@hinkal/common 0.2.18 → 0.2.20
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 +14 -14
- package/API/API.mjs +92 -93
- package/API/admin-calls.cjs +1 -1
- package/API/admin-calls.d.ts +1 -1
- package/API/admin-calls.mjs +4 -4
- package/API/callLifiAPI.cjs +1 -1
- package/API/callLifiAPI.d.ts +1 -1
- package/API/callLifiAPI.mjs +5 -5
- package/API/callMonitor.cjs +1 -1
- package/API/callMonitor.d.ts +1 -1
- package/API/callMonitor.mjs +7 -7
- package/API/callOdosAPI.cjs +1 -1
- package/API/callOdosAPI.mjs +11 -11
- package/API/callOkxAPI.cjs +1 -1
- package/API/callOkxAPI.d.ts +1 -1
- package/API/callOkxAPI.mjs +5 -5
- package/API/callOneInchAPI.cjs +1 -1
- package/API/callOneInchAPI.mjs +10 -11
- package/API/callRelayer.cjs +1 -1
- package/API/callRelayer.d.ts +6 -3
- package/API/callRelayer.mjs +11 -11
- package/API/checkRisk.cjs +1 -1
- package/API/checkRisk.d.ts +1 -1
- package/API/checkRisk.mjs +4 -4
- package/API/enclaveCalls.cjs +1 -1
- package/API/enclaveCalls.mjs +5 -4
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.mjs +9 -9
- package/API/get-token-data.cjs +1 -1
- package/API/get-token-data.d.ts +1 -1
- package/API/get-token-data.mjs +5 -5
- package/API/get-token-price-chart-data.cjs +1 -0
- package/API/get-token-price-chart-data.d.ts +16 -0
- package/API/get-token-price-chart-data.mjs +13 -0
- package/API/getGasEstimates.cjs +1 -1
- package/API/getGasEstimates.mjs +9 -9
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.d.ts +3 -3
- package/API/getServerURL.mjs +51 -67
- package/API/getTokenPrice.cjs +1 -1
- package/API/getTokenPrice.d.ts +5 -0
- package/API/getTokenPrice.mjs +14 -7
- package/API/index.d.ts +1 -3
- package/API/is-tx-stateless.cjs +1 -1
- package/API/is-tx-stateless.d.ts +1 -1
- package/API/is-tx-stateless.mjs +10 -12
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +4 -8
- package/API/kycCalls.mjs +23 -26
- package/API/onrampCalls.cjs +1 -0
- package/API/onrampCalls.d.ts +20 -0
- package/API/onrampCalls.mjs +15 -0
- package/API/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.d.ts +7 -2
- package/API/proxyAccountsCalls.mjs +27 -21
- package/API/relayCalls.cjs +1 -1
- package/API/relayCalls.mjs +4 -4
- package/API/scheduled-transactions-calls.cjs +1 -1
- package/API/scheduled-transactions-calls.d.ts +1 -1
- package/API/scheduled-transactions-calls.mjs +4 -4
- package/API/simulate-batch-tx.cjs +1 -1
- package/API/simulate-batch-tx.d.ts +2 -2
- package/API/simulate-batch-tx.mjs +7 -6
- package/API/solana-calls.cjs +1 -1
- package/API/solana-calls.d.ts +6 -3
- package/API/solana-calls.mjs +15 -15
- package/API/temporaryWalletCalls.cjs +1 -0
- package/API/temporaryWalletCalls.d.ts +13 -0
- package/API/temporaryWalletCalls.mjs +20 -0
- package/API/token-calls.cjs +1 -1
- package/API/token-calls.mjs +6 -5
- package/API/unspent-utxos-calls.cjs +1 -1
- package/API/unspent-utxos-calls.d.ts +2 -2
- package/API/unspent-utxos-calls.mjs +17 -18
- package/README.md +239 -64
- package/constants/addresses.constants.cjs +1 -1
- package/constants/addresses.constants.d.ts +0 -1
- package/constants/addresses.constants.mjs +7 -8
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +1 -6
- package/constants/chains.constants.mjs +63 -50
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +1 -0
- package/constants/coingecko.constants.mjs +11 -10
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.mjs +34 -41
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-solana.json.mjs +28 -2
- package/constants/function-signatures.constants.cjs +1 -1
- package/constants/function-signatures.constants.d.ts +0 -1
- package/constants/function-signatures.constants.mjs +3 -4
- package/constants/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.mjs +39 -40
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +1 -0
- package/constants/mediaUrls.constants.mjs +2 -1
- package/constants/mystery-boxes.constants.d.ts +0 -0
- package/constants/permit2.constants.cjs +1 -1
- package/constants/permit2.constants.d.ts +0 -1
- package/constants/permit2.constants.mjs +10 -11
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +20 -123
- package/constants/server.constants.mjs +39 -142
- package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistry.json.mjs +0 -24
- package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.mjs +0 -24
- package/constants/token-data/index.d.ts +32 -88
- package/constants/token-data/localhostRegistry.json.cjs +1 -1
- package/constants/token-data/localhostRegistry.json.mjs +0 -26
- package/constants/token-data/polygonRegistry.json.cjs +1 -1
- package/constants/token-data/polygonRegistry.json.mjs +4 -4
- package/constants/token-data/polygonRegistryFixed.json.cjs +1 -1
- package/constants/token-data/polygonRegistryFixed.json.mjs +4 -4
- package/constants/token-data/popularTokens.constants.cjs +1 -1
- package/constants/token-data/popularTokens.constants.mjs +0 -1
- package/data-structures/AccountActions/AccountActions.cjs +1 -0
- package/data-structures/AccountActions/AccountActions.d.ts +18 -0
- package/data-structures/AccountActions/AccountActions.mjs +78 -0
- package/data-structures/AccountActions/index.d.ts +1 -0
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +68 -71
- package/data-structures/BlockchainEvent/BlockchainEvent.cjs +1 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.d.ts +14 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.mjs +41 -0
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +45 -54
- package/data-structures/Hinkal/Hinkal.mjs +314 -341
- package/data-structures/Hinkal/IHinkal.d.ts +40 -52
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.d.ts +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +49 -50
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.mjs +29 -24
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +20 -20
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.mjs +87 -85
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +78 -169
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -0
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +4 -0
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +103 -0
- package/data-structures/Hinkal/hinkalDepostAndBridge.cjs +1 -0
- package/data-structures/Hinkal/hinkalDepostAndBridge.d.ts +4 -0
- package/data-structures/Hinkal/hinkalDepostAndBridge.mjs +214 -0
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +4 -5
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +113 -117
- package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +36 -34
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.mjs +40 -36
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +37 -32
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +1 -2
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +17 -15
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +4 -3
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +84 -95
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +2 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +157 -155
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +2 -3
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +43 -40
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +71 -67
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +63 -59
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +81 -77
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +49 -48
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +2 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +71 -68
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +71 -79
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +72 -71
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +81 -79
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +108 -108
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +107 -53
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.d.ts +1 -0
- package/data-structures/IndexedDB/activity-db.mjs +92 -76
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +40 -37
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +18 -15
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +25 -40
- package/data-structures/PublicBalance/PublicBalanceWatcher.cjs +1 -0
- package/data-structures/PublicBalance/PublicBalanceWatcher.d.ts +20 -0
- package/data-structures/PublicBalance/PublicBalanceWatcher.mjs +124 -0
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.cjs +1 -0
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.d.ts +15 -0
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.mjs +64 -0
- package/data-structures/PublicBalance/index.d.ts +2 -0
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +83 -85
- package/data-structures/TokenDBs/token-visibility-db.cjs +1 -1
- package/data-structures/TokenDBs/token-visibility-db.mjs +22 -36
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.d.ts +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +14 -14
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +0 -11
- package/data-structures/crypto-keys/keys.mjs +47 -107
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.mjs +9 -9
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.mjs +5 -5
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.mjs +6 -6
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractEventService.d.ts +4 -2
- package/data-structures/event-service/evm/AbstractEventService.mjs +19 -19
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +3 -3
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +6 -5
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +1 -2
- package/data-structures/event-service/evm/AbstractSnapshotService.mjs +3 -4
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +10 -5
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +39 -35
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.d.ts +11 -0
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +21 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.d.ts +6 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.mjs +16 -0
- package/data-structures/event-service/helpers/ClientEventHelper.cjs +1 -0
- package/data-structures/event-service/helpers/ClientEventHelper.d.ts +11 -0
- package/data-structures/event-service/helpers/ClientEventHelper.mjs +26 -0
- package/data-structures/event-service/helpers/PollingEventHelper.cjs +1 -0
- package/data-structures/event-service/helpers/PollingEventHelper.d.ts +5 -0
- package/data-structures/event-service/helpers/PollingEventHelper.mjs +14 -0
- package/data-structures/event-service/index.d.ts +4 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +3 -2
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +6 -6
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.d.ts +4 -3
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +8 -8
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +4 -10
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +10 -7
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +3 -2
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +1 -2
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +1 -2
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.d.ts +11 -0
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.mjs +22 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.d.ts +6 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.mjs +16 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +11 -16
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +64 -66
- package/data-structures/index.d.ts +3 -0
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +8 -13
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +6 -4
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +6 -4
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +6 -4
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +6 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +6 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +5 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +6 -4
- package/data-structures/utxo/Utxo.cjs +1 -1
- package/data-structures/utxo/Utxo.d.ts +2 -7
- package/data-structures/utxo/Utxo.mjs +40 -36
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +1 -0
- package/error-handling/error-codes.constants.mjs +4 -3
- package/error-handling/get-error.message.cjs +1 -1
- package/error-handling/get-error.message.mjs +21 -27
- package/error-handling/index.d.ts +0 -1
- package/functions/index.d.ts +0 -1
- package/functions/kyc/zkMeHelper.cjs +1 -1
- package/functions/kyc/zkMeHelper.mjs +18 -17
- package/functions/pre-transaction/constructAdminData.cjs +1 -1
- package/functions/pre-transaction/constructAdminData.d.ts +2 -2
- package/functions/pre-transaction/constructAdminData.mjs +12 -18
- package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
- package/functions/pre-transaction/getExternalSwapAddress.d.ts +1 -2
- package/functions/pre-transaction/getExternalSwapAddress.mjs +8 -8
- package/functions/pre-transaction/getFlatFees.cjs +1 -1
- package/functions/pre-transaction/getFlatFees.mjs +22 -30
- package/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
- package/functions/pre-transaction/getSolanaCalldataHash.mjs +22 -22
- package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +21 -36
- package/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
- package/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +1 -1
- package/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +17 -17
- package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -1
- package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +1 -9
- package/functions/pre-transaction/outputApprovalDataProcessing.mjs +19 -34
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -1
- package/functions/pre-transaction/sendV0Transaction.mjs +53 -50
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +4 -4
- package/functions/pre-transaction/solana-public-signals.cjs +1 -1
- package/functions/pre-transaction/solana-public-signals.d.ts +1 -0
- package/functions/pre-transaction/solana-public-signals.mjs +29 -26
- package/functions/pre-transaction/solana.cjs +1 -1
- package/functions/pre-transaction/solana.d.ts +2 -1
- package/functions/pre-transaction/solana.mjs +89 -80
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +4 -5
- package/functions/private-wallet/emporium.helpers.mjs +94 -109
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.d.ts +1 -4
- package/functions/private-wallet/emporium.swap.helpers.mjs +100 -102
- package/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/functions/snarkjs/common.snarkjs.d.ts +1 -1
- package/functions/snarkjs/common.snarkjs.mjs +64 -64
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.d.ts +1 -2
- package/functions/snarkjs/constructEmporiumProof.mjs +89 -89
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +1 -2
- package/functions/snarkjs/constructGeneralZkProof.mjs +117 -121
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/functions/snarkjs/constructSolanaZkProof.d.ts +1 -1
- package/functions/snarkjs/constructSolanaZkProof.mjs +58 -59
- package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +11 -10
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +1 -0
- package/functions/utils/addresses.mjs +13 -12
- package/functions/utils/bytes32.utils.cjs +1 -1
- package/functions/utils/bytes32.utils.mjs +8 -7
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.mjs +2 -2
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +1 -1
- package/functions/utils/create-provider.mjs +13 -9
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.d.ts +0 -1
- package/functions/utils/erc20tokenFunctions.mjs +22 -29
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.mjs +11 -11
- package/functions/utils/index.d.ts +0 -1
- package/functions/utils/involves-permit2-op.cjs +1 -1
- package/functions/utils/involves-permit2-op.d.ts +0 -1
- package/functions/utils/involves-permit2-op.mjs +4 -6
- package/functions/utils/mutexes.utils.cjs +1 -1
- package/functions/utils/mutexes.utils.d.ts +1 -1
- package/functions/utils/mutexes.utils.mjs +3 -3
- package/functions/utils/nftTokenFunctions.cjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +8 -23
- package/functions/utils/prepareHinkal.cjs +1 -1
- package/functions/utils/prepareHinkal.d.ts +6 -13
- package/functions/utils/prepareHinkal.mjs +45 -72
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.mjs +49 -54
- package/functions/utils/socket.utils.cjs +1 -0
- package/functions/utils/socket.utils.d.ts +1 -0
- package/functions/utils/socket.utils.mjs +12 -0
- package/functions/utils/string.utils.cjs +1 -1
- package/functions/utils/string.utils.d.ts +1 -0
- package/functions/utils/string.utils.mjs +18 -14
- package/functions/utils/token-check.utils.cjs +1 -1
- package/functions/utils/token-check.utils.d.ts +3 -0
- package/functions/utils/token-check.utils.mjs +18 -7
- package/functions/utils/upToDateState.cjs +1 -1
- package/functions/utils/upToDateState.d.ts +1 -1
- package/functions/utils/upToDateState.mjs +4 -4
- package/functions/utils/walletBalances.utils.cjs +1 -1
- package/functions/utils/walletBalances.utils.d.ts +2 -17
- package/functions/utils/walletBalances.utils.mjs +5 -36
- package/functions/web3/crypto.cjs +1 -0
- package/functions/web3/crypto.d.ts +1 -0
- package/functions/web3/crypto.mjs +7 -0
- package/functions/web3/events/getApprovedBalance.cjs +1 -1
- package/functions/web3/events/getApprovedBalance.d.ts +3 -4
- package/functions/web3/events/getApprovedBalance.mjs +39 -44
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.d.ts +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.mjs +107 -112
- package/functions/web3/events/getShieldedBalance.cjs +2 -2
- package/functions/web3/events/getShieldedBalance.d.ts +1 -1
- package/functions/web3/events/getShieldedBalance.mjs +71 -70
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.mjs +38 -38
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +13 -10
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +1 -6
- package/functions/web3/functionCalls/accessTokenCalls.mjs +12 -21
- package/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/functions/web3/functionCalls/approveToken.d.ts +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +50 -46
- package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -1
- package/functions/web3/functionCalls/approveTokensToHinkal.d.ts +1 -1
- package/functions/web3/functionCalls/approveTokensToHinkal.mjs +6 -6
- package/functions/web3/functionCalls/estimateGasRelayer.cjs +1 -1
- package/functions/web3/functionCalls/estimateGasRelayer.d.ts +1 -2
- package/functions/web3/functionCalls/estimateGasRelayer.mjs +10 -10
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.d.ts +1 -1
- package/functions/web3/functionCalls/transactCallDirect.mjs +36 -40
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.mjs +36 -34
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +17 -22
- package/functions/web3/getPublicAddressBalance.cjs +1 -1
- package/functions/web3/getPublicAddressBalance.d.ts +1 -1
- package/functions/web3/getPublicAddressBalance.mjs +6 -6
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +27 -27
- package/functions/web3/index.d.ts +1 -0
- package/functions/web3/lifiAPI.cjs +1 -1
- package/functions/web3/lifiAPI.d.ts +1 -1
- package/functions/web3/lifiAPI.mjs +12 -12
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.mjs +6 -19
- package/functions/web3/okxAPI.cjs +1 -1
- package/functions/web3/okxAPI.mjs +22 -22
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +7 -20
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +38 -56
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +22 -34
- package/index.cjs +1 -1
- package/index.mjs +941 -949
- package/package.json +3 -2
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +10 -17
- package/providers/EthersProviderAdapter.mjs +45 -76
- package/providers/SolanaProviderAdapter.cjs +1 -1
- package/providers/SolanaProviderAdapter.d.ts +7 -11
- package/providers/SolanaProviderAdapter.mjs +16 -31
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +11 -17
- package/providers/WagmiProviderAdapter.mjs +86 -117
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +15 -9
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +16 -9
- package/types/TransactionSimulator.types.d.ts +2 -9
- package/types/activities.types.d.ts +2 -0
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +0 -6
- package/types/admin.types.mjs +2 -2
- package/types/balances.types.d.ts +0 -1
- package/types/bridging-tx.types.d.ts +17 -0
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +6 -3
- package/types/cache.types.mjs +1 -1
- package/types/coingecko.types.d.ts +5 -0
- package/types/ethereum-network.types.cjs +1 -1
- package/types/ethereum-network.types.d.ts +2 -8
- package/types/ethereum-network.types.mjs +1 -1
- package/types/events.types.cjs +1 -0
- package/types/events.types.d.ts +9 -0
- package/types/events.types.mjs +5 -0
- package/types/external-action.types.cjs +1 -1
- package/types/external-action.types.d.ts +0 -1
- package/types/external-action.types.mjs +1 -1
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +1 -7
- package/types/hinkal.types.mjs +22 -23
- package/types/index.d.ts +3 -3
- package/types/onramp.types.cjs +1 -0
- package/types/onramp.types.d.ts +58 -0
- package/types/onramp.types.mjs +4 -0
- package/types/proxy.types.d.ts +11 -3
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +10 -39
- package/types/sandbox.types.mjs +2 -2
- package/types/session.types.d.ts +2 -0
- package/types/solana.types.d.ts +9 -0
- package/types/token-prices.types.cjs +1 -1
- package/types/token-prices.types.d.ts +7 -0
- package/types/token-prices.types.mjs +4 -2
- package/types/token.types.d.ts +5 -0
- package/types/transactions.types.cjs +1 -1
- package/types/transactions.types.d.ts +2 -4
- package/types/transactions.types.mjs +3 -3
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +2 -2
- package/API/ai-calls.cjs +0 -1
- package/API/ai-calls.d.ts +0 -17
- package/API/ai-calls.mjs +0 -21
- package/API/duneAPI.cjs +0 -1
- package/API/duneAPI.d.ts +0 -11
- package/API/duneAPI.mjs +0 -25
- package/API/getBridgeProtocols.cjs +0 -1
- package/API/getBridgeProtocols.d.ts +0 -7
- package/API/getBridgeProtocols.mjs +0 -8
- package/API/getLifiStatus.cjs +0 -1
- package/API/getLifiStatus.d.ts +0 -24
- package/API/getLifiStatus.mjs +0 -15
- package/API/getRelayerURL.cjs +0 -1
- package/API/getRelayerURL.d.ts +0 -1
- package/API/getRelayerURL.mjs +0 -10
- package/API/passwordCalls.cjs +0 -1
- package/API/passwordCalls.d.ts +0 -9
- package/API/passwordCalls.mjs +0 -13
- package/API/restoreSnapshots.cjs +0 -1
- package/API/restoreSnapshots.d.ts +0 -1
- package/API/restoreSnapshots.mjs +0 -10
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +0 -1
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +0 -7
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +0 -42
- package/data-structures/Hinkal/hinkalActionStake.d.ts +0 -3
- package/data-structures/Hinkal/hinkalApprove.cjs +0 -1
- package/data-structures/Hinkal/hinkalApprove.d.ts +0 -3
- package/data-structures/Hinkal/hinkalApprove.mjs +0 -115
- package/data-structures/Hinkal/hinkalInsideTransact.cjs +0 -1
- package/data-structures/Hinkal/hinkalInsideTransact.d.ts +0 -4
- package/data-structures/Hinkal/hinkalInsideTransact.mjs +0 -121
- package/error-handling/handleErrorRestore.cjs +0 -1
- package/error-handling/handleErrorRestore.d.ts +0 -2
- package/error-handling/handleErrorRestore.mjs +0 -11
- package/functions/kyc/authentoHelper.cjs +0 -1
- package/functions/kyc/authentoHelper.d.ts +0 -12
- package/functions/kyc/authentoHelper.mjs +0 -30
- package/functions/staking/index.cjs +0 -1
- package/functions/staking/index.d.ts +0 -11
- package/functions/staking/index.mjs +0 -42
- package/functions/utils/get-hinkal-approvals.cjs +0 -1
- package/functions/utils/get-hinkal-approvals.d.ts +0 -3
- package/functions/utils/get-hinkal-approvals.mjs +0 -38
- package/functions/utils/replaceAddressInCalldata.cjs +0 -1
- package/functions/utils/replaceAddressInCalldata.d.ts +0 -1
- package/functions/utils/replaceAddressInCalldata.mjs +0 -7
- package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +0 -1
- package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +0 -5
- package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +0 -32
- package/types/bridging.types.d.ts +0 -29
- package/types/duneAPI.types.d.ts +0 -9
- package/types/hinkal.stake.types.cjs +0 -1
- package/types/hinkal.stake.types.d.ts +0 -11
- package/types/hinkal.stake.types.mjs +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { networkRegistry as
|
|
1
|
+
import { networkRegistry as C } from "../../constants/chains.constants.mjs";
|
|
2
2
|
import { transactionErrorCodes as R } from "../../error-handling/error-codes.constants.mjs";
|
|
3
3
|
import "ethers";
|
|
4
4
|
import "../../types/circom-data.types.mjs";
|
|
@@ -6,156 +6,152 @@ import { ContractType as Y } from "../../types/ethereum-network.types.mjs";
|
|
|
6
6
|
import { ExternalActionId as j } from "../../types/external-action.types.mjs";
|
|
7
7
|
import { defaultHinkalLogicArgs as G } from "../../types/hinkal.types.mjs";
|
|
8
8
|
import "../../types/transactions.types.mjs";
|
|
9
|
-
import { AdminTransactionType as
|
|
9
|
+
import { AdminTransactionType as J } from "../../types/admin.types.mjs";
|
|
10
10
|
import "../../types/activities.types.mjs";
|
|
11
|
+
import "../../constants/vite.constants.mjs";
|
|
12
|
+
import { constructEmporiumProof as Q } from "../../functions/snarkjs/constructEmporiumProof.mjs";
|
|
13
|
+
import { outputUtxoProcessing as X } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
|
|
14
|
+
import { addPaddingToUtxos as Z } from "../../functions/web3/events/getShieldedBalance.mjs";
|
|
15
|
+
import { estimateGasRelayer as $ } from "../../functions/web3/functionCalls/estimateGasRelayer.mjs";
|
|
16
|
+
import { transactCallRelayer as I } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
17
|
+
import { uniswapWorkaround as h } from "../../functions/utils/involves-permit2-op.mjs";
|
|
18
|
+
import { outputApprovalDataProcessing as rr } from "../../functions/pre-transaction/outputApprovalDataProcessing.mjs";
|
|
19
|
+
import { convertEmporiumOpToCallInfo as tr } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
20
|
+
import { getFeeStructure as or } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
21
|
+
import { shouldPatchAccessTokenMerkleTree as er } from "../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs";
|
|
22
|
+
import { getSignatureDataForTransact as sr } from "../../functions/pre-transaction/getSignatureDataForTransact.mjs";
|
|
23
|
+
import { mergeWithFeeStructureEmporium as mr } from "../../functions/pre-transaction/merge-with-fee-structure-emporium.mjs";
|
|
24
|
+
import { caseInsensitiveEqual as ir } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
25
|
+
import { getCurrentTimeInSeconds as ar } from "../../functions/utils/time.utils.mjs";
|
|
26
|
+
import { handleAutoDepositBack as pr } from "./handleAutoDepositBack.mjs";
|
|
11
27
|
import "../../constants/server.constants.mjs";
|
|
12
28
|
import "../../API/getServerURL.mjs";
|
|
13
29
|
import "../http/HttpClient.mjs";
|
|
14
30
|
import "axios";
|
|
15
|
-
import "
|
|
16
|
-
import "
|
|
17
|
-
import "process";
|
|
18
|
-
import "buffer";
|
|
19
|
-
import "../../constants/vite.constants.mjs";
|
|
20
|
-
import "../../constants/save-depths.mjs";
|
|
21
|
-
import { caseInsensitiveEqual as J } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
22
|
-
import "../../constants/reorg-depths.constants.mjs";
|
|
23
|
-
import "../../functions/utils/mutexes.utils.mjs";
|
|
31
|
+
import "../../constants/token-data/index.mjs";
|
|
32
|
+
import { constructAdminData as cr } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
24
33
|
import "@coral-xyz/anchor";
|
|
25
34
|
import "@solana/web3.js";
|
|
26
|
-
import
|
|
27
|
-
import { getCurrentTimeInSeconds as X } from "../../functions/utils/time.utils.mjs";
|
|
28
|
-
import { constructEmporiumProof as Z } from "../../functions/snarkjs/constructEmporiumProof.mjs";
|
|
29
|
-
import { outputUtxoProcessing as $ } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
|
|
30
|
-
import { addPaddingToUtxos as b } from "../../functions/web3/events/getShieldedBalance.mjs";
|
|
31
|
-
import { estimateGasRelayer as h } from "../../functions/web3/functionCalls/estimateGasRelayer.mjs";
|
|
32
|
-
import { transactCallRelayer as tt } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
33
|
-
import { uniswapWorkaround as rt } from "../../functions/utils/involves-permit2-op.mjs";
|
|
34
|
-
import { outputApprovalDataProcessing as ot } from "../../functions/pre-transaction/outputApprovalDataProcessing.mjs";
|
|
35
|
-
import { convertEmporiumOpToCallInfo as et } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
36
|
-
import { getFeeStructure as it } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
37
|
-
import { shouldPatchAccessTokenMerkleTree as mt } from "../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs";
|
|
38
|
-
import { getSignatureDataForTransact as at } from "../../functions/pre-transaction/getSignatureDataForTransact.mjs";
|
|
39
|
-
import { mergeWithFeeStructureEmporium as pt } from "../../functions/pre-transaction/merge-with-fee-structure-emporium.mjs";
|
|
40
|
-
import { handleAutoDepositBack as st } from "./handleAutoDepositBack.mjs";
|
|
41
|
-
import "../../constants/token-data/index.mjs";
|
|
42
|
-
import { constructAdminData as nt } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
35
|
+
import "circomlibjs-hinkal-fork";
|
|
43
36
|
import "@solana/spl-token";
|
|
44
|
-
import {
|
|
45
|
-
import
|
|
46
|
-
|
|
47
|
-
|
|
37
|
+
import { AccountActions as S } from "../AccountActions/AccountActions.mjs";
|
|
38
|
+
import "buffer";
|
|
39
|
+
import { recipientUtxoProcessing as ur } from "../../functions/pre-transaction/recipientUtxoProcessing.mjs";
|
|
40
|
+
import { isValidPrivateAddress as fr } from "../../functions/utils/addresses.mjs";
|
|
41
|
+
const Ir = async (o, r, k, e, A, c, m, l, U, F, B, H = !1, K, w, u, T = !1) => {
|
|
42
|
+
if (u && !fr(u.recipientInfo))
|
|
48
43
|
throw Error(R.RECIPIENT_FORMAT_INCORRECT);
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
44
|
+
const s = k.map((t) => t.erc20TokenAddress), i = S.getAddressFromSubAccount(r, l);
|
|
45
|
+
if (!i)
|
|
46
|
+
throw Error("Public account address is not available");
|
|
47
|
+
const { contractData: L } = C[r], { emporiumAddress: f } = L;
|
|
48
|
+
if (!f)
|
|
51
49
|
throw Error("No Emporium Address Provided");
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
const n = F ?? await or(
|
|
51
|
+
r,
|
|
52
|
+
U,
|
|
53
|
+
s,
|
|
56
54
|
j.Emporium,
|
|
57
|
-
|
|
58
|
-
), W =
|
|
59
|
-
(
|
|
55
|
+
c.map((t) => tr(t, i ?? "", r))
|
|
56
|
+
), W = m.find(
|
|
57
|
+
(t) => ir(t.token.erc20TokenAddress, n.feeToken)
|
|
60
58
|
)?.amount ?? 0n;
|
|
61
|
-
for (
|
|
62
|
-
t,
|
|
63
|
-
c,
|
|
64
|
-
p,
|
|
59
|
+
for (i && await mr(
|
|
65
60
|
o,
|
|
61
|
+
r,
|
|
62
|
+
i,
|
|
63
|
+
c,
|
|
64
|
+
s,
|
|
66
65
|
e,
|
|
67
|
-
|
|
66
|
+
n,
|
|
68
67
|
W
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
for (let
|
|
73
|
-
const { outputUtxos: V } =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
e[
|
|
68
|
+
); A.length < s.length; )
|
|
69
|
+
A.push(!1);
|
|
70
|
+
const a = [...await Z(o, r, s, e)], d = [], p = G(e.length, o.userKeys), y = ar().toString();
|
|
71
|
+
for (let t = 0; t < s.length; t += 1) {
|
|
72
|
+
const { outputUtxos: V } = X(
|
|
73
|
+
o.userKeys,
|
|
74
|
+
a[t],
|
|
75
|
+
e[t],
|
|
77
76
|
y,
|
|
78
77
|
void 0,
|
|
79
78
|
!1
|
|
80
79
|
);
|
|
81
|
-
|
|
82
|
-
const { useApprovalUtxoData:
|
|
83
|
-
|
|
80
|
+
d.push(V);
|
|
81
|
+
const { useApprovalUtxoData: D } = rr(o, r, a[t], e[t]);
|
|
82
|
+
D && (p.doPreTxApproval = !0, p.useApprovalUtxoData[t] = D, p.interactionAddress = f, p.inHinkalAddress = o.userKeys.getInHinkalAddress(f));
|
|
84
83
|
}
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
if (!
|
|
84
|
+
u && ur(u, d, e, y);
|
|
85
|
+
const E = B ?? await o.getRandomRelay(r, !T);
|
|
86
|
+
if (!E)
|
|
88
87
|
throw Error(R.RELAYER_NOT_AVAILABLE);
|
|
89
|
-
const { patchAccessTokenMerkleTree: N, kycRequired: O, hasAccessToken: _ } = await
|
|
90
|
-
t,
|
|
88
|
+
const { patchAccessTokenMerkleTree: N, kycRequired: O, hasAccessToken: _ } = await er(
|
|
91
89
|
o,
|
|
90
|
+
r,
|
|
91
|
+
s,
|
|
92
92
|
e
|
|
93
|
-
),
|
|
94
|
-
|
|
95
|
-
await
|
|
96
|
-
|
|
93
|
+
), b = await sr(
|
|
94
|
+
r,
|
|
95
|
+
await o.getEthereumAddressByChain(r),
|
|
96
|
+
o.userKeys,
|
|
97
97
|
O,
|
|
98
98
|
_
|
|
99
|
-
), { zkCallData: P, circomData:
|
|
99
|
+
), { zkCallData: P, circomData: g, dimData: v, authorizationData: x } = await Q(
|
|
100
100
|
"v1x1",
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
T,
|
|
107
|
-
t.userKeys,
|
|
108
|
-
e.length,
|
|
109
|
-
m.length > 0 ? m[0].length : 0,
|
|
110
|
-
u,
|
|
111
|
-
p,
|
|
112
|
-
t.generateProofRemotely,
|
|
113
|
-
v,
|
|
114
|
-
t.getCurrentChainId(),
|
|
101
|
+
o.merkleTreeHinkalByChain[r],
|
|
102
|
+
o.merkleTreeAccessTokenByChain[r],
|
|
103
|
+
s,
|
|
104
|
+
s.map(() => 0),
|
|
105
|
+
a,
|
|
115
106
|
d,
|
|
116
|
-
|
|
107
|
+
o.userKeys,
|
|
108
|
+
e.length,
|
|
109
|
+
a.length > 0 ? a[0].length : 0,
|
|
110
|
+
f,
|
|
111
|
+
c,
|
|
112
|
+
o.generateProofRemotely,
|
|
113
|
+
E,
|
|
114
|
+
r,
|
|
117
115
|
A,
|
|
118
|
-
|
|
116
|
+
void 0,
|
|
117
|
+
S.getPrivateKeyFromSubAccount(r, l),
|
|
118
|
+
p,
|
|
119
119
|
N,
|
|
120
120
|
void 0,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
),
|
|
125
|
-
if (
|
|
126
|
-
return await
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
await
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
w ? o : void 0,
|
|
137
|
-
// erc20AddressesToFund
|
|
138
|
-
w ? i : void 0
|
|
139
|
-
), B = await tt(
|
|
140
|
-
t.getCurrentChainId(),
|
|
121
|
+
n,
|
|
122
|
+
o.getContractWithFetcher(r, Y.HinkalHelperContract),
|
|
123
|
+
b
|
|
124
|
+
), M = h(c);
|
|
125
|
+
if (T)
|
|
126
|
+
return await $(r, P, v, g, x);
|
|
127
|
+
const q = cr(
|
|
128
|
+
w,
|
|
129
|
+
r,
|
|
130
|
+
m.map((t) => t.token.erc20TokenAddress),
|
|
131
|
+
m.map((t) => t.amount),
|
|
132
|
+
await o.getEthereumAddressByChain(r),
|
|
133
|
+
w === J.PublicSwap ? m.map(({ token: t }) => t) : void 0
|
|
134
|
+
), z = await I(
|
|
135
|
+
r,
|
|
141
136
|
P,
|
|
142
|
-
|
|
143
|
-
|
|
137
|
+
v,
|
|
138
|
+
g,
|
|
144
139
|
!1,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
140
|
+
M,
|
|
141
|
+
x,
|
|
142
|
+
q
|
|
148
143
|
);
|
|
149
|
-
return H &&
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
A,
|
|
153
|
-
f.feeToken,
|
|
154
|
-
C,
|
|
144
|
+
return H && pr(
|
|
145
|
+
o,
|
|
146
|
+
r,
|
|
155
147
|
i,
|
|
156
|
-
l
|
|
157
|
-
|
|
148
|
+
l,
|
|
149
|
+
n.feeToken,
|
|
150
|
+
K,
|
|
151
|
+
m,
|
|
152
|
+
g
|
|
153
|
+
), z;
|
|
158
154
|
};
|
|
159
155
|
export {
|
|
160
|
-
|
|
156
|
+
Ir as hinkalPrivateWallet
|
|
161
157
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../functions/snarkjs/common.snarkjs.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../functions/snarkjs/common.snarkjs.cjs"),A=require("../../functions/web3/etherFunctions.cjs"),d=require("../../types/ethereum-network.types.cjs"),k=require("../utxo/Utxo.cjs"),g=require("../../constants/protocol.constants.cjs"),y=require("../../functions/utils/caseInsensitive.utils.cjs"),u=require("../../functions/utils/token-check.utils.cjs"),q=(n,t)=>{const o=[];let r=0;for(let e=0;e<n.length;e+=1){let i=!1;for(let a=0;a<r;a+=1)if(u.isSameERC20Token(o[a].token,n[e])){o[a].balance+=t[e],i=!0;break}i||(o[r]={token:n[e],balance:t[e]},r+=1)}return o},v=async(n,t,o)=>{const r=q(t,o),e=u.validateAndGetChainId(t),a=n.getContractWithSigner(e,d.ContractType.HinkalContract).address;for(let s=0;s<r.length;s+=1)y.caseInsensitiveEqual(r[s].token.erc20TokenAddress,g.zeroAddress)||await(await n.getContractWithSigner(e,d.ContractType.ERC20Contract,r[s].token.erc20TokenAddress).approve(a,r[s].balance)).wait()},S=async(n,t,o,r)=>{const e=u.validateAndGetChainId(t),i=n.getContractWithSigner(e,d.ContractType.HinkalContract),a=n.userKeys.getShieldedPrivateKey(),s=k.Utxo.findCorrectRandomization(A.randomBigInt(31),a),c=r??Array(t.length).fill(f.calcStealthAddressStructure(s,a));if(c.length!==t.length)throw new Error("Stealth address structures length must be equal to erc20 tokens length");await v(n,t,o);const h=t.findIndex(l=>l.erc20TokenAddress===g.zeroAddress),p=o[h]??0n,C=await i.prooflessDeposit(t.map(({erc20TokenAddress:l})=>l),o,t.map(()=>0n),c,{value:p});return await C.wait(),C};exports.hinkalProoflessDeposit=S;
|
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import { calcStealthAddressStructure as
|
|
2
|
-
import { randomBigInt as
|
|
3
|
-
import { ContractType as
|
|
1
|
+
import { calcStealthAddressStructure as g } from "../../functions/snarkjs/common.snarkjs.mjs";
|
|
2
|
+
import { randomBigInt as C } from "../../functions/web3/etherFunctions.mjs";
|
|
3
|
+
import { ContractType as d } from "../../types/ethereum-network.types.mjs";
|
|
4
4
|
import { Utxo as A } from "../utxo/Utxo.mjs";
|
|
5
|
-
import { zeroAddress as
|
|
6
|
-
import { caseInsensitiveEqual as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { zeroAddress as m } from "../../constants/protocol.constants.mjs";
|
|
6
|
+
import { caseInsensitiveEqual as w } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
7
|
+
import { validateAndGetChainId as p, isSameERC20Token as S } from "../../functions/utils/token-check.utils.mjs";
|
|
8
|
+
const k = (n, t) => {
|
|
9
|
+
const o = [];
|
|
10
|
+
let r = 0;
|
|
11
|
+
for (let e = 0; e < n.length; e += 1) {
|
|
11
12
|
let s = !1;
|
|
12
|
-
for (let
|
|
13
|
-
if (
|
|
14
|
-
|
|
13
|
+
for (let a = 0; a < r; a += 1)
|
|
14
|
+
if (S(o[a].token, n[e])) {
|
|
15
|
+
o[a].balance += t[e], s = !0;
|
|
15
16
|
break;
|
|
16
17
|
}
|
|
17
|
-
s || (
|
|
18
|
-
token:
|
|
19
|
-
balance: e
|
|
20
|
-
},
|
|
18
|
+
s || (o[r] = {
|
|
19
|
+
token: n[e],
|
|
20
|
+
balance: t[e]
|
|
21
|
+
}, r += 1);
|
|
21
22
|
}
|
|
22
|
-
return
|
|
23
|
-
},
|
|
24
|
-
const
|
|
25
|
-
for (let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
return o;
|
|
24
|
+
}, v = async (n, t, o) => {
|
|
25
|
+
const r = k(t, o), e = p(t), a = n.getContractWithSigner(e, d.HinkalContract).address;
|
|
26
|
+
for (let i = 0; i < r.length; i += 1)
|
|
27
|
+
w(r[i].token.erc20TokenAddress, m) || await (await n.getContractWithSigner(
|
|
28
|
+
e,
|
|
29
|
+
d.ERC20Contract,
|
|
30
|
+
r[i].token.erc20TokenAddress
|
|
31
|
+
).approve(a, r[i].balance)).wait();
|
|
32
|
+
}, W = async (n, t, o, r) => {
|
|
33
|
+
const e = p(t), s = n.getContractWithSigner(e, d.HinkalContract), a = n.userKeys.getShieldedPrivateKey(), i = A.findCorrectRandomization(C(31), a), c = r ?? Array(t.length).fill(g(i, a));
|
|
34
|
+
if (c.length !== t.length)
|
|
33
35
|
throw new Error("Stealth address structures length must be equal to erc20 tokens length");
|
|
34
|
-
await
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
await v(n, t, o);
|
|
37
|
+
const h = t.findIndex((l) => l.erc20TokenAddress === m), u = o[h] ?? 0n, f = await s.prooflessDeposit(
|
|
38
|
+
t.map(({ erc20TokenAddress: l }) => l),
|
|
39
|
+
o,
|
|
40
|
+
t.map(() => 0n),
|
|
41
|
+
c,
|
|
40
42
|
{ value: u }
|
|
41
43
|
);
|
|
42
44
|
return await f.wait(), f;
|
|
43
45
|
};
|
|
44
46
|
export {
|
|
45
|
-
|
|
47
|
+
W as hinkalProoflessDeposit
|
|
46
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../constants/addresses.constants.cjs"),y=require("../../functions/pre-transaction/getFeeStructure.cjs"),P=require("../../functions/private-wallet/emporium.swap.helpers.cjs"),g=require("../../functions/utils/convertEmporiumOpToCallInfo.cjs"),v=require("../../types/external-action.types.cjs"),C=require("../../error-handling/error-codes.constants.cjs"),I=require("../../constants/protocol.constants.cjs"),O=require("../../functions/utils/token-check.utils.cjs"),L=require("../AccountActions/AccountActions.cjs"),T=async(t,o,s,u,A,m,p,n,E,S=!1,_,w,d=!1)=>{if(!n)throw new Error("Fee token is required in hinkalProxySwap");const r=O.validateAndGetChainId(o),a=L.AccountActions.getAddressFromSubAccount(r,p);if(!a)throw Error("Public account address is not available");const c=o.map(e=>e.erc20TokenAddress),i=await t.getRandomRelay(r,!d);if(!i)throw Error(C.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const l=await P.createSwapToEmporiumOps(t,r,u,f.SWAP_ROUTER_ADDRESSES[u][r],A,c[0],s[0],s[1],c[1],m,a,i,!0),q=E??await y.getFeeStructure(r,n,c,v.ExternalActionId.Emporium,l.map(e=>g.convertEmporiumOpToCallInfo(e,a,r)),I.HINKAL_SWAP_VARIABLE_RATE),h=o.map((e,R)=>({token:e,amount:s[R]}));return t.actionPrivateWallet(r,[],[],[],l,h,p,n,q,i,S,_,w,void 0,d)};exports.hinkalProxySwap=T;
|
|
@@ -1,60 +1,64 @@
|
|
|
1
1
|
import { SWAP_ROUTER_ADDRESSES as I } from "../../constants/addresses.constants.mjs";
|
|
2
|
-
import { getFeeStructure as
|
|
3
|
-
import { createSwapToEmporiumOps as
|
|
4
|
-
import { convertEmporiumOpToCallInfo as
|
|
5
|
-
import { ExternalActionId as
|
|
6
|
-
import { transactionErrorCodes as
|
|
7
|
-
import { HINKAL_SWAP_VARIABLE_RATE as
|
|
8
|
-
import {
|
|
9
|
-
|
|
2
|
+
import { getFeeStructure as P } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
3
|
+
import { createSwapToEmporiumOps as v } from "../../functions/private-wallet/emporium.swap.helpers.mjs";
|
|
4
|
+
import { convertEmporiumOpToCallInfo as L } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
5
|
+
import { ExternalActionId as O } from "../../types/external-action.types.mjs";
|
|
6
|
+
import { transactionErrorCodes as g } from "../../error-handling/error-codes.constants.mjs";
|
|
7
|
+
import { HINKAL_SWAP_VARIABLE_RATE as y } from "../../constants/protocol.constants.mjs";
|
|
8
|
+
import { validateAndGetChainId as C } from "../../functions/utils/token-check.utils.mjs";
|
|
9
|
+
import { AccountActions as x } from "../AccountActions/AccountActions.mjs";
|
|
10
|
+
const H = async (t, a, i, p, f, E, c, e, u, l = !1, w, S, d = !1) => {
|
|
10
11
|
if (!e)
|
|
11
12
|
throw new Error("Fee token is required in hinkalProxySwap");
|
|
12
|
-
const
|
|
13
|
+
const r = C(a), m = x.getAddressFromSubAccount(r, c);
|
|
13
14
|
if (!m)
|
|
14
|
-
throw Error(
|
|
15
|
-
const
|
|
15
|
+
throw Error("Public account address is not available");
|
|
16
|
+
const n = a.map((o) => o.erc20TokenAddress), s = await t.getRandomRelay(r, !d);
|
|
17
|
+
if (!s)
|
|
18
|
+
throw Error(g.RELAYER_NOT_AVAILABLE);
|
|
19
|
+
const A = await v(
|
|
20
|
+
t,
|
|
16
21
|
r,
|
|
17
|
-
|
|
18
|
-
I[
|
|
22
|
+
p,
|
|
23
|
+
I[p][r],
|
|
19
24
|
f,
|
|
25
|
+
n[0],
|
|
20
26
|
i[0],
|
|
21
|
-
t[0],
|
|
22
|
-
t[1],
|
|
23
27
|
i[1],
|
|
24
|
-
|
|
28
|
+
n[1],
|
|
25
29
|
E,
|
|
26
30
|
m,
|
|
31
|
+
s,
|
|
27
32
|
!0
|
|
28
|
-
),
|
|
29
|
-
|
|
33
|
+
), R = u ?? await P(
|
|
34
|
+
r,
|
|
30
35
|
e,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
O
|
|
37
|
-
), y = p.map((o, C) => ({
|
|
36
|
+
n,
|
|
37
|
+
O.Emporium,
|
|
38
|
+
A.map((o) => L(o, m, r)),
|
|
39
|
+
y
|
|
40
|
+
), _ = a.map((o, h) => ({
|
|
38
41
|
token: o,
|
|
39
|
-
amount:
|
|
42
|
+
amount: i[h]
|
|
40
43
|
}));
|
|
41
|
-
return
|
|
44
|
+
return t.actionPrivateWallet(
|
|
45
|
+
r,
|
|
42
46
|
[],
|
|
43
47
|
[],
|
|
44
48
|
[],
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
A,
|
|
50
|
+
_,
|
|
51
|
+
c,
|
|
48
52
|
e,
|
|
49
|
-
g,
|
|
50
|
-
m,
|
|
51
|
-
u,
|
|
52
|
-
w,
|
|
53
53
|
R,
|
|
54
|
+
s,
|
|
55
|
+
l,
|
|
56
|
+
w,
|
|
57
|
+
S,
|
|
54
58
|
void 0,
|
|
55
|
-
|
|
59
|
+
d
|
|
56
60
|
);
|
|
57
61
|
};
|
|
58
62
|
export {
|
|
59
|
-
|
|
63
|
+
H as hinkalProxySwap
|
|
60
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../../error-handling/error-codes.constants.cjs"),f=require("../../functions/utils/addresses.cjs"),C=require("../../functions/pre-transaction/getVolatileTransferAmount.cjs"),q=require("../../functions/private-wallet/emporium.helpers.cjs"),y=require("../../functions/pre-transaction/getFeeStructure.cjs"),g=require("../../types/external-action.types.cjs"),w=require("../../functions/utils/convertEmporiumOpToCallInfo.cjs"),T=require("../../functions/utils/token-check.utils.cjs"),I=require("../AccountActions/AccountActions.cjs"),O=async(s,r,l,c,o,m,n,p,A=!1)=>{if(!n)throw Error("hinkalProxyToPrivate: subAccount should be provided");if(!o)throw new Error("Fee token is required in hinkalProxyToPrivate");if(!f.isValidPrivateAddress(c))throw Error(P.transactionErrorCodes.RECIPIENT_FORMAT_INCORRECT);const e=T.validateAndGetChainId(r),i=I.AccountActions.getAddressFromSubAccount(e,n);if(!i)throw Error("Public account address is not available");const u=r.map(t=>t.erc20TokenAddress),a=await C.modifyVolatileTokenAmountChanges(e,r,l,i),d=q.createTransaferEmporiumOpsBatch(s,e,u,a),h=m??await y.getFeeStructure(e,o,u,g.ExternalActionId.Emporium,d.map(t=>w.convertEmporiumOpToCallInfo(t,i,e))),v=r.map((t,E)=>({token:t,amount:-1n*a[E]}));return s.actionPrivateWallet(e,[r[0]],[0n],[!1],d,v,n,o,h,void 0,void 0,void 0,p,{recipientInfo:c,amount:a[0],token:r[0]},A)};exports.hinkalProxyToPrivate=O;
|
|
@@ -1,45 +1,50 @@
|
|
|
1
|
-
import { transactionErrorCodes as
|
|
2
|
-
import { isValidPrivateAddress as
|
|
3
|
-
import { modifyVolatileTokenAmountChanges as
|
|
4
|
-
import { createTransaferEmporiumOpsBatch as
|
|
5
|
-
import { getFeeStructure as
|
|
6
|
-
import { ExternalActionId as
|
|
7
|
-
import { convertEmporiumOpToCallInfo as
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
throw Error("hinkalProxyToPrivate: subAccount should be provided");
|
|
1
|
+
import { transactionErrorCodes as E } from "../../error-handling/error-codes.constants.mjs";
|
|
2
|
+
import { isValidPrivateAddress as P } from "../../functions/utils/addresses.mjs";
|
|
3
|
+
import { modifyVolatileTokenAmountChanges as w } from "../../functions/pre-transaction/getVolatileTransferAmount.mjs";
|
|
4
|
+
import { createTransaferEmporiumOpsBatch as C } from "../../functions/private-wallet/emporium.helpers.mjs";
|
|
5
|
+
import { getFeeStructure as I } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
6
|
+
import { ExternalActionId as x } from "../../types/external-action.types.mjs";
|
|
7
|
+
import { convertEmporiumOpToCallInfo as y } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
8
|
+
import { validateAndGetChainId as O } from "../../functions/utils/token-check.utils.mjs";
|
|
9
|
+
import { AccountActions as g } from "../AccountActions/AccountActions.mjs";
|
|
10
|
+
const B = async (n, r, l, s, a, p, i, u, f = !1) => {
|
|
12
11
|
if (!i)
|
|
12
|
+
throw Error("hinkalProxyToPrivate: subAccount should be provided");
|
|
13
|
+
if (!a)
|
|
13
14
|
throw new Error("Fee token is required in hinkalProxyToPrivate");
|
|
14
|
-
if (!
|
|
15
|
-
throw Error(
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
if (!P(s))
|
|
16
|
+
throw Error(E.RECIPIENT_FORMAT_INCORRECT);
|
|
17
|
+
const o = O(r), e = g.getAddressFromSubAccount(o, i);
|
|
18
|
+
if (!e)
|
|
19
|
+
throw Error("Public account address is not available");
|
|
20
|
+
const d = r.map((t) => t.erc20TokenAddress), m = await w(o, r, l, e), c = C(n, o, d, m), h = p ?? await I(
|
|
21
|
+
o,
|
|
22
|
+
a,
|
|
23
|
+
d,
|
|
24
|
+
x.Emporium,
|
|
25
|
+
c.map((t) => y(t, e, o))
|
|
26
|
+
), v = r.map((t, A) => ({
|
|
27
|
+
token: t,
|
|
28
|
+
amount: -1n * m[A]
|
|
25
29
|
}));
|
|
26
|
-
return
|
|
27
|
-
|
|
30
|
+
return n.actionPrivateWallet(
|
|
31
|
+
o,
|
|
32
|
+
[r[0]],
|
|
28
33
|
[0n],
|
|
29
34
|
[!1],
|
|
30
|
-
|
|
31
|
-
E,
|
|
32
|
-
a,
|
|
33
|
-
i,
|
|
35
|
+
c,
|
|
34
36
|
v,
|
|
37
|
+
i,
|
|
38
|
+
a,
|
|
39
|
+
h,
|
|
35
40
|
void 0,
|
|
36
41
|
void 0,
|
|
37
42
|
void 0,
|
|
38
|
-
|
|
39
|
-
{ recipientInfo:
|
|
40
|
-
|
|
43
|
+
u,
|
|
44
|
+
{ recipientInfo: s, amount: m[0], token: r[0] },
|
|
45
|
+
f
|
|
41
46
|
);
|
|
42
47
|
};
|
|
43
48
|
export {
|
|
44
|
-
|
|
49
|
+
B as hinkalProxyToPrivate
|
|
45
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../AccountActions/AccountActions.cjs"),a=async(e,n,t,c)=>{let i;const o=r.AccountActions.getPrivateKeyFromSubAccount(e,c);if(!o)throw Error("Private key is not available");if(t)i=await r.AccountActions.signTypedDataFromPrivateKey(e,o,t.domain,t.types,t.value);else{if(!n)throw Error("dataHash must be provided if typedData is not provided");i=await r.AccountActions.signMessageFromPrivateKey(e,o,n)}return i};exports.hinkalSignSubAccount=a;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { SubAccount } from '../../types/proxy.types';
|
|
2
2
|
import { type TypedData } from '../../types/circom-data.types';
|
|
3
|
-
|
|
4
|
-
export declare const hinkalSignSubAccount: (hinkal: IHinkal, messageToSign: string | undefined, typedData: TypedData | undefined, subAccount: SubAccount) => Promise<string>;
|
|
3
|
+
export declare const hinkalSignSubAccount: (chainId: number, messageToSign: string | undefined, typedData: TypedData | undefined, subAccount: SubAccount) => Promise<string>;
|