@instadapp/avocado-base 0.0.0-dev.a80e59d → 0.0.0-dev.ab8794d

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.
Files changed (43) hide show
  1. package/.github/workflows/npm-publish-dev.yml +2 -5
  2. package/.vscode/settings.json +67 -0
  3. package/abi/avoFactoryProxy.json +1 -1
  4. package/abi/forwarder.json +1 -1
  5. package/abi/multisigAgnosticForwarder.json +937 -0
  6. package/abi/multisigForwarder.json +697 -0
  7. package/app.vue +5 -5
  8. package/assets/images/icons/check.svg +3 -0
  9. package/assets/images/icons/copy.svg +9 -2
  10. package/assets/images/icons/hammer.svg +5 -0
  11. package/assets/images/icons/info-2.svg +12 -0
  12. package/assets/images/icons/stars.svg +4 -0
  13. package/components/ActionLogo.vue +33 -29
  14. package/components/ActionMetadata.vue +45 -29
  15. package/components/Address.vue +74 -0
  16. package/components/AuthorityAvatar.vue +15 -2
  17. package/components/ChainLogo.vue +22 -224
  18. package/components/CopyClipboard.vue +16 -38
  19. package/components/metadata/Bridge.vue +22 -23
  20. package/components/metadata/CrossTransfer.vue +35 -30
  21. package/components/metadata/GasTopup.vue +14 -15
  22. package/components/metadata/Permit2.vue +12 -13
  23. package/components/metadata/Signers.vue +12 -38
  24. package/components/metadata/Swap.vue +45 -53
  25. package/components/metadata/Transfer.vue +25 -27
  26. package/contracts/MultisigAgnosticForwarder.ts +1423 -0
  27. package/contracts/MultisigForwarder.ts +859 -0
  28. package/contracts/factories/MultisigAgnosticForwarder__factory.ts +2135 -0
  29. package/contracts/factories/MultisigForwarder__factory.ts +721 -0
  30. package/contracts/factories/index.ts +2 -0
  31. package/contracts/index.ts +4 -0
  32. package/eslint.config.mjs +34 -0
  33. package/nuxt.config.ts +21 -12
  34. package/package.json +14 -14
  35. package/server/utils/index.ts +4 -4
  36. package/utils/avocado.ts +17 -17
  37. package/utils/bignumber.ts +47 -36
  38. package/utils/formatter.ts +55 -61
  39. package/utils/helper.ts +33 -41
  40. package/utils/metadata.ts +431 -310
  41. package/utils/network.ts +534 -201
  42. package/utils/services.ts +11 -13
  43. package/utils/utils.d.ts +120 -104
package/utils/network.ts CHANGED
@@ -1,291 +1,618 @@
1
- import { ethers } from "ethers";
1
+ import { ethers } from 'ethers'
2
+ import { defineChain } from 'viem'
3
+ import {
4
+ arbitrum,
5
+ aurora,
6
+ avalanche,
7
+ base,
8
+ blast,
9
+ bsc,
10
+ fantom,
11
+ fuse,
12
+ gnosis,
13
+ linea,
14
+ mainnet,
15
+ mode,
16
+ opBNB,
17
+ optimism,
18
+ polygon,
19
+ polygonZkEvm,
20
+ scroll,
21
+ } from 'viem/chains'
22
+ import {
23
+ AVO_PROD_CHAIN_ID,
24
+ AVO_PROD_CHAIN_NAME,
25
+ AVO_PROD_EXPLORER_URL,
26
+ AVO_PROD_RPC_URL,
27
+ AVO_STAGING_CHAIN_ID,
28
+ AVO_STAGING_CHAIN_NAME,
29
+ AVO_STAGING_EXPLORER_URL,
30
+ AVO_STAGING_RPC_URL,
31
+ } from './avocado'
2
32
 
3
- export const bridgeDisabledNetworks = [1101];
33
+ export const bridgeDisabledNetworks = []
34
+
35
+ export const networksSimulationNotSupported = [1313161554, 1101]
36
+
37
+ const avocado = defineChain({
38
+ id: AVO_PROD_CHAIN_ID,
39
+ name: AVO_PROD_CHAIN_NAME,
40
+ nativeCurrency: {
41
+ name: 'Avocado',
42
+ symbol: 'USDC',
43
+ decimals: 18,
44
+ },
45
+ rpcUrls: {
46
+ default: { http: [AVO_PROD_RPC_URL] },
47
+ },
48
+ blockExplorers: {
49
+ default: { name: 'Avoscan', url: AVO_PROD_EXPLORER_URL },
50
+ },
51
+ })
52
+
53
+ const avocadoStaging = defineChain({
54
+ id: AVO_STAGING_CHAIN_ID,
55
+ name: AVO_STAGING_CHAIN_NAME,
56
+ nativeCurrency: {
57
+ name: 'Avocado',
58
+ symbol: 'USDC',
59
+ decimals: 18,
60
+ },
61
+ rpcUrls: {
62
+ default: { http: [AVO_STAGING_RPC_URL] },
63
+ },
64
+ blockExplorers: {
65
+ default: { name: 'Avoscan', url: AVO_STAGING_EXPLORER_URL },
66
+ },
67
+ })
68
+
69
+ const sonic = /* #__PURE__ */ defineChain({
70
+ id: 146,
71
+ name: 'Sonic',
72
+ nativeCurrency: {
73
+ decimals: 18,
74
+ name: 'Sonic',
75
+ symbol: 'S',
76
+ },
77
+ rpcUrls: {
78
+ default: { http: ['https://rpc.soniclabs.com'] },
79
+ },
80
+ blockExplorers: {
81
+ default: {
82
+ name: 'Sonic Explorer',
83
+ url: 'https://explorer.soniclabs.com',
84
+ },
85
+ },
86
+ testnet: false,
87
+ })
4
88
 
