@hinkal/common 0.2.12 → 0.2.14
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.cjs +1 -1
- package/API/API.d.ts +9 -3
- package/API/API.mjs +44 -34
- package/API/ai-calls.cjs +1 -0
- package/API/ai-calls.d.ts +9 -0
- package/API/ai-calls.mjs +13 -0
- package/API/callCurveAPI.cjs +1 -1
- package/API/callCurveAPI.mjs +28 -22
- package/API/callRelayer.d.ts +3 -2
- package/API/dataServerCalls.cjs +1 -1
- package/API/dataServerCalls.d.ts +4 -0
- package/API/dataServerCalls.mjs +11 -7
- package/API/duneAPI.cjs +1 -1
- package/API/duneAPI.mjs +6 -4
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.d.ts +9 -1
- package/API/fetchCommitmentsCache.mjs +6 -5
- package/API/getGasEstimates.cjs +1 -1
- package/API/getGasEstimates.d.ts +2 -1
- package/API/getGasEstimates.mjs +10 -9
- package/API/getServerURL.d.ts +1 -1
- package/API/index.d.ts +2 -0
- package/API/is-tx-stateless.cjs +1 -0
- package/API/is-tx-stateless.d.ts +3 -0
- package/API/is-tx-stateless.mjs +9 -0
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +0 -4
- package/API/kycCalls.mjs +11 -15
- package/API/rewardsPointsCalls.d.ts +0 -3
- package/API/tenderly.api.cjs +1 -0
- package/API/tenderly.api.d.ts +12 -0
- package/API/tenderly.api.mjs +47 -0
- package/API/token-calls.cjs +1 -0
- package/API/token-calls.d.ts +2 -0
- package/API/token-calls.mjs +9 -0
- package/README.md +0 -61
- package/constants/addresses.constants.cjs +1 -0
- package/constants/addresses.constants.d.ts +16 -0
- package/constants/addresses.constants.mjs +50 -0
- package/constants/assets.constants.cjs +1 -1
- package/constants/assets.constants.mjs +13 -13
- package/constants/axelar.constants.cjs +1 -1
- package/constants/axelar.constants.mjs +5 -5
- package/constants/balance.constants.cjs +1 -0
- package/constants/balance.constants.d.ts +1 -0
- package/constants/balance.constants.mjs +4 -0
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +0 -2
- package/constants/chains.constants.mjs +26 -38
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.mjs +108 -108
- package/constants/conversion.constants.cjs +1 -0
- package/constants/conversion.constants.d.ts +1 -0
- package/constants/conversion.constants.mjs +4 -0
- package/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-localhost.json.mjs +1652 -829
- package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-optimism.json.mjs +9707 -3957
- package/constants/fees.constants.cjs +1 -1
- package/constants/fees.constants.d.ts +5 -3
- package/constants/fees.constants.mjs +22 -19
- package/constants/index.d.ts +6 -0
- package/constants/mediaUrls.constants.cjs +1 -0
- package/constants/mediaUrls.constants.d.ts +23 -0
- package/constants/mediaUrls.constants.mjs +26 -0
- package/constants/permit2.constants.cjs +1 -0
- package/constants/permit2.constants.d.ts +2 -0
- package/constants/permit2.constants.mjs +5 -0
- package/constants/protocol.constants.cjs +1 -1
- package/constants/protocol.constants.d.ts +6 -0
- package/constants/protocol.constants.mjs +27 -15
- package/constants/rewards.constants.cjs +1 -1
- package/constants/rewards.constants.d.ts +0 -1
- package/constants/rewards.constants.mjs +14 -13
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +8 -3
- package/constants/server.constants.mjs +16 -11
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +10 -9
- package/constants/token-data/arbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistry.json.mjs +88 -88
- package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.mjs +78 -78
- package/constants/token-data/avalancheRegistry.json.cjs +1 -1
- package/constants/token-data/avalancheRegistry.json.mjs +49 -49
- package/constants/token-data/avalancheRegistryFixed.json.cjs +1 -1
- package/constants/token-data/avalancheRegistryFixed.json.mjs +49 -49
- package/constants/token-data/baseRegistry.json.cjs +1 -1
- package/constants/token-data/baseRegistry.json.mjs +32 -32
- package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
- package/constants/token-data/baseRegistryFixed.json.mjs +29 -29
- package/constants/token-data/bnbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistry.json.mjs +65 -65
- package/constants/token-data/bnbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistryFixed.json.mjs +65 -65
- package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistry.json.mjs +227 -227
- package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.mjs +191 -191
- package/constants/token-data/index.d.ts +91 -0
- package/constants/token-data/localhostRegistry.json.cjs +1 -1
- package/constants/token-data/localhostRegistry.json.mjs +294 -277
- package/constants/token-data/optimismRegistry.json.cjs +1 -1
- package/constants/token-data/optimismRegistry.json.mjs +702 -182
- package/constants/token-data/optimismRegistryFixed.json.cjs +1 -1
- package/constants/token-data/optimismRegistryFixed.json.mjs +678 -175
- package/constants/token-data/polygonRegistry.json.cjs +1 -1
- package/constants/token-data/polygonRegistry.json.mjs +109 -109
- package/constants/token-data/polygonRegistryFixed.json.cjs +1 -1
- package/constants/token-data/polygonRegistryFixed.json.mjs +101 -101
- package/constants/token.limits.constants.cjs +1 -0
- package/constants/token.limits.constants.d.ts +5 -0
- package/constants/token.limits.constants.mjs +30 -0
- package/constants/vite.constants.cjs +1 -1
- package/constants/vite.constants.d.ts +5 -0
- package/constants/vite.constants.mjs +26 -22
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +46 -21
- package/data-structures/Hinkal/Hinkal.mjs +260 -92
- package/data-structures/Hinkal/IHinkal.d.ts +35 -11
- package/data-structures/Hinkal/hinkalActionBeefy.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionBeefy.mjs +5 -4
- package/data-structures/Hinkal/hinkalActionConvex.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionConvex.mjs +4 -3
- package/data-structures/Hinkal/hinkalActionCurve.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionCurve.mjs +5 -4
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +1 -0
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +3 -0
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +61 -0
- package/data-structures/Hinkal/hinkalActionLidoEth.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionLidoEth.mjs +9 -8
- package/data-structures/Hinkal/hinkalActionPendle.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionPendle.mjs +17 -16
- package/data-structures/Hinkal/hinkalActionPendleLP.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionPendleLP.mjs +14 -12
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -0
- package/data-structures/Hinkal/hinkalActionReceive.d.ts +4 -0
- package/data-structures/Hinkal/hinkalActionReceive.mjs +39 -0
- package/data-structures/Hinkal/hinkalActionStake.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionStake.mjs +12 -9
- package/data-structures/Hinkal/hinkalActionVolatile.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionVolatile.mjs +25 -21
- package/data-structures/Hinkal/hinkalApprove.cjs +1 -0
- package/data-structures/Hinkal/hinkalApprove.d.ts +2 -0
- package/data-structures/Hinkal/hinkalApprove.mjs +120 -0
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -0
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.d.ts +3 -0
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +12 -0
- package/data-structures/Hinkal/hinkalDeploySubAccount.cjs +1 -0
- package/data-structures/Hinkal/hinkalDeploySubAccount.d.ts +3 -0
- package/data-structures/Hinkal/hinkalDeploySubAccount.mjs +15 -0
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.d.ts +3 -2
- package/data-structures/Hinkal/hinkalDeposit.mjs +96 -71
- package/data-structures/Hinkal/hinkalGetRecipientInfo.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetRecipientInfo.d.ts +1 -1
- package/data-structures/Hinkal/hinkalGetRecipientInfo.mjs +5 -11
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +6 -18
- package/data-structures/Hinkal/hinkalInsideTransact.cjs +1 -0
- package/data-structures/Hinkal/hinkalInsideTransact.d.ts +2 -0
- package/data-structures/Hinkal/hinkalInsideTransact.mjs +111 -0
- package/data-structures/Hinkal/hinkalMultiSend.cjs +1 -0
- package/data-structures/Hinkal/hinkalMultiSend.d.ts +3 -0
- package/data-structures/Hinkal/hinkalMultiSend.mjs +13 -0
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +83 -38
- package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -0
- package/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +4 -0
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +46 -0
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -0
- package/data-structures/Hinkal/hinkalProxySwap.d.ts +5 -0
- package/data-structures/Hinkal/hinkalProxySwap.mjs +36 -0
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -0
- package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +20 -0
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.d.ts +2 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +68 -60
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.d.ts +3 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +76 -50
- package/data-structures/Hinkal/index.d.ts +1 -0
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +18 -11
- package/data-structures/IndexedDB/activity-db.cjs +1 -0
- package/data-structures/IndexedDB/activity-db.d.ts +16 -0
- package/data-structures/IndexedDB/activity-db.mjs +124 -0
- package/data-structures/IndexedDB/balances-db.cjs +1 -0
- package/data-structures/IndexedDB/balances-db.d.ts +13 -0
- package/data-structures/IndexedDB/balances-db.mjs +75 -0
- package/data-structures/IndexedDB/contact-db.cjs +1 -0
- package/data-structures/IndexedDB/contact-db.d.ts +11 -0
- package/data-structures/IndexedDB/contact-db.mjs +44 -0
- package/data-structures/IndexedDB/index.d.ts +5 -0
- package/data-structures/IndexedDB/prices-db.cjs +1 -0
- package/data-structures/IndexedDB/prices-db.d.ts +9 -0
- package/data-structures/IndexedDB/prices-db.mjs +62 -0
- package/data-structures/IndexedDB/private-balances-db.cjs +1 -0
- package/data-structures/IndexedDB/private-balances-db.d.ts +9 -0
- package/data-structures/IndexedDB/private-balances-db.mjs +28 -0
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +47 -44
- package/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -0
- package/data-structures/TokenDBs/PrivateTokensDB.d.ts +11 -0
- package/data-structures/TokenDBs/PrivateTokensDB.mjs +53 -0
- package/data-structures/TokenDBs/PublicTokensDB.cjs +1 -0
- package/data-structures/TokenDBs/PublicTokensDB.d.ts +13 -0
- package/data-structures/TokenDBs/PublicTokensDB.mjs +81 -0
- package/data-structures/TokenDBs/index.d.ts +2 -0
- package/data-structures/cacheDevices/AttachableMemoryCacheDevice.cjs +1 -0
- package/data-structures/cacheDevices/AttachableMemoryCacheDevice.d.ts +8 -0
- package/data-structures/cacheDevices/AttachableMemoryCacheDevice.mjs +28 -0
- package/data-structures/cacheDevices/BaseCacheDevice.cjs +1 -1
- package/data-structures/cacheDevices/BaseCacheDevice.d.ts +9 -6
- package/data-structures/cacheDevices/BaseCacheDevice.mjs +13 -4
- package/data-structures/cacheDevices/FileCacheDevice.cjs +1 -1
- package/data-structures/cacheDevices/FileCacheDevice.d.ts +1 -0
- package/data-structures/cacheDevices/FileCacheDevice.mjs +7 -3
- package/data-structures/cacheDevices/LocalStorageCacheDevice.cjs +1 -1
- package/data-structures/cacheDevices/LocalStorageCacheDevice.d.ts +2 -1
- package/data-structures/cacheDevices/LocalStorageCacheDevice.mjs +10 -5
- package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.mjs +13 -12
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +13 -3
- package/data-structures/crypto-keys/keys.mjs +45 -34
- package/data-structures/custom-token-registry/CustomTokenRegistry.cjs +1 -1
- package/data-structures/custom-token-registry/CustomTokenRegistry.d.ts +2 -3
- package/data-structures/custom-token-registry/CustomTokenRegistry.mjs +17 -21
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.mjs +15 -29
- package/data-structures/event-service/AbstractApprovalsSnapshotService.cjs +1 -0
- package/data-structures/event-service/AbstractApprovalsSnapshotService.d.ts +30 -0
- package/data-structures/event-service/AbstractApprovalsSnapshotService.mjs +104 -0
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.mjs +24 -37
- package/data-structures/event-service/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/AbstractEventService.d.ts +1 -1
- package/data-structures/event-service/AbstractEventService.mjs +34 -46
- package/data-structures/event-service/index.d.ts +1 -0
- package/data-structures/index.d.ts +2 -0
- package/data-structures/merkle-tree/MerkleTree.cjs +1 -1
- package/data-structures/merkle-tree/MerkleTree.d.ts +4 -1
- package/data-structures/merkle-tree/MerkleTree.mjs +66 -65
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs +1 -1
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.ts +1 -1
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs +10 -6
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +2 -0
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.mjs +6 -10
- package/data-structures/snapshot/ClientApprovalsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/ClientApprovalsSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/ClientApprovalsSnapshotService.mjs +23 -0
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +6 -10
- package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +6 -10
- package/data-structures/token-price-fetcher/TokenChecker.cjs +1 -1
- package/data-structures/token-price-fetcher/TokenChecker.d.ts +1 -0
- package/data-structures/token-price-fetcher/TokenChecker.mjs +4 -2
- package/data-structures/transactions-manager/TransactionsManager.cjs +1 -1
- package/data-structures/transactions-manager/TransactionsManager.d.ts +6 -5
- package/data-structures/transactions-manager/TransactionsManager.mjs +95 -100
- package/data-structures/transactions-manager/history/getBeefyData.cjs +1 -1
- package/data-structures/transactions-manager/history/getBeefyData.mjs +3 -2
- package/data-structures/transactions-manager/history/getConvexData.cjs +1 -1
- package/data-structures/transactions-manager/history/getConvexData.mjs +3 -2
- package/data-structures/transactions-manager/history/getCurveData.cjs +1 -1
- package/data-structures/transactions-manager/history/getCurveData.mjs +3 -2
- package/data-structures/transactions-manager/history/getLidoData.cjs +1 -1
- package/data-structures/transactions-manager/history/getLidoData.mjs +3 -2
- package/data-structures/transactions-manager/history/getPendleData.cjs +1 -1
- package/data-structures/transactions-manager/history/getPendleData.mjs +13 -12
- package/data-structures/transactions-manager/history/getTxDetails.cjs +1 -1
- package/data-structures/transactions-manager/history/getTxDetails.mjs +22 -20
- package/data-structures/transactions-manager/history/getVolatileData.cjs +1 -1
- package/data-structures/transactions-manager/history/getVolatileData.mjs +11 -10
- package/data-structures/transactions-manager/history/history.types.cjs +1 -1
- package/data-structures/transactions-manager/history/history.types.mjs +4 -2
- package/data-structures/utxo/Utxo.cjs +1 -1
- package/data-structures/utxo/Utxo.d.ts +3 -3
- package/data-structures/utxo/Utxo.mjs +8 -7
- package/error-handling/error-codes.constants.cjs +2 -2
- package/error-handling/error-codes.constants.d.ts +20 -3
- package/error-handling/error-codes.constants.mjs +139 -126
- package/error-handling/get-error.message.cjs +1 -1
- package/error-handling/get-error.message.mjs +29 -25
- package/error-handling/index.d.ts +1 -0
- package/error-handling/logger.cjs +1 -0
- package/error-handling/logger.d.ts +5 -0
- package/error-handling/logger.mjs +16 -0
- package/error-handling/types.cjs +1 -1
- package/error-handling/types.d.ts +3 -1
- package/error-handling/types.mjs +2 -2
- package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -0
- package/functions/pre-transaction/getExternalSwapAddress.d.ts +3 -0
- package/functions/pre-transaction/getExternalSwapAddress.mjs +26 -0
- package/functions/pre-transaction/getFeeStructure.cjs +1 -0
- package/functions/pre-transaction/getFeeStructure.d.ts +4 -0
- package/functions/pre-transaction/getFeeStructure.mjs +30 -0
- package/functions/pre-transaction/getFlatFees.cjs +1 -1
- package/functions/pre-transaction/getFlatFees.d.ts +3 -7
- package/functions/pre-transaction/getFlatFees.mjs +52 -46
- package/functions/pre-transaction/getSignatureDataForTransact.cjs +1 -0
- package/functions/pre-transaction/getSignatureDataForTransact.d.ts +3 -0
- package/functions/pre-transaction/getSignatureDataForTransact.mjs +6 -0
- package/functions/pre-transaction/index.d.ts +1 -0
- package/functions/pre-transaction/interaction-to-action.cjs +1 -1
- package/functions/pre-transaction/interaction-to-action.mjs +3 -2
- package/functions/pre-transaction/merge-with-fee-structure.cjs +1 -0
- package/functions/pre-transaction/merge-with-fee-structure.d.ts +2 -0
- package/functions/pre-transaction/merge-with-fee-structure.mjs +25 -0
- package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -0
- package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +16 -0
- package/functions/pre-transaction/outputApprovalDataProcessing.mjs +42 -0
- package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.d.ts +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.mjs +19 -30
- package/functions/pre-transaction/process-gas-estimates.cjs +1 -1
- package/functions/pre-transaction/process-gas-estimates.d.ts +2 -2
- package/functions/pre-transaction/process-gas-estimates.mjs +17 -28
- package/functions/pre-transaction/processAmountChanges.cjs +1 -1
- package/functions/pre-transaction/processAmountChanges.mjs +34 -23
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -0
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +6 -0
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +7 -0
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +17 -4
- package/functions/private-wallet/emporium.helpers.mjs +119 -12
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -0
- package/functions/private-wallet/emporium.swap.helpers.d.ts +5 -0
- package/functions/private-wallet/emporium.swap.helpers.mjs +92 -0
- package/functions/private-wallet/index.d.ts +2 -0
- package/functions/private-wallet/opProducer.cjs +1 -1
- package/functions/private-wallet/opProducer.mjs +1 -1
- package/functions/private-wallet/smartContractWalletCalculator.cjs +1 -0
- package/functions/private-wallet/smartContractWalletCalculator.d.ts +5 -0
- package/functions/private-wallet/smartContractWalletCalculator.mjs +25 -0
- package/functions/protocols/convex.protocols.cjs +1 -1
- package/functions/protocols/convex.protocols.mjs +10 -8
- package/functions/protocols/pendle.helpers.cjs +1 -1
- package/functions/protocols/pendle.helpers.mjs +16 -12
- package/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/functions/snarkjs/common.snarkjs.d.ts +8 -5
- package/functions/snarkjs/common.snarkjs.mjs +177 -87
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.d.ts +223 -2
- package/functions/snarkjs/constant.mjs +313 -93
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.d.ts +6 -3
- package/functions/snarkjs/constructEmporiumProof.mjs +148 -84
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +5 -3
- package/functions/snarkjs/constructGeneralZkProof.mjs +141 -86
- package/functions/snarkjs/generateCircomData.cjs +1 -1
- package/functions/snarkjs/generateCircomData.d.ts +3 -2
- package/functions/snarkjs/generateCircomData.mjs +33 -35
- package/functions/snarkjs/generateZkProof.cjs +1 -1
- package/functions/snarkjs/generateZkProof.d.ts +2 -2
- package/functions/snarkjs/generateZkProof.mjs +4 -4
- package/functions/snarkjs/generateZkProofEnclave.cjs +1 -1
- package/functions/snarkjs/generateZkProofEnclave.d.ts +2 -1
- package/functions/snarkjs/generateZkProofEnclave.mjs +22 -29
- package/functions/snarkjs/generateZkProofSelf.cjs +1 -1
- package/functions/snarkjs/generateZkProofSelf.d.ts +2 -2
- package/functions/snarkjs/generateZkProofSelf.mjs +10 -10
- package/functions/snarkjs/getOriginalSender.cjs +1 -0
- package/functions/snarkjs/getOriginalSender.d.ts +1 -0
- package/functions/snarkjs/getOriginalSender.mjs +5 -0
- package/functions/snarkjs/getZKFiles.cjs +1 -1
- package/functions/snarkjs/getZKFiles.d.ts +3 -2
- package/functions/snarkjs/getZKFiles.mjs +14 -5
- package/functions/utils/addresses.cjs +1 -0
- package/functions/utils/addresses.d.ts +4 -0
- package/functions/utils/addresses.mjs +20 -0
- package/functions/utils/amounts.utils.cjs +1 -1
- package/functions/utils/amounts.utils.d.ts +4 -1
- package/functions/utils/amounts.utils.mjs +29 -27
- package/functions/utils/arraysMatch.cjs +1 -0
- package/functions/utils/arraysMatch.d.ts +1 -0
- package/functions/utils/arraysMatch.mjs +4 -0
- package/functions/utils/axelar.utils.cjs +1 -1
- package/functions/utils/axelar.utils.d.ts +1 -0
- package/functions/utils/axelar.utils.mjs +31 -9
- package/functions/utils/cacheDevice.utils.cjs +1 -1
- package/functions/utils/cacheDevice.utils.mjs +5 -3
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.d.ts +10 -7
- package/functions/utils/cacheFunctions.mjs +62 -39
- package/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -0
- package/functions/utils/convertEmporiumOpToCallInfo.d.ts +2 -0
- package/functions/utils/convertEmporiumOpToCallInfo.mjs +10 -0
- package/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
- package/functions/utils/convertIntegrationProviderToExternalActionId.d.ts +2 -1
- package/functions/utils/convertIntegrationProviderToExternalActionId.mjs +7 -10
- package/functions/utils/encodeTokenWithId.cjs +1 -0
- package/functions/utils/encodeTokenWithId.d.ts +2 -0
- package/functions/utils/encodeTokenWithId.mjs +4 -0
- package/functions/utils/encryptInputForEnclave.cjs +1 -0
- package/functions/utils/encryptInputForEnclave.d.ts +8 -0
- package/functions/utils/encryptInputForEnclave.mjs +43 -0
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.d.ts +8 -2
- package/functions/utils/erc20tokenFunctions.mjs +22 -14
- package/functions/utils/evmNetworkFunctions.cjs +1 -1
- package/functions/utils/evmNetworkFunctions.mjs +6 -4
- package/functions/utils/external-action.utils.d.ts +2 -2
- package/functions/utils/fees.utils.cjs +1 -0
- package/functions/utils/fees.utils.d.ts +2 -0
- package/functions/utils/fees.utils.mjs +14 -0
- package/functions/utils/getBlockExplorerUrl.cjs +1 -0
- package/functions/utils/getBlockExplorerUrl.d.ts +1 -0
- package/functions/utils/getBlockExplorerUrl.mjs +6 -0
- package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -0
- package/functions/utils/getRecipientInfoFromUserKeys.d.ts +3 -0
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +18 -0
- package/functions/utils/index.d.ts +12 -0
- package/functions/utils/involves-permit2-op.cjs +1 -0
- package/functions/utils/involves-permit2-op.d.ts +1 -0
- package/functions/utils/involves-permit2-op.mjs +5 -0
- package/functions/utils/merkleTree.utils.cjs +1 -0
- package/functions/utils/merkleTree.utils.d.ts +2 -0
- package/functions/utils/merkleTree.utils.mjs +19 -0
- package/functions/utils/prepareHinkal.d.ts +6 -0
- package/functions/utils/processUseApprovalUtxoData.cjs +1 -0
- package/functions/utils/processUseApprovalUtxoData.d.ts +3 -0
- package/functions/utils/processUseApprovalUtxoData.mjs +19 -0
- package/functions/utils/publicBalance.utils.cjs +1 -0
- package/functions/utils/publicBalance.utils.d.ts +5 -0
- package/functions/utils/publicBalance.utils.mjs +25 -0
- package/functions/utils/replaceAddressInCalldata.cjs +1 -0
- package/functions/utils/replaceAddressInCalldata.d.ts +1 -0
- package/functions/utils/replaceAddressInCalldata.mjs +7 -0
- package/functions/utils/rpc-int-encode.cjs +1 -0
- package/functions/utils/rpc-int-encode.d.ts +2 -0
- package/functions/utils/rpc-int-encode.mjs +8 -0
- package/functions/utils/serialize.utils.cjs +1 -1
- package/functions/utils/serialize.utils.d.ts +1 -0
- package/functions/utils/serialize.utils.mjs +3 -2
- package/functions/utils/string.utils.cjs +1 -1
- package/functions/utils/string.utils.d.ts +3 -0
- package/functions/utils/string.utils.mjs +31 -7
- package/functions/utils/time.utils.cjs +1 -1
- package/functions/utils/time.utils.d.ts +1 -0
- package/functions/utils/time.utils.mjs +4 -3
- package/functions/utils/token-check.utils.cjs +1 -0
- package/functions/utils/token-check.utils.d.ts +1 -0
- package/functions/utils/token-check.utils.mjs +10 -0
- package/functions/utils/upToDateState.cjs +1 -0
- package/functions/utils/upToDateState.d.ts +2 -0
- package/functions/utils/upToDateState.mjs +11 -0
- package/functions/web3/events/balanceChangedCustomHandler.cjs +1 -0
- package/functions/web3/events/balanceChangedCustomHandler.d.ts +2 -0
- package/functions/web3/events/balanceChangedCustomHandler.mjs +14 -0
- package/functions/web3/events/balanceChangedHandler.cjs +1 -1
- package/functions/web3/events/balanceChangedHandler.mjs +5 -4
- package/functions/web3/events/getApprovedBalance.cjs +1 -0
- package/functions/web3/events/getApprovedBalance.d.ts +7 -0
- package/functions/web3/events/getApprovedBalance.mjs +80 -0
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.d.ts +16 -3
- package/functions/web3/events/getInputUtxoAndBalance.mjs +128 -46
- package/functions/web3/events/getShieldedBalance.cjs +2 -2
- package/functions/web3/events/getShieldedBalance.d.ts +1 -1
- package/functions/web3/events/getShieldedBalance.mjs +79 -82
- package/functions/web3/events/index.d.ts +2 -0
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +2 -2
- package/functions/web3/functionCalls/accessTokenCalls.mjs +19 -17
- package/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +8 -7
- package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -0
- package/functions/web3/functionCalls/approveTokensToHinkal.d.ts +4 -0
- package/functions/web3/functionCalls/approveTokensToHinkal.mjs +11 -0
- package/functions/web3/functionCalls/estimateGasRelayer.cjs +1 -1
- package/functions/web3/functionCalls/estimateGasRelayer.d.ts +2 -2
- package/functions/web3/functionCalls/estimateGasRelayer.mjs +14 -8
- package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +1 -0
- package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +5 -0
- package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +32 -0
- package/functions/web3/functionCalls/relayFunctions.d.ts +1 -15
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.d.ts +2 -2
- package/functions/web3/functionCalls/transactCallDirect.mjs +29 -42
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +2 -2
- package/functions/web3/functionCalls/transactCallRelayer.mjs +26 -5
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.mjs +6 -3
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +6 -3
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +3 -2
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +6 -3
- package/index.cjs +1 -1
- package/index.mjs +756 -612
- package/package.json +6 -2
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +7 -3
- package/providers/EthersProviderAdapter.mjs +31 -11
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +3 -1
- package/providers/WagmiProviderAdapter.mjs +12 -4
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +17 -11
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +17 -11
- package/types/API.types.d.ts +21 -0
- package/types/ICacheDevice.d.ts +4 -3
- package/types/TransactionSimulator.types.d.ts +9 -0
- package/types/activities.types.cjs +1 -0
- package/types/activities.types.d.ts +45 -0
- package/types/activities.types.mjs +13 -0
- package/types/balances.types.cjs +1 -0
- package/types/balances.types.d.ts +17 -0
- package/types/balances.types.mjs +4 -0
- package/types/cache.types.cjs +1 -0
- package/types/cache.types.d.ts +27 -0
- package/types/cache.types.mjs +4 -0
- package/types/circom-data.types.d.ts +29 -9
- package/types/commitments.types.d.ts +6 -0
- package/types/contacts.types.d.ts +5 -0
- package/types/crypto.types.d.ts +1 -0
- package/types/earlyAccessCode.types.d.ts +4 -0
- package/types/ethereum-network.types.cjs +1 -1
- package/types/ethereum-network.types.d.ts +66 -62
- package/types/ethereum-network.types.mjs +1 -1
- package/types/external-action.types.cjs +1 -1
- package/types/external-action.types.d.ts +2 -1
- package/types/external-action.types.mjs +1 -1
- package/types/fee.types.d.ts +9 -0
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +43 -5
- package/types/hinkal.types.mjs +37 -13
- package/types/index.d.ts +9 -0
- package/types/rewards.types.cjs +1 -1
- package/types/rewards.types.d.ts +3 -4
- package/types/rewards.types.mjs +12 -12
- package/types/sandbox.types.cjs +1 -0
- package/types/sandbox.types.d.ts +157 -0
- package/types/sandbox.types.mjs +4 -0
- package/types/tenderly.api.types.d.ts +180 -0
- package/types/token-with-id.types.d.ts +4 -0
- package/types/token.types.d.ts +23 -0
- package/types/transactions.types.cjs +1 -1
- package/types/transactions.types.d.ts +31 -0
- package/types/transactions.types.mjs +8 -5
- package/types/wc.types.d.ts +89 -0
- package/types/with-id.types.d.ts +3 -0
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +26 -31
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.mjs +58 -50
- package/webworker/viteWorkerURL.constant.cjs +3 -3
- package/webworker/viteWorkerURL.constant.mjs +3 -3
- package/webworker/workerFactory.cjs +1 -1
- package/webworker/workerFactory.mjs +2 -2
- package/webworker/workerProxy.cjs +1 -1
- package/webworker/workerProxy.d.ts +11 -11
- package/webworker/workerProxy.mjs +24 -26
- package/webworker/zkProofWorker/zkProofWorker.types.d.ts +2 -0
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.mjs +47 -61
- package/functions/utils/memoize.utils.cjs +0 -1
- package/functions/utils/memoize.utils.mjs +0 -14
|
@@ -1,39 +1,37 @@
|
|
|
1
|
-
import { zeroAddress as
|
|
2
|
-
import { defaultHookData as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
flatFees: c,
|
|
25
|
-
timeStamp: t[0][0].timeStamp,
|
|
26
|
-
stealthAddressStructure: g,
|
|
27
|
-
rootHashAccessToken: n,
|
|
28
|
-
relay: f,
|
|
29
|
-
externalAddress: a === void 0 ? S : a,
|
|
30
|
-
externalActionMetadata: d,
|
|
31
|
-
externalActionId: typeof e == "bigint" ? 0n : b(e),
|
|
32
|
-
hookData: u || h,
|
|
33
|
-
publicSignalCount: p,
|
|
34
|
-
calldataHash: k
|
|
1
|
+
import { zeroAddress as s, defaultSignatureData as b } from "../../constants/protocol.constants.mjs";
|
|
2
|
+
import { defaultHookData as w } from "../../types/circom-data.types.mjs";
|
|
3
|
+
import { getExternalActionIdHash as y } from "../utils/external-action.utils.mjs";
|
|
4
|
+
import { getOriginalSender as z } from "./getOriginalSender.mjs";
|
|
5
|
+
const q = async (c, m, d, g, l, f, p, a, u, D, S, i, t, k, n, A, h, C, H, V, v, x, I, L, T = b) => {
|
|
6
|
+
const o = {
|
|
7
|
+
rootHashHinkal: g,
|
|
8
|
+
erc20TokenAddresses: p.map((e) => e[0].erc20TokenAddress),
|
|
9
|
+
tokenIds: h.map((e) => String(e)),
|
|
10
|
+
amountChanges: f,
|
|
11
|
+
inputNullifiers: d,
|
|
12
|
+
outCommitments: m,
|
|
13
|
+
encryptedOutputs: u,
|
|
14
|
+
timeStamp: a.length > 0 ? a[0][0].timeStamp : String(v ?? ""),
|
|
15
|
+
stealthAddressStructure: C,
|
|
16
|
+
rootHashAccessToken: l,
|
|
17
|
+
relay: n,
|
|
18
|
+
externalAddress: t === void 0 ? s : t,
|
|
19
|
+
externalActionMetadata: k,
|
|
20
|
+
externalActionId: typeof i == "bigint" ? 0n : y(i),
|
|
21
|
+
hookData: V || w,
|
|
22
|
+
publicSignalCount: S,
|
|
23
|
+
calldataHash: A
|
|
35
24
|
};
|
|
25
|
+
if (c === "v1x0") {
|
|
26
|
+
const e = o;
|
|
27
|
+
return e.flatFees = D, e;
|
|
28
|
+
} else {
|
|
29
|
+
const e = o;
|
|
30
|
+
e.onChainCreation = H, e.slippageValues = I;
|
|
31
|
+
const r = structuredClone(x);
|
|
32
|
+
return "interactionAddress" in r && delete r.interactionAddress, e.hinkalLogicArgs = r, e.feeStructure = L, e.signatureData = T, e.originalSender = z(t ?? s, n), e;
|
|
33
|
+
}
|
|
36
34
|
};
|
|
37
35
|
export {
|
|
38
|
-
|
|
36
|
+
q as generateCircomData
|
|
39
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./generateZkProofEnclave.cjs"),f=require("./generateZkProofSelf.cjs"),g=async(e,o,r,t,n)=>n?a.generateZkProofEnclave(e,o,r,t):f.generateZkProofSelf(e,o,r,t);exports.generateZkProof=g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NewZkCallDataType } from '../../types';
|
|
2
|
-
export declare const generateZkProof: (chainId: number, verifierName: string, input: any, remotely?: boolean) => Promise<{
|
|
1
|
+
import { NewZkCallDataType, ProverVersion } from '../../types';
|
|
2
|
+
export declare const generateZkProof: (proverVersion: ProverVersion, chainId: number, verifierName: string, input: any, remotely?: boolean) => Promise<{
|
|
3
3
|
zkCallData: NewZkCallDataType;
|
|
4
4
|
publicSignals: string[];
|
|
5
5
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { generateZkProofEnclave as
|
|
2
|
-
import { generateZkProofSelf as
|
|
3
|
-
const
|
|
1
|
+
import { generateZkProofEnclave as n } from "./generateZkProofEnclave.mjs";
|
|
2
|
+
import { generateZkProofSelf as a } from "./generateZkProofSelf.mjs";
|
|
3
|
+
const m = async (o, e, r, t, f) => f ? n(o, e, r, t) : a(o, e, r, t);
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
m as generateZkProof
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("axios"),a=require("./getZKFiles.cjs"),E=require("./constant.cjs"),f=require("../utils/encryptInputForEnclave.cjs"),i=t=>{if(t.startsWith("http")){const e=t.split("/").at(-1);if(!e)throw new Error("invalid verifierName");return e}return t},m=async(t,n,e,r)=>{const s=i(a.getWASMFile(t,e,n)),c=i(a.getZKeyFile(t,e,n)),{keyCiphertext:o,inputCiphertext:l}=await f.makeEnclaveHandshakeAndEncryptInput(r),u={chainId:n,circuit_wasm:s,circuit_zkey:c,input:l,key:o,version:t},p=await k.post(`${E.ENCLAVE_EC2_URL}/generate`,u),{public_signals:g,zk_calldata:y}=p.data;return{zkCallData:y,publicSignals:g}};exports.generateZkProofEnclave=m;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NewZkCallDataType } from '../../types/snark.types';
|
|
2
|
-
|
|
2
|
+
import { ProverVersion } from '../../types/hinkal.types';
|
|
3
|
+
export declare const generateZkProofEnclave: (proverVersion: ProverVersion, chainId: number, verifierName: string, input: any) => Promise<{
|
|
3
4
|
zkCallData: NewZkCallDataType;
|
|
4
5
|
publicSignals: string[];
|
|
5
6
|
}>;
|
|
@@ -1,33 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const e = d(F(n, t)), i = d(O(n, t)), f = (await l.get(`${m}/handshake`)).data.public_key, y = s.util.decode64(f), g = s.asn1.fromDer(y), h = s.pki.publicKeyFromAsn1(g), k = w(o), c = JSON.stringify(k);
|
|
12
|
-
let p = "", r = 0;
|
|
13
|
-
for (; r < c.length; ) {
|
|
14
|
-
const S = c.slice(r, r + u);
|
|
15
|
-
r += u;
|
|
16
|
-
const z = h.encrypt(S, "RSA-OAEP", {
|
|
17
|
-
md: s.md.sha1.create(),
|
|
18
|
-
mgf1: { md: s.md.sha1.create() },
|
|
19
|
-
label: null
|
|
20
|
-
}), E = s.util.encode64(z);
|
|
21
|
-
p += E;
|
|
1
|
+
import f from "axios";
|
|
2
|
+
import { getWASMFile as k, getZKeyFile as y } from "./getZKFiles.mjs";
|
|
3
|
+
import { ENCLAVE_EC2_URL as E } from "./constant.mjs";
|
|
4
|
+
import { makeEnclaveHandshakeAndEncryptInput as g } from "../utils/encryptInputForEnclave.mjs";
|
|
5
|
+
const a = (t) => {
|
|
6
|
+
if (t.startsWith("http")) {
|
|
7
|
+
const e = t.split("/").at(-1);
|
|
8
|
+
if (!e)
|
|
9
|
+
throw new Error("invalid verifierName");
|
|
10
|
+
return e;
|
|
22
11
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
12
|
+
return t;
|
|
13
|
+
}, d = async (t, i, e, n) => {
|
|
14
|
+
const r = a(k(t, e, i)), s = a(y(t, e, i)), { keyCiphertext: o, inputCiphertext: l } = await g(n), c = {
|
|
15
|
+
chainId: i,
|
|
16
|
+
circuit_wasm: r,
|
|
17
|
+
circuit_zkey: s,
|
|
18
|
+
input: l,
|
|
19
|
+
key: o,
|
|
20
|
+
version: t
|
|
21
|
+
}, p = await f.post(`${E}/generate`, c), { public_signals: m, zk_calldata: u } = p.data;
|
|
22
|
+
return { zkCallData: u, publicSignals: m };
|
|
30
23
|
};
|
|
31
24
|
export {
|
|
32
|
-
|
|
25
|
+
d as generateZkProofEnclave
|
|
33
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./getZKFiles.cjs"),k=require("../../webworker/performTaskWithWorker.cjs"),c=require("../../webworker/snarkjsWorker/snarkjsWorker.types.cjs"),y=require("../../webworker/worker.registry.cjs"),S=async(r,e,t,a)=>{const s=o.getWASMFile(r,t,e),n=o.getZKeyFile(r,t,e),{publicSignals:i,zkCallData:l}=await k.performTaskWithWorker({type:y.WorkerVariant.SnarkJS,payload:{type:c.SnarkJSWorkerActionType.FULL_PROVE,data:{input:a,chainId:e,wasmFilePath:s,zKeyFilePath:n}}});return{zkCallData:l,publicSignals:i}};exports.generateZkProofSelf=S;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NewZkCallDataType } from '../../types';
|
|
2
|
-
export declare const generateZkProofSelf: (chainId: number, verifierName: string, input: any) => Promise<{
|
|
1
|
+
import { NewZkCallDataType, ProverVersion } from '../../types';
|
|
2
|
+
export declare const generateZkProofSelf: (proverVersion: ProverVersion, chainId: number, verifierName: string, input: any) => Promise<{
|
|
3
3
|
zkCallData: NewZkCallDataType;
|
|
4
4
|
publicSignals: string[];
|
|
5
5
|
}>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { getWASMFile as
|
|
2
|
-
import { performTaskWithWorker as
|
|
3
|
-
import { SnarkJSWorkerActionType as
|
|
4
|
-
import { WorkerVariant as
|
|
5
|
-
const
|
|
6
|
-
const e =
|
|
7
|
-
type:
|
|
1
|
+
import { getWASMFile as m, getZKeyFile as n } from "./getZKFiles.mjs";
|
|
2
|
+
import { performTaskWithWorker as k } from "../../webworker/performTaskWithWorker.mjs";
|
|
3
|
+
import { SnarkJSWorkerActionType as s } from "../../webworker/snarkjsWorker/snarkjsWorker.types.mjs";
|
|
4
|
+
import { WorkerVariant as y } from "../../webworker/worker.registry.mjs";
|
|
5
|
+
const W = async (o, t, r, a) => {
|
|
6
|
+
const e = m(o, r, t), l = n(o, r, t), { publicSignals: p, zkCallData: i } = await k({
|
|
7
|
+
type: y.SnarkJS,
|
|
8
8
|
payload: {
|
|
9
|
-
type:
|
|
10
|
-
data: { input:
|
|
9
|
+
type: s.FULL_PROVE,
|
|
10
|
+
data: { input: a, chainId: t, wasmFilePath: e, zKeyFilePath: l }
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
return { zkCallData: i, publicSignals: p };
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
W as generateZkProofSelf
|
|
17
17
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../constants/protocol.constants.cjs"),t=(r,o)=>o===e.zeroAddress?r??e.zeroAddress:e.zeroAddress;exports.getOriginalSender=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getOriginalSender: (externalAddress: string, relay: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../constants/chains.constants.cjs"),s=require("./constant.cjs"),l=(e,t,i)=>{const r=e==="v1x0"?"":e;if(i===o.chainIds.localhost)return s.localVerifiers[`${t}${r}Wasm`];const c=s.prodVerifiers(i,e)[`${t}${r}Wasm`];return console.log({verifier:c}),c},f=(e,t,i)=>{const r=e==="v1x0"?"":e;return i===o.chainIds.localhost?s.localVerifiers[`${t}${r}Zkey`]:s.prodVerifiers(i,e)[`${t}${r}Zkey`]};exports.getWASMFile=l;exports.getZKeyFile=f;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
import { ProverVersion } from '../../types/hinkal.types';
|
|
2
|
+
export declare const getWASMFile: (proverVersion: ProverVersion, filename: string, chainId: number) => string;
|
|
3
|
+
export declare const getZKeyFile: (proverVersion: ProverVersion, filename: string, chainId: number) => string;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import { chainIds as
|
|
2
|
-
import { prodVerifiers as
|
|
3
|
-
const
|
|
1
|
+
import { chainIds as s } from "../../constants/chains.constants.mjs";
|
|
2
|
+
import { prodVerifiers as c, localVerifiers as f } from "./constant.mjs";
|
|
3
|
+
const v = (e, r, t) => {
|
|
4
|
+
const i = e === "v1x0" ? "" : e;
|
|
5
|
+
if (t === s.localhost)
|
|
6
|
+
return f[`${r}${i}Wasm`];
|
|
7
|
+
const o = c(t, e)[`${r}${i}Wasm`];
|
|
8
|
+
return console.log({ verifier: o }), o;
|
|
9
|
+
}, x = (e, r, t) => {
|
|
10
|
+
const i = e === "v1x0" ? "" : e;
|
|
11
|
+
return t === s.localhost ? f[`${r}${i}Zkey`] : c(t, e)[`${r}${i}Zkey`];
|
|
12
|
+
};
|
|
4
13
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
14
|
+
v as getWASMFile,
|
|
15
|
+
x as getZKeyFile
|
|
7
16
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=s=>{const[e,t,n]=s.split(","),r=!e||!t||!n,i=t?.substring(0,2)!=="0x"||n?.substring(0,2)!=="0x",o=n?.length!==66||t?.length>66||t?.length<64,c=s?.includes('"');return!(r||i||o||c)},l=s=>{const[e,t,n,r]=s.split(","),i=!t||!e||!n||!r,o=t?.substring(0,2)!=="0x",c=t?.length>66||t?.length<64,d=s?.includes('"');return!(i||o||c||d)},g=s=>{const[e,t,n,r]=s.split(",");return{extraRandomization:BigInt(e),stealthAddress:BigInt(t),H0:BigInt(n),H1:BigInt(r)}};exports.constructStealthAddressStructure=g;exports.isValidExtendedPrivateAddress=l;exports.isValidPrivateAddress=a;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { StealthAddressStructure } from '../../types/circom-data.types';
|
|
2
|
+
export declare const isValidPrivateAddress: (address: string) => boolean;
|
|
3
|
+
export declare const isValidExtendedPrivateAddress: (address: string) => boolean;
|
|
4
|
+
export declare const constructStealthAddressStructure: (recipientInfo: string) => StealthAddressStructure;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const a = (n) => {
|
|
2
|
+
const [r, t, s] = n.split(","), e = !r || !t || !s, i = t?.substring(0, 2) !== "0x" || s?.substring(0, 2) !== "0x", o = s?.length !== 66 || t?.length > 66 || t?.length < 64, c = n?.includes('"');
|
|
3
|
+
return !(e || i || o || c);
|
|
4
|
+
}, l = (n) => {
|
|
5
|
+
const [r, t, s, e] = n.split(","), i = !t || !r || !s || !e, o = t?.substring(0, 2) !== "0x", c = t?.length > 66 || t?.length < 64, d = n?.includes('"');
|
|
6
|
+
return !(i || o || c || d);
|
|
7
|
+
}, g = (n) => {
|
|
8
|
+
const [r, t, s, e] = n.split(",");
|
|
9
|
+
return {
|
|
10
|
+
extraRandomization: BigInt(r),
|
|
11
|
+
stealthAddress: BigInt(t),
|
|
12
|
+
H0: BigInt(s),
|
|
13
|
+
H1: BigInt(e)
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
g as constructStealthAddressStructure,
|
|
18
|
+
l as isValidExtendedPrivateAddress,
|
|
19
|
+
a as isValidPrivateAddress
|
|
20
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=t=>t.reduce((e
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=t=>t.reduce((n,e)=>n+e,0),s=t=>t.reduce((n,e)=>n+e,0n),u=t=>t/100,a=(t,n)=>n*t/10000n;function g(t){return typeof t=="object"&&"toBigInt"in t?t.toBigInt():BigInt(t)}const m=t=>{try{return BigInt(t)}catch{return}},d=t=>{const n=Number(t);return Number.isNaN(n)?void 0:n},l=(t,n)=>t?parseInt(t,10):n;function f(){BigInt.prototype.toJSON=function(){return this.toString()}}function I(...t){return t.reduce((n,e)=>e>n?e:n)}function p(t){return t===0?0:t<99999e-11?"< 0.000001":+Number(t).toFixed(6)}const B=(t,n)=>{const e=t.toFixed(20),r=e.indexOf(".");if(r===-1)return e;const i=r+n+1;return e.substring(0,i)},o=t=>{if(/^0+$/.test(t))return"0";if(/^0\.\d+$/.test(t))return t;const n=t.replace(/^0+/,"");return n.startsWith(".")?`0${n}`:n},b=t=>{const n=t.split("."),e=n[0],r=n.length>1?`.${n[1]}`:"";return`${o(e).replace(/\B(?=(\d{3})+(?!\d))/g,",")}${r}`},S=(t,n=18)=>{const e=t.match(/^(\d+)(\.(\d+))?$/);if(e){const r=e[1],i=e[3]?.slice(0,n)||"";return i?`${r}.${i}`:r}return t},N=t=>t<0n?-t:t,P=(t,n,e)=>{const r=t<n?t:n;return e?r<e?r:e:r},O=t=>t.reduce((n,{amount:e})=>n+e,0n);exports.absBigInt=N;exports.beepsToPercentage=u;exports.bigintApplySugar=f;exports.bigintMax=I;exports.calculateAmountUsingBeeps=a;exports.calculateBigIntSum=s;exports.calculateSum=c;exports.countTotalAmountInUtxos=O;exports.fixDecimalsAmount=p;exports.getValueFirstNDigit=B;exports.minBigInt=P;exports.toBigInt=g;exports.toBigIntOrUndefined=m;exports.toCommaSeparatedNumberString=b;exports.toInt=l;exports.toNumberOrUndefined=d;exports.trimLeadingZeros=o;exports.truncateToDecimalPlaces=S;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { type Utxo } from '../../data-structures/utxo/Utxo';
|
|
1
2
|
import { BigIntable } from '../../types/big-intable.types';
|
|
2
3
|
export declare const calculateSum: (arr: number[]) => number;
|
|
4
|
+
export declare const calculateBigIntSum: (arr: bigint[]) => bigint;
|
|
3
5
|
export declare const beepsToPercentage: (beeps: number) => number;
|
|
4
6
|
export declare const calculateAmountUsingBeeps: (beep: bigint, amount: bigint) => bigint;
|
|
5
7
|
export declare function toBigInt(value: BigIntable): bigint;
|
|
@@ -14,8 +16,9 @@ export declare function fixDecimalsAmount(n: number): number | "< 0.000001";
|
|
|
14
16
|
export declare const getValueFirstNDigit: (num: number, numberOfDigits: number) => string;
|
|
15
17
|
export declare const trimLeadingZeros: (numberString: string) => string;
|
|
16
18
|
export declare const toCommaSeparatedNumberString: (numberString: string) => string;
|
|
17
|
-
export declare const
|
|
19
|
+
export declare const truncateToDecimalPlaces: (numStr: string, decimalPlaces?: number) => string;
|
|
18
20
|
/** Return absolute value of BigInt */
|
|
19
21
|
export declare const absBigInt: (n: bigint) => bigint;
|
|
20
22
|
/** Return the smallest values of the 2 or 3 values provided */
|
|
21
23
|
export declare const minBigInt: (a: bigint, b: bigint, c?: bigint) => bigint;
|
|
24
|
+
export declare const countTotalAmountInUtxos: (utxos: Utxo[]) => bigint;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const s = (t) => t.reduce((n, e) => n + e, 0), u = (t) => t / 100,
|
|
2
|
-
function
|
|
1
|
+
const s = (t) => t.reduce((n, e) => n + e, 0), u = (t) => t.reduce((n, e) => n + e, 0n), a = (t) => t / 100, d = (t, n) => n * t / 10000n;
|
|
2
|
+
function g(t) {
|
|
3
3
|
return typeof t == "object" && "toBigInt" in t ? t.toBigInt() : BigInt(t);
|
|
4
4
|
}
|
|
5
|
-
const
|
|
5
|
+
const m = (t) => {
|
|
6
6
|
try {
|
|
7
7
|
return BigInt(t);
|
|
8
8
|
} catch {
|
|
@@ -11,8 +11,8 @@ const g = (t) => {
|
|
|
11
11
|
}, f = (t) => {
|
|
12
12
|
const n = Number(t);
|
|
13
13
|
return Number.isNaN(n) ? void 0 : n;
|
|
14
|
-
},
|
|
15
|
-
function
|
|
14
|
+
}, l = (t, n) => t ? parseInt(t, 10) : n;
|
|
15
|
+
function I() {
|
|
16
16
|
BigInt.prototype.toJSON = function() {
|
|
17
17
|
return this.toString();
|
|
18
18
|
};
|
|
@@ -20,10 +20,10 @@ function l() {
|
|
|
20
20
|
function p(...t) {
|
|
21
21
|
return t.reduce((n, e) => e > n ? e : n);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function B(t) {
|
|
24
24
|
return t === 0 ? 0 : t < 99999e-11 ? "< 0.000001" : +Number(t).toFixed(6);
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const N = (t, n) => {
|
|
27
27
|
const e = t.toFixed(20), r = e.indexOf(".");
|
|
28
28
|
if (r === -1)
|
|
29
29
|
return e;
|
|
@@ -36,35 +36,37 @@ const B = (t, n) => {
|
|
|
36
36
|
return t;
|
|
37
37
|
const n = t.replace(/^0+/, "");
|
|
38
38
|
return n.startsWith(".") ? `0${n}` : n;
|
|
39
|
-
},
|
|
39
|
+
}, P = (t) => {
|
|
40
40
|
const n = t.split("."), e = n[0], r = n.length > 1 ? `.${n[1]}` : "";
|
|
41
41
|
return `${i(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",")}${r}`;
|
|
42
|
-
},
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const
|
|
46
|
-
return `${
|
|
42
|
+
}, $ = (t, n = 18) => {
|
|
43
|
+
const e = t.match(/^(\d+)(\.(\d+))?$/);
|
|
44
|
+
if (e) {
|
|
45
|
+
const r = e[1], o = e[3]?.slice(0, n) || "";
|
|
46
|
+
return o ? `${r}.${o}` : r;
|
|
47
47
|
}
|
|
48
48
|
return t;
|
|
49
|
-
},
|
|
49
|
+
}, b = (t) => t < 0n ? -t : t, x = (t, n, e) => {
|
|
50
50
|
const r = t < n ? t : n;
|
|
51
51
|
return e ? r < e ? r : e : r;
|
|
52
|
-
};
|
|
52
|
+
}, O = (t) => t.reduce((n, { amount: e }) => n + e, 0n);
|
|
53
53
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
b as absBigInt,
|
|
55
|
+
a as beepsToPercentage,
|
|
56
|
+
I as bigintApplySugar,
|
|
57
57
|
p as bigintMax,
|
|
58
|
-
|
|
58
|
+
d as calculateAmountUsingBeeps,
|
|
59
|
+
u as calculateBigIntSum,
|
|
59
60
|
s as calculateSum,
|
|
60
|
-
|
|
61
|
-
B as
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
g as
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
O as countTotalAmountInUtxos,
|
|
62
|
+
B as fixDecimalsAmount,
|
|
63
|
+
N as getValueFirstNDigit,
|
|
64
|
+
x as minBigInt,
|
|
65
|
+
g as toBigInt,
|
|
66
|
+
m as toBigIntOrUndefined,
|
|
67
|
+
P as toCommaSeparatedNumberString,
|
|
68
|
+
l as toInt,
|
|
67
69
|
f as toNumberOrUndefined,
|
|
68
70
|
i as trimLeadingZeros,
|
|
69
|
-
|
|
71
|
+
$ as truncateToDecimalPlaces
|
|
70
72
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=(e,t)=>e.length!==t.length?!1:e.every((r,n)=>r===t[n]);exports.arraysMatch=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const arraysMatch: (array1: unknown[], array2: unknown[]) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../constants/token-data/index.cjs");require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.constants.cjs");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../constants/token-data/index.cjs");require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.constants.cjs");const o=require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");require("../../constants/addresses.constants.cjs");require("../../constants/token.limits.constants.cjs");require("../../error-handling/error-codes.constants.cjs");require("ethers");require("axios");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("../../types/activities.types.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");const u=require("../../error-handling/logError.cjs"),a=e=>{const i=o.AxelarRegistry.find(n=>n.chainId===e.chainId);if(!i)return;const{sourceChain:t,sourceAddress:r}=i;return{destinationChain:t,destinationAddress:r,messageFee:e.gasFeeInWei??0n}},s=(e,i)=>e.filter(r=>r.isSelected&&r.chainId!==i).map(r=>{const n=a(r);if(!n){u.logError(`Axelar migration info not found for ${r.chainId} skipping`);return}return n}).filter(r=>r!==void 0);exports.getAllAxelarMigrationInfos=s;exports.getAxelarMigrationInfo=a;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { AxelarMigrationInfo, AxelarNetworkSelection } from '../../types';
|
|
2
2
|
export declare const getAxelarMigrationInfo: (networkSelection: AxelarNetworkSelection) => AxelarMigrationInfo | undefined;
|
|
3
|
+
export declare const getAllAxelarMigrationInfos: (networkSelections: AxelarNetworkSelection[], chainId: number | undefined) => AxelarMigrationInfo[];
|
|
@@ -4,20 +4,42 @@ import "../../constants/vite.constants.mjs";
|
|
|
4
4
|
import "../../constants/contracts.constants.mjs";
|
|
5
5
|
import "../../constants/kyc.constants.mjs";
|
|
6
6
|
import "../../constants/coingecko.constants.mjs";
|
|
7
|
-
import { AxelarRegistry as
|
|
7
|
+
import { AxelarRegistry as m } from "../../constants/axelar.constants.mjs";
|
|
8
8
|
import "../../constants/rewards.constants.mjs";
|
|
9
9
|
import "../../constants/reorg-depths.constants.mjs";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import "../../constants/addresses.constants.mjs";
|
|
11
|
+
import "../../constants/token.limits.constants.mjs";
|
|
12
|
+
import "../../error-handling/error-codes.constants.mjs";
|
|
13
|
+
import "ethers";
|
|
14
|
+
import "axios";
|
|
15
|
+
import "../../types/circom-data.types.mjs";
|
|
16
|
+
import "../../types/transactions.types.mjs";
|
|
17
|
+
import "../../types/curve.types.mjs";
|
|
18
|
+
import "../../types/activities.types.mjs";
|
|
19
|
+
import "circomlibjs-hinkal-fork";
|
|
20
|
+
import "libsodium-wrappers";
|
|
21
|
+
import "process";
|
|
22
|
+
import "buffer";
|
|
23
|
+
import { logError as e } from "../../error-handling/logError.mjs";
|
|
24
|
+
const p = (i) => {
|
|
25
|
+
const o = m.find((t) => t.chainId === i.chainId);
|
|
26
|
+
if (!o)
|
|
13
27
|
return;
|
|
14
|
-
const { sourceChain:
|
|
28
|
+
const { sourceChain: n, sourceAddress: r } = o;
|
|
15
29
|
return {
|
|
16
|
-
destinationChain:
|
|
17
|
-
destinationAddress:
|
|
30
|
+
destinationChain: n,
|
|
31
|
+
destinationAddress: r,
|
|
18
32
|
messageFee: i.gasFeeInWei ?? 0n
|
|
19
33
|
};
|
|
20
|
-
}
|
|
34
|
+
}, q = (i, o) => i.filter((r) => r.isSelected && r.chainId !== o).map((r) => {
|
|
35
|
+
const t = p(r);
|
|
36
|
+
if (!t) {
|
|
37
|
+
e(`Axelar migration info not found for ${r.chainId} skipping`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
return t;
|
|
41
|
+
}).filter((r) => r !== void 0);
|
|
21
42
|
export {
|
|
22
|
-
|
|
43
|
+
q as getAllAxelarMigrationInfos,
|
|
44
|
+
p as getAxelarMigrationInfo
|
|
23
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../constants/token-data/index.cjs");require("../../constants/chains.constants.cjs");const t=require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");const a=require("../../data-structures/cacheDevices/FileCacheDevice.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../constants/token-data/index.cjs");require("../../constants/chains.constants.cjs");const t=require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");require("../../constants/addresses.constants.cjs");require("../../constants/token.limits.constants.cjs");const a=require("../../data-structures/cacheDevices/FileCacheDevice.cjs"),u=require("../../data-structures/cacheDevices/LocalStorageCacheDevice.cjs"),s=e=>{if(t.isNode){let r,c;e&&({useFileCache:r,cacheFilePath:c}=e);const i=require("path").resolve(process.cwd(),"hinkalCache.json");return new a.FileCacheDevice(r,c??i)}else return new u.LocalStorageCacheDevice(e?.disableCaching,e?.serializedCache)};exports.createCacheDevice=s;
|
|
@@ -7,17 +7,19 @@ import "../../constants/coingecko.constants.mjs";
|
|
|
7
7
|
import "../../constants/axelar.constants.mjs";
|
|
8
8
|
import "../../constants/rewards.constants.mjs";
|
|
9
9
|
import "../../constants/reorg-depths.constants.mjs";
|
|
10
|
+
import "../../constants/addresses.constants.mjs";
|
|
11
|
+
import "../../constants/token.limits.constants.mjs";
|
|
10
12
|
import { FileCacheDevice as c } from "../../data-structures/cacheDevices/FileCacheDevice.mjs";
|
|
11
13
|
import { LocalStorageCacheDevice as p } from "../../data-structures/cacheDevices/LocalStorageCacheDevice.mjs";
|
|
12
|
-
const
|
|
14
|
+
const P = (e) => {
|
|
13
15
|
if (i) {
|
|
14
16
|
let r, t;
|
|
15
17
|
e && ({ useFileCache: r, cacheFilePath: t } = e);
|
|
16
18
|
const o = require("path").resolve(process.cwd(), "hinkalCache.json");
|
|
17
19
|
return new c(r, t ?? o);
|
|
18
20
|
} else
|
|
19
|
-
return new p();
|
|
21
|
+
return new p(e?.disableCaching, e?.serializedCache);
|
|
20
22
|
};
|
|
21
23
|
export {
|
|
22
|
-
|
|
24
|
+
P as createCacheDevice
|
|
23
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../types/ethereum-network.types.cjs"),y=require("./getDataFromTransaction.cjs"),A=require("idb-keyval"),k={encryptedOutputs:[],lastOutput:""},o=(s,e)=>{const t=s.substring(0,25),r=e.substring(0,25);return{shortPublicKey:t,shortHinkalAddress:r}},H=(s,e,t)=>`hinkalCache-${s}-${e}-${t}`,v=(s,e,t)=>{const r=s.getContract(l.ContractType.HinkalContract).address;if(!e||!t||!r)throw Error("GetHinkalCache: incorrect arguments");const{shortPublicKey:a,shortHinkalAddress:n}=o(t,r);return JSON.parse(s.cacheDevice.get(H(e,a,n))??JSON.stringify(k))},T=(s,e,t,r)=>{const a=e.getContract(l.ContractType.HinkalContract).address;if(!t||!r||!a)throw Error("SetHinkalCache: incorrect arguments");const{shortPublicKey:n,shortHinkalAddress:c}=o(r,a);e.cacheDevice.set(H(t,n,c),JSON.stringify(s))},S=(s,e,t)=>{T(k,s,e,t)},p=(s,e,t)=>`txsCache-${s}-${e}-${t}`,f=async(s,e,t,r,a,n)=>{if(!e||!t||!r)throw Error("saveTxsCache: incorrect arguments");const{shortPublicKey:c,shortHinkalAddress:i}=o(t,r),C=y.serializeDecodedTxs(s),d=p(e,c,i),g=JSON.stringify({serializedTxs:C,lastHash:a});try{await A.set(d,g)}catch{n.cacheDevice.set(d,g)}},m={serializedTxs:[],lastHash:""},D=async(s,e,t,r)=>{if(!s||!e||!t)throw Error("loadTxsCache: incorrect arguments");const{shortPublicKey:a,shortHinkalAddress:n}=o(e,t),c=p(s,a,n);let i;try{const h=await A.get(c);if(!h)throw new Error("Empty indexedDB cache");i=h}catch{i=r.cacheDevice.get(c)}const{serializedTxs:C,lastHash:d}=JSON.parse(i??JSON.stringify(m));return{decodedTxs:C.map(h=>y.deserializeDecodedTxs(h)),lastHash:d===""?void 0:d}},u=(s,e,t)=>`hinkalApprovalsCache-${s}-${e}-${t}`,x=(s,e,t,r)=>{const a=e.getContract(l.ContractType.HinkalContract,void 0,t).address;if(!t||!r||!a)throw Error("SetHinkalCache: incorrect arguments");const{shortPublicKey:n,shortHinkalAddress:c}=o(r,a);e.cacheDevice.set(u(t,n,c),JSON.stringify(s))},O=(s,e,t)=>{const r=s.getContract(l.ContractType.HinkalContract,void 0,e).address;if(!e||!t||!r)throw Error("GetHinkalCache: incorrect arguments");const{shortPublicKey:a,shortHinkalAddress:n}=o(t,r);return JSON.parse(s.cacheDevice.get(u(e,a,n))??JSON.stringify(k))},w=(s,e,t)=>{x({},s,e,t)};exports.getFilePath=H;exports.getHinkalCache=v;exports.getInHinkalAddressesCache=O;exports.getInHinkalAddressesFilePath=u;exports.loadTxsCache=D;exports.resetCache=S;exports.resetInHinkalAddressesCache=w;exports.saveTxsCache=f;exports.setHinkalCache=T;exports.setInHinkalAddressesCache=x;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { type IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
2
2
|
import { type DecodedTx } from '../../types/transactions.types';
|
|
3
3
|
import { type EncryptedOutputWithSign } from '../../types/commitments.types';
|
|
4
|
-
interface HinkalCacheInterface {
|
|
4
|
+
export interface HinkalCacheInterface {
|
|
5
5
|
encryptedOutputs: EncryptedOutputWithSign[];
|
|
6
6
|
lastOutput: string;
|
|
7
7
|
}
|
|
8
8
|
export declare const getFilePath: (chainId: number, shortPublicKey: string, shortHinkalAddress: string) => string;
|
|
9
|
-
export declare const getHinkalCache: (hinkal: IHinkal) => HinkalCacheInterface;
|
|
10
|
-
export declare const setHinkalCache: (hinkalCache: HinkalCacheInterface, hinkal: IHinkal) => void;
|
|
11
|
-
export declare const resetCache: (hinkal: IHinkal) => void;
|
|
12
|
-
export declare const saveTxsCache: (txs: DecodedTx[], chainId: number, shieldedPublicKey: string, hinkalAddress: string, lastHash: string) => Promise<void>;
|
|
13
|
-
export declare const loadTxsCache: (chainId: number, shieldedPublicKey: string, hinkalAddress: string) => Promise<{
|
|
9
|
+
export declare const getHinkalCache: (hinkal: IHinkal, chainId: number, shieldedPublicKey: string) => HinkalCacheInterface;
|
|
10
|
+
export declare const setHinkalCache: (hinkalCache: HinkalCacheInterface, hinkal: IHinkal, chainId: number, shieldedPublicKey: string) => void;
|
|
11
|
+
export declare const resetCache: (hinkal: IHinkal, chainId: number, shieldedPublicKey: string) => void;
|
|
12
|
+
export declare const saveTxsCache: (txs: DecodedTx[], chainId: number, shieldedPublicKey: string, hinkalAddress: string, lastHash: string, hinkal: IHinkal) => Promise<void>;
|
|
13
|
+
export declare const loadTxsCache: (chainId: number, shieldedPublicKey: string, hinkalAddress: string, hinkal: IHinkal) => Promise<{
|
|
14
14
|
decodedTxs: import("../../types/transactions.types").DecodedTxWithUtxos<bigint, import("ethers").BigNumber>[];
|
|
15
15
|
lastHash: string | undefined;
|
|
16
16
|
}>;
|
|
17
|
-
export
|
|
17
|
+
export declare const getInHinkalAddressesFilePath: (chainId: number, shortPublicKey: string, shortHinkalAddress: string) => string;
|
|
18
|
+
export declare const setInHinkalAddressesCache: (hinkalCache: Record<string, string>, hinkal: IHinkal, chainId: number, shieldedPublicKey: string) => void;
|
|
19
|
+
export declare const getInHinkalAddressesCache: (hinkal: IHinkal, chainId: number, shieldedPublicKey: string) => Record<string, string>;
|
|
20
|
+
export declare const resetInHinkalAddressesCache: (hinkal: IHinkal, chainId: number, shieldedPublicKey: string) => void;
|