@instadapp/avocado-base 0.0.0-dev.0d5070b → 0.0.0-dev.0e696bd

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/abi/avoFactoryProxy.json +109 -0
  2. package/abi/balanceResolver.json +110 -0
  3. package/abi/erc20.json +350 -0
  4. package/abi/forwarder.json +1435 -0
  5. package/abi/gaslessWallet.json +289 -0
  6. package/app.vue +27 -0
  7. package/assets/images/icons/arrow-left.svg +5 -0
  8. package/assets/images/icons/arrow-right.svg +5 -0
  9. package/assets/images/icons/avocado.svg +4 -0
  10. package/assets/images/icons/bridge-2.svg +3 -0
  11. package/assets/images/icons/bridge.svg +7 -0
  12. package/assets/images/icons/calendar.svg +8 -0
  13. package/assets/images/icons/change-threshold.svg +4 -0
  14. package/assets/images/icons/check-circle.svg +4 -0
  15. package/assets/images/icons/chevron-down.svg +4 -0
  16. package/assets/images/icons/clipboard.svg +7 -0
  17. package/assets/images/icons/clock-circle.svg +5 -0
  18. package/assets/images/icons/copy.svg +5 -0
  19. package/assets/images/icons/cross-transfer.svg +7 -0
  20. package/assets/images/icons/dapp.svg +4 -0
  21. package/assets/images/icons/deploy.svg +12 -0
  22. package/assets/images/icons/error-circle.svg +6 -0
  23. package/assets/images/icons/exclamation-circle.svg +13 -0
  24. package/assets/images/icons/exclamation-octagon.svg +13 -0
  25. package/assets/images/icons/exclamation-triangle.svg +5 -0
  26. package/assets/images/icons/external-link.svg +6 -0
  27. package/assets/images/icons/eye.svg +4 -0
  28. package/assets/images/icons/flowers.svg +8 -0
  29. package/assets/images/icons/gas-emoji.svg +193 -0
  30. package/assets/images/icons/gas.svg +14 -0
  31. package/assets/images/icons/gift.svg +153 -0
  32. package/assets/images/icons/globe.svg +110 -0
  33. package/assets/images/icons/hamburger.svg +6 -0
  34. package/assets/images/icons/instadapp-pro.svg +4 -0
  35. package/assets/images/icons/logout.svg +3 -0
  36. package/assets/images/icons/moon.svg +3 -0
  37. package/assets/images/icons/multi-send.svg +7 -0
  38. package/assets/images/icons/network.svg +13 -0
  39. package/assets/images/icons/options.svg +5 -0
  40. package/assets/images/icons/permit-sign.svg +11 -0
  41. package/assets/images/icons/plus-circle.svg +6 -0
  42. package/assets/images/icons/plus.svg +5 -0
  43. package/assets/images/icons/power-off-bg.svg +24 -0
  44. package/assets/images/icons/power-off.svg +19 -0
  45. package/assets/images/icons/power-on.svg +19 -0
  46. package/assets/images/icons/qr.svg +20 -0
  47. package/assets/images/icons/question-circle.svg +14 -0
  48. package/assets/images/icons/refresh.svg +6 -0
  49. package/assets/images/icons/reject-proposal.svg +6 -0
  50. package/assets/images/icons/search.svg +12 -0
  51. package/assets/images/icons/sun.svg +3 -0
  52. package/assets/images/icons/transfer.svg +5 -0
  53. package/assets/images/icons/trash-2.svg +8 -0
  54. package/assets/images/icons/upgrade.svg +4 -0
  55. package/assets/images/icons/wave.svg +214 -0
  56. package/assets/images/icons/x.svg +5 -0
  57. package/components/ActionLogo.vue +38 -0
  58. package/components/ActionMetadata.vue +72 -0
  59. package/components/AuthorityAvatar.vue +26 -0
  60. package/components/ChainLogo.vue +125 -328
  61. package/components/CopyClipboard.vue +64 -0
  62. package/components/metadata/Bridge.vue +59 -0
  63. package/components/metadata/CrossTransfer.vue +71 -0
  64. package/components/metadata/GasTopup.vue +39 -0
  65. package/components/metadata/Permit2.vue +42 -0
  66. package/components/metadata/Signers.vue +45 -0
  67. package/components/metadata/Swap.vue +74 -0
  68. package/components/metadata/Transfer.vue +50 -0
  69. package/components.d.ts +13 -0
  70. package/contracts/AvoFactoryProxy.ts +302 -0
  71. package/contracts/BalanceResolver.ts +321 -0
  72. package/contracts/Erc20.ts +526 -0
  73. package/contracts/Forwarder.ts +1644 -0
  74. package/contracts/GaslessWallet.ts +660 -0
  75. package/contracts/common.ts +46 -0
  76. package/contracts/factories/AvoFactoryProxy__factory.ts +181 -0
  77. package/contracts/factories/BalanceResolver__factory.ts +212 -0
  78. package/contracts/factories/Erc20__factory.ts +368 -0
  79. package/contracts/factories/Forwarder__factory.ts +1456 -0
  80. package/contracts/factories/GaslessWallet__factory.ts +499 -0
  81. package/contracts/factories/index.ts +8 -0
  82. package/contracts/index.ts +14 -0
  83. package/nuxt.config.ts +18 -2
  84. package/package.json +18 -6
  85. package/server/utils/index.ts +2 -0
  86. package/utils/avocado.ts +2 -0
  87. package/utils/bignumber.ts +51 -0
  88. package/utils/formatter.ts +94 -0
  89. package/utils/helper.ts +73 -0
  90. package/utils/metadata.ts +536 -0
  91. package/utils/network.ts +221 -47
  92. package/utils/services.ts +21 -0
  93. package/utils/utils.d.ts +129 -14