5
89
  export const networks: Network[] = [
6
90
  {
7
- name: "Ethereum",
8
- debankName: "eth",
9
- ankrName: "eth",
10
- zerionName: "ethereum",
11
- chainId: 1,
12
- explorerUrl: "https://etherscan.io",
13
- color: "#5D5FEF",
91
+ name: 'Polygon',
92
+ debankName: 'matic',
93
+ ankrName: 'polygon',
94
+ zerionName: 'polygon',
95
+ color: '#7A4ADD',
96
+ chainId: 137,
97
+ legacySupported: true,
98
+ viemChain: polygon,
99
+ balanceResolverAddress: '0x58632D23120b20650262b8A629a14e4F4043E0D9',
100
+ usdcAddress: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
101
+ explorerUrl: 'https://polygonscan.com',
102
+ apiURL: 'https://api.polygonscan.com/api',
103
+ fakeTransactionHash:
104
+ '0x906c551abd5873a428505b6530ac14d91367820706c7ee525f6d7313265d1c92',
14
105
  get serverRpcUrl() {
15
- return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0];
106
+ return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0]
16
107
  },
17
- balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
18
- usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
19
108
  params: {
20
- rpcUrls: ["https://rpc.ankr.com/eth"],
109
+ chainName: 'Matic(Polygon) Mainnet',
21
110
  nativeCurrency: {
22
- name: "Ethereum",
23
- symbol: "ETH",
111
+ name: 'Matic',
112
+ symbol: 'MATIC',
24
113
  decimals: 18,
25
114
  },
115
+ rpcUrls: ['https://polygon-rpc.com'],
26
116
  },
27
117
  },
28
118
  {
29
- name: "Polygon",
30
- debankName: "matic",
31
- ankrName: "polygon",
32
- zerionName: "polygon",
33
- color: "#7A4ADD",
34
- chainId: 137,
35
- balanceResolverAddress: "0x58632D23120b20650262b8A629a14e4F4043E0D9",
36
- usdcAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
37
- explorerUrl: "https://polygonscan.com",
119
+ name: 'Arbitrum',
120
+ debankName: 'arb',
121
+ ankrName: 'arbitrum',
122
+ zerionName: 'arbitrum',
123
+ legacySupported: true,
124
+ viemChain: arbitrum,
125
+ color: '#2D374B',
126
+ chainId: 42161,
127
+ usdcAddress: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8',
128
+ balanceResolverAddress: '0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2',
129
+ fakeTransactionHash:
130
+ '0x9fa291c3b09d31f19b1fa5dd05f30169d1364036d5f7c14b026410bc07bd8843',
131
+ explorerUrl: 'https://arbiscan.io',
132
+ apiURL: 'https://api.arbiscan.io/api',
38
133
  get serverRpcUrl() {
39
- return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0];
134
+ return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0]
40
135
  },
41
136
  params: {
42
- chainName: "Matic(Polygon) Mainnet",
137
+ chainName: 'Arbitrum One',
43
138
  nativeCurrency: {
44
- name: "Matic",
45
- symbol: "MATIC",
139
+ name: 'Ethereum',
140
+ symbol: 'ETH',
46
141
  decimals: 18,
47
142
  },
48
- rpcUrls: ["https://polygon-rpc.com"],
143
+ rpcUrls: ['https://arb1.arbitrum.io/rpc'],
49
144
  },
50
145
  },
