@instadapp/avocado-base 0.0.0-dev.02731e3 → 0.0.0-dev.066d667

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