@openocean.finance/openocean-sdk 0.5.35 → 1.0.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.
@@ -0,0 +1,666 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.chains = exports.Chains = void 0;
4
+ var Wallets_1 = require("./Wallets");
5
+ var utils_1 = require("./../utils");
6
+ var chainObj = {
7
+ "eth": {
8
+ chainName: "Ethereum Mainnet",
9
+ chainId: 1,
10
+ blockExplorerUrl: "https://etherscan.io/tx/",
11
+ nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" },
12
+ popularToken: ["ETH", "USDT", "USDC", "BUSD", "UNI", "C98", "LINK", "MATIC"],
13
+ rpcUrls: [
14
+ "https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"
15
+ ],
16
+ compiler: 'EVM'
17
+ },
18
+ "ropsten": {
19
+ chainName: "Ethereum Ropsten",
20
+ chainId: 3,
21
+ blockExplorerUrl: "https://ropsten.etherscan.io/",
22
+ nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" },
23
+ popularToken: ["ETH", "USDT", "USDC", "BUSD", "UNI", "C98", "LINK", "MATIC"],
24
+ rpcUrls: [
25
+ "https://ropsten.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"
26
+ ],
27
+ compiler: 'EVM',
28
+ isTest: true
29
+ },
30
+ "rinkeby": {
31
+ chainName: "Ethereum Rinkeby",
32
+ chainId: 4,
33
+ blockExplorerUrl: "https://rinkeby.etherscan.io/",
34
+ nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" },
35
+ popularToken: ["ETH", "USDT", "USDC", "BUSD", "UNI", "C98", "LINK", "MATIC"],
36
+ rpcUrls: [
37
+ "https://rinkeby.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"
38
+ ],
39
+ compiler: 'EVM',
40
+ isTest: true
41
+ },
42
+ "bsc": {
43
+ chainName: "Binance Smart Chain", chainId: 56, blockExplorerUrl: "https://bscscan.com/tx/",
44
+ popularToken: ["BNB", "USDT", "BUSD", "CAKE", "C98", "BAKE", "MBOX"],
45
+ nativeCurrency: { name: "BNB", symbol: "BNB", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" },
46
+ rpcUrls: ["https://bsc-dataseed1.binance.org/"],
47
+ compiler: 'EVM',
48
+ },
49
+ "solana": {
50
+ compiler: 'SOL',
51
+ chainName: "Solana Mainnet", blockExplorerUrl: "https://solscan.io/tx/", popularToken: ["SOL", "SNY", "USDT", "USDC", "RAY", "STEP"], rpcUrls: null
52
+ },
53
+ "flow": {
54
+ compiler: 'FLOW',
55
+ chainName: "Flow Mainnet", blockExplorerUrl: "https://flowscan.org/transaction/", popularToken: ["SOL", "SNY", "USDT", "USDC", "RAY", "STEP"], rpcUrls: null
56
+ },
57
+ "polygon": {
58
+ compiler: 'EVM',
59
+ chainName: "Polygon Mainnet", chainId: 137, blockExplorerUrl: "https://polygonscan.com/tx/", popularToken: ["USDT", "USDC", "MATIC", "AAVE", "DINO", "ADDY", "MIMATIC"], nativeCurrency: { name: "MATIC", symbol: "MATIC", decimals: 18, address: "0x0000000000000000000000000000000000001010" }, rpcUrls: ["https://rpc-mainnet.maticvigil.com"]
60
+ },
61
+ "avax": {
62
+ compiler: 'EVM',
63
+ chainName: "Avalanche", chainId: 43114, blockExplorerUrl: "https://cchain.explorer.avax.network/tx/", popularToken: ["AVAX", "PNG", "DAI.E", "ETH", "WAVAX", "JOE", "QI", "USDC.E"], nativeCurrency: { name: "AVAX", symbol: "AVAX", decimals: 18, address: "0x0000000000000000000000000000000000000000" }, rpcUrls: ["https://api.avax.network/ext/bc/C/rpc"]
64
+ },
65
+ "fantom": {
66
+ compiler: 'EVM',
67
+ chainName: "Fantom", chainId: 250, blockExplorerUrl: "https://ftmscan.com/tx/", popularToken: ["ETH", "USDT", "USDC", "SPIRIT", "1INCH", "C98", "FTM", "fUSDT", "MIM", "BOO"], nativeCurrency: { name: "FTM", symbol: "FTM", decimals: 18, address: "0x0000000000000000000000000000000000000000" }, rpcUrls: ["https://rpcapi.fantom.network"]
68
+ },
69
+ "arbitrum": {
70
+ compiler: 'EVM',
71
+ chainName: "Arbitrum", chainId: 42161, blockExplorerUrl: "https://arbiscan.io/tx/", nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" }, rpcUrls: ["https://arb1.arbitrum.io/rpc"]
72
+ },
73
+ "terra": {
74
+ compiler: 'TERRA',
75
+ chainName: "Terra Mainnet", blockExplorerUrl: "https://finder.terra.money/columbus-5/tx/", rpcUrls: null
76
+ },
77
+ "xdai": {
78
+ compiler: 'EVM',
79
+ chainName: "Gnosis Mainnet",
80
+ chainId: 100,
81
+ blockExplorerUrl: "https://blockscout.com/poa/xdai/tx/", popularToken: ["ETH", "USDT", "USDC", "BUSD", "1INCH", "C98"],
82
+ nativeCurrency: { name: "xDai", symbol: "XDAI", decimals: 18, address: "0x0000000000000000000000000000000000000000" },
83
+ rpcUrls: ["https://rpc.gnosischain.com", "https://rpc.xdaichain.com/"]
84
+ },
85
+ "boba": {
86
+ compiler: 'EVM',
87
+ chainName: "Boba Mainnet", chainId: 288, blockExplorerUrl: "https://blockexplorer.boba.network/tx/", nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18, address: "0x0000000000000000000000000000000000000000" }, rpcUrls: ["https://mainnet.boba.network"]
88
+ },
89
+ "ont": {
90
+ compiler: 'ONT',
91
+ chainName: "Ontology Mainnet", blockExplorerUrl: "https://explorer.ont.io/transaction/", popularToken: [], rpcUrls: null
92
+ },
93
+ "ontevm": {
94
+ compiler: 'EVM',
95
+ chainName: "Ontology Evm", chainId: 58, blockExplorerUrl: "https://explorer.ont.io/transaction/", nativeCurrency: { name: "ONG", symbol: "ONG", decimals: 18, address: "0x0000000000000000000000000000000000000000" }, rpcUrls: ["https://dappnode10.ont.io:10339"]
96
+ },
97
+ "metis": {
98
+ compiler: 'EVM',
99
+ chainName: "Andromeda (Metis)", chainId: 1088, blockExplorerUrl: "https://andromeda-explorer.metis.io/tx/", nativeCurrency: { name: "METIS", symbol: "METIS", decimals: 18, address: "0x0000000000000000000000000000000000000000" }, rpcUrls: ["https://andromeda.metis.io/?owner=1088"]
100
+ },
101
+ "tron": {
102
+ compiler: 'TRON',
103
+ chainName: "Tron Mainnet",
104
+ blockExplorerUrl: "https://tronscan.io/#/transaction/",
105
+ popularToken: ["TRX", "WTRX", "ETH", "BTC", "USDT", "USDJ", "JST"],
106
+ rpcUrls: null
107
+ },
108
+ "heco": {
109
+ compiler: 'EVM',
110
+ chainName: "Heco Mainnet",
111
+ chainId: 128,
112
+ blockExplorerUrl: "https://http-mainnet.hecochain.com/tx/",
113
+ popularToken: ["HT", "ETH", "AAVE", "USDT", "USDC", "MDX", "DEP"],
114
+ nativeCurrency: { name: "HT", symbol: "HT", decimals: 18, address: "0x0000000000000000000000000000000000000000" },
115
+ rpcUrls: ["https://http-mainnet.hecochain.com"]
116
+ },
117
+ "okex": {
118
+ compiler: 'EVM',
119
+ chainName: "OEC Mainnet", chainId: 66, blockExplorerUrl: "https://www.oklink.com/okexchain/", popularToken: ["OKT", "OKB", "USDT", "USDC", "BUSD", "BNB", "CHE"], nativeCurrency: { name: "OKT", symbol: "OKT", decimals: 18, address: "0x0000000000000000000000000000000000000000" }, rpcUrls: ["https://exchainrpc.okex.org"]
120
+ },
121
+ "optimism": {
122
+ compiler: 'EVM',
123
+ chainName: "Optimism",
124
+ chainId: 10,
125
+ blockExplorerUrl: "https://optimism.io/tx/",
126
+ nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" },
127
+ rpcUrls: ["https://rpc.ankr.com/optimism", "https://optimism-mainnet.public.blastapi.io", "https://mainnet.optimism.io"]
128
+ },
129
+ "harmony": {
130
+ compiler: 'EVM',
131
+ chainName: "Harmony",
132
+ chainId: 1666600000,
133
+ blockExplorerUrl: "https://explorer.harmony.one/",
134
+ nativeCurrency: { name: "ONE", symbol: "ONE", decimals: 18, address: "0x0000000000000000000000000000000000000000" },
135
+ popularToken: ["ETH", "USDT", "USDC", "BUSD", "1INCH", "C98"],
136
+ rpcUrls: ["https://api.s0.t.hmny.io", "https://api.harmony.one"]
137
+ },
138
+ "dot": {
139
+ compiler: 'EVM',
140
+ chainName: "Polkadot", blockExplorerUrl: "", popularToken: ["ETH", "USDT", "USDC", "BUSD", "1INCH", "C98"]
141
+ },
142
+ "neo": {
143
+ compiler: 'EVM',
144
+ chainName: "Neo", blockExplorerUrl: "", popularToken: ["ETH", "USDT", "USDC", "BUSD", "1INCH", "C98"]
145
+ },
146
+ "aurora": {
147
+ chainName: "Aurora Mainnet",
148
+ chainId: 1313161554,
149
+ blockExplorerUrl: "https://aurorascan.dev/tx/",
150
+ nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" },
151
+ popularToken: [],
152
+ rpcUrls: [
153
+ "https://mainnet.aurora.dev"
154
+ ],
155
+ compiler: 'EVM'
156
+ },
157
+ "cronos": {
158
+ chainName: "Cronos Mainnet",
159
+ chainId: 25,
160
+ blockExplorerUrl: "https://cronos.org/explorer",
161
+ nativeCurrency: {
162
+ name: "CRO",
163
+ symbol: "CRO",
164
+ decimals: 18,
165
+ address: "0x0000000000000000000000000000000000000000"
166
+ },
167
+ popularToken: [],
168
+ rpcUrls: [
169
+ "https://evm.cronos.org"
170
+ ],
171
+ compiler: 'EVM'
172
+ },
173
+ "moonriver": {
174
+ chainName: "Moonriver Mainnet",
175
+ chainId: 1285,
176
+ blockExplorerUrl: "https://moonriver.moonscan.io",
177
+ nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" },
178
+ popularToken: [],
179
+ rpcUrls: [
180
+ "https://rpc.moonriver.moonbeam.network"
181
+ ],
182
+ compiler: 'EVM'
183
+ },
184
+ "bsctest": {
185
+ chainName: "BSC Test Network",
186
+ chainId: 1285,
187
+ blockExplorerUrl: "https://testnet.bscscan.com/",
188
+ nativeCurrency: { name: "BNB", symbol: "BNB", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" },
189
+ popularToken: [],
190
+ rpcUrls: [
191
+ "https://data-seed-prebsc-1-s1.binance.org:8545"
192
+ ],
193
+ compiler: 'EVM'
194
+ },
195
+ "aptos": {
196
+ compiler: 'APTOS',
197
+ chainName: "Aptos Mainnet",
198
+ blockExplorerUrl: "https://explorer.aptoslabs.com/txn/",
199
+ nativeCurrency: { name: "Aptos", symbol: "APT", decimals: 8, address: "0x1" },
200
+ },
201
+ "near": {
202
+ compiler: 'NEAR',
203
+ chainName: "Near Mainnet",
204
+ blockExplorerUrl: "https://nearblocks.io/txns/",
205
+ nativeCurrency: { name: "Near", symbol: "Near", decimals: 24, address: "near.near" },
206
+ },
207
+ cosmos: {
208
+ chainId: 'cosmoshub-4',
209
+ chainName: 'Cosmos',
210
+ rpcUrls: [
211
+ ''
212
+ ],
213
+ blockExplorerUrl: '',
214
+ compiler: 'COSMOS',
215
+ },
216
+ osmosis: {
217
+ chainId: 'osmosis-1',
218
+ chainName: 'Osmosis',
219
+ rpcUrls: [
220
+ 'https://rpc.cosmos.directory/osmosis'
221
+ ],
222
+ blockExplorerUrl: 'https://www.mintscan.io/osmosis/txs/',
223
+ compiler: 'COSMOS',
224
+ },
225
+ iris: {
226
+ chainId: 'irishub-1',
227
+ chainName: 'Iris',
228
+ rpcUrls: [
229
+ 'https://rpc-iris.keplr.app'
230
+ ],
231
+ blockExplorerUrl: '',
232
+ compiler: 'COSMOS',
233
+ },
234
+ "kava": {
235
+ chainName: "Kava Mainnet",
236
+ chainId: 2222,
237
+ blockExplorerUrl: "https://explorer.kava.io/tx/",
238
+ nativeCurrency: { name: "KAVA", symbol: "KAVA", decimals: 18, address: "0x0000000000000000000000000000000000000000" },
239
+ popularToken: [],
240
+ rpcUrls: [
241
+ "https://evm.kava.io"
242
+ ],
243
+ compiler: 'EVM'
244
+ },
245
+ "celo": {
246
+ chainName: "Celo Mainnet",
247
+ chainId: 42220,
248
+ blockExplorerUrl: "https://explorer.celo.org/tx/",
249
+ nativeCurrency: { name: "CELO", symbol: "CELO", decimals: 18, address: "0x471EcE3750Da237f93B8E339c536989b8978a438" },
250
+ popularToken: [],
251
+ rpcUrls: [
252
+ "https://forno.celo.org"
253
+ ],
254
+ compiler: 'EVM'
255
+ },
256
+ "zksync": {
257
+ chainName: "zkSync Era Testnet",
258
+ chainId: 280,
259
+ blockExplorerUrl: "https://goerli.explorer.zksync.io/tx/",
260
+ nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18, address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" },
261
+ popularToken: [],
262
+ rpcUrls: [
263
+ "https://zksync2-testnet.zksync.dev"
264
+ ],
265
+ compiler: 'EVM'
266
+ }
267
+ };
268
+ var Chains = /** @class */ (function () {
269
+ function Chains() {
270
+ var _this = this;
271
+ this.ethereumChainParams = {
272
+ rinkeby: [
273
+ {
274
+ chainId: "0x4",
275
+ chainName: "rinkeby",
276
+ key: 'rinkeby',
277
+ nativeCurrency: {
278
+ name: "ETH",
279
+ symbol: "ETH",
280
+ decimals: 18,
281
+ },
282
+ rpcUrls: ["https://rinkeby.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"],
283
+ blockExplorerUrls: ["https://rinkeby.etherscan.io"],
284
+ },
285
+ ],
286
+ bsc: [
287
+ {
288
+ chainId: "0x38",
289
+ chainName: "Binance Smart Chain Mainnet",
290
+ nativeCurrency: {
291
+ name: "BNB",
292
+ symbol: "BNB",
293
+ decimals: 18,
294
+ },
295
+ rpcUrls: ["https://bsc-dataseed1.binance.org"],
296
+ blockExplorerUrls: ["https://bscscan.com/"],
297
+ },
298
+ ],
299
+ ok: [
300
+ {
301
+ chainId: "0x42",
302
+ chainName: "OEC Mainnet",
303
+ nativeCurrency: {
304
+ name: "OKT",
305
+ symbol: "OKT",
306
+ decimals: 18,
307
+ },
308
+ rpcUrls: ["https://exchainrpc.okex.org"],
309
+ blockExplorerUrls: ["https://www.oklink.com/okexchain/"],
310
+ },
311
+ ],
312
+ polygon: [
313
+ {
314
+ chainId: "0x89",
315
+ chainName: "Polygon Mainnet",
316
+ nativeCurrency: {
317
+ name: "MATIC",
318
+ symbol: "MATIC",
319
+ decimals: 18,
320
+ },
321
+ rpcUrls: ["https://polygon-rpc.com/"],
322
+ blockExplorerUrls: ["https://polygonscan.com"],
323
+ },
324
+ ],
325
+ xdai: [
326
+ {
327
+ chainId: "0x64",
328
+ chainName: "Gnosis Mainnet",
329
+ nativeCurrency: {
330
+ name: "xDai",
331
+ symbol: "XDAI",
332
+ decimals: 18,
333
+ },
334
+ rpcUrls: ["https://rpc.gnosischain.com", "https://rpc.xdaichain.com/"],
335
+ blockExplorerUrls: ["https://blockscout.com/poa/xdai", "https://blockscout.com/xdai/mainnet"],
336
+ },
337
+ ],
338
+ fantom: [
339
+ {
340
+ chainId: "0xfa",
341
+ chainName: "Fantom Mainnet",
342
+ nativeCurrency: {
343
+ name: "FTM",
344
+ symbol: "FTM",
345
+ decimals: 18,
346
+ },
347
+ rpcUrls: ["https://rpcapi.fantom.network"],
348
+ blockExplorerUrls: ["https://ftmscan.com/"],
349
+ },
350
+ ],
351
+ heco: [
352
+ {
353
+ chainId: "0x80",
354
+ chainName: "Heco Mainnet",
355
+ nativeCurrency: {
356
+ name: "HT",
357
+ symbol: "HT",
358
+ decimals: 18,
359
+ },
360
+ rpcUrls: ["https://http-mainnet.hecochain.com"],
361
+ blockExplorerUrls: ["https://http-mainnet.hecochain.com"],
362
+ },
363
+ ],
364
+ avax: [
365
+ {
366
+ chainId: "0xa86a",
367
+ chainName: "Avalanche Mainnet C-Chain",
368
+ nativeCurrency: {
369
+ name: "AVAX",
370
+ symbol: "AVAX",
371
+ decimals: 18,
372
+ },
373
+ rpcUrls: ["https://api.avax.network/ext/bc/C/rpc"],
374
+ blockExplorerUrls: ["https://cchain.explorer.avax.network/"],
375
+ },
376
+ ],
377
+ okex: [
378
+ {
379
+ chainId: "0x42",
380
+ chainName: "OEC Mainnet",
381
+ nativeCurrency: {
382
+ name: "OKT",
383
+ symbol: "OKT",
384
+ decimals: 18,
385
+ },
386
+ rpcUrls: ["https://exchainrpc.okex.org"],
387
+ blockExplorerUrls: ["https://www.oklink.com/okexchain"],
388
+ },
389
+ ],
390
+ harmony: [
391
+ {
392
+ chainId: "0x63564c40",
393
+ chainName: "Harmony Mainnet",
394
+ nativeCurrency: {
395
+ name: "ONE",
396
+ symbol: "ONE",
397
+ decimals: 18,
398
+ },
399
+ rpcUrls: ["https://api.s0.t.hmny.io", "https://api.harmony.one"],
400
+ blockExplorerUrls: ["https://explorer.harmony.one/"],
401
+ },
402
+ ],
403
+ ontevm: [
404
+ {
405
+ chainId: "0x3a",
406
+ chainName: "Ontology EVM",
407
+ nativeCurrency: {
408
+ name: "ONG",
409
+ symbol: "ONG",
410
+ decimals: 18,
411
+ },
412
+ rpcUrls: ["https://dappnode1.ont.io:10339"],
413
+ blockExplorerUrls: ["https://explorer.ont.io"],
414
+ },
415
+ ],
416
+ metis: [
417
+ {
418
+ chainId: "0x440",
419
+ chainName: "Andromeda (Metis)",
420
+ nativeCurrency: {
421
+ name: "METIS",
422
+ symbol: "METIS",
423
+ decimals: 18,
424
+ },
425
+ rpcUrls: ["https://andromeda.metis.io/?owner=1088"],
426
+ blockExplorerUrls: ["https://andromeda-explorer.metis.io"],
427
+ },
428
+ ],
429
+ arbitrum: [
430
+ {
431
+ chainId: "0xa4b1",
432
+ chainName: "Arbitrum One",
433
+ nativeCurrency: {
434
+ name: "ETH",
435
+ symbol: "ETH",
436
+ decimals: 18,
437
+ },
438
+ rpcUrls: ["https://arb1.arbitrum.io/rpc"],
439
+ blockExplorerUrls: ["https://arbiscan.io"],
440
+ },
441
+ ],
442
+ optimism: [
443
+ {
444
+ chainId: "0xa",
445
+ chainName: "optimism",
446
+ nativeCurrency: {
447
+ name: "ETH",
448
+ symbol: "ETH",
449
+ decimals: 18,
450
+ },
451
+ rpcUrls: ["https://rpc.ankr.com/optimism", "https://optimism-mainnet.public.blastapi.io", "https://mainnet.optimism.io"],
452
+ blockExplorerUrls: ["https://optimism.io/"],
453
+ },
454
+ ],
455
+ boba: [
456
+ {
457
+ chainId: "0x120",
458
+ chainName: "Boba Mainnet",
459
+ nativeCurrency: {
460
+ name: "ETH",
461
+ symbol: "ETH",
462
+ decimals: 18,
463
+ },
464
+ rpcUrls: ["https://mainnet.boba.network"],
465
+ blockExplorerUrls: ["https://blockexplorer.boba.network"],
466
+ },
467
+ ],
468
+ aurora: [
469
+ {
470
+ chainId: "0x4e454152",
471
+ chainName: "Aurora Mainnet",
472
+ nativeCurrency: {
473
+ name: "ETH",
474
+ symbol: "ETH",
475
+ decimals: 18,
476
+ },
477
+ rpcUrls: ["https://mainnet.aurora.dev"],
478
+ blockExplorerUrls: ["https://aurorascan.dev/tx/"],
479
+ },
480
+ ],
481
+ cronos: [
482
+ {
483
+ chainId: "0x19",
484
+ chainName: "Cronos Mainnet",
485
+ nativeCurrency: {
486
+ name: "CRO",
487
+ symbol: "CRO",
488
+ decimals: 18,
489
+ },
490
+ rpcUrls: ["https://evm.cronos.org"],
491
+ blockExplorerUrls: ["https://cronos.org/explorer"],
492
+ },
493
+ ],
494
+ moonriver: [
495
+ {
496
+ chainId: "0x505",
497
+ chainName: "Moonriver Mainnet",
498
+ nativeCurrency: {
499
+ name: "MOVR",
500
+ symbol: "MOVR",
501
+ decimals: 18,
502
+ },
503
+ rpcUrls: ["https://rpc.moonriver.moonbeam.network"],
504
+ blockExplorerUrls: ["https://moonriver.moonscan.io"],
505
+ },
506
+ ],
507
+ bsctest: [
508
+ {
509
+ chainId: "0x61",
510
+ chainName: "BSC Test Network",
511
+ nativeCurrency: {
512
+ name: "BNB",
513
+ symbol: "BNB",
514
+ decimals: 18,
515
+ },
516
+ rpcUrls: ["https://data-seed-prebsc-1-s1.binance.org:8545"],
517
+ blockExplorerUrls: ["https://testnet.bscscan.com/"],
518
+ },
519
+ ],
520
+ kava: [
521
+ {
522
+ chainId: "0x8ae",
523
+ chainName: "Kava EVM",
524
+ nativeCurrency: {
525
+ name: "KAVA",
526
+ symbol: "KAVA",
527
+ decimals: 18,
528
+ },
529
+ rpcUrls: ["https://evm.kava.io"],
530
+ blockExplorerUrls: ["https://explorer.kava.io"],
531
+ },
532
+ ],
533
+ celo: [
534
+ {
535
+ chainId: "0xa4ec",
536
+ chainName: "Celo Network",
537
+ nativeCurrency: {
538
+ name: "CELO",
539
+ symbol: "CELO",
540
+ decimals: 18,
541
+ },
542
+ rpcUrls: ["https://forno.celo.org"],
543
+ blockExplorerUrls: ["https://explorer.celo.org"],
544
+ },
545
+ ],
546
+ klaytn: [
547
+ {
548
+ chainId: "0x2019",
549
+ chainName: "Klaytn Cypress",
550
+ nativeCurrency: {
551
+ name: "KLAY",
552
+ symbol: "KLAY",
553
+ decimals: 18,
554
+ },
555
+ rpcUrls: ["https://public-node-api.klaytnapi.com/v1/cypress"],
556
+ blockExplorerUrls: ["https://scope.klaytn.com"],
557
+ },
558
+ ],
559
+ zksync: [
560
+ {
561
+ chainId: "0x118",
562
+ chainName: "zkSync Era Testnet",
563
+ nativeCurrency: {
564
+ name: "Ethereum",
565
+ symbol: "ETH",
566
+ decimals: 18,
567
+ },
568
+ rpcUrls: ["https://zksync2-testnet.zksync.dev"],
569
+ blockExplorerUrls: ["https://goerli.explorer.zksync.io"],
570
+ },
571
+ ],
572
+ };
573
+ this.chainObj = {};
574
+ this.chainList = [];
575
+ this.chainIds = [];
576
+ this.chainNames = [];
577
+ this.chainApproveNames = [];
578
+ if (!utils_1.isPc) {
579
+ this.ethereumChainParams.eth = {
580
+ eth: [
581
+ {
582
+ chainId: "0x1",
583
+ chainName: "ethereum",
584
+ key: 'eth',
585
+ nativeCurrency: {
586
+ name: "ETH",
587
+ symbol: "ETH",
588
+ decimals: 18,
589
+ },
590
+ rpcUrls: ["https://mainnet.infura.io/v3/"],
591
+ blockExplorerUrls: ["https://etherscan.io"],
592
+ },
593
+ ],
594
+ };
595
+ }
596
+ Wallets_1.wallets.walletList.forEach(function (item) {
597
+ item.supportChains.forEach(function (chainName) {
598
+ if (chainObj[chainName] && chainObj[chainName].wallets) {
599
+ chainObj[chainName].wallets.push(item.key);
600
+ }
601
+ else {
602
+ if (!chainObj[chainName]) {
603
+ chainObj[chainName] = {};
604
+ }
605
+ chainObj[chainName].key = chainName;
606
+ chainObj[chainName].wallets = [item.key];
607
+ }
608
+ });
609
+ });
610
+ this.chainObj = chainObj;
611
+ this.chainList = Object.keys(chainObj).map(function (key) {
612
+ if (chainObj[key].chainId) {
613
+ _this.chainIds.push(chainObj[key].chainId);
614
+ }
615
+ _this.chainNames.push(key);
616
+ if (chainObj[key].compiler === 'EVM' || chainObj[key].compiler === 'TRON') {
617
+ _this.chainApproveNames.push(key);
618
+ }
619
+ return chainObj[key];
620
+ });
621
+ // console.log(JSON.stringify(this.chainList))
622
+ }
623
+ Chains.prototype.isNativeToken = function (chainName, address) {
624
+ if (this.chainObj[chainName] && this.chainObj[chainName].nativeCurrency && this.chainObj[chainName].nativeCurrency.address) {
625
+ return this.chainObj[chainName].nativeCurrency.address.toUpperCase() === address.toUpperCase();
626
+ }
627
+ return false;
628
+ };
629
+ Chains.prototype.getNativeToken = function (chainName) {
630
+ return this.chainObj[chainName];
631
+ };
632
+ Chains.prototype.getIsNewChain = function () {
633
+ return ['eth', 'bsc', 'xdai', 'boba', 'arbitrum', 'heco', 'moonriver', 'cronos', 'optimism', 'harmony', 'fantom', 'avax', 'polygon', 'okex'];
634
+ };
635
+ Chains.prototype.getChainById = function (chainId) {
636
+ return this.chainList.find(function (item) {
637
+ return item.chainId == chainId;
638
+ });
639
+ };
640
+ Chains.prototype.getChainByName = function (name) {
641
+ return this.chainObj[name] || null;
642
+ };
643
+ Chains.prototype.getProxyContract = function (chainName) {
644
+ return {
645
+ eth: '0x38B7C17E62dcBD1C39f96eFe74848C4A037b3ed3',
646
+ bsc: "0x7aeef1035ba6794c0478718a2330671ec8802af1",
647
+ fantom: "0x38B7C17E62dcBD1C39f96eFe74848C4A037b3ed3",
648
+ avax: "0x38B7C17E62dcBD1C39f96eFe74848C4A037b3ed3",
649
+ polygon: "0x38B7C17E62dcBD1C39f96eFe74848C4A037b3ed3",
650
+ okex: "0x6D5630eC1Ee74C907617a6fb7BCAdC4Bf0EF3fcA",
651
+ optimism: "0x7AeEF1035Ba6794C0478718a2330671Ec8802aF1",
652
+ harmony: "0x7AeEF1035Ba6794C0478718a2330671Ec8802aF1",
653
+ cronos: "0x7AeEF1035Ba6794C0478718a2330671Ec8802aF1",
654
+ moonriver: "0x7AeEF1035Ba6794C0478718a2330671Ec8802aF1",
655
+ arbitrum: "0x7AeEF1035Ba6794C0478718a2330671Ec8802aF1",
656
+ heco: "0x7AeEF1035Ba6794C0478718a2330671Ec8802aF1",
657
+ boba: "0x7AeEF1035Ba6794C0478718a2330671Ec8802aF1",
658
+ xdai: "0x7AeEF1035Ba6794C0478718a2330671Ec8802aF1",
659
+ tron: "TTpcMZbsojNCMhea2a9LFHq9DLCxsgGZVv",
660
+ }[chainName];
661
+ };
662
+ ;
663
+ return Chains;
664
+ }());
665
+ exports.Chains = Chains;
666
+ exports.chains = new Chains();