@swapkit/types 1.0.0-rc.4 → 1.0.0-rc.40

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,30 @@
1
+ export type GetAddressAndPubKeyResponse = {
2
+ bech32_address: string;
3
+ compressed_pk: any;
4
+ error_message: string;
5
+ return_code: number;
6
+ };
7
+
8
+ export type Signature = {
9
+ pub_key: {
10
+ type: string;
11
+ value: string;
12
+ };
13
+ sequence: string;
14
+ signature: string;
15
+ };
16
+
17
+ export enum ErrorCode {
18
+ NoError = 0x9000,
19
+ }
20
+
21
+ export enum MemoType {
22
+ BOND = "BOND",
23
+ DEPOSIT = "+",
24
+ LEAVE = "LEAVE",
25
+ THORNAME_REGISTER = "~",
26
+ UNBOND = "UNBOND",
27
+ WITHDRAW = "-",
28
+ OPEN_LOAN = "$+",
29
+ CLOSE_LOAN = "$-",
30
+ }
@@ -1,26 +1,23 @@
1
- import type { FixedNumber } from 'ethers';
2
-
3
- import type { Chain, CosmosChain, EVMChain, UTXOChain } from './network.ts';
4
- import type { WalletOption } from './wallet.ts';
1
+ import type { Chain, CosmosChain, EVMChain, UTXOChain } from "./network.ts";
2
+ import type { WalletOption } from "./wallet.ts";
5
3
 
6
4
  type ConnectMethodNames =
7
- | 'connectEVMWallet'
8
- | 'connectKeplr'
9
- | 'connectKeystore'
10
- | 'connectLedger'
11
- | 'connectOkx'
12
- | 'connectTrezor'
13
- | 'connectWalletconnect'
14
- | 'connectXDEFI';
15
-
16
- type ChainWallet = {
17
- address: string;
18
- balance: any[];
19
- walletType: WalletOption;
20
- };
5
+ | "connectEVMWallet"
6
+ | "connectKeplr"
7
+ | "connectKeystore"
8
+ | "connectKeepkey"
9
+ | "connectLedger"
10
+ | "connectOkx"
11
+ | "connectTrezor"
12
+ | "connectWalletconnect"
13
+ | "connectXDEFI";
21
14
 
