@hinkal/common 0.0.111 → 0.0.113
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/index-DXElTGy9.mjs +254449 -0
- package/index.js +455 -642
- package/package.json +1 -1
- package/{webworker/snarkjsWorker/snarkjsWorkerLogic.js → snarkjsWorkerLogic-CVna_BW9.mjs} +1 -1
- package/utxoWorkerLogic-B1Hh-bq4.mjs +64 -0
- package/{webworker/workerProxy.js → workerProxy-BDj498Ht.mjs} +1 -1
- package/zkProofWorkerLogic-D9rxuuiK.mjs +60 -0
- package/API/API.js +0 -58
- package/API/HinkalPointsCalls.js +0 -38
- package/API/callBeefyGraphAPI.js +0 -37
- package/API/callCurveAPI.js +0 -156
- package/API/callMonitor.js +0 -30
- package/API/callOdosAPI.js +0 -44
- package/API/callOneInchAPI.js +0 -37
- package/API/callRelayer.js +0 -32
- package/API/checkRisk.js +0 -30
- package/API/dataServerCalls.js +0 -32
- package/API/fetchCommitmentsCache.js +0 -31
- package/API/fetchNullifiers.js +0 -30
- package/API/getAxelarGasEstimate.js +0 -37
- package/API/getCoingeckoPrice.js +0 -27
- package/API/getConnextReceiveFee.js +0 -30
- package/API/getGasEstimates.js +0 -38
- package/API/getRelayerURL.js +0 -32
- package/API/getServerURL.js +0 -67
- package/API/getTokenPrice.js +0 -41
- package/API/kycCalls.js +0 -32
- package/API/passwordCalls.js +0 -36
- package/API/referralProgramCalls.js +0 -58
- package/API/relayCalls.js +0 -30
- package/API/restoreSnapshots.js +0 -32
- package/API/rewardsPointsCalls.js +0 -40
- package/API/userVerifyTransactions.js +0 -45
- package/constants/assets.constants.js +0 -16
- package/constants/axelar.constants.js +0 -55
- package/constants/backend.constants.js +0 -18
- package/constants/beefy.registry.js +0 -24
- package/constants/chains.constants.js +0 -204
- package/constants/coingecko.constants.js +0 -53
- package/constants/contracts.constants.js +0 -276
- package/constants/crvCvx.registry.js +0 -636
- package/constants/crvDynamic.registry.js +0 -24
- package/constants/deploy-data/deploy-data-arbMainnet.json.js +0 -7415
- package/constants/deploy-data/deploy-data-avalanche.json.js +0 -7411
- package/constants/deploy-data/deploy-data-axelar1.json.js +0 -4329
- package/constants/deploy-data/deploy-data-axelar2.json.js +0 -4329
- package/constants/deploy-data/deploy-data-base.json.js +0 -8425
- package/constants/deploy-data/deploy-data-blast.json.js +0 -9600
- package/constants/deploy-data/deploy-data-bnbMainnet.json.js +0 -6877
- package/constants/deploy-data/deploy-data-ethMainnet.json.js +0 -11427
- package/constants/deploy-data/deploy-data-localhost.json.js +0 -13283
- package/constants/deploy-data/deploy-data-optimism.json.js +0 -7417
- package/constants/deploy-data/deploy-data-polygon.json.js +0 -7439
- package/constants/fees.constants.js +0 -57
- package/constants/kyc.constants.js +0 -118
- package/constants/lido.constants.js +0 -13
- package/constants/pendle.registry.js +0 -253
- package/constants/protocol.constants.js +0 -26
- package/constants/reorg-depths.constants.js +0 -15
- package/constants/rewards.constants.js +0 -27
- package/constants/server.constants.js +0 -157
- package/constants/token-data/ERC20Registry.js +0 -85
- package/constants/token-data/arbMainnetRegistry.json.js +0 -946
- package/constants/token-data/arbMainnetRegistryFixed.json.js +0 -856
- package/constants/token-data/avalancheRegistry.json.js +0 -591
- package/constants/token-data/avalancheRegistryFixed.json.js +0 -591
- package/constants/token-data/baseRegistry.json.js +0 -490
- package/constants/token-data/baseRegistryFixed.json.js +0 -463
- package/constants/token-data/blastRegistry.json.js +0 -137
- package/constants/token-data/blastRegistryFixed.json.js +0 -137
- package/constants/token-data/bnbMainnetRegistry.json.js +0 -973
- package/constants/token-data/bnbMainnetRegistryFixed.json.js +0 -973
- package/constants/token-data/coingeckoRegistry.json.js +0 -115623
- package/constants/token-data/ethMainnetRegistry.json.js +0 -2700
- package/constants/token-data/ethMainnetRegistryFixed.json.js +0 -2251
- package/constants/token-data/index.js +0 -6
- package/constants/token-data/localhostRegistry.json.js +0 -2768
- package/constants/token-data/optimismRegistry.json.js +0 -1455
- package/constants/token-data/optimismRegistryFixed.json.js +0 -1392
- package/constants/token-data/polygonRegistry.json.js +0 -1327
- package/constants/token-data/polygonRegistryFixed.json.js +0 -1255
- package/constants/token-data/popularTokens.constants.js +0 -14
- package/constants/token-data/tokenPricing.consts.js +0 -8
- package/constants/vite.constants.js +0 -29
- package/crypto/babyJub.js +0 -15
- package/crypto/poseidon.js +0 -26
- package/crypto/preProcessing.js +0 -9
- package/data-structures/Hinkal/Hinkal.js +0 -299
- package/data-structures/Hinkal/hinkalActionBeefy.js +0 -101
- package/data-structures/Hinkal/hinkalActionConvex.js +0 -83
- package/data-structures/Hinkal/hinkalActionCurve.js +0 -112
- package/data-structures/Hinkal/hinkalActionLidoEth.js +0 -91
- package/data-structures/Hinkal/hinkalActionPendle.js +0 -140
- package/data-structures/Hinkal/hinkalActionPendleLP.js +0 -96
- package/data-structures/Hinkal/hinkalActionStake.js +0 -138
- package/data-structures/Hinkal/hinkalActionVolatile.js +0 -112
- package/data-structures/Hinkal/hinkalDeposit.js +0 -95
- package/data-structures/Hinkal/hinkalGetZkMeProvider.js +0 -47
- package/data-structures/Hinkal/hinkalPrivateWallet.js +0 -66
- package/data-structures/Hinkal/hinkalSwap.js +0 -98
- package/data-structures/Hinkal/hinkalTransfer.js +0 -5
- package/data-structures/Hinkal/hinkalWithdraw.js +0 -91
- package/data-structures/Hinkal/resetMerkleTrees.js +0 -49
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.js +0 -83
- package/data-structures/ValueCache/ValueCache.js +0 -25
- package/data-structures/crypto-keys/decodeUTXO.js +0 -40
- package/data-structures/crypto-keys/encryptDecryptUtxo.js +0 -41
- package/data-structures/crypto-keys/keyUtils.js +0 -10
- package/data-structures/crypto-keys/keys.js +0 -90
- package/data-structures/custom-token-registry/CustomTokenRegistry.js +0 -33
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.js +0 -131
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.js +0 -132
- package/data-structures/event-service/AbstractEventService.js +0 -118
- package/data-structures/event-service/AbstractNullifierSnapshotService.js +0 -59
- package/data-structures/event-service/AbstractSnapshotService.js +0 -35
- package/data-structures/merkle-tree/MerkleTree.js +0 -177
- package/data-structures/merkle-tree/MerkleTreeIncompleteError.js +0 -8
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.js +0 -48
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.js +0 -47
- package/data-structures/snapshot/ClientNullifierSnapshotService.js +0 -44
- package/data-structures/token-price-fetcher/TokenChecker.js +0 -29
- package/data-structures/token-price-fetcher/TokenPriceFetcher.js +0 -218
- package/data-structures/transactions-manager/TransactionsManager.js +0 -194
- package/data-structures/transactions-manager/history/getBeefyData.js +0 -68
- package/data-structures/transactions-manager/history/getConvexData.js +0 -57
- package/data-structures/transactions-manager/history/getCurveData.js +0 -97
- package/data-structures/transactions-manager/history/getDepositData.js +0 -36
- package/data-structures/transactions-manager/history/getLidoData.js +0 -44
- package/data-structures/transactions-manager/history/getPendleData.js +0 -59
- package/data-structures/transactions-manager/history/getSwapData.js +0 -43
- package/data-structures/transactions-manager/history/getTxDetails.js +0 -74
- package/data-structures/transactions-manager/history/getVolatileData.js +0 -75
- package/data-structures/transactions-manager/history/history.types.js +0 -62
- package/data-structures/transactions-manager/history/history.utils.js +0 -8
- package/data-structures/utxo/Utxo.js +0 -134
- package/data-structures/volatile-helper/VolatileHelper.js +0 -181
- package/error-handling/customErrors/ErrorWithAmount.js +0 -9
- package/error-handling/customErrors/FeeOverTransactionValueError.js +0 -9
- package/error-handling/customErrors/customErrors.helpers.js +0 -21
- package/error-handling/error-codes.constants.js +0 -184
- package/error-handling/get-error.message.js +0 -53
- package/error-handling/handleErrorRestore.js +0 -35
- package/error-handling/logError.js +0 -7
- package/error-handling/types.js +0 -4
- package/externalABIs/BUSD.js +0 -519
- package/externalABIs/BabPassport.json.js +0 -24
- package/externalABIs/BeefyRouterAbi.json.js +0 -1022
- package/externalABIs/BeefyStrategyAbi.json.js +0 -1423
- package/externalABIs/BeefyVaultAbi.json.js +0 -570
- package/externalABIs/BeefyZapAbi.json.js +0 -208
- package/externalABIs/BeefyZapOneInchAbi.json.js +0 -340
- package/externalABIs/ConvexBoosterAbi.json.js +0 -674
- package/externalABIs/ConvexBoosterAbiMainnet.json.js +0 -1002
- package/externalABIs/ConvexRewardPoolAbi.json.js +0 -883
- package/externalABIs/CurveReadingWrapperAbi.json.js +0 -1422
- package/externalABIs/CurveWrappedMainPool.json.js +0 -1136
- package/externalABIs/CurveZap.json.js +0 -262
- package/externalABIs/CvxCrvUtilities.json.js +0 -264
- package/externalABIs/DAI.js +0 -334
- package/externalABIs/ERC20.json.js +0 -291
- package/externalABIs/GalxePassport.json.js +0 -41
- package/externalABIs/IQuoterV2.json.js +0 -205
- package/externalABIs/ISwapRouter.json.js +0 -568
- package/externalABIs/IUniswapV3Factory.json.js +0 -201
- package/externalABIs/IUniswapV3Pool.json.js +0 -999
- package/externalABIs/LidoStEthAbi.json.js +0 -1603
- package/externalABIs/LidoStMaticAbi.json.js +0 -1764
- package/externalABIs/LidoStakeManagerAbi.json.js +0 -2082
- package/externalABIs/LidoWithdrawalQueueERC721Abi.json.js +0 -2030
- package/externalABIs/LidoWstEthAbi.json.js +0 -480
- package/externalABIs/OptimismGasPriceOracle.json.js +0 -206
- package/externalABIs/PendleRouterAbi.json.js +0 -173
- package/externalABIs/PoLidoNftAbi.json.js +0 -701
- package/externalABIs/SanctionsList.js +0 -89
- package/externalABIs/USDC.js +0 -721
- package/externalABIs/USDR.js +0 -346
- package/externalABIs/USDR3CRV.js +0 -542
- package/externalABIs/USDT.js +0 -393
- package/externalABIs/UniswapV2PoolAbi.json.js +0 -80
- package/externalABIs/WETH.js +0 -156
- package/externalABIs/amToken.js +0 -350
- package/externalABIs/transactionsProver.json.js +0 -39
- package/functions/kyc/authentoHelper.js +0 -42
- package/functions/kyc/passportHelper.js +0 -39
- package/functions/kyc/zkMeHelper.js +0 -56
- package/functions/pre-transaction/getFlatFees.js +0 -203
- package/functions/pre-transaction/interaction-to-action.js +0 -57
- package/functions/pre-transaction/outputUtxoProcessing.js +0 -45
- package/functions/pre-transaction/process-gas-estimates.js +0 -57
- package/functions/pre-transaction/processAmountChanges.js +0 -229
- package/functions/private-wallet/emporium.helpers.js +0 -19
- package/functions/private-wallet/opProducer.js +0 -24
- package/functions/protocols/convex.protocols.js +0 -41
- package/functions/protocols/curve.protocols.js +0 -45
- package/functions/protocols/pendle.helpers.js +0 -108
- package/functions/snarkjs/common.snarkjs.js +0 -96
- package/functions/snarkjs/constant.js +0 -211
- package/functions/snarkjs/constructEmporiumProof.js +0 -105
- package/functions/snarkjs/constructGeneralZkProof.js +0 -129
- package/functions/snarkjs/generateCircomData.js +0 -60
- package/functions/snarkjs/generateZkProof.js +0 -18
- package/functions/snarkjs/getZKFiles.js +0 -30
- package/functions/staking/index.js +0 -40
- package/functions/utils/amounts.utils.js +0 -70
- package/functions/utils/axelar.utils.js +0 -38
- package/functions/utils/cacheFunctions.js +0 -67
- package/functions/utils/caseInsensitive.utils.js +0 -6
- package/functions/utils/convertIntegrationProviderToExternalActionId.js +0 -16
- package/functions/utils/create-provider.js +0 -5
- package/functions/utils/enum.utils.js +0 -14
- package/functions/utils/erc20tokenFunctions.js +0 -20
- package/functions/utils/evmNetworkFunctions.js +0 -29
- package/functions/utils/external-action.utils.js +0 -61
- package/functions/utils/getDataFromTransaction.js +0 -105
- package/functions/utils/memoize.utils.js +0 -14
- package/functions/utils/nickname.utils.js +0 -7
- package/functions/utils/process.utils.js +0 -4
- package/functions/utils/reloadPage.js +0 -4
- package/functions/utils/requireEnv.js +0 -7
- package/functions/utils/resolve-sync.utils.js +0 -22
- package/functions/utils/serialize.utils.js +0 -4
- package/functions/utils/string.utils.js +0 -14
- package/functions/utils/time.utils.js +0 -8
- package/functions/utils/userAgent.js +0 -15
- package/functions/utils/volatile-patcher.utils.js +0 -40
- package/functions/web3/etherFunctions.js +0 -41
- package/functions/web3/events/balanceChangedHandler.js +0 -10
- package/functions/web3/events/getInputUtxoAndBalance.js +0 -72
- package/functions/web3/events/getShieldedBalance.js +0 -107
- package/functions/web3/events/web3RetrieveEvents.js +0 -9
- package/functions/web3/functionCalls/accessTokenCalls.js +0 -48
- package/functions/web3/functionCalls/approveToken.js +0 -153
- package/functions/web3/functionCalls/estimateGasRelayer.js +0 -18
- package/functions/web3/functionCalls/transactCallDirect.js +0 -60
- package/functions/web3/functionCalls/transactCallRelayer.js +0 -42
- package/functions/web3/odosAPI.js +0 -65
- package/functions/web3/oneInchAPI.js +0 -61
- package/functions/web3/runContractFunction.js +0 -95
- package/functions/web3/uniswapAPI.js +0 -97
- package/types/beefy.types.js +0 -21
- package/types/circom-data.types.js +0 -22
- package/types/curve.types.js +0 -25
- package/types/ethereum-network.types.js +0 -4
- package/types/external-action.types.js +0 -4
- package/types/hinkal.stake.types.js +0 -4
- package/types/hinkal.types.js +0 -15
- package/types/kyc.types.js +0 -13
- package/types/pendle.types.js +0 -15
- package/types/rewards.types.js +0 -27
- package/types/slippage.types.js +0 -15
- package/types/time.types.js +0 -58
- package/types/token.types.js +0 -4
- package/types/transactions.types.js +0 -36
- package/webworker/performTaskWithWorker.js +0 -62
- package/webworker/snarkjsWorker/snarkjsWorker.types.js +0 -4
- package/webworker/utxoWorker/utxoWorker.types.js +0 -4
- package/webworker/utxoWorker/utxoWorkerLogic.js +0 -70
- package/webworker/worker.registry.js +0 -4
- package/webworker/workerFactory.js +0 -42
- package/webworker/zkProofWorker/zkProofWorker.types.js +0 -4
- package/webworker/zkProofWorker/zkProofWorkerLogic.js +0 -66
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { W as k } from "./workerProxy-BDj498Ht.mjs";
|
|
2
2
|
import * as c from "snarkjs";
|
|
3
3
|
const $ = typeof process < "u" && process.versions != null && process.versions.node != null, i = (
|
|
4
4
|
// @ts-expect-error webpack check is done like this
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { U as p, d as h, e as y, f, g as U, l as d, h as g, b as x, i as u } from "./index-DXElTGy9.mjs";
|
|
2
|
+
import { W as T } from "./workerProxy-BDj498Ht.mjs";
|
|
3
|
+
const i = new T(), v = async ({ data: e }) => {
|
|
4
|
+
const { utxos: s, nullifiers: r } = e, o = s.filter((t) => {
|
|
5
|
+
const c = new p(t);
|
|
6
|
+
return !r.has(c.getNullifier());
|
|
7
|
+
});
|
|
8
|
+
i.postMessageToMainThread(o);
|
|
9
|
+
}, k = async ({ data: e }) => {
|
|
10
|
+
const s = new h(e.signature), r = s.getShieldedPrivateKey(), o = e.encryptedOutputs.map((t) => {
|
|
11
|
+
try {
|
|
12
|
+
return t.isPositive ? y(Buffer.from(t.value.slice(2), "hex"), s) : f(t.value, r);
|
|
13
|
+
} catch {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
}).filter((t) => t !== void 0);
|
|
17
|
+
i.postMessageToMainThread(o);
|
|
18
|
+
}, m = async ({ data: e }) => {
|
|
19
|
+
const s = new h(e.signature), r = [], { encryptedOutputs: o } = e;
|
|
20
|
+
let { lastOutput: t } = e;
|
|
21
|
+
for (let c = 0; c < o.length; c += 1) {
|
|
22
|
+
const a = o[c];
|
|
23
|
+
if (t = a.value, a.isPositive)
|
|
24
|
+
try {
|
|
25
|
+
const n = U(Buffer.from(t.slice(2), "hex"), s);
|
|
26
|
+
if (!n.erc20TokenAddress || !n.amount || !n.stealthAddress)
|
|
27
|
+
throw Error("bruh");
|
|
28
|
+
r.map((l) => l.value).includes(a.value) || r.push(a);
|
|
29
|
+
} catch {
|
|
30
|
+
d("Utxo not decrypted");
|
|
31
|
+
}
|
|
32
|
+
else
|
|
33
|
+
try {
|
|
34
|
+
g(t, s.getShieldedPrivateKey()) && (r.map((l) => l.value).includes(a.value) || r.push(a));
|
|
35
|
+
} catch {
|
|
36
|
+
d("Utxo not decoded");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
i.postMessageToMainThread({ additionalEncryptedOutputs: r, lastOutput: t });
|
|
40
|
+
}, w = async (e) => {
|
|
41
|
+
await x();
|
|
42
|
+
const { type: s } = e.payload;
|
|
43
|
+
switch (s) {
|
|
44
|
+
case u.BATCH_FILTER_UTXOS_WITH_NULLIFIER:
|
|
45
|
+
v(e.payload);
|
|
46
|
+
return;
|
|
47
|
+
case u.BUILD_UTXOS:
|
|
48
|
+
k(e.payload);
|
|
49
|
+
return;
|
|
50
|
+
case u.DECIPHER_OUTPUTS:
|
|
51
|
+
m(e.payload);
|
|
52
|
+
return;
|
|
53
|
+
default:
|
|
54
|
+
throw Error(`Unknown worker message type ${s}`);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
i.attachWorkerSideOnMessage(w);
|
|
58
|
+
export {
|
|
59
|
+
i as default,
|
|
60
|
+
k as handleBuildUtxosMessage,
|
|
61
|
+
m as handleDecipherMessage,
|
|
62
|
+
v as handleFilterUtxosWithNullifier,
|
|
63
|
+
w as onWorkerMessage
|
|
64
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { M as p, p as g, U as T, c as u, a as I, b as k, Z as m, d as C } from "./index-DXElTGy9.mjs";
|
|
2
|
+
import { W as M } from "./workerProxy-BDj498Ht.mjs";
|
|
3
|
+
const d = new M(), A = (e) => {
|
|
4
|
+
const { inputUtxosSerialized: s, merkleTreeSerialized: n } = e.data, l = n.tree, a = new Map(
|
|
5
|
+
Object.entries(l).map(([r, c]) => [BigInt(r), BigInt(c)])
|
|
6
|
+
), t = p.createWithData(
|
|
7
|
+
a,
|
|
8
|
+
BigInt(n.index),
|
|
9
|
+
BigInt(n.count),
|
|
10
|
+
g,
|
|
11
|
+
25n,
|
|
12
|
+
0n
|
|
13
|
+
), i = s.map(
|
|
14
|
+
(r) => r.map((c) => new T(c))
|
|
15
|
+
), { inCommitmentSiblings: o, inCommitmentSiblingSides: S } = u(i, t);
|
|
16
|
+
d.postMessageToMainThread({ inCommitmentSiblings: o, inCommitmentSiblingSides: S });
|
|
17
|
+
}, h = (e) => {
|
|
18
|
+
const { userSignature: s, merkleTreeAccessTokenSerialized: n } = e.data, l = new C(s), a = n.tree, t = new Map(
|
|
19
|
+
Object.entries(a).map(([r, c]) => [BigInt(r), BigInt(c)])
|
|
20
|
+
), i = p.createWithData(
|
|
21
|
+
t,
|
|
22
|
+
BigInt(n.index),
|
|
23
|
+
BigInt(n.count),
|
|
24
|
+
g,
|
|
25
|
+
25n,
|
|
26
|
+
0n
|
|
27
|
+
), { accessTokenSiblings: o, accessTokenSiblingSides: S } = I(l, i);
|
|
28
|
+
d.postMessageToMainThread({ accessTokenSiblings: o, accessTokenSiblingSides: S });
|
|
29
|
+
}, w = (e) => {
|
|
30
|
+
const { inputUtxosSerialized: s, onChainCreation: n } = e.data, a = s.map(
|
|
31
|
+
(t) => t.map((i) => new T(i))
|
|
32
|
+
).map(
|
|
33
|
+
(t, i) => t.map((o) => n[i] ? "0" : o.getNullifier())
|
|
34
|
+
);
|
|
35
|
+
d.postMessageToMainThread(a);
|
|
36
|
+
}, y = async (e) => {
|
|
37
|
+
await k();
|
|
38
|
+
const { type: s } = e.payload;
|
|
39
|
+
switch (s) {
|
|
40
|
+
case m.CALC_COMMITMENTS_SIBLING_AND_SIDES:
|
|
41
|
+
A(e.payload);
|
|
42
|
+
return;
|
|
43
|
+
case m.CALC_ACCESS_TOKEN_SIBLING_AND_SIDES:
|
|
44
|
+
h(e.payload);
|
|
45
|
+
return;
|
|
46
|
+
case m.BUILD_IN_NULLIFIERS:
|
|
47
|
+
w(e.payload);
|
|
48
|
+
return;
|
|
49
|
+
default:
|
|
50
|
+
throw Error(`Unknown worker message type ${s}`);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
d.attachWorkerSideOnMessage(y);
|
|
54
|
+
export {
|
|
55
|
+
d as default,
|
|
56
|
+
w as handleBuildInNullifiers,
|
|
57
|
+
h as handleCalcAccessTokenSiblingAndSides,
|
|
58
|
+
A as handleCalcCommitmentsSiblingAndSides,
|
|
59
|
+
y as onWorkerMessage
|
|
60
|
+
};
|
package/API/API.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
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 "./referralProgramCalls.js";
|
|
2
|
-
import { addNickname as m, getNickname as c, points as d, leaderboard as f, seasonLeaderboard as k } from "./rewardsPointsCalls.js";
|
|
3
|
-
import { verificationStartDate as p, userGetTransactions as P, userVerifyTransactions as y } from "./userVerifyTransactions.js";
|
|
4
|
-
import { getIdleRelay as l } from "./relayCalls.js";
|
|
5
|
-
import { userHasPassword as R, userRegisterPassword as A } from "./passwordCalls.js";
|
|
6
|
-
import { getTokenPrice as T, getTokenPriceEth as u, getTokenPrices as C } from "./getTokenPrice.js";
|
|
7
|
-
import { getUserKycStatus as S, setAiPriseVerificationUrl as v, getAccessTokenSignature as w, getZkMeAccessToken as U, userHasAccessToken as D, afterKycCall as H } from "./kycCalls.js";
|
|
8
|
-
import { getOdosPriceForToken as L } from "./callOdosAPI.js";
|
|
9
|
-
import { getUserPoints as b } from "./dataServerCalls.js";
|
|
10
|
-
import { getLimitedAnonymityStakingPoints as I, getUserAnonymityStakingPoints as K, getUserAnonymityStakingReferralPoints as N } from "./HinkalPointsCalls.js";
|
|
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/API/HinkalPointsCalls.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import o from "axios";
|
|
2
|
-
import "../constants/chains.constants.js";
|
|
3
|
-
import "../types/circom-data.types.js";
|
|
4
|
-
import "../types/transactions.types.js";
|
|
5
|
-
import "../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "../data-structures/crypto-keys/keys.js";
|
|
9
|
-
import { getServerURL as r } from "./getServerURL.js";
|
|
10
|
-
import "../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
11
|
-
import "../functions/web3/events/getShieldedBalance.js";
|
|
12
|
-
import "../webworker/workerFactory.js";
|
|
13
|
-
import "../functions/utils/external-action.utils.js";
|
|
14
|
-
import "../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
15
|
-
import "../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
16
|
-
import "../constants/coingecko.constants.js";
|
|
17
|
-
import { API_CONFIG as m } from "../constants/server.constants.js";
|
|
18
|
-
import "../constants/vite.constants.js";
|
|
19
|
-
import "../functions/utils/userAgent.js";
|
|
20
|
-
import "../constants/reorg-depths.constants.js";
|
|
21
|
-
import "../constants/kyc.constants.js";
|
|
22
|
-
import "../data-structures/volatile-helper/VolatileHelper.js";
|
|
23
|
-
import "libsodium-wrappers";
|
|
24
|
-
import "../constants/contracts.constants.js";
|
|
25
|
-
import "../constants/axelar.constants.js";
|
|
26
|
-
import "../constants/rewards.constants.js";
|
|
27
|
-
const C = async (t, i) => (await o.get(
|
|
28
|
-
`${r(t)}${m.ROUTES.getLimitedAnonymityStakingPoints(i)}`
|
|
29
|
-
)).data, F = async (t, i) => (await o.get(
|
|
30
|
-
`${r(t)}${m.ROUTES.getUserAnonymityStakingPoints(i)}`
|
|
31
|
-
)).data, G = async (t, i) => (await o.get(
|
|
32
|
-
`${r(t)}${m.ROUTES.getUserAnonymityStakingReferralPoints(i)}`
|
|
33
|
-
)).data;
|
|
34
|
-
export {
|
|
35
|
-
C as getLimitedAnonymityStakingPoints,
|
|
36
|
-
F as getUserAnonymityStakingPoints,
|
|
37
|
-
G as getUserAnonymityStakingReferralPoints
|
|
38
|
-
};
|
package/API/callBeefyGraphAPI.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import m from "axios";
|
|
2
|
-
import "../constants/chains.constants.js";
|
|
3
|
-
import "../types/circom-data.types.js";
|
|
4
|
-
import "../types/transactions.types.js";
|
|
5
|
-
import "../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "../data-structures/crypto-keys/keys.js";
|
|
9
|
-
import { getServerURL as e } from "./getServerURL.js";
|
|
10
|
-
import "../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
11
|
-
import "../functions/web3/events/getShieldedBalance.js";
|
|
12
|
-
import "../webworker/workerFactory.js";
|
|
13
|
-
import "../functions/utils/external-action.utils.js";
|
|
14
|
-
import "../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
15
|
-
import "../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
16
|
-
import "../constants/coingecko.constants.js";
|
|
17
|
-
import { API_CONFIG as a } from "../constants/server.constants.js";
|
|
18
|
-
import "../constants/vite.constants.js";
|
|
19
|
-
import "../functions/utils/userAgent.js";
|
|
20
|
-
import "../constants/reorg-depths.constants.js";
|
|
21
|
-
import "../constants/kyc.constants.js";
|
|
22
|
-
import "../data-structures/volatile-helper/VolatileHelper.js";
|
|
23
|
-
import "libsodium-wrappers";
|
|
24
|
-
import "../constants/contracts.constants.js";
|
|
25
|
-
import "../constants/axelar.constants.js";
|
|
26
|
-
import "../constants/rewards.constants.js";
|
|
27
|
-
const E = async (t, r, o, i = "apys") => {
|
|
28
|
-
const p = {
|
|
29
|
-
id: t,
|
|
30
|
-
datePeriod: r,
|
|
31
|
-
dataType: i
|
|
32
|
-
};
|
|
33
|
-
return await m.post(`${e(o)}${a.ROUTES.beefyGraphAPI}`, p);
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
E as getBeefyHistoricalChartData
|
|
37
|
-
};
|
package/API/callCurveAPI.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import p from "axios";
|
|
2
|
-
import { ethers as A } from "ethers";
|
|
3
|
-
import "../types/circom-data.types.js";
|
|
4
|
-
import "../types/transactions.types.js";
|
|
5
|
-
import { curveNetworkNames as f, curvePools as w } from "../types/curve.types.js";
|
|
6
|
-
import { getCrvCvxWithChainId as C } from "../constants/crvCvx.registry.js";
|
|
7
|
-
import { getERC20Registry as l } from "../constants/token-data/ERC20Registry.js";
|
|
8
|
-
import { getNonLocalhostChainId as u } from "../constants/chains.constants.js";
|
|
9
|
-
import { zeroAddress as m } from "../constants/protocol.constants.js";
|
|
10
|
-
import { logError as D } from "../error-handling/logError.js";
|
|
11
|
-
import { lowerCaseIncludes as k, caseInsensitiveEqual as h } from "../functions/utils/caseInsensitive.utils.js";
|
|
12
|
-
const T = /* @__PURE__ */ new Set(), L = {}, y = (e, o) => {
|
|
13
|
-
const n = l(e), a = n.find((t) => t.erc20TokenAddress.toLocaleLowerCase() === o.toLocaleLowerCase());
|
|
14
|
-
return a ? a ? a.symbol : o : n[0].symbol;
|
|
15
|
-
}, P = (e, o) => {
|
|
16
|
-
const n = l(e), a = n.find((t) => t.erc20TokenAddress.toLocaleLowerCase() === o.toLocaleLowerCase());
|
|
17
|
-
return a ? a.logoURI ? a.logoURI : "" : n[0].logoURI ? n[0].logoURI : "";
|
|
18
|
-
};
|
|
19
|
-
async function b(e) {
|
|
20
|
-
const o = u(e), n = f[o];
|
|
21
|
-
return p.get(`https://api.curve.fi/api/getSubgraphData/${n}`, { timeout: 7e3 }).then((a) => a.data ? a.data.data.poolList.map((t) => ({
|
|
22
|
-
address: t.address,
|
|
23
|
-
volumeUSD: t.volumeUSD,
|
|
24
|
-
dailyApy: t.latestDailyApy,
|
|
25
|
-
weeklyApy: t.latestWeeklyApy
|
|
26
|
-
})) : []).catch(() => []);
|
|
27
|
-
}
|
|
28
|
-
async function U(e, o) {
|
|
29
|
-
const n = u(e), a = f[n];
|
|
30
|
-
return a ? p.get(`https://api.curve.fi/api/getPools/${a}/${o}`).then((t) => t.data?.data.poolData.map((s) => {
|
|
31
|
-
const { usdTotal: i } = s, d = Number(A.utils.formatEther(s.totalSupply || "0")), c = d > 0 ? Number(i) / d : 0;
|
|
32
|
-
return {
|
|
33
|
-
id: s.id,
|
|
34
|
-
name: s.name,
|
|
35
|
-
address: s.address,
|
|
36
|
-
lpToken: y(e, s.lpTokenAddress || ""),
|
|
37
|
-
lpTokenAddress: s.lpTokenAddress,
|
|
38
|
-
coins: s.underlyingCoins ? s.underlyingCoins : s.coins,
|
|
39
|
-
tokensForDeposit: s.coins,
|
|
40
|
-
coinAddresses: (s.coinsAddresses || []).filter((r) => r !== m).map((r) => y(e, r)),
|
|
41
|
-
coinLogos: (s.coinsAddresses || []).filter((r) => r !== m).map((r) => P(e, r)),
|
|
42
|
-
gaugeAddress: s.gaugeAddress ? s.gaugeAddress : void 0,
|
|
43
|
-
gaugeCrvApy: s.gaugeCrvApy && s.gaugeCrvApy[0] && s.gaugeCrvApy[0] !== 0 ? { base: s.gaugeCrvApy[0], boosted: s.gaugeCrvApy[1] } : void 0,
|
|
44
|
-
gaugeRewards: s.gaugeRewards,
|
|
45
|
-
usdTotal: i,
|
|
46
|
-
totalSupply: d,
|
|
47
|
-
lpPrice: c,
|
|
48
|
-
liquidityUtilization: void 0
|
|
49
|
-
};
|
|
50
|
-
})) : [];
|
|
51
|
-
}
|
|
52
|
-
async function N(e) {
|
|
53
|
-
let o = [];
|
|
54
|
-
return await Promise.all(
|
|
55
|
-
w.map(async (n) => {
|
|
56
|
-
const a = await U(e, n);
|
|
57
|
-
return o = o.concat(a), a;
|
|
58
|
-
})
|
|
59
|
-
), Promise.all(o);
|
|
60
|
-
}
|
|
61
|
-
async function v(e) {
|
|
62
|
-
const o = await b(e), n = await N(e), a = [];
|
|
63
|
-
for (const t of n) {
|
|
64
|
-
if (a.map((d) => d.address).includes(t.address))
|
|
65
|
-
continue;
|
|
66
|
-
const s = t.lpTokenAddress.toLowerCase();
|
|
67
|
-
T.add(s.toLowerCase()), L[s] = t.address.toLowerCase();
|
|
68
|
-
const i = {
|
|
69
|
-
id: t.id,
|
|
70
|
-
name: t.name,
|
|
71
|
-
address: t.address,
|
|
72
|
-
lpToken: s,
|
|
73
|
-
lpTokenAddress: s,
|
|
74
|
-
coins: t.coins,
|
|
75
|
-
coinNames: t.coinAddresses.join(" "),
|
|
76
|
-
coinAddresses: t.coinAddresses,
|
|
77
|
-
coinLogos: t.coinLogos,
|
|
78
|
-
tokensForDeposit: t.tokensForDeposit,
|
|
79
|
-
gaugeAddress: t.gaugeAddress,
|
|
80
|
-
usdTotal: t.usdTotal,
|
|
81
|
-
totalSupply: t.totalSupply,
|
|
82
|
-
lpPrice: t.lpPrice,
|
|
83
|
-
tvl: Math.round(t.usdTotal),
|
|
84
|
-
gaugeRewards: t.gaugeRewards,
|
|
85
|
-
gaugeCrvApy: t.gaugeCrvApy ? {
|
|
86
|
-
base: Math.round(t.gaugeCrvApy.base * 100) / 100,
|
|
87
|
-
boosted: Math.round(t.gaugeCrvApy.boosted * 100) / 100
|
|
88
|
-
} : void 0,
|
|
89
|
-
liquidityUtilization: 0,
|
|
90
|
-
volumeUSD: 0,
|
|
91
|
-
dailyApy: 0,
|
|
92
|
-
weeklyApy: 0
|
|
93
|
-
};
|
|
94
|
-
for (const d of o)
|
|
95
|
-
if (h(t.address, d.address)) {
|
|
96
|
-
i.liquidityUtilization = d.volumeUSD / t.usdTotal, i.volumeUSD = Math.round(d.volumeUSD), i.dailyApy = Math.round(d.dailyApy * 100) / 100, i.weeklyApy = Math.round(d.weeklyApy * 100) / 100;
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
a.push(i);
|
|
100
|
-
}
|
|
101
|
-
return a;
|
|
102
|
-
}
|
|
103
|
-
const j = async (e) => {
|
|
104
|
-
const o = u(e), n = await v(o), a = C(o).map((s) => s.lpToken.toLowerCase());
|
|
105
|
-
return n.filter((s) => k(a, s.lpTokenAddress));
|
|
106
|
-
}, G = async (e) => {
|
|
107
|
-
const o = u(e), n = await v(o), t = l(e).map((i) => i.erc20TokenAddress.toLowerCase());
|
|
108
|
-
return n.filter((i) => k(t, i.lpTokenAddress));
|
|
109
|
-
};
|
|
110
|
-
async function $(e, o) {
|
|
111
|
-
let n = 0;
|
|
112
|
-
for (let r = 0; r < e.tokensForDeposit.length; r += 1)
|
|
113
|
-
e.tokensForDeposit[r].usdTotal = Number(
|
|
114
|
-
A.utils.formatUnits(
|
|
115
|
-
BigInt(e.tokensForDeposit[r].poolBalance),
|
|
116
|
-
Number(e.tokensForDeposit[r].decimals)
|
|
117
|
-
)
|
|
118
|
-
) * e.tokensForDeposit[r].usdPrice, n += e.tokensForDeposit[r].usdTotal || 0, e.tokensForDeposit[r].symbol.startsWith("am") && (e.tokensForDeposit[r].symbol = e.tokensForDeposit[r].symbol.slice(2));
|
|
119
|
-
for (let r = 0; r < e.tokensForDeposit.length; r += 1)
|
|
120
|
-
e.tokensForDeposit[r].weighting = (e.tokensForDeposit[r].usdTotal || 0) / n;
|
|
121
|
-
const a = await o.functions.fee();
|
|
122
|
-
let t, s, i, d = !1;
|
|
123
|
-
try {
|
|
124
|
-
const r = (await o.functions.future_A_time())[0].toNumber(), g = new Date(r * 1e3);
|
|
125
|
-
s = g.toLocaleString(), i = (await o.functions.future_A())[0].toNumber() / 100, d = !!r && g >= /* @__PURE__ */ new Date(), t = (await o.functions.initial_A())[0].toNumber() / 100;
|
|
126
|
-
} catch {
|
|
127
|
-
D("A ramp up not found");
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
poolAddress: o.address,
|
|
131
|
-
lpToken: e.lpTokenAddress,
|
|
132
|
-
gaugeAddress: e.gaugeAddress,
|
|
133
|
-
gaugeCrvApy: e.gaugeCrvApy,
|
|
134
|
-
currencyReserves: e.coins,
|
|
135
|
-
liquidityUtilization: e.liquidityUtilization,
|
|
136
|
-
volumeUSD: e.volumeUSD,
|
|
137
|
-
dailyApy: e.dailyApy,
|
|
138
|
-
weeklyApy: e.weeklyApy,
|
|
139
|
-
gaugeRewards: e?.gaugeRewards,
|
|
140
|
-
A: (await o.functions.A())[0].toNumber(),
|
|
141
|
-
initialA: t,
|
|
142
|
-
futureTime: s,
|
|
143
|
-
futureA: i,
|
|
144
|
-
hasRampUp: d,
|
|
145
|
-
fee: a[0].toNumber() / 1e8,
|
|
146
|
-
daoFee: a[0].toNumber() / 2e8,
|
|
147
|
-
virtualPrice: Number((await o.functions.get_virtual_price())[0].toBigInt() / 100000000000000n) / 1e4
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
export {
|
|
151
|
-
j as getCurvePools,
|
|
152
|
-
G as getCurvePoolsforPriceFetching,
|
|
153
|
-
$ as getExtendedPoolInfo,
|
|
154
|
-
T as lpTokens,
|
|
155
|
-
L as lpTokensToBasePool
|
|
156
|
-
};
|
package/API/callMonitor.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import t from "axios";
|
|
2
|
-
import "../constants/chains.constants.js";
|
|
3
|
-
import "../types/circom-data.types.js";
|
|
4
|
-
import "../types/transactions.types.js";
|
|
5
|
-
import "../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "../data-structures/crypto-keys/keys.js";
|
|
9
|
-
import { getServerURL as m } from "./getServerURL.js";
|
|
10
|
-
import "../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
11
|
-
import "../functions/web3/events/getShieldedBalance.js";
|
|
12
|
-
import "../webworker/workerFactory.js";
|
|
13
|
-
import "../functions/utils/external-action.utils.js";
|
|
14
|
-
import "../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
15
|
-
import "../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
16
|
-
import "../constants/coingecko.constants.js";
|
|
17
|
-
import { API_CONFIG as i } from "../constants/server.constants.js";
|
|
18
|
-
import "../constants/vite.constants.js";
|
|
19
|
-
import "../functions/utils/userAgent.js";
|
|
20
|
-
import "../constants/reorg-depths.constants.js";
|
|
21
|
-
import "../constants/kyc.constants.js";
|
|
22
|
-
import "../data-structures/volatile-helper/VolatileHelper.js";
|
|
23
|
-
import "libsodium-wrappers";
|
|
24
|
-
import "../constants/contracts.constants.js";
|
|
25
|
-
import "../constants/axelar.constants.js";
|
|
26
|
-
import "../constants/rewards.constants.js";
|
|
27
|
-
const b = (o, r) => t.post(`${m(r)}${i.ROUTES.monitor}`, { address: o });
|
|
28
|
-
export {
|
|
29
|
-
b as monitor
|
|
30
|
-
};
|
package/API/callOdosAPI.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import m from "axios";
|
|
2
|
-
import { chainIds as i } from "../constants/chains.constants.js";
|
|
3
|
-
import "../types/circom-data.types.js";
|
|
4
|
-
import "../types/transactions.types.js";
|
|
5
|
-
import "../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "../data-structures/crypto-keys/keys.js";
|
|
9
|
-
import { getServerURL as p } from "./getServerURL.js";
|
|
10
|
-
import "../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
11
|
-
import "../functions/web3/events/getShieldedBalance.js";
|
|
12
|
-
import "../webworker/workerFactory.js";
|
|
13
|
-
import "../functions/utils/external-action.utils.js";
|
|
14
|
-
import "../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
15
|
-
import "../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
16
|
-
import "../constants/coingecko.constants.js";
|
|
17
|
-
import { API_CONFIG as e } from "../constants/server.constants.js";
|
|
18
|
-
import "../constants/vite.constants.js";
|
|
19
|
-
import "../functions/utils/userAgent.js";
|
|
20
|
-
import "../constants/reorg-depths.constants.js";
|
|
21
|
-
import "../constants/kyc.constants.js";
|
|
22
|
-
import "../data-structures/volatile-helper/VolatileHelper.js";
|
|
23
|
-
import "libsodium-wrappers";
|
|
24
|
-
import "../constants/contracts.constants.js";
|
|
25
|
-
import "../constants/axelar.constants.js";
|
|
26
|
-
import "../constants/rewards.constants.js";
|
|
27
|
-
async function C(r, o) {
|
|
28
|
-
return [i.base, i.localhost].includes(r) || (o.referralCode = "702077826"), (await m.post(`${p(r)}${e.ROUTES.callOdosAPI}`, o)).data;
|
|
29
|
-
}
|
|
30
|
-
const b = async (r, o) => {
|
|
31
|
-
try {
|
|
32
|
-
const { data: t } = await m.get(
|
|
33
|
-
`${p(r)}${e.ROUTES.getOdosPriceForToken(o)}`
|
|
34
|
-
);
|
|
35
|
-
return t.price;
|
|
36
|
-
} catch (t) {
|
|
37
|
-
console.error("Error fetching Odos price:", t);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
export {
|
|
42
|
-
C as callOdosAPI,
|
|
43
|
-
b as getOdosPriceForToken
|
|
44
|
-
};
|
package/API/callOneInchAPI.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import r from "axios";
|
|
2
|
-
import { getNonLocalhostChainId as m } from "../constants/chains.constants.js";
|
|
3
|
-
import "../types/circom-data.types.js";
|
|
4
|
-
import "../types/transactions.types.js";
|
|
5
|
-
import "../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "../data-structures/crypto-keys/keys.js";
|
|
9
|
-
import { getServerURL as n } from "./getServerURL.js";
|
|
10
|
-
import "../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
11
|
-
import "../functions/web3/events/getShieldedBalance.js";
|
|
12
|
-
import "../webworker/workerFactory.js";
|
|
13
|
-
import "../functions/utils/external-action.utils.js";
|
|
14
|
-
import "../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
15
|
-
import "../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
16
|
-
import "../constants/coingecko.constants.js";
|
|
17
|
-
import { API_CONFIG as e } from "../constants/server.constants.js";
|
|
18
|
-
import "../constants/vite.constants.js";
|
|
19
|
-
import "../functions/utils/userAgent.js";
|
|
20
|
-
import "../constants/reorg-depths.constants.js";
|
|
21
|
-
import "../constants/kyc.constants.js";
|
|
22
|
-
import "../data-structures/volatile-helper/VolatileHelper.js";
|
|
23
|
-
import "libsodium-wrappers";
|
|
24
|
-
import "../constants/contracts.constants.js";
|
|
25
|
-
import "../constants/axelar.constants.js";
|
|
26
|
-
import "../constants/rewards.constants.js";
|
|
27
|
-
const N = async (i, o) => {
|
|
28
|
-
const t = m(i), p = new URLSearchParams();
|
|
29
|
-
p.append("fromTokenAddress", o.fromTokenAddress), p.append("toTokenAddress", o.toTokenAddress), p.append("amount", `${o.amount}`), p.append("fromAddress", o.fromAddress), p.append("slippage", `${o.slippage}`), o.destReceiver && p.append("destReceiver", o.destReceiver), o.disableEstimate && p.append("disableEstimate", `${o.disableEstimate}`), o.allowPartialFill && p.append("allowPartialFill", `${o.allowPartialFill}`);
|
|
30
|
-
const a = {
|
|
31
|
-
url: `https://api.1inch.dev/swap/v5.2/${t}/swap?${p}`
|
|
32
|
-
};
|
|
33
|
-
return (await r.post(`${n(i)}${e.ROUTES.callOneInchAPI}`, a)).data.oneInchResponse;
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
N as callOneInchAPI
|
|
37
|
-
};
|
package/API/callRelayer.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import o from "axios";
|
|
2
|
-
import "../constants/chains.constants.js";
|
|
3
|
-
import "../types/circom-data.types.js";
|
|
4
|
-
import "../types/transactions.types.js";
|
|
5
|
-
import "../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "../data-structures/crypto-keys/keys.js";
|
|
9
|
-
import "../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
10
|
-
import "../functions/web3/events/getShieldedBalance.js";
|
|
11
|
-
import "../webworker/workerFactory.js";
|
|
12
|
-
import "../functions/utils/external-action.utils.js";
|
|
13
|
-
import "../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
14
|
-
import "../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
15
|
-
import "../constants/coingecko.constants.js";
|
|
16
|
-
import { getRelayerURL as i } from "./getRelayerURL.js";
|
|
17
|
-
import { RELAYER_CONFIG as m } from "../constants/server.constants.js";
|
|
18
|
-
import "../constants/vite.constants.js";
|
|
19
|
-
import "../functions/utils/userAgent.js";
|
|
20
|
-
import "../constants/reorg-depths.constants.js";
|
|
21
|
-
import "../constants/kyc.constants.js";
|
|
22
|
-
import "../data-structures/volatile-helper/VolatileHelper.js";
|
|
23
|
-
import "libsodium-wrappers";
|
|
24
|
-
import "../constants/contracts.constants.js";
|
|
25
|
-
import "../constants/axelar.constants.js";
|
|
26
|
-
import "../constants/rewards.constants.js";
|
|
27
|
-
async function P(r, t) {
|
|
28
|
-
return (await o.post(`${i(r)}${m.TRANSACT}`, t)).data;
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
P as callRelayerTransactAPI
|
|
32
|
-
};
|
package/API/checkRisk.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import o from "axios";
|
|
2
|
-
import "../constants/chains.constants.js";
|
|
3
|
-
import "../types/circom-data.types.js";
|
|
4
|
-
import "../types/transactions.types.js";
|
|
5
|
-
import "../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "../data-structures/crypto-keys/keys.js";
|
|
9
|
-
import { getServerURL as i } from "./getServerURL.js";
|
|
10
|
-
import "../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
11
|
-
import "../functions/web3/events/getShieldedBalance.js";
|
|
12
|
-
import "../webworker/workerFactory.js";
|
|
13
|
-
import "../functions/utils/external-action.utils.js";
|
|
14
|
-
import "../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
15
|
-
import "../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
16
|
-
import "../constants/coingecko.constants.js";
|
|
17
|
-
import { API_CONFIG as m } from "../constants/server.constants.js";
|
|
18
|
-
import "../constants/vite.constants.js";
|
|
19
|
-
import "../functions/utils/userAgent.js";
|
|
20
|
-
import "../constants/reorg-depths.constants.js";
|
|
21
|
-
import "../constants/kyc.constants.js";
|
|
22
|
-
import "../data-structures/volatile-helper/VolatileHelper.js";
|
|
23
|
-
import "libsodium-wrappers";
|
|
24
|
-
import "../constants/contracts.constants.js";
|
|
25
|
-
import "../constants/axelar.constants.js";
|
|
26
|
-
import "../constants/rewards.constants.js";
|
|
27
|
-
const G = async (r, t) => (await o.get(`${i(r)}${m.ROUTES.checkRisk(t)}`)).data;
|
|
28
|
-
export {
|
|
29
|
-
G as checkRisk
|
|
30
|
-
};
|
package/API/dataServerCalls.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import r from "axios";
|
|
2
|
-
import "../constants/chains.constants.js";
|
|
3
|
-
import "../types/circom-data.types.js";
|
|
4
|
-
import "../types/transactions.types.js";
|
|
5
|
-
import "../types/curve.types.js";
|
|
6
|
-
import "ethers";
|
|
7
|
-
import "circomlibjs";
|
|
8
|
-
import "../data-structures/crypto-keys/keys.js";
|
|
9
|
-
import { getDataServerURL as i } from "./getServerURL.js";
|
|
10
|
-
import "../data-structures/crypto-keys/encryptDecryptUtxo.js";
|
|
11
|
-
import "../functions/web3/events/getShieldedBalance.js";
|
|
12
|
-
import "../webworker/workerFactory.js";
|
|
13
|
-
import "../functions/utils/external-action.utils.js";
|
|
14
|
-
import "../data-structures/custom-token-registry/CustomTokenRegistry.js";
|
|
15
|
-
import "../functions/utils/convertIntegrationProviderToExternalActionId.js";
|
|
16
|
-
import "../constants/coingecko.constants.js";
|
|
17
|
-
import { DATA_SERVER_CONFIG as m } from "../constants/server.constants.js";
|
|
18
|
-
import "../constants/vite.constants.js";
|
|
19
|
-
import "../functions/utils/userAgent.js";
|
|
20
|
-
import "../constants/reorg-depths.constants.js";
|
|
21
|
-
import "../constants/kyc.constants.js";
|
|
22
|
-
import "../data-structures/volatile-helper/VolatileHelper.js";
|
|
23
|
-
import "libsodium-wrappers";
|
|
24
|
-
import "../constants/contracts.constants.js";
|
|
25
|
-
import "../constants/axelar.constants.js";
|
|
26
|
-
import "../constants/rewards.constants.js";
|
|
27
|
-
const L = async (t, o) => (await r.get(
|
|
28
|
-
`${i(t)}${m.getUserPoints(o)}`
|
|
29
|
-
)).data;
|
|
30
|
-
export {
|
|
31
|
-
L as getUserPoints
|
|
32
|
-
};
|