@instadapp/avocado-base 0.0.0-dev.39c2fcc → 0.0.0-dev.3aec0c2

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 (89) hide show
  1. package/.github/workflows/npm-publish-dev.yml +2 -5
  2. package/abi/forwarder.json +8 -8
  3. package/abi/multisigAgnosticForwarder.json +1 -0
  4. package/abi/multisigForwarder.json +697 -0
  5. package/app.vue +7 -0
  6. package/assets/images/icons/arrow-left.svg +5 -0
  7. package/assets/images/icons/arrow-right.svg +5 -0
  8. package/assets/images/icons/avocado.svg +4 -0
  9. package/assets/images/icons/bridge-2.svg +3 -0
  10. package/assets/images/icons/bridge.svg +7 -0
  11. package/assets/images/icons/calendar.svg +8 -0
  12. package/assets/images/icons/change-threshold.svg +4 -0
  13. package/assets/images/icons/check-circle.svg +4 -0
  14. package/assets/images/icons/chevron-down.svg +4 -0
  15. package/assets/images/icons/clipboard.svg +7 -0
  16. package/assets/images/icons/clock-circle.svg +5 -0
  17. package/assets/images/icons/copy.svg +5 -0
  18. package/assets/images/icons/cross-transfer.svg +7 -0
  19. package/assets/images/icons/dapp.svg +4 -0
  20. package/assets/images/icons/deploy.svg +12 -0
  21. package/assets/images/icons/error-circle.svg +6 -0
  22. package/assets/images/icons/exclamation-circle.svg +13 -0
  23. package/assets/images/icons/exclamation-octagon.svg +13 -0
  24. package/assets/images/icons/exclamation-triangle.svg +5 -0
  25. package/assets/images/icons/external-link.svg +6 -0
  26. package/assets/images/icons/eye.svg +4 -0
  27. package/assets/images/icons/flowers.svg +8 -0
  28. package/assets/images/icons/gas-emoji.svg +193 -0
  29. package/assets/images/icons/gas.svg +14 -0
  30. package/assets/images/icons/gift.svg +153 -0
  31. package/assets/images/icons/globe.svg +110 -0
  32. package/assets/images/icons/hamburger.svg +6 -0
  33. package/assets/images/icons/hammer.svg +5 -0
  34. package/assets/images/icons/info-2.svg +12 -0
  35. package/assets/images/icons/instadapp-pro.svg +4 -0
  36. package/assets/images/icons/logout.svg +3 -0
  37. package/assets/images/icons/moon.svg +3 -0
  38. package/assets/images/icons/multi-send.svg +7 -0
  39. package/assets/images/icons/network.svg +13 -0
  40. package/assets/images/icons/options.svg +5 -0
  41. package/assets/images/icons/permit-sign.svg +11 -0
  42. package/assets/images/icons/plus-circle.svg +6 -0
  43. package/assets/images/icons/plus.svg +5 -0
  44. package/assets/images/icons/power-off-bg.svg +24 -0
  45. package/assets/images/icons/power-off.svg +19 -0
  46. package/assets/images/icons/power-on.svg +19 -0
  47. package/assets/images/icons/qr.svg +20 -0
  48. package/assets/images/icons/question-circle.svg +14 -0
  49. package/assets/images/icons/refresh.svg +6 -0
  50. package/assets/images/icons/reject-proposal.svg +6 -0
  51. package/assets/images/icons/search.svg +12 -0
  52. package/assets/images/icons/stars.svg +4 -0
  53. package/assets/images/icons/sun.svg +3 -0
  54. package/assets/images/icons/transfer.svg +5 -0
  55. package/assets/images/icons/trash-2.svg +8 -0
  56. package/assets/images/icons/upgrade.svg +4 -0
  57. package/assets/images/icons/wave.svg +214 -0
  58. package/assets/images/icons/x.svg +5 -0
  59. package/components/ActionLogo.vue +42 -0
  60. package/components/ActionMetadata.vue +82 -0
  61. package/components/AuthorityAvatar.vue +37 -0
  62. package/components/ChainLogo.vue +14 -563
  63. package/components/CopyClipboard.vue +58 -0
  64. package/components/metadata/Bridge.vue +59 -0
  65. package/components/metadata/CrossTransfer.vue +79 -0
  66. package/components/metadata/GasTopup.vue +39 -0
  67. package/components/metadata/Permit2.vue +42 -0
  68. package/components/metadata/Signers.vue +66 -0
  69. package/components/metadata/Swap.vue +67 -0
  70. package/components/metadata/Transfer.vue +50 -0
  71. package/components.d.ts +13 -0
  72. package/contracts/Forwarder.ts +4 -4
  73. package/contracts/MultisigAgnosticForwarder.ts +1413 -0
  74. package/contracts/MultisigForwarder.ts +859 -0
  75. package/contracts/factories/Forwarder__factory.ts +8 -8
  76. package/contracts/factories/MultisigAgnosticForwarder__factory.ts +2051 -0
  77. package/contracts/factories/MultisigForwarder__factory.ts +721 -0
  78. package/contracts/factories/index.ts +2 -0
  79. package/contracts/index.ts +4 -0
  80. package/nuxt.config.ts +17 -1
  81. package/package.json +16 -8
  82. package/utils/avocado.ts +2 -0
  83. package/utils/bignumber.ts +20 -0
  84. package/utils/formatter.ts +2 -2
  85. package/utils/helper.ts +8 -0
  86. package/utils/metadata.ts +456 -180
  87. package/utils/network.ts +365 -74
  88. package/utils/services.ts +21 -0
  89. package/utils/utils.d.ts +142 -114