22
15
  export type ConnectConfig = {
23
16
  stagenet?: boolean;
17
+ /**
18
+ * @required
19
+ */
20
+ thorswapApiKey?: string;
24
21
  /**
25
22
  * @required for AVAX & BSC
26
23
  */
@@ -30,7 +27,11 @@ export type ConnectConfig = {
30
27
  */
31
28
  ethplorerApiKey?: string;
32
29
  /**
33
- * @required for BTC, LTC, DOGE & BCH
30
+ * @required for BTC, BCH, LTC, DOGE
31
+ */
32
+ blockchairApiKey?: string;
33
+ /**
34
+ * @deprecated - use blockchairApiKey instead
34
35
  */
35
36
  utxoApiKey?: string;
36
37
  /**
@@ -44,21 +45,28 @@ export type ConnectConfig = {
44
45
  email: string;
45
46
  appUrl: string;
46
47
  };
48
+ /**
49
+ * @optional for KeepKey config
50
+ */
51
+ keepkeyConfig?: {
52
+ apiKey: string;
53
+ pairingInfo: {
54
+ name: string;
55
+ imageUrl: string;
56
+ basePath: string;
57
+ url: string;
58
+ };
59
+ };
47
60
  };
48
61
 
49
- export type AddChainWalletParams = {
50
- chain: Chain;
51
- wallet: ChainWallet;
52
- walletMethods: any;
53
- };
54
-
55
- export type Witness = {
56
- value: number;
57
- script: Buffer;
62
+ export type AddChainWalletParams<T extends Chain> = {
63
+ address: string;
64
+ balance: any[];
65
+ walletType: WalletOption;
66
+ chain: T;
67
+ [key: string]: any;
58
68
  };
59
69
 
60
- export type FixedNumberish = string | number | FixedNumber;
61
-
62
70
  type ApisType = { [key in UTXOChain]?: string | any } & {
63
71
  [key in EVMChain]?: string | any;
64
72
  } & {
@@ -66,13 +74,18 @@ type ApisType = { [key in UTXOChain]?: string | any } & {
66
74
  };
67
75
 
68
76
  export type ConnectWalletParams = {
69
- addChain: (params: AddChainWalletParams) => void;
77
+ addChain: <T extends Chain>(params: AddChainWalletParams<T>) => void;
70
78
  config: ConnectConfig;
71
79
  rpcUrls: { [chain in Chain]?: string };
72
80
  apis: ApisType;
73
81
  };
74
82
 
75
- export type ExtendParams<WalletConnectMethodNames = ''> = {
83
+ export type Witness = {
84
+ value: number;
85
+ script: Buffer;
86
+ };
87
+
88
+ export type ExtendParams<WalletConnectMethodNames = ""> = {
76
89
  excludedChains?: Chain[];
77
90
  config?: ConnectConfig;
78
91
  rpcUrls?: { [chain in Chain]?: string };
@@ -84,22 +97,22 @@ export type ExtendParams<WalletConnectMethodNames = ''> = {
84
97
  };
85
98
 
86
99
  export enum QuoteMode {
87
- TC_SUPPORTED_TO_TC_SUPPORTED = 'TC-TC',
88
- TC_SUPPORTED_TO_ETH = 'TC-ERC20',
89
- TC_SUPPORTED_TO_AVAX = 'TC-ARC20',
90
- TC_SUPPORTED_TO_BSC = 'TC-BEP20',
91
- ETH_TO_TC_SUPPORTED = 'ERC20-TC',
92
- ETH_TO_ETH = 'ERC20-ERC20',
93
- ETH_TO_AVAX = 'ERC20-ARC20',
94
- ETH_TO_BSC = 'ERC20-BEP20',
95
- AVAX_TO_TC_SUPPORTED = 'ARC20-TC',
96
- AVAX_TO_ETH = 'ARC20-ERC20',
97
- AVAX_TO_AVAX = 'ARC20-ARC20',
98
- AVAX_TO_BSC = 'ARC20-BEP20',
99
- BSC_TO_TC_SUPPORTED = 'BEP20-TC',
100
- BSC_TO_ETH = 'BEP20-ERC20',
101
- BSC_TO_AVAX = 'BEP20-ARC20',
102
- BSC_TO_BSC = 'BEP20-BEP20',
100
+ TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC",
101
+ TC_SUPPORTED_TO_ETH = "TC-ERC20",
102
+ TC_SUPPORTED_TO_AVAX = "TC-ARC20",
103
+ TC_SUPPORTED_TO_BSC = "TC-BEP20",
104
+ ETH_TO_TC_SUPPORTED = "ERC20-TC",
105
+ ETH_TO_ETH = "ERC20-ERC20",
106
+ ETH_TO_AVAX = "ERC20-ARC20",
107
+ ETH_TO_BSC = "ERC20-BEP20",
108
+ AVAX_TO_TC_SUPPORTED = "ARC20-TC",
109
+ AVAX_TO_ETH = "ARC20-ERC20",
110
+ AVAX_TO_AVAX = "ARC20-ARC20",
111
+ AVAX_TO_BSC = "ARC20-BEP20",
112
+ BSC_TO_TC_SUPPORTED = "BEP20-TC",
113
+ BSC_TO_ETH = "BEP20-ERC20",
114
+ BSC_TO_AVAX = "BEP20-ARC20",
115
+ BSC_TO_BSC = "BEP20-BEP20",
103
116
  }
104
117
 
105
118
  export type Asset = {
package/src/index.ts CHANGED
@@ -1,8 +1,7 @@
1
- export { erc20ABI } from './abis/erc20.ts';
2
- export { TCAvalancheDepositABI, TCBscDepositABI, TCEthereumVaultAbi } from './abis/tcEthVault.ts';
3
- export * from './commonTypes.ts';
4
- export * from './errors/index.ts';
5
- export * from './network.ts';
6
- export * from './thorchain.ts';
7
- export * from './transactions.ts';
8
- export * from './wallet.ts';
1
+ export { erc20ABI } from "./abis/erc20.ts";
2
+ export { TCAvalancheDepositABI, TCBscDepositABI, TCEthereumVaultAbi } from "./abis/tcEthVault.ts";
3
+ export * from "./commonTypes.ts";
4
+ export * from "./network.ts";
5
+ export * from "./thorchain.ts";
6
+ export * from "./transactions.ts";
7
+ export * from "./wallet.ts";
package/src/network.ts CHANGED
@@ -1,29 +1,32 @@
1
1
  export enum Chain {
2
- Arbitrum = 'ARB',
3
- Avalanche = 'AVAX',
4
- Binance = 'BNB',
5
- BinanceSmartChain = 'BSC',
6
- Bitcoin = 'BTC',
7
- BitcoinCash = 'BCH',
8
- Cosmos = 'GAIA',
9
- Dogecoin = 'DOGE',
10
- Ethereum = 'ETH',
11
- Kujira = 'KUJI',
12
- Litecoin = 'LTC',
13
- Maya = 'MAYA',
14
- Optimism = 'OP',
15
- Polygon = 'MATIC',
16
- THORChain = 'THOR',
2
+ Arbitrum = "ARB",
3
+ Avalanche = "AVAX",
4
+ Binance = "BNB",
5
+ BinanceSmartChain = "BSC",
6
+ Bitcoin = "BTC",
7
+ BitcoinCash = "BCH",
8
+ Cosmos = "GAIA",
9
+ Dash = "DASH",
10
+ Dogecoin = "DOGE",
11
+ Ethereum = "ETH",
12
+ Kujira = "KUJI",
13
+ Litecoin = "LTC",
14
+ Maya = "MAYA",
15
+ Optimism = "OP",
16
+ Polkadot = "DOT",
17
+ Chainflip = "FLIP",
18
+ Polygon = "MATIC",
19
+ THORChain = "THOR",
17
20
  }
18
21
  type ChainNameType = keyof typeof Chain;
19
22
 
20
23
  export enum ContractAddress {
21
- ARB = '0x0000000000000000000000000000000000000000',
22
- AVAX = '0x0000000000000000000000000000000000000000',
23
- ETH = '0x0000000000000000000000000000000000000000',
24
- BSC = '0x0000000000000000000000000000000000000000',
25
- MATIC = '0x0000000000000000000000000000000000001010',
26
- OP = '0x4200000000000000000000000000000000000042',
24
+ ARB = "0x0000000000000000000000000000000000000000",
25
+ AVAX = "0x0000000000000000000000000000000000000000",
26
+ ETH = "0x0000000000000000000000000000000000000000",
27
+ BSC = "0x0000000000000000000000000000000000000000",
28
+ MATIC = "0x0000000000000000000000000000000000001010",
29
+ OP = "0x4200000000000000000000000000000000000042",
27
30
  }
28
31
 
29
32
  export enum DerivationPath {
@@ -33,8 +36,11 @@ export enum DerivationPath {
33
36
  BNB = "m/44'/714'/0'/0",
34
37
  BSC = "m/44'/60'/0'/0",
35
38
  BTC = "m/84'/0'/0'/0",
39
+ DASH = "m/44'/5'/0'/0",
36
40
  DOGE = "m/44'/3'/0'/0",
41
+ DOT = "////",
37
42
  ETH = "m/44'/60'/0'/0",
43
+ FLIP = "////",
38
44
  GAIA = "m/44'/118'/0'/0",
39
45
  KUJI = "m/44'/118'/0'/0",
40
46
  LTC = "m/84'/2'/0'/0",
@@ -53,6 +59,7 @@ export const NetworkDerivationPath: Record<Chain, DerivationPathArray> = {
53
59
  BNB: [44, 714, 0, 0, 0],
54
60
  BSC: [44, 60, 0, 0, 0],
55
61
  BTC: [84, 0, 0, 0, 0],
62
+ DASH: [44, 5, 0, 0, 0],
56
63
  DOGE: [44, 3, 0, 0, 0],
57
64
  ETH: [44, 60, 0, 0, 0],
58
65
  GAIA: [44, 118, 0, 0, 0],
@@ -62,6 +69,9 @@ export const NetworkDerivationPath: Record<Chain, DerivationPathArray> = {
62
69
  MAYA: [44, 931, 0, 0, 0],
63
70
  OP: [44, 60, 0, 0, 0],
64
71
  THOR: [44, 931, 0, 0, 0],
72
+ // Polkadot and related network derivation path is not number based
73
+ DOT: [0, 0, 0, 0, 0],
74
+ FLIP: [0, 0, 0, 0, 0],
65
75
  };
66
76
 
67
77
  export enum BaseDecimal {
@@ -73,7 +83,9 @@ export enum BaseDecimal {
73
83
  BTC = 8,
74
84
  DASH = 8,
75
85
  DOGE = 8,
86
+ DOT = 10,
76
87
  ETH = 18,
88
+ FLIP = 18,
77
89
  GAIA = 6,
78
90
  KUJI = 6,
79
91
  LTC = 8,
@@ -81,8 +93,12 @@ export enum BaseDecimal {
81
93
  MAYA = 10,
82
94
  OP = 18,
83
95
  THOR = 8,
96
+ ZEC = 8,
84
97
  }
85
98
 
99
+ export type SubstrateChain = Chain.Polkadot | Chain.Chainflip;
100
+ export const SubstrateChains = [Chain.Polkadot, Chain.Chainflip];
101
+
86
102
  export type EVMChain =
87
103
  | Chain.Ethereum
88
104
  | Chain.Avalanche
@@ -91,23 +107,39 @@ export type EVMChain =
91
107
  | Chain.Optimism
92
108
  | Chain.Polygon;
93
109
 
94
- export const EVMChainList: EVMChain[] = [
110
+ export const EVMChains = [
95
111
  Chain.Ethereum,
96
112
  Chain.Avalanche,
97
113
  Chain.BinanceSmartChain,
98
114
  Chain.Arbitrum,
99
115
  Chain.Optimism,
100
116
  Chain.Polygon,
101
- ];
117
+ ] as const;
118
+ /**
119
+ * @deprecated
120
+ * Use `EVMChains` instead
121
+ */
122
+ export const EVMChainList = EVMChains;
102
123
 
103
- export type UTXOChain = Chain.Bitcoin | Chain.BitcoinCash | Chain.Dogecoin | Chain.Litecoin;
124
+ export type UTXOChain =
125
+ | Chain.Bitcoin
126
+ | Chain.BitcoinCash
127
+ | Chain.Dash
128
+ | Chain.Dogecoin
129
+ | Chain.Litecoin;
104
130
 
105
- export const UTXOChainList: Chain[] = [
131
+ export const UTXOChains = [
106
132
  Chain.Bitcoin,
107
133
  Chain.BitcoinCash,
134
+ Chain.Dash,
108
135
  Chain.Dogecoin,
109
136
  Chain.Litecoin,
110
- ];
137
+ ] as const;
138
+ /**
139
+ * @deprecated
140
+ * Use `UTXOChains` instead
141
+ */
142
+ export const UTXOChainList = UTXOChains;
111
143
 
112
144
  export type CosmosChain =
113
145
  | Chain.Cosmos
@@ -116,63 +148,94 @@ export type CosmosChain =
116
148
  | Chain.Maya
117
149
  | Chain.Kujira;
118
150
 
119
- export const CosmosChainList: CosmosChain[] = [Chain.Cosmos, Chain.THORChain, Chain.Binance];
151
+ export const CosmosChains = [Chain.Cosmos, Chain.THORChain, Chain.Binance] as const;
152
+
153
+ /**
154
+ * @deprecated
155
+ * Use `CosmosChains` instead
156
+ */
157
+ export const CosmosChainList = CosmosChains;
158
+
159
+ export const TCSupportedChains = [
160
+ Chain.Avalanche,
161
+ Chain.Binance,
162
+ Chain.BinanceSmartChain,
163
+ Chain.Bitcoin,
164
+ Chain.BitcoinCash,
165
+ Chain.Cosmos,
166
+ Chain.Dogecoin,
167
+ Chain.Ethereum,
168
+ Chain.Litecoin,
169
+ Chain.THORChain,
170
+ ] as const;
171
+
172
+ /**
173
+ * @deprecated
174
+ * Use `TCSupportedChains` instead
175
+ */
176
+ export const TCSupportedChainList = TCSupportedChains;
120
177
 
121
178
  export enum ChainId {
122
- Arbitrum = '42161',
123
- ArbitrumHex = '0xa4b1',
124
- Avalanche = '43114',
125
- AvalancheHex = '0xa86a',
126
- Binance = 'Binance-Chain-Tigris',
127
- BinanceSmartChain = '56',
128
- BinanceSmartChainHex = '0x38',
129
- Bitcoin = 'bitcoin',
130
- BitcoinCash = 'bitcoincash',
131
- Cosmos = 'cosmoshub-4',
132
- Dogecoin = 'dogecoin',
133
- Kujira = 'kaiyo-1',
134
- Ethereum = '1',
135
- EthereumHex = '0x1',
136
- Litecoin = 'litecoin',
137
- Maya = 'mayachain-mainnet-v1',
138
- MayaStagenet = 'mayachain-stagenet-v1',
139
- Optimism = '10',
140
- OptimismHex = '0xa',
141
- Polygon = '137',
142
- PolygonHex = '0x89',
143
- THORChain = 'thorchain-mainnet-v1',
144
- THORChainStagenet = 'thorchain-stagenet-v2',
179
+ Arbitrum = "42161",
180
+ ArbitrumHex = "0xa4b1",
181
+ Avalanche = "43114",
182
+ AvalancheHex = "0xa86a",
183
+ Binance = "Binance-Chain-Tigris",
184
+ BinanceSmartChain = "56",
185
+ BinanceSmartChainHex = "0x38",
186
+ Bitcoin = "bitcoin",
187
+ BitcoinCash = "bitcoincash",
188
+ Chainflip = "chainflip",
189
+ Cosmos = "cosmoshub-4",
190
+ Dash = "dash",
191
+ Dogecoin = "dogecoin",
192
+ Kujira = "kaiyo-1",
193
+ Ethereum = "1",
194
+ EthereumHex = "0x1",
195
+ Litecoin = "litecoin",
196
+ Maya = "mayachain-mainnet-v1",
197
+ MayaStagenet = "mayachain-stagenet-v1",
198
+ Optimism = "10",
199
+ OptimismHex = "0xa",
200
+ Polkadot = "polkadot",
201
+ Polygon = "137",
202
+ PolygonHex = "0x89",
203
+ THORChain = "thorchain-mainnet-v1",
204
+ THORChainStagenet = "thorchain-stagenet-v2",
145
205
  }
146
206
 
147
207
  export enum RPCUrl {
148
- Arbitrum = 'https://arb1.arbitrum.io/rpc',
149
- Avalanche = 'https://node-router.thorswap.net/avalanche-c',
150
- Binance = '',
151
- BinanceSmartChain = 'https://bsc-dataseed.binance.org',
152
- Bitcoin = 'https://node-router.thorswap.net/bitcoin',
153
- BitcoinCash = 'https://node-router.thorswap.net/bitcoin-cash',
154
- Cosmos = 'https://node-router.thorswap.net/cosmos/rpc',
155
- Kujira = 'https://rpc-kujira.synergynodes.com/',
156
- Dogecoin = 'https://node-router.thorswap.net/dogecoin',
157
- Ethereum = 'https://node-router.thorswap.net/ethereum',
158
- Litecoin = 'https://node-router.thorswap.net/litecoin',
159
- Maya = 'https://tendermint.mayachain.info',
160
- MayaStagenet = 'https://stagenet.tendermint.mayachain.info',
161
- Optimism = 'https://mainnet.optimism.io',
162
- Polygon = 'https://polygon-rpc.com',
163
- THORChain = 'https://rpc.thorswap.net',
164
- THORChainStagenet = 'https://stagenet-rpc.ninerealms.com',
208
+ Arbitrum = "https://arb1.arbitrum.io/rpc",
209
+ Avalanche = "https://node-router.thorswap.net/avalanche-c",
210
+ Binance = "",
211
+ BinanceSmartChain = "https://bsc-dataseed.binance.org",
212
+ Bitcoin = "https://node-router.thorswap.net/bitcoin",
213
+ BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash",
214
+ Chainflip = "wss://mainnet-archive.chainflip.io",
215
+ Cosmos = "https://node-router.thorswap.net/cosmos/rpc",
216
+ Dash = "https://node-router.thorswap.net/dash",
217
+ Dogecoin = "https://node-router.thorswap.net/dogecoin",
218
+ Ethereum = "https://node-router.thorswap.net/ethereum",
219
+ Kujira = "https://rpc-kujira.synergynodes.com/",
220
+ Litecoin = "https://node-router.thorswap.net/litecoin",
221
+ Maya = "https://tendermint.mayachain.info",
222
+ MayaStagenet = "https://stagenet.tendermint.mayachain.info",
223
+ Optimism = "https://mainnet.optimism.io",
224
+ Polkadot = "wss://rpc.polkadot.io",
225
+ Polygon = "https://polygon-rpc.com",
226
+ THORChain = "https://rpc.thorswap.net",
227
+ THORChainStagenet = "https://stagenet-rpc.ninerealms.com",
165
228
  }
166
229
 
167
230
  export enum ApiUrl {
168
- Cosmos = 'https://node-router.thorswap.net/cosmos/rest',
169
- Kujira = 'https://lcd-kujira.synergynodes.com/',
170
- MayanodeMainnet = 'https://mayanode.mayachain.info',
171
- MayanodeStagenet = 'https://stagenet.mayanode.mayachain.info',
172
- ThornodeMainnet = 'https://thornode.thorswap.net',
173
- ThornodeStagenet = 'https://stagenet-thornode.ninerealms.com',
174
- ThorswapApi = 'https://api.thorswap.finance',
175
- ThorswapStatic = 'https://static.thorswap.net',
231
+ Cosmos = "https://node-router.thorswap.net/cosmos/rest",
232
+ Kujira = "https://lcd-kujira.synergynodes.com/",
233
+ MayanodeMainnet = "https://mayanode.mayachain.info",
234
+ MayanodeStagenet = "https://stagenet.mayanode.mayachain.info",
235
+ ThornodeMainnet = "https://thornode.thorswap.net",
236
+ ThornodeStagenet = "https://stagenet-thornode.ninerealms.com",
237
+ ThorswapApi = "https://api.thorswap.net",
238
+ ThorswapStatic = "https://static.thorswap.net",
176
239
  }
177
240
 
178
241
  const chains = Object.values(Chain) as Chain[];
@@ -225,7 +288,9 @@ export const ChainIdToChain: Record<ChainId, Chain> = {
225
288
  [ChainId.Binance]: Chain.Binance,
226
289
  [ChainId.BitcoinCash]: Chain.BitcoinCash,
227
290
  [ChainId.Bitcoin]: Chain.Bitcoin,
291
+ [ChainId.Chainflip]: Chain.Chainflip,
228
292
  [ChainId.Cosmos]: Chain.Cosmos,
293
+ [ChainId.Dash]: Chain.Dash,
229
294
  [ChainId.Dogecoin]: Chain.Dogecoin,
230
295
  [ChainId.EthereumHex]: Chain.Ethereum,
231
296
  [ChainId.Kujira]: Chain.Kujira,
@@ -235,6 +300,7 @@ export const ChainIdToChain: Record<ChainId, Chain> = {
235
300
  [ChainId.Maya]: Chain.Maya,
236
301
  [ChainId.OptimismHex]: Chain.Optimism,
237
302
  [ChainId.Optimism]: Chain.Optimism,
303
+ [ChainId.Polkadot]: Chain.Polkadot,
238
304
  [ChainId.PolygonHex]: Chain.Polygon,
239
305
  [ChainId.Polygon]: Chain.Polygon,
240
306
  [ChainId.THORChainStagenet]: Chain.THORChain,
@@ -242,19 +308,22 @@ export const ChainIdToChain: Record<ChainId, Chain> = {
242
308
  };
243
309
 
244
310
  export const ChainToExplorerUrl: Record<Chain, string> = {
245
- [Chain.Arbitrum]: 'https://arbiscan.io',
246
- [Chain.Avalanche]: 'https://snowtrace.io',
247
- [Chain.BinanceSmartChain]: 'https://bscscan.com',
248
- [Chain.Binance]: 'https://explorer.binance.org',
249
- [Chain.BitcoinCash]: 'https://www.blockchain.com/bch',
250
- [Chain.Bitcoin]: 'https://blockstream.info',
251
- [Chain.Cosmos]: 'https://cosmos.bigdipper.live',
252
- [Chain.Dogecoin]: 'https://blockchair.com/dogecoin',
253
- [Chain.Kujira]: 'https://finder.kujira.network/kaiyo-1',
254
- [Chain.Ethereum]: 'https://etherscan.io',
255
- [Chain.Litecoin]: 'https://ltc.bitaps.com',
256
- [Chain.Maya]: 'https://www.mayascan.org',
257
- [Chain.Optimism]: 'https://optimistic.etherscan.io',
258
- [Chain.Polygon]: 'https://polygonscan.com',
259
- [Chain.THORChain]: 'https://viewblock.io/thorchain',
311
+ [Chain.Arbitrum]: "https://arbiscan.io",
312
+ [Chain.Avalanche]: "https://snowtrace.io",
313
+ [Chain.BinanceSmartChain]: "https://bscscan.com",
314
+ [Chain.Binance]: "https://explorer.binance.org",
315
+ [Chain.BitcoinCash]: "https://www.blockchair.com/bitcoin-cash",
316
+ [Chain.Bitcoin]: "https://blockchair.com/bitcoin",
317
+ [Chain.Chainflip]: "https://explorer.polkascan.io/polkadot",
318
+ [Chain.Cosmos]: "https://cosmos.bigdipper.live",
319
+ [Chain.Dash]: "https://blockchair.com/dash",
320
+ [Chain.Dogecoin]: "https://blockchair.com/dogecoin",
321
+ [Chain.Kujira]: "https://finder.kujira.network/kaiyo-1",
322
+ [Chain.Ethereum]: "https://etherscan.io",
323
+ [Chain.Litecoin]: "https://blockchair.com/litecoin",
324
+ [Chain.Maya]: "https://www.mayascan.org",
325
+ [Chain.Optimism]: "https://optimistic.etherscan.io",
326
+ [Chain.Polkadot]: "https://polkadot.subscan.io/",
327
+ [Chain.Polygon]: "https://polygonscan.com",
328
+ [Chain.THORChain]: "https://runescan.io",
260
329
  };
package/src/thorchain.ts CHANGED
@@ -14,17 +14,13 @@ export type Signature = {
14
14
  signature: string;
15
15
  };
16
16
 
17
- export enum ErrorCode {
18
- NoError = 0x9000,
19
- }
20
-
21
17
  export enum MemoType {
22
- BOND = 'BOND',
23
- DEPOSIT = '+',
24
- LEAVE = 'LEAVE',
25
- THORNAME_REGISTER = '~',
26
- UNBOND = 'UNBOND',
27
- WITHDRAW = '-',
28
- OPEN_LOAN = '$+',
29
- CLOSE_LOAN = '$-',
18
+ BOND = "BOND",
19
+ DEPOSIT = "+",
20
+ LEAVE = "LEAVE",
21
+ THORNAME_REGISTER = "~",
22
+ UNBOND = "UNBOND",
23
+ WITHDRAW = "-",
24
+ OPEN_LOAN = "$+",
25
+ CLOSE_LOAN = "$-",
30
26
  }
@@ -1,7 +1,7 @@
1
1
  export enum FeeOption {
2
- Average = 'average',
3
- Fast = 'fast',
4
- Fastest = 'fastest',
2
+ Average = "average",
3
+ Fast = "fast",
4
+ Fastest = "fastest",
5
5
  }
6
6
 
7
7
  export type WalletTxParams = {
package/src/wallet.ts CHANGED
@@ -1,19 +1,28 @@
1
1
  export enum WalletOption {
2
- 'KEYSTORE' = 'KEYSTORE',
3
- 'XDEFI' = 'XDEFI',
4
- 'METAMASK' = 'METAMASK',
5
- 'COINBASE_WEB' = 'COINBASE_WEB',
6
- 'TREZOR' = 'TREZOR',
7
- 'TRUSTWALLET_WEB' = 'TRUSTWALLET_WEB',
8
- 'LEDGER' = 'LEDGER',
9
- 'KEPLR' = 'KEPLR',
10
- 'OKX' = 'OKX',
11
- 'BRAVE' = 'BRAVE',
12
- 'WALLETCONNECT' = 'WALLETCONNECT',
2
+ KEYSTORE = "KEYSTORE",
3
+ KEEPKEY = "KEEPKEY",
4
+ XDEFI = "XDEFI",
5
+ METAMASK = "METAMASK",
6
+ COINBASE_WEB = "COINBASE_WEB",
7
+ TREZOR = "TREZOR",
8
+ TRUSTWALLET_WEB = "TRUSTWALLET_WEB",
9
+ LEDGER = "LEDGER",
10
+ KEPLR = "KEPLR",
11
+ OKX = "OKX",
12
+ OKX_MOBILE = "OKX_MOBILE",
13
+ BRAVE = "BRAVE",
14
+ WALLETCONNECT = "WALLETCONNECT",
13
15
  }
14
16
 
15
17
  export type EVMWalletOptions =
16
18
  | WalletOption.BRAVE
19
+ | WalletOption.OKX_MOBILE
17
20
  | WalletOption.METAMASK
18
21
  | WalletOption.TRUSTWALLET_WEB
19
22
  | WalletOption.COINBASE_WEB;
23
+
24
+ export enum LedgerErrorCode {
25
+ NoError = 0x9000,
26
+ LockedDevice = 0x5515,
27
+ TC_NotFound = 65535,
28
+ }