Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"@metamask/snaps-execution-environments": "11.3.0",
"@metamask/snaps-sdk": "12.0.1",
"@metamask/snaps-utils": "12.6.0",
"@solana-name-service/sns-sdk-kit/@solana-program/token": "^0.16.1",
"@stellar/stellar-sdk/axios@npm:1.15.0": "1.18.1",
"@types/react": "18.2.4",
"@types/react-dom": "18.2.4",
Expand Down
3 changes: 2 additions & 1 deletion packages/solana-wallet-snap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- **BREAKING** Update the Solana Name Service integration to SNS SDK v1 and the Kit 6.9-compatible Solana program clients
- **BREAKING:** Bump `@solana/kit` from `^6.9.0` to `^8.3.0` and the `@solana-program/*` clients (`compute-budget` `^0.18.1`, `system` `^0.14.1`, `token` `^0.16.1`, `token-2022` `^0.17.0`) to their Kit 8-compatible versions. ([#303](https://github.com/MetaMask/internal-snaps/pull/303))
- **BREAKING:** Update the Solana Name Service integration to SNS SDK v1 and the Kit 6.9-compatible Solana program clients ([#271](https://github.com/MetaMask/internal-snaps/pull/271))
- Migrate `trackError` and `withCatchAndThrowSnapError` to `@metamask/snap-networks-utils` `createSnapErrorHandling`, and add `getSnapProvider` for Snap RPC access
- Extract Snap-owned assets domain logic into `SnapAssetsAdapter`; `AssetsService` is a thin facade that delegates metadata, market data, fetch, persist, and account asset reads through the adapter (no Core routing yet). ([#121](https://github.com/MetaMask/internal-snaps/pull/121))
- Align `AssetsService` read API with `snap-networks-utils` / AssetsController shapes by adding `getAccountAssetByID`, `getAccountAssetsByIDs`, `getAccountAssetsByScope`, and `getAccountAssets`, and routing Keyring and Send through them (still Snap-owned storage). ([#120](https://github.com/MetaMask/internal-snaps/pull/120))
Expand Down
12 changes: 7 additions & 5 deletions packages/solana-wallet-snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@
"@metamask/utils": "^11.11.0",
"@noble/ed25519": "2.1.0",
"@solana-name-service/sns-sdk-kit": "^1.0.0",
"@solana-program/compute-budget": "^0.15.0",
"@solana-program/system": "^0.12.0",
"@solana-program/token": "^0.14.0",
"@solana-program/token-2022": "^0.12.0",
"@solana/kit": "^6.9.0",
"@solana-program/compute-budget": "^0.18.1",
"@solana-program/system": "^0.14.1",
"@solana-program/token": "^0.16.1",
"@solana-program/token-2022": "^0.17.0",
"@solana/kit": "^8.3.0",
"@solana/sysvars": "^8.3.0",
"@solana/zk-sdk": "^0.5.2",
"@testing-library/jest-dom": "^6.6.2",
"@types/express": "^5.0.0",
"@types/lodash": "^4.17.15",
Expand Down
1 change: 1 addition & 0 deletions packages/solana-wallet-snap/src/core/constants/solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const LAMPORTS_PER_SOL = 1_000_000_000;
export const DEFAULT_NETWORK_BLOCK_EXPLORER_URL = 'https://solscan.io';
export const METAMASK_ORIGIN = 'metamask';
export const METAMASK_ORIGIN_URL = 'https://metamask.io';
export const MAX_SUPPORTED_TRANSACTION_VERSION = 1;

/**
* Solana CAIP-2 Networks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ describe('TokenHelper', () => {
'1000',
);

expect(amount).toBe(995847000n);
expect(amount).toBe(995847001n);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this change necessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TokenHelper.test.ts:167 — expected interest-bearing conversion 995847000n → 995847001n. Upstream token-2022 0.17 changed the final rounding (rounds up instead of flooring). Note this is still a behavioral change users could see: interest-bearing balances can now differ by 1 raw unit after conversion.

});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { get, groupBy } from 'lodash';

import type { AssetEntity } from '../../../entities';
import type { SolanaKeyringAccount } from '../../../entities/keyring-account';
import { MAX_SUPPORTED_TRANSACTION_VERSION } from '../../constants/solana';
import type { Network } from '../../constants/solana';
import type { SolanaTransaction } from '../../types/solana';
import { trackError } from '../../utils/errors';
Expand Down Expand Up @@ -52,7 +53,7 @@ export class TransactionsService {
.getRpc(scope)
.getTransaction(asSignature(signature), {
encoding: 'json',
maxSupportedTransactionVersion: 0,
maxSupportedTransactionVersion: MAX_SUPPORTED_TRANSACTION_VERSION,
})
.send();

Expand Down Expand Up @@ -184,7 +185,7 @@ export class TransactionsService {
.getRpc(asset.network)
.getTransaction(asSignature(signatureResponse.signature), {
encoding: 'json',
maxSupportedTransactionVersion: 0,
maxSupportedTransactionVersion: MAX_SUPPORTED_TRANSACTION_VERSION,
})
.send();
return {
Expand Down
Loading