51
146
  {
52
- name: "Arbitrum",
53
- debankName: "arb",
54
- ankrName: "arbitrum",
55
- zerionName: "arbitrum",
56
- color: "#2D374B",
57
- chainId: 42161,
58
- usdcAddress: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
59
- balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
60
- explorerUrl: "https://arbiscan.io",
147
+ name: 'Ethereum',
148
+ debankName: 'eth',
149
+ ankrName: 'eth',
150
+ zerionName: 'ethereum',
151
+ viemChain: mainnet,
152
+ chainId: 1,
153
+ explorerUrl: 'https://etherscan.io',
154
+ legacySupported: true,
155
+ fakeTransactionHash:
156
+ '0x13232dd32cef2f641ead890a507710c96560c8c9c3d5fab6facb5ec563c49433',
157
+ apiURL: 'https://api.etherscan.io/api',
158
+ color: '#5D5FEF',
159
+ get serverRpcUrl() {
160
+ return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0]
161
+ },
162
+ balanceResolverAddress: '0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43',
163
+ usdcAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
164
+ params: {
165
+ rpcUrls: ['https://rpc.ankr.com/eth'],
166
+ nativeCurrency: {
167
+ name: 'Ethereum',
168
+ symbol: 'ETH',
169
+ decimals: 18,
170
+ },
171
+ },
172
+ },
173
+ {
174
+ name: 'Base',
175
+ chainId: 8453,
176
+ color: '#1E2024',
177
+ ankrName: 'base',
178
+ viemChain: base,
179
+ explorerUrl: 'https://basescan.org',
180
+ legacySupported: true,
181
+ fakeTransactionHash:
182
+ '0xf7833d80da33730c4fc5d4c64151f0eaa64c0c0535be022af0228a44cc4e9c8e',
183
+ apiURL: 'https://api.basescan.org/api',
61
184
  get serverRpcUrl() {
62
- return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0];
185
+ return process.env?.BASE_RPC_URL || this.params.rpcUrls[0]
63
186
  },
187
+ usdcAddress: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
188
+ balanceResolverAddress: '0x23c8EAb8a4373dD16b0947Ebe8bf76Ff7A49d13C',
64
189
  params: {
65
- chainName: "Arbitrum One",
190
+ rpcUrls: ['https://rpc.ankr.com/base'],
191
+ chainName: 'Base',
66
192
  nativeCurrency: {
67
- name: "Ethereum",
68
- symbol: "ETH",
193
+ name: 'Ethereum',
194
+ symbol: 'ETH',
69
195
  decimals: 18,
70
196
  },
71
- rpcUrls: ["https://arb1.arbitrum.io/rpc"],
72
197
  },
73
198
  },
74
199
  {
75
- name: "Optimism",
76
- debankName: "op",
77
- ankrName: "optimism",
78
- zerionName: "optimism",
79
- color: "#FF0420",
200
+ name: 'Optimism',
201
+ debankName: 'op',
202
+ ankrName: 'optimism',
203
+ zerionName: 'optimism',
204
+ color: '#FF0420',
205
+ legacySupported: true,
206
+ viemChain: optimism,
80
207
  chainId: 10,
81
- usdcAddress: "0x7f5c764cbc14f9669b88837ca1490cca17c31607",
82
- balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
83
- explorerUrl: "https://optimistic.etherscan.io",
208
+ apiURL: 'https://api-optimistic.etherscan.io/api',
209
+ usdcAddress: '0x7f5c764cbc14f9669b88837ca1490cca17c31607',
210
+ balanceResolverAddress: '0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2',
211
+ fakeTransactionHash:
212
+ '0xee7311d68059732b05088f2144dfec6c7a4f5fd0433eb85306afcd6bdf17cebc',
213
+ explorerUrl: 'https://optimistic.etherscan.io',
84
214
  get serverRpcUrl() {
85
- return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0];
215
+ return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0]
86
216
  },
87
217
  params: {
88
- chainName: "Optimistic Ethereum",
218
+ chainName: 'Optimistic Ethereum',
89
219
  nativeCurrency: {
90
- name: "Ethereum",
91
- symbol: "ETH",
220
+ name: 'Ethereum',
221
+ symbol: 'ETH',
92
222
  decimals: 18,
93
223
  },
94
- rpcUrls: ["https://rpc.ankr.com/optimism"],
224
+ rpcUrls: ['https://rpc.ankr.com/optimism'],
95
225
  },
96
226
  },
97
227
  {
98
- name: "Avalanche",
99
- debankName: "avax",
100
- ankrName: "avalanche",
101
- zerionName: "avalanche",
102
- color: "#EB5757",
103
- chainId: 43114,
104
- usdcAddress: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
105
- balanceResolverAddress: "0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E",
106
- explorerUrl: "https://snowtrace.io",
228
+ name: 'Polygon zkEVM',
229
+ chainId: 1101,
230
+ color: '#8544f6',
231
+ ankrName: 'polygon_zkevm',
232
+ viemChain: polygonZkEvm,
233
+ legacySupported: true,
234
+ explorerUrl: 'https://zkevm.polygonscan.com',
235
+ apiURL: 'https://api-zkevm.polygonscan.com/api',
236
+ balanceResolverAddress: '0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01',
237
+ fakeTransactionHash:
238
+ '0x1077130463ade91ad4e9c43c3195298e26a99970975238128912490eea12bf41',
239
+ usdcAddress: '0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035',
107
240
  get serverRpcUrl() {
108
- return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0];
241
+ return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0]
109
242
  },
