@instadapp/avocado-base 0.0.0-dev.b54f035 → 0.0.0-dev.b7853ae

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