@instadapp/avocado-base 0.0.0-dev.e90081b → 0.0.0-dev.ebef45a
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.
- package/app.vue +7 -0
- package/assets/images/icons/arrow-left.svg +5 -0
- package/assets/images/icons/arrow-right.svg +5 -0
- package/assets/images/icons/avocado.svg +4 -0
- package/assets/images/icons/bridge-2.svg +3 -0
- package/assets/images/icons/bridge.svg +7 -0
- package/assets/images/icons/calendar.svg +8 -0
- package/assets/images/icons/change-threshold.svg +4 -0
- package/assets/images/icons/check-circle.svg +4 -0
- package/assets/images/icons/chevron-down.svg +4 -0
- package/assets/images/icons/clipboard.svg +7 -0
- package/assets/images/icons/clock-circle.svg +5 -0
- package/assets/images/icons/copy.svg +5 -0
- package/assets/images/icons/cross-transfer.svg +7 -0
- package/assets/images/icons/dapp.svg +4 -0
- package/assets/images/icons/deploy.svg +12 -0
- package/assets/images/icons/error-circle.svg +6 -0
- package/assets/images/icons/exclamation-circle.svg +13 -0
- package/assets/images/icons/exclamation-octagon.svg +13 -0
- package/assets/images/icons/exclamation-triangle.svg +5 -0
- package/assets/images/icons/external-link.svg +6 -0
- package/assets/images/icons/eye.svg +4 -0
- package/assets/images/icons/flowers.svg +8 -0
- package/assets/images/icons/gas-emoji.svg +193 -0
- package/assets/images/icons/gas.svg +14 -0
- package/assets/images/icons/gift.svg +153 -0
- package/assets/images/icons/globe.svg +110 -0
- package/assets/images/icons/hamburger.svg +6 -0
- package/assets/images/icons/info-2.svg +12 -0
- package/assets/images/icons/instadapp-pro.svg +4 -0
- package/assets/images/icons/logout.svg +3 -0
- package/assets/images/icons/moon.svg +3 -0
- package/assets/images/icons/multi-send.svg +7 -0
- package/assets/images/icons/network.svg +13 -0
- package/assets/images/icons/options.svg +5 -0
- package/assets/images/icons/permit-sign.svg +11 -0
- package/assets/images/icons/plus-circle.svg +6 -0
- package/assets/images/icons/plus.svg +5 -0
- package/assets/images/icons/power-off-bg.svg +24 -0
- package/assets/images/icons/power-off.svg +19 -0
- package/assets/images/icons/power-on.svg +19 -0
- package/assets/images/icons/qr.svg +20 -0
- package/assets/images/icons/question-circle.svg +14 -0
- package/assets/images/icons/refresh.svg +6 -0
- package/assets/images/icons/reject-proposal.svg +6 -0
- package/assets/images/icons/search.svg +12 -0
- package/assets/images/icons/sun.svg +3 -0
- package/assets/images/icons/transfer.svg +5 -0
- package/assets/images/icons/trash-2.svg +8 -0
- package/assets/images/icons/upgrade.svg +4 -0
- package/assets/images/icons/wave.svg +214 -0
- package/assets/images/icons/x.svg +5 -0
- package/components/ActionLogo.vue +38 -0
- package/components/ActionMetadata.vue +72 -0
- package/components/AuthorityAvatar.vue +38 -0
- package/components/ChainLogo.vue +14 -556
- package/components/CopyClipboard.vue +64 -0
- package/components/metadata/Bridge.vue +59 -0
- package/components/metadata/CrossTransfer.vue +71 -0
- package/components/metadata/GasTopup.vue +39 -0
- package/components/metadata/Permit2.vue +42 -0
- package/components/metadata/Signers.vue +47 -0
- package/components/metadata/Swap.vue +74 -0
- package/components/metadata/Transfer.vue +50 -0
- package/components.d.ts +13 -0
- package/nuxt.config.ts +17 -1
- package/package.json +9 -4
- package/utils/avocado.ts +2 -0
- package/utils/bignumber.ts +20 -0
- package/utils/formatter.ts +1 -1
- package/utils/helper.ts +8 -0
- package/utils/metadata.ts +295 -186
- package/utils/network.ts +133 -79
- package/utils/services.ts +21 -0
- package/utils/utils.d.ts +129 -114
package/utils/network.ts
CHANGED
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
import { ethers } from "ethers";
|
|
2
|
+
import {
|
|
3
|
+
AVO_PROD_CHAIN_NAME,
|
|
4
|
+
AVO_PROD_CHAIN_ID,
|
|
5
|
+
AVO_PROD_RPC_URL,
|
|
6
|
+
AVO_PROD_EXPLORER_URL,
|
|
7
|
+
AVO_STAGING_CHAIN_NAME,
|
|
8
|
+
AVO_STAGING_CHAIN_ID,
|
|
9
|
+
AVO_STAGING_RPC_URL,
|
|
10
|
+
AVO_STAGING_EXPLORER_URL,
|
|
11
|
+
} from './avocado'
|
|
2
12
|
|
|
3
13
|
export const bridgeDisabledNetworks = [1101];
|
|
4
14
|
|
|
5
15
|
export const networks: Network[] = [
|
|
6
|
-
{
|
|
7
|
-
name: "Ethereum",
|
|
8
|
-
debankName: "eth",
|
|
9
|
-
ankrName: "eth",
|
|
10
|
-
zerionName: "ethereum",
|
|
11
|
-
chainId: 1,
|
|
12
|
-
explorerUrl: "https://etherscan.io",
|
|
13
|
-
color: "#5D5FEF",
|
|
14
|
-
get serverRpcUrl() {
|
|
15
|
-
return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0];
|
|
16
|
-
},
|
|
17
|
-
balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
|
|
18
|
-
usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
19
|
-
params: {
|
|
20
|
-
rpcUrls: ["https://rpc.ankr.com/eth"],
|
|
21
|
-
nativeCurrency: {
|
|
22
|
-
name: "Ethereum",
|
|
23
|
-
symbol: "ETH",
|
|
24
|
-
decimals: 18,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
16
|
{
|
|
29
17
|
name: "Polygon",
|
|
30
18
|
debankName: "matic",
|
|
@@ -35,6 +23,7 @@ export const networks: Network[] = [
|
|
|
35
23
|
balanceResolverAddress: "0x58632D23120b20650262b8A629a14e4F4043E0D9",
|
|
36
24
|
usdcAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
|
37
25
|
explorerUrl: "https://polygonscan.com",
|
|
26
|
+
apiURL: 'https://api.polygonscan.com',
|
|
38
27
|
get serverRpcUrl() {
|
|
39
28
|
return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0];
|
|
40
29
|
},
|
|
@@ -58,6 +47,7 @@ export const networks: Network[] = [
|
|
|
58
47
|
usdcAddress: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
|
|
59
48
|
balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
|
|
60
49
|
explorerUrl: "https://arbiscan.io",
|
|
50
|
+
apiURL: 'https://api.arbiscan.io',
|
|
61
51
|
get serverRpcUrl() {
|
|
62
52
|
return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0];
|
|
63
53
|
},
|
|
@@ -71,6 +61,50 @@ export const networks: Network[] = [
|
|
|
71
61
|
rpcUrls: ["https://arb1.arbitrum.io/rpc"],
|
|
72
62
|
},
|
|
73
63
|
},
|
|
64
|
+
{
|
|
65
|
+
name: "Ethereum",
|
|
66
|
+
debankName: "eth",
|
|
67
|
+
ankrName: "eth",
|
|
68
|
+
zerionName: "ethereum",
|
|
69
|
+
chainId: 1,
|
|
70
|
+
explorerUrl: "https://etherscan.io",
|
|
71
|
+
apiURL: 'https://api.etherscan.io',
|
|
72
|
+
color: "#5D5FEF",
|
|
73
|
+
get serverRpcUrl() {
|
|
74
|
+
return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0];
|
|
75
|
+
},
|
|
76
|
+
balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
|
|
77
|
+
usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
78
|
+
params: {
|
|
79
|
+
rpcUrls: ["https://rpc.ankr.com/eth"],
|
|
80
|
+
nativeCurrency: {
|
|
81
|
+
name: "Ethereum",
|
|
82
|
+
symbol: "ETH",
|
|
83
|
+
decimals: 18,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'Base',
|
|
89
|
+
chainId: 8453,
|
|
90
|
+
color: '#1E2024',
|
|
91
|
+
explorerUrl: 'https://basescan.org',
|
|
92
|
+
apiURL: 'https://api.basescan.org',
|
|
93
|
+
get serverRpcUrl() {
|
|
94
|
+
return process.env?.BASE_RPC_URL || this.params.rpcUrls[0];
|
|
95
|
+
},
|
|
96
|
+
usdcAddress: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
|
|
97
|
+
balanceResolverAddress: '0x23c8EAb8a4373dD16b0947Ebe8bf76Ff7A49d13C',
|
|
98
|
+
params: {
|
|
99
|
+
rpcUrls: ['https://rpc.ankr.com/base'],
|
|
100
|
+
chainName: "Base",
|
|
101
|
+
nativeCurrency: {
|
|
102
|
+
name: "Ethereum",
|
|
103
|
+
symbol: "ETH",
|
|
104
|
+
decimals: 18,
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
},
|
|
74
108
|
{
|
|
75
109
|
name: "Optimism",
|
|
76
110
|
debankName: "op",
|
|
@@ -78,6 +112,7 @@ export const networks: Network[] = [
|
|
|
78
112
|
zerionName: "optimism",
|
|
79
113
|
color: "#FF0420",
|
|
80
114
|
chainId: 10,
|
|
115
|
+
apiURL: 'https://api-optimistic.etherscan.io',
|
|
81
116
|
usdcAddress: "0x7f5c764cbc14f9669b88837ca1490cca17c31607",
|
|
82
117
|
balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
|
|
83
118
|
explorerUrl: "https://optimistic.etherscan.io",
|
|
@@ -95,26 +130,24 @@ export const networks: Network[] = [
|
|
|
95
130
|
},
|
|
96
131
|
},
|
|
97
132
|
{
|
|
98
|
-
name: "
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
usdcAddress: "
|
|
105
|
-
balanceResolverAddress: "0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E",
|
|
106
|
-
explorerUrl: "https://snowtrace.io",
|
|
133
|
+
name: "Polygon zkEVM",
|
|
134
|
+
chainId: 1101,
|
|
135
|
+
color: "#8544f6",
|
|
136
|
+
explorerUrl: "https://zkevm.polygonscan.com",
|
|
137
|
+
apiURL: 'https://api-zkevm.polygonscan.com',
|
|
138
|
+
balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
|
|
139
|
+
usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
|
|
107
140
|
get serverRpcUrl() {
|
|
108
|
-
return process.env?.
|
|
141
|
+
return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
|
|
109
142
|
},
|
|
110
143
|
params: {
|
|
111
|
-
chainName: "
|
|
144
|
+
chainName: "polygon zkEVM",
|
|
145
|
+
rpcUrls: ["https://zkevm-rpc.com"],
|
|
112
146
|
nativeCurrency: {
|
|
113
|
-
name: "
|
|
114
|
-
symbol: "
|
|
147
|
+
name: "Ethereum",
|
|
148
|
+
symbol: "ETH",
|
|
115
149
|
decimals: 18,
|
|
116
150
|
},
|
|
117
|
-
rpcUrls: ["https://rpc.ankr.com/avalanche"],
|
|
118
151
|
},
|
|
119
152
|
},
|
|
120
153
|
{
|
|
@@ -125,6 +158,7 @@ export const networks: Network[] = [
|
|
|
125
158
|
color: "#F3BA2F",
|
|
126
159
|
chainId: 56,
|
|
127
160
|
explorerUrl: "https://bscscan.com",
|
|
161
|
+
apiURL: 'https://api.bscscan.com',
|
|
128
162
|
usdcAddress: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
|
|
129
163
|
balanceResolverAddress: "0xb808cff38706e267067b0af427726aa099f69f89",
|
|
130
164
|
get serverRpcUrl() {
|
|
@@ -140,6 +174,52 @@ export const networks: Network[] = [
|
|
|
140
174
|
},
|
|
141
175
|
},
|
|
142
176
|
},
|
|
177
|
+
{
|
|
178
|
+
name: "Avalanche",
|
|
179
|
+
debankName: "avax",
|
|
180
|
+
ankrName: "avalanche",
|
|
181
|
+
zerionName: "avalanche",
|
|
182
|
+
color: "#EB5757",
|
|
183
|
+
chainId: 43114,
|
|
184
|
+
usdcAddress: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
|
|
185
|
+
balanceResolverAddress: "0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E",
|
|
186
|
+
explorerUrl: "https://snowtrace.io",
|
|
187
|
+
apiURL: 'https://api.snowtrace.io',
|
|
188
|
+
get serverRpcUrl() {
|
|
189
|
+
return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0];
|
|
190
|
+
},
|
|
191
|
+
params: {
|
|
192
|
+
chainName: "Avalanche Network",
|
|
193
|
+
nativeCurrency: {
|
|
194
|
+
name: "Avalanche",
|
|
195
|
+
symbol: "AVAX",
|
|
196
|
+
decimals: 18,
|
|
197
|
+
},
|
|
198
|
+
rpcUrls: ["https://rpc.ankr.com/avalanche"],
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: "Fantom",
|
|
203
|
+
chainId: 250,
|
|
204
|
+
zerionName: "fantom",
|
|
205
|
+
explorerUrl: "https://ftmscan.com",
|
|
206
|
+
ankrName: "fantom",
|
|
207
|
+
color: "#1969ff",
|
|
208
|
+
get serverRpcUrl() {
|
|
209
|
+
return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0];
|
|
210
|
+
},
|
|
211
|
+
usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
|
|
212
|
+
balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
|
|
213
|
+
params: {
|
|
214
|
+
rpcUrls: ["https://rpc.ankr.com/fantom"],
|
|
215
|
+
chainName: "Fantom",
|
|
216
|
+
nativeCurrency: {
|
|
217
|
+
name: "Fantom",
|
|
218
|
+
symbol: "FTM",
|
|
219
|
+
decimals: 18,
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
},
|
|
143
223
|
{
|
|
144
224
|
name: "Gnosis",
|
|
145
225
|
debankName: "xdai",
|
|
@@ -148,6 +228,7 @@ export const networks: Network[] = [
|
|
|
148
228
|
chainId: 100,
|
|
149
229
|
balanceResolverAddress: "0xfaa244e276b1597f663975ed007ee4ff70d27849",
|
|
150
230
|
explorerUrl: "https://gnosisscan.io",
|
|
231
|
+
apiURL:'https://api.gnosisscan.io',
|
|
151
232
|
usdcAddress: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
|
|
152
233
|
get serverRpcUrl() {
|
|
153
234
|
return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0];
|
|
@@ -162,27 +243,6 @@ export const networks: Network[] = [
|
|
|
162
243
|
},
|
|
163
244
|
},
|
|
164
245
|
},
|
|
165
|
-
{
|
|
166
|
-
name: "Polygon zkEVM",
|
|
167
|
-
chainId: 1101,
|
|
168
|
-
color: "#8544f6",
|
|
169
|
-
explorerUrl: "https://zkevm.polygonscan.com",
|
|
170
|
-
balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
|
|
171
|
-
usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
|
|
172
|
-
get serverRpcUrl() {
|
|
173
|
-
return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
|
|
174
|
-
},
|
|
175
|
-
params: {
|
|
176
|
-
chainName: "polygon zkEVM",
|
|
177
|
-
rpcUrls: ["https://zkevm-rpc.com"],
|
|
178
|
-
|
|
179
|
-
nativeCurrency: {
|
|
180
|
-
name: "Ethereum",
|
|
181
|
-
symbol: "ETH",
|
|
182
|
-
decimals: 18,
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
246
|
{
|
|
187
247
|
name: "Aurora",
|
|
188
248
|
chainId: 1313161554,
|
|
@@ -204,28 +264,6 @@ export const networks: Network[] = [
|
|
|
204
264
|
},
|
|
205
265
|
},
|
|
206
266
|
},
|
|
207
|
-
{
|
|
208
|
-
name: "Fantom",
|
|
209
|
-
chainId: 250,
|
|
210
|
-
zerionName: "fantom",
|
|
211
|
-
explorerUrl: "https://ftmscan.com",
|
|
212
|
-
ankrName: "fantom",
|
|
213
|
-
color: "#1969ff",
|
|
214
|
-
get serverRpcUrl() {
|
|
215
|
-
return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0];
|
|
216
|
-
},
|
|
217
|
-
usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
|
|
218
|
-
balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
|
|
219
|
-
params: {
|
|
220
|
-
rpcUrls: ["https://rpc.ankr.com/fantom"],
|
|
221
|
-
chainName: "Fantom",
|
|
222
|
-
nativeCurrency: {
|
|
223
|
-
name: "Fantom",
|
|
224
|
-
symbol: "FTM",
|
|
225
|
-
decimals: 18,
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
267
|
{
|
|
230
268
|
name: AVO_PROD_CHAIN_NAME,
|
|
231
269
|
chainId: AVO_PROD_CHAIN_ID,
|
|
@@ -268,6 +306,22 @@ export const networks: Network[] = [
|
|
|
268
306
|
},
|
|
269
307
|
];
|
|
270
308
|
|
|
309
|
+
export const chainUsdcAddresses = [
|
|
310
|
+
{ chainId: 1, address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' },
|
|
311
|
+
{ chainId: 10, address: '0x7f5c764cbc14f9669b88837ca1490cca17c31607' },
|
|
312
|
+
{ chainId: 56, address: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d' },
|
|
313
|
+
{ chainId: 100, address: '0xddafbb505ad214d7b80b1f830fccc89b60fb7a83' },
|
|
314
|
+
{ chainId: 137, address: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174' },
|
|
315
|
+
{ chainId: 250, address: '0x04068da6c83afcfa0e13ba15a6696662335d5b75' },
|
|
316
|
+
{ chainId: 42161, address: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' },
|
|
317
|
+
{ chainId: 42161, address: '0xaf88d065e77c8cc2239327c5edb3a432268e5831' },
|
|
318
|
+
{ chainId: 43114, address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e' },
|
|
319
|
+
{ chainId: 43114, address: '0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664' },
|
|
320
|
+
{ chainId: 1101, address: '0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035' },
|
|
321
|
+
{ chainId: 1313161554, address: '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802' },
|
|
322
|
+
{ chainId: 8453, address: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA'}
|
|
323
|
+
];
|
|
324
|
+
|
|
271
325
|
export const getNetworkByChainId = (
|
|
272
326
|
chainId: ChainId | number | string
|
|
273
327
|
): Network => {
|
|
@@ -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,118 +1,133 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
+
apiURL?: string;
|
|
38
|
+
params: {
|
|
39
|
+
chainName?: string;
|
|
40
|
+
iconUrls?: string[];
|
|
41
|
+
rpcUrls: string[];
|
|
42
|
+
nativeCurrency?: {
|
|
43
|
+
name: string;
|
|
44
|
+
symbol: string;
|
|
45
|
+
decimals: number;
|
|
46
|
+
};
|
|
37
47
|
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type SignMetadataProps = {
|
|
51
|
+
token: string;
|
|
52
|
+
spender: string;
|
|
53
|
+
amount: string;
|
|
54
|
+
expiration: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
type DappMetadataProps = {
|
|
58
|
+
name: string;
|
|
59
|
+
url: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type SendMetadataProps = {
|
|
63
|
+
token: string;
|
|
64
|
+
amount: string;
|
|
65
|
+
receiver: string;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type CrossSendMetadataProps = {
|
|
69
|
+
fromToken: string;
|
|
70
|
+
toToken: string;
|
|
71
|
+
toChainId: string;
|
|
72
|
+
amount: string;
|
|
73
|
+
receiver: string;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
type AuthMetadataProps = {
|
|
77
|
+
address: string;
|
|
78
|
+
chainId: string;
|
|
79
|
+
remove: boolean;
|
|
38
80
|
};
|
|
81
|
+
|
|
82
|
+
type UpgradeMetadataProps = {
|
|
83
|
+
version: string;
|
|
84
|
+
walletImpl: string;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
type TopupMetadataProps = {
|
|
88
|
+
amount: string;
|
|
89
|
+
token: string;
|
|
90
|
+
onBehalf: string;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
type BridgeMetadataProps = {
|
|
94
|
+
amount: string;
|
|
95
|
+
receiver: string;
|
|
96
|
+
fromToken: string;
|
|
97
|
+
toToken: string;
|
|
98
|
+
toChainId: string;
|
|
99
|
+
bridgeFee: string;
|
|
100
|
+
nativeToken: string;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
type SwapMetadataProps = {
|
|
104
|
+
sellToken: string;
|
|
105
|
+
buyToken: string;
|
|
106
|
+
sellAmount: string;
|
|
107
|
+
buyAmount: string;
|
|
108
|
+
receiver: string;
|
|
109
|
+
protocol?: string;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
type MetadataProps = {
|
|
113
|
+
type: MetadataTypes,
|
|
114
|
+
encodedData: string;
|
|
115
|
+
version?: string;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
interface ITokenPrice {
|
|
119
|
+
address: string;
|
|
120
|
+
chain_id: string;
|
|
121
|
+
name: string;
|
|
122
|
+
symbol: string;
|
|
123
|
+
decimals: number;
|
|
124
|
+
logo_url: string;
|
|
125
|
+
price: string;
|
|
126
|
+
coingecko_id: string;
|
|
127
|
+
sparkline_price_7d: number[];
|
|
128
|
+
}
|
|
129
|
+
|
|
39
130
|
}
|
|
40
131
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
spender: string;
|
|
44
|
-
amount: string;
|
|
45
|
-
expiration: string;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
type DappMetadataProps = {
|
|
49
|
-
name: string;
|
|
50
|
-
url: string;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
type SendMetadataProps = {
|
|
54
|
-
token: string;
|
|
55
|
-
amount: string;
|
|
56
|
-
receiver: string;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
type CrossSendMetadataProps = {
|
|
60
|
-
fromToken: string;
|
|
61
|
-
toToken: string;
|
|
62
|
-
toChainId: string;
|
|
63
|
-
amount: string;
|
|
64
|
-
receiver: string;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
type AuthMetadataProps = {
|
|
68
|
-
address: string;
|
|
69
|
-
chainId: string;
|
|
70
|
-
remove: boolean;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
type UpgradeMetadataProps = {
|
|
74
|
-
version: string;
|
|
75
|
-
walletImpl: string;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
type TopupMetadataProps = {
|
|
79
|
-
amount: string;
|
|
80
|
-
token: string;
|
|
81
|
-
onBehalf: string;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
type BridgeMetadataProps = {
|
|
85
|
-
amount: string;
|
|
86
|
-
receiver: string;
|
|
87
|
-
fromToken: string;
|
|
88
|
-
toToken: string;
|
|
89
|
-
toChainId: string;
|
|
90
|
-
bridgeFee: string;
|
|
91
|
-
nativeToken: string;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
type SwapMetadataProps = {
|
|
95
|
-
sellToken: string;
|
|
96
|
-
buyToken: string;
|
|
97
|
-
sellAmount: string;
|
|
98
|
-
buyAmount: string;
|
|
99
|
-
receiver: string;
|
|
100
|
-
protocol?: string;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
type MetadataProps = {
|
|
104
|
-
type:
|
|
105
|
-
| "transfer"
|
|
106
|
-
| "bridge"
|
|
107
|
-
| "swap"
|
|
108
|
-
| "multi"
|
|
109
|
-
| "gas-topup"
|
|
110
|
-
| "upgrade"
|
|
111
|
-
| "dapp"
|
|
112
|
-
| "deploy"
|
|
113
|
-
| "permit2"
|
|
114
|
-
| "cross-transfer"
|
|
115
|
-
| "auth";
|
|
116
|
-
encodedData: string;
|
|
117
|
-
version?: string;
|
|
118
|
-
};
|
|
132
|
+
export { }
|
|
133
|
+
|