110
243
  params: {
111
- chainName: "Avalanche Network",
244
+ chainName: 'polygon zkEVM',
245
+ rpcUrls: ['https://zkevm-rpc.com'],
112
246
  nativeCurrency: {
113
- name: "Avalanche",
114
- symbol: "AVAX",
247
+ name: 'Ethereum',
248
+ symbol: 'ETH',
115
249
  decimals: 18,
116
250
  },
117
- rpcUrls: ["https://rpc.ankr.com/avalanche"],
118
251
  },
119
252
  },
120
253
  {
121
- name: "BSC",
122
- debankName: "bsc",
123
- ankrName: "bsc",
124
- zerionName: "binance-smart-chain",
125
- color: "#F3BA2F",
254
+ name: 'BSC',
255
+ debankName: 'bsc',
256
+ ankrName: 'bsc',
257
+ zerionName: 'binance-smart-chain',
258
+ color: '#F3BA2F',
126
259
  chainId: 56,
127
- explorerUrl: "https://bscscan.com",
128
- usdcAddress: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
129
- balanceResolverAddress: "0xb808cff38706e267067b0af427726aa099f69f89",
260
+ legacySupported: true,
261
+ explorerUrl: 'https://bscscan.com',
262
+ viemChain: bsc,
263
+ fakeTransactionHash:
264
+ '0x897d54bf8e492f840bd4d8f1e743bfcab8226ab4d5a899e47ee433dcd6d6abf7',
265
+ apiURL: 'https://api.bscscan.com/api',
266
+ usdcAddress: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d',
267
+ balanceResolverAddress: '0xb808cff38706e267067b0af427726aa099f69f89',
130
268
  get serverRpcUrl() {
131
- return process.env?.BSC_RPC_URL || this.params.rpcUrls[0];
269
+ return process.env?.BSC_RPC_URL || this.params.rpcUrls[0]
132
270
  },
133
271
  params: {
134
- chainName: "Binance Smart Chain",
135
- rpcUrls: ["https://rpc.ankr.com/bsc"],
272
+ chainName: 'Binance Smart Chain',
273
+ rpcUrls: ['https://rpc.ankr.com/bsc'],
136
274
  nativeCurrency: {
137
- name: "Binance Coin",
138
- symbol: "BNB",
275
+ name: 'Binance Coin',
276
+ symbol: 'BNB',
139
277
  decimals: 18,
140
278
  },
141
279
  },
142
280
  },
143
281
  {
144
- name: "Gnosis",
145
- debankName: "xdai",
146
- zerionName: "xdai",
147
- color: "#04795C",
148
- chainId: 100,
149
- balanceResolverAddress: "0xfaa244e276b1597f663975ed007ee4ff70d27849",
150
- explorerUrl: "https://gnosisscan.io",
151
- usdcAddress: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
282
+ name: 'Avalanche',
283
+ debankName: 'avax',
284
+ ankrName: 'avalanche',
285
+ zerionName: 'avalanche',
286
+ color: '#EB5757',
287
+ viemChain: avalanche,
288
+ legacySupported: true,
289
+ chainId: 43114,
290
+ usdcAddress: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
291
+ balanceResolverAddress: '0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E',
292
+ explorerUrl: 'https://snowtrace.io',
293
+ fakeTransactionHash:
294
+ '0x233aac7402558dd4e23f938a50f983e67f5c9604233981c7ac74e63737b8294e',
295
+ apiURL: 'https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan/api',
152
296
  get serverRpcUrl() {
153
- return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0];
297
+ return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0]
154
298
  },
155
299
  params: {
156
- chainName: "Gnosis Safe",
157
- rpcUrls: ["https://rpc.ankr.com/gnosis"],
300
+ chainName: 'Avalanche Network',
158
301
  nativeCurrency: {
159
- name: "xdaistable",
160
- symbol: "xDAI",
302
+ name: 'Avalanche',
303
+ symbol: 'AVAX',
161
304
  decimals: 18,
162
305
  },
306
+ rpcUrls: ['https://rpc.ankr.com/avalanche'],
163
307
  },
164
308
  },
165
309
  {
166
- name: "Polygon zkEVM",
167
- chainId: 1101,
168
- color: "#8544f6",
169
- explorerUrl: "https://zkevm.polygonscan.com",
170
- balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
171
- usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
310
+ name: 'Fantom',
311
+ chainId: 250,
312
+ zerionName: 'fantom',
313
+ explorerUrl: 'https://ftmscan.com',
314
+ apiURL: 'https://api.ftmscan.com/api',
315
+ ankrName: 'fantom',
316
+ color: '#1969ff',
317
+ legacySupported: true,
318
+ viemChain: fantom,
172
319
  get serverRpcUrl() {
173
- return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
320
+ return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0]
174
321
  },