package/utils/network.ts CHANGED
@@ -1,31 +1,21 @@
1
1
  import { ethers } from "ethers";
2
- import {
3
- AVO_PROD_CHAIN_NAME,
4
- AVO_PROD_CHAIN_ID,
5
- AVO_STAGING_CHAIN_NAME,
6
- AVO_STAGING_RPC_URL,
7
- AVO_PROD_RPC_URL,
8
- AVO_STAGING_CHAIN_ID,
9
- } from "./avocado";
10
2
 
11
3
  export const bridgeDisabledNetworks = [1101];
12
4
 
13
5
  export const networks: Network[] = [
14
- {
15
- name: "Mainnet",
16
- chainId: 1,
17
- params: {
18
- rpcUrls: ["https://rpc.ankr.com/eth"],
19
- nativeCurrency: {
20
- name: "Ethereum",
21
- symbol: "ETH",
22
- decimals: 18,
23
- },
24
- },
25
- },
26
6
  {
27
7
  name: "Polygon",
8
+ debankName: "matic",
9
+ ankrName: "polygon",
10
+ zerionName: "polygon",
11
+ color: "#7A4ADD",
28
12
  chainId: 137,
13
+ balanceResolverAddress: "0x58632D23120b20650262b8A629a14e4F4043E0D9",
14
+ usdcAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
15
+ explorerUrl: "https://polygonscan.com",
16
+ get serverRpcUrl() {
17
+ return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0];
18
+ },
29
19
  params: {
30
20
  chainName: "Matic(Polygon) Mainnet",
31
21
  nativeCurrency: {
@@ -34,12 +24,21 @@ export const networks: Network[] = [
34
24
  decimals: 18,
35
25
  },
36
26
  rpcUrls: ["https://polygon-rpc.com"],
37
- blockExplorerUrls: ["https://polygonscan.com/"],
38
27
  },
39
28
  },
40
29
  {
41
30
  name: "Arbitrum",
31
+ debankName: "arb",
32
+ ankrName: "arbitrum",
33
+ zerionName: "arbitrum",
34
+ color: "#2D374B",
42
35
  chainId: 42161,
36
+ usdcAddress: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
37
+ balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
38
+ explorerUrl: "https://arbiscan.io",
39
+ get serverRpcUrl() {
40
+ return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0];
41
+ },
43
42
  params: {
44
43
  chainName: "Arbitrum One",
45
44
  nativeCurrency: {
@@ -48,12 +47,63 @@ export const networks: Network[] = [
48
47
  decimals: 18,
49
48
  },
50
49
  rpcUrls: ["https://arb1.arbitrum.io/rpc"],
51
- blockExplorerUrls: ["https://arbiscan.io"],
52
50
  },
53
51
  },
52
+ {
53
+ name: "Ethereum",
54
+ debankName: "eth",
55
+ ankrName: "eth",
56
+ zerionName: "ethereum",
57
+ chainId: 1,
58
+ explorerUrl: "https://etherscan.io",
59
+ color: "#5D5FEF",
60
+ get serverRpcUrl() {
61
+ return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0];
62
+ },
63
+ balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
64
+ usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
65
+ params: {
66
+ rpcUrls: ["https://rpc.ankr.com/eth"],
67
+ nativeCurrency: {
68
+ name: "Ethereum",
69
+ symbol: "ETH",
70
+ decimals: 18,
71
+ },
72
+ },
73
+ },
74
+ {
75
+ name: 'Base',
76
+ chainId: 8453,
77
+ color: '#1E2024',
78
+ explorerUrl: 'https://basescan.org',
79
+ get serverRpcUrl() {
80
+ return process.env?.BASE_RPC_URL || this.params.rpcUrls[0];
81
+ },
82
+ usdcAddress: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
83
+ balanceResolverAddress: '0x23c8EAb8a4373dD16b0947Ebe8bf76Ff7A49d13C',
84
+ params: {
85
+ rpcUrls: ['https://rpc.ankr.com/base'],
86
+ chainName: "Base",
87
+ nativeCurrency: {
88
+ name: "Ethereum",
89
+ symbol: "ETH",
90
+ decimals: 18,
91
+ },
92
+ }
93
+ },
54
94
  {
55
95
  name: "Optimism",
96
+ debankName: "op",
97
+ ankrName: "optimism",
98
+ zerionName: "optimism",
99
+ color: "#FF0420",
56
100
  chainId: 10,
101
+ usdcAddress: "0x7f5c764cbc14f9669b88837ca1490cca17c31607",
102
+ balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
103
+ explorerUrl: "https://optimistic.etherscan.io",
104
+ get serverRpcUrl() {
105
+ return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0];
106
+ },
57
107
  params: {
58
108
  chainName: "Optimistic Ethereum",
59
109
  nativeCurrency: {
@@ -61,27 +111,42 @@ export const networks: Network[] = [
61
111
  symbol: "ETH",
62
112
  decimals: 18,
63
113
  },
64
- rpcUrls: ["https://mainnet.optimism.io"],
65
- blockExplorerUrls: ["https://optimistic.etherscan.io"],
114
+ rpcUrls: ["https://rpc.ankr.com/optimism"],
66
115
  },
67
116
  },
