@imtbl/sdk 0.1.8-alpha.2 → 0.1.9-alpha
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/blockchain-data.d.ts +402 -110
- package/dist/blockchain-data.js +1699 -232
- package/dist/browser/checkout.js +2 -2
- package/dist/checkout_sdk.d.ts +163 -68
- package/dist/checkout_sdk.js +570 -215
- package/dist/checkout_widgets.d.ts +63 -156
- package/dist/checkout_widgets.js +20 -80
- package/dist/erc20.d.ts +180 -11
- package/dist/erc20.js +22 -22
- package/dist/erc721-permissioned-mintable.d.ts +258 -84
- package/dist/erc721-permissioned-mintable.js +134 -114
- package/dist/immutablex_client.js +1 -1
- package/dist/index.cjs +6966 -1834
- package/dist/index.d.ts +712 -413
- package/dist/index.js +6988 -1855
- package/dist/orderbook.d.ts +16 -16
- package/dist/orderbook.js +221 -114
- package/dist/passport.d.ts +3 -4
- package/dist/passport.js +3681 -436
- package/package.json +6 -1
package/dist/checkout_sdk.js
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
|
-
import { utils, Contract, ethers } from 'ethers';
|
|
2
|
-
import $7v2Z6$metamaskdetectprovider from '@metamask/detect-provider';
|
|
1
|
+
import { utils, Contract, ethers, BigNumber as BigNumber$1 } from 'ethers';
|
|
3
2
|
import { Web3Provider } from '@ethersproject/providers';
|
|
3
|
+
import $7v2Z6$metamaskdetectprovider from '@metamask/detect-provider';
|
|
4
|
+
import { BigNumber, utils as utils$1 } from 'ethers/lib/ethers';
|
|
5
|
+
import { BridgeConfiguration, ETH_MAINNET_TO_ZKEVM_MAINNET, ETH_SEPOLIA_TO_ZKEVM_DEVNET, TokenBridge } from '@imtbl/bridge-sdk';
|
|
6
|
+
import { Exchange, ExchangeConfiguration } from '@imtbl/dex-sdk';
|
|
4
7
|
|
|
5
8
|
var Environment;
|
|
6
9
|
(function (Environment) {
|
|
7
10
|
Environment["PRODUCTION"] = "production";
|
|
8
11
|
Environment["SANDBOX"] = "sandbox";
|
|
9
12
|
})(Environment || (Environment = {}));
|
|
13
|
+
class ImmutableConfiguration {
|
|
14
|
+
environment;
|
|
15
|
+
apiKey;
|
|
16
|
+
constructor(options) {
|
|
17
|
+
this.environment = options.environment;
|
|
18
|
+
this.apiKey = options.apiKey;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
10
21
|
|
|
11
22
|
function $parcel$interopDefault(a) {
|
|
12
23
|
return a && a.__esModule ? a.default : a;
|
|
13
24
|
}
|
|
14
|
-
|
|
25
|
+
/* eslint-disable class-methods-use-this */
|
|
15
26
|
const $762782b6c862d954$export$db5daa1b5156ccfe = [
|
|
16
27
|
{
|
|
17
28
|
constant: true,
|
|
@@ -75,14 +86,12 @@ const $762782b6c862d954$export$db5daa1b5156ccfe = [
|
|
|
75
86
|
|
|
76
87
|
/**
|
|
77
88
|
* Enum representing the supported chains with their corresponding IDs.
|
|
78
|
-
*/
|
|
89
|
+
*/ var $baec09ddc3013323$export$c06e1e7429de6283;
|
|
79
90
|
(function(ChainId) {
|
|
80
91
|
ChainId[ChainId["ETHEREUM"] = 1] = "ETHEREUM";
|
|
81
|
-
ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
|
|
82
|
-
ChainId[ChainId["IMTBL_ZKEVM_DEVNET"] = 13373] = "IMTBL_ZKEVM_DEVNET";
|
|
83
92
|
ChainId[ChainId["IMTBL_ZKEVM_TESTNET"] = 13372] = "IMTBL_ZKEVM_TESTNET";
|
|
84
|
-
ChainId[ChainId["
|
|
85
|
-
ChainId[ChainId["
|
|
93
|
+
ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
|
|
94
|
+
ChainId[ChainId["IMTBL_ZKEVM_DEVNET"] = 13383] = "IMTBL_ZKEVM_DEVNET";
|
|
86
95
|
})($baec09ddc3013323$export$c06e1e7429de6283 || ($baec09ddc3013323$export$c06e1e7429de6283 = {}));
|
|
87
96
|
|
|
88
97
|
|
|
@@ -94,13 +103,38 @@ const $bc2bfebf768286d3$export$6a2ba3c3bd042990 = {
|
|
|
94
103
|
};
|
|
95
104
|
|
|
96
105
|
|
|
97
|
-
|
|
106
|
+
var $d176a05e966364ba$export$3bfad4d03ada24c4;
|
|
98
107
|
(function(ConnectionProviders) {
|
|
99
108
|
ConnectionProviders["METAMASK"] = "metamask";
|
|
100
109
|
})($d176a05e966364ba$export$3bfad4d03ada24c4 || ($d176a05e966364ba$export$3bfad4d03ada24c4 = {}));
|
|
101
110
|
|
|
102
111
|
|
|
112
|
+
var $de275b98d2b651c3$export$788b1fd17f3dad84;
|
|
113
|
+
(function(GasEstimateType) {
|
|
114
|
+
GasEstimateType["BRIDGE_TO_L2"] = "BRIDGE_TO_L2";
|
|
115
|
+
GasEstimateType["SWAP"] = "SWAP";
|
|
116
|
+
})($de275b98d2b651c3$export$788b1fd17f3dad84 || ($de275b98d2b651c3$export$788b1fd17f3dad84 = {}));
|
|
117
|
+
|
|
103
118
|
|
|
119
|
+
|
|
120
|
+
const $a47e48dd2c04791b$export$345c852d0dc8f1df = new Map([
|
|
121
|
+
[
|
|
122
|
+
($baec09ddc3013323$export$c06e1e7429de6283).ETHEREUM,
|
|
123
|
+
"https://checkout-api.dev.immutable.com/v1/rpc/eth-mainnet"
|
|
124
|
+
],
|
|
125
|
+
[
|
|
126
|
+
($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_TESTNET,
|
|
127
|
+
"https://zkevm-rpc.sandbox.x.immutable.com"
|
|
128
|
+
],
|
|
129
|
+
[
|
|
130
|
+
($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA,
|
|
131
|
+
"https://checkout-api.dev.immutable.com/v1/rpc/eth-sepolia"
|
|
132
|
+
],
|
|
133
|
+
[
|
|
134
|
+
($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_DEVNET,
|
|
135
|
+
"https://zkevm-rpc.dev.x.immutable.com"
|
|
136
|
+
]
|
|
137
|
+
]);
|
|
104
138
|
const $a47e48dd2c04791b$export$6f24f3cef7d501c4 = new Map([
|
|
105
139
|
[
|
|
106
140
|
($baec09ddc3013323$export$c06e1e7429de6283).ETHEREUM,
|
|
@@ -108,7 +142,7 @@ const $a47e48dd2c04791b$export$6f24f3cef7d501c4 = new Map([
|
|
|
108
142
|
chainIdHex: "0x1",
|
|
109
143
|
chainName: "Ethereum",
|
|
110
144
|
rpcUrls: [
|
|
111
|
-
|
|
145
|
+
$a47e48dd2c04791b$export$345c852d0dc8f1df.get(($baec09ddc3013323$export$c06e1e7429de6283).ETHEREUM)
|
|
112
146
|
],
|
|
113
147
|
nativeCurrency: {
|
|
114
148
|
name: "Ethereum",
|
|
@@ -126,7 +160,7 @@ const $a47e48dd2c04791b$export$6f24f3cef7d501c4 = new Map([
|
|
|
126
160
|
chainIdHex: "0x343C",
|
|
127
161
|
chainName: "Immutable zkEVM Testnet",
|
|
128
162
|
rpcUrls: [
|
|
129
|
-
|
|
163
|
+
$a47e48dd2c04791b$export$345c852d0dc8f1df.get(($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_TESTNET)
|
|
130
164
|
],
|
|
131
165
|
nativeCurrency: {
|
|
132
166
|
name: "IMX",
|
|
@@ -134,24 +168,6 @@ const $a47e48dd2c04791b$export$6f24f3cef7d501c4 = new Map([
|
|
|
134
168
|
decimals: 18
|
|
135
169
|
}
|
|
136
170
|
}
|
|
137
|
-
],
|
|
138
|
-
[
|
|
139
|
-
($baec09ddc3013323$export$c06e1e7429de6283).POLYGON_ZKEVM,
|
|
140
|
-
{
|
|
141
|
-
chainIdHex: "0x89",
|
|
142
|
-
chainName: "Polygon zkEVM",
|
|
143
|
-
rpcUrls: [
|
|
144
|
-
"https://polygon-rpc.com"
|
|
145
|
-
],
|
|
146
|
-
nativeCurrency: {
|
|
147
|
-
name: "MATIC",
|
|
148
|
-
symbol: "MATIC",
|
|
149
|
-
decimals: 18
|
|
150
|
-
},
|
|
151
|
-
blockExplorerUrls: [
|
|
152
|
-
"https://polygonscan.com/"
|
|
153
|
-
]
|
|
154
|
-
}
|
|
155
171
|
]
|
|
156
172
|
]);
|
|
157
173
|
const $a47e48dd2c04791b$export$3e81fc0987227f10 = new Map([
|
|
@@ -161,7 +177,7 @@ const $a47e48dd2c04791b$export$3e81fc0987227f10 = new Map([
|
|
|
161
177
|
chainIdHex: "0xaa36a7",
|
|
162
178
|
chainName: "Sepolia",
|
|
163
179
|
rpcUrls: [
|
|
164
|
-
|
|
180
|
+
$a47e48dd2c04791b$export$345c852d0dc8f1df.get(($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA)
|
|
165
181
|
],
|
|
166
182
|
nativeCurrency: {
|
|
167
183
|
name: "Sep Eth",
|
|
@@ -176,10 +192,10 @@ const $a47e48dd2c04791b$export$3e81fc0987227f10 = new Map([
|
|
|
176
192
|
[
|
|
177
193
|
($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_DEVNET,
|
|
178
194
|
{
|
|
179
|
-
chainIdHex: "
|
|
195
|
+
chainIdHex: "0x3447",
|
|
180
196
|
chainName: "Immutable zkEVM Devnet",
|
|
181
197
|
rpcUrls: [
|
|
182
|
-
|
|
198
|
+
$a47e48dd2c04791b$export$345c852d0dc8f1df.get(($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_DEVNET)
|
|
183
199
|
],
|
|
184
200
|
nativeCurrency: {
|
|
185
201
|
name: "IMX",
|
|
@@ -187,27 +203,9 @@ const $a47e48dd2c04791b$export$3e81fc0987227f10 = new Map([
|
|
|
187
203
|
decimals: 18
|
|
188
204
|
}
|
|
189
205
|
}
|
|
190
|
-
],
|
|
191
|
-
[
|
|
192
|
-
($baec09ddc3013323$export$c06e1e7429de6283).POLYGON_ZKEVM_TESTNET,
|
|
193
|
-
{
|
|
194
|
-
chainIdHex: "0x5A2",
|
|
195
|
-
chainName: "Polygon zkEVM Testnet",
|
|
196
|
-
rpcUrls: [
|
|
197
|
-
"https://rpc.public.zkevm-test.net"
|
|
198
|
-
],
|
|
199
|
-
nativeCurrency: {
|
|
200
|
-
name: "MATIC",
|
|
201
|
-
symbol: "MATIC",
|
|
202
|
-
decimals: 18
|
|
203
|
-
},
|
|
204
|
-
blockExplorerUrls: [
|
|
205
|
-
"https://testnet-zkevm.polygonscan.com"
|
|
206
|
-
]
|
|
207
|
-
}
|
|
208
206
|
]
|
|
209
207
|
]);
|
|
210
|
-
|
|
208
|
+
var $a47e48dd2c04791b$export$1f05a55fe0680cc7;
|
|
211
209
|
(function(NetworkFilterTypes) {
|
|
212
210
|
NetworkFilterTypes["ALL"] = "all";
|
|
213
211
|
})($a47e48dd2c04791b$export$1f05a55fe0680cc7 || ($a47e48dd2c04791b$export$1f05a55fe0680cc7 = {}));
|
|
@@ -215,7 +213,7 @@ let $a47e48dd2c04791b$export$1f05a55fe0680cc7;
|
|
|
215
213
|
|
|
216
214
|
|
|
217
215
|
|
|
218
|
-
|
|
216
|
+
var $08d5ddc39acd6833$export$fd9b17d87f4121d2;
|
|
219
217
|
(function(TokenFilterTypes) {
|
|
220
218
|
TokenFilterTypes["SWAP"] = "swap";
|
|
221
219
|
TokenFilterTypes["BRIDGE"] = "bridge";
|
|
@@ -234,14 +232,15 @@ let $08d5ddc39acd6833$export$fd9b17d87f4121d2;
|
|
|
234
232
|
|
|
235
233
|
|
|
236
234
|
|
|
237
|
-
|
|
235
|
+
var $4f91c5f280efe242$export$35b06f0d33f57e26;
|
|
238
236
|
(function(WalletAction) {
|
|
239
237
|
WalletAction["CHECK_CONNECTION"] = "eth_accounts";
|
|
240
238
|
WalletAction["CONNECT"] = "eth_requestAccounts";
|
|
241
239
|
WalletAction["ADD_NETWORK"] = "wallet_addEthereumChain";
|
|
242
240
|
WalletAction["SWITCH_NETWORK"] = "wallet_switchEthereumChain";
|
|
241
|
+
WalletAction["GET_CHAINID"] = "eth_chainId";
|
|
243
242
|
})($4f91c5f280efe242$export$35b06f0d33f57e26 || ($4f91c5f280efe242$export$35b06f0d33f57e26 = {}));
|
|
244
|
-
|
|
243
|
+
var $4f91c5f280efe242$export$a75605c67ea83a5a;
|
|
245
244
|
(function(WalletFilterTypes) {
|
|
246
245
|
WalletFilterTypes["ALL"] = "all";
|
|
247
246
|
WalletFilterTypes["DESKTOP"] = "desktop";
|
|
@@ -249,13 +248,25 @@ let $4f91c5f280efe242$export$a75605c67ea83a5a;
|
|
|
249
248
|
})($4f91c5f280efe242$export$a75605c67ea83a5a || ($4f91c5f280efe242$export$a75605c67ea83a5a = {}));
|
|
250
249
|
|
|
251
250
|
|
|
251
|
+
var $e768639828688ca3$export$2d7a51a18d87e21d;
|
|
252
|
+
(function(WalletProviderName) {
|
|
253
|
+
WalletProviderName["METAMASK"] = "metamask";
|
|
254
|
+
})($e768639828688ca3$export$2d7a51a18d87e21d || ($e768639828688ca3$export$2d7a51a18d87e21d = {}));
|
|
255
|
+
const $e768639828688ca3$export$44dde05038008549 = {
|
|
256
|
+
allowMistmatchedChainId: false,
|
|
257
|
+
allowUnsupportedProvider: false
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
|
|
252
261
|
|
|
253
262
|
|
|
254
263
|
/**
|
|
255
264
|
* The different types of errors that can be returned by the checkout process.
|
|
256
|
-
*/
|
|
265
|
+
*/ var $a8bc256d81a5e2c1$export$e3dc0620abde7f5a;
|
|
257
266
|
(function(CheckoutErrorType) {
|
|
258
|
-
CheckoutErrorType["
|
|
267
|
+
CheckoutErrorType["WEB3_PROVIDER_ERROR"] = "WEB3_PROVIDER_ERROR";
|
|
268
|
+
CheckoutErrorType["PROVIDER_ERROR"] = "PROVIDER_ERROR";
|
|
269
|
+
CheckoutErrorType["DEFAULT_PROVIDER_ERROR"] = "DEFAULT_PROVIDER_ERROR";
|
|
259
270
|
CheckoutErrorType["CONNECT_PROVIDER_ERROR"] = "CONNECT_PROVIDER_ERROR";
|
|
260
271
|
CheckoutErrorType["GET_BALANCE_ERROR"] = "GET_BALANCE_ERROR";
|
|
261
272
|
CheckoutErrorType["GET_ERC20_BALANCE_ERROR"] = "GET_ERC20_BALANCE_ERROR";
|
|
@@ -268,8 +279,12 @@ let $4f91c5f280efe242$export$a75605c67ea83a5a;
|
|
|
268
279
|
CheckoutErrorType["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
|
|
269
280
|
CheckoutErrorType["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
|
|
270
281
|
CheckoutErrorType["UNPREDICTABLE_GAS_LIMIT"] = "UNPREDICTABLE_GAS_LIMIT";
|
|
282
|
+
CheckoutErrorType["INVALID_GAS_ESTIMATE_TYPE"] = "INVALID_GAS_ESTIMATE_TYPE";
|
|
271
283
|
})($a8bc256d81a5e2c1$export$e3dc0620abde7f5a || ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a = {}));
|
|
272
284
|
class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
|
|
285
|
+
message;
|
|
286
|
+
type;
|
|
287
|
+
data;
|
|
273
288
|
constructor(message, type, data){
|
|
274
289
|
super(message);
|
|
275
290
|
this.message = message;
|
|
@@ -277,7 +292,7 @@ class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
|
|
|
277
292
|
this.data = data;
|
|
278
293
|
}
|
|
279
294
|
}
|
|
280
|
-
|
|
295
|
+
var $a8bc256d81a5e2c1$export$a22d4e0719ee6def;
|
|
281
296
|
(function(CheckoutInternalErrorType) {
|
|
282
297
|
CheckoutInternalErrorType["REJECTED_SWITCH_AFTER_ADDING_NETWORK"] = "REJECTED_SWITCH_AFTER_ADDING_NETWORK";
|
|
283
298
|
})($a8bc256d81a5e2c1$export$a22d4e0719ee6def || ($a8bc256d81a5e2c1$export$a22d4e0719ee6def = {}));
|
|
@@ -303,78 +318,30 @@ const $a8bc256d81a5e2c1$export$bacc563de539c6c3 = async (fn, customError)=>{
|
|
|
303
318
|
|
|
304
319
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
305
320
|
|
|
306
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
307
321
|
|
|
322
|
+
var $497c134ecbc8a50f$exports = {};
|
|
323
|
+
$497c134ecbc8a50f$exports = JSON.parse('[{"chainId":1},{"chainId":11155111},{"chainId":13372},{"chainId":13383}]');
|
|
308
324
|
|
|
309
325
|
|
|
310
|
-
|
|
311
|
-
const provider = await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>await ($7v2Z6$metamaskdetectprovider)(), {
|
|
312
|
-
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR
|
|
313
|
-
});
|
|
314
|
-
if (!provider || !provider.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No MetaMask provider installed.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR);
|
|
315
|
-
return new (Web3Provider)(provider);
|
|
316
|
-
}
|
|
317
|
-
async function $c99672cf2294e839$var$getWalletProviderForPreference(providerPreference) {
|
|
318
|
-
let web3Provider = null;
|
|
319
|
-
switch(providerPreference){
|
|
320
|
-
case ($d176a05e966364ba$export$3bfad4d03ada24c4).METAMASK:
|
|
321
|
-
web3Provider = await $c99672cf2294e839$var$getMetaMaskProvider();
|
|
322
|
-
break;
|
|
323
|
-
default:
|
|
324
|
-
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Provider preference is not supported", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_PREFERENCE_ERROR);
|
|
325
|
-
}
|
|
326
|
-
return web3Provider;
|
|
327
|
-
}
|
|
328
|
-
async function $c99672cf2294e839$export$2d040992269b4717(providerPreference) {
|
|
329
|
-
const provider = await $c99672cf2294e839$var$getWalletProviderForPreference(providerPreference);
|
|
330
|
-
if (!provider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR, {
|
|
331
|
-
details: `Unsupported provider for ${providerPreference}`
|
|
332
|
-
});
|
|
333
|
-
let accounts = [];
|
|
334
|
-
try {
|
|
335
|
-
accounts = await provider.provider.request({
|
|
336
|
-
method: (0, $4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION,
|
|
337
|
-
params: []
|
|
338
|
-
});
|
|
339
|
-
} catch (err) {
|
|
340
|
-
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Check wallet connection request failed", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_FAILED_ERROR, {
|
|
341
|
-
rpcMethod: ($4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
// accounts[0] will have the active account if connected.
|
|
345
|
-
return {
|
|
346
|
-
isConnected: accounts && accounts.length > 0,
|
|
347
|
-
walletAddress: accounts[0] ?? ""
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
async function $c99672cf2294e839$export$fba2f6c3656e07c1(params) {
|
|
351
|
-
const web3Provider = await $c99672cf2294e839$var$getWalletProviderForPreference(params.providerPreference);
|
|
352
|
-
await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
|
|
353
|
-
if (!web3Provider || !web3Provider?.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR, {
|
|
354
|
-
details: `Unsupported provider for ${params.providerPreference}`
|
|
355
|
-
});
|
|
356
|
-
// this makes the request to the wallet to connect i.e request eth accounts ('eth_requestAccounts')
|
|
357
|
-
await web3Provider.provider.request({
|
|
358
|
-
method: ($4f91c5f280efe242$export$35b06f0d33f57e26).CONNECT,
|
|
359
|
-
params: []
|
|
360
|
-
});
|
|
361
|
-
}, {
|
|
362
|
-
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR
|
|
363
|
-
});
|
|
364
|
-
return web3Provider;
|
|
365
|
-
}
|
|
326
|
+
// this function needs to be in a separate file to prevent circular dependencies with ./network
|
|
366
327
|
|
|
367
328
|
|
|
368
|
-
|
|
369
|
-
$
|
|
329
|
+
async function $a1555a1d2c8d059b$export$c3ba3e93a9fee972(web3Provider) {
|
|
330
|
+
if (!web3Provider.provider.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Parsed provider is not a valid Web3Provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).WEB3_PROVIDER_ERROR);
|
|
331
|
+
const chainId = await web3Provider.provider.request({
|
|
332
|
+
method: ($4f91c5f280efe242$export$35b06f0d33f57e26).GET_CHAINID,
|
|
333
|
+
params: []
|
|
334
|
+
});
|
|
335
|
+
return parseInt(chainId, 16);
|
|
336
|
+
}
|
|
370
337
|
|
|
371
338
|
|
|
372
339
|
const $de192de6ef100f9f$var$UNRECOGNISED_CHAIN_ERROR_CODE = 4902; // error code (MetaMask)
|
|
373
340
|
// these functions should not be exported. These functions should be used as part of an exported function e.g switchWalletNetwork() above.
|
|
374
341
|
// make sure to check if(provider.provider?.request) in the exported function and throw an error
|
|
375
342
|
// eslint-disable-next-line consistent-return
|
|
376
|
-
async function $de192de6ef100f9f$var$switchNetworkInWallet(networkMap,
|
|
377
|
-
if (
|
|
343
|
+
async function $de192de6ef100f9f$var$switchNetworkInWallet(networkMap, web3Provider, chainId) {
|
|
344
|
+
if (web3Provider.provider?.request) return await web3Provider.provider.request({
|
|
378
345
|
method: ($4f91c5f280efe242$export$35b06f0d33f57e26).SWITCH_NETWORK,
|
|
379
346
|
params: [
|
|
380
347
|
{
|
|
@@ -385,8 +352,8 @@ async function $de192de6ef100f9f$var$switchNetworkInWallet(networkMap, provider,
|
|
|
385
352
|
}
|
|
386
353
|
// TODO: Should these functions always return something?
|
|
387
354
|
// eslint-disable-next-line consistent-return
|
|
388
|
-
async function $de192de6ef100f9f$var$addNetworkToWallet(networkMap,
|
|
389
|
-
if (
|
|
355
|
+
async function $de192de6ef100f9f$var$addNetworkToWallet(networkMap, web3Provider, chainId) {
|
|
356
|
+
if (web3Provider.provider?.request) {
|
|
390
357
|
const networkDetails = networkMap.get(chainId);
|
|
391
358
|
const addNetwork = {
|
|
392
359
|
chainId: networkDetails?.chainIdHex,
|
|
@@ -395,7 +362,7 @@ async function $de192de6ef100f9f$var$addNetworkToWallet(networkMap, provider, ch
|
|
|
395
362
|
nativeCurrency: networkDetails?.nativeCurrency,
|
|
396
363
|
blockExplorerUrls: networkDetails?.blockExplorerUrls
|
|
397
364
|
};
|
|
398
|
-
return await
|
|
365
|
+
return await web3Provider.provider.request({
|
|
399
366
|
method: ($4f91c5f280efe242$export$35b06f0d33f57e26).ADD_NETWORK,
|
|
400
367
|
params: [
|
|
401
368
|
addNetwork
|
|
@@ -403,63 +370,6 @@ async function $de192de6ef100f9f$var$addNetworkToWallet(networkMap, provider, ch
|
|
|
403
370
|
});
|
|
404
371
|
}
|
|
405
372
|
}
|
|
406
|
-
async function $de192de6ef100f9f$export$79f13b4cfaaf0d09(config, provider) {
|
|
407
|
-
const { networkMap: networkMap } = config;
|
|
408
|
-
return ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
|
|
409
|
-
const network = await provider.getNetwork();
|
|
410
|
-
if (!Array.from(networkMap.keys()).includes(network.chainId)) // return empty details
|
|
411
|
-
return {
|
|
412
|
-
chainId: network.chainId,
|
|
413
|
-
name: network.name,
|
|
414
|
-
isSupported: false
|
|
415
|
-
};
|
|
416
|
-
const chainIdNetworkInfo = networkMap.get(network.chainId);
|
|
417
|
-
return {
|
|
418
|
-
name: chainIdNetworkInfo.chainName,
|
|
419
|
-
chainId: parseInt(chainIdNetworkInfo.chainIdHex, 16),
|
|
420
|
-
nativeCurrency: chainIdNetworkInfo.nativeCurrency,
|
|
421
|
-
isSupported: true
|
|
422
|
-
};
|
|
423
|
-
}, {
|
|
424
|
-
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_NETWORK_INFO_ERROR
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
async function $de192de6ef100f9f$export$b827d9418aeb5dbd(config, providerPreference, provider, chainId) {
|
|
428
|
-
let currentProvider = provider;
|
|
429
|
-
const { networkMap: networkMap } = config;
|
|
430
|
-
if (!Object.values(($baec09ddc3013323$export$c06e1e7429de6283)).includes(chainId)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${chainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR);
|
|
431
|
-
if (!currentProvider || !currentProvider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR, {
|
|
432
|
-
details: "Unsupported provider"
|
|
433
|
-
});
|
|
434
|
-
// WT-1146 - Refer to the README in this folder for explantion on the switch network flow
|
|
435
|
-
try {
|
|
436
|
-
await $de192de6ef100f9f$var$switchNetworkInWallet(networkMap, currentProvider, chainId);
|
|
437
|
-
} catch (err) {
|
|
438
|
-
if (err.code === $de192de6ef100f9f$var$UNRECOGNISED_CHAIN_ERROR_CODE) try {
|
|
439
|
-
await $de192de6ef100f9f$var$addNetworkToWallet(networkMap, currentProvider, chainId);
|
|
440
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
441
|
-
} catch (err) {
|
|
442
|
-
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled add network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
|
|
443
|
-
}
|
|
444
|
-
else throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled switch network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
|
|
445
|
-
}
|
|
446
|
-
currentProvider = await ($c99672cf2294e839$export$fba2f6c3656e07c1)({
|
|
447
|
-
providerPreference: providerPreference
|
|
448
|
-
});
|
|
449
|
-
if ((await currentProvider.getNetwork()).chainId !== chainId) // user didn't actually switch
|
|
450
|
-
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled switch network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
|
|
451
|
-
// we can assume that if the above succeeds then user has successfully
|
|
452
|
-
// switched to the network specified
|
|
453
|
-
const newNetwork = networkMap.get(chainId);
|
|
454
|
-
return {
|
|
455
|
-
network: {
|
|
456
|
-
name: newNetwork?.chainName,
|
|
457
|
-
chainId: parseInt(newNetwork?.chainIdHex ?? "", 16),
|
|
458
|
-
nativeCurrency: newNetwork?.nativeCurrency
|
|
459
|
-
},
|
|
460
|
-
provider: currentProvider
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
373
|
async function $de192de6ef100f9f$export$3043f6442a9ef563(config, { type: type = ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL , exclude: exclude }) {
|
|
464
374
|
const { networkMap: networkMap } = config;
|
|
465
375
|
const list = ((/*@__PURE__*/$parcel$interopDefault($497c134ecbc8a50f$exports))).filter((network)=>{
|
|
@@ -481,13 +391,71 @@ async function $de192de6ef100f9f$export$3043f6442a9ef563(config, { type: type =
|
|
|
481
391
|
networks: allowedNetworks
|
|
482
392
|
};
|
|
483
393
|
}
|
|
394
|
+
async function $de192de6ef100f9f$export$79f13b4cfaaf0d09(config, web3Provider) {
|
|
395
|
+
const { networkMap: networkMap } = config;
|
|
396
|
+
return ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
|
|
397
|
+
try {
|
|
398
|
+
const network = await web3Provider.getNetwork();
|
|
399
|
+
if (Array.from(networkMap.keys()).includes(network.chainId)) {
|
|
400
|
+
const chainIdNetworkInfo = networkMap.get(network.chainId);
|
|
401
|
+
return {
|
|
402
|
+
name: chainIdNetworkInfo.chainName,
|
|
403
|
+
chainId: parseInt(chainIdNetworkInfo.chainIdHex, 16),
|
|
404
|
+
nativeCurrency: chainIdNetworkInfo.nativeCurrency,
|
|
405
|
+
isSupported: true
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
return {
|
|
409
|
+
chainId: network.chainId,
|
|
410
|
+
name: network.name,
|
|
411
|
+
isSupported: false
|
|
412
|
+
};
|
|
413
|
+
} catch (err) {
|
|
414
|
+
const chainId = await ($a1555a1d2c8d059b$export$c3ba3e93a9fee972)(web3Provider);
|
|
415
|
+
const isSupported = Array.from(networkMap.keys()).includes(chainId);
|
|
416
|
+
return {
|
|
417
|
+
chainId: chainId,
|
|
418
|
+
isSupported: isSupported
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
}, {
|
|
422
|
+
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_NETWORK_INFO_ERROR
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
async function $de192de6ef100f9f$export$b827d9418aeb5dbd(config, web3Provider, chainId) {
|
|
426
|
+
const { networkMap: networkMap } = config;
|
|
427
|
+
const allowedNetworks = await $de192de6ef100f9f$export$3043f6442a9ef563(config, {
|
|
428
|
+
type: ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL
|
|
429
|
+
});
|
|
430
|
+
if (!allowedNetworks.networks.some((network)=>network.chainId === chainId)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${chainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR);
|
|
431
|
+
// WT-1146 - Refer to the README in this folder for explantion on the switch network flow
|
|
432
|
+
try {
|
|
433
|
+
await $de192de6ef100f9f$var$switchNetworkInWallet(networkMap, web3Provider, chainId);
|
|
434
|
+
} catch (err) {
|
|
435
|
+
if (err.code === $de192de6ef100f9f$var$UNRECOGNISED_CHAIN_ERROR_CODE) try {
|
|
436
|
+
await $de192de6ef100f9f$var$addNetworkToWallet(networkMap, web3Provider, chainId);
|
|
437
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
438
|
+
} catch (err) {
|
|
439
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled add network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
|
|
440
|
+
}
|
|
441
|
+
else throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled switch network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
|
|
442
|
+
}
|
|
443
|
+
const newProvider = new (Web3Provider)(web3Provider.provider);
|
|
444
|
+
const newProviderNetwork = await newProvider.getNetwork();
|
|
445
|
+
if (newProviderNetwork.chainId !== chainId) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled switch network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
|
|
446
|
+
const networkInfo = await $de192de6ef100f9f$export$79f13b4cfaaf0d09(config, newProvider);
|
|
447
|
+
return {
|
|
448
|
+
network: networkInfo,
|
|
449
|
+
provider: newProvider
|
|
450
|
+
};
|
|
451
|
+
}
|
|
484
452
|
|
|
485
453
|
|
|
486
454
|
|
|
487
455
|
|
|
488
456
|
|
|
489
457
|
var $cda6003506e4182e$exports = {};
|
|
490
|
-
$cda6003506e4182e$exports = JSON.parse("[{\"chainId\":13373,\"name\":\"IMX\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13373,\"name\":\"FUN token\",\"address\":\"0xd8f1D29a1572FbCeF0B0C9541E50637Ad8804F21\",\"symbol\":\"FUN\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13373,\"name\":\"USDC\",\"address\":\"0x5893A5c7bc615Dfd36D7383366d00FFFca5f7178\",\"symbol\":\"USDC\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13373,\"name\":\"WETH\",\"address\":\"0xD6d9321DCC42377C1fa8cFec665182c463b2392C\",\"symbol\":\"WETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":1,\"name\":\"Ethereum\",\"symbol\":\"ETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF\",\"chainId\":1,\"name\":\"Immutable X\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"Sep Eth\",\"symbol\":\"ETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"Immutable Test token\",\"address\":\"0x40cAdc2BC5d25B9c669B8E09c68eCcb9B80873f7\",\"symbol\":\"TEST\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"FUN token\",\"address\":\"0x741185AEFC3E539c1F42c1d6eeE8bFf1c89D70FE\",\"symbol\":\"FUN\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"US Dollar Coin\",\"address\":\"0x1836E16b2036088490C2CFe4d11970Fc8e5884C4\",\"symbol\":\"USDC\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"DEX\",\"address\":\"0xaC953a0d7B67Fae17c87abf79f09D0f818AC66A2\",\"symbol\":\"DEX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":1442,\"name\":\"WETH\",\"address\":\"0x4F062A3EAeC3730560aB89b5CE5aC0ab2C5517aE\",\"symbol\":\"WETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0x72958b06abdF2701AcE6ceb3cE0B8B1CE11E0851\",\"chainId\":1442,\"name\":\"Immutable X\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]}]");
|
|
458
|
+
$cda6003506e4182e$exports = JSON.parse("[{\"chainId\":13383,\"name\":\"IMX\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"FUN token\",\"address\":\"0xFEa9FF93DC0C6DC73F8Be009Fe7a22Bb9dcE8A2d\",\"symbol\":\"FUN\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"USDC\",\"address\":\"0x5893A5c7bc615Dfd36D7383366d00FFFca5f7178\",\"symbol\":\"USDC\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"WETH\",\"address\":\"0xD6d9321DCC42377C1fa8cFec665182c463b2392C\",\"symbol\":\"WETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":1,\"name\":\"Ethereum\",\"symbol\":\"ETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF\",\"chainId\":1,\"name\":\"Immutable X\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"Sep Eth\",\"symbol\":\"ETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\"]},{\"chainId\":11155111,\"name\":\"Immutable Test token\",\"address\":\"0xd1da7e9b2Ce1a4024DaD52b3D37F4c5c91a525C1\",\"symbol\":\"TEST\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"FUN token\",\"address\":\"0x741185AEFC3E539c1F42c1d6eeE8bFf1c89D70FE\",\"symbol\":\"FUN\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"US Dollar Coin\",\"address\":\"0x1836E16b2036088490C2CFe4d11970Fc8e5884C4\",\"symbol\":\"USDC\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"DEX\",\"address\":\"0x8AC26EfCbf5D700b37A27aA00E6934e6904e7B8e\",\"symbol\":\"DEX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"DEX\",\"address\":\"0xaC953a0d7B67Fae17c87abf79f09D0f818AC66A2\",\"symbol\":\"DEX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":1442,\"name\":\"WETH\",\"address\":\"0x4F062A3EAeC3730560aB89b5CE5aC0ab2C5517aE\",\"symbol\":\"WETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0x72958b06abdF2701AcE6ceb3cE0B8B1CE11E0851\",\"chainId\":1442,\"name\":\"Immutable X\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]}]");
|
|
491
459
|
|
|
492
460
|
|
|
493
461
|
const $efe60cea83bfc4e8$var$filterTokenList = ({ type: type , chainId: chainId , exclude: exclude })=>((/*@__PURE__*/$parcel$interopDefault($cda6003506e4182e$exports))).filter((token)=>{
|
|
@@ -518,12 +486,12 @@ const $efe60cea83bfc4e8$export$473cec51305fdae8 = async ({ type: type = ($08d5dd
|
|
|
518
486
|
|
|
519
487
|
|
|
520
488
|
|
|
521
|
-
const $1564e43dde50bb61$export$df96cd8d56be0ab1 = async (config,
|
|
522
|
-
const networkInfo = await ($de192de6ef100f9f$export$79f13b4cfaaf0d09)(config,
|
|
489
|
+
const $1564e43dde50bb61$export$df96cd8d56be0ab1 = async (config, web3Provider, walletAddress)=>await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
|
|
490
|
+
const networkInfo = await ($de192de6ef100f9f$export$79f13b4cfaaf0d09)(config, web3Provider);
|
|
523
491
|
if (!networkInfo.isSupported) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${networkInfo.chainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR, {
|
|
524
492
|
chainName: networkInfo.name
|
|
525
493
|
});
|
|
526
|
-
const balance = await
|
|
494
|
+
const balance = await web3Provider.getBalance(walletAddress);
|
|
527
495
|
return {
|
|
528
496
|
balance: balance,
|
|
529
497
|
formattedBalance: (utils).formatUnits(balance, networkInfo.nativeCurrency.decimals),
|
|
@@ -532,9 +500,9 @@ const $1564e43dde50bb61$export$df96cd8d56be0ab1 = async (config, provider, walle
|
|
|
532
500
|
}, {
|
|
533
501
|
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_BALANCE_ERROR
|
|
534
502
|
});
|
|
535
|
-
async function $1564e43dde50bb61$export$60e0fe116a0e6ed0(
|
|
503
|
+
async function $1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, walletAddress, contractAddress) {
|
|
536
504
|
return await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
|
|
537
|
-
const contract = new (Contract)(contractAddress, JSON.stringify(($762782b6c862d954$export$db5daa1b5156ccfe)),
|
|
505
|
+
const contract = new (Contract)(contractAddress, JSON.stringify(($762782b6c862d954$export$db5daa1b5156ccfe)), web3Provider);
|
|
538
506
|
const name = await contract.name();
|
|
539
507
|
const symbol = await contract.symbol();
|
|
540
508
|
const balance = await contract.balanceOf(walletAddress);
|
|
@@ -554,16 +522,14 @@ async function $1564e43dde50bb61$export$60e0fe116a0e6ed0(provider, walletAddress
|
|
|
554
522
|
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_ERC20_BALANCE_ERROR
|
|
555
523
|
});
|
|
556
524
|
}
|
|
557
|
-
const $1564e43dde50bb61$export$fee49741664a4d7e = async (config,
|
|
558
|
-
if (!Object.values(($baec09ddc3013323$export$c06e1e7429de6283)).includes(chainId)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`ChainId ${chainId} is not supported`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR);
|
|
559
|
-
if (!provider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("provider object is missing request function", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR);
|
|
525
|
+
const $1564e43dde50bb61$export$fee49741664a4d7e = async (config, web3Provider, walletAddress, chainId)=>{
|
|
560
526
|
const tokenList = await ($efe60cea83bfc4e8$export$473cec51305fdae8)({
|
|
561
527
|
type: ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL,
|
|
562
528
|
chainId: chainId
|
|
563
529
|
});
|
|
564
530
|
const allBalancePromises = [];
|
|
565
|
-
allBalancePromises.push($1564e43dde50bb61$export$df96cd8d56be0ab1(config,
|
|
566
|
-
tokenList.tokens.filter((token)=>token.address).forEach((token)=>allBalancePromises.push($1564e43dde50bb61$export$60e0fe116a0e6ed0(
|
|
531
|
+
allBalancePromises.push($1564e43dde50bb61$export$df96cd8d56be0ab1(config, web3Provider, walletAddress));
|
|
532
|
+
tokenList.tokens.filter((token)=>token.address).forEach((token)=>allBalancePromises.push($1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, walletAddress, token.address ?? "")));
|
|
567
533
|
const balanceResults = await Promise.allSettled(allBalancePromises);
|
|
568
534
|
const getBalanceResults = balanceResults.filter((result)=>result.status === "fulfilled").map((fulfilledResult)=>fulfilledResult.value);
|
|
569
535
|
return {
|
|
@@ -575,18 +541,122 @@ const $1564e43dde50bb61$export$fee49741664a4d7e = async (config, provider, walle
|
|
|
575
541
|
|
|
576
542
|
|
|
577
543
|
|
|
544
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
545
|
+
|
|
546
|
+
async function $c99672cf2294e839$export$2d040992269b4717(web3Provider) {
|
|
547
|
+
if (!web3Provider?.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Check wallet connection request failed", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_FAILED_ERROR, {
|
|
548
|
+
rpcMethod: ($4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION
|
|
549
|
+
});
|
|
550
|
+
let accounts = [];
|
|
551
|
+
try {
|
|
552
|
+
accounts = await web3Provider.provider.request({
|
|
553
|
+
method: (0, $4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION,
|
|
554
|
+
params: []
|
|
555
|
+
});
|
|
556
|
+
} catch (err) {
|
|
557
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Check wallet connection request failed", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_FAILED_ERROR, {
|
|
558
|
+
rpcMethod: ($4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
// accounts[0] will have the active account if connected.
|
|
562
|
+
return {
|
|
563
|
+
isConnected: accounts && accounts.length > 0,
|
|
564
|
+
walletAddress: accounts[0] ?? ""
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
async function $c99672cf2294e839$export$43f7168eb392a88c(web3Provider) {
|
|
568
|
+
await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
|
|
569
|
+
if (!web3Provider || !web3Provider?.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR, {
|
|
570
|
+
details: "Attempting to connect with an incompatible provider"
|
|
571
|
+
});
|
|
572
|
+
// this makes the request to the wallet to connect i.e request eth accounts ('eth_requestAccounts')
|
|
573
|
+
await web3Provider.provider.request({
|
|
574
|
+
method: ($4f91c5f280efe242$export$35b06f0d33f57e26).CONNECT,
|
|
575
|
+
params: []
|
|
576
|
+
});
|
|
577
|
+
}, {
|
|
578
|
+
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR
|
|
579
|
+
});
|
|
580
|
+
return web3Provider;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
async function $5c763be0b0b81038$var$getMetaMaskProvider() {
|
|
591
|
+
const provider = await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>await ($7v2Z6$metamaskdetectprovider)(), {
|
|
592
|
+
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR
|
|
593
|
+
});
|
|
594
|
+
if (!provider || !provider.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No MetaMask provider installed.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR);
|
|
595
|
+
return new (Web3Provider)(provider);
|
|
596
|
+
}
|
|
597
|
+
async function $5c763be0b0b81038$export$500fbc0cd14cdbaa(defaultProvider) {
|
|
598
|
+
let web3Provider = null;
|
|
599
|
+
switch(defaultProvider){
|
|
600
|
+
case ($e768639828688ca3$export$2d7a51a18d87e21d).METAMASK:
|
|
601
|
+
web3Provider = await $5c763be0b0b81038$var$getMetaMaskProvider();
|
|
602
|
+
break;
|
|
603
|
+
default:
|
|
604
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Provider not supported", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).DEFAULT_PROVIDER_ERROR);
|
|
605
|
+
}
|
|
606
|
+
return web3Provider;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
// this function needs to be in a separate file to prevent circular dependencies with ./network
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
function $bb88265fe45a0393$export$ebe4804963e71f98(web3Provider) {
|
|
617
|
+
if (web3Provider && web3Provider instanceof (Web3Provider) && web3Provider.provider?.request) return true;
|
|
618
|
+
return false;
|
|
619
|
+
}
|
|
620
|
+
async function $bb88265fe45a0393$export$9e1fd9cc88c637a0(config, web3Provider, validateProviderOptions) {
|
|
621
|
+
return ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
|
|
622
|
+
if (!$bb88265fe45a0393$export$ebe4804963e71f98(web3Provider)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Parsed provider is not a valid Web3Provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).WEB3_PROVIDER_ERROR);
|
|
623
|
+
// this sets the default options and overrides them with any parsed options
|
|
624
|
+
const options = {
|
|
625
|
+
...($e768639828688ca3$export$44dde05038008549),
|
|
626
|
+
...validateProviderOptions
|
|
627
|
+
};
|
|
628
|
+
const underlyingChainId = await ($a1555a1d2c8d059b$export$c3ba3e93a9fee972)(web3Provider);
|
|
629
|
+
let web3ChainId = web3Provider.network?.chainId;
|
|
630
|
+
try {
|
|
631
|
+
web3ChainId = web3Provider.network?.chainId;
|
|
632
|
+
if (!web3ChainId) web3ChainId = (await web3Provider.getNetwork()).chainId;
|
|
633
|
+
} catch (err) {
|
|
634
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Unable to detect the web3Provider network", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).WEB3_PROVIDER_ERROR);
|
|
635
|
+
}
|
|
636
|
+
if (web3ChainId !== underlyingChainId && !options.allowMistmatchedChainId) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Your wallet has changed network, please switch to a supported network", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).WEB3_PROVIDER_ERROR);
|
|
637
|
+
const allowedNetworks = await ($de192de6ef100f9f$export$3043f6442a9ef563)(config, {
|
|
638
|
+
type: ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL
|
|
639
|
+
});
|
|
640
|
+
const isAllowed = allowedNetworks.networks.some((network)=>network.chainId === underlyingChainId);
|
|
641
|
+
if (!isAllowed && !options.allowUnsupportedProvider) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Your wallet is connected to an unsupported network, please switch to a supported network", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).WEB3_PROVIDER_ERROR);
|
|
642
|
+
return web3Provider;
|
|
643
|
+
}, {
|
|
644
|
+
type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).WEB3_PROVIDER_ERROR
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
|
|
578
648
|
|
|
579
649
|
|
|
580
650
|
|
|
581
651
|
|
|
582
652
|
var $6f3c55a615003cbf$exports = {};
|
|
583
|
-
$6f3c55a615003cbf$exports = JSON.parse('[{"
|
|
653
|
+
$6f3c55a615003cbf$exports = JSON.parse('[{"providerName":"metamask","icon":"some-icon-url","name":"MetaMask","description":"complete web3 wallet solution","platform":["desktop"]},{"providerName":"passport","icon":"pp-icon","name":"Passport","description":"Web3 with your email!","platform":["mobile","desktop"]},{"providerName":"gamestop","icon":"gme-icon","name":"GameStop","description":"Never stopping the game!","platform":["mobile"]}]');
|
|
584
654
|
|
|
585
655
|
|
|
586
656
|
async function $5cdde2ffe6360fec$export$a822caa90d7eef09({ type: type = ($4f91c5f280efe242$export$a75605c67ea83a5a).ALL , exclude: exclude }) {
|
|
587
657
|
// todo:For async API call, use the CheckoutError with errorType:API_CALL_ERROR?? or any other
|
|
588
658
|
const filteredWalletsList = ((/*@__PURE__*/$parcel$interopDefault($6f3c55a615003cbf$exports))).filter((wallet)=>{
|
|
589
|
-
const walletNotExcluded = !exclude?.map((excludeWallet)=>excludeWallet.
|
|
659
|
+
const walletNotExcluded = !exclude?.map((excludeWallet)=>excludeWallet.providerName).includes(wallet.providerName);
|
|
590
660
|
const allowAllWallets = type === ($4f91c5f280efe242$export$a75605c67ea83a5a).ALL;
|
|
591
661
|
const walletsAllowedForType = wallet.platform.includes(type);
|
|
592
662
|
return walletNotExcluded && (allowAllWallets || walletsAllowedForType);
|
|
@@ -605,10 +675,9 @@ async function $5cdde2ffe6360fec$export$a822caa90d7eef09({ type: type = ($4f91c5
|
|
|
605
675
|
|
|
606
676
|
|
|
607
677
|
|
|
608
|
-
const $dbe95599a4661140$export$8e0e7ffc78696d30 = async (
|
|
609
|
-
const { provider: provider , transaction: transaction } = params;
|
|
678
|
+
const $dbe95599a4661140$export$8e0e7ffc78696d30 = async (web3Provider, transaction)=>{
|
|
610
679
|
try {
|
|
611
|
-
const transactionResponse = await
|
|
680
|
+
const transactionResponse = await web3Provider.getSigner().sendTransaction(transaction);
|
|
612
681
|
return {
|
|
613
682
|
transactionResponse: transactionResponse
|
|
614
683
|
};
|
|
@@ -627,13 +696,243 @@ const $dbe95599a4661140$export$8e0e7ffc78696d30 = async (params)=>{
|
|
|
627
696
|
|
|
628
697
|
|
|
629
698
|
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
const $570856c68db0bd36$var$GAS_LIMIT = 140000;
|
|
703
|
+
async function $570856c68db0bd36$var$getTokenInfoByAddress(tokenAddress, chainId) {
|
|
704
|
+
return (await $efe60cea83bfc4e8$export$473cec51305fdae8({
|
|
705
|
+
type: ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL,
|
|
706
|
+
chainId: chainId
|
|
707
|
+
})).tokens.find((token)=>(token.address || "NATIVE") === tokenAddress);
|
|
708
|
+
}
|
|
709
|
+
const $570856c68db0bd36$var$doesChainSupportEIP1559 = (feeData)=>!!feeData.maxFeePerGas && !!feeData.maxPriorityFeePerGas;
|
|
710
|
+
const $570856c68db0bd36$var$getGasPriceInWei = (feeData)=>$570856c68db0bd36$var$doesChainSupportEIP1559(feeData) ? (BigNumber$1).from(feeData.maxFeePerGas).add((BigNumber$1).from(feeData.maxPriorityFeePerGas)) : feeData.gasPrice && (BigNumber$1).from(feeData.gasPrice);
|
|
711
|
+
const $570856c68db0bd36$var$getGasEstimates = async (provider)=>{
|
|
712
|
+
const txnGasLimitInWei = $570856c68db0bd36$var$GAS_LIMIT; // todo: fetch gasLimit from bridgeSDK when they add new fn
|
|
713
|
+
const feeData = await provider.getFeeData();
|
|
714
|
+
const gasPriceInWei = $570856c68db0bd36$var$getGasPriceInWei(feeData);
|
|
715
|
+
if (!gasPriceInWei) return undefined;
|
|
716
|
+
return gasPriceInWei.mul(txnGasLimitInWei);
|
|
717
|
+
};
|
|
718
|
+
async function $570856c68db0bd36$export$51010590edbe56a6(provider, chainId, isApproveTxnRequired, gasTokenAddress) {
|
|
719
|
+
const token = await $570856c68db0bd36$var$getTokenInfoByAddress(gasTokenAddress || "NATIVE", chainId);
|
|
720
|
+
let estimatedAmount = await $570856c68db0bd36$var$getGasEstimates(provider);
|
|
721
|
+
if (!estimatedAmount) return {
|
|
722
|
+
estimatedAmount: undefined,
|
|
723
|
+
token: token
|
|
724
|
+
};
|
|
725
|
+
if (isApproveTxnRequired) estimatedAmount = estimatedAmount.add(estimatedAmount);
|
|
726
|
+
const result = {
|
|
727
|
+
estimatedAmount: estimatedAmount,
|
|
728
|
+
token: token
|
|
729
|
+
};
|
|
730
|
+
return result;
|
|
731
|
+
}
|
|
732
|
+
async function $570856c68db0bd36$export$9e73e22953cebcfc(tokenBridge, tokenAddress, destinationChainId) {
|
|
733
|
+
const bridgeFeeReq = {
|
|
734
|
+
token: tokenAddress
|
|
735
|
+
};
|
|
736
|
+
const bridgeFeeResponse = await tokenBridge.getFee(bridgeFeeReq);
|
|
737
|
+
const tokenInfo = await $570856c68db0bd36$var$getTokenInfoByAddress(tokenAddress, destinationChainId);
|
|
738
|
+
return {
|
|
739
|
+
bridgeFee: {
|
|
740
|
+
estimatedAmount: bridgeFeeResponse.feeAmount,
|
|
741
|
+
token: tokenInfo
|
|
742
|
+
},
|
|
743
|
+
bridgeable: bridgeFeeResponse.bridgeable
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
const $be6f32539b5e2cc9$var$chainId = 13383;
|
|
753
|
+
const $be6f32539b5e2cc9$var$commonRoutingTokens = [
|
|
754
|
+
{
|
|
755
|
+
chainId: $be6f32539b5e2cc9$var$chainId,
|
|
756
|
+
address: "0xFEa9FF93DC0C6DC73F8Be009Fe7a22Bb9dcE8A2d",
|
|
757
|
+
decimals: 18,
|
|
758
|
+
symbol: "FUN",
|
|
759
|
+
name: "The Fungibles Token"
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
chainId: $be6f32539b5e2cc9$var$chainId,
|
|
763
|
+
address: "0x12739A8f1A8035F439092D016DAE19A2874F30d2",
|
|
764
|
+
decimals: 18,
|
|
765
|
+
symbol: "USDC",
|
|
766
|
+
name: "US Dollar Coin"
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
chainId: $be6f32539b5e2cc9$var$chainId,
|
|
770
|
+
address: "0x8AC26EfCbf5D700b37A27aA00E6934e6904e7B8e",
|
|
771
|
+
decimals: 18,
|
|
772
|
+
symbol: "DEX",
|
|
773
|
+
name: "Dex"
|
|
774
|
+
}
|
|
775
|
+
];
|
|
776
|
+
const $be6f32539b5e2cc9$var$contractOverrides = {
|
|
777
|
+
multicall: "0x7b19942581c9462D54155801fCA4a17edf3fD135",
|
|
778
|
+
coreFactory: "0xD17c98b38bA28c7eA1080317EB9AB2b9663BEd92",
|
|
779
|
+
quoterV2: "0x786ec643F231960D4C1A4E336990F8E7bF8f1277",
|
|
780
|
+
peripheryRouter: "0x0d44bB14Cc1dD999255aBB1576b4964D0439C63D",
|
|
781
|
+
migrator: "0x0Afe6F5f4DC34461A801420634239FFaD50A2e44",
|
|
782
|
+
nonfungiblePositionManager: "0xF674847fBcca5C80315e3AE37043Dce99F6CC529",
|
|
783
|
+
tickLens: "0x38034F18D38b74bdE496bdF60CCdBcb25B879e8d"
|
|
784
|
+
};
|
|
785
|
+
const $be6f32539b5e2cc9$export$3e9a43ac784794d5 = ()=>({
|
|
786
|
+
rpcURL: "https://zkevm-rpc.dev.x.immutable.com",
|
|
787
|
+
exchangeContracts: $be6f32539b5e2cc9$var$contractOverrides,
|
|
788
|
+
commonRoutingTokens: $be6f32539b5e2cc9$var$commonRoutingTokens,
|
|
789
|
+
nativeToken: {
|
|
790
|
+
chainId: $be6f32539b5e2cc9$var$chainId,
|
|
791
|
+
address: "",
|
|
792
|
+
decimals: 18,
|
|
793
|
+
symbol: "IMX",
|
|
794
|
+
name: "Immutable X Token"
|
|
795
|
+
}
|
|
796
|
+
});
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
async function $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, environment) {
|
|
800
|
+
const rootChainProvider = readOnlyProviders.get(fromChainId);
|
|
801
|
+
const childChainProvider = readOnlyProviders.get(toChainId);
|
|
802
|
+
if (!rootChainProvider) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${fromChainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR);
|
|
803
|
+
if (!childChainProvider) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${toChainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR);
|
|
804
|
+
const bridgeConfig = new (BridgeConfiguration)({
|
|
805
|
+
baseConfig: new (ImmutableConfiguration)({
|
|
806
|
+
environment: environment
|
|
807
|
+
}),
|
|
808
|
+
bridgeInstance: environment === (Environment).PRODUCTION ? (ETH_MAINNET_TO_ZKEVM_MAINNET) : (ETH_SEPOLIA_TO_ZKEVM_DEVNET),
|
|
809
|
+
rootProvider: rootChainProvider,
|
|
810
|
+
childProvider: childChainProvider
|
|
811
|
+
});
|
|
812
|
+
return new (TokenBridge)(bridgeConfig);
|
|
813
|
+
}
|
|
814
|
+
async function $67fc622a2b913d5f$export$7cf6178417769841(chainId, environment) {
|
|
815
|
+
const exchange = new (Exchange)(new (ExchangeConfiguration)({
|
|
816
|
+
chainId: chainId,
|
|
817
|
+
baseConfig: new (ImmutableConfiguration)({
|
|
818
|
+
environment: environment
|
|
819
|
+
}),
|
|
820
|
+
overrides: ($be6f32539b5e2cc9$export$3e9a43ac784794d5)()
|
|
821
|
+
}));
|
|
822
|
+
return exchange;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
var $d7b15ec974df6f92$exports = {};
|
|
829
|
+
$d7b15ec974df6f92$exports = JSON.parse('{"11155111":{"bridgeToL2Addresses":{"gasTokenAddress":"NATIVE","fromAddress":"0xd1da7e9b2Ce1a4024DaD52b3D37F4c5c91a525C1"},"swapAddresses":{"inAddress":"0xFEa9FF93DC0C6DC73F8Be009Fe7a22Bb9dcE8A2d","outAddress":"0x8AC26EfCbf5D700b37A27aA00E6934e6904e7B8e"}}}');
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
const $2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
833
|
+
const $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS = 18;
|
|
834
|
+
const $2e7bf45a7c9a9570$var$getL1ChainId = (environment)=>{
|
|
835
|
+
if (environment === (Environment).PRODUCTION) return ($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA;
|
|
836
|
+
return ($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA;
|
|
837
|
+
};
|
|
838
|
+
const $2e7bf45a7c9a9570$var$getL2ChainId = (environment)=>{
|
|
839
|
+
if (environment === (Environment).PRODUCTION) return ($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_TESTNET;
|
|
840
|
+
return ($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_DEVNET;
|
|
841
|
+
};
|
|
842
|
+
async function $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, environment, isSpendingCapApprovalRequired, tokenAddress) {
|
|
843
|
+
const fromChainId = $2e7bf45a7c9a9570$var$getL1ChainId(environment);
|
|
844
|
+
const toChainId = $2e7bf45a7c9a9570$var$getL2ChainId(environment);
|
|
845
|
+
const tokenAddresses = environment === (Environment).PRODUCTION ? ((/*@__PURE__*/$parcel$interopDefault($d7b15ec974df6f92$exports)))[($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA] : ((/*@__PURE__*/$parcel$interopDefault($d7b15ec974df6f92$exports)))[($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA];
|
|
846
|
+
const { gasTokenAddress: gasTokenAddress , fromAddress: fromAddress } = tokenAddresses.bridgeToL2Addresses;
|
|
847
|
+
const provider = readOnlyProviders.get(fromChainId);
|
|
848
|
+
try {
|
|
849
|
+
const { estimatedAmount: estimatedAmount , token: token } = await (0, $570856c68db0bd36$export$51010590edbe56a6)(provider, fromChainId, isSpendingCapApprovalRequired, tokenAddress ?? gasTokenAddress);
|
|
850
|
+
const tokenBridge = await $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, environment);
|
|
851
|
+
const { bridgeFee: bridgeFee , bridgeable: bridgeable } = await (0, $570856c68db0bd36$export$9e73e22953cebcfc)(tokenBridge, fromAddress, toChainId);
|
|
852
|
+
return {
|
|
853
|
+
gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).BRIDGE_TO_L2,
|
|
854
|
+
gasFee: {
|
|
855
|
+
estimatedAmount: estimatedAmount,
|
|
856
|
+
token: token
|
|
857
|
+
},
|
|
858
|
+
bridgeFee: {
|
|
859
|
+
estimatedAmount: bridgeFee?.estimatedAmount,
|
|
860
|
+
token: bridgeFee?.token
|
|
861
|
+
},
|
|
862
|
+
bridgeable: bridgeable
|
|
863
|
+
};
|
|
864
|
+
} catch {
|
|
865
|
+
// In the case of an error, just return an empty gas & bridge fee estimate
|
|
866
|
+
return {
|
|
867
|
+
gasEstimateType: ($de275b98d2b651c3$export$788b1fd17f3dad84).BRIDGE_TO_L2,
|
|
868
|
+
gasFee: {},
|
|
869
|
+
bridgeFee: {},
|
|
870
|
+
bridgeable: false
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
async function $2e7bf45a7c9a9570$var$swapGasEstimator(environment) {
|
|
875
|
+
const tokenAddresses = environment === (Environment).PRODUCTION ? ((/*@__PURE__*/$parcel$interopDefault($d7b15ec974df6f92$exports)))[($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA] : ((/*@__PURE__*/$parcel$interopDefault($d7b15ec974df6f92$exports)))[($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA];
|
|
876
|
+
const { inAddress: inAddress , outAddress: outAddress } = tokenAddresses.swapAddresses;
|
|
877
|
+
const chainId = $2e7bf45a7c9a9570$var$getL2ChainId(environment);
|
|
878
|
+
try {
|
|
879
|
+
const exchange = await $67fc622a2b913d5f$export$7cf6178417769841(chainId, environment);
|
|
880
|
+
// Create a fake transaction to get the gas from the quote
|
|
881
|
+
const { info: info } = await exchange.getUnsignedSwapTxFromAmountIn($2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS, inAddress, outAddress, (0, BigNumber).from((0, utils$1).parseUnits("1", $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS)));
|
|
882
|
+
if (info.gasFeeEstimate === null) return {
|
|
883
|
+
gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).SWAP,
|
|
884
|
+
gasFee: {}
|
|
885
|
+
};
|
|
886
|
+
let estimatedAmount;
|
|
887
|
+
if (info.gasFeeEstimate.amount) estimatedAmount = (0, BigNumber).from(info.gasFeeEstimate.amount);
|
|
888
|
+
return {
|
|
889
|
+
gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).SWAP,
|
|
890
|
+
gasFee: {
|
|
891
|
+
estimatedAmount: estimatedAmount,
|
|
892
|
+
token: {
|
|
893
|
+
address: info.gasFeeEstimate?.token.address,
|
|
894
|
+
symbol: info.gasFeeEstimate?.token.symbol ?? "",
|
|
895
|
+
name: info.gasFeeEstimate?.token.name ?? "",
|
|
896
|
+
decimals: info.gasFeeEstimate?.token.decimals ?? $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
} catch {
|
|
901
|
+
// In the case of an error, just return an empty gas fee estimate
|
|
902
|
+
return {
|
|
903
|
+
gasEstimateType: ($de275b98d2b651c3$export$788b1fd17f3dad84).SWAP,
|
|
904
|
+
gasFee: {}
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
async function $2e7bf45a7c9a9570$export$942c8de7174809fc(params, readOnlyProviders, environment) {
|
|
909
|
+
switch(params.gasEstimateType){
|
|
910
|
+
case ($de275b98d2b651c3$export$788b1fd17f3dad84).BRIDGE_TO_L2:
|
|
911
|
+
return await $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, environment, params.isSpendingCapApprovalRequired, params.tokenAddress);
|
|
912
|
+
case ($de275b98d2b651c3$export$788b1fd17f3dad84).SWAP:
|
|
913
|
+
return await $2e7bf45a7c9a9570$var$swapGasEstimator(environment);
|
|
914
|
+
default:
|
|
915
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Invalid type provided for gasEstimateType", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).INVALID_GAS_ESTIMATE_TYPE);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
|
|
630
926
|
class $4013c5c91bb535f6$export$47a4ed4a38b9eecf extends Error {
|
|
927
|
+
message;
|
|
631
928
|
constructor(message){
|
|
632
929
|
super(message);
|
|
633
930
|
this.message = message;
|
|
634
931
|
}
|
|
635
932
|
}
|
|
636
933
|
class $4013c5c91bb535f6$export$4823433c4a67bbc6 {
|
|
934
|
+
environment;
|
|
935
|
+
networkMap;
|
|
637
936
|
constructor(config){
|
|
638
937
|
// validate input
|
|
639
938
|
if (!Object.values((Environment)).includes(config.baseConfig.environment)) throw new $4013c5c91bb535f6$export$47a4ed4a38b9eecf("Invalid checkout configuration of environment");
|
|
@@ -645,9 +944,42 @@ class $4013c5c91bb535f6$export$4823433c4a67bbc6 {
|
|
|
645
944
|
|
|
646
945
|
|
|
647
946
|
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
async function $0e0060cb42e136d2$export$339cb2be73677b30(config, existingReadOnlyProviders) {
|
|
952
|
+
if (config.environment === (Environment).PRODUCTION && existingReadOnlyProviders?.has(($baec09ddc3013323$export$c06e1e7429de6283).ETHEREUM) || config.environment === (Environment).SANDBOX && existingReadOnlyProviders?.has(($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA)) return existingReadOnlyProviders;
|
|
953
|
+
const readOnlyProviders = new Map();
|
|
954
|
+
const allowedNetworks = await $de192de6ef100f9f$export$3043f6442a9ef563(config, {
|
|
955
|
+
type: ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL
|
|
956
|
+
});
|
|
957
|
+
allowedNetworks.networks.forEach((networkInfo)=>{
|
|
958
|
+
const rpcUrl = config.networkMap.get(networkInfo.chainId)?.rpcUrls[0];
|
|
959
|
+
const provider = new (ethers).providers.JsonRpcProvider(rpcUrl);
|
|
960
|
+
readOnlyProviders.set(networkInfo.chainId, provider);
|
|
961
|
+
});
|
|
962
|
+
return readOnlyProviders;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
|
|
648
966
|
class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
967
|
+
config;
|
|
968
|
+
readOnlyProviders;
|
|
649
969
|
constructor(config = ($bc2bfebf768286d3$export$6a2ba3c3bd042990)){
|
|
650
970
|
this.config = new ($4013c5c91bb535f6$export$4823433c4a67bbc6)(config);
|
|
971
|
+
this.readOnlyProviders = new Map();
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Create a provider object which can be used within the Checkout class methods.
|
|
975
|
+
* @param {CreateProviderParams} params The data required to create a provider
|
|
976
|
+
* @returns A new provider object
|
|
977
|
+
* @throws {@link ErrorType}
|
|
978
|
+
*/ async createProvider(params) {
|
|
979
|
+
const web3Provider = await $5c763be0b0b81038$export$500fbc0cd14cdbaa(params.walletProvider);
|
|
980
|
+
return {
|
|
981
|
+
provider: web3Provider
|
|
982
|
+
};
|
|
651
983
|
}
|
|
652
984
|
/**
|
|
653
985
|
* Check if a wallet is connected to the current application
|
|
@@ -655,9 +987,11 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
655
987
|
* @param {CheckConnectionParams} params - The necessary data required to verify a wallet connection status.
|
|
656
988
|
* @returns Wallet connection status details.
|
|
657
989
|
* @throws {@link ErrorType}
|
|
658
|
-
*/
|
|
659
|
-
|
|
660
|
-
|
|
990
|
+
*/ async checkIsWalletConnected(params) {
|
|
991
|
+
const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
|
|
992
|
+
allowUnsupportedProvider: true
|
|
993
|
+
});
|
|
994
|
+
return $c99672cf2294e839$export$2d040992269b4717(web3Provider);
|
|
661
995
|
}
|
|
662
996
|
/**
|
|
663
997
|
* Establish a connection with a wallet provider such as MetaMask and returns the provider object and the current network details.
|
|
@@ -665,11 +999,13 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
665
999
|
* @returns Wallet provider and current network information.
|
|
666
1000
|
* @throws {@link ErrorType}
|
|
667
1001
|
*/ async connect(params) {
|
|
668
|
-
this.
|
|
669
|
-
|
|
670
|
-
|
|
1002
|
+
const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
|
|
1003
|
+
allowUnsupportedProvider: true
|
|
1004
|
+
});
|
|
1005
|
+
await $c99672cf2294e839$export$43f7168eb392a88c(web3Provider);
|
|
1006
|
+
const networkInfo = await $de192de6ef100f9f$export$79f13b4cfaaf0d09(this.config, web3Provider);
|
|
671
1007
|
return {
|
|
672
|
-
provider:
|
|
1008
|
+
provider: web3Provider,
|
|
673
1009
|
network: networkInfo
|
|
674
1010
|
};
|
|
675
1011
|
}
|
|
@@ -679,8 +1015,12 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
679
1015
|
* @returns The new network information.
|
|
680
1016
|
* @throws {@link ErrorType}
|
|
681
1017
|
*/ async switchNetwork(params) {
|
|
682
|
-
|
|
683
|
-
|
|
1018
|
+
const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
|
|
1019
|
+
allowUnsupportedProvider: true,
|
|
1020
|
+
allowMistmatchedChainId: true
|
|
1021
|
+
});
|
|
1022
|
+
const switchNetworkRes = await $de192de6ef100f9f$export$b827d9418aeb5dbd(this.config, web3Provider, params.chainId);
|
|
1023
|
+
return switchNetworkRes;
|
|
684
1024
|
}
|
|
685
1025
|
/**
|
|
686
1026
|
* Fetch the balance of the native token of the current connected network or,
|
|
@@ -690,8 +1030,9 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
690
1030
|
* @returns Native token balance for the given wallet.
|
|
691
1031
|
* @throws {@link ErrorType}
|
|
692
1032
|
*/ async getBalance(params) {
|
|
693
|
-
|
|
694
|
-
return await $1564e43dde50bb61$export$
|
|
1033
|
+
const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
|
|
1034
|
+
if (!params.contractAddress || params.contractAddress === "") return await $1564e43dde50bb61$export$df96cd8d56be0ab1(this.config, web3Provider, params.walletAddress);
|
|
1035
|
+
return await $1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, params.walletAddress, params.contractAddress);
|
|
695
1036
|
}
|
|
696
1037
|
/**
|
|
697
1038
|
* Fetch all available balances (ERC20 & Native) of the current connected network of the given wallet.
|
|
@@ -700,7 +1041,8 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
700
1041
|
* @returns List of tokens balance for the given wallet.
|
|
701
1042
|
* @throws {@link ErrorType}
|
|
702
1043
|
*/ async getAllBalances(params) {
|
|
703
|
-
|
|
1044
|
+
const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
|
|
1045
|
+
return $1564e43dde50bb61$export$fee49741664a4d7e(this.config, web3Provider, params.walletAddress, params.chainId);
|
|
704
1046
|
}
|
|
705
1047
|
/**
|
|
706
1048
|
* Fetch the list of available networks that a wallet can add or/and switch to.
|
|
@@ -715,8 +1057,7 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
715
1057
|
* @param {GetTokenAllowListParams} params - The necessary data required to fetch the list of allowed tokens.
|
|
716
1058
|
* @returns List of allowed tokens.
|
|
717
1059
|
* @throws {@link ErrorType}
|
|
718
|
-
*/
|
|
719
|
-
async getTokenAllowList(params) {
|
|
1060
|
+
*/ async getTokenAllowList(params) {
|
|
720
1061
|
return await $efe60cea83bfc4e8$export$473cec51305fdae8(params);
|
|
721
1062
|
}
|
|
722
1063
|
/**
|
|
@@ -724,8 +1065,7 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
724
1065
|
* @param {GetWalletAllowListParams} params - The necessary data required to fetch the list of allowed wallets.
|
|
725
1066
|
* @returns List of allowed wallets.
|
|
726
1067
|
* @throws {@link ErrorType}
|
|
727
|
-
*/
|
|
728
|
-
async getWalletAllowList(params) {
|
|
1068
|
+
*/ async getWalletAllowList(params) {
|
|
729
1069
|
return await $5cdde2ffe6360fec$export$a822caa90d7eef09(params);
|
|
730
1070
|
}
|
|
731
1071
|
/**
|
|
@@ -735,9 +1075,9 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
735
1075
|
* @throws {@link ErrorType}
|
|
736
1076
|
* @remarks
|
|
737
1077
|
* Further documenation can be found at [MetaMask | Sending Transactions](https://docs.metamask.io/guide/sending-transactions.html).
|
|
738
|
-
*/
|
|
739
|
-
|
|
740
|
-
return await $dbe95599a4661140$export$8e0e7ffc78696d30(params);
|
|
1078
|
+
*/ async sendTransaction(params) {
|
|
1079
|
+
const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
|
|
1080
|
+
return await $dbe95599a4661140$export$8e0e7ffc78696d30(web3Provider, params.transaction);
|
|
741
1081
|
}
|
|
742
1082
|
/**
|
|
743
1083
|
* Get network information about the currently selected network.
|
|
@@ -745,8 +1085,23 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
745
1085
|
* @returns Network details.
|
|
746
1086
|
* @throws {@link ErrorType}
|
|
747
1087
|
*/ async getNetworkInfo(params) {
|
|
748
|
-
|
|
1088
|
+
const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
|
|
1089
|
+
allowUnsupportedProvider: true,
|
|
1090
|
+
allowMistmatchedChainId: true
|
|
1091
|
+
});
|
|
1092
|
+
return await $de192de6ef100f9f$export$79f13b4cfaaf0d09(this.config, web3Provider);
|
|
1093
|
+
}
|
|
1094
|
+
static isWeb3Provider(web3Provider) {
|
|
1095
|
+
return $bb88265fe45a0393$export$ebe4804963e71f98(web3Provider);
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Estimates the gas to perform an action.
|
|
1099
|
+
* @param {GasEstimateParams} params - The params required to calculate a gas estimate
|
|
1100
|
+
* @returns The gas estimate for the given action.
|
|
1101
|
+
*/ async gasEstimate(params) {
|
|
1102
|
+
this.readOnlyProviders = await ($0e0060cb42e136d2$export$339cb2be73677b30)(this.config, this.readOnlyProviders);
|
|
1103
|
+
return await $2e7bf45a7c9a9570$export$942c8de7174809fc(params, this.readOnlyProviders, this.config.environment);
|
|
749
1104
|
}
|
|
750
1105
|
}
|
|
751
1106
|
|
|
752
|
-
export { $baec09ddc3013323$export$c06e1e7429de6283 as ChainId, $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 as Checkout, $a8bc256d81a5e2c1$export$e3dc0620abde7f5a as CheckoutErrorType, $d176a05e966364ba$export$3bfad4d03ada24c4 as ConnectionProviders, $a47e48dd2c04791b$export$1f05a55fe0680cc7 as NetworkFilterTypes, $08d5ddc39acd6833$export$fd9b17d87f4121d2 as TokenFilterTypes, $4f91c5f280efe242$export$a75605c67ea83a5a as WalletFilterTypes };
|
|
1107
|
+
export { $baec09ddc3013323$export$c06e1e7429de6283 as ChainId, $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 as Checkout, $a8bc256d81a5e2c1$export$e3dc0620abde7f5a as CheckoutErrorType, $d176a05e966364ba$export$3bfad4d03ada24c4 as ConnectionProviders, $de275b98d2b651c3$export$788b1fd17f3dad84 as GasEstimateType, $a47e48dd2c04791b$export$1f05a55fe0680cc7 as NetworkFilterTypes, $a47e48dd2c04791b$export$345c852d0dc8f1df as RPC_URL_MAP, $08d5ddc39acd6833$export$fd9b17d87f4121d2 as TokenFilterTypes, $4f91c5f280efe242$export$a75605c67ea83a5a as WalletFilterTypes, $e768639828688ca3$export$2d7a51a18d87e21d as WalletProviderName };
|