@swapkit/types 1.0.0-rc.46 → 1.0.0-rc.48

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/index.d.ts DELETED
@@ -1,694 +0,0 @@
1
- /// <reference types="node" />
2
-
3
- export declare type AddChainWalletParams<T extends Chain> = {
4
- address: string;
5
- balance: any[];
6
- walletType: WalletOption;
7
- chain: T;
8
- [key: string]: any;
9
- };
10
-
11
- export declare const AGG_SWAP: QuoteMode[];
12
-
13
- declare type ApisType = {
14
- [key in UTXOChain]?: string | any;
15
- } & {
16
- [key in EVMChain]?: string | any;
17
- } & {
18
- [key in CosmosChain]?: string;
19
- };
20
-
21
- export declare enum ApiUrl {
22
- Cosmos = "https://node-router.thorswap.net/cosmos/rest",
23
- Kujira = "https://lcd-kujira.synergynodes.com/",
24
- MayanodeMainnet = "https://mayanode.mayachain.info",
25
- MayanodeStagenet = "https://stagenet.mayanode.mayachain.info",
26
- ThornodeMainnet = "https://thornode.thorswap.net",
27
- ThornodeStagenet = "https://stagenet-thornode.ninerealms.com",
28
- ThorswapApi = "https://api.thorswap.net",
29
- ThorswapStatic = "https://static.thorswap.net"
30
- }
31
-
32
- export declare type Asset = {
33
- chain: Chain;
34
- symbol: string;
35
- ticker: string;
36
- synth?: boolean;
37
- };
38
-
39
- export declare enum BaseDecimal {
40
- ARB = 18,
41
- AVAX = 18,
42
- BCH = 8,
43
- BNB = 8,
44
- BSC = 18,
45
- BTC = 8,
46
- DASH = 8,
47
- DOGE = 8,
48
- DOT = 10,
49
- ETH = 18,
50
- FLIP = 18,
51
- GAIA = 6,
52
- KUJI = 6,
53
- LTC = 8,
54
- MATIC = 18,
55
- MAYA = 10,
56
- OP = 18,
57
- THOR = 8,
58
- ZEC = 8
59
- }
60
-
61
- export declare enum Chain {
62
- Arbitrum = "ARB",
63
- Avalanche = "AVAX",
64
- Binance = "BNB",
65
- BinanceSmartChain = "BSC",
66
- Bitcoin = "BTC",
67
- BitcoinCash = "BCH",
68
- Cosmos = "GAIA",
69
- Dash = "DASH",
70
- Dogecoin = "DOGE",
71
- Ethereum = "ETH",
72
- Kujira = "KUJI",
73
- Litecoin = "LTC",
74
- Maya = "MAYA",
75
- Optimism = "OP",
76
- Polkadot = "DOT",
77
- Chainflip = "FLIP",
78
- Polygon = "MATIC",
79
- THORChain = "THOR"
80
- }
81
-
82
- export declare enum ChainId {
83
- Arbitrum = "42161",
84
- ArbitrumHex = "0xa4b1",
85
- Avalanche = "43114",
86
- AvalancheHex = "0xa86a",
87
- Binance = "Binance-Chain-Tigris",
88
- BinanceSmartChain = "56",
89
- BinanceSmartChainHex = "0x38",
90
- Bitcoin = "bitcoin",
91
- BitcoinCash = "bitcoincash",
92
- Chainflip = "chainflip",
93
- Cosmos = "cosmoshub-4",
94
- Dash = "dash",
95
- Dogecoin = "dogecoin",
96
- Kujira = "kaiyo-1",
97
- Ethereum = "1",
98
- EthereumHex = "0x1",
99
- Litecoin = "litecoin",
100
- Maya = "mayachain-mainnet-v1",
101
- MayaStagenet = "mayachain-stagenet-v1",
102
- Optimism = "10",
103
- OptimismHex = "0xa",
104
- Polkadot = "polkadot",
105
- Polygon = "137",
106
- PolygonHex = "0x89",
107
- THORChain = "thorchain-mainnet-v1",
108
- THORChainStagenet = "thorchain-stagenet-v2"
109
- }
110
-
111
- export declare const ChainIdToChain: Record<ChainId, Chain>;
112
-
113
- export declare const ChainToChainId: {
114
- ARB: ChainId;
115
- AVAX: ChainId;
116
- BNB: ChainId;
117
- BSC: ChainId;
118
- BTC: ChainId;
119
- BCH: ChainId;
120
- GAIA: ChainId;
121
- DASH: ChainId;
122
- DOGE: ChainId;
123
- ETH: ChainId;
124
- KUJI: ChainId;
125
- LTC: ChainId;
126
- MAYA: ChainId;
127
- OP: ChainId;
128
- DOT: ChainId;
129
- FLIP: ChainId;
130
- MATIC: ChainId;
131
- THOR: ChainId;
132
- };
133
-
134
- export declare const ChainToExplorerUrl: Record<Chain, string>;
135
-
136
- export declare const ChainToHexChainId: {
137
- ARB: ChainId;
138
- AVAX: ChainId;
139
- BNB: ChainId;
140
- BSC: ChainId;
141
- BTC: ChainId;
142
- BCH: ChainId;
143
- GAIA: ChainId;
144
- DASH: ChainId;
145
- DOGE: ChainId;
146
- ETH: ChainId;
147
- KUJI: ChainId;
148
- LTC: ChainId;
149
- MAYA: ChainId;
150
- OP: ChainId;
151
- DOT: ChainId;
152
- FLIP: ChainId;
153
- MATIC: ChainId;
154
- THOR: ChainId;
155
- };
156
-
157
- export declare const ChainToRPC: {
158
- ARB: RPCUrl;
159
- AVAX: RPCUrl;
160
- BNB: RPCUrl;
161
- BSC: RPCUrl;
162
- BTC: RPCUrl;
163
- BCH: RPCUrl;
164
- GAIA: RPCUrl;
165
- DASH: RPCUrl;
166
- DOGE: RPCUrl;
167
- ETH: RPCUrl;
168
- KUJI: RPCUrl;
169
- LTC: RPCUrl;
170
- MAYA: RPCUrl;
171
- OP: RPCUrl;
172
- DOT: RPCUrl;
173
- FLIP: RPCUrl;
174
- MATIC: RPCUrl;
175
- THOR: RPCUrl;
176
- };
177
-
178
- export declare type ConnectConfig = {
179
- stagenet?: boolean;
180
- /**
181
- * @required
182
- */
183
- thorswapApiKey?: string;
184
- /**
185
- * @required for AVAX & BSC
186
- */
187
- covalentApiKey?: string;
188
- /**
189
- * @required for ETH
190
- */
191
- ethplorerApiKey?: string;
192
- /**
193
- * @required for BTC, BCH, LTC, DOGE
194
- */
195
- blockchairApiKey?: string;
196
- /**
197
- * @deprecated - use blockchairApiKey instead
198
- */
199
- utxoApiKey?: string;
200
- /**
201
- * @required for Walletconnect
202
- */
203
- walletConnectProjectId?: string;
204
- /**
205
- * @optional for Trezor config
206
- */
207
- trezorManifest?: {
208
- email: string;
209
- appUrl: string;
210
- };
211
- /**
212
- * @optional for KeepKey config
213
- */
214
- keepkeyConfig?: {
215
- apiKey: string;
216
- pairingInfo: {
217
- name: string;
218
- imageUrl: string;
219
- basePath: string;
220
- url: string;
221
- };
222
- };
223
- };
224
-
225
- declare type ConnectMethodNames = "connectEVMWallet" | "connectKeplr" | "connectKeystore" | "connectKeepkey" | "connectLedger" | "connectOkx" | "connectTrezor" | "connectWalletconnect" | "connectXDEFI";
226
-
227
- export declare type ConnectWalletParams = {
228
- addChain: <T extends Chain>(params: AddChainWalletParams<T>) => void;
229
- config: ConnectConfig;
230
- rpcUrls: {
231
- [chain in Chain]?: string;
232
- };
233
- apis: ApisType;
234
- };
235
-
236
- export declare enum ContractAddress {
237
- ARB = "0x0000000000000000000000000000000000000000",
238
- AVAX = "0x0000000000000000000000000000000000000000",
239
- ETH = "0x0000000000000000000000000000000000000000",
240
- BSC = "0x0000000000000000000000000000000000000000",
241
- MATIC = "0x0000000000000000000000000000000000001010",
242
- OP = "0x4200000000000000000000000000000000000042"
243
- }
244
-
245
- export declare type CosmosChain = Chain.Cosmos | Chain.THORChain | Chain.Binance | Chain.Maya | Chain.Kujira;
246
-
247
- /**
248
- * @deprecated
249
- * Use `CosmosChains` instead
250
- */
251
- export declare const CosmosChainList: readonly [Chain.Cosmos, Chain.THORChain, Chain.Binance, Chain.Maya, Chain.Kujira];
252
-
253
- export declare const CosmosChains: readonly [Chain.Cosmos, Chain.THORChain, Chain.Binance, Chain.Maya, Chain.Kujira];
254
-
255
- export declare enum DerivationPath {
256
- ARB = "m/44'/60'/0'/0",
257
- AVAX = "m/44'/60'/0'/0",
258
- BCH = "m/44'/145'/0'/0",
259
- BNB = "m/44'/714'/0'/0",
260
- BSC = "m/44'/60'/0'/0",
261
- BTC = "m/84'/0'/0'/0",
262
- DASH = "m/44'/5'/0'/0",
263
- DOGE = "m/44'/3'/0'/0",
264
- DOT = "////",
265
- ETH = "m/44'/60'/0'/0",
266
- FLIP = "////",
267
- GAIA = "m/44'/118'/0'/0",
268
- KUJI = "m/44'/118'/0'/0",
269
- LTC = "m/84'/2'/0'/0",
270
- MATIC = "m/44'/60'/0'/0",
271
- MAYA = "m/44'/931'/0'/0",
272
- OP = "m/44'/60'/0'/0",
273
- THOR = "m/44'/931'/0'/0"
274
- }
275
-
276
- export declare type DerivationPathArray = [number, number, number, number, number];
277
-
278
- export declare const erc20ABI: ({
279
- inputs: never[];
280
- stateMutability: string;
281
- type: string;
282
- anonymous?: undefined;
283
- name?: undefined;
284
- outputs?: undefined;
285
- } | {
286
- anonymous: boolean;
287
- inputs: {
288
- indexed: boolean;
289
- internalType: string;
290
- name: string;
291
- type: string;
292
- }[];
293
- name: string;
294
- type: string;
295
- stateMutability?: undefined;
296
- outputs?: undefined;
297
- } | {
298
- inputs: {
299
- internalType: string;
300
- name: string;
301
- type: string;
302
- }[];
303
- name: string;
304
- outputs: {
305
- internalType: string;
306
- name: string;
307
- type: string;
308
- }[];
309
- stateMutability: string;
310
- type: string;
311
- anonymous?: undefined;
312
- })[];
313
-
314
- export declare type EVMChain = Chain.Ethereum | Chain.Avalanche | Chain.BinanceSmartChain | Chain.Arbitrum | Chain.Optimism | Chain.Polygon;
315
-
316
- /**
317
- * @deprecated
318
- * Use `EVMChains` instead
319
- */
320
- export declare const EVMChainList: readonly [Chain.Ethereum, Chain.Avalanche, Chain.BinanceSmartChain, Chain.Arbitrum, Chain.Optimism, Chain.Polygon];
321
-
322
- export declare const EVMChains: readonly [Chain.Ethereum, Chain.Avalanche, Chain.BinanceSmartChain, Chain.Arbitrum, Chain.Optimism, Chain.Polygon];
323
-
324
- export declare type EVMTxBaseParams<T = bigint> = {
325
- to?: string;
326
- from?: string;
327
- nonce?: number;
328
- gasLimit?: T;
329
- data?: string;
330
- value?: T;
331
- chainId?: T;
332
- };
333
-
334
- export declare type EVMWalletOptions = WalletOption.BRAVE | WalletOption.OKX_MOBILE | WalletOption.METAMASK | WalletOption.TRUSTWALLET_WEB | WalletOption.COINBASE_WEB;
335
-
336
- export declare type ExtendParams<WalletConnectMethodNames = ""> = {
337
- excludedChains?: Chain[];
338
- config?: ConnectConfig;
339
- rpcUrls?: {
340
- [chain in Chain]?: string;
341
- };
342
- apis?: ApisType;
343
- wallets: {
344
- connectMethodName: ConnectMethodNames | WalletConnectMethodNames;
345
- connect: (params: ConnectWalletParams) => (...params: any) => Promise<any>;
346
- }[];
347
- };
348
-
349
- export declare enum FeeOption {
350
- Average = "average",
351
- Fast = "fast",
352
- Fastest = "fastest"
353
- }
354
-
355
- export declare type GetAddressAndPubKeyResponse = {
356
- bech32_address: string;
357
- compressed_pk: any;
358
- error_message: string;
359
- return_code: number;
360
- };
361
-
362
- export declare enum LedgerErrorCode {
363
- NoError = 36864,
364
- LockedDevice = 21781,
365
- TC_NotFound = 65535
366
- }
367
-
368
- export declare enum MemoType {
369
- BOND = "BOND",
370
- DEPOSIT = "+",
371
- LEAVE = "LEAVE",
372
- THORNAME_REGISTER = "~",
373
- UNBOND = "UNBOND",
374
- WITHDRAW = "-",
375
- OPEN_LOAN = "$+",
376
- CLOSE_LOAN = "$-"
377
- }
378
-
379
- export declare const NetworkDerivationPath: Record<Chain, DerivationPathArray>;
380
-
381
- export declare enum QuoteMode {
382
- TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC",
383
- TC_SUPPORTED_TO_ETH = "TC-ERC20",
384
- TC_SUPPORTED_TO_AVAX = "TC-ARC20",
385
- TC_SUPPORTED_TO_BSC = "TC-BEP20",
386
- ETH_TO_TC_SUPPORTED = "ERC20-TC",
387
- ETH_TO_ETH = "ERC20-ERC20",
388
- ETH_TO_AVAX = "ERC20-ARC20",
389
- ETH_TO_BSC = "ERC20-BEP20",
390
- AVAX_TO_TC_SUPPORTED = "ARC20-TC",
391
- AVAX_TO_ETH = "ARC20-ERC20",
392
- AVAX_TO_AVAX = "ARC20-ARC20",
393
- AVAX_TO_BSC = "ARC20-BEP20",
394
- BSC_TO_TC_SUPPORTED = "BEP20-TC",
395
- BSC_TO_ETH = "BEP20-ERC20",
396
- BSC_TO_AVAX = "BEP20-ARC20",
397
- BSC_TO_BSC = "BEP20-BEP20"
398
- }
399
-
400
- export declare enum RPCUrl {
401
- Arbitrum = "https://arb1.arbitrum.io/rpc",
402
- Avalanche = "https://node-router.thorswap.net/avalanche-c",
403
- Binance = "",
404
- BinanceSmartChain = "https://bsc-dataseed.binance.org",
405
- Bitcoin = "https://node-router.thorswap.net/bitcoin",
406
- BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash",
407
- Chainflip = "wss://mainnet-archive.chainflip.io",
408
- Cosmos = "https://node-router.thorswap.net/cosmos/rpc",
409
- Dash = "https://node-router.thorswap.net/dash",
410
- Dogecoin = "https://node-router.thorswap.net/dogecoin",
411
- Ethereum = "https://node-router.thorswap.net/ethereum",
412
- Kujira = "https://rpc-kujira.synergynodes.com/",
413
- Litecoin = "https://node-router.thorswap.net/litecoin",
414
- Maya = "https://tendermint.mayachain.info",
415
- MayaStagenet = "https://stagenet.tendermint.mayachain.info",
416
- Optimism = "https://mainnet.optimism.io",
417
- Polkadot = "wss://rpc.polkadot.io",
418
- Polygon = "https://polygon-rpc.com",
419
- THORChain = "https://rpc.thorswap.net",
420
- THORChainStagenet = "https://stagenet-rpc.ninerealms.com"
421
- }
422
-
423
- export declare type Signature = {
424
- pub_key: {
425
- type: string;
426
- value: string;
427
- };
428
- sequence: string;
429
- signature: string;
430
- };
431
-
432
- export declare type SubstrateChain = Chain.Polkadot | Chain.Chainflip;
433
-
434
- export declare const SubstrateChains: Chain[];
435
-
436
- export declare const SWAP_IN: QuoteMode[];
437
-
438
- export declare const SWAP_OUT: QuoteMode[];
439
-
440
- export declare const TCAvalancheDepositABI: ({
441
- inputs: never[];
442
- stateMutability: string;
443
- type: string;
444
- anonymous?: undefined;
445
- name?: undefined;
446
- outputs?: undefined;
447
- } | {
448
- anonymous: boolean;
449
- inputs: ({
450
- indexed: boolean;
451
- internalType: string;
452
- name: string;
453
- type: string;
454
- components?: undefined;
455
- } | {
456
- components: {
457
- internalType: string;
458
- name: string;
459
- type: string;
460
- }[];
461
- indexed: boolean;
462
- internalType: string;
463
- name: string;
464
- type: string;
465
- })[];
466
- name: string;
467
- type: string;
468
- stateMutability?: undefined;
469
- outputs?: undefined;
470
- } | {
471
- inputs: ({
472
- internalType: string;
473
- name: string;
474
- type: string;
475
- components?: undefined;
476
- } | {
477
- components: {
478
- internalType: string;
479
- name: string;
480
- type: string;
481
- }[];
482
- internalType: string;
483
- name: string;
484
- type: string;
485
- })[];
486
- name: string;
487
- outputs: never[];
488
- stateMutability: string;
489
- type: string;
490
- anonymous?: undefined;
491
- } | {
492
- inputs: {
493
- internalType: string;
494
- name: string;
495
- type: string;
496
- }[];
497
- name: string;
498
- outputs: {
499
- internalType: string;
500
- name: string;
501
- type: string;
502
- }[];
503
- stateMutability: string;
504
- type: string;
505
- anonymous?: undefined;
506
- })[];
507
-
508
- export declare const TCBscDepositABI: ({
509
- inputs: never[];
510
- stateMutability: string;
511
- type: string;
512
- anonymous?: undefined;
513
- name?: undefined;
514
- outputs?: undefined;
515
- } | {
516
- anonymous: boolean;
517
- inputs: ({
518
- indexed: boolean;
519
- internalType: string;
520
- name: string;
521
- type: string;
522
- components?: undefined;
523
- } | {
524
- components: {
525
- internalType: string;
526
- name: string;
527
- type: string;
528
- }[];
529
- indexed: boolean;
530
- internalType: string;
531
- name: string;
532
- type: string;
533
- })[];
534
- name: string;
535
- type: string;
536
- stateMutability?: undefined;
537
- outputs?: undefined;
538
- } | {
539
- inputs: ({
540
- internalType: string;
541
- name: string;
542
- type: string;
543
- components?: undefined;
544
- } | {
545
- components: {
546
- internalType: string;
547
- name: string;
548
- type: string;
549
- }[];
550
- internalType: string;
551
- name: string;
552
- type: string;
553
- })[];
554
- name: string;
555
- outputs: never[];
556
- stateMutability: string;
557
- type: string;
558
- anonymous?: undefined;
559
- } | {
560
- inputs: {
561
- internalType: string;
562
- name: string;
563
- type: string;
564
- }[];
565
- name: string;
566
- outputs: {
567
- internalType: string;
568
- name: string;
569
- type: string;
570
- }[];
571
- stateMutability: string;
572
- type: string;
573
- anonymous?: undefined;
574
- })[];
575
-
576
- export declare const TCEthereumVaultAbi: ({
577
- inputs: {
578
- internalType: string;
579
- name: string;
580
- type: string;
581
- }[];
582
- stateMutability: string;
583
- type: string;
584
- anonymous?: undefined;
585
- name?: undefined;
586
- outputs?: undefined;
587
- } | {
588
- anonymous: boolean;
589
- inputs: ({
590
- indexed: boolean;
591
- internalType: string;
592
- name: string;
593
- type: string;
594
- components?: undefined;
595
- } | {
596
- components: {
597
- internalType: string;
598
- name: string;
599
- type: string;
600
- }[];
601
- indexed: boolean;
602
- internalType: string;
603
- name: string;
604
- type: string;
605
- })[];
606
- name: string;
607
- type: string;
608
- stateMutability?: undefined;
609
- outputs?: undefined;
610
- } | {
611
- inputs: ({
612
- internalType: string;
613
- name: string;
614
- type: string;
615
- components?: undefined;
616
- } | {
617
- components: {
618
- internalType: string;
619
- name: string;
620
- type: string;
621
- }[];
622
- internalType: string;
623
- name: string;
624
- type: string;
625
- })[];
626
- name: string;
627
- outputs: never[];
628
- stateMutability: string;
629
- type: string;
630
- anonymous?: undefined;
631
- } | {
632
- inputs: {
633
- internalType: string;
634
- name: string;
635
- type: string;
636
- }[];
637
- name: string;
638
- outputs: {
639
- internalType: string;
640
- name: string;
641
- type: string;
642
- }[];
643
- stateMutability: string;
644
- type: string;
645
- anonymous?: undefined;
646
- })[];
647
-
648
- /**
649
- * @deprecated
650
- * Use `TCSupportedChains` instead
651
- */
652
- export declare const TCSupportedChainList: readonly [Chain.Avalanche, Chain.Binance, Chain.BinanceSmartChain, Chain.Bitcoin, Chain.BitcoinCash, Chain.Cosmos, Chain.Dogecoin, Chain.Ethereum, Chain.Litecoin, Chain.THORChain];
653
-
654
- export declare const TCSupportedChains: readonly [Chain.Avalanche, Chain.Binance, Chain.BinanceSmartChain, Chain.Bitcoin, Chain.BitcoinCash, Chain.Cosmos, Chain.Dogecoin, Chain.Ethereum, Chain.Litecoin, Chain.THORChain];
655
-
656
- export declare type UTXOChain = Chain.Bitcoin | Chain.BitcoinCash | Chain.Dash | Chain.Dogecoin | Chain.Litecoin;
657
-
658
- /**
659
- * @deprecated
660
- * Use `UTXOChains` instead
661
- */
662
- export declare const UTXOChainList: readonly [Chain.Bitcoin, Chain.BitcoinCash, Chain.Dash, Chain.Dogecoin, Chain.Litecoin];
663
-
664
- export declare const UTXOChains: readonly [Chain.Bitcoin, Chain.BitcoinCash, Chain.Dash, Chain.Dogecoin, Chain.Litecoin];
665
-
666
- export declare enum WalletOption {
667
- KEYSTORE = "KEYSTORE",
668
- KEEPKEY = "KEEPKEY",
669
- XDEFI = "XDEFI",
670
- METAMASK = "METAMASK",
671
- COINBASE_WEB = "COINBASE_WEB",
672
- TREZOR = "TREZOR",
673
- TRUSTWALLET_WEB = "TRUSTWALLET_WEB",
674
- LEDGER = "LEDGER",
675
- KEPLR = "KEPLR",
676
- OKX = "OKX",
677
- OKX_MOBILE = "OKX_MOBILE",
678
- BRAVE = "BRAVE",
679
- WALLETCONNECT = "WALLETCONNECT"
680
- }
681
-
682
- export declare type WalletTxParams = {
683
- feeOptionKey?: FeeOption;
684
- from?: string;
685
- memo?: string;
686
- recipient: string;
687
- };
688
-
689
- export declare type Witness = {
690
- value: number;
691
- script: Buffer;
692
- };
693
-
694
- export { }