@coinmasters/types 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.
- package/LICENSE +201 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +767 -0
- package/dist/index.es.js +861 -0
- package/package.json +43 -0
- package/src/abis/erc20.ts +99 -0
- package/src/abis/tcEthVault.ts +496 -0
- package/src/commonTypes.ts +132 -0
- package/src/errors/apiError.ts +75 -0
- package/src/errors/displayMessages.ts +68 -0
- package/src/errors/index.ts +2 -0
- package/src/errors/types.ts +144 -0
- package/src/index.ts +8 -0
- package/src/network.ts +253 -0
- package/src/thorchain.ts +30 -0
- package/src/transactions.ts +22 -0
- package/src/wallet.ts +20 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,767 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
|
|
3
|
+
import type { FixedNumber } from 'ethers';
|
|
4
|
+
|
|
5
|
+
export declare type AddChainWalletParams = {
|
|
6
|
+
chain: Chain;
|
|
7
|
+
wallet: ChainWallet;
|
|
8
|
+
walletMethods: any;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export declare const AGG_SWAP: QuoteMode[];
|
|
12
|
+
|
|
13
|
+
export declare class ApiError extends Error {
|
|
14
|
+
readonly status: number;
|
|
15
|
+
readonly revision: string;
|
|
16
|
+
readonly type?: ERROR_TYPE;
|
|
17
|
+
readonly module: ERROR_MODULE;
|
|
18
|
+
readonly code: ERROR_CODE;
|
|
19
|
+
readonly message: string;
|
|
20
|
+
readonly display: string;
|
|
21
|
+
readonly stack?: string;
|
|
22
|
+
readonly options: ApiErrorOptions;
|
|
23
|
+
readonly displayMessageParams?: string[];
|
|
24
|
+
constructor({ status, revision, module, code, message, type, options: { shouldLog, shouldThrow, shouldTrace }, displayMessageParams, }: ErrorInfo);
|
|
25
|
+
static fromErrorInfo(errorInfo: ErrorInfo): ApiError;
|
|
26
|
+
toErrorInfo(): ErrorInfo;
|
|
27
|
+
get identifier(): string;
|
|
28
|
+
get displayMessage(): string;
|
|
29
|
+
handle(): ErrorInfo;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export declare type ApiErrorOptions = {
|
|
33
|
+
shouldLog?: boolean;
|
|
34
|
+
shouldTrace?: boolean;
|
|
35
|
+
shouldThrow?: boolean;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
declare type ApisType = {
|
|
39
|
+
[key in UTXOChain]?: string | any;
|
|
40
|
+
} & {
|
|
41
|
+
[key in EVMChain]?: string | any;
|
|
42
|
+
} & {
|
|
43
|
+
[key in CosmosChain]?: string;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export declare enum ApiUrl {
|
|
47
|
+
Cosmos = "https://node-router.thorswap.net/cosmos/rest",
|
|
48
|
+
MayanodeMainnet = "https://mayanode.mayachain.info",
|
|
49
|
+
MayanodeStagenet = "https://stagenet.mayanode.mayachain.info",
|
|
50
|
+
ThornodeMainnet = "https://thornode.thorswap.net",
|
|
51
|
+
ThornodeStagenet = "https://stagenet-thornode.ninerealms.com",
|
|
52
|
+
ThorswapApi = "https://api.thorswap.finance",
|
|
53
|
+
ThorswapStatic = "https://static.thorswap.net"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export declare type Asset = {
|
|
57
|
+
chain: Chain;
|
|
58
|
+
symbol: string;
|
|
59
|
+
ticker: string;
|
|
60
|
+
synth?: boolean;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export declare enum BaseDecimal {
|
|
64
|
+
ARB = 18,
|
|
65
|
+
AVAX = 18,
|
|
66
|
+
BCH = 8,
|
|
67
|
+
BNB = 8,
|
|
68
|
+
BSC = 18,
|
|
69
|
+
BTC = 8,
|
|
70
|
+
DASH = 8,
|
|
71
|
+
DOGE = 8,
|
|
72
|
+
ETH = 18,
|
|
73
|
+
GAIA = 6,
|
|
74
|
+
KUJI = 6,
|
|
75
|
+
LTC = 8,
|
|
76
|
+
MATIC = 18,
|
|
77
|
+
MAYA = 10,
|
|
78
|
+
OP = 18,
|
|
79
|
+
THOR = 8
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare enum Chain {
|
|
83
|
+
Arbitrum = "ARB",
|
|
84
|
+
Avalanche = "AVAX",
|
|
85
|
+
Binance = "BNB",
|
|
86
|
+
BinanceSmartChain = "BSC",
|
|
87
|
+
Bitcoin = "BTC",
|
|
88
|
+
BitcoinCash = "BCH",
|
|
89
|
+
Cosmos = "GAIA",
|
|
90
|
+
Dogecoin = "DOGE",
|
|
91
|
+
Ethereum = "ETH",
|
|
92
|
+
Litecoin = "LTC",
|
|
93
|
+
Maya = "MAYA",
|
|
94
|
+
Optimism = "OP",
|
|
95
|
+
Polygon = "MATIC",
|
|
96
|
+
THORChain = "THOR"
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export declare enum ChainId {
|
|
100
|
+
Arbitrum = "42161",
|
|
101
|
+
ArbitrumHex = "0xa4b1",
|
|
102
|
+
Avalanche = "43114",
|
|
103
|
+
AvalancheHex = "0xa86a",
|
|
104
|
+
Binance = "Binance-Chain-Tigris",
|
|
105
|
+
BinanceSmartChain = "56",
|
|
106
|
+
BinanceSmartChainHex = "0x38",
|
|
107
|
+
Bitcoin = "bitcoin",
|
|
108
|
+
BitcoinCash = "bitcoincash",
|
|
109
|
+
Cosmos = "cosmoshub-4",
|
|
110
|
+
Dogecoin = "dogecoin",
|
|
111
|
+
Ethereum = "1",
|
|
112
|
+
EthereumHex = "0x1",
|
|
113
|
+
Litecoin = "litecoin",
|
|
114
|
+
Maya = "mayachain-mainnet-v1",
|
|
115
|
+
MayaStagenet = "mayachain-stagenet-v1",
|
|
116
|
+
Optimism = "10",
|
|
117
|
+
OptimismHex = "0xa",
|
|
118
|
+
Polygon = "137",
|
|
119
|
+
PolygonHex = "0x89",
|
|
120
|
+
THORChain = "thorchain-mainnet-v1",
|
|
121
|
+
THORChainStagenet = "thorchain-stagenet-v2"
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export declare const ChainIdToChain: Record<ChainId, Chain>;
|
|
125
|
+
|
|
126
|
+
export declare const ChainToChainId: {
|
|
127
|
+
ARB: ChainId;
|
|
128
|
+
AVAX: ChainId;
|
|
129
|
+
BNB: ChainId;
|
|
130
|
+
BSC: ChainId;
|
|
131
|
+
BTC: ChainId;
|
|
132
|
+
BCH: ChainId;
|
|
133
|
+
GAIA: ChainId;
|
|
134
|
+
DOGE: ChainId;
|
|
135
|
+
ETH: ChainId;
|
|
136
|
+
LTC: ChainId;
|
|
137
|
+
MAYA: ChainId;
|
|
138
|
+
OP: ChainId;
|
|
139
|
+
MATIC: ChainId;
|
|
140
|
+
THOR: ChainId;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export declare const ChainToExplorerUrl: Record<Chain, string>;
|
|
144
|
+
|
|
145
|
+
export declare const ChainToHexChainId: {
|
|
146
|
+
ARB: ChainId;
|
|
147
|
+
AVAX: ChainId;
|
|
148
|
+
BNB: ChainId;
|
|
149
|
+
BSC: ChainId;
|
|
150
|
+
BTC: ChainId;
|
|
151
|
+
BCH: ChainId;
|
|
152
|
+
GAIA: ChainId;
|
|
153
|
+
DOGE: ChainId;
|
|
154
|
+
ETH: ChainId;
|
|
155
|
+
LTC: ChainId;
|
|
156
|
+
MAYA: ChainId;
|
|
157
|
+
OP: ChainId;
|
|
158
|
+
MATIC: ChainId;
|
|
159
|
+
THOR: ChainId;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export declare const ChainToRPC: {
|
|
163
|
+
ARB: RPCUrl;
|
|
164
|
+
AVAX: RPCUrl;
|
|
165
|
+
BNB: RPCUrl;
|
|
166
|
+
BSC: RPCUrl;
|
|
167
|
+
BTC: RPCUrl;
|
|
168
|
+
BCH: RPCUrl;
|
|
169
|
+
GAIA: RPCUrl;
|
|
170
|
+
DOGE: RPCUrl;
|
|
171
|
+
ETH: RPCUrl;
|
|
172
|
+
LTC: RPCUrl;
|
|
173
|
+
MAYA: RPCUrl;
|
|
174
|
+
OP: RPCUrl;
|
|
175
|
+
MATIC: RPCUrl;
|
|
176
|
+
THOR: RPCUrl;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
declare type ChainWallet = {
|
|
180
|
+
address: string;
|
|
181
|
+
balance: any[];
|
|
182
|
+
walletType: WalletOption;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export declare type ConnectConfig = {
|
|
186
|
+
stagenet?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* @required for AVAX & BSC
|
|
189
|
+
*/
|
|
190
|
+
covalentApiKey?: string;
|
|
191
|
+
/**
|
|
192
|
+
* @required for ETH
|
|
193
|
+
*/
|
|
194
|
+
ethplorerApiKey?: string;
|
|
195
|
+
/**
|
|
196
|
+
* @required for BTC, LTC, DOGE & BCH
|
|
197
|
+
*/
|
|
198
|
+
utxoApiKey?: string;
|
|
199
|
+
/**
|
|
200
|
+
* @required for Walletconnect
|
|
201
|
+
*/
|
|
202
|
+
walletConnectProjectId?: string;
|
|
203
|
+
/**
|
|
204
|
+
* @optional for Trezor config
|
|
205
|
+
*/
|
|
206
|
+
trezorManifest?: {
|
|
207
|
+
email: string;
|
|
208
|
+
appUrl: string;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
declare type ConnectMethodNames = 'connectEVMWallet' | 'connectKeplr' | 'connectKeystore' | 'connectKeepkey' | 'connectLedger' | 'connectOkx' | 'connectTrezor' | 'connectWalletconnect' | 'connectXDEFI';
|
|
213
|
+
|
|
214
|
+
export declare type ConnectWalletParams = {
|
|
215
|
+
addChain: (params: AddChainWalletParams) => void;
|
|
216
|
+
config: ConnectConfig;
|
|
217
|
+
rpcUrls: {
|
|
218
|
+
[chain in Chain]?: string;
|
|
219
|
+
};
|
|
220
|
+
apis: ApisType;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
export declare enum ContractAddress {
|
|
224
|
+
ARB = "0x0000000000000000000000000000000000000000",
|
|
225
|
+
AVAX = "0x0000000000000000000000000000000000000000",
|
|
226
|
+
ETH = "0x0000000000000000000000000000000000000000",
|
|
227
|
+
BSC = "0x0000000000000000000000000000000000000000",
|
|
228
|
+
MATIC = "0x0000000000000000000000000000000000001010",
|
|
229
|
+
OP = "0x4200000000000000000000000000000000000042"
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export declare type CosmosChain = Chain.Cosmos | Chain.THORChain | Chain.Binance;
|
|
233
|
+
|
|
234
|
+
export declare const CosmosChainList: CosmosChain[];
|
|
235
|
+
|
|
236
|
+
export declare enum DerivationPath {
|
|
237
|
+
ARB = "m/44'/60'/0'/0",
|
|
238
|
+
AVAX = "m/44'/60'/0'/0",
|
|
239
|
+
BCH = "m/44'/145'/0'/0",
|
|
240
|
+
BNB = "m/44'/714'/0'/0",
|
|
241
|
+
BSC = "m/44'/60'/0'/0",
|
|
242
|
+
BTC = "m/84'/0'/0'/0",
|
|
243
|
+
DOGE = "m/44'/3'/0'/0",
|
|
244
|
+
ETH = "m/44'/60'/0'/0",
|
|
245
|
+
GAIA = "m/44'/118'/0'/0",
|
|
246
|
+
LTC = "m/84'/2'/0'/0",
|
|
247
|
+
MATIC = "m/44'/60'/0'/0",
|
|
248
|
+
MAYA = "m/44'/931'/0'/0",
|
|
249
|
+
OP = "m/44'/60'/0'/0",
|
|
250
|
+
THOR = "m/44'/931'/0'/0"
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export declare type DerivationPathArray = [number, number, number, number, number];
|
|
254
|
+
|
|
255
|
+
export declare const erc20ABI: ({
|
|
256
|
+
inputs: never[];
|
|
257
|
+
stateMutability: string;
|
|
258
|
+
type: string;
|
|
259
|
+
anonymous?: undefined;
|
|
260
|
+
name?: undefined;
|
|
261
|
+
outputs?: undefined;
|
|
262
|
+
} | {
|
|
263
|
+
anonymous: boolean;
|
|
264
|
+
inputs: {
|
|
265
|
+
indexed: boolean;
|
|
266
|
+
internalType: string;
|
|
267
|
+
name: string;
|
|
268
|
+
type: string;
|
|
269
|
+
}[];
|
|
270
|
+
name: string;
|
|
271
|
+
type: string;
|
|
272
|
+
stateMutability?: undefined;
|
|
273
|
+
outputs?: undefined;
|
|
274
|
+
} | {
|
|
275
|
+
inputs: {
|
|
276
|
+
internalType: string;
|
|
277
|
+
name: string;
|
|
278
|
+
type: string;
|
|
279
|
+
}[];
|
|
280
|
+
name: string;
|
|
281
|
+
outputs: {
|
|
282
|
+
internalType: string;
|
|
283
|
+
name: string;
|
|
284
|
+
type: string;
|
|
285
|
+
}[];
|
|
286
|
+
stateMutability: string;
|
|
287
|
+
type: string;
|
|
288
|
+
anonymous?: undefined;
|
|
289
|
+
})[];
|
|
290
|
+
|
|
291
|
+
export declare enum ERROR_CODE {
|
|
292
|
+
INVALID_INPUT_PARAMETERS = "1000",
|
|
293
|
+
UNKNOWN_PROVIDERS = "1001",
|
|
294
|
+
CANNOT_FIND_INBOUND_ADDRESS = "1002",
|
|
295
|
+
NO_INBOUND_ADDRESSES = "1003",
|
|
296
|
+
CHAIN_HALTED_OR_UNSUPPORTED = "1004",
|
|
297
|
+
MISSING_INPUT_PARAMETER = "1005",
|
|
298
|
+
INVALID_TYPE_GENERIC = "1100",
|
|
299
|
+
INVALID_NUMBER_STRING = "1101",
|
|
300
|
+
INVALID_NUMBER = "1102",
|
|
301
|
+
INVALID_BOOLEAN = "1103",
|
|
302
|
+
INVALID_OBJECT = "1104",
|
|
303
|
+
INVALID_ARRAY = "1105",
|
|
304
|
+
SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000",
|
|
305
|
+
SELL_BUY_ASSETS_ARE_THE_SAME = "2001",
|
|
306
|
+
MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002",
|
|
307
|
+
AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003",
|
|
308
|
+
AFF_ADDRESS_TOO_LONG = "2004",
|
|
309
|
+
AFF_BPS_INTEGER_0_100 = "2005",
|
|
310
|
+
SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006",
|
|
311
|
+
DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007",
|
|
312
|
+
PREFERRED_PROFVIDER_NOT_SUPPORTED = "2008",
|
|
313
|
+
DESTINATION_ADDRESS_SMART_CONTRACT = "2009",
|
|
314
|
+
BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010",
|
|
315
|
+
SOURCE_ADDRESS_SMART_CONTRACT = "2011",
|
|
316
|
+
INVALID_PROVIDER = "2100",
|
|
317
|
+
MISSING_CROSS_CHAIN_PROVIDER = "2101",
|
|
318
|
+
MISSING_AVAX_PROVIDER = "2102",
|
|
319
|
+
MISSING_BSC_PROVIDER = "2103",
|
|
320
|
+
MISSING_ETH_PROVIDER = "2104",
|
|
321
|
+
INVALID_PROVIDER_FOR_SWAP_OUT = "2105",
|
|
322
|
+
MISSING_ARB_PROVIDER = "2106",
|
|
323
|
+
INVALID_CHAIN = "2200",
|
|
324
|
+
INVALID_ASSET = "2201",
|
|
325
|
+
INVALID_ASSET_IDENTIFIER = "2202",
|
|
326
|
+
UNSUPPORTED_CHAIN = "2204",
|
|
327
|
+
UNSUPPORTED_ASSET = "2203",
|
|
328
|
+
UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205",
|
|
329
|
+
INVALID_SOURCE_ADDRESS = "2300",
|
|
330
|
+
INVALID_DESTINATION_ADDRESS = "2301",
|
|
331
|
+
THORNODE_QUOTE_GENERIC_ERROR = "3000",
|
|
332
|
+
NOT_ENOUGH_SYNTH_BALANCE = "3001",
|
|
333
|
+
SYNTH_MINTING_CAP_REACHED = "3002",
|
|
334
|
+
INVALID_QUOTE_MODE = "4000",
|
|
335
|
+
NO_QUOTES = "4001",
|
|
336
|
+
SERVICE_UNAVAILABLE_GENERIC = "5000",
|
|
337
|
+
MISSING_GAS_DATA_GENERIC = "5100",
|
|
338
|
+
MISSING_TOKEN_INFO_GENERIC = "5200",
|
|
339
|
+
CANT_FIND_TOKEN_LIST = "5201",
|
|
340
|
+
NO_PRICE = "5202",
|
|
341
|
+
PRICE_IS_STALE = "5203",
|
|
342
|
+
ADDRESS_NOT_WHITELISTED = "6000",
|
|
343
|
+
ADDRESS_ALREADY_CLAIMED = "6001",
|
|
344
|
+
TEMPORARY_ERROR = "9999"
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export declare enum ERROR_MODULE {
|
|
348
|
+
HEALTH_CONTROLLER = "1000",
|
|
349
|
+
LIQUIDITY_CONTROLLER = "1001",
|
|
350
|
+
PROVIDER_CONTROLLER = "1002",
|
|
351
|
+
QUOTE_CONTROLLER = "1003",
|
|
352
|
+
SWAP_CONTROLLER = "1004",
|
|
353
|
+
UTIL_CONTROLLER = "1005",
|
|
354
|
+
AIRDROP_CONTROLLER = "1006",
|
|
355
|
+
PROVIDER = "2000",
|
|
356
|
+
ASSET = "2001",
|
|
357
|
+
TOKEN_LIST = "2002",
|
|
358
|
+
QUOTE = "2100",
|
|
359
|
+
QUOTE_TXN_DETAILS = "2101",
|
|
360
|
+
THORCHAIN_PROVIDER = "3000",
|
|
361
|
+
UNISWAPV2_ETH_PROVIDER = "3001",
|
|
362
|
+
UNISWAPV3_ETH_PROVIDER = "3002",
|
|
363
|
+
SUSHISWAP_ETH_PROVIDER = "3003",
|
|
364
|
+
PANCAKESWAP_BSC_PROVIDER = "3004",
|
|
365
|
+
PANCAKESWAP_ETH_PROVIDER = "3005",
|
|
366
|
+
ONEINCH_ETH_PROVIDER = "3006",
|
|
367
|
+
ONEINCH_BSC_PROVIDER = "3007",
|
|
368
|
+
ONEINCH_AVAX_PROVIDER = "3008",
|
|
369
|
+
ZEROX_ETH_PROVIDER = "3009",
|
|
370
|
+
WOOFI_AVAX_PROVIDER = "3010",
|
|
371
|
+
PANGOLIN_AVAX_PROVIDER = "3011",
|
|
372
|
+
TRADERJOE_AVAX_PROVIDER = "3012",
|
|
373
|
+
KYBER_ETH_PROVIDER = "3013",
|
|
374
|
+
KYBER_AVAX_PROVIDER = "3014",
|
|
375
|
+
WOOFI_BSC_PROVIDER = "3015",
|
|
376
|
+
STARGATE_PROVIDER = "3016",
|
|
377
|
+
PROVIDER_UTIL = "4000",
|
|
378
|
+
TXN_DETAILS = "5000",
|
|
379
|
+
AIRDROP_UTIL = "6000"
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export declare enum ERROR_TYPE {
|
|
383
|
+
VALIDATION_ERROR = "VALIDATION_ERROR",
|
|
384
|
+
REQUEST_PARAMETER_ERROR = "REQUEST_PARAMETER_ERROR",
|
|
385
|
+
RESPONSE_PARSING_ERROR = "RESPONSE_PARSING_ERROR",
|
|
386
|
+
UNSUPPORTED = "UNSUPPORTED",
|
|
387
|
+
NOT_IMPLEMENTED = "NOT_IMPLEMENTED",
|
|
388
|
+
INCOMPATIBLE_ASSETS_OPERATIONS = "INCOMPATIBLE_ASSETS_OPERATIONS",
|
|
389
|
+
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
|
390
|
+
DOWN_FOR_MAINTENANCE = "DOWN_FOR_MAINTENANCE",
|
|
391
|
+
MISSING_INBOUND_INFO = "MISSING_INBOUND_INFO",
|
|
392
|
+
QUOTE_FETCHING_ERROR = "QUOTE_FETCHING_ERROR",
|
|
393
|
+
AIRDROP_ERROR = "AIRDROP_ERROR",
|
|
394
|
+
UNHANDLED_ERROR = "UNHANDLED_ERROR"
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export declare enum ErrorCode {
|
|
398
|
+
NoError = 36864
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export declare type ErrorInfo = {
|
|
402
|
+
status: number;
|
|
403
|
+
revision: string;
|
|
404
|
+
type?: ERROR_TYPE;
|
|
405
|
+
module: ERROR_MODULE;
|
|
406
|
+
code: ERROR_CODE;
|
|
407
|
+
message?: string | undefined;
|
|
408
|
+
stack?: string;
|
|
409
|
+
identifier?: string;
|
|
410
|
+
options?: ApiErrorOptions;
|
|
411
|
+
displayMessageParams?: string[];
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
export declare type EVMChain = Chain.Ethereum | Chain.Avalanche | Chain.BinanceSmartChain | Chain.Arbitrum | Chain.Optimism | Chain.Polygon;
|
|
415
|
+
|
|
416
|
+
export declare const EVMChainList: EVMChain[];
|
|
417
|
+
|
|
418
|
+
export declare type EVMTxBaseParams<T = bigint> = {
|
|
419
|
+
to?: string;
|
|
420
|
+
from?: string;
|
|
421
|
+
nonce?: number;
|
|
422
|
+
gasLimit?: T;
|
|
423
|
+
data?: string;
|
|
424
|
+
value?: T;
|
|
425
|
+
chainId?: T;
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
export declare type EVMWalletOptions = WalletOption.BRAVE | WalletOption.METAMASK | WalletOption.TRUSTWALLET_WEB | WalletOption.COINBASE_WEB;
|
|
429
|
+
|
|
430
|
+
export declare type ExtendParams<WalletConnectMethodNames = ''> = {
|
|
431
|
+
excludedChains?: Chain[];
|
|
432
|
+
config?: ConnectConfig;
|
|
433
|
+
rpcUrls?: {
|
|
434
|
+
[chain in Chain]?: string;
|
|
435
|
+
};
|
|
436
|
+
apis?: ApisType;
|
|
437
|
+
wallets: {
|
|
438
|
+
connectMethodName: ConnectMethodNames | WalletConnectMethodNames;
|
|
439
|
+
connect: (params: ConnectWalletParams) => (...params: any) => Promise<any>;
|
|
440
|
+
}[];
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
export declare enum FeeOption {
|
|
444
|
+
Average = "average",
|
|
445
|
+
Fast = "fast",
|
|
446
|
+
Fastest = "fastest"
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export declare type FixedNumberish = string | number | FixedNumber;
|
|
450
|
+
|
|
451
|
+
export declare type GetAddressAndPubKeyResponse = {
|
|
452
|
+
bech32_address: string;
|
|
453
|
+
compressed_pk: any;
|
|
454
|
+
error_message: string;
|
|
455
|
+
return_code: number;
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
export declare enum MemoType {
|
|
459
|
+
BOND = "BOND",
|
|
460
|
+
DEPOSIT = "+",
|
|
461
|
+
LEAVE = "LEAVE",
|
|
462
|
+
THORNAME_REGISTER = "~",
|
|
463
|
+
UNBOND = "UNBOND",
|
|
464
|
+
WITHDRAW = "-",
|
|
465
|
+
OPEN_LOAN = "$+",
|
|
466
|
+
CLOSE_LOAN = "$-"
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export declare const NetworkDerivationPath: Record<Chain, DerivationPathArray>;
|
|
470
|
+
|
|
471
|
+
export declare enum NetworkId {
|
|
472
|
+
Ethereum = 60,
|
|
473
|
+
Binance = 714,
|
|
474
|
+
THORChain = 931
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export declare enum QuoteMode {
|
|
478
|
+
TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC",
|
|
479
|
+
TC_SUPPORTED_TO_ETH = "TC-ERC20",
|
|
480
|
+
TC_SUPPORTED_TO_AVAX = "TC-ARC20",
|
|
481
|
+
TC_SUPPORTED_TO_BSC = "TC-BEP20",
|
|
482
|
+
ETH_TO_TC_SUPPORTED = "ERC20-TC",
|
|
483
|
+
ETH_TO_ETH = "ERC20-ERC20",
|
|
484
|
+
ETH_TO_AVAX = "ERC20-ARC20",
|
|
485
|
+
ETH_TO_BSC = "ERC20-BEP20",
|
|
486
|
+
AVAX_TO_TC_SUPPORTED = "ARC20-TC",
|
|
487
|
+
AVAX_TO_ETH = "ARC20-ERC20",
|
|
488
|
+
AVAX_TO_AVAX = "ARC20-ARC20",
|
|
489
|
+
AVAX_TO_BSC = "ARC20-BEP20",
|
|
490
|
+
BSC_TO_TC_SUPPORTED = "BEP20-TC",
|
|
491
|
+
BSC_TO_ETH = "BEP20-ERC20",
|
|
492
|
+
BSC_TO_AVAX = "BEP20-ARC20",
|
|
493
|
+
BSC_TO_BSC = "BEP20-BEP20"
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export declare enum RPCUrl {
|
|
497
|
+
Arbitrum = "https://arb1.arbitrum.io/rpc",
|
|
498
|
+
Avalanche = "https://node-router.thorswap.net/avalanche-c",
|
|
499
|
+
Binance = "",
|
|
500
|
+
BinanceSmartChain = "https://bsc-dataseed.binance.org",
|
|
501
|
+
Bitcoin = "https://node-router.thorswap.net/bitcoin",
|
|
502
|
+
BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash",
|
|
503
|
+
Cosmos = "https://node-router.thorswap.net/cosmos/rpc",
|
|
504
|
+
Dogecoin = "https://node-router.thorswap.net/dogecoin",
|
|
505
|
+
Ethereum = "https://node-router.thorswap.net/ethereum",
|
|
506
|
+
Litecoin = "https://node-router.thorswap.net/litecoin",
|
|
507
|
+
Maya = "https://tendermint.mayachain.info",
|
|
508
|
+
MayaStagenet = "https://stagenet.tendermint.mayachain.info",
|
|
509
|
+
Optimism = "https://mainnet.optimism.io",
|
|
510
|
+
Polygon = "https://polygon-rpc.com",
|
|
511
|
+
THORChain = "https://rpc.thorswap.net",
|
|
512
|
+
THORChainStagenet = "https://stagenet-rpc.ninerealms.com"
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
export declare type Signature = {
|
|
516
|
+
pub_key: {
|
|
517
|
+
type: string;
|
|
518
|
+
value: string;
|
|
519
|
+
};
|
|
520
|
+
sequence: string;
|
|
521
|
+
signature: string;
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
export declare const SWAP_IN: QuoteMode[];
|
|
525
|
+
|
|
526
|
+
export declare const SWAP_OUT: QuoteMode[];
|
|
527
|
+
|
|
528
|
+
export declare const TCAvalancheDepositABI: ({
|
|
529
|
+
inputs: never[];
|
|
530
|
+
stateMutability: string;
|
|
531
|
+
type: string;
|
|
532
|
+
anonymous?: undefined;
|
|
533
|
+
name?: undefined;
|
|
534
|
+
outputs?: undefined;
|
|
535
|
+
} | {
|
|
536
|
+
anonymous: boolean;
|
|
537
|
+
inputs: ({
|
|
538
|
+
indexed: boolean;
|
|
539
|
+
internalType: string;
|
|
540
|
+
name: string;
|
|
541
|
+
type: string;
|
|
542
|
+
components?: undefined;
|
|
543
|
+
} | {
|
|
544
|
+
components: {
|
|
545
|
+
internalType: string;
|
|
546
|
+
name: string;
|
|
547
|
+
type: string;
|
|
548
|
+
}[];
|
|
549
|
+
indexed: boolean;
|
|
550
|
+
internalType: string;
|
|
551
|
+
name: string;
|
|
552
|
+
type: string;
|
|
553
|
+
})[];
|
|
554
|
+
name: string;
|
|
555
|
+
type: string;
|
|
556
|
+
stateMutability?: undefined;
|
|
557
|
+
outputs?: undefined;
|
|
558
|
+
} | {
|
|
559
|
+
inputs: ({
|
|
560
|
+
internalType: string;
|
|
561
|
+
name: string;
|
|
562
|
+
type: string;
|
|
563
|
+
components?: undefined;
|
|
564
|
+
} | {
|
|
565
|
+
components: {
|
|
566
|
+
internalType: string;
|
|
567
|
+
name: string;
|
|
568
|
+
type: string;
|
|
569
|
+
}[];
|
|
570
|
+
internalType: string;
|
|
571
|
+
name: string;
|
|
572
|
+
type: string;
|
|
573
|
+
})[];
|
|
574
|
+
name: string;
|
|
575
|
+
outputs: never[];
|
|
576
|
+
stateMutability: string;
|
|
577
|
+
type: string;
|
|
578
|
+
anonymous?: undefined;
|
|
579
|
+
} | {
|
|
580
|
+
inputs: {
|
|
581
|
+
internalType: string;
|
|
582
|
+
name: string;
|
|
583
|
+
type: string;
|
|
584
|
+
}[];
|
|
585
|
+
name: string;
|
|
586
|
+
outputs: {
|
|
587
|
+
internalType: string;
|
|
588
|
+
name: string;
|
|
589
|
+
type: string;
|
|
590
|
+
}[];
|
|
591
|
+
stateMutability: string;
|
|
592
|
+
type: string;
|
|
593
|
+
anonymous?: undefined;
|
|
594
|
+
})[];
|
|
595
|
+
|
|
596
|
+
export declare const TCBscDepositABI: ({
|
|
597
|
+
inputs: never[];
|
|
598
|
+
stateMutability: string;
|
|
599
|
+
type: string;
|
|
600
|
+
anonymous?: undefined;
|
|
601
|
+
name?: undefined;
|
|
602
|
+
outputs?: undefined;
|
|
603
|
+
} | {
|
|
604
|
+
anonymous: boolean;
|
|
605
|
+
inputs: ({
|
|
606
|
+
indexed: boolean;
|
|
607
|
+
internalType: string;
|
|
608
|
+
name: string;
|
|
609
|
+
type: string;
|
|
610
|
+
components?: undefined;
|
|
611
|
+
} | {
|
|
612
|
+
components: {
|
|
613
|
+
internalType: string;
|
|
614
|
+
name: string;
|
|
615
|
+
type: string;
|
|
616
|
+
}[];
|
|
617
|
+
indexed: boolean;
|
|
618
|
+
internalType: string;
|
|
619
|
+
name: string;
|
|
620
|
+
type: string;
|
|
621
|
+
})[];
|
|
622
|
+
name: string;
|
|
623
|
+
type: string;
|
|
624
|
+
stateMutability?: undefined;
|
|
625
|
+
outputs?: undefined;
|
|
626
|
+
} | {
|
|
627
|
+
inputs: ({
|
|
628
|
+
internalType: string;
|
|
629
|
+
name: string;
|
|
630
|
+
type: string;
|
|
631
|
+
components?: undefined;
|
|
632
|
+
} | {
|
|
633
|
+
components: {
|
|
634
|
+
internalType: string;
|
|
635
|
+
name: string;
|
|
636
|
+
type: string;
|
|
637
|
+
}[];
|
|
638
|
+
internalType: string;
|
|
639
|
+
name: string;
|
|
640
|
+
type: string;
|
|
641
|
+
})[];
|
|
642
|
+
name: string;
|
|
643
|
+
outputs: never[];
|
|
644
|
+
stateMutability: string;
|
|
645
|
+
type: string;
|
|
646
|
+
anonymous?: undefined;
|
|
647
|
+
} | {
|
|
648
|
+
inputs: {
|
|
649
|
+
internalType: string;
|
|
650
|
+
name: string;
|
|
651
|
+
type: string;
|
|
652
|
+
}[];
|
|
653
|
+
name: string;
|
|
654
|
+
outputs: {
|
|
655
|
+
internalType: string;
|
|
656
|
+
name: string;
|
|
657
|
+
type: string;
|
|
658
|
+
}[];
|
|
659
|
+
stateMutability: string;
|
|
660
|
+
type: string;
|
|
661
|
+
anonymous?: undefined;
|
|
662
|
+
})[];
|
|
663
|
+
|
|
664
|
+
export declare const TCEthereumVaultAbi: ({
|
|
665
|
+
inputs: {
|
|
666
|
+
internalType: string;
|
|
667
|
+
name: string;
|
|
668
|
+
type: string;
|
|
669
|
+
}[];
|
|
670
|
+
stateMutability: string;
|
|
671
|
+
type: string;
|
|
672
|
+
anonymous?: undefined;
|
|
673
|
+
name?: undefined;
|
|
674
|
+
outputs?: undefined;
|
|
675
|
+
} | {
|
|
676
|
+
anonymous: boolean;
|
|
677
|
+
inputs: ({
|
|
678
|
+
indexed: boolean;
|
|
679
|
+
internalType: string;
|
|
680
|
+
name: string;
|
|
681
|
+
type: string;
|
|
682
|
+
components?: undefined;
|
|
683
|
+
} | {
|
|
684
|
+
components: {
|
|
685
|
+
internalType: string;
|
|
686
|
+
name: string;
|
|
687
|
+
type: string;
|
|
688
|
+
}[];
|
|
689
|
+
indexed: boolean;
|
|
690
|
+
internalType: string;
|
|
691
|
+
name: string;
|
|
692
|
+
type: string;
|
|
693
|
+
})[];
|
|
694
|
+
name: string;
|
|
695
|
+
type: string;
|
|
696
|
+
stateMutability?: undefined;
|
|
697
|
+
outputs?: undefined;
|
|
698
|
+
} | {
|
|
699
|
+
inputs: ({
|
|
700
|
+
internalType: string;
|
|
701
|
+
name: string;
|
|
702
|
+
type: string;
|
|
703
|
+
components?: undefined;
|
|
704
|
+
} | {
|
|
705
|
+
components: {
|
|
706
|
+
internalType: string;
|
|
707
|
+
name: string;
|
|
708
|
+
type: string;
|
|
709
|
+
}[];
|
|
710
|
+
internalType: string;
|
|
711
|
+
name: string;
|
|
712
|
+
type: string;
|
|
713
|
+
})[];
|
|
714
|
+
name: string;
|
|
715
|
+
outputs: never[];
|
|
716
|
+
stateMutability: string;
|
|
717
|
+
type: string;
|
|
718
|
+
anonymous?: undefined;
|
|
719
|
+
} | {
|
|
720
|
+
inputs: {
|
|
721
|
+
internalType: string;
|
|
722
|
+
name: string;
|
|
723
|
+
type: string;
|
|
724
|
+
}[];
|
|
725
|
+
name: string;
|
|
726
|
+
outputs: {
|
|
727
|
+
internalType: string;
|
|
728
|
+
name: string;
|
|
729
|
+
type: string;
|
|
730
|
+
}[];
|
|
731
|
+
stateMutability: string;
|
|
732
|
+
type: string;
|
|
733
|
+
anonymous?: undefined;
|
|
734
|
+
})[];
|
|
735
|
+
|
|
736
|
+
export declare type UTXOChain = Chain.Bitcoin | Chain.BitcoinCash | Chain.Dogecoin | Chain.Litecoin;
|
|
737
|
+
|
|
738
|
+
export declare const UTXOChainList: Chain[];
|
|
739
|
+
|
|
740
|
+
export declare enum WalletOption {
|
|
741
|
+
'KEYSTORE' = "KEYSTORE",
|
|
742
|
+
'KEEPKEY' = "KEEPKEY",
|
|
743
|
+
'XDEFI' = "XDEFI",
|
|
744
|
+
'METAMASK' = "METAMASK",
|
|
745
|
+
'COINBASE_WEB' = "COINBASE_WEB",
|
|
746
|
+
'TREZOR' = "TREZOR",
|
|
747
|
+
'TRUSTWALLET_WEB' = "TRUSTWALLET_WEB",
|
|
748
|
+
'LEDGER' = "LEDGER",
|
|
749
|
+
'KEPLR' = "KEPLR",
|
|
750
|
+
'OKX' = "OKX",
|
|
751
|
+
'BRAVE' = "BRAVE",
|
|
752
|
+
'WALLETCONNECT' = "WALLETCONNECT"
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
export declare type WalletTxParams = {
|
|
756
|
+
feeOptionKey?: FeeOption;
|
|
757
|
+
from?: string;
|
|
758
|
+
memo?: string;
|
|
759
|
+
recipient: string;
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
export declare type Witness = {
|
|
763
|
+
value: number;
|
|
764
|
+
script: Buffer;
|
|
765
|
+
};
|
|
766
|
+
|
|
767
|
+
export { }
|