package/utils/network.ts CHANGED
@@ -1,30 +1,71 @@
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: "Ethereum",
8
- debankName: "eth",
9
- ankrName: "eth",
10
- zerionName: "ethereum",
11
- chainId: 1,
12
- explorerUrl: "https://etherscan.io",
13
- color: "#5D5FEF",
14
- get serverRpcUrl() {
15
- return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0];
16
- },
17
- balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
18
- usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
19
- params: {
20
- rpcUrls: ["https://rpc.ankr.com/eth"],
21
- nativeCurrency: {
22
- name: "Ethereum",
23
- symbol: "ETH",
24
- decimals: 18,
25
- },
26
- },
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,
59
+ },
60
+ rpcUrls: {
61
+ default: { http: [AVO_STAGING_RPC_URL] },
27
62
  },
63
+ blockExplorers: {
64
+ default: { name: "Avoscan", url: AVO_STAGING_EXPLORER_URL },
65
+ },
66
+ });
67
+
68
+ export const networks: Network[] = [
28
69
  {
29
70
  name: "Polygon",
30
71
  debankName: "matic",
@@ -32,9 +73,13 @@ export const networks: Network[] = [
32
73
  zerionName: "polygon",
33
74
  color: "#7A4ADD",
34
75
  chainId: 137,
76
+ viemChain: polygon,
35
77
  balanceResolverAddress: "0x58632D23120b20650262b8A629a14e4F4043E0D9",
36
78
  usdcAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
37
79
  explorerUrl: "https://polygonscan.com",
80
+ apiURL: "https://api.polygonscan.com/api",
81
+ fakeTransactionHash:
82
+ "0x906c551abd5873a428505b6530ac14d91367820706c7ee525f6d7313265d1c92",
38
83
  get serverRpcUrl() {
39
84
  return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0];
40
85
  },
@@ -53,11 +98,15 @@ export const networks: Network[] = [
53
98
  debankName: "arb",
54
99
  ankrName: "arbitrum",
55
100
  zerionName: "arbitrum",
101
+ viemChain: arbitrum,
56
102
  color: "#2D374B",
57
103
  chainId: 42161,
58
104
  usdcAddress: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
59
105
  balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
106
+ fakeTransactionHash:
107
+ "0x9fa291c3b09d31f19b1fa5dd05f30169d1364036d5f7c14b026410bc07bd8843",
60
108
  explorerUrl: "https://arbiscan.io",
109
+ apiURL: "https://api.arbiscan.io/api",
61
110
  get serverRpcUrl() {
62
111
  return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0];
63
112
  },
@@ -71,15 +120,70 @@ export const networks: Network[] = [
71
120
  rpcUrls: ["https://arb1.arbitrum.io/rpc"],
72
121
  },
73
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/api",
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/api",
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
+ },
172
+ },
173
+ },
74
174
  {
75
175
  name: "Optimism",
76
176
  debankName: "op",
77
177
  ankrName: "optimism",
78
178
  zerionName: "optimism",
79
179
  color: "#FF0420",
180
+ viemChain: optimism,
80
181
  chainId: 10,
182
+ apiURL: "https://api-optimistic.etherscan.io/api",
81
183
  usdcAddress: "0x7f5c764cbc14f9669b88837ca1490cca17c31607",
82
184
  balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
185
+ fakeTransactionHash:
186
+ "0xee7311d68059732b05088f2144dfec6c7a4f5fd0433eb85306afcd6bdf17cebc",
83
187
  explorerUrl: "https://optimistic.etherscan.io",
84
188
  get serverRpcUrl() {
85
189
  return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0];
@@ -95,26 +199,28 @@ export const networks: Network[] = [
95
199
  },
96
200
  },