68
117
  {
69
- name: "Avalanche",
70
- chainId: 43114,
118
+ name: "Polygon zkEVM",
119
+ chainId: 1101,
120
+ color: "#8544f6",
121
+ explorerUrl: "https://zkevm.polygonscan.com",
122
+ balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
123
+ usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
124
+ get serverRpcUrl() {
125
+ return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
126
+ },
71
127
  params: {
72
- chainName: "Avalanche Network",
128
+ chainName: "polygon zkEVM",
129
+ rpcUrls: ["https://zkevm-rpc.com"],
73
130
  nativeCurrency: {
74
- name: "Avalanche",
75
- symbol: "AVAX",
131
+ name: "Ethereum",
132
+ symbol: "ETH",
76
133
  decimals: 18,
77
134
  },
78
- rpcUrls: ["https://api.avax.network/ext/bc/C/rpc"],
79
- blockExplorerUrls: ["https://snowtrace.io/"],
80
135
  },
81
136
  },
82
137
  {
83
138
  name: "BSC",
139
+ debankName: "bsc",
140
+ ankrName: "bsc",
141
+ zerionName: "binance-smart-chain",
142
+ color: "#F3BA2F",
84
143
  chainId: 56,
144
+ explorerUrl: "https://bscscan.com",
145
+ usdcAddress: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
146
+ balanceResolverAddress: "0xb808cff38706e267067b0af427726aa099f69f89",
147
+ get serverRpcUrl() {
148
+ return process.env?.BSC_RPC_URL || this.params.rpcUrls[0];
149
+ },
85
150
  params: {
86
151
  chainName: "Binance Smart Chain",
87
152
  rpcUrls: ["https://rpc.ankr.com/bsc"],
@@ -92,9 +157,63 @@ export const networks: Network[] = [
92
157
  },
93
158
  },
94
159
  },
