@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
|
@@ -35,5 +35,5 @@ export declare class WorkerProxy {
|
|
|
35
35
|
postMessage(message: unknown): void;
|
|
36
36
|
postMessageToMainThread(message: unknown): void;
|
|
37
37
|
postErrorToMainThread(error: unknown): void;
|
|
38
|
-
|
|
38
|
+
private get parentPort();
|
|
39
39
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=function(e){return e[e.CALC_COMMITMENTS_SIBLING_AND_SIDES=0]=`CALC_COMMITMENTS_SIBLING_AND_SIDES`,e[e.
|
|
1
|
+
var e=function(e){return e[e.CALC_COMMITMENTS_SIBLING_AND_SIDES=0]=`CALC_COMMITMENTS_SIBLING_AND_SIDES`,e[e.BUILD_IN_NULLIFIERS=1]=`BUILD_IN_NULLIFIERS`,e}({});exports.ZKProofWorkerActionType=e;
|
|
@@ -3,8 +3,7 @@ import { MerkleTreeJson } from '../../data-structures/merkle-tree';
|
|
|
3
3
|
import { WorkerParams, WorkerPayload } from '../worker.types';
|
|
4
4
|
export declare enum ZKProofWorkerActionType {
|
|
5
5
|
CALC_COMMITMENTS_SIBLING_AND_SIDES = 0,
|
|
6
|
-
|
|
7
|
-
BUILD_IN_NULLIFIERS = 2
|
|
6
|
+
BUILD_IN_NULLIFIERS = 1
|
|
8
7
|
}
|
|
9
8
|
export interface ZKProofWorkerCalcCommitmentsPayload extends WorkerPayload<{
|
|
10
9
|
inputUtxosSerialized: IUtxoConstructor[][];
|
|
@@ -16,21 +15,12 @@ export interface ZKProofWorkerCalcCommitmentsReturn {
|
|
|
16
15
|
inCommitmentSiblings: string[][][];
|
|
17
16
|
inCommitmentSiblingSides: string[][][];
|
|
18
17
|
}
|
|
19
|
-
export interface ZKProofWorkerCalcAccessTokenPayload extends WorkerPayload<{
|
|
20
|
-
merkleTreeAccessTokenSerialized: MerkleTreeJson;
|
|
21
|
-
accessKey: string;
|
|
22
|
-
}> {
|
|
23
|
-
type: ZKProofWorkerActionType.CALC_ACCESS_TOKEN_SIBLING_AND_SIDES;
|
|
24
|
-
}
|
|
25
|
-
export interface ZKProofWorkerCalcAccessTokenReturn {
|
|
26
|
-
accessTokenSiblings: string[];
|
|
27
|
-
accessTokenSiblingSides: string[];
|
|
28
|
-
}
|
|
29
18
|
export interface ZKProofWorkerBuildInNullifiersPayload extends WorkerPayload<{
|
|
30
19
|
inputUtxosSerialized: IUtxoConstructor[][];
|
|
31
20
|
}> {
|
|
32
21
|
type: ZKProofWorkerActionType.BUILD_IN_NULLIFIERS;
|
|
33
22
|
}
|
|
34
23
|
export type ZKProofWorkerBuildInNullifiersReturn = string[][];
|
|
35
|
-
export type ZKProofWorkerPayload = ZKProofWorkerCalcCommitmentsPayload |
|
|
24
|
+
export type ZKProofWorkerPayload = ZKProofWorkerCalcCommitmentsPayload | ZKProofWorkerBuildInNullifiersPayload;
|
|
36
25
|
export type ZKProofWorkerParams = WorkerParams<ZKProofWorkerPayload>;
|
|
26
|
+
export type ZKProofWorkerReturn = ZKProofWorkerCalcCommitmentsReturn | ZKProofWorkerBuildInNullifiersReturn;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region libs/shared/common/src/webworker/zkProofWorker/zkProofWorker.types.ts
|
|
2
2
|
var e = /* @__PURE__ */ function(e) {
|
|
3
|
-
return e[e.CALC_COMMITMENTS_SIBLING_AND_SIDES = 0] = "CALC_COMMITMENTS_SIBLING_AND_SIDES", e[e.
|
|
3
|
+
return e[e.CALC_COMMITMENTS_SIBLING_AND_SIDES = 0] = "CALC_COMMITMENTS_SIBLING_AND_SIDES", e[e.BUILD_IN_NULLIFIERS = 1] = "BUILD_IN_NULLIFIERS", e;
|
|
4
4
|
}({});
|
|
5
5
|
//#endregion
|
|
6
6
|
export { e as ZKProofWorkerActionType };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=``+(typeof document>`u`?require(`url`).pathToFileURL(__dirname+`/../../assets/zkProofWorkerLauncher
|
|
1
|
+
var e=``+(typeof document>`u`?require(`url`).pathToFileURL(__dirname+`/../../assets/zkProofWorkerLauncher--LA9r4L5.js`).href:new URL(`../../assets/zkProofWorkerLauncher--LA9r4L5.js`,document.currentScript&&document.currentScript.tagName.toUpperCase()===`SCRIPT`&&document.currentScript.src||document.baseURI).href);exports.default=e;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region libs/shared/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url
|
|
2
|
-
var e = "" + new URL("../../assets/zkProofWorkerLauncher
|
|
2
|
+
var e = "" + new URL("../../assets/zkProofWorkerLauncher--LA9r4L5.js", import.meta.url).href;
|
|
3
3
|
//#endregion
|
|
4
4
|
export { e as default };
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ZKProofWorkerBuildInNullifiersPayload, ZKProofWorkerCalcAccessTokenPayload, ZKProofWorkerCalcCommitmentsPayload, ZKProofWorkerParams } from './zkProofWorker.types';
|
|
3
|
-
declare const workerProxy: WorkerProxy;
|
|
1
|
+
import { ZKProofWorkerBuildInNullifiersPayload, ZKProofWorkerCalcCommitmentsPayload, ZKProofWorkerParams } from './zkProofWorker.types';
|
|
4
2
|
export declare const handleCalcCommitmentsSiblingAndSides: (payload: ZKProofWorkerCalcCommitmentsPayload) => void;
|
|
5
|
-
export declare const handleCalcAccessTokenSiblingAndSides: (payload: ZKProofWorkerCalcAccessTokenPayload) => void;
|
|
6
3
|
export declare const handleBuildInNullifiers: (payload: ZKProofWorkerBuildInNullifiersPayload) => void;
|
|
7
4
|
export declare const onWorkerMessage: (data: ZKProofWorkerParams) => Promise<void>;
|
|
8
|
-
export default workerProxy;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./workerProxy-BNBqYien.js`),t=require(`./logError-fCJ4HXQz.js`);let n=require(`worker_threads`),r=require(`buffer`);var i=e.C(e.v());Object.values({preHookContract:`0x0000000000000000000000000000000000000000`,hookContract:`0x0000000000000000000000000000000000000000`,preHookMetadata:`0x00`,postHookMetadata:`0x00`});var a=(e,t)=>{let n=[];for(let r=0;r<e.length;r+=1){n.push([]);for(let i=0;i<e[r].length;i+=1)n[r][i]=t.getSiblingHashesForVerification(BigInt(e[r][i].getCommitment())).map(e=>e.toString())}let r=[];for(let n=0;n<e.length;n+=1){r.push([]);for(let i=0;i<e[n].length;i+=1)r[n][i]=t.getSiblingSides(BigInt(e[n][i].getCommitment())).map(e=>e.toString())}return{inCommitmentSiblings:n,inCommitmentSiblingSides:r}},o=function(e){return e[e.CALC_COMMITMENTS_SIBLING_AND_SIDES=0]=`CALC_COMMITMENTS_SIBLING_AND_SIDES`,e[e.BUILD_IN_NULLIFIERS=1]=`BUILD_IN_NULLIFIERS`,e}({}),s=class extends Error{constructor(){super(`Merkle tree is incomplete`),this.name=`MerkleTreeIncompleteError`}},c=class e{tree;count;index;reverseTree;static createWithData(t,n,r,i,a,o,s){return new e(a,o,s,t,n,r,i)}static create(n,r,i=t.u){return new e(n,i,r)}createReverseTree(){let e=new Map;for(let t=this.getStartIndex();t<this.getStartIndex()+this.count;t+=1n){let n=this.tree.get(t);n!==void 0&&e.set(n,t)}return e}constructor(e,t,n,r,i,a,o){this.hashFunction=e,this.levels=t,this.defaultNodeValue=n,this.tree=r??new Map,this.count=o??0n,this.index=a??2n**(t-1n),i?this.reverseTree=i:this.reverseTree=this.createReverseTree()}getStartIndex(){return 2n**(this.levels-1n)}logarithm2(e){let t=0n;for(;2n**t<e;)t+=1n;return t}bigIntMax(e,t){return e>t?e:t}forceInsert(e,t){if(t<this.getStartIndex())throw RangeError();this.tree.set(t,e),this.reverseTree.set(e,t);let n=this.index-this.getStartIndex(),r=this.logarithm2(n),i=t;for(let e=1n;e<=r;e+=1n){i/=2n;let e=this.hashFunction(this.tree.get(i*2n)||this.defaultNodeValue,this.tree.get(i*2n+1n)||this.defaultNodeValue);this.tree.set(i,e)}}insert(e,n){let r=!1;this.tree.has(n)&&(r=!0,t.t(`Editing commitment index: ${n} `)),r||(this.count+=1n),this.index=this.bigIntMax(this.index,n+1n),this.forceInsert(e,n)}remove(e){this.forceInsert(this.defaultNodeValue,e)}completenessCheck(){if(this.count!==this.index-this.getStartIndex())throw new s}getRootHash(){this.completenessCheck();for(let e=1n;e<2n**this.levels;e*=2n)if(this.tree.get(e))return this.tree.get(e);return this.defaultNodeValue}getMerkleData(){return this.completenessCheck(),new Map(this.tree)}getValue(e){return this.tree.get(e)}getSiblingIndex(e){return e===1n?1n:e%2n==1n?e-1n:e+1n}getSiblingHashesForVerification(e){this.completenessCheck();let t=this.reverseTree.get(e);if(t===void 0)return Array(25).fill(0n);let n=[];for(;t!==0n;)n.push(this.tree.get(this.getSiblingIndex(t))||this.defaultNodeValue),t/=2n;return n.slice(0,25)}getSiblingSides(e){this.completenessCheck();let t=this.reverseTree.get(e);if(t===void 0)return Array(25).fill(0n);let n=[];for(;t!==0n;){let e=t%2n==0n?0n:1n;n.push(e),t/=2n}return n.slice(0,25)}toJSON(){let{tree:e,reverseTree:t,count:n,index:r}=this;return{tree:Object.fromEntries(e),reverseTree:Object.fromEntries(t),count:n.toString(),index:r.toString()}}toJSONLite(){let{tree:e,count:t,index:n}=this;return{tree:Object.fromEntries(e),count:t.toString(),index:n.toString()}}clone(){return e.createWithData(new Map(this.tree),new Map(this.reverseTree),this.index,this.count,this.hashFunction,this.levels,this.defaultNodeValue)}getIndex(){return this.index}},l=e=>new Map(Object.entries(e).map(([e,t])=>[BigInt(e),BigInt(t)])),u=e=>{let n=l(e.tree),r=e.reverseTree?l(e.reverseTree):void 0;return c.createWithData(n,r,BigInt(e.index),BigInt(e.count),t.p,t.u,0n)},d=new e.t,f=e=>{let{inputUtxosSerialized:n,merkleTreeSerialized:r}=e.data,i=u(r),{inCommitmentSiblings:o,inCommitmentSiblingSides:s}=a(n.map(e=>e.map(e=>new t.o(e))),i);d.postMessageToMainThread({inCommitmentSiblings:o,inCommitmentSiblingSides:s})},p=e=>{let{inputUtxosSerialized:n}=e.data,r=n.map(e=>e.map(e=>new t.o(e))).map(e=>e.map(e=>e.amount===0n?`0`:e.getNullifier()));d.postMessageToMainThread(r)},m=async e=>{try{await t.f(!0);let{type:n}=e.payload;switch(n){case o.CALC_COMMITMENTS_SIBLING_AND_SIDES:f(e.payload);return;case o.BUILD_IN_NULLIFIERS:p(e.payload);return;default:throw Error(`Unknown worker message type ${n}`)}}catch(e){console.error(`zk proof worker message failed`,e),d.postErrorToMainThread(e)}};globalThis.process=i.default,globalThis.Buffer=r.Buffer,n.parentPort.on(`message`,async e=>{await m(e)});
|
package/API/solana-calls.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../constants/server.constants.cjs`),t=require(`./getServerURL.cjs`),n=require(`../data-structures/http/HttpClient.cjs`);require(`../data-structures/http/index.cjs`);var r=async r=>n.httpClient.post(`${t.SERVER_URL}${e.API_CONFIG.ROUTES.generateProoflessDepositLimitless}`,r),i=async r=>n.httpClient.post(`${t.SERVER_URL}${e.API_CONFIG.ROUTES.generateMultiPaymentDepositLimitless}`,r),a=async r=>n.httpClient.post(`${t.SERVER_URL}${e.API_CONFIG.ROUTES.generateAddAccessToken}`,r);exports.generateAddAccessToken=a,exports.generateMultiPaymentDepositLimitless=i,exports.generateProoflessDepositLimitless=r;
|
package/API/solana-calls.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { AnchorStealthAddressStructure } from '../types/circom-data.types';
|
|
2
|
-
interface GenerateProoflessDepositLimitlessInput {
|
|
3
|
-
payer: string;
|
|
4
|
-
ethereumAddress: string;
|
|
5
|
-
mint: string;
|
|
6
|
-
amount: string;
|
|
7
|
-
stealthAddressStructure: AnchorStealthAddressStructure;
|
|
8
|
-
chainId: number;
|
|
9
|
-
}
|
|
10
|
-
interface GenerateMultiPaymentDepositLimitlessInput {
|
|
11
|
-
payer: string;
|
|
12
|
-
ethereumAddress: string;
|
|
13
|
-
mint: string;
|
|
14
|
-
amounts: string[];
|
|
15
|
-
stealthAddressStructures: AnchorStealthAddressStructure[];
|
|
16
|
-
chainId: number;
|
|
17
|
-
createBlockedUtxos: boolean;
|
|
18
|
-
}
|
|
19
|
-
interface GenerateProoflessDepositLimitlessOutput {
|
|
20
|
-
serializedTransaction: string;
|
|
21
|
-
blockhash: string;
|
|
22
|
-
lastValidBlockHeight: number;
|
|
23
|
-
}
|
|
24
|
-
export declare const generateProoflessDepositLimitless: (input: GenerateProoflessDepositLimitlessInput) => Promise<GenerateProoflessDepositLimitlessOutput>;
|
|
25
|
-
export declare const generateMultiPaymentDepositLimitless: (input: GenerateMultiPaymentDepositLimitlessInput) => Promise<GenerateProoflessDepositLimitlessOutput>;
|
|
26
|
-
interface GenerateAddTokenPublicKeyInput {
|
|
27
|
-
payer: string;
|
|
28
|
-
accessKey: string;
|
|
29
|
-
ethereumAddress: string;
|
|
30
|
-
chainId: number;
|
|
31
|
-
}
|
|
32
|
-
interface GenerateAddAccessTokenOutput {
|
|
33
|
-
serializedTransaction: string;
|
|
34
|
-
blockhash: string;
|
|
35
|
-
lastValidBlockHeight: number;
|
|
36
|
-
}
|
|
37
|
-
export declare const generateAddAccessToken: (input: GenerateAddTokenPublicKeyInput) => Promise<GenerateAddAccessTokenOutput>;
|
|
38
|
-
export {};
|
package/API/solana-calls.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { API_CONFIG as e } from "../constants/server.constants.mjs";
|
|
2
|
-
import { SERVER_URL as t } from "./getServerURL.mjs";
|
|
3
|
-
import { httpClient as n } from "../data-structures/http/HttpClient.mjs";
|
|
4
|
-
import "../data-structures/http/index.mjs";
|
|
5
|
-
//#region libs/shared/common/src/API/solana-calls.ts
|
|
6
|
-
var r = async (r) => n.post(`${t}${e.ROUTES.generateProoflessDepositLimitless}`, r), i = async (r) => n.post(`${t}${e.ROUTES.generateMultiPaymentDepositLimitless}`, r), a = async (r) => n.post(`${t}${e.ROUTES.generateAddAccessToken}`, r);
|
|
7
|
-
//#endregion
|
|
8
|
-
export { a as generateAddAccessToken, i as generateMultiPaymentDepositLimitless, r as generateProoflessDepositLimitless };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=[`TRX`],t=t=>e.includes(t);exports.isNonCircularToken=t;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isNonCircularToken: (symbol: string) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../functions/utils/amounts.utils.cjs`),t=require(`../../functions/pre-transaction/solana.cjs`);let n=require(`@solana/web3.js`);var r=async(r,i,a,o)=>{for(let s=0;s<a.length;s+=1){let c=t.getTokenLimitStorageAccountPublicKey(r.programId,i,new n.PublicKey(a[s]));if(!await r.provider.connection.getAccountInfo(c,`confirmed`))continue;let l=BigInt((await r.account.tokenLimitStorageAccount.fetch(c,`confirmed`)).amountLimit.toString());if(l!==0n&&e.absBigInt(o[s])>l)return!0}return!1};exports.hinkalCheckSolanaTokenRegistry=r;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { absBigInt as e } from "../../functions/utils/amounts.utils.mjs";
|
|
2
|
-
import { getTokenLimitStorageAccountPublicKey as t } from "../../functions/pre-transaction/solana.mjs";
|
|
3
|
-
import { PublicKey as n } from "@solana/web3.js";
|
|
4
|
-
//#region libs/shared/common/src/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.ts
|
|
5
|
-
var r = async (r, i, a, o) => {
|
|
6
|
-
for (let s = 0; s < a.length; s += 1) {
|
|
7
|
-
let c = t(r.programId, i, new n(a[s]));
|
|
8
|
-
if (!await r.provider.connection.getAccountInfo(c, "confirmed")) continue;
|
|
9
|
-
let l = BigInt((await r.account.tokenLimitStorageAccount.fetch(c, "confirmed")).amountLimit.toString());
|
|
10
|
-
if (l !== 0n && e(o[s]) > l) return !0;
|
|
11
|
-
}
|
|
12
|
-
return !1;
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
|
-
export { r as hinkalCheckSolanaTokenRegistry };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/tron.utils.cjs`),n=require(`../../functions/utils/create-provider.cjs`);require(`../../functions/utils/index.cjs`);let r=require(`ethers`);var i=async(e,t,n)=>await e.checkTokenRegistry(t,n),a=t=>{let i=e.networkRegistry[t].contractData,a=n.createCustomRpcProvider(t);if(!i.hinkalHelperAddress||!i.hinkalHelperABI)throw Error(`hinkal helpercontract data not found`);return new r.ethers.Contract(i.hinkalHelperAddress,i.hinkalHelperABI,a)},o=async(n,r,i)=>{let a=t.createTronWeb(i),{contractData:o}=e.networkRegistry[i],{hinkalHelperAddress:s,hinkalHelperABI:c}=o;if(!s||!c)throw Error(`hinkal helper contract data not found`);let l=a.contract(c,t.evmHexToTronBase58Address(s)),u=n.map(t.evmHexToTronBase58Address);return!!await l.checkTokenRegistry(u,r.map(String)).call()};exports.createHinkalHelperFromData=a,exports.hinkalCheckTokenRegistry=i,exports.hinkalCheckTronTokenRegistry=o;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ethers } from 'ethers';
|
|
2
|
-
export declare const hinkalCheckTokenRegistry: (hinkalHelper: ethers.Contract, erc20Addresses: string[], amountChanges: bigint[]) => Promise<boolean>;
|
|
3
|
-
export declare const createHinkalHelperFromData: (chainId: number) => ethers.Contract;
|
|
4
|
-
export declare const hinkalCheckTronTokenRegistry: (erc20Addresses: string[], amountChanges: bigint[], chainId: number) => Promise<boolean>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { networkRegistry as e } from "../../constants/chains.constants.mjs";
|
|
2
|
-
import { createTronWeb as t, evmHexToTronBase58Address as n } from "../../functions/utils/tron.utils.mjs";
|
|
3
|
-
import { createCustomRpcProvider as r } from "../../functions/utils/create-provider.mjs";
|
|
4
|
-
import "../../functions/utils/index.mjs";
|
|
5
|
-
import { ethers as i } from "ethers";
|
|
6
|
-
//#region libs/shared/common/src/data-structures/Hinkal/hinkalCheckTokenRegistry.ts
|
|
7
|
-
var a = async (e, t, n) => await e.checkTokenRegistry(t, n), o = (t) => {
|
|
8
|
-
let n = e[t].contractData, a = r(t);
|
|
9
|
-
if (!n.hinkalHelperAddress || !n.hinkalHelperABI) throw Error("hinkal helpercontract data not found");
|
|
10
|
-
return new i.Contract(n.hinkalHelperAddress, n.hinkalHelperABI, a);
|
|
11
|
-
}, s = async (r, i, a) => {
|
|
12
|
-
let o = t(a), { contractData: s } = e[a], { hinkalHelperAddress: c, hinkalHelperABI: l } = s;
|
|
13
|
-
if (!c || !l) throw Error("hinkal helper contract data not found");
|
|
14
|
-
let u = o.contract(l, n(c)), d = r.map(n);
|
|
15
|
-
return !!await u.checkTokenRegistry(d, i.map(String)).call();
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|
|
18
|
-
export { o as createHinkalHelperFromData, a as hinkalCheckTokenRegistry, s as hinkalCheckTronTokenRegistry };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../../constants/protocol.constants.cjs`),t=require(`../../../functions/utils/amounts.utils.cjs`),n=require(`../../../crypto/poseidon.cjs`);require(`../../../crypto/index.cjs`);const r=require(`../../merkle-tree/MerkleTree.cjs`);require(`../../merkle-tree/index.cjs`);const i=require(`./AbstractSnapshotService.cjs`),a=require(`../../../functions/utils/merkleTree.utils.cjs`);var o=class extends i.AbstractSnapshotService{constructor(e){super(e,`NewAccessKeyAdded`)}_merkleTree;_senderAddresses;_senderAddressIndexMap;get merkleTree(){return this._merkleTree}get senderAddresses(){return this._senderAddresses}get senderAddressIndexMap(){return this._senderAddressIndexMap}serializeSnapshot(e){return{merkleTree:e.payload.merkleTree.toJSON(),senderAddresses:Array.from(e.payload.senderAddresses),latestBlockNumber:e.latestBlockNumber,senderAddressIndexMap:Array.from(e.payload.senderAddressIndexMap).map(([e,t])=>({address:e,index:t}))}}deserializeSnapshot(e){let t,i;return t=e.latestBlockNumber&&e.merkleTree?a.contructMerkleTreeFromSerialized(e.merkleTree):r.MerkleTree.create(n.poseidonFunction,0n),i=e.latestBlockNumber&&e.senderAddressIndexMap?new Map(e.senderAddressIndexMap.map(({address:e,index:t})=>[e,t])):new Map,{latestBlockNumber:e.latestBlockNumber??0,payload:{merkleTree:t,senderAddresses:e.senderAddresses??[],senderAddressIndexMap:i}}}acceptEvent(t,n){try{return this._merkleTree.insert(t.accessKey,t.index),this._senderAddressIndexMap.set(t.senderAddress,Math.max(Number(t.index),this._senderAddressIndexMap.get(t.senderAddress)??0)),this._senderAddresses.includes(t.senderAddress)||this._senderAddresses.push(t.senderAddress),t.accessKey===0n&&t.senderAddress===e.zeroAddress&&this._merkleTree.remove(t.index),!0}catch(e){return console.error(e),!1}}mapEvent(e){let n=e.getArg(`accessKey`),r=e.getArg(`index`),i=e.getArg(`senderAddress`);return{accessKey:t.toBigInt(n),index:t.toBigInt(r),senderAddress:i}}getSnapshotPayload(){return{merkleTree:this._merkleTree,senderAddresses:this._senderAddresses,senderAddressIndexMap:this._senderAddressIndexMap}}populateSnapshot({payload:{merkleTree:e,senderAddresses:t,senderAddressIndexMap:n}}){this._merkleTree=e,this._senderAddresses=t,this._senderAddressIndexMap=n}};exports.AbstractAccessTokenSnapshotService=o;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { MerkleTree, MerkleTreeJson } from '../../merkle-tree';
|
|
2
|
-
import { AccessTokenEvent } from '../../../types';
|
|
3
|
-
import { AbstractSnapshotService, Snapshot } from './AbstractSnapshotService';
|
|
4
|
-
import { BlockchainEventEmitter } from './BlockchainEventEmitter';
|
|
5
|
-
import { BlockchainEvent } from '../../BlockchainEvent/BlockchainEvent';
|
|
6
|
-
export type SenderAddressIndexMapJson = {
|
|
7
|
-
address: string;
|
|
8
|
-
index: number;
|
|
9
|
-
}[];
|
|
10
|
-
export type AccessTokenSnapshotPayload = {
|
|
11
|
-
readonly merkleTree: MerkleTree<bigint>;
|
|
12
|
-
readonly senderAddresses: string[];
|
|
13
|
-
readonly senderAddressIndexMap: Map<string, number>;
|
|
14
|
-
};
|
|
15
|
-
export type AccessTokenSerializedSnapshot = {
|
|
16
|
-
latestBlockNumber?: number;
|
|
17
|
-
merkleTree?: MerkleTreeJson;
|
|
18
|
-
senderAddresses?: string[];
|
|
19
|
-
senderAddressIndexMap?: SenderAddressIndexMapJson;
|
|
20
|
-
};
|
|
21
|
-
export declare abstract class AbstractAccessTokenSnapshotService extends AbstractSnapshotService<AccessTokenEvent<bigint>, AccessTokenSnapshotPayload, AccessTokenSerializedSnapshot> {
|
|
22
|
-
constructor(accessTokenEventFetcher: BlockchainEventEmitter);
|
|
23
|
-
private _merkleTree;
|
|
24
|
-
private _senderAddresses;
|
|
25
|
-
private _senderAddressIndexMap;
|
|
26
|
-
get merkleTree(): MerkleTree<bigint>;
|
|
27
|
-
get senderAddresses(): string[];
|
|
28
|
-
get senderAddressIndexMap(): Map<string, number>;
|
|
29
|
-
protected serializeSnapshot(snapshot: Snapshot<AccessTokenSnapshotPayload>): AccessTokenSerializedSnapshot;
|
|
30
|
-
protected deserializeSnapshot(serializedSnapshot: AccessTokenSerializedSnapshot): Snapshot<AccessTokenSnapshotPayload>;
|
|
31
|
-
protected acceptEvent(event: AccessTokenEvent<bigint>, _blockNumber: number): boolean;
|
|
32
|
-
protected mapEvent(event: BlockchainEvent): AccessTokenEvent<bigint>;
|
|
33
|
-
protected getSnapshotPayload(): AccessTokenSnapshotPayload;
|
|
34
|
-
protected populateSnapshot({ payload: { merkleTree, senderAddresses, senderAddressIndexMap }, }: Snapshot<AccessTokenSnapshotPayload>): void;
|
|
35
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { zeroAddress as e } from "../../../constants/protocol.constants.mjs";
|
|
2
|
-
import { toBigInt as t } from "../../../functions/utils/amounts.utils.mjs";
|
|
3
|
-
import { poseidonFunction as n } from "../../../crypto/poseidon.mjs";
|
|
4
|
-
import "../../../crypto/index.mjs";
|
|
5
|
-
import { MerkleTree as r } from "../../merkle-tree/MerkleTree.mjs";
|
|
6
|
-
import "../../merkle-tree/index.mjs";
|
|
7
|
-
import { AbstractSnapshotService as i } from "./AbstractSnapshotService.mjs";
|
|
8
|
-
import { contructMerkleTreeFromSerialized as a } from "../../../functions/utils/merkleTree.utils.mjs";
|
|
9
|
-
//#region libs/shared/common/src/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.ts
|
|
10
|
-
var o = class extends i {
|
|
11
|
-
constructor(e) {
|
|
12
|
-
super(e, "NewAccessKeyAdded");
|
|
13
|
-
}
|
|
14
|
-
_merkleTree;
|
|
15
|
-
_senderAddresses;
|
|
16
|
-
_senderAddressIndexMap;
|
|
17
|
-
get merkleTree() {
|
|
18
|
-
return this._merkleTree;
|
|
19
|
-
}
|
|
20
|
-
get senderAddresses() {
|
|
21
|
-
return this._senderAddresses;
|
|
22
|
-
}
|
|
23
|
-
get senderAddressIndexMap() {
|
|
24
|
-
return this._senderAddressIndexMap;
|
|
25
|
-
}
|
|
26
|
-
serializeSnapshot(e) {
|
|
27
|
-
return {
|
|
28
|
-
merkleTree: e.payload.merkleTree.toJSON(),
|
|
29
|
-
senderAddresses: Array.from(e.payload.senderAddresses),
|
|
30
|
-
latestBlockNumber: e.latestBlockNumber,
|
|
31
|
-
senderAddressIndexMap: Array.from(e.payload.senderAddressIndexMap).map(([e, t]) => ({
|
|
32
|
-
address: e,
|
|
33
|
-
index: t
|
|
34
|
-
}))
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
deserializeSnapshot(e) {
|
|
38
|
-
let t, i;
|
|
39
|
-
return t = e.latestBlockNumber && e.merkleTree ? a(e.merkleTree) : r.create(n, 0n), i = e.latestBlockNumber && e.senderAddressIndexMap ? new Map(e.senderAddressIndexMap.map(({ address: e, index: t }) => [e, t])) : /* @__PURE__ */ new Map(), {
|
|
40
|
-
latestBlockNumber: e.latestBlockNumber ?? 0,
|
|
41
|
-
payload: {
|
|
42
|
-
merkleTree: t,
|
|
43
|
-
senderAddresses: e.senderAddresses ?? [],
|
|
44
|
-
senderAddressIndexMap: i
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
acceptEvent(t, n) {
|
|
49
|
-
try {
|
|
50
|
-
return this._merkleTree.insert(t.accessKey, t.index), this._senderAddressIndexMap.set(t.senderAddress, Math.max(Number(t.index), this._senderAddressIndexMap.get(t.senderAddress) ?? 0)), this._senderAddresses.includes(t.senderAddress) || this._senderAddresses.push(t.senderAddress), t.accessKey === 0n && t.senderAddress === e && this._merkleTree.remove(t.index), !0;
|
|
51
|
-
} catch (e) {
|
|
52
|
-
return console.error(e), !1;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
mapEvent(e) {
|
|
56
|
-
let n = e.getArg("accessKey"), r = e.getArg("index"), i = e.getArg("senderAddress");
|
|
57
|
-
return {
|
|
58
|
-
accessKey: t(n),
|
|
59
|
-
index: t(r),
|
|
60
|
-
senderAddress: i
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
getSnapshotPayload() {
|
|
64
|
-
return {
|
|
65
|
-
merkleTree: this._merkleTree,
|
|
66
|
-
senderAddresses: this._senderAddresses,
|
|
67
|
-
senderAddressIndexMap: this._senderAddressIndexMap
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
populateSnapshot({ payload: { merkleTree: e, senderAddresses: t, senderAddressIndexMap: n } }) {
|
|
71
|
-
this._merkleTree = e, this._senderAddresses = t, this._senderAddressIndexMap = n;
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
//#endregion
|
|
75
|
-
export { o as AbstractAccessTokenSnapshotService };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../../functions/utils/caseInsensitive.utils.cjs`),t=require(`../../../functions/utils/amounts.utils.cjs`),n=require(`./AbstractSnapshotService.cjs`);var r=class extends n.AbstractSnapshotService{constructor(e){super(e,`NewApprovedUtxo`)}_approvals=new Map;events=new Set;get approvals(){return this._approvals}getEventKey(e,t,n){return typeof e!=`bigint`||typeof n!=`string`||typeof t!=`string`?null:`${n}-${t}-${e}`}serializeSnapshot(e){let t=Object.fromEntries(e.payload.approvals),n=Object.entries(t).map(([e,t])=>[e,t.map(e=>({amount:e.amount.toString(),tokenAddress:e.tokenAddress,inHinkalAddress:e.inHinkalAddress.toString()}))]),r=Object.fromEntries(n);return{latestBlockNumber:e.latestBlockNumber,approvals:r,events:[...this.events]}}deserializeSnapshot(e){let t=e.approvals,n=Object.entries(t).map(([e,t])=>[e,t.map(e=>({amount:BigInt(e.amount),tokenAddress:e.tokenAddress,inHinkalAddress:BigInt(e.inHinkalAddress)}))]),r=new Map(n);return{latestBlockNumber:e.latestBlockNumber??0,payload:{approvals:r,events:new Set(e.events)}}}getSnapshotPayload(){return{approvals:this._approvals,events:this.events}}populateSnapshot({payload:{approvals:e,events:t}}){this._approvals=e,this.events=t}mapEvent(e){let n=e.getArg(`approveTo`),r=e.getArg(`tokenAddress`),i=e.getArg(`amount`),a=e.getArg(`inHinkalAddress`);return{approveTo:n,tokenAddress:r,amount:t.toBigInt(i),inHinkalAddress:t.toBigInt(a)}}acceptEvent(t,n,r){let i=this.getEventKey(t.inHinkalAddress,t.tokenAddress,r);if(i&&!this.events.has(i)){let{amount:n,tokenAddress:a,inHinkalAddress:o}=t,s={amount:n,tokenAddress:a,inHinkalAddress:o},c=this.approvals.get(t.approveTo)||[],l=!1;for(let t=0;t<c.length;t+=1)e.caseInsensitiveEqual(a,c[t].tokenAddress)&&o===c[t].inHinkalAddress&&(c[t].amount+=n,l=!0);if(c=c.filter(e=>e.amount!==0n),l&&c.length===0)this.approvals.delete(t.approveTo);else{let e=l?c:[...c,s];this.approvals.set(t.approveTo,e)}return r&&this.events.add(i),!0}return!1}};exports.AbstractApprovalsSnapshotService=r;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { AbstractSnapshotService, Snapshot } from './AbstractSnapshotService';
|
|
2
|
-
import { NewApprovedUtxoEvent } from '../../../types/commitments.types';
|
|
3
|
-
import { BlockchainEventEmitter } from './BlockchainEventEmitter';
|
|
4
|
-
import { ApprovedUtxo } from '../../../types/hinkal.types';
|
|
5
|
-
import { BlockchainEvent } from '../../BlockchainEvent/BlockchainEvent';
|
|
6
|
-
export type ApprovalsSnapshotPayload = {
|
|
7
|
-
readonly approvals: Map<string, ApprovedUtxo[]>;
|
|
8
|
-
readonly events: Set<string>;
|
|
9
|
-
};
|
|
10
|
-
export type ApprovalsSerializedSnapshot = {
|
|
11
|
-
latestBlockNumber?: number;
|
|
12
|
-
approvals: Record<string, ApprovedUtxo<string>[]>;
|
|
13
|
-
events: string[];
|
|
14
|
-
};
|
|
15
|
-
export declare abstract class AbstractApprovalsSnapshotService extends AbstractSnapshotService<NewApprovedUtxoEvent, ApprovalsSnapshotPayload, ApprovalsSerializedSnapshot> {
|
|
16
|
-
constructor(hinkalEventEmitter: BlockchainEventEmitter);
|
|
17
|
-
private _approvals;
|
|
18
|
-
events: Set<string>;
|
|
19
|
-
get approvals(): Map<string, ApprovedUtxo[]>;
|
|
20
|
-
private getEventKey;
|
|
21
|
-
protected serializeSnapshot(snapshot: Snapshot<ApprovalsSnapshotPayload>): ApprovalsSerializedSnapshot;
|
|
22
|
-
protected deserializeSnapshot(serializedSnapshot: ApprovalsSerializedSnapshot): Snapshot<ApprovalsSnapshotPayload>;
|
|
23
|
-
protected getSnapshotPayload(): {
|
|
24
|
-
approvals: Map<string, ApprovedUtxo[]>;
|
|
25
|
-
events: Set<string>;
|
|
26
|
-
};
|
|
27
|
-
protected populateSnapshot({ payload: { approvals, events } }: Snapshot<ApprovalsSnapshotPayload>): void;
|
|
28
|
-
protected mapEvent(event: BlockchainEvent): NewApprovedUtxoEvent;
|
|
29
|
-
protected acceptEvent(event: NewApprovedUtxoEvent, _blockNumber: number, txHash: string): boolean;
|
|
30
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { caseInsensitiveEqual as e } from "../../../functions/utils/caseInsensitive.utils.mjs";
|
|
2
|
-
import { toBigInt as t } from "../../../functions/utils/amounts.utils.mjs";
|
|
3
|
-
import { AbstractSnapshotService as n } from "./AbstractSnapshotService.mjs";
|
|
4
|
-
//#region libs/shared/common/src/data-structures/event-service/evm/AbstractApprovalsSnapshotService.ts
|
|
5
|
-
var r = class extends n {
|
|
6
|
-
constructor(e) {
|
|
7
|
-
super(e, "NewApprovedUtxo");
|
|
8
|
-
}
|
|
9
|
-
_approvals = /* @__PURE__ */ new Map();
|
|
10
|
-
events = /* @__PURE__ */ new Set();
|
|
11
|
-
get approvals() {
|
|
12
|
-
return this._approvals;
|
|
13
|
-
}
|
|
14
|
-
getEventKey(e, t, n) {
|
|
15
|
-
return typeof e != "bigint" || typeof n != "string" || typeof t != "string" ? null : `${n}-${t}-${e}`;
|
|
16
|
-
}
|
|
17
|
-
serializeSnapshot(e) {
|
|
18
|
-
let t = Object.fromEntries(e.payload.approvals), n = Object.entries(t).map(([e, t]) => [e, t.map((e) => ({
|
|
19
|
-
amount: e.amount.toString(),
|
|
20
|
-
tokenAddress: e.tokenAddress,
|
|
21
|
-
inHinkalAddress: e.inHinkalAddress.toString()
|
|
22
|
-
}))]), r = Object.fromEntries(n);
|
|
23
|
-
return {
|
|
24
|
-
latestBlockNumber: e.latestBlockNumber,
|
|
25
|
-
approvals: r,
|
|
26
|
-
events: [...this.events]
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
deserializeSnapshot(e) {
|
|
30
|
-
let t = e.approvals, n = Object.entries(t).map(([e, t]) => [e, t.map((e) => ({
|
|
31
|
-
amount: BigInt(e.amount),
|
|
32
|
-
tokenAddress: e.tokenAddress,
|
|
33
|
-
inHinkalAddress: BigInt(e.inHinkalAddress)
|
|
34
|
-
}))]), r = new Map(n);
|
|
35
|
-
return {
|
|
36
|
-
latestBlockNumber: e.latestBlockNumber ?? 0,
|
|
37
|
-
payload: {
|
|
38
|
-
approvals: r,
|
|
39
|
-
events: new Set(e.events)
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
getSnapshotPayload() {
|
|
44
|
-
return {
|
|
45
|
-
approvals: this._approvals,
|
|
46
|
-
events: this.events
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
populateSnapshot({ payload: { approvals: e, events: t } }) {
|
|
50
|
-
this._approvals = e, this.events = t;
|
|
51
|
-
}
|
|
52
|
-
mapEvent(e) {
|
|
53
|
-
let n = e.getArg("approveTo"), r = e.getArg("tokenAddress"), i = e.getArg("amount"), a = e.getArg("inHinkalAddress");
|
|
54
|
-
return {
|
|
55
|
-
approveTo: n,
|
|
56
|
-
tokenAddress: r,
|
|
57
|
-
amount: t(i),
|
|
58
|
-
inHinkalAddress: t(a)
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
acceptEvent(t, n, r) {
|
|
62
|
-
let i = this.getEventKey(t.inHinkalAddress, t.tokenAddress, r);
|
|
63
|
-
if (i && !this.events.has(i)) {
|
|
64
|
-
let { amount: n, tokenAddress: a, inHinkalAddress: o } = t, s = {
|
|
65
|
-
amount: n,
|
|
66
|
-
tokenAddress: a,
|
|
67
|
-
inHinkalAddress: o
|
|
68
|
-
}, c = this.approvals.get(t.approveTo) || [], l = !1;
|
|
69
|
-
for (let t = 0; t < c.length; t += 1) e(a, c[t].tokenAddress) && o === c[t].inHinkalAddress && (c[t].amount += n, l = !0);
|
|
70
|
-
if (c = c.filter((e) => e.amount !== 0n), l && c.length === 0) this.approvals.delete(t.approveTo);
|
|
71
|
-
else {
|
|
72
|
-
let e = l ? c : [...c, s];
|
|
73
|
-
this.approvals.set(t.approveTo, e);
|
|
74
|
-
}
|
|
75
|
-
return r && this.events.add(i), !0;
|
|
76
|
-
}
|
|
77
|
-
return !1;
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
//#endregion
|
|
81
|
-
export { r as AbstractApprovalsSnapshotService };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../constants/protocol.constants.cjs`),t=require(`../../../functions/utils/amounts.utils.cjs`),n=require(`../../../crypto/poseidon.cjs`);require(`../../../crypto/index.cjs`);const r=require(`../../merkle-tree/MerkleTree.cjs`);require(`../../merkle-tree/index.cjs`);const i=require(`../../../functions/utils/merkleTree.utils.cjs`),a=require(`./AbstractSolanaSnapshotService.cjs`);let o=require(`@solana/web3.js`);var s=class extends a.AbstractSolanaSnapshotService{constructor(e){super(e,`NewAccessKeyAdded`)}_merkleTree;_senderAddresses;_senderAddressIndexMap;get merkleTree(){return this._merkleTree}get senderAddresses(){return this._senderAddresses}get senderAddressIndexMap(){return this._senderAddressIndexMap}serializeSnapshot(e){return{merkleTree:e.payload.merkleTree.toJSON(),senderAddresses:Array.from(e.payload.senderAddresses),latestBlockNumber:e.latestBlockNumber,senderAddressIndexMap:Array.from(e.payload.senderAddressIndexMap).map(([e,t])=>({address:e,index:t}))}}deserializeSnapshot(e){let t,a;return t=e.latestBlockNumber&&e.merkleTree?i.contructMerkleTreeFromSerialized(e.merkleTree):r.MerkleTree.create(n.poseidonFunction,0n),a=e.latestBlockNumber&&e.senderAddressIndexMap?new Map(e.senderAddressIndexMap.map(({address:e,index:t})=>[e,t])):new Map,{latestBlockNumber:e.latestBlockNumber??0,payload:{merkleTree:t,senderAddresses:e.senderAddresses??[],senderAddressIndexMap:a}}}acceptEvent(t,n){try{return this._merkleTree.insert(t.access_key,t.index),this._senderAddressIndexMap.set(t.sender_address,Math.max(Number(t.index),this._senderAddressIndexMap.get(t.sender_address)??0)),this._senderAddresses.includes(t.sender_address)||this._senderAddresses.push(t.sender_address),t.access_key===0n&&t.sender_address===e.zeroAddress&&this._merkleTree.remove(t.index),!0}catch(e){return console.error(e),!1}}mapEvent(e){let n=e.getArg(`access_key`),r=e.getArg(`index`),i=e.getArg(`sender_address`);return{access_key:t.advancedToBigInt(n),index:t.advancedToBigInt(r),sender_address:new o.PublicKey(i).toBase58()}}getSnapshotPayload(){return{merkleTree:this._merkleTree,senderAddresses:this._senderAddresses,senderAddressIndexMap:this._senderAddressIndexMap}}populateSnapshot({payload:{merkleTree:e,senderAddresses:t,senderAddressIndexMap:n}}){this._merkleTree=e,this._senderAddresses=t,this._senderAddressIndexMap=n}};exports.AbstractSolanaAccessTokenSnapshotService=s;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { MerkleTree, MerkleTreeJson } from '../../merkle-tree';
|
|
2
|
-
import { SolanaAccessTokenEvent } from '../../../types';
|
|
3
|
-
import { AbstractSolanaSnapshotService, SolanaSnapshot } from './AbstractSolanaSnapshotService';
|
|
4
|
-
import { SolanaBlockchainEventEmitter } from './SolanaBlockchainEventEmitter';
|
|
5
|
-
import { BlockchainEvent } from '../../BlockchainEvent/BlockchainEvent';
|
|
6
|
-
export type SolanaSenderAddressIndexMapJson = {
|
|
7
|
-
address: string;
|
|
8
|
-
index: number;
|
|
9
|
-
}[];
|
|
10
|
-
export type SolanaAccessTokenSnapshotPayload = {
|
|
11
|
-
readonly merkleTree: MerkleTree<bigint>;
|
|
12
|
-
readonly senderAddresses: string[];
|
|
13
|
-
readonly senderAddressIndexMap: Map<string, number>;
|
|
14
|
-
};
|
|
15
|
-
export type SolanaAccessTokenSerializedSnapshot = {
|
|
16
|
-
latestBlockNumber?: number;
|
|
17
|
-
merkleTree?: MerkleTreeJson;
|
|
18
|
-
senderAddresses?: string[];
|
|
19
|
-
senderAddressIndexMap?: SolanaSenderAddressIndexMapJson;
|
|
20
|
-
};
|
|
21
|
-
export declare abstract class AbstractSolanaAccessTokenSnapshotService extends AbstractSolanaSnapshotService<SolanaAccessTokenEvent<bigint, string>, SolanaAccessTokenSnapshotPayload, SolanaAccessTokenSerializedSnapshot> {
|
|
22
|
-
constructor(accessTokenEventFetcher: SolanaBlockchainEventEmitter);
|
|
23
|
-
private _merkleTree;
|
|
24
|
-
private _senderAddresses;
|
|
25
|
-
private _senderAddressIndexMap;
|
|
26
|
-
get merkleTree(): MerkleTree<bigint>;
|
|
27
|
-
get senderAddresses(): string[];
|
|
28
|
-
get senderAddressIndexMap(): Map<string, number>;
|
|
29
|
-
protected serializeSnapshot(snapshot: SolanaSnapshot<SolanaAccessTokenSnapshotPayload>): SolanaAccessTokenSerializedSnapshot;
|
|
30
|
-
protected deserializeSnapshot(serializedSnapshot: SolanaAccessTokenSerializedSnapshot): SolanaSnapshot<SolanaAccessTokenSnapshotPayload>;
|
|
31
|
-
protected acceptEvent(event: SolanaAccessTokenEvent<bigint, string>, _slot: number): boolean;
|
|
32
|
-
protected mapEvent(event: BlockchainEvent): SolanaAccessTokenEvent<bigint, string>;
|
|
33
|
-
protected getSnapshotPayload(): SolanaAccessTokenSnapshotPayload;
|
|
34
|
-
protected populateSnapshot({ payload: { merkleTree, senderAddresses, senderAddressIndexMap }, }: SolanaSnapshot<SolanaAccessTokenSnapshotPayload>): void;
|
|
35
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { zeroAddress as e } from "../../../constants/protocol.constants.mjs";
|
|
2
|
-
import { advancedToBigInt as t } from "../../../functions/utils/amounts.utils.mjs";
|
|
3
|
-
import { poseidonFunction as n } from "../../../crypto/poseidon.mjs";
|
|
4
|
-
import "../../../crypto/index.mjs";
|
|
5
|
-
import { MerkleTree as r } from "../../merkle-tree/MerkleTree.mjs";
|
|
6
|
-
import "../../merkle-tree/index.mjs";
|
|
7
|
-
import { contructMerkleTreeFromSerialized as i } from "../../../functions/utils/merkleTree.utils.mjs";
|
|
8
|
-
import { AbstractSolanaSnapshotService as a } from "./AbstractSolanaSnapshotService.mjs";
|
|
9
|
-
import { PublicKey as o } from "@solana/web3.js";
|
|
10
|
-
//#region libs/shared/common/src/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.ts
|
|
11
|
-
var s = class extends a {
|
|
12
|
-
constructor(e) {
|
|
13
|
-
super(e, "NewAccessKeyAdded");
|
|
14
|
-
}
|
|
15
|
-
_merkleTree;
|
|
16
|
-
_senderAddresses;
|
|
17
|
-
_senderAddressIndexMap;
|
|
18
|
-
get merkleTree() {
|
|
19
|
-
return this._merkleTree;
|
|
20
|
-
}
|
|
21
|
-
get senderAddresses() {
|
|
22
|
-
return this._senderAddresses;
|
|
23
|
-
}
|
|
24
|
-
get senderAddressIndexMap() {
|
|
25
|
-
return this._senderAddressIndexMap;
|
|
26
|
-
}
|
|
27
|
-
serializeSnapshot(e) {
|
|
28
|
-
return {
|
|
29
|
-
merkleTree: e.payload.merkleTree.toJSON(),
|
|
30
|
-
senderAddresses: Array.from(e.payload.senderAddresses),
|
|
31
|
-
latestBlockNumber: e.latestBlockNumber,
|
|
32
|
-
senderAddressIndexMap: Array.from(e.payload.senderAddressIndexMap).map(([e, t]) => ({
|
|
33
|
-
address: e,
|
|
34
|
-
index: t
|
|
35
|
-
}))
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
deserializeSnapshot(e) {
|
|
39
|
-
let t, a;
|
|
40
|
-
return t = e.latestBlockNumber && e.merkleTree ? i(e.merkleTree) : r.create(n, 0n), a = e.latestBlockNumber && e.senderAddressIndexMap ? new Map(e.senderAddressIndexMap.map(({ address: e, index: t }) => [e, t])) : /* @__PURE__ */ new Map(), {
|
|
41
|
-
latestBlockNumber: e.latestBlockNumber ?? 0,
|
|
42
|
-
payload: {
|
|
43
|
-
merkleTree: t,
|
|
44
|
-
senderAddresses: e.senderAddresses ?? [],
|
|
45
|
-
senderAddressIndexMap: a
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
acceptEvent(t, n) {
|
|
50
|
-
try {
|
|
51
|
-
return this._merkleTree.insert(t.access_key, t.index), this._senderAddressIndexMap.set(t.sender_address, Math.max(Number(t.index), this._senderAddressIndexMap.get(t.sender_address) ?? 0)), this._senderAddresses.includes(t.sender_address) || this._senderAddresses.push(t.sender_address), t.access_key === 0n && t.sender_address === e && this._merkleTree.remove(t.index), !0;
|
|
52
|
-
} catch (e) {
|
|
53
|
-
return console.error(e), !1;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
mapEvent(e) {
|
|
57
|
-
let n = e.getArg("access_key"), r = e.getArg("index"), i = e.getArg("sender_address");
|
|
58
|
-
return {
|
|
59
|
-
access_key: t(n),
|
|
60
|
-
index: t(r),
|
|
61
|
-
sender_address: new o(i).toBase58()
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
getSnapshotPayload() {
|
|
65
|
-
return {
|
|
66
|
-
merkleTree: this._merkleTree,
|
|
67
|
-
senderAddresses: this._senderAddresses,
|
|
68
|
-
senderAddressIndexMap: this._senderAddressIndexMap
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
populateSnapshot({ payload: { merkleTree: e, senderAddresses: t, senderAddressIndexMap: n } }) {
|
|
72
|
-
this._merkleTree = e, this._senderAddresses = t, this._senderAddressIndexMap = n;
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
//#endregion
|
|
76
|
-
export { s as AbstractSolanaAccessTokenSnapshotService };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../functions/web3/etherFunctions.cjs`),t=require(`../../crypto/poseidon.cjs`),n=require(`./MerkleTree.cjs`);var r=(r,i,a,o)=>{if(!o||a){let r=n.MerkleTree.create(t.poseidonFunction,0n);return r.insert(BigInt(i),r.getStartIndex()),o||r.insert(e.randomBigInt(31),r.getStartIndex()+1n),r}return r};exports.getPatchedAccessTokenMerkleTree=r;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { randomBigInt as e } from "../../functions/web3/etherFunctions.mjs";
|
|
2
|
-
import { poseidonFunction as t } from "../../crypto/poseidon.mjs";
|
|
3
|
-
import { MerkleTree as n } from "./MerkleTree.mjs";
|
|
4
|
-
//#region libs/shared/common/src/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.ts
|
|
5
|
-
var r = (r, i, a, o) => {
|
|
6
|
-
if (!o || a) {
|
|
7
|
-
let r = n.create(t, 0n);
|
|
8
|
-
return r.insert(BigInt(i), r.getStartIndex()), o || r.insert(e(31), r.getStartIndex() + 1n), r;
|
|
9
|
-
}
|
|
10
|
-
return r;
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
13
|
-
export { r as getPatchedAccessTokenMerkleTree };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../../functions/utils/getContractAddress.cjs`),t=require(`../../../functions/utils/getSignerFromContract.cjs`),n=require(`../../event-service/evm/AbstractAccessTokenSnapshotService.cjs`);require(`../../event-service/index.cjs`);const r=require(`../SnapshotFetcherService.cjs`);var i=class extends n.AbstractAccessTokenSnapshotService{snapshotsService;constructor(e,t){super(e),this.snapshotsService=t}async fetchSnapshot(){let{contract:n}=this.blockchainEventEmitter,{chainId:i}=await t.getProviderFromContract(n).getNetwork(),a=Number(i);this.snapshotsService||=new r.SnapshotFetcherService(a,e.getContractAddress(n));let o=await this.snapshotsService.getAccessTokens();if(o.accessTokenContractAddress!==e.getContractAddress(n)||o.chainId!==a)throw Error(`Commitment Snapshot: incorrect contract or chain id`);return{latestBlockNumber:o.latestBlockNumber,merkleTree:o.merkleTree,senderAddresses:o.senderAddresses,senderAddressIndexMap:o.senderAddressIndexMap}}persistSnapshot(e){return Promise.resolve()}};exports.ClientAccessTokenSnapshotService=i;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AbstractAccessTokenSnapshotService, AccessTokenSerializedSnapshot, BlockchainEventEmitter } from '../../event-service';
|
|
2
|
-
import { SnapshotFetcherService } from '../SnapshotFetcherService';
|
|
3
|
-
export declare class ClientAccessTokenSnapshotService extends AbstractAccessTokenSnapshotService {
|
|
4
|
-
private snapshotsService;
|
|
5
|
-
constructor(accessTokenEventFetcher: BlockchainEventEmitter, snapshotFetcher: SnapshotFetcherService);
|
|
6
|
-
protected fetchSnapshot(): Promise<AccessTokenSerializedSnapshot>;
|
|
7
|
-
protected persistSnapshot(_serializedSnapshot: AccessTokenSerializedSnapshot): Promise<unknown>;
|
|
8
|
-
}
|