@instadapp/avocado-base 0.0.0-dev.6ff6bcb → 0.0.0-dev.75719e7

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