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

## [Unreleased]

### Added

- Add back the `endowment:assets` permission for the Bitcoin scopes to the snap manifest, with no-op `onAssetsLookup`, `onAssetsConversion`, `onAssetHistoricalPrice`, and `onAssetsMarketData` entry points required to keep the permission ([#274](https://github.com/MetaMask/internal-snaps/pull/274))

### Changed

- **BREAKING** Bump `@metamask/keyring-api` from `^23.7.0` to `^24.1.0` ([#214](https://github.com/MetaMask/internal-snaps/pull/214))
Expand Down
11 changes: 10 additions & 1 deletion packages/bitcoin-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": "aFQ3IzhV1Uq960fx3NsYY0RhOmZiB+KVOvkvBFvcMPQ=",
"shasum": "Pd1NN2k0m87Txbpt+rzuEjoUWWynDerzz4qR4Wto+nc=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down Expand Up @@ -87,6 +87,15 @@
}
}
]
},
"endowment:assets": {
"scopes": [
"bip122:000000000019d6689c085ae165831e93",
"bip122:000000000933ea01ad0ee984209779ba",
"bip122:00000000da84f2bafbbc53dee25a72ae",
"bip122:00000008819873e925422c1ff0f99f7c",
"bip122:regtest"
]
}
},
"platformVersion": "12.0.1",
Expand Down
19 changes: 19 additions & 0 deletions packages/bitcoin-wallet-snap/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { handleKeyringRequest } from '@metamask/keyring-snap-sdk/v2';
import type {
OnAssetHistoricalPriceHandler,
OnAssetsConversionHandler,
OnAssetsLookupHandler,
OnAssetsMarketDataHandler,
OnCronjobHandler,
OnKeyringRequestHandler,
OnUserInputHandler,
Expand Down Expand Up @@ -113,3 +117,18 @@ export const onUserInput: OnUserInputHandler = async ({ id, event, context }) =>

export const onActive: OnActiveHandler = async () =>
middleware.handle(async () => cronHandler.synchronizeAccounts());

export const onAssetsLookup: OnAssetsLookupHandler = async () => ({
assets: {},
});

export const onAssetsConversion: OnAssetsConversionHandler = async () => ({
conversionRates: {},
});

export const onAssetHistoricalPrice: OnAssetHistoricalPriceHandler = async () =>
null;

export const onAssetsMarketData: OnAssetsMarketDataHandler = async () => ({
marketData: {},
});
4 changes: 4 additions & 0 deletions packages/solana-wallet-snap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add back the `endowment:assets` permission for the Solana scopes to the snap manifest, with no-op `onAssetsLookup`, `onAssetsConversion`, `onAssetHistoricalPrice`, and `onAssetsMarketData` entry points required to keep the permission ([#274](https://github.com/MetaMask/internal-snaps/pull/274))

### Changed

- Migrate `trackError` and `withCatchAndThrowSnapError` to `@metamask/snap-networks-utils` `createSnapErrorHandling`, and add `getSnapProvider` for Snap RPC access
Expand Down
8 changes: 7 additions & 1 deletion 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": "5XRlmv4jiAX3IKwm1vWkTlTRvieyZ4yBBgbQvDbXMQc=",
"shasum": "3XId1IkqlIty92kiBLHbDxIv1RY8AnZiGvOiTOnTaJI=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down Expand Up @@ -72,6 +72,12 @@
}
}
},
"endowment:assets": {
"scopes": [
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"
]
},
"endowment:name-lookup": {
"chains": [
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
Expand Down
19 changes: 19 additions & 0 deletions packages/solana-wallet-snap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { validateOrigin } from '@metamask/snap-networks-utils';
import { MethodNotFoundError } from '@metamask/snaps-sdk';
import type {
Json,
OnAssetHistoricalPriceHandler,
OnAssetsConversionHandler,
OnAssetsLookupHandler,
OnAssetsMarketDataHandler,
OnActiveHandler,
OnClientRequestHandler,
OnCronjobHandler,
Expand Down Expand Up @@ -255,3 +259,18 @@ export const onNameLookup: OnNameLookupHandler = async (request) => {
);
return result ?? null;
};

export const onAssetsLookup: OnAssetsLookupHandler = async () => ({
assets: {},
});

export const onAssetsConversion: OnAssetsConversionHandler = async () => ({
conversionRates: {},
});

export const onAssetHistoricalPrice: OnAssetHistoricalPriceHandler = async () =>
null;

export const onAssetsMarketData: OnAssetsMarketDataHandler = async () => ({
marketData: {},
});
5 changes: 4 additions & 1 deletion packages/tron-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": "P5tbNf6ZPq2tMKAaTnr8oVM+C+rBRVYrf8ACLshI01c=",
"shasum": "iF+9rnAdk21FSl4s0l1iE9+oTvqg8mAy987x6FDUTvo=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down Expand Up @@ -60,6 +60,9 @@
}
]
},
"endowment:assets": {
"scopes": ["tron:728126428"]
},
"endowment:messenger": {
"actions": [
"RemoteFeatureFlagController:getState",
Expand Down
19 changes: 19 additions & 0 deletions packages/tron-wallet-snap/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type {
OnAssetHistoricalPriceHandler,
OnAssetsConversionHandler,
OnAssetsLookupHandler,
OnAssetsMarketDataHandler,
OnClientRequestHandler,
OnCronjobHandler,
OnKeyringRequestHandler,
Expand Down Expand Up @@ -38,3 +42,18 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ origin, request }) =>

export const onUserInput: OnUserInputHandler = async (params) =>
withCatchAndThrowSnapError(async () => userInputHandler.handle(params));

export const onAssetsLookup: OnAssetsLookupHandler = async () => ({
assets: {},
});

export const onAssetsConversion: OnAssetsConversionHandler = async () => ({
conversionRates: {},
});

export const onAssetHistoricalPrice: OnAssetHistoricalPriceHandler = async () =>
null;

export const onAssetsMarketData: OnAssetsMarketDataHandler = async () => ({
marketData: {},
});
Loading