@instadapp/avocado-base 0.0.0-dev.f0b0c4f → 0.0.0-dev.f307ae7

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