160
+ {
161
+ name: "Avalanche",
162
+ debankName: "avax",
163
+ ankrName: "avalanche",
164
+ zerionName: "avalanche",
165
+ color: "#EB5757",
166
+ chainId: 43114,
167
+ usdcAddress: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
168
+ balanceResolverAddress: "0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E",
169
+ explorerUrl: "https://snowtrace.io",
170
+ get serverRpcUrl() {
171
+ return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0];
172
+ },
173
+ params: {
174
+ chainName: "Avalanche Network",
175
+ nativeCurrency: {
176
+ name: "Avalanche",
177
+ symbol: "AVAX",
178
+ decimals: 18,
179
+ },
180
+ rpcUrls: ["https://rpc.ankr.com/avalanche"],
181
+ },
182
+ },
183
+ {
184
+ name: "Fantom",
185
+ chainId: 250,
186
+ zerionName: "fantom",
187
+ explorerUrl: "https://ftmscan.com",
188
+ ankrName: "fantom",
189
+ color: "#1969ff",
190
+ get serverRpcUrl() {
191
+ return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0];
192
+ },
193
+ usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
194
+ balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
195
+ params: {
196
+ rpcUrls: ["https://rpc.ankr.com/fantom"],
197
+ chainName: "Fantom",
198
+ nativeCurrency: {
199
+ name: "Fantom",
200
+ symbol: "FTM",
201
+ decimals: 18,
202
+ },
203
+ },
204
+ },
95
205
  {
96
206
  name: "Gnosis",
207
+ debankName: "xdai",
208
+ zerionName: "xdai",
209
+ color: "#04795C",
97
210
  chainId: 100,
211
+ balanceResolverAddress: "0xfaa244e276b1597f663975ed007ee4ff70d27849",
212
+ explorerUrl: "https://gnosisscan.io",
213
+ usdcAddress: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
214
+ get serverRpcUrl() {
215
+ return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0];
216
+ },
98
217
  params: {
99
218
  chainName: "Gnosis Safe",
100
219
  rpcUrls: ["https://rpc.ankr.com/gnosis"],
@@ -106,21 +225,35 @@ export const networks: Network[] = [
106
225
  },
107
226
  },
108
227
  {
109
- name: "Polygon zkEVM",
110
- chainId: 1101,
228
+ name: "Aurora",
229
+ chainId: 1313161554,
230
+ zerionName: "aurora",
231
+ color: "#78d64b",
232
+ explorerUrl: "https://explorer.mainnet.aurora.dev",
233
+ get serverRpcUrl() {
234
+ return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0];
235
+ },
236
+ usdcAddress: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
237
+ balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
111
238
  params: {
112
- chainName: "polygon zkEVM",
113
- rpcUrls: ["https://rpc.ankr.com/polygon_zkevm"],
239
+ rpcUrls: ["https://mainnet.aurora.dev"],
240
+ chainName: "Aurora",
114
241
  nativeCurrency: {
115
- name: "Ethereum",
116
- symbol: "ETH",
117
242
  decimals: 18,
243
+ name: "Aurora ETH",
244
+ symbol: "AETH",
118
245
  },
119
246
  },
120
247
  },
