@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,52 +1,73 @@
|
|
|
1
|
-
import { EventType as
|
|
2
|
-
import { ContractType as
|
|
3
|
-
import { checkHinkalAccessToken as
|
|
4
|
-
import { getShieldedBalance as
|
|
5
|
-
import { UserKeys as
|
|
6
|
-
import { hinkalActionBeefy as
|
|
7
|
-
import { hinkalActionConvex as
|
|
8
|
-
import { hinkalActionCurve as
|
|
9
|
-
import { hinkalActionPendle as
|
|
10
|
-
import { hinkalDeposit as
|
|
11
|
-
import { hinkalSwap as
|
|
12
|
-
import { hinkalWithdraw as
|
|
13
|
-
import { resetMerkleTrees as
|
|
14
|
-
import { MerkleTree as
|
|
15
|
-
import
|
|
1
|
+
import { EventType as k } from "../../types/hinkal.types.mjs";
|
|
2
|
+
import { ContractType as l } from "../../types/ethereum-network.types.mjs";
|
|
3
|
+
import { checkHinkalAccessToken as T, mintAccessToken as S, mintTokenCrossChain as E } from "../../functions/web3/functionCalls/accessTokenCalls.mjs";
|
|
4
|
+
import { getShieldedBalance as F } from "../../functions/web3/events/getShieldedBalance.mjs";
|
|
5
|
+
import { UserKeys as d } from "../crypto-keys/keys.mjs";
|
|
6
|
+
import { hinkalActionBeefy as I } from "./hinkalActionBeefy.mjs";
|
|
7
|
+
import { hinkalActionConvex as R } from "./hinkalActionConvex.mjs";
|
|
8
|
+
import { hinkalActionCurve as H } from "./hinkalActionCurve.mjs";
|
|
9
|
+
import { hinkalActionPendle as M } from "./hinkalActionPendle.mjs";
|
|
10
|
+
import { hinkalDeposit as B, hinkalDepositForOther as b } from "./hinkalDeposit.mjs";
|
|
11
|
+
import { hinkalSwap as x } from "./hinkalSwap.mjs";
|
|
12
|
+
import { hinkalWithdraw as U } from "./hinkalWithdraw.mjs";
|
|
13
|
+
import { resetMerkleTrees as W } from "./resetMerkleTrees.mjs";
|
|
14
|
+
import { MerkleTree as f } from "../merkle-tree/MerkleTree.mjs";
|
|
15
|
+
import "ethers";
|
|
16
|
+
import { transactionErrorCodes as A } from "../../error-handling/error-codes.constants.mjs";
|
|
17
|
+
import { poseidonFunction as y } from "../../crypto/poseidon.mjs";
|
|
16
18
|
import "circomlibjs-hinkal-fork";
|
|
17
19
|
import "libsodium-wrappers";
|
|
18
20
|
import "process";
|
|
19
21
|
import "buffer";
|
|
20
|
-
import { networkRegistry as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import "../../constants/vite.constants.mjs";
|
|
22
|
+
import { networkRegistry as K } from "../../constants/chains.constants.mjs";
|
|
23
|
+
import { monitor as L } from "../../API/callMonitor.mjs";
|
|
24
|
+
import { hinkalActionLido as D } from "./hinkalActionLidoEth.mjs";
|
|
25
|
+
import { isExtension as N } from "../../constants/vite.constants.mjs";
|
|
25
26
|
import "axios";
|
|
26
27
|
import "../../constants/coingecko.constants.mjs";
|
|
27
|
-
import { getAxelarGasEstimate as
|
|
28
|
-
import { API as
|
|
29
|
-
import "ethers";
|
|
28
|
+
import { getAxelarGasEstimate as O } from "../../API/getAxelarGasEstimate.mjs";
|
|
29
|
+
import { API as C } from "../../API/API.mjs";
|
|
30
30
|
import "../../types/curve.types.mjs";
|
|
31
|
+
import "../../constants/token-data/index.mjs";
|
|
31
32
|
import "../../constants/contracts.constants.mjs";
|
|
32
|
-
import { supportedPassportLinks as
|
|
33
|
+
import { supportedPassportLinks as G } from "../../constants/kyc.constants.mjs";
|
|
33
34
|
import "../../constants/axelar.constants.mjs";
|
|
34
35
|
import "../../constants/rewards.constants.mjs";
|
|
35
36
|
import "../../constants/reorg-depths.constants.mjs";
|
|
36
|
-
import
|
|
37
|
+
import "../../constants/addresses.constants.mjs";
|
|
38
|
+
import "../../constants/token.limits.constants.mjs";
|
|
39
|
+
import { TransactionsManager as _ } from "../transactions-manager/TransactionsManager.mjs";
|
|
37
40
|
import "../../functions/utils/external-action.utils.mjs";
|
|
38
41
|
import "../../types/circom-data.types.mjs";
|
|
39
42
|
import "../../types/transactions.types.mjs";
|
|
40
|
-
import
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
|
|
43
|
+
import "../../types/activities.types.mjs";
|
|
44
|
+
import { reloadPage as j } from "../../functions/utils/reloadPage.mjs";
|
|
45
|
+
import { hinkalActionVolatile as V } from "./hinkalActionVolatile.mjs";
|
|
46
|
+
import { hinkalActionPendleLP as z, hinkalGetPendleLPClaimableParams as q } from "./hinkalActionPendleLP.mjs";
|
|
47
|
+
import { getConnextReceiveFee as J } from "../../API/getConnextReceiveFee.mjs";
|
|
48
|
+
import { hinkalActionStake as Q } from "./hinkalActionStake.mjs";
|
|
49
|
+
import { MultiThreadedUtxoUtils as X } from "../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs";
|
|
50
|
+
import { hinkalPrivateWallet as Y } from "./hinkalPrivateWallet.mjs";
|
|
51
|
+
import { resetCache as Z } from "../../functions/utils/cacheFunctions.mjs";
|
|
52
|
+
import { createCacheDevice as $ } from "../../functions/utils/cacheDevice.utils.mjs";
|
|
53
|
+
import { getContractWithFetcherByChainId as ee } from "../../functions/web3/getContractMetadata.mjs";
|
|
54
|
+
import { getRecipientInfo as te } from "./hinkalGetRecipientInfo.mjs";
|
|
55
|
+
import { hinkalApprove as re } from "./hinkalApprove.mjs";
|
|
56
|
+
import { hinkalInsideTransact as ie } from "./hinkalInsideTransact.mjs";
|
|
57
|
+
import { getApprovedBalance as ne, getApprovedUtxos as ae, getApprovedUtxosForToken as se, getMyApprovalAmountForInteraction as oe } from "../../functions/web3/events/getApprovedBalance.mjs";
|
|
58
|
+
import { getInteractionApprovals as ce, checkExistingApprovalFromHinkal as he, getBufferEntry as pe } from "../../functions/web3/functionCalls/inHinkalApprovalCalls.mjs";
|
|
59
|
+
import { hinkalSignSubAccount as le } from "./hinkalSignSubAccount.mjs";
|
|
60
|
+
import { hinkalDeploySubAccount as de } from "./hinkalDeploySubAccount.mjs";
|
|
61
|
+
import { hinkalCheckTokenRegistry as me } from "./hinkalCheckTokenRegistry.mjs";
|
|
62
|
+
import { hinkalActionReceive as ge } from "./hinkalActionReceive.mjs";
|
|
63
|
+
import { hinkalActionFundApproveAndTransact as ue } from "./hinkalActionFundApproveAndTransact.mjs";
|
|
64
|
+
import { privateTokensDB as ve } from "../TokenDBs/PrivateTokensDB.mjs";
|
|
65
|
+
import "idb-keyval";
|
|
66
|
+
import { hinkalProoflessDeposit as ke } from "./hinkalProoflessDeposit.mjs";
|
|
67
|
+
import { hinkalProxySwap as fe } from "./hinkalProxySwap.mjs";
|
|
68
|
+
import { hinkalMultiSendPrivateRecipients as Ae } from "./hinkalMultiSend.mjs";
|
|
69
|
+
import { getErc20TokensForChain as ye } from "../../functions/utils/erc20tokenFunctions.mjs";
|
|
70
|
+
class Kt {
|
|
50
71
|
providerAdapter;
|
|
51
72
|
userKeys;
|
|
52
73
|
signingMessage = "Login to Hinkal Protocol";
|
|
@@ -54,14 +75,18 @@ class Be {
|
|
|
54
75
|
merkleTreeAccessToken;
|
|
55
76
|
nullifiers;
|
|
56
77
|
encryptedOutputs;
|
|
78
|
+
approvals;
|
|
57
79
|
commitmentsSnapshotService;
|
|
58
80
|
nullifierSnapshotService;
|
|
59
81
|
accessTokenSnapshotService;
|
|
82
|
+
approvalsSnapshotService;
|
|
60
83
|
transactionsManager;
|
|
61
84
|
utxoUtils;
|
|
62
85
|
cacheDevice;
|
|
86
|
+
generateProofRemotely;
|
|
87
|
+
disableMerkleTreeUpdates;
|
|
63
88
|
constructor(e) {
|
|
64
|
-
this.userKeys = new
|
|
89
|
+
this.userKeys = new d(void 0), this.merkleTreeHinkal = f.create(y, 25n, 0n), this.merkleTreeAccessToken = f.create(y, 25n, 0n), this.nullifiers = /* @__PURE__ */ new Set(), this.encryptedOutputs = [], this.approvals = /* @__PURE__ */ new Map(), this.transactionsManager = new _(), this.generateProofRemotely = e?.generateProofRemotely ?? !1, this.utxoUtils = new X(), this.cacheDevice = $(e), this.disableMerkleTreeUpdates = e?.disableMerkleTreeUpdates ?? !1;
|
|
65
90
|
}
|
|
66
91
|
async initProviderAdapter(e, t) {
|
|
67
92
|
await this.updateProviderAdapter(t), this.providerAdapter?.initConnector(e);
|
|
@@ -69,13 +94,13 @@ class Be {
|
|
|
69
94
|
await t.init(r), await this.setListeners();
|
|
70
95
|
}
|
|
71
96
|
async initUserKeys() {
|
|
72
|
-
this.userKeys = new
|
|
97
|
+
this.userKeys = new d(await this.getProviderAdapter().signMessage(this.signingMessage));
|
|
73
98
|
}
|
|
74
99
|
async initUserKeysWithPassword(e) {
|
|
75
|
-
this.userKeys = new
|
|
100
|
+
this.userKeys = new d(e);
|
|
76
101
|
}
|
|
77
102
|
async resetMerkle() {
|
|
78
|
-
this.isSelectedNetworkSupported() && await
|
|
103
|
+
this.disableMerkleTreeUpdates || this.isSelectedNetworkSupported() && await W(this);
|
|
79
104
|
}
|
|
80
105
|
getProviderAdapter() {
|
|
81
106
|
if (!this.providerAdapter)
|
|
@@ -91,12 +116,21 @@ class Be {
|
|
|
91
116
|
getContract(e, t = void 0, r) {
|
|
92
117
|
return this.getProviderAdapter().getContract(e, t, r);
|
|
93
118
|
}
|
|
119
|
+
getContractWithFetcherByChainId(e, t, r = void 0) {
|
|
120
|
+
return ee(e, t, r);
|
|
121
|
+
}
|
|
94
122
|
async signMessage(e) {
|
|
95
123
|
return await this.getProviderAdapter().signMessage(e);
|
|
96
124
|
}
|
|
97
125
|
async signTypedData(e, t, r) {
|
|
98
126
|
return await this.getProviderAdapter().signTypedData(e, t, r);
|
|
99
127
|
}
|
|
128
|
+
async deploySubAccount(e, t) {
|
|
129
|
+
return de(this, e, t);
|
|
130
|
+
}
|
|
131
|
+
async signWithSubAccount(e, t, r, i) {
|
|
132
|
+
return le(this, e, t, r, i);
|
|
133
|
+
}
|
|
100
134
|
getContractWithSigner(e, t = "") {
|
|
101
135
|
return this.getProviderAdapter().getContractWithSigner(e, t);
|
|
102
136
|
}
|
|
@@ -107,15 +141,18 @@ class Be {
|
|
|
107
141
|
return this.getProviderAdapter().getContractWithFetcherForEthereum(e, t);
|
|
108
142
|
}
|
|
109
143
|
isSelectedNetworkSupported() {
|
|
110
|
-
return !!
|
|
144
|
+
return !!K[this.getCurrentChainId()];
|
|
111
145
|
}
|
|
112
146
|
async switchNetwork(e) {
|
|
113
147
|
try {
|
|
114
148
|
await this.getProviderAdapter().switchNetwork(e);
|
|
115
149
|
} catch {
|
|
116
|
-
throw new Error(
|
|
150
|
+
throw new Error(A.FAILED_TO_SWITCH_NETWORKS);
|
|
117
151
|
}
|
|
118
152
|
}
|
|
153
|
+
async switchAccount(e) {
|
|
154
|
+
await this.getProviderAdapter().switchAccount(e);
|
|
155
|
+
}
|
|
119
156
|
getCurrentChainId() {
|
|
120
157
|
const { chainId: e } = this.getProviderAdapter();
|
|
121
158
|
if (!e)
|
|
@@ -153,31 +190,62 @@ class Be {
|
|
|
153
190
|
}
|
|
154
191
|
async onAccountChanged() {
|
|
155
192
|
await this.getProviderAdapter().onAccountChanged();
|
|
156
|
-
const e =
|
|
193
|
+
const e = k.AccountChanged;
|
|
157
194
|
typeof document < "u" ? document?.dispatchEvent(new Event(e)) : process?.emit("message", e, void 0);
|
|
158
195
|
}
|
|
159
196
|
async onChainChanged(e) {
|
|
160
197
|
if (e) {
|
|
161
198
|
await this.getProviderAdapter().onChainChanged(e);
|
|
162
|
-
const t =
|
|
199
|
+
const t = k.NetworkChange;
|
|
163
200
|
typeof document < "u" ? document.dispatchEvent(new Event(t)) : process?.emit("message", t, void 0);
|
|
164
201
|
} else
|
|
165
|
-
await this.disconnectFromConnector(),
|
|
202
|
+
await this.disconnectFromConnector(), j();
|
|
166
203
|
}
|
|
167
204
|
async monitorConnectedAddress() {
|
|
168
|
-
|
|
205
|
+
L(await this.getEthereumAddress(), this.getCurrentChainId());
|
|
206
|
+
}
|
|
207
|
+
async getBalances(e, t, r, i, n = !1, a) {
|
|
208
|
+
return F(
|
|
209
|
+
this,
|
|
210
|
+
e,
|
|
211
|
+
t,
|
|
212
|
+
r,
|
|
213
|
+
i,
|
|
214
|
+
n,
|
|
215
|
+
this.generateProofRemotely,
|
|
216
|
+
a
|
|
217
|
+
);
|
|
169
218
|
}
|
|
170
|
-
async
|
|
171
|
-
return
|
|
219
|
+
async getApprovedBalances(e = !1, t = !1) {
|
|
220
|
+
return ne(this, e, t);
|
|
221
|
+
}
|
|
222
|
+
async getTotalBalance(e, t, r, i = !1, n) {
|
|
223
|
+
const a = e ?? this.getCurrentChainId(), s = r ?? await this.getEthereumAddress(), o = t ?? this.userKeys, c = await this.getBalances(
|
|
224
|
+
a,
|
|
225
|
+
o.getShieldedPrivateKey(),
|
|
226
|
+
o.getShieldedPublicKey(),
|
|
227
|
+
s,
|
|
228
|
+
i,
|
|
229
|
+
n
|
|
230
|
+
), h = await this.getApprovedBalances(i, n), w = N ? await ve.getPrivateTokens(a, s) : ye(a), m = [];
|
|
231
|
+
return w.forEach((g) => {
|
|
232
|
+
const u = g.erc20TokenAddress.toLowerCase(), p = c.get(u), v = h.get(u), P = {
|
|
233
|
+
token: g,
|
|
234
|
+
balance: (p?.balance ?? 0n) + (v?.balance ?? 0n),
|
|
235
|
+
timestamp: p?.timestamp || v?.timestamp || "0",
|
|
236
|
+
nfts: p?.nfts || []
|
|
237
|
+
};
|
|
238
|
+
m.push(P);
|
|
239
|
+
}), m;
|
|
172
240
|
}
|
|
173
241
|
getSupportedPassportLinks() {
|
|
174
|
-
return
|
|
242
|
+
return G;
|
|
175
243
|
}
|
|
176
244
|
checkAccessToken() {
|
|
177
|
-
return
|
|
245
|
+
return T(this);
|
|
178
246
|
}
|
|
179
247
|
async getAxelarEstimate(e, t, r, i) {
|
|
180
|
-
return
|
|
248
|
+
return O(
|
|
181
249
|
e,
|
|
182
250
|
t,
|
|
183
251
|
r,
|
|
@@ -186,41 +254,42 @@ class Be {
|
|
|
186
254
|
);
|
|
187
255
|
}
|
|
188
256
|
async getConnextReceiveFee(e, t) {
|
|
189
|
-
return
|
|
257
|
+
return J(this.getCurrentChainId(), e, t);
|
|
190
258
|
}
|
|
191
|
-
async mintHinkalAccessToken(e) {
|
|
192
|
-
return
|
|
259
|
+
async mintHinkalAccessToken(e, t) {
|
|
260
|
+
return S(this, e, t);
|
|
193
261
|
}
|
|
194
|
-
async mintHinkalAccessTokenCrossChain(e, t) {
|
|
195
|
-
return
|
|
262
|
+
async mintHinkalAccessTokenCrossChain(e, t, r) {
|
|
263
|
+
return E(this, e, t, r);
|
|
196
264
|
}
|
|
197
265
|
async getHinkalTreeRootHash() {
|
|
198
|
-
return this.getContractWithFetcher(
|
|
266
|
+
return this.getContractWithFetcher(l.HinkalContract).getRootHash();
|
|
199
267
|
}
|
|
200
268
|
async getAccessTokenTreeRootHash() {
|
|
201
|
-
return this.getContractWithFetcher(
|
|
269
|
+
return this.getContractWithFetcher(l.AccessTokenContract).getRootHash();
|
|
202
270
|
}
|
|
203
271
|
async resetMerkleTreesIfNecessary() {
|
|
204
272
|
if (!this.isSelectedNetworkSupported())
|
|
205
|
-
throw new Error(
|
|
273
|
+
throw new Error(A.UNSUPPORTED_NETWORK);
|
|
206
274
|
const [e, t] = await Promise.all([
|
|
207
275
|
this.getHinkalTreeRootHash(),
|
|
208
276
|
this.getAccessTokenTreeRootHash()
|
|
209
277
|
]);
|
|
210
|
-
(e.toBigInt() !== this.merkleTreeHinkal.getRootHash() || t.toBigInt() !== this.merkleTreeAccessToken.getRootHash()) && await this.resetMerkle();
|
|
278
|
+
(e.toBigInt() !== this.merkleTreeHinkal.getRootHash() || t.toBigInt() !== this.merkleTreeAccessToken.getRootHash()) && (console.log("resetting merkle tree in resetMerkleTreesIfNecessary"), await this.resetMerkle());
|
|
211
279
|
}
|
|
212
280
|
async getEventsFromHinkal() {
|
|
213
281
|
await Promise.all([
|
|
214
282
|
this.accessTokenSnapshotService?.retrieveEventsFromLatestBlock(),
|
|
215
283
|
this.commitmentsSnapshotService?.retrieveEventsFromLatestBlock(),
|
|
216
|
-
this.nullifierSnapshotService?.retrieveEventsFromLatestBlock()
|
|
284
|
+
this.nullifierSnapshotService?.retrieveEventsFromLatestBlock(),
|
|
285
|
+
this.approvalsSnapshotService?.retrieveEventsFromLatestBlock()
|
|
217
286
|
]);
|
|
218
287
|
}
|
|
219
288
|
getEthereumAddress() {
|
|
220
289
|
return this.getProviderAdapter().getAddress();
|
|
221
290
|
}
|
|
222
291
|
async getRandomRelay() {
|
|
223
|
-
return (await
|
|
292
|
+
return (await C.getIdleRelay(this.getCurrentChainId())).relay;
|
|
224
293
|
}
|
|
225
294
|
getGasPrice() {
|
|
226
295
|
if (!this.providerAdapter?.chainId)
|
|
@@ -228,45 +297,84 @@ class Be {
|
|
|
228
297
|
return this.providerAdapter.getGasPrice();
|
|
229
298
|
}
|
|
230
299
|
getAPI() {
|
|
231
|
-
return
|
|
300
|
+
return C;
|
|
232
301
|
}
|
|
233
302
|
resetCache() {
|
|
234
|
-
|
|
303
|
+
Z(this, this.getCurrentChainId(), this.userKeys.getShieldedPublicKey());
|
|
235
304
|
}
|
|
236
305
|
snapshotsClearInterval() {
|
|
237
|
-
this.commitmentsSnapshotService?.intervalClear(), this.accessTokenSnapshotService?.intervalClear(), this.nullifierSnapshotService?.intervalClear();
|
|
306
|
+
this.commitmentsSnapshotService?.intervalClear(), this.accessTokenSnapshotService?.intervalClear(), this.nullifierSnapshotService?.intervalClear(), this.approvalsSnapshotService?.intervalClear();
|
|
307
|
+
}
|
|
308
|
+
checkTokenRegistry(e, t) {
|
|
309
|
+
const r = this.getContractWithFetcher(l.HinkalHelperContract);
|
|
310
|
+
return me(r, e, t);
|
|
311
|
+
}
|
|
312
|
+
getRecipientInfo(e = !1) {
|
|
313
|
+
return te(this, e);
|
|
314
|
+
}
|
|
315
|
+
async getInteractionApprovals(e) {
|
|
316
|
+
return await ce(this, e);
|
|
317
|
+
}
|
|
318
|
+
getApprovedUtxos(e = !1) {
|
|
319
|
+
return ae(this, e);
|
|
320
|
+
}
|
|
321
|
+
getApprovedUtxosForToken(e, t = !1) {
|
|
322
|
+
return se(this, e, t);
|
|
323
|
+
}
|
|
324
|
+
getMyApprovalAmountForInteraction(e, t) {
|
|
325
|
+
return oe(this, e, t);
|
|
326
|
+
}
|
|
327
|
+
async checkExistingApprovalFromHinkal(e, t) {
|
|
328
|
+
return await he(this, e, t);
|
|
329
|
+
}
|
|
330
|
+
async getBufferEntry(e, t, r) {
|
|
331
|
+
return pe(this, e, t, r);
|
|
238
332
|
}
|
|
239
333
|
async deposit(e, t) {
|
|
240
|
-
return
|
|
334
|
+
return B(this, e, t);
|
|
241
335
|
}
|
|
242
336
|
async depositForOther(e, t, r) {
|
|
243
|
-
return
|
|
337
|
+
return b(this, e, t, r);
|
|
338
|
+
}
|
|
339
|
+
async prooflessDeposit(e, t, r) {
|
|
340
|
+
return ke(this, e, t, r);
|
|
244
341
|
}
|
|
245
342
|
// async transfer(token: ERC20Token, amount: bigint, recipientAddress: string): Promise<ethers.ContractTransaction> {
|
|
246
343
|
// return hinkalTransfer(this, token, amount, recipientAddress);
|
|
247
344
|
// }
|
|
248
|
-
async withdraw(e, t, r, i, n = !1) {
|
|
249
|
-
return
|
|
345
|
+
async withdraw(e, t, r, i, n, a, s = !1) {
|
|
346
|
+
return U(
|
|
347
|
+
this,
|
|
348
|
+
e,
|
|
349
|
+
t,
|
|
350
|
+
r,
|
|
351
|
+
i,
|
|
352
|
+
n,
|
|
353
|
+
a,
|
|
354
|
+
s
|
|
355
|
+
);
|
|
250
356
|
}
|
|
251
|
-
async swap(e, t, r, i, n = !1,
|
|
252
|
-
return
|
|
357
|
+
async swap(e, t, r, i, n, a, s = !1, o = !1) {
|
|
358
|
+
return x(
|
|
253
359
|
this,
|
|
254
360
|
e,
|
|
255
361
|
t,
|
|
256
362
|
r,
|
|
257
363
|
i,
|
|
258
364
|
n,
|
|
259
|
-
a
|
|
365
|
+
a,
|
|
366
|
+
s,
|
|
367
|
+
o
|
|
260
368
|
);
|
|
261
369
|
}
|
|
262
370
|
async actionCurve(e, t, r, i, n, a = !1) {
|
|
263
|
-
return
|
|
371
|
+
return H(this, e, t, r, i, n, a);
|
|
264
372
|
}
|
|
265
373
|
async actionConvex(e, t, r, i, n = !1) {
|
|
266
|
-
return
|
|
374
|
+
return R(this, e, t, r, i, n);
|
|
267
375
|
}
|
|
268
|
-
async actionBeefy(e, t, r, i, n, a,
|
|
269
|
-
return
|
|
376
|
+
async actionBeefy(e, t, r, i, n, a, s = !1) {
|
|
377
|
+
return I(
|
|
270
378
|
this,
|
|
271
379
|
e,
|
|
272
380
|
t,
|
|
@@ -274,17 +382,17 @@ class Be {
|
|
|
274
382
|
i,
|
|
275
383
|
n,
|
|
276
384
|
a,
|
|
277
|
-
|
|
385
|
+
s
|
|
278
386
|
);
|
|
279
387
|
}
|
|
280
388
|
async actionLido(e, t, r, i, n, a = !1) {
|
|
281
|
-
return
|
|
389
|
+
return D(this, e, t, r, i, n, a);
|
|
282
390
|
}
|
|
283
391
|
async actionPendle(e, t, r, i, n = !1) {
|
|
284
|
-
return
|
|
392
|
+
return M(this, e, t, r, i, n);
|
|
285
393
|
}
|
|
286
394
|
async actionPendleLP(e, t, r, i, n = !1) {
|
|
287
|
-
return
|
|
395
|
+
return z(
|
|
288
396
|
this,
|
|
289
397
|
e,
|
|
290
398
|
t,
|
|
@@ -294,18 +402,88 @@ class Be {
|
|
|
294
402
|
);
|
|
295
403
|
}
|
|
296
404
|
async actionVolatile(e, t, r, i = !1) {
|
|
297
|
-
return
|
|
405
|
+
return V(this, e, t, r, i);
|
|
298
406
|
}
|
|
299
407
|
async actionStake(e, t, r, i) {
|
|
300
|
-
return
|
|
408
|
+
return Q(this, e, t, r, i);
|
|
301
409
|
}
|
|
302
|
-
async
|
|
303
|
-
return
|
|
410
|
+
async actionReceive(e, t, r, i, n, a = !1) {
|
|
411
|
+
return ge(
|
|
412
|
+
this,
|
|
413
|
+
e,
|
|
414
|
+
t,
|
|
415
|
+
r,
|
|
416
|
+
i,
|
|
417
|
+
n,
|
|
418
|
+
a
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
async actionFundApproveAndTransact(e, t, r, i, n, a, s, o, c, h) {
|
|
422
|
+
return ue(
|
|
423
|
+
this,
|
|
424
|
+
e,
|
|
425
|
+
t,
|
|
426
|
+
r,
|
|
427
|
+
i,
|
|
428
|
+
n,
|
|
429
|
+
a,
|
|
430
|
+
s,
|
|
431
|
+
o,
|
|
432
|
+
c,
|
|
433
|
+
h
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
async actionPrivateWallet(e, t, r, i = [], n, a, s, o = !1) {
|
|
437
|
+
return Y(
|
|
438
|
+
this,
|
|
439
|
+
e,
|
|
440
|
+
t,
|
|
441
|
+
r,
|
|
442
|
+
i,
|
|
443
|
+
n,
|
|
444
|
+
a,
|
|
445
|
+
s,
|
|
446
|
+
o
|
|
447
|
+
);
|
|
304
448
|
}
|
|
305
449
|
async getPendleLPClaimableParams(e, t) {
|
|
306
|
-
return
|
|
450
|
+
return q(this, e, t);
|
|
451
|
+
}
|
|
452
|
+
async approve(e, t, r, i, n = !1) {
|
|
453
|
+
return re(this, e, t, r, i, n);
|
|
454
|
+
}
|
|
455
|
+
async hinkalInsideTransact(e, t, r, i, n, a, s = !1) {
|
|
456
|
+
return ie(
|
|
457
|
+
this,
|
|
458
|
+
e,
|
|
459
|
+
t,
|
|
460
|
+
r,
|
|
461
|
+
i,
|
|
462
|
+
n,
|
|
463
|
+
a,
|
|
464
|
+
s
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
async proxySwap(e, t, r, i, n, a, s, o = !1) {
|
|
468
|
+
return fe(
|
|
469
|
+
this,
|
|
470
|
+
e,
|
|
471
|
+
t,
|
|
472
|
+
r,
|
|
473
|
+
i,
|
|
474
|
+
n,
|
|
475
|
+
a,
|
|
476
|
+
s,
|
|
477
|
+
o
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
async multiSendPrivateRecipients(e, t, r) {
|
|
481
|
+
return Ae(this, e, t, r);
|
|
482
|
+
}
|
|
483
|
+
areMerkleTreeUpdatesDisabled() {
|
|
484
|
+
return this.disableMerkleTreeUpdates;
|
|
307
485
|
}
|
|
308
486
|
}
|
|
309
487
|
export {
|
|
310
|
-
|
|
488
|
+
Kt as Hinkal
|
|
311
489
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxelarMigrationInfo } from '../../types/axelar.types';
|
|
2
|
-
import { BeefyAction, ConvexAction, CurveAction, LidoAction, LidoVariant, VolatileHelperData } from '../../types/hinkal.types';
|
|
2
|
+
import { ApprovedUtxo, ApprovedUtxoWithInteractionAddress, BeefyAction, ConvexAction, CurveAction, FeeStructure, LidoAction, LidoVariant, VolatileHelperData } from '../../types/hinkal.types';
|
|
3
3
|
import { ContractMetadata, ContractType, EthereumNetwork } from '../../types/ethereum-network.types';
|
|
4
4
|
import { EncryptedOutputWithSign } from '../../types/commitments.types';
|
|
5
5
|
import { ExternalActionId } from '../../types/external-action.types';
|
|
@@ -8,18 +8,20 @@ import { type IMultiThreadedUtxoUtils } from '../../types/IMultiThreadedUtxoUtil
|
|
|
8
8
|
import { PendleLPMetadata, PendleMetadata } from '../../types/pendle.types';
|
|
9
9
|
import { RelayerTransaction } from '../../types/relayer.types';
|
|
10
10
|
import { SignatureData } from '../../types/crypto.types';
|
|
11
|
-
import { TokenBalance } from '../../types/token.types';
|
|
11
|
+
import { ERC20Token, TokenBalance } from '../../types/token.types';
|
|
12
12
|
import { Bytes, ContractTransaction, ethers } from 'ethers';
|
|
13
13
|
import { type UserKeys } from '../crypto-keys/keys';
|
|
14
14
|
import { IProviderAdapter } from '../provider-adapter/IProviderAdapter';
|
|
15
15
|
import { ClientAccessTokenSnapshotService } from '../snapshot/ClientAccessTokenSnapshotService';
|
|
16
16
|
import { ClientCommitmentsSnapshotService } from '../snapshot/ClientCommitmentsSnapshotService';
|
|
17
17
|
import { ClientNullifierSnapshotService } from '../snapshot/ClientNullifierSnapshotService';
|
|
18
|
+
import { ClientApprovalsSnapshotService } from '../snapshot/ClientApprovalsSnapshotService';
|
|
18
19
|
import { MerkleTree } from '../merkle-tree';
|
|
19
20
|
import { TransactionsManager } from '../transactions-manager/TransactionsManager';
|
|
20
21
|
import { IAPI } from '../../API/API';
|
|
21
22
|
import { AxelarGasResponse } from '../../API/getAxelarGasEstimate';
|
|
22
23
|
import { type ICacheDevice } from '../../types/ICacheDevice';
|
|
24
|
+
import { StealthAddressStructure } from '../../types/circom-data.types';
|
|
23
25
|
export interface IHinkal<ConnectorType = unknown> {
|
|
24
26
|
userKeys: UserKeys;
|
|
25
27
|
readonly signingMessage: string;
|
|
@@ -27,13 +29,18 @@ export interface IHinkal<ConnectorType = unknown> {
|
|
|
27
29
|
merkleTreeAccessToken: MerkleTree<bigint>;
|
|
28
30
|
nullifiers: Set<string>;
|
|
29
31
|
encryptedOutputs: EncryptedOutputWithSign[];
|
|
32
|
+
approvals: Map<string, ApprovedUtxo[]>;
|
|
30
33
|
commitmentsSnapshotService?: ClientCommitmentsSnapshotService;
|
|
31
34
|
nullifierSnapshotService?: ClientNullifierSnapshotService;
|
|
32
35
|
accessTokenSnapshotService?: ClientAccessTokenSnapshotService;
|
|
36
|
+
approvalsSnapshotService?: ClientApprovalsSnapshotService;
|
|
33
37
|
transactionsManager: TransactionsManager;
|
|
38
|
+
generateProofRemotely: boolean;
|
|
34
39
|
utxoUtils: IMultiThreadedUtxoUtils;
|
|
35
40
|
cacheDevice: ICacheDevice;
|
|
36
|
-
getBalances(): Promise<TokenBalance
|
|
41
|
+
getBalances(chainId: number, passedShieldedPrivateKey: string, passedShieldedPublicKey: string, ethAddress: string, resetCacheBefore?: boolean, updateTokensListBefore?: boolean): Promise<Map<string, TokenBalance>>;
|
|
42
|
+
getApprovedBalances(resetCacheBefore?: boolean, updateTokensListBefore?: boolean): Promise<Map<string, TokenBalance>>;
|
|
43
|
+
getTotalBalance(chainId?: number, userKeys?: UserKeys, ethAddress?: string, resetCacheBefore?: boolean, updateTokensListBefore?: boolean): Promise<TokenBalance[]>;
|
|
37
44
|
getSupportedPassportLinks(): string[];
|
|
38
45
|
checkAccessToken(): Promise<boolean>;
|
|
39
46
|
getAxelarEstimate(chainId: number, sourceChainName: string, destChainName: string, sourceChainToken: string): Promise<AxelarGasResponse>;
|
|
@@ -41,17 +48,26 @@ export interface IHinkal<ConnectorType = unknown> {
|
|
|
41
48
|
resetMerkleTreesIfNecessary(): Promise<void>;
|
|
42
49
|
resetMerkle(): Promise<void>;
|
|
43
50
|
getEventsFromHinkal(): Promise<void>;
|
|
44
|
-
mintHinkalAccessToken(signatureData: SignatureData): Promise<ethers.ContractTransaction>;
|
|
45
|
-
mintHinkalAccessTokenCrossChain(signatureData: SignatureData, axelarMigrationInfos: AxelarMigrationInfo[]): Promise<ethers.ContractTransaction>;
|
|
51
|
+
mintHinkalAccessToken(signatureData: SignatureData, fromWallet?: boolean): Promise<ethers.ContractTransaction>;
|
|
52
|
+
mintHinkalAccessTokenCrossChain(signatureData: SignatureData, axelarMigrationInfos: AxelarMigrationInfo[], fromWallet?: boolean): Promise<ethers.ContractTransaction>;
|
|
46
53
|
getRandomRelay(): Promise<string | undefined>;
|
|
47
54
|
getGasPrice(): Promise<bigint>;
|
|
48
55
|
getAPI(): IAPI;
|
|
49
56
|
resetCache(): void;
|
|
50
57
|
snapshotsClearInterval(): void;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
checkTokenRegistry(erc20Addresses: string[], amountChanges: bigint[]): Promise<boolean>;
|
|
59
|
+
getRecipientInfo(extendedInfo?: boolean): string;
|
|
60
|
+
getInteractionApprovals(interactionAddress: string): Promise<ApprovedUtxo[]>;
|
|
61
|
+
getApprovedUtxos(resetCacheBefore?: boolean): ApprovedUtxoWithInteractionAddress[];
|
|
62
|
+
getApprovedUtxosForToken(erc20Address: string, resetCacheBefore?: boolean): ApprovedUtxoWithInteractionAddress[];
|
|
63
|
+
getMyApprovalAmountForInteraction(interactionAddress: string, tokenAddress: string): bigint;
|
|
64
|
+
checkExistingApprovalFromHinkal(erc20Address: string, interactionAddress: string): Promise<bigint>;
|
|
65
|
+
getBufferEntry(approveTo: string, tokenAddress: string, inHinkalAddress: bigint): Promise<bigint>;
|
|
66
|
+
deposit(erc20Tokens: ERC20Token[], amountChanges: bigint[]): Promise<ethers.ContractTransaction>;
|
|
67
|
+
depositForOther(erc20Tokens: ERC20Token[], amountChanges: bigint[], recepinetInfo: string): Promise<ethers.ContractTransaction>;
|
|
68
|
+
prooflessDeposit(erc20Tokens: ERC20Token[], amountChanges: bigint[], stealthAddressStructures?: StealthAddressStructure[]): Promise<ethers.ContractTransaction>;
|
|
69
|
+
withdraw(erc20Tokens: ERC20Token[], deltaAmounts: bigint[], recipientAddress: string, isRelayerOff: boolean, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean): Promise<ethers.ContractTransaction | RelayerTransaction | bigint>;
|
|
70
|
+
swap(erc20Addresses: string[], deltaAmounts: bigint[], externalActionId: ExternalActionId, swapData: string, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean, withPrivateMempool?: boolean): Promise<RelayerTransaction | bigint>;
|
|
55
71
|
actionCurve(tokens: string[], tokenAmounts: bigint[], poolAddress: string, curveAction: CurveAction, newVersion: boolean, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
56
72
|
actionConvex(tokens: string[], tokenAmounts: bigint[], poolId: number, convexAction: ConvexAction, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
57
73
|
actionBeefy(tokens: string[], tokenAmounts: bigint[], beefyAction: BeefyAction, oneInchData: string[], zapAddress: string, boostAddress: string | undefined, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
@@ -69,22 +85,33 @@ export interface IHinkal<ConnectorType = unknown> {
|
|
|
69
85
|
getContract(contract: ContractType, contractAddress?: string, chainId?: number): ethers.Contract;
|
|
70
86
|
getContractWithSigner(contract: ContractType, contractAddress?: string): ethers.Contract;
|
|
71
87
|
getContractWithFetcher(contract: ContractType, contractAddress?: string): ethers.Contract;
|
|
88
|
+
getContractWithFetcherByChainId(chainId: number, contractType: ContractType, contractAddress?: string): ethers.Contract;
|
|
72
89
|
getContractWithFetcherForEthereum(contract: ContractType, contractAddress?: string): ethers.Contract;
|
|
73
90
|
isSelectedNetworkSupported(): boolean;
|
|
74
91
|
switchNetwork(network: EthereumNetwork): Promise<unknown>;
|
|
92
|
+
switchAccount(signer: ethers.Signer): Promise<unknown>;
|
|
75
93
|
getCurrentChainId(): number;
|
|
76
94
|
monitorConnectedAddress(): Promise<void>;
|
|
77
95
|
getSelectedNetwork(): EthereumNetwork | undefined;
|
|
78
96
|
isPermitterAvailable(): boolean;
|
|
79
97
|
signMessage(message: Bytes | string): Promise<string>;
|
|
80
98
|
signTypedData(domain: ethers.TypedDataDomain, types: Record<string, ethers.TypedDataField[]>, value: Record<string, unknown>): Promise<string>;
|
|
99
|
+
deploySubAccount(walletNonce: bigint, feeToken?: string): Promise<RelayerTransaction>;
|
|
100
|
+
signWithSubAccount(dataHash: string, walletNonce: bigint, shouldBeProxyDeployed?: boolean, feeToken?: string): Promise<string>;
|
|
81
101
|
actionLido(lidoVariant: LidoVariant, lidoAction: LidoAction, tokens: string[], tokenAmounts: bigint[], tokenIds: number[], onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
82
102
|
actionPendle(erc20Addresses: string[], amountChanges: bigint[], pendleMetadata: PendleMetadata, gasTokenAddress?: string, onlyGasEstimate?: boolean): Promise<RelayerTransaction | ContractTransaction | bigint>;
|
|
83
103
|
actionPendleLP(erc20Addresses: string[], amountChanges: bigint[], pendleLPMetadata: PendleLPMetadata, gasTokenAddress?: string, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
84
104
|
actionVolatile(erc20Addresses: string[], amountChanges: bigint[], volatileHelperData: VolatileHelperData, onlyGasEstimate?: boolean): Promise<RelayerTransaction | ContractTransaction | bigint>;
|
|
85
|
-
|
|
105
|
+
actionFundApproveAndTransact(erc20Addresses: string[], fundAmounts: bigint[], approveTokenAddresses: string[], approveAmounts: bigint[], walletNonce: bigint, to: string, callDataString: string, value: bigint, feeToken?: string, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
106
|
+
actionPrivateWallet(erc20Addresses: string[], deltaAmounts: bigint[], onChainCreation: boolean[], ops: string[], walletNonce?: bigint, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
107
|
+
actionReceive(erc20Addresses: string[], deltaAmounts: bigint[], feeTokens?: string, feeStructureOverride?: FeeStructure, walletNonce?: bigint, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
86
108
|
getPendleLPClaimableParams(wlpTokenAddress: string, wlpTokenBalance: bigint): Promise<{
|
|
87
109
|
amount: bigint;
|
|
88
110
|
timestamp: string;
|
|
89
111
|
}>;
|
|
112
|
+
approve(erc20Addresses: string[], amount: bigint, approvedTo: string, feeToken?: string, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
113
|
+
hinkalInsideTransact(erc20Addresses: string[], deltaChanges: bigint[], approvalChanges: bigint[], externalAddress: string, externalActionMetadata: string, feeToken?: string, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
114
|
+
proxySwap(erc20Addresses: string[], deltaAmounts: bigint[], externalActionId: ExternalActionId, swapData: string, walletNonce: bigint, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
115
|
+
multiSendPrivateRecipients(erc20Tokens: ERC20Token[], amounts: bigint[], extendedRecipientInfos?: string[]): Promise<ethers.ContractTransaction>;
|
|
116
|
+
areMerkleTreeUpdatesDisabled(): boolean;
|
|
90
117
|
}
|