@hinkal/common 0.2.13 → 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 +10 -3
- package/API/API.mjs +42 -31
- 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 +7 -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/rewardsPointsCalls.cjs +1 -1
- package/API/rewardsPointsCalls.d.ts +3 -3
- package/API/rewardsPointsCalls.mjs +1 -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/API/userVerifyTransactions.cjs +1 -1
- package/API/userVerifyTransactions.d.ts +6 -7
- package/API/userVerifyTransactions.mjs +13 -14
- 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 +28 -40
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.mjs +144 -140
- 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-arbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arbMainnet.json.mjs +846 -11
- package/constants/deploy-data/deploy-data-avalanche.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-avalanche.json.mjs +848 -13
- package/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-base.json.mjs +852 -17
- package/constants/deploy-data/deploy-data-bnbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-bnbMainnet.json.mjs +855 -20
- package/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-ethMainnet.json.mjs +850 -15
- package/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-localhost.json.mjs +3208 -1550
- package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-optimism.json.mjs +10010 -3429
- package/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-polygon.json.mjs +844 -9
- 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/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.mjs +30 -18
- 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.mjs +14 -12
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +14 -6
- package/constants/server.constants.mjs +24 -16
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +49 -48
- package/constants/token-data/arbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistry.json.mjs +89 -86
- package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.mjs +79 -76
- package/constants/token-data/avalancheRegistry.json.cjs +1 -1
- package/constants/token-data/avalancheRegistry.json.mjs +51 -48
- package/constants/token-data/avalancheRegistryFixed.json.cjs +1 -1
- package/constants/token-data/avalancheRegistryFixed.json.mjs +51 -48
- package/constants/token-data/baseRegistry.json.cjs +1 -1
- package/constants/token-data/baseRegistry.json.mjs +34 -31
- package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
- package/constants/token-data/baseRegistryFixed.json.mjs +31 -28
- package/constants/token-data/bnbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistry.json.mjs +67 -64
- package/constants/token-data/bnbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistryFixed.json.mjs +67 -64
- package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistry.json.mjs +229 -226
- package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.mjs +193 -190
- package/constants/token-data/index.cjs +1 -0
- package/constants/token-data/index.d.ts +1063 -15
- package/constants/token-data/index.mjs +34 -0
- package/constants/token-data/localhostRegistry.json.cjs +1 -1
- package/constants/token-data/localhostRegistry.json.mjs +296 -276
- package/constants/token-data/optimismRegistry.json.cjs +1 -1
- package/constants/token-data/optimismRegistry.json.mjs +703 -180
- package/constants/token-data/optimismRegistryFixed.json.cjs +1 -1
- package/constants/token-data/optimismRegistryFixed.json.mjs +679 -173
- package/constants/token-data/polygonRegistry.json.cjs +1 -1
- package/constants/token-data/polygonRegistry.json.mjs +110 -107
- package/constants/token-data/polygonRegistryFixed.json.cjs +1 -1
- package/constants/token-data/polygonRegistryFixed.json.mjs +102 -99
- 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 +48 -20
- package/data-structures/Hinkal/Hinkal.mjs +263 -85
- package/data-structures/Hinkal/IHinkal.d.ts +37 -10
- package/data-structures/Hinkal/hinkalActionBeefy.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionBeefy.mjs +25 -23
- package/data-structures/Hinkal/hinkalActionConvex.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionConvex.mjs +11 -9
- package/data-structures/Hinkal/hinkalActionCurve.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionCurve.mjs +18 -16
- 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 +24 -22
- package/data-structures/Hinkal/hinkalActionPendle.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionPendle.d.ts +1 -1
- package/data-structures/Hinkal/hinkalActionPendle.mjs +17 -15
- package/data-structures/Hinkal/hinkalActionPendleLP.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionPendleLP.mjs +29 -26
- 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.d.ts +1 -1
- package/data-structures/Hinkal/hinkalActionStake.mjs +15 -11
- package/data-structures/Hinkal/hinkalActionVolatile.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionVolatile.d.ts +1 -1
- package/data-structures/Hinkal/hinkalActionVolatile.mjs +31 -26
- 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 +116 -52
- package/data-structures/Hinkal/hinkalGetRecipientInfo.cjs +1 -0
- package/data-structures/Hinkal/hinkalGetRecipientInfo.d.ts +2 -0
- package/data-structures/Hinkal/hinkalGetRecipientInfo.mjs +10 -0
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +6 -17
- 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 -37
- 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 +69 -60
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.d.ts +3 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +77 -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 +15 -15
- 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 +6 -1
- package/data-structures/merkle-tree/MerkleTree.mjs +79 -65
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs +1 -0
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.ts +3 -0
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs +13 -0
- package/data-structures/merkle-tree/index.d.ts +1 -0
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +2 -0
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.mjs +3 -2
- 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 +3 -2
- package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +6 -5
- 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 +8 -6
- package/data-structures/transactions-manager/TransactionsManager.mjs +124 -122
- 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 +22 -1
- package/error-handling/error-codes.constants.mjs +129 -112
- 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/externalABIs/BabPassport.json.cjs +1 -1
- package/externalABIs/BabPassport.json.mjs +8 -3
- package/externalABIs/BeefyRouterAbi.json.cjs +1 -1
- package/externalABIs/BeefyRouterAbi.json.mjs +5 -2
- package/externalABIs/BeefyStrategyAbi.json.cjs +1 -1
- package/externalABIs/BeefyStrategyAbi.json.mjs +5 -2
- package/externalABIs/BeefyVaultAbi.json.cjs +1 -1
- package/externalABIs/BeefyVaultAbi.json.mjs +5 -2
- package/externalABIs/BeefyZapAbi.json.cjs +1 -1
- package/externalABIs/BeefyZapAbi.json.mjs +5 -2
- package/externalABIs/BeefyZapOneInchAbi.json.cjs +1 -1
- package/externalABIs/BeefyZapOneInchAbi.json.mjs +5 -2
- package/externalABIs/ConvexBoosterAbi.json.cjs +1 -1
- package/externalABIs/ConvexBoosterAbi.json.mjs +5 -2
- package/externalABIs/ConvexBoosterAbiMainnet.json.cjs +1 -1
- package/externalABIs/ConvexBoosterAbiMainnet.json.mjs +5 -2
- package/externalABIs/ConvexRewardPoolAbi.json.cjs +1 -1
- package/externalABIs/ConvexRewardPoolAbi.json.mjs +5 -2
- package/externalABIs/CurveReadingWrapperAbi.json.cjs +1 -1
- package/externalABIs/CurveReadingWrapperAbi.json.mjs +5 -2
- package/externalABIs/CurveWrappedMainPool.json.cjs +1 -1
- package/externalABIs/CurveWrappedMainPool.json.mjs +5 -2
- package/externalABIs/CurveZap.json.cjs +1 -1
- package/externalABIs/CurveZap.json.mjs +5 -2
- package/externalABIs/CvxCrvUtilities.json.cjs +1 -1
- package/externalABIs/CvxCrvUtilities.json.mjs +5 -2
- package/externalABIs/ERC20.json.cjs +1 -1
- package/externalABIs/ERC20.json.mjs +20 -3
- package/externalABIs/GalxePassport.json.cjs +1 -1
- package/externalABIs/GalxePassport.json.mjs +8 -3
- package/externalABIs/IQuoterV2.json.cjs +1 -1
- package/externalABIs/IQuoterV2.json.mjs +20 -3
- package/externalABIs/ISwapRouter.json.cjs +1 -1
- package/externalABIs/ISwapRouter.json.mjs +5 -2
- package/externalABIs/IUniswapV3Factory.json.cjs +1 -1
- package/externalABIs/IUniswapV3Factory.json.mjs +20 -3
- package/externalABIs/IUniswapV3Pool.json.cjs +1 -1
- package/externalABIs/IUniswapV3Pool.json.mjs +20 -3
- package/externalABIs/PendleRouterAbi.json.cjs +1 -1
- package/externalABIs/PendleRouterAbi.json.mjs +5 -2
- package/externalABIs/UniswapV2PoolAbi.json.cjs +1 -1
- package/externalABIs/UniswapV2PoolAbi.json.mjs +16 -3
- package/externalABIs/index.cjs +1 -0
- package/externalABIs/index.d.ts +307 -11
- package/externalABIs/index.mjs +23 -0
- package/externalABIs/transactionsProver.json.cjs +1 -1
- package/externalABIs/transactionsProver.json.mjs +20 -3
- package/functions/kyc/zkMeHelper.cjs +1 -1
- package/functions/kyc/zkMeHelper.d.ts +0 -1
- package/functions/kyc/zkMeHelper.mjs +8 -11
- 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 -27
- 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 +9 -1
- package/functions/private-wallet/emporium.helpers.mjs +117 -22
- 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 +1 -0
- package/functions/private-wallet/opProducer.cjs +1 -1
- package/functions/private-wallet/opProducer.mjs +9 -10
- package/functions/private-wallet/smartContractWalletCalculator.cjs +1 -1
- package/functions/private-wallet/smartContractWalletCalculator.d.ts +5 -1
- package/functions/private-wallet/smartContractWalletCalculator.mjs +22 -17
- package/functions/protocols/convex.protocols.cjs +1 -1
- package/functions/protocols/convex.protocols.mjs +11 -8
- package/functions/protocols/pendle.helpers.cjs +1 -1
- package/functions/protocols/pendle.helpers.mjs +20 -15
- 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 -1
- package/functions/snarkjs/constant.mjs +315 -94
- 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 +142 -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 -15
- package/functions/snarkjs/generateZkProofEnclave.cjs +1 -0
- package/functions/snarkjs/generateZkProofEnclave.d.ts +6 -0
- package/functions/snarkjs/generateZkProofEnclave.mjs +26 -0
- package/functions/snarkjs/generateZkProofSelf.cjs +1 -0
- package/functions/snarkjs/generateZkProofSelf.d.ts +5 -0
- package/functions/snarkjs/generateZkProofSelf.mjs +17 -0
- 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 +32 -9
- package/functions/utils/cacheDevice.utils.cjs +1 -1
- package/functions/utils/cacheDevice.utils.mjs +11 -8
- 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 +23 -14
- package/functions/utils/evmNetworkFunctions.cjs +1 -1
- package/functions/utils/evmNetworkFunctions.mjs +7 -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 +2 -0
- package/functions/utils/string.utils.mjs +28 -14
- 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/utils/userAgent.cjs +1 -1
- package/functions/utils/userAgent.mjs +8 -8
- 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 +70 -65
- 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 +20 -18
- 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 +31 -30
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +2 -2
- package/functions/web3/functionCalls/transactCallRelayer.mjs +32 -9
- package/functions/web3/getContractMetadata.cjs +1 -0
- package/functions/web3/getContractMetadata.d.ts +5 -0
- package/functions/web3/getContractMetadata.mjs +30 -0
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.d.ts +1 -2
- package/functions/web3/odosAPI.mjs +23 -19
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.d.ts +1 -2
- package/functions/web3/oneInchAPI.mjs +20 -15
- 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.d.ts +4 -4
- package/functions/web3/uniswapAPI.mjs +57 -43
- package/index.cjs +1 -1
- package/index.mjs +761 -639
- package/package.json +19 -8
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +8 -3
- package/providers/EthersProviderAdapter.mjs +52 -43
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +4 -1
- package/providers/WagmiProviderAdapter.mjs +53 -56
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +18 -10
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +18 -10
- 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 +8 -3
- 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 +48 -0
- package/types/hinkal.types.mjs +38 -13
- package/types/index.d.ts +9 -0
- package/types/kyc.types.cjs +1 -1
- package/types/kyc.types.d.ts +1 -1
- package/types/kyc.types.mjs +1 -1
- package/types/remote-proof.types.d.ts +15 -0
- package/types/rewards.types.d.ts +9 -0
- 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/time.types.cjs +1 -1
- package/types/time.types.mjs +1 -1
- 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 -26
- 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,32 +1,33 @@
|
|
|
1
1
|
import { ethers as D } from "ethers";
|
|
2
2
|
import { defaultHookData as U } from "../../types/circom-data.types.mjs";
|
|
3
|
-
import { ExternalActionId as
|
|
3
|
+
import { ExternalActionId as O } from "../../types/external-action.types.mjs";
|
|
4
4
|
import { PendleLPAction as A } from "../../types/hinkal.types.mjs";
|
|
5
5
|
import "../../types/transactions.types.mjs";
|
|
6
6
|
import "../../types/curve.types.mjs";
|
|
7
|
+
import "../../types/activities.types.mjs";
|
|
7
8
|
import { addPaddingToUtxos as y } from "../../functions/web3/events/getShieldedBalance.mjs";
|
|
8
|
-
import { constructZkProof as
|
|
9
|
-
import { getFlatFees as
|
|
10
|
-
import { outputUtxoProcessing as
|
|
11
|
-
import { processAmountChanges as
|
|
12
|
-
import { estimateGasRelayer as
|
|
13
|
-
import { transactCallRelayer as
|
|
14
|
-
import { networkRegistry as
|
|
15
|
-
import { transactionErrorCodes as
|
|
16
|
-
const
|
|
9
|
+
import { constructZkProof as T } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
|
|
10
|
+
import { getFlatFees as b } from "../../functions/pre-transaction/getFlatFees.mjs";
|
|
11
|
+
import { outputUtxoProcessing as h } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
|
|
12
|
+
import { processAmountChanges as v } from "../../functions/pre-transaction/processAmountChanges.mjs";
|
|
13
|
+
import { estimateGasRelayer as F } from "../../functions/web3/functionCalls/estimateGasRelayer.mjs";
|
|
14
|
+
import { transactCallRelayer as S } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
15
|
+
import { networkRegistry as G } from "../../constants/chains.constants.mjs";
|
|
16
|
+
import { transactionErrorCodes as H } from "../../error-handling/error-codes.constants.mjs";
|
|
17
|
+
const K = (t, e) => {
|
|
17
18
|
if (t === A.AddOrRemoveLiquidity)
|
|
18
19
|
return e.length === 3 ? [!1, !0, !1] : [!1, !0, !1, !1];
|
|
19
20
|
if (t === A.Checkpoint)
|
|
20
21
|
return [!1, !0];
|
|
21
22
|
throw new Error("Unknown PendleLPAction not implemented");
|
|
22
|
-
},
|
|
23
|
+
}, M = (t, e) => {
|
|
23
24
|
const { pendleLPAction: o, lpAddress: r, evmData: a } = t;
|
|
24
25
|
return D.utils.defaultAbiCoder.encode(
|
|
25
26
|
["uint8", "address", "uint256", "uint256", "bytes"],
|
|
26
27
|
[o, r, e[0][0].amount, e[0][0].timeStamp, a]
|
|
27
28
|
);
|
|
28
|
-
},
|
|
29
|
-
const s =
|
|
29
|
+
}, ot = async (t, e, o, r, a, P = !1) => {
|
|
30
|
+
const s = O.PendleLP, { pendleLPAction: m } = r, i = [...await y(t, e, o)], x = `swapperMO${o.length.toString()}x${i[0].length}x1`, { flatFees: c, feeUnit: g } = await b(
|
|
30
31
|
t.getCurrentChainId(),
|
|
31
32
|
e,
|
|
32
33
|
s,
|
|
@@ -34,24 +35,25 @@ const H = (t, e) => {
|
|
|
34
35
|
m,
|
|
35
36
|
a
|
|
36
37
|
);
|
|
37
|
-
o =
|
|
38
|
+
o = v({
|
|
38
39
|
erc20Addresses: e,
|
|
39
40
|
amountChanges: o,
|
|
40
41
|
flatFees: c,
|
|
41
|
-
feeUnit:
|
|
42
|
+
feeUnit: g,
|
|
42
43
|
externalActionId: s,
|
|
43
44
|
action: m,
|
|
44
45
|
gasTokenAddress: a
|
|
45
46
|
});
|
|
46
47
|
const l = [];
|
|
47
48
|
for (let n = 0; n < e.length; n += 1) {
|
|
48
|
-
const { outputUtxos: I } =
|
|
49
|
+
const { outputUtxos: I } = h(t.userKeys, i[n], o[n]);
|
|
49
50
|
l.push(I);
|
|
50
51
|
}
|
|
51
|
-
const
|
|
52
|
+
const C = K(m, e), { contractData: w } = G[t.getCurrentChainId()], E = w?.pendleLPExternalActionInstanceAddress, R = M(r, i), p = await t.getRandomRelay();
|
|
52
53
|
if (!p)
|
|
53
|
-
throw Error(
|
|
54
|
-
const
|
|
54
|
+
throw Error(H.RELAYER_NOT_AVAILABLE);
|
|
55
|
+
const L = { ...U }, { zkCallData: f, circomData: u, dimData: d } = await T(
|
|
56
|
+
"v1x0",
|
|
55
57
|
t.merkleTreeHinkal,
|
|
56
58
|
t.merkleTreeAccessToken,
|
|
57
59
|
i,
|
|
@@ -60,19 +62,20 @@ const H = (t, e) => {
|
|
|
60
62
|
x,
|
|
61
63
|
s,
|
|
62
64
|
E,
|
|
63
|
-
|
|
65
|
+
R,
|
|
66
|
+
t.generateProofRemotely,
|
|
64
67
|
p,
|
|
65
68
|
t.getCurrentChainId(),
|
|
66
|
-
|
|
69
|
+
C,
|
|
67
70
|
c,
|
|
68
|
-
|
|
71
|
+
L
|
|
69
72
|
);
|
|
70
|
-
return P ? await
|
|
71
|
-
},
|
|
73
|
+
return P ? await F(t, f, d, u) : await S(t.getCurrentChainId(), f, d, u);
|
|
74
|
+
}, rt = async (t, e, o) => {
|
|
72
75
|
const r = [...await y(t, [e], [-1n * o])];
|
|
73
76
|
return { amount: r[0][0].amount, timestamp: r[0][0].timeStamp };
|
|
74
77
|
};
|
|
75
78
|
export {
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
ot as hinkalActionPendleLP,
|
|
80
|
+
rt as hinkalGetPendleLPClaimableParams
|
|
78
81
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../functions/private-wallet/emporium.helpers.cjs"),f=require("../../functions/pre-transaction/getFeeStructure.cjs"),h=require("../../functions/private-wallet/smartContractWalletCalculator.cjs"),v=require("../../functions/utils/convertEmporiumOpToCallInfo.cjs"),E=require("../../types/external-action.types.cjs"),g=require("../../types/ethereum-network.types.cjs"),q=async(e,t,r,o,a,c,n=!1)=>{if(!c)throw Error("hinkalActionReceive: wallet nonce should be provided");if(!o)throw new Error("Fee token is required in hinkalActionReceive");const u=await h.calculateSmartContractWalletAddressFromNonce(e.getCurrentChainId(),e.userKeys,c),s=e.getContractWithFetcher(g.ContractType.HinkalContract),p=i.createTransaferEmporiumOpsBatch(e,t,r),l=a??await f.getFeeStructure(e.getCurrentChainId(),o,t,E.ExternalActionId.Emporium,void 0,p.map(C=>v.convertEmporiumOpToCallInfo(C,u,s.address)));r=[...r];const m=i.createTransaferEmporiumOpsBatch(e,t,r);return e.actionPrivateWallet(t,r,r.map(()=>!1),m,c,o,l,n)};exports.hinkalActionReceive=q;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RelayerTransaction } from '../../types/relayer.types';
|
|
2
|
+
import { IHinkal } from './IHinkal';
|
|
3
|
+
import { FeeStructure } from '../../types/hinkal.types';
|
|
4
|
+
export declare const hinkalActionReceive: (hinkal: IHinkal, erc20Addresses: string[], deltaAmounts: bigint[], feeToken?: string, feeStructureOverride?: FeeStructure, walletNonce?: bigint, onlyGasEstimate?: boolean) => Promise<RelayerTransaction | bigint>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createTransaferEmporiumOpsBatch as a } from "../../functions/private-wallet/emporium.helpers.mjs";
|
|
2
|
+
import { getFeeStructure as v } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
3
|
+
import { calculateSmartContractWalletAddressFromNonce as h } from "../../functions/private-wallet/smartContractWalletCalculator.mjs";
|
|
4
|
+
import { convertEmporiumOpToCallInfo as E } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
5
|
+
import { ExternalActionId as l } from "../../types/external-action.types.mjs";
|
|
6
|
+
import { ContractType as w } from "../../types/ethereum-network.types.mjs";
|
|
7
|
+
const y = async (r, o, t, e, c, i, n = !1) => {
|
|
8
|
+
if (!i)
|
|
9
|
+
throw Error("hinkalActionReceive: wallet nonce should be provided");
|
|
10
|
+
if (!e)
|
|
11
|
+
throw new Error("Fee token is required in hinkalActionReceive");
|
|
12
|
+
const m = await h(
|
|
13
|
+
r.getCurrentChainId(),
|
|
14
|
+
r.userKeys,
|
|
15
|
+
i
|
|
16
|
+
), p = r.getContractWithFetcher(w.HinkalContract), f = a(r, o, t), s = c ?? await v(
|
|
17
|
+
r.getCurrentChainId(),
|
|
18
|
+
e,
|
|
19
|
+
o,
|
|
20
|
+
l.Emporium,
|
|
21
|
+
void 0,
|
|
22
|
+
f.map((C) => E(C, m, p.address))
|
|
23
|
+
);
|
|
24
|
+
t = [...t];
|
|
25
|
+
const u = a(r, o, t);
|
|
26
|
+
return r.actionPrivateWallet(
|
|
27
|
+
o,
|
|
28
|
+
t,
|
|
29
|
+
t.map(() => !1),
|
|
30
|
+
u,
|
|
31
|
+
i,
|
|
32
|
+
e,
|
|
33
|
+
s,
|
|
34
|
+
n
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
y as hinkalActionReceive
|
|
39
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../../constants/protocol.constants.cjs"),p=require("../../functions/staking/index.cjs"),f=require("../../functions/utils/erc20tokenFunctions.cjs"),B=require("../../functions/web3/etherFunctions.cjs"),O=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),_=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),b=require("../../functions/web3/events/getShieldedBalance.cjs"),l=require("../utxo/Utxo.cjs");require("../../types/circom-data.types.cjs");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../../constants/protocol.constants.cjs"),p=require("../../functions/staking/index.cjs"),f=require("../../functions/utils/erc20tokenFunctions.cjs"),B=require("../../functions/web3/etherFunctions.cjs"),O=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),_=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),b=require("../../functions/web3/events/getShieldedBalance.cjs"),l=require("../utxo/Utxo.cjs");require("../../types/circom-data.types.cjs");const m=require("../../types/ethereum-network.types.cjs"),M=require("../../types/external-action.types.cjs");require("../../constants/vite.constants.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");const S=require("../../types/hinkal.stake.types.cjs");require("../../types/activities.types.cjs");require("ethers");const j=require("../crypto-keys/keys.cjs");require("libsodium-wrappers");const w=require("../../functions/web3/functionCalls/transactCallDirect.cjs"),z=async(t,g,o,s,i)=>{const q=await t.getEthereumAddress(),a=f.getERC20Token(g[0],t.getCurrentChainId());if(!a)throw Error("Deposit Action: No Token Found");const u=s===S.HinkalStakeMode.Stake,n=s===S.HinkalStakeMode.Unstake,{erc20TokenAddress:P}=a,r=[...await b.addPaddingToUtxos(t,g,o,2,void 0,s!==S.HinkalStakeMode.Deposit)];if(u||n){r[0][0]=l.Utxo.createFrom(r[0][0],{amount:o[0]*(u?1n:-1n),isStakeOrUnstakeInput:!0});for(let e=0;e<r.length;e+=1)for(let c=0;c<r[e].length;c+=1)e===0&&c===0||(r[e][c]=l.Utxo.createFrom(r[e][c],{amount:0n}))}const{outputUtxos:E}=O.outputUtxoProcessing(t.userKeys,r[0],o[0]),d=[E.map(e=>l.Utxo.createFrom(e,{isStake:u,isUnstakeOutput:n}))];n&&(d[0][0]=l.Utxo.createFrom(d[0][0],{amount:0n,isUnstakeOutput:n}));const H=[!1],k=B.randomBigInt(30),K=j.UserKeys.getEncryptionKeyPair(t.userKeys.getShieldedPrivateKey()),h=p.encryptStake(k,i,T.ownerPublicKey),D=p.encryptStake(k,i,K.publicKey),F=n?0n:p.createStakeCommitment(!0,i,k,P,o[0],BigInt(d[0][0].timeStamp)),I=u?0:1,v=p.encodeHStakeMetadata(I,F,q,h,D),x=t.getContractWithSigner(m.ContractType.HinkalWrapper2),y=t.getContractWithSigner(m.ContractType.HinkalStakeExternalAction),{zkCallData:C,dimData:A,circomData:U}=await _.constructZkProof("v1x0",t.merkleTreeHinkal,t.merkleTreeAccessToken,r,d,t.userKeys,"swapperME1x2x1",M.ExternalActionId.HinkalStake,y.address,v,t.generateProofRemotely,T.zeroAddress,t.getCurrentChainId(),H,void 0,void 0,{stakedTokenRecipient:i,stakeBlinding:k,mode:s,depositorAddress:q});if(n){const e=f.getHToken(a,t.getCurrentChainId());if(!e)throw new Error("hToken not found");const W=(await t.getContractWithFetcher(m.ContractType.HToken,e.erc20TokenAddress).previewWithdraw(-o[0])).toBigInt();return w.transactCallDirect(t,W,e,C,U,A,y,x)}return w.transactCallDirect(t,o[0],a,C,U,A,y,x)};exports.hinkalActionStake=z;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IHinkal } from './IHinkal';
|
|
2
2
|
import { HinkalStakeMode } from '../../types';
|
|
3
|
-
export declare const hinkalActionStake: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], stakeMode: HinkalStakeMode, stakedTokenRecipient: string) => Promise<
|
|
3
|
+
export declare const hinkalActionStake: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], stakeMode: HinkalStakeMode, stakedTokenRecipient: string) => Promise<any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ownerPublicKey as
|
|
2
|
-
import { encryptStake as T, createStakeCommitment as
|
|
1
|
+
import { ownerPublicKey as W, zeroAddress as B } from "../../constants/protocol.constants.mjs";
|
|
2
|
+
import { encryptStake as T, createStakeCommitment as O, encodeHStakeMetadata as h } from "../../functions/staking/index.mjs";
|
|
3
3
|
import { getERC20Token as b, getHToken as z } from "../../functions/utils/erc20tokenFunctions.mjs";
|
|
4
4
|
import { randomBigInt as j } from "../../functions/web3/etherFunctions.mjs";
|
|
5
5
|
import { outputUtxoProcessing as M } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
|
|
@@ -9,14 +9,16 @@ import { Utxo as u } from "../utxo/Utxo.mjs";
|
|
|
9
9
|
import "../../types/circom-data.types.mjs";
|
|
10
10
|
import { ContractType as k } from "../../types/ethereum-network.types.mjs";
|
|
11
11
|
import { ExternalActionId as q } from "../../types/external-action.types.mjs";
|
|
12
|
+
import "../../constants/vite.constants.mjs";
|
|
12
13
|
import "../../types/transactions.types.mjs";
|
|
13
14
|
import "../../types/curve.types.mjs";
|
|
14
15
|
import { HinkalStakeMode as y } from "../../types/hinkal.stake.types.mjs";
|
|
16
|
+
import "../../types/activities.types.mjs";
|
|
15
17
|
import "ethers";
|
|
16
18
|
import { UserKeys as G } from "../crypto-keys/keys.mjs";
|
|
17
19
|
import "libsodium-wrappers";
|
|
18
20
|
import { transactCallDirect as w } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
|
|
19
|
-
const
|
|
21
|
+
const ut = async (t, g, e, a, s) => {
|
|
20
22
|
const A = await t.getEthereumAddress(), c = b(g[0], t.getCurrentChainId());
|
|
21
23
|
if (!c)
|
|
22
24
|
throw Error("Deposit Action: No Token Found");
|
|
@@ -51,20 +53,21 @@ const pt = async (t, g, e, a, s) => {
|
|
|
51
53
|
amount: 0n,
|
|
52
54
|
isUnstakeOutput: n
|
|
53
55
|
}));
|
|
54
|
-
const K = [!1], d = j(30), H = G.getEncryptionKeyPair(t.userKeys.getShieldedPrivateKey()), I = T(d, s,
|
|
56
|
+
const K = [!1], d = j(30), H = G.getEncryptionKeyPair(t.userKeys.getShieldedPrivateKey()), I = T(d, s, W), P = T(d, s, H.publicKey), v = n ? 0n : O(
|
|
55
57
|
!0,
|
|
56
58
|
s,
|
|
57
59
|
d,
|
|
58
60
|
U,
|
|
59
61
|
e[0],
|
|
60
62
|
BigInt(p[0][0].timeStamp)
|
|
61
|
-
),
|
|
63
|
+
), D = h(
|
|
62
64
|
m ? 0 : 1,
|
|
63
|
-
|
|
65
|
+
v,
|
|
64
66
|
A,
|
|
65
67
|
I,
|
|
66
68
|
P
|
|
67
69
|
), C = t.getContractWithSigner(k.HinkalWrapper2), f = t.getContractWithSigner(k.HinkalStakeExternalAction), { zkCallData: S, dimData: l, circomData: x } = await N(
|
|
70
|
+
"v1x0",
|
|
68
71
|
t.merkleTreeHinkal,
|
|
69
72
|
t.merkleTreeAccessToken,
|
|
70
73
|
r,
|
|
@@ -73,8 +76,9 @@ const pt = async (t, g, e, a, s) => {
|
|
|
73
76
|
"swapperME1x2x1",
|
|
74
77
|
q.HinkalStake,
|
|
75
78
|
f.address,
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
D,
|
|
80
|
+
t.generateProofRemotely,
|
|
81
|
+
B,
|
|
78
82
|
t.getCurrentChainId(),
|
|
79
83
|
K,
|
|
80
84
|
void 0,
|
|
@@ -90,10 +94,10 @@ const pt = async (t, g, e, a, s) => {
|
|
|
90
94
|
const o = z(c, t.getCurrentChainId());
|
|
91
95
|
if (!o)
|
|
92
96
|
throw new Error("hToken not found");
|
|
93
|
-
const
|
|
97
|
+
const F = (await t.getContractWithFetcher(k.HToken, o.erc20TokenAddress).previewWithdraw(-e[0])).toBigInt();
|
|
94
98
|
return w(
|
|
95
99
|
t,
|
|
96
|
-
|
|
100
|
+
F,
|
|
97
101
|
o,
|
|
98
102
|
S,
|
|
99
103
|
x,
|
|
@@ -114,5 +118,5 @@ const pt = async (t, g, e, a, s) => {
|
|
|
114
118
|
);
|
|
115
119
|
};
|
|
116
120
|
export {
|
|
117
|
-
|
|
121
|
+
ut as hinkalActionStake
|
|
118
122
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../constants/protocol.constants.cjs"),_=require("../../functions/utils/erc20tokenFunctions.cjs"),U=require("../../functions/pre-transaction/getFlatFees.cjs"),v=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),H=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),N=require("../../functions/web3/events/getShieldedBalance.cjs"),V=require("../../functions/web3/functionCalls/transactCallDirect.cjs"),W=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),b=require("../../functions/web3/functionCalls/estimateGasRelayer.cjs"),E=require("../volatile-helper/VolatileHelper.cjs"),n=require("../../types/hinkal.types.cjs"),q=require("../../types/ethereum-network.types.cjs"),M=require("../../types/external-action.types.cjs"),z=require("../../error-handling/error-codes.constants.cjs"),G=async(t,a,e,T,D)=>{const{action:r,isRelayerOff:i,recipientAddress:R,baseExternalActionId:I,baseExternalActionMetadata:S}=T,p=_.getERC20Token(a[0],t.getCurrentChainId());if(!p)throw Error("Deposit Action: No Token Found");const m=await t.checkAccessToken(),A=[...e],F=[...a];let g=[],y=e.map(()=>0n);({erc20Addresses:a,amountChanges:e,onChainCreation:g}=await E.VolatileHelper.processVolatileData(t.getCurrentChainId(),r,a,e));const c=await E.VolatileHelper.getVolatileExternalData(t,r,A,R,I,S);if(!c)throw Error("No External Action Data");(r===n.VolatileAction.Withdraw&&!i||r===n.VolatileAction.Swap)&&({flatFees:y}=await U.getFlatFees(t.getCurrentChainId(),F,M.ExternalActionId.Volatile,A,r),r===n.VolatileAction.Swap&&(e[1]=0n));const d=[...await N.addPaddingToUtxos(t,a,e)],P=`swapperM${e.length.toString()}x${d[0].length}x1`,w=[];for(let o=0;o<a.length;o+=1){const{outputUtxos:x}=v.outputUtxoProcessing(t.userKeys,d[o],e[o]);w.push(x)}const C=r===n.VolatileAction.Deposit||i?f.zeroAddress:await t.getRandomRelay();if(!i&&!C)throw Error(z.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const{zkCallData:s,circomData:l,dimData:u}=await H.constructZkProof("v1x1",t.merkleTreeHinkal,t.merkleTreeAccessToken,d,w,t.userKeys,P,c.externalActionId,c.externalAddress,c.externalActionMetadata,t.generateProofRemotely,i?f.zeroAddress:C,t.getCurrentChainId(),g,y,void 0,void 0,m);if(r===n.VolatileAction.Deposit){const o=t.getContractWithSigner(q.ContractType.VolatileVault),x=t.getContractWithSigner(q.ContractType.HinkalWrapper);return await V.transactCallDirect(t,A[0],p,s,l,u,o,x)}return r===n.VolatileAction.Withdraw&&i?await V.transactCallDirect(t,e[0],p,s,l,u):D?await b.estimateGasRelayer(t,s,u,l):await W.transactCallRelayer(t.getCurrentChainId(),s,u,l)};exports.hinkalActionVolatile=G;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IHinkal } from './IHinkal';
|
|
2
2
|
import { VolatileHelperData } from '../../types/hinkal.types';
|
|
3
|
-
export declare const hinkalActionVolatile: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], volatileHelperData: VolatileHelperData, onlyGasEstimate: boolean) => Promise<
|
|
3
|
+
export declare const hinkalActionVolatile: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], volatileHelperData: VolatileHelperData, onlyGasEstimate: boolean) => Promise<any>;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { zeroAddress as E } from "../../constants/protocol.constants.mjs";
|
|
2
2
|
import { getERC20Token as F } from "../../functions/utils/erc20tokenFunctions.mjs";
|
|
3
3
|
import { getFlatFees as N } from "../../functions/pre-transaction/getFlatFees.mjs";
|
|
4
|
-
import { outputUtxoProcessing as
|
|
5
|
-
import { constructZkProof as
|
|
6
|
-
import { addPaddingToUtxos as
|
|
4
|
+
import { outputUtxoProcessing as P } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
|
|
5
|
+
import { constructZkProof as H } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
|
|
6
|
+
import { addPaddingToUtxos as L } from "../../functions/web3/events/getShieldedBalance.mjs";
|
|
7
7
|
import { transactCallDirect as y } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
|
|
8
|
-
import { transactCallRelayer as
|
|
8
|
+
import { transactCallRelayer as M } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
9
9
|
import { estimateGasRelayer as b } from "../../functions/web3/functionCalls/estimateGasRelayer.mjs";
|
|
10
10
|
import { VolatileHelper as C } from "../volatile-helper/VolatileHelper.mjs";
|
|
11
11
|
import { VolatileAction as i } from "../../types/hinkal.types.mjs";
|
|
12
|
-
import { ContractType as
|
|
12
|
+
import { ContractType as T } from "../../types/ethereum-network.types.mjs";
|
|
13
13
|
import { ExternalActionId as z } from "../../types/external-action.types.mjs";
|
|
14
14
|
import { transactionErrorCodes as K } from "../../error-handling/error-codes.constants.mjs";
|
|
15
|
-
const rt = async (t, a,
|
|
16
|
-
const { action:
|
|
15
|
+
const rt = async (t, a, o, D, R) => {
|
|
16
|
+
const { action: r, isRelayerOff: n, recipientAddress: I, baseExternalActionId: V, baseExternalActionMetadata: S } = D, m = F(a[0], t.getCurrentChainId());
|
|
17
17
|
if (!m)
|
|
18
18
|
throw Error("Deposit Action: No Token Found");
|
|
19
|
-
const f = [...
|
|
20
|
-
let
|
|
21
|
-
({ erc20Addresses: a, amountChanges:
|
|
19
|
+
const U = await t.checkAccessToken(), f = [...o], W = [...a];
|
|
20
|
+
let A = [], w = o.map(() => 0n);
|
|
21
|
+
({ erc20Addresses: a, amountChanges: o, onChainCreation: A } = await C.processVolatileData(
|
|
22
22
|
t.getCurrentChainId(),
|
|
23
|
-
|
|
23
|
+
r,
|
|
24
24
|
a,
|
|
25
|
-
|
|
25
|
+
o
|
|
26
26
|
));
|
|
27
27
|
const c = await C.getVolatileExternalData(
|
|
28
28
|
t,
|
|
29
|
-
|
|
29
|
+
r,
|
|
30
30
|
f,
|
|
31
31
|
I,
|
|
32
32
|
V,
|
|
@@ -34,38 +34,43 @@ const rt = async (t, a, r, R, T) => {
|
|
|
34
34
|
);
|
|
35
35
|
if (!c)
|
|
36
36
|
throw Error("No External Action Data");
|
|
37
|
-
(
|
|
37
|
+
(r === i.Withdraw && !n || r === i.Swap) && ({ flatFees: w } = await N(
|
|
38
38
|
t.getCurrentChainId(),
|
|
39
|
-
|
|
39
|
+
W,
|
|
40
40
|
z.Volatile,
|
|
41
41
|
f,
|
|
42
|
-
|
|
43
|
-
),
|
|
44
|
-
const x = [...await
|
|
42
|
+
r
|
|
43
|
+
), r === i.Swap && (o[1] = 0n));
|
|
44
|
+
const x = [...await L(t, a, o)], v = `swapperM${o.length.toString()}x${x[0].length}x1`, g = [];
|
|
45
45
|
for (let e = 0; e < a.length; e += 1) {
|
|
46
|
-
const { outputUtxos: d } =
|
|
46
|
+
const { outputUtxos: d } = P(t.userKeys, x[e], o[e]);
|
|
47
47
|
g.push(d);
|
|
48
48
|
}
|
|
49
|
-
const u =
|
|
49
|
+
const u = r === i.Deposit || n ? E : await t.getRandomRelay();
|
|
50
50
|
if (!n && !u)
|
|
51
51
|
throw Error(K.RELAYER_NOT_AVAILABLE);
|
|
52
|
-
const { zkCallData: s, circomData: p, dimData: l } = await
|
|
52
|
+
const { zkCallData: s, circomData: p, dimData: l } = await H(
|
|
53
|
+
"v1x1",
|
|
53
54
|
t.merkleTreeHinkal,
|
|
54
55
|
t.merkleTreeAccessToken,
|
|
55
56
|
x,
|
|
56
57
|
g,
|
|
57
58
|
t.userKeys,
|
|
58
|
-
|
|
59
|
+
v,
|
|
59
60
|
c.externalActionId,
|
|
60
61
|
c.externalAddress,
|
|
61
62
|
c.externalActionMetadata,
|
|
63
|
+
t.generateProofRemotely,
|
|
62
64
|
n ? E : u,
|
|
63
65
|
t.getCurrentChainId(),
|
|
66
|
+
A,
|
|
64
67
|
w,
|
|
65
|
-
|
|
68
|
+
void 0,
|
|
69
|
+
void 0,
|
|
70
|
+
U
|
|
66
71
|
);
|
|
67
|
-
if (
|
|
68
|
-
const e = t.getContractWithSigner(
|
|
72
|
+
if (r === i.Deposit) {
|
|
73
|
+
const e = t.getContractWithSigner(T.VolatileVault), d = t.getContractWithSigner(T.HinkalWrapper);
|
|
69
74
|
return await y(
|
|
70
75
|
t,
|
|
71
76
|
f[0],
|
|
@@ -77,7 +82,7 @@ const rt = async (t, a, r, R, T) => {
|
|
|
77
82
|
d
|
|
78
83
|
);
|
|
79
84
|
}
|
|
80
|
-
return
|
|
85
|
+
return r === i.Withdraw && n ? await y(t, o[0], m, s, p, l) : R ? await b(t, s, l, p) : await M(t.getCurrentChainId(), s, l, p);
|
|
81
86
|
};
|
|
82
87
|
export {
|
|
83
88
|
rt as hinkalActionVolatile
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("../../error-handling/error-codes.constants.cjs"),k=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),L=require("../../functions/web3/events/getShieldedBalance.cjs"),N=require("../../functions/web3/functionCalls/estimateGasRelayer.cjs"),W=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),h=require("../../types/external-action.types.cjs"),K=require("../../externalABIs/index.cjs"),D=require("ethers"),T=require("../../types/hinkal.types.cjs"),V=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),f=require("../../functions/pre-transaction/outputApprovalDataProcessing.cjs"),b=require("../../functions/pre-transaction/getFeeStructure.cjs"),B=require("../../functions/pre-transaction/merge-with-fee-structure.cjs"),q=require("../../types/ethereum-network.types.cjs"),G=require("../../constants/conversion.constants.cjs"),z=require("../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs"),X=require("../../functions/pre-transaction/getSignatureDataForTransact.cjs"),Z=async(t,r,s,n,E,P=!1)=>{const c=D.ethers.utils.getAddress(n),i=new D.ethers.Contract(r[0],K.ERC20ABI),U=t.userKeys.getInHinkalAddress(c),g=t.getMyApprovalAmountForInteraction(n,r[0]),A=g-s;if(A>=0n)throw Error("Unreachable State: you already have approval");const a=[A],R=t.getContractWithFetcher(q.ContractType.HinkalContract),d=await b.getFeeStructure(t.getCurrentChainId(),E,r,h.ExternalActionId.Wallet,void 0,[0n,1n].map(e=>({to:i.address,from:R.address,value:0n,calldata:i.interface.encodeFunctionData("approve",[n,e])})));B.mergeWithFeeStructure(t.getCurrentChainId(),r,a,d);const o=[...await L.addPaddingToUtxos(t,r,a)],w=`swapperMHA${a.length.toString()}x${o[0].length}x1`,I=a.map(()=>!1),C=[],u={doPreTxApproval:!0,hinkalLogicAction:T.HinkalLogicAction.APPROVE,executeApprovalChanges:r.map(()=>0n),inHinkalAddress:U,useApprovalUtxoData:[]},{patchAccessTokenMerkleTree:S,kycRequired:F,hasAccessToken:_}=await z.shouldPatchAccessTokenMerkleTree(t,r,a),H=await X.getSignatureDataForTransact(t.getCurrentChainId(),await t.getEthereumAddress(),t.userKeys,F,_);for(let e=0;e<r.length;e+=1){const{outputUtxos:O}=V.outputUtxoProcessing(t.userKeys,o[e],a[e],void 0,void 0,!1);if(C.push(O),e===0){const{useApprovalUtxoData:p}=f.outputApprovalDataProcessingForHinkalApprove(t,o[e],n,s,a[e]);u.useApprovalUtxoData.push(p)}else{const{useApprovalUtxoData:p}=f.outputApprovalDataProcessing(t,o[e],a[e]);u.useApprovalUtxoData.push(p??T.defaultUseApprovalUTXOData(G.APPROVED_UTXO_CONVERSION_COUNT,0n))}}const x=await t.getRandomRelay();if(!x)throw Error(M.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const l={externalActionId:h.ExternalActionId.Wallet,externalAddress:c,externalActionMetadata:i.interface.encodeFunctionData("approve",[c,s-g])},{zkCallData:v,circomData:y,dimData:m}=await k.constructZkProof("v1x1",t.merkleTreeHinkal,t.merkleTreeAccessToken,o,C,t.userKeys,w,l.externalActionId,l.externalAddress,l.externalActionMetadata,t.generateProofRemotely,x,t.getCurrentChainId(),I,void 0,void 0,void 0,S,u,void 0,d,t.getContractWithFetcher(q.ContractType.HinkalHelperContract),H);return P?await N.estimateGasRelayer(t,v,m,y):await W.transactCallRelayer(t.getCurrentChainId(),v,m,y)};exports.hinkalApprove=Z;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { transactionErrorCodes as L } from "../../error-handling/error-codes.constants.mjs";
|
|
2
|
+
import { constructZkProof as M } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
|
|
3
|
+
import { addPaddingToUtxos as N } from "../../functions/web3/events/getShieldedBalance.mjs";
|
|
4
|
+
import { estimateGasRelayer as W } from "../../functions/web3/functionCalls/estimateGasRelayer.mjs";
|
|
5
|
+
import { transactCallRelayer as _ } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
6
|
+
import { ExternalActionId as D } from "../../types/external-action.types.mjs";
|
|
7
|
+
import { ERC20ABI as K } from "../../externalABIs/index.mjs";
|
|
8
|
+
import { ethers as y } from "ethers";
|
|
9
|
+
import { HinkalLogicAction as V, defaultUseApprovalUTXOData as z } from "../../types/hinkal.types.mjs";
|
|
10
|
+
import { outputUtxoProcessing as B } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
|
|
11
|
+
import { outputApprovalDataProcessingForHinkalApprove as X, outputApprovalDataProcessing as $ } from "../../functions/pre-transaction/outputApprovalDataProcessing.mjs";
|
|
12
|
+
import { getFeeStructure as b } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
13
|
+
import { mergeWithFeeStructure as k } from "../../functions/pre-transaction/merge-with-fee-structure.mjs";
|
|
14
|
+
import { ContractType as E } from "../../types/ethereum-network.types.mjs";
|
|
15
|
+
import { APPROVED_UTXO_CONVERSION_COUNT as q } from "../../constants/conversion.constants.mjs";
|
|
16
|
+
import { shouldPatchAccessTokenMerkleTree as G } from "../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs";
|
|
17
|
+
import { getSignatureDataForTransact as Y } from "../../functions/pre-transaction/getSignatureDataForTransact.mjs";
|
|
18
|
+
const gt = async (t, e, s, n, U, T = !1) => {
|
|
19
|
+
const i = y.utils.getAddress(n), c = new y.Contract(e[0], K), w = t.userKeys.getInHinkalAddress(i), l = t.getMyApprovalAmountForInteraction(n, e[0]), A = l - s;
|
|
20
|
+
if (A >= 0n)
|
|
21
|
+
throw Error("Unreachable State: you already have approval");
|
|
22
|
+
const r = [A], I = t.getContractWithFetcher(E.HinkalContract), g = await b(
|
|
23
|
+
t.getCurrentChainId(),
|
|
24
|
+
U,
|
|
25
|
+
e,
|
|
26
|
+
D.Wallet,
|
|
27
|
+
void 0,
|
|
28
|
+
// we don't need exact amounts, just need to result in the same amount of gas
|
|
29
|
+
[0n, 1n].map((o) => ({
|
|
30
|
+
to: c.address,
|
|
31
|
+
from: I.address,
|
|
32
|
+
value: 0n,
|
|
33
|
+
calldata: c.interface.encodeFunctionData("approve", [n, o])
|
|
34
|
+
}))
|
|
35
|
+
);
|
|
36
|
+
k(t.getCurrentChainId(), e, r, g);
|
|
37
|
+
const a = [...await N(t, e, r)], R = `swapperMHA${r.length.toString()}x${a[0].length}x1`, P = r.map(() => !1), d = [], p = {
|
|
38
|
+
doPreTxApproval: !0,
|
|
39
|
+
hinkalLogicAction: V.APPROVE,
|
|
40
|
+
executeApprovalChanges: e.map(() => 0n),
|
|
41
|
+
// this should not matter
|
|
42
|
+
inHinkalAddress: w,
|
|
43
|
+
// as well
|
|
44
|
+
useApprovalUtxoData: []
|
|
45
|
+
}, { patchAccessTokenMerkleTree: h, kycRequired: F, hasAccessToken: H } = await G(
|
|
46
|
+
t,
|
|
47
|
+
e,
|
|
48
|
+
r
|
|
49
|
+
), O = await Y(
|
|
50
|
+
t.getCurrentChainId(),
|
|
51
|
+
await t.getEthereumAddress(),
|
|
52
|
+
t.userKeys,
|
|
53
|
+
F,
|
|
54
|
+
H
|
|
55
|
+
);
|
|
56
|
+
for (let o = 0; o < e.length; o += 1) {
|
|
57
|
+
const { outputUtxos: S } = B(
|
|
58
|
+
t.userKeys,
|
|
59
|
+
a[o],
|
|
60
|
+
r[o],
|
|
61
|
+
void 0,
|
|
62
|
+
void 0,
|
|
63
|
+
!1
|
|
64
|
+
);
|
|
65
|
+
if (d.push(S), o === 0) {
|
|
66
|
+
const { useApprovalUtxoData: m } = X(
|
|
67
|
+
t,
|
|
68
|
+
a[o],
|
|
69
|
+
n,
|
|
70
|
+
s,
|
|
71
|
+
r[o]
|
|
72
|
+
);
|
|
73
|
+
p.useApprovalUtxoData.push(m);
|
|
74
|
+
} else {
|
|
75
|
+
const { useApprovalUtxoData: m } = $(t, a[o], r[o]);
|
|
76
|
+
p.useApprovalUtxoData.push(
|
|
77
|
+
m ?? z(q, 0n)
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const f = await t.getRandomRelay();
|
|
82
|
+
if (!f)
|
|
83
|
+
throw Error(L.RELAYER_NOT_AVAILABLE);
|
|
84
|
+
const u = {
|
|
85
|
+
externalActionId: D.Wallet,
|
|
86
|
+
externalAddress: i,
|
|
87
|
+
externalActionMetadata: c.interface.encodeFunctionData("approve", [
|
|
88
|
+
i,
|
|
89
|
+
s - l
|
|
90
|
+
])
|
|
91
|
+
}, { zkCallData: C, circomData: x, dimData: v } = await M(
|
|
92
|
+
"v1x1",
|
|
93
|
+
t.merkleTreeHinkal,
|
|
94
|
+
t.merkleTreeAccessToken,
|
|
95
|
+
a,
|
|
96
|
+
d,
|
|
97
|
+
t.userKeys,
|
|
98
|
+
R,
|
|
99
|
+
u.externalActionId,
|
|
100
|
+
u.externalAddress,
|
|
101
|
+
u.externalActionMetadata,
|
|
102
|
+
t.generateProofRemotely,
|
|
103
|
+
f,
|
|
104
|
+
t.getCurrentChainId(),
|
|
105
|
+
P,
|
|
106
|
+
void 0,
|
|
107
|
+
void 0,
|
|
108
|
+
void 0,
|
|
109
|
+
h,
|
|
110
|
+
p,
|
|
111
|
+
void 0,
|
|
112
|
+
g,
|
|
113
|
+
t.getContractWithFetcher(E.HinkalHelperContract),
|
|
114
|
+
O
|
|
115
|
+
);
|
|
116
|
+
return T ? await W(t, C, v, x) : await _(t.getCurrentChainId(), C, v, x);
|
|
117
|
+
};
|
|
118
|
+
export {
|
|
119
|
+
gt as hinkalApprove
|
|
120
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../constants/chains.constants.cjs"),a=require("ethers"),i=async(r,e,t)=>await r.checkTokenRegistry(e,t),o=r=>{const e=n.networkRegistry[r].contractData,t=new a.ethers.providers.JsonRpcProvider(n.networkRegistry[r].fetchRpcUrl);if(!e.hinkalHelperAddress||!e.hinkalHelperABI)throw Error("hinkal helpercontract data not found");return new a.ethers.Contract(e.hinkalHelperAddress,e.hinkalHelperABI,t)};exports.createHinkalHelperFromData=o;exports.hinkalCheckTokenRegistry=i;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { networkRegistry as n } from "../../constants/chains.constants.mjs";
|
|
2
|
+
import { ethers as o } from "ethers";
|
|
3
|
+
const l = async (e, r, t) => await e.checkTokenRegistry(r, t), s = (e) => {
|
|
4
|
+
const r = n[e].contractData, t = new o.providers.JsonRpcProvider(n[e].fetchRpcUrl);
|
|
5
|
+
if (!r.hinkalHelperAddress || !r.hinkalHelperABI)
|
|
6
|
+
throw Error("hinkal helpercontract data not found");
|
|
7
|
+
return new o.Contract(r.hinkalHelperAddress, r.hinkalHelperABI, t);
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
s as createHinkalHelperFromData,
|
|
11
|
+
l as hinkalCheckTokenRegistry
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../constants/protocol.constants.cjs"),s=require("../../types/ethereum-network.types.cjs"),i=require("../../error-handling/logger.cjs"),u=async(t,o,a)=>{const e=await t.actionPrivateWallet([],[],[],[],o,a);if(i.Logger.log({creationTransaction:e}),!e)throw Error("SubAccount creation failed");const c=t.getContractWithFetcher(s.ContractType.HinkalWalletFactory),n=t.userKeys.getWalletSalt(o),r=await c.getWallet(n);if(!r||r===l.zeroAddress)throw Error("smart wallet corresponding to the subAccount not found");return e};exports.hinkalDeploySubAccount=u;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { zeroAddress as l } from "../../constants/protocol.constants.mjs";
|
|
2
|
+
import { ContractType as i } from "../../types/ethereum-network.types.mjs";
|
|
3
|
+
import { Logger as s } from "../../error-handling/logger.mjs";
|
|
4
|
+
const g = async (t, r, e) => {
|
|
5
|
+
const o = await t.actionPrivateWallet([], [], [], [], r, e);
|
|
6
|
+
if (s.log({ creationTransaction: o }), !o)
|
|
7
|
+
throw Error("SubAccount creation failed");
|
|
8
|
+
const c = t.getContractWithFetcher(i.HinkalWalletFactory), n = t.userKeys.getWalletSalt(r), a = await c.getWallet(n);
|
|
9
|
+
if (!a || a === l)
|
|
10
|
+
throw Error("smart wallet corresponding to the subAccount not found");
|
|
11
|
+
return o;
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
g as hinkalDeploySubAccount
|
|
15
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("../../constants/protocol.constants.cjs"),U=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),w=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),K=require("../../functions/web3/events/getShieldedBalance.cjs"),P=require("../../functions/web3/functionCalls/transactCallDirect.cjs"),g=require("../utxo/Utxo.cjs"),h=require("../../error-handling/error-codes.constants.cjs");require("../../types/circom-data.types.cjs");const q=require("../../types/ethereum-network.types.cjs");require("../../constants/vite.constants.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("../../types/activities.types.cjs");const k=require("../../functions/pre-transaction/getSignatureDataForTransact.cjs"),I=require("../../functions/utils/addresses.cjs"),S=require("../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs"),C=async(e,a,t)=>{const{patchAccessTokenMerkleTree:o,kycRequired:r,hasAccessToken:l}=await S.shouldPatchAccessTokenMerkleTree(e,a,t),n=void 0,A=await e.getEthereumAddress(),i=await k.getSignatureDataForTransact(e.getCurrentChainId(),A,e.userKeys,r,l),c={externalActionId:0n,externalAddress:await e.getEthereumAddress(),externalActionMetadata:"0x00"};return{signatureData:i,externalActionData:c,contractTransaction:n,contractToApprove:n,patchAccessTokenMerkleTree:o}},f=async(e,a,t)=>{const o=a.map(s=>s.erc20TokenAddress),{externalActionData:r,contractTransaction:l,contractToApprove:n,patchAccessTokenMerkleTree:A,signatureData:i}=await C(e,o,t),c=[...await K.addPaddingToUtxos(e,o,t)],p=`swapperM${t.length.toString()}x${c[0].length}x1`,d=[];for(let s=0;s<o.length;s+=1){const{outputUtxos:v}=U.outputUtxoProcessing(e.userKeys,c[s],t[s]);d.push(v)}const{zkCallData:x,circomData:T,dimData:y}=await w.constructZkProof("v1x1",e.merkleTreeHinkal,e.merkleTreeAccessToken,c,d,e.userKeys,p,r.externalActionId,r.externalAddress,r.externalActionMetadata,e.generateProofRemotely,D.zeroAddress,e.getCurrentChainId(),void 0,void 0,void 0,void 0,A,void 0,void 0,void 0,e.getContractWithFetcher(q.ContractType.HinkalHelperContract),i);return await P.transactCallDirect(e,t,a,x,T,y,n,l)},E=async(e,a,t,o)=>{const r=a.map(u=>u.erc20TokenAddress),[l,n,A]=o.split(",");if(!I.isValidPrivateAddress(o))throw Error(h.transactionErrorCodes.RECIPIENT_FORMAT_INCORRECT);const i=r.map(u=>[new g.Utxo({amount:0n,erc20TokenAddress:u,shieldedPrivateKey:e.userKeys.getShieldedPrivateKey()}),new g.Utxo({amount:0n,erc20TokenAddress:u,shieldedPrivateKey:e.userKeys.getShieldedPrivateKey()})]),c=`swapperM${t.length.toString()}x${i[0].length}x1`,p=r.map((u,M)=>[new g.Utxo({amount:t[M],erc20TokenAddress:u,randomization:BigInt(l),stealthAddress:n,encryptionKey:A})]),{externalActionData:d,contractTransaction:x,contractToApprove:T,patchAccessTokenMerkleTree:y}=await C(e,r,t),{zkCallData:m,circomData:s,dimData:v}=await w.constructZkProof("v1x1",e.merkleTreeHinkal,e.merkleTreeAccessToken,i,p,e.userKeys,c,d.externalActionId,d.externalAddress,d.externalActionMetadata,e.generateProofRemotely,D.zeroAddress,e.getCurrentChainId(),void 0,void 0,void 0,void 0,y,void 0,void 0,void 0,e.getContractWithFetcher(q.ContractType.HinkalHelperContract));return await P.transactCallDirect(e,t,a,m,s,v,T,x)};exports.hinkalDeposit=f;exports.hinkalDepositForOther=E;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { IHinkal } from './IHinkal';
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
2
|
+
import { ERC20Token } from '../../types';
|
|
3
|
+
export declare const hinkalDeposit: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[]) => Promise<any>;
|
|
4
|
+
export declare const hinkalDepositForOther: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], recipinetInfo: string) => Promise<any>;
|