@metamask-previews/controller-utils 11.2.0-preview-9edcf0e0 → 11.2.0-preview-cf09c0a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants.cjs +138 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/{types/constants.d.ts → constants.d.cts} +2 -2
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.mts +117 -0
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.mjs +133 -54
- package/dist/constants.mjs.map +1 -1
- package/dist/index.cjs +48 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{types/index.d.ts → index.d.cts} +6 -6
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +4 -137
- package/dist/index.mjs.map +1 -1
- package/dist/logger.cjs +7 -0
- package/dist/logger.cjs.map +1 -0
- package/dist/{types/logger.d.ts → logger.d.cts} +2 -2
- package/dist/logger.d.cts.map +1 -0
- package/dist/logger.d.mts +5 -0
- package/dist/logger.d.mts.map +1 -0
- package/dist/logger.mjs +3 -8
- package/dist/logger.mjs.map +1 -1
- package/dist/siwe.cjs +128 -0
- package/dist/siwe.cjs.map +1 -0
- package/dist/{types/siwe.d.ts → siwe.d.cts} +2 -2
- package/dist/siwe.d.cts.map +1 -0
- package/dist/siwe.d.mts +68 -0
- package/dist/siwe.d.mts.map +1 -0
- package/dist/siwe.mjs +120 -10
- package/dist/siwe.mjs.map +1 -1
- package/dist/types.cjs +107 -0
- package/dist/types.cjs.map +1 -0
- package/dist/{types/types.d.ts → types.d.cts} +1 -1
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +132 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +100 -21
- package/dist/types.mjs.map +1 -1
- package/dist/util.cjs +512 -0
- package/dist/util.cjs.map +1 -0
- package/dist/{types/util.d.ts → util.d.cts} +4 -4
- package/dist/util.d.cts.map +1 -0
- package/dist/util.d.mts +243 -0
- package/dist/util.d.mts.map +1 -0
- package/dist/util.mjs +488 -59
- package/dist/util.mjs.map +1 -1
- package/package.json +12 -7
- package/dist/chunk-2DKE2P5J.mjs +0 -306
- package/dist/chunk-2DKE2P5J.mjs.map +0 -1
- package/dist/chunk-6LGAYF2M.mjs +0 -147
- package/dist/chunk-6LGAYF2M.mjs.map +0 -1
- package/dist/chunk-CQMU5S2P.mjs +0 -85
- package/dist/chunk-CQMU5S2P.mjs.map +0 -1
- package/dist/chunk-DBJSLKNR.js +0 -9
- package/dist/chunk-DBJSLKNR.js.map +0 -1
- package/dist/chunk-M6G3ISXG.js +0 -86
- package/dist/chunk-M6G3ISXG.js.map +0 -1
- package/dist/chunk-MG6F6B4L.js +0 -147
- package/dist/chunk-MG6F6B4L.js.map +0 -1
- package/dist/chunk-RZFCNKW4.mjs +0 -9
- package/dist/chunk-RZFCNKW4.mjs.map +0 -1
- package/dist/chunk-SAQIILOG.js +0 -306
- package/dist/chunk-SAQIILOG.js.map +0 -1
- package/dist/chunk-VDEIYYE4.mjs +0 -86
- package/dist/chunk-VDEIYYE4.mjs.map +0 -1
- package/dist/chunk-XH4YXW3J.js +0 -85
- package/dist/chunk-XH4YXW3J.js.map +0 -1
- package/dist/constants.js +0 -56
- package/dist/constants.js.map +0 -1
- package/dist/index.js +0 -138
- package/dist/index.js.map +0 -1
- package/dist/logger.js +0 -9
- package/dist/logger.js.map +0 -1
- package/dist/siwe.js +0 -12
- package/dist/siwe.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/logger.d.ts.map +0 -1
- package/dist/types/siwe.d.ts.map +0 -1
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/util.d.ts.map +0 -1
- package/dist/types.js +0 -23
- package/dist/types.js.map +0 -1
- package/dist/util.js +0 -61
- package/dist/util.js.map +0 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP = exports.ApprovalType = exports.ORIGIN_METAMASK = exports.NFT_API_TIMEOUT = exports.NFT_API_VERSION = exports.NFT_API_BASE_URL = exports.OPENSEA_PROXY_URL = exports.BUILT_IN_NETWORKS = exports.TESTNET_TICKER_SYMBOLS = exports.ASSET_TYPES = exports.GWEI = exports.ERC1155_TOKEN_RECEIVER_INTERFACE_ID = exports.ERC1155_METADATA_URI_INTERFACE_ID = exports.ERC1155_INTERFACE_ID = exports.ERC721_ENUMERABLE_INTERFACE_ID = exports.ERC721_METADATA_INTERFACE_ID = exports.ERC721_INTERFACE_ID = exports.ERC20 = exports.ERC1155 = exports.ERC721 = exports.MAX_SAFE_CHAIN_ID = exports.GANACHE_CHAIN_ID = exports.IPFS_DEFAULT_GATEWAY_URL = exports.FALL_BACK_VS_CURRENCY = exports.RPC = void 0;
|
|
4
|
+
const types_1 = require("./types.cjs");
|
|
5
|
+
exports.RPC = 'rpc';
|
|
6
|
+
exports.FALL_BACK_VS_CURRENCY = 'ETH';
|
|
7
|
+
exports.IPFS_DEFAULT_GATEWAY_URL = 'https://cloudflare-ipfs.com/ipfs/';
|
|
8
|
+
// NETWORKS ID
|
|
9
|
+
// `toHex` not invoked to avoid cyclic dependency
|
|
10
|
+
exports.GANACHE_CHAIN_ID = '0x539'; // toHex(1337)
|
|
11
|
+
/**
|
|
12
|
+
* The largest possible chain ID we can handle.
|
|
13
|
+
* Explanation: https://gist.github.com/rekmarks/a47bd5f2525936c4b8eee31a16345553
|
|
14
|
+
*/
|
|
15
|
+
exports.MAX_SAFE_CHAIN_ID = 4503599627370476;
|
|
16
|
+
// TOKEN STANDARDS
|
|
17
|
+
exports.ERC721 = 'ERC721';
|
|
18
|
+
exports.ERC1155 = 'ERC1155';
|
|
19
|
+
exports.ERC20 = 'ERC20';
|
|
20
|
+
// TOKEN INTERFACE IDS
|
|
21
|
+
exports.ERC721_INTERFACE_ID = '0x80ac58cd';
|
|
22
|
+
exports.ERC721_METADATA_INTERFACE_ID = '0x5b5e139f';
|
|
23
|
+
exports.ERC721_ENUMERABLE_INTERFACE_ID = '0x780e9d63';
|
|
24
|
+
exports.ERC1155_INTERFACE_ID = '0xd9b67a26';
|
|
25
|
+
exports.ERC1155_METADATA_URI_INTERFACE_ID = '0x0e89341c';
|
|
26
|
+
exports.ERC1155_TOKEN_RECEIVER_INTERFACE_ID = '0x4e2312e0';
|
|
27
|
+
// UNITS
|
|
28
|
+
exports.GWEI = 'gwei';
|
|
29
|
+
// ASSET TYPES
|
|
30
|
+
exports.ASSET_TYPES = {
|
|
31
|
+
NATIVE: 'NATIVE',
|
|
32
|
+
TOKEN: 'TOKEN',
|
|
33
|
+
NFT: 'NFT',
|
|
34
|
+
UNKNOWN: 'UNKNOWN',
|
|
35
|
+
};
|
|
36
|
+
// TICKER SYMBOLS
|
|
37
|
+
exports.TESTNET_TICKER_SYMBOLS = {
|
|
38
|
+
GOERLI: 'GoerliETH',
|
|
39
|
+
SEPOLIA: 'SepoliaETH',
|
|
40
|
+
LINEA_GOERLI: 'LineaETH',
|
|
41
|
+
LINEA_SEPOLIA: 'LineaETH',
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Map of all build-in Infura networks to their network, ticker and chain IDs.
|
|
45
|
+
*/
|
|
46
|
+
exports.BUILT_IN_NETWORKS = {
|
|
47
|
+
[types_1.NetworkType.goerli]: {
|
|
48
|
+
chainId: types_1.ChainId.goerli,
|
|
49
|
+
ticker: types_1.NetworksTicker.goerli,
|
|
50
|
+
rpcPrefs: {
|
|
51
|
+
blockExplorerUrl: `https://${types_1.NetworkType.goerli}.etherscan.io`,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
[types_1.NetworkType.sepolia]: {
|
|
55
|
+
chainId: types_1.ChainId.sepolia,
|
|
56
|
+
ticker: types_1.NetworksTicker.sepolia,
|
|
57
|
+
rpcPrefs: {
|
|
58
|
+
blockExplorerUrl: `https://${types_1.NetworkType.sepolia}.etherscan.io`,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
[types_1.NetworkType.mainnet]: {
|
|
62
|
+
chainId: types_1.ChainId.mainnet,
|
|
63
|
+
ticker: types_1.NetworksTicker.mainnet,
|
|
64
|
+
rpcPrefs: {
|
|
65
|
+
blockExplorerUrl: 'https://etherscan.io',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
[types_1.NetworkType['linea-goerli']]: {
|
|
69
|
+
chainId: types_1.ChainId['linea-goerli'],
|
|
70
|
+
ticker: types_1.NetworksTicker['linea-goerli'],
|
|
71
|
+
rpcPrefs: {
|
|
72
|
+
blockExplorerUrl: 'https://goerli.lineascan.build',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
[types_1.NetworkType['linea-sepolia']]: {
|
|
76
|
+
chainId: types_1.ChainId['linea-sepolia'],
|
|
77
|
+
ticker: types_1.NetworksTicker['linea-sepolia'],
|
|
78
|
+
rpcPrefs: {
|
|
79
|
+
blockExplorerUrl: 'https://sepolia.lineascan.build',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
[types_1.NetworkType['linea-mainnet']]: {
|
|
83
|
+
chainId: types_1.ChainId['linea-mainnet'],
|
|
84
|
+
ticker: types_1.NetworksTicker['linea-mainnet'],
|
|
85
|
+
rpcPrefs: {
|
|
86
|
+
blockExplorerUrl: 'https://lineascan.build',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
[types_1.NetworkType.rpc]: {
|
|
90
|
+
chainId: undefined,
|
|
91
|
+
blockExplorerUrl: undefined,
|
|
92
|
+
ticker: undefined,
|
|
93
|
+
rpcPrefs: undefined,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
// APIs
|
|
97
|
+
exports.OPENSEA_PROXY_URL = 'https://proxy.api.cx.metamask.io/opensea/v1/api/v2';
|
|
98
|
+
exports.NFT_API_BASE_URL = 'https://nft.api.cx.metamask.io';
|
|
99
|
+
exports.NFT_API_VERSION = '1';
|
|
100
|
+
exports.NFT_API_TIMEOUT = 15000;
|
|
101
|
+
// Default origin for controllers
|
|
102
|
+
exports.ORIGIN_METAMASK = 'metamask';
|
|
103
|
+
/**
|
|
104
|
+
* Approval request types for various operations.
|
|
105
|
+
* These types are used by different controllers to create and manage
|
|
106
|
+
* approval requests consistently.
|
|
107
|
+
*/
|
|
108
|
+
var ApprovalType;
|
|
109
|
+
(function (ApprovalType) {
|
|
110
|
+
ApprovalType["AddEthereumChain"] = "wallet_addEthereumChain";
|
|
111
|
+
ApprovalType["ConnectAccounts"] = "connect_accounts";
|
|
112
|
+
ApprovalType["EthDecrypt"] = "eth_decrypt";
|
|
113
|
+
ApprovalType["EthGetEncryptionPublicKey"] = "eth_getEncryptionPublicKey";
|
|
114
|
+
ApprovalType["EthSignTypedData"] = "eth_signTypedData";
|
|
115
|
+
ApprovalType["PersonalSign"] = "personal_sign";
|
|
116
|
+
ApprovalType["ResultError"] = "result_error";
|
|
117
|
+
ApprovalType["ResultSuccess"] = "result_success";
|
|
118
|
+
ApprovalType["SnapDialogAlert"] = "snap_dialog:alert";
|
|
119
|
+
ApprovalType["SnapDialogConfirmation"] = "snap_dialog:confirmation";
|
|
120
|
+
ApprovalType["SnapDialogPrompt"] = "snap_dialog:prompt";
|
|
121
|
+
ApprovalType["SnapDialogDefault"] = "snap_dialog";
|
|
122
|
+
ApprovalType["SwitchEthereumChain"] = "wallet_switchEthereumChain";
|
|
123
|
+
ApprovalType["Transaction"] = "transaction";
|
|
124
|
+
ApprovalType["Unlock"] = "unlock";
|
|
125
|
+
ApprovalType["WalletConnect"] = "wallet_connect";
|
|
126
|
+
ApprovalType["WalletRequestPermissions"] = "wallet_requestPermissions";
|
|
127
|
+
ApprovalType["WatchAsset"] = "wallet_watchAsset";
|
|
128
|
+
})(ApprovalType || (exports.ApprovalType = ApprovalType = {}));
|
|
129
|
+
exports.CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP = {
|
|
130
|
+
[types_1.ChainId.goerli]: types_1.BuiltInNetworkName.Goerli,
|
|
131
|
+
[types_1.ChainId.sepolia]: types_1.BuiltInNetworkName.Sepolia,
|
|
132
|
+
[types_1.ChainId.mainnet]: types_1.BuiltInNetworkName.Mainnet,
|
|
133
|
+
[types_1.ChainId['linea-goerli']]: types_1.BuiltInNetworkName.LineaGoerli,
|
|
134
|
+
[types_1.ChainId['linea-sepolia']]: types_1.BuiltInNetworkName.LineaSepolia,
|
|
135
|
+
[types_1.ChainId['linea-mainnet']]: types_1.BuiltInNetworkName.LineaMainnet,
|
|
136
|
+
[types_1.ChainId.aurora]: types_1.BuiltInNetworkName.Aurora,
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=constants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,uCAKiB;AAEJ,QAAA,GAAG,GAAG,KAAK,CAAC;AACZ,QAAA,qBAAqB,GAAG,KAAK,CAAC;AAC9B,QAAA,wBAAwB,GAAG,mCAAmC,CAAC;AAE5E,cAAc;AACd,iDAAiD;AACpC,QAAA,gBAAgB,GAAG,OAAO,CAAC,CAAC,cAAc;AACvD;;;GAGG;AACU,QAAA,iBAAiB,GAAG,gBAAgB,CAAC;AAElD,kBAAkB;AACL,QAAA,MAAM,GAAG,QAAQ,CAAC;AAClB,QAAA,OAAO,GAAG,SAAS,CAAC;AACpB,QAAA,KAAK,GAAG,OAAO,CAAC;AAE7B,sBAAsB;AACT,QAAA,mBAAmB,GAAG,YAAY,CAAC;AACnC,QAAA,4BAA4B,GAAG,YAAY,CAAC;AAC5C,QAAA,8BAA8B,GAAG,YAAY,CAAC;AAC9C,QAAA,oBAAoB,GAAG,YAAY,CAAC;AACpC,QAAA,iCAAiC,GAAG,YAAY,CAAC;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C,eAAO,CAAC,MAAM,CAAC,EAAE,0BAAkB,CAAC,MAAM;IAC3C,CAAC,eAAO,CAAC,OAAO,CAAC,EAAE,0BAAkB,CAAC,OAAO;IAC7C,CAAC,eAAO,CAAC,OAAO,CAAC,EAAE,0BAAkB,CAAC,OAAO;IAC7C,CAAC,eAAO,CAAC,cAAc,CAAC,CAAC,EAAE,0BAAkB,CAAC,WAAW;IACzD,CAAC,eAAO,CAAC,eAAe,CAAC,CAAC,EAAE,0BAAkB,CAAC,YAAY;IAC3D,CAAC,eAAO,CAAC,eAAe,CAAC,CAAC,EAAE,0BAAkB,CAAC,YAAY;IAC3D,CAAC,eAAO,CAAC,MAAM,CAAC,EAAE,0BAAkB,CAAC,MAAM;CAC5C,CAAC","sourcesContent":["import {\n NetworkType,\n NetworksTicker,\n ChainId,\n BuiltInNetworkName,\n} from './types';\n\nexport const RPC = 'rpc';\nexport const FALL_BACK_VS_CURRENCY = 'ETH';\nexport const IPFS_DEFAULT_GATEWAY_URL = 'https://cloudflare-ipfs.com/ipfs/';\n\n// NETWORKS ID\n// `toHex` not invoked to avoid cyclic dependency\nexport const GANACHE_CHAIN_ID = '0x539'; // toHex(1337)\n/**\n * The largest possible chain ID we can handle.\n * Explanation: https://gist.github.com/rekmarks/a47bd5f2525936c4b8eee31a16345553\n */\nexport const MAX_SAFE_CHAIN_ID = 4503599627370476;\n\n// TOKEN STANDARDS\nexport const ERC721 = 'ERC721';\nexport const ERC1155 = 'ERC1155';\nexport const ERC20 = 'ERC20';\n\n// TOKEN INTERFACE IDS\nexport const ERC721_INTERFACE_ID = '0x80ac58cd';\nexport const ERC721_METADATA_INTERFACE_ID = '0x5b5e139f';\nexport const ERC721_ENUMERABLE_INTERFACE_ID = '0x780e9d63';\nexport const ERC1155_INTERFACE_ID = '0xd9b67a26';\nexport const ERC1155_METADATA_URI_INTERFACE_ID = '0x0e89341c';\nexport const ERC1155_TOKEN_RECEIVER_INTERFACE_ID = '0x4e2312e0';\n\n// UNITS\nexport const GWEI = 'gwei';\n\n// ASSET TYPES\nexport const ASSET_TYPES = {\n NATIVE: 'NATIVE',\n TOKEN: 'TOKEN',\n NFT: 'NFT',\n UNKNOWN: 'UNKNOWN',\n};\n\n// TICKER SYMBOLS\nexport const TESTNET_TICKER_SYMBOLS = {\n GOERLI: 'GoerliETH',\n SEPOLIA: 'SepoliaETH',\n LINEA_GOERLI: 'LineaETH',\n LINEA_SEPOLIA: 'LineaETH',\n};\n\n/**\n * Map of all build-in Infura networks to their network, ticker and chain IDs.\n */\nexport const BUILT_IN_NETWORKS = {\n [NetworkType.goerli]: {\n chainId: ChainId.goerli,\n ticker: NetworksTicker.goerli,\n rpcPrefs: {\n blockExplorerUrl: `https://${NetworkType.goerli}.etherscan.io`,\n },\n },\n [NetworkType.sepolia]: {\n chainId: ChainId.sepolia,\n ticker: NetworksTicker.sepolia,\n rpcPrefs: {\n blockExplorerUrl: `https://${NetworkType.sepolia}.etherscan.io`,\n },\n },\n [NetworkType.mainnet]: {\n chainId: ChainId.mainnet,\n ticker: NetworksTicker.mainnet,\n rpcPrefs: {\n blockExplorerUrl: 'https://etherscan.io',\n },\n },\n [NetworkType['linea-goerli']]: {\n chainId: ChainId['linea-goerli'],\n ticker: NetworksTicker['linea-goerli'],\n rpcPrefs: {\n blockExplorerUrl: 'https://goerli.lineascan.build',\n },\n },\n [NetworkType['linea-sepolia']]: {\n chainId: ChainId['linea-sepolia'],\n ticker: NetworksTicker['linea-sepolia'],\n rpcPrefs: {\n blockExplorerUrl: 'https://sepolia.lineascan.build',\n },\n },\n [NetworkType['linea-mainnet']]: {\n chainId: ChainId['linea-mainnet'],\n ticker: NetworksTicker['linea-mainnet'],\n rpcPrefs: {\n blockExplorerUrl: 'https://lineascan.build',\n },\n },\n [NetworkType.rpc]: {\n chainId: undefined,\n blockExplorerUrl: undefined,\n ticker: undefined,\n rpcPrefs: undefined,\n },\n} as const;\n\n// APIs\nexport const OPENSEA_PROXY_URL =\n 'https://proxy.api.cx.metamask.io/opensea/v1/api/v2';\n\nexport const NFT_API_BASE_URL = 'https://nft.api.cx.metamask.io';\n\nexport const NFT_API_VERSION = '1';\n\nexport const NFT_API_TIMEOUT = 15000;\n\n// Default origin for controllers\nexport const ORIGIN_METAMASK = 'metamask';\n\n/**\n * Approval request types for various operations.\n * These types are used by different controllers to create and manage\n * approval requests consistently.\n */\nexport enum ApprovalType {\n AddEthereumChain = 'wallet_addEthereumChain',\n ConnectAccounts = 'connect_accounts',\n EthDecrypt = 'eth_decrypt',\n EthGetEncryptionPublicKey = 'eth_getEncryptionPublicKey',\n EthSignTypedData = 'eth_signTypedData',\n PersonalSign = 'personal_sign',\n ResultError = 'result_error',\n ResultSuccess = 'result_success',\n SnapDialogAlert = 'snap_dialog:alert',\n SnapDialogConfirmation = 'snap_dialog:confirmation',\n SnapDialogPrompt = 'snap_dialog:prompt',\n SnapDialogDefault = 'snap_dialog',\n SwitchEthereumChain = 'wallet_switchEthereumChain',\n Transaction = 'transaction',\n Unlock = 'unlock',\n WalletConnect = 'wallet_connect',\n WalletRequestPermissions = 'wallet_requestPermissions',\n WatchAsset = 'wallet_watchAsset',\n}\n\nexport const CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP: Record<\n ChainId,\n BuiltInNetworkName\n> = {\n [ChainId.goerli]: BuiltInNetworkName.Goerli,\n [ChainId.sepolia]: BuiltInNetworkName.Sepolia,\n [ChainId.mainnet]: BuiltInNetworkName.Mainnet,\n [ChainId['linea-goerli']]: BuiltInNetworkName.LineaGoerli,\n [ChainId['linea-sepolia']]: BuiltInNetworkName.LineaSepolia,\n [ChainId['linea-mainnet']]: BuiltInNetworkName.LineaMainnet,\n [ChainId.aurora]: BuiltInNetworkName.Aurora,\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NetworksTicker, ChainId, BuiltInNetworkName } from
|
|
1
|
+
import { NetworksTicker, ChainId, BuiltInNetworkName } from "./types.cjs";
|
|
2
2
|
export declare const RPC = "rpc";
|
|
3
3
|
export declare const FALL_BACK_VS_CURRENCY = "ETH";
|
|
4
4
|
export declare const IPFS_DEFAULT_GATEWAY_URL = "https://cloudflare-ipfs.com/ipfs/";
|
|
@@ -114,4 +114,4 @@ export declare enum ApprovalType {
|
|
|
114
114
|
WatchAsset = "wallet_watchAsset"
|
|
115
115
|
}
|
|
116
116
|
export declare const CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP: Record<ChainId, BuiltInNetworkName>;
|
|
117
|
-
//# sourceMappingURL=constants.d.
|
|
117
|
+
//# sourceMappingURL=constants.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,OAAO,EACP,kBAAkB,EACnB,oBAAgB;AAEjB,eAAO,MAAM,GAAG,QAAQ,CAAC;AACzB,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAC3C,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAI5E,eAAO,MAAM,gBAAgB,UAAU,CAAC;AACxC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAGlD,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,KAAK,UAAU,CAAC;AAG7B,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAChD,eAAO,MAAM,4BAA4B,eAAe,CAAC;AACzD,eAAO,MAAM,8BAA8B,eAAe,CAAC;AAC3D,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,iCAAiC,eAAe,CAAC;AAC9D,eAAO,MAAM,mCAAmC,eAAe,CAAC;AAGhE,eAAO,MAAM,IAAI,SAAS,CAAC;AAG3B,eAAO,MAAM,WAAW;;;;;CAKvB,CAAC;AAGF,eAAO,MAAM,sBAAsB;;;;;CAKlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDpB,CAAC;AAGX,eAAO,MAAM,iBAAiB,uDACwB,CAAC;AAEvD,eAAO,MAAM,gBAAgB,mCAAmC,CAAC;AAEjE,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,eAAO,MAAM,eAAe,QAAQ,CAAC;AAGrC,eAAO,MAAM,eAAe,aAAa,CAAC;AAE1C;;;;GAIG;AACH,oBAAY,YAAY;IACtB,gBAAgB,4BAA4B;IAC5C,eAAe,qBAAqB;IACpC,UAAU,gBAAgB;IAC1B,yBAAyB,+BAA+B;IACxD,gBAAgB,sBAAsB;IACtC,YAAY,kBAAkB;IAC9B,WAAW,iBAAiB;IAC5B,aAAa,mBAAmB;IAChC,eAAe,sBAAsB;IACrC,sBAAsB,6BAA6B;IACnD,gBAAgB,uBAAuB;IACvC,iBAAiB,gBAAgB;IACjC,mBAAmB,+BAA+B;IAClD,WAAW,gBAAgB;IAC3B,MAAM,WAAW;IACjB,aAAa,mBAAmB;IAChC,wBAAwB,8BAA8B;IACtD,UAAU,sBAAsB;CACjC;AAED,eAAO,MAAM,mCAAmC,EAAE,MAAM,CACtD,OAAO,EACP,kBAAkB,CASnB,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { NetworksTicker, ChainId, BuiltInNetworkName } from "./types.mjs";
|
|
2
|
+
export declare const RPC = "rpc";
|
|
3
|
+
export declare const FALL_BACK_VS_CURRENCY = "ETH";
|
|
4
|
+
export declare const IPFS_DEFAULT_GATEWAY_URL = "https://cloudflare-ipfs.com/ipfs/";
|
|
5
|
+
export declare const GANACHE_CHAIN_ID = "0x539";
|
|
6
|
+
/**
|
|
7
|
+
* The largest possible chain ID we can handle.
|
|
8
|
+
* Explanation: https://gist.github.com/rekmarks/a47bd5f2525936c4b8eee31a16345553
|
|
9
|
+
*/
|
|
10
|
+
export declare const MAX_SAFE_CHAIN_ID = 4503599627370476;
|
|
11
|
+
export declare const ERC721 = "ERC721";
|
|
12
|
+
export declare const ERC1155 = "ERC1155";
|
|
13
|
+
export declare const ERC20 = "ERC20";
|
|
14
|
+
export declare const ERC721_INTERFACE_ID = "0x80ac58cd";
|
|
15
|
+
export declare const ERC721_METADATA_INTERFACE_ID = "0x5b5e139f";
|
|
16
|
+
export declare const ERC721_ENUMERABLE_INTERFACE_ID = "0x780e9d63";
|
|
17
|
+
export declare const ERC1155_INTERFACE_ID = "0xd9b67a26";
|
|
18
|
+
export declare const ERC1155_METADATA_URI_INTERFACE_ID = "0x0e89341c";
|
|
19
|
+
export declare const ERC1155_TOKEN_RECEIVER_INTERFACE_ID = "0x4e2312e0";
|
|
20
|
+
export declare const GWEI = "gwei";
|
|
21
|
+
export declare const ASSET_TYPES: {
|
|
22
|
+
NATIVE: string;
|
|
23
|
+
TOKEN: string;
|
|
24
|
+
NFT: string;
|
|
25
|
+
UNKNOWN: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const TESTNET_TICKER_SYMBOLS: {
|
|
28
|
+
GOERLI: string;
|
|
29
|
+
SEPOLIA: string;
|
|
30
|
+
LINEA_GOERLI: string;
|
|
31
|
+
LINEA_SEPOLIA: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Map of all build-in Infura networks to their network, ticker and chain IDs.
|
|
35
|
+
*/
|
|
36
|
+
export declare const BUILT_IN_NETWORKS: {
|
|
37
|
+
readonly goerli: {
|
|
38
|
+
readonly chainId: "0x5";
|
|
39
|
+
readonly ticker: NetworksTicker.goerli;
|
|
40
|
+
readonly rpcPrefs: {
|
|
41
|
+
readonly blockExplorerUrl: "https://goerli.etherscan.io";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
readonly sepolia: {
|
|
45
|
+
readonly chainId: "0xaa36a7";
|
|
46
|
+
readonly ticker: NetworksTicker.sepolia;
|
|
47
|
+
readonly rpcPrefs: {
|
|
48
|
+
readonly blockExplorerUrl: "https://sepolia.etherscan.io";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly mainnet: {
|
|
52
|
+
readonly chainId: "0x1";
|
|
53
|
+
readonly ticker: NetworksTicker.mainnet;
|
|
54
|
+
readonly rpcPrefs: {
|
|
55
|
+
readonly blockExplorerUrl: "https://etherscan.io";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly "linea-goerli": {
|
|
59
|
+
readonly chainId: "0xe704";
|
|
60
|
+
readonly ticker: (typeof NetworksTicker)["linea-goerli"];
|
|
61
|
+
readonly rpcPrefs: {
|
|
62
|
+
readonly blockExplorerUrl: "https://goerli.lineascan.build";
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
readonly "linea-sepolia": {
|
|
66
|
+
readonly chainId: "0xe705";
|
|
67
|
+
readonly ticker: (typeof NetworksTicker)["linea-goerli"];
|
|
68
|
+
readonly rpcPrefs: {
|
|
69
|
+
readonly blockExplorerUrl: "https://sepolia.lineascan.build";
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
readonly "linea-mainnet": {
|
|
73
|
+
readonly chainId: "0xe708";
|
|
74
|
+
readonly ticker: NetworksTicker.mainnet;
|
|
75
|
+
readonly rpcPrefs: {
|
|
76
|
+
readonly blockExplorerUrl: "https://lineascan.build";
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
readonly rpc: {
|
|
80
|
+
readonly chainId: undefined;
|
|
81
|
+
readonly blockExplorerUrl: undefined;
|
|
82
|
+
readonly ticker: undefined;
|
|
83
|
+
readonly rpcPrefs: undefined;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export declare const OPENSEA_PROXY_URL = "https://proxy.api.cx.metamask.io/opensea/v1/api/v2";
|
|
87
|
+
export declare const NFT_API_BASE_URL = "https://nft.api.cx.metamask.io";
|
|
88
|
+
export declare const NFT_API_VERSION = "1";
|
|
89
|
+
export declare const NFT_API_TIMEOUT = 15000;
|
|
90
|
+
export declare const ORIGIN_METAMASK = "metamask";
|
|
91
|
+
/**
|
|
92
|
+
* Approval request types for various operations.
|
|
93
|
+
* These types are used by different controllers to create and manage
|
|
94
|
+
* approval requests consistently.
|
|
95
|
+
*/
|
|
96
|
+
export declare enum ApprovalType {
|
|
97
|
+
AddEthereumChain = "wallet_addEthereumChain",
|
|
98
|
+
ConnectAccounts = "connect_accounts",
|
|
99
|
+
EthDecrypt = "eth_decrypt",
|
|
100
|
+
EthGetEncryptionPublicKey = "eth_getEncryptionPublicKey",
|
|
101
|
+
EthSignTypedData = "eth_signTypedData",
|
|
102
|
+
PersonalSign = "personal_sign",
|
|
103
|
+
ResultError = "result_error",
|
|
104
|
+
ResultSuccess = "result_success",
|
|
105
|
+
SnapDialogAlert = "snap_dialog:alert",
|
|
106
|
+
SnapDialogConfirmation = "snap_dialog:confirmation",
|
|
107
|
+
SnapDialogPrompt = "snap_dialog:prompt",
|
|
108
|
+
SnapDialogDefault = "snap_dialog",
|
|
109
|
+
SwitchEthereumChain = "wallet_switchEthereumChain",
|
|
110
|
+
Transaction = "transaction",
|
|
111
|
+
Unlock = "unlock",
|
|
112
|
+
WalletConnect = "wallet_connect",
|
|
113
|
+
WalletRequestPermissions = "wallet_requestPermissions",
|
|
114
|
+
WatchAsset = "wallet_watchAsset"
|
|
115
|
+
}
|
|
116
|
+
export declare const CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP: Record<ChainId, BuiltInNetworkName>;
|
|
117
|
+
//# sourceMappingURL=constants.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,OAAO,EACP,kBAAkB,EACnB,oBAAgB;AAEjB,eAAO,MAAM,GAAG,QAAQ,CAAC;AACzB,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAC3C,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAI5E,eAAO,MAAM,gBAAgB,UAAU,CAAC;A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B;IACtD,UAAU,sBAAsB;CACjC;AAED,eAAO,MAAM,mCAAmC,EAAE,MAAM,CACtD,OAAO,EACP,kBAAkB,CASnB,CAAC"}
|
package/dist/constants.mjs
CHANGED
|
@@ -1,56 +1,135 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
import { NetworkType, NetworksTicker, ChainId, BuiltInNetworkName } from "./types.mjs";
|
|
2
|
+
export const RPC = 'rpc';
|
|
3
|
+
export const FALL_BACK_VS_CURRENCY = 'ETH';
|
|
4
|
+
export const IPFS_DEFAULT_GATEWAY_URL = 'https://cloudflare-ipfs.com/ipfs/';
|
|
5
|
+
// NETWORKS ID
|
|
6
|
+
// `toHex` not invoked to avoid cyclic dependency
|
|
7
|
+
export const GANACHE_CHAIN_ID = '0x539'; // toHex(1337)
|
|
8
|
+
/**
|
|
9
|
+
* The largest possible chain ID we can handle.
|
|
10
|
+
* Explanation: https://gist.github.com/rekmarks/a47bd5f2525936c4b8eee31a16345553
|
|
11
|
+
*/
|
|
12
|
+
export const MAX_SAFE_CHAIN_ID = 4503599627370476;
|
|
13
|
+
// TOKEN STANDARDS
|
|
14
|
+
export const ERC721 = 'ERC721';
|
|
15
|
+
export const ERC1155 = 'ERC1155';
|
|
16
|
+
export const ERC20 = 'ERC20';
|
|
17
|
+
// TOKEN INTERFACE IDS
|
|
18
|
+
export const ERC721_INTERFACE_ID = '0x80ac58cd';
|
|
19
|
+
export const ERC721_METADATA_INTERFACE_ID = '0x5b5e139f';
|
|
20
|
+
export const ERC721_ENUMERABLE_INTERFACE_ID = '0x780e9d63';
|
|
21
|
+
export const ERC1155_INTERFACE_ID = '0xd9b67a26';
|
|
22
|
+
export const ERC1155_METADATA_URI_INTERFACE_ID = '0x0e89341c';
|
|
23
|
+
export const ERC1155_TOKEN_RECEIVER_INTERFACE_ID = '0x4e2312e0';
|
|
24
|
+
// UNITS
|
|
25
|
+
export const GWEI = 'gwei';
|
|
26
|
+
// ASSET TYPES
|
|
27
|
+
export const ASSET_TYPES = {
|
|
28
|
+
NATIVE: 'NATIVE',
|
|
29
|
+
TOKEN: 'TOKEN',
|
|
30
|
+
NFT: 'NFT',
|
|
31
|
+
UNKNOWN: 'UNKNOWN',
|
|
32
|
+
};
|
|
33
|
+
// TICKER SYMBOLS
|
|
34
|
+
export const TESTNET_TICKER_SYMBOLS = {
|
|
35
|
+
GOERLI: 'GoerliETH',
|
|
36
|
+
SEPOLIA: 'SepoliaETH',
|
|
37
|
+
LINEA_GOERLI: 'LineaETH',
|
|
38
|
+
LINEA_SEPOLIA: 'LineaETH',
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Map of all build-in Infura networks to their network, ticker and chain IDs.
|
|
42
|
+
*/
|
|
43
|
+
export const BUILT_IN_NETWORKS = {
|
|
44
|
+
[NetworkType.goerli]: {
|
|
45
|
+
chainId: ChainId.goerli,
|
|
46
|
+
ticker: NetworksTicker.goerli,
|
|
47
|
+
rpcPrefs: {
|
|
48
|
+
blockExplorerUrl: `https://${NetworkType.goerli}.etherscan.io`,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
[NetworkType.sepolia]: {
|
|
52
|
+
chainId: ChainId.sepolia,
|
|
53
|
+
ticker: NetworksTicker.sepolia,
|
|
54
|
+
rpcPrefs: {
|
|
55
|
+
blockExplorerUrl: `https://${NetworkType.sepolia}.etherscan.io`,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
[NetworkType.mainnet]: {
|
|
59
|
+
chainId: ChainId.mainnet,
|
|
60
|
+
ticker: NetworksTicker.mainnet,
|
|
61
|
+
rpcPrefs: {
|
|
62
|
+
blockExplorerUrl: 'https://etherscan.io',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
[NetworkType['linea-goerli']]: {
|
|
66
|
+
chainId: ChainId['linea-goerli'],
|
|
67
|
+
ticker: NetworksTicker['linea-goerli'],
|
|
68
|
+
rpcPrefs: {
|
|
69
|
+
blockExplorerUrl: 'https://goerli.lineascan.build',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
[NetworkType['linea-sepolia']]: {
|
|
73
|
+
chainId: ChainId['linea-sepolia'],
|
|
74
|
+
ticker: NetworksTicker['linea-sepolia'],
|
|
75
|
+
rpcPrefs: {
|
|
76
|
+
blockExplorerUrl: 'https://sepolia.lineascan.build',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
[NetworkType['linea-mainnet']]: {
|
|
80
|
+
chainId: ChainId['linea-mainnet'],
|
|
81
|
+
ticker: NetworksTicker['linea-mainnet'],
|
|
82
|
+
rpcPrefs: {
|
|
83
|
+
blockExplorerUrl: 'https://lineascan.build',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
[NetworkType.rpc]: {
|
|
87
|
+
chainId: undefined,
|
|
88
|
+
blockExplorerUrl: undefined,
|
|
89
|
+
ticker: undefined,
|
|
90
|
+
rpcPrefs: undefined,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
// APIs
|
|
94
|
+
export const OPENSEA_PROXY_URL = 'https://proxy.api.cx.metamask.io/opensea/v1/api/v2';
|
|
95
|
+
export const NFT_API_BASE_URL = 'https://nft.api.cx.metamask.io';
|
|
96
|
+
export const NFT_API_VERSION = '1';
|
|
97
|
+
export const NFT_API_TIMEOUT = 15000;
|
|
98
|
+
// Default origin for controllers
|
|
99
|
+
export const ORIGIN_METAMASK = 'metamask';
|
|
100
|
+
/**
|
|
101
|
+
* Approval request types for various operations.
|
|
102
|
+
* These types are used by different controllers to create and manage
|
|
103
|
+
* approval requests consistently.
|
|
104
|
+
*/
|
|
105
|
+
export var ApprovalType;
|
|
106
|
+
(function (ApprovalType) {
|
|
107
|
+
ApprovalType["AddEthereumChain"] = "wallet_addEthereumChain";
|
|
108
|
+
ApprovalType["ConnectAccounts"] = "connect_accounts";
|
|
109
|
+
ApprovalType["EthDecrypt"] = "eth_decrypt";
|
|
110
|
+
ApprovalType["EthGetEncryptionPublicKey"] = "eth_getEncryptionPublicKey";
|
|
111
|
+
ApprovalType["EthSignTypedData"] = "eth_signTypedData";
|
|
112
|
+
ApprovalType["PersonalSign"] = "personal_sign";
|
|
113
|
+
ApprovalType["ResultError"] = "result_error";
|
|
114
|
+
ApprovalType["ResultSuccess"] = "result_success";
|
|
115
|
+
ApprovalType["SnapDialogAlert"] = "snap_dialog:alert";
|
|
116
|
+
ApprovalType["SnapDialogConfirmation"] = "snap_dialog:confirmation";
|
|
117
|
+
ApprovalType["SnapDialogPrompt"] = "snap_dialog:prompt";
|
|
118
|
+
ApprovalType["SnapDialogDefault"] = "snap_dialog";
|
|
119
|
+
ApprovalType["SwitchEthereumChain"] = "wallet_switchEthereumChain";
|
|
120
|
+
ApprovalType["Transaction"] = "transaction";
|
|
121
|
+
ApprovalType["Unlock"] = "unlock";
|
|
122
|
+
ApprovalType["WalletConnect"] = "wallet_connect";
|
|
123
|
+
ApprovalType["WalletRequestPermissions"] = "wallet_requestPermissions";
|
|
124
|
+
ApprovalType["WatchAsset"] = "wallet_watchAsset";
|
|
125
|
+
})(ApprovalType || (ApprovalType = {}));
|
|
126
|
+
export const CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP = {
|
|
127
|
+
[ChainId.goerli]: BuiltInNetworkName.Goerli,
|
|
128
|
+
[ChainId.sepolia]: BuiltInNetworkName.Sepolia,
|
|
129
|
+
[ChainId.mainnet]: BuiltInNetworkName.Mainnet,
|
|
130
|
+
[ChainId['linea-goerli']]: BuiltInNetworkName.LineaGoerli,
|
|
131
|
+
[ChainId['linea-sepolia']]: BuiltInNetworkName.LineaSepolia,
|
|
132
|
+
[ChainId['linea-mainnet']]: BuiltInNetworkName.LineaMainnet,
|
|
133
|
+
[ChainId.aurora]: BuiltInNetworkName.Aurora,
|
|
55
134
|
};
|
|
56
135
|
//# sourceMappingURL=constants.mjs.map
|
package/dist/constants.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,cAAc,EACd,OAAO,EACP,kBAAkB,EACnB,oBAAgB;AAEjB,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC;AACzB,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAC3C,MAAM,CAAC,MAAM,wBAAwB,GAAG,mCAAmC,CAAC;AAE5E,cAAc;AACd,iDAAiD;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC,CAAC,cAAc;AACvD;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAElD,kBAAkB;AAClB,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC;AAC/B,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,KAAK,GAAG,OAAO,CAAC;AAE7B,sBAAsB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D,sDAAsC,CAAA;IACtC,8CAA8B,CAAA;IAC9B,4CAA4B,CAAA;IAC5B,gDAAgC,CAAA;IAChC,qDAAqC,CAAA;IACrC,mEAAmD,CAAA;IACnD,uDAAuC,CAAA;IACvC,iDAAiC,CAAA;IACjC,kEAAkD,CAAA;IAClD,2CAA2B,CAAA;IAC3B,iCAAiB,CAAA;IACjB,gDAAgC,CAAA;IAChC,sEAAsD,CAAA;IACtD,gDAAgC,CAAA;AAClC,CAAC,EAnBW,YAAY,KAAZ,YAAY,QAmBvB;AAED,MAAM,CAAC,MAAM,mCAAmC,GAG5C;IACF,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,kBAAkB,CAAC,MAAM;IAC3C,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,OAAO;IAC7C,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,OAAO;IAC7C,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,EAAE,kBAAkB,CAAC,WAAW;IACzD,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,EAAE,kBAAkB,CAAC,YAAY;IAC3D,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,EAAE,kBAAkB,CAAC,YAAY;IAC3D,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,kBAAkB,CAAC,MAAM;CAC5C,CAAC","sourcesContent":["import {\n NetworkType,\n NetworksTicker,\n ChainId,\n BuiltInNetworkName,\n} from './types';\n\nexport const RPC = 'rpc';\nexport const FALL_BACK_VS_CURRENCY = 'ETH';\nexport const IPFS_DEFAULT_GATEWAY_URL = 'https://cloudflare-ipfs.com/ipfs/';\n\n// NETWORKS ID\n// `toHex` not invoked to avoid cyclic dependency\nexport const GANACHE_CHAIN_ID = '0x539'; // toHex(1337)\n/**\n * The largest possible chain ID we can handle.\n * Explanation: https://gist.github.com/rekmarks/a47bd5f2525936c4b8eee31a16345553\n */\nexport const MAX_SAFE_CHAIN_ID = 4503599627370476;\n\n// TOKEN STANDARDS\nexport const ERC721 = 'ERC721';\nexport const ERC1155 = 'ERC1155';\nexport const ERC20 = 'ERC20';\n\n// TOKEN INTERFACE IDS\nexport const ERC721_INTERFACE_ID = '0x80ac58cd';\nexport const ERC721_METADATA_INTERFACE_ID = '0x5b5e139f';\nexport const ERC721_ENUMERABLE_INTERFACE_ID = '0x780e9d63';\nexport const ERC1155_INTERFACE_ID = '0xd9b67a26';\nexport const ERC1155_METADATA_URI_INTERFACE_ID = '0x0e89341c';\nexport const ERC1155_TOKEN_RECEIVER_INTERFACE_ID = '0x4e2312e0';\n\n// UNITS\nexport const GWEI = 'gwei';\n\n// ASSET TYPES\nexport const ASSET_TYPES = {\n NATIVE: 'NATIVE',\n TOKEN: 'TOKEN',\n NFT: 'NFT',\n UNKNOWN: 'UNKNOWN',\n};\n\n// TICKER SYMBOLS\nexport const TESTNET_TICKER_SYMBOLS = {\n GOERLI: 'GoerliETH',\n SEPOLIA: 'SepoliaETH',\n LINEA_GOERLI: 'LineaETH',\n LINEA_SEPOLIA: 'LineaETH',\n};\n\n/**\n * Map of all build-in Infura networks to their network, ticker and chain IDs.\n */\nexport const BUILT_IN_NETWORKS = {\n [NetworkType.goerli]: {\n chainId: ChainId.goerli,\n ticker: NetworksTicker.goerli,\n rpcPrefs: {\n blockExplorerUrl: `https://${NetworkType.goerli}.etherscan.io`,\n },\n },\n [NetworkType.sepolia]: {\n chainId: ChainId.sepolia,\n ticker: NetworksTicker.sepolia,\n rpcPrefs: {\n blockExplorerUrl: `https://${NetworkType.sepolia}.etherscan.io`,\n },\n },\n [NetworkType.mainnet]: {\n chainId: ChainId.mainnet,\n ticker: NetworksTicker.mainnet,\n rpcPrefs: {\n blockExplorerUrl: 'https://etherscan.io',\n },\n },\n [NetworkType['linea-goerli']]: {\n chainId: ChainId['linea-goerli'],\n ticker: NetworksTicker['linea-goerli'],\n rpcPrefs: {\n blockExplorerUrl: 'https://goerli.lineascan.build',\n },\n },\n [NetworkType['linea-sepolia']]: {\n chainId: ChainId['linea-sepolia'],\n ticker: NetworksTicker['linea-sepolia'],\n rpcPrefs: {\n blockExplorerUrl: 'https://sepolia.lineascan.build',\n },\n },\n [NetworkType['linea-mainnet']]: {\n chainId: ChainId['linea-mainnet'],\n ticker: NetworksTicker['linea-mainnet'],\n rpcPrefs: {\n blockExplorerUrl: 'https://lineascan.build',\n },\n },\n [NetworkType.rpc]: {\n chainId: undefined,\n blockExplorerUrl: undefined,\n ticker: undefined,\n rpcPrefs: undefined,\n },\n} as const;\n\n// APIs\nexport const OPENSEA_PROXY_URL =\n 'https://proxy.api.cx.metamask.io/opensea/v1/api/v2';\n\nexport const NFT_API_BASE_URL = 'https://nft.api.cx.metamask.io';\n\nexport const NFT_API_VERSION = '1';\n\nexport const NFT_API_TIMEOUT = 15000;\n\n// Default origin for controllers\nexport const ORIGIN_METAMASK = 'metamask';\n\n/**\n * Approval request types for various operations.\n * These types are used by different controllers to create and manage\n * approval requests consistently.\n */\nexport enum ApprovalType {\n AddEthereumChain = 'wallet_addEthereumChain',\n ConnectAccounts = 'connect_accounts',\n EthDecrypt = 'eth_decrypt',\n EthGetEncryptionPublicKey = 'eth_getEncryptionPublicKey',\n EthSignTypedData = 'eth_signTypedData',\n PersonalSign = 'personal_sign',\n ResultError = 'result_error',\n ResultSuccess = 'result_success',\n SnapDialogAlert = 'snap_dialog:alert',\n SnapDialogConfirmation = 'snap_dialog:confirmation',\n SnapDialogPrompt = 'snap_dialog:prompt',\n SnapDialogDefault = 'snap_dialog',\n SwitchEthereumChain = 'wallet_switchEthereumChain',\n Transaction = 'transaction',\n Unlock = 'unlock',\n WalletConnect = 'wallet_connect',\n WalletRequestPermissions = 'wallet_requestPermissions',\n WatchAsset = 'wallet_watchAsset',\n}\n\nexport const CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP: Record<\n ChainId,\n BuiltInNetworkName\n> = {\n [ChainId.goerli]: BuiltInNetworkName.Goerli,\n [ChainId.sepolia]: BuiltInNetworkName.Sepolia,\n [ChainId.mainnet]: BuiltInNetworkName.Mainnet,\n [ChainId['linea-goerli']]: BuiltInNetworkName.LineaGoerli,\n [ChainId['linea-sepolia']]: BuiltInNetworkName.LineaSepolia,\n [ChainId['linea-mainnet']]: BuiltInNetworkName.LineaMainnet,\n [ChainId.aurora]: BuiltInNetworkName.Aurora,\n};\n"]}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.weiHexToGweiDec = exports.toHex = exports.toChecksumHexAddress = exports.timeoutFetch = exports.successfulFetch = exports.safelyExecuteWithTimeout = exports.safelyExecute = exports.query = exports.normalizeEnsName = exports.isValidHexAddress = exports.isValidJson = exports.isSmartContractCode = exports.isSafeDynamicKey = exports.isSafeChainId = exports.isPlainObject = exports.isNonEmptyArray = exports.hexToText = exports.hexToBN = exports.handleFetch = exports.gweiDecToWEIBN = exports.getBuyURL = exports.fromHex = exports.fractionBN = exports.fetchWithErrorHandling = exports.convertHexToDecimal = exports.BNToHex = void 0;
|
|
18
|
+
__exportStar(require("./constants.cjs"), exports);
|
|
19
|
+
var util_1 = require("./util.cjs");
|
|
20
|
+
Object.defineProperty(exports, "BNToHex", { enumerable: true, get: function () { return util_1.BNToHex; } });
|
|
21
|
+
Object.defineProperty(exports, "convertHexToDecimal", { enumerable: true, get: function () { return util_1.convertHexToDecimal; } });
|
|
22
|
+
Object.defineProperty(exports, "fetchWithErrorHandling", { enumerable: true, get: function () { return util_1.fetchWithErrorHandling; } });
|
|
23
|
+
Object.defineProperty(exports, "fractionBN", { enumerable: true, get: function () { return util_1.fractionBN; } });
|
|
24
|
+
Object.defineProperty(exports, "fromHex", { enumerable: true, get: function () { return util_1.fromHex; } });
|
|
25
|
+
Object.defineProperty(exports, "getBuyURL", { enumerable: true, get: function () { return util_1.getBuyURL; } });
|
|
26
|
+
Object.defineProperty(exports, "gweiDecToWEIBN", { enumerable: true, get: function () { return util_1.gweiDecToWEIBN; } });
|
|
27
|
+
Object.defineProperty(exports, "handleFetch", { enumerable: true, get: function () { return util_1.handleFetch; } });
|
|
28
|
+
Object.defineProperty(exports, "hexToBN", { enumerable: true, get: function () { return util_1.hexToBN; } });
|
|
29
|
+
Object.defineProperty(exports, "hexToText", { enumerable: true, get: function () { return util_1.hexToText; } });
|
|
30
|
+
Object.defineProperty(exports, "isNonEmptyArray", { enumerable: true, get: function () { return util_1.isNonEmptyArray; } });
|
|
31
|
+
Object.defineProperty(exports, "isPlainObject", { enumerable: true, get: function () { return util_1.isPlainObject; } });
|
|
32
|
+
Object.defineProperty(exports, "isSafeChainId", { enumerable: true, get: function () { return util_1.isSafeChainId; } });
|
|
33
|
+
Object.defineProperty(exports, "isSafeDynamicKey", { enumerable: true, get: function () { return util_1.isSafeDynamicKey; } });
|
|
34
|
+
Object.defineProperty(exports, "isSmartContractCode", { enumerable: true, get: function () { return util_1.isSmartContractCode; } });
|
|
35
|
+
Object.defineProperty(exports, "isValidJson", { enumerable: true, get: function () { return util_1.isValidJson; } });
|
|
36
|
+
Object.defineProperty(exports, "isValidHexAddress", { enumerable: true, get: function () { return util_1.isValidHexAddress; } });
|
|
37
|
+
Object.defineProperty(exports, "normalizeEnsName", { enumerable: true, get: function () { return util_1.normalizeEnsName; } });
|
|
38
|
+
Object.defineProperty(exports, "query", { enumerable: true, get: function () { return util_1.query; } });
|
|
39
|
+
Object.defineProperty(exports, "safelyExecute", { enumerable: true, get: function () { return util_1.safelyExecute; } });
|
|
40
|
+
Object.defineProperty(exports, "safelyExecuteWithTimeout", { enumerable: true, get: function () { return util_1.safelyExecuteWithTimeout; } });
|
|
41
|
+
Object.defineProperty(exports, "successfulFetch", { enumerable: true, get: function () { return util_1.successfulFetch; } });
|
|
42
|
+
Object.defineProperty(exports, "timeoutFetch", { enumerable: true, get: function () { return util_1.timeoutFetch; } });
|
|
43
|
+
Object.defineProperty(exports, "toChecksumHexAddress", { enumerable: true, get: function () { return util_1.toChecksumHexAddress; } });
|
|
44
|
+
Object.defineProperty(exports, "toHex", { enumerable: true, get: function () { return util_1.toHex; } });
|
|
45
|
+
Object.defineProperty(exports, "weiHexToGweiDec", { enumerable: true, get: function () { return util_1.weiHexToGweiDec; } });
|
|
46
|
+
__exportStar(require("./types.cjs"), exports);
|
|
47
|
+
__exportStar(require("./siwe.cjs"), exports);
|
|
48
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA4B;AAE5B,mCA2BgB;AA1Bd,+FAAA,OAAO,OAAA;AACP,2GAAA,mBAAmB,OAAA;AACnB,8GAAA,sBAAsB,OAAA;AACtB,kGAAA,UAAU,OAAA;AACV,+FAAA,OAAO,OAAA;AACP,iGAAA,SAAS,OAAA;AACT,sGAAA,cAAc,OAAA;AACd,mGAAA,WAAW,OAAA;AACX,+FAAA,OAAO,OAAA;AACP,iGAAA,SAAS,OAAA;AACT,uGAAA,eAAe,OAAA;AACf,qGAAA,aAAa,OAAA;AACb,qGAAA,aAAa,OAAA;AACb,wGAAA,gBAAgB,OAAA;AAChB,2GAAA,mBAAmB,OAAA;AACnB,mGAAA,WAAW,OAAA;AACX,yGAAA,iBAAiB,OAAA;AACjB,wGAAA,gBAAgB,OAAA;AAChB,6FAAA,KAAK,OAAA;AACL,qGAAA,aAAa,OAAA;AACb,gHAAA,wBAAwB,OAAA;AACxB,uGAAA,eAAe,OAAA;AACf,oGAAA,YAAY,OAAA;AACZ,4GAAA,oBAAoB,OAAA;AACpB,6FAAA,KAAK,OAAA;AACL,uGAAA,eAAe,OAAA;AAEjB,8CAAwB;AACxB,6CAAuB","sourcesContent":["export * from './constants';\nexport type { NonEmptyArray } from './util';\nexport {\n BNToHex,\n convertHexToDecimal,\n fetchWithErrorHandling,\n fractionBN,\n fromHex,\n getBuyURL,\n gweiDecToWEIBN,\n handleFetch,\n hexToBN,\n hexToText,\n isNonEmptyArray,\n isPlainObject,\n isSafeChainId,\n isSafeDynamicKey,\n isSmartContractCode,\n isValidJson,\n isValidHexAddress,\n normalizeEnsName,\n query,\n safelyExecute,\n safelyExecuteWithTimeout,\n successfulFetch,\n timeoutFetch,\n toChecksumHexAddress,\n toHex,\n weiHexToGweiDec,\n} from './util';\nexport * from './types';\nexport * from './siwe';\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export type { NonEmptyArray } from
|
|
3
|
-
export { BNToHex, convertHexToDecimal, fetchWithErrorHandling, fractionBN, fromHex, getBuyURL, gweiDecToWEIBN, handleFetch, hexToBN, hexToText, isNonEmptyArray, isPlainObject, isSafeChainId, isSafeDynamicKey, isSmartContractCode, isValidJson, isValidHexAddress, normalizeEnsName, query, safelyExecute, safelyExecuteWithTimeout, successfulFetch, timeoutFetch, toChecksumHexAddress, toHex, weiHexToGweiDec, } from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
//# sourceMappingURL=index.d.
|
|
1
|
+
export * from "./constants.cjs";
|
|
2
|
+
export type { NonEmptyArray } from "./util.cjs";
|
|
3
|
+
export { BNToHex, convertHexToDecimal, fetchWithErrorHandling, fractionBN, fromHex, getBuyURL, gweiDecToWEIBN, handleFetch, hexToBN, hexToText, isNonEmptyArray, isPlainObject, isSafeChainId, isSafeDynamicKey, isSmartContractCode, isValidJson, isValidHexAddress, normalizeEnsName, query, safelyExecute, safelyExecuteWithTimeout, successfulFetch, timeoutFetch, toChecksumHexAddress, toHex, weiHexToGweiDec, } from "./util.cjs";
|
|
4
|
+
export * from "./types.cjs";
|
|
5
|
+
export * from "./siwe.cjs";
|
|
6
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,YAAY,EAAE,aAAa,EAAE,mBAAe;AAC5C,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,OAAO,EACP,SAAS,EACT,cAAc,EACd,WAAW,EACX,OAAO,EACP,SAAS,EACT,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,EACL,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,eAAe,GAChB,mBAAe;AAChB,4BAAwB;AACxB,2BAAuB"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./constants.mjs";
|
|
2
|
+
export type { NonEmptyArray } from "./util.mjs";
|
|
3
|
+
export { BNToHex, convertHexToDecimal, fetchWithErrorHandling, fractionBN, fromHex, getBuyURL, gweiDecToWEIBN, handleFetch, hexToBN, hexToText, isNonEmptyArray, isPlainObject, isSafeChainId, isSafeDynamicKey, isSmartContractCode, isValidJson, isValidHexAddress, normalizeEnsName, query, safelyExecute, safelyExecuteWithTimeout, successfulFetch, timeoutFetch, toChecksumHexAddress, toHex, weiHexToGweiDec, } from "./util.mjs";
|
|
4
|
+
export * from "./types.mjs";
|
|
5
|
+
export * from "./siwe.mjs";
|
|
6
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,YAAY,EAAE,aAAa,EAAE,mBAAe;AAC5C,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,OAAO,EACP,SAAS,EACT,cAAc,EACd,WAAW,EACX,OAAO,EACP,SAAS,EACT,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,EACL,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,eAAe,GAChB,mBAAe;AAChB,4BAAwB;AACxB,2BAAuB"}
|