@wagmi/core 0.6.12 → 0.7.0
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/chains/package.json +2 -2
- package/connectors/coinbaseWallet/package.json +2 -2
- package/connectors/metaMask/package.json +2 -2
- package/connectors/mock/package.json +2 -2
- package/connectors/walletConnect/package.json +2 -2
- package/dist/{declarations/src/connectors/base.d.ts → base-5bd9b5ed.d.ts} +8 -5
- package/dist/chains.d.ts +3 -0
- package/dist/chains.js +29 -0
- package/dist/chunk-2EDVJWOA.js +3496 -0
- package/dist/chunk-4DNFSL2K.js +376 -0
- package/dist/chunk-MQXBDTVK.js +29 -0
- package/dist/{declarations/src/connectors → connectors}/coinbaseWallet.d.ts +10 -6
- package/dist/connectors/coinbaseWallet.js +215 -0
- package/dist/{declarations/src/connectors → connectors}/metaMask.d.ts +11 -4
- package/dist/connectors/metaMask.js +115 -0
- package/dist/connectors/mock/index.d.ts +78 -0
- package/dist/connectors/mock/index.js +190 -0
- package/dist/{declarations/src/connectors → connectors}/walletConnect.d.ts +9 -5
- package/dist/connectors/walletConnect.js +160 -0
- package/dist/{declarations/src/types/contracts.d.ts → contracts-fb6a6ff0.d.ts} +122 -17
- package/dist/{declarations/src/types/index.d.ts → index-bacc1c49.d.ts} +83 -15
- package/dist/index.d.ts +1738 -0
- package/dist/index.js +165 -0
- package/dist/{declarations/src/connectors/injected.d.ts → injected-6980e5c3.d.ts} +9 -6
- package/dist/internal.d.ts +8 -0
- package/dist/internal.js +8 -0
- package/dist/providers/alchemy.d.ts +11 -0
- package/dist/providers/alchemy.js +32 -0
- package/dist/providers/infura.d.ts +11 -0
- package/dist/providers/infura.js +32 -0
- package/dist/providers/jsonRpc.d.ts +14 -0
- package/dist/providers/jsonRpc.js +44 -0
- package/dist/providers/public.d.ts +8 -0
- package/dist/providers/public.js +30 -0
- package/internal/package.json +2 -2
- package/package.json +40 -51
- package/providers/alchemy/package.json +2 -2
- package/providers/infura/package.json +2 -2
- package/providers/jsonRpc/package.json +2 -2
- package/providers/public/package.json +2 -2
- package/chains/dist/wagmi-core-chains.cjs.d.ts +0 -1
- package/chains/dist/wagmi-core-chains.cjs.dev.js +0 -26
- package/chains/dist/wagmi-core-chains.cjs.js +0 -7
- package/chains/dist/wagmi-core-chains.cjs.prod.js +0 -26
- package/chains/dist/wagmi-core-chains.esm.js +0 -2
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.d.ts +0 -1
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.dev.js +0 -274
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.js +0 -7
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.prod.js +0 -274
- package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.esm.js +0 -252
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.d.ts +0 -1
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.dev.js +0 -153
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.js +0 -7
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.prod.js +0 -153
- package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.esm.js +0 -149
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.d.ts +0 -1
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.dev.js +0 -262
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.js +0 -7
- package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.prod.js +0 -262
- package/connectors/mock/dist/wagmi-core-connectors-mock.esm.js +0 -253
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.d.ts +0 -1
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.dev.js +0 -228
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.js +0 -7
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.prod.js +0 -228
- package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.esm.js +0 -206
- package/dist/chains-73cc6c23.cjs.prod.js +0 -526
- package/dist/chains-8fce19d8.esm.js +0 -502
- package/dist/chains-fe1f4131.cjs.dev.js +0 -526
- package/dist/debounce-0862bf88.esm.js +0 -18
- package/dist/debounce-2d836dc9.cjs.prod.js +0 -20
- package/dist/debounce-46ac0312.cjs.dev.js +0 -20
- package/dist/declarations/src/actions/accounts/connect.d.ts +0 -18
- package/dist/declarations/src/actions/accounts/disconnect.d.ts +0 -1
- package/dist/declarations/src/actions/accounts/fetchBalance.d.ts +0 -19
- package/dist/declarations/src/actions/accounts/fetchSigner.d.ts +0 -7
- package/dist/declarations/src/actions/accounts/getAccount.d.ts +0 -36
- package/dist/declarations/src/actions/accounts/getNetwork.d.ts +0 -8
- package/dist/declarations/src/actions/accounts/index.d.ts +0 -12
- package/dist/declarations/src/actions/accounts/signMessage.d.ts +0 -7
- package/dist/declarations/src/actions/accounts/signTypedData.d.ts +0 -23
- package/dist/declarations/src/actions/accounts/switchNetwork.d.ts +0 -6
- package/dist/declarations/src/actions/accounts/watchAccount.d.ts +0 -12
- package/dist/declarations/src/actions/accounts/watchNetwork.d.ts +0 -10
- package/dist/declarations/src/actions/accounts/watchSigner.d.ts +0 -5
- package/dist/declarations/src/actions/contracts/fetchToken.d.ts +0 -21
- package/dist/declarations/src/actions/contracts/getContract.d.ts +0 -113
- package/dist/declarations/src/actions/contracts/index.d.ts +0 -11
- package/dist/declarations/src/actions/contracts/multicall.d.ts +0 -17
- package/dist/declarations/src/actions/contracts/prepareWriteContract.d.ts +0 -47
- package/dist/declarations/src/actions/contracts/readContract.d.ts +0 -15
- package/dist/declarations/src/actions/contracts/readContracts.d.ts +0 -28
- package/dist/declarations/src/actions/contracts/watchContractEvent.d.ts +0 -28
- package/dist/declarations/src/actions/contracts/watchMulticall.d.ts +0 -10
- package/dist/declarations/src/actions/contracts/watchReadContract.d.ts +0 -7
- package/dist/declarations/src/actions/contracts/watchReadContracts.d.ts +0 -10
- package/dist/declarations/src/actions/contracts/writeContract.d.ts +0 -72
- package/dist/declarations/src/actions/ens/fetchEnsAddress.d.ts +0 -9
- package/dist/declarations/src/actions/ens/fetchEnsAvatar.d.ts +0 -8
- package/dist/declarations/src/actions/ens/fetchEnsName.d.ts +0 -9
- package/dist/declarations/src/actions/ens/fetchEnsResolver.d.ts +0 -9
- package/dist/declarations/src/actions/ens/index.d.ts +0 -4
- package/dist/declarations/src/actions/index.d.ts +0 -6
- package/dist/declarations/src/actions/network-status/fetchBlockNumber.d.ts +0 -5
- package/dist/declarations/src/actions/network-status/fetchFeeData.d.ts +0 -16
- package/dist/declarations/src/actions/network-status/index.d.ts +0 -3
- package/dist/declarations/src/actions/network-status/watchBlockNumber.d.ts +0 -7
- package/dist/declarations/src/actions/providers/getProvider.d.ts +0 -7
- package/dist/declarations/src/actions/providers/getWebSocketProvider.d.ts +0 -7
- package/dist/declarations/src/actions/providers/index.d.ts +0 -4
- package/dist/declarations/src/actions/providers/watchProvider.d.ts +0 -4
- package/dist/declarations/src/actions/providers/watchWebSocketProvider.d.ts +0 -4
- package/dist/declarations/src/actions/transactions/fetchTransaction.d.ts +0 -21
- package/dist/declarations/src/actions/transactions/index.d.ts +0 -4
- package/dist/declarations/src/actions/transactions/prepareSendTransaction.d.ts +0 -37
- package/dist/declarations/src/actions/transactions/sendTransaction.d.ts +0 -48
- package/dist/declarations/src/actions/transactions/waitForTransaction.d.ts +0 -18
- package/dist/declarations/src/chains.d.ts +0 -1
- package/dist/declarations/src/client.d.ts +0 -91
- package/dist/declarations/src/connectors/index.d.ts +0 -2
- package/dist/declarations/src/connectors/mock/connector.d.ts +0 -34
- package/dist/declarations/src/connectors/mock/index.d.ts +0 -2
- package/dist/declarations/src/connectors/mock/provider.d.ts +0 -41
- package/dist/declarations/src/constants/abis.d.ts +0 -941
- package/dist/declarations/src/constants/blockExplorers.d.ts +0 -9
- package/dist/declarations/src/constants/chains.d.ts +0 -64
- package/dist/declarations/src/constants/index.d.ts +0 -7
- package/dist/declarations/src/constants/rpcs.d.ts +0 -11
- package/dist/declarations/src/constants/units.d.ts +0 -1
- package/dist/declarations/src/errors.d.ts +0 -134
- package/dist/declarations/src/index.d.ts +0 -14
- package/dist/declarations/src/internal.d.ts +0 -3
- package/dist/declarations/src/providers/alchemy.d.ts +0 -6
- package/dist/declarations/src/providers/infura.d.ts +0 -6
- package/dist/declarations/src/providers/jsonRpc.d.ts +0 -10
- package/dist/declarations/src/providers/public.d.ts +0 -4
- package/dist/declarations/src/storage.d.ts +0 -12
- package/dist/declarations/src/types/utils.d.ts +0 -103
- package/dist/declarations/src/utils/assertActiveChain.d.ts +0 -5
- package/dist/declarations/src/utils/configureChains.d.ts +0 -26
- package/dist/declarations/src/utils/debounce.d.ts +0 -1
- package/dist/declarations/src/utils/deepEqual.d.ts +0 -2
- package/dist/declarations/src/utils/getInjectedName.d.ts +0 -2
- package/dist/declarations/src/utils/index.d.ts +0 -11
- package/dist/declarations/src/utils/logger.d.ts +0 -1
- package/dist/declarations/src/utils/minimizeContractInterface.d.ts +0 -5
- package/dist/declarations/src/utils/normalizeChainId.d.ts +0 -1
- package/dist/declarations/src/utils/normalizeFunctionName.d.ts +0 -17
- package/dist/declarations/src/utils/parseContractResult.d.ts +0 -7
- package/dist/getProvider-3b1af4e6.cjs.dev.js +0 -1143
- package/dist/getProvider-84f303a1.cjs.prod.js +0 -1143
- package/dist/getProvider-97db849e.esm.js +0 -1105
- package/dist/rpcs-38f4faba.cjs.prod.js +0 -57
- package/dist/rpcs-52ea3d8d.cjs.dev.js +0 -57
- package/dist/rpcs-d533516e.esm.js +0 -51
- package/dist/wagmi-core.cjs.d.ts +0 -1
- package/dist/wagmi-core.cjs.dev.js +0 -2683
- package/dist/wagmi-core.cjs.js +0 -7
- package/dist/wagmi-core.cjs.prod.js +0 -2683
- package/dist/wagmi-core.esm.js +0 -2599
- package/internal/dist/wagmi-core-internal.cjs.d.ts +0 -1
- package/internal/dist/wagmi-core-internal.cjs.dev.js +0 -9
- package/internal/dist/wagmi-core-internal.cjs.js +0 -7
- package/internal/dist/wagmi-core-internal.cjs.prod.js +0 -9
- package/internal/dist/wagmi-core-internal.esm.js +0 -1
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.d.ts +0 -1
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.dev.js +0 -36
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.js +0 -7
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.prod.js +0 -36
- package/providers/alchemy/dist/wagmi-core-providers-alchemy.esm.js +0 -32
- package/providers/infura/dist/wagmi-core-providers-infura.cjs.d.ts +0 -1
- package/providers/infura/dist/wagmi-core-providers-infura.cjs.dev.js +0 -36
- package/providers/infura/dist/wagmi-core-providers-infura.cjs.js +0 -7
- package/providers/infura/dist/wagmi-core-providers-infura.cjs.prod.js +0 -36
- package/providers/infura/dist/wagmi-core-providers-infura.esm.js +0 -32
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.d.ts +0 -1
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.dev.js +0 -46
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.js +0 -7
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.prod.js +0 -46
- package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.esm.js +0 -42
- package/providers/public/dist/wagmi-core-providers-public.cjs.d.ts +0 -1
- package/providers/public/dist/wagmi-core-providers-public.cjs.dev.js +0 -32
- package/providers/public/dist/wagmi-core-providers-public.cjs.js +0 -7
- package/providers/public/dist/wagmi-core-providers-public.cjs.prod.js +0 -32
- package/providers/public/dist/wagmi-core-providers-public.esm.js +0 -28
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
// src/constants/blockExplorers.ts
|
|
2
|
+
var etherscanBlockExplorers = {
|
|
3
|
+
mainnet: {
|
|
4
|
+
name: "Etherscan",
|
|
5
|
+
url: "https://etherscan.io"
|
|
6
|
+
},
|
|
7
|
+
goerli: {
|
|
8
|
+
name: "Etherscan",
|
|
9
|
+
url: "https://goerli.etherscan.io"
|
|
10
|
+
},
|
|
11
|
+
sepolia: {
|
|
12
|
+
name: "Etherscan",
|
|
13
|
+
url: "https://sepolia.etherscan.io"
|
|
14
|
+
},
|
|
15
|
+
optimism: {
|
|
16
|
+
name: "Etherscan",
|
|
17
|
+
url: "https://optimistic.etherscan.io"
|
|
18
|
+
},
|
|
19
|
+
optimismGoerli: {
|
|
20
|
+
name: "Etherscan",
|
|
21
|
+
url: "https://goerli-optimism.etherscan.io"
|
|
22
|
+
},
|
|
23
|
+
polygon: {
|
|
24
|
+
name: "PolygonScan",
|
|
25
|
+
url: "https://polygonscan.com"
|
|
26
|
+
},
|
|
27
|
+
polygonMumbai: {
|
|
28
|
+
name: "PolygonScan",
|
|
29
|
+
url: "https://mumbai.polygonscan.com"
|
|
30
|
+
},
|
|
31
|
+
arbitrum: { name: "Arbiscan", url: "https://arbiscan.io" },
|
|
32
|
+
arbitrumGoerli: { name: "Arbiscan", url: "https://goerli.arbiscan.io" }
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// src/constants/rpcs.ts
|
|
36
|
+
var alchemyRpcUrls = {
|
|
37
|
+
mainnet: "https://eth-mainnet.alchemyapi.io/v2",
|
|
38
|
+
goerli: "https://eth-goerli.alchemyapi.io/v2",
|
|
39
|
+
optimism: "https://opt-mainnet.g.alchemy.com/v2",
|
|
40
|
+
optimismGoerli: "https://opt-goerli.g.alchemy.com/v2",
|
|
41
|
+
polygon: "https://polygon-mainnet.g.alchemy.com/v2",
|
|
42
|
+
polygonMumbai: "https://polygon-mumbai.g.alchemy.com/v2",
|
|
43
|
+
arbitrum: "https://arb-mainnet.g.alchemy.com/v2",
|
|
44
|
+
arbitrumGoerli: "https://arb-goerli.g.alchemy.com/v2"
|
|
45
|
+
};
|
|
46
|
+
var infuraRpcUrls = {
|
|
47
|
+
mainnet: "https://mainnet.infura.io/v3",
|
|
48
|
+
goerli: "https://goerli.infura.io/v3",
|
|
49
|
+
sepolia: "https://sepolia.infura.io/v3",
|
|
50
|
+
optimism: "https://optimism-mainnet.infura.io/v3",
|
|
51
|
+
optimismGoerli: "https://optimism-goerli.infura.io/v3",
|
|
52
|
+
polygon: "https://polygon-mainnet.infura.io/v3",
|
|
53
|
+
polygonMumbai: "https://polygon-mumbai.infura.io/v3",
|
|
54
|
+
arbitrum: "https://arbitrum-mainnet.infura.io/v3",
|
|
55
|
+
arbitrumGoerli: "https://arbitrum-goerli.infura.io/v3"
|
|
56
|
+
};
|
|
57
|
+
var publicRpcUrls = {
|
|
58
|
+
mainnet: "https://cloudflare-eth.com",
|
|
59
|
+
goerli: "https://rpc.ankr.com/eth_goerli",
|
|
60
|
+
sepolia: "https://rpc.sepolia.org",
|
|
61
|
+
optimism: "https://mainnet.optimism.io",
|
|
62
|
+
optimismGoerli: "https://goerli.optimism.io",
|
|
63
|
+
polygon: "https://polygon-rpc.com",
|
|
64
|
+
polygonMumbai: "https://matic-mumbai.chainstacklabs.com",
|
|
65
|
+
arbitrum: "https://arb1.arbitrum.io/rpc",
|
|
66
|
+
arbitrumGoerli: "https://goerli-rollup.arbitrum.io/rpc"
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// src/constants/chains.ts
|
|
70
|
+
var chainId = {
|
|
71
|
+
mainnet: 1,
|
|
72
|
+
goerli: 5,
|
|
73
|
+
sepolia: 11155111,
|
|
74
|
+
optimism: 10,
|
|
75
|
+
optimismGoerli: 420,
|
|
76
|
+
polygon: 137,
|
|
77
|
+
polygonMumbai: 80001,
|
|
78
|
+
arbitrum: 42161,
|
|
79
|
+
arbitrumGoerli: 421613,
|
|
80
|
+
localhost: 1337,
|
|
81
|
+
hardhat: 31337,
|
|
82
|
+
foundry: 31337
|
|
83
|
+
};
|
|
84
|
+
var mainnet = {
|
|
85
|
+
id: chainId.mainnet,
|
|
86
|
+
name: "Ethereum",
|
|
87
|
+
network: "homestead",
|
|
88
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
89
|
+
rpcUrls: {
|
|
90
|
+
alchemy: alchemyRpcUrls.mainnet,
|
|
91
|
+
default: publicRpcUrls.mainnet,
|
|
92
|
+
infura: infuraRpcUrls.mainnet,
|
|
93
|
+
public: publicRpcUrls.mainnet
|
|
94
|
+
},
|
|
95
|
+
blockExplorers: {
|
|
96
|
+
etherscan: etherscanBlockExplorers.mainnet,
|
|
97
|
+
default: etherscanBlockExplorers.mainnet
|
|
98
|
+
},
|
|
99
|
+
ens: {
|
|
100
|
+
address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
|
|
101
|
+
},
|
|
102
|
+
multicall: {
|
|
103
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
104
|
+
blockCreated: 14353601
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
var goerli = {
|
|
108
|
+
id: chainId.goerli,
|
|
109
|
+
name: "Goerli",
|
|
110
|
+
network: "goerli",
|
|
111
|
+
nativeCurrency: { name: "Goerli Ether", symbol: "ETH", decimals: 18 },
|
|
112
|
+
rpcUrls: {
|
|
113
|
+
alchemy: alchemyRpcUrls.goerli,
|
|
114
|
+
default: publicRpcUrls.goerli,
|
|
115
|
+
infura: infuraRpcUrls.goerli,
|
|
116
|
+
public: publicRpcUrls.goerli
|
|
117
|
+
},
|
|
118
|
+
blockExplorers: {
|
|
119
|
+
etherscan: etherscanBlockExplorers.goerli,
|
|
120
|
+
default: etherscanBlockExplorers.goerli
|
|
121
|
+
},
|
|
122
|
+
ens: {
|
|
123
|
+
address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
|
|
124
|
+
},
|
|
125
|
+
multicall: {
|
|
126
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
127
|
+
blockCreated: 6507670
|
|
128
|
+
},
|
|
129
|
+
testnet: true
|
|
130
|
+
};
|
|
131
|
+
var sepolia = {
|
|
132
|
+
id: chainId.sepolia,
|
|
133
|
+
name: "Sepolia",
|
|
134
|
+
network: "sepolia",
|
|
135
|
+
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
|
136
|
+
rpcUrls: {
|
|
137
|
+
default: publicRpcUrls.sepolia,
|
|
138
|
+
infura: infuraRpcUrls.sepolia,
|
|
139
|
+
public: publicRpcUrls.sepolia
|
|
140
|
+
},
|
|
141
|
+
blockExplorers: {
|
|
142
|
+
etherscan: etherscanBlockExplorers.sepolia,
|
|
143
|
+
default: etherscanBlockExplorers.sepolia
|
|
144
|
+
},
|
|
145
|
+
multicall: {
|
|
146
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
147
|
+
blockCreated: 751532
|
|
148
|
+
},
|
|
149
|
+
testnet: true
|
|
150
|
+
};
|
|
151
|
+
var optimism = {
|
|
152
|
+
id: chainId.optimism,
|
|
153
|
+
name: "Optimism",
|
|
154
|
+
network: "optimism",
|
|
155
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
156
|
+
rpcUrls: {
|
|
157
|
+
alchemy: alchemyRpcUrls.optimism,
|
|
158
|
+
default: publicRpcUrls.optimism,
|
|
159
|
+
infura: infuraRpcUrls.optimism,
|
|
160
|
+
public: publicRpcUrls.optimism
|
|
161
|
+
},
|
|
162
|
+
blockExplorers: {
|
|
163
|
+
etherscan: etherscanBlockExplorers.optimism,
|
|
164
|
+
default: etherscanBlockExplorers.optimism
|
|
165
|
+
},
|
|
166
|
+
multicall: {
|
|
167
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
168
|
+
blockCreated: 4286263
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
var optimismGoerli = {
|
|
172
|
+
id: chainId.optimismGoerli,
|
|
173
|
+
name: "Optimism Goerli",
|
|
174
|
+
network: "optimism-goerli",
|
|
175
|
+
nativeCurrency: {
|
|
176
|
+
name: "Goerli Ether",
|
|
177
|
+
symbol: "ETH",
|
|
178
|
+
decimals: 18
|
|
179
|
+
},
|
|
180
|
+
rpcUrls: {
|
|
181
|
+
alchemy: alchemyRpcUrls.optimismGoerli,
|
|
182
|
+
default: publicRpcUrls.optimismGoerli,
|
|
183
|
+
infura: infuraRpcUrls.optimismGoerli,
|
|
184
|
+
public: publicRpcUrls.optimismGoerli
|
|
185
|
+
},
|
|
186
|
+
blockExplorers: {
|
|
187
|
+
etherscan: etherscanBlockExplorers.optimismGoerli,
|
|
188
|
+
default: etherscanBlockExplorers.optimismGoerli
|
|
189
|
+
},
|
|
190
|
+
multicall: {
|
|
191
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
192
|
+
blockCreated: 49461
|
|
193
|
+
},
|
|
194
|
+
testnet: true
|
|
195
|
+
};
|
|
196
|
+
var polygon = {
|
|
197
|
+
id: chainId.polygon,
|
|
198
|
+
name: "Polygon",
|
|
199
|
+
network: "matic",
|
|
200
|
+
nativeCurrency: { name: "MATIC", symbol: "MATIC", decimals: 18 },
|
|
201
|
+
rpcUrls: {
|
|
202
|
+
alchemy: alchemyRpcUrls.polygon,
|
|
203
|
+
default: publicRpcUrls.polygon,
|
|
204
|
+
infura: infuraRpcUrls.polygon,
|
|
205
|
+
public: publicRpcUrls.polygon
|
|
206
|
+
},
|
|
207
|
+
blockExplorers: {
|
|
208
|
+
etherscan: etherscanBlockExplorers.polygon,
|
|
209
|
+
default: etherscanBlockExplorers.polygon
|
|
210
|
+
},
|
|
211
|
+
multicall: {
|
|
212
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
213
|
+
blockCreated: 25770160
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
var polygonMumbai = {
|
|
217
|
+
id: chainId.polygonMumbai,
|
|
218
|
+
name: "Polygon Mumbai",
|
|
219
|
+
network: "maticmum",
|
|
220
|
+
nativeCurrency: {
|
|
221
|
+
name: "MATIC",
|
|
222
|
+
symbol: "MATIC",
|
|
223
|
+
decimals: 18
|
|
224
|
+
},
|
|
225
|
+
rpcUrls: {
|
|
226
|
+
alchemy: alchemyRpcUrls.polygonMumbai,
|
|
227
|
+
default: publicRpcUrls.polygonMumbai,
|
|
228
|
+
infura: infuraRpcUrls.polygonMumbai,
|
|
229
|
+
public: publicRpcUrls.polygonMumbai
|
|
230
|
+
},
|
|
231
|
+
blockExplorers: {
|
|
232
|
+
etherscan: etherscanBlockExplorers.polygonMumbai,
|
|
233
|
+
default: etherscanBlockExplorers.polygonMumbai
|
|
234
|
+
},
|
|
235
|
+
multicall: {
|
|
236
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
237
|
+
blockCreated: 25444704
|
|
238
|
+
},
|
|
239
|
+
testnet: true
|
|
240
|
+
};
|
|
241
|
+
var arbitrum = {
|
|
242
|
+
id: chainId.arbitrum,
|
|
243
|
+
name: "Arbitrum One",
|
|
244
|
+
network: "arbitrum",
|
|
245
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
246
|
+
rpcUrls: {
|
|
247
|
+
alchemy: alchemyRpcUrls.arbitrum,
|
|
248
|
+
default: publicRpcUrls.arbitrum,
|
|
249
|
+
infura: infuraRpcUrls.arbitrum,
|
|
250
|
+
public: publicRpcUrls.arbitrum
|
|
251
|
+
},
|
|
252
|
+
blockExplorers: {
|
|
253
|
+
arbitrum: {
|
|
254
|
+
name: "Arbitrum Explorer",
|
|
255
|
+
url: "https://explorer.arbitrum.io"
|
|
256
|
+
},
|
|
257
|
+
etherscan: etherscanBlockExplorers.arbitrum,
|
|
258
|
+
default: etherscanBlockExplorers.arbitrum
|
|
259
|
+
},
|
|
260
|
+
multicall: {
|
|
261
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
262
|
+
blockCreated: 7654707
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
var arbitrumGoerli = {
|
|
266
|
+
id: chainId.arbitrumGoerli,
|
|
267
|
+
name: "Arbitrum Goerli",
|
|
268
|
+
network: "arbitrum-goerli",
|
|
269
|
+
nativeCurrency: {
|
|
270
|
+
name: "Arbitrum Goerli Ether",
|
|
271
|
+
symbol: "ETH",
|
|
272
|
+
decimals: 18
|
|
273
|
+
},
|
|
274
|
+
rpcUrls: {
|
|
275
|
+
alchemy: alchemyRpcUrls.arbitrumGoerli,
|
|
276
|
+
default: publicRpcUrls.arbitrumGoerli,
|
|
277
|
+
infura: infuraRpcUrls.arbitrumGoerli,
|
|
278
|
+
public: publicRpcUrls.arbitrumGoerli
|
|
279
|
+
},
|
|
280
|
+
blockExplorers: {
|
|
281
|
+
arbitrum: {
|
|
282
|
+
name: "Arbitrum Explorer",
|
|
283
|
+
url: "https://goerli-rollup-explorer.arbitrum.io"
|
|
284
|
+
},
|
|
285
|
+
etherscan: etherscanBlockExplorers.arbitrumGoerli,
|
|
286
|
+
default: etherscanBlockExplorers.arbitrumGoerli
|
|
287
|
+
},
|
|
288
|
+
multicall: {
|
|
289
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
290
|
+
blockCreated: 88114
|
|
291
|
+
},
|
|
292
|
+
testnet: true
|
|
293
|
+
};
|
|
294
|
+
var localhost = {
|
|
295
|
+
id: chainId.localhost,
|
|
296
|
+
name: "Localhost",
|
|
297
|
+
network: "localhost",
|
|
298
|
+
rpcUrls: {
|
|
299
|
+
default: "http://127.0.0.1:8545"
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
var hardhat = {
|
|
303
|
+
id: chainId.hardhat,
|
|
304
|
+
name: "Hardhat",
|
|
305
|
+
network: "hardhat",
|
|
306
|
+
rpcUrls: {
|
|
307
|
+
default: "http://127.0.0.1:8545"
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
var foundry = {
|
|
311
|
+
id: chainId.foundry,
|
|
312
|
+
name: "Foundry",
|
|
313
|
+
network: "foundry",
|
|
314
|
+
rpcUrls: {
|
|
315
|
+
default: "http://127.0.0.1:8545"
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
var chain = {
|
|
319
|
+
mainnet,
|
|
320
|
+
goerli,
|
|
321
|
+
sepolia,
|
|
322
|
+
optimism,
|
|
323
|
+
optimismGoerli,
|
|
324
|
+
polygon,
|
|
325
|
+
polygonMumbai,
|
|
326
|
+
arbitrum,
|
|
327
|
+
arbitrumGoerli,
|
|
328
|
+
localhost,
|
|
329
|
+
hardhat,
|
|
330
|
+
foundry
|
|
331
|
+
};
|
|
332
|
+
var allChains = [
|
|
333
|
+
mainnet,
|
|
334
|
+
goerli,
|
|
335
|
+
sepolia,
|
|
336
|
+
optimism,
|
|
337
|
+
optimismGoerli,
|
|
338
|
+
polygon,
|
|
339
|
+
polygonMumbai,
|
|
340
|
+
arbitrum,
|
|
341
|
+
arbitrumGoerli,
|
|
342
|
+
localhost,
|
|
343
|
+
hardhat,
|
|
344
|
+
foundry
|
|
345
|
+
];
|
|
346
|
+
var defaultChains = [mainnet, goerli];
|
|
347
|
+
var defaultL2Chains = [
|
|
348
|
+
arbitrum,
|
|
349
|
+
arbitrumGoerli,
|
|
350
|
+
optimism,
|
|
351
|
+
optimismGoerli
|
|
352
|
+
];
|
|
353
|
+
|
|
354
|
+
export {
|
|
355
|
+
etherscanBlockExplorers,
|
|
356
|
+
alchemyRpcUrls,
|
|
357
|
+
infuraRpcUrls,
|
|
358
|
+
publicRpcUrls,
|
|
359
|
+
chainId,
|
|
360
|
+
mainnet,
|
|
361
|
+
goerli,
|
|
362
|
+
sepolia,
|
|
363
|
+
optimism,
|
|
364
|
+
optimismGoerli,
|
|
365
|
+
polygon,
|
|
366
|
+
polygonMumbai,
|
|
367
|
+
arbitrum,
|
|
368
|
+
arbitrumGoerli,
|
|
369
|
+
localhost,
|
|
370
|
+
hardhat,
|
|
371
|
+
foundry,
|
|
372
|
+
chain,
|
|
373
|
+
allChains,
|
|
374
|
+
defaultChains,
|
|
375
|
+
defaultL2Chains
|
|
376
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __accessCheck = (obj, member, msg) => {
|
|
2
|
+
if (!member.has(obj))
|
|
3
|
+
throw TypeError("Cannot " + msg);
|
|
4
|
+
};
|
|
5
|
+
var __privateGet = (obj, member, getter) => {
|
|
6
|
+
__accessCheck(obj, member, "read from private field");
|
|
7
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
8
|
+
};
|
|
9
|
+
var __privateAdd = (obj, member, value) => {
|
|
10
|
+
if (member.has(obj))
|
|
11
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
12
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
13
|
+
};
|
|
14
|
+
var __privateSet = (obj, member, value, setter) => {
|
|
15
|
+
__accessCheck(obj, member, "write to private field");
|
|
16
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
17
|
+
return value;
|
|
18
|
+
};
|
|
19
|
+
var __privateMethod = (obj, member, method) => {
|
|
20
|
+
__accessCheck(obj, member, "access private method");
|
|
21
|
+
return method;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
__privateGet,
|
|
26
|
+
__privateAdd,
|
|
27
|
+
__privateSet,
|
|
28
|
+
__privateMethod
|
|
29
|
+
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { CoinbaseWalletProvider } from '@coinbase/wallet-sdk';
|
|
2
|
+
import { CoinbaseWalletSDKOptions } from '@coinbase/wallet-sdk/dist/CoinbaseWalletSDK';
|
|
3
3
|
import { providers } from 'ethers';
|
|
4
|
-
import { Chain } from '../
|
|
5
|
-
import { Connector } from '
|
|
4
|
+
import { C as Chain } from '../index-bacc1c49.js';
|
|
5
|
+
import { C as Connector } from '../base-5bd9b5ed.js';
|
|
6
|
+
import 'abitype';
|
|
7
|
+
import 'eventemitter3';
|
|
8
|
+
|
|
6
9
|
declare type Options = CoinbaseWalletSDKOptions & {
|
|
7
10
|
/**
|
|
8
11
|
* Fallback Ethereum JSON RPC URL
|
|
@@ -15,7 +18,7 @@ declare type Options = CoinbaseWalletSDKOptions & {
|
|
|
15
18
|
*/
|
|
16
19
|
chainId?: number;
|
|
17
20
|
};
|
|
18
|
-
|
|
21
|
+
declare class CoinbaseWalletConnector extends Connector<CoinbaseWalletProvider, Options, providers.JsonRpcSigner> {
|
|
19
22
|
#private;
|
|
20
23
|
readonly id = "coinbaseWallet";
|
|
21
24
|
readonly name = "Coinbase Wallet";
|
|
@@ -53,4 +56,5 @@ export declare class CoinbaseWalletConnector extends Connector<CoinbaseWalletPro
|
|
|
53
56
|
protected onChainChanged: (chainId: number | string) => void;
|
|
54
57
|
protected onDisconnect: () => void;
|
|
55
58
|
}
|
|
56
|
-
|
|
59
|
+
|
|
60
|
+
export { CoinbaseWalletConnector };
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AddChainError,
|
|
3
|
+
ChainNotConfiguredError,
|
|
4
|
+
Connector,
|
|
5
|
+
SwitchChainError,
|
|
6
|
+
UserRejectedRequestError,
|
|
7
|
+
normalizeChainId
|
|
8
|
+
} from "../chunk-2EDVJWOA.js";
|
|
9
|
+
import "../chunk-4DNFSL2K.js";
|
|
10
|
+
import {
|
|
11
|
+
__privateAdd,
|
|
12
|
+
__privateGet,
|
|
13
|
+
__privateMethod,
|
|
14
|
+
__privateSet
|
|
15
|
+
} from "../chunk-MQXBDTVK.js";
|
|
16
|
+
|
|
17
|
+
// src/connectors/coinbaseWallet.ts
|
|
18
|
+
import { providers } from "ethers";
|
|
19
|
+
import { getAddress, hexValue } from "ethers/lib/utils.js";
|
|
20
|
+
var _client, _provider, _isUserRejectedRequestError, isUserRejectedRequestError_fn;
|
|
21
|
+
var CoinbaseWalletConnector = class extends Connector {
|
|
22
|
+
constructor({ chains, options }) {
|
|
23
|
+
super({
|
|
24
|
+
chains,
|
|
25
|
+
options: {
|
|
26
|
+
reloadOnDisconnect: false,
|
|
27
|
+
...options
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
__privateAdd(this, _isUserRejectedRequestError);
|
|
31
|
+
this.id = "coinbaseWallet";
|
|
32
|
+
this.name = "Coinbase Wallet";
|
|
33
|
+
this.ready = true;
|
|
34
|
+
__privateAdd(this, _client, void 0);
|
|
35
|
+
__privateAdd(this, _provider, void 0);
|
|
36
|
+
this.onAccountsChanged = (accounts) => {
|
|
37
|
+
if (accounts.length === 0)
|
|
38
|
+
this.emit("disconnect");
|
|
39
|
+
else
|
|
40
|
+
this.emit("change", { account: getAddress(accounts[0]) });
|
|
41
|
+
};
|
|
42
|
+
this.onChainChanged = (chainId) => {
|
|
43
|
+
const id = normalizeChainId(chainId);
|
|
44
|
+
const unsupported = this.isChainUnsupported(id);
|
|
45
|
+
this.emit("change", { chain: { id, unsupported } });
|
|
46
|
+
};
|
|
47
|
+
this.onDisconnect = () => {
|
|
48
|
+
this.emit("disconnect");
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
async connect({ chainId } = {}) {
|
|
52
|
+
try {
|
|
53
|
+
const provider = await this.getProvider();
|
|
54
|
+
provider.on("accountsChanged", this.onAccountsChanged);
|
|
55
|
+
provider.on("chainChanged", this.onChainChanged);
|
|
56
|
+
provider.on("disconnect", this.onDisconnect);
|
|
57
|
+
this.emit("message", { type: "connecting" });
|
|
58
|
+
const accounts = await provider.enable();
|
|
59
|
+
const account = getAddress(accounts[0]);
|
|
60
|
+
let id = await this.getChainId();
|
|
61
|
+
let unsupported = this.isChainUnsupported(id);
|
|
62
|
+
if (chainId && id !== chainId) {
|
|
63
|
+
const chain = await this.switchChain(chainId);
|
|
64
|
+
id = chain.id;
|
|
65
|
+
unsupported = this.isChainUnsupported(id);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
account,
|
|
69
|
+
chain: { id, unsupported },
|
|
70
|
+
provider: new providers.Web3Provider(
|
|
71
|
+
provider
|
|
72
|
+
)
|
|
73
|
+
};
|
|
74
|
+
} catch (error) {
|
|
75
|
+
if (/(user closed modal|accounts received is empty)/i.test(
|
|
76
|
+
error.message
|
|
77
|
+
))
|
|
78
|
+
throw new UserRejectedRequestError(error);
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
async disconnect() {
|
|
83
|
+
if (!__privateGet(this, _provider))
|
|
84
|
+
return;
|
|
85
|
+
const provider = await this.getProvider();
|
|
86
|
+
provider.removeListener("accountsChanged", this.onAccountsChanged);
|
|
87
|
+
provider.removeListener("chainChanged", this.onChainChanged);
|
|
88
|
+
provider.removeListener("disconnect", this.onDisconnect);
|
|
89
|
+
provider.disconnect();
|
|
90
|
+
provider.close();
|
|
91
|
+
}
|
|
92
|
+
async getAccount() {
|
|
93
|
+
const provider = await this.getProvider();
|
|
94
|
+
const accounts = await provider.request({
|
|
95
|
+
method: "eth_accounts"
|
|
96
|
+
});
|
|
97
|
+
return getAddress(accounts[0]);
|
|
98
|
+
}
|
|
99
|
+
async getChainId() {
|
|
100
|
+
const provider = await this.getProvider();
|
|
101
|
+
const chainId = normalizeChainId(provider.chainId);
|
|
102
|
+
return chainId;
|
|
103
|
+
}
|
|
104
|
+
async getProvider() {
|
|
105
|
+
if (!__privateGet(this, _provider)) {
|
|
106
|
+
let CoinbaseWalletSDK = (await import("@coinbase/wallet-sdk")).default;
|
|
107
|
+
if (typeof CoinbaseWalletSDK !== "function" && typeof CoinbaseWalletSDK.default === "function")
|
|
108
|
+
CoinbaseWalletSDK = CoinbaseWalletSDK.default;
|
|
109
|
+
__privateSet(this, _client, new CoinbaseWalletSDK(this.options));
|
|
110
|
+
class WalletProvider {
|
|
111
|
+
}
|
|
112
|
+
class Client {
|
|
113
|
+
}
|
|
114
|
+
const walletExtensionChainId = __privateGet(this, _client).walletExtension?.getChainId();
|
|
115
|
+
const chain = this.chains.find(
|
|
116
|
+
(chain2) => this.options.chainId ? chain2.id === this.options.chainId : chain2.id === walletExtensionChainId
|
|
117
|
+
) || this.chains[0];
|
|
118
|
+
const chainId = this.options.chainId || chain?.id;
|
|
119
|
+
const jsonRpcUrl = this.options.jsonRpcUrl || chain?.rpcUrls.default;
|
|
120
|
+
__privateSet(this, _provider, __privateGet(this, _client).makeWeb3Provider(jsonRpcUrl, chainId));
|
|
121
|
+
}
|
|
122
|
+
return __privateGet(this, _provider);
|
|
123
|
+
}
|
|
124
|
+
async getSigner({ chainId } = {}) {
|
|
125
|
+
const [provider, account] = await Promise.all([
|
|
126
|
+
this.getProvider(),
|
|
127
|
+
this.getAccount()
|
|
128
|
+
]);
|
|
129
|
+
return new providers.Web3Provider(
|
|
130
|
+
provider,
|
|
131
|
+
chainId
|
|
132
|
+
).getSigner(account);
|
|
133
|
+
}
|
|
134
|
+
async isAuthorized() {
|
|
135
|
+
try {
|
|
136
|
+
const account = await this.getAccount();
|
|
137
|
+
return !!account;
|
|
138
|
+
} catch {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async switchChain(chainId) {
|
|
143
|
+
const provider = await this.getProvider();
|
|
144
|
+
const id = hexValue(chainId);
|
|
145
|
+
try {
|
|
146
|
+
await provider.request({
|
|
147
|
+
method: "wallet_switchEthereumChain",
|
|
148
|
+
params: [{ chainId: id }]
|
|
149
|
+
});
|
|
150
|
+
return this.chains.find((x) => x.id === chainId) ?? {
|
|
151
|
+
id: chainId,
|
|
152
|
+
name: `Chain ${id}`,
|
|
153
|
+
network: `${id}`,
|
|
154
|
+
rpcUrls: { default: "" }
|
|
155
|
+
};
|
|
156
|
+
} catch (error) {
|
|
157
|
+
const chain = this.chains.find((x) => x.id === chainId);
|
|
158
|
+
if (!chain)
|
|
159
|
+
throw new ChainNotConfiguredError({ chainId, connectorId: this.id });
|
|
160
|
+
if (error.code === 4902) {
|
|
161
|
+
try {
|
|
162
|
+
await provider.request({
|
|
163
|
+
method: "wallet_addEthereumChain",
|
|
164
|
+
params: [
|
|
165
|
+
{
|
|
166
|
+
chainId: id,
|
|
167
|
+
chainName: chain.name,
|
|
168
|
+
nativeCurrency: chain.nativeCurrency,
|
|
169
|
+
rpcUrls: [chain.rpcUrls.public ?? chain.rpcUrls.default],
|
|
170
|
+
blockExplorerUrls: this.getBlockExplorerUrls(chain)
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
});
|
|
174
|
+
return chain;
|
|
175
|
+
} catch (addError) {
|
|
176
|
+
if (__privateMethod(this, _isUserRejectedRequestError, isUserRejectedRequestError_fn).call(this, addError))
|
|
177
|
+
throw new UserRejectedRequestError(addError);
|
|
178
|
+
throw new AddChainError();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (__privateMethod(this, _isUserRejectedRequestError, isUserRejectedRequestError_fn).call(this, error))
|
|
182
|
+
throw new UserRejectedRequestError(error);
|
|
183
|
+
throw new SwitchChainError(error);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
async watchAsset({
|
|
187
|
+
address,
|
|
188
|
+
decimals = 18,
|
|
189
|
+
image,
|
|
190
|
+
symbol
|
|
191
|
+
}) {
|
|
192
|
+
const provider = await this.getProvider();
|
|
193
|
+
return provider.request({
|
|
194
|
+
method: "wallet_watchAsset",
|
|
195
|
+
params: {
|
|
196
|
+
type: "ERC20",
|
|
197
|
+
options: {
|
|
198
|
+
address,
|
|
199
|
+
decimals,
|
|
200
|
+
image,
|
|
201
|
+
symbol
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
_client = new WeakMap();
|
|
208
|
+
_provider = new WeakMap();
|
|
209
|
+
_isUserRejectedRequestError = new WeakSet();
|
|
210
|
+
isUserRejectedRequestError_fn = function(error) {
|
|
211
|
+
return /(user rejected)/i.test(error.message);
|
|
212
|
+
};
|
|
213
|
+
export {
|
|
214
|
+
CoinbaseWalletConnector
|
|
215
|
+
};
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { Chain, Ethereum } from '../
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { C as Chain, E as Ethereum } from '../index-bacc1c49.js';
|
|
2
|
+
import { a as InjectedConnectorOptions, I as InjectedConnector } from '../injected-6980e5c3.js';
|
|
3
|
+
import 'abitype';
|
|
4
|
+
import 'ethers';
|
|
5
|
+
import '../base-5bd9b5ed.js';
|
|
6
|
+
import 'eventemitter3';
|
|
7
|
+
|
|
8
|
+
declare type MetaMaskConnectorOptions = Pick<InjectedConnectorOptions, 'shimChainChangedDisconnect' | 'shimDisconnect'> & {
|
|
4
9
|
/**
|
|
5
10
|
* While "disconnected" with `shimDisconnect`, allows user to select a different MetaMask account (than the currently connected account) when trying to connect.
|
|
6
11
|
*/
|
|
7
12
|
UNSTABLE_shimOnConnectSelectAccount?: boolean;
|
|
8
13
|
};
|
|
9
|
-
|
|
14
|
+
declare class MetaMaskConnector extends InjectedConnector {
|
|
10
15
|
#private;
|
|
11
16
|
readonly id = "metaMask";
|
|
12
17
|
readonly ready: boolean;
|
|
@@ -26,3 +31,5 @@ export declare class MetaMaskConnector extends InjectedConnector {
|
|
|
26
31
|
}>;
|
|
27
32
|
getProvider(): Promise<Ethereum | undefined>;
|
|
28
33
|
}
|
|
34
|
+
|
|
35
|
+
export { MetaMaskConnector, MetaMaskConnectorOptions };
|