@instadapp/avocado-base 0.0.0-dev.f392746 → 0.0.0-dev.f6bd350

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