97
201
  {
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",
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/api",
209
+ balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
210
+ fakeTransactionHash:
211
+ "0x1077130463ade91ad4e9c43c3195298e26a99970975238128912490eea12bf41",
212
+ usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
107
213
  get serverRpcUrl() {
108
- return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0];
214
+ return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
109
215
  },
110
216
  params: {
111
- chainName: "Avalanche Network",
217
+ chainName: "polygon zkEVM",
218
+ rpcUrls: ["https://zkevm-rpc.com"],
112
219
  nativeCurrency: {
113
- name: "Avalanche",
114
- symbol: "AVAX",
220
+ name: "Ethereum",
221
+ symbol: "ETH",
115
222
  decimals: 18,
116
223
  },
117
- rpcUrls: ["https://rpc.ankr.com/avalanche"],
118
224
  },
119
225
  },
120
226
  {
@@ -125,6 +231,10 @@ export const networks: Network[] = [
125
231
  color: "#F3BA2F",
126
232
  chainId: 56,
127
233
  explorerUrl: "https://bscscan.com",
234
+ viemChain: bsc,
235
+ fakeTransactionHash:
236
+ "0x897d54bf8e492f840bd4d8f1e743bfcab8226ab4d5a899e47ee433dcd6d6abf7",
237
+ apiURL: "https://api.bscscan.com/api",
128
238
  usdcAddress: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
129
239
  balanceResolverAddress: "0xb808cff38706e267067b0af427726aa099f69f89",
130
240
  get serverRpcUrl() {
@@ -140,14 +250,72 @@ export const networks: Network[] = [
140
250
  },
141
251
  },
142
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.routescan.io/v2/network/mainnet/evm/43114/etherscan/api",
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
+ apiURL: 'https://api.ftmscan.com/api',
286
+ ankrName: "fantom",
287
+ color: "#1969ff",
288
+ viemChain: fantom,
289
+ get serverRpcUrl() {
290
+ return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0];
291
+ },
292
+ usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
293
+ balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
294
+ fakeTransactionHash:
295
+ "0x1e9a8405d660172314124e06896212c0786d7fb1550b89410d4bc87e9e8054e4",
296
+ params: {
297
+ rpcUrls: ["https://rpc.ankr.com/fantom"],
298
+ chainName: "Fantom",
299
+ nativeCurrency: {
300
+ name: "Fantom",
301
+ symbol: "FTM",
302
+ decimals: 18,
303
+ },
304
+ },
305
+ },
143
306
  {
144
307
  name: "Gnosis",
145
308
  debankName: "xdai",
146
309
  zerionName: "xdai",
147
310
  color: "#04795C",
311
+ ankrName: "gnosis",
312
+ viemChain: gnosis,
148
313
  chainId: 100,
149
314
  balanceResolverAddress: "0xfaa244e276b1597f663975ed007ee4ff70d27849",
150
315
  explorerUrl: "https://gnosisscan.io",
316
+ fakeTransactionHash:
317
+ "0x1513033806310a2c3b29f2276f8aa7388461b0ef9f8499c297e68c12187c179b",
318
+ apiURL: "https://api.gnosisscan.io/api",
151
319
  usdcAddress: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
152
320
  get serverRpcUrl() {
153
321
  return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0];
@@ -162,33 +330,16 @@ export const networks: Network[] = [
162
330
  },
163
331
  },
