UNPKG

@metamask-previews/multichain-network-controller

Version:
61 lines 2.55 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MULTICHAIN_NETWORK_CONTROLLER_METADATA = exports.getDefaultMultichainNetworkControllerState = exports.NETWORKS_METADATA = exports.AVAILABLE_MULTICHAIN_NETWORK_CONFIGURATIONS = exports.SOL_NATIVE_ASSET = exports.BTC_NATIVE_ASSET = void 0; const keyring_api_1 = require("@metamask/keyring-api"); const network_controller_1 = require("@metamask/network-controller"); exports.BTC_NATIVE_ASSET = `${keyring_api_1.BtcScope.Mainnet}/slip44:0`; exports.SOL_NATIVE_ASSET = `${keyring_api_1.SolScope.Mainnet}/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`; /** * Supported networks by the MultichainNetworkController */ exports.AVAILABLE_MULTICHAIN_NETWORK_CONFIGURATIONS = { [keyring_api_1.BtcScope.Mainnet]: { chainId: keyring_api_1.BtcScope.Mainnet, name: 'Bitcoin Mainnet', nativeCurrency: exports.BTC_NATIVE_ASSET, isEvm: false, }, [keyring_api_1.SolScope.Mainnet]: { chainId: keyring_api_1.SolScope.Mainnet, name: 'Solana Mainnet', nativeCurrency: exports.SOL_NATIVE_ASSET, isEvm: false, }, }; /** * Metadata for the supported networks. */ exports.NETWORKS_METADATA = { [keyring_api_1.BtcScope.Mainnet]: { features: [], status: network_controller_1.NetworkStatus.Available, }, [keyring_api_1.SolScope.Mainnet]: { features: [], status: network_controller_1.NetworkStatus.Available, }, }; /** * Default state of the {@link MultichainNetworkController}. * * @returns The default state of the {@link MultichainNetworkController}. */ const getDefaultMultichainNetworkControllerState = () => ({ multichainNetworkConfigurationsByChainId: exports.AVAILABLE_MULTICHAIN_NETWORK_CONFIGURATIONS, selectedMultichainNetworkChainId: keyring_api_1.SolScope.Mainnet, isEvmSelected: true, }); exports.getDefaultMultichainNetworkControllerState = getDefaultMultichainNetworkControllerState; /** * {@link MultichainNetworkController}'s metadata. * * This allows us to choose if fields of the state should be persisted or not * using the `persist` flag; and if they can be sent to Sentry or not, using * the `anonymous` flag. */ exports.MULTICHAIN_NETWORK_CONTROLLER_METADATA = { multichainNetworkConfigurationsByChainId: { persist: true, anonymous: true }, selectedMultichainNetworkChainId: { persist: true, anonymous: true }, isEvmSelected: { persist: true, anonymous: true }, }; //# sourceMappingURL=constants.cjs.map