@instadapp/avocado-base 0.0.0-dev.991c44c → 0.0.0-dev.9c7000a

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