@instadapp/avocado-base 0.0.0-dev.02731e3 → 0.0.0-dev.08c3664
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/abi/forwarder.json +1253 -149
- 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/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 +73 -0
- package/components/ChainLogo.vue +1 -1
- package/components/metadata/Bridge.vue +39 -0
- package/components/metadata/CrossTransfer.vue +67 -0
- package/components/metadata/GasTopup.vue +33 -0
- package/components/metadata/Permit2.vue +37 -0
- package/components/metadata/Swap.vue +67 -0
- package/components/metadata/Transfer.vue +46 -0
- package/components.d.ts +13 -0
- package/contracts/Forwarder.ts +856 -2
- package/contracts/factories/Forwarder__factory.ts +816 -16
- package/nuxt.config.ts +17 -1
- package/package.json +6 -3
- package/utils/avocado.ts +2 -0
- package/utils/bignumber.ts +20 -0
- package/utils/helper.ts +7 -0
- package/utils/metadata.ts +314 -148
- package/utils/network.ts +24 -23
- package/utils/services.ts +14 -0
- package/utils/utils.d.ts +127 -107
package/utils/network.ts
CHANGED
|
@@ -4,7 +4,7 @@ export const bridgeDisabledNetworks = [1101];
|
|
|
4
4
|
|
|
5
5
|
export const networks: Network[] = [
|
|
6
6
|
{
|
|
7
|
-
name: "
|
|
7
|
+
name: "Ethereum",
|
|
8
8
|
debankName: "eth",
|
|
9
9
|
ankrName: "eth",
|
|
10
10
|
zerionName: "ethereum",
|
|
@@ -114,7 +114,7 @@ export const networks: Network[] = [
|
|
|
114
114
|
symbol: "AVAX",
|
|
115
115
|
decimals: 18,
|
|
116
116
|
},
|
|
117
|
-
rpcUrls: ["https://
|
|
117
|
+
rpcUrls: ["https://rpc.ankr.com/avalanche"],
|
|
118
118
|
},
|
|
119
119
|
},
|
|
120
120
|
{
|
|
@@ -174,7 +174,7 @@ export const networks: Network[] = [
|
|
|
174
174
|
},
|
|
175
175
|
params: {
|
|
176
176
|
chainName: "polygon zkEVM",
|
|
177
|
-
rpcUrls: ["https://rpc.
|
|
177
|
+
rpcUrls: ["https://zkevm-rpc.com"],
|
|
178
178
|
|
|
179
179
|
nativeCurrency: {
|
|
180
180
|
name: "Ethereum",
|
|
@@ -183,26 +183,27 @@ export const networks: Network[] = [
|
|
|
183
183
|
},
|
|
184
184
|
},
|
|
185
185
|
},
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
186
|
+
{
|
|
187
|
+
name: "Aurora",
|
|
188
|
+
chainId: 1313161554,
|
|
189
|
+
zerionName: "aurora",
|
|
190
|
+
color: "#78d64b",
|
|
191
|
+
explorerUrl: "https://explorer.mainnet.aurora.dev",
|
|
192
|
+
get serverRpcUrl() {
|
|
193
|
+
return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0];
|
|
194
|
+
},
|
|
195
|
+
usdcAddress: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
|
|
196
|
+
balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
|
|
197
|
+
params: {
|
|
198
|
+
rpcUrls: ["https://mainnet.aurora.dev"],
|
|
199
|
+
chainName: "Aurora",
|
|
200
|
+
nativeCurrency: {
|
|
201
|
+
decimals: 18,
|
|
202
|
+
name: "Aurora ETH",
|
|
203
|
+
symbol: "AETH",
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
},
|
|
206
207
|
{
|
|
207
208
|
name: "Fantom",
|
|
208
209
|
chainId: 250,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const fetchTokenByAddress = async (
|
|
2
|
+
address: string,
|
|
3
|
+
chainId: string | number
|
|
4
|
+
) => {
|
|
5
|
+
if (!address || !chainId) return null;
|
|
6
|
+
const [token] = (await $fetch(`${blockQueryURL}/${chainId}/tokens`, {
|
|
7
|
+
params: {
|
|
8
|
+
sparkline: false,
|
|
9
|
+
"addresses[]": [address],
|
|
10
|
+
},
|
|
11
|
+
})) as ITokenPrice[];
|
|
12
|
+
|
|
13
|
+
return token;
|
|
14
|
+
};
|
package/utils/utils.d.ts
CHANGED
|
@@ -1,111 +1,131 @@
|
|
|
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
|
+
| 63400;
|
|
15
|
+
|
|
16
|
+
type ISlackMessageType = "danger" | "error" | "success" | "banner";
|
|
17
|
+
|
|
18
|
+
type MetadataTypes = keyof typeof MetadataEnums;
|
|
19
|
+
|
|
20
|
+
type PayloadFunction = (data: any, type: MetadataTypes) => any;
|
|
21
|
+
|
|
22
|
+
type IPayload = Record<MetadataTypes, PayloadFunction>;
|
|
23
|
+
|
|
24
|
+
interface Network {
|
|
25
|
+
name: string;
|
|
26
|
+
debankName?: string;
|
|
27
|
+
ankrName?: string;
|
|
28
|
+
zerionName?: string;
|
|
29
|
+
chainId: ChainId;
|
|
30
|
+
color: string;
|
|
31
|
+
isAvocado?: boolean;
|
|
32
|
+
serverRpcUrl: string | undefined;
|
|
33
|
+
balanceResolverAddress?: string;
|
|
34
|
+
usdcAddress: string;
|
|
35
|
+
explorerUrl: string;
|
|
36
|
+
params: {
|
|
37
|
+
chainName?: string;
|
|
38
|
+
iconUrls?: string[];
|
|
39
|
+
rpcUrls: string[];
|
|
40
|
+
nativeCurrency?: {
|
|
41
|
+
name: string;
|
|
42
|
+
symbol: string;
|
|
43
|
+
decimals: number;
|
|
44
|
+
};
|
|
37
45
|
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type SignMetadataProps = {
|
|
49
|
+
token: string;
|
|
50
|
+
spender: string;
|
|
51
|
+
amount: string;
|
|
52
|
+
expiration: string;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
type DappMetadataProps = {
|
|
56
|
+
name: string;
|
|
57
|
+
url: string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
type SendMetadataProps = {
|
|
61
|
+
token: string;
|
|
62
|
+
amount: string;
|
|
63
|
+
receiver: string;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
type CrossSendMetadataProps = {
|
|
67
|
+
fromToken: string;
|
|
68
|
+
toToken: string;
|
|
69
|
+
toChainId: string;
|
|
70
|
+
amount: string;
|
|
71
|
+
receiver: string;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
type AuthMetadataProps = {
|
|
75
|
+
address: string;
|
|
76
|
+
chainId: string;
|
|
77
|
+
remove: boolean;
|
|
38
78
|
};
|
|
79
|
+
|
|
80
|
+
type UpgradeMetadataProps = {
|
|
81
|
+
version: string;
|
|
82
|
+
walletImpl: string;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
type TopupMetadataProps = {
|
|
86
|
+
amount: string;
|
|
87
|
+
token: string;
|
|
88
|
+
onBehalf: string;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
type BridgeMetadataProps = {
|
|
92
|
+
amount: string;
|
|
93
|
+
receiver: string;
|
|
94
|
+
fromToken: string;
|
|
95
|
+
toToken: string;
|
|
96
|
+
toChainId: string;
|
|
97
|
+
bridgeFee: string;
|
|
98
|
+
nativeToken: string;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
type SwapMetadataProps = {
|
|
102
|
+
sellToken: string;
|
|
103
|
+
buyToken: string;
|
|
104
|
+
sellAmount: string;
|
|
105
|
+
buyAmount: string;
|
|
106
|
+
receiver: string;
|
|
107
|
+
protocol?: string;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
type MetadataProps = {
|
|
111
|
+
type: MetadataTypes,
|
|
112
|
+
encodedData: string;
|
|
113
|
+
version?: string;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
interface ITokenPrice {
|
|
117
|
+
address: string;
|
|
118
|
+
chain_id: string;
|
|
119
|
+
name: string;
|
|
120
|
+
symbol: string;
|
|
121
|
+
decimals: number;
|
|
122
|
+
logo_url: string;
|
|
123
|
+
price: string;
|
|
124
|
+
coingecko_id: string;
|
|
125
|
+
sparkline_price_7d: number[];
|
|
126
|
+
}
|
|
127
|
+
|
|
39
128
|
}
|
|
40
129
|
|
|
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 UpgradeMetadataProps = {
|
|
68
|
-
version: string;
|
|
69
|
-
walletImpl: string;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
type TopupMetadataProps = {
|
|
73
|
-
amount: string;
|
|
74
|
-
token: string;
|
|
75
|
-
onBehalf: string;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
type BridgeMetadataProps = {
|
|
79
|
-
amount: string;
|
|
80
|
-
receiver: string;
|
|
81
|
-
fromToken: string;
|
|
82
|
-
toToken: string;
|
|
83
|
-
toChainId: string;
|
|
84
|
-
bridgeFee: string;
|
|
85
|
-
nativeToken: string;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
type SwapMetadataProps = {
|
|
89
|
-
sellToken: string;
|
|
90
|
-
buyToken: string;
|
|
91
|
-
sellAmount: string;
|
|
92
|
-
buyAmount: string;
|
|
93
|
-
receiver: string;
|
|
94
|
-
protocol?: string;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
type MetadataProps = {
|
|
98
|
-
type:
|
|
99
|
-
| "transfer"
|
|
100
|
-
| "bridge"
|
|
101
|
-
| "swap"
|
|
102
|
-
| "multi"
|
|
103
|
-
| "gas-topup"
|
|
104
|
-
| "upgrade"
|
|
105
|
-
| "dapp"
|
|
106
|
-
| "deploy"
|
|
107
|
-
| "permit2"
|
|
108
|
-
| "cross-transfer";
|
|
109
|
-
encodedData: string;
|
|
110
|
-
version?: string;
|
|
111
|
-
};
|
|
130
|
+
export { }
|
|
131
|
+
|