@hinkal/common 0.0.113 → 0.0.115
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/assets/{snarkjsWorkerLauncher-fuD5h_j0.js → snarkjsWorkerLauncher-CaBCnle3.js} +283 -257
- package/assets/snarkjsWorkerLogic-BAbiO5gj.js +17935 -0
- package/assets/snarkjsWorkerLogic-wHJfYCfg.js +15636 -0
- package/assets/{utxoWorkerLogic-CtFLQiAX.js → utxoWorkerLogic-BGFm-Zl2.js} +2 -2
- package/assets/{zkProofWorkerLauncher-J3Ts5_Ba.js → zkProofWorkerLauncher-BteYxRBn.js} +1 -1
- package/assets/{zkProofWorkerLogic-CPNuu61R.js → zkProofWorkerLogic-DiLbAhAo.js} +8354 -8298
- package/common.mjs +644 -0
- package/common10.mjs +30 -0
- package/common100.mjs +156 -0
- package/common101.mjs +568 -0
- package/common102.mjs +1603 -0
- package/common103.mjs +1764 -0
- package/common104.mjs +2030 -0
- package/common105.mjs +701 -0
- package/common106.mjs +480 -0
- package/common107.mjs +2082 -0
- package/common108.mjs +39 -0
- package/common109.mjs +24 -0
- package/common11.mjs +30 -0
- package/common110.mjs +41 -0
- package/common111.mjs +206 -0
- package/common112.mjs +48 -0
- package/common113.mjs +39 -0
- package/common114.mjs +70 -0
- package/common115.mjs +67 -0
- package/common116.mjs +5 -0
- package/common117.mjs +61 -0
- package/common118.mjs +20 -0
- package/common119.mjs +7 -0
- package/common12.mjs +58 -0
- package/common120.mjs +22 -0
- package/common121.mjs +16 -0
- package/common122.mjs +57 -0
- package/common123.mjs +45 -0
- package/common124.mjs +57 -0
- package/common125.mjs +229 -0
- package/common126.mjs +203 -0
- package/common127.mjs +29 -0
- package/common128.mjs +38 -0
- package/common129.mjs +15 -0
- package/common13.mjs +156 -0
- package/common130.mjs +105 -0
- package/common131.mjs +4 -0
- package/common132.mjs +14 -0
- package/common133.mjs +7 -0
- package/common134.mjs +6 -0
- package/common135.mjs +8 -0
- package/common136.mjs +40 -0
- package/common137.mjs +41 -0
- package/common138.mjs +72 -0
- package/common139.mjs +107 -0
- package/common14.mjs +32 -0
- package/common140.mjs +9 -0
- package/common141.mjs +10 -0
- package/common142.mjs +97 -0
- package/common143.mjs +65 -0
- package/common144.mjs +61 -0
- package/common145.mjs +95 -0
- package/common146.mjs +129 -0
- package/common147.mjs +105 -0
- package/common148.mjs +96 -0
- package/common149.mjs +18 -0
- package/common15.mjs +16 -0
- package/common150.mjs +45 -0
- package/common151.mjs +41 -0
- package/common152.mjs +108 -0
- package/common153.mjs +40 -0
- package/common154.mjs +19 -0
- package/common155.mjs +24 -0
- package/common156.mjs +21 -0
- package/common157.mjs +22 -0
- package/common158.mjs +4 -0
- package/common159.mjs +4 -0
- package/common16.mjs +6 -0
- package/common160.mjs +15 -0
- package/common161.mjs +13 -0
- package/common162.mjs +4 -0
- package/common163.mjs +15 -0
- package/common164.mjs +36 -0
- package/common165.mjs +58 -0
- package/common166.mjs +27 -0
- package/common167.mjs +15 -0
- package/common168.mjs +25 -0
- package/common169.mjs +4 -0
- package/common17.mjs +6877 -0
- package/common170.mjs +85 -0
- package/common171.mjs +2251 -0
- package/common172.mjs +856 -0
- package/common173.mjs +973 -0
- package/common174.mjs +1255 -0
- package/common175.mjs +591 -0
- package/common176.mjs +1392 -0
- package/common177.mjs +463 -0
- package/common178.mjs +137 -0
- package/common179.mjs +2700 -0
- package/common18.mjs +7415 -0
- package/common180.mjs +946 -0
- package/common181.mjs +973 -0
- package/common182.mjs +1327 -0
- package/common183.mjs +591 -0
- package/common184.mjs +1455 -0
- package/common185.mjs +490 -0
- package/common186.mjs +137 -0
- package/common187.mjs +2768 -0
- package/common188.mjs +8 -0
- package/common189.mjs +14 -0
- package/common19.mjs +11427 -0
- package/common190.mjs +115623 -0
- package/common191.mjs +42 -0
- package/common192.mjs +1022 -0
- package/common193.mjs +1423 -0
- package/common194.mjs +208 -0
- package/common195.mjs +340 -0
- package/common196.mjs +674 -0
- package/common197.mjs +1002 -0
- package/common198.mjs +883 -0
- package/common199.mjs +262 -0
- package/common2.mjs +67 -0
- package/common20.mjs +7417 -0
- package/common200.mjs +264 -0
- package/common201.mjs +173 -0
- package/common202.mjs +999 -0
- package/common203.mjs +80 -0
- package/common204.mjs +56 -0
- package/common205.mjs +42 -0
- package/common206.mjs +14 -0
- package/common207.mjs +4 -0
- package/common208.mjs +62 -0
- package/common209.mjs +4 -0
- package/common21.mjs +7439 -0
- package/common210.mjs +4 -0
- package/common211.mjs +58 -0
- package/common212.mjs +40 -0
- package/common213.mjs +45 -0
- package/common214.mjs +36 -0
- package/common215.mjs +32 -0
- package/common216.mjs +44 -0
- package/common217.mjs +32 -0
- package/common218.mjs +38 -0
- package/common219.mjs +9 -0
- package/common22.mjs +7411 -0
- package/common220.mjs +32 -0
- package/common221.mjs +47 -0
- package/common222.mjs +14 -0
- package/common223.mjs +30 -0
- package/common224.mjs +91 -0
- package/common225.mjs +112 -0
- package/common226.mjs +96 -0
- package/common227.mjs +30 -0
- package/common228.mjs +138 -0
- package/common229.mjs +18 -0
- package/common23.mjs +8425 -0
- package/common230.mjs +42 -0
- package/common231.mjs +60 -0
- package/common232.mjs +48 -0
- package/common233.mjs +47 -0
- package/common234.mjs +44 -0
- package/common235.mjs +74 -0
- package/common236.mjs +4 -0
- package/common237.mjs +60 -0
- package/common238.mjs +4 -0
- package/common239.mjs +30 -0
- package/common24.mjs +9600 -0
- package/common240.mjs +4 -0
- package/common241.mjs +153 -0
- package/common242.mjs +31 -0
- package/common243.mjs +30 -0
- package/common244.mjs +68 -0
- package/common245.mjs +57 -0
- package/common246.mjs +97 -0
- package/common247.mjs +36 -0
- package/common248.mjs +43 -0
- package/common249.mjs +44 -0
- package/common25.mjs +13283 -0
- package/common250.mjs +59 -0
- package/common251.mjs +75 -0
- package/{snarkjsWorkerLogic-CVna_BW9.mjs → common252.mjs} +1 -1
- package/common253.mjs +66 -0
- package/common254.mjs +70 -0
- package/common255.mjs +211 -0
- package/common256.mjs +8 -0
- package/{workerProxy-BDj498Ht.mjs → common257.mjs} +1 -1
- package/common26.mjs +4329 -0
- package/common27.mjs +4329 -0
- package/common28.mjs +204 -0
- package/common29.mjs +57 -0
- package/common3.mjs +27 -0
- package/common30.mjs +276 -0
- package/common31.mjs +118 -0
- package/common32.mjs +157 -0
- package/common33.mjs +29 -0
- package/common34.mjs +26 -0
- package/common35.mjs +53 -0
- package/common36.mjs +55 -0
- package/common37.mjs +18 -0
- package/common38.mjs +636 -0
- package/common39.mjs +24 -0
- package/common4.mjs +37 -0
- package/common40.mjs +13 -0
- package/common41.mjs +27 -0
- package/common42.mjs +15 -0
- package/common43.mjs +24 -0
- package/common44.mjs +253 -0
- package/common45.mjs +26 -0
- package/common46.mjs +15 -0
- package/common47.mjs +9 -0
- package/common48.mjs +25 -0
- package/common49.mjs +40 -0
- package/common5.mjs +37 -0
- package/common50.mjs +41 -0
- package/common51.mjs +90 -0
- package/common52.mjs +10 -0
- package/common53.mjs +299 -0
- package/common54.mjs +101 -0
- package/common55.mjs +83 -0
- package/common56.mjs +112 -0
- package/common57.mjs +140 -0
- package/common58.mjs +95 -0
- package/common59.mjs +98 -0
- package/common6.mjs +32 -0
- package/common60.mjs +5 -0
- package/common61.mjs +91 -0
- package/common62.mjs +66 -0
- package/common63.mjs +49 -0
- package/common64.mjs +177 -0
- package/common65.mjs +8 -0
- package/common66.mjs +131 -0
- package/common67.mjs +132 -0
- package/common68.mjs +59 -0
- package/common69.mjs +35 -0
- package/common7.mjs +37 -0
- package/common70.mjs +118 -0
- package/common71.mjs +134 -0
- package/common72.mjs +33 -0
- package/common73.mjs +29 -0
- package/common74.mjs +218 -0
- package/common75.mjs +194 -0
- package/common76.mjs +62 -0
- package/common77.mjs +181 -0
- package/common78.mjs +83 -0
- package/common79.mjs +9 -0
- package/common8.mjs +38 -0
- package/common80.mjs +21 -0
- package/common81.mjs +184 -0
- package/common82.mjs +53 -0
- package/common83.mjs +35 -0
- package/common84.mjs +7 -0
- package/common85.mjs +4 -0
- package/common86.mjs +350 -0
- package/common87.mjs +570 -0
- package/common88.mjs +519 -0
- package/common89.mjs +1422 -0
- package/common9.mjs +41 -0
- package/common90.mjs +1136 -0
- package/common91.mjs +334 -0
- package/common92.mjs +291 -0
- package/common93.mjs +205 -0
- package/common94.mjs +201 -0
- package/common95.mjs +89 -0
- package/common96.mjs +721 -0
- package/common97.mjs +346 -0
- package/common98.mjs +542 -0
- package/common99.mjs +393 -0
- package/package.json +4 -4
- package/assets/snarkjsWorkerLogic-B6N4z_eM.js +0 -12136
- package/assets/snarkjsWorkerLogic-Fv0M38Mc.js +0 -12087
- package/index-DXElTGy9.mjs +0 -254449
- package/index.js +0 -457
- package/utxoWorkerLogic-B1Hh-bq4.mjs +0 -64
- package/zkProofWorkerLogic-D9rxuuiK.mjs +0 -60
package/common148.mjs
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ethers as i } from "ethers";
|
|
2
|
+
import { CIRCOM_P as u } from "./common34.mjs";
|
|
3
|
+
import { UserKeys as g } from "./common51.mjs";
|
|
4
|
+
import { encryptUtxo as h } from "./common50.mjs";
|
|
5
|
+
import { defaultHookData as S } from "./common157.mjs";
|
|
6
|
+
import { getExternalActionIdHash as m } from "./common117.mjs";
|
|
7
|
+
const k = (t, e) => t.map((r, n) => r.map((s) => e[n] ? "0" : s.getNullifier())), B = (t, e) => t.map((r, n) => r.map((s) => e[n] ? "0" : s.getCommitment())), y = (t, e, r = !1) => {
|
|
8
|
+
const n = [];
|
|
9
|
+
for (let s = 0; s < t.length; s += 1) {
|
|
10
|
+
let o = 0n, l = 0n;
|
|
11
|
+
for (let a = 0; a < t[s].length; a += 1)
|
|
12
|
+
o += t[s][a].amount;
|
|
13
|
+
for (let a = 0; a < e[s].length; a += 1)
|
|
14
|
+
l += e[s][a].amount;
|
|
15
|
+
l - o < 0 ? r ? n.push(l - o) : n.push(u + (l - o)) : n.push(l - o);
|
|
16
|
+
}
|
|
17
|
+
return n;
|
|
18
|
+
}, O = (t, e) => {
|
|
19
|
+
const r = [[""]];
|
|
20
|
+
for (let n = 0; n < t.length; n += 1)
|
|
21
|
+
n > 0 && r.push([""]), t[n].forEach((s, o) => {
|
|
22
|
+
r[n][o] = `0x${Buffer.from(h(s, e)).toString("hex")}`;
|
|
23
|
+
});
|
|
24
|
+
return r;
|
|
25
|
+
}, T = (t, e) => {
|
|
26
|
+
const r = [];
|
|
27
|
+
for (let s = 0; s < t.length; s += 1) {
|
|
28
|
+
r.push([]);
|
|
29
|
+
for (let o = 0; o < t[s].length; o += 1)
|
|
30
|
+
r[s][o] = e.getSiblingHashesForVerification(BigInt(t[s][o].getCommitment())).map((l) => l.toString());
|
|
31
|
+
}
|
|
32
|
+
const n = [];
|
|
33
|
+
for (let s = 0; s < t.length; s += 1) {
|
|
34
|
+
n.push([]);
|
|
35
|
+
for (let o = 0; o < t[s].length; o += 1)
|
|
36
|
+
n[s][o] = e.getSiblingSides(BigInt(t[s][o].getCommitment())).map((l) => l.toString());
|
|
37
|
+
}
|
|
38
|
+
return { inCommitmentSiblings: r, inCommitmentSiblingSides: n };
|
|
39
|
+
}, j = (t, e) => {
|
|
40
|
+
const r = e.getSiblingHashesForVerification(BigInt(t.getAccessKey())).map((s) => s.toString()), n = e.getSiblingSides(BigInt(t.getAccessKey())).map((s) => s.toString());
|
|
41
|
+
return { accessTokenSiblings: r, accessTokenSiblingSides: n };
|
|
42
|
+
}, E = (t) => {
|
|
43
|
+
const e = { ...t };
|
|
44
|
+
return e.amountChanges = t.amountChanges.map((r) => r.toString()), e.calldataHash = t.calldataHash.toString(), e.rootHashAccessToken = t.rootHashAccessToken?.toString(), e.stealthAddressStructure.extraRandomization = t.stealthAddressStructure.extraRandomization.toString(), e.stealthAddressStructure.stealthAddress = t.stealthAddressStructure.stealthAddress.toString(), e.stealthAddressStructure.H0 = t.stealthAddressStructure.H0.toString(), e.stealthAddressStructure.H1 = t.stealthAddressStructure.H1.toString(), e.rootHashHinkal = t.rootHashHinkal?.toString(), e.externalActionId = t.externalActionId?.toString(), e.flatFees = t.flatFees.map((r) => r.toString()), e;
|
|
45
|
+
}, F = (t) => {
|
|
46
|
+
const e = { ...t };
|
|
47
|
+
return e.amountChanges = t.amountChanges.map((r) => BigInt(r)), e.calldataHash = BigInt(t.calldataHash), e.rootHashAccessToken = BigInt(t.rootHashAccessToken), e.rootHashHinkal = BigInt(t.rootHashHinkal), e.externalActionId = BigInt(t.externalActionId), e;
|
|
48
|
+
}, M = (t, e, r, n, s, o, l, a) => {
|
|
49
|
+
const d = Object.values(a || S), c = i.utils.defaultAbiCoder.encode(
|
|
50
|
+
[
|
|
51
|
+
"uint16",
|
|
52
|
+
"address",
|
|
53
|
+
"address",
|
|
54
|
+
"uint256",
|
|
55
|
+
"bytes",
|
|
56
|
+
"tuple(address, address, bytes, bytes)",
|
|
57
|
+
"bytes[][]",
|
|
58
|
+
"uint256[]"
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
t,
|
|
62
|
+
e,
|
|
63
|
+
r,
|
|
64
|
+
typeof n == "bigint" ? n : m(n),
|
|
65
|
+
s,
|
|
66
|
+
d,
|
|
67
|
+
o,
|
|
68
|
+
l
|
|
69
|
+
]
|
|
70
|
+
);
|
|
71
|
+
return BigInt(i.utils.keccak256(c)) % u;
|
|
72
|
+
}, f = (t) => t.startsWith("swapperMO") || t.startsWith("swapperME") ? 2 : t.startsWith("swapperMW") ? 1 : 0, W = (t, e, r, n, s, o) => {
|
|
73
|
+
const l = f(t);
|
|
74
|
+
return 9 + e.length + r.length + n.flat().length + s.length + l + o;
|
|
75
|
+
}, w = (t, e) => {
|
|
76
|
+
const { h0: r, h1: n } = g.getStealthAddressCompressedPoints(t, e), s = BigInt(g.getStealthAddress(t, e));
|
|
77
|
+
return {
|
|
78
|
+
extraRandomization: t,
|
|
79
|
+
H0: r,
|
|
80
|
+
H1: n,
|
|
81
|
+
stealthAddress: s
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
k as buildInNullifiers,
|
|
86
|
+
B as buildOutCommitments,
|
|
87
|
+
j as calcAccessTokenSiblingsAndSides,
|
|
88
|
+
y as calcAmountChanges,
|
|
89
|
+
T as calcCommitmentsSiblingAndSides,
|
|
90
|
+
O as calcEncryptedOutputs,
|
|
91
|
+
W as calcPublicSignalCount,
|
|
92
|
+
w as calcStealthAddressStructure,
|
|
93
|
+
M as createCallDataHash,
|
|
94
|
+
F as deserializeCircomData,
|
|
95
|
+
E as serializeCircomData
|
|
96
|
+
};
|
package/common149.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { performTaskWithWorker as p } from "./common208.mjs";
|
|
2
|
+
import { SnarkJSWorkerActionType as i } from "./common238.mjs";
|
|
3
|
+
import { WorkerVariant as c } from "./common209.mjs";
|
|
4
|
+
import { getZKeyFile as r, getWASMFile as g } from "./common239.mjs";
|
|
5
|
+
const S = async (o, t, e) => {
|
|
6
|
+
console.log("Zero Knowledge proof construction started, please wait...", r(t, o));
|
|
7
|
+
const a = g(t, o), n = r(t, o), { publicSignals: l, zkCallData: s } = await p({
|
|
8
|
+
type: c.SnarkJS,
|
|
9
|
+
payload: {
|
|
10
|
+
type: i.FULL_PROVE,
|
|
11
|
+
data: { input: e, chainId: o, wasmFilePath: a, zKeyFilePath: n }
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
return console.log("Zero Knowledge proof construction finished "), { zkCallData: s, publicSignals: l };
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
S as generateZkProof
|
|
18
|
+
};
|
package/common15.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const s = "https://hinkal-s3-assets.s3.us-west-1.amazonaws.com/assets/", g = {
|
|
2
|
+
CHEVRON: `${s}Chevron.svg`,
|
|
3
|
+
MOON: `${s}Moon.svg`,
|
|
4
|
+
SUN: `${s}Sun.svg`,
|
|
5
|
+
ARROW_LEFT: `${s}ArrowLeft.svg`,
|
|
6
|
+
AUTHENTO_LIGHT: `${s}AuthentoLogoLight.png`,
|
|
7
|
+
AUTHENTO_DARK: `${s}AuthentoLogoDark.png`,
|
|
8
|
+
KING: `${s}King.svg`,
|
|
9
|
+
CIRCLE_STRIKETHROUGH: `${s}CircleStrikethrough.svg`,
|
|
10
|
+
RIGHT_SQUARE: `${s}RightSquare.svg`,
|
|
11
|
+
COINBASE_DARK: `${s}CoinbaseDark.png`,
|
|
12
|
+
COINBASE_LIGHT: `${s}CoinbaseLight.png`
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
g as IMAGE_PATHS
|
|
16
|
+
};
|
package/common150.mjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { getNonLocalhostChainId as o, chainIds as t } from "./common28.mjs";
|
|
2
|
+
import "./common157.mjs";
|
|
3
|
+
import "./common164.mjs";
|
|
4
|
+
import "./common168.mjs";
|
|
5
|
+
import "ethers";
|
|
6
|
+
import "circomlibjs";
|
|
7
|
+
import "./common51.mjs";
|
|
8
|
+
import "axios";
|
|
9
|
+
import "./common50.mjs";
|
|
10
|
+
import "./common139.mjs";
|
|
11
|
+
import "./common191.mjs";
|
|
12
|
+
import "./common117.mjs";
|
|
13
|
+
import "./common72.mjs";
|
|
14
|
+
import "./common121.mjs";
|
|
15
|
+
import "./common35.mjs";
|
|
16
|
+
import "./common33.mjs";
|
|
17
|
+
import "./common129.mjs";
|
|
18
|
+
import "./common42.mjs";
|
|
19
|
+
import "./common31.mjs";
|
|
20
|
+
import "./common77.mjs";
|
|
21
|
+
import "libsodium-wrappers";
|
|
22
|
+
import "./common30.mjs";
|
|
23
|
+
import "./common36.mjs";
|
|
24
|
+
import "./common41.mjs";
|
|
25
|
+
const v = (r) => {
|
|
26
|
+
switch (o(r)) {
|
|
27
|
+
case t.polygon:
|
|
28
|
+
return "0x172370d5Cd63279eFa6d502DAB29171933a610AF";
|
|
29
|
+
case t.arbMainnet:
|
|
30
|
+
return "0x11cdb42b0eb46d95f990bedd4695a6e3fa034978";
|
|
31
|
+
case t.ethMainnet:
|
|
32
|
+
return "0xD533a949740bb3306d119CC777fa900bA034cd52";
|
|
33
|
+
case t.avalanche:
|
|
34
|
+
return "0x47536F17F4fF30e64A96a7555826b8f9e66ec468";
|
|
35
|
+
case t.optimism:
|
|
36
|
+
return "0x0994206dfe8de6ec6920ff4d779b0d950605fb53";
|
|
37
|
+
case t.base:
|
|
38
|
+
return "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415";
|
|
39
|
+
default:
|
|
40
|
+
return "0xD533a949740bb3306d119CC777fa900bA034cd52";
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
v as getCRV
|
|
45
|
+
};
|
package/common151.mjs
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { getNonLocalhostChainId as r, chainIds as t } from "./common28.mjs";
|
|
2
|
+
import "./common157.mjs";
|
|
3
|
+
import "./common164.mjs";
|
|
4
|
+
import "./common168.mjs";
|
|
5
|
+
import "ethers";
|
|
6
|
+
import "circomlibjs";
|
|
7
|
+
import "./common51.mjs";
|
|
8
|
+
import "axios";
|
|
9
|
+
import "./common50.mjs";
|
|
10
|
+
import "./common139.mjs";
|
|
11
|
+
import "./common191.mjs";
|
|
12
|
+
import "./common117.mjs";
|
|
13
|
+
import "./common72.mjs";
|
|
14
|
+
import "./common121.mjs";
|
|
15
|
+
import "./common35.mjs";
|
|
16
|
+
import "./common33.mjs";
|
|
17
|
+
import "./common129.mjs";
|
|
18
|
+
import "./common42.mjs";
|
|
19
|
+
import "./common31.mjs";
|
|
20
|
+
import "./common77.mjs";
|
|
21
|
+
import "libsodium-wrappers";
|
|
22
|
+
import "./common30.mjs";
|
|
23
|
+
import "./common36.mjs";
|
|
24
|
+
import "./common41.mjs";
|
|
25
|
+
const N = (o) => {
|
|
26
|
+
switch (r(o)) {
|
|
27
|
+
case t.polygon:
|
|
28
|
+
return "0x4257ea7637c355f81616050cbb6a9b709fd72683";
|
|
29
|
+
case t.arbMainnet:
|
|
30
|
+
return "0xb952a807345991bd529fdded05009f5e80fe8f45";
|
|
31
|
+
case t.ethMainnet:
|
|
32
|
+
return "0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B";
|
|
33
|
+
case t.optimism:
|
|
34
|
+
return "0x81ab7e0d570b01411fcc4afd3d50ec8c241cb74b";
|
|
35
|
+
default:
|
|
36
|
+
return "0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B";
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
N as getCVX
|
|
41
|
+
};
|
package/common152.mjs
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import "./common28.mjs";
|
|
2
|
+
import "./common157.mjs";
|
|
3
|
+
import { PendleAction as n } from "./common160.mjs";
|
|
4
|
+
import "./common164.mjs";
|
|
5
|
+
import { PendleAssetType as i, PendleSwapType as t } from "./common167.mjs";
|
|
6
|
+
import "./common168.mjs";
|
|
7
|
+
import "ethers";
|
|
8
|
+
import "circomlibjs";
|
|
9
|
+
import "./common51.mjs";
|
|
10
|
+
import "axios";
|
|
11
|
+
import "./common50.mjs";
|
|
12
|
+
import "./common139.mjs";
|
|
13
|
+
import "./common191.mjs";
|
|
14
|
+
import "./common117.mjs";
|
|
15
|
+
import { getERC20Token as T } from "./common118.mjs";
|
|
16
|
+
import "./common121.mjs";
|
|
17
|
+
import "./common35.mjs";
|
|
18
|
+
import { API_CONFIG as p } from "./common32.mjs";
|
|
19
|
+
import "./common33.mjs";
|
|
20
|
+
import { caseInsensitiveEqual as d } from "./common134.mjs";
|
|
21
|
+
import "./common129.mjs";
|
|
22
|
+
import "./common42.mjs";
|
|
23
|
+
import "./common31.mjs";
|
|
24
|
+
import { isInEnum as w } from "./common206.mjs";
|
|
25
|
+
import "./common77.mjs";
|
|
26
|
+
import "./common72.mjs";
|
|
27
|
+
import "libsodium-wrappers";
|
|
28
|
+
import "./common30.mjs";
|
|
29
|
+
import "./common36.mjs";
|
|
30
|
+
import "./common41.mjs";
|
|
31
|
+
function H(e) {
|
|
32
|
+
if (!e)
|
|
33
|
+
return;
|
|
34
|
+
const r = T(e.address, e.chainId);
|
|
35
|
+
if (!r?.isVolatile)
|
|
36
|
+
return r?.symbol.toLowerCase() === "weth" && console.log("token:", r), r;
|
|
37
|
+
}
|
|
38
|
+
function J(e, r) {
|
|
39
|
+
if (!e || !r)
|
|
40
|
+
return;
|
|
41
|
+
let o;
|
|
42
|
+
switch (r) {
|
|
43
|
+
case i.YT:
|
|
44
|
+
o = e?.yt;
|
|
45
|
+
break;
|
|
46
|
+
case i.PT:
|
|
47
|
+
o = e?.pt;
|
|
48
|
+
break;
|
|
49
|
+
case i.PENDLE_LP:
|
|
50
|
+
o = e?.lp;
|
|
51
|
+
break;
|
|
52
|
+
case i.SY:
|
|
53
|
+
o = e?.sy;
|
|
54
|
+
break;
|
|
55
|
+
default:
|
|
56
|
+
o = void 0;
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
return o;
|
|
60
|
+
}
|
|
61
|
+
const K = (e, r, o) => {
|
|
62
|
+
if (d(e.yt.address, o.erc20TokenAddress))
|
|
63
|
+
return t.SwapExactTokenForYt;
|
|
64
|
+
if (d(e.pt.address, o.erc20TokenAddress))
|
|
65
|
+
return t.SwapExactTokenForPt;
|
|
66
|
+
if (d(e.yt.address, r.erc20TokenAddress))
|
|
67
|
+
return t.SwapExactYtForToken;
|
|
68
|
+
if (d(e.pt.address, r.erc20TokenAddress))
|
|
69
|
+
return t.SwapExactPtForToken;
|
|
70
|
+
}, Q = (e) => {
|
|
71
|
+
let r;
|
|
72
|
+
switch (e) {
|
|
73
|
+
case t.SwapExactTokenForYt:
|
|
74
|
+
r = p.ROUTES.pendleSwapExactTokenForYT;
|
|
75
|
+
break;
|
|
76
|
+
case t.SwapExactTokenForPt:
|
|
77
|
+
r = p.ROUTES.pendleSwapExactTokenForPt;
|
|
78
|
+
break;
|
|
79
|
+
case t.SwapExactYtForToken:
|
|
80
|
+
r = p.ROUTES.pendleSwapExactYtForToken;
|
|
81
|
+
break;
|
|
82
|
+
case t.SwapExactPtForToken:
|
|
83
|
+
r = p.ROUTES.pendleSwapExactPtForToken;
|
|
84
|
+
break;
|
|
85
|
+
default:
|
|
86
|
+
throw new Error("Cant determine Pendle Swap Type Api Route");
|
|
87
|
+
}
|
|
88
|
+
return r;
|
|
89
|
+
}, W = (e, r, o, s) => {
|
|
90
|
+
if (!w(n, e))
|
|
91
|
+
throw new Error("getTokenIndexForPendleFlatFee: Invalid Pendle Action");
|
|
92
|
+
if (s)
|
|
93
|
+
return o.findIndex(
|
|
94
|
+
(a) => a.toLowerCase() === s?.toLowerCase()
|
|
95
|
+
);
|
|
96
|
+
const l = r.findIndex((a) => a > 0n), c = r.length - 1;
|
|
97
|
+
if (r[c] <= 0n)
|
|
98
|
+
throw new Error("getTokenIndexForPendleFlatFee: Last token in amountChange is not > 0");
|
|
99
|
+
let m = l;
|
|
100
|
+
return (e === n.Mint || e === n.Redeem || e === n.PoolRemove) && (m = l), m;
|
|
101
|
+
};
|
|
102
|
+
export {
|
|
103
|
+
K as determinePendleSwapType,
|
|
104
|
+
Q as determinePendleSwapTypeApiRoute,
|
|
105
|
+
H as erc20TokenFromPendleAsset,
|
|
106
|
+
J as getAssetTypeFromPendleMarket,
|
|
107
|
+
W as getTokenIndexForPendleFlatFee
|
|
108
|
+
};
|
package/common153.mjs
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ethers as i } from "ethers";
|
|
2
|
+
import { UserKeys as f } from "./common51.mjs";
|
|
3
|
+
import s from "libsodium-wrappers";
|
|
4
|
+
import { poseidonHash as c } from "./common45.mjs";
|
|
5
|
+
import "circomlibjs";
|
|
6
|
+
const S = (t, e, r) => {
|
|
7
|
+
const o = i.utils.defaultAbiCoder.encode(
|
|
8
|
+
["uint256", "address"],
|
|
9
|
+
[t, e]
|
|
10
|
+
), n = s.crypto_box_seal(o, i.utils.arrayify(r));
|
|
11
|
+
return `0x${Buffer.from(n).toString("hex")}`;
|
|
12
|
+
}, k = (t, e) => {
|
|
13
|
+
const r = Buffer.from(t.slice(2), "hex"), { publicKey: o, privateKey: n } = f.getEncryptionKeyPair(e.getShieldedPrivateKey());
|
|
14
|
+
try {
|
|
15
|
+
const a = s.crypto_box_seal_open(
|
|
16
|
+
r,
|
|
17
|
+
i.utils.arrayify(o),
|
|
18
|
+
i.utils.arrayify(n)
|
|
19
|
+
), d = Buffer.from(a).toString("utf-8"), [u, y] = i.utils.defaultAbiCoder.decode(
|
|
20
|
+
["uint256", "address"],
|
|
21
|
+
d
|
|
22
|
+
);
|
|
23
|
+
return { stakeBlinding: u.toBigInt(), stakedTokenRecipient: y };
|
|
24
|
+
} catch {
|
|
25
|
+
console.log("failed to decrypt");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
}, B = (t, e, r, o, n, a) => BigInt(
|
|
29
|
+
c(...[t, e, r, o, n, a].map(BigInt))
|
|
30
|
+
), h = (t, e) => c(t, e), x = (t, e, r, o, n) => i.utils.defaultAbiCoder.encode(
|
|
31
|
+
["uint8", "uint256", "address", "bytes", "bytes"],
|
|
32
|
+
[t, e, r, o, n]
|
|
33
|
+
);
|
|
34
|
+
export {
|
|
35
|
+
h as calculateStakeNullifier,
|
|
36
|
+
B as createStakeCommitment,
|
|
37
|
+
k as decryptStake,
|
|
38
|
+
x as encodeHStakeMetadata,
|
|
39
|
+
S as encryptStake
|
|
40
|
+
};
|
package/common154.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ethers as e, BigNumber as d } from "ethers";
|
|
2
|
+
const p = (t, i, s, r, y) => {
|
|
3
|
+
let a = new Uint8Array(), l = new Uint8Array();
|
|
4
|
+
typeof t == "object" && "address" in t ? (a = e.utils.arrayify(t.address), i && (l = e.utils.arrayify(t.interface.encodeFunctionData(i, s)))) : a = e.utils.arrayify(t);
|
|
5
|
+
const n = e.utils.arrayify([r ? 1 : 0]), o = e.utils.zeroPad(e.utils.arrayify(d.from(y ?? 0n)), 16), u = e.utils.concat([a, n, o, l]);
|
|
6
|
+
return e.utils.hexlify(u);
|
|
7
|
+
}, m = (t, i) => e.utils.defaultAbiCoder.encode(
|
|
8
|
+
["tuple(bytes32 walletSalt, bytes[] ops)"],
|
|
9
|
+
[
|
|
10
|
+
{
|
|
11
|
+
walletSalt: i ?? e.utils.hexlify(new Uint8Array(32)),
|
|
12
|
+
ops: t
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
);
|
|
16
|
+
export {
|
|
17
|
+
p as emporiumOp,
|
|
18
|
+
m as encodeEmporiumMetadata
|
|
19
|
+
};
|
package/common155.mjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { abi as m } from "./common92.mjs";
|
|
2
|
+
import { abi as s } from "./common101.mjs";
|
|
3
|
+
import { ethers as p } from "ethers";
|
|
4
|
+
import { emporiumOp as b } from "./common154.mjs";
|
|
5
|
+
var f = /* @__PURE__ */ ((r) => (r[r.Erc20Token = 0] = "Erc20Token", r[r.Uniswap = 1] = "Uniswap", r))(f || {});
|
|
6
|
+
const E = (r, t, a, i, c, e) => {
|
|
7
|
+
let o = "";
|
|
8
|
+
switch (r) {
|
|
9
|
+
case 0:
|
|
10
|
+
o = m;
|
|
11
|
+
break;
|
|
12
|
+
case 1:
|
|
13
|
+
o = s;
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
if (!o)
|
|
17
|
+
throw Error("No ABI match in produceOp");
|
|
18
|
+
const n = new p.Contract(t, o);
|
|
19
|
+
return b(n, a, i, c, e);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
f as OpType,
|
|
23
|
+
E as produceOp
|
|
24
|
+
};
|
package/common156.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const p = {
|
|
2
|
+
base: "https://data.beefy.finance/api/v2/",
|
|
3
|
+
routes: {
|
|
4
|
+
prices: (a, s) => {
|
|
5
|
+
const e = new URLSearchParams();
|
|
6
|
+
return e.append("oracle", a), e.append("bucket", s), `prices/?${e}`;
|
|
7
|
+
},
|
|
8
|
+
tvls: (a, s) => {
|
|
9
|
+
const e = new URLSearchParams();
|
|
10
|
+
return e.append("vault", a), e.append("bucket", s), `tvls/?${e}`;
|
|
11
|
+
},
|
|
12
|
+
apys: (a, s) => {
|
|
13
|
+
const e = new URLSearchParams();
|
|
14
|
+
return e.append("vault", a), e.append("bucket", s), `apys/?${e}`;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}, t = (a) => a <= 4;
|
|
18
|
+
export {
|
|
19
|
+
p as dataBeefyApiConfig,
|
|
20
|
+
t as isBeefyDeposit
|
|
21
|
+
};
|
package/common157.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const a = {
|
|
2
|
+
extraRandomization: "",
|
|
3
|
+
stealthAddress: "",
|
|
4
|
+
H0: "",
|
|
5
|
+
H1: ""
|
|
6
|
+
}, t = {
|
|
7
|
+
preHookContract: "0x0000000000000000000000000000000000000000",
|
|
8
|
+
hookContract: "0x0000000000000000000000000000000000000000",
|
|
9
|
+
preHookMetadata: "0x00",
|
|
10
|
+
postHookMetadata: "0x00"
|
|
11
|
+
}, o = Object.values(t), e = {
|
|
12
|
+
extraRandomization: 1n,
|
|
13
|
+
stealthAddress: 0n,
|
|
14
|
+
H0: 0n,
|
|
15
|
+
H1: 0n
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
t as defaultHookData,
|
|
19
|
+
o as defaultHookDataArray,
|
|
20
|
+
e as defaultStealthAddressStructure,
|
|
21
|
+
a as emptyStealthAddressStructure
|
|
22
|
+
};
|
package/common158.mjs
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var l = /* @__PURE__ */ ((e) => (e[e.HinkalContract = 0] = "HinkalContract", e[e.HinkalHelperContract = 1] = "HinkalHelperContract", e[e.CrossChainAccessTokenContract = 2] = "CrossChainAccessTokenContract", e[e.UniswapV3FactoryContract = 3] = "UniswapV3FactoryContract", e[e.UniswapV3PoolContract = 4] = "UniswapV3PoolContract", e[e.UniswapV3QuoterContract = 5] = "UniswapV3QuoterContract", e[e.ERC20Contract = 6] = "ERC20Contract", e[e.WATokenContract = 7] = "WATokenContract", e[e.OneInchExternalActionContract = 8] = "OneInchExternalActionContract", e[e.MerkleTreeContract = 9] = "MerkleTreeContract", e[e.ContractWithNonces = 10] = "ContractWithNonces", e[e.PermitterContract = 11] = "PermitterContract", e[e.CurveWrappedMainPool = 12] = "CurveWrappedMainPool", e[e.CurveReadingWrapper = 13] = "CurveReadingWrapper", e[e.CurvePoolLPTokenAmountCalculator2 = 14] = "CurvePoolLPTokenAmountCalculator2", e[e.CurvePoolLPTokenAmountCalculator3 = 15] = "CurvePoolLPTokenAmountCalculator3", e[e.CurvePoolLPTokenAmountCalculator4 = 16] = "CurvePoolLPTokenAmountCalculator4", e[e.CurvePoolLPTokenAmountCalculatorDynamic = 17] = "CurvePoolLPTokenAmountCalculatorDynamic", e[e.CurvePoolLPTokenAmountCalculator2OneArg = 18] = "CurvePoolLPTokenAmountCalculator2OneArg", e[e.CurvePoolLPTokenAmountCalculator3OneArg = 19] = "CurvePoolLPTokenAmountCalculator3OneArg", e[e.CurvePoolLPTokenAmountCalculator4OneArg = 20] = "CurvePoolLPTokenAmountCalculator4OneArg", e[e.CurvePoolWithIntCoins = 21] = "CurvePoolWithIntCoins", e[e.CurveExternalAction = 22] = "CurveExternalAction", e[e.WrappedStakedCurveLp = 23] = "WrappedStakedCurveLp", e[e.WrappedStakedRewardsCurveLp = 24] = "WrappedStakedRewardsCurveLp", e[e.CurveGauge = 25] = "CurveGauge", e[e.ConvexBooster = 26] = "ConvexBooster", e[e.ConvexBoosterMainnet = 27] = "ConvexBoosterMainnet", e[e.ConvexRewardPool = 28] = "ConvexRewardPool", e[e.ConvexCvxLocker = 29] = "ConvexCvxLocker", e[e.ConvexStakePool = 30] = "ConvexStakePool", e[e.ConvexCvxCRVWrapper = 31] = "ConvexCvxCRVWrapper", e[e.ConvexCxvCrvUtillities = 32] = "ConvexCxvCrvUtillities", e[e.ConvexExternalAction = 33] = "ConvexExternalAction", e[e.WrappedStakedConvexLp = 34] = "WrappedStakedConvexLp", e[e.CurvePoolWithIntBalances = 35] = "CurvePoolWithIntBalances", e[e.CurveZaps = 36] = "CurveZaps", e[e.BeefyVault = 37] = "BeefyVault", e[e.BeefyZap = 38] = "BeefyZap", e[e.BeefyRouter = 39] = "BeefyRouter", e[e.BeefyZapOneInch = 40] = "BeefyZapOneInch", e[e.BeefyExternalAction = 41] = "BeefyExternalAction", e[e.BeefyStakeExternalAction = 42] = "BeefyStakeExternalAction", e[e.BeefyStrategy = 43] = "BeefyStrategy", e[e.WrappedStakedBeefyLp = 44] = "WrappedStakedBeefyLp", e[e.UniswapV2PoolContract = 45] = "UniswapV2PoolContract", e[e.LidoWstEther = 46] = "LidoWstEther", e[e.LidoStEther = 47] = "LidoStEther", e[e.LidoStMatic = 48] = "LidoStMatic", e[e.LidoWithdrawalQueueERC721 = 49] = "LidoWithdrawalQueueERC721", e[e.LidoStakeManager = 50] = "LidoStakeManager", e[e.PoLidoNFT = 51] = "PoLidoNFT", e[e.PendleGeneralExternalAction = 52] = "PendleGeneralExternalAction", e[e.PendleRouter = 53] = "PendleRouter", e[e.WstPendleLPToken = 54] = "WstPendleLPToken", e[e.WstYtToken = 55] = "WstYtToken", e[e.VolatileVault = 56] = "VolatileVault", e[e.VolatileTokenAction = 57] = "VolatileTokenAction", e[e.HinkalWrapper = 58] = "HinkalWrapper", e[e.HinkalWrapper2 = 59] = "HinkalWrapper2", e[e.HinkalStakeExternalAction = 60] = "HinkalStakeExternalAction", e[e.HToken = 61] = "HToken", e))(l || {});
|
|
2
|
+
export {
|
|
3
|
+
l as ContractType
|
|
4
|
+
};
|
package/common159.mjs
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var C = /* @__PURE__ */ ((e) => (e.Transact = "Transact", e.Uniswap = "Uniswap", e.Odos = "Odos", e.OneInch = "OneInch", e.Curve = "Curve", e.CurveDynamic = "CurveDynamic", e.CurveCRV = "CurveCRV", e.CurveCRVRewards = "CurveCRVRewards", e.Convex = "Convex", e.Beefy = "Beefy", e.BeefyStake = "BeefyStake", e.Volatile = "Volatile", e.LidoETH = "LidoETH", e.LidoMATIC = "LidoMATIC", e.LidoETHNFT = "LidoETHNFT", e.LidoMATICNFT = "LidoMATICNFT", e.Pendle = "Pendle", e.PendleLP = "PendleLP", e.HinkalStake = "HinkalStake", e.Connext = "Connext", e.Emporium = "Emporium", e))(C || {});
|
|
2
|
+
export {
|
|
3
|
+
C as ExternalActionId
|
|
4
|
+
};
|
package/common16.mjs
ADDED
package/common160.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var E = /* @__PURE__ */ ((a) => (a.BalanceChange = "BalanceChange", a.NetworkChange = "NetworkChange", a.KycNeeded = "KycNeeded", a.AccountChanged = "AccountChanged", a.ShowConnect = "ShowConnect", a.ShowNetworkPopup = "ShowNetworkPopup", a.MerkleTreeUpdated = "MerkleTreeUpdated", a.MerkleTreeResetStarted = "MerkleTreeResetStarted", a.MerkleTreeResetFinished = "MerkleTreeResetFinished", a))(E || {}), S = /* @__PURE__ */ ((a) => (a[a.UNISWAP = 1] = "UNISWAP", a[a.ODOS = 2] = "ODOS", a[a.ONEINCH = 3] = "ONEINCH", a[a.PENDLE = 4] = "PENDLE", a[a.ALL = 5] = "ALL", a[a.NONE = 6] = "NONE", a))(S || {}), D = /* @__PURE__ */ ((a) => (a[a.CurveAavePool = 0] = "CurveAavePool", a))(D || {}), _ = /* @__PURE__ */ ((a) => (a[a.Deposit = 0] = "Deposit", a[a.WithdrawInt = 11] = "WithdrawInt", a[a.WithdrawUint = 12] = "WithdrawUint", a[a.WithdrawImbalance = 13] = "WithdrawImbalance", a[a.Stake = 2] = "Stake", a[a.Unstake = 3] = "Unstake", a[a.GetCRV = 4] = "GetCRV", a))(_ || {}), h = /* @__PURE__ */ ((a) => (a[a.StakeLP = 0] = "StakeLP", a[a.UnStakeLP = 1] = "UnStakeLP", a[a.ClaimRewardsLP = 2] = "ClaimRewardsLP", a))(h || {}), W = /* @__PURE__ */ ((a) => (a[a.Deposit = 0] = "Deposit", a[a.DepositRegular = 1] = "DepositRegular", a[a.DepositOneInchSingle = 2] = "DepositOneInchSingle", a[a.DepositOneInchUniswap = 3] = "DepositOneInchUniswap", a[a.DepositOneInchSolidly = 4] = "DepositOneInchSolidly", a[a.Withdraw = 5] = "Withdraw", a[a.WithdrawRegular = 6] = "WithdrawRegular", a[a.WithdrawOneInchSingle = 7] = "WithdrawOneInchSingle", a[a.WithdrawOneInchUniswapAndSolidly = 8] = "WithdrawOneInchUniswapAndSolidly", a[a.WithdrawBoth = 9] = "WithdrawBoth", a[a.Stake = 10] = "Stake", a[a.Unstake = 11] = "Unstake", a[a.GetRewards = 12] = "GetRewards", a))(W || {}), L = /* @__PURE__ */ ((a) => (a.Ethereum = "Ethereum", a.Polygon = "Polygon", a))(L || {}), r = /* @__PURE__ */ ((a) => (a[a.Stake = 0] = "Stake", a[a.Request = 1] = "Request", a[a.Claim = 2] = "Claim", a))(r || {}), w = /* @__PURE__ */ ((a) => (a[a.Deposit = 0] = "Deposit", a[a.Withdraw = 1] = "Withdraw", a[a.SwapFromYt = 2] = "SwapFromYt", a[a.SwapToYt = 3] = "SwapToYt", a[a.SwapPt = 4] = "SwapPt", a[a.Mint = 5] = "Mint", a[a.Redeem = 6] = "Redeem", a[a.Checkpoint = 7] = "Checkpoint", a[a.PoolRemove = 8] = "PoolRemove", a))(w || {}), s = /* @__PURE__ */ ((a) => (a[a.AddOrRemoveLiquidity = 0] = "AddOrRemoveLiquidity", a[a.Checkpoint = 1] = "Checkpoint", a[a.Invalid = 99] = "Invalid", a))(s || {}), U = /* @__PURE__ */ ((a) => (a[a.Persist = 0] = "Persist", a[a.Deposit = 1] = "Deposit", a[a.Withdraw = 2] = "Withdraw", a[a.Swap = 3] = "Swap", a))(U || {}), p = /* @__PURE__ */ ((a) => (a.WITHDRAW = "WITHDRAW", a.SWAP = "SWAP", a.CURVE_DEPOSIT = "CURVE_DEPOSIT", a.CURVE_WITHDRAW = "CURVE_WITHDRAW", a.CURVE_WITHDRAW_INBALANCED = "CURVE_WITHDRAW_INBALANCED", a.STAKING = "STAKING", a.UNSTAKING = "UNSTAKING", a.CLAIMING = "CLAIMING", a.BEEFY = "BEEFY", a.BEEFY_STAKE = "BEEFY_STAKE", a.BEEFY_UNSTAKE = "BEEFY_UNSTAKE", a.BEEFY_GET_REWARDS = "BEEFY_GET_REWARDS", a.LIDO_STAKE = "LIDO_STAKE", a.LIDO_REQUEST = "LIDO_REQUEST", a.LIDO_CLAIM = "LIDO_CLAIM", a.PENDLE_TRANSACT = "PENDLE_TRANSACT", a.PENDLE_YT_IN_SWAP = "PENDLE_YT_IN_SWAP", a.PENDLE_YT_OUT_SWAP = "PENDLE_YT_OUT_SWAP", a.PENDLE_PT_SWAP = "PENDLE_PT_SWAP", a.PENDLE_MINT = "PENDLE_MINT", a.PENDLE_REDEEM = "PENDLE_REDEEM", a.PENDLE_CLAIM = "PENDLE_CLAIM", a.PENDLE_LP = "PENDLE_LP", a.PENDLE_LP_CLAIM = "PENDLE_LP_CLAIM", a.VOLATILE_WITHDRAW = "VOLATILE_WITHDRAW", a.VOLATILE_SWAP = "VOLATILE_SWAP", a.EMPORIUM = "EMPORIUM", a.NONE = "NONE", a))(p || {});
|
|
2
|
+
export {
|
|
3
|
+
W as BeefyAction,
|
|
4
|
+
h as ConvexAction,
|
|
5
|
+
_ as CurveAction,
|
|
6
|
+
E as EventType,
|
|
7
|
+
p as INTERACTION,
|
|
8
|
+
S as IntegrationProvider,
|
|
9
|
+
r as LidoAction,
|
|
10
|
+
L as LidoVariant,
|
|
11
|
+
w as PendleAction,
|
|
12
|
+
s as PendleLPAction,
|
|
13
|
+
D as StakeProvider,
|
|
14
|
+
U as VolatileAction
|
|
15
|
+
};
|
package/common161.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var N = /* @__PURE__ */ ((E) => (E.USER = "USER", E.BUSINESS = "BUSINESS", E))(N || {});
|
|
2
|
+
const S = [
|
|
3
|
+
"USER",
|
|
4
|
+
"BUSINESS"
|
|
5
|
+
/* BUSINESS */
|
|
6
|
+
];
|
|
7
|
+
var D = /* @__PURE__ */ ((E) => (E.APPROVED = "APPROVED", E.DECLINED = "DECLINED", E.REVIEW = "REVIEW", E.UNKNOWN = "UNKNOWN", E))(D || {}), I = /* @__PURE__ */ ((E) => (E.COMPLETED = "COMPLETED", E.FAILED = "FAILED", E.PENDING = "PENDING", E.RUNNING = "RUNNING", E.NOT_STARTED = "NOT_STARTED", E))(I || {});
|
|
8
|
+
export {
|
|
9
|
+
D as KycVerificationResult,
|
|
10
|
+
I as KycVerificationStatus,
|
|
11
|
+
N as VERIFICATION_TYPE,
|
|
12
|
+
S as VerificationTypes
|
|
13
|
+
};
|
package/common162.mjs
ADDED
package/common163.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var r = /* @__PURE__ */ ((e) => (e.Swap = "Swap", e.CurveDeposit = "CurveDeposit", e.CurveWithdraw = "CurveWithdraw", e.Beefy = "Beefy", e.Pendle = "Pendle", e))(r || {});
|
|
2
|
+
const t = {
|
|
3
|
+
Swap: 0.7,
|
|
4
|
+
// means 0.7% -> taken from default Uniswap Slippage
|
|
5
|
+
CurveDeposit: 0.9,
|
|
6
|
+
// 0.03 taken from Curve
|
|
7
|
+
CurveWithdraw: 0.9,
|
|
8
|
+
Beefy: 1,
|
|
9
|
+
Pendle: 3
|
|
10
|
+
// 1 means 1%
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
r as SlippageType,
|
|
14
|
+
t as slippageLevels
|
|
15
|
+
};
|
package/common164.mjs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BigNumber as t } from "ethers";
|
|
2
|
+
const o = t.from(0), r = {
|
|
3
|
+
blockNumber: 0,
|
|
4
|
+
timeStamp: 0,
|
|
5
|
+
methodId: "",
|
|
6
|
+
input: "",
|
|
7
|
+
decodedInput: {
|
|
8
|
+
erc20TokenAddresses: [],
|
|
9
|
+
amountChanges: [],
|
|
10
|
+
flatFees: [0n, 0n].map((e) => t.from(e)),
|
|
11
|
+
externalActionId: o,
|
|
12
|
+
externalActionMetadata: "",
|
|
13
|
+
encryptedOutputs: [],
|
|
14
|
+
hookData: {
|
|
15
|
+
hookContract: "",
|
|
16
|
+
preHookContract: "",
|
|
17
|
+
preHookMetadata: "",
|
|
18
|
+
postHookMetadata: ""
|
|
19
|
+
},
|
|
20
|
+
stealthAddressStructure: {
|
|
21
|
+
extraRandomization: 0n,
|
|
22
|
+
stealthAddress: 0n,
|
|
23
|
+
H0: 0n,
|
|
24
|
+
H1: 0n
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
logs: [],
|
|
28
|
+
hash: "",
|
|
29
|
+
gas: 0,
|
|
30
|
+
gasPrice: 0,
|
|
31
|
+
isError: "",
|
|
32
|
+
status: ""
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
r as emptyDecodedTx
|
|
36
|
+
};
|
package/common165.mjs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const w = 1e3, R = 6e4, m = 36e5, f = 864e5, A = 6048e5, r = /* @__PURE__ */ new Date("2024-03-04T00:00:00.000Z"), c = (e) => {
|
|
2
|
+
if (e < 0)
|
|
3
|
+
throw Error("Certification for the past week is not available");
|
|
4
|
+
}, o = (e) => (c(e), new Date(new Date(r).setUTCDate(r.getUTCDate() + 7 * e))), U = (e) => {
|
|
5
|
+
c(e);
|
|
6
|
+
const t = o(e).getTime() / 1e3, n = o(e + 1).getTime() / 1e3;
|
|
7
|
+
return { initialTimestamp: t, endTimestamp: n };
|
|
8
|
+
}, i = () => {
|
|
9
|
+
const e = (/* @__PURE__ */ new Date()).getTime() / 1e3;
|
|
10
|
+
let t = -1, n;
|
|
11
|
+
do
|
|
12
|
+
t += 1, { endTimestamp: n } = U(t);
|
|
13
|
+
while (e > n);
|
|
14
|
+
return t;
|
|
15
|
+
}, I = (e) => {
|
|
16
|
+
if (e === void 0)
|
|
17
|
+
return i();
|
|
18
|
+
const t = Number(e);
|
|
19
|
+
return !Number.isFinite(t) || t < 0 ? i() : t;
|
|
20
|
+
}, Y = (e, t = "/") => [e.getUTCDate(), e.getUTCMonth() + 1, e.getUTCFullYear()].join(t), h = (e) => {
|
|
21
|
+
const t = i();
|
|
22
|
+
return e === t;
|
|
23
|
+
}, p = (e) => {
|
|
24
|
+
const t = i();
|
|
25
|
+
return e < t - 1;
|
|
26
|
+
}, v = (e) => {
|
|
27
|
+
const t = new Date(e);
|
|
28
|
+
return t.setUTCDate(t.getUTCDate() + 1), t.setUTCHours(0), t.setUTCMinutes(0), t.setUTCSeconds(0), t.setUTCMilliseconds(0), t;
|
|
29
|
+
};
|
|
30
|
+
var g = /* @__PURE__ */ ((e) => (e[e.JANUARY = 0] = "JANUARY", e[e.FEBRUARY = 1] = "FEBRUARY", e[e.MARCH = 2] = "MARCH", e[e.APRIL = 3] = "APRIL", e[e.MAY = 4] = "MAY", e[e.JUNE = 5] = "JUNE", e[e.JULY = 6] = "JULY", e[e.AUGUST = 7] = "AUGUST", e[e.SEPTEMBER = 8] = "SEPTEMBER", e[e.OCTOBER = 9] = "OCTOBER", e[e.NOVEMBER = 10] = "NOVEMBER", e[e.DECEMBER = 11] = "DECEMBER", e))(g || {});
|
|
31
|
+
const C = (e, t) => {
|
|
32
|
+
if (t < 0 || t > 11)
|
|
33
|
+
throw Error("getNextMonth: incorrect month provided");
|
|
34
|
+
if (e < 2023 || e > 2025)
|
|
35
|
+
throw Error("getNextMonth: incorrect year provided");
|
|
36
|
+
let n = e, s;
|
|
37
|
+
return t < 11 ? s = t + 1 : (s = 0, n = e + 1), { newYear: n, newMonth: s };
|
|
38
|
+
}, B = (e, t) => {
|
|
39
|
+
const { newYear: n, newMonth: s } = C(e, t), a = new Date(e, t, 1).getTime() / 1e3, l = new Date(e, t, 8).getTime() / 1e3, u = new Date(e, t, 15).getTime() / 1e3, d = new Date(e, t, 23).getTime() / 1e3, E = new Date(n, s, 1).getTime() / 1e3;
|
|
40
|
+
return [a, l, u, d, E];
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
g as MONTHS,
|
|
44
|
+
f as dayInMilliseconds,
|
|
45
|
+
B as divideMonthOnIntervals,
|
|
46
|
+
i as getCurrentWeek,
|
|
47
|
+
o as getDateFromWeek,
|
|
48
|
+
v as getNextDay,
|
|
49
|
+
U as getWeekTimestamps,
|
|
50
|
+
p as hasCertificationPeriodExpired,
|
|
51
|
+
m as hourInMilliseconds,
|
|
52
|
+
h as isWeekCurrent,
|
|
53
|
+
R as minuteInMilliseconds,
|
|
54
|
+
I as parseWeek,
|
|
55
|
+
w as secondInMilliseconds,
|
|
56
|
+
Y as toDateString,
|
|
57
|
+
A as weekInMilliseconds
|
|
58
|
+
};
|