164
332
  },
165
- {
166
- name: "Polygon zkEVM",
167
- chainId: 1101,
168
- color: "#8544f6",
169
- explorerUrl: "https://zkevm.polygonscan.com",
170
- balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
171
- usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
172
- get serverRpcUrl() {
173
- return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
174
- },
175
- params: {
176
- chainName: "polygon zkEVM",
177
- rpcUrls: ["https://zkevm-rpc.com"],
178
-
179
- nativeCurrency: {
180
- name: "Ethereum",
181
- symbol: "ETH",
182
- decimals: 18,
183
- },
184
- },
185
- },
186
333
  {
187
334
  name: "Aurora",
188
335
  chainId: 1313161554,
189
336
  zerionName: "aurora",
190
337
  color: "#78d64b",
338
+ viemChain: aurora,
191
339
  explorerUrl: "https://explorer.mainnet.aurora.dev",
340
+ apiURL:'https://explorer.mainnet.aurora.dev/api/v2',
341
+ fakeTransactionHash:
342
+ "0x0923401c5a80c39a5cd57c098a6c4729edbefd0db6894def7d349493f4ff3ec6",
192
343
  get serverRpcUrl() {
193
344
  return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0];
194
345
  },
@@ -205,32 +356,144 @@ export const networks: Network[] = [
205
356
  },
206
357
  },
207
358
  {
208
- name: "Fantom",
209
- chainId: 250,
210
- zerionName: "fantom",
211
- explorerUrl: "https://ftmscan.com",
212
- ankrName: "fantom",
213
- color: "#1969ff",
359
+ name: "Fuse",
360
+ chainId: 122,
361
+ zerionName: "fuse",
362
+ color: "#78d64b",
363
+ explorerUrl: "https://explorer.fuse.io",
364
+ apiURL: 'https://explorer.fuse.io/api/v2',
365
+ viemChain: fuse,
366
+ fakeTransactionHash:
367
+ "0xf22a8031de9b978a57c728e18c6b54633356c39db4d0466e53b9b7c3ee7f8def",
214
368
  get serverRpcUrl() {
215
- return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0];
369
+ return process.env?.FUSE_RPC_URL || this.params.rpcUrls[0];
216
370
  },
