@instadapp/avocado-base 0.0.0-dev.d695dce → 0.0.0-dev.d723a21

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