@instadapp/avocado-base 0.0.0-dev.2588b9b → 0.0.0-dev.25ba262

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