217
- usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
218
- balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
371
+ usdcAddress: "",
372
+ balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
219
373
  params: {
220
- rpcUrls: ["https://rpc.ankr.com/fantom"],
221
- chainName: "Fantom",
374
+ rpcUrls: ["https://fuse-mainnet.chainstacklabs.com"],
375
+ chainName: "Fuse",
222
376
  nativeCurrency: {
223
- name: "Fantom",
224
- symbol: "FTM",
377
+ decimals: 18,
378
+ name: "Fuse",
379
+ symbol: "fuse",
380
+ },
381
+ },
382
+ },
383
+ {
384
+ name: "Scroll",
385
+ chainId: 534352,
386
+ color: "#78d64b",
387
+ ankrName: 'scroll',
388
+ explorerUrl: "https://scrollscan.com",
389
+ apiURL: 'https://api.scrollscan.com/api',
390
+ viemChain: scroll,
391
+ fakeTransactionHash:
392
+ "0x6bf297c414264fc8cddd47224632b4426a02138df2f50fe891eca87f6aefea01",
393
+ get serverRpcUrl() {
394
+ return process.env?.SCROLL_RPC_URL || this.params.rpcUrls[0];
395
+ },
396
+ params: {
397
+ rpcUrls: ["https://rpc.scroll.io"],
398
+ chainName: "Scroll",
399
+ nativeCurrency: {
400
+ name: "Ethereum",
401
+ symbol: "ETH",
402
+ decimals: 18,
403
+ },
404
+ },
405
+ },
406
+ {
407
+ name: "opBNB",
408
+ chainId: 204,
409
+ color: "#78d64b",
410
+ explorerUrl: "https://opbnbscan.com",
411
+ apiURL: null,
412
+ viemChain: opBNB,
413
+ fakeTransactionHash:
414
+ "0xb9438a3eae61442bc7d419d79930370ce09ac0f46e0695025751e3bfe1a931e7",
415
+ get serverRpcUrl() {
416
+ return process.env?.OPBNB_RPC_URL || this.params.rpcUrls[0];
417
+ },
418
+ params: {
419
+ rpcUrls: ["https://opbnb-mainnet-rpc.bnbchain.org"],
420
+ chainName: "opBNB",
421
+ nativeCurrency: {
422
+ name: "BNB",
423
+ symbol: "BNB",
225
424
  decimals: 18,
226
425
  },
227
426
  },
228
427
  },
