@hinkal/common 0.2.13 → 0.2.15
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/getRelayerURL.cjs +1 -1
- package/API/getRelayerURL.mjs +4 -4
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.d.ts +1 -1
- package/API/getServerURL.mjs +14 -12
- 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 +14 -0
- package/API/tenderly.api.mjs +55 -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 +11 -11
- 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 +2 -2
- package/constants/chains.constants.mjs +32 -35
- 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 +10115 -3422
- package/constants/deploy-data/deploy-data-avalanche.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-avalanche.json.mjs +10112 -3415
- package/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-base.json.mjs +9408 -3725
- package/constants/deploy-data/deploy-data-bnbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-bnbMainnet.json.mjs +9893 -3194
- package/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-ethMainnet.json.mjs +6318 -3587
- 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 +10113 -3422
- package/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-polygon.json.mjs +10092 -3423
- 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 +8 -0
- package/constants/protocol.constants.mjs +29 -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 +34 -6
- package/constants/server.constants.mjs +48 -20
- 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 +350 -110
- package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.mjs +334 -100
- package/constants/token-data/avalancheRegistry.json.cjs +1 -1
- package/constants/token-data/avalancheRegistry.json.mjs +236 -68
- package/constants/token-data/avalancheRegistryFixed.json.cjs +1 -1
- package/constants/token-data/avalancheRegistryFixed.json.mjs +236 -68
- package/constants/token-data/baseRegistry.json.cjs +1 -1
- package/constants/token-data/baseRegistry.json.mjs +224 -59
- package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
- package/constants/token-data/baseRegistryFixed.json.mjs +212 -56
- 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 +1017 -344
- package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.mjs +946 -303
- package/constants/token-data/index.cjs +1 -0
- package/constants/token-data/index.d.ts +1496 -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 +530 -155
- package/constants/token-data/polygonRegistryFixed.json.cjs +1 -1
- package/constants/token-data/polygonRegistryFixed.json.mjs +504 -147
- 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 +7 -1
- package/constants/vite.constants.mjs +27 -22
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +48 -20
- package/data-structures/Hinkal/Hinkal.mjs +264 -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 +86 -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 +7 -2
- package/data-structures/merkle-tree/MerkleTree.mjs +85 -70
- 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 +20 -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/getTokenHolder.cjs +1 -0
- package/functions/web3/getTokenHolder.d.ts +1 -0
- package/functions/web3/getTokenHolder.mjs +12 -0
- package/functions/web3/index.d.ts +1 -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 +739 -609
- 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,86 +1,91 @@
|
|
|
1
|
-
import { Mutex as
|
|
2
|
-
import {
|
|
3
|
-
import { getERC20Token as k } from "../../utils/erc20tokenFunctions.mjs";
|
|
1
|
+
import { Mutex as x } from "async-mutex";
|
|
2
|
+
import { getErc20TokensForChain as A, getERC20Token as U } from "../../utils/erc20tokenFunctions.mjs";
|
|
4
3
|
import { caseInsensitiveEqual as g } from "../../utils/caseInsensitive.utils.mjs";
|
|
5
|
-
import { patchRegistry as
|
|
6
|
-
import { Utxo as
|
|
7
|
-
import {
|
|
8
|
-
import { VolatileHelper as b } from "../../../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
9
|
-
import { getAmountWithPrecision as x } from "../etherFunctions.mjs";
|
|
4
|
+
import { patchRegistry as P } from "../../utils/volatile-patcher.utils.mjs";
|
|
5
|
+
import { Utxo as E } from "../../../data-structures/utxo/Utxo.mjs";
|
|
6
|
+
import { getAmountWithPrecision as M } from "../etherFunctions.mjs";
|
|
10
7
|
import { ErrorWithAmount as S } from "../../../error-handling/customErrors/ErrorWithAmount.mjs";
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
import "../../../error-handling/error-codes.constants.mjs";
|
|
9
|
+
import { getInputUtxoAndBalance as v, getInputUtxoAndBalancePerToken as I } from "./getInputUtxoAndBalance.mjs";
|
|
10
|
+
import { privateTokensDB as w } from "../../../data-structures/TokenDBs/PrivateTokensDB.mjs";
|
|
11
|
+
import { isExtension as h } from "../../../constants/vite.constants.mjs";
|
|
12
|
+
import { encodeTokenWithId as B } from "../../utils/encodeTokenWithId.mjs";
|
|
13
|
+
const b = new x(), $ = async (f, n, l, a, i, p = !1, u, c = !1) => b.runExclusive(async () => {
|
|
14
|
+
const { inputUtxos: r } = await v({
|
|
15
|
+
hinkal: f,
|
|
16
|
+
sliceIfMore6: !1,
|
|
17
|
+
chainId: n,
|
|
18
|
+
passedShieldedPrivateKey: l,
|
|
19
|
+
passedShieldedPublicKey: a,
|
|
20
|
+
ethAddress: i,
|
|
21
|
+
resetCacheBefore: p,
|
|
22
|
+
allowRemoteDecryption: u
|
|
23
|
+
});
|
|
24
|
+
c && h && await w.fetchAndUpdatePrivateTokens(
|
|
25
|
+
r.map((e) => e.erc20TokenAddress),
|
|
26
|
+
n,
|
|
27
|
+
i
|
|
28
|
+
);
|
|
29
|
+
const k = h ? await w.getPrivateTokens(n, i) : A(n);
|
|
30
|
+
h || await P(n);
|
|
31
|
+
const d = k.map((e) => ({
|
|
16
32
|
token: e,
|
|
17
|
-
balance:
|
|
18
|
-
const
|
|
19
|
-
return g(
|
|
33
|
+
balance: r.reduce((t, s) => {
|
|
34
|
+
const m = e.erc20TokenAddress;
|
|
35
|
+
return g(m, s.erc20TokenAddress) ? t + s.amount : t;
|
|
20
36
|
}, 0n),
|
|
21
|
-
timestamp:
|
|
37
|
+
timestamp: r.filter(
|
|
22
38
|
(t) => g(t.erc20TokenAddress, e.erc20TokenAddress)
|
|
23
39
|
)[0]?.timeStamp,
|
|
24
|
-
nfts:
|
|
40
|
+
nfts: r.filter(
|
|
25
41
|
(t) => g(t.erc20TokenAddress, e.erc20TokenAddress) && t.tokenId !== 0
|
|
26
42
|
).map((t) => ({ tokenId: t.tokenId, timestamp: t.timeStamp }))
|
|
27
|
-
})),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
...e,
|
|
39
|
-
balance: BigInt(t)
|
|
40
|
-
};
|
|
41
|
-
})
|
|
42
|
-
);
|
|
43
|
-
return n(), u;
|
|
44
|
-
}, X = async (i, n, a, s = 6, c = n.map(() => 0), p = !1) => {
|
|
45
|
-
const { userKeys: u } = i, e = [], t = [];
|
|
43
|
+
})), o = /* @__PURE__ */ new Map();
|
|
44
|
+
return d.forEach((e) => {
|
|
45
|
+
o.set(e.token.erc20TokenAddress.toLowerCase(), e);
|
|
46
|
+
}), o;
|
|
47
|
+
}), j = async (f, n, l, a = 6, i = n.map(() => 0), p = !1) => {
|
|
48
|
+
const { userKeys: u } = f, c = [], r = [], k = await I({
|
|
49
|
+
hinkal: f,
|
|
50
|
+
sliceIfMore6: !1,
|
|
51
|
+
ensuredTokensWithId: n.map((o, e) => ({ erc20TokenAddress: n[e], tokenId: i[e] })),
|
|
52
|
+
allowRemoteDecryption: !1
|
|
53
|
+
});
|
|
46
54
|
let d = 0;
|
|
47
55
|
for (let o = 0; o < n.length; o += 1)
|
|
48
56
|
if (p === !1) {
|
|
49
|
-
const {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
sliceIfMore6: !1
|
|
54
|
-
});
|
|
55
|
-
d = Math.max(r.length, d), t.push(r);
|
|
57
|
+
const e = k.get(B({ erc20TokenAddress: n[o], tokenId: i[o] })) ?? [];
|
|
58
|
+
if (!e)
|
|
59
|
+
throw new Error("Missing utxos for token");
|
|
60
|
+
d = Math.max(e.length, d), r.push(e);
|
|
56
61
|
} else
|
|
57
|
-
|
|
58
|
-
return d === 2 ?
|
|
59
|
-
if (o.length >
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
63
|
-
Please try again with ${
|
|
64
|
-
throw new S(
|
|
62
|
+
r.push([]);
|
|
63
|
+
return d === 2 ? r : (r.forEach((o, e) => {
|
|
64
|
+
if (o.length > a) {
|
|
65
|
+
const t = o.slice(0, a), s = t.reduce((m, T) => m + T.amount, 0n);
|
|
66
|
+
if (l[e] < 0n && s < -l[e]) {
|
|
67
|
+
const m = U(n[e], f.getCurrentChainId()), T = Number(M(s, m, 2)), y = `Unfortunately your transaction did not go through due to UTXOs limitations.
|
|
68
|
+
Please try again with ${m.symbol}`;
|
|
69
|
+
throw new S(T, y);
|
|
65
70
|
}
|
|
66
|
-
|
|
67
|
-
} else if (o.length <=
|
|
68
|
-
const
|
|
69
|
-
let
|
|
70
|
-
for (;
|
|
71
|
-
|
|
72
|
-
new
|
|
71
|
+
c.push(t);
|
|
72
|
+
} else if (o.length <= a) {
|
|
73
|
+
const t = [...o];
|
|
74
|
+
let s = a - o.length;
|
|
75
|
+
for (; s > 0; )
|
|
76
|
+
s -= 1, t.push(
|
|
77
|
+
new E({
|
|
73
78
|
amount: 0n,
|
|
74
|
-
erc20TokenAddress: n[
|
|
79
|
+
erc20TokenAddress: n[e],
|
|
75
80
|
shieldedPrivateKey: u.getShieldedPrivateKey(),
|
|
76
|
-
tokenId:
|
|
81
|
+
tokenId: i[e]
|
|
77
82
|
})
|
|
78
83
|
);
|
|
79
|
-
|
|
84
|
+
c.push(t);
|
|
80
85
|
}
|
|
81
|
-
}),
|
|
86
|
+
}), c);
|
|
82
87
|
};
|
|
83
88
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
j as addPaddingToUtxos,
|
|
90
|
+
$ as getShieldedBalance
|
|
86
91
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../types/circom-data.types.cjs");const r=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 u=async e=>(await e.getContractWithFetcher(r.ContractType.AccessTokenContract).functions.hasToken(e.userKeys.getAccessKey()))[0],C=async(e,s,t)=>{const c=e.getContractWithSigner(r.ContractType.AccessTokenContract),n={value:0n,...t&&{type:0}};return await c.addToken(s,n)},y=async(e,s,t,c)=>{const n=e.getContractWithSigner(r.ContractType.AccessTokenContract),o=t.reduce((k,T)=>k+T.messageFee,0n),a={chains:t,totalMessageFees:o},i={value:o,...c&&{type:0}};return await n.addTokenCrossChain(s,a,i)};exports.checkHinkalAccessToken=u;exports.mintAccessToken=C;exports.mintTokenCrossChain=y;
|
|
@@ -2,5 +2,5 @@ import { ethers } from 'ethers';
|
|
|
2
2
|
import { IHinkal } from '../../../data-structures/Hinkal/IHinkal';
|
|
3
3
|
import { AxelarMigrationInfo, SignatureData } from '../../../types';
|
|
4
4
|
export declare const checkHinkalAccessToken: (hinkal: IHinkal) => Promise<any>;
|
|
5
|
-
export declare const mintAccessToken: (hinkal: IHinkal, signatureData: SignatureData) => Promise<ethers.ContractTransaction>;
|
|
6
|
-
export declare const mintTokenCrossChain: (hinkal: IHinkal, signatureData: SignatureData, axelarMigrationInfos: AxelarMigrationInfo[]) => Promise<ethers.ContractTransaction>;
|
|
5
|
+
export declare const mintAccessToken: (hinkal: IHinkal, signatureData: SignatureData, fromWallet?: boolean) => Promise<ethers.ContractTransaction>;
|
|
6
|
+
export declare const mintTokenCrossChain: (hinkal: IHinkal, signatureData: SignatureData, axelarMigrationInfos: AxelarMigrationInfo[], fromWallet?: boolean) => Promise<ethers.ContractTransaction>;
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { networkRegistry as i } from "../../../constants/chains.constants.mjs";
|
|
2
1
|
import "../../../types/circom-data.types.mjs";
|
|
3
|
-
import { ContractType as
|
|
2
|
+
import { ContractType as a } from "../../../types/ethereum-network.types.mjs";
|
|
3
|
+
import "../../../constants/vite.constants.mjs";
|
|
4
4
|
import "../../../types/transactions.types.mjs";
|
|
5
5
|
import "../../../types/curve.types.mjs";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
value:
|
|
6
|
+
import "../../../types/activities.types.mjs";
|
|
7
|
+
const g = async (t) => (await t.getContractWithFetcher(a.AccessTokenContract).functions.hasToken(t.userKeys.getAccessKey()))[0], x = async (t, s, e) => {
|
|
8
|
+
const c = t.getContractWithSigner(a.AccessTokenContract), n = {
|
|
9
|
+
value: 0n,
|
|
10
|
+
...e && { type: 0 }
|
|
10
11
|
};
|
|
11
|
-
return await
|
|
12
|
-
}, A = async (
|
|
13
|
-
const n =
|
|
14
|
-
(k,
|
|
12
|
+
return await c.addToken(s, n);
|
|
13
|
+
}, A = async (t, s, e, c) => {
|
|
14
|
+
const n = t.getContractWithSigner(a.AccessTokenContract), o = e.reduce(
|
|
15
|
+
(k, T) => k + T.messageFee,
|
|
15
16
|
0n
|
|
16
|
-
),
|
|
17
|
-
chains:
|
|
18
|
-
totalMessageFees:
|
|
19
|
-
},
|
|
20
|
-
value: o
|
|
17
|
+
), r = {
|
|
18
|
+
chains: e,
|
|
19
|
+
totalMessageFees: o
|
|
20
|
+
}, i = {
|
|
21
|
+
value: o,
|
|
22
|
+
...c && { type: 0 }
|
|
21
23
|
};
|
|
22
|
-
return await n.addTokenCrossChain(s,
|
|
24
|
+
return await n.addTokenCrossChain(s, r, i);
|
|
23
25
|
};
|
|
24
26
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
g as checkHinkalAccessToken,
|
|
28
|
+
x as mintAccessToken,
|
|
27
29
|
A as mintTokenCrossChain
|
|
28
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("ethers"),f=require("../../../constants/chains.constants.cjs"),T=require("../../../constants/protocol.constants.cjs"),d=require("../../../types/token.types.cjs"),l=require("../../../types/ethereum-network.types.cjs"),A=async(e,n,s)=>{const t=BigInt(await s.allowance(await s.signer.getAddress(),n.address));return e===t},I=async(e,n,s,t)=>{if(f.getNonLocalhostChainId(e.getCurrentChainId())!==f.chainIds.ethMainnet||s.symbol.toLowerCase()!=="usdt"||BigInt(await t.allowance(await t.signer.getAddress(),n.address))===0n)return;const i=await t.approve(n.address,0n);i&&"hash"in i&&await e.waitForTransaction(i.hash)},b=async(e,n,s,t)=>{const o=e.getContractWithSigner(l.ContractType.ERC20Contract,t.erc20TokenAddress),i=t.approvalType??d.ApprovalType.Classic;if(i===d.ApprovalType.Classic||!e.isPermitterAvailable()){if(await A(s,n,o))return;await I(e,n,t,o);const p=await o.approve(n.address,s);p&&"hash"in p&&await e.waitForTransaction(p.hash);return}const c=await e.getEthereumAddress(),v=e.getContract(l.ContractType.PermitterContract),g=await e.getContractWithFetcher(l.ContractType.ContractWithNonces,t.erc20TokenAddress).nonces(c),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("ethers"),f=require("../../../constants/chains.constants.cjs"),T=require("../../../constants/protocol.constants.cjs"),d=require("../../../types/token.types.cjs"),l=require("../../../types/ethereum-network.types.cjs"),A=async(e,n,s)=>{const t=BigInt(await s.allowance(await s.signer.getAddress(),n.address));return e===t},I=async(e,n,s,t)=>{if(f.getNonLocalhostChainId(e.getCurrentChainId())!==f.chainIds.ethMainnet||s.symbol.toLowerCase()!=="usdt"||BigInt(await t.allowance(await t.signer.getAddress(),n.address))===0n)return;const i=await t.approve(n.address,0n);i&&"hash"in i&&await e.waitForTransaction(i.hash)},b=async(e,n,s,t)=>{const o=e.getContractWithSigner(l.ContractType.ERC20Contract,t.erc20TokenAddress),i=t.approvalType??d.ApprovalType.Classic;if(i===d.ApprovalType.Classic||!e.isPermitterAvailable()){if(await A(s,n,o))return;await I(e,n,t,o);const p=await o.approve(n.address,s,{type:0});p&&"hash"in p&&await e.waitForTransaction(p.hash);return}const c=await e.getEthereumAddress(),v=e.getContract(l.ContractType.PermitterContract),g=await e.getContractWithFetcher(l.ContractType.ContractWithNonces,t.erc20TokenAddress).nonces(c),y=BigInt(Date.now()+T.permitSignatureValidFor)/1000n,r={owner:c,holder:c,spender:v.address,value:s,nonce:g,deadline:y,expiry:y,allowed:!0},{v:u,r:w,s:h}=a.ethers.utils.splitSignature(await e.signTypedData({name:await o.name(),chainId:e.getCurrentChainId(),version:"1",verifyingContract:t.erc20TokenAddress},{Permit:i===d.ApprovalType.ERC20Permit?[{name:"owner",type:"address"},{name:"spender",type:"address"},{name:"value",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]:[{name:"holder",type:"address"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"expiry",type:"uint256"},{name:"allowed",type:"bool"}]},r));if(i===d.ApprovalType.ERC20Permit){const m=new a.ethers.utils.Interface(["function permit(address owner,address spender,uint256 value,uint256 deadline,uint8 v,bytes32 r,bytes32 s) external"]);return a.ethers.utils.arrayify(m.encodeFunctionData("permit",[r.owner,r.spender,r.value,r.deadline,u,a.ethers.utils.arrayify(w),a.ethers.utils.arrayify(h)])).slice(4)}const C=new a.ethers.utils.Interface(["function permit(address holder,address spender,uint256 nonce,uint256 expiry,bool allowed,uint8 v,bytes32 r,bytes32 s) external"]);return a.ethers.utils.arrayify(C.encodeFunctionData("permit",[r.holder,r.spender,r.nonce,r.expiry,r.allowed,u,a.ethers.utils.arrayify(w),a.ethers.utils.arrayify(h)])).slice(4)};exports.approveTokenToHinkal=b;
|
|
@@ -23,22 +23,23 @@ const T = async (e, n, s) => {
|
|
|
23
23
|
await x(e, n, t, o);
|
|
24
24
|
const p = await o.approve(
|
|
25
25
|
n.address,
|
|
26
|
-
s
|
|
26
|
+
s,
|
|
27
27
|
// { gasLimit: 10000000 }
|
|
28
|
+
{ type: 0 }
|
|
28
29
|
);
|
|
29
30
|
p && "hash" in p && await e.waitForTransaction(p.hash);
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
|
-
const c = await e.getEthereumAddress(), g = e.getContract(l.PermitterContract), C = await e.getContractWithFetcher(l.ContractWithNonces, t.erc20TokenAddress).nonces(c),
|
|
33
|
+
const c = await e.getEthereumAddress(), g = e.getContract(l.PermitterContract), C = await e.getContractWithFetcher(l.ContractWithNonces, t.erc20TokenAddress).nonces(c), y = BigInt(Date.now() + A) / 1000n, r = {
|
|
33
34
|
owner: c,
|
|
34
35
|
holder: c,
|
|
35
36
|
spender: g.address,
|
|
36
37
|
value: s,
|
|
37
38
|
nonce: C,
|
|
38
|
-
deadline:
|
|
39
|
-
expiry:
|
|
39
|
+
deadline: y,
|
|
40
|
+
expiry: y,
|
|
40
41
|
allowed: !0
|
|
41
|
-
}, { v:
|
|
42
|
+
}, { v: u, r: m, s: w } = a.utils.splitSignature(
|
|
42
43
|
await e.signTypedData(
|
|
43
44
|
{
|
|
44
45
|
name: await o.name(),
|
|
@@ -104,7 +105,7 @@ const T = async (e, n, s) => {
|
|
|
104
105
|
r.spender,
|
|
105
106
|
r.value,
|
|
106
107
|
r.deadline,
|
|
107
|
-
|
|
108
|
+
u,
|
|
108
109
|
a.utils.arrayify(m),
|
|
109
110
|
a.utils.arrayify(w)
|
|
110
111
|
])
|
|
@@ -120,7 +121,7 @@ const T = async (e, n, s) => {
|
|
|
120
121
|
r.nonce,
|
|
121
122
|
r.expiry,
|
|
122
123
|
r.allowed,
|
|
123
|
-
|
|
124
|
+
u,
|
|
124
125
|
a.utils.arrayify(m),
|
|
125
126
|
a.utils.arrayify(w)
|
|
126
127
|
])
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../constants/protocol.constants.cjs"),i=require("./approveToken.cjs"),p=async(t,s,c,o)=>{for(let e=0;e<o.length;e+=1){const n=o[e],r=c[e];n>0n&&r.erc20TokenAddress!==a.zeroAddress&&await i.approveTokenToHinkal(t,s,n,r)}};exports.approveTokensToHinkal=p;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
2
|
+
import { IHinkal } from '../../../data-structures/Hinkal/IHinkal';
|
|
3
|
+
import { ERC20Token } from '../../../types/token.types';
|
|
4
|
+
export declare const approveTokensToHinkal: (hinkal: IHinkal, contractForApproval: ethers.Contract, tokensToApprove: ERC20Token[], amounts: bigint[]) => Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { zeroAddress as i } from "../../../constants/protocol.constants.mjs";
|
|
2
|
+
import { approveTokenToHinkal as p } from "./approveToken.mjs";
|
|
3
|
+
const T = async (t, s, c, r) => {
|
|
4
|
+
for (let o = 0; o < r.length; o += 1) {
|
|
5
|
+
const e = r[o], n = c[o];
|
|
6
|
+
e > 0n && n.erc20TokenAddress !== i && await p(t, s, e, n);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
T as approveTokensToHinkal
|
|
11
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../types/ethereum-network.types.cjs"),a=async(n,t,s,e)=>{const o=n.getContractWithFetcher(i.ContractType.HinkalContract),r="transact",c=await o.populateTransaction[r](t[0],t[1],t[2],s,e);return console.log(c),(await o.estimateGas[r](t[0],t[1],t[2],s,e,{from:e.relay})).toBigInt()};exports.estimateGasRelayer=a;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IHinkal } from '../../../data-structures/Hinkal/IHinkal';
|
|
2
|
-
import {
|
|
2
|
+
import { CircomDataBaseType, DimDataType } from '../../../types/circom-data.types';
|
|
3
3
|
import { NewZkCallDataType } from '../../../types/snark.types';
|
|
4
|
-
export declare const estimateGasRelayer: (hinkal: IHinkal, newZkCallData: NewZkCallDataType, dimData: DimDataType, circomData:
|
|
4
|
+
export declare const estimateGasRelayer: (hinkal: IHinkal, newZkCallData: NewZkCallDataType, dimData: DimDataType, circomData: CircomDataBaseType) => Promise<bigint>;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { ContractType as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
return (await r.estimateGas[s](
|
|
1
|
+
import { ContractType as i } from "../../../types/ethereum-network.types.mjs";
|
|
2
|
+
const g = async (e, t, s, o) => {
|
|
3
|
+
const n = e.getContractWithFetcher(i.HinkalContract), r = "transact", c = await n.populateTransaction[r](
|
|
5
4
|
t[0],
|
|
6
5
|
t[1],
|
|
7
6
|
t[2],
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
s,
|
|
8
|
+
o
|
|
9
|
+
);
|
|
10
|
+
return console.log(c), (await n.estimateGas[r](
|
|
11
|
+
t[0],
|
|
12
|
+
t[1],
|
|
13
|
+
t[2],
|
|
14
|
+
s,
|
|
15
|
+
o,
|
|
16
|
+
{ from: o.relay }
|
|
11
17
|
)).toBigInt();
|
|
12
18
|
};
|
|
13
19
|
export {
|
|
14
|
-
|
|
20
|
+
g as estimateGasRelayer
|
|
15
21
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../types/ethereum-network.types.cjs"),s=async(n,o)=>{const r=await n.getContractWithFetcher(a.ContractType.HinkalContract).callStatic.getInteractionApprovals(o);if(!r)throw Error("getInteractionApprovals fail: no approved utxos fetched");return r.map(t=>{const c=t;return{amount:c.amount.toBigInt(),inHinkalAddress:c.inHinkalAddress.toBigInt(),tokenAddress:c.tokenAddress}})},l=async(n,o,e)=>{const r=n.getContractWithFetcher(a.ContractType.HinkalContract),t=await n.getContractWithFetcher(a.ContractType.ERC20Contract,o).callStatic.allowance(r.address,e);if(t===void 0)throw Error("checkExistingApprovalFromHinkal Error, no allowance fetched");return t.toBigInt()},p=async(n,o,e,r)=>{const t=await n.getContractWithFetcher(a.ContractType.HinkalContract).callStatic.getBufferEntry(o,e,r);if(t===void 0)throw Error("getBufferEntry Fail: No amount fatched");return t.toBigInt()};exports.checkExistingApprovalFromHinkal=l;exports.getBufferEntry=p;exports.getInteractionApprovals=s;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type IHinkal } from '../../../data-structures/Hinkal/IHinkal';
|
|
2
|
+
import { type ApprovedUtxo } from '../../../types';
|
|
3
|
+
export declare const getInteractionApprovals: (hinkal: IHinkal, interactionAddress: string) => Promise<ApprovedUtxo[]>;
|
|
4
|
+
export declare const checkExistingApprovalFromHinkal: (hinkal: IHinkal, erc20Address: string, interactionAddress: string) => Promise<bigint>;
|
|
5
|
+
export declare const getBufferEntry: (hinkal: IHinkal, approveTo: string, tokenAddress: string, inHinkalAddress: bigint) => Promise<bigint>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ContractType as e } from "../../../types/ethereum-network.types.mjs";
|
|
2
|
+
const l = async (n, r) => {
|
|
3
|
+
const o = await n.getContractWithFetcher(e.HinkalContract).callStatic.getInteractionApprovals(r);
|
|
4
|
+
if (!o)
|
|
5
|
+
throw Error("getInteractionApprovals fail: no approved utxos fetched");
|
|
6
|
+
return o.map((t) => {
|
|
7
|
+
const c = t;
|
|
8
|
+
return {
|
|
9
|
+
amount: c.amount.toBigInt(),
|
|
10
|
+
inHinkalAddress: c.inHinkalAddress.toBigInt(),
|
|
11
|
+
tokenAddress: c.tokenAddress
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}, p = async (n, r, a) => {
|
|
15
|
+
const o = n.getContractWithFetcher(e.HinkalContract), t = await n.getContractWithFetcher(e.ERC20Contract, r).callStatic.allowance(
|
|
16
|
+
o.address,
|
|
17
|
+
a
|
|
18
|
+
);
|
|
19
|
+
if (t === void 0)
|
|
20
|
+
throw Error("checkExistingApprovalFromHinkal Error, no allowance fetched");
|
|
21
|
+
return t.toBigInt();
|
|
22
|
+
}, h = async (n, r, a, o) => {
|
|
23
|
+
const t = await n.getContractWithFetcher(e.HinkalContract).callStatic.getBufferEntry(r, a, o);
|
|
24
|
+
if (t === void 0)
|
|
25
|
+
throw Error("getBufferEntry Fail: No amount fatched");
|
|
26
|
+
return t.toBigInt();
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
p as checkExistingApprovalFromHinkal,
|
|
30
|
+
h as getBufferEntry,
|
|
31
|
+
l as getInteractionApprovals
|
|
32
|
+
};
|
|
@@ -1,17 +1,3 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
|
-
export interface RelayEntryData {
|
|
3
|
-
relayAddress: string;
|
|
4
|
-
url: string;
|
|
5
|
-
priority: number;
|
|
6
|
-
}
|
|
7
|
-
export interface RelayEntryWithIndex extends RelayEntryData {
|
|
8
|
-
lowerIndex: number;
|
|
9
|
-
}
|
|
10
2
|
export declare const getRelayPercentage: (contract: ethers.Contract) => Promise<bigint>;
|
|
11
|
-
export declare const
|
|
12
|
-
lowerIndex: number;
|
|
13
|
-
relayAddress: string;
|
|
14
|
-
url: string;
|
|
15
|
-
priority: number;
|
|
16
|
-
};
|
|
17
|
-
export declare const getRelay: (hinkalHelperContract: ethers.Contract) => Promise<RelayEntryWithIndex>;
|
|
3
|
+
export declare const getRelay: (hinkalHelperContract: ethers.Contract) => Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../../../constants/protocol.constants.cjs"),x=require("../../../types/ethereum-network.types.cjs"),I=require("../../utils/time.utils.cjs"),f=require("./approveTokensToHinkal.cjs"),q=async(e,o,s,n,p,w,y,A)=>{const a=Array.isArray(o)?o:[o],i=Array.isArray(s)?s:[s];if(a.length!==i.length)throw new Error("token and amount length mismatch");const d=e.getContractWithSigner(x.ContractType.HinkalContract),v=await e.getEthereumAddress(),C=y??d,r=A??d,l="transact";await f.approveTokensToHinkal(e,C,i,a);const g=i.findIndex(({erc20TokenAddress:c})=>c===T.zeroAddress),h=g===-1?0n:a[g],u={value:h>0n?BigInt(h).toString():void 0};let t;const m=[n[0],n[1],n[2],w,p,{...u,from:v,type:0}];try{t=(await r.estimateGas[l](...m)).toNumber(),console.log({gasCosts:t}),console.log({signerAddress:await r.signer.getAddress(),chainIdHinkal:e.getCurrentChainId(),ethersNetwork:await r.provider.getNetwork()})}catch(c){console.log("hinkalDeposit: gas estimation error",{err:c})}const k=t&&t>=0?Math.ceil(t*12/10):void 0;return u.gasLimit=k,await I.waitLittle(),await r[l](...m)};exports.transactCallDirect=q;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
2
|
import { IHinkal } from '../../../data-structures/Hinkal/IHinkal';
|
|
3
|
-
import {
|
|
3
|
+
import { CircomDataBaseType, DimDataType } from '../../../types/circom-data.types';
|
|
4
4
|
import { ERC20Token } from '../../../types/token.types';
|
|
5
5
|
import { NewZkCallDataType } from '../../../types/snark.types';
|
|
6
|
-
export declare const transactCallDirect: (hinkal: IHinkal, amount: bigint, tokenToApprove: ERC20Token, newZkCallData: NewZkCallDataType, circomData:
|
|
6
|
+
export declare const transactCallDirect: (hinkal: IHinkal, amount: bigint | bigint[], tokenToApprove: ERC20Token | ERC20Token[], newZkCallData: NewZkCallDataType, circomData: CircomDataBaseType, dimData: DimDataType, contractApproval?: ethers.Contract, contractTransaction?: ethers.Contract) => Promise<any>;
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { zeroAddress as
|
|
2
|
-
import { ContractType as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
const a =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { zeroAddress as x } from "../../../constants/protocol.constants.mjs";
|
|
2
|
+
import { ContractType as I } from "../../../types/ethereum-network.types.mjs";
|
|
3
|
+
import { waitLittle as k } from "../../utils/time.utils.mjs";
|
|
4
|
+
import { approveTokensToHinkal as H } from "./approveTokensToHinkal.mjs";
|
|
5
|
+
const L = async (r, e, s, n, w, A, y, f) => {
|
|
6
|
+
const a = Array.isArray(e) ? e : [e], i = Array.isArray(s) ? s : [s];
|
|
7
|
+
if (a.length !== i.length)
|
|
8
|
+
throw new Error("token and amount length mismatch");
|
|
9
|
+
const d = r.getContractWithSigner(I.HinkalContract), u = await r.getEthereumAddress(), v = y ?? d, o = f ?? d, g = "transact";
|
|
10
|
+
await H(r, v, i, a);
|
|
11
|
+
const m = i.findIndex(({ erc20TokenAddress: c }) => c === x), l = m === -1 ? 0n : a[m], h = {
|
|
12
|
+
value: l > 0n ? BigInt(l).toString() : void 0
|
|
10
13
|
};
|
|
11
|
-
let
|
|
14
|
+
let t;
|
|
15
|
+
const p = [
|
|
16
|
+
n[0],
|
|
17
|
+
n[1],
|
|
18
|
+
n[2],
|
|
19
|
+
A,
|
|
20
|
+
w,
|
|
21
|
+
{ ...h, from: u, type: 0 }
|
|
22
|
+
];
|
|
12
23
|
try {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
)).toNumber();
|
|
21
|
-
} catch (A) {
|
|
22
|
-
console.log("hinkalDeposit: gas estimation error: ", { err: A });
|
|
24
|
+
t = (await o.estimateGas[g](...p)).toNumber(), console.log({ gasCosts: t }), console.log({
|
|
25
|
+
signerAddress: await o.signer.getAddress(),
|
|
26
|
+
chainIdHinkal: r.getCurrentChainId(),
|
|
27
|
+
ethersNetwork: await o.provider.getNetwork()
|
|
28
|
+
});
|
|
29
|
+
} catch (c) {
|
|
30
|
+
console.log("hinkalDeposit: gas estimation error", { err: c });
|
|
23
31
|
}
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
t[0],
|
|
27
|
-
t[1],
|
|
28
|
-
t[2],
|
|
29
|
-
n,
|
|
30
|
-
c,
|
|
31
|
-
i
|
|
32
|
-
);
|
|
32
|
+
const C = t && t >= 0 ? Math.ceil(t * 12 / 10) : void 0;
|
|
33
|
+
return h.gasLimit = C, await k(), await o[g](...p);
|
|
33
34
|
};
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
L as transactCallDirect
|
|
36
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../API/callRelayer.cjs");require("../../../constants/chains.constants.cjs");require("ethers");require("circomlibjs-hinkal-fork");require("../../../error-handling/error-codes.constants.cjs");require("../../../data-structures/crypto-keys/keys.cjs");require("../../../constants/vite.constants.cjs");const o=require("../../snarkjs/common.snarkjs.cjs");require("../../../types/circom-data.types.cjs");require("../../utils/external-action.utils.cjs");require("axios");require("node-forge");require("libsodium-wrappers");require("../../../constants/contracts.constants.cjs");require("idb-keyval");require("../../../constants/token-data/index.cjs");require("../../utils/convertIntegrationProviderToExternalActionId.cjs");require("../../../types/transactions.types.cjs");require("../../../types/curve.types.cjs");require("../../../types/activities.types.cjs");require("process");require("buffer");require("../../../constants/reorg-depths.constants.cjs");require("../../../constants/kyc.constants.cjs");require("../../../constants/coingecko.constants.cjs");require("../../../constants/axelar.constants.cjs");require("../../../constants/rewards.constants.cjs");require("../../../constants/addresses.constants.cjs");require("../../../constants/token.limits.constants.cjs");require("../../utils/userAgent.cjs");require("../../../data-structures/volatile-helper/VolatileHelper.cjs");const n=async(i,r,u,q,a,s)=>{const c=o.serializeCircomData(q),e=await t.callRelayerTransactAPI(i,{a:r[0],b:r[1],c:r[2],dimData:u,circomData:c,withPrivateMempool:a,withUniswapWorkAround:s});if(e.status==="success")return e.message;throw new Error(e.error)};exports.transactCallRelayer=n;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CircomDataBaseType, DimDataType, NewZkCallDataType, RelayerTransaction } from '../../../types';
|
|
2
2
|
export interface RelayerResponseInterface {
|
|
3
3
|
status: string;
|
|
4
4
|
message: RelayerTransaction;
|
|
5
5
|
error?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const transactCallRelayer: (chainId: number, newZkCallData: NewZkCallDataType, dimData: DimDataType, circomData:
|
|
7
|
+
export declare const transactCallRelayer: (chainId: number, newZkCallData: NewZkCallDataType, dimData: DimDataType, circomData: CircomDataBaseType, withPrivateMempool?: boolean, withUniswapWorkAround?: boolean) => Promise<RelayerTransaction>;
|
|
@@ -1,25 +1,48 @@
|
|
|
1
|
-
import { callRelayerTransactAPI as
|
|
1
|
+
import { callRelayerTransactAPI as c } from "../../../API/callRelayer.mjs";
|
|
2
2
|
import "../../../constants/chains.constants.mjs";
|
|
3
3
|
import "ethers";
|
|
4
4
|
import "circomlibjs-hinkal-fork";
|
|
5
|
-
import "
|
|
5
|
+
import "../../../error-handling/error-codes.constants.mjs";
|
|
6
|
+
import "../../../data-structures/crypto-keys/keys.mjs";
|
|
6
7
|
import "../../../constants/vite.constants.mjs";
|
|
7
|
-
import { serializeCircomData as
|
|
8
|
+
import { serializeCircomData as e } from "../../snarkjs/common.snarkjs.mjs";
|
|
8
9
|
import "../../../types/circom-data.types.mjs";
|
|
9
10
|
import "../../utils/external-action.utils.mjs";
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
import "axios";
|
|
12
|
+
import "node-forge";
|
|
13
|
+
import "libsodium-wrappers";
|
|
14
|
+
import "../../../constants/contracts.constants.mjs";
|
|
15
|
+
import "idb-keyval";
|
|
16
|
+
import "../../../constants/token-data/index.mjs";
|
|
17
|
+
import "../../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
18
|
+
import "../../../types/transactions.types.mjs";
|
|
19
|
+
import "../../../types/curve.types.mjs";
|
|
20
|
+
import "../../../types/activities.types.mjs";
|
|
21
|
+
import "process";
|
|
22
|
+
import "buffer";
|
|
23
|
+
import "../../../constants/reorg-depths.constants.mjs";
|
|
24
|
+
import "../../../constants/kyc.constants.mjs";
|
|
25
|
+
import "../../../constants/coingecko.constants.mjs";
|
|
26
|
+
import "../../../constants/axelar.constants.mjs";
|
|
27
|
+
import "../../../constants/rewards.constants.mjs";
|
|
28
|
+
import "../../../constants/addresses.constants.mjs";
|
|
29
|
+
import "../../../constants/token.limits.constants.mjs";
|
|
30
|
+
import "../../utils/userAgent.mjs";
|
|
31
|
+
import "../../../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
32
|
+
const N = async (t, r, i, m, p, s) => {
|
|
33
|
+
const a = e(m), o = await c(t, {
|
|
12
34
|
a: r[0],
|
|
13
35
|
b: r[1],
|
|
14
36
|
c: r[2],
|
|
15
|
-
dimData:
|
|
16
|
-
circomData:
|
|
17
|
-
withPrivateMempool:
|
|
37
|
+
dimData: i,
|
|
38
|
+
circomData: a,
|
|
39
|
+
withPrivateMempool: p,
|
|
40
|
+
withUniswapWorkAround: s
|
|
18
41
|
});
|
|
19
42
|
if (o.status === "success")
|
|
20
43
|
return o.message;
|
|
21
44
|
throw new Error(o.error);
|
|
22
45
|
};
|
|
23
46
|
export {
|
|
24
|
-
|
|
47
|
+
N as transactCallRelayer
|
|
25
48
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../constants/contracts.constants.cjs"),a=require("../../constants/chains.constants.cjs"),g=require("../../error-handling/error-codes.constants.cjs"),c=require("ethers"),s=(t,o)=>{const r=a.networkRegistry[o];if(!r)throw new Error(g.transactionErrorCodes.UNSUPPORTED_NETWORK);const e=d.contractMetadataMapping[t];if(!e)throw new Error(`Unsupported contractType: ${t}`);return e(r.contractData)},i=(t,o,r)=>{const e=s(t,o);if(!e.abi)throw new Error(`No ABI configured for contractType: ${t}`);if(e.address&&r)throw new Error(`Overriding address is not supported for contractType: ${t}`);const n=e.address??r;if(!n)throw new Error(`No contractAddress configured for contractType: ${t}`);return new c.ethers.Contract(n,e.abi)},h=(t,o,r=void 0)=>i(o,t,r).connect(new c.ethers.providers.StaticJsonRpcProvider(a.networkRegistry[t].fetchRpcUrl));exports.getContract=i;exports.getContractMetadata=s;exports.getContractWithFetcherByChainId=h;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ContractMetadata, ContractType } from '../../types/ethereum-network.types';
|
|
2
|
+
import { ethers } from 'ethers';
|
|
3
|
+
export declare const getContractMetadata: (contractType: ContractType, chainId: number) => ContractMetadata;
|
|
4
|
+
export declare const getContract: (contractType: ContractType, chainId: number, contractAddress?: string) => ethers.Contract;
|
|
5
|
+
export declare const getContractWithFetcherByChainId: (chainId: number, contractType: ContractType, contractAddress?: undefined) => ethers.Contract;
|