322
+ usdcAddress: '0x04068da6c83afcfa0e13ba15a6696662335d5b75',
323
+ balanceResolverAddress: '0x929376c77a2fb8152375a089a4fccf84ff481479',
324
+ fakeTransactionHash:
325
+ '0x1e9a8405d660172314124e06896212c0786d7fb1550b89410d4bc87e9e8054e4',
175
326
  params: {
176
- chainName: "polygon zkEVM",
177
- rpcUrls: ["https://zkevm-rpc.com"],
327
+ rpcUrls: ['https://rpc.ankr.com/fantom'],
328
+ chainName: 'Fantom',
178
329
  nativeCurrency: {
179
- name: "Ethereum",
180
- symbol: "ETH",
330
+ name: 'Fantom',
331
+ symbol: 'FTM',
181
332
  decimals: 18,
182
333
  },
183
334
  },
184
335
  },
185
336
  {
186
- name: "Aurora",
337
+ name: 'Gnosis',
338
+ debankName: 'xdai',
339
+ zerionName: 'xdai',
340
+ color: '#04795C',
341
+ ankrName: 'gnosis',
342
+ viemChain: gnosis,
343
+ legacySupported: true,
344
+ chainId: 100,
345
+ balanceResolverAddress: '0xfaa244e276b1597f663975ed007ee4ff70d27849',
346
+ explorerUrl: 'https://gnosisscan.io',
347
+ fakeTransactionHash:
348
+ '0x1513033806310a2c3b29f2276f8aa7388461b0ef9f8499c297e68c12187c179b',
349
+ apiURL: 'https://api.gnosisscan.io/api',
350
+ usdcAddress: '0xddafbb505ad214d7b80b1f830fccc89b60fb7a83',
351
+ get serverRpcUrl() {
352
+ return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0]
353
+ },
354
+ params: {
355
+ chainName: 'Gnosis Safe',
356
+ rpcUrls: ['https://rpc.ankr.com/gnosis'],
357
+ nativeCurrency: {
358
+ name: 'xdaistable',
359
+ symbol: 'xDAI',
360
+ decimals: 18,
361
+ },
362
+ },
363
+ },
364
+ {
365
+ name: 'Aurora',
187
366
  chainId: 1313161554,
188
- zerionName: "aurora",
189
- color: "#78d64b",
190
- explorerUrl: "https://explorer.mainnet.aurora.dev",
367
+ zerionName: 'aurora',
368
+ color: '#78d64b',
369
+ viemChain: aurora,
370
+ legacySupported: true,
371
+ explorerUrl: 'https://explorer.mainnet.aurora.dev',
372
+ apiURL: 'https://explorer.mainnet.aurora.dev/api/v2',
373
+ fakeTransactionHash:
374
+ '0x0923401c5a80c39a5cd57c098a6c4729edbefd0db6894def7d349493f4ff3ec6',
191
375
  get serverRpcUrl() {
192
- return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0];
376
+ return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0]
193
377
  },
194
- usdcAddress: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
195
- balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
378
+ usdcAddress: '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802',
379
+ balanceResolverAddress: '0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474',
196
380
  params: {
197
- rpcUrls: ["https://mainnet.aurora.dev"],
198
- chainName: "Aurora",
381
+ rpcUrls: ['https://mainnet.aurora.dev'],
382
+ chainName: 'Aurora',
199
383
  nativeCurrency: {
200
384
  decimals: 18,
201
- name: "Aurora ETH",
202
- symbol: "AETH",
385
+ name: 'Aurora ETH',
386
+ symbol: 'AETH',
203
387
  },
204
388
  },
205
389
  },
206
390
  {
207
- name: "Fantom",
208
- chainId: 250,
209
- zerionName: "fantom",
210
- explorerUrl: "https://ftmscan.com",
211
- ankrName: "fantom",
212
- color: "#1969ff",
391
+ name: 'Fuse',
392
+ chainId: 122,
393
+ zerionName: 'fuse',
394
+ color: '#78d64b',
395
+ explorerUrl: 'https://explorer.fuse.io',
396
+ apiURL: 'https://explorer.fuse.io/api/v2',
397
+ viemChain: fuse,
398
+ legacySupported: false,
399
+ fakeTransactionHash:
400
+ '0xf22a8031de9b978a57c728e18c6b54633356c39db4d0466e53b9b7c3ee7f8def',
213
401
  get serverRpcUrl() {
214
- return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0];
402
+ return process.env?.FUSE_RPC_URL || this.params.rpcUrls[0]
215
403
  },
216
- usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
217
- balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
404
+ usdcAddress: '',
405
+ balanceResolverAddress: '0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474',
218
406
  params: {
219
- rpcUrls: ["https://rpc.ankr.com/fantom"],
220
- chainName: "Fantom",
407
+ rpcUrls: ['https://fuse-mainnet.chainstacklabs.com'],
408
+ chainName: 'Fuse',
221
409
  nativeCurrency: {
222
- name: "Fantom",
223
- symbol: "FTM",
224
410
  decimals: 18,
411
+ name: 'Fuse',
412
+ symbol: 'fuse',
225
413
  },
226
414
  },
