Skip to content
Draft
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
4 changes: 2 additions & 2 deletions packages/solana-wallet-snap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Route Solana fungible asset reads through AssetsController migration stages (`Off`, `ReadAssetsControllerWithFallback`, `ReadAssetsControllerOnly`), mapping controller assets via `mapControllerAsset` while Snap-owned NFT assets always use `SnapAssetsAdapter`. Gate fungible tracking in `fetch`/`save`/`saveMany` and account monitors via `shouldTrackSnapAssets`.
- Wire Core messenger plumbing (`endowment:messenger`, `AssetsProvider`, `RemoteFeatureFlagsProvider`) into the Solana snap.
- Hardcode Solana fungible asset reads through `AssetsProvider` / `mapControllerAsset` (no migration-stage or remote feature-flag routing). Disable Snap fungible tracking in `fetch`/`save`/`saveMany` and account sync; Snap-owned NFT assets still use `SnapAssetsAdapter`.
- Wire Core messenger plumbing (`endowment:messenger`, `AssetsProvider`) into the Solana snap.
- Extract Snap-owned balance fetch/persist/read logic into `SnapAssetsAdapter`; `AssetsService` delegates account asset reads and saves 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 `getAccountAssetsForAllActiveScopes`, and routing Keyring, Send, send render, and `refreshSend` through them (still Snap-owned storage). ([#120](https://github.com/MetaMask/internal-snaps/pull/120))
- This package was migrated from [snap-solana-wallet](https://github.com/MetaMask/snap-solana-wallet). See the source repository for the original [changelog](https://github.com/MetaMask/snap-solana-wallet/blob/main/packages/snap/CHANGELOG.md). ([#72](https://github.com/MetaMask/internal-snaps/pull/72))
Expand Down
1 change: 0 additions & 1 deletion packages/solana-wallet-snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"@metamask/keyring-api": "^23.7.0",
"@metamask/keyring-snap-sdk": "^9.2.1",
"@metamask/messenger": "^2.0.0",
"@metamask/remote-feature-flag-controller": "^5.0.0",
"@metamask/snap-networks-utils": "workspace:^",
"@metamask/snaps-cli": "^8.4.1",
"@metamask/snaps-jest": "^10.2.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/solana-wallet-snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/internal-snaps.git"
},
"source": {
"shasum": "5UbMR/XOp/xr10ccku+kJxErgd1zptASqMx4tavLCL8=",
"shasum": "8pC/CUT1b2BVxIsPy6IWJQ8SMrFeW13nBhWeWKriNUs=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down Expand Up @@ -91,7 +91,6 @@
"snap_getPreferences": {},
"endowment:messenger": {
"actions": [
"RemoteFeatureFlagController:getState",
"AssetsController:getAccountAssetByID",
"AssetsController:getAccountAssetsByIDs",
"AssetsController:getAccountAssetsByScope"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,9 @@ export class AccountsSynchronizer {

const assets = (
await Promise.allSettled(
accountsToSync.map(async (account) => {
if (
await this.#assetsService.shouldTrackSnapAssetsForAccount(
account.id,
)
) {
const fetchedAssets = await this.#assetsService.fetch(account);
await this.#assetsService.saveMany(fetchedAssets);
return fetchedAssets;
}

return this.#assetsService.getAccountAssetsForAllActiveScopes(
account.id,
);
}),
accountsToSync.map(async (account) =>
this.#assetsService.getAccountAssetsForAllActiveScopes(account.id),
),
)
)
.map((item) => (item.status === 'fulfilled' ? item.value : []))
Expand Down
Loading
Loading