@hinkal/common 0.2.31 → 0.2.33
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
package/functions/index.mjs
CHANGED
|
@@ -2,18 +2,20 @@ import "./utils/serialize.utils.mjs";
|
|
|
2
2
|
import "./utils/get-signature-header.mjs";
|
|
3
3
|
import "./utils/caseInsensitive.utils.mjs";
|
|
4
4
|
import "./utils/addresses.mjs";
|
|
5
|
+
import "./utils/auth.utils.mjs";
|
|
5
6
|
import "./kyc/openDefaultPassportWindow.mjs";
|
|
6
7
|
import "./web3/etherFunctions.mjs";
|
|
7
8
|
import "./utils/amounts.utils.mjs";
|
|
8
9
|
import "./utils/erc20tokenFunctions.mjs";
|
|
10
|
+
import "./utils/bytes32.utils.mjs";
|
|
9
11
|
import "./utils/time.utils.mjs";
|
|
10
|
-
import "./
|
|
11
|
-
import "./web3/functionCalls/accessTokenCalls.mjs";
|
|
12
|
+
import "./utils/bit.operations.mjs";
|
|
12
13
|
import "./utils/upToDateState.mjs";
|
|
13
14
|
import "./utils/getDataFromTransaction.mjs";
|
|
14
|
-
import "./utils/getContractAddress.mjs";
|
|
15
15
|
import "./utils/cacheFunctions.mjs";
|
|
16
|
+
import "./utils/encryptInputForEnclave.mjs";
|
|
16
17
|
import "./utils/solanaMint.utils.mjs";
|
|
18
|
+
import "./utils/customEnclaveFunctionsRegister.mjs";
|
|
17
19
|
import "./utils/tron.utils.mjs";
|
|
18
20
|
import "./web3/events/getInputUtxoAndBalance.mjs";
|
|
19
21
|
import "./utils/string.utils.mjs";
|
|
@@ -23,8 +25,10 @@ import "./web3/events/getShieldedBalance.mjs";
|
|
|
23
25
|
import "./pre-transaction/outputUtxoProcessing.mjs";
|
|
24
26
|
import "./utils/external-action.utils.mjs";
|
|
25
27
|
import "./snarkjs/common.snarkjs.mjs";
|
|
28
|
+
import "./pre-transaction/solana.mjs";
|
|
29
|
+
import "./snarkjs/signedMessageHash.mjs";
|
|
26
30
|
import "./snarkjs/generateZkProof.mjs";
|
|
27
|
-
import "./utils/
|
|
31
|
+
import "./utils/serialize-utxos.utils.mjs";
|
|
28
32
|
import "./utils/create-provider.mjs";
|
|
29
33
|
import "./utils/requireEnv.mjs";
|
|
30
34
|
import "./utils/resolve-sync.utils.mjs";
|
|
@@ -32,10 +36,9 @@ import "./utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
|
32
36
|
import "./pre-transaction/interaction-to-action.mjs";
|
|
33
37
|
import "./pre-transaction/process-gas-estimates.mjs";
|
|
34
38
|
import "./pre-transaction/getFlatFees.mjs";
|
|
35
|
-
import "./utils/processUseApprovalUtxoData.mjs";
|
|
36
|
-
import "./pre-transaction/outputApprovalDataProcessing.mjs";
|
|
37
39
|
import "./pre-transaction/getVolatileTransferAmount.mjs";
|
|
38
40
|
import "./pre-transaction/constructAdminData.mjs";
|
|
41
|
+
import "./pre-transaction/calculateSolanaNullifierCount.mjs";
|
|
39
42
|
import "./pre-transaction/addressTableLookup.mjs";
|
|
40
43
|
import "./pre-transaction/solana-public-signals.mjs";
|
|
41
44
|
import "./pre-transaction/convert-okx-instructions.mjs";
|
|
@@ -43,15 +46,13 @@ import "./web3/getSolanaPriorityFee.mjs";
|
|
|
43
46
|
import "./utils/process.utils.mjs";
|
|
44
47
|
import "./pre-transaction/sendV0Transaction.mjs";
|
|
45
48
|
import "./pre-transaction/store-proof.mjs";
|
|
46
|
-
import "./utils/bytes32.utils.mjs";
|
|
47
49
|
import "./pre-transaction/sendInitNullifiersTransaction.mjs";
|
|
48
|
-
import "./pre-transaction/initTokenLimitIfNeeded.mjs";
|
|
49
50
|
import "./pre-transaction/recipientUtxoProcessing.mjs";
|
|
50
51
|
import "./pre-transaction/store-instructions.mjs";
|
|
51
52
|
import "./pre-transaction/ensureAmountChanges.mjs";
|
|
52
53
|
import "./pre-transaction/getFeeStructure.mjs";
|
|
53
|
-
import "./pre-transaction/getKycAndSignatureData.mjs";
|
|
54
54
|
import "./pre-transaction/waitForDepositedUtxosInMerkleTree.mjs";
|
|
55
|
+
import "./pre-transaction/buildCommitmentValidationData.mjs";
|
|
55
56
|
import "./pre-transaction/index.mjs";
|
|
56
57
|
import "./utils/evmNetworkFunctions.mjs";
|
|
57
58
|
import "./utils/userAgent.mjs";
|
|
@@ -72,30 +73,35 @@ import "./utils/inLogicMetadata.mjs";
|
|
|
72
73
|
import "./utils/networks.utils.mjs";
|
|
73
74
|
import "./utils/is-valid-url.mjs";
|
|
74
75
|
import "./utils/postToOffscreen.mjs";
|
|
76
|
+
import "./utils/solanaSendPreflight.utils.mjs";
|
|
75
77
|
import "./utils/prepareHinkal.mjs";
|
|
78
|
+
import "./utils/getContractAddress.mjs";
|
|
76
79
|
import "./utils/getUtxosFromReceipt.utils.mjs";
|
|
77
80
|
import "./utils/getUtxosFromReceiptSolana.mjs";
|
|
81
|
+
import "./utils/fees.utils.mjs";
|
|
78
82
|
import "./utils/proxyAvatar.utils.mjs";
|
|
79
83
|
import "./utils/validateUsername.mjs";
|
|
80
|
-
import "./utils/serialize-utxos.utils.mjs";
|
|
81
84
|
import "./utils/enclave-utxo-storage.mjs";
|
|
82
85
|
import "./utils/enclave-signature-storage.mjs";
|
|
83
86
|
import "./utils/tx-confirmation.utils.mjs";
|
|
84
87
|
import "./utils/buildClaimableDepositPlan.mjs";
|
|
88
|
+
import "./utils/pay-routing.utils.mjs";
|
|
89
|
+
import "./utils/formatter.mjs";
|
|
85
90
|
import "./utils/tronSimulation.utils.mjs";
|
|
86
91
|
import "./utils/getSignerFromContract.mjs";
|
|
92
|
+
import "./utils/deposit-claimable.utils.mjs";
|
|
93
|
+
import "./utils/transfer-claimable.utils.mjs";
|
|
87
94
|
import "./utils/getWalletGroupKey.utils.mjs";
|
|
95
|
+
import "./web3/events/balanceChangedHandler.mjs";
|
|
96
|
+
import "./utils/dispatchBalanceRefreshes.mjs";
|
|
97
|
+
import "./utils/lifi.utils.mjs";
|
|
98
|
+
import "./utils/enclave-recipient-info-storage.mjs";
|
|
99
|
+
import "./utils/solana-memo.mjs";
|
|
100
|
+
import "./utils/mnemonics.mjs";
|
|
88
101
|
import "./utils/index.mjs";
|
|
89
102
|
import "./snarkjs/fetchOnChainRootHashes.mjs";
|
|
90
|
-
import "./snarkjs/constructGeneralZkProof.mjs";
|
|
91
103
|
import "./private-wallet/emporium.helpers.mjs";
|
|
92
|
-
import "./snarkjs/
|
|
93
|
-
import "./snarkjs/constructSolanaZkProof.mjs";
|
|
94
|
-
import "./snarkjs/index.mjs";
|
|
95
|
-
import "./kyc/passportHelper.mjs";
|
|
96
|
-
import "./web3/events/balanceChangedHandler.mjs";
|
|
97
|
-
import "./web3/events/balanceChangedCustomHandler.mjs";
|
|
98
|
-
import "./web3/events/getApprovedBalance.mjs";
|
|
104
|
+
import "./snarkjs/constructGeneralZkProof.mjs";
|
|
99
105
|
import "./web3/events/getTransactionLogEvents.mjs";
|
|
100
106
|
import "./web3/uniswapAPI.mjs";
|
|
101
107
|
import "./web3/odosAPI.mjs";
|
|
@@ -107,9 +113,12 @@ import "./web3/getTokenHolder.mjs";
|
|
|
107
113
|
import "./web3/EIP-712.mjs";
|
|
108
114
|
import "./web3/signAndSendSerializedTransaction.mjs";
|
|
109
115
|
import "./web3/connectors.utils.mjs";
|
|
110
|
-
import "./web3/tron-wagmi-adapter.mjs";
|
|
111
116
|
import "./web3/crypto.mjs";
|
|
112
117
|
import "./web3/index.mjs";
|
|
118
|
+
import "./snarkjs/constructSolanaZkProof.mjs";
|
|
119
|
+
import "./snarkjs/verifyCommitmentValidationData.mjs";
|
|
120
|
+
import "./snarkjs/index.mjs";
|
|
121
|
+
import "./kyc/passportHelper.mjs";
|
|
113
122
|
import "./kyc/checkTokenLimitsUSD.mjs";
|
|
114
123
|
import "./kyc/index.mjs";
|
|
115
124
|
import "./private-wallet/opProducer.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../API/getTokenPrice.cjs`)
|
|
1
|
+
const e=require(`../../API/getTokenPrice.cjs`),t=require(`../../constants/kyc.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`../web3/etherFunctions.cjs`),i=require(`../utils/erc20tokenFunctions.cjs`);require(`../../constants/index.cjs`),require(`../../API/index.cjs`),require(`../../error-handling/index.cjs`),require(`../utils/index.cjs`),require(`../web3/index.cjs`);var a=async(a,o,s)=>{if(!o.length||!s.length)return!1;let c=o.map(e=>i.getERC20Token(e,a)),l=[];try{l=(await e.getTokenPrices(a,o)).prices||[]}catch{throw Error(n.transactionErrorCodes.KYC_PRICE_FETCH_FAILED)}for(let e=0;e<o.length;e++){let n=c[e],i=s[e],a=l[e];if(!n||i===0n||!a)continue;let o=r.getAmountInToken(n,i);if(Number(o)*a>t.KYC_LIMIT)return!0}return!1};exports.checkTokenLimitsUSD=a;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { getTokenPrices as e } from "../../API/getTokenPrice.mjs";
|
|
2
|
-
import "../../constants/kyc.constants.mjs";
|
|
3
|
-
import { transactionErrorCodes as
|
|
4
|
-
import { getAmountInToken as
|
|
5
|
-
import { getERC20Token as
|
|
2
|
+
import { KYC_LIMIT as t } from "../../constants/kyc.constants.mjs";
|
|
3
|
+
import { transactionErrorCodes as n } from "../../error-handling/error-codes.constants.mjs";
|
|
4
|
+
import { getAmountInToken as r } from "../web3/etherFunctions.mjs";
|
|
5
|
+
import { getERC20Token as i } from "../utils/erc20tokenFunctions.mjs";
|
|
6
6
|
import "../../constants/index.mjs";
|
|
7
7
|
import "../../API/index.mjs";
|
|
8
8
|
import "../../error-handling/index.mjs";
|
|
9
9
|
import "../utils/index.mjs";
|
|
10
10
|
import "../web3/index.mjs";
|
|
11
11
|
//#region libs/shared/common/src/functions/kyc/checkTokenLimitsUSD.ts
|
|
12
|
-
var
|
|
13
|
-
if (!
|
|
14
|
-
let
|
|
12
|
+
var a = async (a, o, s) => {
|
|
13
|
+
if (!o.length || !s.length) return !1;
|
|
14
|
+
let c = o.map((e) => i(e, a)), l = [];
|
|
15
15
|
try {
|
|
16
|
-
|
|
16
|
+
l = (await e(a, o)).prices || [];
|
|
17
17
|
} catch {
|
|
18
|
-
throw Error(
|
|
18
|
+
throw Error(n.KYC_PRICE_FETCH_FAILED);
|
|
19
19
|
}
|
|
20
|
-
for (let e = 0; e <
|
|
21
|
-
let
|
|
22
|
-
if (!
|
|
23
|
-
let
|
|
24
|
-
if (Number(
|
|
20
|
+
for (let e = 0; e < o.length; e++) {
|
|
21
|
+
let n = c[e], i = s[e], a = l[e];
|
|
22
|
+
if (!n || i === 0n || !a) continue;
|
|
23
|
+
let o = r(n, i);
|
|
24
|
+
if (Number(o) * a > t) return !0;
|
|
25
25
|
}
|
|
26
26
|
return !1;
|
|
27
27
|
};
|
|
28
28
|
//#endregion
|
|
29
|
-
export {
|
|
29
|
+
export { a as checkTokenLimitsUSD };
|
package/functions/kyc/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./openDefaultPassportWindow.cjs`),require(
|
|
1
|
+
require(`./openDefaultPassportWindow.cjs`),require(`./passportHelper.cjs`),require(`./checkTokenLimitsUSD.cjs`);
|
package/functions/kyc/index.d.ts
CHANGED
package/functions/kyc/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/protocol.constants.cjs`),t=require(`../utils/time.utils.cjs`);let n=require(`@solana/web3.js`);var r=async(e,t)=>{if(!t)return;let r=[...new Set(t)];return Promise.all(r.map(async t=>{let r=(await e.connection.getAddressLookupTable(new n.PublicKey(t))).value;if(!r)throw Error(`failed to fetch lookup table ${t}`);return r}))},
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/protocol.constants.cjs`),t=require(`../utils/time.utils.cjs`);let n=require(`@solana/web3.js`);var r=30,i=async(e,t)=>{if(!t)return;let r=[...new Set(t)];return Promise.all(r.map(async t=>{let r=(await e.connection.getAddressLookupTable(new n.PublicKey(t))).value;if(!r)throw Error(`failed to fetch lookup table ${t}`);return r}))},a=async(i,a,o)=>{let[s,{blockhash:c}]=await Promise.all([i.connection.getSlot(`finalized`),i.connection.getLatestBlockhash(`finalized`)]),l=s,[u,d]=n.AddressLookupTableProgram.createLookupTable({authority:o.publicKey,payer:o.publicKey,recentSlot:l}),f=n.ComputeBudgetProgram.setComputeUnitPrice({microLamports:e.MAX_MICRO_LAMPORTS_PER_CU}),p=new n.Transaction().add(f).add(u);p.recentBlockhash=c,p.feePayer=o.publicKey,p.sign(o),await(0,n.sendAndConfirmTransaction)(i.connection,p,[o],{commitment:`confirmed`});for(let e=0;e<20&&!(await i.connection.getAddressLookupTable(d,{commitment:`confirmed`})).value;e+=1){if(e===19)throw Error(`Lookup table ${d.toBase58()} not visible after creation`);await t.waitLittle(500)}for(let e=0;e<a.length;e+=r){let t=a.slice(e,e+r),s=n.AddressLookupTableProgram.extendLookupTable({payer:o.publicKey,authority:o.publicKey,lookupTable:d,addresses:t}),{blockhash:c}=await i.connection.getLatestBlockhash(),l=new n.Transaction().add(s);l.recentBlockhash=c,l.feePayer=o.publicKey,l.sign(o),await(0,n.sendAndConfirmTransaction)(i.connection,l,[o],{commitment:`confirmed`})}return d};exports.createAndExtendAddressLookupTable=a,exports.getAddressLookupTableAccounts=i;
|
|
@@ -2,7 +2,7 @@ import { MAX_MICRO_LAMPORTS_PER_CU as e } from "../../constants/protocol.constan
|
|
|
2
2
|
import { waitLittle as t } from "../utils/time.utils.mjs";
|
|
3
3
|
import { AddressLookupTableProgram as n, ComputeBudgetProgram as r, PublicKey as i, Transaction as a, sendAndConfirmTransaction as o } from "@solana/web3.js";
|
|
4
4
|
//#region libs/shared/common/src/functions/pre-transaction/addressTableLookup.ts
|
|
5
|
-
var s = async (e, t) => {
|
|
5
|
+
var s = 30, c = async (e, t) => {
|
|
6
6
|
if (!t) return;
|
|
7
7
|
let n = [...new Set(t)];
|
|
8
8
|
return Promise.all(n.map(async (t) => {
|
|
@@ -10,24 +10,27 @@ var s = async (e, t) => {
|
|
|
10
10
|
if (!n) throw Error(`failed to fetch lookup table ${t}`);
|
|
11
11
|
return n;
|
|
12
12
|
}));
|
|
13
|
-
},
|
|
14
|
-
let [
|
|
15
|
-
authority:
|
|
16
|
-
payer:
|
|
17
|
-
recentSlot:
|
|
18
|
-
}),
|
|
19
|
-
|
|
20
|
-
for (let e = 0; e < 20 && !(await i.connection.getAddressLookupTable(
|
|
21
|
-
if (e === 19) throw Error(`Lookup table ${
|
|
13
|
+
}, l = async (i, c, l) => {
|
|
14
|
+
let [u, { blockhash: d }] = await Promise.all([i.connection.getSlot("finalized"), i.connection.getLatestBlockhash("finalized")]), f = u, [p, m] = n.createLookupTable({
|
|
15
|
+
authority: l.publicKey,
|
|
16
|
+
payer: l.publicKey,
|
|
17
|
+
recentSlot: f
|
|
18
|
+
}), h = r.setComputeUnitPrice({ microLamports: e }), g = new a().add(h).add(p);
|
|
19
|
+
g.recentBlockhash = d, g.feePayer = l.publicKey, g.sign(l), await o(i.connection, g, [l], { commitment: "confirmed" });
|
|
20
|
+
for (let e = 0; e < 20 && !(await i.connection.getAddressLookupTable(m, { commitment: "confirmed" })).value; e += 1) {
|
|
21
|
+
if (e === 19) throw Error(`Lookup table ${m.toBase58()} not visible after creation`);
|
|
22
22
|
await t(500);
|
|
23
23
|
}
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
for (let e = 0; e < c.length; e += s) {
|
|
25
|
+
let t = c.slice(e, e + s), r = n.extendLookupTable({
|
|
26
|
+
payer: l.publicKey,
|
|
27
|
+
authority: l.publicKey,
|
|
28
|
+
lookupTable: m,
|
|
29
|
+
addresses: t
|
|
30
|
+
}), { blockhash: u } = await i.connection.getLatestBlockhash(), d = new a().add(r);
|
|
31
|
+
d.recentBlockhash = u, d.feePayer = l.publicKey, d.sign(l), await o(i.connection, d, [l], { commitment: "confirmed" });
|
|
32
|
+
}
|
|
33
|
+
return m;
|
|
31
34
|
};
|
|
32
35
|
//#endregion
|
|
33
|
-
export {
|
|
36
|
+
export { l as createAndExtendAddressLookupTable, c as getAddressLookupTableAccounts };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../data-structures/crypto-keys/keys.cjs`),n=require(`../utils/solanaMint.utils.cjs`),r=require(`../snarkjs/common.snarkjs.cjs`),i=require(`../../webworker/worker.registry.cjs`),a=require(`../../webworker/performTaskWithWorker.cjs`),o=require(`../snarkjs/generateZkProof.cjs`),s=require(`../../webworker/zkProofWorker/zkProofWorker.types.cjs`);var c=async(c,l,u,d)=>{let f=e.isSolanaLike(c),p=d.map(e=>e.map(e=>e.amount.toString())),m=d.map(e=>e.map(e=>e.timeStamp)),h=d.map(e=>e.map(e=>r.getUtxoCircuitInRandomization(e))),g=d.map(e=>e.map(e=>e.getConstructableParams())),_=d.map(e=>e.map(e=>e.amount===0n?`0`:BigInt(e.getCommitment()).toString())),v=await a.performTaskWithWorker({type:i.WorkerVariant.ZKProof,payload:{type:s.ZKProofWorkerActionType.BUILD_IN_NULLIFIERS,data:{inputUtxosSerialized:g}}}),y=l.getShieldedPrivateKey(),b=l.getSpendingKeyPair().pubSpendingBJJPoint,x=f?u.map(e=>{let{compressedAddress:t}=n.formatMintAddress(e);return BigInt(t).toString()}):u.map(e=>BigInt(e).toString());d.forEach((e,n)=>{e.forEach((e,r)=>{let i=e.getStealthAddress(),a=e.spendingPublicKey??b,o=e.isNewStyle&&e.H0?t.UserKeys.getStealthAddressNewStyle(e.H0,y,a):t.UserKeys.getStealthAddress(BigInt(e.randomization),y);if(BigInt(i).toString()!==BigInt(o).toString())throw Error(`Commitment validation stealth mismatch at tokenIdx=${n}, utxoIdx=${r}`)})});let S={nullifyingPrivateKey:y,spendingPublicKey:b,erc20TokenAddresses:x,inAmounts:p,inRandomizations:h,inH0Ax:d.map(e=>e.map(e=>r.getUtxoCircuitH0Coords(e)[0].toString())),inH0Ay:d.map(e=>e.map(e=>r.getUtxoCircuitH0Coords(e)[1].toString())),isNewStyle:d.map(e=>e.map(e=>!!e.isNewStyle)),inTimeStamps:m,inCommitments:_,inNullifiers:v};if(!u.length||!d[0]?.length)return;let{zkCallData:C}=await o.generateZkProof(c,`commitmentCalculator${u.length}x${d[0].length}`,S,!1);if(!Array.isArray(C?.[0])||!Array.isArray(C?.[1])||!Array.isArray(C?.[2]))throw Error(`Invalid zkCallData shape for commitment validation`);return{tokenAddresses:x,inAmounts:p,inTimeStamps:m,inRandomizations:h,inCommitments:_,inNullifiers:v,proof:{a:C[0],b:C[1],c:C[2]}}};exports.buildCommitmentValidationData=c;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { UserKeys } from '../../data-structures/crypto-keys/keys';
|
|
2
|
+
import { Utxo } from '../../data-structures/utxo/Utxo';
|
|
3
|
+
import { CommitmentValidationDataType } from '../../types';
|
|
4
|
+
export declare const buildCommitmentValidationData: (chainId: number, userKeys: UserKeys, erc20Addresses: string[], inputUtxosArray: Utxo[][]) => Promise<CommitmentValidationDataType | undefined>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { isSolanaLike as e } from "../../constants/chains.constants.mjs";
|
|
2
|
+
import { UserKeys as t } from "../../data-structures/crypto-keys/keys.mjs";
|
|
3
|
+
import { formatMintAddress as n } from "../utils/solanaMint.utils.mjs";
|
|
4
|
+
import { getUtxoCircuitH0Coords as r, getUtxoCircuitInRandomization as i } from "../snarkjs/common.snarkjs.mjs";
|
|
5
|
+
import { WorkerVariant as a } from "../../webworker/worker.registry.mjs";
|
|
6
|
+
import { performTaskWithWorker as o } from "../../webworker/performTaskWithWorker.mjs";
|
|
7
|
+
import { generateZkProof as s } from "../snarkjs/generateZkProof.mjs";
|
|
8
|
+
import { ZKProofWorkerActionType as c } from "../../webworker/zkProofWorker/zkProofWorker.types.mjs";
|
|
9
|
+
//#region libs/shared/common/src/functions/pre-transaction/buildCommitmentValidationData.ts
|
|
10
|
+
var l = async (l, u, d, f) => {
|
|
11
|
+
let p = e(l), m = f.map((e) => e.map((e) => e.amount.toString())), h = f.map((e) => e.map((e) => e.timeStamp)), g = f.map((e) => e.map((e) => i(e))), _ = f.map((e) => e.map((e) => e.getConstructableParams())), v = f.map((e) => e.map((e) => e.amount === 0n ? "0" : BigInt(e.getCommitment()).toString())), y = await o({
|
|
12
|
+
type: a.ZKProof,
|
|
13
|
+
payload: {
|
|
14
|
+
type: c.BUILD_IN_NULLIFIERS,
|
|
15
|
+
data: { inputUtxosSerialized: _ }
|
|
16
|
+
}
|
|
17
|
+
}), b = u.getShieldedPrivateKey(), x = u.getSpendingKeyPair().pubSpendingBJJPoint, S = p ? d.map((e) => {
|
|
18
|
+
let { compressedAddress: t } = n(e);
|
|
19
|
+
return BigInt(t).toString();
|
|
20
|
+
}) : d.map((e) => BigInt(e).toString());
|
|
21
|
+
f.forEach((e, n) => {
|
|
22
|
+
e.forEach((e, r) => {
|
|
23
|
+
let i = e.getStealthAddress(), a = e.spendingPublicKey ?? x, o = e.isNewStyle && e.H0 ? t.getStealthAddressNewStyle(e.H0, b, a) : t.getStealthAddress(BigInt(e.randomization), b);
|
|
24
|
+
if (BigInt(i).toString() !== BigInt(o).toString()) throw Error(`Commitment validation stealth mismatch at tokenIdx=${n}, utxoIdx=${r}`);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
let C = {
|
|
28
|
+
nullifyingPrivateKey: b,
|
|
29
|
+
spendingPublicKey: x,
|
|
30
|
+
erc20TokenAddresses: S,
|
|
31
|
+
inAmounts: m,
|
|
32
|
+
inRandomizations: g,
|
|
33
|
+
inH0Ax: f.map((e) => e.map((e) => r(e)[0].toString())),
|
|
34
|
+
inH0Ay: f.map((e) => e.map((e) => r(e)[1].toString())),
|
|
35
|
+
isNewStyle: f.map((e) => e.map((e) => !!e.isNewStyle)),
|
|
36
|
+
inTimeStamps: h,
|
|
37
|
+
inCommitments: v,
|
|
38
|
+
inNullifiers: y
|
|
39
|
+
};
|
|
40
|
+
if (!d.length || !f[0]?.length) return;
|
|
41
|
+
let { zkCallData: w } = await s(l, `commitmentCalculator${d.length}x${f[0].length}`, C, !1);
|
|
42
|
+
if (!Array.isArray(w?.[0]) || !Array.isArray(w?.[1]) || !Array.isArray(w?.[2])) throw Error("Invalid zkCallData shape for commitment validation");
|
|
43
|
+
return {
|
|
44
|
+
tokenAddresses: S,
|
|
45
|
+
inAmounts: m,
|
|
46
|
+
inTimeStamps: h,
|
|
47
|
+
inRandomizations: g,
|
|
48
|
+
inCommitments: v,
|
|
49
|
+
inNullifiers: y,
|
|
50
|
+
proof: {
|
|
51
|
+
a: w[0],
|
|
52
|
+
b: w[1],
|
|
53
|
+
c: w[2]
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { l as buildCommitmentValidationData };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../web3/events/getShieldedBalance.cjs`),n=require(`./solana.cjs`),r=require(`../utils/create-provider.cjs`);let i=require(`@solana/web3.js`);var a=async(a,o,s,c)=>{if(!e.isSolanaLike(o)||s.length===0||c.length===0)return 0;try{let l=(await t.addPaddingToUtxos(a,o,s,c,6)).flat().filter(e=>e.amount!==0n);if(l.length===0)return 0;let{fetchRpcUrl:u,contractData:d}=e.networkRegistry[o],{originalDeployer:f,hinkalIdl:p}=d;if(!u)throw Error(`RPC URL not found for chain ID`);if(!f)throw Error(`Original deployer not found for chain ID`);if(!p)throw Error(`Hinkal IDL not found for chain ID`);let m=r.createCustomSolanaConnection(u),h=new i.PublicKey(f),g=new i.PublicKey(p.address),_=l.map(e=>n.getNullifierAccount(BigInt(e.getNullifier()),h,g));return(await m.getMultipleAccountsInfo(_)).filter(e=>e===null).length}catch(e){return(e instanceof Error?e.message:String(e)).toLowerCase().includes(`utxos limitations`)?6:0}};exports.calculateSolanaNullifierCount=a;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isSolanaLike as e, networkRegistry as t } from "../../constants/chains.constants.mjs";
|
|
2
|
+
import { addPaddingToUtxos as n } from "../web3/events/getShieldedBalance.mjs";
|
|
3
|
+
import { getNullifierAccount as r } from "./solana.mjs";
|
|
4
|
+
import { createCustomSolanaConnection as i } from "../utils/create-provider.mjs";
|
|
5
|
+
import { PublicKey as a } from "@solana/web3.js";
|
|
6
|
+
//#region libs/shared/common/src/functions/pre-transaction/calculateSolanaNullifierCount.ts
|
|
7
|
+
var o = async (o, s, c, l) => {
|
|
8
|
+
if (!e(s) || c.length === 0 || l.length === 0) return 0;
|
|
9
|
+
try {
|
|
10
|
+
let e = (await n(o, s, c, l, 6)).flat().filter((e) => e.amount !== 0n);
|
|
11
|
+
if (e.length === 0) return 0;
|
|
12
|
+
let { fetchRpcUrl: u, contractData: d } = t[s], { originalDeployer: f, hinkalIdl: p } = d;
|
|
13
|
+
if (!u) throw Error("RPC URL not found for chain ID");
|
|
14
|
+
if (!f) throw Error("Original deployer not found for chain ID");
|
|
15
|
+
if (!p) throw Error("Hinkal IDL not found for chain ID");
|
|
16
|
+
let m = i(u), h = new a(f), g = new a(p.address), _ = e.map((e) => r(BigInt(e.getNullifier()), h, g));
|
|
17
|
+
return (await m.getMultipleAccountsInfo(_)).filter((e) => e === null).length;
|
|
18
|
+
} catch (e) {
|
|
19
|
+
return (e instanceof Error ? e.message : String(e)).toLowerCase().includes("utxos limitations") ? 6 : 0;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { o as calculateSolanaNullifierCount };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../utils/addresses.cjs`);var t=(t,n,r,i,a,o)=>{if(!t)return;let s;return o&&(s={tokenIn:{symbol:o[0]
|
|
1
|
+
const e=require(`../utils/addresses.cjs`);var t=(t,n,r,i,a,o)=>{if(!t)return;let s;return o&&(s={tokenIn:{symbol:o[0]?.symbol,address:o[0]?.erc20TokenAddress.toLowerCase()},tokenOut:{symbol:o[1]?.symbol,address:o[1]?.erc20TokenAddress.toLowerCase()}}),{hashedOwner:e.hashEthereumAddress(a),chainId:n,timestamp:Date.now(),action:t,erc20TokenAddresses:r,erc20TokenAmount:i.map(String),swapPair:s}};exports.constructAdminData=t;
|
|
@@ -5,12 +5,12 @@ var t = (t, n, r, i, a, o) => {
|
|
|
5
5
|
let s;
|
|
6
6
|
return o && (s = {
|
|
7
7
|
tokenIn: {
|
|
8
|
-
symbol: o[0]
|
|
9
|
-
address: o[0]
|
|
8
|
+
symbol: o[0]?.symbol,
|
|
9
|
+
address: o[0]?.erc20TokenAddress.toLowerCase()
|
|
10
10
|
},
|
|
11
11
|
tokenOut: {
|
|
12
|
-
symbol: o[1]
|
|
13
|
-
address: o[1]
|
|
12
|
+
symbol: o[1]?.symbol,
|
|
13
|
+
address: o[1]?.erc20TokenAddress.toLowerCase()
|
|
14
14
|
}
|
|
15
15
|
}), {
|
|
16
16
|
hashedOwner: e(a),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./
|
|
1
|
+
require(`./outputUtxoProcessing.cjs`),require(`./solana.cjs`),require(`./interaction-to-action.cjs`),require(`./process-gas-estimates.cjs`),require(`./getFlatFees.cjs`),require(`./getVolatileTransferAmount.cjs`),require(`./constructAdminData.cjs`),require(`./calculateSolanaNullifierCount.cjs`),require(`./addressTableLookup.cjs`),require(`./solana-public-signals.cjs`),require(`./convert-okx-instructions.cjs`),require(`./sendV0Transaction.cjs`),require(`./store-proof.cjs`),require(`./sendInitNullifiersTransaction.cjs`),require(`./recipientUtxoProcessing.cjs`),require(`./store-instructions.cjs`),require(`./ensureAmountChanges.cjs`),require(`./getFeeStructure.cjs`),require(`./waitForDepositedUtxosInMerkleTree.cjs`),require(`./buildCommitmentValidationData.cjs`);
|
|
@@ -2,20 +2,19 @@ export * from './interaction-to-action';
|
|
|
2
2
|
export * from './outputUtxoProcessing';
|
|
3
3
|
export * from './process-gas-estimates';
|
|
4
4
|
export * from './getFlatFees';
|
|
5
|
-
export * from './outputApprovalDataProcessing';
|
|
6
5
|
export * from './getVolatileTransferAmount';
|
|
7
6
|
export * from './constructAdminData';
|
|
8
7
|
export * from './solana';
|
|
8
|
+
export * from './calculateSolanaNullifierCount';
|
|
9
9
|
export * from './addressTableLookup';
|
|
10
10
|
export * from './solana-public-signals';
|
|
11
11
|
export * from './convert-okx-instructions';
|
|
12
12
|
export * from './sendV0Transaction';
|
|
13
13
|
export * from './store-proof';
|
|
14
14
|
export * from './sendInitNullifiersTransaction';
|
|
15
|
-
export * from './initTokenLimitIfNeeded';
|
|
16
15
|
export * from './recipientUtxoProcessing';
|
|
17
16
|
export * from './store-instructions';
|
|
18
17
|
export * from './ensureAmountChanges';
|
|
19
18
|
export * from './getFeeStructure';
|
|
20
|
-
export * from './getKycAndSignatureData';
|
|
21
19
|
export * from './waitForDepositedUtxosInMerkleTree';
|
|
20
|
+
export * from './buildCommitmentValidationData';
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import "./solana.mjs";
|
|
2
1
|
import "./outputUtxoProcessing.mjs";
|
|
2
|
+
import "./solana.mjs";
|
|
3
3
|
import "./interaction-to-action.mjs";
|
|
4
4
|
import "./process-gas-estimates.mjs";
|
|
5
5
|
import "./getFlatFees.mjs";
|
|
6
|
-
import "./outputApprovalDataProcessing.mjs";
|
|
7
6
|
import "./getVolatileTransferAmount.mjs";
|
|
8
7
|
import "./constructAdminData.mjs";
|
|
8
|
+
import "./calculateSolanaNullifierCount.mjs";
|
|
9
9
|
import "./addressTableLookup.mjs";
|
|
10
10
|
import "./solana-public-signals.mjs";
|
|
11
11
|
import "./convert-okx-instructions.mjs";
|
|
12
12
|
import "./sendV0Transaction.mjs";
|
|
13
13
|
import "./store-proof.mjs";
|
|
14
14
|
import "./sendInitNullifiersTransaction.mjs";
|
|
15
|
-
import "./initTokenLimitIfNeeded.mjs";
|
|
16
15
|
import "./recipientUtxoProcessing.mjs";
|
|
17
16
|
import "./store-instructions.mjs";
|
|
18
17
|
import "./ensureAmountChanges.mjs";
|
|
19
18
|
import "./getFeeStructure.mjs";
|
|
20
|
-
import "./getKycAndSignatureData.mjs";
|
|
21
19
|
import "./waitForDepositedUtxosInMerkleTree.mjs";
|
|
20
|
+
import "./buildCommitmentValidationData.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../error-handling/error-codes.constants.cjs`),t=require(`../utils/amounts.utils.cjs`),n=require(`../../data-structures/utxo/Utxo.cjs`);var r=(r,i,a,o,s
|
|
1
|
+
const e=require(`../../error-handling/error-codes.constants.cjs`),t=require(`../utils/amounts.utils.cjs`),n=require(`../../data-structures/utxo/Utxo.cjs`);var r=(r,i,a,o,s=!0,c,l)=>{let u=t.countTotalAmountInUtxos(i),{erc20TokenAddress:d,mintAddress:f}=i[0];if(s&&a<0n&&u+a<0n)throw Error(e.transactionErrorCodes.INSUFFICIENT_FUNDS_TO_TRANSACT);let p=[new n.Utxo({amount:t.bigintMax(u+a,0n),erc20TokenAddress:d,mintAddress:f,nullifyingKey:r.getShieldedPrivateKey(),timeStamp:o,spendingPublicKey:r.getSpendingKeyPair().pubSpendingBJJPoint,isNewStyle:!0})];if(c!==void 0&&l!==void 0){let[e,t,r,,i]=c.split(`,`);p.push(new n.Utxo({amount:l,erc20TokenAddress:d,mintAddress:f,H0:[BigInt(t),BigInt(r)],stealthAddress:e,encryptionKey:i,timeStamp:o,isNewStyle:!0}))}return{outputUtxos:p}};exports.outputUtxoProcessing=r;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UserKeys } from '../../data-structures/crypto-keys/keys';
|
|
2
2
|
import { Utxo } from '../../data-structures/utxo/Utxo';
|
|
3
|
-
export declare const outputUtxoProcessing: (userKeys: UserKeys, inputUtxos: Utxo[], amountChange: bigint, timeStamp?: string,
|
|
3
|
+
export declare const outputUtxoProcessing: (userKeys: UserKeys, inputUtxos: Utxo[], amountChange: bigint, timeStamp?: string, revertIfNegative?: boolean, recipientAddress?: string, recipientAmountChange?: bigint) => {
|
|
4
4
|
outputUtxos: Utxo[];
|
|
5
5
|
};
|
|
@@ -2,29 +2,32 @@ import { transactionErrorCodes as e } from "../../error-handling/error-codes.con
|
|
|
2
2
|
import { bigintMax as t, countTotalAmountInUtxos as n } from "../utils/amounts.utils.mjs";
|
|
3
3
|
import { Utxo as r } from "../../data-structures/utxo/Utxo.mjs";
|
|
4
4
|
//#region libs/shared/common/src/functions/pre-transaction/outputUtxoProcessing.ts
|
|
5
|
-
var i = (i, a, o, s, c
|
|
6
|
-
let
|
|
7
|
-
if (
|
|
8
|
-
let
|
|
9
|
-
amount: t(
|
|
10
|
-
erc20TokenAddress:
|
|
11
|
-
mintAddress:
|
|
12
|
-
|
|
5
|
+
var i = (i, a, o, s, c = !0, l, u) => {
|
|
6
|
+
let d = n(a), { erc20TokenAddress: f, mintAddress: p } = a[0];
|
|
7
|
+
if (c && o < 0n && d + o < 0n) throw Error(e.INSUFFICIENT_FUNDS_TO_TRANSACT);
|
|
8
|
+
let m = [new r({
|
|
9
|
+
amount: t(d + o, 0n),
|
|
10
|
+
erc20TokenAddress: f,
|
|
11
|
+
mintAddress: p,
|
|
12
|
+
nullifyingKey: i.getShieldedPrivateKey(),
|
|
13
13
|
timeStamp: s,
|
|
14
|
-
|
|
14
|
+
spendingPublicKey: i.getSpendingKeyPair().pubSpendingBJJPoint,
|
|
15
|
+
isNewStyle: !0
|
|
15
16
|
})];
|
|
16
|
-
if (
|
|
17
|
-
let [e, t, n] =
|
|
18
|
-
|
|
19
|
-
amount:
|
|
20
|
-
erc20TokenAddress:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
if (l !== void 0 && u !== void 0) {
|
|
18
|
+
let [e, t, n, , i] = l.split(",");
|
|
19
|
+
m.push(new r({
|
|
20
|
+
amount: u,
|
|
21
|
+
erc20TokenAddress: f,
|
|
22
|
+
mintAddress: p,
|
|
23
|
+
H0: [BigInt(t), BigInt(n)],
|
|
24
|
+
stealthAddress: e,
|
|
25
|
+
encryptionKey: i,
|
|
26
|
+
timeStamp: s,
|
|
27
|
+
isNewStyle: !0
|
|
25
28
|
}));
|
|
26
29
|
}
|
|
27
|
-
return { outputUtxos:
|
|
30
|
+
return { outputUtxos: m };
|
|
28
31
|
};
|
|
29
32
|
//#endregion
|
|
30
33
|
export { i as outputUtxoProcessing };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../utils/caseInsensitive.utils.cjs`),t=require(`../../data-structures/utxo/Utxo.cjs`);var n=(n,r,i,a)=>{let{recipientInfo:o,amount:s,token:c}=n,[l,u,d]=o.split(`,`),
|
|
1
|
+
const e=require(`../utils/caseInsensitive.utils.cjs`),t=require(`../../data-structures/utxo/Utxo.cjs`);var n=(n,r,i,a)=>{let{recipientInfo:o,amount:s,token:c}=n,[l,u,d,,f]=o.split(`,`),p=r.findIndex(t=>t.find(t=>e.caseInsensitiveEqual(t.erc20TokenAddress,n?.token.erc20TokenAddress))!==void 0),m=new t.Utxo({amount:s,erc20TokenAddress:c.erc20TokenAddress,timeStamp:a,H0:[BigInt(u),BigInt(d)],stealthAddress:l,encryptionKey:f,isNewStyle:!0});if(p===-1)throw Error(`Private recipient index not found`);r.forEach((e,n)=>{if(n===p)e.push(m),i[n]+=s;else{let n=new t.Utxo({amount:0n,erc20TokenAddress:e[0].erc20TokenAddress,timeStamp:a,H0:[BigInt(u),BigInt(d)],stealthAddress:l,encryptionKey:f,isNewStyle:!0});e.push(n)}})};exports.recipientUtxoProcessing=n;
|
|
@@ -2,25 +2,27 @@ import { caseInsensitiveEqual as e } from "../utils/caseInsensitive.utils.mjs";
|
|
|
2
2
|
import { Utxo as t } from "../../data-structures/utxo/Utxo.mjs";
|
|
3
3
|
//#region libs/shared/common/src/functions/pre-transaction/recipientUtxoProcessing.ts
|
|
4
4
|
var n = (n, r, i, a) => {
|
|
5
|
-
let { recipientInfo: o, amount: s, token: c } = n, [l, u, d] = o.split(","),
|
|
5
|
+
let { recipientInfo: o, amount: s, token: c } = n, [l, u, d, , f] = o.split(","), p = r.findIndex((t) => t.find((t) => e(t.erc20TokenAddress, n?.token.erc20TokenAddress)) !== void 0), m = new t({
|
|
6
6
|
amount: s,
|
|
7
7
|
erc20TokenAddress: c.erc20TokenAddress,
|
|
8
8
|
timeStamp: a,
|
|
9
|
-
|
|
10
|
-
stealthAddress:
|
|
11
|
-
encryptionKey:
|
|
9
|
+
H0: [BigInt(u), BigInt(d)],
|
|
10
|
+
stealthAddress: l,
|
|
11
|
+
encryptionKey: f,
|
|
12
|
+
isNewStyle: !0
|
|
12
13
|
});
|
|
13
|
-
if (
|
|
14
|
+
if (p === -1) throw Error("Private recipient index not found");
|
|
14
15
|
r.forEach((e, n) => {
|
|
15
|
-
if (n ===
|
|
16
|
+
if (n === p) e.push(m), i[n] += s;
|
|
16
17
|
else {
|
|
17
18
|
let n = new t({
|
|
18
19
|
amount: 0n,
|
|
19
20
|
erc20TokenAddress: e[0].erc20TokenAddress,
|
|
20
21
|
timeStamp: a,
|
|
21
|
-
|
|
22
|
-
stealthAddress:
|
|
23
|
-
encryptionKey:
|
|
22
|
+
H0: [BigInt(u), BigInt(d)],
|
|
23
|
+
stealthAddress: l,
|
|
24
|
+
encryptionKey: f,
|
|
25
|
+
isNewStyle: !0
|
|
24
26
|
});
|
|
25
27
|
e.push(n);
|
|
26
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require(`../utils/bytes32.utils.cjs`),t=require(`./solana.cjs`),n=require(`./sendV0Transaction.cjs`);var r=async(n,r,i,a,o)=>{if(o.every(e=>e===0))return{instruction:void 0,willCreate:!1};let s=t.getNullifierAccount(e.convertBytes32ToBigInt(o),i,r.programId);return await n.getAccountInfo(s)?{instruction:void 0,willCreate:!1}:{instruction:await r.methods.initNullifier(o).accounts({originalDeployer:i,signer:a}).instruction(),willCreate:!0,account:s,nullifier:o}},i=async(e,t,n,i,a)=>{let o=[],s=[];for(let c of a){let{instruction:a,willCreate:l,account:u,nullifier:d}=await r(e,t,n,i,c);a&&o.push(a),l&&u&&d&&s.push({account:u,nullifier:d})}return{instructions:o,createdAccounts:s}},a=async(e,t,r,a,o)=>{let{instructions:s,createdAccounts:c}=await i(e,t,r,a.publicKey,o);return{signature:await n.sendV0Transaction(e,s,a,[a]),createdAccounts:c}};exports.sendInitNullifiersTransaction=a;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { convertBytes32ToBigInt as e } from "../utils/bytes32.utils.mjs";
|
|
2
|
+
import { getNullifierAccount as t } from "./solana.mjs";
|
|
3
|
+
import { sendV0Transaction as n } from "./sendV0Transaction.mjs";
|
|
4
4
|
//#region libs/shared/common/src/functions/pre-transaction/sendInitNullifiersTransaction.ts
|
|
5
|
-
var r = async (
|
|
5
|
+
var r = async (n, r, i, a, o) => {
|
|
6
6
|
if (o.every((e) => e === 0)) return {
|
|
7
7
|
instruction: void 0,
|
|
8
8
|
willCreate: !1
|
|
9
9
|
};
|
|
10
|
-
let s = e(
|
|
11
|
-
return await
|
|
10
|
+
let s = t(e(o), i, r.programId);
|
|
11
|
+
return await n.getAccountInfo(s) ? {
|
|
12
12
|
instruction: void 0,
|
|
13
13
|
willCreate: !1
|
|
14
14
|
} : {
|
|
@@ -33,10 +33,10 @@ var r = async (t, r, i, a, o) => {
|
|
|
33
33
|
instructions: o,
|
|
34
34
|
createdAccounts: s
|
|
35
35
|
};
|
|
36
|
-
}, a = async (e,
|
|
37
|
-
let { instructions: s, createdAccounts: c } = await i(e,
|
|
36
|
+
}, a = async (e, t, r, a, o) => {
|
|
37
|
+
let { instructions: s, createdAccounts: c } = await i(e, t, r, a.publicKey, o);
|
|
38
38
|
return {
|
|
39
|
-
signature: await
|
|
39
|
+
signature: await n(e, s, a, [a]),
|
|
40
40
|
createdAccounts: c
|
|
41
41
|
};
|
|
42
42
|
};
|