227
415
  },
228
- {
229
- name: 'Base',
230
- chainId: 8453,
231
- color: '#1E2024',
232
- explorerUrl: 'https://basescan.org',
416
+ {
417
+ name: 'Scroll',
418
+ chainId: 534352,
419
+ color: '#78d64b',
420
+ ankrName: 'scroll',
421
+ legacySupported: false,
422
+ explorerUrl: 'https://scrollscan.com',
423
+ apiURL: 'https://api.scrollscan.com/api',
424
+ viemChain: scroll,
425
+ fakeTransactionHash:
426
+ '0x6bf297c414264fc8cddd47224632b4426a02138df2f50fe891eca87f6aefea01',
233
427
  get serverRpcUrl() {
234
- return process.env?.BASE_RPC_URL || this.params.rpcUrls[0];
235
- },
236
- usdcAddress: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
237
- balanceResolverAddress: '0x23c8EAb8a4373dD16b0947Ebe8bf76Ff7A49d13C',
238
- params: {
239
- rpcUrls: ['https://rpc.ankr.com/base'],
240
- chainName: "Base",
428
+ return process.env?.SCROLL_RPC_URL || this.params.rpcUrls[0]
429
+ },
430
+ params: {
431
+ rpcUrls: ['https://rpc.scroll.io'],
432
+ chainName: 'Scroll',
241
433
  nativeCurrency: {
242
- name: "Ethereum",
243
- symbol: "ETH",
434
+ name: 'Ethereum',
435
+ symbol: 'ETH',
244
436
  decimals: 18,
245
437
  },
246
- }
438
+ },
247
439
  },
