@instadapp/avocado-base 0.0.0-dev.0f85f1a → 0.0.0-dev.110311

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