@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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../constants/token-data/index.cjs");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../constants/token-data/index.cjs");const u=require("../../data-structures/custom-token-registry/CustomTokenRegistry.cjs"),l=require("../web3/etherFunctions.cjs"),m=require("./amounts.utils.cjs"),a=require("../../constants/protocol.constants.cjs"),i=require("../../constants/token-data/popularTokens.constants.cjs"),k=require("../../constants/chains.constants.cjs"),y=require("../../constants/token-data/ERC20Registry.cjs"),c=e=>{const n=y.getERC20Registry(e),o=u.customTokenRegistry.getCustomTokens(e);return[...n,...o]},g=(e,n,o)=>(o??c(n))?.find(t=>e===void 0?!1:t.erc20TokenAddress.toLowerCase()===e.toLowerCase()),C=(e,n)=>c(n)?.find(o=>e===void 0?!1:o.symbol.toLowerCase()===e.toLowerCase()),p=e=>{const n=e.reduce((o,{amount:t,token:T,nftIds:s})=>{const r=T.erc20TokenAddress.toLowerCase();return o[r]?o[r].amount+=t:o[r]={amount:t,token:T,nftIds:s},o},{});return Object.values(n)},d=e=>e.map(({amount:n,token:o,nftIds:t})=>{if(n===0n)return;const T=n>0n?"+":"-",s=Number(l.getAmountInToken(o,n));return{token:o,amount:`${T}${m.fixDecimalsAmount(s>0?s:-s)}`,nftIds:t}}).filter(n=>!!n),f=e=>e.nftTokenType===a.TokenType.ERC721||e.nftTokenType===a.TokenType.ERC1155||e.nftTokenType===a.TokenType.MetaplexNFT||e.nftTokenType===a.TokenType.Token2022NFT||e.nftTokenType===a.TokenType.CompressedNFT,b=e=>e.chainId===k.chainIds.arcTestnet&&e.erc20TokenAddress===a.zeroAddress,h=(e,n)=>{const o=n.toLowerCase();return e.symbol.toLowerCase().includes(o)||e.name.toLowerCase().includes(o)||e.erc20TokenAddress.toLowerCase().startsWith(o)},R=e=>{const n=e.filter(s=>i.PopularTokenSymbols.some(r=>r.symbol===s.symbol)),o=e.filter(s=>!i.PopularTokenSymbols.some(r=>r.symbol===s.symbol)),t=n.sort((s,r)=>s.symbol.localeCompare(r.symbol,"en-US")),T=o.sort((s,r)=>s.symbol.localeCompare(r.symbol,"en-US"));return[...t,...T]};exports.aggregateTokenChanges=p;exports.formatTokenChangesList=d;exports.getERC20Token=g;exports.getERC20TokenBySymbol=C;exports.getErc20TokensForChain=c;exports.isArcNativeToken=b;exports.isNFTToken=f;exports.searchCompareFunction=h;exports.sortTokens=R;
|
|
@@ -2,7 +2,6 @@ import { ERC20Token, TokenChanges } from '../../types/token.types';
|
|
|
2
2
|
export declare const getErc20TokensForChain: (chainId: number) => ERC20Token[];
|
|
3
3
|
export declare const getERC20Token: (address: string, chainId: number, fromList?: ERC20Token[]) => ERC20Token | undefined;
|
|
4
4
|
export declare const getERC20TokenBySymbol: (symbol: string, chainId: number) => ERC20Token | undefined;
|
|
5
|
-
export declare const getHToken: (token: ERC20Token, chainId: number) => ERC20Token | undefined;
|
|
6
5
|
export declare const aggregateTokenChanges: (tokenChanges: TokenChanges<bigint>[]) => TokenChanges<bigint>[];
|
|
7
6
|
export declare const formatTokenChangesList: (tokenChanges: TokenChanges<bigint>[]) => {
|
|
8
7
|
token: ERC20Token;
|
|
@@ -1,62 +1,55 @@
|
|
|
1
1
|
import "../../constants/token-data/index.mjs";
|
|
2
|
-
import { customTokenRegistry as
|
|
2
|
+
import { customTokenRegistry as c } from "../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
3
3
|
import { getAmountInToken as l } from "../web3/etherFunctions.mjs";
|
|
4
|
-
import { fixDecimalsAmount as
|
|
5
|
-
import { TokenType as
|
|
4
|
+
import { fixDecimalsAmount as u } from "./amounts.utils.mjs";
|
|
5
|
+
import { TokenType as T, zeroAddress as p } from "../../constants/protocol.constants.mjs";
|
|
6
6
|
import { PopularTokenSymbols as i } from "../../constants/token-data/popularTokens.constants.mjs";
|
|
7
7
|
import { chainIds as f } from "../../constants/chains.constants.mjs";
|
|
8
|
-
import { getERC20Registry as
|
|
9
|
-
const
|
|
10
|
-
const r =
|
|
8
|
+
import { getERC20Registry as d } from "../../constants/token-data/ERC20Registry.mjs";
|
|
9
|
+
const a = (e) => {
|
|
10
|
+
const r = d(e), o = c.getCustomTokens(e);
|
|
11
11
|
return [...r, ...o];
|
|
12
|
-
}, R = (e, r, o) => (o ??
|
|
13
|
-
const o = a(r);
|
|
14
|
-
if (e.hasHToken)
|
|
15
|
-
return o.find(
|
|
16
|
-
(n) => n.underlyingErc20TokenAddress?.toLowerCase() === e.erc20TokenAddress.toLowerCase() && n.isHToken
|
|
17
|
-
);
|
|
18
|
-
}, N = (e) => {
|
|
12
|
+
}, R = (e, r, o) => (o ?? a(r))?.find((n) => e === void 0 ? !1 : n.erc20TokenAddress.toLowerCase() === e.toLowerCase()), h = (e, r) => a(r)?.find((o) => e === void 0 ? !1 : o.symbol.toLowerCase() === e.toLowerCase()), N = (e) => {
|
|
19
13
|
const r = e.reduce(
|
|
20
|
-
(o, { amount: n, token:
|
|
21
|
-
const t =
|
|
14
|
+
(o, { amount: n, token: m, nftIds: s }) => {
|
|
15
|
+
const t = m.erc20TokenAddress.toLowerCase();
|
|
22
16
|
return o[t] ? o[t].amount += n : o[t] = {
|
|
23
17
|
amount: n,
|
|
24
|
-
token:
|
|
18
|
+
token: m,
|
|
25
19
|
nftIds: s
|
|
26
20
|
}, o;
|
|
27
21
|
},
|
|
28
22
|
{}
|
|
29
23
|
);
|
|
30
24
|
return Object.values(r);
|
|
31
|
-
},
|
|
25
|
+
}, E = (e) => e.map(({ amount: r, token: o, nftIds: n }) => {
|
|
32
26
|
if (r === 0n)
|
|
33
27
|
return;
|
|
34
|
-
const
|
|
28
|
+
const m = r > 0n ? "+" : "-", s = Number(l(o, r));
|
|
35
29
|
return {
|
|
36
30
|
token: o,
|
|
37
|
-
amount: `${
|
|
31
|
+
amount: `${m}${u(s > 0 ? s : -s)}`,
|
|
38
32
|
nftIds: n
|
|
39
33
|
};
|
|
40
|
-
}).filter((r) => !!r), F = (e) => e.nftTokenType ===
|
|
34
|
+
}).filter((r) => !!r), F = (e) => e.nftTokenType === T.ERC721 || e.nftTokenType === T.ERC1155 || e.nftTokenType === T.MetaplexNFT || e.nftTokenType === T.Token2022NFT || e.nftTokenType === T.CompressedNFT, v = (e) => e.chainId === f.arcTestnet && e.erc20TokenAddress === p, S = (e, r) => {
|
|
41
35
|
const o = r.toLowerCase();
|
|
42
36
|
return e.symbol.toLowerCase().includes(o) || e.name.toLowerCase().includes(o) || e.erc20TokenAddress.toLowerCase().startsWith(o);
|
|
43
|
-
},
|
|
37
|
+
}, P = (e) => {
|
|
44
38
|
const r = e.filter(
|
|
45
39
|
(s) => i.some((t) => t.symbol === s.symbol)
|
|
46
40
|
), o = e.filter(
|
|
47
41
|
(s) => !i.some((t) => t.symbol === s.symbol)
|
|
48
|
-
), n = r.sort((s, t) => s.symbol.localeCompare(t.symbol, "en-US")),
|
|
49
|
-
return [...n, ...
|
|
42
|
+
), n = r.sort((s, t) => s.symbol.localeCompare(t.symbol, "en-US")), m = o.sort((s, t) => s.symbol.localeCompare(t.symbol, "en-US"));
|
|
43
|
+
return [...n, ...m];
|
|
50
44
|
};
|
|
51
45
|
export {
|
|
52
46
|
N as aggregateTokenChanges,
|
|
53
|
-
|
|
47
|
+
E as formatTokenChangesList,
|
|
54
48
|
R as getERC20Token,
|
|
55
49
|
h as getERC20TokenBySymbol,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
S as isArcNativeToken,
|
|
50
|
+
a as getErc20TokensForChain,
|
|
51
|
+
v as isArcNativeToken,
|
|
59
52
|
F as isNFTToken,
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
S as searchCompareFunction,
|
|
54
|
+
P as sortTokens
|
|
62
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../API/getServerURL.cjs");require("axios");require("../../constants/coingecko.constants.cjs");require("../../constants/server.constants.cjs");require("../../
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../API/getServerURL.cjs");require("axios");require("../../constants/coingecko.constants.cjs");require("../../constants/server.constants.cjs");require("../../data-structures/http/HttpClient.cjs");const a=require("../../API/API.cjs");require("../../API/tenderly.api.cjs");require("../../constants/token-data/index.cjs");require("../../constants/chains.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/reorg-depths.constants.cjs");require("../../constants/addresses.constants.cjs");require("../../constants/token.limits.constants.cjs");require("../../constants/presale.constants.cjs");require("../../constants/activity.constants.cjs");require("../../constants/tasks.constants.cjs");require("../../constants/events.constants.cjs");const l=async(s,n)=>{const r=s.getApprovedUtxos(n);if(r.length===0)return[];const o=[...new Set(r.map(e=>e.tokenAddress.toLowerCase()))],i=(await a.API.tokensInfoCall(n,o)).filter(e=>!!e),u=new Map(i.map(e=>[e.erc20TokenAddress.toLowerCase(),e]));return r.map(e=>{const t=u.get(e.tokenAddress.toLowerCase());return t?{token:t,spenderAddress:e.interactionAddress,allowance:e.amount}:null}).filter(e=>e!==null&&e.allowance>0n)};exports.getHinkalApprovals=l;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
2
2
|
import { TokenApproval } from '../../types';
|
|
3
|
-
export declare const getHinkalApprovals: (hinkal: IHinkal) => Promise<TokenApproval[]>;
|
|
3
|
+
export declare const getHinkalApprovals: (hinkal: IHinkal, chainId: number) => Promise<TokenApproval[]>;
|
|
@@ -2,13 +2,14 @@ import "../../API/getServerURL.mjs";
|
|
|
2
2
|
import "axios";
|
|
3
3
|
import "../../constants/coingecko.constants.mjs";
|
|
4
4
|
import "../../constants/server.constants.mjs";
|
|
5
|
-
import "../../constants/chains.constants.mjs";
|
|
6
5
|
import "../../data-structures/http/HttpClient.mjs";
|
|
7
|
-
import "../../
|
|
8
|
-
import
|
|
6
|
+
import { API as m } from "../../API/API.mjs";
|
|
7
|
+
import "../../API/tenderly.api.mjs";
|
|
9
8
|
import "../../constants/token-data/index.mjs";
|
|
9
|
+
import "../../constants/chains.constants.mjs";
|
|
10
10
|
import "../../constants/contracts.constants.mjs";
|
|
11
11
|
import "../../constants/kyc.constants.mjs";
|
|
12
|
+
import "../../constants/vite.constants.mjs";
|
|
12
13
|
import "../../constants/reorg-depths.constants.mjs";
|
|
13
14
|
import "../../constants/addresses.constants.mjs";
|
|
14
15
|
import "../../constants/token.limits.constants.mjs";
|
|
@@ -16,23 +17,22 @@ import "../../constants/presale.constants.mjs";
|
|
|
16
17
|
import "../../constants/activity.constants.mjs";
|
|
17
18
|
import "../../constants/tasks.constants.mjs";
|
|
18
19
|
import "../../constants/events.constants.mjs";
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
if (o.length === 0)
|
|
20
|
+
const H = async (n, r) => {
|
|
21
|
+
const t = n.getApprovedUtxos(r);
|
|
22
|
+
if (t.length === 0)
|
|
23
23
|
return [];
|
|
24
|
-
const p = [...new Set(
|
|
25
|
-
(
|
|
26
|
-
), i = new Map(s.map((
|
|
27
|
-
return
|
|
28
|
-
const e = i.get(
|
|
24
|
+
const p = [...new Set(t.map((o) => o.tokenAddress.toLowerCase()))], s = (await m.tokensInfoCall(r, p)).filter(
|
|
25
|
+
(o) => !!o
|
|
26
|
+
), i = new Map(s.map((o) => [o.erc20TokenAddress.toLowerCase(), o]));
|
|
27
|
+
return t.map((o) => {
|
|
28
|
+
const e = i.get(o.tokenAddress.toLowerCase());
|
|
29
29
|
return e ? {
|
|
30
30
|
token: e,
|
|
31
|
-
spenderAddress:
|
|
32
|
-
allowance:
|
|
31
|
+
spenderAddress: o.interactionAddress,
|
|
32
|
+
allowance: o.amount
|
|
33
33
|
} : null;
|
|
34
|
-
}).filter((
|
|
34
|
+
}).filter((o) => o !== null && o.allowance > 0n);
|
|
35
35
|
};
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
H as getHinkalApprovals
|
|
38
38
|
};
|
|
@@ -7,8 +7,8 @@ export declare const decodeTxInput: (iface: utils.Interface, input: string) => {
|
|
|
7
7
|
externalActionId: BigNumber;
|
|
8
8
|
externalActionMetadata: string;
|
|
9
9
|
encryptedOutputs: string[];
|
|
10
|
-
hookData: import(
|
|
11
|
-
stealthAddressStructure: import(
|
|
10
|
+
hookData: import('../../types/circom-data.types').HookDataType;
|
|
11
|
+
stealthAddressStructure: import('../../types/circom-data.types').StealthAddressStructure<bigint>;
|
|
12
12
|
};
|
|
13
13
|
export declare const deserializeDecodedTxs: (decodedTx: DecodedTxWithUtxos<string, string>) => DecodedTxWithUtxos;
|
|
14
14
|
export declare const serializeDecodedTxs: (decodedTxs: DecodedTx[]) => {
|
|
@@ -26,7 +26,7 @@ export declare const serializeDecodedTxs: (decodedTxs: DecodedTx[]) => {
|
|
|
26
26
|
erc20TokenAddresses: string[];
|
|
27
27
|
externalActionMetadata: string;
|
|
28
28
|
encryptedOutputs: string[];
|
|
29
|
-
hookData: import(
|
|
29
|
+
hookData: import('../../types/circom-data.types').HookDataType;
|
|
30
30
|
};
|
|
31
31
|
status: string;
|
|
32
32
|
blockNumber: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../../data-structures/crypto-keys/decodeUTXO.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../../data-structures/crypto-keys/decodeUTXO.cjs"),o=require("./caseInsensitive.utils.cjs");require("../../types/circom-data.types.cjs");const p=require("../../types/ethereum-network.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");const q=require("./amounts.utils.cjs"),y=(c,t,r,u)=>{const n=t.getContractWithFetcher(r,p.ContractType.HinkalContract),a=n.interface,l=t.userKeys.getShieldedPrivateKey();return c.logs.filter(e=>o.caseInsensitiveEqual(e.address,n.address)).map(e=>{try{const s=a.parseLog(e);if(s.name==="NewCommitment"){const{encryptedOutput:d,index:g}=s.args;if(q.toBigInt(g)<0n){const i=m.decodeUtxo(d,l,r);if(o.caseInsensitiveEqual(i.erc20TokenAddress,u))return i}}}catch{return null}return null}).filter(e=>e!==null)};exports.getUtxosFromReceipt=y;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
2
|
import { Utxo } from '../../data-structures/utxo/Utxo';
|
|
3
3
|
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
4
|
-
export declare const getUtxosFromReceipt: (receipt: ethers.providers.TransactionReceipt, hinkal: IHinkal, tokenAddress: string) => Utxo[];
|
|
4
|
+
export declare const getUtxosFromReceipt: (receipt: ethers.providers.TransactionReceipt, hinkal: IHinkal, chainId: number, tokenAddress: string) => Utxo[];
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { decodeUtxo as u } from "../../data-structures/crypto-keys/decodeUTXO.mjs";
|
|
2
|
-
import { caseInsensitiveEqual as
|
|
2
|
+
import { caseInsensitiveEqual as s } from "./caseInsensitive.utils.mjs";
|
|
3
3
|
import "../../types/circom-data.types.mjs";
|
|
4
4
|
import { ContractType as f } from "../../types/ethereum-network.types.mjs";
|
|
5
5
|
import "../../types/transactions.types.mjs";
|
|
6
6
|
import "../../types/activities.types.mjs";
|
|
7
7
|
import { toBigInt as g } from "./amounts.utils.mjs";
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
return
|
|
8
|
+
const F = (c, e, r, a) => {
|
|
9
|
+
const o = e.getContractWithFetcher(r, f.HinkalContract), m = o.interface, p = e.userKeys.getShieldedPrivateKey();
|
|
10
|
+
return c.logs.filter((t) => s(t.address, o.address)).map((t) => {
|
|
11
11
|
try {
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
const { encryptedOutput:
|
|
12
|
+
const n = m.parseLog(t);
|
|
13
|
+
if (n.name === "NewCommitment") {
|
|
14
|
+
const { encryptedOutput: d, index: l } = n.args;
|
|
15
15
|
if (g(l) < 0n) {
|
|
16
|
-
const
|
|
17
|
-
if (i
|
|
18
|
-
return
|
|
16
|
+
const i = u(d, p, r);
|
|
17
|
+
if (s(i.erc20TokenAddress, a))
|
|
18
|
+
return i;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
} catch {
|
|
@@ -25,5 +25,5 @@ const k = (s, e, c) => {
|
|
|
25
25
|
}).filter((t) => t !== null);
|
|
26
26
|
};
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
F as getUtxosFromReceipt
|
|
29
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../constants/permit2.constants.cjs"),n=e=>e.some(o=>s.uniswapWorkaroundAddresses.some(r=>o.toLowerCase().includes(r.slice(2).toLowerCase())));exports.uniswapWorkaround=n;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
(e) => i.some((o) => e.toLowerCase().includes(o.slice(2).toLowerCase()))
|
|
1
|
+
import { uniswapWorkaroundAddresses as s } from "../../constants/permit2.constants.mjs";
|
|
2
|
+
const a = (o) => o.some(
|
|
3
|
+
(e) => s.some((r) => e.toLowerCase().includes(r.slice(2).toLowerCase()))
|
|
5
4
|
);
|
|
6
5
|
export {
|
|
7
|
-
a as
|
|
8
|
-
d as uniswapWorkaround
|
|
6
|
+
a as uniswapWorkaround
|
|
9
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("async-mutex"),t=new Map,u=e=>(t.has(e)||t.set(e,new n.Mutex),t.get(e)??new n.Mutex);exports.getChainBalanceFetchingMutex=u;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Mutex } from 'async-mutex';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const getChainBalanceFetchingMutex: (chainId: number) => Mutex;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Mutex as
|
|
2
|
-
const
|
|
1
|
+
import { Mutex as n } from "async-mutex";
|
|
2
|
+
const t = /* @__PURE__ */ new Map(), r = (e) => (t.has(e) || t.set(e, new n()), t.get(e) ?? new n());
|
|
3
3
|
export {
|
|
4
|
-
|
|
4
|
+
r as getChainBalanceFetchingMutex
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../constants/protocol.constants.cjs");require("../../error-handling/error-codes.constants.cjs");require("ethers");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");require("../../constants/vite.constants.cjs");const c=require("../../error-handling/logger.cjs"),i=s=>{const e={};return s.forEach(({assetInfo:t,id:o})=>{if(n.NFT_TRANSACTION_TYPES.includes(t.standard)&&o)try{if(t?.contractAddress){const r=t.contractAddress.toLowerCase();e[r]||(e[r]=[]),e[r].push(BigInt(o).toString())}}catch(r){c.Logger.error(`Failed to parse tokenId: ${o}`,r)}}),e};exports.extractTokenIdsFromAssetChanges=i;
|
|
@@ -1,40 +1,25 @@
|
|
|
1
|
-
import { NFT_TRANSACTION_TYPES as
|
|
1
|
+
import { NFT_TRANSACTION_TYPES as c } from "../../constants/protocol.constants.mjs";
|
|
2
2
|
import "../../error-handling/error-codes.constants.mjs";
|
|
3
3
|
import "ethers";
|
|
4
4
|
import "../../types/circom-data.types.mjs";
|
|
5
5
|
import "../../types/transactions.types.mjs";
|
|
6
6
|
import "../../types/activities.types.mjs";
|
|
7
|
-
import "../../constants/server.constants.mjs";
|
|
8
|
-
import "../../API/getServerURL.mjs";
|
|
9
|
-
import "../../data-structures/http/HttpClient.mjs";
|
|
10
|
-
import "axios";
|
|
11
|
-
import "../../constants/chains.constants.mjs";
|
|
12
|
-
import "circomlibjs-hinkal-fork";
|
|
13
|
-
import "libsodium-wrappers";
|
|
14
|
-
import "process";
|
|
15
|
-
import "buffer";
|
|
16
7
|
import "../../constants/vite.constants.mjs";
|
|
17
|
-
import "../../
|
|
18
|
-
|
|
19
|
-
import "./mutexes.utils.mjs";
|
|
20
|
-
import "@coral-xyz/anchor";
|
|
21
|
-
import { Logger as e } from "../../error-handling/logger.mjs";
|
|
22
|
-
import "@solana/web3.js";
|
|
23
|
-
import "../../data-structures/crypto-keys/keys.mjs";
|
|
24
|
-
const y = (m) => {
|
|
8
|
+
import { Logger as n } from "../../error-handling/logger.mjs";
|
|
9
|
+
const g = (s) => {
|
|
25
10
|
const t = {};
|
|
26
|
-
return
|
|
27
|
-
if (
|
|
11
|
+
return s.forEach(({ assetInfo: o, id: e }) => {
|
|
12
|
+
if (c.includes(o.standard) && e)
|
|
28
13
|
try {
|
|
29
14
|
if (o?.contractAddress) {
|
|
30
15
|
const r = o.contractAddress.toLowerCase();
|
|
31
|
-
t[r] || (t[r] = []), t[r].push(BigInt(
|
|
16
|
+
t[r] || (t[r] = []), t[r].push(BigInt(e).toString());
|
|
32
17
|
}
|
|
33
18
|
} catch (r) {
|
|
34
|
-
|
|
19
|
+
n.error(`Failed to parse tokenId: ${e}`, r);
|
|
35
20
|
}
|
|
36
21
|
}), t;
|
|
37
22
|
};
|
|
38
23
|
export {
|
|
39
|
-
|
|
24
|
+
g as extractTokenIdsFromAssetChanges
|
|
40
25
|
};
|
|
@@ -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("ethers"),v=require("@solana/web3.js"),i=require("../../crypto/preProcessing.cjs"),d=require("../../providers/EthersProviderAdapter.cjs"),s=require("../../constants/chains.constants.cjs"),c=require("./create-provider.cjs"),l=require("../../providers/SolanaProviderAdapter.cjs"),h=(r,t)=>{const e=s.networkRegistry[t].fetchRpcUrl;if(!e)throw new Error("RPC URL not found for the specified chain ID");const n=c.createCustomRpcProvider(e);return new p.ethers.Wallet(r,n)},w=(r,t)=>{const e=s.networkRegistry[t].fetchRpcUrl;if(!e)throw new Error("RPC URL not found for the specified chain ID");const n=c.createCustomRpcProvider(e);return new p.ethers.VoidSigner(r,n)},f=async(r,t)=>{await i.preProcessing();const e=d.default();e.initSigner?.(t),await r.initProviderAdapter(void 0,e),await r.initUserKeys()},g=async(r,t,e)=>{const n=d.default(),a=w(e,t);n.initSigner?.(a),await r.initProviderAdapter(void 0,n)},y=async(r,t,e,n)=>{await i.preProcessing(),await g(r,e,t),await r.initUserKeysWithPassword(n)},u=r=>{const t=r.userKeys.getDerivedSolanaPublicKey();return{publicKey:new v.PublicKey(t),signTransaction:()=>{throw new Error("Void wallet cannot sign transactions")},signAllTransactions:()=>{throw new Error("Void wallet cannot sign transactions")},signMessage:()=>{throw new Error("Void wallet cannot sign messages")}}},P=async(r,t,e)=>{const n=s.networkRegistry[t].fetchRpcUrl;if(!n)throw new Error("RPC URL not found for the specified chain ID");const a=c.createCustomSolanaConnection(n),o=u(r),S=new l.SolanaProviderAdapter(a,t,o,e);await r.initProviderAdapter(o,S)},A=async(r,t,e)=>{await i.preProcessing();const n=s.networkRegistry[t].fetchRpcUrl;if(!n)throw new Error("RPC URL not found for the specified chain ID");const a=c.createCustomSolanaConnection(n),o=new l.SolanaProviderAdapter(a,t,e);await r.initProviderAdapter(e,o),await r.initUserKeys()},R=async(r,t,e,n)=>{await r.initUserKeysWithPassword(n),await i.preProcessing(),await P(r,e,t)};exports.createSigner=h;exports.createVoidSigner=w;exports.createVoidSolanaWallet=u;exports.prepareEthersProviderAdapter=g;exports.prepareHinkal=f;exports.prepareHinkalWithSignature=y;exports.prepareSolanaHinkal=A;exports.prepareSolanaHinkalWithSignature=R;exports.prepareSolanaProviderAdapter=P;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
2
|
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
3
|
-
import { UserKeys } from '../../data-structures/crypto-keys/keys';
|
|
4
3
|
import { SolanaWallet } from '../../types/solana.types';
|
|
5
4
|
export declare const createSigner: (privateKey: string, chainId: number) => ethers.Wallet;
|
|
6
5
|
export declare const createVoidSigner: (address: string, chainId: number) => ethers.VoidSigner;
|
|
7
6
|
export declare const prepareHinkal: (hinkal: IHinkal, signer: ethers.Wallet) => Promise<void>;
|
|
8
7
|
export declare const prepareEthersProviderAdapter: (hinkal: IHinkal, chainId: number, ethereumAddress: string) => Promise<void>;
|
|
9
8
|
export declare const prepareHinkalWithSignature: (hinkal: IHinkal, address: string, chainId: number, signature: string) => Promise<void>;
|
|
10
|
-
export declare const prepareToAccessNewWallet: (hinkal: IHinkal, privateKey: string) => Promise<{
|
|
11
|
-
userKeys: UserKeys;
|
|
12
|
-
signer: ethers.Wallet;
|
|
13
|
-
}>;
|
|
14
|
-
export declare const prepareToAccessNewWalletWithSignature: (hinkal: IHinkal, address: string, signature: string) => Promise<UserKeys>;
|
|
15
9
|
export declare const createVoidSolanaWallet: (hinkal: IHinkal) => SolanaWallet;
|
|
16
10
|
export declare const prepareSolanaProviderAdapter: (hinkal: IHinkal, chainId: number, ethereumAddress: string) => Promise<void>;
|
|
17
11
|
export declare const prepareSolanaHinkal: (hinkal: IHinkal, chainId: number, wallet: SolanaWallet) => Promise<void>;
|
|
@@ -1,52 +1,35 @@
|
|
|
1
|
-
import { ethers as
|
|
2
|
-
import { PublicKey as
|
|
1
|
+
import { ethers as c } from "ethers";
|
|
2
|
+
import { PublicKey as P } from "@solana/web3.js";
|
|
3
3
|
import { preProcessing as a } from "../../crypto/preProcessing.mjs";
|
|
4
|
-
import
|
|
5
|
-
import { networkRegistry as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const e = c[t].fetchRpcUrl;
|
|
4
|
+
import p from "../../providers/EthersProviderAdapter.mjs";
|
|
5
|
+
import { networkRegistry as s } from "../../constants/chains.constants.mjs";
|
|
6
|
+
import { createCustomRpcProvider as d, createCustomSolanaConnection as w } from "./create-provider.mjs";
|
|
7
|
+
import { SolanaProviderAdapter as l } from "../../providers/SolanaProviderAdapter.mjs";
|
|
8
|
+
const K = (r, t) => {
|
|
9
|
+
const e = s[t].fetchRpcUrl;
|
|
11
10
|
if (!e)
|
|
12
11
|
throw new Error("RPC URL not found for the specified chain ID");
|
|
13
|
-
const
|
|
14
|
-
return new
|
|
15
|
-
},
|
|
16
|
-
const e =
|
|
12
|
+
const o = d(e);
|
|
13
|
+
return new c.Wallet(r, o);
|
|
14
|
+
}, g = (r, t) => {
|
|
15
|
+
const e = s[t].fetchRpcUrl;
|
|
17
16
|
if (!e)
|
|
18
17
|
throw new Error("RPC URL not found for the specified chain ID");
|
|
19
|
-
const
|
|
20
|
-
return new
|
|
18
|
+
const o = d(e);
|
|
19
|
+
return new c.VoidSigner(r, o);
|
|
21
20
|
}, C = async (r, t) => {
|
|
22
21
|
await a();
|
|
23
|
-
const e =
|
|
22
|
+
const e = p();
|
|
24
23
|
e.initSigner?.(t), await r.initProviderAdapter(void 0, e), await r.initUserKeys();
|
|
25
|
-
},
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
await a(), await
|
|
30
|
-
},
|
|
31
|
-
await a();
|
|
32
|
-
const e = r.getSelectedNetwork()?.chainId;
|
|
33
|
-
if (!e)
|
|
34
|
-
throw Error("chainId is undefined");
|
|
35
|
-
const n = v(t, e), o = s();
|
|
36
|
-
return o.initSigner?.(n), { userKeys: new w(await o.signMessage(r.signingMessage)), signer: n };
|
|
37
|
-
}, b = async (r, t, e) => {
|
|
38
|
-
await a();
|
|
39
|
-
const n = r.getSelectedNetwork()?.chainId;
|
|
40
|
-
if (!n)
|
|
41
|
-
throw Error("chainId is undefined");
|
|
42
|
-
const o = h(t, n);
|
|
43
|
-
s().initSigner?.(o);
|
|
44
|
-
const d = new w(e);
|
|
45
|
-
return await r.switchAccount(o), d;
|
|
46
|
-
}, A = (r) => {
|
|
24
|
+
}, h = async (r, t, e) => {
|
|
25
|
+
const o = p(), n = g(e, t);
|
|
26
|
+
o.initSigner?.(n), await r.initProviderAdapter(void 0, o);
|
|
27
|
+
}, W = async (r, t, e, o) => {
|
|
28
|
+
await a(), await h(r, e, t), await r.initUserKeysWithPassword(o);
|
|
29
|
+
}, v = (r) => {
|
|
47
30
|
const t = r.userKeys.getDerivedSolanaPublicKey();
|
|
48
31
|
return {
|
|
49
|
-
publicKey: new
|
|
32
|
+
publicKey: new P(t),
|
|
50
33
|
signTransaction: () => {
|
|
51
34
|
throw new Error("Void wallet cannot sign transactions");
|
|
52
35
|
},
|
|
@@ -57,32 +40,30 @@ const v = (r, t) => {
|
|
|
57
40
|
throw new Error("Void wallet cannot sign messages");
|
|
58
41
|
}
|
|
59
42
|
};
|
|
60
|
-
},
|
|
61
|
-
const
|
|
62
|
-
if (!
|
|
43
|
+
}, m = async (r, t, e) => {
|
|
44
|
+
const o = s[t].fetchRpcUrl;
|
|
45
|
+
if (!o)
|
|
63
46
|
throw new Error("RPC URL not found for the specified chain ID");
|
|
64
|
-
const
|
|
65
|
-
await r.initProviderAdapter(i,
|
|
66
|
-
},
|
|
47
|
+
const n = w(o), i = v(r), f = new l(n, t, i, e);
|
|
48
|
+
await r.initProviderAdapter(i, f);
|
|
49
|
+
}, V = async (r, t, e) => {
|
|
67
50
|
await a();
|
|
68
|
-
const
|
|
69
|
-
if (!
|
|
51
|
+
const o = s[t].fetchRpcUrl;
|
|
52
|
+
if (!o)
|
|
70
53
|
throw new Error("RPC URL not found for the specified chain ID");
|
|
71
|
-
const
|
|
54
|
+
const n = w(o), i = new l(n, t, e);
|
|
72
55
|
await r.initProviderAdapter(e, i), await r.initUserKeys();
|
|
73
|
-
},
|
|
74
|
-
await r.initUserKeysWithPassword(
|
|
56
|
+
}, D = async (r, t, e, o) => {
|
|
57
|
+
await r.initUserKeysWithPassword(o), await a(), await m(r, e, t);
|
|
75
58
|
};
|
|
76
59
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
60
|
+
K as createSigner,
|
|
61
|
+
g as createVoidSigner,
|
|
62
|
+
v as createVoidSolanaWallet,
|
|
63
|
+
h as prepareEthersProviderAdapter,
|
|
81
64
|
C as prepareHinkal,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
D as prepareToAccessNewWallet,
|
|
87
|
-
b as prepareToAccessNewWalletWithSignature
|
|
65
|
+
W as prepareHinkalWithSignature,
|
|
66
|
+
V as prepareSolanaHinkal,
|
|
67
|
+
D as prepareSolanaHinkalWithSignature,
|
|
68
|
+
m as prepareSolanaProviderAdapter
|
|
88
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../API/API.cjs"),i=require("../../error-handling/error-codes.constants.cjs"),c=require("./caseInsensitive.utils.cjs"),l=async(n,e)=>{const t=await s.API.tokensInfoCall(n,e),a=[];return t.forEach((r,o)=>{(!r||!r.balanceStorageOffset||!r.allowanceStorageOffset)&&a.push(e[o])}),a},d=n=>{if(n.length===0)throw new Error("Token array cannot be empty");const e=n.map(r=>r.chainId),t=e[0];if(!e.every(r=>r===t))throw new Error(i.transactionErrorCodes.TOKENS_DO_NOT_BELONG_SAME_CHAIN);return t},h=(n,e)=>!n||!e?!1:c.caseInsensitiveEqual(n.erc20TokenAddress,e.erc20TokenAddress)&&n.chainId===e.chainId;exports.checkTokensForShielding=l;exports.isSameERC20Token=h;exports.validateAndGetChainId=d;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
+
import { ERC20Token } from '../../types/token.types';
|
|
1
2
|
export declare const checkTokensForShielding: (chainId: number, erc20Addresses: string[]) => Promise<string[]>;
|
|
3
|
+
export declare const validateAndGetChainId: (tokens: ERC20Token[]) => number;
|
|
4
|
+
export declare const isSameERC20Token: (a?: ERC20Token, b?: ERC20Token) => boolean;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import { API as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { API as i } from "../../API/API.mjs";
|
|
2
|
+
import { transactionErrorCodes as s } from "../../error-handling/error-codes.constants.mjs";
|
|
3
|
+
import { caseInsensitiveEqual as c } from "./caseInsensitive.utils.mjs";
|
|
4
|
+
const d = async (e, n) => {
|
|
5
|
+
const o = await i.tokensInfoCall(e, n), a = [];
|
|
6
|
+
return o.forEach((r, t) => {
|
|
7
|
+
(!r || !r.balanceStorageOffset || !r.allowanceStorageOffset) && a.push(n[t]);
|
|
6
8
|
}), a;
|
|
7
|
-
}
|
|
9
|
+
}, m = (e) => {
|
|
10
|
+
if (e.length === 0)
|
|
11
|
+
throw new Error("Token array cannot be empty");
|
|
12
|
+
const n = e.map((r) => r.chainId), o = n[0];
|
|
13
|
+
if (!n.every((r) => r === o))
|
|
14
|
+
throw new Error(s.TOKENS_DO_NOT_BELONG_SAME_CHAIN);
|
|
15
|
+
return o;
|
|
16
|
+
}, E = (e, n) => !e || !n ? !1 : c(e.erc20TokenAddress, n.erc20TokenAddress) && e.chainId === n.chainId;
|
|
8
17
|
export {
|
|
9
|
-
|
|
18
|
+
d as checkTokensForShielding,
|
|
19
|
+
E as isSameERC20Token,
|
|
20
|
+
m as validateAndGetChainId
|
|
10
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../error-handling/error-codes.constants.cjs"),o=require("./caseInsensitive.utils.cjs"),n=async(e,t)=>{const r=await e.getEthereumAddress();if(!o.caseInsensitiveEqual(r,t))throw Error(s.transactionErrorCodes.ERROR_MESSAGE_CHAIN_ADDRESS_CHANGED);return!0};exports.checkAddressNotUpdated=n;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const checkAddressNotUpdated: (hinkal: IHinkal, oldEthAddress: string) => Promise<boolean>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { transactionErrorCodes as s } from "../../error-handling/error-codes.constants.mjs";
|
|
2
2
|
import { caseInsensitiveEqual as o } from "./caseInsensitive.utils.mjs";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
if (
|
|
3
|
+
const n = async (r, t) => {
|
|
4
|
+
const e = await r.getEthereumAddress();
|
|
5
|
+
if (!o(e, t))
|
|
6
6
|
throw Error(s.ERROR_MESSAGE_CHAIN_ADDRESS_CHANGED);
|
|
7
7
|
return !0;
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
n as checkAddressNotUpdated
|
|
11
11
|
};
|