@hinkal/common 0.2.17 → 0.2.19
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 +8 -13
- package/API/API.mjs +86 -94
- 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/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/getWebsiteURL.d.ts +1 -1
- package/API/index.d.ts +0 -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 +2 -2
- package/API/proxyAccountsCalls.mjs +19 -19
- 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/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 +1 -1
- package/API/unspent-utxos-calls.mjs +15 -18
- package/README.md +237 -61
- 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 +0 -5
- package/constants/chains.constants.mjs +21 -26
- 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/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/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +2 -0
- package/constants/mediaUrls.constants.mjs +3 -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 +14 -122
- package/constants/server.constants.mjs +44 -152
- 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/popularTokens.constants.cjs +1 -1
- package/constants/token-data/popularTokens.constants.mjs +0 -1
- package/constants/vite.constants.cjs +1 -1
- package/constants/vite.constants.mjs +36 -13
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +34 -49
- package/data-structures/Hinkal/Hinkal.mjs +238 -301
- package/data-structures/Hinkal/IHinkal.d.ts +33 -48
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.d.ts +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +42 -42
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.mjs +25 -23
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +9 -9
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.mjs +95 -93
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +147 -133
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +1 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +107 -115
- 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 +34 -33
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +26 -24
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +1 -2
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +8 -9
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +4 -3
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +86 -97
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +2 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +146 -146
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +2 -3
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +38 -38
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +57 -56
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +59 -58
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +83 -79
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +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 +67 -64
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +75 -87
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.d.ts +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +55 -58
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +80 -82
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.d.ts +2 -2
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +87 -90
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +105 -53
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.mjs +7 -7
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +8 -8
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +10 -10
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +25 -40
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +10 -11
- 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/event-service/evm/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractEventService.d.ts +1 -0
- package/data-structures/event-service/evm/AbstractEventService.mjs +7 -4
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +0 -1
- 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 +3 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +17 -14
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +1 -0
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +9 -6
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +0 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +1 -2
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +3 -2
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +42 -45
- 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 +3 -4
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +3 -4
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +3 -4
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +3 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +3 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +2 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +3 -4
- package/data-structures/utxo/Utxo.cjs +1 -1
- package/data-structures/utxo/Utxo.d.ts +1 -7
- package/data-structures/utxo/Utxo.mjs +26 -36
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +3 -0
- package/error-handling/error-codes.constants.mjs +5 -2
- 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/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/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 +60 -51
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +3 -5
- package/functions/private-wallet/emporium.helpers.mjs +95 -135
- 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 +2 -2
- package/functions/snarkjs/constructEmporiumProof.mjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +2 -3
- 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 +54 -59
- package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +11 -10
- package/functions/snarkjs/generateCircomData.d.ts +1 -1
- 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/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.mjs +2 -2
- package/functions/utils/enum.utils.cjs +1 -0
- package/functions/utils/enum.utils.mjs +14 -0
- 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/get-hinkal-approvals.cjs +1 -1
- package/functions/utils/get-hinkal-approvals.d.ts +1 -1
- package/functions/utils/get-hinkal-approvals.mjs +16 -16
- package/functions/utils/getDataFromTransaction.d.ts +3 -3
- 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/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 +0 -6
- package/functions/utils/prepareHinkal.mjs +41 -60
- 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 +1 -16
- package/functions/utils/walletBalances.utils.mjs +4 -35
- 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 +114 -121
- package/functions/web3/events/getInputUtxosEnclave.d.ts +1 -1
- 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 +7 -7
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +7 -7
- 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 +71 -63
- 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/recoverTransactionFromError.cjs +1 -0
- package/functions/web3/functionCalls/recoverTransactionFromError.d.ts +2 -0
- package/functions/web3/functionCalls/recoverTransactionFromError.mjs +23 -0
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.d.ts +1 -1
- package/functions/web3/functionCalls/transactCallDirect.mjs +45 -36
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.mjs +44 -43
- 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 +8 -8
- 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 +937 -967
- package/package.json +2 -2
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +10 -17
- package/providers/EthersProviderAdapter.mjs +48 -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 +6 -7
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +5 -5
- package/types/TransactionSimulator.types.d.ts +2 -9
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +3 -7
- package/types/admin.types.mjs +2 -2
- package/types/balances.types.d.ts +0 -1
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +2 -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 +1 -8
- package/types/ethereum-network.types.mjs +1 -1
- 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 +1 -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 +1 -0
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +8 -39
- package/types/sandbox.types.mjs +2 -2
- package/types/session.types.d.ts +2 -0
- package/types/solana.types.d.ts +3 -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/transactions.types.cjs +1 -1
- package/types/transactions.types.d.ts +6 -4
- package/types/transactions.types.mjs +4 -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 +1 -1
- 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/staking/index.cjs +0 -1
- package/functions/staking/index.d.ts +0 -11
- package/functions/staking/index.mjs +0 -42
- 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,25 +1,27 @@
|
|
|
1
|
-
import { randomBigInt as
|
|
2
|
-
import { Utxo as
|
|
3
|
-
import { transactionErrorCodes as
|
|
4
|
-
import { ethers as
|
|
1
|
+
import { randomBigInt as F } from "../../functions/web3/etherFunctions.mjs";
|
|
2
|
+
import { Utxo as N } from "../utxo/Utxo.mjs";
|
|
3
|
+
import { transactionErrorCodes as W } from "../../error-handling/error-codes.constants.mjs";
|
|
4
|
+
import { ethers as _ } from "ethers";
|
|
5
5
|
import "idb-keyval";
|
|
6
|
-
import { networkRegistry as
|
|
6
|
+
import { networkRegistry as H } from "../../constants/chains.constants.mjs";
|
|
7
7
|
import "../crypto-keys/keys.mjs";
|
|
8
8
|
import "node-forge";
|
|
9
9
|
import "../../constants/vite.constants.mjs";
|
|
10
10
|
import "libsodium-wrappers";
|
|
11
11
|
import "../http/HttpClient.mjs";
|
|
12
12
|
import "axios";
|
|
13
|
-
import { formatMintAddress as
|
|
14
|
-
import { PublicKey as
|
|
15
|
-
import { hashEthereumAddress as
|
|
13
|
+
import { formatMintAddress as M } from "../../functions/utils/solanaMint.utils.mjs";
|
|
14
|
+
import { PublicKey as L } from "@solana/web3.js";
|
|
15
|
+
import { hashEthereumAddress as q } from "../../functions/utils/addresses.mjs";
|
|
16
16
|
import "../../constants/server.constants.mjs";
|
|
17
|
+
import "../../API/getServerURL.mjs";
|
|
17
18
|
import "../../constants/token-data/index.mjs";
|
|
18
|
-
import { solanaNativeAddress as
|
|
19
|
-
import { API as
|
|
20
|
-
import "../../functions/utils/
|
|
19
|
+
import { solanaNativeAddress as B } from "../../constants/protocol.constants.mjs";
|
|
20
|
+
import { API as G } from "../../API/API.mjs";
|
|
21
|
+
import { validateAndGetChainId as X } from "../../functions/utils/token-check.utils.mjs";
|
|
22
|
+
import "async-mutex";
|
|
21
23
|
import "../../types/circom-data.types.mjs";
|
|
22
|
-
import { ExternalActionId as
|
|
24
|
+
import { ExternalActionId as Y } from "../../types/external-action.types.mjs";
|
|
23
25
|
import "../../types/transactions.types.mjs";
|
|
24
26
|
import "../../types/activities.types.mjs";
|
|
25
27
|
import "../../functions/web3/events/getApprovedBalance.mjs";
|
|
@@ -34,203 +36,201 @@ import "../../constants/activity.constants.mjs";
|
|
|
34
36
|
import "../../constants/tasks.constants.mjs";
|
|
35
37
|
import "../../constants/events.constants.mjs";
|
|
36
38
|
import "../../functions/utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
37
|
-
import "../../
|
|
38
|
-
import "circomlibjs-hinkal-fork";
|
|
39
|
-
import "process";
|
|
40
|
-
import "buffer";
|
|
41
|
-
import "../../constants/save-depths.mjs";
|
|
42
|
-
import { BN as Y } from "@coral-xyz/anchor";
|
|
43
|
-
import { getStorageAccountPublicKey as Z, getStorageVaultPublicKey as j, getMerkleAccountPublicKey as G, buildAnchorStealthAddressStructure as J, getTokenLimitStorageAccountPublicKey as Q } from "../../functions/pre-transaction/solana.mjs";
|
|
39
|
+
import { getStorageAccountPublicKey as Z, getStorageVaultPublicKey as j, getMerkleAccountPublicKey as J, buildAnchorStealthAddressStructure as Q, getTokenLimitStorageAccountPublicKey as tt } from "../../functions/pre-transaction/solana.mjs";
|
|
44
40
|
import "@solana/spl-token";
|
|
41
|
+
import { BN as ot } from "@coral-xyz/anchor";
|
|
45
42
|
import "../../functions/utils/userAgent.mjs";
|
|
46
|
-
import { getCurrentTimeInSeconds as
|
|
43
|
+
import { getCurrentTimeInSeconds as rt } from "../../functions/utils/time.utils.mjs";
|
|
44
|
+
import "circomlibjs-hinkal-fork";
|
|
47
45
|
import "multiformats";
|
|
48
46
|
import "../../API/tenderly.api.mjs";
|
|
49
|
-
import
|
|
47
|
+
import "process";
|
|
48
|
+
import "buffer";
|
|
49
|
+
import "../../providers/EthersProviderAdapter.mjs";
|
|
50
|
+
import { calculateTotalFee as et } from "../../functions/utils/fees.utils.mjs";
|
|
50
51
|
import "../../functions/web3/getTokenHolder.mjs";
|
|
51
|
-
import { signAndSendSerializedTransaction as
|
|
52
|
-
import { calcStealthAddressStructure as
|
|
53
|
-
import { hinkalCheckSolanaTokenRegistry as
|
|
54
|
-
import { getUtxosFromReceiptSolana as
|
|
55
|
-
import { constructSolanaZkProof as
|
|
56
|
-
import { solanaTransactCallRelayerBatch as
|
|
57
|
-
import { getFeeStructure as
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
hinkalAddress: p,
|
|
62
|
-
originalDeployer: g
|
|
63
|
-
} = F[t.getCurrentChainId()].contractData;
|
|
64
|
-
if (!l)
|
|
52
|
+
import { signAndSendSerializedTransaction as nt } from "../../functions/web3/signAndSendSerializedTransaction.mjs";
|
|
53
|
+
import { calcStealthAddressStructure as it, calcEncryptedOutputs as st } from "../../functions/snarkjs/common.snarkjs.mjs";
|
|
54
|
+
import { hinkalCheckSolanaTokenRegistry as at } from "./hinkalCheckSolanaTokenRegistry.mjs";
|
|
55
|
+
import { getUtxosFromReceiptSolana as ct } from "../../functions/utils/getUtxosFromReceiptSolana.mjs";
|
|
56
|
+
import { constructSolanaZkProof as mt } from "../../functions/snarkjs/constructSolanaZkProof.mjs";
|
|
57
|
+
import { solanaTransactCallRelayerBatch as lt } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
58
|
+
import { getFeeStructure as dt } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
59
|
+
const pt = async (t, o, y, l, d, w) => {
|
|
60
|
+
const s = y.erc20TokenAddress, n = l.map((r) => r + et(r, w)), { hinkalIdl: p, hinkalAddress: u, originalDeployer: g } = H[o].contractData;
|
|
61
|
+
if (!p)
|
|
65
62
|
throw new Error("No IDL configured for Solana program on this network");
|
|
66
63
|
if (!g)
|
|
67
64
|
throw new Error("missing original deployer");
|
|
68
|
-
const f = t.userKeys.getShieldedPrivateKey(),
|
|
65
|
+
const f = t.userKeys.getShieldedPrivateKey(), D = N.findCorrectRandomization(F(31), f), E = it(D, f), e = t.getSolanaProgram(p), I = t.getSolanaPublicKey(), i = new L(g), A = new L(u), { mintPublicKey: S } = M(s), P = S.toString(), C = Z(A, i), U = j(A, i), K = J(A, i), T = Q(E), v = n.reduce((r, c) => r + c, 0n), O = await at(
|
|
69
66
|
e,
|
|
70
|
-
new
|
|
71
|
-
[
|
|
72
|
-
[
|
|
73
|
-
),
|
|
74
|
-
let
|
|
75
|
-
if (
|
|
76
|
-
const { serializedTransaction:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
), { wallet: a } = e.provider;
|
|
86
|
-
if (!a)
|
|
67
|
+
new L(i),
|
|
68
|
+
[s],
|
|
69
|
+
[v]
|
|
70
|
+
), b = n.map((r) => `${r}`);
|
|
71
|
+
let h = "";
|
|
72
|
+
if (O) {
|
|
73
|
+
const { serializedTransaction: r, blockhash: c, lastValidBlockHeight: a } = await G.generateMultiPaymentDepositLimitless({
|
|
74
|
+
amounts: b,
|
|
75
|
+
payer: t.getSolanaPublicKey().toBase58(),
|
|
76
|
+
ethereumAddress: await t.getEthereumAddress(),
|
|
77
|
+
mint: s,
|
|
78
|
+
stealthAddressStructure: T,
|
|
79
|
+
chainId: o
|
|
80
|
+
}), { wallet: m } = e.provider;
|
|
81
|
+
if (!m)
|
|
87
82
|
throw new Error("missing wallet");
|
|
88
|
-
|
|
83
|
+
h = await nt(
|
|
89
84
|
e.provider,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
r,
|
|
86
|
+
c,
|
|
87
|
+
a
|
|
93
88
|
);
|
|
94
89
|
} else {
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
90
|
+
const r = tt(e.programId, i, S), c = P === B ? null : S, a = P === B ? null : void 0;
|
|
91
|
+
h = await e.methods.multiPaymentDeposit(
|
|
92
|
+
b.map((z) => new ot(z)),
|
|
93
|
+
T
|
|
99
94
|
).accounts({
|
|
100
|
-
mint:
|
|
101
|
-
signer:
|
|
102
|
-
signerAta:
|
|
103
|
-
originalDeployer:
|
|
104
|
-
storageAccount:
|
|
105
|
-
storageVault:
|
|
106
|
-
merkleAccount:
|
|
107
|
-
tokenLimitStorage:
|
|
108
|
-
storageVaultAta:
|
|
95
|
+
mint: c,
|
|
96
|
+
signer: I,
|
|
97
|
+
signerAta: a,
|
|
98
|
+
originalDeployer: i,
|
|
99
|
+
storageAccount: C,
|
|
100
|
+
storageVault: U,
|
|
101
|
+
merkleAccount: K,
|
|
102
|
+
tokenLimitStorage: r,
|
|
103
|
+
storageVaultAta: a,
|
|
109
104
|
accessTokenOwner: null
|
|
110
105
|
}).rpc();
|
|
111
|
-
const
|
|
106
|
+
const m = await e.provider.connection.getLatestBlockhash();
|
|
112
107
|
await e.provider.connection.confirmTransaction(
|
|
113
108
|
{
|
|
114
|
-
blockhash:
|
|
115
|
-
lastValidBlockHeight:
|
|
116
|
-
signature:
|
|
109
|
+
blockhash: m.blockhash,
|
|
110
|
+
lastValidBlockHeight: m.lastValidBlockHeight,
|
|
111
|
+
signature: h
|
|
117
112
|
},
|
|
118
113
|
"confirmed"
|
|
119
114
|
);
|
|
120
115
|
}
|
|
121
|
-
const
|
|
116
|
+
const x = await e.provider.connection.getTransaction(h, {
|
|
122
117
|
commitment: "confirmed",
|
|
123
118
|
maxSupportedTransactionVersion: 0
|
|
124
119
|
});
|
|
125
|
-
if (!
|
|
120
|
+
if (!x)
|
|
126
121
|
throw new Error("Transaction missing");
|
|
127
|
-
const
|
|
128
|
-
return
|
|
129
|
-
const
|
|
130
|
-
if (!
|
|
131
|
-
throw new Error(`Could not find newly created UTXO with amount ${
|
|
132
|
-
|
|
133
|
-
recipientAddress:
|
|
134
|
-
utxo:
|
|
122
|
+
const V = ct(x, e, t.userKeys), R = [], k = [...V];
|
|
123
|
+
return d.forEach((r, c) => {
|
|
124
|
+
const a = n[c], m = k.find(($) => $.amount === a);
|
|
125
|
+
if (!m)
|
|
126
|
+
throw new Error(`Could not find newly created UTXO with amount ${a} for recipient ${r}.`);
|
|
127
|
+
R.push({
|
|
128
|
+
recipientAddress: r,
|
|
129
|
+
utxo: m
|
|
135
130
|
});
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
}),
|
|
139
|
-
},
|
|
140
|
-
|
|
131
|
+
const z = k.indexOf(m);
|
|
132
|
+
k.splice(z, 1);
|
|
133
|
+
}), R;
|
|
134
|
+
}, ut = async (t, o, y, l, d, w, s) => {
|
|
135
|
+
const n = y.erc20TokenAddress;
|
|
136
|
+
if (l.length === 0)
|
|
141
137
|
throw new Error("userDepositedUtxos must not be empty");
|
|
142
|
-
const { hinkalIdl:
|
|
143
|
-
if (!
|
|
138
|
+
const { hinkalIdl: p, originalDeployer: u } = H[o].contractData;
|
|
139
|
+
if (!u || !p)
|
|
144
140
|
throw new Error("missing data");
|
|
145
|
-
const g = t.getSolanaProgram(
|
|
141
|
+
const g = t.getSolanaProgram(p), f = await t.getRandomRelay(o, !0);
|
|
146
142
|
if (!f)
|
|
147
|
-
throw new Error(
|
|
148
|
-
const
|
|
149
|
-
for (let
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
const { compressedAddress:
|
|
143
|
+
throw new Error(W.RELAYER_NOT_AVAILABLE);
|
|
144
|
+
const D = rt().toString(), E = t.generateProofRemotely ? 5 : 1, e = [];
|
|
145
|
+
for (let i = 0; i < l.length; i += E) {
|
|
146
|
+
const A = l.slice(i, i + E), S = await Promise.all(
|
|
147
|
+
A.map(async ({ recipientAddress: P, utxo: C }) => {
|
|
148
|
+
const { compressedAddress: U } = M(B), K = new N({
|
|
153
149
|
amount: 0n,
|
|
154
|
-
mintAddress:
|
|
155
|
-
erc20TokenAddress:
|
|
150
|
+
mintAddress: n,
|
|
151
|
+
erc20TokenAddress: U,
|
|
156
152
|
shieldedPrivateKey: t.userKeys.getShieldedPrivateKey(),
|
|
157
|
-
timeStamp:
|
|
153
|
+
timeStamp: D,
|
|
158
154
|
tokenId: 0
|
|
159
|
-
}),
|
|
160
|
-
|
|
155
|
+
}), T = [C, K], v = [K], O = N.findCorrectRandomization(
|
|
156
|
+
F(31),
|
|
161
157
|
t.userKeys.getShieldedPrivateKey()
|
|
162
|
-
),
|
|
158
|
+
), b = {
|
|
163
159
|
tokenNumber: 1,
|
|
164
|
-
nullifierAmount:
|
|
165
|
-
outputAmount:
|
|
166
|
-
},
|
|
160
|
+
nullifierAmount: T.length,
|
|
161
|
+
outputAmount: v.length
|
|
162
|
+
}, h = st([v])[0][0], x = Array.from(_.utils.arrayify(h)), { proofAArr: V, proofBArr: R, proofCArr: k, publicInputsArr: r } = await mt(
|
|
167
163
|
t.generateProofRemotely,
|
|
168
|
-
|
|
169
|
-
t.
|
|
170
|
-
t.
|
|
164
|
+
u,
|
|
165
|
+
t.merkleTreeHinkalByChain[o],
|
|
166
|
+
t.merkleTreeAccessTokenByChain[o],
|
|
171
167
|
t.userKeys,
|
|
172
168
|
g,
|
|
173
|
-
[
|
|
174
|
-
[
|
|
175
|
-
[
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
169
|
+
[n],
|
|
170
|
+
[T],
|
|
171
|
+
[v],
|
|
172
|
+
O,
|
|
173
|
+
d.flatFee,
|
|
174
|
+
d.variableRate,
|
|
175
|
+
P,
|
|
180
176
|
f,
|
|
181
|
-
|
|
182
|
-
[
|
|
183
|
-
|
|
177
|
+
b,
|
|
178
|
+
[x],
|
|
179
|
+
o,
|
|
180
|
+
void 0,
|
|
184
181
|
void 0,
|
|
185
182
|
void 0,
|
|
186
183
|
void 0,
|
|
187
184
|
void 0,
|
|
188
185
|
!1
|
|
189
|
-
),
|
|
190
|
-
recipient:
|
|
191
|
-
mint:
|
|
186
|
+
), a = {
|
|
187
|
+
recipient: P,
|
|
188
|
+
mint: n === B ? void 0 : n
|
|
192
189
|
};
|
|
193
190
|
return {
|
|
194
191
|
relayAddress: f,
|
|
195
192
|
functionName: "transact",
|
|
193
|
+
chainId: o,
|
|
196
194
|
args: {
|
|
197
|
-
proofAArr:
|
|
198
|
-
proofBArr:
|
|
199
|
-
proofCArr:
|
|
200
|
-
publicInputsArr:
|
|
201
|
-
encryptedOutputs: [
|
|
202
|
-
relayerFee:
|
|
203
|
-
dimensions:
|
|
195
|
+
proofAArr: V,
|
|
196
|
+
proofBArr: R,
|
|
197
|
+
proofCArr: k,
|
|
198
|
+
publicInputsArr: r,
|
|
199
|
+
encryptedOutputs: [x],
|
|
200
|
+
relayerFee: d.flatFee.toString(),
|
|
201
|
+
dimensions: b
|
|
204
202
|
},
|
|
205
|
-
accounts:
|
|
203
|
+
accounts: a
|
|
206
204
|
};
|
|
207
205
|
})
|
|
208
206
|
);
|
|
209
|
-
e.push(...
|
|
207
|
+
e.push(...S);
|
|
210
208
|
}
|
|
211
|
-
return await
|
|
212
|
-
|
|
209
|
+
return await lt(
|
|
210
|
+
o,
|
|
213
211
|
e,
|
|
214
|
-
|
|
215
|
-
|
|
212
|
+
w,
|
|
213
|
+
s
|
|
216
214
|
);
|
|
217
|
-
},
|
|
218
|
-
const
|
|
215
|
+
}, Ao = async (t, o, y, l, d, w) => {
|
|
216
|
+
const s = X([o]), n = o.erc20TokenAddress, p = q(await t.getEthereumAddress()), u = w ?? await dt(s, n, [n], Y.Transact, [], 0n), g = await pt(
|
|
219
217
|
t,
|
|
220
|
-
r,
|
|
221
218
|
s,
|
|
222
|
-
|
|
223
|
-
|
|
219
|
+
o,
|
|
220
|
+
y,
|
|
221
|
+
l,
|
|
222
|
+
u
|
|
224
223
|
);
|
|
225
|
-
return
|
|
224
|
+
return ut(
|
|
226
225
|
t,
|
|
227
|
-
|
|
226
|
+
s,
|
|
227
|
+
o,
|
|
228
228
|
g,
|
|
229
|
+
u,
|
|
229
230
|
p,
|
|
230
|
-
|
|
231
|
-
h
|
|
231
|
+
d
|
|
232
232
|
);
|
|
233
233
|
};
|
|
234
234
|
export {
|
|
235
|
-
|
|
235
|
+
Ao as hinkalSolanaDepositAndWithdraw
|
|
236
236
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@solana/web3.js"),P=require("../../constants/chains.constants.cjs"),y=require("../../functions/pre-transaction/sendV0Transaction.cjs"),f=require("../../functions/pre-transaction/solanaTransfer.utils.cjs"),h=require("../crypto-keys/keys.cjs"),g=require("../../functions/utils/create-provider.cjs"),w=require("../../functions/utils/token-check.utils.cjs"),S=async(e,a,r,o)=>{const n=w.validateAndGetChainId([e]),t=h.UserKeys.getSignerAddressFromPrivateKey(n,r.privateKey),{fetchRpcUrl:s}=P.networkRegistry[n];if(!s)throw new Error("RPC URL not found for the specified chain ID");const i=g.createCustomSolanaConnection(s),c=new u.PublicKey(t),{instructions:d,programId:l}=await f.buildSolanaTransferInstructions(i,c,new u.PublicKey(o),e,a);return{connection:i,chainId:n,senderAddress:t,senderPublickey:c,programId:l,instructions:d}},b=async(e,a,r,o,n=!1)=>{if(n)throw new Error("onlyGasEstimate is not supported for Solana proxy send");const{connection:t,chainId:s,senderAddress:i,senderPublickey:c,programId:d,instructions:l}=await S(e,a,r,o);return y.sendProxyV0Transaction({connection:t,chainId:s,subAccount:r,payerPublicKey:c,instructions:l,convertParams:{fromAddress:i,toAddress:o,programAddress:d.toString()}})},p=async(e,a,r,o)=>{const{connection:n,senderPublickey:t,instructions:s}=await S(e,a,r,o);return y.serializeProxyV0Transaction(n,t,s)};exports.getSolanaProxySendSerializedTransaction=p;exports.hinkalSolanaProxySend=b;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ERC20Token } from '../../types/token.types';
|
|
2
|
-
import { IHinkal } from './IHinkal';
|
|
3
2
|
import { RelayerTransaction } from '../../types/relayer.types';
|
|
4
3
|
import { SubAccount } from '../../types/proxy.types';
|
|
5
|
-
export declare const hinkalSolanaProxySend: (
|
|
6
|
-
export declare const getSolanaProxySendSerializedTransaction: (
|
|
4
|
+
export declare const hinkalSolanaProxySend: (token: ERC20Token, tokenAmount: bigint, subAccount: SubAccount, recipientAddress: string, onlyGasEstimate?: boolean) => Promise<RelayerTransaction>;
|
|
5
|
+
export declare const getSolanaProxySendSerializedTransaction: (token: ERC20Token, tokenAmount: bigint, subAccount: SubAccount, recipientAddress: string) => Promise<string>;
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
import { PublicKey as l } from "@solana/web3.js";
|
|
2
|
-
import { networkRegistry as
|
|
3
|
-
import { sendProxyV0Transaction as
|
|
4
|
-
import { buildSolanaTransferInstructions as
|
|
5
|
-
import { UserKeys as
|
|
6
|
-
import { createCustomSolanaConnection as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { networkRegistry as f } from "../../constants/chains.constants.mjs";
|
|
3
|
+
import { sendProxyV0Transaction as p, serializeProxyV0Transaction as u } from "../../functions/pre-transaction/sendV0Transaction.mjs";
|
|
4
|
+
import { buildSolanaTransferInstructions as P } from "../../functions/pre-transaction/solanaTransfer.utils.mjs";
|
|
5
|
+
import { UserKeys as S } from "../crypto-keys/keys.mjs";
|
|
6
|
+
import { createCustomSolanaConnection as w } from "../../functions/utils/create-provider.mjs";
|
|
7
|
+
import { validateAndGetChainId as h } from "../../functions/utils/token-check.utils.mjs";
|
|
8
|
+
const y = async (n, i, o, e) => {
|
|
9
|
+
const r = h([n]), t = S.getSignerAddressFromPrivateKey(r, o.privateKey), { fetchRpcUrl: s } = f[r];
|
|
10
|
+
if (!s)
|
|
10
11
|
throw new Error("RPC URL not found for the specified chain ID");
|
|
11
|
-
const
|
|
12
|
+
const a = w(s), c = new l(t), { instructions: d, programId: m } = await P(
|
|
13
|
+
a,
|
|
12
14
|
c,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
i
|
|
16
|
-
a
|
|
15
|
+
new l(e),
|
|
16
|
+
n,
|
|
17
|
+
i
|
|
17
18
|
);
|
|
18
19
|
return {
|
|
19
|
-
connection:
|
|
20
|
+
connection: a,
|
|
20
21
|
chainId: r,
|
|
21
|
-
senderAddress:
|
|
22
|
-
senderPublickey:
|
|
23
|
-
programId:
|
|
24
|
-
instructions:
|
|
22
|
+
senderAddress: t,
|
|
23
|
+
senderPublickey: c,
|
|
24
|
+
programId: m,
|
|
25
|
+
instructions: d
|
|
25
26
|
};
|
|
26
|
-
},
|
|
27
|
+
}, k = async (n, i, o, e, r = !1) => {
|
|
27
28
|
if (r)
|
|
28
29
|
throw new Error("onlyGasEstimate is not supported for Solana proxy send");
|
|
29
|
-
const { connection:
|
|
30
|
-
return
|
|
31
|
-
connection:
|
|
32
|
-
chainId:
|
|
33
|
-
subAccount:
|
|
34
|
-
payerPublicKey:
|
|
35
|
-
instructions:
|
|
30
|
+
const { connection: t, chainId: s, senderAddress: a, senderPublickey: c, programId: d, instructions: m } = await y(n, i, o, e);
|
|
31
|
+
return p({
|
|
32
|
+
connection: t,
|
|
33
|
+
chainId: s,
|
|
34
|
+
subAccount: o,
|
|
35
|
+
payerPublicKey: c,
|
|
36
|
+
instructions: m,
|
|
36
37
|
convertParams: {
|
|
37
|
-
fromAddress:
|
|
38
|
-
toAddress:
|
|
39
|
-
programAddress:
|
|
38
|
+
fromAddress: a,
|
|
39
|
+
toAddress: e,
|
|
40
|
+
programAddress: d.toString()
|
|
40
41
|
}
|
|
41
42
|
});
|
|
42
|
-
},
|
|
43
|
-
const { connection: r, senderPublickey:
|
|
44
|
-
s,
|
|
45
|
-
i,
|
|
46
|
-
a,
|
|
43
|
+
}, v = async (n, i, o, e) => {
|
|
44
|
+
const { connection: r, senderPublickey: t, instructions: s } = await y(
|
|
47
45
|
n,
|
|
48
|
-
|
|
46
|
+
i,
|
|
47
|
+
o,
|
|
48
|
+
e
|
|
49
49
|
);
|
|
50
|
-
return
|
|
50
|
+
return u(r, t, s);
|
|
51
51
|
};
|
|
52
52
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
v as getSolanaProxySendSerializedTransaction,
|
|
54
|
+
k as hinkalSolanaProxySend
|
|
55
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@solana/spl-token"),h=require("@solana/web3.js"),f=require("../../constants/chains.constants.cjs"),b=require("../../constants/protocol.constants.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@solana/spl-token"),h=require("@solana/web3.js"),f=require("../../constants/chains.constants.cjs"),b=require("../../constants/protocol.constants.cjs"),N=require("../../functions/utils/solanaMint.utils.cjs"),k=require("../../functions/utils/addresses.cjs"),O=require("../../error-handling/error-codes.constants.cjs"),S=require("../../functions/pre-transaction/solana.cjs"),V=require("@coral-xyz/anchor"),T=require("../../functions/pre-transaction/sendV0Transaction.cjs"),M=require("../crypto-keys/keys.cjs"),G=require("../../functions/utils/create-provider.cjs"),q=require("../../functions/utils/token-check.utils.cjs"),L=async({program:t,mintPublicKey:r,mintAddressString:n,tokenAmount:o,anchorStealthStructure:s,senderPublickey:d,originalDeployer:e,storageAccount:i,storageVault:a})=>{const u=new V.BN(o.toString()),l=S.getTokenLimitStorageAccountPublicKey(t.programId,e,r),g=n===b.solanaNativeAddress?null:r,c=n===b.solanaNativeAddress?null:void 0;return t.methods.prooflessDeposit(u,s).accounts({mint:g,signer:d,signerAta:c,originalDeployer:e,storageAccount:i,storageVault:a,tokenLimitStorage:l,storageVaultAta:c,accessTokenOwner:null}).instruction()},I=async(t,r,n,o,s,d)=>{const e=d??t.getRecipientInfo();if(!k.isValidPrivateAddress(e))throw Error(O.transactionErrorCodes.RECIPIENT_FORMAT_INCORRECT);const i=M.UserKeys.getSignerAddressFromPrivateKey(r,s.privateKey),{hinkalIdl:a,hinkalAddress:u,originalDeployer:l}=f.networkRegistry[r].contractData;if(!a)throw new Error("No IDL configured for Solana program on this network");if(!l)throw new Error("missing original deployer");const g=t.getSolanaProgram(a),c=new h.PublicKey(l),y=new h.PublicKey(u),P=new h.PublicKey(i),{erc20TokenAddress:R}=n,{fetchRpcUrl:A}=f.networkRegistry[r];if(!A)throw new Error("RPC URL not found for the specified chain ID");const E=G.createCustomSolanaConnection(A),{mintPublicKey:w}=N.formatMintAddress(R),_=w.toString(),p=S.getStorageAccountPublicKey(y,c),C=S.getStorageVaultPublicKey(y,c),K=k.constructStealthAddressStructure(e),v=S.buildAnchorStealthAddressStructure(K),x=await L({program:g,mintPublicKey:w,mintAddressString:_,tokenAmount:o,anchorStealthStructure:v,senderPublickey:P,originalDeployer:c,storageAccount:p,storageVault:C}),D=n.is2022Program?m.TOKEN_2022_PROGRAM_ID:m.TOKEN_PROGRAM_ID;return{connection:E,senderAddress:i,senderPublickey:P,instructions:[x],storageAccount:p,programId:D}},z=async(t,r,n,o,s,d=!1)=>{if(d)throw new Error("onlyGasEstimate is not supported for Solana proxy shield");if(!o)throw new Error("subAccount is required");const e=q.validateAndGetChainId([r]),{connection:i,senderPublickey:a,instructions:u,senderAddress:l,storageAccount:g,programId:c}=await I(t,e,r,n,o,s),y=s||g.toString();return T.sendProxyV0Transaction({connection:i,chainId:e,subAccount:o,payerPublicKey:a,instructions:u,convertParams:{fromAddress:l,toAddress:y,programAddress:c.toString()}})},U=async(t,r,n,o,s)=>{const d=q.validateAndGetChainId([r]),{connection:e,senderPublickey:i,instructions:a}=await I(t,d,r,n,o,s);return T.serializeProxyV0Transaction(e,i,a)};exports.getSolanaProxyShieldSerializedTransaction=U;exports.hinkalSolanaProxyShield=z;
|