@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/common12.mjs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getActiveCode as e, updateActiveCode as r, getWeeklyReferralCodes as t, getReferralCodes as o, addReferralCode as i, getLpProgram as s, getRewardsHistory as a, setRewardsReceivingData as n, getRewardsReceivingData as g } from "./common211.mjs";
|
|
2
|
+
import { addNickname as m, getNickname as c, points as d, leaderboard as f, seasonLeaderboard as k } from "./common212.mjs";
|
|
3
|
+
import { verificationStartDate as p, userGetTransactions as P, userVerifyTransactions as y } from "./common213.mjs";
|
|
4
|
+
import { getIdleRelay as l } from "./common11.mjs";
|
|
5
|
+
import { userHasPassword as R, userRegisterPassword as A } from "./common214.mjs";
|
|
6
|
+
import { getTokenPrice as T, getTokenPriceEth as u, getTokenPrices as C } from "./common9.mjs";
|
|
7
|
+
import { getUserKycStatus as S, setAiPriseVerificationUrl as v, getAccessTokenSignature as w, getZkMeAccessToken as U, userHasAccessToken as D, afterKycCall as H } from "./common215.mjs";
|
|
8
|
+
import { getOdosPriceForToken as L } from "./common216.mjs";
|
|
9
|
+
import { getUserPoints as b } from "./common217.mjs";
|
|
10
|
+
import { getLimitedAnonymityStakingPoints as I, getUserAnonymityStakingPoints as K, getUserAnonymityStakingReferralPoints as N } from "./common218.mjs";
|
|
11
|
+
const j = {
|
|
12
|
+
// KYC
|
|
13
|
+
getUserKycStatus: S,
|
|
14
|
+
setAiPriseVerificationUrl: v,
|
|
15
|
+
getAccessTokenSignature: w,
|
|
16
|
+
getZkMeAccessToken: U,
|
|
17
|
+
userHasAccessToken: D,
|
|
18
|
+
afterKycCall: H,
|
|
19
|
+
// Prices
|
|
20
|
+
getTokenPrice: T,
|
|
21
|
+
getTokenPriceEth: u,
|
|
22
|
+
getTokenPrices: C,
|
|
23
|
+
getOdosPriceForToken: L,
|
|
24
|
+
// Referral Codes
|
|
25
|
+
getActiveCode: e,
|
|
26
|
+
updateActiveCode: r,
|
|
27
|
+
getWeeklyReferralCodes: t,
|
|
28
|
+
getReferralCodes: o,
|
|
29
|
+
addReferralCode: i,
|
|
30
|
+
getLpProgram: s,
|
|
31
|
+
// Rewards Points
|
|
32
|
+
addNickname: m,
|
|
33
|
+
getNickname: c,
|
|
34
|
+
// Transaction Verifications
|
|
35
|
+
verificationStartDate: p,
|
|
36
|
+
userGetTransactions: P,
|
|
37
|
+
userVerifyTransactions: y,
|
|
38
|
+
points: d,
|
|
39
|
+
leaderboard: f,
|
|
40
|
+
seasonLeaderboard: k,
|
|
41
|
+
// relay
|
|
42
|
+
getIdleRelay: l,
|
|
43
|
+
// password
|
|
44
|
+
userHasPassword: R,
|
|
45
|
+
userRegisterPassword: A,
|
|
46
|
+
getRewardsHistory: a,
|
|
47
|
+
setRewardsReceivingData: n,
|
|
48
|
+
getRewardsReceivingData: g,
|
|
49
|
+
// points
|
|
50
|
+
getUserPoints: b,
|
|
51
|
+
// AnonymityStakingPoints
|
|
52
|
+
getLimitedAnonymityStakingPoints: I,
|
|
53
|
+
getUserAnonymityStakingPoints: K,
|
|
54
|
+
getUserAnonymityStakingReferralPoints: N
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
j as API
|
|
58
|
+
};
|
package/common120.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const c = (t) => t.reduce((e, n) => e.then(() => n()), Promise.resolve()), h = (t, e, n) => {
|
|
2
|
+
const s = [];
|
|
3
|
+
if (n) {
|
|
4
|
+
let o = t;
|
|
5
|
+
for (; o <= e; ) {
|
|
6
|
+
const r = Math.min(o + n - 1, e);
|
|
7
|
+
s.push({
|
|
8
|
+
from: o,
|
|
9
|
+
to: r
|
|
10
|
+
}), o = r + 1;
|
|
11
|
+
}
|
|
12
|
+
} else
|
|
13
|
+
s.push({
|
|
14
|
+
from: t,
|
|
15
|
+
to: e
|
|
16
|
+
});
|
|
17
|
+
return s;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
h as getSequence,
|
|
21
|
+
c as resolveSync
|
|
22
|
+
};
|
package/common121.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "./common157.mjs";
|
|
2
|
+
import { ExternalActionId as r } from "./common159.mjs";
|
|
3
|
+
import { IntegrationProvider as o } from "./common160.mjs";
|
|
4
|
+
import "./common164.mjs";
|
|
5
|
+
import "./common168.mjs";
|
|
6
|
+
const t = {
|
|
7
|
+
[o.UNISWAP]: r.Uniswap,
|
|
8
|
+
[o.ODOS]: r.Odos,
|
|
9
|
+
[o.ONEINCH]: r.OneInch,
|
|
10
|
+
[o.PENDLE]: r.Pendle,
|
|
11
|
+
[o.ALL]: void 0,
|
|
12
|
+
[o.NONE]: void 0
|
|
13
|
+
}, p = (n) => t[n];
|
|
14
|
+
export {
|
|
15
|
+
p as convertIntegrationProviderToExternalActionId
|
|
16
|
+
};
|
package/common122.mjs
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import "./common157.mjs";
|
|
2
|
+
import { ExternalActionId as e } from "./common159.mjs";
|
|
3
|
+
import { INTERACTION as u, CurveAction as C, ConvexAction as L, BeefyAction as T, LidoAction as s, PendleAction as f, VolatileAction as P, PendleLPAction as R } from "./common160.mjs";
|
|
4
|
+
import "./common164.mjs";
|
|
5
|
+
import "./common168.mjs";
|
|
6
|
+
const m = (r, E) => {
|
|
7
|
+
if (r === e.Transact)
|
|
8
|
+
return u.WITHDRAW;
|
|
9
|
+
if ([e.Uniswap, e.Odos, e.OneInch].includes(
|
|
10
|
+
r
|
|
11
|
+
))
|
|
12
|
+
return u.SWAP;
|
|
13
|
+
if ((r === e.Curve || r === e.CurveDynamic) && E === C.Deposit)
|
|
14
|
+
return u.CURVE_DEPOSIT;
|
|
15
|
+
if ((r === e.Curve || r === e.CurveDynamic) && [C.WithdrawInt, C.WithdrawUint].includes(E))
|
|
16
|
+
return u.CURVE_WITHDRAW;
|
|
17
|
+
if ((r === e.Curve || r === e.CurveDynamic) && E === C.WithdrawImbalance)
|
|
18
|
+
return u.CURVE_WITHDRAW_INBALANCED;
|
|
19
|
+
if ((r === e.CurveCRV || r === e.CurveCRVRewards) && E === C.Stake || r === e.Convex && E === L.StakeLP)
|
|
20
|
+
return u.STAKING;
|
|
21
|
+
if ((r === e.CurveCRV || r === e.CurveCRVRewards) && E === C.Unstake || r === e.Convex && E === L.UnStakeLP)
|
|
22
|
+
return u.UNSTAKING;
|
|
23
|
+
if ((r === e.CurveCRV || r === e.CurveCRVRewards) && E === C.GetCRV || r === e.Convex && E === L.ClaimRewardsLP)
|
|
24
|
+
return u.CLAIMING;
|
|
25
|
+
if (r === e.Beefy)
|
|
26
|
+
return u.BEEFY;
|
|
27
|
+
if (r === e.BeefyStake && E === T.Stake)
|
|
28
|
+
return u.BEEFY_STAKE;
|
|
29
|
+
if (r === e.BeefyStake && E === T.Unstake)
|
|
30
|
+
return u.BEEFY_UNSTAKE;
|
|
31
|
+
if (r === e.BeefyStake && E === T.GetRewards)
|
|
32
|
+
return u.BEEFY_GET_REWARDS;
|
|
33
|
+
if ((r === e.LidoETH || r === e.LidoMATIC) && E === s.Stake)
|
|
34
|
+
return u.LIDO_STAKE;
|
|
35
|
+
if ((r === e.LidoETHNFT || r === e.LidoMATICNFT) && E === s.Request)
|
|
36
|
+
return u.LIDO_REQUEST;
|
|
37
|
+
if ((r === e.LidoETHNFT || r === e.LidoMATICNFT) && E === s.Claim)
|
|
38
|
+
return u.LIDO_CLAIM;
|
|
39
|
+
if (r === e.Pendle)
|
|
40
|
+
return E === f.SwapFromYt ? u.PENDLE_YT_IN_SWAP : E === f.SwapToYt ? u.PENDLE_YT_OUT_SWAP : E === f.SwapPt ? u.PENDLE_PT_SWAP : E === f.Checkpoint ? u.PENDLE_CLAIM : u.PENDLE_TRANSACT;
|
|
41
|
+
if (r === e.Volatile) {
|
|
42
|
+
if (E === P.Withdraw)
|
|
43
|
+
return u.VOLATILE_WITHDRAW;
|
|
44
|
+
if (E === P.Swap)
|
|
45
|
+
return u.VOLATILE_SWAP;
|
|
46
|
+
} else if (r === e.PendleLP) {
|
|
47
|
+
if (E === R.AddOrRemoveLiquidity)
|
|
48
|
+
return u.PENDLE_LP;
|
|
49
|
+
if (E === R.Checkpoint)
|
|
50
|
+
return u.PENDLE_LP_CLAIM;
|
|
51
|
+
} else if (r === e.Emporium)
|
|
52
|
+
return u.EMPORIUM;
|
|
53
|
+
return u.NONE;
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
m as getInteractionFromAction
|
|
57
|
+
};
|
package/common123.mjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Utxo as s } from "./common71.mjs";
|
|
2
|
+
import { transactionErrorCodes as n } from "./common81.mjs";
|
|
3
|
+
import "ethers";
|
|
4
|
+
import "axios";
|
|
5
|
+
import "./common28.mjs";
|
|
6
|
+
import "./common157.mjs";
|
|
7
|
+
import "./common164.mjs";
|
|
8
|
+
import "./common168.mjs";
|
|
9
|
+
import "./common51.mjs";
|
|
10
|
+
import "./common50.mjs";
|
|
11
|
+
import "./common139.mjs";
|
|
12
|
+
import "./common191.mjs";
|
|
13
|
+
import "./common117.mjs";
|
|
14
|
+
import "./common72.mjs";
|
|
15
|
+
import "./common121.mjs";
|
|
16
|
+
import "./common35.mjs";
|
|
17
|
+
import "./common33.mjs";
|
|
18
|
+
import "./common129.mjs";
|
|
19
|
+
import "circomlibjs";
|
|
20
|
+
import "./common42.mjs";
|
|
21
|
+
import "./common31.mjs";
|
|
22
|
+
import "./common77.mjs";
|
|
23
|
+
import "libsodium-wrappers";
|
|
24
|
+
import "./common30.mjs";
|
|
25
|
+
import "./common36.mjs";
|
|
26
|
+
import "./common41.mjs";
|
|
27
|
+
const b = (i, r, o, m, p) => {
|
|
28
|
+
let t = 0n;
|
|
29
|
+
if (r.forEach((e) => {
|
|
30
|
+
t += e.amount;
|
|
31
|
+
}), o < 0n && t + o < 0n)
|
|
32
|
+
throw Error(n.INSUFFICIENT_FUNDS_TO_TRANSACT);
|
|
33
|
+
return { outputUtxos: [
|
|
34
|
+
new s({
|
|
35
|
+
amount: t + o,
|
|
36
|
+
erc20TokenAddress: r[0].erc20TokenAddress,
|
|
37
|
+
shieldedPrivateKey: i.getShieldedPrivateKey(),
|
|
38
|
+
timeStamp: m,
|
|
39
|
+
tokenId: p
|
|
40
|
+
})
|
|
41
|
+
] };
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
b as outputUtxoProcessing
|
|
45
|
+
};
|
package/common124.mjs
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import "./common28.mjs";
|
|
2
|
+
import "./common157.mjs";
|
|
3
|
+
import "./common164.mjs";
|
|
4
|
+
import "./common168.mjs";
|
|
5
|
+
import { getAmountInWei as T } from "./common137.mjs";
|
|
6
|
+
import "ethers";
|
|
7
|
+
import "circomlibjs";
|
|
8
|
+
import { getValueFirstNDigit as l } from "./common114.mjs";
|
|
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 "./common72.mjs";
|
|
16
|
+
import "./common121.mjs";
|
|
17
|
+
import "./common129.mjs";
|
|
18
|
+
import "./common42.mjs";
|
|
19
|
+
import "./common31.mjs";
|
|
20
|
+
import "./common35.mjs";
|
|
21
|
+
import { logError as p } from "./common84.mjs";
|
|
22
|
+
import "./common77.mjs";
|
|
23
|
+
import "libsodium-wrappers";
|
|
24
|
+
import "./common33.mjs";
|
|
25
|
+
import "./common30.mjs";
|
|
26
|
+
import "./common36.mjs";
|
|
27
|
+
import "./common41.mjs";
|
|
28
|
+
import { getGasEstimates as E } from "./common8.mjs";
|
|
29
|
+
const K = async (s, t, e, a, n, c) => {
|
|
30
|
+
let i, o, r;
|
|
31
|
+
try {
|
|
32
|
+
({
|
|
33
|
+
status: i,
|
|
34
|
+
priceOfTransactionInUSD: o,
|
|
35
|
+
priceOfTransactionInToken: r
|
|
36
|
+
} = await E(
|
|
37
|
+
s,
|
|
38
|
+
t.erc20TokenAddress,
|
|
39
|
+
e,
|
|
40
|
+
a,
|
|
41
|
+
n,
|
|
42
|
+
c
|
|
43
|
+
));
|
|
44
|
+
} catch (f) {
|
|
45
|
+
p("processGasEstimates error:", f);
|
|
46
|
+
}
|
|
47
|
+
const m = r ? T(t, l(r, t.decimals)) : void 0;
|
|
48
|
+
return p("processGasEstimates: ", {
|
|
49
|
+
status: i,
|
|
50
|
+
priceOfTransactionInUSD: o,
|
|
51
|
+
priceOfTransactionInTokenEstimate: r,
|
|
52
|
+
priceOfTransactionInToken: m
|
|
53
|
+
}), { priceOfTransactionInUSD: o, priceOfTransactionInToken: m };
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
K as processGasEstimates
|
|
57
|
+
};
|
package/common125.mjs
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import "./common28.mjs";
|
|
2
|
+
import { getAmountAfterRelayAndFlatFees as k, getAmountAfterRelayAndFlatFeesAndSlippage as b, getAmountAfterSlippage as L } from "./common29.mjs";
|
|
3
|
+
import "./common30.mjs";
|
|
4
|
+
import "./common31.mjs";
|
|
5
|
+
import "./common33.mjs";
|
|
6
|
+
import "./common35.mjs";
|
|
7
|
+
import "./common36.mjs";
|
|
8
|
+
import "./common41.mjs";
|
|
9
|
+
import "./common42.mjs";
|
|
10
|
+
import { FeeOverTransactionValueError as S } from "./common79.mjs";
|
|
11
|
+
import { absBigInt as W } from "./common114.mjs";
|
|
12
|
+
import "ethers";
|
|
13
|
+
import "axios";
|
|
14
|
+
import "circomlibjs";
|
|
15
|
+
import "./common51.mjs";
|
|
16
|
+
import "./common50.mjs";
|
|
17
|
+
import { isBeefyDeposit as R } from "./common156.mjs";
|
|
18
|
+
import "./common157.mjs";
|
|
19
|
+
import { INTERACTION as p } from "./common160.mjs";
|
|
20
|
+
import { SlippageType as _ } from "./common163.mjs";
|
|
21
|
+
import "./common164.mjs";
|
|
22
|
+
import "./common168.mjs";
|
|
23
|
+
import "./common139.mjs";
|
|
24
|
+
import "./common117.mjs";
|
|
25
|
+
import "./common72.mjs";
|
|
26
|
+
import "./common121.mjs";
|
|
27
|
+
import { getInteractionFromAction as d } from "./common122.mjs";
|
|
28
|
+
import "./common129.mjs";
|
|
29
|
+
import "./common191.mjs";
|
|
30
|
+
import "libsodium-wrappers";
|
|
31
|
+
import "./common77.mjs";
|
|
32
|
+
const A = (T, r, E) => {
|
|
33
|
+
const N = W(T) - r;
|
|
34
|
+
if (r < 0n)
|
|
35
|
+
throw new S({
|
|
36
|
+
totalFeeWEI: N,
|
|
37
|
+
feeUnit: E
|
|
38
|
+
});
|
|
39
|
+
return r;
|
|
40
|
+
}, h = ({
|
|
41
|
+
erc20Addresses: T = [],
|
|
42
|
+
amountChanges: r,
|
|
43
|
+
flatFees: E,
|
|
44
|
+
feeUnit: c,
|
|
45
|
+
externalActionId: N,
|
|
46
|
+
action: D,
|
|
47
|
+
gasTokenAddress: w
|
|
48
|
+
}) => {
|
|
49
|
+
const P = d(N, D);
|
|
50
|
+
if (P === p.NONE)
|
|
51
|
+
throw Error("No interaction was choosen");
|
|
52
|
+
switch (P) {
|
|
53
|
+
case p.WITHDRAW: {
|
|
54
|
+
A(
|
|
55
|
+
r[0],
|
|
56
|
+
k(r[0], E[0], !0),
|
|
57
|
+
c
|
|
58
|
+
);
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
case p.SWAP: {
|
|
62
|
+
r[1] = A(
|
|
63
|
+
r[1],
|
|
64
|
+
b(r[1], E[1], _.Swap),
|
|
65
|
+
c
|
|
66
|
+
);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
case p.CURVE_DEPOSIT: {
|
|
70
|
+
const i = r.length - 1;
|
|
71
|
+
r[i] = A(
|
|
72
|
+
r[i],
|
|
73
|
+
b(r[i], E[i], _.CurveDeposit),
|
|
74
|
+
c
|
|
75
|
+
);
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
case p.CURVE_WITHDRAW:
|
|
79
|
+
E.forEach((i, I) => {
|
|
80
|
+
i > 0n ? r[I] = A(
|
|
81
|
+
r[I],
|
|
82
|
+
b(r[I], i, _.CurveWithdraw),
|
|
83
|
+
c
|
|
84
|
+
) : i === 0n && r[I] > 0n && I !== E.length - 1 && (r[I] = L(r[I], _.CurveWithdraw));
|
|
85
|
+
});
|
|
86
|
+
break;
|
|
87
|
+
case p.CURVE_WITHDRAW_INBALANCED:
|
|
88
|
+
break;
|
|
89
|
+
case p.STAKING:
|
|
90
|
+
r[0] = A(
|
|
91
|
+
r[0],
|
|
92
|
+
k(r[1], E[1]),
|
|
93
|
+
c
|
|
94
|
+
);
|
|
95
|
+
break;
|
|
96
|
+
case p.UNSTAKING:
|
|
97
|
+
r[1] = A(
|
|
98
|
+
r[1],
|
|
99
|
+
k(r[0], E[0]),
|
|
100
|
+
c
|
|
101
|
+
);
|
|
102
|
+
break;
|
|
103
|
+
case p.CLAIMING:
|
|
104
|
+
r[1] = A(
|
|
105
|
+
r[1],
|
|
106
|
+
k(r[1], E[1]),
|
|
107
|
+
c
|
|
108
|
+
);
|
|
109
|
+
break;
|
|
110
|
+
case p.BEEFY: {
|
|
111
|
+
const i = R(D) ? 1 : 0;
|
|
112
|
+
r[i] = A(
|
|
113
|
+
r[i],
|
|
114
|
+
b(
|
|
115
|
+
r[i],
|
|
116
|
+
E[i],
|
|
117
|
+
_.Beefy
|
|
118
|
+
),
|
|
119
|
+
c
|
|
120
|
+
);
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
case p.BEEFY_STAKE:
|
|
124
|
+
r[0] = A(
|
|
125
|
+
r[0],
|
|
126
|
+
k(r[1], E[1]),
|
|
127
|
+
c
|
|
128
|
+
);
|
|
129
|
+
break;
|
|
130
|
+
case p.BEEFY_UNSTAKE:
|
|
131
|
+
r[1] = A(
|
|
132
|
+
r[1],
|
|
133
|
+
k(r[0], E[0]),
|
|
134
|
+
c
|
|
135
|
+
);
|
|
136
|
+
break;
|
|
137
|
+
case p.BEEFY_GET_REWARDS:
|
|
138
|
+
r[1] = A(
|
|
139
|
+
r[1],
|
|
140
|
+
k(r[1], E[1]),
|
|
141
|
+
c
|
|
142
|
+
);
|
|
143
|
+
break;
|
|
144
|
+
case p.LIDO_STAKE:
|
|
145
|
+
r[0] = A(
|
|
146
|
+
r[0],
|
|
147
|
+
k(r[0], E[0]),
|
|
148
|
+
c
|
|
149
|
+
);
|
|
150
|
+
break;
|
|
151
|
+
case p.LIDO_REQUEST:
|
|
152
|
+
A(
|
|
153
|
+
r[1],
|
|
154
|
+
k(r[1], E[1]),
|
|
155
|
+
c
|
|
156
|
+
);
|
|
157
|
+
break;
|
|
158
|
+
case p.LIDO_CLAIM:
|
|
159
|
+
r[1] = A(
|
|
160
|
+
r[1],
|
|
161
|
+
k(r[1], E[1]),
|
|
162
|
+
c
|
|
163
|
+
);
|
|
164
|
+
break;
|
|
165
|
+
case p.PENDLE_TRANSACT:
|
|
166
|
+
r[0] < 0n && A(
|
|
167
|
+
r[0],
|
|
168
|
+
k(r[0], E[0], !0),
|
|
169
|
+
c
|
|
170
|
+
);
|
|
171
|
+
break;
|
|
172
|
+
case p.PENDLE_YT_IN_SWAP:
|
|
173
|
+
r[1] = A(
|
|
174
|
+
r[1],
|
|
175
|
+
k(r[1], E[1]),
|
|
176
|
+
c
|
|
177
|
+
);
|
|
178
|
+
break;
|
|
179
|
+
case p.PENDLE_YT_OUT_SWAP:
|
|
180
|
+
break;
|
|
181
|
+
case p.PENDLE_PT_SWAP:
|
|
182
|
+
r[1] = A(
|
|
183
|
+
r[1],
|
|
184
|
+
k(r[1], E[1]),
|
|
185
|
+
c
|
|
186
|
+
);
|
|
187
|
+
break;
|
|
188
|
+
case p.PENDLE_MINT:
|
|
189
|
+
r[1] = A(
|
|
190
|
+
r[1],
|
|
191
|
+
k(r[1], E[1]),
|
|
192
|
+
c
|
|
193
|
+
);
|
|
194
|
+
break;
|
|
195
|
+
case p.PENDLE_REDEEM:
|
|
196
|
+
r[2] = A(
|
|
197
|
+
r[2],
|
|
198
|
+
k(r[2], E[2]),
|
|
199
|
+
c
|
|
200
|
+
);
|
|
201
|
+
break;
|
|
202
|
+
case p.PENDLE_CLAIM:
|
|
203
|
+
r[1] = A(
|
|
204
|
+
r[1],
|
|
205
|
+
k(r[1], E[1]),
|
|
206
|
+
c
|
|
207
|
+
);
|
|
208
|
+
break;
|
|
209
|
+
case p.PENDLE_LP: {
|
|
210
|
+
const i = r.findIndex((I) => I > 0n);
|
|
211
|
+
r[i] = A(
|
|
212
|
+
r[i],
|
|
213
|
+
b(r[i], E[i], _.Pendle)
|
|
214
|
+
);
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
case p.PENDLE_LP_CLAIM:
|
|
218
|
+
r[1] = A(
|
|
219
|
+
r[1],
|
|
220
|
+
k(r[1], E[1]),
|
|
221
|
+
c
|
|
222
|
+
);
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
return r;
|
|
226
|
+
};
|
|
227
|
+
export {
|
|
228
|
+
h as processAmountChanges
|
|
229
|
+
};
|
package/common126.mjs
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { isBeefyDeposit as S } from "./common156.mjs";
|
|
2
|
+
import "./common157.mjs";
|
|
3
|
+
import { INTERACTION as a } from "./common160.mjs";
|
|
4
|
+
import "./common164.mjs";
|
|
5
|
+
import "./common168.mjs";
|
|
6
|
+
import "ethers";
|
|
7
|
+
import "axios";
|
|
8
|
+
import "./common28.mjs";
|
|
9
|
+
import "circomlibjs";
|
|
10
|
+
import "./common51.mjs";
|
|
11
|
+
import "./common139.mjs";
|
|
12
|
+
import "./common191.mjs";
|
|
13
|
+
import "./common50.mjs";
|
|
14
|
+
import "./common117.mjs";
|
|
15
|
+
import { getInteractionFromAction as I } from "./common122.mjs";
|
|
16
|
+
import { processGasEstimates as W } from "./common124.mjs";
|
|
17
|
+
import "libsodium-wrappers";
|
|
18
|
+
import "./common42.mjs";
|
|
19
|
+
import "./common31.mjs";
|
|
20
|
+
import "./common35.mjs";
|
|
21
|
+
import "./common33.mjs";
|
|
22
|
+
import "./common77.mjs";
|
|
23
|
+
import "./common72.mjs";
|
|
24
|
+
import "./common30.mjs";
|
|
25
|
+
import "./common36.mjs";
|
|
26
|
+
import "./common41.mjs";
|
|
27
|
+
import { getERC20Token as k } from "./common118.mjs";
|
|
28
|
+
import "./common121.mjs";
|
|
29
|
+
import "./common129.mjs";
|
|
30
|
+
const Z = async (r, o, D, N, L, m) => {
|
|
31
|
+
let t;
|
|
32
|
+
const n = I(D, L);
|
|
33
|
+
if (n === a.NONE)
|
|
34
|
+
throw Error("No interaction was choosen");
|
|
35
|
+
let T, b, _;
|
|
36
|
+
switch (n) {
|
|
37
|
+
case a.WITHDRAW:
|
|
38
|
+
t = k(o[0], r);
|
|
39
|
+
break;
|
|
40
|
+
case a.SWAP:
|
|
41
|
+
t = k(o[1], r);
|
|
42
|
+
break;
|
|
43
|
+
case a.CURVE_DEPOSIT:
|
|
44
|
+
t = k(o[o.length - 1], r);
|
|
45
|
+
break;
|
|
46
|
+
case a.CURVE_WITHDRAW: {
|
|
47
|
+
if (_ = o.findIndex(
|
|
48
|
+
(P) => P.toLowerCase() === m?.toLowerCase()
|
|
49
|
+
), console.log({ curveWithdrawGasTokenAddress: m, withdrawTokenIndex: _ }), _ === -1)
|
|
50
|
+
throw Error("Curve Withdraw Token Index not found");
|
|
51
|
+
t = k(o[_], r);
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
case a.STAKING:
|
|
55
|
+
case a.UNSTAKING:
|
|
56
|
+
t = k(o[1], r);
|
|
57
|
+
break;
|
|
58
|
+
case a.CLAIMING:
|
|
59
|
+
t = k(o[1], r);
|
|
60
|
+
break;
|
|
61
|
+
case a.BEEFY:
|
|
62
|
+
T = S(L) ? 1 : 0, t = k(o[T], r);
|
|
63
|
+
break;
|
|
64
|
+
case a.BEEFY_STAKE:
|
|
65
|
+
case a.BEEFY_UNSTAKE:
|
|
66
|
+
t = k(o[1], r);
|
|
67
|
+
break;
|
|
68
|
+
case a.BEEFY_GET_REWARDS:
|
|
69
|
+
t = k(o[1], r);
|
|
70
|
+
break;
|
|
71
|
+
case a.LIDO_STAKE:
|
|
72
|
+
t = k(o[0], r);
|
|
73
|
+
break;
|
|
74
|
+
case a.LIDO_REQUEST:
|
|
75
|
+
t = k(o[1], r);
|
|
76
|
+
break;
|
|
77
|
+
case a.LIDO_CLAIM:
|
|
78
|
+
t = k(o[1], r);
|
|
79
|
+
break;
|
|
80
|
+
case a.PENDLE_TRANSACT:
|
|
81
|
+
t = k(o[0], r);
|
|
82
|
+
break;
|
|
83
|
+
case a.PENDLE_YT_IN_SWAP:
|
|
84
|
+
t = k(o[1], r);
|
|
85
|
+
break;
|
|
86
|
+
case a.PENDLE_YT_OUT_SWAP:
|
|
87
|
+
t = k(o[0], r);
|
|
88
|
+
break;
|
|
89
|
+
case a.PENDLE_PT_SWAP:
|
|
90
|
+
t = k(o[1], r);
|
|
91
|
+
break;
|
|
92
|
+
case a.PENDLE_MINT:
|
|
93
|
+
t = k(o[1], r);
|
|
94
|
+
break;
|
|
95
|
+
case a.PENDLE_REDEEM:
|
|
96
|
+
t = k(o[2], r);
|
|
97
|
+
break;
|
|
98
|
+
case a.PENDLE_CLAIM:
|
|
99
|
+
t = k(o[1], r);
|
|
100
|
+
break;
|
|
101
|
+
case a.VOLATILE_WITHDRAW:
|
|
102
|
+
t = k(o[0], r);
|
|
103
|
+
break;
|
|
104
|
+
case a.VOLATILE_SWAP:
|
|
105
|
+
t = k(o[1], r);
|
|
106
|
+
break;
|
|
107
|
+
case a.PENDLE_LP:
|
|
108
|
+
b = N.findIndex((P) => P > 0), t = k(o[b], r);
|
|
109
|
+
break;
|
|
110
|
+
case a.PENDLE_LP_CLAIM:
|
|
111
|
+
t = k(o[1], r);
|
|
112
|
+
break;
|
|
113
|
+
case a.EMPORIUM:
|
|
114
|
+
}
|
|
115
|
+
let E, p;
|
|
116
|
+
const i = N.length;
|
|
117
|
+
t && ({ priceOfTransactionInToken: E, priceOfTransactionInUSD: p } = await W(
|
|
118
|
+
r,
|
|
119
|
+
t,
|
|
120
|
+
D,
|
|
121
|
+
L,
|
|
122
|
+
i
|
|
123
|
+
));
|
|
124
|
+
const e = new Array(i).fill(0n);
|
|
125
|
+
switch (n) {
|
|
126
|
+
case a.WITHDRAW:
|
|
127
|
+
e[0] = E || 0n;
|
|
128
|
+
break;
|
|
129
|
+
case a.SWAP:
|
|
130
|
+
e[1] = E || 0n;
|
|
131
|
+
break;
|
|
132
|
+
case a.CURVE_DEPOSIT:
|
|
133
|
+
e[e.length - 1] = E || 0n;
|
|
134
|
+
break;
|
|
135
|
+
case a.CURVE_WITHDRAW:
|
|
136
|
+
_ !== void 0 && (e[_] = E || 0n);
|
|
137
|
+
break;
|
|
138
|
+
case a.STAKING:
|
|
139
|
+
case a.UNSTAKING:
|
|
140
|
+
e[1] = E || 0n, e[0] = E || 0n;
|
|
141
|
+
break;
|
|
142
|
+
case a.CLAIMING:
|
|
143
|
+
e[1] = E || 0n;
|
|
144
|
+
break;
|
|
145
|
+
case a.BEEFY:
|
|
146
|
+
T && (e[T] = E || 0n);
|
|
147
|
+
break;
|
|
148
|
+
case a.BEEFY_STAKE:
|
|
149
|
+
e[1] = E || 0n, e[0] = E || 0n;
|
|
150
|
+
break;
|
|
151
|
+
case a.BEEFY_GET_REWARDS:
|
|
152
|
+
e[1] = E || 0n;
|
|
153
|
+
break;
|
|
154
|
+
case a.LIDO_STAKE:
|
|
155
|
+
e[0] = E || 0n;
|
|
156
|
+
break;
|
|
157
|
+
case a.LIDO_REQUEST:
|
|
158
|
+
e[1] = E || 0n;
|
|
159
|
+
break;
|
|
160
|
+
case a.LIDO_CLAIM:
|
|
161
|
+
e[1] = E || 0n;
|
|
162
|
+
break;
|
|
163
|
+
case a.PENDLE_TRANSACT:
|
|
164
|
+
e[0] = E || 0n;
|
|
165
|
+
break;
|
|
166
|
+
case a.PENDLE_YT_IN_SWAP:
|
|
167
|
+
e[1] = E || 0n;
|
|
168
|
+
break;
|
|
169
|
+
case a.PENDLE_YT_OUT_SWAP:
|
|
170
|
+
e[0] = E || 0n;
|
|
171
|
+
break;
|
|
172
|
+
case a.PENDLE_PT_SWAP:
|
|
173
|
+
e[1] = E || 0n;
|
|
174
|
+
break;
|
|
175
|
+
case a.PENDLE_MINT:
|
|
176
|
+
e[1] = E || 0n;
|
|
177
|
+
break;
|
|
178
|
+
case a.PENDLE_REDEEM:
|
|
179
|
+
e[2] = E || 0n;
|
|
180
|
+
break;
|
|
181
|
+
case a.PENDLE_CLAIM:
|
|
182
|
+
e[1] = E || 0n;
|
|
183
|
+
break;
|
|
184
|
+
case a.VOLATILE_WITHDRAW:
|
|
185
|
+
e[0] = E || 0n;
|
|
186
|
+
break;
|
|
187
|
+
case a.VOLATILE_SWAP:
|
|
188
|
+
e[1] = E || 0n;
|
|
189
|
+
break;
|
|
190
|
+
case a.PENDLE_LP:
|
|
191
|
+
b !== void 0 && (e[b] = E || 0n);
|
|
192
|
+
break;
|
|
193
|
+
case a.PENDLE_LP_CLAIM:
|
|
194
|
+
e[1] = E || 0n;
|
|
195
|
+
break;
|
|
196
|
+
case a.EMPORIUM:
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
return { flatFees: e, priceOfTransactionInToken: E, feeUnit: t, priceOfTransactionInUSD: p };
|
|
200
|
+
};
|
|
201
|
+
export {
|
|
202
|
+
Z as getFlatFees
|
|
203
|
+
};
|