@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,58 +1,81 @@
|
|
|
1
|
-
import { ContractType as
|
|
2
|
-
import { serializeDecodedTxs as
|
|
3
|
-
import { set as
|
|
4
|
-
const
|
|
1
|
+
import { ContractType as l } from "../../types/ethereum-network.types.mjs";
|
|
2
|
+
import { serializeDecodedTxs as p, deserializeDecodedTxs as f } from "./getDataFromTransaction.mjs";
|
|
3
|
+
import { set as m, get as x } from "idb-keyval";
|
|
4
|
+
const H = {
|
|
5
5
|
encryptedOutputs: [],
|
|
6
6
|
lastOutput: ""
|
|
7
|
-
},
|
|
8
|
-
const s =
|
|
7
|
+
}, o = (e, t) => {
|
|
8
|
+
const s = e.substring(0, 25), r = t.substring(0, 25);
|
|
9
9
|
return { shortPublicKey: s, shortHinkalAddress: r };
|
|
10
|
-
},
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
10
|
+
}, k = (e, t, s) => `hinkalCache-${e}-${t}-${s}`, w = (e, t, s) => {
|
|
11
|
+
const r = e.getContract(l.HinkalContract).address;
|
|
12
|
+
if (!t || !s || !r)
|
|
13
13
|
throw Error("GetHinkalCache: incorrect arguments");
|
|
14
|
-
const { shortPublicKey:
|
|
14
|
+
const { shortPublicKey: n, shortHinkalAddress: c } = o(s, r);
|
|
15
15
|
return JSON.parse(
|
|
16
|
-
|
|
16
|
+
e.cacheDevice.get(k(t, n, c)) ?? JSON.stringify(H)
|
|
17
17
|
);
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
if (!s || !
|
|
18
|
+
}, A = (e, t, s, r) => {
|
|
19
|
+
const n = t.getContract(l.HinkalContract).address;
|
|
20
|
+
if (!s || !r || !n)
|
|
21
21
|
throw Error("SetHinkalCache: incorrect arguments");
|
|
22
|
-
const { shortPublicKey:
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
if (!
|
|
22
|
+
const { shortPublicKey: c, shortHinkalAddress: a } = o(r, n);
|
|
23
|
+
t.cacheDevice.set(k(s, c, a), JSON.stringify(e));
|
|
24
|
+
}, J = (e, t, s) => {
|
|
25
|
+
A(H, e, t, s);
|
|
26
|
+
}, u = (e, t, s) => `txsCache-${e}-${t}-${s}`, N = async (e, t, s, r, n, c) => {
|
|
27
|
+
if (!t || !s || !r)
|
|
28
28
|
throw Error("saveTxsCache: incorrect arguments");
|
|
29
|
-
const { shortPublicKey:
|
|
29
|
+
const { shortPublicKey: a, shortHinkalAddress: i } = o(s, r), g = p(e), h = u(t, a, i), C = JSON.stringify({ serializedTxs: g, lastHash: n });
|
|
30
30
|
try {
|
|
31
|
-
await
|
|
31
|
+
await m(h, C);
|
|
32
32
|
} catch {
|
|
33
|
-
|
|
33
|
+
c.cacheDevice.set(h, C);
|
|
34
34
|
}
|
|
35
|
-
},
|
|
36
|
-
if (!
|
|
35
|
+
}, S = { serializedTxs: [], lastHash: "" }, $ = async (e, t, s, r) => {
|
|
36
|
+
if (!e || !t || !s)
|
|
37
37
|
throw Error("loadTxsCache: incorrect arguments");
|
|
38
|
-
const { shortPublicKey:
|
|
39
|
-
let
|
|
38
|
+
const { shortPublicKey: n, shortHinkalAddress: c } = o(t, s), a = u(e, n, c);
|
|
39
|
+
let i;
|
|
40
40
|
try {
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
41
|
+
const d = await x(a);
|
|
42
|
+
if (!d)
|
|
43
43
|
throw new Error("Empty indexedDB cache");
|
|
44
|
-
|
|
44
|
+
i = d;
|
|
45
45
|
} catch {
|
|
46
|
-
|
|
46
|
+
i = r.cacheDevice.get(a);
|
|
47
47
|
}
|
|
48
|
-
const { serializedTxs:
|
|
49
|
-
return { decodedTxs:
|
|
48
|
+
const { serializedTxs: g, lastHash: h } = JSON.parse(i ?? JSON.stringify(S));
|
|
49
|
+
return { decodedTxs: g.map((d) => f(d)), lastHash: h === "" ? void 0 : h };
|
|
50
|
+
}, y = (e, t, s) => `hinkalApprovalsCache-${e}-${t}-${s}`, T = (e, t, s, r) => {
|
|
51
|
+
const n = t.getContract(l.HinkalContract, void 0, s).address;
|
|
52
|
+
if (!s || !r || !n)
|
|
53
|
+
throw Error("SetHinkalCache: incorrect arguments");
|
|
54
|
+
const { shortPublicKey: c, shortHinkalAddress: a } = o(r, n);
|
|
55
|
+
t.cacheDevice.set(
|
|
56
|
+
y(s, c, a),
|
|
57
|
+
JSON.stringify(e)
|
|
58
|
+
);
|
|
59
|
+
}, E = (e, t, s) => {
|
|
60
|
+
const r = e.getContract(l.HinkalContract, void 0, t).address;
|
|
61
|
+
if (!t || !s || !r)
|
|
62
|
+
throw Error("GetHinkalCache: incorrect arguments");
|
|
63
|
+
const { shortPublicKey: n, shortHinkalAddress: c } = o(s, r);
|
|
64
|
+
return JSON.parse(
|
|
65
|
+
e.cacheDevice.get(y(t, n, c)) ?? JSON.stringify(H)
|
|
66
|
+
);
|
|
67
|
+
}, z = (e, t, s) => {
|
|
68
|
+
T({}, e, t, s);
|
|
50
69
|
};
|
|
51
70
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
71
|
+
k as getFilePath,
|
|
72
|
+
w as getHinkalCache,
|
|
73
|
+
E as getInHinkalAddressesCache,
|
|
74
|
+
y as getInHinkalAddressesFilePath,
|
|
75
|
+
$ as loadTxsCache,
|
|
76
|
+
J as resetCache,
|
|
77
|
+
z as resetInHinkalAddressesCache,
|
|
78
|
+
N as saveTxsCache,
|
|
79
|
+
A as setHinkalCache,
|
|
80
|
+
T as setInHinkalAddressesCache
|
|
58
81
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("ethers"),p=(o,l,s)=>{const e=t.ethers.utils.arrayify(o),n=e.slice(0,20),a=e.slice(20,21),c=e.slice(21,37),i=e.slice(37),[r,u,y,v]=[n,c,a,i].map(m=>t.ethers.utils.hexlify(m));return{from:BigInt(y)>0?l:s,to:r,value:BigInt(u),calldata:v}};exports.convertEmporiumOpToCallInfo=p;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ethers as e } from "ethers";
|
|
2
|
+
const v = (l, o, s) => {
|
|
3
|
+
const t = e.utils.arrayify(l), a = t.slice(0, 20), c = t.slice(20, 21), i = t.slice(21, 37), n = t.slice(37), [r, y, u, B] = [a, i, c, n].map(
|
|
4
|
+
(m) => e.utils.hexlify(m)
|
|
5
|
+
);
|
|
6
|
+
return { from: BigInt(u) > 0 ? o : s, to: r, value: BigInt(y), calldata: B };
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
v as convertEmporiumOpToCallInfo
|
|
10
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../types/hinkal.types.cjs"),e=require("../../types/external-action.types.cjs"),r={[n.IntegrationProvider.UNISWAP]:e.ExternalActionId.Uniswap,[n.IntegrationProvider.ODOS]:e.ExternalActionId.Odos,[n.IntegrationProvider.ONEINCH]:e.ExternalActionId.OneInch,[n.IntegrationProvider.PENDLE]:e.ExternalActionId.Pendle,[n.IntegrationProvider.ALL]:void 0,[n.IntegrationProvider.NONE]:void 0},o=t=>r[t];exports.convertIntegrationProviderToExternalActionId=o;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IntegrationProvider } from '../../types/hinkal.types';
|
|
2
|
+
import { ExternalActionId } from '../../types/external-action.types';
|
|
2
3
|
export declare const convertIntegrationProviderToExternalActionId: (integrationProvider: IntegrationProvider) => ExternalActionId | undefined;
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import "../../types/circom-data.types.mjs";
|
|
2
|
-
import { ExternalActionId as r } from "../../types/external-action.types.mjs";
|
|
3
1
|
import { IntegrationProvider as o } from "../../types/hinkal.types.mjs";
|
|
4
|
-
import "../../types/
|
|
5
|
-
import "../../types/curve.types.mjs";
|
|
2
|
+
import { ExternalActionId as n } from "../../types/external-action.types.mjs";
|
|
6
3
|
const t = {
|
|
7
|
-
[o.UNISWAP]:
|
|
8
|
-
[o.ODOS]:
|
|
9
|
-
[o.ONEINCH]:
|
|
10
|
-
[o.PENDLE]:
|
|
4
|
+
[o.UNISWAP]: n.Uniswap,
|
|
5
|
+
[o.ODOS]: n.Odos,
|
|
6
|
+
[o.ONEINCH]: n.OneInch,
|
|
7
|
+
[o.PENDLE]: n.Pendle,
|
|
11
8
|
[o.ALL]: void 0,
|
|
12
9
|
[o.NONE]: void 0
|
|
13
|
-
},
|
|
10
|
+
}, d = (r) => t[r];
|
|
14
11
|
export {
|
|
15
|
-
|
|
12
|
+
d as convertIntegrationProviderToExternalActionId
|
|
16
13
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=e=>`${e.erc20TokenAddress.toLowerCase()}-${e.tokenId}`;exports.encodeTokenWithId=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("axios"),m=require("node-forge"),h=require("../snarkjs/constant.cjs"),i=require("ethers"),o=require("libsodium-wrappers");function b(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const c=b(m),f=214,y=async()=>{const t=(await l.get(`${h.ENCLAVE_EC2_URL}/handshake`)).data.public_key,n=c.util.decode64(t),r=c.asn1.fromDer(n);return c.pki.publicKeyFromAsn1(r)},a=e=>typeof e=="bigint"||typeof e=="number"?e.toString():e,p=e=>c.util.hexToBytes(e.replace("0x","")),E=e=>{const t=structuredClone(e);return Object.entries(t).forEach(([n,r])=>{t[n]=a(r),Array.isArray(r)&&(Array.isArray(r[0])?t[n]=r.map(s=>s.map(a)):t[n]=r.map(a))}),t},k=(e,t)=>{const n=i.ethers.utils.hexlify(t).slice(2),r=p(n);if(r.length>f)throw new Error("too many bytes passed to assymetric_encrypt");const s=e.encrypt(r,"RSA-OAEP",{md:c.md.sha1.create(),mgf1:{md:c.md.sha1.create()},label:null});return c.util.encode64(s)},A=(e,t)=>{const n=o.randombytes_buf(o.crypto_secretbox_NONCEBYTES),r=o.crypto_secretbox_easy(t,n,e),s=i.ethers.utils.hexlify(n)+i.ethers.utils.hexlify(r).slice(2),d=p(s);return c.util.encode64(d)},u=(e,t)=>{const n=o.randombytes_buf(o.crypto_secretbox_KEYBYTES),r=k(t,n),s=A(n,e);return{keyCiphertext:r,inputCiphertext:s}},x=(e,t)=>{const n=E(e),r=JSON.stringify(n),s=new TextEncoder().encode(r);return u(s,t)},g=async e=>{const t=await y();return x(e,t)},_=async e=>{const t=await y();return u(e,t)};exports.makeEnclaveHandshakeAndEncryptInput=g;exports.makeEnclaveHandshakeAndEncryptUint8Array=_;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const makeEnclaveHandshakeAndEncryptInput: (input: any) => Promise<{
|
|
2
|
+
keyCiphertext: string;
|
|
3
|
+
inputCiphertext: string;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const makeEnclaveHandshakeAndEncryptUint8Array: (inputUint8Array: Uint8Array) => Promise<{
|
|
6
|
+
keyCiphertext: string;
|
|
7
|
+
inputCiphertext: string;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import u from "axios";
|
|
2
|
+
import * as o from "node-forge";
|
|
3
|
+
import { ENCLAVE_EC2_URL as h } from "../snarkjs/constant.mjs";
|
|
4
|
+
import { ethers as a } from "ethers";
|
|
5
|
+
import c from "libsodium-wrappers";
|
|
6
|
+
const l = 214, p = async () => {
|
|
7
|
+
const e = (await u.get(`${h}/handshake`)).data.public_key, r = o.util.decode64(e), n = o.asn1.fromDer(r);
|
|
8
|
+
return o.pki.publicKeyFromAsn1(n);
|
|
9
|
+
}, i = (t) => typeof t == "bigint" || typeof t == "number" ? t.toString() : t, y = (t) => o.util.hexToBytes(t.replace("0x", "")), f = (t) => {
|
|
10
|
+
const e = structuredClone(t);
|
|
11
|
+
return Object.entries(e).forEach(([r, n]) => {
|
|
12
|
+
e[r] = i(n), Array.isArray(n) && (Array.isArray(n[0]) ? e[r] = n.map((s) => s.map(i)) : e[r] = n.map(i));
|
|
13
|
+
}), e;
|
|
14
|
+
}, E = (t, e) => {
|
|
15
|
+
const r = a.utils.hexlify(e).slice(2), n = y(r);
|
|
16
|
+
if (n.length > l)
|
|
17
|
+
throw new Error("too many bytes passed to assymetric_encrypt");
|
|
18
|
+
const s = t.encrypt(n, "RSA-OAEP", {
|
|
19
|
+
md: o.md.sha1.create(),
|
|
20
|
+
mgf1: { md: o.md.sha1.create() },
|
|
21
|
+
label: null
|
|
22
|
+
});
|
|
23
|
+
return o.util.encode64(s);
|
|
24
|
+
}, b = (t, e) => {
|
|
25
|
+
const r = c.randombytes_buf(c.crypto_secretbox_NONCEBYTES), n = c.crypto_secretbox_easy(e, r, t), s = a.utils.hexlify(r) + a.utils.hexlify(n).slice(2), d = y(s);
|
|
26
|
+
return o.util.encode64(d);
|
|
27
|
+
}, m = (t, e) => {
|
|
28
|
+
const r = c.randombytes_buf(c.crypto_secretbox_KEYBYTES), n = E(e, r), s = b(r, t);
|
|
29
|
+
return { keyCiphertext: n, inputCiphertext: s };
|
|
30
|
+
}, x = (t, e) => {
|
|
31
|
+
const r = f(t), n = JSON.stringify(r), s = new TextEncoder().encode(n);
|
|
32
|
+
return m(s, e);
|
|
33
|
+
}, S = async (t) => {
|
|
34
|
+
const e = await p();
|
|
35
|
+
return x(t, e);
|
|
36
|
+
}, g = async (t) => {
|
|
37
|
+
const e = await p();
|
|
38
|
+
return m(t, e);
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
S as makeEnclaveHandshakeAndEncryptInput,
|
|
42
|
+
g as makeEnclaveHandshakeAndEncryptUint8Array
|
|
43
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../constants/token-data/index.cjs");const g=require("../../data-structures/custom-token-registry/CustomTokenRegistry.cjs"),c=require("../web3/etherFunctions.cjs"),T=require("./amounts.utils.cjs"),i=require("../../constants/token-data/ERC20Registry.cjs"),s=e=>{const t=i.getERC20Registry(e),o=g.customTokenRegistry.getCustomTokens(e);return[...t,...o]},k=(e,t,o)=>(o??s(t))?.find(n=>e===void 0?!1:n.erc20TokenAddress.toLowerCase()===e.toLowerCase()),C=(e,t)=>s(t)?.find(o=>e===void 0?!1:o.symbol.toLowerCase()===e.toLowerCase()),a=(e,t)=>{const o=i.getERC20Registry(t);if(e.hasHToken)return o.find(n=>n.underlyingErc20TokenAddress?.toLowerCase()===e.erc20TokenAddress.toLowerCase()&&n.isHToken)},m=e=>e.map(({amount:t,token:o,dollarValue:n})=>{const u=t>0n?"+":"-",r=Number(c.getAmountInToken(o,t));return{token:o,amount:`${u}${T.fixDecimalsAmount(r>0?r:-r)}`,dollarValue:n}});exports.getERC20Token=k;exports.getERC20TokenBySymbol=C;exports.getErc20TokensForChain=s;exports.getHToken=a;exports.getTokenChangesList=m;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { ERC20Token } from '../../types/token.types';
|
|
2
|
-
export declare const
|
|
1
|
+
import { ERC20Token, TokenChanges } from '../../types/token.types';
|
|
2
|
+
export declare const getErc20TokensForChain: (chainId: number) => ERC20Token[];
|
|
3
|
+
export declare const getERC20Token: (address: string, chainId: number, fromList?: ERC20Token[]) => ERC20Token | undefined;
|
|
3
4
|
export declare const getERC20TokenBySymbol: (symbol: string, chainId: number) => ERC20Token | undefined;
|
|
4
5
|
export declare const getHToken: (token: ERC20Token, chainId: number) => ERC20Token | undefined;
|
|
6
|
+
export declare const getTokenChangesList: (tokenChanges: TokenChanges<bigint>[]) => {
|
|
7
|
+
token: ERC20Token;
|
|
8
|
+
amount: string;
|
|
9
|
+
dollarValue: string;
|
|
10
|
+
}[];
|
|
@@ -1,20 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { customTokenRegistry as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
return [...
|
|
9
|
-
},
|
|
10
|
-
const r =
|
|
1
|
+
import "../../constants/token-data/index.mjs";
|
|
2
|
+
import { customTokenRegistry as u } from "../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
3
|
+
import { getAmountInToken as c } from "../web3/etherFunctions.mjs";
|
|
4
|
+
import { fixDecimalsAmount as g } from "./amounts.utils.mjs";
|
|
5
|
+
import { getERC20Registry as s } from "../../constants/token-data/ERC20Registry.mjs";
|
|
6
|
+
const i = (e) => {
|
|
7
|
+
const o = s(e), r = u.getCustomTokens(e);
|
|
8
|
+
return [...o, ...r];
|
|
9
|
+
}, d = (e, o, r) => (r ?? i(o))?.find((t) => e === void 0 ? !1 : t.erc20TokenAddress.toLowerCase() === e.toLowerCase()), p = (e, o) => i(o)?.find((r) => e === void 0 ? !1 : r.symbol.toLowerCase() === e.toLowerCase()), y = (e, o) => {
|
|
10
|
+
const r = s(o);
|
|
11
11
|
if (e.hasHToken)
|
|
12
12
|
return r.find(
|
|
13
13
|
(t) => t.underlyingErc20TokenAddress?.toLowerCase() === e.erc20TokenAddress.toLowerCase() && t.isHToken
|
|
14
14
|
);
|
|
15
|
-
}
|
|
15
|
+
}, L = (e) => e.map(({ amount: o, token: r, dollarValue: t }) => {
|
|
16
|
+
const m = o > 0n ? "+" : "-", n = Number(c(r, o));
|
|
17
|
+
return {
|
|
18
|
+
token: r,
|
|
19
|
+
amount: `${m}${g(n > 0 ? n : -n)}`,
|
|
20
|
+
dollarValue: t
|
|
21
|
+
};
|
|
22
|
+
});
|
|
16
23
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
d as getERC20Token,
|
|
25
|
+
p as getERC20TokenBySymbol,
|
|
26
|
+
i as getErc20TokensForChain,
|
|
27
|
+
y as getHToken,
|
|
28
|
+
L as getTokenChangesList
|
|
20
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");const i=e=>r.networkRegistry[e],
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../constants/token-data/index.cjs");const r=require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");require("../../constants/addresses.constants.cjs");require("../../constants/token.limits.constants.cjs");const i=e=>r.networkRegistry[e],u=e=>Object.keys(r.chainIdsByType)[Object.values(r.chainIdsByType).findIndex(t=>t.includes(e.chainId))];exports.getNetworkObject=i;exports.getNetworkType=u;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../../constants/token-data/index.mjs";
|
|
2
|
+
import { networkRegistry as e, chainIdsByType as o } from "../../constants/chains.constants.mjs";
|
|
2
3
|
import "../../constants/vite.constants.mjs";
|
|
3
4
|
import "../../constants/contracts.constants.mjs";
|
|
4
5
|
import "../../constants/kyc.constants.mjs";
|
|
@@ -6,8 +7,10 @@ import "../../constants/coingecko.constants.mjs";
|
|
|
6
7
|
import "../../constants/axelar.constants.mjs";
|
|
7
8
|
import "../../constants/rewards.constants.mjs";
|
|
8
9
|
import "../../constants/reorg-depths.constants.mjs";
|
|
9
|
-
|
|
10
|
+
import "../../constants/addresses.constants.mjs";
|
|
11
|
+
import "../../constants/token.limits.constants.mjs";
|
|
12
|
+
const g = (t) => e[t], j = (t) => Object.keys(o)[Object.values(o).findIndex((r) => r.includes(t.chainId))];
|
|
10
13
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
g as getNetworkObject,
|
|
15
|
+
j as getNetworkType
|
|
13
16
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
2
|
import { ExternalActionId } from '../../types/external-action.types';
|
|
3
|
-
import {
|
|
3
|
+
import { CircomDataBaseType } from '../../types/circom-data.types';
|
|
4
4
|
export declare const getExternalActionIdHash: (externalActionId: ExternalActionId | 0n) => bigint;
|
|
5
5
|
export declare const getExternalActionIdFromNumber: (externalActionIdNumber: string | bigint) => ExternalActionId | undefined;
|
|
6
|
-
export declare const getActionFromMetadata: (externalActionId: ExternalActionId, circomDataDeserialized: Partial<
|
|
6
|
+
export declare const getActionFromMetadata: (externalActionId: ExternalActionId, circomDataDeserialized: Partial<CircomDataBaseType>) => number | undefined;
|
|
7
7
|
export declare const decodeMetadata: (externalActionId: ExternalActionId, externalActionMetadata: string) => ethers.utils.Result;
|
|
8
8
|
export declare const getExternalMetadataHash: (externalMetadataBuffer: string) => bigint;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../types/hinkal.types.cjs"),a=(e,r)=>{if(e.length!==r.length)throw new Error("length mismatch");const t=e.findIndex(n=>n!==0n);return t===-1?u.defaultFeeStructure:{feeToken:r[t],flatFee:e[t],variableRate:0n}};exports.generateFeeStructure=a;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defaultFeeStructure as o } from "../../types/hinkal.types.mjs";
|
|
2
|
+
const a = (e, r) => {
|
|
3
|
+
if (e.length !== r.length)
|
|
4
|
+
throw new Error("length mismatch");
|
|
5
|
+
const t = e.findIndex((n) => n !== 0n);
|
|
6
|
+
return t === -1 ? o : {
|
|
7
|
+
feeToken: r[t],
|
|
8
|
+
flatFee: e[t],
|
|
9
|
+
variableRate: 0n
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
a as generateFeeStructure
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../constants/chains.constants.cjs"),r=require("../../constants/mediaUrls.constants.cjs"),s=e=>e===i.chainIds.polygon?r.mediaUrls.POLY_SCAN:e===i.chainIds.arbMainnet?r.mediaUrls.ARB_SCAN:e===i.chainIds.ethMainnet?r.mediaUrls.ETH_SCAN:e===i.chainIds.avalanche?r.mediaUrls.AVAX_SCAN:e===i.chainIds.bnbMainnet?r.mediaUrls.BSC_SCAN:e===i.chainIds.base?r.mediaUrls.BASE_SCAN:e===i.chainIds.optimism?r.mediaUrls.OPTIMISM_SCAN:r.mediaUrls.ETH_SCAN;exports.getBlockExplorerUrl=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getBlockExplorerUrl: (nonLocalChainId: number) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { chainIds as t } from "../../constants/chains.constants.mjs";
|
|
2
|
+
import { mediaUrls as r } from "../../constants/mediaUrls.constants.mjs";
|
|
3
|
+
const i = (e) => e === t.polygon ? r.POLY_SCAN : e === t.arbMainnet ? r.ARB_SCAN : e === t.ethMainnet ? r.ETH_SCAN : e === t.avalanche ? r.AVAX_SCAN : e === t.bnbMainnet ? r.BSC_SCAN : e === t.base ? r.BASE_SCAN : e === t.optimism ? r.OPTIMISM_SCAN : r.ETH_SCAN;
|
|
4
|
+
export {
|
|
5
|
+
i as getBlockExplorerUrl
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../constants/protocol.constants.cjs");require("ethers");const d=require("../../data-structures/utxo/Utxo.cjs"),c=require("../../data-structures/crypto-keys/keys.cjs");require("libsodium-wrappers");const y=n=>{const e=n.getShieldedPrivateKey(),t=c.UserKeys.getEncryptionKeyPair(e).publicKey,r=new d.Utxo({amount:0n,erc20TokenAddress:i.zeroAddress,shieldedPrivateKey:e}),{randomization:s}=r,o=r.getStealthAddress();if(!s||!o||!t)throw Error("Cannot get recipient information");return`${s},${o},${t}`},u=n=>{const e=n.getShieldedPrivateKey(),t=new d.Utxo({amount:0n,erc20TokenAddress:i.zeroAddress,shieldedPrivateKey:e}),{randomization:r}=t,s=t.getStealthAddress(),{h0:o,h1:a}=c.UserKeys.getStealthAddressCompressedPoints(r,e);return`${r},${s},${o},${a}`};exports.getExtendedRecipientInfoFromUserKeys=u;exports.getRecipientInfoFromUserKeys=y;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { zeroAddress as i } from "../../constants/protocol.constants.mjs";
|
|
2
|
+
import "ethers";
|
|
3
|
+
import { Utxo as d } from "../../data-structures/utxo/Utxo.mjs";
|
|
4
|
+
import { UserKeys as c } from "../../data-structures/crypto-keys/keys.mjs";
|
|
5
|
+
import "libsodium-wrappers";
|
|
6
|
+
const K = (s) => {
|
|
7
|
+
const e = s.getShieldedPrivateKey(), t = c.getEncryptionKeyPair(e).publicKey, o = new d({ amount: 0n, erc20TokenAddress: i, shieldedPrivateKey: e }), { randomization: r } = o, n = o.getStealthAddress();
|
|
8
|
+
if (!r || !n || !t)
|
|
9
|
+
throw Error("Cannot get recipient information");
|
|
10
|
+
return `${r},${n},${t}`;
|
|
11
|
+
}, g = (s) => {
|
|
12
|
+
const e = s.getShieldedPrivateKey(), t = new d({ amount: 0n, erc20TokenAddress: i, shieldedPrivateKey: e }), { randomization: o } = t, r = t.getStealthAddress(), { h0: n, h1: a } = c.getStealthAddressCompressedPoints(o, e);
|
|
13
|
+
return `${o},${r},${n},${a}`;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
g as getExtendedRecipientInfoFromUserKeys,
|
|
17
|
+
K as getRecipientInfoFromUserKeys
|
|
18
|
+
};
|
|
@@ -19,3 +19,15 @@ export * from './time.utils';
|
|
|
19
19
|
export * from './volatile-patcher.utils';
|
|
20
20
|
export * from './cacheDevice.utils';
|
|
21
21
|
export * from './process.utils';
|
|
22
|
+
export * from './getBlockExplorerUrl';
|
|
23
|
+
export * from './involves-permit2-op';
|
|
24
|
+
export * from './upToDateState';
|
|
25
|
+
export * from './serialize.utils';
|
|
26
|
+
export * from './processUseApprovalUtxoData';
|
|
27
|
+
export * from './convertEmporiumOpToCallInfo';
|
|
28
|
+
export * from './getRecipientInfoFromUserKeys';
|
|
29
|
+
export * from './publicBalance.utils';
|
|
30
|
+
export * from './rpc-int-encode';
|
|
31
|
+
export * from './token-check.utils';
|
|
32
|
+
export * from './arraysMatch';
|
|
33
|
+
export * from './addresses';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../constants/permit2.constants.cjs"),o=e=>e.some(t=>t.toLowerCase().includes(s.permit2Address.slice(2).toLowerCase()));exports.involvesPermit2Op=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const involvesPermit2Op: (ops: string[]) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../constants/protocol.constants.cjs"),c=require("../../crypto/poseidon.cjs"),s=require("../../data-structures/merkle-tree/MerkleTree.cjs"),n=e=>new Map(Object.entries(e).map(([r,t])=>[BigInt(r),BigInt(t)])),i=e=>{const r=n(e.tree),t=e.reverseTree?n(e.reverseTree):void 0;return s.MerkleTree.createWithData(r,t,BigInt(e.index),BigInt(e.count),c.poseidonFunction,o.MERKLE_LEVELS,0n)};exports.contructMerkleTreeFromSerialized=i;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MERKLE_LEVELS as o } from "../../constants/protocol.constants.mjs";
|
|
2
|
+
import { poseidonFunction as c } from "../../crypto/poseidon.mjs";
|
|
3
|
+
import { MerkleTree as s } from "../../data-structures/merkle-tree/MerkleTree.mjs";
|
|
4
|
+
const n = (e) => new Map(
|
|
5
|
+
Object.entries(e).map(([t, r]) => [BigInt(t), BigInt(r)])
|
|
6
|
+
), M = (e) => {
|
|
7
|
+
const t = n(e.tree), r = e.reverseTree ? n(e.reverseTree) : void 0;
|
|
8
|
+
return s.createWithData(
|
|
9
|
+
t,
|
|
10
|
+
r,
|
|
11
|
+
BigInt(e.index),
|
|
12
|
+
BigInt(e.count),
|
|
13
|
+
c,
|
|
14
|
+
o,
|
|
15
|
+
0n
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
M as contructMerkleTreeFromSerialized
|
|
20
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
2
|
+
import { IHinkal } from '../../data-structures';
|
|
3
|
+
export declare const createSigner: (privateKey: string, chainId: number) => ethers.Wallet;
|
|
4
|
+
export declare const createVoidSigner: (address: string, chainId: number) => ethers.VoidSigner;
|
|
5
|
+
export declare const prepareHinkal: (hinkal: IHinkal, signer: ethers.Wallet) => Promise<void>;
|
|
6
|
+
export declare const prepareHinkalWithSignature: (hinkal: IHinkal, signer: ethers.VoidSigner, signature: string) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../constants/protocol.constants.cjs"),n=require("../../constants/conversion.constants.cjs"),a=(r,e,o)=>{const s=[...r];for(;s.length<o;)s.push(e);return s},p=r=>{const e=structuredClone(r);return e.approvalChanges=a(e.approvalChanges,0n,n.APPROVED_UTXO_CONVERSION_COUNT),e.conversionInHinkalAddress=a(e.conversionInHinkalAddress,0n,n.APPROVED_UTXO_CONVERSION_COUNT),e.externalApprovalAddresses=a(e.externalApprovalAddresses,t.zeroAddress,n.APPROVED_UTXO_CONVERSION_COUNT),e},l=r=>r.approvalChanges[0]===0n;exports.isUseApprovalDataEmpty=l;exports.padUseApprovalUtxoData=p;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { UseApprovalUTXOData } from '../../types/hinkal.types';
|
|
2
|
+
export declare const padUseApprovalUtxoData: (useApprovalUtxoData: UseApprovalUTXOData) => UseApprovalUTXOData<bigint>;
|
|
3
|
+
export declare const isUseApprovalDataEmpty: (useApprovalUtxoData: UseApprovalUTXOData) => boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { zeroAddress as p } from "../../constants/protocol.constants.mjs";
|
|
2
|
+
import { APPROVED_UTXO_CONVERSION_COUNT as n } from "../../constants/conversion.constants.mjs";
|
|
3
|
+
const a = (e, r, o) => {
|
|
4
|
+
const s = [...e];
|
|
5
|
+
for (; s.length < o; )
|
|
6
|
+
s.push(r);
|
|
7
|
+
return s;
|
|
8
|
+
}, d = (e) => {
|
|
9
|
+
const r = structuredClone(e);
|
|
10
|
+
return r.approvalChanges = a(r.approvalChanges, 0n, n), r.conversionInHinkalAddress = a(r.conversionInHinkalAddress, 0n, n), r.externalApprovalAddresses = a(
|
|
11
|
+
r.externalApprovalAddresses,
|
|
12
|
+
p,
|
|
13
|
+
n
|
|
14
|
+
), r;
|
|
15
|
+
}, A = (e) => e.approvalChanges[0] === 0n;
|
|
16
|
+
export {
|
|
17
|
+
A as isUseApprovalDataEmpty,
|
|
18
|
+
d as padUseApprovalUtxoData
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("ethers"),d=require("../../constants/protocol.constants.cjs"),b=require("../../constants/chains.constants.cjs"),g=require("../../types/ethereum-network.types.cjs"),f=require("./erc20tokenFunctions.cjs"),l=async(n,c,e,s)=>{try{const o=e.erc20TokenAddress;let t;o!==d.zeroAddress?t=await n(g.ContractType.ERC20Contract,e.erc20TokenAddress)?.balanceOf(c):t=await s.getBalance(c);const r=t.toBigInt();return r<=0n?null:{token:e,balance:r}}catch{return null}},p=async(n,c,e,s)=>{const{fetchRpcUrl:o}=b.networkRegistry[n],t=new u.ethers.providers.JsonRpcProvider(o),r=s??f.getErc20TokensForChain(n);return(await Promise.all(r.map(async a=>l(c,e,a,t)))).filter(a=>a!==null)};exports.getPublicBalance=l;exports.getPublicBalancesOfTokens=p;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
2
|
+
import { ContractType } from '../../types/ethereum-network.types';
|
|
3
|
+
import { ERC20Token, TokenBalance } from '../../types/token.types';
|
|
4
|
+
export declare const getPublicBalance: (getContractWithFetcher: (contract: ContractType, contractAddress?: string | undefined) => ethers.Contract, ethereumAddress: string, token: ERC20Token, provider: ethers.providers.JsonRpcProvider) => Promise<TokenBalance | null>;
|
|
5
|
+
export declare const getPublicBalancesOfTokens: (chainId: number, getContractWithFetcher: (contract: ContractType, contractAddress?: string | undefined) => ethers.Contract, ethereumAddress: string, tokens?: ERC20Token[]) => Promise<TokenBalance[]>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ethers as i } from "ethers";
|
|
2
|
+
import { zeroAddress as f } from "../../constants/protocol.constants.mjs";
|
|
3
|
+
import { networkRegistry as p } from "../../constants/chains.constants.mjs";
|
|
4
|
+
import { ContractType as m } from "../../types/ethereum-network.types.mjs";
|
|
5
|
+
import { getErc20TokensForChain as d } from "./erc20tokenFunctions.mjs";
|
|
6
|
+
const u = async (e, n, t, o) => {
|
|
7
|
+
try {
|
|
8
|
+
const a = t.erc20TokenAddress;
|
|
9
|
+
let r;
|
|
10
|
+
a !== f ? r = await e(m.ERC20Contract, t.erc20TokenAddress)?.balanceOf(n) : r = await o.getBalance(n);
|
|
11
|
+
const c = r.toBigInt();
|
|
12
|
+
return c <= 0n ? null : { token: t, balance: c };
|
|
13
|
+
} catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}, T = async (e, n, t, o) => {
|
|
17
|
+
const { fetchRpcUrl: a } = p[e], r = new i.providers.JsonRpcProvider(a), c = o ?? d(e);
|
|
18
|
+
return (await Promise.all(
|
|
19
|
+
c.map(async (s) => u(n, t, s, r))
|
|
20
|
+
)).filter((s) => s !== null);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
u as getPublicBalance,
|
|
24
|
+
T as getPublicBalancesOfTokens
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=(e,t,s)=>{const o=t.slice(2),r=s.slice(2);return e.toLowerCase().split(o.toLowerCase()).join(r.toLowerCase())};exports.replaceAddressesInCalldata=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const replaceAddressesInCalldata: (callDataString: string, searchFor: string, replacement: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("ethers"),n=r=>{const t=e.ethers.BigNumber.from(r);return e.ethers.utils.hexValue(t)};exports.rpcIntEncode=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=i=>JSON.stringify(i,(r,t)=>typeof t=="bigint"?`bigint:${t.toString()}`:t);exports.CustomJSONStringify=n;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=i=>JSON.stringify(i,(r,t)=>typeof t=="bigint"?`bigint:${t.toString()}`:t),s=i=>JSON.parse(i,(r,t)=>typeof t=="string"&&t.startsWith("bigint:")?BigInt(t.slice(7)):t);exports.CustomJSONParse=s;exports.CustomJSONStringify=n;
|