@swapkit/helpers 4.0.0-beta.31 → 4.0.0-beta.33
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.cjs +3 -3
- package/dist/index.cjs.map +8 -8
- package/dist/index.js +3 -3
- package/dist/index.js.map +8 -8
- package/package.json +2 -2
- package/src/modules/swapKitError.ts +10 -0
- package/src/types/chains.ts +42 -3
- package/src/types/derivationPath.ts +7 -1
- package/src/types/wallet.ts +1 -0
- package/src/utils/asset.ts +5 -0
- package/src/utils/wallets.ts +6 -3
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"description": "SwapKit - Helpers",
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"@swapkit/toolboxes": "4.0.0-beta.
|
|
11
|
+
"@swapkit/toolboxes": "4.0.0-beta.50",
|
|
12
12
|
"ethers": "6.14.3",
|
|
13
13
|
"ts-pattern": "5.7.1",
|
|
14
14
|
"zod": "3.25.74",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"type-check:go": "tsgo"
|
|
60
60
|
},
|
|
61
61
|
"type": "module",
|
|
62
|
-
"version": "4.0.0-beta.
|
|
62
|
+
"version": "4.0.0-beta.33"
|
|
63
63
|
}
|
|
@@ -237,6 +237,15 @@ const errorCodes = {
|
|
|
237
237
|
wallet_near_extensions_no_provider: 22002,
|
|
238
238
|
wallet_near_extensions_not_found: 22003,
|
|
239
239
|
wallet_near_method_not_supported: 22003,
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Wallets - Vultisig
|
|
243
|
+
*/
|
|
244
|
+
wallet_vultisig_not_found: 22101,
|
|
245
|
+
wallet_vultisig_contract_address_not_provided: 22102,
|
|
246
|
+
wallet_vultisig_asset_not_defined: 22103,
|
|
247
|
+
wallet_vultisig_send_transaction_no_address: 22104,
|
|
248
|
+
|
|
240
249
|
/**
|
|
241
250
|
* Wallets - Xaman
|
|
242
251
|
*/
|
|
@@ -246,6 +255,7 @@ const errorCodes = {
|
|
|
246
255
|
wallet_xaman_connection_failed: 23004,
|
|
247
256
|
wallet_xaman_transaction_failed: 23005,
|
|
248
257
|
wallet_xaman_monitoring_failed: 23006,
|
|
258
|
+
|
|
249
259
|
/**
|
|
250
260
|
* Chainflip
|
|
251
261
|
*/
|
package/src/types/chains.ts
CHANGED
|
@@ -3,8 +3,10 @@ import { SwapKitError } from "../modules/swapKitError";
|
|
|
3
3
|
|
|
4
4
|
export enum Chain {
|
|
5
5
|
Arbitrum = "ARB",
|
|
6
|
+
Aurora = "AURORA",
|
|
6
7
|
Avalanche = "AVAX",
|
|
7
8
|
Base = "BASE",
|
|
9
|
+
Berachain = "BERA",
|
|
8
10
|
BinanceSmartChain = "BSC",
|
|
9
11
|
Bitcoin = "BTC",
|
|
10
12
|
BitcoinCash = "BCH",
|
|
@@ -13,6 +15,7 @@ export enum Chain {
|
|
|
13
15
|
Dogecoin = "DOGE",
|
|
14
16
|
Ethereum = "ETH",
|
|
15
17
|
Fiat = "FIAT",
|
|
18
|
+
Gnosis = "GNO",
|
|
16
19
|
Kujira = "KUJI",
|
|
17
20
|
Litecoin = "LTC",
|
|
18
21
|
Maya = "MAYA",
|
|
@@ -20,7 +23,7 @@ export enum Chain {
|
|
|
20
23
|
Optimism = "OP",
|
|
21
24
|
Polkadot = "DOT",
|
|
22
25
|
Chainflip = "FLIP",
|
|
23
|
-
Polygon = "
|
|
26
|
+
Polygon = "POL",
|
|
24
27
|
Radix = "XRD",
|
|
25
28
|
Ripple = "XRP",
|
|
26
29
|
THORChain = "THOR",
|
|
@@ -37,10 +40,14 @@ export enum StagenetChain {
|
|
|
37
40
|
export enum ChainId {
|
|
38
41
|
Arbitrum = "42161",
|
|
39
42
|
ArbitrumHex = "0xa4b1",
|
|
43
|
+
Aurora = "1313161554",
|
|
44
|
+
AuroraHex = "0x4e454152",
|
|
40
45
|
Avalanche = "43114",
|
|
41
46
|
AvalancheHex = "0xa86a",
|
|
42
47
|
Base = "8453",
|
|
43
48
|
BaseHex = "0x2105",
|
|
49
|
+
Berachain = "80094",
|
|
50
|
+
BerachainHex = "0x138de",
|
|
44
51
|
BinanceSmartChain = "56",
|
|
45
52
|
BinanceSmartChainHex = "0x38",
|
|
46
53
|
Bitcoin = "bitcoin",
|
|
@@ -49,10 +56,12 @@ export enum ChainId {
|
|
|
49
56
|
Cosmos = "cosmoshub-4",
|
|
50
57
|
Dash = "dash",
|
|
51
58
|
Dogecoin = "dogecoin",
|
|
52
|
-
Kujira = "kaiyo-1",
|
|
53
59
|
Ethereum = "1",
|
|
54
60
|
EthereumHex = "0x1",
|
|
55
61
|
Fiat = "fiat",
|
|
62
|
+
Gnosis = "100",
|
|
63
|
+
GnosisHex = "0x64",
|
|
64
|
+
Kujira = "kaiyo-1",
|
|
56
65
|
Litecoin = "litecoin",
|
|
57
66
|
Maya = "mayachain-mainnet-v1",
|
|
58
67
|
MayaStagenet = "mayachain-stagenet-v1",
|
|
@@ -75,10 +84,14 @@ export enum ChainId {
|
|
|
75
84
|
export const ChainIdToChain: Record<ChainId, Chain> = {
|
|
76
85
|
[ChainId.ArbitrumHex]: Chain.Arbitrum,
|
|
77
86
|
[ChainId.Arbitrum]: Chain.Arbitrum,
|
|
87
|
+
[ChainId.AuroraHex]: Chain.Aurora,
|
|
88
|
+
[ChainId.Aurora]: Chain.Aurora,
|
|
78
89
|
[ChainId.AvalancheHex]: Chain.Avalanche,
|
|
79
90
|
[ChainId.Avalanche]: Chain.Avalanche,
|
|
80
91
|
[ChainId.BaseHex]: Chain.Base,
|
|
81
92
|
[ChainId.Base]: Chain.Base,
|
|
93
|
+
[ChainId.BerachainHex]: Chain.Berachain,
|
|
94
|
+
[ChainId.Berachain]: Chain.Berachain,
|
|
82
95
|
[ChainId.BinanceSmartChainHex]: Chain.BinanceSmartChain,
|
|
83
96
|
[ChainId.BinanceSmartChain]: Chain.BinanceSmartChain,
|
|
84
97
|
[ChainId.BitcoinCash]: Chain.BitcoinCash,
|
|
@@ -90,6 +103,8 @@ export const ChainIdToChain: Record<ChainId, Chain> = {
|
|
|
90
103
|
[ChainId.EthereumHex]: Chain.Ethereum,
|
|
91
104
|
[ChainId.Ethereum]: Chain.Ethereum,
|
|
92
105
|
[ChainId.Fiat]: Chain.Fiat,
|
|
106
|
+
[ChainId.GnosisHex]: Chain.Gnosis,
|
|
107
|
+
[ChainId.Gnosis]: Chain.Gnosis,
|
|
93
108
|
[ChainId.Kujira]: Chain.Kujira,
|
|
94
109
|
[ChainId.Litecoin]: Chain.Litecoin,
|
|
95
110
|
[ChainId.MayaStagenet]: Chain.Maya,
|
|
@@ -116,9 +131,11 @@ const chains = Object.values(Chain) as Chain[];
|
|
|
116
131
|
|
|
117
132
|
export const BaseDecimal: Record<Chain, number> = {
|
|
118
133
|
ARB: 18,
|
|
134
|
+
AURORA: 18,
|
|
119
135
|
AVAX: 18,
|
|
120
136
|
BASE: 18,
|
|
121
137
|
BCH: 8,
|
|
138
|
+
BERA: 18,
|
|
122
139
|
BSC: 18,
|
|
123
140
|
BTC: 8,
|
|
124
141
|
DASH: 8,
|
|
@@ -128,9 +145,10 @@ export const BaseDecimal: Record<Chain, number> = {
|
|
|
128
145
|
FIAT: 2,
|
|
129
146
|
FLIP: 18,
|
|
130
147
|
GAIA: 6,
|
|
148
|
+
GNO: 18,
|
|
131
149
|
KUJI: 6,
|
|
132
150
|
LTC: 8,
|
|
133
|
-
|
|
151
|
+
POL: 18,
|
|
134
152
|
MAYA: 8,
|
|
135
153
|
NEAR: 24,
|
|
136
154
|
OP: 18,
|
|
@@ -144,8 +162,10 @@ export const BaseDecimal: Record<Chain, number> = {
|
|
|
144
162
|
|
|
145
163
|
export const BlockTimes: Record<Partial<Chain>, number> = {
|
|
146
164
|
[Chain.Arbitrum]: 0.3,
|
|
165
|
+
[Chain.Aurora]: 1,
|
|
147
166
|
[Chain.Avalanche]: 3,
|
|
148
167
|
[Chain.Base]: 2,
|
|
168
|
+
[Chain.Berachain]: 2,
|
|
149
169
|
[Chain.BinanceSmartChain]: 3,
|
|
150
170
|
[Chain.Bitcoin]: 600,
|
|
151
171
|
[Chain.BitcoinCash]: 600,
|
|
@@ -155,6 +175,7 @@ export const BlockTimes: Record<Partial<Chain>, number> = {
|
|
|
155
175
|
[Chain.Dogecoin]: 600,
|
|
156
176
|
[Chain.Ethereum]: 12.5,
|
|
157
177
|
[Chain.Fiat]: 60,
|
|
178
|
+
[Chain.Gnosis]: 5.2,
|
|
158
179
|
[Chain.Kujira]: 2.2,
|
|
159
180
|
[Chain.Litecoin]: 150,
|
|
160
181
|
[Chain.Maya]: 6,
|
|
@@ -175,19 +196,25 @@ export const SubstrateChains = [Chain.Polkadot, Chain.Chainflip];
|
|
|
175
196
|
|
|
176
197
|
export type EVMChain =
|
|
177
198
|
| Chain.Arbitrum
|
|
199
|
+
| Chain.Aurora
|
|
178
200
|
| Chain.Avalanche
|
|
179
201
|
| Chain.Base
|
|
202
|
+
| Chain.Berachain
|
|
180
203
|
| Chain.BinanceSmartChain
|
|
181
204
|
| Chain.Ethereum
|
|
205
|
+
| Chain.Gnosis
|
|
182
206
|
| Chain.Optimism
|
|
183
207
|
| Chain.Polygon;
|
|
184
208
|
|
|
185
209
|
export const EVMChains = [
|
|
186
210
|
Chain.Arbitrum,
|
|
211
|
+
Chain.Aurora,
|
|
187
212
|
Chain.Avalanche,
|
|
188
213
|
Chain.Base,
|
|
214
|
+
Chain.Berachain,
|
|
189
215
|
Chain.BinanceSmartChain,
|
|
190
216
|
Chain.Ethereum,
|
|
217
|
+
Chain.Gnosis,
|
|
191
218
|
Chain.Optimism,
|
|
192
219
|
Chain.Polygon,
|
|
193
220
|
] as const;
|
|
@@ -240,8 +267,10 @@ export const MAYASupportedChains = [
|
|
|
240
267
|
|
|
241
268
|
export const RPC_URLS: Record<Chain | StagenetChain, string> = {
|
|
242
269
|
[Chain.Arbitrum]: "https://arb1.arbitrum.io/rpc",
|
|
270
|
+
[Chain.Aurora]: "https://aurora-rpc.publicnode.com",
|
|
243
271
|
[Chain.Avalanche]: "https://api.avax.network/ext/bc/C/rpc",
|
|
244
272
|
[Chain.Base]: "https://base-rpc.publicnode.com",
|
|
273
|
+
[Chain.Berachain]: "https://berachain-rpc.publicnode.com",
|
|
245
274
|
[Chain.BinanceSmartChain]: "https://bsc-dataseed.binance.org",
|
|
246
275
|
[Chain.BitcoinCash]: "https://node-router.thorswap.net/bitcoin-cash",
|
|
247
276
|
[Chain.Bitcoin]: "https://bitcoin-rpc.publicnode.com",
|
|
@@ -251,6 +280,7 @@ export const RPC_URLS: Record<Chain | StagenetChain, string> = {
|
|
|
251
280
|
[Chain.Dogecoin]: "https://node-router.thorswap.net/dogecoin",
|
|
252
281
|
[Chain.Ethereum]: "https://ethereum-rpc.publicnode.com",
|
|
253
282
|
[Chain.Fiat]: "",
|
|
283
|
+
[Chain.Gnosis]: "https://gnosis-rpc.publicnode.com",
|
|
254
284
|
[Chain.Kujira]: "https://kujira-rpc.ibs.team",
|
|
255
285
|
[Chain.Litecoin]: "https://node-router.thorswap.net/litecoin",
|
|
256
286
|
[Chain.Maya]: "https://tendermint.mayachain.info",
|
|
@@ -284,6 +314,7 @@ export const FALLBACK_URLS: Record<Chain | StagenetChain, string[]> = {
|
|
|
284
314
|
"https://arb-mainnet.g.alchemy.com/v2/demo",
|
|
285
315
|
"https://arbitrum.blockpi.network/v1/rpc/public",
|
|
286
316
|
],
|
|
317
|
+
[Chain.Aurora]: ["https://1rpc.io/aurora", "https://mainnet.aurora.dev"],
|
|
287
318
|
[Chain.Avalanche]: [
|
|
288
319
|
"https://api.avax.network/ext/bc/C/rpc",
|
|
289
320
|
"https://avalanche-c-chain-rpc.publicnode.com",
|
|
@@ -293,6 +324,7 @@ export const FALLBACK_URLS: Record<Chain | StagenetChain, string[]> = {
|
|
|
293
324
|
"https://bsc-rpc.gateway.pokt.network",
|
|
294
325
|
"https://bsc-dataseed2.binance.org",
|
|
295
326
|
],
|
|
327
|
+
[Chain.Berachain]: ["https://rpc.berachain.com", "https://berachain.drpc.org"],
|
|
296
328
|
[Chain.Bitcoin]: ["https://bitcoin.publicnode.com"],
|
|
297
329
|
[Chain.BitcoinCash]: ["https://bch-dataseed.binance.org", "https://bch.getblock.io/mainnet"],
|
|
298
330
|
[Chain.Chainflip]: [
|
|
@@ -304,6 +336,7 @@ export const FALLBACK_URLS: Record<Chain | StagenetChain, string[]> = {
|
|
|
304
336
|
[Chain.Dogecoin]: ["https://doge.getblock.io/mainnet", "https://dogecoin.publicnode.com"],
|
|
305
337
|
[Chain.Ethereum]: ["https://eth.llamarpc.com", "https://cloudflare-eth.com"],
|
|
306
338
|
[Chain.Fiat]: [],
|
|
339
|
+
[Chain.Gnosis]: ["https://gnosis.drpc.org", "https://rpc.ankr.com/gnosis"],
|
|
307
340
|
[Chain.Kujira]: ["https://kujira-rpc.polkachu.com", "https://rpc-kujira.synergynodes.com/"],
|
|
308
341
|
[Chain.Litecoin]: ["https://ltc.getblock.io/mainnet", "https://litecoin.publicnode.com"],
|
|
309
342
|
[Chain.Maya]: ["https://tendermint.mayachain.info", "https://maya-tendermint.publicnode.com"],
|
|
@@ -333,8 +366,10 @@ export const FALLBACK_URLS: Record<Chain | StagenetChain, string[]> = {
|
|
|
333
366
|
|
|
334
367
|
export const EXPLORER_URLS: Record<Chain, string> = {
|
|
335
368
|
[Chain.Arbitrum]: "https://arbiscan.io",
|
|
369
|
+
[Chain.Aurora]: "https://explorer.mainnet.aurora.dev",
|
|
336
370
|
[Chain.Avalanche]: "https://snowtrace.io",
|
|
337
371
|
[Chain.Base]: "https://basescan.org",
|
|
372
|
+
[Chain.Berachain]: "https://berascan.com",
|
|
338
373
|
[Chain.BinanceSmartChain]: "https://bscscan.com",
|
|
339
374
|
[Chain.Bitcoin]: "https://blockchair.com/bitcoin",
|
|
340
375
|
[Chain.BitcoinCash]: "https://www.blockchair.com/bitcoin-cash",
|
|
@@ -344,6 +379,7 @@ export const EXPLORER_URLS: Record<Chain, string> = {
|
|
|
344
379
|
[Chain.Dogecoin]: "https://blockchair.com/dogecoin",
|
|
345
380
|
[Chain.Ethereum]: "https://etherscan.io",
|
|
346
381
|
[Chain.Fiat]: "",
|
|
382
|
+
[Chain.Gnosis]: "https://gnosisscan.io",
|
|
347
383
|
[Chain.Kujira]: "https://finder.kujira.network/kaiyo-1",
|
|
348
384
|
[Chain.Litecoin]: "https://blockchair.com/litecoin",
|
|
349
385
|
[Chain.Maya]: "https://www.mayascan.org",
|
|
@@ -365,10 +401,13 @@ const getRpcBody = (chain: Chain | StagenetChain) => {
|
|
|
365
401
|
return match(chain)
|
|
366
402
|
.with(
|
|
367
403
|
Chain.Arbitrum,
|
|
404
|
+
Chain.Aurora,
|
|
368
405
|
Chain.Avalanche,
|
|
369
406
|
Chain.Base,
|
|
407
|
+
Chain.Berachain,
|
|
370
408
|
Chain.BinanceSmartChain,
|
|
371
409
|
Chain.Ethereum,
|
|
410
|
+
Chain.Gnosis,
|
|
372
411
|
Chain.Optimism,
|
|
373
412
|
Chain.Polygon,
|
|
374
413
|
() => ({ id: 1, jsonrpc: "2.0", method: "eth_blockNumber", params: [] }),
|
|
@@ -3,10 +3,13 @@ import type { Chain } from "./chains";
|
|
|
3
3
|
|
|
4
4
|
export enum ContractAddress {
|
|
5
5
|
ARB = "0x0000000000000000000000000000000000000000",
|
|
6
|
+
AURORA = "0x0000000000000000000000000000000000000000",
|
|
6
7
|
AVAX = "0x0000000000000000000000000000000000000000",
|
|
7
8
|
BASE = "0x0000000000000000000000000000000000000000",
|
|
9
|
+
BERA = "0x0000000000000000000000000000000000000000",
|
|
8
10
|
ETH = "0x0000000000000000000000000000000000000000",
|
|
9
11
|
BSC = "0x0000000000000000000000000000000000000000",
|
|
12
|
+
GNO = "0x0000000000000000000000000000000000000000",
|
|
10
13
|
MATIC = "0x0000000000000000000000000000000000001010",
|
|
11
14
|
OP = "0x4200000000000000000000000000000000000042",
|
|
12
15
|
}
|
|
@@ -15,18 +18,21 @@ export type DerivationPathArray = [number, number, number, number, number?];
|
|
|
15
18
|
|
|
16
19
|
export const NetworkDerivationPath: Record<Chain, DerivationPathArray> = {
|
|
17
20
|
ARB: [44, 60, 0, 0, 0],
|
|
21
|
+
AURORA: [44, 60, 0, 0, 0],
|
|
18
22
|
AVAX: [44, 60, 0, 0, 0],
|
|
19
23
|
BASE: [44, 60, 0, 0, 0],
|
|
20
24
|
BCH: [44, 145, 0, 0, 0],
|
|
25
|
+
BERA: [44, 60, 0, 0, 0],
|
|
21
26
|
BSC: [44, 60, 0, 0, 0],
|
|
22
27
|
BTC: [84, 0, 0, 0, 0],
|
|
23
28
|
DASH: [44, 5, 0, 0, 0],
|
|
24
29
|
DOGE: [44, 3, 0, 0, 0],
|
|
25
30
|
ETH: [44, 60, 0, 0, 0],
|
|
26
31
|
GAIA: [44, 118, 0, 0, 0],
|
|
32
|
+
GNO: [44, 60, 0, 0, 0],
|
|
27
33
|
KUJI: [44, 118, 0, 0, 0],
|
|
28
34
|
LTC: [84, 2, 0, 0, 0],
|
|
29
|
-
|
|
35
|
+
POL: [44, 60, 0, 0, 0],
|
|
30
36
|
MAYA: [44, 931, 0, 0, 0],
|
|
31
37
|
NEAR: [44, 397, 0, 0, 0],
|
|
32
38
|
OP: [44, 60, 0, 0, 0],
|
package/src/types/wallet.ts
CHANGED
package/src/utils/asset.ts
CHANGED
|
@@ -24,6 +24,7 @@ export const CommonAssetStrings = [
|
|
|
24
24
|
|
|
25
25
|
const ethGasChains = [
|
|
26
26
|
Chain.Arbitrum,
|
|
27
|
+
Chain.Aurora,
|
|
27
28
|
Chain.Base,
|
|
28
29
|
Chain.Ethereum,
|
|
29
30
|
Chain.Optimism,
|
|
@@ -114,7 +115,9 @@ export function isGasAsset({ chain, symbol }: { chain: Chain; symbol: string })
|
|
|
114
115
|
return match(chain)
|
|
115
116
|
.with(...ethGasChains, () => symbol === "ETH")
|
|
116
117
|
.with(Chain.Avalanche, () => symbol === "AVAX")
|
|
118
|
+
.with(Chain.Berachain, () => symbol === "BERA")
|
|
117
119
|
.with(Chain.BinanceSmartChain, () => symbol === "BNB")
|
|
120
|
+
.with(Chain.Gnosis, () => symbol === "XDAU")
|
|
118
121
|
.with(Chain.Maya, () => symbol === "CACAO")
|
|
119
122
|
.with(Chain.Cosmos, () => symbol === "ATOM")
|
|
120
123
|
.with(Chain.THORChain, () => symbol === "RUNE")
|
|
@@ -132,6 +135,8 @@ export const getCommonAssetInfo = (assetString: CommonAssetString) => {
|
|
|
132
135
|
.with(Chain.Maya, (asset) => ({ identifier: `${asset}.CACAO`, decimal: 10 }))
|
|
133
136
|
.with(Chain.BinanceSmartChain, (asset) => ({ identifier: `${asset}.BNB`, decimal }))
|
|
134
137
|
.with(Chain.Avalanche, (asset) => ({ identifier: `${asset}.AVAX`, decimal }))
|
|
138
|
+
.with(Chain.Gnosis, (asset) => ({ identifier: `${asset}.XDAI`, decimal }))
|
|
139
|
+
.with(Chain.Berachain, (asset) => ({ identifier: `${asset}.BERA`, decimal }))
|
|
135
140
|
.with(
|
|
136
141
|
...UTXOChains,
|
|
137
142
|
Chain.Solana,
|
package/src/utils/wallets.ts
CHANGED
|
@@ -21,6 +21,7 @@ declare const window: {
|
|
|
21
21
|
bitkeep?: { ethereum: EthereumWindowProvider };
|
|
22
22
|
xfi?: { ethereum: EthereumWindowProvider };
|
|
23
23
|
$onekey?: { ethereum: EthereumWindowProvider };
|
|
24
|
+
vultisig?: { ethereum: EthereumWindowProvider };
|
|
24
25
|
} & Window;
|
|
25
26
|
|
|
26
27
|
export function isWeb3Detected() {
|
|
@@ -35,6 +36,7 @@ export function listWeb3EVMWallets() {
|
|
|
35
36
|
const metamaskEnabled = window?.ethereum && !window.ethereum?.isBraveWallet;
|
|
36
37
|
// @ts-ignore that should be implemented in ctrl and hooked up via swapkit core
|
|
37
38
|
const ctrlEnabled = window?.xfi || window?.ethereum?.__XDEFI;
|
|
39
|
+
const vultisigEnabled = window?.vultisig;
|
|
38
40
|
const braveEnabled = window?.ethereum?.isBraveWallet;
|
|
39
41
|
const trustEnabled = window?.ethereum?.isTrust || window?.trustwallet;
|
|
40
42
|
const coinbaseEnabled =
|
|
@@ -47,6 +49,7 @@ export function listWeb3EVMWallets() {
|
|
|
47
49
|
const wallets = [];
|
|
48
50
|
if (metamaskEnabled) wallets.push(WalletOption.METAMASK);
|
|
49
51
|
if (ctrlEnabled) wallets.push(WalletOption.CTRL);
|
|
52
|
+
if (vultisigEnabled) wallets.push(WalletOption.VULTISIG);
|
|
50
53
|
if (braveEnabled) wallets.push(WalletOption.BRAVE);
|
|
51
54
|
if (trustEnabled) wallets.push(WalletOption.TRUSTWALLET_WEB);
|
|
52
55
|
if (coinbaseEnabled) wallets.push(WalletOption.COINBASE_WEB);
|
|
@@ -68,10 +71,10 @@ export async function switchEVMWalletNetwork(
|
|
|
68
71
|
method: "wallet_switchEthereumChain",
|
|
69
72
|
params: [{ chainId: ChainToHexChainId[chain] }],
|
|
70
73
|
});
|
|
71
|
-
} catch (
|
|
74
|
+
} catch (error) {
|
|
72
75
|
if (!networkParams) {
|
|
73
76
|
throw new SwapKitError("helpers_failed_to_switch_network", {
|
|
74
|
-
error:
|
|
77
|
+
error: error,
|
|
75
78
|
reason: "networkParams not provided",
|
|
76
79
|
});
|
|
77
80
|
}
|
|
@@ -84,7 +87,7 @@ export function filterSupportedChains<T extends string[]>({
|
|
|
84
87
|
supportedChains,
|
|
85
88
|
walletType,
|
|
86
89
|
}: { chains: Chain[]; supportedChains: T; walletType?: WalletOption }) {
|
|
87
|
-
const supported = chains.filter((chain) => supportedChains.includes(chain));
|
|
90
|
+
const supported = chains.filter((chain) => !chain || supportedChains.includes(chain));
|
|
88
91
|
|
|
89
92
|
if (supported.length === 0) {
|
|
90
93
|
throw new SwapKitError("wallet_chain_not_supported", {
|