440
+ {
441
+ name: 'opBNB',
442
+ chainId: 204,
443
+ color: '#78d64b',
444
+ explorerUrl: 'https://opbnbscan.com',
445
+ apiURL: null,
446
+ viemChain: opBNB,
447
+ legacySupported: false,
448
+ fakeTransactionHash:
449
+ '0xb9438a3eae61442bc7d419d79930370ce09ac0f46e0695025751e3bfe1a931e7',
450
+ get serverRpcUrl() {
451
+ return process.env?.OPBNB_RPC_URL || this.params.rpcUrls[0]
452
+ },
453
+ params: {
454
+ rpcUrls: ['https://opbnb-mainnet-rpc.bnbchain.org'],
455
+ chainName: 'opBNB',
456
+ nativeCurrency: {
457
+ name: 'BNB',
458
+ symbol: 'BNB',
459
+ decimals: 18,
460
+ },
461
+ },
462
+ },
463
+ {
464
+ chainId: 34443,
465
+ name: 'Mode',
466
+ color: '#d7ff00',
467
+ explorerUrl: 'https://explorer.mode.network',
468
+ legacySupported: false,
469
+ fakeTransactionHash: '0xb58002db3481f2c51855a91280ec940d0bebec075c4b362b9f90c21a2b14edbe',
470
+ apiURL: 'https://explorer.mode.network/api/v2',
471
+ params: {
472
+ rpcUrls: ['https://1rpc.io/mode'],
473
+ chainName: 'Mode',
474
+ nativeCurrency: {
475
+ name: 'Ethereum',
476
+ symbol: 'ETH',
477
+ decimals: 18,
478
+ },
479
+ },
480
+ get serverRpcUrl() {
481
+ return process.env?.MODE_RPC_URL || this.params.rpcUrls[0]
482
+ },
483
+ viemChain: mode,
484
+ },
485
+ {
486
+ chainId: 81457,
487
+ name: 'Blast',
488
+ color: '#78d64b',
489
+ explorerUrl: 'https://blastscan.io',
490
+ apiURL: 'https://api.blastscan.io/api',
491
+ legacySupported: false,
492
+ fakeTransactionHash: '0x934ed8516242f8c08bb9e0e90bb1f989d92ceb6b0333e86ac2d555f25ac27e58',
493
+ params: {
494
+ rpcUrls: ['https://rpc.ankr.com/blast'],
495
+ chainName: 'Blast',
496
+ nativeCurrency: {
497
+ name: 'Ethereum',
498
+ symbol: 'ETH',
499
+ decimals: 18,
500
+ },
501
+ },
502
+ get serverRpcUrl() {
503
+ return process.env?.BLAST_RPC_URL || this.params.rpcUrls[0]
504
+ },
505
+ viemChain: blast,
506
+ },
507
+ {
508
+ chainId: 59144,
509
+ name: 'Linea',
510
+ apiURL: 'https://api.lineascan.build/api',
511
+ color: '#78d64b',
512
+ explorerUrl: 'https://lineascan.build',
513
+ legacySupported: false,
514
+ params: {
515
+ rpcUrls: ['https://linea-mainnet.public.blastapi.io'],
516
+ chainName: 'Linea',
517
+ nativeCurrency: {
518
+ name: 'Linea Ether',
519
+ symbol: 'ETH',
520
+ decimals: 18,
521
+ },
522
+ },
523
+ fakeTransactionHash: '0x62d068a66eb1515a09e993200e8a495c7fead512689ba78e50523c8e83bbf5b5',
524
+ get serverRpcUrl() {
525
+ return process.env?.LINEA_RPC_URL || this.params.rpcUrls[0]
526
+ },
527
+ viemChain: linea,
528
+ ankrName: 'linea',
529
+ },
530
+ {
531
+ name: sonic.name,
532
+ chainId: sonic.id,
533
+ explorerUrl: sonic.blockExplorers.default.url,
534
+ legacySupported: false,
535
+ viemChain: sonic,
536
+ color: '#78d64b',
537
+ apiURL: null,
538
+ fakeTransactionHash: '0xc8fe01a980987295c36e898b4681fa8c937eb8dfd48a3ae080956b36a66195ee',
539
+ get serverRpcUrl() {
540
+ return process.env?.SONIC_RPC_URL || this.params.rpcUrls[0]
541
+ },
542
+ params: {
543
+ rpcUrls: sonic.rpcUrls.default.http as any,
544
+ chainName: sonic.name,
545
+ nativeCurrency: sonic.nativeCurrency,
546
+ },
547
+ },
548
+ // {
549
+ // name: "Manta Pacific",
550
+ // chainId: 169,
551
+ // explorerUrl: "https://pacific-explorer.manta.network",
552
+ // params: {
553
+ // rpcUrls: ["https://pacific-rpc.manta.network/http"],
554
+ // chainName: "Manta Pacific",
555
+ // nativeCurrency: {
556
+ // name: "Ethereum",
557
+ // symbol: "ETH",
558
+ // decimals: 18,
559
+ // },
560
+ // },
561
+ // color: "#78d64b",
562
+ // fakeTransactionHash: "0x3fB128aA5AC254C8539996B11C587E521AE0d3ab",
563
+ // get serverRpcUrl() {
564
+ // return process.env?.MANTA_RPC_URL || this.params.rpcUrls[0];
565
+ // },
566
+ // },
248
567
  {
249
568
  name: AVO_PROD_CHAIN_NAME,
250
569
  chainId: AVO_PROD_CHAIN_ID,
570
+ apiURL: null,
251
571
  isAvocado: true,
252
- balanceResolverAddress: "",
253
- color: "#16A34A",
254
- usdcAddress: "",
572
+ balanceResolverAddress: '',
573
+ fakeTransactionHash: '',
574
+ legacySupported: false,
575
+ viemChain: avocado,
576
+ color: '#16A34A',
577
+ usdcAddress: '',
255
578
  serverRpcUrl: AVO_PROD_RPC_URL,
256
579
  explorerUrl: AVO_PROD_EXPLORER_URL,
257
580
  params: {
258
581
  chainName: AVO_PROD_CHAIN_NAME,
259
582
  nativeCurrency: {
260
- name: "Avocado",
261
- symbol: "USDC",
583
+ name: 'Avocado',
584
+ symbol: 'USDC',
262
585
  decimals: 18,
263
586
  },
264
- iconUrls: ["https://avocado.instadapp.io/logo.svg"],
587
+ iconUrls: ['https://avocado.instadapp.io/logo.svg'],
265
588
  rpcUrls: [AVO_PROD_RPC_URL],
266
589
  },
267
590
  },
268
591
  {
269
592
  name: AVO_STAGING_CHAIN_NAME,
593
+ apiURL: null,
270
594
  chainId: AVO_STAGING_CHAIN_ID,
271
595
  serverRpcUrl: AVO_STAGING_RPC_URL,
272
- color: "#16A34A",
596
+ color: '#16A34A',
273
597
  explorerUrl: AVO_STAGING_EXPLORER_URL,
598
+ legacySupported: false,
599
+ viemChain: avocadoStaging,
600
+ fakeTransactionHash: '',
274
601
  isAvocado: true,
275
- balanceResolverAddress: "",
276
- usdcAddress: "",
602
+ balanceResolverAddress: '',
603
+ usdcAddress: '',
277
604
  params: {
278
605
  chainName: AVO_STAGING_CHAIN_NAME,
279
606
  nativeCurrency: {
280
- name: "Avocado",
281
- symbol: "USDC",
607
+ name: 'Avocado',
608
+ symbol: 'USDC',
282
609
  decimals: 18,
283
610
  },
284
- iconUrls: ["https://avocado.instadapp.io/logo.svg"],
611
+ iconUrls: ['https://avocado.instadapp.io/logo.svg'],
285
612
  rpcUrls: [AVO_STAGING_RPC_URL],
286
613
  },
287
614
  },
288
- ];
615
+ ]
289
616
 
