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