@instadapp/avocado-base 0.0.80 → 0.0.82
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/package.json +1 -1
- package/utils/metadata.ts +25 -0
- package/utils/network.ts +66 -0
- package/utils/utils.d.ts +4 -1
package/package.json
CHANGED
package/utils/metadata.ts
CHANGED
|
@@ -20,6 +20,7 @@ export const MetadataEnums = {
|
|
|
20
20
|
"change-threshold": "change-threshold",
|
|
21
21
|
import: "import",
|
|
22
22
|
"tx-builder": "tx-builder",
|
|
23
|
+
"avocado-bridge": "avocado-bridge",
|
|
23
24
|
} as const;
|
|
24
25
|
|
|
25
26
|
const multiMetadataTypes = ["bytes[]"];
|
|
@@ -70,6 +71,7 @@ const actionMetadataTypes: Record<MetadataTypes, string[]> = {
|
|
|
70
71
|
"remove-signers": ["address[] signers"],
|
|
71
72
|
"change-threshold": ["uint8 count"],
|
|
72
73
|
rejection: ["bytes32 id"],
|
|
74
|
+
"avocado-bridge": ["bytes32 id", "uint256 toChainId"],
|
|
73
75
|
};
|
|
74
76
|
|
|
75
77
|
const encodeMetadata = (props: MetadataProps) => {
|
|
@@ -97,6 +99,24 @@ export const encodeDappMetadata = (
|
|
|
97
99
|
return single ? encodeMultipleActions(data) : data;
|
|
98
100
|
};
|
|
99
101
|
|
|
102
|
+
export const encodeAvocadoBridgeMetadata = (
|
|
103
|
+
id: string,
|
|
104
|
+
toChainId: string | number,
|
|
105
|
+
single = true
|
|
106
|
+
) => {
|
|
107
|
+
const encodedData = ethers.utils.defaultAbiCoder.encode(
|
|
108
|
+
actionMetadataTypes["avocado-bridge"],
|
|
109
|
+
[id, toChainId]
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
const data = encodeMetadata({
|
|
113
|
+
type: MetadataEnums["avocado-bridge"],
|
|
114
|
+
encodedData,
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
return single ? encodeMultipleActions(data) : data;
|
|
118
|
+
};
|
|
119
|
+
|
|
100
120
|
export const encodeTransferMetadata = (
|
|
101
121
|
params: SendMetadataProps,
|
|
102
122
|
single = true
|
|
@@ -521,6 +541,11 @@ const typesPayload: IPayload = {
|
|
|
521
541
|
type,
|
|
522
542
|
count: data.count,
|
|
523
543
|
}),
|
|
544
|
+
"avocado-bridge": (data, type) => ({
|
|
545
|
+
type,
|
|
546
|
+
id: data.id,
|
|
547
|
+
toChainId: data.toChainId ? data.toChainId.toString() : null,
|
|
548
|
+
}),
|
|
524
549
|
};
|
|
525
550
|
|
|
526
551
|
const parseMetadata = (metadata: string) => {
|
package/utils/network.ts
CHANGED
|
@@ -26,6 +26,8 @@ export const networks: Network[] = [
|
|
|
26
26
|
usdcAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
|
27
27
|
explorerUrl: "https://polygonscan.com",
|
|
28
28
|
apiURL: "https://api.polygonscan.com",
|
|
29
|
+
fakeTransactionHash:
|
|
30
|
+
"0xf6c89fd5df9abaf04723b7fb05ed8476f69107ea038975285076fc42e9a8a0f1",
|
|
29
31
|
get serverRpcUrl() {
|
|
30
32
|
return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0];
|
|
31
33
|
},
|
|
@@ -48,6 +50,8 @@ export const networks: Network[] = [
|
|
|
48
50
|
chainId: 42161,
|
|
49
51
|
usdcAddress: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
|
|
50
52
|
balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
|
|
53
|
+
fakeTransactionHash:
|
|
54
|
+
"0x9fa291c3b09d31f19b1fa5dd05f30169d1364036d5f7c14b026410bc07bd8843",
|
|
51
55
|
explorerUrl: "https://arbiscan.io",
|
|
52
56
|
apiURL: "https://api.arbiscan.io",
|
|
53
57
|
get serverRpcUrl() {
|
|
@@ -70,6 +74,8 @@ export const networks: Network[] = [
|
|
|
70
74
|
zerionName: "ethereum",
|
|
71
75
|
chainId: 1,
|
|
72
76
|
explorerUrl: "https://etherscan.io",
|
|
77
|
+
fakeTransactionHash:
|
|
78
|
+
"0x13232dd32cef2f641ead890a507710c96560c8c9c3d5fab6facb5ec563c49433",
|
|
73
79
|
apiURL: "https://api.etherscan.io",
|
|
74
80
|
color: "#5D5FEF",
|
|
75
81
|
get serverRpcUrl() {
|
|
@@ -92,6 +98,8 @@ export const networks: Network[] = [
|
|
|
92
98
|
color: "#1E2024",
|
|
93
99
|
ankrName: "base",
|
|
94
100
|
explorerUrl: "https://basescan.org",
|
|
101
|
+
fakeTransactionHash:
|
|
102
|
+
"0xf7833d80da33730c4fc5d4c64151f0eaa64c0c0535be022af0228a44cc4e9c8e",
|
|
95
103
|
apiURL: "https://api.basescan.org",
|
|
96
104
|
get serverRpcUrl() {
|
|
97
105
|
return process.env?.BASE_RPC_URL || this.params.rpcUrls[0];
|
|
@@ -118,6 +126,8 @@ export const networks: Network[] = [
|
|
|
118
126
|
apiURL: "https://api-optimistic.etherscan.io",
|
|
119
127
|
usdcAddress: "0x7f5c764cbc14f9669b88837ca1490cca17c31607",
|
|
120
128
|
balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
|
|
129
|
+
fakeTransactionHash:
|
|
130
|
+
"0xee7311d68059732b05088f2144dfec6c7a4f5fd0433eb85306afcd6bdf17cebc",
|
|
121
131
|
explorerUrl: "https://optimistic.etherscan.io",
|
|
122
132
|
get serverRpcUrl() {
|
|
123
133
|
return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0];
|
|
@@ -140,6 +150,8 @@ export const networks: Network[] = [
|
|
|
140
150
|
explorerUrl: "https://zkevm.polygonscan.com",
|
|
141
151
|
apiURL: "https://api-zkevm.polygonscan.com",
|
|
142
152
|
balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
|
|
153
|
+
fakeTransactionHash:
|
|
154
|
+
"0x1077130463ade91ad4e9c43c3195298e26a99970975238128912490eea12bf41",
|
|
143
155
|
usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
|
|
144
156
|
get serverRpcUrl() {
|
|
145
157
|
return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
|
|
@@ -162,6 +174,8 @@ export const networks: Network[] = [
|
|
|
162
174
|
color: "#F3BA2F",
|
|
163
175
|
chainId: 56,
|
|
164
176
|
explorerUrl: "https://bscscan.com",
|
|
177
|
+
fakeTransactionHash:
|
|
178
|
+
"0x897d54bf8e492f840bd4d8f1e743bfcab8226ab4d5a899e47ee433dcd6d6abf7",
|
|
165
179
|
apiURL: "https://api.bscscan.com",
|
|
166
180
|
usdcAddress: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
|
|
167
181
|
balanceResolverAddress: "0xb808cff38706e267067b0af427726aa099f69f89",
|
|
@@ -188,6 +202,8 @@ export const networks: Network[] = [
|
|
|
188
202
|
usdcAddress: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
|
|
189
203
|
balanceResolverAddress: "0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E",
|
|
190
204
|
explorerUrl: "https://snowtrace.io",
|
|
205
|
+
fakeTransactionHash:
|
|
206
|
+
"0x233aac7402558dd4e23f938a50f983e67f5c9604233981c7ac74e63737b8294e",
|
|
191
207
|
apiURL: "https://api.snowtrace.io",
|
|
192
208
|
get serverRpcUrl() {
|
|
193
209
|
return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0];
|
|
@@ -214,6 +230,8 @@ export const networks: Network[] = [
|
|
|
214
230
|
},
|
|
215
231
|
usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
|
|
216
232
|
balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
|
|
233
|
+
fakeTransactionHash:
|
|
234
|
+
"0x1e9a8405d660172314124e06896212c0786d7fb1550b89410d4bc87e9e8054e4",
|
|
217
235
|
params: {
|
|
218
236
|
rpcUrls: ["https://rpc.ankr.com/fantom"],
|
|
219
237
|
chainName: "Fantom",
|
|
@@ -233,6 +251,8 @@ export const networks: Network[] = [
|
|
|
233
251
|
chainId: 100,
|
|
234
252
|
balanceResolverAddress: "0xfaa244e276b1597f663975ed007ee4ff70d27849",
|
|
235
253
|
explorerUrl: "https://gnosisscan.io",
|
|
254
|
+
fakeTransactionHash:
|
|
255
|
+
"0x1513033806310a2c3b29f2276f8aa7388461b0ef9f8499c297e68c12187c179b",
|
|
236
256
|
apiURL: "https://api.gnosisscan.io",
|
|
237
257
|
usdcAddress: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
|
|
238
258
|
get serverRpcUrl() {
|
|
@@ -254,6 +274,8 @@ export const networks: Network[] = [
|
|
|
254
274
|
zerionName: "aurora",
|
|
255
275
|
color: "#78d64b",
|
|
256
276
|
explorerUrl: "https://explorer.mainnet.aurora.dev",
|
|
277
|
+
fakeTransactionHash:
|
|
278
|
+
"0x0923401c5a80c39a5cd57c098a6c4729edbefd0db6894def7d349493f4ff3ec6",
|
|
257
279
|
get serverRpcUrl() {
|
|
258
280
|
return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0];
|
|
259
281
|
},
|
|
@@ -275,6 +297,8 @@ export const networks: Network[] = [
|
|
|
275
297
|
zerionName: "fuse",
|
|
276
298
|
color: "#78d64b",
|
|
277
299
|
explorerUrl: "https://explorer.fuse.io",
|
|
300
|
+
fakeTransactionHash:
|
|
301
|
+
"0xf22a8031de9b978a57c728e18c6b54633356c39db4d0466e53b9b7c3ee7f8def",
|
|
278
302
|
get serverRpcUrl() {
|
|
279
303
|
return process.env?.FUSE_RPC_URL || this.params.rpcUrls[0];
|
|
280
304
|
},
|
|
@@ -290,11 +314,52 @@ export const networks: Network[] = [
|
|
|
290
314
|
},
|
|
291
315
|
},
|
|
292
316
|
},
|
|
317
|
+
// {
|
|
318
|
+
// name: "Scroll",
|
|
319
|
+
// chainId: 534352,
|
|
320
|
+
// color: "#78d64b",
|
|
321
|
+
// explorerUrl: "https://scrollscan.com",
|
|
322
|
+
// fakeTransactionHash:
|
|
323
|
+
// "0x6bf297c414264fc8cddd47224632b4426a02138df2f50fe891eca87f6aefea01",
|
|
324
|
+
// get serverRpcUrl() {
|
|
325
|
+
// return process.env?.SCROLL_RPC_URL || this.params.rpcUrls[0];
|
|
326
|
+
// },
|
|
327
|
+
// params: {
|
|
328
|
+
// rpcUrls: ["https://rpc.scroll.io"],
|
|
329
|
+
// chainName: "Scroll",
|
|
330
|
+
// nativeCurrency: {
|
|
331
|
+
// name: "Ethereum",
|
|
332
|
+
// symbol: "ETH",
|
|
333
|
+
// decimals: 18,
|
|
334
|
+
// },
|
|
335
|
+
// },
|
|
336
|
+
// },
|
|
337
|
+
// {
|
|
338
|
+
// name: "opBNB",
|
|
339
|
+
// chainId: 204,
|
|
340
|
+
// color: "#78d64b",
|
|
341
|
+
// explorerUrl: "https://opbnbscan.com",
|
|
342
|
+
// fakeTransactionHash:
|
|
343
|
+
// "0xb9438a3eae61442bc7d419d79930370ce09ac0f46e0695025751e3bfe1a931e7",
|
|
344
|
+
// get serverRpcUrl() {
|
|
345
|
+
// return process.env?.OPBNB_RPC_URL || this.params.rpcUrls[0];
|
|
346
|
+
// },
|
|
347
|
+
// params: {
|
|
348
|
+
// rpcUrls: ["https://opbnb-mainnet-rpc.bnbchain.org"],
|
|
349
|
+
// chainName: "opBNB",
|
|
350
|
+
// nativeCurrency: {
|
|
351
|
+
// name: "BNB",
|
|
352
|
+
// symbol: "BNB",
|
|
353
|
+
// decimals: 18,
|
|
354
|
+
// },
|
|
355
|
+
// },
|
|
356
|
+
// },
|
|
293
357
|
{
|
|
294
358
|
name: AVO_PROD_CHAIN_NAME,
|
|
295
359
|
chainId: AVO_PROD_CHAIN_ID,
|
|
296
360
|
isAvocado: true,
|
|
297
361
|
balanceResolverAddress: "",
|
|
362
|
+
fakeTransactionHash: "",
|
|
298
363
|
color: "#16A34A",
|
|
299
364
|
usdcAddress: "",
|
|
300
365
|
serverRpcUrl: AVO_PROD_RPC_URL,
|
|
@@ -316,6 +381,7 @@ export const networks: Network[] = [
|
|
|
316
381
|
serverRpcUrl: AVO_STAGING_RPC_URL,
|
|
317
382
|
color: "#16A34A",
|
|
318
383
|
explorerUrl: AVO_STAGING_EXPLORER_URL,
|
|
384
|
+
fakeTransactionHash: "",
|
|
319
385
|
isAvocado: true,
|
|
320
386
|
balanceResolverAddress: "",
|
|
321
387
|
usdcAddress: "",
|
package/utils/utils.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ declare global {
|
|
|
13
13
|
| 1313161554
|
|
14
14
|
| 8453
|
|
15
15
|
| 122
|
|
16
|
+
| 534352
|
|
17
|
+
| 204
|
|
16
18
|
| 63400;
|
|
17
19
|
|
|
18
20
|
type ISlackMessageType = "danger" | "error" | "success" | "banner";
|
|
@@ -33,8 +35,9 @@ declare global {
|
|
|
33
35
|
isAvocado?: boolean;
|
|
34
36
|
serverRpcUrl: string | undefined;
|
|
35
37
|
balanceResolverAddress?: string;
|
|
36
|
-
usdcAddress
|
|
38
|
+
usdcAddress?: string;
|
|
37
39
|
explorerUrl: string;
|
|
40
|
+
fakeTransactionHash: string;
|
|
38
41
|
apiURL?: string;
|
|
39
42
|
params: {
|
|
40
43
|
chainName?: string;
|