121
248
  {
122
249
  name: AVO_PROD_CHAIN_NAME,
123
250
  chainId: AVO_PROD_CHAIN_ID,
251
+ isAvocado: true,
252
+ balanceResolverAddress: "",
253
+ color: "#16A34A",
254
+ usdcAddress: "",
255
+ serverRpcUrl: AVO_PROD_RPC_URL,
256
+ explorerUrl: AVO_PROD_EXPLORER_URL,
124
257
  params: {
125
258
  chainName: AVO_PROD_CHAIN_NAME,
126
259
  nativeCurrency: {
@@ -130,12 +263,17 @@ export const networks: Network[] = [
130
263
  },
131
264
  iconUrls: ["https://avocado.instadapp.io/logo.svg"],
132
265
  rpcUrls: [AVO_PROD_RPC_URL],
133
- blockExplorerUrls: ["https://avocado.instadapp.io"],
134
266
  },
135
267
  },
136
268
  {
137
269
  name: AVO_STAGING_CHAIN_NAME,
138
270
  chainId: AVO_STAGING_CHAIN_ID,
271
+ serverRpcUrl: AVO_STAGING_RPC_URL,
272
+ color: "#16A34A",
273
+ explorerUrl: AVO_STAGING_EXPLORER_URL,
274
+ isAvocado: true,
275
+ balanceResolverAddress: "",
276
+ usdcAddress: "",
139
277
  params: {
140
278
  chainName: AVO_STAGING_CHAIN_NAME,
141
279
  nativeCurrency: {
@@ -145,21 +283,34 @@ export const networks: Network[] = [
145
283
  },
146
284
  iconUrls: ["https://avocado.instadapp.io/logo.svg"],
147
285
  rpcUrls: [AVO_STAGING_RPC_URL],
148
- blockExplorerUrls: ["https://avocado.instadapp.io"],
149
286
  },
150
287
  },
151
288
  ];
152
289
 
290
+ export const chainUsdcAddresses = [
291
+ { chainId: 1, address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' },
292
+ { chainId: 10, address: '0x7f5c764cbc14f9669b88837ca1490cca17c31607' },
293
+ { chainId: 56, address: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d' },
294
+ { chainId: 100, address: '0xddafbb505ad214d7b80b1f830fccc89b60fb7a83' },
295
+ { chainId: 137, address: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174' },
296
+ { chainId: 250, address: '0x04068da6c83afcfa0e13ba15a6696662335d5b75' },
297
+ { chainId: 42161, address: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' },
298
+ { chainId: 42161, address: '0xaf88d065e77c8cc2239327c5edb3a432268e5831' },
299
+ { chainId: 43114, address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e' },
300
+ { chainId: 43114, address: '0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664' },
301
+ { chainId: 1101, address: '0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035' },
302
+ { chainId: 1313161554, address: '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802' },
303
+ { chainId: 8453, address: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA'}
304
+ ];
305
+
153
306
  export const getNetworkByChainId = (
154
- chainId: Network["chainId"] | number | string
155
- ) => {
156
- return networks.find((i) => i.chainId === Number(chainId))!;
307
+ chainId: ChainId | number | string
308
+ ): Network => {
309
+ return networks.find((i) => i.chainId == chainId)!;
157
310
  };
158
311
 
159
312
  export const availableNetworks = networks.filter(
160
- (network) =>
161
- network.chainId != AVO_STAGING_CHAIN_ID &&
162
- network.chainId != AVO_PROD_CHAIN_ID
313
+ (network) => !network.isAvocado
163
314
  );
164
315
 
165
316
  export const chainIdToName = (chainId: ChainId | number | string) => {
@@ -179,14 +330,37 @@ export const RPCMap = networks.reduce((acc, network) => {
179
330
 
180
331
  export const networkIds = networks.map((network) => network.chainId);
181
332
 
182
- const rpcInstances: Record<string, ethers.providers.JsonRpcProvider> = {};
333
+ const rpcInstances: Record<string, ethers.providers.StaticJsonRpcProvider> = {};
334
+ const serverRpcInstances: Record<
335
+ string,
336
+ ethers.providers.StaticJsonRpcProvider
337
+ > = {};
338
+
339
+ export const getServerRpcProvider = (chainId: number | string) => {
340
+ if (!rpcInstances[chainId]) {
341
+ const network = networks.find((n) => n.chainId == chainId);
342
+ serverRpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
343
+ network?.serverRpcUrl
344
+ );
345
+ }
346
+
347
+ return serverRpcInstances[chainId];
348
+ };
183
349
 
184
350
  export const getRpcProvider = (chainId: number | string) => {
185
351
  if (!rpcInstances[chainId]) {
186
- rpcInstances[chainId] = new ethers.providers.JsonRpcProvider(
352
+ rpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
187
353
  getRpcURLByChainId(Number(chainId))
188
354
  );
189
355
  }
190
356
 
191
357
  return rpcInstances[chainId];
192
358
  };
359
+
360
+ export const getExplorerUrl = (
361
+ chainId: ChainId | number | string,
362
+ suffix: `/${string}` = "/"
363
+ ) => {
364
+ const network = getNetworkByChainId(chainId);
365
+ return `${network.explorerUrl}${suffix}`;
366
+ };
@@ -0,0 +1,21 @@
1
+ export const fetchTokenByAddress = async (
2
+ address: string,
3
+ chainId: string | number,
4
+ tokens?: ITokenPrice[]
5
+ ) => {
6
+ if (!address || !chainId) return null;
7
+
8
+ if (tokens?.length) {
9
+ const token = tokens.find((token) => token.address?.toLocaleLowerCase() === address?.toLocaleLowerCase() && token.chain_id == chainId);
10
+ if (token) return token;
11
+ }
12
+
13
+ const [token] = (await $fetch(`${blockQueryURL}/${chainId}/tokens`, {
14
+ params: {
15
+ sparkline: false,
16
+ "addresses[]": [address],
17
+ },
18
+ })) as ITokenPrice[];
19
+
20
+ return token;
21
+ };
package/utils/utils.d.ts CHANGED
@@ -1,17 +1,132 @@
1
- type ChainId = 1 | 137 | 42161 | 10 | 56 | 43114 | 100 | 1101 | 634 | 63400;
2
-
3
- interface Network {
4
- name: string;
5
- chainId: ChainId;
6
- params: {
7
- chainName?: string;
8
- rpcUrls: string[];
9
- blockExplorerUrls?: string[];
10
- iconUrls?: string[];
11
- nativeCurrency?: {
12
- name: string;
13
- symbol: string;
14
- decimals: number;
1
+ declare global {
2
+ type ChainId =
3
+ | 1
4
+ | 137
5
+ | 42161
6
+ | 10
7
+ | 56
8
+ | 43114
9
+ | 100
10
+ | 1101
11
+ | 250
12
+ | 634
13
+ | 1313161554
14
+ | 8453
15
+ | 63400;
16
+
17
+ type ISlackMessageType = "danger" | "error" | "success" | "banner";
18
+
19
+ type MetadataTypes = keyof typeof MetadataEnums;
20
+
21
+ type PayloadFunction = (data: any, type: MetadataTypes) => any;
22
+
23
+ type IPayload = Record<MetadataTypes, PayloadFunction>;
24
+
25
+ interface Network {
26
+ name: string;
27
+ debankName?: string;
28
+ ankrName?: string;
29
+ zerionName?: string;
30
+ chainId: ChainId;
31
+ color: string;
32
+ isAvocado?: boolean;
33
+ serverRpcUrl: string | undefined;
34
+ balanceResolverAddress?: string;
35
+ usdcAddress: string;
36
+ explorerUrl: string;
37
+ params: {
38
+ chainName?: string;
39
+ iconUrls?: string[];
40
+ rpcUrls: string[];
41
+ nativeCurrency?: {
42
+ name: string;
43
+ symbol: string;
44
+ decimals: number;
45
+ };
15
46
  };
47
+ }
48
+
49
+ type SignMetadataProps = {
50
+ token: string;
51
+ spender: string;
52
+ amount: string;
53
+ expiration: string;
54
+ };
55
+
56
+ type DappMetadataProps = {
57
+ name: string;
58
+ url: string;
16
59
  };
60
+
61
+ type SendMetadataProps = {
62
+ token: string;
63
+ amount: string;
64
+ receiver: string;
65
+ };
66
+
67
+ type CrossSendMetadataProps = {
68
+ fromToken: string;
69
+ toToken: string;
70
+ toChainId: string;
71
+ amount: string;
72
+ receiver: string;
73
+ };
74
+
75
+ type AuthMetadataProps = {
76
+ address: string;
77
+ chainId: string;
78
+ remove: boolean;
79
+ };
80
+
81
+ type UpgradeMetadataProps = {
82
+ version: string;
83
+ walletImpl: string;
84
+ };
85
+
86
+ type TopupMetadataProps = {
87
+ amount: string;
88
+ token: string;
89
+ onBehalf: string;
90
+ };
91
+
92
+ type BridgeMetadataProps = {
93
+ amount: string;
94
+ receiver: string;
95
+ fromToken: string;
96
+ toToken: string;
97
+ toChainId: string;
98
+ bridgeFee: string;
99
+ nativeToken: string;
100
+ };
101
+
102
+ type SwapMetadataProps = {
103
+ sellToken: string;
104
+ buyToken: string;
105
+ sellAmount: string;
106
+ buyAmount: string;
107
+ receiver: string;
108
+ protocol?: string;
109
+ };
110
+
111
+ type MetadataProps = {
112
+ type: MetadataTypes,
113
+ encodedData: string;
114
+ version?: string;
115
+ };
116
+
117
+ interface ITokenPrice {
118
+ address: string;
119
+ chain_id: string;
120
+ name: string;
121
+ symbol: string;
122
+ decimals: number;
123
+ logo_url: string;
124
+ price: string;
125
+ coingecko_id: string;
126
+ sparkline_price_7d: number[];
127
+ }
128
+
17
129
  }
130
+
131
+ export { }
132
+