@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,43 +1,45 @@
|
|
|
1
1
|
import { getAmountAfterRelayAndFlatFees as I, getAmountAfterRelayAndFlatFeesAndSlippage as N, getAmountAfterSlippage as L } from "../../constants/fees.constants.mjs";
|
|
2
2
|
import { FeeOverTransactionValueError as S } from "../../error-handling/customErrors/FeeOverTransactionValueError.mjs";
|
|
3
|
-
import { absBigInt as
|
|
3
|
+
import { absBigInt as R } from "../utils/amounts.utils.mjs";
|
|
4
4
|
import "ethers";
|
|
5
|
+
import "../../error-handling/error-codes.constants.mjs";
|
|
5
6
|
import "axios";
|
|
6
7
|
import "../../constants/chains.constants.mjs";
|
|
7
8
|
import "../../constants/vite.constants.mjs";
|
|
8
|
-
import { isBeefyDeposit as
|
|
9
|
+
import { isBeefyDeposit as W } from "../../types/beefy.types.mjs";
|
|
9
10
|
import "../../types/circom-data.types.mjs";
|
|
10
11
|
import { INTERACTION as c } from "../../types/hinkal.types.mjs";
|
|
11
|
-
import { SlippageType as
|
|
12
|
+
import { SlippageType as _ } from "../../types/slippage.types.mjs";
|
|
12
13
|
import "../../types/transactions.types.mjs";
|
|
13
14
|
import "../../types/curve.types.mjs";
|
|
15
|
+
import "../../types/activities.types.mjs";
|
|
14
16
|
import "circomlibjs-hinkal-fork";
|
|
15
17
|
import "libsodium-wrappers";
|
|
16
18
|
import "process";
|
|
17
19
|
import "buffer";
|
|
18
20
|
import "../../constants/reorg-depths.constants.mjs";
|
|
19
|
-
import { getInteractionFromAction as
|
|
21
|
+
import { getInteractionFromAction as w } from "./interaction-to-action.mjs";
|
|
20
22
|
const p = (D, r, E) => {
|
|
21
|
-
const T =
|
|
23
|
+
const T = R(D) - r;
|
|
22
24
|
if (r < 0n)
|
|
23
25
|
throw new S({
|
|
24
26
|
totalFeeWEI: T,
|
|
25
27
|
feeUnit: E
|
|
26
28
|
});
|
|
27
29
|
return r;
|
|
28
|
-
},
|
|
30
|
+
}, F = ({
|
|
29
31
|
erc20Addresses: D = [],
|
|
30
32
|
amountChanges: r,
|
|
31
33
|
flatFees: E,
|
|
32
34
|
feeUnit: A,
|
|
33
35
|
externalActionId: T,
|
|
34
|
-
action:
|
|
35
|
-
gasTokenAddress:
|
|
36
|
+
action: P,
|
|
37
|
+
gasTokenAddress: O
|
|
36
38
|
}) => {
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
+
const i = w(T, P);
|
|
40
|
+
if (i === c.NONE)
|
|
39
41
|
throw Error("No interaction was choosen");
|
|
40
|
-
switch (
|
|
42
|
+
switch (i) {
|
|
41
43
|
case c.WITHDRAW: {
|
|
42
44
|
p(
|
|
43
45
|
r[0],
|
|
@@ -49,7 +51,7 @@ const p = (D, r, E) => {
|
|
|
49
51
|
case c.SWAP: {
|
|
50
52
|
r[1] = p(
|
|
51
53
|
r[1],
|
|
52
|
-
N(r[1], E[1],
|
|
54
|
+
N(r[1], E[1], _.Swap),
|
|
53
55
|
A
|
|
54
56
|
);
|
|
55
57
|
break;
|
|
@@ -58,18 +60,18 @@ const p = (D, r, E) => {
|
|
|
58
60
|
const k = r.length - 1;
|
|
59
61
|
r[k] = p(
|
|
60
62
|
r[k],
|
|
61
|
-
N(r[k], E[k],
|
|
63
|
+
N(r[k], E[k], _.CurveDeposit),
|
|
62
64
|
A
|
|
63
65
|
);
|
|
64
66
|
break;
|
|
65
67
|
}
|
|
66
68
|
case c.CURVE_WITHDRAW:
|
|
67
|
-
E.forEach((k,
|
|
68
|
-
k > 0n ? r[
|
|
69
|
-
r[
|
|
70
|
-
N(r[
|
|
69
|
+
E.forEach((k, b) => {
|
|
70
|
+
k > 0n ? r[b] = p(
|
|
71
|
+
r[b],
|
|
72
|
+
N(r[b], k, _.CurveWithdraw),
|
|
71
73
|
A
|
|
72
|
-
) : k === 0n && r[
|
|
74
|
+
) : k === 0n && r[b] > 0n && b !== E.length - 1 && (r[b] = L(r[b], _.CurveWithdraw));
|
|
73
75
|
});
|
|
74
76
|
break;
|
|
75
77
|
case c.CURVE_WITHDRAW_INBALANCED:
|
|
@@ -96,13 +98,13 @@ const p = (D, r, E) => {
|
|
|
96
98
|
);
|
|
97
99
|
break;
|
|
98
100
|
case c.BEEFY: {
|
|
99
|
-
const k =
|
|
101
|
+
const k = W(P) ? 1 : 0;
|
|
100
102
|
r[k] = p(
|
|
101
103
|
r[k],
|
|
102
104
|
N(
|
|
103
105
|
r[k],
|
|
104
106
|
E[k],
|
|
105
|
-
|
|
107
|
+
_.Beefy
|
|
106
108
|
),
|
|
107
109
|
A
|
|
108
110
|
);
|
|
@@ -195,10 +197,10 @@ const p = (D, r, E) => {
|
|
|
195
197
|
);
|
|
196
198
|
break;
|
|
197
199
|
case c.PENDLE_LP: {
|
|
198
|
-
const k = r.findIndex((
|
|
200
|
+
const k = r.findIndex((b) => b > 0n);
|
|
199
201
|
r[k] = p(
|
|
200
202
|
r[k],
|
|
201
|
-
N(r[k], E[k],
|
|
203
|
+
N(r[k], E[k], _.Pendle)
|
|
202
204
|
);
|
|
203
205
|
break;
|
|
204
206
|
}
|
|
@@ -209,9 +211,18 @@ const p = (D, r, E) => {
|
|
|
209
211
|
A
|
|
210
212
|
);
|
|
211
213
|
break;
|
|
214
|
+
case c.EMPORIUM:
|
|
215
|
+
E.forEach((k, b) => {
|
|
216
|
+
k > 0 && (r[b] = p(
|
|
217
|
+
r[b],
|
|
218
|
+
r[b] - k,
|
|
219
|
+
A
|
|
220
|
+
));
|
|
221
|
+
});
|
|
222
|
+
break;
|
|
212
223
|
}
|
|
213
224
|
return r;
|
|
214
225
|
};
|
|
215
226
|
export {
|
|
216
|
-
|
|
227
|
+
F as processAmountChanges
|
|
217
228
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=async(e,t,o)=>{const c=await e.checkTokenRegistry(t,o),s=await e.checkAccessToken();return{patchAccessTokenMerkleTree:c&&!s,hasAccessToken:s,kycRequired:c}};exports.shouldPatchAccessTokenMerkleTree=r;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
2
|
+
export declare const shouldPatchAccessTokenMerkleTree: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[]) => Promise<{
|
|
3
|
+
patchAccessTokenMerkleTree: boolean;
|
|
4
|
+
hasAccessToken: boolean;
|
|
5
|
+
kycRequired: boolean;
|
|
6
|
+
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("ethers"),q=require("../../constants/protocol.constants.cjs"),y=require("../../types/ethereum-network.types.cjs");require("../../constants/contracts.constants.cjs");require("circomlibjs-hinkal-fork");require("../../error-handling/error-codes.constants.cjs");require("../../data-structures/crypto-keys/keys.cjs");require("idb-keyval");require("../utils/external-action.utils.cjs");require("../../constants/token-data/index.cjs");require("../utils/convertIntegrationProviderToExternalActionId.cjs");require("../../types/circom-data.types.cjs");require("../../constants/vite.constants.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("../../types/activities.types.cjs");require("axios");require("../../constants/chains.constants.cjs");require("libsodium-wrappers");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");const E=require("../utils/string.utils.cjs");require("../../data-structures/volatile-helper/VolatileHelper.cjs");const O=require("../utils/replaceAddressInCalldata.cjs"),v=require("./smartContractWalletCalculator.cjs"),l=({contract:r,func:e,args:o,callDataString:t,invokeWallet:a,value:i})=>{let c=new Uint8Array,d=t?n.utils.arrayify(t):new Uint8Array;if(typeof r=="object"&&"address"in r){if(c=n.utils.arrayify(r.address),t?.length&&t?.length>0)throw Error("If function and args are providedm no calldata is needed");e&&o&&!t&&(d=n.utils.arrayify(r.interface.encodeFunctionData(e,o)))}else c=n.utils.arrayify(r);const f=n.utils.arrayify([a?1:0]),m=n.utils.zeroPad(n.utils.arrayify(n.BigNumber.from(i??0n)),16),u=n.utils.concat([c,f,m,d]);return n.utils.hexlify(u)},F=(r,e,o)=>n.utils.defaultAbiCoder.encode(["tuple(bytes32 walletSalt, uint256 replayProtection, bytes[] ops)"],[{walletSalt:e??n.utils.hexlify(new Uint8Array(32)),replayProtection:o??0n,ops:r}]),h=(r,e,o,t,a)=>{if(e===q.zeroAddress)return l({contract:o,callDataString:"",value:t,invokeWallet:a});const i=r.getContractWithFetcher(y.ContractType.ERC20Contract,e);return l({contract:i,func:"transfer",args:[o,t],invokeWallet:a})},C=(r,e,o,t,a)=>{if(e===q.zeroAddress)throw new Error("can't approve native token");const i=r.getContractWithFetcher(y.ContractType.ERC20Contract,e);return l({contract:i,func:"approve",args:[o,t],invokeWallet:a})},A=(r,e,o,t)=>{const a=r.getContractWithFetcher(y.ContractType.HinkalContract);return h(r,e,t??a.address,o,!0)},w=(r,e,o,t)=>e.map((a,i)=>A(r,a,o[i],t)),g=(r,e,o)=>{const t=r.getSelectedNetwork()?.contractData.hinkalAddress;if(!t)throw Error("No Hinkal Address Provided to modifyDataForProxy");return E.replaceAllInstances(o,t.slice(2),e.slice(2))},P=async(r,e,o)=>{if(!e)throw Error("No Nonce Provided to modifyDataForProxy");const t=await v.calculateSmartContractWalletAddressFromNonce(r.getCurrentChainId(),r.userKeys,e);return g(r,t,o)},T=(r,e,o,t,a,i,c,d,f)=>{const m=r.getContractWithFetcher(y.ContractType.HinkalContract),u=[];for(let s=0;s<e.length;s+=1){const p=e[s];u.push(h(r,p,i,o[s],!1))}for(let s=0;s<t.length;s+=1){const p=t[s];p!==q.zeroAddress&&u.push(C(r,p,c,a[s],!0))}return u.push(l({contract:c,callDataString:O.replaceAddressesInCalldata(d,m.address,i),value:f,invokeWallet:!0})),u};exports.createApproveEmporiumOp=C;exports.createTransaferEmporiumOpsBatch=w;exports.createTransferEmporiumOp=A;exports.createTransferToEmporiumOp=h;exports.emporiumOp=l;exports.encodeEmporiumMetadata=F;exports.generateFundApproveAndTransactOps=T;exports.modifyDataForProxy=g;exports.modifyDataForProxyWithNonce=P;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Contract, ContractTransaction } from 'ethers';
|
|
2
|
+
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
2
3
|
export declare const emporiumOp: <ContractInstance extends Contract, ContractFunctions extends ContractInstance["functions"], ExactFunction extends { [K in keyof ContractFunctions]: ReturnType<ContractFunctions[K]> extends Promise<ContractTransaction> ? K : never; }[keyof ContractFunctions], FunctionArguments extends Parameters<ContractFunctions[ExactFunction]>>({ contract, func, args, callDataString, invokeWallet, value, }: {
|
|
3
4
|
contract: ContractInstance | string;
|
|
4
5
|
func?: ExactFunction | undefined;
|
|
@@ -7,4 +8,11 @@ export declare const emporiumOp: <ContractInstance extends Contract, ContractFun
|
|
|
7
8
|
invokeWallet?: boolean | undefined;
|
|
8
9
|
value?: bigint | undefined;
|
|
9
10
|
}) => string;
|
|
10
|
-
export declare const encodeEmporiumMetadata: (ops: string[], walletSalt?: string) => string;
|
|
11
|
+
export declare const encodeEmporiumMetadata: (ops: string[], walletSalt?: string, replayProtection?: bigint) => string;
|
|
12
|
+
export declare const createTransferToEmporiumOp: (hinkal: IHinkal, erc20TokenAddress: string, to: string, amount: bigint, invokeWallet: boolean) => string;
|
|
13
|
+
export declare const createApproveEmporiumOp: (hinkal: IHinkal, erc20TokenAddress: string, to: string, amount: bigint, invokeWallet: boolean) => string;
|
|
14
|
+
export declare const createTransferEmporiumOp: (hinkal: IHinkal, erc20TokenAddress: string, amount: bigint, to?: string) => string;
|
|
15
|
+
export declare const createTransaferEmporiumOpsBatch: (hinkal: IHinkal, erc20TokenAddresses: string[], amounts: bigint[], to?: string) => string[];
|
|
16
|
+
export declare const modifyDataForProxy: (hinkal: IHinkal, userAddress: string, data: string) => string;
|
|
17
|
+
export declare const modifyDataForProxyWithNonce: (hinkal: IHinkal, nonce: bigint | undefined, data: string) => Promise<string>;
|
|
18
|
+
export declare const generateFundApproveAndTransactOps: (hinkal: IHinkal, erc20AddressesToFund: string[], fundAmounts: bigint[], approveTokenAddresses: string[], approveAmounts: bigint[], walletAddress: string, to: string, callDataString: string, value: bigint) => string[];
|
|
@@ -1,31 +1,126 @@
|
|
|
1
|
-
import { utils as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { utils as n, BigNumber as g } from "ethers";
|
|
2
|
+
import { zeroAddress as h } from "../../constants/protocol.constants.mjs";
|
|
3
|
+
import { ContractType as l } from "../../types/ethereum-network.types.mjs";
|
|
4
|
+
import "../../constants/contracts.constants.mjs";
|
|
5
|
+
import "circomlibjs-hinkal-fork";
|
|
6
|
+
import "../../error-handling/error-codes.constants.mjs";
|
|
7
|
+
import "../../data-structures/crypto-keys/keys.mjs";
|
|
8
|
+
import "idb-keyval";
|
|
9
|
+
import "../utils/external-action.utils.mjs";
|
|
10
|
+
import "../../constants/token-data/index.mjs";
|
|
11
|
+
import "../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
12
|
+
import "../../types/circom-data.types.mjs";
|
|
13
|
+
import "../../constants/vite.constants.mjs";
|
|
14
|
+
import "../../types/transactions.types.mjs";
|
|
15
|
+
import "../../types/curve.types.mjs";
|
|
16
|
+
import "../../types/activities.types.mjs";
|
|
17
|
+
import "axios";
|
|
18
|
+
import "../../constants/chains.constants.mjs";
|
|
19
|
+
import "libsodium-wrappers";
|
|
20
|
+
import "process";
|
|
21
|
+
import "buffer";
|
|
22
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
23
|
+
import "../../constants/kyc.constants.mjs";
|
|
24
|
+
import "../../constants/coingecko.constants.mjs";
|
|
25
|
+
import "../../constants/axelar.constants.mjs";
|
|
26
|
+
import "../../constants/rewards.constants.mjs";
|
|
27
|
+
import "../../constants/addresses.constants.mjs";
|
|
28
|
+
import "../../constants/token.limits.constants.mjs";
|
|
29
|
+
import "../utils/userAgent.mjs";
|
|
30
|
+
import { replaceAllInstances as A } from "../utils/string.utils.mjs";
|
|
31
|
+
import "../../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
32
|
+
import { replaceAddressesInCalldata as w } from "../utils/replaceAddressInCalldata.mjs";
|
|
33
|
+
import { calculateSmartContractWalletAddressFromNonce as E } from "./smartContractWalletCalculator.mjs";
|
|
34
|
+
const f = ({
|
|
35
|
+
contract: t,
|
|
36
|
+
func: r,
|
|
37
|
+
args: e,
|
|
38
|
+
callDataString: o,
|
|
39
|
+
invokeWallet: a,
|
|
40
|
+
value: i
|
|
9
41
|
}) => {
|
|
10
|
-
let
|
|
11
|
-
if (typeof
|
|
12
|
-
if (
|
|
42
|
+
let p = new Uint8Array(), m = o ? n.arrayify(o) : new Uint8Array();
|
|
43
|
+
if (typeof t == "object" && "address" in t) {
|
|
44
|
+
if (p = n.arrayify(t.address), o?.length && o?.length > 0)
|
|
13
45
|
throw Error("If function and args are providedm no calldata is needed");
|
|
14
|
-
|
|
46
|
+
r && e && !o && (m = n.arrayify(t.interface.encodeFunctionData(r, e)));
|
|
15
47
|
} else
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
return
|
|
19
|
-
},
|
|
20
|
-
["tuple(bytes32 walletSalt, bytes[] ops)"],
|
|
48
|
+
p = n.arrayify(t);
|
|
49
|
+
const y = n.arrayify([a ? 1 : 0]), u = n.zeroPad(n.arrayify(g.from(i ?? 0n)), 16), s = n.concat([p, y, u, m]);
|
|
50
|
+
return n.hexlify(s);
|
|
51
|
+
}, at = (t, r, e) => n.defaultAbiCoder.encode(
|
|
52
|
+
["tuple(bytes32 walletSalt, uint256 replayProtection, bytes[] ops)"],
|
|
21
53
|
[
|
|
22
54
|
{
|
|
23
|
-
walletSalt:
|
|
24
|
-
|
|
55
|
+
walletSalt: r ?? n.hexlify(new Uint8Array(32)),
|
|
56
|
+
replayProtection: e ?? 0n,
|
|
57
|
+
ops: t
|
|
25
58
|
}
|
|
26
59
|
]
|
|
27
|
-
)
|
|
60
|
+
), C = (t, r, e, o, a) => {
|
|
61
|
+
if (r === h)
|
|
62
|
+
return f({ contract: e, callDataString: "", value: o, invokeWallet: a });
|
|
63
|
+
const i = t.getContractWithFetcher(l.ERC20Contract, r);
|
|
64
|
+
return f({
|
|
65
|
+
contract: i,
|
|
66
|
+
func: "transfer",
|
|
67
|
+
args: [e, o],
|
|
68
|
+
invokeWallet: a
|
|
69
|
+
});
|
|
70
|
+
}, v = (t, r, e, o, a) => {
|
|
71
|
+
if (r === h)
|
|
72
|
+
throw new Error("can't approve native token");
|
|
73
|
+
const i = t.getContractWithFetcher(l.ERC20Contract, r);
|
|
74
|
+
return f({
|
|
75
|
+
contract: i,
|
|
76
|
+
func: "approve",
|
|
77
|
+
args: [e, o],
|
|
78
|
+
invokeWallet: a
|
|
79
|
+
});
|
|
80
|
+
}, F = (t, r, e, o) => {
|
|
81
|
+
const a = t.getContractWithFetcher(l.HinkalContract);
|
|
82
|
+
return C(t, r, o ?? a.address, e, !0);
|
|
83
|
+
}, nt = (t, r, e, o) => r.map((a, i) => F(t, a, e[i], o)), P = (t, r, e) => {
|
|
84
|
+
const o = t.getSelectedNetwork()?.contractData.hinkalAddress;
|
|
85
|
+
if (!o)
|
|
86
|
+
throw Error("No Hinkal Address Provided to modifyDataForProxy");
|
|
87
|
+
return A(e, o.slice(2), r.slice(2));
|
|
88
|
+
}, it = async (t, r, e) => {
|
|
89
|
+
if (!r)
|
|
90
|
+
throw Error("No Nonce Provided to modifyDataForProxy");
|
|
91
|
+
const o = await E(
|
|
92
|
+
t.getCurrentChainId(),
|
|
93
|
+
t.userKeys,
|
|
94
|
+
r
|
|
95
|
+
);
|
|
96
|
+
return P(t, o, e);
|
|
97
|
+
}, ct = (t, r, e, o, a, i, p, m, y) => {
|
|
98
|
+
const u = t.getContractWithFetcher(l.HinkalContract), s = [];
|
|
99
|
+
for (let c = 0; c < r.length; c += 1) {
|
|
100
|
+
const d = r[c];
|
|
101
|
+
s.push(C(t, d, i, e[c], !1));
|
|
102
|
+
}
|
|
103
|
+
for (let c = 0; c < o.length; c += 1) {
|
|
104
|
+
const d = o[c];
|
|
105
|
+
d !== h && s.push(v(t, d, p, a[c], !0));
|
|
106
|
+
}
|
|
107
|
+
return s.push(
|
|
108
|
+
f({
|
|
109
|
+
contract: p,
|
|
110
|
+
callDataString: w(m, u.address, i),
|
|
111
|
+
value: y,
|
|
112
|
+
invokeWallet: !0
|
|
113
|
+
})
|
|
114
|
+
), s;
|
|
115
|
+
};
|
|
28
116
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
117
|
+
v as createApproveEmporiumOp,
|
|
118
|
+
nt as createTransaferEmporiumOpsBatch,
|
|
119
|
+
F as createTransferEmporiumOp,
|
|
120
|
+
C as createTransferToEmporiumOp,
|
|
121
|
+
f as emporiumOp,
|
|
122
|
+
at as encodeEmporiumMetadata,
|
|
123
|
+
ct as generateFundApproveAndTransactOps,
|
|
124
|
+
P as modifyDataForProxy,
|
|
125
|
+
it as modifyDataForProxyWithNonce
|
|
31
126
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("ethers"),O=require("./emporium.helpers.cjs"),x=require("../../constants/addresses.constants.cjs"),I=require("../../types/external-action.types.cjs"),b=require("../../types/ethereum-network.types.cjs"),y=require("../pre-transaction/getExternalSwapAddress.cjs"),z=require("../utils/string.utils.cjs"),w=require("../../constants/protocol.constants.cjs"),q=(e,c,r,a,t,i,n=!1)=>{const p=g.BigNumber.from(i).toBigInt(),u={tokenIn:c,tokenOut:a,fee:p,recipient:t,amountIn:r,amountOutMinimum:0,sqrtPriceLimitX96:0},o=["function exactInputSingle(tuple(address tokenIn,address tokenOut,uint24 fee,address recipient,uint256 amountIn,uint256 amountOutMinimum,uint160 sqrtPriceLimitX96)) external payable returns (uint256 amountOut)"],m=new g.ethers.Contract(e,o);return O.emporiumOp({contract:m,func:"exactInputSingle",args:[u],invokeWallet:n})},h=(e,c,r,a,t,i,n=!1)=>{const p=y.getExternalSwapAddress(e,c),u=z.replaceAllInstances(a,p.slice(2),t.slice(2));return O.emporiumOp({contract:r,callDataString:u,value:i,invokeWallet:n})},D=(e,c,r,a,t,i,n,p,u,o=!1)=>{const m=i<0n?-1n*i:i,C=p<0n?-1n*p:p,s=[],S=x.NATIVE_TOKEN_WRAPPER_ADDRESSES[e.getCurrentChainId()];let l=!1,f;if(c===I.ExternalActionId.OneInch){t!==w.zeroAddress&&s.push(O.createApproveEmporiumOp(e,t,r,m,o));const E=t===w.zeroAddress?m:void 0;return f=h(e,c,r,a,u,E,o),s.push(f),s}if(t===w.zeroAddress){const E=e.getContractWithFetcher(b.ContractType.ERC20Contract,S);s.push(O.emporiumOp({contract:E,func:"deposit",value:m,invokeWallet:o})),t=S}if(n===w.zeroAddress&&(n=S,l=!0),t!==w.zeroAddress&&s.push(O.createApproveEmporiumOp(e,t,r,m,o)),c===I.ExternalActionId.Uniswap?f=q(r,t,m,n,u,a,o):f=h(e,c,r,a,u,void 0,o),s.push(f),l){const E=["function withdraw(uint256) external"],_=new g.ethers.Contract(n,E);s.push(O.emporiumOp({contract:_,func:"withdraw",args:[C],invokeWallet:o})),n=w.zeroAddress}return s};exports.createSwapToEmporiumOpForUniswap=q;exports.createSwapToEmporiumOpFromData=h;exports.createSwapToEmporiumOps=D;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
2
|
+
import { ExternalActionId } from '../../types/external-action.types';
|
|
3
|
+
export declare const createSwapToEmporiumOpForUniswap: (routerAddress: string, inputTokenAddress: string, positiveAmountInput: bigint, outputTokenAddress: string, recipient: string, data: string, invokeWallet?: boolean) => string;
|
|
4
|
+
export declare const createSwapToEmporiumOpFromData: (hinkal: IHinkal, externalActionId: ExternalActionId, routerAddress: string, data: string, walletAddress: string, value?: bigint, invokeWallet?: boolean) => string;
|
|
5
|
+
export declare const createSwapToEmporiumOps: (hinkal: IHinkal, externalActionId: ExternalActionId, routerAddress: string, data: string, inputTokenAddress: string, inputAmount: bigint, outputTokenAddress: string, outputAmount: bigint, walletAddress: string, invokeWallet?: boolean) => string[];
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { BigNumber as b, ethers as x } from "ethers";
|
|
2
|
+
import { emporiumOp as E, createApproveEmporiumOp as S } from "./emporium.helpers.mjs";
|
|
3
|
+
import { NATIVE_TOKEN_WRAPPER_ADDRESSES as l } from "../../constants/addresses.constants.mjs";
|
|
4
|
+
import { ExternalActionId as h } from "../../types/external-action.types.mjs";
|
|
5
|
+
import { ContractType as R } from "../../types/ethereum-network.types.mjs";
|
|
6
|
+
import { getExternalSwapAddress as F } from "../pre-transaction/getExternalSwapAddress.mjs";
|
|
7
|
+
import { replaceAllInstances as N } from "../utils/string.utils.mjs";
|
|
8
|
+
import { zeroAddress as u } from "../../constants/protocol.constants.mjs";
|
|
9
|
+
const U = (r, a, n, m, t, e, c = !1) => {
|
|
10
|
+
const p = b.from(e).toBigInt(), s = {
|
|
11
|
+
tokenIn: a,
|
|
12
|
+
tokenOut: m,
|
|
13
|
+
fee: p,
|
|
14
|
+
recipient: t,
|
|
15
|
+
amountIn: n,
|
|
16
|
+
amountOutMinimum: 0,
|
|
17
|
+
sqrtPriceLimitX96: 0
|
|
18
|
+
}, o = [
|
|
19
|
+
"function exactInputSingle(tuple(address tokenIn,address tokenOut,uint24 fee,address recipient,uint256 amountIn,uint256 amountOutMinimum,uint160 sqrtPriceLimitX96)) external payable returns (uint256 amountOut)"
|
|
20
|
+
], f = new x.Contract(r, o);
|
|
21
|
+
return E({
|
|
22
|
+
contract: f,
|
|
23
|
+
func: "exactInputSingle",
|
|
24
|
+
args: [s],
|
|
25
|
+
invokeWallet: c
|
|
26
|
+
});
|
|
27
|
+
}, C = (r, a, n, m, t, e, c = !1) => {
|
|
28
|
+
const p = F(r, a), s = N(m, p.slice(2), t.slice(2));
|
|
29
|
+
return E({
|
|
30
|
+
contract: n,
|
|
31
|
+
callDataString: s,
|
|
32
|
+
value: e,
|
|
33
|
+
invokeWallet: c
|
|
34
|
+
});
|
|
35
|
+
}, z = (r, a, n, m, t, e, c, p, s, o = !1) => {
|
|
36
|
+
const f = e < 0n ? -1n * e : e, D = p < 0n ? -1n * p : p, i = [], g = l[r.getCurrentChainId()];
|
|
37
|
+
let I = !1, w;
|
|
38
|
+
if (a === h.OneInch)
|
|
39
|
+
return t !== u && i.push(S(r, t, n, f, o)), w = C(
|
|
40
|
+
r,
|
|
41
|
+
a,
|
|
42
|
+
n,
|
|
43
|
+
m,
|
|
44
|
+
s,
|
|
45
|
+
t === u ? f : void 0,
|
|
46
|
+
o
|
|
47
|
+
), i.push(w), i;
|
|
48
|
+
if (t === u) {
|
|
49
|
+
const O = r.getContractWithFetcher(R.ERC20Contract, g);
|
|
50
|
+
i.push(
|
|
51
|
+
E({
|
|
52
|
+
contract: O,
|
|
53
|
+
func: "deposit",
|
|
54
|
+
value: f,
|
|
55
|
+
invokeWallet: o
|
|
56
|
+
})
|
|
57
|
+
), t = g;
|
|
58
|
+
}
|
|
59
|
+
if (c === u && (c = g, I = !0), t !== u && i.push(S(r, t, n, f, o)), a === h.Uniswap ? w = U(
|
|
60
|
+
n,
|
|
61
|
+
t,
|
|
62
|
+
f,
|
|
63
|
+
c,
|
|
64
|
+
s,
|
|
65
|
+
m,
|
|
66
|
+
o
|
|
67
|
+
) : w = C(
|
|
68
|
+
r,
|
|
69
|
+
a,
|
|
70
|
+
n,
|
|
71
|
+
m,
|
|
72
|
+
s,
|
|
73
|
+
void 0,
|
|
74
|
+
o
|
|
75
|
+
), i.push(w), I) {
|
|
76
|
+
const O = ["function withdraw(uint256) external"], P = new x.Contract(c, O);
|
|
77
|
+
i.push(
|
|
78
|
+
E({
|
|
79
|
+
contract: P,
|
|
80
|
+
func: "withdraw",
|
|
81
|
+
args: [D],
|
|
82
|
+
invokeWallet: o
|
|
83
|
+
})
|
|
84
|
+
), c = u;
|
|
85
|
+
}
|
|
86
|
+
return i;
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
U as createSwapToEmporiumOpForUniswap,
|
|
90
|
+
C as createSwapToEmporiumOpFromData,
|
|
91
|
+
z as createSwapToEmporiumOps
|
|
92
|
+
};
|
|
@@ -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("../../externalABIs/index.cjs"),p=require("ethers"),d=require("./emporium.helpers.cjs");var o=(e=>(e[e.Erc20Token=0]="Erc20Token",e[e.Uniswap=1]="Uniswap",e))(o||{});const h=(e,c,n,i,s,a)=>{let r="";switch(e){case 0:r=t.ERC20ABI;break;case 1:r=t.ISwapRouterABI;break}if(!r)throw Error("No ABI match in produceOp");const u=new p.ethers.Contract(c,r);return d.emporiumOp({contract:u,func:n,args:i,invokeWallet:s,value:a})};exports.OpType=o;exports.produceOp=h;
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { abi as s } from "../../externalABIs/ISwapRouter.json.mjs";
|
|
1
|
+
import { ISwapRouterABI as m, ERC20ABI as s } from "../../externalABIs/index.mjs";
|
|
3
2
|
import { ethers as p } from "ethers";
|
|
4
|
-
import { emporiumOp as
|
|
5
|
-
var
|
|
6
|
-
const E = (r, t,
|
|
3
|
+
import { emporiumOp as u } from "./emporium.helpers.mjs";
|
|
4
|
+
var w = /* @__PURE__ */ ((r) => (r[r.Erc20Token = 0] = "Erc20Token", r[r.Uniswap = 1] = "Uniswap", r))(w || {});
|
|
5
|
+
const E = (r, t, e, c, a, n) => {
|
|
7
6
|
let o = "";
|
|
8
7
|
switch (r) {
|
|
9
8
|
case 0:
|
|
10
|
-
o =
|
|
9
|
+
o = s;
|
|
11
10
|
break;
|
|
12
11
|
case 1:
|
|
13
|
-
o =
|
|
12
|
+
o = m;
|
|
14
13
|
break;
|
|
15
14
|
}
|
|
16
15
|
if (!o)
|
|
17
16
|
throw Error("No ABI match in produceOp");
|
|
18
|
-
const
|
|
19
|
-
return
|
|
17
|
+
const i = new p.Contract(t, o);
|
|
18
|
+
return u({ contract: i, func: e, args: c, invokeWallet: a, value: n });
|
|
20
19
|
};
|
|
21
20
|
export {
|
|
22
|
-
|
|
21
|
+
w as OpType,
|
|
23
22
|
E as produceOp
|
|
24
23
|
};
|
|
@@ -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("ethers"),n=require("../../constants/chains.constants.cjs"),u=require("../../constants/protocol.constants.cjs"),y=require("../utils/caseInsensitive.utils.cjs"),w=require("../../types/ethereum-network.types.cjs"),g=require("../../error-handling/logger.cjs"),p=["function getWallet(bytes32 salt) external view returns (address)"],i=async(e,r)=>{const s=t.utils.hexlify(t.utils.zeroPad(t.utils.arrayify(r),32)),c=new t.ethers.providers.JsonRpcProvider(n.networkRegistry[`${e}`].fetchRpcUrl),{hinkalWalletFactoryAddress:o}=n.networkRegistry[e].contractData;if(!o)throw new Error(`Invalid deployer address ${o}`);const l=await new t.ethers.Contract(o,p,c).getWallet(s);if(!l)throw new Error("Wallet address in Wallet Factory not found");return l},h=async(e,r,s)=>i(e,r.getWalletSalt(s)),W=async(e,r)=>{const s=e.getCurrentChainId(),{userKeys:c}=e,o=c.getWalletSalt(r),a=await e.getContractWithFetcher(w.ContractType.HinkalWalletFactory).getWallet(o);g.Logger.log("check if wallet is deployed for subaccount",{walletAddress:a});const d=await new t.ethers.providers.JsonRpcProvider(n.networkRegistry[s].fetchRpcUrl).getCode(a);return!!a&&d!=="0x"&&!y.caseInsensitiveEqual(a,u.zeroAddress)};exports.calculateSmartContractWalletAddress=i;exports.calculateSmartContractWalletAddressFromNonce=h;exports.isProxyDeployed=W;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { UserKeys } from '../../data-structures/crypto-keys/keys';
|
|
2
|
+
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
3
|
+
export declare const calculateSmartContractWalletAddress: (chainId: number, saltString: string) => Promise<string>;
|
|
4
|
+
export declare const calculateSmartContractWalletAddressFromNonce: (chainId: number, userKeys: UserKeys, walletNonce: bigint) => Promise<string>;
|
|
5
|
+
export declare const isProxyDeployed: (hinkal: IHinkal, walletNonce: bigint) => Promise<boolean>;
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import { utils as
|
|
2
|
-
import { networkRegistry as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { utils as c, ethers as n } from "ethers";
|
|
2
|
+
import { networkRegistry as d } from "../../constants/chains.constants.mjs";
|
|
3
|
+
import { zeroAddress as p } from "../../constants/protocol.constants.mjs";
|
|
4
|
+
import { caseInsensitiveEqual as y } from "../utils/caseInsensitive.utils.mjs";
|
|
5
|
+
import { ContractType as f } from "../../types/ethereum-network.types.mjs";
|
|
6
|
+
import { Logger as w } from "../../error-handling/logger.mjs";
|
|
7
|
+
const m = ["function getWallet(bytes32 salt) external view returns (address)"], u = async (t, e) => {
|
|
8
|
+
const r = c.hexlify(c.zeroPad(c.arrayify(e), 32)), s = new n.providers.JsonRpcProvider(d[`${t}`].fetchRpcUrl), { hinkalWalletFactoryAddress: o } = d[t].contractData;
|
|
9
|
+
if (!o)
|
|
10
|
+
throw new Error(`Invalid deployer address ${o}`);
|
|
11
|
+
const l = await new n.Contract(o, m, s).getWallet(r);
|
|
12
|
+
if (!l)
|
|
13
|
+
throw new Error("Wallet address in Wallet Factory not found");
|
|
14
|
+
return l;
|
|
15
|
+
}, A = async (t, e, r) => u(t, e.getWalletSalt(r)), x = async (t, e) => {
|
|
16
|
+
const r = t.getCurrentChainId(), { userKeys: s } = t, o = s.getWalletSalt(e), a = await t.getContractWithFetcher(f.HinkalWalletFactory).getWallet(o);
|
|
17
|
+
w.log("check if wallet is deployed for subaccount", { walletAddress: a });
|
|
18
|
+
const i = await new n.providers.JsonRpcProvider(d[r].fetchRpcUrl).getCode(a);
|
|
19
|
+
return !!a && i !== "0x" && !y(a, p);
|
|
17
20
|
};
|
|
18
21
|
export {
|
|
19
|
-
|
|
22
|
+
u as calculateSmartContractWalletAddress,
|
|
23
|
+
A as calculateSmartContractWalletAddressFromNonce,
|
|
24
|
+
x as isProxyDeployed
|
|
20
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=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 c=r=>{switch(e.getNonLocalhostChainId(r)){case e.chainIds.polygon:return"0x4257ea7637c355f81616050cbb6a9b709fd72683";case e.chainIds.arbMainnet:return"0xb952a807345991bd529fdded05009f5e80fe8f45";case e.chainIds.ethMainnet:return"0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B";case e.chainIds.optimism:return"0x81ab7e0d570b01411fcc4afd3d50ec8c241cb74b";default:return"0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B"}};exports.getCVX=c;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../constants/token-data/index.cjs");const e=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 c=r=>{switch(e.getNonLocalhostChainId(r)){case e.chainIds.polygon:return"0x4257ea7637c355f81616050cbb6a9b709fd72683";case e.chainIds.arbMainnet:return"0xb952a807345991bd529fdded05009f5e80fe8f45";case e.chainIds.ethMainnet:return"0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B";case e.chainIds.optimism:return"0x81ab7e0d570b01411fcc4afd3d50ec8c241cb74b";default:return"0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B"}};exports.getCVX=c;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../../constants/token-data/index.mjs";
|
|
2
|
+
import { getNonLocalhostChainId as o, chainIds as t } 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,20 +7,22 @@ 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
|
-
|
|
11
|
-
|
|
10
|
+
import "../../constants/addresses.constants.mjs";
|
|
11
|
+
import "../../constants/token.limits.constants.mjs";
|
|
12
|
+
const D = (e) => {
|
|
13
|
+
switch (o(e)) {
|
|
14
|
+
case t.polygon:
|
|
12
15
|
return "0x4257ea7637c355f81616050cbb6a9b709fd72683";
|
|
13
|
-
case
|
|
16
|
+
case t.arbMainnet:
|
|
14
17
|
return "0xb952a807345991bd529fdded05009f5e80fe8f45";
|
|
15
|
-
case
|
|
18
|
+
case t.ethMainnet:
|
|
16
19
|
return "0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B";
|
|
17
|
-
case
|
|
20
|
+
case t.optimism:
|
|
18
21
|
return "0x81ab7e0d570b01411fcc4afd3d50ec8c241cb74b";
|
|
19
22
|
default:
|
|
20
23
|
return "0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B";
|
|
21
24
|
}
|
|
22
25
|
};
|
|
23
26
|
export {
|
|
24
|
-
|
|
27
|
+
D as getCVX
|
|
25
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../constants/token-data/index.cjs");require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");const i=require("../../constants/server.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");const o=require("../utils/caseInsensitive.utils.cjs");require("../../constants/addresses.constants.cjs");require("../../constants/token.limits.constants.cjs");require("../../types/circom-data.types.cjs");const s=require("../../types/hinkal.types.cjs");require("../../types/transactions.types.cjs");const n=require("../../types/pendle.types.cjs");require("../../types/curve.types.cjs");require("../../types/activities.types.cjs");require("ethers");require("circomlibjs-hinkal-fork");require("../../error-handling/error-codes.constants.cjs");require("../../data-structures/crypto-keys/keys.cjs");require("idb-keyval");require("../utils/external-action.utils.cjs");const c=require("../utils/erc20tokenFunctions.cjs");require("../utils/convertIntegrationProviderToExternalActionId.cjs");require("axios");require("libsodium-wrappers");require("process");require("buffer");require("../utils/userAgent.cjs");require("../../data-structures/volatile-helper/VolatileHelper.cjs");const T=require("../utils/enum.utils.cjs");function P(e){if(!e)return;const r=c.getERC20Token(e.address,e.chainId);if(!r?.isVolatile)return r}function q(e,r){if(!e||!r)return;let t;switch(r){case n.PendleAssetType.YT:t=e?.yt;break;case n.PendleAssetType.PT:t=e?.pt;break;case n.PendleAssetType.PENDLE_LP:t=e?.lp;break;case n.PendleAssetType.SY:t=e?.sy;break;default:t=void 0;break}return t}const w=(e,r,t)=>{if(o.caseInsensitiveEqual(e.yt.address,t.erc20TokenAddress))return n.PendleSwapType.SwapExactTokenForYt;if(o.caseInsensitiveEqual(e.pt.address,t.erc20TokenAddress))return n.PendleSwapType.SwapExactTokenForPt;if(o.caseInsensitiveEqual(e.yt.address,r.erc20TokenAddress))return n.PendleSwapType.SwapExactYtForToken;if(o.caseInsensitiveEqual(e.pt.address,r.erc20TokenAddress))return n.PendleSwapType.SwapExactPtForToken},F=e=>{let r;switch(e){case n.PendleSwapType.SwapExactTokenForYt:r=i.API_CONFIG.ROUTES.pendleSwapExactTokenForYT;break;case n.PendleSwapType.SwapExactTokenForPt:r=i.API_CONFIG.ROUTES.pendleSwapExactTokenForPt;break;case n.PendleSwapType.SwapExactYtForToken:r=i.API_CONFIG.ROUTES.pendleSwapExactYtForToken;break;case n.PendleSwapType.SwapExactPtForToken:r=i.API_CONFIG.ROUTES.pendleSwapExactPtForToken;break;default:throw new Error("Cant determine Pendle Swap Type Api Route")}return r},k=(e,r,t,a)=>{if(!T.isInEnum(s.PendleAction,e))throw new Error("getTokenIndexForPendleFlatFee: Invalid Pendle Action");if(a)return t.findIndex(d=>d.toLowerCase()===a?.toLowerCase());const u=r.findIndex(d=>d>0n),p=r.length-1;if(r[p]<=0n)throw new Error("getTokenIndexForPendleFlatFee: Last token in amountChange is not > 0");let l=u;return(e===s.PendleAction.Mint||e===s.PendleAction.Redeem||e===s.PendleAction.PoolRemove)&&(l=u),l};exports.determinePendleSwapType=w;exports.determinePendleSwapTypeApiRoute=F;exports.erc20TokenFromPendleAsset=P;exports.getAssetTypeFromPendleMarket=q;exports.getTokenIndexForPendleFlatFee=k;
|