428
+ {
429
+ chainId: 34443,
430
+ name: "Mode",
431
+ color: "#d7ff00",
432
+ explorerUrl: 'https://explorer.mode.network',
433
+ fakeTransactionHash: '0xb58002db3481f2c51855a91280ec940d0bebec075c4b362b9f90c21a2b14edbe',
434
+ apiURL: 'https://explorer.mode.network/api/v2',
435
+ params: {
436
+ rpcUrls: ["https://1rpc.io/mode"],
437
+ chainName: "Mode",
438
+ nativeCurrency: {
439
+ name: "Ethereum",
440
+ symbol: "ETH",
441
+ decimals: 18,
442
+ }
443
+ },
444
+ get serverRpcUrl() {
445
+ return process.env?.MODE_RPC_URL || this.params.rpcUrls[0];
446
+ },
447
+ viemChain: mode,
448
+ },
449
+ {
450
+ chainId: 81457,
451
+ name: "Blast",
452
+ color: "#78d64b",
453
+ explorerUrl: 'https://blastscan.io',
454
+ apiURL:'https://api.blastscan.io/api',
455
+ fakeTransactionHash: '0x934ed8516242f8c08bb9e0e90bb1f989d92ceb6b0333e86ac2d555f25ac27e58',
456
+ params: {
457
+ rpcUrls: ['https://rpc.ankr.com/blast'],
458
+ chainName: "Blast",
459
+ nativeCurrency: {
460
+ name: "Ethereum",
461
+ symbol: "ETH",
462
+ decimals: 18,
463
+ }
464
+ },
465
+ get serverRpcUrl() {
466
+ return process.env?.BLAST_RPC_URL || this.params.rpcUrls[0];
467
+ },
468
+ viemChain: blast,
469
+ },
470
+ // {
471
+ // name: "Manta Pacific",
472
+ // chainId: 169,
473
+ // explorerUrl: "https://pacific-explorer.manta.network",
474
+ // params: {
475
+ // rpcUrls: ["https://pacific-rpc.manta.network/http"],
476
+ // chainName: "Manta Pacific",
477
+ // nativeCurrency: {
478
+ // name: "Ethereum",
479
+ // symbol: "ETH",
480
+ // decimals: 18,
481
+ // },
482
+ // },
483
+ // color: "#78d64b",
484
+ // fakeTransactionHash: "0x3fB128aA5AC254C8539996B11C587E521AE0d3ab",
485
+ // get serverRpcUrl() {
486
+ // return process.env?.MANTA_RPC_URL || this.params.rpcUrls[0];
487
+ // },
488
+ // },
229
489
  {
230
490
  name: AVO_PROD_CHAIN_NAME,
231
491
  chainId: AVO_PROD_CHAIN_ID,
492
+ apiURL:null,
232
493
  isAvocado: true,
233
494
  balanceResolverAddress: "",
495
+ fakeTransactionHash: "",
496
+ viemChain: avocado,
234
497
  color: "#16A34A",
235
498
  usdcAddress: "",
236
499
  serverRpcUrl: AVO_PROD_RPC_URL,
@@ -248,10 +511,13 @@ export const networks: Network[] = [
248
511
  },
249
512
  {
250
513
  name: AVO_STAGING_CHAIN_NAME,
514
+ apiURL: null,
251
515
  chainId: AVO_STAGING_CHAIN_ID,
252
516
  serverRpcUrl: AVO_STAGING_RPC_URL,
253
517
  color: "#16A34A",
254
518
  explorerUrl: AVO_STAGING_EXPLORER_URL,
519
+ viemChain: avocadoStaging,
520
+ fakeTransactionHash: "",
255
521
  isAvocado: true,
256
522
  balanceResolverAddress: "",
257
523
  usdcAddress: "",
@@ -268,6 +534,26 @@ export const networks: Network[] = [
268
534
  },
269
535
  ];
270
536
 
537
+ export const chainUsdcAddresses = [
538
+ { chainId: 1, address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" },
539
+ { chainId: 10, address: "0x7f5c764cbc14f9669b88837ca1490cca17c31607" },
540
+ { chainId: 56, address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d" },
541
+ { chainId: 100, address: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83" },
542
+ { chainId: 137, address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174" },
543
+ { chainId: 137, address: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359" },
544
+ { chainId: 250, address: "0x04068da6c83afcfa0e13ba15a6696662335d5b75" },
545
+ { chainId: 42161, address: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8" },
546
+ { chainId: 42161, address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831" },
547
+ { chainId: 43114, address: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e" },
548
+ { chainId: 43114, address: "0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664" },
549
+ { chainId: 1101, address: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035" },
550
+ {
551
+ chainId: 1313161554,
552
+ address: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
553
+ },
554
+ { chainId: 8453, address: "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA" },
555
+ ];
556
+
271
557
  export const getNetworkByChainId = (
272
558
  chainId: ChainId | number | string
273
559
  ): Network => {
@@ -280,12 +566,16 @@ export const availableNetworks = networks.filter(
280
566
 
281
567
  export const chainIdToName = (chainId: ChainId | number | string) => {
282
568
  const network = getNetworkByChainId(chainId);
283
- return network.name;
569
+ return network?.name;
284
570
  };
285
571
 
286
572
  export const getRpcURLByChainId = (chainId: ChainId | number | string) => {
287
- const network = getNetworkByChainId(chainId);
288
- return network.params.rpcUrls[0];
573
+ try {
574
+ const network = getNetworkByChainId(chainId);
575
+ return network.params.rpcUrls[0];
576
+ } catch (e) {
577
+ return "";
578
+ }
289
579
  };
290
580
 
291
581
  export const RPCMap = networks.reduce((acc, network) => {
@@ -327,5 +617,6 @@ export const getExplorerUrl = (
327
617
  suffix: `/${string}` = "/"
328
618
  ) => {
329
619
  const network = getNetworkByChainId(chainId);
620
+ if (!network) return "";
330
621
  return `${network.explorerUrl}${suffix}`;
331
622
  };
@@ -0,0 +1,21 @@
1
+ export const fetchTokenByAddress = async (
2
+ address: string,
3
+ chainId: string | number,
4
+ tokens?: ITokenPrice[]
5
+ ) => {
6
+ if (!address || !chainId) return null;
7
+
8
+ if (tokens?.length) {
9
+ const token = tokens.find((token) => token.address?.toLocaleLowerCase() === address?.toLocaleLowerCase() && token.chain_id == chainId);
10
+ if (token) return token;
11
+ }
12
+
13
+ const [token] = (await $fetch(`${blockQueryURL}/${chainId}/tokens`, {
14
+ params: {
15
+ sparkline: false,
16
+ "addresses[]": [address],
17
+ },
18
+ })) as ITokenPrice[];
19
+
20
+ return token;
21
+ };