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

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