@hinkal/common 0.2.26 → 0.2.28
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 +35 -17
- package/API/API.mjs +100 -80
- package/API/admin-calls.cjs +1 -1
- package/API/admin-calls.d.ts +8 -1
- package/API/admin-calls.mjs +6 -5
- 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 +14 -6
- 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/deposit-and-withdraw-status-calls.cjs +1 -1
- package/API/deposit-and-withdraw-status-calls.d.ts +3 -2
- package/API/deposit-and-withdraw-status-calls.mjs +8 -8
- package/API/enclaveSignatureCalls.cjs +1 -0
- package/API/enclaveSignatureCalls.d.ts +10 -0
- package/API/enclaveSignatureCalls.mjs +16 -0
- package/API/enclaveUtxoCalls.cjs +1 -0
- package/API/enclaveUtxoCalls.d.ts +40 -0
- package/API/enclaveUtxoCalls.mjs +24 -0
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.d.ts +2 -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/getCoingeckoPrice.cjs +1 -1
- package/API/getCoingeckoPrice.d.ts +0 -1
- package/API/getCoingeckoPrice.mjs +15 -16
- 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.cjs +1 -1
- package/API/getWebsiteURL.d.ts +1 -0
- package/API/getWebsiteURL.mjs +25 -10
- package/API/index.d.ts +3 -3
- 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/privacy-score-calls.cjs +1 -0
- package/API/privacy-score-calls.d.ts +17 -0
- package/API/privacy-score-calls.mjs +29 -0
- package/API/privateSendEmailNotificationsCalls.cjs +1 -0
- package/API/privateSendEmailNotificationsCalls.d.ts +8 -0
- package/API/privateSendEmailNotificationsCalls.mjs +11 -0
- package/API/privateSendNonceCalls.cjs +1 -0
- package/API/privateSendNonceCalls.d.ts +13 -0
- package/API/privateSendNonceCalls.mjs +15 -0
- package/API/privateSendRecipientInfoCalls.cjs +1 -0
- package/API/privateSendRecipientInfoCalls.d.ts +21 -0
- package/API/privateSendRecipientInfoCalls.mjs +15 -0
- package/API/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.d.ts +4 -2
- package/API/proxyAccountsCalls.mjs +18 -20
- package/API/relayCalls.cjs +1 -1
- package/API/relayCalls.mjs +4 -4
- package/API/rewardsUserCalls.cjs +1 -1
- package/API/rewardsUserCalls.d.ts +9 -0
- package/API/rewardsUserCalls.mjs +28 -22
- package/API/scheduled-transactions-calls.cjs +1 -1
- package/API/scheduled-transactions-calls.d.ts +2 -2
- package/API/scheduled-transactions-calls.mjs +9 -8
- 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/simulate-transaction.cjs +1 -0
- package/API/{is-tx-stateless.d.ts → simulate-transaction.d.ts} +1 -1
- package/API/simulate-transaction.mjs +18 -0
- package/API/snapshot-event-calls.cjs +1 -0
- package/API/snapshot-event-calls.d.ts +7 -0
- package/API/snapshot-event-calls.mjs +13 -0
- package/API/solana-calls.cjs +1 -1
- package/API/solana-calls.d.ts +8 -4
- package/API/solana-calls.mjs +15 -15
- package/API/temporaryWalletCalls.cjs +1 -1
- package/API/temporaryWalletCalls.mjs +13 -19
- package/API/token-calls.cjs +1 -1
- package/API/token-calls.mjs +6 -5
- package/API/tronSubsidyCalls.cjs +1 -0
- package/API/tronSubsidyCalls.d.ts +13 -0
- package/API/tronSubsidyCalls.mjs +11 -0
- package/README.md +20 -13
- package/constants/activity.constants.cjs +1 -1
- package/constants/activity.constants.mjs +4 -2
- package/constants/addresses.constants.cjs +1 -1
- package/constants/addresses.constants.mjs +1 -1
- package/constants/bridging.constants.cjs +1 -1
- package/constants/bridging.constants.d.ts +4 -0
- package/constants/bridging.constants.mjs +6 -2
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +6 -6
- package/constants/chains.constants.mjs +112 -69
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +2 -1
- package/constants/coingecko.constants.mjs +49 -38
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-solana.json.mjs +390 -9
- package/constants/deploy-data/deploy-data-tronMainnet.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-tronMainnet.json.mjs +4638 -0
- package/constants/deploy-data/deploy-data-tronNile.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-tronNile.json.mjs +4638 -0
- package/constants/deploy-data/index.d.ts +3 -1
- package/constants/fees.constants.cjs +1 -1
- package/constants/fees.constants.d.ts +4 -1
- package/constants/fees.constants.mjs +8 -4
- 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/images.constants.cjs +1 -0
- package/constants/images.constants.d.ts +1 -0
- package/constants/images.constants.mjs +4 -0
- package/constants/index.d.ts +6 -0
- package/constants/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.mjs +39 -40
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +5 -1
- package/constants/mediaUrls.constants.mjs +6 -2
- package/constants/non-circular-tokens.constants.cjs +1 -0
- package/constants/non-circular-tokens.constants.d.ts +1 -0
- package/constants/non-circular-tokens.constants.mjs +4 -0
- package/constants/pay.constants.cjs +1 -0
- package/constants/pay.constants.d.ts +1 -0
- package/constants/pay.constants.mjs +4 -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/protocol.constants.cjs +1 -1
- package/constants/protocol.constants.d.ts +6 -1
- package/constants/protocol.constants.mjs +38 -33
- package/constants/reorg-depths.constants.cjs +1 -1
- package/constants/reorg-depths.constants.mjs +3 -0
- package/constants/save-depths.cjs +1 -1
- package/constants/save-depths.mjs +6 -3
- package/constants/schedule.constants.cjs +1 -0
- package/constants/schedule.constants.d.ts +2 -0
- package/constants/schedule.constants.mjs +14 -0
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +31 -123
- package/constants/server.constants.mjs +65 -156
- package/constants/tasks.constants.cjs +1 -1
- package/constants/tasks.constants.mjs +5 -4
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +48 -34
- package/constants/token-data/arbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistry.json.mjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.mjs +1 -1
- package/constants/token-data/arcTestnetRegistry.json.cjs +1 -1
- package/constants/token-data/arcTestnetRegistry.json.mjs +2 -2
- package/constants/token-data/avalancheRegistry.json.cjs +1 -1
- package/constants/token-data/avalancheRegistry.json.mjs +1 -1
- package/constants/token-data/avalancheRegistryFixed.json.cjs +1 -1
- package/constants/token-data/avalancheRegistryFixed.json.mjs +1 -1
- package/constants/token-data/baseRegistry.json.cjs +1 -1
- package/constants/token-data/baseRegistry.json.mjs +3 -3
- package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
- package/constants/token-data/baseRegistryFixed.json.mjs +1 -1
- package/constants/token-data/bnbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistry.json.mjs +2 -2
- package/constants/token-data/bnbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistryFixed.json.mjs +2 -2
- package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistry.json.mjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.mjs +1 -1
- package/constants/token-data/index.d.ts +2 -2
- package/constants/token-data/solanaMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/solanaMainnetRegistry.json.mjs +143 -74
- package/constants/token-data/tronMainnetRegistry.json.cjs +1 -0
- package/constants/token-data/tronMainnetRegistry.json.mjs +24 -0
- package/constants/token-data/tronNileRegistry.json.cjs +1 -0
- package/constants/token-data/tronNileRegistry.json.mjs +24 -0
- package/constants/tokens.constants.cjs +1 -0
- package/constants/tokens.constants.d.ts +3 -0
- package/constants/tokens.constants.mjs +15 -0
- package/constants/tx-confirmation.constants.cjs +1 -0
- package/constants/tx-confirmation.constants.d.ts +4 -0
- package/constants/tx-confirmation.constants.mjs +7 -0
- package/constants/wallet.constants.cjs +1 -1
- package/constants/wallet.constants.d.ts +1 -7
- package/constants/wallet.constants.mjs +18 -8
- package/crypto/poseidon.cjs +1 -1
- package/crypto/poseidon.mjs +5 -5
- package/data-structures/AccountActions/AccountActions.cjs +1 -0
- package/data-structures/AccountActions/AccountActions.d.ts +17 -0
- package/data-structures/AccountActions/AccountActions.mjs +67 -0
- package/data-structures/AccountActions/index.d.ts +1 -0
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +106 -109
- package/data-structures/BlockchainEvent/BlockchainEvent.cjs +1 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.d.ts +14 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.mjs +45 -0
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +66 -74
- package/data-structures/Hinkal/Hinkal.mjs +366 -392
- package/data-structures/Hinkal/IHinkal.d.ts +61 -71
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.d.ts +2 -4
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +146 -79
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.d.ts +1 -2
- package/data-structures/Hinkal/hinkalActionReceive.mjs +26 -22
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.d.ts +1 -0
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +34 -22
- package/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -0
- package/data-structures/Hinkal/hinkalClaimUtxo.d.ts +6 -0
- package/data-structures/Hinkal/hinkalClaimUtxo.mjs +119 -0
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.d.ts +2 -2
- package/data-structures/Hinkal/hinkalDeposit.mjs +101 -92
- package/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -0
- package/data-structures/Hinkal/{hinkalDepostAndBridge.d.ts → hinkalDepositAndBridge.d.ts} +2 -2
- package/data-structures/Hinkal/hinkalDepositAndBridge.mjs +259 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +2 -2
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +159 -102
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +131 -92
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +4 -5
- package/data-structures/Hinkal/hinkalMultiSend.cjs +1 -1
- package/data-structures/Hinkal/hinkalMultiSend.d.ts +1 -1
- package/data-structures/Hinkal/hinkalMultiSend.mjs +4 -4
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +121 -125
- package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +2 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +188 -38
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.d.ts +1 -2
- package/data-structures/Hinkal/hinkalProxySwap.mjs +34 -31
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +32 -28
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +1 -2
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +17 -15
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.d.ts +5 -0
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +130 -0
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +6 -3
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +98 -110
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +3 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +228 -197
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.d.ts +5 -0
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +28 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +4 -4
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +44 -43
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +2 -2
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +73 -71
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +3 -3
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +79 -64
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +122 -100
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +29 -2
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +132 -70
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +3 -2
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +113 -75
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +71 -103
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.d.ts +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +96 -96
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.d.ts +2 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +97 -99
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.d.ts +1 -2
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +204 -113
- package/data-structures/Hinkal/index.d.ts +4 -0
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +109 -54
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.d.ts +4 -5
- package/data-structures/IndexedDB/activity-db.mjs +124 -131
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +45 -38
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +43 -36
- package/data-structures/IndexedDB/index.d.ts +1 -0
- package/data-structures/IndexedDB/pay-activity-db.cjs +1 -0
- package/data-structures/IndexedDB/pay-activity-db.d.ts +9 -0
- package/data-structures/IndexedDB/pay-activity-db.mjs +26 -0
- package/data-structures/IndexedDB/prices-db.cjs +1 -1
- package/data-structures/IndexedDB/prices-db.mjs +1 -1
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +26 -40
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +82 -79
- 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/decodeUTXO.cjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.mjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +29 -30
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +9 -11
- package/data-structures/crypto-keys/keys.mjs +65 -110
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.mjs +9 -9
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.mjs +5 -5
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.d.ts +9 -4
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.mjs +65 -48
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractEventService.d.ts +4 -2
- package/data-structures/event-service/evm/AbstractEventService.mjs +13 -13
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +5 -5
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +2 -2
- package/data-structures/event-service/evm/AbstractSnapshotService.mjs +5 -6
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +18 -7
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +75 -49
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.d.ts +11 -0
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +25 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.d.ts +6 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.mjs +16 -0
- package/data-structures/event-service/helpers/ClientEventHelper.cjs +1 -0
- package/data-structures/event-service/helpers/ClientEventHelper.d.ts +10 -0
- package/data-structures/event-service/helpers/ClientEventHelper.mjs +38 -0
- package/data-structures/event-service/helpers/PollingEventHelper.cjs +1 -0
- package/data-structures/event-service/helpers/PollingEventHelper.d.ts +5 -0
- package/data-structures/event-service/helpers/PollingEventHelper.mjs +14 -0
- package/data-structures/event-service/index.d.ts +4 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +3 -2
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +6 -6
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.d.ts +9 -4
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +65 -48
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +5 -10
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +13 -7
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +3 -2
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +4 -4
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +1 -2
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +1 -2
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.d.ts +11 -0
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.mjs +26 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.d.ts +6 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.mjs +16 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +20 -19
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +126 -76
- package/data-structures/index.d.ts +2 -0
- package/data-structures/merkle-tree/MerkleTree.cjs +1 -1
- package/data-structures/merkle-tree/MerkleTree.d.ts +3 -2
- package/data-structures/merkle-tree/MerkleTree.mjs +27 -17
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs +1 -1
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.ts +1 -2
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs +6 -6
- package/data-structures/presale/PresaleContractWrapper.d.ts +1 -1
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +9 -13
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +23 -18
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +12 -7
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +11 -5
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +9 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +9 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +12 -6
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +10 -5
- package/error-handling/customErrors/ErrorWithIndex.cjs +1 -0
- package/error-handling/customErrors/ErrorWithIndex.d.ts +4 -0
- package/error-handling/customErrors/ErrorWithIndex.mjs +9 -0
- package/error-handling/customErrors/ErrorWithTx.cjs +1 -1
- package/error-handling/customErrors/ErrorWithTx.d.ts +2 -3
- package/error-handling/customErrors/ErrorWithTx.mjs +5 -5
- package/error-handling/customErrors/index.d.ts +1 -0
- package/error-handling/error-codes.constants.cjs +2 -2
- package/error-handling/error-codes.constants.d.ts +29 -0
- package/error-handling/error-codes.constants.mjs +51 -22
- package/error-handling/get-error.message.cjs +1 -1
- package/error-handling/get-error.message.mjs +46 -47
- package/error-handling/index.d.ts +0 -1
- package/error-handling/isInsufficientFundsError.cjs +1 -0
- package/error-handling/isInsufficientFundsError.d.ts +1 -0
- package/error-handling/isInsufficientFundsError.mjs +19 -0
- package/functions/auto-deposit-back-helpers/get-gas-token-records.cjs +1 -0
- package/functions/auto-deposit-back-helpers/get-gas-token-records.d.ts +9 -0
- package/functions/auto-deposit-back-helpers/get-gas-token-records.mjs +74 -0
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.cjs +1 -0
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.d.ts +3 -0
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.mjs +61 -0
- package/functions/auto-deposit-back-helpers/index.d.ts +4 -0
- package/functions/auto-deposit-back-helpers/select-gas-token.cjs +1 -0
- package/functions/auto-deposit-back-helpers/select-gas-token.d.ts +13 -0
- package/functions/auto-deposit-back-helpers/select-gas-token.mjs +79 -0
- package/functions/auto-deposit-back-helpers/update-hinkal.cjs +1 -0
- package/functions/auto-deposit-back-helpers/update-hinkal.d.ts +3 -0
- package/functions/auto-deposit-back-helpers/update-hinkal.mjs +18 -0
- package/functions/connectors.types.d.ts +11 -3
- package/functions/index.d.ts +1 -0
- package/functions/kyc/zkMeHelper.cjs +1 -1
- package/functions/kyc/zkMeHelper.mjs +17 -16
- package/functions/pre-transaction/addressTableLookup.cjs +1 -1
- package/functions/pre-transaction/addressTableLookup.mjs +1 -1
- 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/convert-okx-instructions.cjs +1 -1
- package/functions/pre-transaction/convert-okx-instructions.mjs +20 -16
- package/functions/pre-transaction/ensureAmountChanges.cjs +1 -0
- package/functions/pre-transaction/ensureAmountChanges.d.ts +2 -0
- package/functions/pre-transaction/ensureAmountChanges.mjs +11 -0
- 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/getFeeStructure.cjs +1 -1
- package/functions/pre-transaction/getFeeStructure.d.ts +2 -1
- package/functions/pre-transaction/getFeeStructure.mjs +13 -12
- package/functions/pre-transaction/getKycAndSignatureData.cjs +1 -0
- package/functions/pre-transaction/getKycAndSignatureData.d.ts +5 -0
- package/functions/pre-transaction/getKycAndSignatureData.mjs +20 -0
- package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +22 -36
- package/functions/pre-transaction/index.d.ts +4 -0
- package/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
- package/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +1 -1
- package/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +17 -17
- package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -1
- package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +1 -9
- package/functions/pre-transaction/outputApprovalDataProcessing.mjs +19 -34
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -1
- package/functions/pre-transaction/sendV0Transaction.d.ts +4 -8
- package/functions/pre-transaction/sendV0Transaction.mjs +150 -86
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +7 -4
- package/functions/pre-transaction/store-instructions.cjs +1 -1
- package/functions/pre-transaction/store-instructions.mjs +11 -6
- package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs +1 -0
- package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.d.ts +3 -0
- package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs +33 -0
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +12 -7
- package/functions/private-wallet/emporium.helpers.mjs +105 -131
- 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 +98 -100
- package/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/functions/snarkjs/common.snarkjs.d.ts +4 -5
- package/functions/snarkjs/common.snarkjs.mjs +113 -111
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.mjs +7 -1
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.d.ts +4 -4
- package/functions/snarkjs/constructEmporiumProof.mjs +111 -121
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +2 -2
- package/functions/snarkjs/constructGeneralZkProof.mjs +104 -124
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/functions/snarkjs/constructSolanaZkProof.d.ts +1 -1
- package/functions/snarkjs/constructSolanaZkProof.mjs +58 -64
- package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +11 -10
- package/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -0
- package/functions/snarkjs/fetchOnChainRootHashes.d.ts +4 -0
- package/functions/snarkjs/fetchOnChainRootHashes.mjs +15 -0
- package/functions/snarkjs/generateCircomData.cjs +1 -1
- package/functions/snarkjs/generateCircomData.d.ts +3 -3
- package/functions/snarkjs/generateCircomData.mjs +29 -31
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.cjs +1 -1
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.d.ts +12 -1
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +161 -65
- package/functions/snarkjs/getZKFiles.cjs +1 -1
- package/functions/snarkjs/getZKFiles.mjs +8 -11
- package/functions/snarkjs/index.d.ts +1 -0
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +3 -0
- package/functions/utils/addresses.mjs +32 -17
- package/functions/utils/amounts.utils.cjs +1 -1
- package/functions/utils/amounts.utils.d.ts +1 -1
- package/functions/utils/amounts.utils.mjs +2 -2
- package/functions/utils/buildClaimableDepositPlan.cjs +1 -0
- package/functions/utils/buildClaimableDepositPlan.d.ts +15 -0
- package/functions/utils/buildClaimableDepositPlan.mjs +40 -0
- package/functions/utils/cacheDevice.utils.cjs +1 -1
- package/functions/utils/cacheDevice.utils.mjs +8 -6
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.mjs +2 -2
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +1 -1
- package/functions/utils/create-provider.mjs +11 -7
- package/functions/utils/enclave-signature-storage.cjs +1 -0
- package/functions/utils/enclave-signature-storage.d.ts +2 -0
- package/functions/utils/enclave-signature-storage.mjs +13 -0
- package/functions/utils/enclave-utxo-storage.cjs +1 -0
- package/functions/utils/enclave-utxo-storage.d.ts +6 -0
- package/functions/utils/enclave-utxo-storage.mjs +34 -0
- package/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +21 -21
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.mjs +35 -35
- package/functions/utils/evmNetworkFunctions.cjs +1 -1
- package/functions/utils/evmNetworkFunctions.mjs +5 -3
- package/functions/utils/fees.utils.cjs +1 -1
- package/functions/utils/fees.utils.mjs +31 -29
- package/functions/utils/getBlockExplorerUrl.cjs +1 -1
- package/functions/utils/getBlockExplorerUrl.mjs +3 -3
- package/functions/utils/getDataFromTransaction.d.ts +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +2 -1
- package/functions/utils/getUtxosFromReceipt.utils.mjs +44 -15
- package/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
- package/functions/utils/getUtxosFromReceiptSolana.d.ts +2 -1
- package/functions/utils/getUtxosFromReceiptSolana.mjs +27 -16
- package/functions/utils/index.d.ts +12 -2
- 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/networks.utils.cjs +1 -1
- package/functions/utils/networks.utils.mjs +4 -2
- package/functions/utils/nftTokenFunctions.cjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +9 -23
- package/functions/utils/prepareHinkal.cjs +1 -1
- package/functions/utils/prepareHinkal.d.ts +6 -13
- package/functions/utils/prepareHinkal.mjs +44 -71
- package/functions/utils/process.utils.cjs +1 -1
- package/functions/utils/process.utils.d.ts +6 -0
- package/functions/utils/process.utils.mjs +22 -10
- package/functions/utils/proxyAvatar.utils.cjs +1 -0
- package/functions/utils/proxyAvatar.utils.d.ts +2 -0
- package/functions/utils/proxyAvatar.utils.mjs +5 -0
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.d.ts +1 -1
- package/functions/utils/publicBalance.utils.mjs +55 -53
- package/functions/utils/serialize-utxos.utils.cjs +1 -0
- package/functions/utils/serialize-utxos.utils.d.ts +3 -0
- package/functions/utils/serialize-utxos.utils.mjs +13 -0
- package/functions/utils/string.utils.cjs +1 -1
- package/functions/utils/string.utils.d.ts +2 -0
- package/functions/utils/string.utils.mjs +35 -27
- package/functions/utils/time.utils.cjs +1 -1
- package/functions/utils/time.utils.mjs +1 -1
- 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/tron.utils.cjs +1 -0
- package/functions/utils/tron.utils.d.ts +25 -0
- package/functions/utils/tron.utils.mjs +128 -0
- package/functions/utils/tronSimulation.utils.cjs +1 -0
- package/functions/utils/tronSimulation.utils.d.ts +1 -0
- package/functions/utils/tronSimulation.utils.mjs +30 -0
- package/functions/utils/tx-confirmation.utils.cjs +1 -0
- package/functions/utils/tx-confirmation.utils.d.ts +10 -0
- package/functions/utils/tx-confirmation.utils.mjs +50 -0
- 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/userAgent.cjs +1 -1
- package/functions/utils/userAgent.d.ts +0 -2
- package/functions/utils/userAgent.mjs +4 -23
- package/functions/utils/validateUsername.cjs +1 -0
- package/functions/utils/validateUsername.d.ts +5 -0
- package/functions/utils/validateUsername.mjs +16 -0
- package/functions/utils/walletBalances.utils.cjs +1 -1
- package/functions/utils/walletBalances.utils.d.ts +2 -17
- package/functions/utils/walletBalances.utils.mjs +5 -36
- package/functions/web3/connectors.utils.cjs +1 -1
- package/functions/web3/connectors.utils.d.ts +1 -0
- package/functions/web3/connectors.utils.mjs +14 -12
- package/functions/web3/crypto.cjs +1 -0
- package/functions/web3/crypto.d.ts +1 -0
- package/functions/web3/crypto.mjs +7 -0
- package/functions/web3/etherFunctions.cjs +1 -1
- package/functions/web3/etherFunctions.d.ts +1 -1
- package/functions/web3/etherFunctions.mjs +12 -15
- 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 +127 -132
- package/functions/web3/events/getShieldedBalance.cjs +1 -2
- package/functions/web3/events/getShieldedBalance.d.ts +1 -1
- package/functions/web3/events/getShieldedBalance.mjs +72 -69
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.mjs +40 -36
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +17 -10
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +1 -6
- package/functions/web3/functionCalls/accessTokenCalls.mjs +19 -25
- package/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/functions/web3/functionCalls/approveToken.d.ts +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +68 -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/constructBatchCall.cjs +1 -1
- package/functions/web3/functionCalls/constructBatchCall.d.ts +3 -2
- package/functions/web3/functionCalls/constructBatchCall.mjs +53 -16
- package/functions/web3/functionCalls/estimateGasRelayer.d.ts +2 -3
- package/functions/web3/functionCalls/recoverTransactionFromError.cjs +1 -1
- package/functions/web3/functionCalls/recoverTransactionFromError.mjs +8 -7
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.d.ts +2 -2
- package/functions/web3/functionCalls/transactCallDirect.mjs +58 -48
- package/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -0
- package/functions/web3/functionCalls/transactCallDirectTron.d.ts +6 -0
- package/functions/web3/functionCalls/transactCallDirectTron.mjs +63 -0
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +15 -6
- package/functions/web3/functionCalls/transactCallRelayer.mjs +72 -67
- package/functions/web3/functionCalls/waitForErc20Approvals.cjs +1 -0
- package/functions/web3/functionCalls/waitForErc20Approvals.d.ts +9 -0
- package/functions/web3/functionCalls/waitForErc20Approvals.mjs +54 -0
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +14 -18
- package/functions/web3/getPublicAddressBalance.cjs +1 -1
- package/functions/web3/getPublicAddressBalance.d.ts +1 -1
- package/functions/web3/getPublicAddressBalance.mjs +7 -7
- package/functions/web3/getSolanaPriorityFee.cjs +1 -0
- package/functions/web3/getSolanaPriorityFee.d.ts +3 -0
- package/functions/web3/getSolanaPriorityFee.mjs +32 -0
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +35 -31
- package/functions/web3/index.d.ts +3 -0
- package/functions/web3/lifiAPI.cjs +1 -1
- package/functions/web3/lifiAPI.d.ts +1 -1
- package/functions/web3/lifiAPI.mjs +12 -12
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.mjs +4 -15
- package/functions/web3/okxAPI.cjs +1 -1
- package/functions/web3/okxAPI.mjs +13 -13
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +9 -20
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +38 -50
- package/functions/web3/tron-wagmi-adapter.cjs +1 -0
- package/functions/web3/tron-wagmi-adapter.d.ts +8 -0
- package/functions/web3/tron-wagmi-adapter.mjs +31 -0
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +24 -34
- package/index.cjs +1 -1
- package/index.mjs +1079 -958
- package/package.json +4 -2
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +11 -17
- package/providers/EthersProviderAdapter.mjs +53 -82
- package/providers/SolanaProviderAdapter.cjs +1 -1
- package/providers/SolanaProviderAdapter.d.ts +8 -11
- package/providers/SolanaProviderAdapter.mjs +20 -32
- package/providers/TronProviderAdapter.cjs +1 -0
- package/providers/TronProviderAdapter.d.ts +37 -0
- package/providers/TronProviderAdapter.mjs +145 -0
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +14 -19
- package/providers/WagmiProviderAdapter.mjs +104 -130
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.d.ts +2 -2
- package/providers/prepareEthersHinkal.mjs +17 -10
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +21 -13
- package/types/TransactionSimulator.types.d.ts +2 -9
- package/types/activities.types.cjs +1 -1
- package/types/activities.types.d.ts +13 -7
- package/types/activities.types.mjs +18 -18
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +11 -8
- package/types/admin.types.mjs +2 -2
- package/types/balances.types.d.ts +1 -1
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +12 -4
- package/types/cache.types.mjs +2 -2
- package/types/circom-data.types.d.ts +6 -14
- package/types/coingecko.types.d.ts +5 -0
- package/types/commitments.types.d.ts +4 -0
- package/types/connector.types.d.ts +1 -0
- package/types/ethereum-network.types.d.ts +1 -1
- package/types/events.types.cjs +1 -0
- package/types/events.types.d.ts +6 -0
- package/types/events.types.mjs +4 -0
- package/types/fee.types.cjs +1 -0
- package/types/fee.types.d.ts +4 -0
- package/types/fee.types.mjs +4 -0
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +5 -1
- package/types/hinkal.types.mjs +14 -13
- package/types/index.d.ts +5 -4
- package/types/onramp.types.cjs +1 -0
- package/types/onramp.types.d.ts +58 -0
- package/types/onramp.types.mjs +4 -0
- package/types/pay-activities.types.cjs +1 -0
- package/types/pay-activities.types.d.ts +29 -0
- package/types/pay-activities.types.mjs +6 -0
- package/types/proxy.types.d.ts +7 -3
- package/types/rewards.types.d.ts +1 -1
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +12 -72
- package/types/sandbox.types.mjs +2 -2
- package/types/schedule.types.cjs +1 -0
- package/types/schedule.types.d.ts +7 -0
- package/types/schedule.types.mjs +4 -0
- package/types/scheduled-transactions.types.d.ts +14 -0
- package/types/session.types.d.ts +2 -0
- package/types/solana.types.d.ts +10 -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.d.ts +2 -2
- package/types/tron.types.d.ts +10 -0
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +31 -27
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.mjs +1 -1
- package/webworker/viteWorkerURL.constant.cjs +3 -3
- package/webworker/viteWorkerURL.constant.mjs +3 -3
- package/webworker/zkProofWorker/zkProofWorker.types.d.ts +1 -2
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.mjs +27 -28
- 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/enclaveCalls.cjs +0 -1
- package/API/enclaveCalls.d.ts +0 -9
- package/API/enclaveCalls.mjs +0 -11
- 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/is-tx-stateless.cjs +0 -1
- package/API/is-tx-stateless.mjs +0 -20
- 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/constants/token-data/popularTokens.constants.cjs +0 -1
- package/constants/token-data/popularTokens.constants.d.ts +0 -3
- package/constants/token-data/popularTokens.constants.mjs +0 -13
- package/constants/token-data/tokenPricing.consts.d.ts +0 -2
- 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/hinkalApprove.cjs +0 -1
- package/data-structures/Hinkal/hinkalApprove.d.ts +0 -3
- package/data-structures/Hinkal/hinkalApprove.mjs +0 -114
- package/data-structures/Hinkal/hinkalDepostAndBridge.cjs +0 -1
- package/data-structures/Hinkal/hinkalDepostAndBridge.mjs +0 -230
- package/data-structures/Hinkal/hinkalInsideTransact.cjs +0 -1
- package/data-structures/Hinkal/hinkalInsideTransact.d.ts +0 -4
- package/data-structures/Hinkal/hinkalInsideTransact.mjs +0 -120
- package/error-handling/handleErrorRestore.cjs +0 -1
- package/error-handling/handleErrorRestore.d.ts +0 -2
- package/error-handling/handleErrorRestore.mjs +0 -11
- package/functions/kyc/authentoHelper.cjs +0 -1
- package/functions/kyc/authentoHelper.d.ts +0 -12
- package/functions/kyc/authentoHelper.mjs +0 -30
- package/functions/utils/ethers-formatter.utils.cjs +0 -1
- package/functions/utils/ethers-formatter.utils.d.ts +0 -5
- package/functions/utils/ethers-formatter.utils.mjs +0 -59
- package/functions/utils/get-hinkal-approvals.cjs +0 -1
- package/functions/utils/get-hinkal-approvals.d.ts +0 -3
- package/functions/utils/get-hinkal-approvals.mjs +0 -38
- package/functions/utils/replaceAddressInCalldata.cjs +0 -1
- package/functions/utils/replaceAddressInCalldata.d.ts +0 -1
- package/functions/utils/replaceAddressInCalldata.mjs +0 -7
- package/functions/web3/functionCalls/estimateGasRelayer.cjs +0 -1
- package/functions/web3/functionCalls/estimateGasRelayer.mjs +0 -22
- package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +0 -1
- package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +0 -5
- package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +0 -29
- package/types/bridging.types.d.ts +0 -29
- package/types/duneAPI.types.d.ts +0 -9
- package/types/relayer.types.d.ts +0 -25
- package/types/routing.types.cjs +0 -1
- package/types/routing.types.d.ts +0 -7
- package/types/routing.types.mjs +0 -4
|
@@ -1,54 +1,49 @@
|
|
|
1
|
-
import { caseInsensitiveEqual as
|
|
1
|
+
import { caseInsensitiveEqual as f } from "../../utils/caseInsensitive.utils.mjs";
|
|
2
2
|
import { resetInHinkalAddressesCache as g, getInHinkalAddressesCache as v, setInHinkalAddressesCache as k } from "../../utils/cacheFunctions.mjs";
|
|
3
|
-
import { Mutex as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
(m) => ({ ...m, interactionAddress: p })
|
|
3
|
+
import { Mutex as y } from "async-mutex";
|
|
4
|
+
import { getErc20TokensForChain as x } from "../../utils/erc20tokenFunctions.mjs";
|
|
5
|
+
import { privateTokensDB as m } from "../../../data-structures/TokenDBs/PrivateTokensDB.mjs";
|
|
6
|
+
import { isExtension as u } from "../../../constants/vite.constants.mjs";
|
|
7
|
+
const C = new y(), E = (t, e, a) => (t.forEach((s) => {
|
|
8
|
+
s.inHinkalAddress === a && e.push(s);
|
|
9
|
+
}), e), A = (t, e, a = !1) => {
|
|
10
|
+
const { userKeys: s } = t;
|
|
11
|
+
a && g(t, e, s.getShieldedPublicKey());
|
|
12
|
+
const { approvalsByChain: i } = t, r = v(t, e, s.getShieldedPublicKey());
|
|
13
|
+
let n = [];
|
|
14
|
+
return i[e].forEach((l, d) => {
|
|
15
|
+
const o = r[d];
|
|
16
|
+
let p;
|
|
17
|
+
o ? p = BigInt(o) : (p = s.getInHinkalAddress(d), r[d] = p.toString()), n = E(
|
|
18
|
+
l.map(
|
|
19
|
+
(c) => ({ ...c, interactionAddress: d, chainId: e })
|
|
21
20
|
),
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
n,
|
|
22
|
+
p
|
|
24
23
|
);
|
|
25
|
-
}), k(
|
|
26
|
-
},
|
|
27
|
-
const
|
|
28
|
-
let
|
|
29
|
-
const
|
|
24
|
+
}), k(r, t, e, s.getShieldedPublicKey()), n;
|
|
25
|
+
}, K = (t, e, a, s) => A(t, a, s).filter((r) => f(r.tokenAddress, e)).sort((r, n) => r.amount === n.amount ? 0 : r.amount > n.amount ? -1 : 1), M = async (t, e, a, s) => {
|
|
26
|
+
const i = await t.getEthereumAddressByChain(e);
|
|
27
|
+
let r = [];
|
|
28
|
+
const n = /* @__PURE__ */ new Map();
|
|
30
29
|
return await C.runExclusive(async () => {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
),
|
|
37
|
-
token:
|
|
38
|
-
balance:
|
|
30
|
+
const l = A(t, e, a);
|
|
31
|
+
s && u && await m.fetchAndUpdatePrivateTokens(
|
|
32
|
+
l.map((o) => o.tokenAddress),
|
|
33
|
+
e,
|
|
34
|
+
i
|
|
35
|
+
), r = (u ? await m.getPrivateTokens(e, i) : x(e)).map((o) => ({
|
|
36
|
+
token: o,
|
|
37
|
+
balance: l.reduce((p, c) => f(o.erc20TokenAddress, c.tokenAddress) ? p + c.amount : p, 0n),
|
|
39
38
|
timestamp: "0",
|
|
40
39
|
nfts: []
|
|
41
|
-
})),
|
|
42
|
-
|
|
40
|
+
})), r.forEach((o) => {
|
|
41
|
+
n.set(o.token.erc20TokenAddress.toLowerCase(), o);
|
|
43
42
|
});
|
|
44
|
-
}),
|
|
45
|
-
}, U = (e, d, r) => {
|
|
46
|
-
const { userKeys: t, approvals: o } = e, n = y.getAddress(d), i = o.get(n) ?? [], c = t.getInHinkalAddress(n);
|
|
47
|
-
return i.reduce((s, a) => u(a.tokenAddress, r) && a.inHinkalAddress === c ? s + a.amount : s, 0n);
|
|
43
|
+
}), n;
|
|
48
44
|
};
|
|
49
45
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
U as getMyApprovalAmountForInteraction
|
|
46
|
+
M as getApprovedBalance,
|
|
47
|
+
A as getApprovedUtxos,
|
|
48
|
+
K as getApprovedUtxosForToken
|
|
54
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("../../../data-structures/utxo/Utxo.cjs"),E=require("../../utils/upToDateState.cjs"),k=require("../../utils/cacheFunctions.cjs"),I=require("../../utils/caseInsensitive.utils.cjs"),h=require("../../utils/encodeTokenWithId.cjs"),M=require("./getInputUtxosEnclave.cjs"),H=require("../../utils/solanaMint.utils.cjs"),S=require("../../../constants/chains.constants.cjs"),R=require("../../utils/addresses.cjs"),K=require("../../../API/scheduled-transactions-calls.cjs"),_=require("async-mutex"),G=require("../../utils/tron.utils.cjs"),j=new _.Mutex,b=async(t,e,s,c,o,n,u,a,r)=>j.runExclusive(async()=>{r+=1;const p=n.slice(r),{lastOutput:g,additionalEncryptedOutputs:A}=await t.utxoUtils.batchProcess(p,a,e,s),y=[...u,...A];return await E.checkAddressNotUpdated(t,c),k.setHinkalCache({lastOutput:g,encryptedOutputs:y},t,s,o),await t.utxoUtils.buildBatchProcess(y,e,s)}),P=async(t,e,s,c)=>{const{utxos:o,encryptedOutputs:n,lastOutput:u}=await M.getInputUtxosEnclave(t,s,e);return k.setHinkalCache({encryptedOutputs:n,lastOutput:u},t,s,c),o},C=async(t,e,s,c,o,n,u,a,r)=>{try{return await P(t,e,s,o)}catch{return b(t,e,s,c,o,n,u,a,r)}},D=t=>{if(Array.isArray(t))return t;if(t!==void 0)return[t]},W=async(t,e,s)=>await t.utxoUtils.batchFilterUtxosWithNullifier(e,s),z=(t,e,s,c,o,n,u)=>{for(t.sort((a,r)=>a.amount<=r.amount?1:-1);t.length<e||t.length>e&&t.length<6;)if(t.push(new F.Utxo({amount:0n,erc20TokenAddress:o,mintAddress:u,shieldedPrivateKey:c,tokenId:n})),s)for(;t.length>6;)t.splice(t.length-1)},q=async({hinkal:t,chainId:e,passedShieldedPublicKey:s=void 0,ethAddress:c=void 0,resetCacheBefore:o=!1,allowRemoteDecryption:n=!1,useBlockedUtxos:u=!1})=>{const a=c??await t.getEthereumAddress(),r=s??t.userKeys.getShieldedPublicKey(),{userKeys:p}=t,g=t.encryptedOutputsByChain[e],A=t.nullifiersByChain[e],y=Array.from(g);o&&k.resetCache(t,e,r);let{encryptedOutputs:d,lastOutput:x}=k.getHinkalCache(t,e,r);await E.checkAddressNotUpdated(t,a);const i=x!=="",l=y.findIndex(m=>m.value===x),f=l>-1,w=!i&&l===-1,U=t.areMerkleTreeUpdatesDisabled(),v=!U&&(f||!n&&w),O=!U&&n&&w,L=!v&&!O;let T=[];v?T=await b(t,p,e,a,r,y,d,x,l):O?T=await C(t,p,e,a,r,y,d,x,l):L&&(T=await t.utxoUtils.buildBatchProcess(d,p,e)),await E.checkAddressNotUpdated(t,a);const B=await W(t,T,A);return{inputUtxos:u?B.filter(m=>m.isBlocked):B.filter(m=>!m.isBlocked)}},N=async({hinkal:t,chainId:e,passedShieldedPublicKey:s=void 0,ethAddress:c=void 0,resetCacheBefore:o=!1,allowRemoteDecryption:n=!1})=>{const u=c??await t.getEthereumAddressByChain(e),a=S.isTronLike(e)?G.addressToHexFormat(u):u,r=R.hashEthereumAddress(a),{inputUtxos:p}=await q({hinkal:t,chainId:e,passedShieldedPublicKey:s,ethAddress:u,resetCacheBefore:o,allowRemoteDecryption:n,useBlockedUtxos:!0});if(!p.length)return{inputUtxos:[]};const g=p.map(d=>d.getNullifier()),{indexes:A}=await K.getScheduledTransactionsNullifierIndexes({hashedEthereumAddress:r,nullifiers:g});return{inputUtxos:A.map(d=>p[d]).filter(d=>!!d)}},J=async({hinkal:t,tokenWithId:e,minInput:s=2,sliceIfMore6:c=!0,chainId:o,passedShieldedPrivateKey:n=void 0,passedShieldedPublicKey:u=void 0,ethAddress:a=void 0,resetCacheBefore:r=!1,ensuredTokensWithId:p,useBlockedUtxos:g=!1})=>{const A=n??t.userKeys.getShieldedPrivateKey(),{inputUtxos:y}=g?await N({hinkal:t,chainId:o,ethAddress:a,passedShieldedPrivateKey:n,resetCacheBefore:r}):await q({hinkal:t,tokenWithId:e,minInput:s,sliceIfMore6:c,chainId:o,passedShieldedPrivateKey:n,passedShieldedPublicKey:u,ethAddress:a,resetCacheBefore:r}),d=D(e),x=new Map;y.forEach(i=>{const l=i.getTokenAddress(o);if(d&&!d.some(U=>I.caseInsensitiveEqual(U.erc20TokenAddress,l)&&U.tokenId===i.tokenId))return;const f=h.encodeTokenWithId(o,{erc20TokenAddress:l,tokenId:i.tokenId}),w=x.get(f)??[];x.set(f,[...w,i])}),p?.forEach(i=>{const l=h.encodeTokenWithId(o,{erc20TokenAddress:i.erc20TokenAddress,tokenId:i.tokenId});x.set(l,x.get(l)??[])});for(const[i,l]of x){const f=i.split("-")[0],w=Number(i.split("-")[1]),U=S.isSolanaLike(o),v=U?f:void 0,O=U?H.formatMintAddress(f).compressedAddress.toLowerCase():f.toLowerCase();z(l,s,c,A,O,w,v)}return x};exports.attemptGetInputUtxosRemotely=C;exports.getInputUtxoAndBalance=q;exports.getInputUtxoAndBalanceOfStuckUtxos=N;exports.getInputUtxoAndBalancePerToken=J;exports.getInputUtxosRemotely=P;
|
|
@@ -5,11 +5,11 @@ import { EncryptedOutputWithSign } from '../../../types/commitments.types';
|
|
|
5
5
|
import { type TokenWithId } from '../../../types/token-with-id.types';
|
|
6
6
|
interface IGetInputUtxos {
|
|
7
7
|
hinkal: IHinkal;
|
|
8
|
+
chainId: number;
|
|
8
9
|
tokenWithId?: TokenWithId | TokenWithId[];
|
|
9
10
|
minInput?: number;
|
|
10
11
|
sliceIfMore6?: boolean;
|
|
11
12
|
tokenId?: number;
|
|
12
|
-
chainId?: number;
|
|
13
13
|
passedShieldedPrivateKey?: string;
|
|
14
14
|
passedShieldedPublicKey?: string;
|
|
15
15
|
ethAddress?: string;
|
|
@@ -1,195 +1,190 @@
|
|
|
1
|
-
import { Utxo as
|
|
2
|
-
import {
|
|
3
|
-
import { setHinkalCache as b, resetCache as
|
|
4
|
-
import { caseInsensitiveEqual as
|
|
5
|
-
import { encodeTokenWithId as
|
|
6
|
-
import { getInputUtxosEnclave as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { isSolanaLike as M } from "../../../constants/chains.constants.mjs";
|
|
1
|
+
import { Utxo as N } from "../../../data-structures/utxo/Utxo.mjs";
|
|
2
|
+
import { checkAddressNotUpdated as T } from "../../utils/upToDateState.mjs";
|
|
3
|
+
import { setHinkalCache as b, resetCache as S, getHinkalCache as F } from "../../utils/cacheFunctions.mjs";
|
|
4
|
+
import { caseInsensitiveEqual as H } from "../../utils/caseInsensitive.utils.mjs";
|
|
5
|
+
import { encodeTokenWithId as k } from "../../utils/encodeTokenWithId.mjs";
|
|
6
|
+
import { getInputUtxosEnclave as K } from "./getInputUtxosEnclave.mjs";
|
|
7
|
+
import { formatMintAddress as M } from "../../utils/solanaMint.utils.mjs";
|
|
8
|
+
import { isTronLike as R, isSolanaLike as h } from "../../../constants/chains.constants.mjs";
|
|
10
9
|
import { hashEthereumAddress as q } from "../../utils/addresses.mjs";
|
|
11
10
|
import { getScheduledTransactionsNullifierIndexes as G } from "../../../API/scheduled-transactions-calls.mjs";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
import { Mutex as j } from "async-mutex";
|
|
12
|
+
import { addressToHexFormat as z } from "../../utils/tron.utils.mjs";
|
|
13
|
+
const D = new j(), L = async (t, e, s, c, o, r, u, a, n) => D.runExclusive(async () => {
|
|
14
|
+
n += 1;
|
|
15
|
+
const p = r.slice(n), { lastOutput: U, additionalEncryptedOutputs: w } = await t.utxoUtils.batchProcess(
|
|
16
|
+
p,
|
|
15
17
|
a,
|
|
16
|
-
|
|
17
|
-
s
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return await T(t, e, d), b(
|
|
18
|
+
e,
|
|
19
|
+
s
|
|
20
|
+
), m = [...u, ...w];
|
|
21
|
+
return await T(t, c), b(
|
|
21
22
|
{
|
|
22
23
|
lastOutput: U,
|
|
23
|
-
encryptedOutputs:
|
|
24
|
+
encryptedOutputs: m
|
|
24
25
|
},
|
|
25
26
|
t,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
), await t.utxoUtils.buildBatchProcess(
|
|
29
|
-
},
|
|
27
|
+
s,
|
|
28
|
+
o
|
|
29
|
+
), await t.utxoUtils.buildBatchProcess(m, e, s);
|
|
30
|
+
}), J = async (t, e, s, c) => {
|
|
30
31
|
const {
|
|
31
|
-
utxos:
|
|
32
|
-
encryptedOutputs:
|
|
32
|
+
utxos: o,
|
|
33
|
+
encryptedOutputs: r,
|
|
33
34
|
lastOutput: u
|
|
34
|
-
} = await
|
|
35
|
+
} = await K(t, s, e);
|
|
35
36
|
return b(
|
|
36
37
|
{
|
|
37
|
-
encryptedOutputs:
|
|
38
|
+
encryptedOutputs: r,
|
|
38
39
|
lastOutput: u
|
|
39
40
|
},
|
|
40
41
|
t,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
),
|
|
44
|
-
},
|
|
42
|
+
s,
|
|
43
|
+
c
|
|
44
|
+
), o;
|
|
45
|
+
}, Q = async (t, e, s, c, o, r, u, a, n) => {
|
|
45
46
|
try {
|
|
46
|
-
return await
|
|
47
|
+
return await J(t, e, s, o);
|
|
47
48
|
} catch {
|
|
48
|
-
return
|
|
49
|
+
return L(
|
|
49
50
|
t,
|
|
50
|
-
s,
|
|
51
51
|
e,
|
|
52
|
-
|
|
52
|
+
s,
|
|
53
|
+
c,
|
|
54
|
+
o,
|
|
53
55
|
r,
|
|
54
|
-
n,
|
|
55
56
|
u,
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
a,
|
|
58
|
+
n
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
|
-
},
|
|
61
|
+
}, V = (t) => {
|
|
61
62
|
if (Array.isArray(t))
|
|
62
63
|
return t;
|
|
63
64
|
if (t !== void 0)
|
|
64
65
|
return [t];
|
|
65
|
-
},
|
|
66
|
-
for (t.sort((
|
|
67
|
-
if (t.push(new
|
|
66
|
+
}, X = async (t, e, s) => await t.utxoUtils.batchFilterUtxosWithNullifier(e, s), Y = (t, e, s, c, o, r, u) => {
|
|
67
|
+
for (t.sort((a, n) => a.amount <= n.amount ? 1 : -1); t.length < e || t.length > e && t.length < 6; )
|
|
68
|
+
if (t.push(new N({ amount: 0n, erc20TokenAddress: o, mintAddress: u, shieldedPrivateKey: c, tokenId: r })), s)
|
|
68
69
|
for (; t.length > 6; )
|
|
69
70
|
t.splice(t.length - 1);
|
|
70
71
|
}, P = async ({
|
|
71
72
|
hinkal: t,
|
|
72
|
-
chainId:
|
|
73
|
-
passedShieldedPublicKey:
|
|
74
|
-
ethAddress:
|
|
75
|
-
resetCacheBefore:
|
|
76
|
-
allowRemoteDecryption:
|
|
73
|
+
chainId: e,
|
|
74
|
+
passedShieldedPublicKey: s = void 0,
|
|
75
|
+
ethAddress: c = void 0,
|
|
76
|
+
resetCacheBefore: o = !1,
|
|
77
|
+
allowRemoteDecryption: r = !1,
|
|
77
78
|
useBlockedUtxos: u = !1
|
|
78
79
|
}) => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
a
|
|
87
|
-
);
|
|
88
|
-
await T(t, o, c);
|
|
89
|
-
const p = m !== "", f = l.findIndex((E) => E.value === m), x = f > -1, A = !p && f === -1, y = t.areMerkleTreeUpdatesDisabled(), v = !y && (x || !n && A), O = !y && n && A, S = !v && !O;
|
|
90
|
-
let I = [];
|
|
91
|
-
v ? I = await N(
|
|
80
|
+
const a = c ?? await t.getEthereumAddress(), n = s ?? t.userKeys.getShieldedPublicKey(), { userKeys: p } = t, U = t.encryptedOutputsByChain[e], w = t.nullifiersByChain[e], m = Array.from(U);
|
|
81
|
+
o && S(t, e, n);
|
|
82
|
+
let { encryptedOutputs: d, lastOutput: f } = F(t, e, n);
|
|
83
|
+
await T(t, a);
|
|
84
|
+
const i = f !== "", l = m.findIndex((g) => g.value === f), x = l > -1, A = !i && l === -1, y = t.areMerkleTreeUpdatesDisabled(), v = !y && (x || !r && A), O = !y && r && A, C = !v && !O;
|
|
85
|
+
let E = [];
|
|
86
|
+
v ? E = await L(
|
|
92
87
|
t,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
c,
|
|
88
|
+
p,
|
|
89
|
+
e,
|
|
96
90
|
a,
|
|
97
|
-
|
|
98
|
-
w,
|
|
91
|
+
n,
|
|
99
92
|
m,
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
d,
|
|
94
|
+
f,
|
|
95
|
+
l
|
|
96
|
+
) : O ? E = await Q(
|
|
102
97
|
t,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
c,
|
|
98
|
+
p,
|
|
99
|
+
e,
|
|
106
100
|
a,
|
|
107
|
-
|
|
108
|
-
w,
|
|
101
|
+
n,
|
|
109
102
|
m,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
103
|
+
d,
|
|
104
|
+
f,
|
|
105
|
+
l
|
|
106
|
+
) : C && (E = await t.utxoUtils.buildBatchProcess(d, p, e)), await T(t, a);
|
|
107
|
+
const B = await X(t, E, w);
|
|
108
|
+
return { inputUtxos: u ? B.filter((g) => g.isBlocked) : B.filter((g) => !g.isBlocked) };
|
|
109
|
+
}, Z = async ({
|
|
115
110
|
hinkal: t,
|
|
116
|
-
chainId:
|
|
117
|
-
passedShieldedPublicKey:
|
|
118
|
-
ethAddress:
|
|
119
|
-
resetCacheBefore:
|
|
120
|
-
allowRemoteDecryption:
|
|
111
|
+
chainId: e,
|
|
112
|
+
passedShieldedPublicKey: s = void 0,
|
|
113
|
+
ethAddress: c = void 0,
|
|
114
|
+
resetCacheBefore: o = !1,
|
|
115
|
+
allowRemoteDecryption: r = !1
|
|
121
116
|
}) => {
|
|
122
|
-
const u =
|
|
117
|
+
const u = c ?? await t.getEthereumAddressByChain(e), a = R(e) ? z(u) : u, n = q(a), { inputUtxos: p } = await P({
|
|
123
118
|
hinkal: t,
|
|
124
|
-
chainId:
|
|
125
|
-
passedShieldedPublicKey:
|
|
126
|
-
ethAddress:
|
|
127
|
-
resetCacheBefore:
|
|
128
|
-
allowRemoteDecryption:
|
|
119
|
+
chainId: e,
|
|
120
|
+
passedShieldedPublicKey: s,
|
|
121
|
+
ethAddress: u,
|
|
122
|
+
resetCacheBefore: o,
|
|
123
|
+
allowRemoteDecryption: r,
|
|
129
124
|
useBlockedUtxos: !0
|
|
130
125
|
});
|
|
131
|
-
if (!
|
|
126
|
+
if (!p.length)
|
|
132
127
|
return { inputUtxos: [] };
|
|
133
|
-
const U =
|
|
134
|
-
hashedEthereumAddress:
|
|
128
|
+
const U = p.map((d) => d.getNullifier()), { indexes: w } = await G({
|
|
129
|
+
hashedEthereumAddress: n,
|
|
135
130
|
nullifiers: U
|
|
136
131
|
});
|
|
137
|
-
return { inputUtxos:
|
|
138
|
-
},
|
|
132
|
+
return { inputUtxos: w.map((d) => p[d]).filter((d) => !!d) };
|
|
133
|
+
}, dt = async ({
|
|
139
134
|
hinkal: t,
|
|
140
|
-
tokenWithId:
|
|
141
|
-
minInput:
|
|
142
|
-
sliceIfMore6:
|
|
143
|
-
chainId:
|
|
144
|
-
passedShieldedPrivateKey:
|
|
135
|
+
tokenWithId: e,
|
|
136
|
+
minInput: s = 2,
|
|
137
|
+
sliceIfMore6: c = !0,
|
|
138
|
+
chainId: o,
|
|
139
|
+
passedShieldedPrivateKey: r = void 0,
|
|
145
140
|
passedShieldedPublicKey: u = void 0,
|
|
146
|
-
ethAddress:
|
|
147
|
-
resetCacheBefore:
|
|
148
|
-
ensuredTokensWithId:
|
|
141
|
+
ethAddress: a = void 0,
|
|
142
|
+
resetCacheBefore: n = !1,
|
|
143
|
+
ensuredTokensWithId: p,
|
|
149
144
|
useBlockedUtxos: U = !1
|
|
150
145
|
}) => {
|
|
151
|
-
const
|
|
146
|
+
const w = r ?? t.userKeys.getShieldedPrivateKey(), { inputUtxos: m } = U ? await Z({
|
|
152
147
|
hinkal: t,
|
|
153
|
-
chainId:
|
|
154
|
-
ethAddress:
|
|
155
|
-
passedShieldedPrivateKey:
|
|
156
|
-
resetCacheBefore:
|
|
148
|
+
chainId: o,
|
|
149
|
+
ethAddress: a,
|
|
150
|
+
passedShieldedPrivateKey: r,
|
|
151
|
+
resetCacheBefore: n
|
|
157
152
|
}) : await P({
|
|
158
153
|
hinkal: t,
|
|
159
|
-
tokenWithId:
|
|
160
|
-
minInput:
|
|
161
|
-
sliceIfMore6:
|
|
162
|
-
chainId:
|
|
163
|
-
passedShieldedPrivateKey:
|
|
154
|
+
tokenWithId: e,
|
|
155
|
+
minInput: s,
|
|
156
|
+
sliceIfMore6: c,
|
|
157
|
+
chainId: o,
|
|
158
|
+
passedShieldedPrivateKey: r,
|
|
164
159
|
passedShieldedPublicKey: u,
|
|
165
|
-
ethAddress:
|
|
166
|
-
resetCacheBefore:
|
|
167
|
-
}),
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
171
|
-
(y) =>
|
|
160
|
+
ethAddress: a,
|
|
161
|
+
resetCacheBefore: n
|
|
162
|
+
}), d = V(e), f = /* @__PURE__ */ new Map();
|
|
163
|
+
m.forEach((i) => {
|
|
164
|
+
const l = i.getTokenAddress(o);
|
|
165
|
+
if (d && !d.some(
|
|
166
|
+
(y) => H(y.erc20TokenAddress, l) && y.tokenId === i.tokenId
|
|
172
167
|
))
|
|
173
168
|
return;
|
|
174
|
-
const x =
|
|
175
|
-
|
|
176
|
-
}),
|
|
177
|
-
const
|
|
178
|
-
erc20TokenAddress:
|
|
179
|
-
tokenId:
|
|
169
|
+
const x = k(o, { erc20TokenAddress: l, tokenId: i.tokenId }), A = f.get(x) ?? [];
|
|
170
|
+
f.set(x, [...A, i]);
|
|
171
|
+
}), p?.forEach((i) => {
|
|
172
|
+
const l = k(o, {
|
|
173
|
+
erc20TokenAddress: i.erc20TokenAddress,
|
|
174
|
+
tokenId: i.tokenId
|
|
180
175
|
});
|
|
181
|
-
|
|
176
|
+
f.set(l, f.get(l) ?? []);
|
|
182
177
|
});
|
|
183
|
-
for (const [
|
|
184
|
-
const x =
|
|
185
|
-
|
|
178
|
+
for (const [i, l] of f) {
|
|
179
|
+
const x = i.split("-")[0], A = Number(i.split("-")[1]), y = h(o), v = y ? x : void 0, O = y ? M(x).compressedAddress.toLowerCase() : x.toLowerCase();
|
|
180
|
+
Y(l, s, c, w, O, A, v);
|
|
186
181
|
}
|
|
187
|
-
return
|
|
182
|
+
return f;
|
|
188
183
|
};
|
|
189
184
|
export {
|
|
190
|
-
|
|
185
|
+
Q as attemptGetInputUtxosRemotely,
|
|
191
186
|
P as getInputUtxoAndBalance,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
187
|
+
Z as getInputUtxoAndBalanceOfStuckUtxos,
|
|
188
|
+
dt as getInputUtxoAndBalancePerToken,
|
|
189
|
+
J as getInputUtxosRemotely
|
|
195
190
|
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
Please try again with ${r.symbol}`;throw new E.ErrorWithAmount(u,p)}f.push(n)}else if(o.length<=d){const n=[...o];let c=d-o.length;for(;c>0;){c-=1;const r=M.isSolanaLike(i.getCurrentChainId()),u=r?t[e]:void 0,p=r?I.formatMintAddress(t[e]).compressedAddress:t[e];n.push(new v.Utxo({amount:0n,erc20TokenAddress:p,mintAddress:u,shieldedPrivateKey:T.getShieldedPrivateKey(),tokenId:a[e]}))}f.push(n)}}),f)};exports.addPaddingToUtxos=C;exports.getShieldedBalance=B;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("../../utils/erc20tokenFunctions.cjs"),E=require("../../utils/caseInsensitive.utils.cjs"),w=require("../../../data-structures/utxo/Utxo.cjs"),M=require("../etherFunctions.cjs"),P=require("../../../error-handling/customErrors/ErrorWithAmount.cjs"),y=require("../../../error-handling/error-codes.constants.cjs"),h=require("./getInputUtxoAndBalance.cjs"),S=require("../../../data-structures/TokenDBs/PrivateTokensDB.cjs"),q=require("../../../constants/vite.constants.cjs"),B=require("../../utils/encodeTokenWithId.cjs"),_=require("../../utils/mutexes.utils.cjs"),I=require("../../utils/solanaMint.utils.cjs"),O=require("../../../constants/chains.constants.cjs"),R=async(d,n,s,g,r,l=!1,k,p=!1,x=!1)=>_.getChainBalanceFetchingMutex(n).runExclusive(async()=>{const{inputUtxos:a}=x?await h.getInputUtxoAndBalanceOfStuckUtxos({hinkal:d,chainId:n,ethAddress:r,passedShieldedPrivateKey:s,resetCacheBefore:l,allowRemoteDecryption:k}):await h.getInputUtxoAndBalance({hinkal:d,sliceIfMore6:!1,chainId:n,passedShieldedPrivateKey:s,passedShieldedPublicKey:g,ethAddress:r,resetCacheBefore:l,allowRemoteDecryption:k});p&&q.isExtension&&await S.privateTokensDB.fetchAndUpdatePrivateTokens(a.map(e=>e.getTokenAddress(n)).filter(e=>e!==void 0),n,r);const f=(q.isExtension?await S.privateTokensDB.getPrivateTokens(n,r):U.getErc20TokensForChain(n)).map(e=>({token:e,balance:a.reduce((t,c)=>{const i=e.erc20TokenAddress,u=c.getTokenAddress(n);return E.caseInsensitiveEqual(i,u)?t+c.amount:t},0n),timestamp:a.filter(t=>E.caseInsensitiveEqual(t.getTokenAddress(n),e.erc20TokenAddress))[0]?.timeStamp,nfts:a.filter(t=>E.caseInsensitiveEqual(t.getTokenAddress(n),e.erc20TokenAddress)&&t.tokenId!==0).map(t=>({tokenId:t.tokenId,timestamp:t.timeStamp}))})),o=new Map;return f.forEach(e=>{o.set(e.token.erc20TokenAddress.toLowerCase(),e)}),o}),W=async(d,n,s,g,r=6,l=s.map(()=>0),k=!1,p=!1)=>{const{userKeys:x}=d,T=[],a=[];if(s.length===0)return[];const A=await h.getInputUtxoAndBalancePerToken({hinkal:d,sliceIfMore6:!1,ensuredTokensWithId:s.map((o,e)=>({erc20TokenAddress:s[e],tokenId:l[e]})),allowRemoteDecryption:!1,useBlockedUtxos:p,chainId:n});let f=0;for(let o=0;o<s.length;o+=1)if(k===!1){const e=A.get(B.encodeTokenWithId(n,{erc20TokenAddress:s[o],tokenId:l[o]}))??[];if(!e)throw new Error("Missing utxos for token");f=Math.max(e.length,f),a.push(e)}else a.push([]);return f===2?a:(a.forEach((o,e)=>{if(o.length>r){const t=o.slice(0,r),c=t.reduce((i,u)=>i+u.amount,0n);if(g[e]<0n&&c<-g[e]){const i=U.getERC20Token(s[e],n),u=i.decimals===18?6:2,m=Number(M.getAmountWithPrecision(c,i,u)),v=`${y.DIRECTLY_SHOW_MESSAGE_ERROR_CODES.UTXO_LIMITATIONS}. Please try again with ${m} ${i.symbol}, including gas fees.`;throw new P.ErrorWithAmount(m,v)}T.push(t)}else if(o.length<=r){const t=[...o];let c=r-o.length;for(;c>0;){c-=1;const i=O.isSolanaLike(n),u=i?s[e]:void 0,m=i?I.formatMintAddress(s[e]).compressedAddress:s[e];t.push(new w.Utxo({amount:0n,erc20TokenAddress:m,mintAddress:u,shieldedPrivateKey:x.getShieldedPrivateKey(),tokenId:l[e]}))}T.push(t)}}),T)};exports.addPaddingToUtxos=W;exports.getShieldedBalance=R;
|
|
@@ -15,4 +15,4 @@ export declare const getShieldedBalance: (hinkal: IHinkal, chainId: number, pass
|
|
|
15
15
|
* @param maxInput to pad until maxInput number
|
|
16
16
|
* @returns return padded UTXOs for every erc20 token
|
|
17
17
|
*/
|
|
18
|
-
export declare const addPaddingToUtxos: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[], maxInput?: number, tokenIds?: number[], forceEmptyUtxos?: boolean, useBlockedUtxos?: boolean) => Promise<Utxo[][]>;
|
|
18
|
+
export declare const addPaddingToUtxos: (hinkal: IHinkal, chainId: number, erc20Addresses: string[], amountChanges: bigint[], maxInput?: number, tokenIds?: number[], forceEmptyUtxos?: boolean, useBlockedUtxos?: boolean) => Promise<Utxo[][]>;
|