@hinkal/common 0.0.104 → 0.0.106
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/API/API.js +58 -0
- package/API/HinkalPointsCalls.js +38 -0
- package/API/callBeefyGraphAPI.js +37 -0
- package/API/callCurveAPI.js +156 -0
- package/API/callMonitor.js +30 -0
- package/API/callOdosAPI.js +44 -0
- package/API/callOneInchAPI.js +37 -0
- package/API/callRelayer.js +32 -0
- package/API/checkRisk.js +30 -0
- package/API/dataServerCalls.js +32 -0
- package/API/fetchCommitmentsCache.js +31 -0
- package/API/fetchNullifiers.js +30 -0
- package/API/getAxelarGasEstimate.js +37 -0
- package/API/getCoingeckoPrice.js +27 -0
- package/API/getConnextReceiveFee.js +30 -0
- package/API/getGasEstimates.js +38 -0
- package/API/getRelayerURL.js +32 -0
- package/API/getServerURL.js +67 -0
- package/API/getTokenPrice.js +41 -0
- package/API/kycCalls.js +32 -0
- package/API/passwordCalls.js +36 -0
- package/API/referralProgramCalls.js +58 -0
- package/API/relayCalls.js +30 -0
- package/API/restoreSnapshots.js +32 -0
- package/API/rewardsPointsCalls.js +40 -0
- package/API/userVerifyTransactions.js +45 -0
- package/README.md +116 -1
- package/assets/{snarkjsWorkerLogic-CatB8Hso.js → snarkjsWorkerLogic-Fv0M38Mc.js} +2 -2
- package/assets/{utxoWorkerLogic-DDqTe7hT.js → utxoWorkerLogic-CtFLQiAX.js} +2 -2
- package/assets/{zkProofWorkerLauncher-C-pvCm0b.js → zkProofWorkerLauncher-J3Ts5_Ba.js} +1 -1
- package/assets/{zkProofWorkerLogic-CLpRqNRx.js → zkProofWorkerLogic-CPNuu61R.js} +18 -19
- package/constants/assets.constants.js +16 -0
- package/constants/axelar.constants.js +55 -0
- package/constants/backend.constants.js +18 -0
- package/constants/beefy.registry.js +24 -0
- package/constants/chains.constants.js +204 -0
- package/constants/coingecko.constants.js +53 -0
- package/constants/contracts.constants.js +276 -0
- package/constants/crvCvx.registry.js +636 -0
- package/constants/crvDynamic.registry.js +24 -0
- package/constants/deploy-data/deploy-data-arbMainnet.json.js +7415 -0
- package/constants/deploy-data/deploy-data-avalanche.json.js +7411 -0
- package/constants/deploy-data/deploy-data-axelar1.json.js +4329 -0
- package/constants/deploy-data/deploy-data-axelar2.json.js +4329 -0
- package/constants/deploy-data/deploy-data-base.json.js +8425 -0
- package/constants/deploy-data/deploy-data-blast.json.js +9600 -0
- package/constants/deploy-data/deploy-data-bnbMainnet.json.js +6877 -0
- package/constants/deploy-data/deploy-data-ethMainnet.json.js +11427 -0
- package/constants/deploy-data/deploy-data-localhost.json.js +13283 -0
- package/constants/deploy-data/deploy-data-optimism.json.js +7417 -0
- package/constants/deploy-data/deploy-data-polygon.json.js +7439 -0
- package/constants/fees.constants.js +57 -0
- package/constants/kyc.constants.js +118 -0
- package/constants/lido.constants.js +13 -0
- package/constants/pendle.registry.js +253 -0
- package/constants/protocol.constants.js +26 -0
- package/constants/reorg-depths.constants.js +15 -0
- package/constants/rewards.constants.js +27 -0
- package/constants/server.constants.js +157 -0
- package/constants/token-data/ERC20Registry.js +85 -0
- package/constants/token-data/arbMainnetRegistry.json.js +946 -0
- package/constants/token-data/arbMainnetRegistryFixed.json.js +856 -0
- package/constants/token-data/avalancheRegistry.json.js +591 -0
- package/constants/token-data/avalancheRegistryFixed.json.js +591 -0
- package/constants/token-data/baseRegistry.json.js +490 -0
- package/constants/token-data/baseRegistryFixed.json.js +463 -0
- package/constants/token-data/blastRegistry.json.js +137 -0
- package/constants/token-data/blastRegistryFixed.json.js +137 -0
- package/constants/token-data/bnbMainnetRegistry.json.js +973 -0
- package/constants/token-data/bnbMainnetRegistryFixed.json.js +973 -0
- package/constants/token-data/coingeckoRegistry.json.js +115623 -0
- package/constants/token-data/ethMainnetRegistry.json.js +2700 -0
- package/constants/token-data/ethMainnetRegistryFixed.json.js +2251 -0
- package/constants/token-data/index.js +6 -0
- package/constants/token-data/localhostRegistry.json.js +2768 -0
- package/constants/token-data/optimismRegistry.json.js +1455 -0
- package/constants/token-data/optimismRegistryFixed.json.js +1392 -0
- package/constants/token-data/polygonRegistry.json.js +1327 -0
- package/constants/token-data/polygonRegistryFixed.json.js +1255 -0
- package/constants/token-data/popularTokens.constants.js +14 -0
- package/constants/token-data/tokenPricing.consts.js +8 -0
- package/constants/vite.constants.js +29 -0
- package/crypto/babyJub.js +15 -0
- package/crypto/poseidon.js +26 -0
- package/crypto/preProcessing.js +9 -0
- package/data-structures/Hinkal/Hinkal.js +299 -0
- package/data-structures/Hinkal/hinkalActionBeefy.js +101 -0
- package/data-structures/Hinkal/hinkalActionConvex.js +83 -0
- package/data-structures/Hinkal/hinkalActionCurve.js +112 -0
- package/data-structures/Hinkal/hinkalActionLidoEth.js +91 -0
- package/data-structures/Hinkal/hinkalActionPendle.js +140 -0
- package/data-structures/Hinkal/hinkalActionPendleLP.js +96 -0
- package/data-structures/Hinkal/hinkalActionStake.js +138 -0
- package/data-structures/Hinkal/hinkalActionVolatile.js +112 -0
- package/data-structures/Hinkal/hinkalDeposit.js +95 -0
- package/data-structures/Hinkal/hinkalGetZkMeProvider.js +47 -0
- package/data-structures/Hinkal/hinkalPrivateWallet.js +66 -0
- package/data-structures/Hinkal/hinkalSwap.js +98 -0
- package/data-structures/Hinkal/hinkalTransfer.js +5 -0
- package/data-structures/Hinkal/hinkalWithdraw.js +91 -0
- package/data-structures/Hinkal/resetMerkleTrees.js +49 -0
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.js +83 -0
- package/data-structures/ValueCache/ValueCache.js +25 -0
- package/data-structures/crypto-keys/decodeUTXO.js +40 -0
- package/data-structures/crypto-keys/encryptDecryptUtxo.js +41 -0
- package/data-structures/crypto-keys/keyUtils.js +10 -0
- package/data-structures/crypto-keys/keys.js +90 -0
- package/data-structures/custom-token-registry/CustomTokenRegistry.js +33 -0
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.js +131 -0
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.js +132 -0
- package/data-structures/event-service/AbstractEventService.js +118 -0
- package/data-structures/event-service/AbstractNullifierSnapshotService.js +59 -0
- package/data-structures/event-service/AbstractSnapshotService.js +35 -0
- package/data-structures/merkle-tree/MerkleTree.js +177 -0
- package/data-structures/merkle-tree/MerkleTreeIncompleteError.js +8 -0
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.js +48 -0
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.js +47 -0
- package/data-structures/snapshot/ClientNullifierSnapshotService.js +44 -0
- package/data-structures/token-price-fetcher/TokenChecker.js +29 -0
- package/data-structures/token-price-fetcher/TokenPriceFetcher.js +218 -0
- package/data-structures/transactions-manager/TransactionsManager.js +194 -0
- package/data-structures/transactions-manager/history/getBeefyData.js +68 -0
- package/data-structures/transactions-manager/history/getConvexData.js +57 -0
- package/data-structures/transactions-manager/history/getCurveData.js +97 -0
- package/data-structures/transactions-manager/history/getDepositData.js +36 -0
- package/data-structures/transactions-manager/history/getLidoData.js +44 -0
- package/data-structures/transactions-manager/history/getPendleData.js +59 -0
- package/data-structures/transactions-manager/history/getSwapData.js +43 -0
- package/data-structures/transactions-manager/history/getTxDetails.js +74 -0
- package/data-structures/transactions-manager/history/getVolatileData.js +75 -0
- package/data-structures/transactions-manager/history/history.types.js +62 -0
- package/data-structures/transactions-manager/history/history.utils.js +8 -0
- package/data-structures/utxo/Utxo.js +134 -0
- package/data-structures/volatile-helper/VolatileHelper.js +181 -0
- package/error-handling/customErrors/ErrorWithAmount.js +9 -0
- package/error-handling/customErrors/FeeOverTransactionValueError.js +9 -0
- package/error-handling/customErrors/customErrors.helpers.js +21 -0
- package/error-handling/error-codes.constants.js +184 -0
- package/error-handling/get-error.message.js +53 -0
- package/error-handling/handleErrorRestore.js +35 -0
- package/error-handling/logError.js +7 -0
- package/error-handling/types.js +4 -0
- package/externalABIs/BUSD.js +519 -0
- package/externalABIs/BabPassport.json.js +24 -0
- package/externalABIs/BeefyRouterAbi.json.js +1022 -0
- package/externalABIs/BeefyStrategyAbi.json.js +1423 -0
- package/externalABIs/BeefyVaultAbi.json.js +570 -0
- package/externalABIs/BeefyZapAbi.json.js +208 -0
- package/externalABIs/BeefyZapOneInchAbi.json.js +340 -0
- package/externalABIs/ConvexBoosterAbi.json.js +674 -0
- package/externalABIs/ConvexBoosterAbiMainnet.json.js +1002 -0
- package/externalABIs/ConvexRewardPoolAbi.json.js +883 -0
- package/externalABIs/CurveReadingWrapperAbi.json.js +1422 -0
- package/externalABIs/CurveWrappedMainPool.json.js +1136 -0
- package/externalABIs/CurveZap.json.js +262 -0
- package/externalABIs/CvxCrvUtilities.json.js +264 -0
- package/externalABIs/DAI.js +334 -0
- package/externalABIs/ERC20.json.js +291 -0
- package/externalABIs/GalxePassport.json.js +41 -0
- package/externalABIs/IQuoterV2.json.js +205 -0
- package/externalABIs/ISwapRouter.json.js +568 -0
- package/externalABIs/IUniswapV3Factory.json.js +201 -0
- package/externalABIs/IUniswapV3Pool.json.js +999 -0
- package/externalABIs/LidoStEthAbi.json.js +1603 -0
- package/externalABIs/LidoStMaticAbi.json.js +1764 -0
- package/externalABIs/LidoStakeManagerAbi.json.js +2082 -0
- package/externalABIs/LidoWithdrawalQueueERC721Abi.json.js +2030 -0
- package/externalABIs/LidoWstEthAbi.json.js +480 -0
- package/externalABIs/OptimismGasPriceOracle.json.js +206 -0
- package/externalABIs/PendleRouterAbi.json.js +173 -0
- package/externalABIs/PoLidoNftAbi.json.js +701 -0
- package/externalABIs/SanctionsList.js +89 -0
- package/externalABIs/USDC.js +721 -0
- package/externalABIs/USDR.js +346 -0
- package/externalABIs/USDR3CRV.js +542 -0
- package/externalABIs/USDT.js +393 -0
- package/externalABIs/UniswapV2PoolAbi.json.js +80 -0
- package/externalABIs/WETH.js +156 -0
- package/externalABIs/amToken.js +350 -0
- package/externalABIs/transactionsProver.json.js +39 -0
- package/functions/kyc/authentoHelper.js +42 -0
- package/functions/kyc/passportHelper.js +39 -0
- package/functions/kyc/zkMeHelper.js +56 -0
- package/functions/pre-transaction/getFlatFees.js +203 -0
- package/functions/pre-transaction/interaction-to-action.js +57 -0
- package/functions/pre-transaction/outputUtxoProcessing.js +45 -0
- package/functions/pre-transaction/process-gas-estimates.js +57 -0
- package/functions/pre-transaction/processAmountChanges.js +229 -0
- package/functions/private-wallet/emporium.helpers.js +19 -0
- package/functions/private-wallet/opProducer.js +24 -0
- package/functions/protocols/convex.protocols.js +41 -0
- package/functions/protocols/curve.protocols.js +45 -0
- package/functions/protocols/pendle.helpers.js +108 -0
- package/functions/snarkjs/common.snarkjs.js +96 -0
- package/functions/snarkjs/constant.js +211 -0
- package/functions/snarkjs/constructEmporiumProof.js +105 -0
- package/functions/snarkjs/constructGeneralZkProof.js +129 -0
- package/functions/snarkjs/generateCircomData.js +60 -0
- package/functions/snarkjs/generateZkProof.js +18 -0
- package/functions/snarkjs/getZKFiles.js +30 -0
- package/functions/staking/index.js +40 -0
- package/functions/utils/amounts.utils.js +70 -0
- package/functions/utils/axelar.utils.js +38 -0
- package/functions/utils/cacheFunctions.js +67 -0
- package/functions/utils/caseInsensitive.utils.js +6 -0
- package/functions/utils/convertIntegrationProviderToExternalActionId.js +16 -0
- package/functions/utils/create-provider.js +5 -0
- package/functions/utils/enum.utils.js +14 -0
- package/functions/utils/erc20tokenFunctions.js +20 -0
- package/functions/utils/evmNetworkFunctions.js +29 -0
- package/functions/utils/external-action.utils.js +61 -0
- package/functions/utils/getDataFromTransaction.js +105 -0
- package/functions/utils/memoize.utils.js +14 -0
- package/functions/utils/nickname.utils.js +7 -0
- package/functions/utils/process.utils.js +4 -0
- package/functions/utils/reloadPage.js +4 -0
- package/functions/utils/requireEnv.js +7 -0
- package/functions/utils/resolve-sync.utils.js +22 -0
- package/functions/utils/serialize.utils.js +4 -0
- package/functions/utils/string.utils.js +14 -0
- package/functions/utils/time.utils.js +8 -0
- package/functions/utils/userAgent.js +15 -0
- package/functions/utils/volatile-patcher.utils.js +40 -0
- package/functions/web3/etherFunctions.js +41 -0
- package/functions/web3/events/balanceChangedHandler.js +10 -0
- package/functions/web3/events/getInputUtxoAndBalance.js +72 -0
- package/functions/web3/events/getShieldedBalance.js +107 -0
- package/functions/web3/events/web3RetrieveEvents.js +9 -0
- package/functions/web3/functionCalls/accessTokenCalls.js +48 -0
- package/functions/web3/functionCalls/approveToken.js +153 -0
- package/functions/web3/functionCalls/estimateGasRelayer.js +18 -0
- package/functions/web3/functionCalls/transactCallDirect.js +60 -0
- package/functions/web3/functionCalls/transactCallRelayer.js +42 -0
- package/functions/web3/odosAPI.js +65 -0
- package/functions/web3/oneInchAPI.js +61 -0
- package/functions/web3/runContractFunction.js +95 -0
- package/functions/web3/uniswapAPI.js +97 -0
- package/index.js +644 -0
- package/package.json +5 -4
- package/types/beefy.types.js +21 -0
- package/types/circom-data.types.js +22 -0
- package/types/curve.types.js +25 -0
- package/types/ethereum-network.types.js +4 -0
- package/types/external-action.types.js +4 -0
- package/types/hinkal.stake.types.js +4 -0
- package/types/hinkal.types.js +15 -0
- package/types/kyc.types.js +13 -0
- package/types/pendle.types.js +15 -0
- package/types/rewards.types.js +27 -0
- package/types/slippage.types.js +15 -0
- package/types/time.types.js +58 -0
- package/types/token.types.js +4 -0
- package/types/transactions.types.js +36 -0
- package/webworker/performTaskWithWorker.js +62 -0
- package/webworker/snarkjsWorker/snarkjsWorker.types.js +4 -0
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.js +32 -0
- package/webworker/utxoWorker/utxoWorker.types.js +4 -0
- package/webworker/utxoWorker/utxoWorkerLogic.js +70 -0
- package/webworker/viteWorkerURL.constant.d.ts +3 -3
- package/webworker/worker.registry.js +4 -0
- package/webworker/workerFactory.d.ts +0 -1
- package/webworker/workerFactory.js +42 -0
- package/{workerProxy-BDj498Ht.mjs → webworker/workerProxy.js} +1 -1
- package/webworker/zkProofWorker/zkProofWorker.types.js +4 -0
- package/webworker/zkProofWorker/zkProofWorkerLogic.js +66 -0
- package/assets/viteWorkerURL.constant-DrIQXA2B.js +0 -11
- package/index-DbehuQxV.mjs +0 -398145
- package/index.mjs +0 -457
- package/snarkjsWorkerLogic-BpNWzeoy.mjs +0 -12086
- package/utxoWorkerLogic-D7NuHk_K.mjs +0 -64
- package/viteWorkerURL.constant-Bc7ufzqC.mjs +0 -9
- package/zkProofWorkerLogic-Bnalmuka.mjs +0 -60
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import i 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 p } 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 T = async (t, o, r) => (await i.get(`${m(t)}${p.ROUTES.connextReceiveFee(o, r)}`)).data;
|
|
28
|
+
export {
|
|
29
|
+
T as getConnextReceiveFee
|
|
30
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import a 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 e } from "./getRelayerURL.js";
|
|
17
|
+
import { RELAYER_CONFIG as s } 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 j = async (t, r, o, m, i, p) => (await a.get(
|
|
28
|
+
`${e(t)}${s.getGasEstimate(
|
|
29
|
+
r,
|
|
30
|
+
o,
|
|
31
|
+
m,
|
|
32
|
+
i,
|
|
33
|
+
p
|
|
34
|
+
)}`
|
|
35
|
+
)).data;
|
|
36
|
+
export {
|
|
37
|
+
j as getGasEstimates
|
|
38
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { chainIds as i } from "../constants/chains.constants.js";
|
|
2
|
+
import "../types/circom-data.types.js";
|
|
3
|
+
import "../types/transactions.types.js";
|
|
4
|
+
import "../types/curve.types.js";
|
|
5
|
+
import "ethers";
|
|
6
|
+
import "circomlibjs";
|
|
7
|
+
import "../data-structures/crypto-keys/keys.js";
|
|
8
|
+
import "axios";
|
|
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 { RELAYER_URLS as m, STAGING_RELAYER_URLS as p, PLAYGROUND_RELAYER_URLS as n } from "../constants/server.constants.js";
|
|
17
|
+
import { deploymentMode as o, DEPLOYMENT_MODE as e } from "../constants/vite.constants.js";
|
|
18
|
+
import "../functions/utils/userAgent.js";
|
|
19
|
+
import "../constants/reorg-depths.constants.js";
|
|
20
|
+
import "../constants/kyc.constants.js";
|
|
21
|
+
import "../data-structures/volatile-helper/VolatileHelper.js";
|
|
22
|
+
import "libsodium-wrappers";
|
|
23
|
+
import "../constants/contracts.constants.js";
|
|
24
|
+
import "../constants/axelar.constants.js";
|
|
25
|
+
import "../constants/rewards.constants.js";
|
|
26
|
+
const V = (r) => {
|
|
27
|
+
let t;
|
|
28
|
+
return o === e.DEVELOPMENT ? t = m : o === e.STAGING ? t = p : o === e.PLAYGROUND ? t = n : t = m, r === i.polygon ? t.polygon : r === i.arbMainnet ? t.arbMainnet : r === i.ethMainnet ? t.ethMainnet : r === i.bnbMainnet ? t.bnbMainnet : r === i.avalanche ? t.avalanche : r === i.optimism ? t.optimism : r === i.base ? t.base : r === i.blast ? t.blast : t.localhost;
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
V as getRelayerURL
|
|
32
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { chainIds as r, chainIdsByType as p, EthereumNetworkType as s } from "../constants/chains.constants.js";
|
|
2
|
+
import "../types/circom-data.types.js";
|
|
3
|
+
import "../types/transactions.types.js";
|
|
4
|
+
import "../types/curve.types.js";
|
|
5
|
+
import "ethers";
|
|
6
|
+
import "circomlibjs";
|
|
7
|
+
import "../data-structures/crypto-keys/keys.js";
|
|
8
|
+
import "axios";
|
|
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 { DATA_SERVER_URL_PRODUCTION as n, PLAYGROUND_URL as R, DATA_SERVER_PORT as a, STAGING_URL as c, DATA_SERVER_URL_LOCAL as E, SERVER_URLS as m, STAGING_SERVER_URLS as l, PLAYGROUND_SERVER_URLS as u } from "../constants/server.constants.js";
|
|
17
|
+
import { deploymentMode as o, DEPLOYMENT_MODE as e } from "../constants/vite.constants.js";
|
|
18
|
+
import "../functions/utils/userAgent.js";
|
|
19
|
+
import "../constants/reorg-depths.constants.js";
|
|
20
|
+
import "../constants/kyc.constants.js";
|
|
21
|
+
import "../data-structures/volatile-helper/VolatileHelper.js";
|
|
22
|
+
import "libsodium-wrappers";
|
|
23
|
+
import "../constants/contracts.constants.js";
|
|
24
|
+
import "../constants/axelar.constants.js";
|
|
25
|
+
import "../constants/rewards.constants.js";
|
|
26
|
+
const k = (i) => {
|
|
27
|
+
let t;
|
|
28
|
+
switch (o === e.DEVELOPMENT ? t = m : o === e.STAGING ? t = l : o === e.PLAYGROUND ? t = u : t = m, i) {
|
|
29
|
+
case r.polygon:
|
|
30
|
+
return t.polygon;
|
|
31
|
+
case r.arbMainnet:
|
|
32
|
+
return t.arbMainnet;
|
|
33
|
+
case r.ethMainnet:
|
|
34
|
+
return t.ethMainnet;
|
|
35
|
+
case r.avalanche:
|
|
36
|
+
return t.avalanche;
|
|
37
|
+
case r.bnbMainnet:
|
|
38
|
+
return t.bnbMainnet;
|
|
39
|
+
case r.optimism:
|
|
40
|
+
return t.optimism;
|
|
41
|
+
case r.base:
|
|
42
|
+
return t.base;
|
|
43
|
+
case r.blast:
|
|
44
|
+
return t.blast;
|
|
45
|
+
case r.localhost:
|
|
46
|
+
return t.localhost;
|
|
47
|
+
default:
|
|
48
|
+
return t.polygon;
|
|
49
|
+
}
|
|
50
|
+
}, x = (i) => {
|
|
51
|
+
switch (o) {
|
|
52
|
+
case e.DEVELOPMENT:
|
|
53
|
+
return p[s.Mainnet].includes(i) ? n : `${E}:${a}`;
|
|
54
|
+
case e.STAGING:
|
|
55
|
+
return `${c}:${a}`;
|
|
56
|
+
case e.PLAYGROUND:
|
|
57
|
+
return `${R}:${a}`;
|
|
58
|
+
case e.PRODUCTION:
|
|
59
|
+
return n;
|
|
60
|
+
default:
|
|
61
|
+
return n;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
x as getDataServerURL,
|
|
66
|
+
k as getServerURL
|
|
67
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
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 p } 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 N(t, r, m) {
|
|
28
|
+
return (await o.post(`${i(t)}${p.getTokenPrice}`, {
|
|
29
|
+
erc20Address: r,
|
|
30
|
+
id: m
|
|
31
|
+
})).data;
|
|
32
|
+
}
|
|
33
|
+
async function O(t, r) {
|
|
34
|
+
return (await o.get(`${i(t)}${p.getTokenPriceEth(r)}`)).data;
|
|
35
|
+
}
|
|
36
|
+
const U = async (t, r) => (await o.post(`${i(t)}${p.getTokenPrices}`, { erc20Addresses: r })).data;
|
|
37
|
+
export {
|
|
38
|
+
N as getTokenPrice,
|
|
39
|
+
O as getTokenPriceEth,
|
|
40
|
+
U as getTokenPrices
|
|
41
|
+
};
|
package/API/kycCalls.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import a from "axios";
|
|
2
|
+
import { API_CONFIG as s } from "../constants/server.constants.js";
|
|
3
|
+
import { getServerURL as r } from "./getServerURL.js";
|
|
4
|
+
async function T(t, e) {
|
|
5
|
+
return (await a.post(`${r(t)}${s.ROUTES.checkKycStatus}`, {
|
|
6
|
+
ethereumAddress: e
|
|
7
|
+
})).data;
|
|
8
|
+
}
|
|
9
|
+
async function $(t, e, n, c) {
|
|
10
|
+
return (await a.post(`${r(t)}${s.ROUTES.startUserVerification}`, {
|
|
11
|
+
ethereumAddress: e,
|
|
12
|
+
verificationSessionId: n,
|
|
13
|
+
verificationType: c
|
|
14
|
+
})).data;
|
|
15
|
+
}
|
|
16
|
+
async function S(t, e, n) {
|
|
17
|
+
return (await a.post(`${r(t)}${s.ROUTES.getUserSignature}`, { ethereumAddress: e, accessKey: n })).data;
|
|
18
|
+
}
|
|
19
|
+
const U = async (t) => (await a.get(`${r(t)}${s.ROUTES.zkMeAccessToken}`)).data.accessToken, f = async (t, e) => (await a.get(
|
|
20
|
+
`${r(t)}${s.ROUTES.userHasAccessToken(e)}`
|
|
21
|
+
)).data, p = async (t, e, n) => (await a.post(`${r(t)}${s.ROUTES.afterKycCall}`, {
|
|
22
|
+
ethereumAddress: e,
|
|
23
|
+
hasAccessTokenOnAnyChain: n
|
|
24
|
+
})).data;
|
|
25
|
+
export {
|
|
26
|
+
p as afterKycCall,
|
|
27
|
+
S as getAccessTokenSignature,
|
|
28
|
+
T as getUserKycStatus,
|
|
29
|
+
U as getZkMeAccessToken,
|
|
30
|
+
$ as setAiPriseVerificationUrl,
|
|
31
|
+
f as userHasAccessToken
|
|
32
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import p 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 s } 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 L = async (r, o) => (await p.get(
|
|
28
|
+
`${s(r)}${i.ROUTES.userHasPassword(o)}`
|
|
29
|
+
)).data, N = async (r, o, t) => (await p.post(`${s(r)}${i.ROUTES.userRegisterPassword}`, {
|
|
30
|
+
ethereumAddress: o,
|
|
31
|
+
passwordHash: t
|
|
32
|
+
})).data;
|
|
33
|
+
export {
|
|
34
|
+
L as userHasPassword,
|
|
35
|
+
N as userRegisterPassword
|
|
36
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
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 s } 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 I = async (e, t) => (await o.get(`${s(e)}${a.ROUTES.getActiveCode(t)}`)).data, W = async (e, t, r) => (await o.post(`${s(e)}${a.ROUTES.updateActiveCode}`, {
|
|
28
|
+
ethereumAddress: t,
|
|
29
|
+
activeCode: r
|
|
30
|
+
})).data, F = async (e, t, r) => (await o.get(
|
|
31
|
+
`${s(e)}${a.ROUTES.getWeeklyReferralCodes(t, r)}`
|
|
32
|
+
)).data, G = async (e, t) => (await o.get(`${s(e)}${a.ROUTES.getReferralCodes(t)}`)).data, N = async (e, t, r, n) => (await o.post(`${s(e)}${a.ROUTES.addReferralCode}`, {
|
|
33
|
+
ethereumAddress: t,
|
|
34
|
+
referralCode: r,
|
|
35
|
+
action: n
|
|
36
|
+
})).data, _ = async (e, t) => (await o.get(`${s(e)}${a.ROUTES.getLpProgram(t)}`)).data, b = async (e, t) => (await o.get(
|
|
37
|
+
`${s(t)}${a.ROUTES.getRewardsHistory(e)}`
|
|
38
|
+
)).data, h = async (e, t, r, n) => (await o.post(
|
|
39
|
+
`${s(n)}${a.ROUTES.setRewardsReceivingData}`,
|
|
40
|
+
{
|
|
41
|
+
ethereumAddress: e,
|
|
42
|
+
receivingAddress: t,
|
|
43
|
+
rewardTokenAddress: r
|
|
44
|
+
}
|
|
45
|
+
)).data, j = async (e, t) => (await o.get(
|
|
46
|
+
`${s(t)}${a.ROUTES.getRewardsReceivingData(e)}`
|
|
47
|
+
)).data;
|
|
48
|
+
export {
|
|
49
|
+
N as addReferralCode,
|
|
50
|
+
I as getActiveCode,
|
|
51
|
+
_ as getLpProgram,
|
|
52
|
+
G as getReferralCodes,
|
|
53
|
+
b as getRewardsHistory,
|
|
54
|
+
j as getRewardsReceivingData,
|
|
55
|
+
F as getWeeklyReferralCodes,
|
|
56
|
+
h as setRewardsReceivingData,
|
|
57
|
+
W as updateActiveCode
|
|
58
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import o from "axios";
|
|
2
|
+
import { getRelayerURL as r } from "./getRelayerURL.js";
|
|
3
|
+
import "../constants/chains.constants.js";
|
|
4
|
+
import "../types/circom-data.types.js";
|
|
5
|
+
import "../types/transactions.types.js";
|
|
6
|
+
import "../types/curve.types.js";
|
|
7
|
+
import "ethers";
|
|
8
|
+
import "circomlibjs";
|
|
9
|
+
import "../data-structures/crypto-keys/keys.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 { 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
|
+
const Y = async (t) => (await o.get(`${r(t)}${m.getIdleRelay}`)).data;
|
|
28
|
+
export {
|
|
29
|
+
Y as getIdleRelay
|
|
30
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
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 t } 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 p } 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 G(r) {
|
|
28
|
+
return (await o.post(`${t(r)}${p.ROUTES.restoreSnapshots}`)).data;
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
G as restoreSnapshots
|
|
32
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import e 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 s } 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 F = async (t, o, r, p) => (await e.post(`${s(t)}${a.ROUTES.addNickname}`, {
|
|
28
|
+
ethereumAddress: o,
|
|
29
|
+
nickname: r,
|
|
30
|
+
action: p
|
|
31
|
+
})).data, G = async (t, o) => (await e.get(`${s(t)}${a.ROUTES.getNickname(o)}`)).data, P = async (t, o, r) => (await e.get(`${s(o)}${a.ROUTES.points(t, r)}`)).data, _ = async (t, o) => (await e.get(`${s(t)}${a.ROUTES.leaderboard(o)}`)).data, h = async (t, o) => (await e.get(
|
|
32
|
+
`${s(t)}${a.ROUTES.seasonLeaderboard(o)}`
|
|
33
|
+
)).data;
|
|
34
|
+
export {
|
|
35
|
+
F as addNickname,
|
|
36
|
+
G as getNickname,
|
|
37
|
+
_ as leaderboard,
|
|
38
|
+
P as points,
|
|
39
|
+
h as seasonLeaderboard
|
|
40
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import i from "axios";
|
|
2
|
+
import { getServerURL as a } from "./getServerURL.js";
|
|
3
|
+
import "../constants/chains.constants.js";
|
|
4
|
+
import "../types/circom-data.types.js";
|
|
5
|
+
import "../types/transactions.types.js";
|
|
6
|
+
import "../types/curve.types.js";
|
|
7
|
+
import "ethers";
|
|
8
|
+
import "circomlibjs";
|
|
9
|
+
import "../data-structures/crypto-keys/keys.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 P = async (t, r) => {
|
|
28
|
+
const { data: o } = await i.get(
|
|
29
|
+
`${a(t)}${m.ROUTES.verificationStartDate(r)}`
|
|
30
|
+
);
|
|
31
|
+
return o;
|
|
32
|
+
}, _ = async (t, r, o) => (await i.get(
|
|
33
|
+
`${a(t)}${m.ROUTES.userGetTransactions(r, o)}`
|
|
34
|
+
)).data, b = async (t, r, o, s, p, n) => (await i.post(`${a(t)}${m.ROUTES.userVerifyTransactions}`, {
|
|
35
|
+
transactionHashes: r,
|
|
36
|
+
zkCallDataArray: o,
|
|
37
|
+
backendToken: s,
|
|
38
|
+
ethereumAddress: p,
|
|
39
|
+
week: n
|
|
40
|
+
})).data;
|
|
41
|
+
export {
|
|
42
|
+
_ as userGetTransactions,
|
|
43
|
+
b as userVerifyTransactions,
|
|
44
|
+
P as verificationStartDate
|
|
45
|
+
};
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Hinkal is a middleware and a set of smart contracts on EVM chains that use ZK-pr
|
|
|
4
4
|
|
|
5
5
|
This SDK allows users to perform arbitrary smart contract interactions privately.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
9
|
Using npm:
|
|
10
10
|
|
|
@@ -18,6 +18,120 @@ Or, yarn:
|
|
|
18
18
|
yarn add @hinkal/common
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
|
|
22
|
+
## Vite-based React App
|
|
23
|
+
#### Step 1: Create a Vite App
|
|
24
|
+
If you don't have a Vite app set up, create one using the following command:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm create vite@latest my-vite-app --template react
|
|
28
|
+
cd my-vite-app
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Create React App (CRA)
|
|
32
|
+
|
|
33
|
+
#### Step 1: Create a CRA App
|
|
34
|
+
If you don't have a CRA app set up, create one using the following command:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx create-react-app my-cra-app
|
|
38
|
+
|
|
39
|
+
cd my-cra-app
|
|
40
|
+
```
|
|
41
|
+
#### Step 2: Install Required Packages
|
|
42
|
+
For correct operation in CRA, you should install craco and update the configuration:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install @craco/craco copy-webpack-plugin
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### Step 3: Configure CRACO
|
|
49
|
+
Create a craco.config.js file in the root of your CRA project and add the following configuration:
|
|
50
|
+
|
|
51
|
+
```javascript
|
|
52
|
+
// craco.config.js
|
|
53
|
+
const CopyPlugin = require("copy-webpack-plugin");
|
|
54
|
+
const webpack = require('webpack');
|
|
55
|
+
|
|
56
|
+
module.exports = {
|
|
57
|
+
webpack: {
|
|
58
|
+
configure: (config, { env, paths }) => {
|
|
59
|
+
return {
|
|
60
|
+
...config,
|
|
61
|
+
// Important: This plugins update is required for correct @hinkal/common work
|
|
62
|
+
plugins: [
|
|
63
|
+
...config.plugins || [],
|
|
64
|
+
new CopyPlugin({
|
|
65
|
+
patterns: [{
|
|
66
|
+
from: './node_modules/@hinkal/common/assets/*.js',
|
|
67
|
+
to: './static/media/[name].js'
|
|
68
|
+
}],
|
|
69
|
+
}),
|
|
70
|
+
new webpack.ProvidePlugin({
|
|
71
|
+
Buffer: ['buffer', 'Buffer'],
|
|
72
|
+
}),
|
|
73
|
+
],
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
```
|
|
79
|
+
The CRACO configuration is essential because your library utilizes Web Workers. The CopyPlugin is required to ensure that the necessary worker scripts are correctly loaded into your application. By copying the worker-related assets to the appropriate directory, you enable seamless access to these resources.
|
|
80
|
+
|
|
81
|
+
Additionally, the webpack.ProvidePlugin configuration is needed for the correct functioning of the worker, as it provides the Buffer global variable, which some functionalities in your library may depend on.
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
#### Step 4: Update Scripts in package.json
|
|
85
|
+
Update the scripts section in package.json to use CRACO:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
"scripts": {
|
|
89
|
+
"start": "craco start",
|
|
90
|
+
"build": "craco build",
|
|
91
|
+
"test": "craco test",
|
|
92
|
+
"eject": "react-scripts eject"
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## 3. Next.js-based App
|
|
97
|
+
#### Step 1: Create a Next.js App
|
|
98
|
+
If you don't have a Next.js app set up, create one using the following command:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npx create-next-app@latest my-next-app
|
|
102
|
+
cd my-next-app
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
#### Step 2: Install Required Packages
|
|
106
|
+
For correct operation in Next.js, you should install copy-webpack-plugin:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npm install copy-webpack-plugin
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
#### Step 3: Configure Next.js
|
|
113
|
+
Create or update the next.config.js file in the root of your Next.js project and add the following configuration:
|
|
114
|
+
|
|
115
|
+
```javascript
|
|
116
|
+
// next.config.js
|
|
117
|
+
const CopyPlugin = require("copy-webpack-plugin");
|
|
118
|
+
|
|
119
|
+
module.exports = {
|
|
120
|
+
webpack: (config) => {
|
|
121
|
+
config.plugins.push(
|
|
122
|
+
new CopyPlugin({
|
|
123
|
+
patterns: [{
|
|
124
|
+
from: './node_modules/@hinkal/common/assets/*.js',
|
|
125
|
+
to: './static/media/[name].js'
|
|
126
|
+
}],
|
|
127
|
+
})
|
|
128
|
+
);
|
|
129
|
+
return config;
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
```
|
|
133
|
+
The CopyPlugin in the Next.js configuration is required to ensure that the necessary worker scripts are correctly loaded into your application. By copying the worker-related assets to the appropriate directory, you enable seamless access to these resources. This setup is crucial for the proper functioning of your library, which relies on Web Workers.
|
|
134
|
+
|
|
21
135
|
### Usage
|
|
22
136
|
|
|
23
137
|
1. Import hinkal from @hinkal/common package and initiate a Hinkal instance:
|
|
@@ -91,3 +205,4 @@ Once the user has passed the check, they can mint an access token using:
|
|
|
91
205
|
const { signatureData } = await hinkal.getAPI().getAccessTokenSignature(chainId, ethereumAddress, accessKey);
|
|
92
206
|
await mintAccessToken(this, signatureData);
|
|
93
207
|
```
|
|
208
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./zkProofWorkerLauncher-
|
|
1
|
+
import { W as Qi } from "./zkProofWorkerLogic-CPNuu61R.js";
|
|
2
|
+
import "./zkProofWorkerLauncher-J3Ts5_Ba.js";
|
|
3
3
|
const Pi = [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4];
|
|
4
4
|
function Xn(c, t) {
|
|
5
5
|
if (!t || t == 10)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { U as l, d as p,
|
|
2
|
-
import "./zkProofWorkerLauncher-
|
|
1
|
+
import { U as l, d as p, W as T, a as f, b as I, c as y, l as h, p as m } from "./zkProofWorkerLogic-CPNuu61R.js";
|
|
2
|
+
import "./zkProofWorkerLauncher-J3Ts5_Ba.js";
|
|
3
3
|
const U = (e) => {
|
|
4
4
|
const t = p.decode(
|
|
5
5
|
["uint256", "address", "tuple(uint256, uint256, uint256, uint256)", "uint256", "uint256"],
|
|
@@ -1190,7 +1190,7 @@ const et = () => {
|
|
|
1190
1190
|
};
|
|
1191
1191
|
globalThis.process = tt;
|
|
1192
1192
|
globalThis.Buffer = xr.Buffer;
|
|
1193
|
-
const nt = import("./zkProofWorkerLogic-
|
|
1193
|
+
const nt = import("./zkProofWorkerLogic-CPNuu61R.js").then(function(f) {
|
|
1194
1194
|
return f.z;
|
|
1195
1195
|
});
|
|
1196
1196
|
addEventListener("message", async (f) => {
|