@hinkal/common 0.2.26 → 0.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API/API.cjs +1 -1
- package/API/API.d.ts +35 -17
- package/API/API.mjs +100 -80
- package/API/admin-calls.cjs +1 -1
- package/API/admin-calls.d.ts +8 -1
- package/API/admin-calls.mjs +6 -5
- package/API/callLifiAPI.cjs +1 -1
- package/API/callLifiAPI.d.ts +1 -1
- package/API/callLifiAPI.mjs +5 -5
- package/API/callMonitor.cjs +1 -1
- package/API/callMonitor.d.ts +1 -1
- package/API/callMonitor.mjs +7 -7
- package/API/callOdosAPI.cjs +1 -1
- package/API/callOdosAPI.mjs +11 -11
- package/API/callOkxAPI.cjs +1 -1
- package/API/callOkxAPI.d.ts +1 -1
- package/API/callOkxAPI.mjs +5 -5
- package/API/callOneInchAPI.cjs +1 -1
- package/API/callOneInchAPI.mjs +10 -11
- package/API/callRelayer.cjs +1 -1
- package/API/callRelayer.d.ts +14 -6
- package/API/callRelayer.mjs +11 -11
- package/API/checkRisk.cjs +1 -1
- package/API/checkRisk.d.ts +1 -1
- package/API/checkRisk.mjs +4 -4
- package/API/deposit-and-withdraw-status-calls.cjs +1 -1
- package/API/deposit-and-withdraw-status-calls.d.ts +3 -2
- package/API/deposit-and-withdraw-status-calls.mjs +8 -8
- package/API/enclaveSignatureCalls.cjs +1 -0
- package/API/enclaveSignatureCalls.d.ts +10 -0
- package/API/enclaveSignatureCalls.mjs +16 -0
- package/API/enclaveUtxoCalls.cjs +1 -0
- package/API/enclaveUtxoCalls.d.ts +40 -0
- package/API/enclaveUtxoCalls.mjs +24 -0
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.d.ts +2 -1
- package/API/fetchCommitmentsCache.mjs +9 -9
- package/API/get-token-data.cjs +1 -1
- package/API/get-token-data.d.ts +1 -1
- package/API/get-token-data.mjs +5 -5
- package/API/get-token-price-chart-data.cjs +1 -0
- package/API/get-token-price-chart-data.d.ts +16 -0
- package/API/get-token-price-chart-data.mjs +13 -0
- package/API/getCoingeckoPrice.cjs +1 -1
- package/API/getCoingeckoPrice.d.ts +0 -1
- package/API/getCoingeckoPrice.mjs +15 -16
- package/API/getGasEstimates.cjs +1 -1
- package/API/getGasEstimates.mjs +9 -9
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.d.ts +3 -3
- package/API/getServerURL.mjs +51 -67
- package/API/getTokenPrice.cjs +1 -1
- package/API/getTokenPrice.d.ts +5 -0
- package/API/getTokenPrice.mjs +14 -7
- package/API/getWebsiteURL.cjs +1 -1
- package/API/getWebsiteURL.d.ts +1 -0
- package/API/getWebsiteURL.mjs +25 -10
- package/API/index.d.ts +3 -3
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +4 -8
- package/API/kycCalls.mjs +23 -26
- package/API/onrampCalls.cjs +1 -0
- package/API/onrampCalls.d.ts +20 -0
- package/API/onrampCalls.mjs +15 -0
- package/API/privacy-score-calls.cjs +1 -0
- package/API/privacy-score-calls.d.ts +17 -0
- package/API/privacy-score-calls.mjs +29 -0
- package/API/privateSendEmailNotificationsCalls.cjs +1 -0
- package/API/privateSendEmailNotificationsCalls.d.ts +8 -0
- package/API/privateSendEmailNotificationsCalls.mjs +11 -0
- package/API/privateSendNonceCalls.cjs +1 -0
- package/API/privateSendNonceCalls.d.ts +13 -0
- package/API/privateSendNonceCalls.mjs +15 -0
- package/API/privateSendRecipientInfoCalls.cjs +1 -0
- package/API/privateSendRecipientInfoCalls.d.ts +21 -0
- package/API/privateSendRecipientInfoCalls.mjs +15 -0
- package/API/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.d.ts +4 -2
- package/API/proxyAccountsCalls.mjs +18 -20
- package/API/relayCalls.cjs +1 -1
- package/API/relayCalls.mjs +4 -4
- package/API/rewardsUserCalls.cjs +1 -1
- package/API/rewardsUserCalls.d.ts +9 -0
- package/API/rewardsUserCalls.mjs +28 -22
- package/API/scheduled-transactions-calls.cjs +1 -1
- package/API/scheduled-transactions-calls.d.ts +2 -2
- package/API/scheduled-transactions-calls.mjs +9 -8
- package/API/simulate-batch-tx.cjs +1 -1
- package/API/simulate-batch-tx.d.ts +2 -2
- package/API/simulate-batch-tx.mjs +7 -6
- package/API/simulate-transaction.cjs +1 -0
- package/API/{is-tx-stateless.d.ts → simulate-transaction.d.ts} +1 -1
- package/API/simulate-transaction.mjs +18 -0
- package/API/snapshot-event-calls.cjs +1 -0
- package/API/snapshot-event-calls.d.ts +7 -0
- package/API/snapshot-event-calls.mjs +13 -0
- package/API/solana-calls.cjs +1 -1
- package/API/solana-calls.d.ts +8 -4
- package/API/solana-calls.mjs +15 -15
- package/API/temporaryWalletCalls.cjs +1 -1
- package/API/temporaryWalletCalls.mjs +13 -19
- package/API/token-calls.cjs +1 -1
- package/API/token-calls.mjs +6 -5
- package/API/tronSubsidyCalls.cjs +1 -0
- package/API/tronSubsidyCalls.d.ts +13 -0
- package/API/tronSubsidyCalls.mjs +11 -0
- package/README.md +20 -13
- package/constants/activity.constants.cjs +1 -1
- package/constants/activity.constants.mjs +4 -2
- package/constants/addresses.constants.cjs +1 -1
- package/constants/addresses.constants.mjs +1 -1
- package/constants/bridging.constants.cjs +1 -1
- package/constants/bridging.constants.d.ts +4 -0
- package/constants/bridging.constants.mjs +6 -2
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +6 -6
- package/constants/chains.constants.mjs +112 -69
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +2 -1
- package/constants/coingecko.constants.mjs +49 -38
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-solana.json.mjs +390 -9
- package/constants/deploy-data/deploy-data-tronMainnet.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-tronMainnet.json.mjs +4638 -0
- package/constants/deploy-data/deploy-data-tronNile.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-tronNile.json.mjs +4638 -0
- package/constants/deploy-data/index.d.ts +3 -1
- package/constants/fees.constants.cjs +1 -1
- package/constants/fees.constants.d.ts +4 -1
- package/constants/fees.constants.mjs +8 -4
- package/constants/function-signatures.constants.cjs +1 -1
- package/constants/function-signatures.constants.d.ts +0 -1
- package/constants/function-signatures.constants.mjs +3 -4
- package/constants/images.constants.cjs +1 -0
- package/constants/images.constants.d.ts +1 -0
- package/constants/images.constants.mjs +4 -0
- package/constants/index.d.ts +6 -0
- package/constants/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.mjs +39 -40
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +5 -1
- package/constants/mediaUrls.constants.mjs +6 -2
- package/constants/non-circular-tokens.constants.cjs +1 -0
- package/constants/non-circular-tokens.constants.d.ts +1 -0
- package/constants/non-circular-tokens.constants.mjs +4 -0
- package/constants/pay.constants.cjs +1 -0
- package/constants/pay.constants.d.ts +1 -0
- package/constants/pay.constants.mjs +4 -0
- package/constants/permit2.constants.cjs +1 -1
- package/constants/permit2.constants.d.ts +0 -1
- package/constants/permit2.constants.mjs +10 -11
- package/constants/protocol.constants.cjs +1 -1
- package/constants/protocol.constants.d.ts +6 -1
- package/constants/protocol.constants.mjs +38 -33
- package/constants/reorg-depths.constants.cjs +1 -1
- package/constants/reorg-depths.constants.mjs +3 -0
- package/constants/save-depths.cjs +1 -1
- package/constants/save-depths.mjs +6 -3
- package/constants/schedule.constants.cjs +1 -0
- package/constants/schedule.constants.d.ts +2 -0
- package/constants/schedule.constants.mjs +14 -0
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +31 -123
- package/constants/server.constants.mjs +65 -156
- package/constants/tasks.constants.cjs +1 -1
- package/constants/tasks.constants.mjs +5 -4
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +48 -34
- package/constants/token-data/arbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistry.json.mjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.mjs +1 -1
- package/constants/token-data/arcTestnetRegistry.json.cjs +1 -1
- package/constants/token-data/arcTestnetRegistry.json.mjs +2 -2
- package/constants/token-data/avalancheRegistry.json.cjs +1 -1
- package/constants/token-data/avalancheRegistry.json.mjs +1 -1
- package/constants/token-data/avalancheRegistryFixed.json.cjs +1 -1
- package/constants/token-data/avalancheRegistryFixed.json.mjs +1 -1
- package/constants/token-data/baseRegistry.json.cjs +1 -1
- package/constants/token-data/baseRegistry.json.mjs +3 -3
- package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
- package/constants/token-data/baseRegistryFixed.json.mjs +1 -1
- package/constants/token-data/bnbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistry.json.mjs +2 -2
- package/constants/token-data/bnbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistryFixed.json.mjs +2 -2
- package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistry.json.mjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.mjs +1 -1
- package/constants/token-data/index.d.ts +2 -2
- package/constants/token-data/solanaMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/solanaMainnetRegistry.json.mjs +143 -74
- package/constants/token-data/tronMainnetRegistry.json.cjs +1 -0
- package/constants/token-data/tronMainnetRegistry.json.mjs +24 -0
- package/constants/token-data/tronNileRegistry.json.cjs +1 -0
- package/constants/token-data/tronNileRegistry.json.mjs +24 -0
- package/constants/tokens.constants.cjs +1 -0
- package/constants/tokens.constants.d.ts +3 -0
- package/constants/tokens.constants.mjs +15 -0
- package/constants/tx-confirmation.constants.cjs +1 -0
- package/constants/tx-confirmation.constants.d.ts +4 -0
- package/constants/tx-confirmation.constants.mjs +7 -0
- package/constants/wallet.constants.cjs +1 -1
- package/constants/wallet.constants.d.ts +1 -7
- package/constants/wallet.constants.mjs +18 -8
- package/crypto/poseidon.cjs +1 -1
- package/crypto/poseidon.mjs +5 -5
- package/data-structures/AccountActions/AccountActions.cjs +1 -0
- package/data-structures/AccountActions/AccountActions.d.ts +17 -0
- package/data-structures/AccountActions/AccountActions.mjs +67 -0
- package/data-structures/AccountActions/index.d.ts +1 -0
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +106 -109
- package/data-structures/BlockchainEvent/BlockchainEvent.cjs +1 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.d.ts +14 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.mjs +45 -0
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +66 -74
- package/data-structures/Hinkal/Hinkal.mjs +366 -392
- package/data-structures/Hinkal/IHinkal.d.ts +61 -71
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.d.ts +2 -4
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +146 -79
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.d.ts +1 -2
- package/data-structures/Hinkal/hinkalActionReceive.mjs +26 -22
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.d.ts +1 -0
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +34 -22
- package/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -0
- package/data-structures/Hinkal/hinkalClaimUtxo.d.ts +6 -0
- package/data-structures/Hinkal/hinkalClaimUtxo.mjs +119 -0
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.d.ts +2 -2
- package/data-structures/Hinkal/hinkalDeposit.mjs +101 -92
- package/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -0
- package/data-structures/Hinkal/{hinkalDepostAndBridge.d.ts → hinkalDepositAndBridge.d.ts} +2 -2
- package/data-structures/Hinkal/hinkalDepositAndBridge.mjs +259 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +2 -2
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +159 -102
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +131 -92
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +4 -5
- package/data-structures/Hinkal/hinkalMultiSend.cjs +1 -1
- package/data-structures/Hinkal/hinkalMultiSend.d.ts +1 -1
- package/data-structures/Hinkal/hinkalMultiSend.mjs +4 -4
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +121 -125
- package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +2 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +188 -38
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.d.ts +1 -2
- package/data-structures/Hinkal/hinkalProxySwap.mjs +34 -31
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +32 -28
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +1 -2
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +17 -15
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.d.ts +5 -0
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +130 -0
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +6 -3
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +98 -110
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +3 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +228 -197
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.d.ts +5 -0
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +28 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +4 -4
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +44 -43
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +2 -2
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +73 -71
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +3 -3
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +79 -64
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +122 -100
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +29 -2
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +132 -70
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +3 -2
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +113 -75
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +71 -103
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.d.ts +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +96 -96
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.d.ts +2 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +97 -99
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.d.ts +1 -2
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +204 -113
- package/data-structures/Hinkal/index.d.ts +4 -0
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +109 -54
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.d.ts +4 -5
- package/data-structures/IndexedDB/activity-db.mjs +124 -131
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +45 -38
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +43 -36
- package/data-structures/IndexedDB/index.d.ts +1 -0
- package/data-structures/IndexedDB/pay-activity-db.cjs +1 -0
- package/data-structures/IndexedDB/pay-activity-db.d.ts +9 -0
- package/data-structures/IndexedDB/pay-activity-db.mjs +26 -0
- package/data-structures/IndexedDB/prices-db.cjs +1 -1
- package/data-structures/IndexedDB/prices-db.mjs +1 -1
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +26 -40
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +82 -79
- package/data-structures/TokenDBs/token-visibility-db.cjs +1 -1
- package/data-structures/TokenDBs/token-visibility-db.mjs +22 -36
- package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.mjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +29 -30
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +9 -11
- package/data-structures/crypto-keys/keys.mjs +65 -110
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.mjs +9 -9
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.mjs +5 -5
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.d.ts +9 -4
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.mjs +65 -48
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractEventService.d.ts +4 -2
- package/data-structures/event-service/evm/AbstractEventService.mjs +13 -13
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +5 -5
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +2 -2
- package/data-structures/event-service/evm/AbstractSnapshotService.mjs +5 -6
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +18 -7
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +75 -49
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.d.ts +11 -0
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +25 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.d.ts +6 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.mjs +16 -0
- package/data-structures/event-service/helpers/ClientEventHelper.cjs +1 -0
- package/data-structures/event-service/helpers/ClientEventHelper.d.ts +10 -0
- package/data-structures/event-service/helpers/ClientEventHelper.mjs +38 -0
- package/data-structures/event-service/helpers/PollingEventHelper.cjs +1 -0
- package/data-structures/event-service/helpers/PollingEventHelper.d.ts +5 -0
- package/data-structures/event-service/helpers/PollingEventHelper.mjs +14 -0
- package/data-structures/event-service/index.d.ts +4 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +3 -2
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +6 -6
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.d.ts +9 -4
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +65 -48
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +5 -10
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +13 -7
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +3 -2
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +4 -4
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +1 -2
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +1 -2
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.d.ts +11 -0
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.mjs +26 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.d.ts +6 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.mjs +16 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +20 -19
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +126 -76
- package/data-structures/index.d.ts +2 -0
- package/data-structures/merkle-tree/MerkleTree.cjs +1 -1
- package/data-structures/merkle-tree/MerkleTree.d.ts +3 -2
- package/data-structures/merkle-tree/MerkleTree.mjs +27 -17
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs +1 -1
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.ts +1 -2
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs +6 -6
- package/data-structures/presale/PresaleContractWrapper.d.ts +1 -1
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +9 -13
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +23 -18
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +12 -7
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +11 -5
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +9 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +9 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +12 -6
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +10 -5
- package/error-handling/customErrors/ErrorWithIndex.cjs +1 -0
- package/error-handling/customErrors/ErrorWithIndex.d.ts +4 -0
- package/error-handling/customErrors/ErrorWithIndex.mjs +9 -0
- package/error-handling/customErrors/ErrorWithTx.cjs +1 -1
- package/error-handling/customErrors/ErrorWithTx.d.ts +2 -3
- package/error-handling/customErrors/ErrorWithTx.mjs +5 -5
- package/error-handling/customErrors/index.d.ts +1 -0
- package/error-handling/error-codes.constants.cjs +2 -2
- package/error-handling/error-codes.constants.d.ts +29 -0
- package/error-handling/error-codes.constants.mjs +51 -22
- package/error-handling/get-error.message.cjs +1 -1
- package/error-handling/get-error.message.mjs +46 -47
- package/error-handling/index.d.ts +0 -1
- package/error-handling/isInsufficientFundsError.cjs +1 -0
- package/error-handling/isInsufficientFundsError.d.ts +1 -0
- package/error-handling/isInsufficientFundsError.mjs +19 -0
- package/functions/auto-deposit-back-helpers/get-gas-token-records.cjs +1 -0
- package/functions/auto-deposit-back-helpers/get-gas-token-records.d.ts +9 -0
- package/functions/auto-deposit-back-helpers/get-gas-token-records.mjs +74 -0
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.cjs +1 -0
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.d.ts +3 -0
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.mjs +61 -0
- package/functions/auto-deposit-back-helpers/index.d.ts +4 -0
- package/functions/auto-deposit-back-helpers/select-gas-token.cjs +1 -0
- package/functions/auto-deposit-back-helpers/select-gas-token.d.ts +13 -0
- package/functions/auto-deposit-back-helpers/select-gas-token.mjs +79 -0
- package/functions/auto-deposit-back-helpers/update-hinkal.cjs +1 -0
- package/functions/auto-deposit-back-helpers/update-hinkal.d.ts +3 -0
- package/functions/auto-deposit-back-helpers/update-hinkal.mjs +18 -0
- package/functions/connectors.types.d.ts +11 -3
- package/functions/index.d.ts +1 -0
- package/functions/kyc/zkMeHelper.cjs +1 -1
- package/functions/kyc/zkMeHelper.mjs +17 -16
- package/functions/pre-transaction/addressTableLookup.cjs +1 -1
- package/functions/pre-transaction/addressTableLookup.mjs +1 -1
- package/functions/pre-transaction/constructAdminData.cjs +1 -1
- package/functions/pre-transaction/constructAdminData.d.ts +2 -2
- package/functions/pre-transaction/constructAdminData.mjs +12 -18
- package/functions/pre-transaction/convert-okx-instructions.cjs +1 -1
- package/functions/pre-transaction/convert-okx-instructions.mjs +20 -16
- package/functions/pre-transaction/ensureAmountChanges.cjs +1 -0
- package/functions/pre-transaction/ensureAmountChanges.d.ts +2 -0
- package/functions/pre-transaction/ensureAmountChanges.mjs +11 -0
- package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
- package/functions/pre-transaction/getExternalSwapAddress.d.ts +1 -2
- package/functions/pre-transaction/getExternalSwapAddress.mjs +8 -8
- package/functions/pre-transaction/getFeeStructure.cjs +1 -1
- package/functions/pre-transaction/getFeeStructure.d.ts +2 -1
- package/functions/pre-transaction/getFeeStructure.mjs +13 -12
- package/functions/pre-transaction/getKycAndSignatureData.cjs +1 -0
- package/functions/pre-transaction/getKycAndSignatureData.d.ts +5 -0
- package/functions/pre-transaction/getKycAndSignatureData.mjs +20 -0
- package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +22 -36
- package/functions/pre-transaction/index.d.ts +4 -0
- package/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
- package/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +1 -1
- package/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +17 -17
- package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -1
- package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +1 -9
- package/functions/pre-transaction/outputApprovalDataProcessing.mjs +19 -34
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -1
- package/functions/pre-transaction/sendV0Transaction.d.ts +4 -8
- package/functions/pre-transaction/sendV0Transaction.mjs +150 -86
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +7 -4
- package/functions/pre-transaction/store-instructions.cjs +1 -1
- package/functions/pre-transaction/store-instructions.mjs +11 -6
- package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs +1 -0
- package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.d.ts +3 -0
- package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs +33 -0
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +12 -7
- package/functions/private-wallet/emporium.helpers.mjs +105 -131
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.d.ts +1 -4
- package/functions/private-wallet/emporium.swap.helpers.mjs +98 -100
- package/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/functions/snarkjs/common.snarkjs.d.ts +4 -5
- package/functions/snarkjs/common.snarkjs.mjs +113 -111
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.mjs +7 -1
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.d.ts +4 -4
- package/functions/snarkjs/constructEmporiumProof.mjs +111 -121
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +2 -2
- package/functions/snarkjs/constructGeneralZkProof.mjs +104 -124
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/functions/snarkjs/constructSolanaZkProof.d.ts +1 -1
- package/functions/snarkjs/constructSolanaZkProof.mjs +58 -64
- package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +11 -10
- package/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -0
- package/functions/snarkjs/fetchOnChainRootHashes.d.ts +4 -0
- package/functions/snarkjs/fetchOnChainRootHashes.mjs +15 -0
- package/functions/snarkjs/generateCircomData.cjs +1 -1
- package/functions/snarkjs/generateCircomData.d.ts +3 -3
- package/functions/snarkjs/generateCircomData.mjs +29 -31
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.cjs +1 -1
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.d.ts +12 -1
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +161 -65
- package/functions/snarkjs/getZKFiles.cjs +1 -1
- package/functions/snarkjs/getZKFiles.mjs +8 -11
- package/functions/snarkjs/index.d.ts +1 -0
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +3 -0
- package/functions/utils/addresses.mjs +32 -17
- package/functions/utils/amounts.utils.cjs +1 -1
- package/functions/utils/amounts.utils.d.ts +1 -1
- package/functions/utils/amounts.utils.mjs +2 -2
- package/functions/utils/buildClaimableDepositPlan.cjs +1 -0
- package/functions/utils/buildClaimableDepositPlan.d.ts +15 -0
- package/functions/utils/buildClaimableDepositPlan.mjs +40 -0
- package/functions/utils/cacheDevice.utils.cjs +1 -1
- package/functions/utils/cacheDevice.utils.mjs +8 -6
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.mjs +2 -2
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +1 -1
- package/functions/utils/create-provider.mjs +11 -7
- package/functions/utils/enclave-signature-storage.cjs +1 -0
- package/functions/utils/enclave-signature-storage.d.ts +2 -0
- package/functions/utils/enclave-signature-storage.mjs +13 -0
- package/functions/utils/enclave-utxo-storage.cjs +1 -0
- package/functions/utils/enclave-utxo-storage.d.ts +6 -0
- package/functions/utils/enclave-utxo-storage.mjs +34 -0
- package/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +21 -21
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.mjs +35 -35
- package/functions/utils/evmNetworkFunctions.cjs +1 -1
- package/functions/utils/evmNetworkFunctions.mjs +5 -3
- package/functions/utils/fees.utils.cjs +1 -1
- package/functions/utils/fees.utils.mjs +31 -29
- package/functions/utils/getBlockExplorerUrl.cjs +1 -1
- package/functions/utils/getBlockExplorerUrl.mjs +3 -3
- package/functions/utils/getDataFromTransaction.d.ts +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +2 -1
- package/functions/utils/getUtxosFromReceipt.utils.mjs +44 -15
- package/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
- package/functions/utils/getUtxosFromReceiptSolana.d.ts +2 -1
- package/functions/utils/getUtxosFromReceiptSolana.mjs +27 -16
- package/functions/utils/index.d.ts +12 -2
- package/functions/utils/involves-permit2-op.cjs +1 -1
- package/functions/utils/involves-permit2-op.d.ts +0 -1
- package/functions/utils/involves-permit2-op.mjs +4 -6
- package/functions/utils/mutexes.utils.cjs +1 -1
- package/functions/utils/mutexes.utils.d.ts +1 -1
- package/functions/utils/mutexes.utils.mjs +3 -3
- package/functions/utils/networks.utils.cjs +1 -1
- package/functions/utils/networks.utils.mjs +4 -2
- package/functions/utils/nftTokenFunctions.cjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +9 -23
- package/functions/utils/prepareHinkal.cjs +1 -1
- package/functions/utils/prepareHinkal.d.ts +6 -13
- package/functions/utils/prepareHinkal.mjs +44 -71
- package/functions/utils/process.utils.cjs +1 -1
- package/functions/utils/process.utils.d.ts +6 -0
- package/functions/utils/process.utils.mjs +22 -10
- package/functions/utils/proxyAvatar.utils.cjs +1 -0
- package/functions/utils/proxyAvatar.utils.d.ts +2 -0
- package/functions/utils/proxyAvatar.utils.mjs +5 -0
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.d.ts +1 -1
- package/functions/utils/publicBalance.utils.mjs +55 -53
- package/functions/utils/serialize-utxos.utils.cjs +1 -0
- package/functions/utils/serialize-utxos.utils.d.ts +3 -0
- package/functions/utils/serialize-utxos.utils.mjs +13 -0
- package/functions/utils/string.utils.cjs +1 -1
- package/functions/utils/string.utils.d.ts +2 -0
- package/functions/utils/string.utils.mjs +35 -27
- package/functions/utils/time.utils.cjs +1 -1
- package/functions/utils/time.utils.mjs +1 -1
- package/functions/utils/token-check.utils.cjs +1 -1
- package/functions/utils/token-check.utils.d.ts +3 -0
- package/functions/utils/token-check.utils.mjs +18 -7
- package/functions/utils/tron.utils.cjs +1 -0
- package/functions/utils/tron.utils.d.ts +25 -0
- package/functions/utils/tron.utils.mjs +128 -0
- package/functions/utils/tronSimulation.utils.cjs +1 -0
- package/functions/utils/tronSimulation.utils.d.ts +1 -0
- package/functions/utils/tronSimulation.utils.mjs +30 -0
- package/functions/utils/tx-confirmation.utils.cjs +1 -0
- package/functions/utils/tx-confirmation.utils.d.ts +10 -0
- package/functions/utils/tx-confirmation.utils.mjs +50 -0
- package/functions/utils/upToDateState.cjs +1 -1
- package/functions/utils/upToDateState.d.ts +1 -1
- package/functions/utils/upToDateState.mjs +4 -4
- package/functions/utils/userAgent.cjs +1 -1
- package/functions/utils/userAgent.d.ts +0 -2
- package/functions/utils/userAgent.mjs +4 -23
- package/functions/utils/validateUsername.cjs +1 -0
- package/functions/utils/validateUsername.d.ts +5 -0
- package/functions/utils/validateUsername.mjs +16 -0
- package/functions/utils/walletBalances.utils.cjs +1 -1
- package/functions/utils/walletBalances.utils.d.ts +2 -17
- package/functions/utils/walletBalances.utils.mjs +5 -36
- package/functions/web3/connectors.utils.cjs +1 -1
- package/functions/web3/connectors.utils.d.ts +1 -0
- package/functions/web3/connectors.utils.mjs +14 -12
- package/functions/web3/crypto.cjs +1 -0
- package/functions/web3/crypto.d.ts +1 -0
- package/functions/web3/crypto.mjs +7 -0
- package/functions/web3/etherFunctions.cjs +1 -1
- package/functions/web3/etherFunctions.d.ts +1 -1
- package/functions/web3/etherFunctions.mjs +12 -15
- package/functions/web3/events/getApprovedBalance.cjs +1 -1
- package/functions/web3/events/getApprovedBalance.d.ts +3 -4
- package/functions/web3/events/getApprovedBalance.mjs +39 -44
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.d.ts +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.mjs +127 -132
- package/functions/web3/events/getShieldedBalance.cjs +1 -2
- package/functions/web3/events/getShieldedBalance.d.ts +1 -1
- package/functions/web3/events/getShieldedBalance.mjs +72 -69
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.mjs +40 -36
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +17 -10
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +1 -6
- package/functions/web3/functionCalls/accessTokenCalls.mjs +19 -25
- package/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/functions/web3/functionCalls/approveToken.d.ts +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +68 -63
- package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -1
- package/functions/web3/functionCalls/approveTokensToHinkal.d.ts +1 -1
- package/functions/web3/functionCalls/approveTokensToHinkal.mjs +6 -6
- package/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
- package/functions/web3/functionCalls/constructBatchCall.d.ts +3 -2
- package/functions/web3/functionCalls/constructBatchCall.mjs +53 -16
- package/functions/web3/functionCalls/estimateGasRelayer.d.ts +2 -3
- package/functions/web3/functionCalls/recoverTransactionFromError.cjs +1 -1
- package/functions/web3/functionCalls/recoverTransactionFromError.mjs +8 -7
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.d.ts +2 -2
- package/functions/web3/functionCalls/transactCallDirect.mjs +58 -48
- package/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -0
- package/functions/web3/functionCalls/transactCallDirectTron.d.ts +6 -0
- package/functions/web3/functionCalls/transactCallDirectTron.mjs +63 -0
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +15 -6
- package/functions/web3/functionCalls/transactCallRelayer.mjs +72 -67
- package/functions/web3/functionCalls/waitForErc20Approvals.cjs +1 -0
- package/functions/web3/functionCalls/waitForErc20Approvals.d.ts +9 -0
- package/functions/web3/functionCalls/waitForErc20Approvals.mjs +54 -0
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +14 -18
- package/functions/web3/getPublicAddressBalance.cjs +1 -1
- package/functions/web3/getPublicAddressBalance.d.ts +1 -1
- package/functions/web3/getPublicAddressBalance.mjs +7 -7
- package/functions/web3/getSolanaPriorityFee.cjs +1 -0
- package/functions/web3/getSolanaPriorityFee.d.ts +3 -0
- package/functions/web3/getSolanaPriorityFee.mjs +32 -0
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +35 -31
- package/functions/web3/index.d.ts +3 -0
- package/functions/web3/lifiAPI.cjs +1 -1
- package/functions/web3/lifiAPI.d.ts +1 -1
- package/functions/web3/lifiAPI.mjs +12 -12
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.mjs +4 -15
- package/functions/web3/okxAPI.cjs +1 -1
- package/functions/web3/okxAPI.mjs +13 -13
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +9 -20
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +38 -50
- package/functions/web3/tron-wagmi-adapter.cjs +1 -0
- package/functions/web3/tron-wagmi-adapter.d.ts +8 -0
- package/functions/web3/tron-wagmi-adapter.mjs +31 -0
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +24 -34
- package/index.cjs +1 -1
- package/index.mjs +1079 -958
- package/package.json +4 -2
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +11 -17
- package/providers/EthersProviderAdapter.mjs +53 -82
- package/providers/SolanaProviderAdapter.cjs +1 -1
- package/providers/SolanaProviderAdapter.d.ts +8 -11
- package/providers/SolanaProviderAdapter.mjs +20 -32
- package/providers/TronProviderAdapter.cjs +1 -0
- package/providers/TronProviderAdapter.d.ts +37 -0
- package/providers/TronProviderAdapter.mjs +145 -0
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +14 -19
- package/providers/WagmiProviderAdapter.mjs +104 -130
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.d.ts +2 -2
- package/providers/prepareEthersHinkal.mjs +17 -10
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +21 -13
- package/types/TransactionSimulator.types.d.ts +2 -9
- package/types/activities.types.cjs +1 -1
- package/types/activities.types.d.ts +13 -7
- package/types/activities.types.mjs +18 -18
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +11 -8
- package/types/admin.types.mjs +2 -2
- package/types/balances.types.d.ts +1 -1
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +12 -4
- package/types/cache.types.mjs +2 -2
- package/types/circom-data.types.d.ts +6 -14
- package/types/coingecko.types.d.ts +5 -0
- package/types/commitments.types.d.ts +4 -0
- package/types/connector.types.d.ts +1 -0
- package/types/ethereum-network.types.d.ts +1 -1
- package/types/events.types.cjs +1 -0
- package/types/events.types.d.ts +6 -0
- package/types/events.types.mjs +4 -0
- package/types/fee.types.cjs +1 -0
- package/types/fee.types.d.ts +4 -0
- package/types/fee.types.mjs +4 -0
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +5 -1
- package/types/hinkal.types.mjs +14 -13
- package/types/index.d.ts +5 -4
- package/types/onramp.types.cjs +1 -0
- package/types/onramp.types.d.ts +58 -0
- package/types/onramp.types.mjs +4 -0
- package/types/pay-activities.types.cjs +1 -0
- package/types/pay-activities.types.d.ts +29 -0
- package/types/pay-activities.types.mjs +6 -0
- package/types/proxy.types.d.ts +7 -3
- package/types/rewards.types.d.ts +1 -1
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +12 -72
- package/types/sandbox.types.mjs +2 -2
- package/types/schedule.types.cjs +1 -0
- package/types/schedule.types.d.ts +7 -0
- package/types/schedule.types.mjs +4 -0
- package/types/scheduled-transactions.types.d.ts +14 -0
- package/types/session.types.d.ts +2 -0
- package/types/solana.types.d.ts +10 -0
- package/types/token-prices.types.cjs +1 -1
- package/types/token-prices.types.d.ts +7 -0
- package/types/token-prices.types.mjs +4 -2
- package/types/transactions.types.d.ts +2 -2
- package/types/tron.types.d.ts +10 -0
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +31 -27
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.mjs +1 -1
- package/webworker/viteWorkerURL.constant.cjs +3 -3
- package/webworker/viteWorkerURL.constant.mjs +3 -3
- package/webworker/zkProofWorker/zkProofWorker.types.d.ts +1 -2
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.mjs +27 -28
- package/API/ai-calls.cjs +0 -1
- package/API/ai-calls.d.ts +0 -17
- package/API/ai-calls.mjs +0 -21
- package/API/duneAPI.cjs +0 -1
- package/API/duneAPI.d.ts +0 -11
- package/API/duneAPI.mjs +0 -25
- package/API/enclaveCalls.cjs +0 -1
- package/API/enclaveCalls.d.ts +0 -9
- package/API/enclaveCalls.mjs +0 -11
- package/API/getBridgeProtocols.cjs +0 -1
- package/API/getBridgeProtocols.d.ts +0 -7
- package/API/getBridgeProtocols.mjs +0 -8
- package/API/getLifiStatus.cjs +0 -1
- package/API/getLifiStatus.d.ts +0 -24
- package/API/getLifiStatus.mjs +0 -15
- package/API/getRelayerURL.cjs +0 -1
- package/API/getRelayerURL.d.ts +0 -1
- package/API/getRelayerURL.mjs +0 -10
- package/API/is-tx-stateless.cjs +0 -1
- package/API/is-tx-stateless.mjs +0 -20
- package/API/passwordCalls.cjs +0 -1
- package/API/passwordCalls.d.ts +0 -9
- package/API/passwordCalls.mjs +0 -13
- package/API/restoreSnapshots.cjs +0 -1
- package/API/restoreSnapshots.d.ts +0 -1
- package/API/restoreSnapshots.mjs +0 -10
- package/constants/token-data/popularTokens.constants.cjs +0 -1
- package/constants/token-data/popularTokens.constants.d.ts +0 -3
- package/constants/token-data/popularTokens.constants.mjs +0 -13
- package/constants/token-data/tokenPricing.consts.d.ts +0 -2
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +0 -1
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +0 -7
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +0 -42
- package/data-structures/Hinkal/hinkalApprove.cjs +0 -1
- package/data-structures/Hinkal/hinkalApprove.d.ts +0 -3
- package/data-structures/Hinkal/hinkalApprove.mjs +0 -114
- package/data-structures/Hinkal/hinkalDepostAndBridge.cjs +0 -1
- package/data-structures/Hinkal/hinkalDepostAndBridge.mjs +0 -230
- package/data-structures/Hinkal/hinkalInsideTransact.cjs +0 -1
- package/data-structures/Hinkal/hinkalInsideTransact.d.ts +0 -4
- package/data-structures/Hinkal/hinkalInsideTransact.mjs +0 -120
- package/error-handling/handleErrorRestore.cjs +0 -1
- package/error-handling/handleErrorRestore.d.ts +0 -2
- package/error-handling/handleErrorRestore.mjs +0 -11
- package/functions/kyc/authentoHelper.cjs +0 -1
- package/functions/kyc/authentoHelper.d.ts +0 -12
- package/functions/kyc/authentoHelper.mjs +0 -30
- package/functions/utils/ethers-formatter.utils.cjs +0 -1
- package/functions/utils/ethers-formatter.utils.d.ts +0 -5
- package/functions/utils/ethers-formatter.utils.mjs +0 -59
- package/functions/utils/get-hinkal-approvals.cjs +0 -1
- package/functions/utils/get-hinkal-approvals.d.ts +0 -3
- package/functions/utils/get-hinkal-approvals.mjs +0 -38
- package/functions/utils/replaceAddressInCalldata.cjs +0 -1
- package/functions/utils/replaceAddressInCalldata.d.ts +0 -1
- package/functions/utils/replaceAddressInCalldata.mjs +0 -7
- package/functions/web3/functionCalls/estimateGasRelayer.cjs +0 -1
- package/functions/web3/functionCalls/estimateGasRelayer.mjs +0 -22
- package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +0 -1
- package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +0 -5
- package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +0 -29
- package/types/bridging.types.d.ts +0 -29
- package/types/duneAPI.types.d.ts +0 -9
- package/types/relayer.types.d.ts +0 -25
- package/types/routing.types.cjs +0 -1
- package/types/routing.types.d.ts +0 -7
- package/types/routing.types.mjs +0 -4
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BlockchainEventEmitter as c } from "./BlockchainEventEmitter.mjs";
|
|
2
|
+
import { ClientEventHelper as a } from "../helpers/ClientEventHelper.mjs";
|
|
3
|
+
class E extends c {
|
|
4
|
+
clientEventHelper;
|
|
5
|
+
constructor(e, t, n, s, r, i, l) {
|
|
6
|
+
super(t, n, s, !1, r, i, l), this.clientEventHelper = new a(t, e);
|
|
7
|
+
}
|
|
8
|
+
clear() {
|
|
9
|
+
this.clientEventHelper.clear();
|
|
10
|
+
}
|
|
11
|
+
startUpdateListener() {
|
|
12
|
+
this.clientEventHelper.startUpdateListener(
|
|
13
|
+
async (e) => {
|
|
14
|
+
await this.eventsFetchingMutex.runExclusive(async () => {
|
|
15
|
+
await this.processEvents(e);
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
this.latestBlockNumber + 1,
|
|
19
|
+
(e) => this.advanceLatestBlockNumber(e)
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
E as ClientBlockchainEventEmitter
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./BlockchainEventEmitter.cjs"),t=require("../helpers/PollingEventHelper.cjs");class l extends e.BlockchainEventEmitter{pollingEventHelper=new t.PollingEventHelper;clear(){this.pollingEventHelper.clear()}startUpdateListener(){this.pollingEventHelper.startUpdateListener(async()=>{await this.retrieveEvents(this.latestBlockNumber)})}}exports.PollingBlockchainEventEmitter=l;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BlockchainEventEmitter as e } from "./BlockchainEventEmitter.mjs";
|
|
2
|
+
import { PollingEventHelper as t } from "../helpers/PollingEventHelper.mjs";
|
|
3
|
+
class n extends e {
|
|
4
|
+
pollingEventHelper = new t();
|
|
5
|
+
clear() {
|
|
6
|
+
this.pollingEventHelper.clear();
|
|
7
|
+
}
|
|
8
|
+
startUpdateListener() {
|
|
9
|
+
this.pollingEventHelper.startUpdateListener(async () => {
|
|
10
|
+
await this.retrieveEvents(this.latestBlockNumber);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
n as PollingBlockchainEventEmitter
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../error-handling/logger.cjs"),v=require("../../BlockchainEvent/BlockchainEvent.cjs"),h=require("../../../API/API.cjs"),I=5e3;class d{chainId;eventCategory;pollIntervalId;constructor(r,l){this.chainId=r,this.eventCategory=l}clear(){this.pollIntervalId!=null&&(clearInterval(this.pollIntervalId),this.pollIntervalId=void 0)}startUpdateListener(r,l,o){let e=l;const a=async()=>{try{const{events:t,latestBlockNumber:n}=await h.API.getSnapshotServerEvents(this.chainId,this.eventCategory,e);if(t.length>0){const i=t.map(s=>v.BlockchainEvent.fromSerialized(s));await r(i)}n>=e&&(e=n+1,o(e))}catch(t){c.Logger.error("Snapshot events poll error",t)}};this.pollIntervalId=setInterval(a,I)}}exports.ClientEventHelper=d;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EventCategory } from '../../../types/events.types';
|
|
2
|
+
import { BlockchainEvent } from '../../BlockchainEvent/BlockchainEvent';
|
|
3
|
+
export declare class ClientEventHelper {
|
|
4
|
+
chainId: number;
|
|
5
|
+
eventCategory: EventCategory;
|
|
6
|
+
private pollIntervalId;
|
|
7
|
+
constructor(chainId: number, eventCategory: EventCategory);
|
|
8
|
+
clear(): void;
|
|
9
|
+
startUpdateListener(processEvents: (events: BlockchainEvent[]) => Promise<void>, fromBlockNumber: number, onProcessed: (latestBlockNumber: number) => void): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Logger as c } from "../../../error-handling/logger.mjs";
|
|
2
|
+
import { BlockchainEvent as v } from "../../BlockchainEvent/BlockchainEvent.mjs";
|
|
3
|
+
import { API as h } from "../../../API/API.mjs";
|
|
4
|
+
const I = 5e3;
|
|
5
|
+
class g {
|
|
6
|
+
chainId;
|
|
7
|
+
eventCategory;
|
|
8
|
+
pollIntervalId;
|
|
9
|
+
constructor(r, l) {
|
|
10
|
+
this.chainId = r, this.eventCategory = l;
|
|
11
|
+
}
|
|
12
|
+
clear() {
|
|
13
|
+
this.pollIntervalId != null && (clearInterval(this.pollIntervalId), this.pollIntervalId = void 0);
|
|
14
|
+
}
|
|
15
|
+
startUpdateListener(r, l, o) {
|
|
16
|
+
let t = l;
|
|
17
|
+
const a = async () => {
|
|
18
|
+
try {
|
|
19
|
+
const { events: e, latestBlockNumber: n } = await h.getSnapshotServerEvents(
|
|
20
|
+
this.chainId,
|
|
21
|
+
this.eventCategory,
|
|
22
|
+
t
|
|
23
|
+
);
|
|
24
|
+
if (e.length > 0) {
|
|
25
|
+
const i = e.map((s) => v.fromSerialized(s));
|
|
26
|
+
await r(i);
|
|
27
|
+
}
|
|
28
|
+
n >= t && (t = n + 1, o(t));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
c.error("Snapshot events poll error", e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
this.pollIntervalId = setInterval(a, I);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
g as ClientEventHelper
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class t{intervalId;clear(){this.intervalId!==void 0&&clearInterval(this.intervalId),this.intervalId=void 0}startUpdateListener(e){this.intervalId=setInterval(async()=>{await e()},3500)}}exports.PollingEventHelper=t;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
class a {
|
|
2
|
+
intervalId;
|
|
3
|
+
clear() {
|
|
4
|
+
this.intervalId !== void 0 && clearInterval(this.intervalId), this.intervalId = void 0;
|
|
5
|
+
}
|
|
6
|
+
startUpdateListener(t) {
|
|
7
|
+
this.intervalId = setInterval(async () => {
|
|
8
|
+
await t();
|
|
9
|
+
}, 3500);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
a as PollingEventHelper
|
|
14
|
+
};
|
|
@@ -5,7 +5,11 @@ export * from './evm/AbstractNullifierSnapshotService';
|
|
|
5
5
|
export * from './evm/AbstractSnapshotService';
|
|
6
6
|
export * from './evm/AbstractEventService';
|
|
7
7
|
export * from './evm/BlockchainEventEmitter';
|
|
8
|
+
export * from './evm/PollingBlockchainEventEmitter';
|
|
9
|
+
export * from './evm/ClientBlockchainEventEmitter';
|
|
8
10
|
export * from './solana/SolanaBlockchainEventEmitter';
|
|
11
|
+
export * from './solana/ClientSolanaBlockchainEventEmitter';
|
|
12
|
+
export * from './solana/PollingSolanaBlockchainEventEmitter';
|
|
9
13
|
export * from './solana/AbstractSolanaEventService';
|
|
10
14
|
export * from './solana/AbstractSolanaSnapshotService';
|
|
11
15
|
export * from './solana/AbstractSolanaNullifierSnapshotService';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../constants/protocol.constants.cjs"),c=require("../../../crypto/poseidon.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");const n=require("../../../functions/utils/amounts.utils.cjs"),o=require("../../merkle-tree/MerkleTree.cjs");require("ethers");require("../../../error-handling/error-codes.constants.cjs");const l=require("./AbstractSolanaSnapshotService.cjs"),i=require("../../../functions/utils/merkleTree.utils.cjs"),u=require("@solana/web3.js");class A extends l.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(([s,r])=>({address:s,index:r}))}}deserializeSnapshot(e){let s,r;return e.latestBlockNumber&&e.merkleTree?s=i.contructMerkleTreeFromSerialized(e.merkleTree):s=o.MerkleTree.create(c.poseidonFunction,0n),e.latestBlockNumber&&e.senderAddressIndexMap?r=new Map(e.senderAddressIndexMap.map(({address:d,index:t})=>[d,t])):r=new Map,{latestBlockNumber:e.latestBlockNumber??0,payload:{merkleTree:s,senderAddresses:e.senderAddresses??[],senderAddressIndexMap:r}}}acceptEvent(e,s){try{return this._merkleTree.insert(e.access_key,e.index),this._senderAddressIndexMap.set(e.sender_address,Math.max(Number(e.index),this._senderAddressIndexMap.get(e.sender_address)??0)),this._senderAddresses.includes(e.sender_address)||this._senderAddresses.push(e.sender_address),e.access_key===0n&&e.sender_address===a.zeroAddress&&this._merkleTree.remove(e.index),!0}catch(r){return console.error(r),!1}}mapEvent(e){const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../constants/protocol.constants.cjs"),c=require("../../../crypto/poseidon.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");const n=require("../../../functions/utils/amounts.utils.cjs"),o=require("../../merkle-tree/MerkleTree.cjs");require("ethers");require("../../../error-handling/error-codes.constants.cjs");const l=require("./AbstractSolanaSnapshotService.cjs"),i=require("../../../functions/utils/merkleTree.utils.cjs"),u=require("@solana/web3.js");class A extends l.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(([s,r])=>({address:s,index:r}))}}deserializeSnapshot(e){let s,r;return e.latestBlockNumber&&e.merkleTree?s=i.contructMerkleTreeFromSerialized(e.merkleTree):s=o.MerkleTree.create(c.poseidonFunction,0n),e.latestBlockNumber&&e.senderAddressIndexMap?r=new Map(e.senderAddressIndexMap.map(({address:d,index:t})=>[d,t])):r=new Map,{latestBlockNumber:e.latestBlockNumber??0,payload:{merkleTree:s,senderAddresses:e.senderAddresses??[],senderAddressIndexMap:r}}}acceptEvent(e,s){try{return this._merkleTree.insert(e.access_key,e.index),this._senderAddressIndexMap.set(e.sender_address,Math.max(Number(e.index),this._senderAddressIndexMap.get(e.sender_address)??0)),this._senderAddresses.includes(e.sender_address)||this._senderAddresses.push(e.sender_address),e.access_key===0n&&e.sender_address===a.zeroAddress&&this._merkleTree.remove(e.index),!0}catch(r){return console.error(r),!1}}mapEvent(e){const s=e.getArg("access_key"),r=e.getArg("index"),d=e.getArg("sender_address");return{access_key:n.advancedToBigInt(s),index:n.advancedToBigInt(r),sender_address:new u.PublicKey(d).toBase58()}}getSnapshotPayload(){return{merkleTree:this._merkleTree,senderAddresses:this._senderAddresses,senderAddressIndexMap:this._senderAddressIndexMap}}populateSnapshot({payload:{merkleTree:e,senderAddresses:s,senderAddressIndexMap:r}}){this._merkleTree=e,this._senderAddresses=s,this._senderAddressIndexMap=r}}exports.AbstractSolanaAccessTokenSnapshotService=A;
|
|
@@ -2,6 +2,7 @@ import { MerkleTree, MerkleTreeJson } from '../../merkle-tree';
|
|
|
2
2
|
import { SolanaAccessTokenEvent } from '../../../types';
|
|
3
3
|
import { AbstractSolanaSnapshotService, SolanaSnapshot } from './AbstractSolanaSnapshotService';
|
|
4
4
|
import { SolanaBlockchainEventEmitter } from './SolanaBlockchainEventEmitter';
|
|
5
|
+
import { BlockchainEvent } from '../../BlockchainEvent/BlockchainEvent';
|
|
5
6
|
export type SolanaSenderAddressIndexMapJson = {
|
|
6
7
|
address: string;
|
|
7
8
|
index: number;
|
|
@@ -17,7 +18,7 @@ export type SolanaAccessTokenSerializedSnapshot = {
|
|
|
17
18
|
senderAddresses?: string[];
|
|
18
19
|
senderAddressIndexMap?: SolanaSenderAddressIndexMapJson;
|
|
19
20
|
};
|
|
20
|
-
export declare abstract class AbstractSolanaAccessTokenSnapshotService extends AbstractSolanaSnapshotService<SolanaAccessTokenEvent<bigint, string>,
|
|
21
|
+
export declare abstract class AbstractSolanaAccessTokenSnapshotService extends AbstractSolanaSnapshotService<SolanaAccessTokenEvent<bigint, string>, SolanaAccessTokenSnapshotPayload, SolanaAccessTokenSerializedSnapshot> {
|
|
21
22
|
constructor(accessTokenEventFetcher: SolanaBlockchainEventEmitter);
|
|
22
23
|
private _merkleTree;
|
|
23
24
|
private _senderAddresses;
|
|
@@ -28,7 +29,7 @@ export declare abstract class AbstractSolanaAccessTokenSnapshotService extends A
|
|
|
28
29
|
protected serializeSnapshot(snapshot: SolanaSnapshot<SolanaAccessTokenSnapshotPayload>): SolanaAccessTokenSerializedSnapshot;
|
|
29
30
|
protected deserializeSnapshot(serializedSnapshot: SolanaAccessTokenSerializedSnapshot): SolanaSnapshot<SolanaAccessTokenSnapshotPayload>;
|
|
30
31
|
protected acceptEvent(event: SolanaAccessTokenEvent<bigint, string>, _slot: number): boolean;
|
|
31
|
-
protected mapEvent(event:
|
|
32
|
+
protected mapEvent(event: BlockchainEvent): SolanaAccessTokenEvent<bigint, string>;
|
|
32
33
|
protected getSnapshotPayload(): SolanaAccessTokenSnapshotPayload;
|
|
33
34
|
protected populateSnapshot({ payload: { merkleTree, senderAddresses, senderAddressIndexMap }, }: SolanaSnapshot<SolanaAccessTokenSnapshotPayload>): void;
|
|
34
35
|
}
|
|
@@ -8,10 +8,10 @@ import { advancedToBigInt as t } from "../../../functions/utils/amounts.utils.mj
|
|
|
8
8
|
import { MerkleTree as m } from "../../merkle-tree/MerkleTree.mjs";
|
|
9
9
|
import "ethers";
|
|
10
10
|
import "../../../error-handling/error-codes.constants.mjs";
|
|
11
|
-
import { AbstractSolanaSnapshotService as
|
|
12
|
-
import { contructMerkleTreeFromSerialized as
|
|
11
|
+
import { AbstractSolanaSnapshotService as c } from "./AbstractSolanaSnapshotService.mjs";
|
|
12
|
+
import { contructMerkleTreeFromSerialized as l } from "../../../functions/utils/merkleTree.utils.mjs";
|
|
13
13
|
import { PublicKey as p } from "@solana/web3.js";
|
|
14
|
-
class
|
|
14
|
+
class N extends c {
|
|
15
15
|
constructor(e) {
|
|
16
16
|
super(e, "NewAccessKeyAdded");
|
|
17
17
|
}
|
|
@@ -40,7 +40,7 @@ class B extends l {
|
|
|
40
40
|
}
|
|
41
41
|
deserializeSnapshot(e) {
|
|
42
42
|
let s, r;
|
|
43
|
-
return e.latestBlockNumber && e.merkleTree ? s =
|
|
43
|
+
return e.latestBlockNumber && e.merkleTree ? s = l(e.merkleTree) : s = m.create(o, 0n), e.latestBlockNumber && e.senderAddressIndexMap ? r = new Map(
|
|
44
44
|
e.senderAddressIndexMap.map(({ address: d, index: n }) => [d, n])
|
|
45
45
|
) : r = /* @__PURE__ */ new Map(), {
|
|
46
46
|
latestBlockNumber: e.latestBlockNumber ?? 0,
|
|
@@ -62,7 +62,7 @@ class B extends l {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
mapEvent(e) {
|
|
65
|
-
const
|
|
65
|
+
const s = e.getArg("access_key"), r = e.getArg("index"), d = e.getArg("sender_address");
|
|
66
66
|
return {
|
|
67
67
|
access_key: t(s),
|
|
68
68
|
index: t(r),
|
|
@@ -83,5 +83,5 @@ class B extends l {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
export {
|
|
86
|
-
|
|
86
|
+
N as AbstractSolanaAccessTokenSnapshotService
|
|
87
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../crypto/poseidon.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");const l=require("../../merkle-tree/MerkleTree.cjs");require("ethers");require("../../../error-handling/error-codes.constants.cjs");const p=require("../../../functions/utils/amounts.utils.cjs"),y=require("./AbstractSolanaSnapshotService.cjs"),O=require("../../../functions/utils/merkleTree.utils.cjs"),d=require("../../crypto-keys/decodeUTXO.cjs");class h extends y.AbstractSolanaSnapshotService{constructor(e){super(e,"NewCommitment")}_merkleTree;_encryptedOutputs;_encryptedOutputsByCommitment=new Map;get merkleTree(){return this._merkleTree}get encryptedOutputs(){return this._encryptedOutputs}serializeSnapshot(e){return{merkleTree:e.payload.merkleTree.toJSON(),latestBlockNumber:e.latestBlockNumber,encryptedOutputs:e.payload.encryptedOutputs.map(t=>({value:t.value,isPositive:String(t.isPositive),isBlocked:t.isBlocked??!1})),encryptedOutputsByCommitment:Array.from(e.payload.encryptedOutputsByCommitment.entries()).map(([t,i])=>({commitment:t.toString(),encryptedOutput:i}))}}deserializeSnapshot(e){let t;e.latestBlockNumber&&e.merkleTree?t=O.contructMerkleTreeFromSerialized(e.merkleTree):t=l.MerkleTree.create(a.poseidonFunction,0n);const i=e.encryptedOutputs?.map(r=>({value:r.value,isPositive:JSON.parse(r.isPositive),isBlocked:r.isBlocked??!1})),u=new Map;return e.encryptedOutputsByCommitment?.forEach(({commitment:r,encryptedOutput:n})=>{u.set(BigInt(r),n)}),{latestBlockNumber:e.latestBlockNumber??0,payload:{merkleTree:t,encryptedOutputs:i||[],encryptedOutputsByCommitment:u}}}getSnapshotPayload(){return{merkleTree:this._merkleTree,encryptedOutputs:this._encryptedOutputs,encryptedOutputsByCommitment:this._encryptedOutputsByCommitment}}populateSnapshot({payload:{merkleTree:e,encryptedOutputs:t,encryptedOutputsByCommitment:i}}){this._merkleTree=e,this._encryptedOutputs=t,this._encryptedOutputsByCommitment=i}async mapEvent(e){const t=e.getArg("commitment"),i=e.getArg("index"),u=e.getArg("encrypted_output"),r=e.getArg("on_chain_data"),n=p.advancedToBigInt(t),o=p.advancedToBigInt(i);if(u.length===0){const c=d.encodeSolanaOnChainUtxo(r);return{commitment:n,index:o,encryptedOutput:c}}const s=`0x${Buffer.from(u).toString("hex")}`;return{commitment:n,index:o,encryptedOutput:s}}acceptEvent(e,t,i,u){const r=e.index>=0n?e.index:-1n*e.index,n=this._merkleTree.getValue(r);if(n===e.commitment)return!1;this._merkleTree.insert(e.commitment,r);const o=n!==void 0?this._encryptedOutputsByCommitment.get(n):void 0;if(n!==void 0&&o!==void 0){const s=this.encryptedOutputs.findIndex(c=>c.value===o);s!==-1&&this.encryptedOutputs.splice(s,1),this._encryptedOutputsByCommitment.delete(n)}if(this._encryptedOutputsByCommitment.set(e.commitment,e.encryptedOutput),this.encryptedOutputs.map(s=>s.value).includes(e.encryptedOutput))return!0;const m={value:e.encryptedOutput,isPositive:!d.isSolanaOnChainUtxo(e.encryptedOutput),isBlocked:u??!1};return this._encryptedOutputs.push(m),!0}}exports.AbstractSolanaCommitmentsSnapshotService=h;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { MerkleTree, MerkleTreeJson } from '../../merkle-tree';
|
|
2
|
-
import { CommitmentEvent,
|
|
2
|
+
import { CommitmentEvent, EncryptedOutputWithCommitment, EncryptedOutputWithSign } from '../../../types';
|
|
3
3
|
import { AbstractSolanaSnapshotService, SolanaSnapshot } from './AbstractSolanaSnapshotService';
|
|
4
4
|
import { SolanaBlockchainEventEmitter } from './SolanaBlockchainEventEmitter';
|
|
5
|
+
import { BlockchainEvent } from '../../BlockchainEvent/BlockchainEvent';
|
|
5
6
|
export type SolanaCommitmentsSnapshotPayload = {
|
|
6
7
|
readonly merkleTree: MerkleTree<bigint>;
|
|
7
8
|
readonly encryptedOutputs: EncryptedOutputWithSign[];
|
|
9
|
+
readonly encryptedOutputsByCommitment: Map<bigint, string>;
|
|
8
10
|
};
|
|
9
11
|
export type SolanaCommitmentsSerializedSnapshot = {
|
|
10
12
|
latestBlockNumber?: number;
|
|
11
13
|
merkleTree?: MerkleTreeJson;
|
|
12
14
|
encryptedOutputs?: EncryptedOutputWithSign<string>[];
|
|
15
|
+
encryptedOutputsByCommitment?: EncryptedOutputWithCommitment[];
|
|
13
16
|
};
|
|
14
|
-
export declare abstract class AbstractSolanaCommitmentsSnapshotService extends AbstractSolanaSnapshotService<CommitmentEvent<bigint>,
|
|
17
|
+
export declare abstract class AbstractSolanaCommitmentsSnapshotService extends AbstractSolanaSnapshotService<CommitmentEvent<bigint>, SolanaCommitmentsSnapshotPayload, SolanaCommitmentsSerializedSnapshot> {
|
|
15
18
|
constructor(solanaEventEmitter: SolanaBlockchainEventEmitter);
|
|
16
19
|
private _merkleTree;
|
|
17
20
|
private _encryptedOutputs;
|
|
21
|
+
private _encryptedOutputsByCommitment;
|
|
18
22
|
get merkleTree(): MerkleTree<bigint>;
|
|
19
23
|
get encryptedOutputs(): EncryptedOutputWithSign<boolean>[];
|
|
20
24
|
protected serializeSnapshot(snapshot: SolanaSnapshot<SolanaCommitmentsSnapshotPayload>): SolanaCommitmentsSerializedSnapshot;
|
|
@@ -22,8 +26,9 @@ export declare abstract class AbstractSolanaCommitmentsSnapshotService extends A
|
|
|
22
26
|
protected getSnapshotPayload(): {
|
|
23
27
|
merkleTree: MerkleTree<bigint>;
|
|
24
28
|
encryptedOutputs: EncryptedOutputWithSign<boolean>[];
|
|
29
|
+
encryptedOutputsByCommitment: Map<bigint, string>;
|
|
25
30
|
};
|
|
26
|
-
protected populateSnapshot({ payload: { merkleTree, encryptedOutputs }, }: SolanaSnapshot<SolanaCommitmentsSnapshotPayload>): void;
|
|
27
|
-
protected mapEvent(event:
|
|
31
|
+
protected populateSnapshot({ payload: { merkleTree, encryptedOutputs, encryptedOutputsByCommitment }, }: SolanaSnapshot<SolanaCommitmentsSnapshotPayload>): void;
|
|
32
|
+
protected mapEvent(event: BlockchainEvent): Promise<CommitmentEvent<bigint>>;
|
|
28
33
|
protected acceptEvent(event: CommitmentEvent<bigint>, _slot: number, _signature?: string, isBlocked?: boolean): boolean;
|
|
29
34
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { poseidonFunction as
|
|
1
|
+
import { poseidonFunction as d } from "../../../crypto/poseidon.mjs";
|
|
2
2
|
import "circomlibjs-hinkal-fork";
|
|
3
3
|
import "libsodium-wrappers";
|
|
4
4
|
import "process";
|
|
@@ -6,89 +6,106 @@ import "buffer";
|
|
|
6
6
|
import { MerkleTree as a } from "../../merkle-tree/MerkleTree.mjs";
|
|
7
7
|
import "ethers";
|
|
8
8
|
import "../../../error-handling/error-codes.constants.mjs";
|
|
9
|
-
import { advancedToBigInt as
|
|
9
|
+
import { advancedToBigInt as c } from "../../../functions/utils/amounts.utils.mjs";
|
|
10
10
|
import { AbstractSolanaSnapshotService as l } from "./AbstractSolanaSnapshotService.mjs";
|
|
11
|
-
import { contructMerkleTreeFromSerialized as
|
|
12
|
-
import { encodeSolanaOnChainUtxo as
|
|
11
|
+
import { contructMerkleTreeFromSerialized as y } from "../../../functions/utils/merkleTree.utils.mjs";
|
|
12
|
+
import { encodeSolanaOnChainUtxo as O, isSolanaOnChainUtxo as h } from "../../crypto-keys/decodeUTXO.mjs";
|
|
13
13
|
class I extends l {
|
|
14
|
-
constructor(
|
|
15
|
-
super(
|
|
14
|
+
constructor(t) {
|
|
15
|
+
super(t, "NewCommitment");
|
|
16
16
|
}
|
|
17
17
|
_merkleTree;
|
|
18
18
|
_encryptedOutputs;
|
|
19
|
+
_encryptedOutputsByCommitment = /* @__PURE__ */ new Map();
|
|
19
20
|
get merkleTree() {
|
|
20
21
|
return this._merkleTree;
|
|
21
22
|
}
|
|
22
23
|
get encryptedOutputs() {
|
|
23
24
|
return this._encryptedOutputs;
|
|
24
25
|
}
|
|
25
|
-
serializeSnapshot(
|
|
26
|
+
serializeSnapshot(t) {
|
|
26
27
|
return {
|
|
27
|
-
merkleTree:
|
|
28
|
-
latestBlockNumber:
|
|
29
|
-
encryptedOutputs:
|
|
30
|
-
value:
|
|
31
|
-
isPositive: String(
|
|
32
|
-
isBlocked:
|
|
33
|
-
}))
|
|
28
|
+
merkleTree: t.payload.merkleTree.toJSON(),
|
|
29
|
+
latestBlockNumber: t.latestBlockNumber,
|
|
30
|
+
encryptedOutputs: t.payload.encryptedOutputs.map((e) => ({
|
|
31
|
+
value: e.value,
|
|
32
|
+
isPositive: String(e.isPositive),
|
|
33
|
+
isBlocked: e.isBlocked ?? !1
|
|
34
|
+
})),
|
|
35
|
+
encryptedOutputsByCommitment: Array.from(t.payload.encryptedOutputsByCommitment.entries()).map(
|
|
36
|
+
([e, i]) => ({
|
|
37
|
+
commitment: e.toString(),
|
|
38
|
+
encryptedOutput: i
|
|
39
|
+
})
|
|
40
|
+
)
|
|
34
41
|
};
|
|
35
42
|
}
|
|
36
|
-
deserializeSnapshot(
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
const
|
|
43
|
+
deserializeSnapshot(t) {
|
|
44
|
+
let e;
|
|
45
|
+
t.latestBlockNumber && t.merkleTree ? e = y(t.merkleTree) : e = a.create(d, 0n);
|
|
46
|
+
const i = t.encryptedOutputs?.map((r) => ({
|
|
40
47
|
value: r.value,
|
|
41
48
|
isPositive: JSON.parse(r.isPositive),
|
|
42
49
|
isBlocked: r.isBlocked ?? !1
|
|
43
|
-
}));
|
|
44
|
-
return {
|
|
45
|
-
|
|
50
|
+
})), m = /* @__PURE__ */ new Map();
|
|
51
|
+
return t.encryptedOutputsByCommitment?.forEach(({ commitment: r, encryptedOutput: n }) => {
|
|
52
|
+
m.set(BigInt(r), n);
|
|
53
|
+
}), {
|
|
54
|
+
latestBlockNumber: t.latestBlockNumber ?? 0,
|
|
46
55
|
payload: {
|
|
47
|
-
merkleTree:
|
|
48
|
-
encryptedOutputs:
|
|
56
|
+
merkleTree: e,
|
|
57
|
+
encryptedOutputs: i || [],
|
|
58
|
+
encryptedOutputsByCommitment: m
|
|
49
59
|
}
|
|
50
60
|
};
|
|
51
61
|
}
|
|
52
62
|
getSnapshotPayload() {
|
|
53
63
|
return {
|
|
54
64
|
merkleTree: this._merkleTree,
|
|
55
|
-
encryptedOutputs: this._encryptedOutputs
|
|
65
|
+
encryptedOutputs: this._encryptedOutputs,
|
|
66
|
+
encryptedOutputsByCommitment: this._encryptedOutputsByCommitment
|
|
56
67
|
};
|
|
57
68
|
}
|
|
58
69
|
populateSnapshot({
|
|
59
|
-
payload: { merkleTree:
|
|
70
|
+
payload: { merkleTree: t, encryptedOutputs: e, encryptedOutputsByCommitment: i }
|
|
60
71
|
}) {
|
|
61
|
-
this._merkleTree =
|
|
72
|
+
this._merkleTree = t, this._encryptedOutputs = e, this._encryptedOutputsByCommitment = i;
|
|
62
73
|
}
|
|
63
|
-
async mapEvent(
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
const
|
|
74
|
+
async mapEvent(t) {
|
|
75
|
+
const e = t.getArg("commitment"), i = t.getArg("index"), m = t.getArg("encrypted_output"), r = t.getArg("on_chain_data"), n = c(e), p = c(i);
|
|
76
|
+
if (m.length === 0) {
|
|
77
|
+
const u = O(r);
|
|
67
78
|
return {
|
|
68
|
-
commitment:
|
|
69
|
-
index:
|
|
70
|
-
encryptedOutput:
|
|
79
|
+
commitment: n,
|
|
80
|
+
index: p,
|
|
81
|
+
encryptedOutput: u
|
|
71
82
|
};
|
|
72
83
|
}
|
|
73
|
-
const
|
|
84
|
+
const o = `0x${Buffer.from(m).toString("hex")}`;
|
|
74
85
|
return {
|
|
75
|
-
commitment:
|
|
76
|
-
index:
|
|
77
|
-
encryptedOutput:
|
|
86
|
+
commitment: n,
|
|
87
|
+
index: p,
|
|
88
|
+
encryptedOutput: o
|
|
78
89
|
};
|
|
79
90
|
}
|
|
80
|
-
acceptEvent(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return this._encryptedOutputs.push(s), !0;
|
|
91
|
+
acceptEvent(t, e, i, m) {
|
|
92
|
+
const r = t.index >= 0n ? t.index : -1n * t.index, n = this._merkleTree.getValue(r);
|
|
93
|
+
if (n === t.commitment)
|
|
94
|
+
return !1;
|
|
95
|
+
this._merkleTree.insert(t.commitment, r);
|
|
96
|
+
const p = n !== void 0 ? this._encryptedOutputsByCommitment.get(n) : void 0;
|
|
97
|
+
if (n !== void 0 && p !== void 0) {
|
|
98
|
+
const o = this.encryptedOutputs.findIndex((u) => u.value === p);
|
|
99
|
+
o !== -1 && this.encryptedOutputs.splice(o, 1), this._encryptedOutputsByCommitment.delete(n);
|
|
90
100
|
}
|
|
91
|
-
|
|
101
|
+
if (this._encryptedOutputsByCommitment.set(t.commitment, t.encryptedOutput), this.encryptedOutputs.map((o) => o.value).includes(t.encryptedOutput))
|
|
102
|
+
return !0;
|
|
103
|
+
const s = {
|
|
104
|
+
value: t.encryptedOutput,
|
|
105
|
+
isPositive: !h(t.encryptedOutput),
|
|
106
|
+
isBlocked: m ?? !1
|
|
107
|
+
};
|
|
108
|
+
return this._encryptedOutputs.push(s), !0;
|
|
92
109
|
}
|
|
93
110
|
}
|
|
94
111
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class l{solanaBlockchainEventEmitter;eventName;constructor(e,s){this.solanaBlockchainEventEmitter=e,this.eventName=s,e.addEventProcessorFunction(this.processEventsPage.bind(this))}get latestBlockNumber(){return this.solanaBlockchainEventEmitter.latestBlockNumber}get isReady(){return this.solanaBlockchainEventEmitter.isReady}get chainId(){return this.solanaBlockchainEventEmitter.chainId}intervalClear(){this.solanaBlockchainEventEmitter.intervalClear()}async processEventsPage(e){const s=[],n=new Set;e.forEach(({eventName:t,transactionHash:a})=>{t==="BlockedUtxosCreated"&&n.add(a)});const c=e.filter(t=>t.eventName===this.eventName).map(async t=>{try{const a=await this.mapEvent(t),o=n.has(t.transactionHash);return await this.acceptEvent(a,t.blockNumber,t.transactionHash,o)?a:null}catch{return null}}),r=(await Promise.all(c)).filter(t=>t!==null);s.push(...r);const i=s.length;return await this.afterEventsAccepted(i),s.length}}exports.AbstractSolanaEventService=l;
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
+
import { BlockchainEvent } from '../../BlockchainEvent/BlockchainEvent';
|
|
1
2
|
import { SolanaBlockchainEventEmitter } from './SolanaBlockchainEventEmitter';
|
|
2
|
-
export interface SolanaEvent {
|
|
3
|
-
signature: string;
|
|
4
|
-
slot: number;
|
|
5
|
-
blockTime: number;
|
|
6
|
-
programId: any;
|
|
7
|
-
data: any;
|
|
8
|
-
eventName: string;
|
|
9
|
-
}
|
|
10
3
|
type PromiseOrValue<T> = T | Promise<T>;
|
|
11
|
-
export declare abstract class AbstractSolanaEventService<EventType
|
|
4
|
+
export declare abstract class AbstractSolanaEventService<EventType> {
|
|
12
5
|
protected solanaBlockchainEventEmitter: SolanaBlockchainEventEmitter;
|
|
13
6
|
protected readonly eventName: string;
|
|
14
7
|
protected constructor(solanaBlockchainEventEmitter: SolanaBlockchainEventEmitter, eventName: string);
|
|
15
8
|
get latestBlockNumber(): number;
|
|
9
|
+
get isReady(): boolean;
|
|
10
|
+
get chainId(): number;
|
|
16
11
|
intervalClear(): void;
|
|
17
12
|
private processEventsPage;
|
|
18
13
|
protected abstract acceptEvent(event: EventType, slot: number, signature?: string, isBlocked?: boolean): boolean | Promise<boolean>;
|
|
19
|
-
protected abstract mapEvent(event:
|
|
14
|
+
protected abstract mapEvent(event: BlockchainEvent): PromiseOrValue<EventType>;
|
|
20
15
|
protected abstract afterEventsAccepted(eventsCount: number): Promise<void>;
|
|
21
16
|
}
|
|
22
17
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class u {
|
|
2
2
|
solanaBlockchainEventEmitter;
|
|
3
3
|
eventName;
|
|
4
4
|
constructor(e, s) {
|
|
@@ -7,27 +7,33 @@ class E {
|
|
|
7
7
|
get latestBlockNumber() {
|
|
8
8
|
return this.solanaBlockchainEventEmitter.latestBlockNumber;
|
|
9
9
|
}
|
|
10
|
+
get isReady() {
|
|
11
|
+
return this.solanaBlockchainEventEmitter.isReady;
|
|
12
|
+
}
|
|
13
|
+
get chainId() {
|
|
14
|
+
return this.solanaBlockchainEventEmitter.chainId;
|
|
15
|
+
}
|
|
10
16
|
intervalClear() {
|
|
11
17
|
this.solanaBlockchainEventEmitter.intervalClear();
|
|
12
18
|
}
|
|
13
19
|
async processEventsPage(e) {
|
|
14
20
|
const s = [], a = /* @__PURE__ */ new Set();
|
|
15
|
-
e.forEach(({ eventName: t,
|
|
21
|
+
e.forEach(({ eventName: t, transactionHash: n }) => {
|
|
16
22
|
t === "BlockedUtxosCreated" && a.add(n);
|
|
17
23
|
});
|
|
18
24
|
const c = e.filter((t) => t.eventName === this.eventName).map(async (t) => {
|
|
19
25
|
try {
|
|
20
|
-
const n = await this.mapEvent(t
|
|
21
|
-
return await this.acceptEvent(n, t.
|
|
26
|
+
const n = await this.mapEvent(t), o = a.has(t.transactionHash);
|
|
27
|
+
return await this.acceptEvent(n, t.blockNumber, t.transactionHash, o) ? n : null;
|
|
22
28
|
} catch {
|
|
23
29
|
return null;
|
|
24
30
|
}
|
|
25
31
|
}), r = (await Promise.all(c)).filter((t) => t !== null);
|
|
26
32
|
s.push(...r);
|
|
27
|
-
const
|
|
28
|
-
return await this.afterEventsAccepted(
|
|
33
|
+
const i = s.length;
|
|
34
|
+
return await this.afterEventsAccepted(i), s.length;
|
|
29
35
|
}
|
|
30
36
|
}
|
|
31
37
|
export {
|
|
32
|
-
|
|
38
|
+
u as AbstractSolanaEventService
|
|
33
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../functions/utils/amounts.utils.cjs"),i=require("./AbstractSolanaSnapshotService.cjs"),s=require("ethers");class n extends i.AbstractSolanaSnapshotService{constructor(e){super(e,"Nullified")}_nullifiers;get nullifiers(){return this._nullifiers}serializeSnapshot(e){return{nullifiers:Array.from(e.payload.nullifiers).map(r=>r.toString()),latestBlockNumber:e.latestBlockNumber}}deserializeSnapshot(e){return{latestBlockNumber:e.latestBlockNumber??0,payload:{nullifiers:new Set(e.nullifiers??[])}}}acceptEvent(e,r){try{return this._nullifiers.has(e.nullifier)?!1:(this._nullifiers.add(e.nullifier),!0)}catch(t){return console.error(t),!1}}mapEvent(e){return{nullifier:s.ethers.toBeHex(l.advancedToBigInt(e.getArg("nullifier")))}}getSnapshotPayload(){return{nullifiers:this._nullifiers}}populateSnapshot({payload:{nullifiers:e}}){this._nullifiers=e}}exports.AbstractSolanaNullifierSnapshotService=n;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NullifierEvent } from '../../../types/commitments.types';
|
|
2
2
|
import { AbstractSolanaSnapshotService, SolanaSnapshot } from './AbstractSolanaSnapshotService';
|
|
3
3
|
import { SolanaBlockchainEventEmitter } from './SolanaBlockchainEventEmitter';
|
|
4
|
+
import { BlockchainEvent } from '../../BlockchainEvent/BlockchainEvent';
|
|
4
5
|
export type SolanaNullifierSnapshotPayload = {
|
|
5
6
|
readonly nullifiers: Set<string>;
|
|
6
7
|
};
|
|
@@ -8,14 +9,14 @@ export type SolanaNullifierSerializedSnapshot = {
|
|
|
8
9
|
latestBlockNumber?: number;
|
|
9
10
|
nullifiers?: string[];
|
|
10
11
|
};
|
|
11
|
-
export declare abstract class AbstractSolanaNullifierSnapshotService extends AbstractSolanaSnapshotService<NullifierEvent<string>,
|
|
12
|
+
export declare abstract class AbstractSolanaNullifierSnapshotService extends AbstractSolanaSnapshotService<NullifierEvent<string>, SolanaNullifierSnapshotPayload, SolanaNullifierSerializedSnapshot> {
|
|
12
13
|
constructor(solanaEventEmitter: SolanaBlockchainEventEmitter);
|
|
13
14
|
private _nullifiers;
|
|
14
15
|
get nullifiers(): Set<string>;
|
|
15
16
|
protected serializeSnapshot(snapshot: SolanaSnapshot<SolanaNullifierSnapshotPayload>): SolanaNullifierSerializedSnapshot;
|
|
16
17
|
protected deserializeSnapshot(serializedSnapshot: SolanaNullifierSerializedSnapshot): SolanaSnapshot<SolanaNullifierSnapshotPayload>;
|
|
17
18
|
protected acceptEvent(event: NullifierEvent<string>, _slot: number): boolean;
|
|
18
|
-
protected mapEvent(event:
|
|
19
|
+
protected mapEvent(event: BlockchainEvent): NullifierEvent<string>;
|
|
19
20
|
protected getSnapshotPayload(): SolanaNullifierSnapshotPayload;
|
|
20
21
|
protected populateSnapshot({ payload: { nullifiers } }: SolanaSnapshot<SolanaNullifierSnapshotPayload>): void;
|
|
21
22
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ethers as i } from "ethers";
|
|
2
1
|
import { advancedToBigInt as t } from "../../../functions/utils/amounts.utils.mjs";
|
|
3
|
-
import { AbstractSolanaSnapshotService as
|
|
4
|
-
|
|
2
|
+
import { AbstractSolanaSnapshotService as i } from "./AbstractSolanaSnapshotService.mjs";
|
|
3
|
+
import { ethers as n } from "ethers";
|
|
4
|
+
class f extends i {
|
|
5
5
|
constructor(r) {
|
|
6
6
|
super(r, "Nullified");
|
|
7
7
|
}
|
|
@@ -32,7 +32,7 @@ class f extends n {
|
|
|
32
32
|
}
|
|
33
33
|
mapEvent(r) {
|
|
34
34
|
return {
|
|
35
|
-
nullifier:
|
|
35
|
+
nullifier: n.toBeHex(t(r.getArg("nullifier")))
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
getSnapshotPayload() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./AbstractSolanaEventService.cjs"),a=require("../../../constants/save-depths.cjs");class o extends e.AbstractSolanaEventService{savedLatestSlot=0;constructor(t,s){super(t,s)}async init(){await this.loadSnapshot()}async retrieveEventsFromLatestBlock(){await this.solanaBlockchainEventEmitter.retrieveEvents(this.latestBlockNumber)}async loadSnapshot(){const t=await this.fetchSnapshot(),s=this.deserializeSnapshot(t);this.populateSnapshot(s),this.solanaBlockchainEventEmitter.syncFromAtMost(s.latestBlockNumber),this.savedLatestSlot=s.latestBlockNumber}saveSnapshot(){return this.savedLatestSlot=this.latestBlockNumber,this.persistSnapshot(this.serializeSnapshot({latestBlockNumber:this.latestBlockNumber,payload:this.getSnapshotPayload()}))}async afterEventsAccepted(t){(t>0||this.savedLatestSlot+a.saveDepths[this.chainId]<this.latestBlockNumber)&&await this.saveSnapshot()}}exports.AbstractSolanaSnapshotService=o;
|
|
@@ -4,9 +4,8 @@ export interface SolanaSnapshot<SnapshotPayloadType> {
|
|
|
4
4
|
readonly latestBlockNumber: number;
|
|
5
5
|
readonly payload: SnapshotPayloadType;
|
|
6
6
|
}
|
|
7
|
-
export declare abstract class AbstractSolanaSnapshotService<EventType,
|
|
7
|
+
export declare abstract class AbstractSolanaSnapshotService<EventType, SnapshotPayloadType, SerializedSnapshotType> extends AbstractSolanaEventService<EventType> {
|
|
8
8
|
private savedLatestSlot;
|
|
9
|
-
private chainId;
|
|
10
9
|
protected constructor(solanaBlockchainEventEmitter: SolanaBlockchainEventEmitter, eventName: string);
|
|
11
10
|
init(): Promise<void>;
|
|
12
11
|
retrieveEventsFromLatestBlock(): Promise<void>;
|
|
@@ -2,12 +2,11 @@ import { AbstractSolanaEventService as a } from "./AbstractSolanaEventService.mj
|
|
|
2
2
|
import { saveDepths as e } from "../../../constants/save-depths.mjs";
|
|
3
3
|
class n extends a {
|
|
4
4
|
savedLatestSlot = 0;
|
|
5
|
-
chainId = 0;
|
|
6
5
|
constructor(t, s) {
|
|
7
6
|
super(t, s);
|
|
8
7
|
}
|
|
9
8
|
async init() {
|
|
10
|
-
await this.loadSnapshot()
|
|
9
|
+
await this.loadSnapshot();
|
|
11
10
|
}
|
|
12
11
|
async retrieveEventsFromLatestBlock() {
|
|
13
12
|
await this.solanaBlockchainEventEmitter.retrieveEvents(this.latestBlockNumber);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../types/events.types.cjs"),c=require("./SolanaBlockchainEventEmitter.cjs"),o=require("../helpers/ClientEventHelper.cjs");class v extends c.SolanaBlockchainEventEmitter{clientEventHelper;constructor(e,n,i,s,r,a,t){super(e,n,i,s,!1,r,a),t&&this.setIdl(t),this.clientEventHelper=new o.ClientEventHelper(e,l.EventCategory.MainContractEvents)}clear(){this.clientEventHelper.clear()}startUpdateListener(){this.clientEventHelper.startUpdateListener(async e=>{await this.eventsFetchingMutex.runExclusive(async()=>{await this.processEvents(e)})},this.latestBlockNumber+1,e=>this.advanceLatestBlockNumber(e))}}exports.ClientSolanaBlockchainEventEmitter=v;
|