@hinkal/common 0.2.31 → 0.2.32
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 +26 -11
- package/API/API.mjs +103 -88
- package/API/callMonitor.cjs +1 -1
- package/API/callMonitor.d.ts +8 -0
- package/API/callMonitor.mjs +2 -2
- package/API/callRelayer.d.ts +4 -1
- package/API/dashboardAccountCalls.cjs +1 -0
- package/API/dashboardAccountCalls.d.ts +24 -0
- package/API/dashboardAccountCalls.mjs +10 -0
- package/API/dashboardAccountMemberCalls.cjs +1 -0
- package/API/dashboardAccountMemberCalls.d.ts +34 -0
- package/API/dashboardAccountMemberCalls.mjs +16 -0
- package/API/dashboardBalanceCalls.cjs +1 -0
- package/API/dashboardBalanceCalls.d.ts +12 -0
- package/API/dashboardBalanceCalls.mjs +13 -0
- package/API/dashboardContactCalls.cjs +1 -0
- package/API/dashboardContactCalls.d.ts +9 -0
- package/API/dashboardContactCalls.mjs +13 -0
- package/API/dashboardPayoutCalls.cjs +1 -0
- package/API/dashboardPayoutCalls.d.ts +14 -0
- package/API/dashboardPayoutCalls.mjs +13 -0
- package/API/dashboardTransactionCalls.cjs +1 -0
- package/API/dashboardTransactionCalls.d.ts +3 -0
- package/API/dashboardTransactionCalls.mjs +10 -0
- package/API/enclaveRecipientInfoCalls.cjs +1 -0
- package/API/enclaveRecipientInfoCalls.d.ts +14 -0
- package/API/enclaveRecipientInfoCalls.mjs +7 -0
- package/API/enclaveSignatureCalls.cjs +1 -1
- package/API/enclaveSignatureCalls.d.ts +3 -8
- package/API/enclaveSignatureCalls.mjs +6 -8
- package/API/enclaveUtxoCalls.cjs +1 -1
- package/API/enclaveUtxoCalls.d.ts +8 -2
- package/API/enclaveUtxoCalls.mjs +5 -3
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.d.ts +1 -19
- package/API/fetchCommitmentsCache.mjs +9 -22
- package/API/getAnyRecipientInfo.d.ts +1 -0
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.d.ts +3 -0
- package/API/getServerURL.mjs +15 -32
- package/API/getWebsiteURL.cjs +1 -1
- package/API/getWebsiteURL.d.ts +3 -2
- package/API/getWebsiteURL.mjs +12 -5
- package/API/index.cjs +1 -1
- package/API/index.d.ts +2 -0
- package/API/index.mjs +2 -0
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +0 -5
- package/API/kycCalls.mjs +3 -10
- package/API/privateSendRecipientInfoCalls.cjs +1 -1
- package/API/privateSendRecipientInfoCalls.d.ts +0 -10
- package/API/privateSendRecipientInfoCalls.mjs +2 -2
- package/API/scheduled-transactions-calls.cjs +1 -1
- package/API/scheduled-transactions-calls.d.ts +8 -2
- package/API/scheduled-transactions-calls.mjs +5 -4
- package/API/tenderly.api.cjs +1 -1
- package/API/tenderly.api.d.ts +1 -1
- package/API/tenderly.api.mjs +1 -1
- package/constants/addresses.constants.cjs +1 -1
- package/constants/addresses.constants.d.ts +10 -7
- package/constants/addresses.constants.mjs +11 -8
- package/constants/assets.constants.cjs +1 -1
- package/constants/assets.constants.mjs +1 -1
- package/constants/auth.constants.cjs +1 -0
- package/constants/auth.constants.d.ts +2 -0
- package/constants/auth.constants.mjs +4 -0
- package/constants/backend.constants.cjs +1 -1
- package/constants/backend.constants.d.ts +0 -1
- package/constants/backend.constants.mjs +0 -1
- package/constants/bridging.constants.cjs +1 -1
- package/constants/bridging.constants.d.ts +2 -0
- package/constants/bridging.constants.mjs +7 -3
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +25 -8
- package/constants/chains.constants.mjs +168 -127
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +5 -3
- package/constants/coingecko.constants.mjs +8 -5
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.mjs +0 -4
- package/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arbMainnet.json.mjs +125 -850
- package/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arcTestnet.json.mjs +97 -1013
- package/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-base.json.mjs +132 -869
- package/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-ethMainnet.json.mjs +132 -871
- package/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-localhost.json.mjs +6 -808
- package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-optimism.json.mjs +132 -869
- package/constants/deploy-data/deploy-data-optimismTest.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-optimismTest.json.mjs +3565 -0
- package/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-polygon.json.mjs +132 -869
- package/constants/deploy-data/deploy-data-sepoliaTestnet.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-sepoliaTestnet.json.mjs +3561 -0
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-solana.json.mjs +1 -1
- package/constants/deploy-data/deploy-data-tempo.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-tempo.json.mjs +3563 -0
- package/constants/deploy-data/deploy-data-tronMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-tronMainnet.json.mjs +133 -870
- package/constants/deploy-data/deploy-data-tronNile.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-tronNile.json.mjs +133 -870
- package/constants/deploy-data/index.d.ts +4 -1
- package/constants/events.constants.cjs +1 -1
- package/constants/events.constants.mjs +4 -1
- package/constants/fees.constants.cjs +1 -1
- package/constants/fees.constants.d.ts +5 -1
- package/constants/fees.constants.mjs +9 -5
- package/constants/index.cjs +1 -1
- package/constants/index.d.ts +2 -1
- package/constants/index.mjs +6 -2
- package/constants/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.d.ts +1 -1
- package/constants/kyc.constants.mjs +38 -37
- package/constants/lifi.constants.cjs +1 -1
- package/constants/lifi.constants.d.ts +2 -0
- package/constants/lifi.constants.mjs +7 -2
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +7 -1
- package/constants/mediaUrls.constants.mjs +9 -3
- package/constants/price-impact.constants.cjs +1 -0
- package/constants/price-impact.constants.d.ts +2 -0
- package/constants/price-impact.constants.mjs +4 -0
- package/constants/protocol.constants.cjs +1 -1
- package/constants/protocol.constants.d.ts +4 -1
- package/constants/protocol.constants.mjs +2 -2
- package/constants/reorg-depths.constants.cjs +1 -1
- package/constants/reorg-depths.constants.d.ts +3 -1
- package/constants/reorg-depths.constants.mjs +3 -1
- package/constants/save-depths.cjs +1 -1
- package/constants/save-depths.d.ts +3 -1
- package/constants/save-depths.mjs +3 -1
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +33 -8
- package/constants/server.constants.mjs +44 -24
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +20 -9
- package/constants/token-data/arbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistry.json.mjs +24 -24
- package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.mjs +24 -24
- package/constants/token-data/arcTestnetRegistry.json.cjs +1 -1
- package/constants/token-data/arcTestnetRegistry.json.mjs +3 -3
- package/constants/token-data/baseRegistry.json.cjs +1 -1
- package/constants/token-data/baseRegistry.json.mjs +20 -12
- package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
- package/constants/token-data/baseRegistryFixed.json.mjs +18 -10
- package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistry.json.mjs +38 -38
- package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.mjs +38 -38
- package/constants/token-data/localhostRegistry.json.cjs +1 -1
- package/constants/token-data/localhostRegistry.json.mjs +211 -211
- package/constants/token-data/optimismRegistry.json.cjs +1 -1
- package/constants/token-data/optimismRegistry.json.mjs +36 -28
- package/constants/token-data/optimismRegistryFixed.json.cjs +1 -1
- package/constants/token-data/optimismRegistryFixed.json.mjs +36 -28
- package/constants/token-data/polygonRegistry.json.cjs +1 -1
- package/constants/token-data/polygonRegistry.json.mjs +34 -26
- package/constants/token-data/polygonRegistryFixed.json.cjs +1 -1
- package/constants/token-data/polygonRegistryFixed.json.mjs +34 -26
- package/constants/token-data/sepoliaTestnetRegistry.json.cjs +1 -0
- package/constants/token-data/sepoliaTestnetRegistry.json.mjs +21 -0
- package/constants/token-data/solanaMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/solanaMainnetRegistry.json.mjs +1 -1
- package/constants/token-data/tempoRegistry.json.cjs +1 -0
- package/constants/token-data/tempoRegistry.json.mjs +37 -0
- package/constants/token-data/tronMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/tronMainnetRegistry.json.mjs +26 -15
- package/constants/token-data/tronNileRegistry.json.cjs +1 -1
- package/constants/token-data/tronNileRegistry.json.mjs +2 -2
- package/constants/tokens.constants.cjs +1 -1
- package/constants/tokens.constants.d.ts +1 -0
- package/constants/tokens.constants.mjs +10 -3
- package/constants/vite.constants.cjs +1 -1
- package/constants/vite.constants.mjs +23 -5
- package/constants/wallet.constants.cjs +1 -1
- package/constants/wallet.constants.d.ts +1 -1
- package/constants/wallet.constants.mjs +2 -18
- package/crypto/babyJub.d.ts +1 -1
- package/crypto/ecdh-dual-path.cjs +1 -0
- package/crypto/ecdh-dual-path.d.ts +13 -0
- package/crypto/ecdh-dual-path.mjs +39 -0
- package/crypto/ecdh-sealed-keys.cjs +1 -0
- package/crypto/ecdh-sealed-keys.d.ts +22 -0
- package/crypto/ecdh-sealed-keys.mjs +33 -0
- package/crypto/ecdh.cjs +1 -0
- package/crypto/ecdh.d.ts +2 -0
- package/crypto/ecdh.mjs +9 -0
- package/crypto/eddsa.cjs +1 -0
- package/crypto/eddsa.d.ts +8 -0
- package/crypto/eddsa.mjs +12 -0
- package/crypto/index.cjs +1 -1
- package/crypto/index.d.ts +4 -0
- package/crypto/index.mjs +4 -0
- package/crypto/preProcessing.cjs +1 -1
- package/crypto/preProcessing.d.ts +1 -1
- package/crypto/preProcessing.mjs +10 -8
- package/data-structures/AccountActions/AccountActions.cjs +1 -1
- package/data-structures/AccountActions/AccountActions.mjs +3 -2
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +2 -3
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +16 -21
- package/data-structures/Hinkal/Hinkal.mjs +144 -160
- package/data-structures/Hinkal/IHinkal.d.ts +13 -19
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +15 -15
- package/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -1
- package/data-structures/Hinkal/hinkalClaimUtxo.d.ts +1 -2
- package/data-structures/Hinkal/hinkalClaimUtxo.mjs +49 -47
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.d.ts +5 -3
- package/data-structures/Hinkal/hinkalDeposit.mjs +106 -50
- package/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndBridge.d.ts +1 -1
- package/data-structures/Hinkal/hinkalDepositAndBridge.mjs +94 -87
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +3 -2
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +48 -48
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +41 -63
- package/data-structures/Hinkal/hinkalPalEvmDeposit.cjs +1 -0
- package/data-structures/Hinkal/hinkalPalEvmDeposit.d.ts +9 -0
- package/data-structures/Hinkal/hinkalPalEvmDeposit.mjs +19 -0
- package/data-structures/Hinkal/hinkalPalSolanaDepositPrepare.cjs +1 -0
- package/data-structures/Hinkal/hinkalPalSolanaDepositPrepare.d.ts +9 -0
- package/data-structures/Hinkal/hinkalPalSolanaDepositPrepare.mjs +18 -0
- package/data-structures/Hinkal/hinkalPalTronDepositPrepare.cjs +1 -0
- package/data-structures/Hinkal/hinkalPalTronDepositPrepare.d.ts +9 -0
- package/data-structures/Hinkal/hinkalPalTronDepositPrepare.mjs +17 -0
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +46 -50
- package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +4 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +84 -128
- package/data-structures/Hinkal/hinkalProoflessDeposit.utils.cjs +1 -0
- package/data-structures/Hinkal/hinkalProoflessDeposit.utils.d.ts +7 -0
- package/data-structures/Hinkal/hinkalProoflessDeposit.utils.mjs +51 -0
- package/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.cjs +1 -0
- package/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.d.ts +6 -0
- package/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.mjs +128 -0
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.d.ts +2 -2
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +68 -69
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +4 -3
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +96 -57
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +20 -2
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +114 -122
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +12 -17
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +38 -40
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +4 -3
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +68 -52
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +2 -2
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +67 -72
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +2 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +56 -61
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +38 -48
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +32 -42
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +41 -54
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +43 -56
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +87 -108
- package/data-structures/Hinkal/index.cjs +1 -1
- package/data-structures/Hinkal/index.d.ts +5 -0
- package/data-structures/Hinkal/index.mjs +5 -0
- package/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.cjs +1 -0
- package/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.d.ts +22 -0
- package/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.mjs +34 -0
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +33 -40
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.mjs +25 -24
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.d.ts +1 -0
- package/data-structures/IndexedDB/contact-db.mjs +30 -16
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.d.ts +1 -1
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +4 -4
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +37 -34
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.d.ts +2 -0
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +65 -50
- package/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/PrivateTokensDB.mjs +2 -1
- package/data-structures/WalletManager/WalletManager.cjs +1 -0
- package/data-structures/WalletManager/WalletManager.d.ts +51 -0
- package/data-structures/WalletManager/WalletManager.mjs +99 -0
- package/data-structures/WalletManager/index.cjs +1 -0
- package/data-structures/WalletManager/index.d.ts +1 -0
- package/data-structures/WalletManager/index.mjs +1 -0
- package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.d.ts +5 -3
- package/data-structures/crypto-keys/decodeUTXO.mjs +49 -46
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +32 -40
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +51 -24
- package/data-structures/crypto-keys/keys.mjs +104 -43
- package/data-structures/custom-token-registry/CustomTokenRegistry.cjs +1 -1
- package/data-structures/custom-token-registry/CustomTokenRegistry.mjs +2 -2
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +2 -2
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +4 -4
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.mjs +1 -1
- package/data-structures/event-service/helpers/ClientEventHelper.cjs +1 -1
- package/data-structures/event-service/helpers/ClientEventHelper.mjs +3 -3
- package/data-structures/event-service/helpers/PollingEventHelper.cjs +1 -1
- package/data-structures/event-service/helpers/PollingEventHelper.d.ts +2 -0
- package/data-structures/event-service/helpers/PollingEventHelper.mjs +7 -3
- package/data-structures/event-service/index.cjs +1 -1
- package/data-structures/event-service/index.d.ts +0 -3
- package/data-structures/event-service/index.mjs +0 -3
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.mjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +2 -2
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +5 -5
- package/data-structures/index.cjs +1 -1
- package/data-structures/index.d.ts +1 -0
- package/data-structures/index.mjs +10 -10
- package/data-structures/merkle-tree/index.cjs +1 -1
- package/data-structures/merkle-tree/index.d.ts +0 -1
- package/data-structures/merkle-tree/index.mjs +0 -1
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +6 -0
- package/data-structures/snapshot/SnapshotFetcherService.cjs +1 -1
- package/data-structures/snapshot/SnapshotFetcherService.d.ts +0 -2
- package/data-structures/snapshot/SnapshotFetcherService.mjs +0 -6
- package/data-structures/snapshot/index.cjs +1 -1
- package/data-structures/snapshot/index.d.ts +0 -3
- package/data-structures/snapshot/index.mjs +0 -3
- package/data-structures/utxo/Utxo.cjs +1 -1
- package/data-structures/utxo/Utxo.d.ts +16 -10
- package/data-structures/utxo/Utxo.mjs +40 -38
- package/error-handling/customErrors/HttpError.cjs +1 -0
- package/error-handling/customErrors/HttpError.d.ts +4 -0
- package/error-handling/customErrors/HttpError.mjs +8 -0
- package/error-handling/customErrors/index.cjs +1 -1
- package/error-handling/customErrors/index.d.ts +1 -0
- package/error-handling/customErrors/index.mjs +1 -0
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +11 -0
- package/error-handling/error-codes.constants.mjs +13 -2
- package/error-handling/index.cjs +1 -1
- package/error-handling/index.mjs +1 -0
- package/error-handling/retrySolanaError.cjs +1 -0
- package/error-handling/retrySolanaError.d.ts +1 -0
- package/error-handling/retrySolanaError.mjs +4 -0
- package/externalABIs/index.cjs +1 -1
- package/externalABIs/index.d.ts +1 -16
- package/externalABIs/index.mjs +4 -5
- package/functions/auto-deposit-back-helpers/get-gas-token-records.d.ts +1 -1
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.d.ts +1 -1
- package/functions/index.cjs +1 -1
- package/functions/index.mjs +28 -19
- package/functions/kyc/checkTokenLimitsUSD.cjs +1 -1
- package/functions/kyc/checkTokenLimitsUSD.mjs +15 -15
- package/functions/kyc/index.cjs +1 -1
- package/functions/kyc/index.d.ts +0 -1
- package/functions/kyc/index.mjs +0 -1
- package/functions/pre-transaction/addressTableLookup.cjs +1 -1
- package/functions/pre-transaction/addressTableLookup.mjs +21 -18
- package/functions/pre-transaction/buildCommitmentValidationData.cjs +1 -0
- package/functions/pre-transaction/buildCommitmentValidationData.d.ts +4 -0
- package/functions/pre-transaction/buildCommitmentValidationData.mjs +58 -0
- package/functions/pre-transaction/calculateSolanaNullifierCount.cjs +1 -0
- package/functions/pre-transaction/calculateSolanaNullifierCount.d.ts +2 -0
- package/functions/pre-transaction/calculateSolanaNullifierCount.mjs +23 -0
- package/functions/pre-transaction/constructAdminData.cjs +1 -1
- package/functions/pre-transaction/constructAdminData.mjs +4 -4
- package/functions/pre-transaction/index.cjs +1 -1
- package/functions/pre-transaction/index.d.ts +2 -3
- package/functions/pre-transaction/index.mjs +3 -4
- package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.d.ts +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.mjs +22 -19
- package/functions/pre-transaction/recipientUtxoProcessing.cjs +1 -1
- package/functions/pre-transaction/recipientUtxoProcessing.mjs +11 -9
- package/functions/pre-transaction/sendInitNullifiersTransaction.cjs +1 -1
- package/functions/pre-transaction/sendInitNullifiersTransaction.mjs +9 -9
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -1
- package/functions/pre-transaction/sendV0Transaction.mjs +45 -43
- package/functions/pre-transaction/solana-public-signals.cjs +1 -1
- package/functions/pre-transaction/solana-public-signals.d.ts +7 -6
- package/functions/pre-transaction/solana-public-signals.mjs +22 -19
- package/functions/pre-transaction/solana.cjs +1 -1
- package/functions/pre-transaction/solana.d.ts +0 -4
- package/functions/pre-transaction/solana.mjs +7 -27
- package/functions/pre-transaction/store-proof.cjs +1 -1
- package/functions/pre-transaction/store-proof.mjs +3 -3
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +13 -3
- package/functions/private-wallet/emporium.helpers.mjs +84 -74
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.mjs +6 -6
- package/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/functions/snarkjs/common.snarkjs.d.ts +8 -13
- package/functions/snarkjs/common.snarkjs.mjs +65 -74
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.d.ts +146 -426
- package/functions/snarkjs/constant.mjs +149 -430
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +2 -3
- package/functions/snarkjs/constructGeneralZkProof.mjs +74 -57
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/functions/snarkjs/constructSolanaZkProof.d.ts +1 -2
- package/functions/snarkjs/constructSolanaZkProof.mjs +65 -37
- package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.d.ts +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +6 -10
- package/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -1
- package/functions/snarkjs/fetchOnChainRootHashes.d.ts +0 -1
- package/functions/snarkjs/fetchOnChainRootHashes.mjs +22 -7
- package/functions/snarkjs/generateCircomData.cjs +1 -1
- package/functions/snarkjs/generateCircomData.d.ts +2 -2
- package/functions/snarkjs/generateCircomData.mjs +29 -31
- package/functions/snarkjs/generateZkProof.cjs +1 -1
- package/functions/snarkjs/generateZkProof.mjs +20 -10
- package/functions/snarkjs/generateZkProofEnclave.cjs +1 -1
- package/functions/snarkjs/generateZkProofEnclave.mjs +15 -18
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.cjs +1 -1
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.d.ts +2 -9
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +40 -94
- package/functions/snarkjs/getZKFiles.cjs +1 -1
- package/functions/snarkjs/getZKFiles.d.ts +1 -0
- package/functions/snarkjs/getZKFiles.mjs +2 -2
- package/functions/snarkjs/index.cjs +1 -1
- package/functions/snarkjs/index.d.ts +2 -1
- package/functions/snarkjs/index.mjs +2 -1
- package/functions/snarkjs/signedMessageHash.cjs +1 -0
- package/functions/snarkjs/signedMessageHash.d.ts +31 -0
- package/functions/snarkjs/signedMessageHash.mjs +49 -0
- package/functions/snarkjs/verifyCommitmentValidationData.cjs +1 -0
- package/functions/snarkjs/verifyCommitmentValidationData.d.ts +4 -0
- package/functions/snarkjs/verifyCommitmentValidationData.mjs +43 -0
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +2 -0
- package/functions/utils/addresses.mjs +12 -8
- package/functions/utils/aggregateTokenAmounts.cjs +1 -0
- package/functions/utils/aggregateTokenAmounts.d.ts +2 -0
- package/functions/utils/aggregateTokenAmounts.mjs +26 -0
- package/functions/utils/amounts.utils.cjs +1 -1
- package/functions/utils/amounts.utils.d.ts +0 -1
- package/functions/utils/amounts.utils.mjs +18 -18
- package/functions/utils/auth.utils.cjs +1 -0
- package/functions/utils/auth.utils.d.ts +5 -0
- package/functions/utils/auth.utils.mjs +7 -0
- package/functions/utils/bit.operations.cjs +1 -0
- package/functions/utils/bit.operations.d.ts +3 -0
- package/functions/utils/bit.operations.mjs +4 -0
- package/functions/utils/buildClaimableDepositPlan.cjs +1 -1
- package/functions/utils/buildClaimableDepositPlan.d.ts +3 -2
- package/functions/utils/buildClaimableDepositPlan.mjs +32 -24
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.d.ts +0 -4
- package/functions/utils/cacheFunctions.mjs +33 -47
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +2 -3
- package/functions/utils/create-provider.mjs +8 -10
- package/functions/utils/customEnclaveFunctionsRegister.cjs +1 -0
- package/functions/utils/customEnclaveFunctionsRegister.d.ts +18 -0
- package/functions/utils/customEnclaveFunctionsRegister.mjs +8 -0
- package/functions/utils/deposit-claimable.utils.cjs +1 -0
- package/functions/utils/deposit-claimable.utils.d.ts +6 -0
- package/functions/utils/deposit-claimable.utils.mjs +106 -0
- package/functions/utils/dispatchBalanceRefreshes.cjs +1 -0
- package/functions/utils/dispatchBalanceRefreshes.d.ts +4 -0
- package/functions/utils/dispatchBalanceRefreshes.mjs +44 -0
- package/functions/utils/enclave-recipient-info-storage.cjs +1 -0
- package/functions/utils/enclave-recipient-info-storage.d.ts +2 -0
- package/functions/utils/enclave-recipient-info-storage.mjs +17 -0
- package/functions/utils/enclave-signature-storage.cjs +1 -1
- package/functions/utils/enclave-signature-storage.d.ts +1 -2
- package/functions/utils/enclave-signature-storage.mjs +6 -9
- package/functions/utils/enclave-utxo-storage.cjs +1 -1
- package/functions/utils/enclave-utxo-storage.d.ts +3 -2
- package/functions/utils/enclave-utxo-storage.mjs +18 -21
- package/functions/utils/encodeTokenWithId.cjs +1 -1
- package/functions/utils/encodeTokenWithId.mjs +1 -1
- package/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +17 -23
- package/functions/utils/enum.utils.cjs +1 -0
- package/functions/utils/enum.utils.mjs +12 -0
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.d.ts +2 -0
- package/functions/utils/erc20tokenFunctions.mjs +26 -16
- package/functions/utils/evmNetworkFunctions.d.ts +1 -2
- package/functions/utils/fees.utils.cjs +1 -1
- package/functions/utils/fees.utils.d.ts +2 -1
- package/functions/utils/fees.utils.mjs +30 -16
- package/functions/utils/formatter.cjs +1 -0
- package/functions/utils/formatter.d.ts +1 -0
- package/functions/utils/formatter.mjs +15 -0
- package/functions/utils/getBlockExplorerUrl.cjs +1 -1
- package/functions/utils/getBlockExplorerUrl.mjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.d.ts +2 -0
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +14 -9
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -0
- package/functions/utils/getUtxosFromReceipt.utils.mjs +43 -27
- package/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
- package/functions/utils/getUtxosFromReceiptSolana.d.ts +1 -0
- package/functions/utils/getUtxosFromReceiptSolana.mjs +36 -21
- package/functions/utils/getWalletGroupKey.utils.cjs +1 -1
- package/functions/utils/getWalletGroupKey.utils.mjs +4 -1
- package/functions/utils/index.cjs +1 -1
- package/functions/utils/index.d.ts +14 -1
- package/functions/utils/index.mjs +21 -9
- package/functions/utils/lifi.utils.cjs +1 -0
- package/functions/utils/lifi.utils.d.ts +3 -0
- package/functions/utils/lifi.utils.mjs +30 -0
- package/functions/utils/mnemonics.cjs +1 -0
- package/functions/utils/mnemonics.d.ts +1 -0
- package/functions/utils/mnemonics.mjs +8 -0
- package/functions/utils/pay-routing.utils.cjs +1 -0
- package/functions/utils/pay-routing.utils.d.ts +4 -0
- package/functions/utils/pay-routing.utils.mjs +17 -0
- package/functions/utils/prepareHinkal.cjs +1 -1
- package/functions/utils/prepareHinkal.mjs +29 -29
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.mjs +5 -5
- package/functions/utils/serialize-utxos.utils.cjs +1 -1
- package/functions/utils/serialize-utxos.utils.mjs +6 -2
- package/functions/utils/solana-memo.cjs +1 -0
- package/functions/utils/solana-memo.d.ts +3 -0
- package/functions/utils/solana-memo.mjs +15 -0
- package/functions/utils/solanaSendPreflight.utils.cjs +1 -0
- package/functions/utils/solanaSendPreflight.utils.d.ts +6 -0
- package/functions/utils/solanaSendPreflight.utils.mjs +21 -0
- package/functions/utils/string.utils.cjs +1 -1
- package/functions/utils/string.utils.mjs +1 -1
- package/functions/utils/time.utils.cjs +1 -1
- package/functions/utils/time.utils.d.ts +6 -0
- package/functions/utils/time.utils.mjs +23 -16
- package/functions/utils/token-check.utils.cjs +1 -1
- package/functions/utils/token-check.utils.d.ts +1 -0
- package/functions/utils/token-check.utils.mjs +9 -8
- package/functions/utils/transfer-claimable.utils.cjs +1 -0
- package/functions/utils/transfer-claimable.utils.d.ts +9 -0
- package/functions/utils/transfer-claimable.utils.mjs +93 -0
- package/functions/utils/tron.utils.cjs +1 -1
- package/functions/utils/tron.utils.d.ts +11 -1
- package/functions/utils/tron.utils.mjs +85 -40
- package/functions/utils/tx-confirmation.utils.cjs +1 -1
- package/functions/utils/tx-confirmation.utils.mjs +5 -5
- package/functions/utils/userAgent.cjs +1 -1
- package/functions/utils/userAgent.d.ts +1 -0
- package/functions/utils/userAgent.mjs +4 -1
- package/functions/web3/connectors.utils.cjs +1 -1
- package/functions/web3/connectors.utils.d.ts +1 -0
- package/functions/web3/connectors.utils.mjs +5 -2
- package/functions/web3/events/balanceChangedHandler.cjs +1 -1
- package/functions/web3/events/balanceChangedHandler.d.ts +2 -1
- package/functions/web3/events/balanceChangedHandler.mjs +3 -3
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.d.ts +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.mjs +21 -20
- package/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
- package/functions/web3/events/getInputUtxosEnclave.d.ts +2 -1
- package/functions/web3/events/getInputUtxosEnclave.mjs +25 -18
- package/functions/web3/events/getShieldedBalance.cjs +1 -1
- package/functions/web3/events/getShieldedBalance.mjs +15 -17
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.mjs +1 -1
- package/functions/web3/events/index.cjs +1 -1
- package/functions/web3/events/index.d.ts +0 -2
- package/functions/web3/events/index.mjs +0 -2
- package/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
- package/functions/web3/functionCalls/constructBatchCall.d.ts +1 -0
- package/functions/web3/functionCalls/constructBatchCall.mjs +10 -2
- package/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirectTron.d.ts +4 -1
- package/functions/web3/functionCalls/transactCallDirectTron.mjs +89 -55
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +5 -4
- package/functions/web3/functionCalls/transactCallRelayer.mjs +17 -13
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +1 -1
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +1 -1
- package/functions/web3/index.cjs +1 -1
- package/functions/web3/index.d.ts +0 -1
- package/functions/web3/index.mjs +0 -3
- package/functions/web3/lifiAPI.cjs +1 -1
- package/functions/web3/lifiAPI.mjs +28 -19
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +1 -1
- package/index.cjs +1 -1
- package/index.mjs +331 -309
- package/package.json +5 -2
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.mjs +1 -1
- package/providers/SolanaProviderAdapter.cjs +1 -1
- package/providers/SolanaProviderAdapter.d.ts +10 -1
- package/providers/SolanaProviderAdapter.mjs +38 -2
- package/providers/TronProviderAdapter.cjs +1 -1
- package/providers/TronProviderAdapter.mjs +2 -2
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +3 -1
- package/providers/WagmiProviderAdapter.mjs +62 -52
- package/providers/prepareSolanaHinkal.cjs +1 -1
- package/providers/prepareSolanaHinkal.mjs +3 -3
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +1 -8
- package/types/admin.types.mjs +1 -1
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +2 -1
- package/types/cache.types.mjs +1 -1
- package/types/chains.types.cjs +1 -0
- package/types/chains.types.d.ts +11 -0
- package/types/chains.types.mjs +8 -0
- package/types/circom-data.types.d.ts +13 -0
- package/types/commitments.types.d.ts +0 -6
- package/types/contacts.types.d.ts +1 -0
- package/types/dashboard-account.cjs +1 -0
- package/types/dashboard-account.d.ts +101 -0
- package/types/dashboard-account.mjs +8 -0
- package/types/dashboard-payout.types.cjs +1 -0
- package/types/dashboard-payout.types.d.ts +29 -0
- package/types/dashboard-payout.types.mjs +8 -0
- package/types/dashboard-transaction.types.d.ts +22 -0
- package/types/ethereum-network.types.cjs +1 -1
- package/types/ethereum-network.types.d.ts +15 -18
- package/types/ethereum-network.types.mjs +1 -1
- package/types/events.types.cjs +1 -1
- package/types/events.types.d.ts +2 -3
- package/types/events.types.mjs +1 -1
- package/types/external-action.types.cjs +1 -1
- package/types/external-action.types.d.ts +2 -1
- package/types/external-action.types.mjs +1 -1
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +6 -17
- package/types/hinkal.types.mjs +16 -18
- package/types/index.cjs +1 -1
- package/types/index.d.ts +6 -0
- package/types/index.mjs +3 -0
- package/types/pay-activities.types.d.ts +3 -0
- package/types/pay-routing.types.d.ts +9 -0
- package/types/scheduled-transactions.types.d.ts +7 -0
- package/types/solana.types.d.ts +5 -6
- package/types/token-prices.types.d.ts +4 -0
- package/types/transaction.types.d.ts +1 -3
- package/webworker/WorkerWrapper.cjs +1 -0
- package/webworker/WorkerWrapper.d.ts +9 -0
- package/webworker/WorkerWrapper.mjs +22 -0
- package/webworker/logError-fCJ4HXQz.js +22 -0
- package/webworker/package.json +112 -0
- package/webworker/performTaskWithWorker.cjs +1 -1
- package/webworker/performTaskWithWorker.mjs +4 -4
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.d.ts +0 -3
- package/webworker/snarkjsWorker/snarkjsWorkerNode.d.ts +0 -0
- package/webworker/snarkjsWorkerNode.cjs +3 -0
- package/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.d.ts +0 -3
- package/webworker/utxoWorker/utxoWorkerNode.d.ts +0 -0
- package/webworker/utxoWorkerNode.cjs +1 -0
- package/webworker/viteWorkerURL.constant.cjs +4 -4
- package/webworker/viteWorkerURL.constant.mjs +4 -4
- package/webworker/worker.registry.cjs +1 -1
- package/webworker/worker.registry.mjs +6 -3
- package/webworker/workerFactory.cjs +1 -1
- package/webworker/workerFactory.d.ts +4 -1
- package/webworker/workerFactory.mjs +31 -17
- package/webworker/workerProxy-BNBqYien.js +130 -0
- package/webworker/workerProxy.d.ts +1 -1
- package/webworker/workerThreadsPatch.d.ts +1 -0
- package/webworker/zkProofWorker/zkProofWorker.types.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorker.types.d.ts +3 -13
- package/webworker/zkProofWorker/zkProofWorker.types.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.d.ts +1 -5
- package/webworker/zkProofWorker/zkProofWorkerNode.d.ts +0 -0
- package/webworker/zkProofWorkerNode.cjs +1 -0
- package/API/solana-calls.cjs +0 -1
- package/API/solana-calls.d.ts +0 -38
- package/API/solana-calls.mjs +0 -8
- package/constants/non-circular-tokens.constants.cjs +0 -1
- package/constants/non-circular-tokens.constants.d.ts +0 -1
- package/constants/non-circular-tokens.constants.mjs +0 -4
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.cjs +0 -1
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.d.ts +0 -3
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.mjs +0 -15
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +0 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.d.ts +0 -4
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +0 -18
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.d.ts +0 -35
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.mjs +0 -75
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +0 -1
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.d.ts +0 -30
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.mjs +0 -81
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +0 -35
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +0 -76
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs +0 -1
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.ts +0 -2
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs +0 -13
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.d.ts +0 -8
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +0 -29
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +0 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.d.ts +0 -8
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +0 -30
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.d.ts +0 -8
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +0 -26
- package/externalABIs/transactionsProver.json.cjs +0 -1
- package/externalABIs/transactionsProver.json.mjs +0 -43
- package/functions/pre-transaction/getKycAndSignatureData.cjs +0 -1
- package/functions/pre-transaction/getKycAndSignatureData.d.ts +0 -5
- package/functions/pre-transaction/getKycAndSignatureData.mjs +0 -12
- package/functions/pre-transaction/getSignatureDataForTransact.cjs +0 -1
- package/functions/pre-transaction/getSignatureDataForTransact.d.ts +0 -3
- package/functions/pre-transaction/getSignatureDataForTransact.mjs +0 -6
- package/functions/pre-transaction/initTokenLimitIfNeeded.cjs +0 -1
- package/functions/pre-transaction/initTokenLimitIfNeeded.d.ts +0 -3
- package/functions/pre-transaction/initTokenLimitIfNeeded.mjs +0 -17
- package/functions/pre-transaction/outputApprovalDataProcessing.cjs +0 -1
- package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +0 -10
- package/functions/pre-transaction/outputApprovalDataProcessing.mjs +0 -22
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +0 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +0 -6
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +0 -11
- package/functions/snarkjs/constructEmporiumProof.cjs +0 -1
- package/functions/snarkjs/constructEmporiumProof.d.ts +0 -13
- package/functions/snarkjs/constructEmporiumProof.mjs +0 -74
- package/functions/utils/processUseApprovalUtxoData.cjs +0 -1
- package/functions/utils/processUseApprovalUtxoData.d.ts +0 -3
- package/functions/utils/processUseApprovalUtxoData.mjs +0 -13
- package/functions/web3/events/balanceChangedCustomHandler.cjs +0 -1
- package/functions/web3/events/balanceChangedCustomHandler.d.ts +0 -2
- package/functions/web3/events/balanceChangedCustomHandler.mjs +0 -9
- package/functions/web3/events/getApprovedBalance.cjs +0 -1
- package/functions/web3/events/getApprovedBalance.d.ts +0 -6
- package/functions/web3/events/getApprovedBalance.mjs +0 -37
- package/functions/web3/functionCalls/accessTokenCalls.cjs +0 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +0 -2
- package/functions/web3/functionCalls/accessTokenCalls.mjs +0 -19
- package/functions/web3/tron-wagmi-adapter.cjs +0 -1
- package/functions/web3/tron-wagmi-adapter.d.ts +0 -8
- package/functions/web3/tron-wagmi-adapter.mjs +0 -27
- package/providers/CustomEthersProvider.cjs +0 -1
- package/providers/CustomEthersProvider.d.ts +0 -10
- package/providers/CustomEthersProvider.mjs +0 -28
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +0 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +0 -30
- package/webworker/utxoWorker/utxoWorkerLogic.cjs +0 -1
- package/webworker/utxoWorker/utxoWorkerLogic.mjs +0 -69
- package/webworker/workerProxy.cjs +0 -1
- package/webworker/workerProxy.mjs +0 -33
- package/webworker/zkProofWorker/zkProofWorkerLogic.cjs +0 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.mjs +0 -45
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { DepositAndWithdrawPhase as a } from "../../types/scheduled-transactions.types.mjs";
|
|
1
|
+
import { ExternalActionId as e } from "../../types/external-action.types.mjs";
|
|
2
|
+
import { networkRegistry as t } from "../../constants/chains.constants.mjs";
|
|
3
|
+
import { PAY_SEND_VARIABLE_RATE as n, zeroAddress as r } from "../../constants/protocol.constants.mjs";
|
|
4
|
+
import { DepositAndWithdrawPhase as i } from "../../types/scheduled-transactions.types.mjs";
|
|
6
5
|
import "../../types/index.mjs";
|
|
7
|
-
import { caseInsensitiveEqual as
|
|
8
|
-
import { hashEthereumAddress as s } from "../../functions/utils/addresses.mjs";
|
|
6
|
+
import { caseInsensitiveEqual as a } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
7
|
+
import { hashEthereumAddress as o, hashString as s } from "../../functions/utils/addresses.mjs";
|
|
9
8
|
import { API as c } from "../../API/API.mjs";
|
|
10
9
|
import { SWAP_ROUTER_ADDRESSES as l } from "../../constants/addresses.constants.mjs";
|
|
11
10
|
import { transactionErrorCodes as u } from "../../error-handling/error-codes.constants.mjs";
|
|
@@ -13,104 +12,112 @@ import { getERC20Token as d } from "../../functions/utils/erc20tokenFunctions.mj
|
|
|
13
12
|
import { getCurrentTimeInSeconds as f } from "../../functions/utils/time.utils.mjs";
|
|
14
13
|
import { Utxo as p } from "../utxo/Utxo.mjs";
|
|
15
14
|
import { validateAndGetChainId as m } from "../../functions/utils/token-check.utils.mjs";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import { convertEmporiumOpToCallInfo as
|
|
15
|
+
import { constructAdminData as h } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
16
|
+
import { getFeeStructure as g } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
17
|
+
import { waitForDepositedUtxosInMerkleTree as _ } from "../../functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs";
|
|
18
|
+
import { buildCommitmentValidationData as v } from "../../functions/pre-transaction/buildCommitmentValidationData.mjs";
|
|
19
|
+
import "../../functions/pre-transaction/index.mjs";
|
|
20
|
+
import { convertEmporiumOpToCallInfo as y } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
21
|
+
import { calculateModifiedFeeStructure as b } from "../../functions/utils/fees.utils.mjs";
|
|
22
22
|
import "../../functions/utils/index.mjs";
|
|
23
|
-
import { createLifiBridgeOps as x } from "../../functions/private-wallet/emporium.helpers.mjs";
|
|
24
|
-
import {
|
|
25
|
-
import { transactCallRelayerBatch as
|
|
26
|
-
import { safeUpdateDepositAndWithdrawStatus as
|
|
27
|
-
import { hinkalDepositOnChainUtxos as
|
|
23
|
+
import { createLifiBridgeOps as x, getAuthorizationDataIfNeeded as S } from "../../functions/private-wallet/emporium.helpers.mjs";
|
|
24
|
+
import { constructZkProof as C } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
|
|
25
|
+
import { transactCallRelayerBatch as w } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
26
|
+
import { safeUpdateDepositAndWithdrawStatus as T } from "../../API/deposit-and-withdraw-status-calls.mjs";
|
|
27
|
+
import { hinkalDepositOnChainUtxos as E } from "./hinkalDepositOnChainUtxos.mjs";
|
|
28
28
|
import "../../functions/index.mjs";
|
|
29
29
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalDepositAndBridge.ts
|
|
30
|
-
var
|
|
31
|
-
if (
|
|
32
|
-
let
|
|
33
|
-
if (!
|
|
34
|
-
let
|
|
35
|
-
if (!
|
|
36
|
-
let
|
|
37
|
-
if (!
|
|
38
|
-
let
|
|
39
|
-
for (let t = 0; t <
|
|
40
|
-
let
|
|
41
|
-
await c.addTemporaryWalletNonce(
|
|
42
|
-
let
|
|
30
|
+
var D = async (n, o, s, d, m, g, _, y, E, D, O) => {
|
|
31
|
+
if (d.length === 0) throw Error("No recipients to bridge");
|
|
32
|
+
let k = s.erc20TokenAddress, { contractData: A } = t[o], { emporiumAddress: j } = A;
|
|
33
|
+
if (!j) throw Error("No Emporium Address");
|
|
34
|
+
let M = l[e.Lifi][o];
|
|
35
|
+
if (!M) throw Error(`LIFI not configured for chain ${o}`);
|
|
36
|
+
let N = await n.getRandomRelay(o);
|
|
37
|
+
if (!N) throw Error(u.RELAYER_NOT_AVAILABLE);
|
|
38
|
+
let P = await n.getEthereumAddressByChain(o), F = f().toString(), I = n.generateProofRemotely ? 5 : 1, L = [];
|
|
39
|
+
for (let t = 0; t < d.length; t += I) {
|
|
40
|
+
let i = d.slice(t, t + I), l = await Promise.all(i.map(async ({ utxo: t, nativeUtxo: i, bridgeAmount: l, quote: u, temporarySubAccount: d, recipientAddress: f }) => {
|
|
41
|
+
await c.addTemporaryWalletNonce(o, g, d.index);
|
|
42
|
+
let _ = u.nativeFee > 0n && !a(k, r), y = [k], w = [-t.amount], T = [!1], E = new p({
|
|
43
43
|
amount: 0n,
|
|
44
|
-
erc20TokenAddress:
|
|
45
|
-
|
|
46
|
-
timeStamp:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
erc20TokenAddress: k,
|
|
45
|
+
nullifyingKey: n.userKeys.getShieldedPrivateKey(),
|
|
46
|
+
timeStamp: F,
|
|
47
|
+
...t.isNewStyle ? {
|
|
48
|
+
spendingPublicKey: n.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,
|
|
49
|
+
isNewStyle: !0
|
|
50
|
+
} : { isNewStyle: !1 }
|
|
51
|
+
}), O = [[t, E]], A = [[E]];
|
|
52
|
+
if (_ && i) {
|
|
50
53
|
let e = new p({
|
|
51
54
|
amount: 0n,
|
|
52
|
-
erc20TokenAddress:
|
|
53
|
-
|
|
54
|
-
timeStamp:
|
|
55
|
-
|
|
55
|
+
erc20TokenAddress: r,
|
|
56
|
+
nullifyingKey: n.userKeys.getShieldedPrivateKey(),
|
|
57
|
+
timeStamp: F,
|
|
58
|
+
...i.isNewStyle ? {
|
|
59
|
+
spendingPublicKey: n.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,
|
|
60
|
+
isNewStyle: !0
|
|
61
|
+
} : { isNewStyle: !1 }
|
|
56
62
|
});
|
|
57
|
-
|
|
63
|
+
y.push(r), w.push(-i.amount), T.push(!1), O.push([i, e]), A.push([e]);
|
|
58
64
|
}
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
let I = x(n, o, d.ethAddress, M, k, t.amount, l, u), L = await b(o, s, l, m), R = h(D, o, y, [-t.amount], P), [{ zkCallData: z, circomData: B, dimData: V }, H, U] = await Promise.all([
|
|
66
|
+
C(n.merkleTreeHinkalByChain[o], O, A, n.userKeys, e.Emporium, j, I, n.generateProofRemotely, L, N ?? r, o, T, void 0, void 0, d.privateKey),
|
|
67
|
+
S(o, d.privateKey),
|
|
68
|
+
v(o, n.userKeys, y, O)
|
|
69
|
+
]);
|
|
64
70
|
return {
|
|
65
|
-
zkCallData:
|
|
66
|
-
dimData:
|
|
67
|
-
circomData:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
zkCallData: z,
|
|
72
|
+
dimData: V,
|
|
73
|
+
circomData: B,
|
|
74
|
+
commitmentValidationData: U,
|
|
75
|
+
authorizationData: H,
|
|
76
|
+
recipientAddress: f,
|
|
77
|
+
adminData: R
|
|
71
78
|
};
|
|
72
79
|
}));
|
|
73
|
-
|
|
80
|
+
L.push(...l);
|
|
74
81
|
}
|
|
75
|
-
await
|
|
76
|
-
id:
|
|
77
|
-
chainId:
|
|
78
|
-
hashedEthereumAddress:
|
|
79
|
-
phase:
|
|
82
|
+
await T({
|
|
83
|
+
id: _,
|
|
84
|
+
chainId: o,
|
|
85
|
+
hashedEthereumAddress: g,
|
|
86
|
+
phase: i.BEFORE_SCHEDULE_WITHDRAW
|
|
80
87
|
});
|
|
81
|
-
let
|
|
82
|
-
return await
|
|
83
|
-
id:
|
|
84
|
-
chainId:
|
|
85
|
-
hashedEthereumAddress:
|
|
86
|
-
phase:
|
|
87
|
-
scheduleId:
|
|
88
|
-
}),
|
|
89
|
-
},
|
|
90
|
-
let
|
|
91
|
-
if (!
|
|
92
|
-
let
|
|
93
|
-
if (
|
|
88
|
+
let R = await w(o, L, g, y, E, O);
|
|
89
|
+
return await T({
|
|
90
|
+
id: _,
|
|
91
|
+
chainId: o,
|
|
92
|
+
hashedEthereumAddress: g,
|
|
93
|
+
phase: i.AFTER_SCHEDULE_WITHDRAW,
|
|
94
|
+
scheduleId: R
|
|
95
|
+
}), R;
|
|
96
|
+
}, O = async (t, i, c, u, f, p, h, v, b = !0) => {
|
|
97
|
+
let S = i.erc20TokenAddress, C = m([i]), w = v ? s(v) : void 0, T = o(await t.getEthereumAddressByChain(C)), O = l[e.Lifi][C];
|
|
98
|
+
if (!O) throw Error("LIFI router not configured");
|
|
99
|
+
let k;
|
|
100
|
+
if (f) k = f;
|
|
94
101
|
else {
|
|
95
|
-
let
|
|
96
|
-
|
|
102
|
+
let r = c[0], i = x(t, C, r.temporarySubAccount.ethAddress, O, S, r.bridgeAmount, r.bridgeAmount, r.quote).map((e) => y(e, r.temporarySubAccount.ethAddress, C));
|
|
103
|
+
k = await g(C, S, [S], e.Emporium, i, n);
|
|
97
104
|
}
|
|
98
|
-
let
|
|
99
|
-
feeToken:
|
|
105
|
+
let A = {
|
|
106
|
+
feeToken: k.feeToken,
|
|
100
107
|
flatFee: 0n,
|
|
101
108
|
variableRate: 0n
|
|
102
|
-
},
|
|
103
|
-
if (
|
|
104
|
-
let
|
|
105
|
-
if (!
|
|
106
|
-
let { userDepositedUtxos: n } = await
|
|
107
|
-
|
|
109
|
+
}, j = c.reduce((e, t) => e + t.quote.nativeFee, 0n) > 0n && !a(S, r), M = c.map((e) => e.bridgeAmount), N = c.map((e) => e.recipientAddress), { userDepositedUtxos: P, statusId: F, depositTxHash: I } = await E(t, C, i, M, N, k, T, b), L = [];
|
|
110
|
+
if (j) {
|
|
111
|
+
let e = d(r, C);
|
|
112
|
+
if (!e) throw Error("No native token");
|
|
113
|
+
let { userDepositedUtxos: n } = await E(t, C, e, c.map((e) => e.quote.nativeFee), N, A, T, b);
|
|
114
|
+
L = n;
|
|
108
115
|
}
|
|
109
|
-
return await
|
|
116
|
+
return await _(t, C, [...P, ...L]), await D(t, C, i, c.map((e, t) => ({
|
|
110
117
|
...e,
|
|
111
|
-
utxo:
|
|
112
|
-
nativeUtxo:
|
|
113
|
-
})),
|
|
118
|
+
utxo: P[t].utxo,
|
|
119
|
+
nativeUtxo: j ? L[t]?.utxo : void 0
|
|
120
|
+
})), k, T, F, u, p, h, w), I;
|
|
114
121
|
};
|
|
115
122
|
//#endregion
|
|
116
|
-
export {
|
|
123
|
+
export { O as hinkalDepositAndBridge };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../types/
|
|
1
|
+
const e=require(`../../types/external-action.types.cjs`),t=require(`../../constants/chains.constants.cjs`),n=require(`../../constants/protocol.constants.cjs`),r=require(`../../types/scheduled-transactions.types.cjs`);require(`../../types/index.cjs`);const i=require(`../../functions/utils/caseInsensitive.utils.cjs`),a=require(`../../functions/utils/addresses.cjs`),o=require(`../../error-handling/error-codes.constants.cjs`),s=require(`../../functions/utils/time.utils.cjs`),c=require(`../utxo/Utxo.cjs`),l=require(`../../functions/utils/tron.utils.cjs`),u=require(`../../functions/utils/token-check.utils.cjs`),d=require(`../../functions/pre-transaction/constructAdminData.cjs`),f=require(`../../functions/pre-transaction/getFeeStructure.cjs`),p=require(`../../functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs`),m=require(`../../functions/pre-transaction/buildCommitmentValidationData.cjs`);require(`../../functions/pre-transaction/index.cjs`);const h=require(`../../functions/utils/fees.utils.cjs`),g=require(`../../functions/snarkjs/constructGeneralZkProof.cjs`),_=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),v=require(`../../API/deposit-and-withdraw-status-calls.cjs`),y=require(`./hinkalDepositOnChainUtxos.cjs`);require(`../../functions/index.cjs`);var b=async(e,a,u,f,p,y,b,x,S,C,w,T)=>{let E=t.isTronLike(a);if(f.length===0)throw Error(`userDepositedUtxos must not be empty`);let D=u.erc20TokenAddress,[O,k]=await Promise.all([e.getRandomRelay(a),e.getEthereumAddressByChain(a)]);if(!O)throw Error(o.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let A=s.getCurrentTimeInSeconds().toString(),j=e.generateProofRemotely&&!E?5:1,M=[],N=l.addressToHexFormat(k);for(let t=0;t<f.length;t+=j){let r=f.slice(t,t+j),o=await Promise.all(r.map(async({recipientAddress:r,utxo:o},s)=>{let f=t+s,_=l.addressToHexFormat(r),v=new c.Utxo({amount:0n,erc20TokenAddress:D,nullifyingKey:e.userKeys.getShieldedPrivateKey(),timeStamp:A,...o.isNewStyle?{spendingPublicKey:e.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,isNewStyle:!0}:{isNewStyle:!1}}),b=[[i.caseInsensitiveEqual(o.erc20TokenAddress,D)?o:c.Utxo.createFrom(o,{erc20TokenAddress:D}),v]],x=[[v]],S={externalActionId:0n,externalAddress:_,externalActionMetadata:`0x00`},C=d.constructAdminData(w,a,[D],[-o.amount],N),T=await h.calculateModifiedFeeStructure(a,u,p[f],y),[{zkCallData:k,circomData:j,dimData:M},P]=await Promise.all([g.constructZkProof(e.merkleTreeHinkalByChain[a],b,x,e.userKeys,S.externalActionId,S.externalAddress,S.externalActionMetadata,e.generateProofRemotely,T,O??n.zeroAddress,a),m.buildCommitmentValidationData(a,e.userKeys,[D],b)]);return{zkCallData:k,dimData:M,circomData:j,commitmentValidationData:P,adminData:C,recipientAddress:r,tronProofSignature:await l.reorderZkCallData(E,k,M,j)}}));M.push(...o)}await v.safeUpdateDepositAndWithdrawStatus({id:x,chainId:a,hashedEthereumAddress:b,phase:r.DepositAndWithdrawPhase.BEFORE_SCHEDULE_WITHDRAW});let P=await _.transactCallRelayerBatch(a,M,b,S,C,T);return await v.safeUpdateDepositAndWithdrawStatus({id:x,chainId:a,hashedEthereumAddress:b,phase:r.DepositAndWithdrawPhase.AFTER_SCHEDULE_WITHDRAW,scheduleId:P}),P},x=async(t,n,r,i,o,s,c,d,m,h=!0)=>{let g=u.validateAndGetChainId([n]),_=m?a.hashString(m):void 0,v=n.erc20TokenAddress,x=a.hashEthereumAddress(l.addressToHexFormat(await t.getEthereumAddressByChain(g))),S=s??await f.getFeeStructure(g,v,[v],e.ExternalActionId.Transact,[],10n),{userDepositedUtxos:C,statusId:w,depositTxHash:T}=await y.hinkalDepositOnChainUtxos(t,g,n,r,i,S,x,h);return await p.waitForDepositedUtxosInMerkleTree(t,g,C),await b(t,g,n,C,r,S,x,w,o,c,d,_),T};exports.hinkalDepositAndWithdraw=x,exports.hinkalWithdrawBatch=b;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IHinkal } from './IHinkal';
|
|
2
|
-
import { AdminTransactionType, ERC20Token } from '../../types';
|
|
2
|
+
import { AdminTransactionType, ERC20Token, RecipientUtxo } from '../../types';
|
|
3
3
|
import { FeeStructure } from '../../types/hinkal.types';
|
|
4
|
+
export declare const hinkalWithdrawBatch: (hinkal: IHinkal, chainId: number, erc20Token: ERC20Token, userDepositedUtxos: RecipientUtxo[], recipientAmounts: bigint[], feeStructure: FeeStructure, hashedEthereumAddress: string, statusId: string | undefined, txCompletionTime?: number, ref?: string, action?: AdminTransactionType, hashedDashboardAccountId?: string) => Promise<string>;
|
|
4
5
|
export declare const hinkalDepositAndWithdraw: (hinkal: IHinkal, erc20Token: ERC20Token, recipientAmounts: bigint[], recipientAddresses: string[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, // Should be passed fee for only one withdraw transaction, multiplication happening in this function
|
|
5
|
-
ref?: string, action?: AdminTransactionType, preEstimateGas?: boolean) => Promise<string>;
|
|
6
|
+
ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, preEstimateGas?: boolean) => Promise<string>;
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { DepositAndWithdrawPhase as i } from "../../types/scheduled-transactions.types.mjs";
|
|
1
|
+
import { ExternalActionId as e } from "../../types/external-action.types.mjs";
|
|
2
|
+
import { isTronLike as t } from "../../constants/chains.constants.mjs";
|
|
3
|
+
import { zeroAddress as n } from "../../constants/protocol.constants.mjs";
|
|
4
|
+
import { DepositAndWithdrawPhase as r } from "../../types/scheduled-transactions.types.mjs";
|
|
6
5
|
import "../../types/index.mjs";
|
|
7
|
-
import { caseInsensitiveEqual as
|
|
8
|
-
import { hashEthereumAddress as o } from "../../functions/utils/addresses.mjs";
|
|
6
|
+
import { caseInsensitiveEqual as i } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
7
|
+
import { hashEthereumAddress as a, hashString as o } from "../../functions/utils/addresses.mjs";
|
|
9
8
|
import { transactionErrorCodes as s } from "../../error-handling/error-codes.constants.mjs";
|
|
10
9
|
import { getCurrentTimeInSeconds as c } from "../../functions/utils/time.utils.mjs";
|
|
11
10
|
import { Utxo as l } from "../utxo/Utxo.mjs";
|
|
12
11
|
import { addressToHexFormat as u, reorderZkCallData as d } from "../../functions/utils/tron.utils.mjs";
|
|
13
12
|
import { validateAndGetChainId as f } from "../../functions/utils/token-check.utils.mjs";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
13
|
+
import { constructAdminData as p } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
14
|
+
import { getFeeStructure as m } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
15
|
+
import { waitForDepositedUtxosInMerkleTree as h } from "../../functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs";
|
|
16
|
+
import { buildCommitmentValidationData as g } from "../../functions/pre-transaction/buildCommitmentValidationData.mjs";
|
|
17
|
+
import "../../functions/pre-transaction/index.mjs";
|
|
18
|
+
import { calculateModifiedFeeStructure as _ } from "../../functions/utils/fees.utils.mjs";
|
|
19
19
|
import { constructZkProof as v } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
|
|
20
20
|
import { transactCallRelayerBatch as y } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
21
21
|
import { safeUpdateDepositAndWithdrawStatus as b } from "../../API/deposit-and-withdraw-status-calls.mjs";
|
|
22
22
|
import { hinkalDepositOnChainUtxos as x } from "./hinkalDepositOnChainUtxos.mjs";
|
|
23
23
|
import "../../functions/index.mjs";
|
|
24
24
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.ts
|
|
25
|
-
var S = async (
|
|
26
|
-
let D =
|
|
27
|
-
if (
|
|
28
|
-
let O =
|
|
25
|
+
var S = async (e, a, o, f, m, h, x, S, C, w, T, E) => {
|
|
26
|
+
let D = t(a);
|
|
27
|
+
if (f.length === 0) throw Error("userDepositedUtxos must not be empty");
|
|
28
|
+
let O = o.erc20TokenAddress, [k, A] = await Promise.all([e.getRandomRelay(a), e.getEthereumAddressByChain(a)]);
|
|
29
29
|
if (!k) throw Error(s.RELAYER_NOT_AVAILABLE);
|
|
30
|
-
let j = c().toString(), M =
|
|
31
|
-
for (let
|
|
32
|
-
let
|
|
33
|
-
let
|
|
30
|
+
let j = c().toString(), M = e.generateProofRemotely && !D ? 5 : 1, N = [], P = u(A);
|
|
31
|
+
for (let t = 0; t < f.length; t += M) {
|
|
32
|
+
let r = f.slice(t, t + M), s = await Promise.all(r.map(async ({ recipientAddress: r, utxo: s }, c) => {
|
|
33
|
+
let f = t + c, y = u(r), b = new l({
|
|
34
34
|
amount: 0n,
|
|
35
35
|
erc20TokenAddress: O,
|
|
36
|
-
|
|
36
|
+
nullifyingKey: e.userKeys.getShieldedPrivateKey(),
|
|
37
37
|
timeStamp: j,
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
...s.isNewStyle ? {
|
|
39
|
+
spendingPublicKey: e.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,
|
|
40
|
+
isNewStyle: !0
|
|
41
|
+
} : { isNewStyle: !1 }
|
|
42
|
+
}), x = [[i(s.erc20TokenAddress, O) ? s : l.createFrom(s, { erc20TokenAddress: O }), b]], S = [[b]], C = {
|
|
40
43
|
externalActionId: 0n,
|
|
41
|
-
externalAddress:
|
|
44
|
+
externalAddress: y,
|
|
42
45
|
externalActionMetadata: "0x00"
|
|
43
|
-
},
|
|
44
|
-
feeToken: x.feeToken,
|
|
45
|
-
flatFee: M,
|
|
46
|
-
variableRate: 0n
|
|
47
|
-
}, { zkCallData: F, circomData: I, dimData: L } = await v(t.merkleTreeHinkalByChain[o], t.merkleTreeAccessTokenByChain[o], y, b, t.userKeys, S, T.externalActionId, T.externalAddress, T.externalActionMetadata, t.generateProofRemotely, k ?? r, o, void 0, void 0, void 0, C, void 0, void 0, N, t.getContractWithFetcher(o, e.HinkalHelperContract), w);
|
|
46
|
+
}, w = p(T, a, [O], [-s.amount], P), E = await _(a, o, m[f], h), [{ zkCallData: A, circomData: M, dimData: N }, F] = await Promise.all([v(e.merkleTreeHinkalByChain[a], x, S, e.userKeys, C.externalActionId, C.externalAddress, C.externalActionMetadata, e.generateProofRemotely, E, k ?? n, a), g(a, e.userKeys, [O], x)]);
|
|
48
47
|
return {
|
|
49
|
-
zkCallData:
|
|
50
|
-
dimData:
|
|
51
|
-
circomData:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
zkCallData: A,
|
|
49
|
+
dimData: N,
|
|
50
|
+
circomData: M,
|
|
51
|
+
commitmentValidationData: F,
|
|
52
|
+
adminData: w,
|
|
53
|
+
recipientAddress: r,
|
|
54
|
+
tronProofSignature: await d(D, A, N, M)
|
|
55
55
|
};
|
|
56
56
|
}));
|
|
57
57
|
N.push(...s);
|
|
58
58
|
}
|
|
59
59
|
await b({
|
|
60
|
-
id:
|
|
61
|
-
chainId:
|
|
62
|
-
hashedEthereumAddress:
|
|
63
|
-
phase:
|
|
60
|
+
id: S,
|
|
61
|
+
chainId: a,
|
|
62
|
+
hashedEthereumAddress: x,
|
|
63
|
+
phase: r.BEFORE_SCHEDULE_WITHDRAW
|
|
64
64
|
});
|
|
65
|
-
let F = await y(
|
|
65
|
+
let F = await y(a, N, x, C, w, E);
|
|
66
66
|
return await b({
|
|
67
|
-
id:
|
|
68
|
-
chainId:
|
|
69
|
-
hashedEthereumAddress:
|
|
70
|
-
phase:
|
|
67
|
+
id: S,
|
|
68
|
+
chainId: a,
|
|
69
|
+
hashedEthereumAddress: x,
|
|
70
|
+
phase: r.AFTER_SCHEDULE_WITHDRAW,
|
|
71
71
|
scheduleId: F
|
|
72
72
|
}), F;
|
|
73
|
-
}, C = async (
|
|
74
|
-
let
|
|
75
|
-
return await
|
|
73
|
+
}, C = async (t, n, r, i, s, c, l, d, p, g = !0) => {
|
|
74
|
+
let _ = f([n]), v = p ? o(p) : void 0, y = n.erc20TokenAddress, b = a(u(await t.getEthereumAddressByChain(_))), C = c ?? await m(_, y, [y], e.Transact, [], 10n), { userDepositedUtxos: w, statusId: T, depositTxHash: E } = await x(t, _, n, r, i, C, b, g);
|
|
75
|
+
return await h(t, _, w), await S(t, _, n, w, r, C, b, T, s, l, d, v), E;
|
|
76
76
|
};
|
|
77
77
|
//#endregion
|
|
78
|
-
export { C as hinkalDepositAndWithdraw };
|
|
78
|
+
export { C as hinkalDepositAndWithdraw, S as hinkalWithdrawBatch };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require(`../../types/ethereum-network.types.cjs`),t=require(`../../constants/chains.constants.cjs`),n=require(`../../types/scheduled-transactions.types.cjs`);require(`../../types/index.cjs`);const r=require(`../../functions/utils/tron.utils.cjs`),i=require(`../../functions/utils/getUtxosFromReceipt.utils.cjs`),a=require(`../../functions/utils/tx-confirmation.utils.cjs`),o=require(`../../functions/web3/functionCalls/transactCallDirect.cjs`),s=require(`../../functions/web3/functionCalls/transactCallDirectTron.cjs`),c=require(`../../API/deposit-and-withdraw-status-calls.cjs`),l=require(`./prepareDepositOnChainUtxosZkProof.cjs`);var u=async(u,d,f,p,m,h,g,_=!0)=>{let v=t.isTronLike(d),y=f.erc20TokenAddress,{zkCallData:b,circomData:x,dimData:S,totalAmount:C,utxoAmounts:w,hinkalWrapperAddress:T,hinkalWrapperABI:E,depositOnChainUtxosExternalActionAddress:D,depositOnChainUtxosExternalActionABI:O}=await l.prepareDepositOnChainUtxosZkProof(u,d,f,p,h),k=(await c.updateDepositAndWithdrawStatus({chainId:d,hashedEthereumAddress:g,phase:n.DepositAndWithdrawPhase.BEFORE_DEPOSIT})).id??void 0,A;if(v){let e=u.getTronWeb();A=await s.transactCallDirectTron(u,d,C,f,b,x,S,e.contract(O,r.evmHexToTronBase58Address(D)),e.contract(E,r.evmHexToTronBase58Address(T)),_)}else{let t=u.getContractWithSigner(d,e.ContractType.HinkalWrapper);A=(await o.transactCallDirect(u,d,C,f,b,x,S,u.getContractWithSigner(d,e.ContractType.DepositOnChainUtxos),t,_)).hash}if(!A)throw Error(`Deposit transaction hash not found`);let j=await a.waitForEthereumTransactionConfirmation(d,A);await c.safeUpdateDepositAndWithdrawStatus({id:k,chainId:d,hashedEthereumAddress:g,phase:n.DepositAndWithdrawPhase.AFTER_DEPOSIT,depositTxHash:A});let M=i.getOnChainUtxosFromReceipt(j,u,d,y);if(M.length===0)throw Error(`No UTXOs found in deposit transaction. Check contract address and ABI.`);let N=[],P=[...M];return m.forEach((e,t)=>{let n=w[t],r=P.find(e=>e.amount===n);if(!r)throw Error(`Could not find newly created UTXO with amount ${n} for recipient ${e}.`);N.push({recipientAddress:e,utxo:r});let i=P.indexOf(r);P.splice(i,1)}),{userDepositedUtxos:N,statusId:k,depositTxHash:A}};exports.hinkalDepositOnChainUtxos=u;
|
|
@@ -1,76 +1,54 @@
|
|
|
1
1
|
import { ContractType as e } from "../../types/ethereum-network.types.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { zeroAddress as i } from "../../constants/protocol.constants.mjs";
|
|
5
|
-
import { AdminTransactionType as a } from "../../types/admin.types.mjs";
|
|
6
|
-
import { DepositAndWithdrawPhase as o } from "../../types/scheduled-transactions.types.mjs";
|
|
2
|
+
import { isTronLike as t } from "../../constants/chains.constants.mjs";
|
|
3
|
+
import { DepositAndWithdrawPhase as n } from "../../types/scheduled-transactions.types.mjs";
|
|
7
4
|
import "../../types/index.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { getOnChainUtxosFromReceipt as h } from "../../functions/utils/getUtxosFromReceipt.utils.mjs";
|
|
16
|
-
import { waitForEthereumTransactionConfirmation as ee } from "../../functions/utils/tx-confirmation.utils.mjs";
|
|
17
|
-
import { constructZkProof as g } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
|
|
18
|
-
import { transactCallDirect as _ } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
|
|
19
|
-
import { transactCallDirectTron as v } from "../../functions/web3/functionCalls/transactCallDirectTron.mjs";
|
|
20
|
-
import { safeUpdateDepositAndWithdrawStatus as y, updateDepositAndWithdrawStatus as b } from "../../API/deposit-and-withdraw-status-calls.mjs";
|
|
21
|
-
import { ethers as te } from "ethers";
|
|
5
|
+
import { evmHexToTronBase58Address as r } from "../../functions/utils/tron.utils.mjs";
|
|
6
|
+
import { getOnChainUtxosFromReceipt as i } from "../../functions/utils/getUtxosFromReceipt.utils.mjs";
|
|
7
|
+
import { waitForEthereumTransactionConfirmation as a } from "../../functions/utils/tx-confirmation.utils.mjs";
|
|
8
|
+
import { transactCallDirect as o } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
|
|
9
|
+
import { transactCallDirectTron as s } from "../../functions/web3/functionCalls/transactCallDirectTron.mjs";
|
|
10
|
+
import { safeUpdateDepositAndWithdrawStatus as c, updateDepositAndWithdrawStatus as l } from "../../API/deposit-and-withdraw-status-calls.mjs";
|
|
11
|
+
import { prepareDepositOnChainUtxosZkProof as u } from "./prepareDepositOnChainUtxosZkProof.mjs";
|
|
22
12
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.ts
|
|
23
|
-
var
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
}, S = async (u, d, S, C, w, T, E, D = !0) => {
|
|
34
|
-
let O = n(d), k = S.erc20TokenAddress, A = c(await u.getEthereumAddressByChain(d)), j = C.map((e) => e + f(e, T)), M = j.reduce((e, t) => e + t, 0n), N = [k], P = [0n], F = [!0], I = te.AbiCoder.defaultAbiCoder().encode(["uint256[]"], [j]), { hinkalWrapperAddress: L, hinkalWrapperABI: R, depositOnChainUtxosExternalActionAddress: z, depositOnChainUtxosExternalActionABI: B } = r[d].contractData;
|
|
35
|
-
if (!L || !R || !z || !B) throw Error("contract data not set in networkRegistry");
|
|
36
|
-
let [{ patchAccessTokenMerkleTree: V, signatureData: H }, { inputUtxosArray: U, outputUtxosArray: W }] = await Promise.all([m(u, d, N, P, A), x(u, d, N, P)]), { zkCallData: G, circomData: K, dimData: q } = await g(u.merkleTreeHinkalByChain[d], u.merkleTreeAccessTokenByChain[d], U, W, u.userKeys, `swapperM1x${U[0].length}x1`, t.DepositOnChainUtxos, z, I, u.generateProofRemotely, i, d, F, void 0, void 0, V, void 0, void 0, void 0, u.getContractWithFetcher(d, e.HinkalHelperContract), H, L), J = (await b({
|
|
37
|
-
chainId: d,
|
|
38
|
-
hashedEthereumAddress: E,
|
|
39
|
-
phase: o.BEFORE_DEPOSIT
|
|
40
|
-
})).id ?? void 0, Y;
|
|
41
|
-
if (O) {
|
|
42
|
-
let e = u.getTronWeb();
|
|
43
|
-
Y = await v(u, d, M, S, G, K, q, e.contract(B, l(z)), e.contract(R, l(L)), D);
|
|
13
|
+
var d = async (d, f, p, m, h, g, _, v = !0) => {
|
|
14
|
+
let y = t(f), b = p.erc20TokenAddress, { zkCallData: x, circomData: S, dimData: C, totalAmount: w, utxoAmounts: T, hinkalWrapperAddress: E, hinkalWrapperABI: D, depositOnChainUtxosExternalActionAddress: O, depositOnChainUtxosExternalActionABI: k } = await u(d, f, p, m, g), A = (await l({
|
|
15
|
+
chainId: f,
|
|
16
|
+
hashedEthereumAddress: _,
|
|
17
|
+
phase: n.BEFORE_DEPOSIT
|
|
18
|
+
})).id ?? void 0, j;
|
|
19
|
+
if (y) {
|
|
20
|
+
let e = d.getTronWeb();
|
|
21
|
+
j = await s(d, f, w, p, x, S, C, e.contract(k, r(O)), e.contract(D, r(E)), v);
|
|
44
22
|
} else {
|
|
45
|
-
let t =
|
|
46
|
-
|
|
23
|
+
let t = d.getContractWithSigner(f, e.HinkalWrapper);
|
|
24
|
+
j = (await o(d, f, w, p, x, S, C, d.getContractWithSigner(f, e.DepositOnChainUtxos), t, v)).hash;
|
|
47
25
|
}
|
|
48
|
-
if (!
|
|
49
|
-
let
|
|
50
|
-
await
|
|
51
|
-
id:
|
|
52
|
-
chainId:
|
|
53
|
-
hashedEthereumAddress:
|
|
54
|
-
phase:
|
|
55
|
-
depositTxHash:
|
|
26
|
+
if (!j) throw Error("Deposit transaction hash not found");
|
|
27
|
+
let M = await a(f, j);
|
|
28
|
+
await c({
|
|
29
|
+
id: A,
|
|
30
|
+
chainId: f,
|
|
31
|
+
hashedEthereumAddress: _,
|
|
32
|
+
phase: n.AFTER_DEPOSIT,
|
|
33
|
+
depositTxHash: j
|
|
56
34
|
});
|
|
57
|
-
let
|
|
58
|
-
if (
|
|
59
|
-
let
|
|
60
|
-
return
|
|
61
|
-
let n =
|
|
35
|
+
let N = i(M, d, f, b);
|
|
36
|
+
if (N.length === 0) throw Error("No UTXOs found in deposit transaction. Check contract address and ABI.");
|
|
37
|
+
let P = [], F = [...N];
|
|
38
|
+
return h.forEach((e, t) => {
|
|
39
|
+
let n = T[t], r = F.find((e) => e.amount === n);
|
|
62
40
|
if (!r) throw Error(`Could not find newly created UTXO with amount ${n} for recipient ${e}.`);
|
|
63
|
-
|
|
41
|
+
P.push({
|
|
64
42
|
recipientAddress: e,
|
|
65
43
|
utxo: r
|
|
66
44
|
});
|
|
67
|
-
let i =
|
|
68
|
-
|
|
69
|
-
}),
|
|
70
|
-
userDepositedUtxos:
|
|
71
|
-
statusId:
|
|
72
|
-
depositTxHash:
|
|
45
|
+
let i = F.indexOf(r);
|
|
46
|
+
F.splice(i, 1);
|
|
47
|
+
}), {
|
|
48
|
+
userDepositedUtxos: P,
|
|
49
|
+
statusId: A,
|
|
50
|
+
depositTxHash: j
|
|
73
51
|
};
|
|
74
52
|
};
|
|
75
53
|
//#endregion
|
|
76
|
-
export {
|
|
54
|
+
export { d as hinkalDepositOnChainUtxos };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../types/circom-data.types.cjs`),t=require(`../../types/ethereum-network.types.cjs`);require(`../../types/index.cjs`);const n=require(`../../functions/web3/functionCalls/transactCallDirect.cjs`),r=require(`./prepareDepositOnChainUtxosZkProof.cjs`);let i=require(`ethers`);var a=async(a,o,s,c,l,u)=>{let{zkCallData:d,circomData:f,dimData:p,totalAmount:m,utxoAmounts:h}=await r.prepareDepositOnChainUtxosZkProof(a,o,s,c,l,{hookData:{...e.defaultHookData,preHookMetadata:i.ethers.hexlify(i.ethers.toUtf8Bytes(JSON.stringify({orderId:u})))}}),g=a.getContractWithSigner(o,t.ContractType.HinkalWrapper);return{unsignedTx:await n.transactCallDirect(a,o,m,s,d,f,p,a.getContractWithSigner(o,t.ContractType.DepositOnChainUtxos),g,!1,!0),utxoAmounts:h}};exports.hinkalPalEvmDepositPrepare=a;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
2
|
+
import { IHinkal } from './IHinkal';
|
|
3
|
+
import { ERC20Token } from '../../types';
|
|
4
|
+
import { FeeStructure } from '../../types/hinkal.types';
|
|
5
|
+
export type PalEvmDepositPrepareResult = {
|
|
6
|
+
unsignedTx: ethers.TransactionRequest;
|
|
7
|
+
utxoAmounts: bigint[];
|
|
8
|
+
};
|
|
9
|
+
export declare const hinkalPalEvmDepositPrepare: (hinkal: IHinkal, chainId: number, token: ERC20Token, recipientAmounts: bigint[], feeStructure: FeeStructure, orderId: string) => Promise<PalEvmDepositPrepareResult>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defaultHookData as e } from "../../types/circom-data.types.mjs";
|
|
2
|
+
import { ContractType as t } from "../../types/ethereum-network.types.mjs";
|
|
3
|
+
import "../../types/index.mjs";
|
|
4
|
+
import { transactCallDirect as n } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
|
|
5
|
+
import { prepareDepositOnChainUtxosZkProof as r } from "./prepareDepositOnChainUtxosZkProof.mjs";
|
|
6
|
+
import { ethers as i } from "ethers";
|
|
7
|
+
//#region libs/shared/common/src/data-structures/Hinkal/hinkalPalEvmDeposit.ts
|
|
8
|
+
var a = async (a, o, s, c, l, u) => {
|
|
9
|
+
let { zkCallData: d, circomData: f, dimData: p, totalAmount: m, utxoAmounts: h } = await r(a, o, s, c, l, { hookData: {
|
|
10
|
+
...e,
|
|
11
|
+
preHookMetadata: i.hexlify(i.toUtf8Bytes(JSON.stringify({ orderId: u })))
|
|
12
|
+
} }), g = a.getContractWithSigner(o, t.HinkalWrapper);
|
|
13
|
+
return {
|
|
14
|
+
unsignedTx: await n(a, o, m, s, d, f, p, a.getContractWithSigner(o, t.DepositOnChainUtxos), g, !1, !0),
|
|
15
|
+
utxoAmounts: h
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { a as hinkalPalEvmDepositPrepare };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../functions/utils/fees.utils.cjs`),t=require(`../../functions/utils/solana-memo.cjs`),n=require(`./hinkalSolanaDepositAndWithdraw.cjs`);let r=require(`@solana/web3.js`);var i=async(i,a,o,s,c,l)=>{let u=s.map(t=>t+e.calculateTotalFee(t,c)),d=n.buildMultiPaymentDepositSetup(i,a,o,u),f=await n.buildMultiPaymentDepositBuilder(d).instruction(),p=t.buildOrderIdMemoInstruction(l),{blockhash:m}=await d.program.provider.connection.getLatestBlockhash();return{unsignedTx:new r.VersionedTransaction(new r.TransactionMessage({payerKey:d.publicKey,recentBlockhash:m,instructions:[f,p]}).compileToV0Message()),utxoAmounts:u}};exports.hinkalPalSolanaDepositPrepare=i;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VersionedTransaction } from '@solana/web3.js';
|
|
2
|
+
import { FeeStructure } from '../../types/hinkal.types';
|
|
3
|
+
import { ERC20Token } from '../../types/token.types';
|
|
4
|
+
import { IHinkal } from './IHinkal';
|
|
5
|
+
export type PalSolanaDepositPrepareResult = {
|
|
6
|
+
unsignedTx: VersionedTransaction;
|
|
7
|
+
utxoAmounts: bigint[];
|
|
8
|
+
};
|
|
9
|
+
export declare const hinkalPalSolanaDepositPrepare: (hinkal: IHinkal, chainId: number, token: ERC20Token, recipientAmounts: bigint[], feeStructure: FeeStructure, orderId: string) => Promise<PalSolanaDepositPrepareResult>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { calculateTotalFee as e } from "../../functions/utils/fees.utils.mjs";
|
|
2
|
+
import { buildOrderIdMemoInstruction as t } from "../../functions/utils/solana-memo.mjs";
|
|
3
|
+
import { buildMultiPaymentDepositBuilder as n, buildMultiPaymentDepositSetup as r } from "./hinkalSolanaDepositAndWithdraw.mjs";
|
|
4
|
+
import { TransactionMessage as i, VersionedTransaction as a } from "@solana/web3.js";
|
|
5
|
+
//#region libs/shared/common/src/data-structures/Hinkal/hinkalPalSolanaDepositPrepare.ts
|
|
6
|
+
var o = async (o, s, c, l, u, d) => {
|
|
7
|
+
let f = l.map((t) => t + e(t, u)), p = r(o, s, c, f), m = await n(p).instruction(), h = t(d), { blockhash: g } = await p.program.provider.connection.getLatestBlockhash();
|
|
8
|
+
return {
|
|
9
|
+
unsignedTx: new a(new i({
|
|
10
|
+
payerKey: p.publicKey,
|
|
11
|
+
recentBlockhash: g,
|
|
12
|
+
instructions: [m, h]
|
|
13
|
+
}).compileToV0Message()),
|
|
14
|
+
utxoAmounts: f
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { o as hinkalPalSolanaDepositPrepare };
|