-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into decoding_e2e
- Loading branch information
Showing
5 changed files
with
84 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { BtcAccountType, SolAccountType } from '@metamask/keyring-api'; | ||
import { BITCOIN_WALLET_SNAP_ID } from '../../lib/accounts/bitcoin-wallet-snap'; | ||
import { SOLANA_WALLET_SNAP_ID } from '../../lib/accounts/solana-wallet-snap'; | ||
|
||
export const MULTICHAIN_ACCOUNT_TYPE_TO_SNAP_ID = { | ||
///: BEGIN:ONLY_INCLUDE_IF(build-flask) | ||
[BtcAccountType.P2wpkh]: BITCOIN_WALLET_SNAP_ID, | ||
///: END:ONLY_INCLUDE_IF | ||
///: BEGIN:ONLY_INCLUDE_IF(solana) | ||
[SolAccountType.DataAccount]: SOLANA_WALLET_SNAP_ID, | ||
///: END:ONLY_INCLUDE_IF | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { SnapId } from '@metamask/snaps-sdk'; | ||
import { BITCOIN_WALLET_SNAP_ID } from './bitcoin-wallet-snap'; | ||
import { SOLANA_WALLET_SNAP_ID } from './solana-wallet-snap'; | ||
|
||
/** | ||
* A constant array that contains the IDs of whitelisted multichain | ||
* wallet Snaps. These Snaps can be used by the extension to implement | ||
* core features (e.g. Send flow). | ||
* | ||
* @constant | ||
* @type {SnapId[]} | ||
*/ | ||
const WHITELISTED_SNAPS = [BITCOIN_WALLET_SNAP_ID, SOLANA_WALLET_SNAP_ID]; | ||
|
||
/** | ||
* Checks if the given Snap ID corresponds to a multichain wallet Snap. | ||
* | ||
* @param id - The ID of the Snap to check. | ||
* @returns True if the Snap ID is in the whitelist, false otherwise. | ||
*/ | ||
export function isMultichainWalletSnap(id: SnapId): boolean { | ||
return WHITELISTED_SNAPS.includes(id); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters