@talken/talkenkit 2.4.30 → 2.5.1
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/{AbcCredentialManager-DDHLW2IH.js → AbcCredentialManager-5W3B7GI4.js} +1 -1
- package/dist/{abcWallet-TLGPQAMU.js → abcWallet-O5IRLUXL.js} +2 -2
- package/dist/{chunk-ALBABQ53.js → chunk-PN6K4CMZ.js} +4 -1
- package/dist/{chunk-MI7TNBED.js → chunk-UHZL3WSM.js} +709 -86
- package/dist/components/TransactionResultModal/TransactionResultModal.css.d.ts +17 -0
- package/dist/components/TransactionResultModal/TransactionResultModal.d.ts +9 -0
- package/dist/index.css +138 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1344 -980
- package/dist/providers/TransactionResultProvider/TransactionResultContext.d.ts +6 -0
- package/dist/providers/TransactionResultProvider/TransactionResultProvider.d.ts +7 -0
- package/dist/providers/TransactionResultProvider/TransactionResultSingleton.d.ts +16 -0
- package/dist/providers/TransactionResultProvider/index.d.ts +4 -0
- package/dist/providers/TransactionResultProvider/types.d.ts +14 -0
- package/dist/wallets/walletConnectors/abcWallet/AbcCredentialManager.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/AbcEvmAutoConnector.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/abcAccessKeyProvider.d.ts +69 -0
- package/dist/wallets/walletConnectors/abcWallet/abcAccessKeyProvider.js +11 -0
- package/dist/wallets/walletConnectors/abcWallet/abcBitcoinConnector.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/abcBitcoinProvider.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/abcConnector.js +8 -6
- package/dist/wallets/walletConnectors/abcWallet/abcProvider.d.ts +8 -0
- package/dist/wallets/walletConnectors/abcWallet/abcProvider.js +5 -4
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaProvider.d.ts +1 -0
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaProvider.js +8 -8
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaWalletAdapter.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/abcTronProvider.d.ts +1 -0
- package/dist/wallets/walletConnectors/abcWallet/abcTronProvider.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/abcWallet.d.ts +7 -0
- package/dist/wallets/walletConnectors/abcWallet/abcWallet.js +9 -7
- package/dist/wallets/walletConnectors/abcWallet/api/ConfigApi.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/api/TalkenApiClient.d.ts +25 -0
- package/dist/wallets/walletConnectors/abcWallet/api/TalkenApiClient.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/api/TokenApi.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/api/WalletscanApi.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/api/index.js +9 -9
- package/dist/wallets/walletConnectors/abcWallet/constants.d.ts +3 -0
- package/dist/wallets/walletConnectors/abcWallet/constants.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/index.d.ts +1 -1
- package/dist/wallets/walletConnectors/abcWallet/index.js +35 -33
- package/dist/wallets/walletConnectors/abcWallet/sessionUtils.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/types.d.ts +11 -0
- package/dist/wallets/walletConnectors/abcWallet/utils.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/walletGeneration.js +3 -3
- package/dist/wallets/walletConnectors/{chunk-VDWJ3NQ5.js → chunk-25ZDAJ3L.js} +1 -1
- package/dist/wallets/walletConnectors/chunk-4JZPP3S7.js +380 -0
- package/dist/wallets/walletConnectors/{chunk-HHZ3JZRH.js → chunk-4YEALKXG.js} +74 -14
- package/dist/wallets/walletConnectors/{chunk-IN3HEGZM.js → chunk-645DT4TS.js} +46 -5
- package/dist/wallets/walletConnectors/{chunk-XNA5NIFE.js → chunk-6TAU7OQK.js} +7 -4
- package/dist/wallets/walletConnectors/{chunk-MO2AXXLI.js → chunk-FKI5AZVH.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-JADQLTFW.js → chunk-H2AZTZMM.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-NULM3THX.js → chunk-HWRZGGGN.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-BHEVY4QY.js → chunk-KIYXONNH.js} +35 -2
- package/dist/wallets/walletConnectors/{chunk-NU3ITJNK.js → chunk-L6FCF3FH.js} +94 -736
- package/dist/wallets/walletConnectors/{chunk-ACLPF2UW.js → chunk-LIGH2LEU.js} +1 -1
- package/dist/wallets/walletConnectors/chunk-OASBABPG.js +746 -0
- package/dist/wallets/walletConnectors/{chunk-A66MTFML.js → chunk-PF65YS3T.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-6WF4SXLB.js → chunk-QKK3OPQA.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-3LF7FVL6.js → chunk-RGYZNNB6.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-DPTDOCWL.js → chunk-RX2VOIUB.js} +4 -1
- package/dist/wallets/walletConnectors/{chunk-YV6IZWGE.js → chunk-URS2KVYK.js} +45 -2
- package/dist/wallets/walletConnectors/{chunk-BXH3GDX5.js → chunk-YKFI6ZGM.js} +1 -1
- package/dist/wallets/walletConnectors/index.js +47 -45
- package/package.json +1 -1
- package/dist/wallets/walletConnectors/chunk-CABLJOMU.js +0 -194
- package/dist/wallets/walletConnectors/chunk-J3YPHDHM.js +0 -827
- package/dist/wallets/walletConnectors/chunk-J566FC7T.js +0 -54
- package/dist/wallets/walletConnectors/chunk-OHQXPSR6.js +0 -300
- package/dist/wallets/walletConnectors/chunk-OMOYFHBT.js +0 -1485
|
@@ -1,746 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getChainKey,
|
|
4
|
+
getExplorerTxUrl,
|
|
5
|
+
getNetworkName
|
|
6
|
+
} from "./chunk-OASBABPG.js";
|
|
2
7
|
import {
|
|
3
8
|
hexToNumber,
|
|
4
9
|
numberToHex
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
getCredentialManager
|
|
8
|
-
} from "./chunk-6WF4SXLB.js";
|
|
10
|
+
} from "./chunk-PF65YS3T.js";
|
|
9
11
|
import {
|
|
10
12
|
TalkenApiError
|
|
11
13
|
} from "./chunk-4P3SPC44.js";
|
|
14
|
+
import {
|
|
15
|
+
getCredentialManager
|
|
16
|
+
} from "./chunk-QKK3OPQA.js";
|
|
12
17
|
|
|
13
18
|
// src/wallets/walletConnectors/abcWallet/abcProvider.ts
|
|
14
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
getShowPendingTransaction,
|
|
21
|
+
getTalkenApiClient,
|
|
22
|
+
getUpdateTransactionResult
|
|
23
|
+
} from "@talken/talkenkit";
|
|
15
24
|
import { parseGwei } from "viem";
|
|
16
|
-
|
|
17
|
-
// src/config/networks.ts
|
|
18
|
-
var NETWORK_CONFIGS = {
|
|
19
|
-
// Ethereum Mainnet
|
|
20
|
-
1: {
|
|
21
|
-
chainId: 1,
|
|
22
|
-
network: "ethereum",
|
|
23
|
-
name: "Ethereum",
|
|
24
|
-
type: "EVM" /* EVM */,
|
|
25
|
-
isTestnet: false,
|
|
26
|
-
explorer: "https://etherscan.io",
|
|
27
|
-
website: "https://ethereum.org",
|
|
28
|
-
nativeCurrency: {
|
|
29
|
-
name: "Ether",
|
|
30
|
-
symbol: "ETH",
|
|
31
|
-
decimals: 18
|
|
32
|
-
},
|
|
33
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
34
|
-
signSupport: { legacy: true, eip1559: true }
|
|
35
|
-
},
|
|
36
|
-
// Ethereum Sepolia Testnet
|
|
37
|
-
11155111: {
|
|
38
|
-
chainId: 11155111,
|
|
39
|
-
network: "ethereum_sepolia",
|
|
40
|
-
name: "Ethereum Sepolia",
|
|
41
|
-
type: "EVM" /* EVM */,
|
|
42
|
-
isTestnet: true,
|
|
43
|
-
explorer: "https://sepolia.etherscan.io",
|
|
44
|
-
website: "https://ethereum.org",
|
|
45
|
-
nativeCurrency: {
|
|
46
|
-
name: "Sepolia Ether",
|
|
47
|
-
symbol: "ETH",
|
|
48
|
-
decimals: 18
|
|
49
|
-
},
|
|
50
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
51
|
-
signSupport: { legacy: true, eip1559: true }
|
|
52
|
-
},
|
|
53
|
-
// Ethereum Holesky Testnet
|
|
54
|
-
17e3: {
|
|
55
|
-
chainId: 17e3,
|
|
56
|
-
network: "ethereum_holesky",
|
|
57
|
-
name: "Ethereum Holesky",
|
|
58
|
-
type: "EVM" /* EVM */,
|
|
59
|
-
isTestnet: true,
|
|
60
|
-
explorer: "https://holesky.etherscan.io",
|
|
61
|
-
website: "https://ethereum.org",
|
|
62
|
-
nativeCurrency: {
|
|
63
|
-
name: "Holesky Ether",
|
|
64
|
-
symbol: "ETH",
|
|
65
|
-
decimals: 18
|
|
66
|
-
},
|
|
67
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
68
|
-
signSupport: { legacy: true, eip1559: true }
|
|
69
|
-
},
|
|
70
|
-
// Kaia Mainnet (formerly Klaytn)
|
|
71
|
-
8217: {
|
|
72
|
-
chainId: 8217,
|
|
73
|
-
network: "kaia",
|
|
74
|
-
name: "Kaia Mainnet",
|
|
75
|
-
type: "EVM" /* EVM */,
|
|
76
|
-
isTestnet: false,
|
|
77
|
-
explorer: "https://kaiascan.io",
|
|
78
|
-
website: "https://kaia.io",
|
|
79
|
-
nativeCurrency: {
|
|
80
|
-
name: "Kaia",
|
|
81
|
-
symbol: "KAIA",
|
|
82
|
-
decimals: 18
|
|
83
|
-
},
|
|
84
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
85
|
-
signSupport: { legacy: true, eip1559: true }
|
|
86
|
-
},
|
|
87
|
-
// Kaia Kairos Testnet
|
|
88
|
-
1001: {
|
|
89
|
-
chainId: 1001,
|
|
90
|
-
network: "kaia_kairos",
|
|
91
|
-
name: "Kaia Kairos Testnet",
|
|
92
|
-
type: "EVM" /* EVM */,
|
|
93
|
-
isTestnet: true,
|
|
94
|
-
explorer: "https://kairos.kaiascan.io",
|
|
95
|
-
website: "https://kaia.io",
|
|
96
|
-
nativeCurrency: {
|
|
97
|
-
name: "Kaia",
|
|
98
|
-
symbol: "KAIA",
|
|
99
|
-
decimals: 18
|
|
100
|
-
},
|
|
101
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
102
|
-
signSupport: { legacy: true, eip1559: true }
|
|
103
|
-
},
|
|
104
|
-
// Polygon Mainnet
|
|
105
|
-
137: {
|
|
106
|
-
chainId: 137,
|
|
107
|
-
network: "polygon",
|
|
108
|
-
name: "Polygon",
|
|
109
|
-
type: "EVM" /* EVM */,
|
|
110
|
-
isTestnet: false,
|
|
111
|
-
explorer: "https://polygonscan.com",
|
|
112
|
-
website: "https://polygon.technology",
|
|
113
|
-
nativeCurrency: {
|
|
114
|
-
name: "MATIC",
|
|
115
|
-
symbol: "MATIC",
|
|
116
|
-
decimals: 18
|
|
117
|
-
},
|
|
118
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
119
|
-
signSupport: { legacy: true, eip1559: true }
|
|
120
|
-
},
|
|
121
|
-
// Polygon Amoy Testnet
|
|
122
|
-
80002: {
|
|
123
|
-
chainId: 80002,
|
|
124
|
-
network: "polygon_amoy",
|
|
125
|
-
name: "Polygon Amoy Testnet",
|
|
126
|
-
type: "EVM" /* EVM */,
|
|
127
|
-
isTestnet: true,
|
|
128
|
-
explorer: "https://amoy.polygonscan.com",
|
|
129
|
-
website: "https://polygon.technology",
|
|
130
|
-
nativeCurrency: {
|
|
131
|
-
name: "MATIC",
|
|
132
|
-
symbol: "MATIC",
|
|
133
|
-
decimals: 18
|
|
134
|
-
},
|
|
135
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
136
|
-
signSupport: { legacy: true, eip1559: true }
|
|
137
|
-
},
|
|
138
|
-
// Binance Smart Chain Mainnet
|
|
139
|
-
56: {
|
|
140
|
-
chainId: 56,
|
|
141
|
-
network: "binance",
|
|
142
|
-
name: "Binance Smart Chain Mainnet",
|
|
143
|
-
type: "EVM" /* EVM */,
|
|
144
|
-
isTestnet: false,
|
|
145
|
-
explorer: "https://bscscan.com",
|
|
146
|
-
website: "https://www.bnbchain.org/en/bnb-smart-chain",
|
|
147
|
-
nativeCurrency: {
|
|
148
|
-
name: "BNB",
|
|
149
|
-
symbol: "BNB",
|
|
150
|
-
decimals: 18
|
|
151
|
-
},
|
|
152
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
153
|
-
signSupport: { legacy: true, eip1559: true }
|
|
154
|
-
},
|
|
155
|
-
// Binance Smart Chain Testnet
|
|
156
|
-
97: {
|
|
157
|
-
chainId: 97,
|
|
158
|
-
network: "binance_testnet",
|
|
159
|
-
name: "Binance Smart Chain Testnet",
|
|
160
|
-
type: "EVM" /* EVM */,
|
|
161
|
-
isTestnet: true,
|
|
162
|
-
explorer: "https://testnet.bscscan.com",
|
|
163
|
-
website: "https://www.bnbchain.org/en/bnb-smart-chain",
|
|
164
|
-
nativeCurrency: {
|
|
165
|
-
name: "BNB",
|
|
166
|
-
symbol: "BNB",
|
|
167
|
-
decimals: 18
|
|
168
|
-
},
|
|
169
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
170
|
-
signSupport: { legacy: true, eip1559: true }
|
|
171
|
-
},
|
|
172
|
-
// Arbitrum One
|
|
173
|
-
42161: {
|
|
174
|
-
chainId: 42161,
|
|
175
|
-
network: "arbitrum",
|
|
176
|
-
name: "Arbitrum One",
|
|
177
|
-
type: "EVM" /* EVM */,
|
|
178
|
-
isTestnet: false,
|
|
179
|
-
explorer: "https://arbiscan.io",
|
|
180
|
-
website: "https://arbitrum.io",
|
|
181
|
-
nativeCurrency: {
|
|
182
|
-
name: "Ether",
|
|
183
|
-
symbol: "ETH",
|
|
184
|
-
decimals: 18
|
|
185
|
-
},
|
|
186
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
187
|
-
signSupport: { legacy: true, eip1559: true }
|
|
188
|
-
},
|
|
189
|
-
// Arbitrum Sepolia
|
|
190
|
-
421614: {
|
|
191
|
-
chainId: 421614,
|
|
192
|
-
network: "arbitrum_sepolia",
|
|
193
|
-
name: "Arbitrum Sepolia",
|
|
194
|
-
type: "EVM" /* EVM */,
|
|
195
|
-
isTestnet: true,
|
|
196
|
-
explorer: "https://sepolia.arbiscan.io",
|
|
197
|
-
website: "https://arbitrum.io",
|
|
198
|
-
nativeCurrency: {
|
|
199
|
-
name: "Ether",
|
|
200
|
-
symbol: "ETH",
|
|
201
|
-
decimals: 18
|
|
202
|
-
},
|
|
203
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
204
|
-
signSupport: { legacy: true, eip1559: true }
|
|
205
|
-
},
|
|
206
|
-
// Optimism Mainnet
|
|
207
|
-
10: {
|
|
208
|
-
chainId: 10,
|
|
209
|
-
network: "optimism",
|
|
210
|
-
name: "Optimism",
|
|
211
|
-
type: "EVM" /* EVM */,
|
|
212
|
-
isTestnet: false,
|
|
213
|
-
explorer: "https://optimistic.etherscan.io",
|
|
214
|
-
website: "https://optimism.io",
|
|
215
|
-
nativeCurrency: {
|
|
216
|
-
name: "Ether",
|
|
217
|
-
symbol: "ETH",
|
|
218
|
-
decimals: 18
|
|
219
|
-
},
|
|
220
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
221
|
-
signSupport: { legacy: true, eip1559: true }
|
|
222
|
-
},
|
|
223
|
-
// Optimism Sepolia
|
|
224
|
-
420: {
|
|
225
|
-
chainId: 420,
|
|
226
|
-
network: "optimism_sepolia",
|
|
227
|
-
name: "Optimism Sepolia",
|
|
228
|
-
type: "EVM" /* EVM */,
|
|
229
|
-
isTestnet: true,
|
|
230
|
-
explorer: "https://sepolia-optimism.etherscan.io",
|
|
231
|
-
website: "https://optimism.io",
|
|
232
|
-
nativeCurrency: {
|
|
233
|
-
name: "Ether",
|
|
234
|
-
symbol: "ETH",
|
|
235
|
-
decimals: 18
|
|
236
|
-
},
|
|
237
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
238
|
-
signSupport: { legacy: true, eip1559: true }
|
|
239
|
-
},
|
|
240
|
-
// Avalanche C-Chain
|
|
241
|
-
43114: {
|
|
242
|
-
chainId: 43114,
|
|
243
|
-
network: "avalanche",
|
|
244
|
-
name: "Avalanche C-Chain",
|
|
245
|
-
type: "EVM" /* EVM */,
|
|
246
|
-
isTestnet: false,
|
|
247
|
-
explorer: "https://avascan.info/blockchain/c/home",
|
|
248
|
-
website: "https://avax.network",
|
|
249
|
-
nativeCurrency: {
|
|
250
|
-
name: "Avalanche",
|
|
251
|
-
symbol: "AVAX",
|
|
252
|
-
decimals: 18
|
|
253
|
-
},
|
|
254
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
255
|
-
signSupport: { legacy: true, eip1559: true }
|
|
256
|
-
},
|
|
257
|
-
// Avalanche Fuji Testnet
|
|
258
|
-
43113: {
|
|
259
|
-
chainId: 43113,
|
|
260
|
-
network: "avalanche_fuji",
|
|
261
|
-
name: "Avalanche Fuji Testnet",
|
|
262
|
-
type: "EVM" /* EVM */,
|
|
263
|
-
isTestnet: true,
|
|
264
|
-
explorer: "https://testnet.avascan.info",
|
|
265
|
-
website: "https://avax.network",
|
|
266
|
-
nativeCurrency: {
|
|
267
|
-
name: "Avalanche",
|
|
268
|
-
symbol: "AVAX",
|
|
269
|
-
decimals: 18
|
|
270
|
-
},
|
|
271
|
-
apiSupport: { tokens: false, nft: false, transactions: false },
|
|
272
|
-
signSupport: { legacy: true, eip1559: true }
|
|
273
|
-
},
|
|
274
|
-
// Mantle Mainnet
|
|
275
|
-
5e3: {
|
|
276
|
-
chainId: 5e3,
|
|
277
|
-
network: "mantle",
|
|
278
|
-
name: "Mantle Mainnet",
|
|
279
|
-
type: "EVM" /* EVM */,
|
|
280
|
-
isTestnet: false,
|
|
281
|
-
explorer: "https://explorer.mantle.xyz",
|
|
282
|
-
website: "https://www.mantle.xyz",
|
|
283
|
-
nativeCurrency: {
|
|
284
|
-
name: "Mantle",
|
|
285
|
-
symbol: "MNT",
|
|
286
|
-
decimals: 18
|
|
287
|
-
},
|
|
288
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
289
|
-
signSupport: { legacy: true, eip1559: true }
|
|
290
|
-
},
|
|
291
|
-
// Mantle Testnet
|
|
292
|
-
5001: {
|
|
293
|
-
chainId: 5001,
|
|
294
|
-
network: "mantle_testnet",
|
|
295
|
-
name: "Mantle Testnet",
|
|
296
|
-
type: "EVM" /* EVM */,
|
|
297
|
-
isTestnet: true,
|
|
298
|
-
explorer: "https://sepolia.mantlescan.xyz",
|
|
299
|
-
website: "https://www.mantle.xyz",
|
|
300
|
-
nativeCurrency: {
|
|
301
|
-
name: "Mantle",
|
|
302
|
-
symbol: "MNT",
|
|
303
|
-
decimals: 18
|
|
304
|
-
},
|
|
305
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
306
|
-
signSupport: { legacy: true, eip1559: true }
|
|
307
|
-
},
|
|
308
|
-
// Moonbeam
|
|
309
|
-
1284: {
|
|
310
|
-
chainId: 1284,
|
|
311
|
-
network: "moonbeam",
|
|
312
|
-
name: "Moonbeam",
|
|
313
|
-
type: "EVM" /* EVM */,
|
|
314
|
-
isTestnet: false,
|
|
315
|
-
explorer: "https://moonbeam.moonscan.io",
|
|
316
|
-
website: "https://moonbeam.network",
|
|
317
|
-
nativeCurrency: {
|
|
318
|
-
name: "Glimmer",
|
|
319
|
-
symbol: "GLMR",
|
|
320
|
-
decimals: 18
|
|
321
|
-
},
|
|
322
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
323
|
-
signSupport: { legacy: true, eip1559: true }
|
|
324
|
-
},
|
|
325
|
-
// Moonriver
|
|
326
|
-
1285: {
|
|
327
|
-
chainId: 1285,
|
|
328
|
-
network: "moonriver",
|
|
329
|
-
name: "Moonriver",
|
|
330
|
-
type: "EVM" /* EVM */,
|
|
331
|
-
isTestnet: false,
|
|
332
|
-
explorer: "https://moonriver.moonscan.io",
|
|
333
|
-
website: "https://moonbeam.network/networks/moonriver",
|
|
334
|
-
nativeCurrency: {
|
|
335
|
-
name: "Moonriver",
|
|
336
|
-
symbol: "MOVR",
|
|
337
|
-
decimals: 18
|
|
338
|
-
},
|
|
339
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
340
|
-
signSupport: { legacy: true, eip1559: true }
|
|
341
|
-
},
|
|
342
|
-
// Scroll Mainnet
|
|
343
|
-
534352: {
|
|
344
|
-
chainId: 534352,
|
|
345
|
-
network: "scroll",
|
|
346
|
-
name: "Scroll",
|
|
347
|
-
type: "EVM" /* EVM */,
|
|
348
|
-
isTestnet: false,
|
|
349
|
-
explorer: "https://scrollscan.co",
|
|
350
|
-
website: "https://scroll.io",
|
|
351
|
-
nativeCurrency: {
|
|
352
|
-
name: "Ether",
|
|
353
|
-
symbol: "ETH",
|
|
354
|
-
decimals: 18
|
|
355
|
-
},
|
|
356
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
357
|
-
signSupport: { legacy: true, eip1559: true }
|
|
358
|
-
},
|
|
359
|
-
// Scroll Testnet
|
|
360
|
-
534351: {
|
|
361
|
-
chainId: 534351,
|
|
362
|
-
network: "scroll_testnet",
|
|
363
|
-
name: "Scroll Testnet",
|
|
364
|
-
type: "EVM" /* EVM */,
|
|
365
|
-
isTestnet: true,
|
|
366
|
-
explorer: "https://sepolia.scrollscan.com",
|
|
367
|
-
website: "https://scroll.io",
|
|
368
|
-
nativeCurrency: {
|
|
369
|
-
name: "Ether",
|
|
370
|
-
symbol: "ETH",
|
|
371
|
-
decimals: 18
|
|
372
|
-
},
|
|
373
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
374
|
-
signSupport: { legacy: true, eip1559: true }
|
|
375
|
-
},
|
|
376
|
-
// Silicon Mainnet
|
|
377
|
-
2355: {
|
|
378
|
-
chainId: 2355,
|
|
379
|
-
network: "silicon",
|
|
380
|
-
name: "Silicon",
|
|
381
|
-
type: "EVM" /* EVM */,
|
|
382
|
-
isTestnet: false,
|
|
383
|
-
explorer: "https://scope.silicon.network",
|
|
384
|
-
website: "https://silicon.network",
|
|
385
|
-
nativeCurrency: {
|
|
386
|
-
name: "Ether",
|
|
387
|
-
symbol: "ETH",
|
|
388
|
-
decimals: 18
|
|
389
|
-
},
|
|
390
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
391
|
-
signSupport: { legacy: true, eip1559: true }
|
|
392
|
-
},
|
|
393
|
-
// Silicon Sepolia
|
|
394
|
-
1722641160: {
|
|
395
|
-
chainId: 1722641160,
|
|
396
|
-
network: "silicon_sepolia",
|
|
397
|
-
name: "Silicon Sepolia",
|
|
398
|
-
type: "EVM" /* EVM */,
|
|
399
|
-
isTestnet: true,
|
|
400
|
-
explorer: "https://scope-sepolia.silicon.network",
|
|
401
|
-
website: "https://silicon.network",
|
|
402
|
-
nativeCurrency: {
|
|
403
|
-
name: "Ether",
|
|
404
|
-
symbol: "ETH",
|
|
405
|
-
decimals: 18
|
|
406
|
-
},
|
|
407
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
408
|
-
signSupport: { legacy: true, eip1559: true }
|
|
409
|
-
},
|
|
410
|
-
// Six Protocol
|
|
411
|
-
98: {
|
|
412
|
-
chainId: 98,
|
|
413
|
-
network: "six_evm",
|
|
414
|
-
name: "Six Protocol",
|
|
415
|
-
type: "EVM" /* EVM */,
|
|
416
|
-
isTestnet: false,
|
|
417
|
-
explorer: "https://v2.sixscan.io",
|
|
418
|
-
website: "https://www.six.network",
|
|
419
|
-
nativeCurrency: {
|
|
420
|
-
name: "SIX",
|
|
421
|
-
symbol: "SIX",
|
|
422
|
-
decimals: 18
|
|
423
|
-
},
|
|
424
|
-
apiSupport: { tokens: true, nft: false, transactions: true },
|
|
425
|
-
signSupport: { legacy: true, eip1559: false }
|
|
426
|
-
},
|
|
427
|
-
// Six Protocol Testnet
|
|
428
|
-
150: {
|
|
429
|
-
chainId: 150,
|
|
430
|
-
network: "six_evm_testnet",
|
|
431
|
-
name: "Six Protocol Testnet",
|
|
432
|
-
type: "EVM" /* EVM */,
|
|
433
|
-
isTestnet: true,
|
|
434
|
-
explorer: "https://v2.fivenet.sixscan.io",
|
|
435
|
-
website: "https://www.six.network",
|
|
436
|
-
nativeCurrency: {
|
|
437
|
-
name: "SIX",
|
|
438
|
-
symbol: "SIX",
|
|
439
|
-
decimals: 18
|
|
440
|
-
},
|
|
441
|
-
apiSupport: { tokens: true, nft: false, transactions: true },
|
|
442
|
-
signSupport: { legacy: true, eip1559: false }
|
|
443
|
-
},
|
|
444
|
-
// Wemix Mainnet
|
|
445
|
-
1111: {
|
|
446
|
-
chainId: 1111,
|
|
447
|
-
network: "wemix",
|
|
448
|
-
name: "Wemix3.0 Mainnet",
|
|
449
|
-
type: "EVM" /* EVM */,
|
|
450
|
-
isTestnet: false,
|
|
451
|
-
explorer: "https://explorer.wemix.com",
|
|
452
|
-
website: "https://wemix.com",
|
|
453
|
-
nativeCurrency: {
|
|
454
|
-
name: "WEMIX",
|
|
455
|
-
symbol: "WEMIX",
|
|
456
|
-
decimals: 18
|
|
457
|
-
},
|
|
458
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
459
|
-
signSupport: { legacy: true, eip1559: true }
|
|
460
|
-
},
|
|
461
|
-
// Wemix Testnet
|
|
462
|
-
1112: {
|
|
463
|
-
chainId: 1112,
|
|
464
|
-
network: "wemix_testnet",
|
|
465
|
-
name: "Wemix3.0 Testnet",
|
|
466
|
-
type: "EVM" /* EVM */,
|
|
467
|
-
isTestnet: true,
|
|
468
|
-
explorer: "https://explorer.test.wemix.com",
|
|
469
|
-
website: "https://wemix.com",
|
|
470
|
-
nativeCurrency: {
|
|
471
|
-
name: "WEMIX",
|
|
472
|
-
symbol: "WEMIX",
|
|
473
|
-
decimals: 18
|
|
474
|
-
},
|
|
475
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
476
|
-
signSupport: { legacy: true, eip1559: true }
|
|
477
|
-
},
|
|
478
|
-
// Taiko Mainnet
|
|
479
|
-
167e3: {
|
|
480
|
-
chainId: 167e3,
|
|
481
|
-
network: "taiko",
|
|
482
|
-
name: "Taiko Mainnet",
|
|
483
|
-
type: "EVM" /* EVM */,
|
|
484
|
-
isTestnet: false,
|
|
485
|
-
explorer: "https://taikoscan.io",
|
|
486
|
-
website: "https://taiko.xyz",
|
|
487
|
-
nativeCurrency: {
|
|
488
|
-
name: "Ether",
|
|
489
|
-
symbol: "ETH",
|
|
490
|
-
decimals: 18
|
|
491
|
-
},
|
|
492
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
493
|
-
signSupport: { legacy: true, eip1559: true }
|
|
494
|
-
},
|
|
495
|
-
// Taiko Hekla Testnet
|
|
496
|
-
167009: {
|
|
497
|
-
chainId: 167009,
|
|
498
|
-
network: "taiko_hekla",
|
|
499
|
-
name: "Taiko Hekla Testnet",
|
|
500
|
-
type: "EVM" /* EVM */,
|
|
501
|
-
isTestnet: true,
|
|
502
|
-
explorer: "https://hekla.taikoscan.io",
|
|
503
|
-
website: "https://taiko.xyz",
|
|
504
|
-
nativeCurrency: {
|
|
505
|
-
name: "Ether",
|
|
506
|
-
symbol: "ETH",
|
|
507
|
-
decimals: 18
|
|
508
|
-
},
|
|
509
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
510
|
-
signSupport: { legacy: true, eip1559: true }
|
|
511
|
-
},
|
|
512
|
-
// Base Mainnet
|
|
513
|
-
8453: {
|
|
514
|
-
chainId: 8453,
|
|
515
|
-
network: "base",
|
|
516
|
-
name: "Base",
|
|
517
|
-
type: "EVM" /* EVM */,
|
|
518
|
-
isTestnet: false,
|
|
519
|
-
explorer: "https://basescan.org",
|
|
520
|
-
website: "https://base.org",
|
|
521
|
-
nativeCurrency: {
|
|
522
|
-
name: "Ether",
|
|
523
|
-
symbol: "ETH",
|
|
524
|
-
decimals: 18
|
|
525
|
-
},
|
|
526
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
527
|
-
signSupport: { legacy: true, eip1559: true }
|
|
528
|
-
},
|
|
529
|
-
// Base Sepolia Testnet
|
|
530
|
-
84532: {
|
|
531
|
-
chainId: 84532,
|
|
532
|
-
network: "base_sepolia",
|
|
533
|
-
name: "Base Sepolia",
|
|
534
|
-
type: "EVM" /* EVM */,
|
|
535
|
-
isTestnet: true,
|
|
536
|
-
explorer: "https://sepolia.basescan.org",
|
|
537
|
-
website: "https://base.org",
|
|
538
|
-
nativeCurrency: {
|
|
539
|
-
name: "Ether",
|
|
540
|
-
symbol: "ETH",
|
|
541
|
-
decimals: 18
|
|
542
|
-
},
|
|
543
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
544
|
-
signSupport: { legacy: true, eip1559: true }
|
|
545
|
-
},
|
|
546
|
-
// ChainBounty Mainnet
|
|
547
|
-
51828: {
|
|
548
|
-
chainId: 51828,
|
|
549
|
-
network: "chainbounty",
|
|
550
|
-
name: "ChainBounty Mainnet",
|
|
551
|
-
type: "EVM" /* EVM */,
|
|
552
|
-
isTestnet: false,
|
|
553
|
-
explorer: "https://scan.chainbounty.io",
|
|
554
|
-
website: "https://chainbounty.io",
|
|
555
|
-
nativeCurrency: {
|
|
556
|
-
name: "ChainBounty",
|
|
557
|
-
symbol: "CBY",
|
|
558
|
-
decimals: 18
|
|
559
|
-
},
|
|
560
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
561
|
-
signSupport: { legacy: true, eip1559: true }
|
|
562
|
-
},
|
|
563
|
-
// ChainBounty Testnet
|
|
564
|
-
56580: {
|
|
565
|
-
chainId: 56580,
|
|
566
|
-
network: "chainbounty_testnet",
|
|
567
|
-
name: "ChainBounty Testnet",
|
|
568
|
-
type: "EVM" /* EVM */,
|
|
569
|
-
isTestnet: true,
|
|
570
|
-
explorer: "https://test.scan.chainbounty.io",
|
|
571
|
-
website: "https://chainbounty.io",
|
|
572
|
-
nativeCurrency: {
|
|
573
|
-
name: "ChainBounty",
|
|
574
|
-
symbol: "CBY",
|
|
575
|
-
decimals: 18
|
|
576
|
-
},
|
|
577
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
578
|
-
signSupport: { legacy: true, eip1559: true }
|
|
579
|
-
},
|
|
580
|
-
// Aptos Mainnet (Non-EVM)
|
|
581
|
-
aptos: {
|
|
582
|
-
chainId: null,
|
|
583
|
-
network: "aptos",
|
|
584
|
-
name: "Aptos",
|
|
585
|
-
type: "Non-EVM" /* NON_EVM */,
|
|
586
|
-
isTestnet: false,
|
|
587
|
-
explorer: "https://explorer.aptoslabs.com/?network=mainnet",
|
|
588
|
-
website: "https://aptos.dev",
|
|
589
|
-
nativeCurrency: {
|
|
590
|
-
name: "Aptos",
|
|
591
|
-
symbol: "APT",
|
|
592
|
-
decimals: 8
|
|
593
|
-
},
|
|
594
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
595
|
-
signSupport: { legacy: true, eip1559: false }
|
|
596
|
-
},
|
|
597
|
-
// Aptos Testnet (Non-EVM)
|
|
598
|
-
aptos_testnet: {
|
|
599
|
-
chainId: null,
|
|
600
|
-
network: "aptos_testnet",
|
|
601
|
-
name: "Aptos Testnet",
|
|
602
|
-
type: "Non-EVM" /* NON_EVM */,
|
|
603
|
-
isTestnet: true,
|
|
604
|
-
explorer: "https://explorer.aptoslabs.com/?network=testnet",
|
|
605
|
-
website: "https://aptos.dev",
|
|
606
|
-
nativeCurrency: {
|
|
607
|
-
name: "Aptos",
|
|
608
|
-
symbol: "APT",
|
|
609
|
-
decimals: 8
|
|
610
|
-
},
|
|
611
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
612
|
-
signSupport: { legacy: true, eip1559: false }
|
|
613
|
-
},
|
|
614
|
-
// Bitcoin Mainnet
|
|
615
|
-
bitcoin: {
|
|
616
|
-
chainId: null,
|
|
617
|
-
network: "bitcoin",
|
|
618
|
-
name: "Bitcoin Mainnet",
|
|
619
|
-
type: "Bitcoin" /* BITCOIN */,
|
|
620
|
-
isTestnet: false,
|
|
621
|
-
explorer: "https://blockstream.info",
|
|
622
|
-
website: "https://bitcoin.org",
|
|
623
|
-
nativeCurrency: {
|
|
624
|
-
name: "Bitcoin",
|
|
625
|
-
symbol: "BTC",
|
|
626
|
-
decimals: 8
|
|
627
|
-
},
|
|
628
|
-
apiSupport: { tokens: true, nft: false, transactions: true },
|
|
629
|
-
signSupport: { legacy: true, eip1559: false }
|
|
630
|
-
},
|
|
631
|
-
// Bitcoin Testnet
|
|
632
|
-
bitcoin_testnet: {
|
|
633
|
-
chainId: null,
|
|
634
|
-
network: "bitcoin_testnet",
|
|
635
|
-
name: "Bitcoin Testnet",
|
|
636
|
-
type: "Bitcoin" /* BITCOIN */,
|
|
637
|
-
isTestnet: true,
|
|
638
|
-
explorer: "https://blockstream.info/testnet",
|
|
639
|
-
website: "https://bitcoin.org",
|
|
640
|
-
nativeCurrency: {
|
|
641
|
-
name: "Bitcoin",
|
|
642
|
-
symbol: "BTC",
|
|
643
|
-
decimals: 8
|
|
644
|
-
},
|
|
645
|
-
apiSupport: { tokens: true, nft: false, transactions: true },
|
|
646
|
-
signSupport: { legacy: true, eip1559: false }
|
|
647
|
-
},
|
|
648
|
-
// Tron Mainnet
|
|
649
|
-
tron: {
|
|
650
|
-
chainId: null,
|
|
651
|
-
network: "tron",
|
|
652
|
-
name: "Tron Mainnet",
|
|
653
|
-
type: "TRX" /* TRON */,
|
|
654
|
-
isTestnet: false,
|
|
655
|
-
explorer: "https://tronscan.org",
|
|
656
|
-
website: "https://tron.network",
|
|
657
|
-
nativeCurrency: {
|
|
658
|
-
name: "Tronix",
|
|
659
|
-
symbol: "TRX",
|
|
660
|
-
decimals: 6
|
|
661
|
-
},
|
|
662
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
663
|
-
signSupport: { legacy: true, eip1559: true }
|
|
664
|
-
},
|
|
665
|
-
// Tron Nile Testnet
|
|
666
|
-
tron_nile: {
|
|
667
|
-
chainId: null,
|
|
668
|
-
network: "tron_nile",
|
|
669
|
-
name: "Tron Nile Testnet",
|
|
670
|
-
type: "TRX" /* TRON */,
|
|
671
|
-
isTestnet: true,
|
|
672
|
-
explorer: "https://nile.tronscan.org",
|
|
673
|
-
website: "https://tron.network",
|
|
674
|
-
nativeCurrency: {
|
|
675
|
-
name: "Tronix",
|
|
676
|
-
symbol: "TRX",
|
|
677
|
-
decimals: 6
|
|
678
|
-
},
|
|
679
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
680
|
-
signSupport: { legacy: true, eip1559: true }
|
|
681
|
-
},
|
|
682
|
-
// ICP Mainnet
|
|
683
|
-
icp: {
|
|
684
|
-
chainId: null,
|
|
685
|
-
network: "icp",
|
|
686
|
-
name: "Internet Computer",
|
|
687
|
-
type: "ICP" /* ICP */,
|
|
688
|
-
isTestnet: false,
|
|
689
|
-
explorer: "https://dashboard.internetcomputer.org",
|
|
690
|
-
website: "https://internetcomputer.org",
|
|
691
|
-
nativeCurrency: {
|
|
692
|
-
name: "ICP",
|
|
693
|
-
symbol: "ICP",
|
|
694
|
-
decimals: 8
|
|
695
|
-
},
|
|
696
|
-
apiSupport: { tokens: true, nft: true, transactions: true },
|
|
697
|
-
signSupport: { legacy: true, eip1559: true }
|
|
698
|
-
}
|
|
699
|
-
};
|
|
700
|
-
var NETWORK_BY_PARAM = Object.values(
|
|
701
|
-
NETWORK_CONFIGS
|
|
702
|
-
).reduce(
|
|
703
|
-
(acc, config) => {
|
|
704
|
-
acc[config.network] = config;
|
|
705
|
-
return acc;
|
|
706
|
-
},
|
|
707
|
-
{}
|
|
708
|
-
);
|
|
709
|
-
function getNetworkName(chainId, fallback = "ethereum") {
|
|
710
|
-
return NETWORK_CONFIGS[chainId]?.network ?? fallback;
|
|
711
|
-
}
|
|
712
|
-
var CHAIN_ID_TO_KEY = {
|
|
713
|
-
// Mainnet
|
|
714
|
-
1: "ethereum",
|
|
715
|
-
42161: "arbitrum",
|
|
716
|
-
8217: "kaia",
|
|
717
|
-
56: "bsc",
|
|
718
|
-
8453: "base",
|
|
719
|
-
137: "polygon",
|
|
720
|
-
43114: "avalanche",
|
|
721
|
-
5e3: "mantle",
|
|
722
|
-
51828: "chainbounty",
|
|
723
|
-
// Testnet
|
|
724
|
-
11155111: "sepolia",
|
|
725
|
-
421614: "arbitrumSepolia",
|
|
726
|
-
1001: "kaiaKairos",
|
|
727
|
-
97: "bscTestnet",
|
|
728
|
-
84532: "baseSepolia",
|
|
729
|
-
80002: "polygonAmoy",
|
|
730
|
-
43113: "avalancheFuji",
|
|
731
|
-
5003: "mantleSepolia",
|
|
732
|
-
56580: "chainbountyTestnet",
|
|
733
|
-
998: "hyperevmTestnet"
|
|
734
|
-
};
|
|
735
|
-
function getChainKey(chainId) {
|
|
736
|
-
const key = CHAIN_ID_TO_KEY[chainId];
|
|
737
|
-
if (!key) {
|
|
738
|
-
throw new Error(`Unsupported chainId for tx endpoint: ${chainId}`);
|
|
739
|
-
}
|
|
740
|
-
return key;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
// src/wallets/walletConnectors/abcWallet/abcProvider.ts
|
|
744
25
|
var EventEmitter = class {
|
|
745
26
|
constructor() {
|
|
746
27
|
this.events = /* @__PURE__ */ new Map();
|
|
@@ -984,10 +265,12 @@ var AbcEvmProvider = class extends EventEmitter {
|
|
|
984
265
|
return this.eth_getTransactionCount(
|
|
985
266
|
Array.isArray(params) ? params : []
|
|
986
267
|
);
|
|
987
|
-
case "eth_blockNumber":
|
|
988
268
|
case "eth_call":
|
|
989
|
-
|
|
269
|
+
return this.eth_call(params);
|
|
990
270
|
case "eth_getBalance":
|
|
271
|
+
return this.eth_getBalance(params);
|
|
272
|
+
case "eth_blockNumber":
|
|
273
|
+
case "eth_gasPrice":
|
|
991
274
|
case "eth_getBlockByHash":
|
|
992
275
|
case "eth_getBlockByNumber":
|
|
993
276
|
case "eth_getCode":
|
|
@@ -1110,10 +393,20 @@ var AbcEvmProvider = class extends EventEmitter {
|
|
|
1110
393
|
const hexValue = tx.value || "0x0";
|
|
1111
394
|
const amountWei = BigInt(hexValue).toString();
|
|
1112
395
|
const email = this.getRecoveryEmail();
|
|
396
|
+
const chainKey = getChainKey(this.chainId);
|
|
397
|
+
const showPending = getShowPendingTransaction();
|
|
398
|
+
if (showPending) {
|
|
399
|
+
showPending({
|
|
400
|
+
txHash: "",
|
|
401
|
+
network: chainKey,
|
|
402
|
+
chain: "evm",
|
|
403
|
+
explorerUrl: void 0
|
|
404
|
+
});
|
|
405
|
+
}
|
|
1113
406
|
const api = this.getTalkenApiClientOrThrow();
|
|
1114
407
|
const result = await this.withSigningCredentialRetry(
|
|
1115
408
|
() => api.evm.sendTransaction({
|
|
1116
|
-
chainKey
|
|
409
|
+
chainKey,
|
|
1117
410
|
to: tx.to,
|
|
1118
411
|
amountWei,
|
|
1119
412
|
pin: pinHash,
|
|
@@ -1121,9 +414,20 @@ var AbcEvmProvider = class extends EventEmitter {
|
|
|
1121
414
|
gasLimit: tx.gas || tx.gasLimit,
|
|
1122
415
|
maxFeePerGas: tx.maxFeePerGas,
|
|
1123
416
|
maxPriorityFeePerGas: tx.maxPriorityFeePerGas,
|
|
417
|
+
waitForReceipt: true,
|
|
1124
418
|
...email && { email }
|
|
1125
419
|
})
|
|
1126
420
|
);
|
|
421
|
+
const updateResult = getUpdateTransactionResult();
|
|
422
|
+
if (updateResult) {
|
|
423
|
+
updateResult({
|
|
424
|
+
txHash: result.txHash,
|
|
425
|
+
network: chainKey,
|
|
426
|
+
chain: "evm",
|
|
427
|
+
receipt: result.receipt ?? null,
|
|
428
|
+
explorerUrl: getExplorerTxUrl(this.chainId, result.txHash)
|
|
429
|
+
});
|
|
430
|
+
}
|
|
1127
431
|
return result.txHash;
|
|
1128
432
|
}
|
|
1129
433
|
/**
|
|
@@ -1454,6 +758,60 @@ var AbcEvmProvider = class extends EventEmitter {
|
|
|
1454
758
|
return "0x5208";
|
|
1455
759
|
}
|
|
1456
760
|
}
|
|
761
|
+
/**
|
|
762
|
+
* Execute read-only eth_call via talken-api
|
|
763
|
+
*/
|
|
764
|
+
async eth_call(params) {
|
|
765
|
+
const p = Array.isArray(params) ? params : [];
|
|
766
|
+
const tx = p[0];
|
|
767
|
+
if (!tx?.to || !tx?.data) {
|
|
768
|
+
throw new ProviderRpcError(
|
|
769
|
+
ErrorCode.INVALID_PARAMS,
|
|
770
|
+
"eth_call requires to and data"
|
|
771
|
+
);
|
|
772
|
+
}
|
|
773
|
+
try {
|
|
774
|
+
const api = this.getTalkenApiClientOrThrow();
|
|
775
|
+
const response = await api.evm.ethCall({
|
|
776
|
+
network: getNetworkName(this.chainId),
|
|
777
|
+
to: tx.to,
|
|
778
|
+
data: tx.data,
|
|
779
|
+
from: tx.from || this.wallet?.address
|
|
780
|
+
});
|
|
781
|
+
return response?.result ?? response?.data ?? "0x";
|
|
782
|
+
} catch (error) {
|
|
783
|
+
throw new ProviderRpcError(
|
|
784
|
+
ErrorCode.INTERNAL_ERROR,
|
|
785
|
+
`eth_call failed: ${error instanceof Error ? error.message : String(error)}`
|
|
786
|
+
);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Get native balance via talken-api
|
|
791
|
+
*/
|
|
792
|
+
async eth_getBalance(params) {
|
|
793
|
+
const p = Array.isArray(params) ? params : [];
|
|
794
|
+
const address = p[0] || this.wallet?.address;
|
|
795
|
+
if (!address) {
|
|
796
|
+
throw new ProviderRpcError(
|
|
797
|
+
ErrorCode.INVALID_PARAMS,
|
|
798
|
+
"Missing address parameter"
|
|
799
|
+
);
|
|
800
|
+
}
|
|
801
|
+
try {
|
|
802
|
+
const api = this.getTalkenApiClientOrThrow();
|
|
803
|
+
const response = await api.evm.getBalance(
|
|
804
|
+
getNetworkName(this.chainId),
|
|
805
|
+
address
|
|
806
|
+
);
|
|
807
|
+
return response?.balance ?? "0x0";
|
|
808
|
+
} catch (error) {
|
|
809
|
+
throw new ProviderRpcError(
|
|
810
|
+
ErrorCode.INTERNAL_ERROR,
|
|
811
|
+
`eth_getBalance failed: ${error instanceof Error ? error.message : String(error)}`
|
|
812
|
+
);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
1457
815
|
/**
|
|
1458
816
|
* Check if connected
|
|
1459
817
|
*/
|