290
617
  export const chainUsdcAddresses = [
291
618
  { chainId: 1, address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' },
@@ -293,74 +620,80 @@ export const chainUsdcAddresses = [
293
620
  { chainId: 56, address: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d' },
294
621
  { chainId: 100, address: '0xddafbb505ad214d7b80b1f830fccc89b60fb7a83' },
295
622
  { chainId: 137, address: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174' },
623
+ { chainId: 137, address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359' },
296
624
  { chainId: 250, address: '0x04068da6c83afcfa0e13ba15a6696662335d5b75' },
297
625
  { chainId: 42161, address: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' },
298
626
  { chainId: 42161, address: '0xaf88d065e77c8cc2239327c5edb3a432268e5831' },
299
627
  { chainId: 43114, address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e' },
300
628
  { chainId: 43114, address: '0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664' },
301
629
  { chainId: 1101, address: '0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035' },
302
- { chainId: 1313161554, address: '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802' },
303
- { chainId: 8453, address: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA'}
304
- ];
630
+ {
631
+ chainId: 1313161554,
632
+ address: '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802',
633
+ },
634
+ { chainId: 8453, address: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA' },
635
+ ]
305
636
 
306
- export const getNetworkByChainId = (
307
- chainId: ChainId | number | string
308
- ): Network => {
309
- return networks.find((i) => i.chainId == chainId)!;
310
- };
637
+ export function getNetworkByChainId(chainId: ChainId | number | string): Network {
638
+ return networks.find(i => i.chainId == chainId)!
639
+ }
311
640
 
312
641
  export const availableNetworks = networks.filter(
313
- (network) => !network.isAvocado
314
- );
642
+ network => !network.isAvocado,
643
+ )
315
644
 
316
- export const chainIdToName = (chainId: ChainId | number | string) => {
317
- const network = getNetworkByChainId(chainId);
318
- return network.name;
319
- };
645
+ export function chainIdToName(chainId: ChainId | number | string) {
646
+ const network = getNetworkByChainId(chainId)
647
+ return network?.name
648
+ }
320
649
 
321
- export const getRpcURLByChainId = (chainId: ChainId | number | string) => {
322
- const network = getNetworkByChainId(chainId);
323
- return network.params.rpcUrls[0];
324
- };
650
+ export function getRpcURLByChainId(chainId: ChainId | number | string) {
651
+ try {
652
+ const network = getNetworkByChainId(chainId)
653
+ return network.params.rpcUrls[0]
654
+ }
655
+ catch {
656
+ return ''
657
+ }
658
+ }
325
659
 
326
660
  export const RPCMap = networks.reduce((acc, network) => {
327
- acc[network.chainId] = network.params.rpcUrls[0];
328
- return acc;
329
- }, {} as Record<number, string>);
661
+ acc[network.chainId] = network.params.rpcUrls[0]
662
+ return acc
663
+ }, {} as Record<number, string>)
330
664
 
331
- export const networkIds = networks.map((network) => network.chainId);
665
+ export const networkIds = networks.map(network => network.chainId)
332
666
 
333
- const rpcInstances: Record<string, ethers.providers.StaticJsonRpcProvider> = {};
667
+ const rpcInstances: Record<string, ethers.providers.StaticJsonRpcProvider> = {}
334
668
  const serverRpcInstances: Record<
335
669
  string,
336
670
  ethers.providers.StaticJsonRpcProvider
337
- > = {};
671
+ > = {}
338
672
 
339
- export const getServerRpcProvider = (chainId: number | string) => {
673
+ export function getServerRpcProvider(chainId: number | string) {
340
674
  if (!rpcInstances[chainId]) {
341
- const network = networks.find((n) => n.chainId == chainId);
675
+ const network = networks.find(n => n.chainId == chainId)
342
676
  serverRpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
343
- network?.serverRpcUrl
344
- );
677
+ network?.serverRpcUrl,
678
+ )
345
679
  }
346
680
 
347
- return serverRpcInstances[chainId];
348
- };
681
+ return serverRpcInstances[chainId]
682
+ }
349
683
 
350
- export const getRpcProvider = (chainId: number | string) => {
684
+ export function getRpcProvider(chainId: number | string) {
351
685
  if (!rpcInstances[chainId]) {
352
686
  rpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
353
- getRpcURLByChainId(Number(chainId))
354
- );
687
+ getRpcURLByChainId(Number(chainId)),
688
+ )
355
689
  }
356
690
 
357
- return rpcInstances[chainId];
358
- };
691
+ return rpcInstances[chainId]
692
+ }
359
693
 
360
- export const getExplorerUrl = (
361
- chainId: ChainId | number | string,
362
- suffix: `/${string}` = "/"
363
- ) => {
364
- const network = getNetworkByChainId(chainId);
365
- return `${network.explorerUrl}${suffix}`;
366
- };
694
+ export function getExplorerUrl(chainId: ChainId | number | string, suffix: `/${string}` = '/') {
695
+ const network = getNetworkByChainId(chainId)
696
+ if (!network)
697
+ return ''
698
+ return `${network.explorerUrl}${suffix}`
699
+ }