@sabaaa1/common 0.1.6 → 0.1.14
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 +16 -12
- package/API/API.mjs +73 -69
- package/API/accessCodeCalls.cjs +1 -0
- package/API/accessCodeCalls.d.ts +23 -0
- package/API/accessCodeCalls.mjs +23 -0
- package/API/admin-calls.cjs +1 -1
- package/API/admin-calls.mjs +5 -7
- package/API/ai-calls.cjs +1 -1
- package/API/ai-calls.mjs +11 -10
- package/API/brotherhoodCalls.cjs +1 -1
- package/API/brotherhoodCalls.mjs +43 -69
- package/API/callLifiAPI.cjs +1 -1
- package/API/callLifiAPI.mjs +8 -7
- package/API/callOdosAPI.cjs +1 -1
- package/API/callOdosAPI.mjs +16 -16
- package/API/callOkxAPI.cjs +1 -0
- package/API/callOkxAPI.d.ts +10 -0
- package/API/callOkxAPI.mjs +13 -0
- package/API/callOneInchAPI.cjs +1 -1
- package/API/callOneInchAPI.mjs +8 -7
- package/API/callRelayer.cjs +1 -1
- package/API/callRelayer.d.ts +11 -0
- package/API/callRelayer.mjs +15 -7
- package/API/checkRisk.cjs +1 -1
- package/API/checkRisk.mjs +5 -4
- package/API/duneAPI.cjs +1 -1
- package/API/duneAPI.mjs +2 -3
- package/API/enclaveCalls.cjs +1 -1
- package/API/enclaveCalls.mjs +9 -11
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.d.ts +2 -2
- package/API/fetchCommitmentsCache.mjs +13 -10
- package/API/generate-trading-points.cjs +1 -1
- package/API/generate-trading-points.mjs +34 -39
- package/API/get-token-data.cjs +1 -1
- package/API/get-token-data.mjs +5 -4
- package/API/getBridgeProtocols.cjs +1 -1
- package/API/getBridgeProtocols.mjs +4 -3
- package/API/getGasEstimates.cjs +1 -1
- package/API/getGasEstimates.d.ts +2 -1
- package/API/getGasEstimates.mjs +14 -16
- package/API/getLifiStatus.cjs +1 -1
- package/API/getLifiStatus.mjs +11 -10
- package/API/getRelayerURL.cjs +1 -1
- package/API/getRelayerURL.mjs +4 -4
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.mjs +42 -36
- package/API/getTokenPrice.cjs +1 -1
- package/API/getTokenPrice.d.ts +0 -11
- package/API/getTokenPrice.mjs +8 -23
- package/API/getWebsiteURL.cjs +1 -1
- package/API/getWebsiteURL.d.ts +1 -1
- package/API/getWebsiteURL.mjs +6 -7
- package/API/index.d.ts +2 -1
- package/API/is-tx-stateless.cjs +1 -1
- package/API/is-tx-stateless.mjs +17 -22
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +2 -2
- package/API/kycCalls.mjs +31 -30
- package/API/leaderboardCalls.cjs +1 -1
- package/API/leaderboardCalls.mjs +11 -16
- package/API/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.mjs +19 -18
- package/API/referralsCalls.cjs +1 -1
- package/API/referralsCalls.mjs +16 -24
- package/API/relayCalls.cjs +1 -1
- package/API/relayCalls.mjs +6 -8
- package/API/resolve-sns.cjs +1 -0
- package/API/resolve-sns.d.ts +1 -0
- package/API/resolve-sns.mjs +12 -0
- package/API/restoreSnapshots.cjs +1 -1
- package/API/restoreSnapshots.mjs +5 -5
- package/API/rewardsUserCalls.cjs +1 -1
- package/API/rewardsUserCalls.mjs +37 -54
- package/API/seedless-calls.cjs +1 -0
- package/API/seedless-calls.d.ts +53 -0
- package/API/seedless-calls.mjs +12 -0
- package/API/send-telegram-callback.cjs +1 -1
- package/API/send-telegram-callback.mjs +9 -11
- package/API/simulate-batch-tx.cjs +1 -1
- package/API/simulate-batch-tx.mjs +11 -13
- package/API/solana-calls.cjs +1 -0
- package/API/solana-calls.d.ts +34 -0
- package/API/solana-calls.mjs +19 -0
- package/API/tenderly.api.cjs +1 -1
- package/API/tenderly.api.mjs +48 -59
- package/API/token-calls.cjs +1 -1
- package/API/token-calls.mjs +11 -13
- package/API/weeklyAnalyticCalls.cjs +1 -1
- package/API/weeklyAnalyticCalls.mjs +9 -14
- package/README.md +164 -0
- package/_virtual/_commonjsHelpers.cjs +1 -0
- package/_virtual/_commonjsHelpers.mjs +30 -0
- package/_virtual/bn.cjs +1 -0
- package/_virtual/bn.mjs +4 -0
- package/_virtual/bn2.cjs +1 -0
- package/_virtual/bn2.mjs +4 -0
- package/_virtual/common.cjs +1 -0
- package/_virtual/common.mjs +4 -0
- package/_virtual/common2.cjs +1 -0
- package/_virtual/common2.mjs +4 -0
- package/_virtual/hash.cjs +1 -0
- package/_virtual/hash.mjs +4 -0
- package/_virtual/index.cjs +1 -0
- package/_virtual/index.mjs +6 -0
- package/_virtual/index10.cjs +1 -0
- package/_virtual/index10.mjs +6 -0
- package/_virtual/index11.cjs +1 -0
- package/_virtual/index11.mjs +6 -0
- package/_virtual/index12.cjs +1 -0
- package/_virtual/index12.mjs +6 -0
- package/_virtual/index13.cjs +1 -0
- package/_virtual/index13.mjs +6 -0
- package/_virtual/index14.cjs +1 -0
- package/_virtual/index14.mjs +6 -0
- package/_virtual/index15.cjs +1 -0
- package/_virtual/index15.mjs +6 -0
- package/_virtual/index16.cjs +1 -0
- package/_virtual/index16.mjs +6 -0
- package/_virtual/index17.cjs +1 -0
- package/_virtual/index17.mjs +6 -0
- package/_virtual/index18.cjs +1 -0
- package/_virtual/index18.mjs +6 -0
- package/_virtual/index19.cjs +1 -0
- package/_virtual/index19.mjs +6 -0
- package/_virtual/index2.cjs +1 -0
- package/_virtual/index2.mjs +6 -0
- package/_virtual/index20.cjs +1 -0
- package/_virtual/index20.mjs +6 -0
- package/_virtual/index21.cjs +1 -0
- package/_virtual/index21.mjs +6 -0
- package/_virtual/index22.cjs +1 -0
- package/_virtual/index22.mjs +4 -0
- package/_virtual/index3.cjs +1 -0
- package/_virtual/index3.mjs +6 -0
- package/_virtual/index4.cjs +1 -0
- package/_virtual/index4.mjs +6 -0
- package/_virtual/index5.cjs +1 -0
- package/_virtual/index5.mjs +6 -0
- package/_virtual/index6.cjs +1 -0
- package/_virtual/index6.mjs +6 -0
- package/_virtual/index7.cjs +1 -0
- package/_virtual/index7.mjs +6 -0
- package/_virtual/index8.cjs +1 -0
- package/_virtual/index8.mjs +6 -0
- package/_virtual/index9.cjs +1 -0
- package/_virtual/index9.mjs +6 -0
- package/_virtual/inherits_browser.cjs +1 -0
- package/_virtual/inherits_browser.mjs +4 -0
- package/_virtual/ripemd.cjs +1 -0
- package/_virtual/ripemd.mjs +4 -0
- package/_virtual/scrypt.cjs +1 -0
- package/_virtual/scrypt.mjs +4 -0
- package/_virtual/sha.cjs +1 -0
- package/_virtual/sha.mjs +4 -0
- package/_virtual/sha3.cjs +1 -0
- package/_virtual/sha3.mjs +4 -0
- package/_virtual/utils.cjs +1 -0
- package/_virtual/utils.mjs +4 -0
- package/_virtual/utils2.cjs +1 -0
- package/_virtual/utils2.mjs +4 -0
- package/constants/backend.constants.cjs +1 -1
- package/constants/backend.constants.d.ts +2 -1
- package/constants/backend.constants.mjs +5 -7
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +5 -0
- package/constants/chains.constants.mjs +63 -35
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +1 -1
- package/constants/coingecko.constants.mjs +18 -11
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.mjs +19 -15
- package/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arbMainnet.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arcTestnet.json.mjs +1214 -4
- package/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-base.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-ethMainnet.json.mjs +1213 -3
- package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-optimism.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-polygon.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-solana.json.mjs +6111 -0
- package/constants/deploy-data/index.d.ts +2 -1
- package/constants/index.d.ts +1 -1
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +9 -0
- package/constants/mediaUrls.constants.mjs +13 -4
- package/constants/okx.constants.cjs +1 -0
- package/constants/okx.constants.d.ts +2 -0
- package/constants/okx.constants.mjs +5 -0
- package/constants/protocol.constants.cjs +1 -1
- package/constants/protocol.constants.d.ts +12 -1
- package/constants/protocol.constants.mjs +37 -29
- package/constants/save-depths.cjs +1 -1
- package/constants/save-depths.mjs +4 -1
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +23 -10
- package/constants/server.constants.mjs +102 -89
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +49 -35
- package/constants/token-data/index.cjs +1 -1
- package/constants/token-data/index.d.ts +17 -1
- package/constants/token-data/index.mjs +29 -25
- package/constants/token-data/solanaLocalnetRegistry.json.cjs +1 -0
- package/constants/token-data/solanaLocalnetRegistry.json.mjs +24 -0
- package/constants/token-data/solanaMainnetRegistry.json.cjs +1 -0
- package/constants/token-data/solanaMainnetRegistry.json.mjs +560 -0
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +41 -41
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +19 -10
- package/data-structures/Hinkal/Hinkal.mjs +290 -125
- package/data-structures/Hinkal/IHinkal.d.ts +18 -11
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +36 -32
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +24 -23
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.mjs +13 -12
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.cjs +1 -0
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.d.ts +3 -0
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.mjs +28 -0
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +11 -8
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +4 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +167 -0
- package/data-structures/Hinkal/hinkalGetRecipientInfo.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetRecipientInfo.d.ts +1 -1
- package/data-structures/Hinkal/hinkalGetRecipientInfo.mjs +4 -4
- package/data-structures/Hinkal/hinkalMultiSend.cjs +1 -1
- package/data-structures/Hinkal/hinkalMultiSend.mjs +6 -6
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +109 -93
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.mjs +23 -22
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -0
- package/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +6 -0
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +45 -0
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +11 -9
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +4 -0
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +133 -0
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +216 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +6 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +55 -0
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +6 -0
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +99 -0
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +5 -0
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +96 -0
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +4 -0
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +120 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +90 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +106 -0
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +33 -27
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +20 -14
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +15 -9
- package/data-structures/Hinkal/index.d.ts +4 -0
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +56 -23
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.d.ts +0 -1
- package/data-structures/IndexedDB/activity-db.mjs +86 -86
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +15 -12
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +29 -26
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +14 -10
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.d.ts +2 -2
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +32 -31
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.d.ts +6 -1
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +154 -79
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +24 -21
- package/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/PrivateTokensDB.mjs +39 -34
- package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.d.ts +15 -3
- package/data-structures/crypto-keys/decodeUTXO.mjs +84 -26
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +36 -30
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +19 -5
- package/data-structures/crypto-keys/keys.mjs +117 -60
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractAccessTokenSnapshotService.d.ts → evm/AbstractAccessTokenSnapshotService.d.ts} +2 -2
- package/data-structures/event-service/{AbstractAccessTokenSnapshotService.mjs → evm/AbstractAccessTokenSnapshotService.mjs} +6 -6
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractApprovalsSnapshotService.d.ts → evm/AbstractApprovalsSnapshotService.d.ts} +2 -2
- package/data-structures/event-service/{AbstractApprovalsSnapshotService.mjs → evm/AbstractApprovalsSnapshotService.mjs} +2 -2
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractCommitmentsSnapshotService.d.ts → evm/AbstractCommitmentsSnapshotService.d.ts} +3 -3
- package/data-structures/event-service/{AbstractCommitmentsSnapshotService.mjs → evm/AbstractCommitmentsSnapshotService.mjs} +24 -21
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -0
- package/data-structures/event-service/{AbstractEventService.d.ts → evm/AbstractEventService.d.ts} +1 -1
- package/data-structures/event-service/evm/AbstractEventService.mjs +37 -0
- package/data-structures/event-service/{AbstractNullifierSnapshotService.d.ts → evm/AbstractNullifierSnapshotService.d.ts} +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractSnapshotService.mjs → evm/AbstractSnapshotService.mjs} +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/{BlockchainEventEmitter.d.ts → evm/BlockchainEventEmitter.d.ts} +2 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +89 -0
- package/data-structures/event-service/index.d.ts +13 -7
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +34 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +87 -0
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.d.ts +29 -0
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +96 -0
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +22 -0
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +33 -0
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +21 -0
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +49 -0
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +22 -0
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +33 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +39 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +153 -0
- package/data-structures/http/BasicHttpClient.cjs +1 -0
- package/data-structures/http/BasicHttpClient.d.ts +11 -0
- package/data-structures/http/BasicHttpClient.mjs +25 -0
- package/data-structures/http/HttpClient.cjs +1 -0
- package/data-structures/http/HttpClient.d.ts +10 -0
- package/data-structures/http/HttpClient.mjs +15 -0
- package/data-structures/http/index.d.ts +2 -0
- package/data-structures/index.d.ts +1 -0
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +1 -3
- package/data-structures/snapshot/SnapshotFetcherService.d.ts +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientAccessTokenSnapshotService.d.ts → evm-snapshots/ClientAccessTokenSnapshotService.d.ts} +2 -2
- package/data-structures/snapshot/{ClientAccessTokenSnapshotService.mjs → evm-snapshots/ClientAccessTokenSnapshotService.mjs} +13 -9
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientApprovalsSnapshotService.d.ts → evm-snapshots/ClientApprovalsSnapshotService.d.ts} +2 -3
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +43 -0
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientCommitmentsSnapshotService.d.ts → evm-snapshots/ClientCommitmentsSnapshotService.d.ts} +2 -2
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +35 -0
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientNullifierSnapshotService.d.ts → evm-snapshots/ClientNullifierSnapshotService.d.ts} +2 -2
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +34 -0
- package/data-structures/snapshot/index.d.ts +7 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +42 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +34 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +34 -0
- package/data-structures/token-price-fetcher/TokenChecker.cjs +1 -1
- package/data-structures/token-price-fetcher/TokenChecker.mjs +5 -4
- package/data-structures/utxo/Utxo.cjs +1 -1
- package/data-structures/utxo/Utxo.d.ts +6 -1
- package/data-structures/utxo/Utxo.mjs +37 -24
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +2 -0
- package/error-handling/error-codes.constants.mjs +4 -2
- package/functions/connectors.types.d.ts +14 -0
- package/functions/index.d.ts +1 -0
- package/functions/pre-transaction/addressTableLookup.cjs +1 -0
- package/functions/pre-transaction/addressTableLookup.d.ts +4 -0
- package/functions/pre-transaction/addressTableLookup.mjs +44 -0
- package/functions/pre-transaction/constructAdminData.cjs +1 -1
- package/functions/pre-transaction/constructAdminData.d.ts +2 -1
- package/functions/pre-transaction/constructAdminData.mjs +30 -12
- package/functions/pre-transaction/convert-okx-instructions.cjs +1 -0
- package/functions/pre-transaction/convert-okx-instructions.d.ts +12 -0
- package/functions/pre-transaction/convert-okx-instructions.mjs +30 -0
- package/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -0
- package/functions/pre-transaction/getSolanaCalldataHash.d.ts +4 -0
- package/functions/pre-transaction/getSolanaCalldataHash.mjs +36 -0
- package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +11 -7
- package/functions/pre-transaction/index.d.ts +10 -0
- package/functions/pre-transaction/initTokenLimitIfNeeded.cjs +1 -0
- package/functions/pre-transaction/initTokenLimitIfNeeded.d.ts +3 -0
- package/functions/pre-transaction/initTokenLimitIfNeeded.mjs +20 -0
- package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.mjs +14 -13
- package/functions/pre-transaction/process-gas-estimates.cjs +1 -1
- package/functions/pre-transaction/process-gas-estimates.d.ts +2 -2
- package/functions/pre-transaction/process-gas-estimates.mjs +13 -12
- package/functions/pre-transaction/recipientUtxoProcessing.cjs +1 -0
- package/functions/pre-transaction/recipientUtxoProcessing.d.ts +3 -0
- package/functions/pre-transaction/recipientUtxoProcessing.mjs +36 -0
- package/functions/pre-transaction/sendInitNullifiersTransaction.cjs +1 -0
- package/functions/pre-transaction/sendInitNullifiersTransaction.d.ts +11 -0
- package/functions/pre-transaction/sendInitNullifiersTransaction.mjs +41 -0
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -0
- package/functions/pre-transaction/sendV0Transaction.d.ts +22 -0
- package/functions/pre-transaction/sendV0Transaction.mjs +121 -0
- package/functions/pre-transaction/solana-public-signals.cjs +1 -0
- package/functions/pre-transaction/solana-public-signals.d.ts +19 -0
- package/functions/pre-transaction/solana-public-signals.mjs +60 -0
- package/functions/pre-transaction/solana.cjs +1 -0
- package/functions/pre-transaction/solana.d.ts +17 -0
- package/functions/pre-transaction/solana.mjs +96 -0
- package/functions/pre-transaction/solanaTransfer.utils.cjs +1 -0
- package/functions/pre-transaction/solanaTransfer.utils.d.ts +6 -0
- package/functions/pre-transaction/solanaTransfer.utils.mjs +38 -0
- package/functions/pre-transaction/store-instructions.cjs +1 -0
- package/functions/pre-transaction/store-instructions.d.ts +4 -0
- package/functions/pre-transaction/store-instructions.mjs +9 -0
- package/functions/pre-transaction/store-proof.cjs +1 -0
- package/functions/pre-transaction/store-proof.d.ts +7 -0
- package/functions/pre-transaction/store-proof.mjs +55 -0
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.mjs +33 -29
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.d.ts +1 -1
- package/functions/private-wallet/emporium.swap.helpers.mjs +79 -69
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.d.ts +40 -0
- package/functions/snarkjs/constant.mjs +66 -23
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.mjs +32 -32
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +1 -1
- package/functions/snarkjs/constructGeneralZkProof.mjs +63 -61
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -0
- package/functions/snarkjs/constructSolanaZkProof.d.ts +13 -0
- package/functions/snarkjs/constructSolanaZkProof.mjs +109 -0
- package/functions/snarkjs/generateCircomData.cjs +1 -1
- package/functions/snarkjs/generateCircomData.d.ts +1 -1
- package/functions/snarkjs/generateCircomData.mjs +9 -9
- package/functions/snarkjs/generateZkProofEnclave.cjs +1 -1
- package/functions/snarkjs/generateZkProofEnclave.mjs +10 -9
- package/functions/snarkjs/getZKFiles.cjs +1 -1
- package/functions/snarkjs/getZKFiles.mjs +13 -13
- package/functions/snarkjs/index.d.ts +1 -0
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +1 -1
- package/functions/utils/addresses.mjs +21 -17
- package/functions/utils/amounts.utils.cjs +1 -1
- package/functions/utils/amounts.utils.d.ts +1 -0
- package/functions/utils/amounts.utils.mjs +53 -40
- package/functions/utils/bytes32.utils.cjs +1 -0
- package/functions/utils/bytes32.utils.d.ts +2 -0
- package/functions/utils/bytes32.utils.mjs +10 -0
- package/functions/utils/cacheDevice.utils.cjs +1 -1
- package/functions/utils/cacheDevice.utils.mjs +2 -3
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.mjs +53 -52
- package/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
- package/functions/utils/convertIntegrationProviderToExternalActionId.mjs +1 -0
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +4 -1
- package/functions/utils/create-provider.mjs +8 -6
- package/functions/utils/encodeTokenWithId.cjs +1 -1
- package/functions/utils/encodeTokenWithId.d.ts +1 -1
- package/functions/utils/encodeTokenWithId.mjs +6 -2
- package/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +29 -28
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.mjs +29 -29
- package/functions/utils/ethers-formatter.utils.cjs +1 -1
- package/functions/utils/ethers-formatter.utils.d.ts +2 -0
- package/functions/utils/ethers-formatter.utils.mjs +45 -15
- package/functions/utils/evmNetworkFunctions.cjs +1 -1
- package/functions/utils/evmNetworkFunctions.mjs +3 -4
- package/functions/utils/fees.utils.cjs +1 -1
- package/functions/utils/fees.utils.d.ts +1 -0
- package/functions/utils/fees.utils.mjs +19 -9
- package/functions/utils/get-hinkal-approvals.cjs +1 -1
- package/functions/utils/get-hinkal-approvals.mjs +1 -1
- package/functions/utils/getBlockExplorerUrl.cjs +1 -1
- package/functions/utils/getBlockExplorerUrl.mjs +2 -2
- package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.d.ts +0 -1
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +10 -13
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -0
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +4 -0
- package/functions/utils/getUtxosFromReceipt.utils.mjs +29 -0
- package/functions/utils/getUtxosFromReceiptSolana.cjs +1 -0
- package/functions/utils/getUtxosFromReceiptSolana.d.ts +5 -0
- package/functions/utils/getUtxosFromReceiptSolana.mjs +19 -0
- package/functions/utils/index.d.ts +5 -1
- package/functions/utils/networks.utils.cjs +1 -1
- package/functions/utils/networks.utils.mjs +2 -3
- package/functions/utils/nftTokenFunctions.cjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +8 -4
- package/functions/utils/prepareHinkal.cjs +1 -0
- package/functions/utils/prepareHinkal.d.ts +7 -1
- package/functions/utils/prepareHinkal.mjs +88 -0
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.d.ts +1 -0
- package/functions/utils/publicBalance.utils.mjs +75 -45
- package/functions/utils/solanaMint.utils.cjs +1 -0
- package/functions/utils/solanaMint.utils.d.ts +10 -0
- package/functions/utils/solanaMint.utils.mjs +14 -0
- package/functions/utils/time.utils.cjs +1 -1
- package/functions/utils/time.utils.d.ts +1 -1
- package/functions/utils/time.utils.mjs +11 -11
- package/functions/utils/userAgent.cjs +1 -1
- package/functions/utils/userAgent.mjs +6 -7
- package/functions/utils/walletBalances.utils.cjs +1 -1
- package/functions/utils/walletBalances.utils.d.ts +2 -1
- package/functions/utils/walletBalances.utils.mjs +18 -17
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.mjs +98 -91
- package/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
- package/functions/web3/events/getInputUtxosEnclave.mjs +38 -16
- package/functions/web3/events/getShieldedBalance.cjs +2 -2
- package/functions/web3/events/getShieldedBalance.mjs +70 -62
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.d.ts +3 -2
- package/functions/web3/events/getTransactionLogEvents.mjs +12 -9
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -0
- package/functions/web3/fetchSolanaMerkleTreeRootHash.d.ts +4 -0
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +45 -0
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +2 -0
- package/functions/web3/functionCalls/accessTokenCalls.mjs +25 -7
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +20 -0
- package/functions/web3/functionCalls/transactCallRelayer.mjs +61 -19
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +20 -50
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +29 -24
- package/functions/web3/index.d.ts +2 -0
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.mjs +11 -8
- package/functions/web3/okxAPI.cjs +1 -0
- package/functions/web3/okxAPI.d.ts +8 -0
- package/functions/web3/okxAPI.mjs +43 -0
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +7 -4
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +22 -18
- package/functions/web3/signAndSendSerializedTransaction.cjs +1 -0
- package/functions/web3/signAndSendSerializedTransaction.d.ts +2 -0
- package/functions/web3/signAndSendSerializedTransaction.mjs +11 -0
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +7 -4
- package/index.cjs +1 -1
- package/index.mjs +922 -810
- package/package.json +12 -16
- package/providers/CustomEthersProvider.cjs +1 -0
- package/providers/{TorExternalProvider.d.ts → CustomEthersProvider.d.ts} +2 -2
- package/providers/CustomEthersProvider.mjs +29 -0
- package/providers/CustomSolanaConnection.cjs +1 -0
- package/providers/CustomSolanaConnection.d.ts +4 -0
- package/providers/CustomSolanaConnection.mjs +33 -0
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +1 -2
- package/providers/EthersProviderAdapter.mjs +8 -48
- package/providers/SolanaProviderAdapter.cjs +1 -0
- package/providers/SolanaProviderAdapter.d.ts +44 -0
- package/providers/SolanaProviderAdapter.mjs +125 -0
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +1 -2
- package/providers/WagmiProviderAdapter.mjs +26 -24
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +10 -7
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +9 -6
- package/types/IMultiThreadedUtxoUtils.d.ts +2 -2
- package/types/TransactionSimulator.types.d.ts +1 -0
- package/types/activities.types.cjs +1 -1
- package/types/activities.types.d.ts +1 -0
- package/types/activities.types.mjs +6 -4
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +16 -0
- package/types/admin.types.mjs +1 -1
- package/types/all-points.types.d.ts +0 -1
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +8 -1
- package/types/cache.types.mjs +1 -1
- package/types/circom-data.types.d.ts +6 -0
- package/types/commitments.types.d.ts +12 -0
- package/types/ethereum-network.types.cjs +1 -1
- package/types/ethereum-network.types.d.ts +9 -3
- package/types/ethereum-network.types.mjs +1 -1
- package/types/external-action.types.cjs +1 -1
- package/types/external-action.types.d.ts +3 -1
- package/types/external-action.types.mjs +2 -2
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +3 -2
- package/types/hinkal.types.mjs +8 -8
- package/types/http.types.d.ts +8 -0
- package/types/index.d.ts +3 -2
- package/types/new-rewards.type.d.ts +2 -9
- package/types/offscreen.types.cjs +1 -1
- package/types/offscreen.types.d.ts +2 -1
- package/types/offscreen.types.mjs +2 -2
- package/types/okx.types.d.ts +57 -0
- package/types/rewards.types.d.ts +0 -11
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +19 -2
- package/types/sandbox.types.mjs +2 -2
- package/types/solana.types.d.ts +75 -0
- package/types/token.types.d.ts +6 -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.d.ts +0 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +28 -30
- package/webworker/utxoWorker/utxoWorker.types.d.ts +2 -0
- 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 +33 -31
- package/webworker/viteWorkerURL.constant.cjs +21 -1
- package/webworker/viteWorkerURL.constant.mjs +21 -12
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
- package/API/mysteryBoxesCalls.cjs +0 -1
- package/API/mysteryBoxesCalls.d.ts +0 -60
- package/API/mysteryBoxesCalls.mjs +0 -66
- package/assets/snarkjsWorkerLauncher-CWaDqRaL.js +0 -14803
- package/assets/utxoWorkerLauncher-BUhBaUSg.js +0 -115868
- package/assets/zkProofWorkerLauncher-DlWQP3l9.js +0 -115360
- package/constants/mystery-boxes.constants.cjs +0 -1
- package/constants/mystery-boxes.constants.d.ts +0 -63
- package/constants/mystery-boxes.constants.mjs +0 -355
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractApprovalsSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractEventService.cjs +0 -1
- package/data-structures/event-service/AbstractEventService.mjs +0 -33
- package/data-structures/event-service/AbstractSnapshotService.cjs +0 -1
- package/data-structures/event-service/BlockchainEventEmitter.cjs +0 -1
- package/data-structures/event-service/BlockchainEventEmitter.mjs +0 -80
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientApprovalsSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientApprovalsSnapshotService.mjs +0 -23
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +0 -31
- package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +0 -30
- package/functions/utils/mystery-box-auction.utils.cjs +0 -1
- package/functions/utils/mystery-box-auction.utils.d.ts +0 -8
- package/functions/utils/mystery-box-auction.utils.mjs +0 -51
- package/providers/TorExternalProvider.cjs +0 -1
- package/providers/TorExternalProvider.mjs +0 -29
- package/types/merch-order.types.cjs +0 -1
- package/types/merch-order.types.d.ts +0 -16
- package/types/merch-order.types.mjs +0 -4
- package/types/mystery-boxes.types.cjs +0 -1
- package/types/mystery-boxes.types.d.ts +0 -43
- package/types/mystery-boxes.types.mjs +0 -6
- /package/data-structures/event-service/{AbstractNullifierSnapshotService.cjs → evm/AbstractNullifierSnapshotService.cjs} +0 -0
- /package/data-structures/event-service/{AbstractNullifierSnapshotService.mjs → evm/AbstractNullifierSnapshotService.mjs} +0 -0
- /package/data-structures/event-service/{AbstractSnapshotService.d.ts → evm/AbstractSnapshotService.d.ts} +0 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { BorshCoder as v, EventParser as p } from "@coral-xyz/anchor";
|
|
2
|
+
import { getSequence as f, resolveSync as S } from "../../../functions/utils/resolve-sync.utils.mjs";
|
|
3
|
+
import { balanceFetchingMutex as P } from "../../../functions/utils/mutexes.utils.mjs";
|
|
4
|
+
import { Logger as l } from "../../../error-handling/logger.mjs";
|
|
5
|
+
import { networkRegistry as y, chainIds as u } from "../../../constants/chains.constants.mjs";
|
|
6
|
+
import { caseInsensitiveEqual as E } from "../../../functions/utils/caseInsensitive.utils.mjs";
|
|
7
|
+
const d = 1e3;
|
|
8
|
+
class _ {
|
|
9
|
+
connection;
|
|
10
|
+
programId;
|
|
11
|
+
_latestSlot;
|
|
12
|
+
_initialSlot;
|
|
13
|
+
onEventsProcessed;
|
|
14
|
+
eventProcessors = /* @__PURE__ */ new Set();
|
|
15
|
+
maxPageSize;
|
|
16
|
+
isReady = !1;
|
|
17
|
+
isServer;
|
|
18
|
+
intervalId;
|
|
19
|
+
inProgress;
|
|
20
|
+
// to remove race conditions
|
|
21
|
+
anchorParser;
|
|
22
|
+
constructor(t, r, i, s, n) {
|
|
23
|
+
this.connection = t, this.programId = r, this._initialSlot = i, this.maxPageSize = n, this.isServer = s, this.inProgress = !1;
|
|
24
|
+
}
|
|
25
|
+
get latestBlockNumber() {
|
|
26
|
+
return this._latestSlot ?? this._initialSlot;
|
|
27
|
+
}
|
|
28
|
+
setIdl(t) {
|
|
29
|
+
try {
|
|
30
|
+
const r = new v(t);
|
|
31
|
+
this.anchorParser = new p(this.programId, r);
|
|
32
|
+
} catch (r) {
|
|
33
|
+
l.error("Failed to initialize Anchor EventParser:", r), this.anchorParser = void 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
syncFromAtMost(t) {
|
|
37
|
+
(this._latestSlot === void 0 || t < this._latestSlot) && (this._latestSlot = t);
|
|
38
|
+
}
|
|
39
|
+
intervalClear() {
|
|
40
|
+
this.isReady = !1, this.eventProcessors = /* @__PURE__ */ new Set(), clearInterval(this.intervalId);
|
|
41
|
+
}
|
|
42
|
+
async init() {
|
|
43
|
+
if (this.isReady)
|
|
44
|
+
throw new Error("Already initialized");
|
|
45
|
+
this.isReady = !0, await this.retrieveEvents(this.latestBlockNumber + 1), this.intervalId = setInterval(async () => {
|
|
46
|
+
await this.retrieveEvents(this.latestBlockNumber);
|
|
47
|
+
}, 3500);
|
|
48
|
+
}
|
|
49
|
+
requireReady() {
|
|
50
|
+
if (!this.isReady)
|
|
51
|
+
throw new Error("Not ready");
|
|
52
|
+
}
|
|
53
|
+
get chainId() {
|
|
54
|
+
const t = this.connection.rpcEndpoint;
|
|
55
|
+
return E(t, y[u.solanaMainnet].fetchRpcUrl) ? u.solanaMainnet : u.solanaLocalnet;
|
|
56
|
+
}
|
|
57
|
+
addEventProcessorFunction(t) {
|
|
58
|
+
if (this.isReady)
|
|
59
|
+
throw new Error("Can't add event processor after event emitter initialized");
|
|
60
|
+
this.eventProcessors.add(t);
|
|
61
|
+
}
|
|
62
|
+
async getLastSlotForEventRequest() {
|
|
63
|
+
const t = await this.connection.getSlot();
|
|
64
|
+
return this.isServer ? Math.max(this.latestBlockNumber, t - 32 + 1) : t;
|
|
65
|
+
}
|
|
66
|
+
// Implementation for IBlockchainEventEmitter interface (blockNumber terminology)
|
|
67
|
+
async retrieveEvents(t, r = !1) {
|
|
68
|
+
const i = t;
|
|
69
|
+
return this.requireReady(), await P.runExclusive(async () => {
|
|
70
|
+
try {
|
|
71
|
+
if (this.inProgress && !r)
|
|
72
|
+
return !1;
|
|
73
|
+
this.inProgress = !0;
|
|
74
|
+
let n = 0;
|
|
75
|
+
const o = await this.getLastSlotForEventRequest();
|
|
76
|
+
if (o < i)
|
|
77
|
+
return this.inProgress = !1, !1;
|
|
78
|
+
const c = f(i, o, this.maxPageSize), h = [];
|
|
79
|
+
await S(
|
|
80
|
+
c.map(({ from: e, to: g }) => async () => {
|
|
81
|
+
const m = await this.getProgramEvents(e, g);
|
|
82
|
+
h.push(...m);
|
|
83
|
+
})
|
|
84
|
+
);
|
|
85
|
+
const a = await Promise.all(
|
|
86
|
+
[...this.eventProcessors].map((e) => e(h))
|
|
87
|
+
);
|
|
88
|
+
return this._latestSlot = o, n += a.reduce((e, g) => e + g, 0), this.onEventsProcessed?.(n), this.inProgress = !1, !0;
|
|
89
|
+
} catch (n) {
|
|
90
|
+
return l.error("retrieveEvents error:", n), this.inProgress = !1, !1;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
async getProgramEvents(t, r) {
|
|
95
|
+
const i = [];
|
|
96
|
+
try {
|
|
97
|
+
const s = await this.connection.getSignaturesForAddress(this.programId, {
|
|
98
|
+
limit: d,
|
|
99
|
+
before: void 0
|
|
100
|
+
// Start from the latest
|
|
101
|
+
});
|
|
102
|
+
let n = s.length;
|
|
103
|
+
for (; n >= d; ) {
|
|
104
|
+
const a = s[s.length - 1], e = await this.connection.getSignaturesForAddress(this.programId, {
|
|
105
|
+
limit: d,
|
|
106
|
+
before: a.signature
|
|
107
|
+
});
|
|
108
|
+
if (e.length === 0)
|
|
109
|
+
break;
|
|
110
|
+
s.push(...e), n = e.length;
|
|
111
|
+
}
|
|
112
|
+
const c = s.filter((a) => a.slot >= t && a.slot <= r).map(async (a) => {
|
|
113
|
+
try {
|
|
114
|
+
const e = await this.connection.getTransaction(a.signature, {
|
|
115
|
+
commitment: "confirmed",
|
|
116
|
+
maxSupportedTransactionVersion: 0
|
|
117
|
+
});
|
|
118
|
+
return e && e.meta && e.meta.logMessages ? this.parseLogsForEvents(
|
|
119
|
+
e.meta.logMessages,
|
|
120
|
+
a.signature,
|
|
121
|
+
a.slot,
|
|
122
|
+
e.blockTime || null
|
|
123
|
+
) : [];
|
|
124
|
+
} catch (e) {
|
|
125
|
+
return l.error(`Failed to get transaction ${a.signature}:`, e), [];
|
|
126
|
+
}
|
|
127
|
+
}), h = await Promise.all(c);
|
|
128
|
+
i.push(...h.flat());
|
|
129
|
+
} catch (s) {
|
|
130
|
+
l.error("Error getting program events:", s);
|
|
131
|
+
}
|
|
132
|
+
return i;
|
|
133
|
+
}
|
|
134
|
+
parseLogsForEvents(t, r, i, s) {
|
|
135
|
+
if (!this.anchorParser)
|
|
136
|
+
return [];
|
|
137
|
+
try {
|
|
138
|
+
return Array.from(this.anchorParser.parseLogs(t)).map(({ name: o, data: c }) => ({
|
|
139
|
+
signature: r,
|
|
140
|
+
slot: i,
|
|
141
|
+
blockTime: s || 0,
|
|
142
|
+
programId: this.programId,
|
|
143
|
+
data: c,
|
|
144
|
+
eventName: o
|
|
145
|
+
}));
|
|
146
|
+
} catch (n) {
|
|
147
|
+
return l.error("Anchor EventParser failed; falling back to generic parsing:", n), [];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
export {
|
|
152
|
+
_ as SolanaBlockchainEventEmitter
|
|
153
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("axios");class o{axiosInstance;constructor(){this.axiosInstance=n.create()}async get(s,t){return(await this.axiosInstance.get(s,t)).data}async post(s,t,e){return(await this.axiosInstance.post(s,t,e)).data}async put(s,t,e){return(await this.axiosInstance.put(s,t,e)).data}async patch(s,t,e){return(await this.axiosInstance.patch(s,t,e)).data}async delete(s,t){return(await this.axiosInstance.delete(s,t)).data}}exports.BasicHttpClient=o;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { HttpClient } from '../../types/http.types';
|
|
3
|
+
export declare class BasicHttpClient implements HttpClient {
|
|
4
|
+
private axiosInstance;
|
|
5
|
+
constructor();
|
|
6
|
+
get<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
|
7
|
+
post<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
|
8
|
+
put<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
|
9
|
+
patch<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
|
|
10
|
+
delete<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import n from "axios";
|
|
2
|
+
class c {
|
|
3
|
+
axiosInstance;
|
|
4
|
+
constructor() {
|
|
5
|
+
this.axiosInstance = n.create();
|
|
6
|
+
}
|
|
7
|
+
async get(s, t) {
|
|
8
|
+
return (await this.axiosInstance.get(s, t)).data;
|
|
9
|
+
}
|
|
10
|
+
async post(s, t, a) {
|
|
11
|
+
return (await this.axiosInstance.post(s, t, a)).data;
|
|
12
|
+
}
|
|
13
|
+
async put(s, t, a) {
|
|
14
|
+
return (await this.axiosInstance.put(s, t, a)).data;
|
|
15
|
+
}
|
|
16
|
+
async patch(s, t, a) {
|
|
17
|
+
return (await this.axiosInstance.patch(s, t, a)).data;
|
|
18
|
+
}
|
|
19
|
+
async delete(s, t) {
|
|
20
|
+
return (await this.axiosInstance.delete(s, t)).data;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
c as BasicHttpClient
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./BasicHttpClient.cjs");let n=new i.BasicHttpClient;const l={setHttpClient:t=>{n=t},get:(t,e)=>n.get(t,e),post:(t,e,p)=>n.post(t,e,p),put:(t,e,p)=>n.put(t,e,p),patch:(t,e,p)=>n.patch(t,e,p),delete:(t,e)=>n.delete(t,e)};exports.httpClient=l;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpClient } from '../../types/http.types';
|
|
2
|
+
declare const httpClient: {
|
|
3
|
+
setHttpClient: (client: HttpClient) => void;
|
|
4
|
+
get: <T = any>(url: string, config?: any) => Promise<T>;
|
|
5
|
+
post: <T_1 = any>(url: string, data?: any, config?: any) => Promise<T_1>;
|
|
6
|
+
put: <T_2 = any>(url: string, data?: any, config?: any) => Promise<T_2>;
|
|
7
|
+
patch: <T_3 = any>(url: string, data?: any, config?: any) => Promise<T_3>;
|
|
8
|
+
delete: <T_4 = any>(url: string, config?: any) => Promise<T_4>;
|
|
9
|
+
};
|
|
10
|
+
export { httpClient };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BasicHttpClient as l } from "./BasicHttpClient.mjs";
|
|
2
|
+
let p = new l();
|
|
3
|
+
const o = {
|
|
4
|
+
setHttpClient: (t) => {
|
|
5
|
+
p = t;
|
|
6
|
+
},
|
|
7
|
+
get: (t, e) => p.get(t, e),
|
|
8
|
+
post: (t, e, n) => p.post(t, e, n),
|
|
9
|
+
put: (t, e, n) => p.put(t, e, n),
|
|
10
|
+
patch: (t, e, n) => p.patch(t, e, n),
|
|
11
|
+
delete: (t, e) => p.delete(t, e)
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
o as httpClient
|
|
15
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TransactionRequest, TransactionResponse } from '@ethersproject/providers';
|
|
2
1
|
import { ContractMetadata, ContractType, EthereumNetwork } from '../../types/ethereum-network.types';
|
|
3
2
|
import { Contract, ethers, Signer } from 'ethers';
|
|
4
3
|
export interface ChainEventListener {
|
|
@@ -8,7 +7,6 @@ export interface ChainEventListener {
|
|
|
8
7
|
export interface IProviderAdapter<ConnectorType = unknown> {
|
|
9
8
|
chainId: number | undefined;
|
|
10
9
|
initConnector(connector: ConnectorType): void;
|
|
11
|
-
getSigner(): Signer;
|
|
12
10
|
initSigner?(signer: Signer): void;
|
|
13
11
|
init(chainId?: number): Promise<void>;
|
|
14
12
|
initConfig?(config?: any): Promise<void> | void;
|
|
@@ -26,7 +24,7 @@ export interface IProviderAdapter<ConnectorType = unknown> {
|
|
|
26
24
|
getContractWithSigner(contract: ContractType, contractAddress?: string): Contract;
|
|
27
25
|
getContractWithFetcher(contract: ContractType, contractAddress?: string): Contract;
|
|
28
26
|
getContractWithFetcherForEthereum(contract: ContractType, contractAddress?: string): Contract;
|
|
29
|
-
sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>;
|
|
27
|
+
sendTransaction(tx: ethers.providers.TransactionRequest): Promise<ethers.providers.TransactionResponse>;
|
|
30
28
|
switchNetwork(network: EthereumNetwork): Promise<unknown>;
|
|
31
29
|
switchAccount(signer: ethers.Signer): Promise<void>;
|
|
32
30
|
onAccountChanged(): Promise<unknown>;
|
|
@@ -12,5 +12,5 @@ export declare class SnapshotFetcherService {
|
|
|
12
12
|
getCommitments(forceRefresh?: boolean): Promise<import("../../API/fetchCommitmentsCache").ICommitmentsTreeSnapshot>;
|
|
13
13
|
getAccessTokens(forceRefresh?: boolean): Promise<import("../../API/fetchCommitmentsCache").IAccessTokenTreeSnapshot>;
|
|
14
14
|
getNullifiers(forceRefresh?: boolean): Promise<import("../../API/fetchCommitmentsCache").INullifiersSnapshot>;
|
|
15
|
-
getApprovals(forceRefresh?: boolean): Promise<import("../../API/fetchCommitmentsCache").IApprovalsSnapshot>;
|
|
15
|
+
getApprovals(forceRefresh?: boolean): Promise<import("../../API/fetchCommitmentsCache").IApprovalsSnapshot | undefined>;
|
|
16
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../event-service/evm/AbstractAccessTokenSnapshotService.cjs");require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../../constants/vite.constants.cjs");require("../../../error-handling/error-codes.constants.cjs");require("../../../constants/save-depths.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../../functions/utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("../../../constants/chains.constants.cjs");require("@solana/web3.js");require("../../crypto-keys/keys.cjs");const c=require("../SnapshotFetcherService.cjs");class i extends t.AbstractAccessTokenSnapshotService{snapshotsService;constructor(e,s){super(e),this.snapshotsService=s}async fetchSnapshot(){const{contract:e}=this.blockchainEventEmitter,{chainId:s}=await e.provider.getNetwork();this.snapshotsService||(this.snapshotsService=new c.SnapshotFetcherService(s,e.address));const r=await this.snapshotsService.getAccessTokens();if(r.accessTokenContractAddress!==e.address||r.chainId!==s)throw Error("Commitment Snapshot: incorrect contract or chain id");return{latestBlockNumber:r.latestBlockNumber,merkleTree:r.merkleTree,senderAddresses:r.senderAddresses,senderAddressIndexMap:r.senderAddressIndexMap}}persistSnapshot(e){return Promise.resolve()}}exports.ClientAccessTokenSnapshotService=i;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractAccessTokenSnapshotService, AccessTokenSerializedSnapshot, BlockchainEventEmitter } from '
|
|
2
|
-
import { SnapshotFetcherService } from '
|
|
1
|
+
import { AbstractAccessTokenSnapshotService, AccessTokenSerializedSnapshot, BlockchainEventEmitter } from '../../event-service';
|
|
2
|
+
import { SnapshotFetcherService } from '../SnapshotFetcherService';
|
|
3
3
|
export declare class ClientAccessTokenSnapshotService extends AbstractAccessTokenSnapshotService {
|
|
4
4
|
private snapshotsService;
|
|
5
5
|
constructor(accessTokenEventFetcher: BlockchainEventEmitter, snapshotFetcher: SnapshotFetcherService);
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { AbstractAccessTokenSnapshotService as r } from "
|
|
1
|
+
import { AbstractAccessTokenSnapshotService as r } from "../../event-service/evm/AbstractAccessTokenSnapshotService.mjs";
|
|
2
2
|
import "ethers";
|
|
3
3
|
import "circomlibjs-hinkal-fork";
|
|
4
4
|
import "libsodium-wrappers";
|
|
5
5
|
import "process";
|
|
6
6
|
import "buffer";
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
import
|
|
13
|
-
|
|
7
|
+
import "../../../constants/vite.constants.mjs";
|
|
8
|
+
import "../../../error-handling/error-codes.constants.mjs";
|
|
9
|
+
import "../../../constants/save-depths.mjs";
|
|
10
|
+
import "../../../constants/reorg-depths.constants.mjs";
|
|
11
|
+
import "../../../functions/utils/mutexes.utils.mjs";
|
|
12
|
+
import "@coral-xyz/anchor";
|
|
13
|
+
import "../../../constants/chains.constants.mjs";
|
|
14
|
+
import "@solana/web3.js";
|
|
15
|
+
import "../../crypto-keys/keys.mjs";
|
|
16
|
+
import { SnapshotFetcherService as o } from "../SnapshotFetcherService.mjs";
|
|
17
|
+
class b extends r {
|
|
14
18
|
snapshotsService;
|
|
15
19
|
constructor(e, t) {
|
|
16
20
|
super(e), this.snapshotsService = t;
|
|
@@ -33,5 +37,5 @@ class T extends r {
|
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
export {
|
|
36
|
-
|
|
40
|
+
b as ClientAccessTokenSnapshotService
|
|
37
41
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../../constants/vite.constants.cjs");require("../../../error-handling/error-codes.constants.cjs");require("../../../constants/save-depths.cjs");const s=require("../../event-service/evm/AbstractApprovalsSnapshotService.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../../functions/utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("../../../constants/chains.constants.cjs");require("@solana/web3.js");require("../../crypto-keys/keys.cjs");class a extends s.AbstractApprovalsSnapshotService{snapshotsService;constructor(r,t){super(r),this.snapshotsService=t}async fetchSnapshot(){const{contract:r}=this.blockchainEventEmitter,{chainId:t}=await r.provider.getNetwork(),e=await this.snapshotsService.getApprovals();if(!e)return{latestBlockNumber:0,approvals:{},events:[]};if(e.hinkalAddress!==r.address||e.chainId!==t)throw Error("approvalsSnapshotData Snapshot: incorrect contract or chain id");return{latestBlockNumber:e.latestBlockNumber,approvals:e.approvals,events:e.events}}persistSnapshot(r){return Promise.resolve()}}exports.ClientApprovalsSnapshotService=a;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AbstractApprovalsSnapshotService, ApprovalsSerializedSnapshot } from '
|
|
2
|
-
import {
|
|
3
|
-
import { SnapshotFetcherService } from './SnapshotFetcherService';
|
|
1
|
+
import { AbstractApprovalsSnapshotService, ApprovalsSerializedSnapshot, BlockchainEventEmitter, CommitmentsSerializedSnapshot } from '../../event-service';
|
|
2
|
+
import { SnapshotFetcherService } from '../SnapshotFetcherService';
|
|
4
3
|
export declare class ClientApprovalsSnapshotService extends AbstractApprovalsSnapshotService {
|
|
5
4
|
private snapshotsService;
|
|
6
5
|
constructor(hinkalEventEmitter: BlockchainEventEmitter, snapshotFetcher: SnapshotFetcherService);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "ethers";
|
|
2
|
+
import "circomlibjs-hinkal-fork";
|
|
3
|
+
import "libsodium-wrappers";
|
|
4
|
+
import "process";
|
|
5
|
+
import "buffer";
|
|
6
|
+
import "../../../constants/vite.constants.mjs";
|
|
7
|
+
import "../../../error-handling/error-codes.constants.mjs";
|
|
8
|
+
import "../../../constants/save-depths.mjs";
|
|
9
|
+
import { AbstractApprovalsSnapshotService as s } from "../../event-service/evm/AbstractApprovalsSnapshotService.mjs";
|
|
10
|
+
import "../../../constants/reorg-depths.constants.mjs";
|
|
11
|
+
import "../../../functions/utils/mutexes.utils.mjs";
|
|
12
|
+
import "@coral-xyz/anchor";
|
|
13
|
+
import "../../../constants/chains.constants.mjs";
|
|
14
|
+
import "@solana/web3.js";
|
|
15
|
+
import "../../crypto-keys/keys.mjs";
|
|
16
|
+
class f extends s {
|
|
17
|
+
snapshotsService;
|
|
18
|
+
constructor(r, o) {
|
|
19
|
+
super(r), this.snapshotsService = o;
|
|
20
|
+
}
|
|
21
|
+
async fetchSnapshot() {
|
|
22
|
+
const { contract: r } = this.blockchainEventEmitter, { chainId: o } = await r.provider.getNetwork(), t = await this.snapshotsService.getApprovals();
|
|
23
|
+
if (!t)
|
|
24
|
+
return {
|
|
25
|
+
latestBlockNumber: 0,
|
|
26
|
+
approvals: {},
|
|
27
|
+
events: []
|
|
28
|
+
};
|
|
29
|
+
if (t.hinkalAddress !== r.address || t.chainId !== o)
|
|
30
|
+
throw Error("approvalsSnapshotData Snapshot: incorrect contract or chain id");
|
|
31
|
+
return {
|
|
32
|
+
latestBlockNumber: t.latestBlockNumber,
|
|
33
|
+
approvals: t.approvals,
|
|
34
|
+
events: t.events
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
persistSnapshot(r) {
|
|
38
|
+
return Promise.resolve();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
f as ClientApprovalsSnapshotService
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../../constants/vite.constants.cjs");require("../../../error-handling/error-codes.constants.cjs");require("../../../constants/save-depths.cjs");const t=require("../../event-service/evm/AbstractCommitmentsSnapshotService.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../../functions/utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("../../../constants/chains.constants.cjs");require("@solana/web3.js");require("../../crypto-keys/keys.cjs");class s extends t.AbstractCommitmentsSnapshotService{snapshotsService;constructor(e,r){super(e),this.snapshotsService=r}async fetchSnapshot(){const e=await this.snapshotsService.getCommitments();return{latestBlockNumber:e.latestBlockNumber,merkleTree:e.merkleTree,encryptedOutputs:e.encryptedOutputs}}persistSnapshot(e){return Promise.resolve()}}exports.ClientCommitmentsSnapshotService=s;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractCommitmentsSnapshotService, BlockchainEventEmitter, CommitmentsSerializedSnapshot } from '
|
|
2
|
-
import { SnapshotFetcherService } from '
|
|
1
|
+
import { AbstractCommitmentsSnapshotService, BlockchainEventEmitter, CommitmentsSerializedSnapshot } from '../../event-service';
|
|
2
|
+
import { SnapshotFetcherService } from '../SnapshotFetcherService';
|
|
3
3
|
export declare class ClientCommitmentsSnapshotService extends AbstractCommitmentsSnapshotService {
|
|
4
4
|
private snapshotsService;
|
|
5
5
|
constructor(hinkalEventEmitter: BlockchainEventEmitter, snapshotsFetcher: SnapshotFetcherService);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import "ethers";
|
|
2
|
+
import "circomlibjs-hinkal-fork";
|
|
3
|
+
import "libsodium-wrappers";
|
|
4
|
+
import "process";
|
|
5
|
+
import "buffer";
|
|
6
|
+
import "../../../constants/vite.constants.mjs";
|
|
7
|
+
import "../../../error-handling/error-codes.constants.mjs";
|
|
8
|
+
import "../../../constants/save-depths.mjs";
|
|
9
|
+
import { AbstractCommitmentsSnapshotService as r } from "../../event-service/evm/AbstractCommitmentsSnapshotService.mjs";
|
|
10
|
+
import "../../../constants/reorg-depths.constants.mjs";
|
|
11
|
+
import "../../../functions/utils/mutexes.utils.mjs";
|
|
12
|
+
import "@coral-xyz/anchor";
|
|
13
|
+
import "../../../constants/chains.constants.mjs";
|
|
14
|
+
import "@solana/web3.js";
|
|
15
|
+
import "../../crypto-keys/keys.mjs";
|
|
16
|
+
class b extends r {
|
|
17
|
+
snapshotsService;
|
|
18
|
+
constructor(t, e) {
|
|
19
|
+
super(t), this.snapshotsService = e;
|
|
20
|
+
}
|
|
21
|
+
async fetchSnapshot() {
|
|
22
|
+
const t = await this.snapshotsService.getCommitments();
|
|
23
|
+
return {
|
|
24
|
+
latestBlockNumber: t.latestBlockNumber,
|
|
25
|
+
merkleTree: t.merkleTree,
|
|
26
|
+
encryptedOutputs: t.encryptedOutputs
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
persistSnapshot(t) {
|
|
30
|
+
return Promise.resolve();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
b as ClientCommitmentsSnapshotService
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../../constants/vite.constants.cjs");require("../../../error-handling/error-codes.constants.cjs");require("../../../constants/save-depths.cjs");const i=require("../../event-service/evm/AbstractNullifierSnapshotService.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../../functions/utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("../../../constants/chains.constants.cjs");require("@solana/web3.js");require("../../crypto-keys/keys.cjs");class s extends i.AbstractNullifierSnapshotService{snapshotsService;constructor(e,r){super(e),this.snapshotsService=r}async fetchSnapshot(){const e=await this.snapshotsService.getNullifiers();return{latestBlockNumber:e.latestBlockNumber,nullifiers:e.nullifiers}}persistSnapshot(e){return Promise.resolve()}}exports.ClientNullifierSnapshotService=s;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractNullifierSnapshotService, BlockchainEventEmitter, NullifierSerializedSnapshot } from '
|
|
2
|
-
import { SnapshotFetcherService } from '
|
|
1
|
+
import { AbstractNullifierSnapshotService, BlockchainEventEmitter, NullifierSerializedSnapshot } from '../../event-service';
|
|
2
|
+
import { SnapshotFetcherService } from '../SnapshotFetcherService';
|
|
3
3
|
export declare class ClientNullifierSnapshotService extends AbstractNullifierSnapshotService {
|
|
4
4
|
private snapshotsService;
|
|
5
5
|
constructor(hinkalEventEmitter: BlockchainEventEmitter, snapshotsFetcher: SnapshotFetcherService);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "ethers";
|
|
2
|
+
import "circomlibjs-hinkal-fork";
|
|
3
|
+
import "libsodium-wrappers";
|
|
4
|
+
import "process";
|
|
5
|
+
import "buffer";
|
|
6
|
+
import "../../../constants/vite.constants.mjs";
|
|
7
|
+
import "../../../error-handling/error-codes.constants.mjs";
|
|
8
|
+
import "../../../constants/save-depths.mjs";
|
|
9
|
+
import { AbstractNullifierSnapshotService as i } from "../../event-service/evm/AbstractNullifierSnapshotService.mjs";
|
|
10
|
+
import "../../../constants/reorg-depths.constants.mjs";
|
|
11
|
+
import "../../../functions/utils/mutexes.utils.mjs";
|
|
12
|
+
import "@coral-xyz/anchor";
|
|
13
|
+
import "../../../constants/chains.constants.mjs";
|
|
14
|
+
import "@solana/web3.js";
|
|
15
|
+
import "../../crypto-keys/keys.mjs";
|
|
16
|
+
class d extends i {
|
|
17
|
+
snapshotsService;
|
|
18
|
+
constructor(t, r) {
|
|
19
|
+
super(t), this.snapshotsService = r;
|
|
20
|
+
}
|
|
21
|
+
async fetchSnapshot() {
|
|
22
|
+
const t = await this.snapshotsService.getNullifiers();
|
|
23
|
+
return {
|
|
24
|
+
latestBlockNumber: t.latestBlockNumber,
|
|
25
|
+
nullifiers: t.nullifiers
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
persistSnapshot(t) {
|
|
29
|
+
return Promise.resolve();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
d as ClientNullifierSnapshotService
|
|
34
|
+
};
|
|
@@ -1 +1,8 @@
|
|
|
1
1
|
export * from './SnapshotFetcherService';
|
|
2
|
+
export * from './solana-snapshots/ClientSolanaCommitmentsSnapshotService';
|
|
3
|
+
export * from './solana-snapshots/ClientSolanaNullifierSnapshotService';
|
|
4
|
+
export * from './solana-snapshots/ClientSolanaAccessTokenSnapshotService';
|
|
5
|
+
export * from './evm-snapshots/ClientAccessTokenSnapshotService';
|
|
6
|
+
export * from './evm-snapshots/ClientCommitmentsSnapshotService';
|
|
7
|
+
export * from './evm-snapshots/ClientNullifierSnapshotService';
|
|
8
|
+
export * from './evm-snapshots/ClientApprovalsSnapshotService';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../../constants/vite.constants.cjs");require("../../../error-handling/error-codes.constants.cjs");require("../../../constants/save-depths.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../../functions/utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("../../../constants/chains.constants.cjs");require("@solana/web3.js");require("../../crypto-keys/keys.cjs");const s=require("../../event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs"),t=require("../SnapshotFetcherService.cjs");class n extends s.AbstractSolanaAccessTokenSnapshotService{snapshotsService;constructor(r,e){super(r),this.snapshotsService=e}async fetchSnapshot(){const{chainId:r}=this.solanaBlockchainEventEmitter;this.snapshotsService||(this.snapshotsService=new t.SnapshotFetcherService(r,this.solanaBlockchainEventEmitter.programId.toString()));const e=await this.snapshotsService.getAccessTokens();return{latestBlockNumber:e.latestBlockNumber,merkleTree:e.merkleTree,senderAddresses:e.senderAddresses,senderAddressIndexMap:e.senderAddressIndexMap}}persistSnapshot(r){return Promise.resolve()}}exports.ClientSolanaAccessTokenSnapshotService=n;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AbstractSolanaAccessTokenSnapshotService, SolanaAccessTokenSerializedSnapshot, SolanaBlockchainEventEmitter } from '../../event-service';
|
|
2
|
+
import { SnapshotFetcherService } from '../SnapshotFetcherService';
|
|
3
|
+
export declare class ClientSolanaAccessTokenSnapshotService extends AbstractSolanaAccessTokenSnapshotService {
|
|
4
|
+
private snapshotsService;
|
|
5
|
+
constructor(accessTokenEventEmitter: SolanaBlockchainEventEmitter, snapshotFetcher: SnapshotFetcherService);
|
|
6
|
+
protected fetchSnapshot(): Promise<SolanaAccessTokenSerializedSnapshot>;
|
|
7
|
+
protected persistSnapshot(_serializedSnapshot: SolanaAccessTokenSerializedSnapshot): Promise<unknown>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import "ethers";
|
|
2
|
+
import "circomlibjs-hinkal-fork";
|
|
3
|
+
import "libsodium-wrappers";
|
|
4
|
+
import "process";
|
|
5
|
+
import "buffer";
|
|
6
|
+
import "../../../constants/vite.constants.mjs";
|
|
7
|
+
import "../../../error-handling/error-codes.constants.mjs";
|
|
8
|
+
import "../../../constants/save-depths.mjs";
|
|
9
|
+
import "../../../constants/reorg-depths.constants.mjs";
|
|
10
|
+
import "../../../functions/utils/mutexes.utils.mjs";
|
|
11
|
+
import "@coral-xyz/anchor";
|
|
12
|
+
import "../../../constants/chains.constants.mjs";
|
|
13
|
+
import "@solana/web3.js";
|
|
14
|
+
import "../../crypto-keys/keys.mjs";
|
|
15
|
+
import { AbstractSolanaAccessTokenSnapshotService as t } from "../../event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs";
|
|
16
|
+
import { SnapshotFetcherService as r } from "../SnapshotFetcherService.mjs";
|
|
17
|
+
class x extends t {
|
|
18
|
+
snapshotsService;
|
|
19
|
+
constructor(s, e) {
|
|
20
|
+
super(s), this.snapshotsService = e;
|
|
21
|
+
}
|
|
22
|
+
async fetchSnapshot() {
|
|
23
|
+
const { chainId: s } = this.solanaBlockchainEventEmitter;
|
|
24
|
+
this.snapshotsService || (this.snapshotsService = new r(
|
|
25
|
+
s,
|
|
26
|
+
this.solanaBlockchainEventEmitter.programId.toString()
|
|
27
|
+
));
|
|
28
|
+
const e = await this.snapshotsService.getAccessTokens();
|
|
29
|
+
return {
|
|
30
|
+
latestBlockNumber: e.latestBlockNumber,
|
|
31
|
+
merkleTree: e.merkleTree,
|
|
32
|
+
senderAddresses: e.senderAddresses,
|
|
33
|
+
senderAddressIndexMap: e.senderAddressIndexMap
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
persistSnapshot(s) {
|
|
37
|
+
return Promise.resolve();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
x as ClientSolanaAccessTokenSnapshotService
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../../constants/vite.constants.cjs");require("../../../error-handling/error-codes.constants.cjs");require("../../../constants/save-depths.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../../functions/utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("../../../constants/chains.constants.cjs");const t=require("../../event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs");require("@solana/web3.js");class s extends t.AbstractSolanaCommitmentsSnapshotService{snapshotsService;constructor(e,r){super(e),this.snapshotsService=r}async fetchSnapshot(){const e=await this.snapshotsService.getCommitments();return{latestBlockNumber:e.latestBlockNumber,merkleTree:e.merkleTree,encryptedOutputs:e.encryptedOutputs}}persistSnapshot(e){return Promise.resolve()}}exports.ClientSolanaCommitmentsSnapshotService=s;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AbstractSolanaCommitmentsSnapshotService, SolanaBlockchainEventEmitter, SolanaCommitmentsSerializedSnapshot } from '../../event-service';
|
|
2
|
+
import { SnapshotFetcherService } from '../SnapshotFetcherService';
|
|
3
|
+
export declare class ClientSolanaCommitmentsSnapshotService extends AbstractSolanaCommitmentsSnapshotService {
|
|
4
|
+
private snapshotsService;
|
|
5
|
+
constructor(commitmentsEventEmitter: SolanaBlockchainEventEmitter, snapshotFetcher: SnapshotFetcherService);
|
|
6
|
+
protected fetchSnapshot(): Promise<SolanaCommitmentsSerializedSnapshot>;
|
|
7
|
+
protected persistSnapshot(_serializedSnapshot: SolanaCommitmentsSerializedSnapshot): Promise<unknown>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "ethers";
|
|
2
|
+
import "circomlibjs-hinkal-fork";
|
|
3
|
+
import "libsodium-wrappers";
|
|
4
|
+
import "process";
|
|
5
|
+
import "buffer";
|
|
6
|
+
import "../../../constants/vite.constants.mjs";
|
|
7
|
+
import "../../../error-handling/error-codes.constants.mjs";
|
|
8
|
+
import "../../../constants/save-depths.mjs";
|
|
9
|
+
import "../../../constants/reorg-depths.constants.mjs";
|
|
10
|
+
import "../../../functions/utils/mutexes.utils.mjs";
|
|
11
|
+
import "@coral-xyz/anchor";
|
|
12
|
+
import "../../../constants/chains.constants.mjs";
|
|
13
|
+
import { AbstractSolanaCommitmentsSnapshotService as r } from "../../event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs";
|
|
14
|
+
import "@solana/web3.js";
|
|
15
|
+
class C extends r {
|
|
16
|
+
snapshotsService;
|
|
17
|
+
constructor(t, e) {
|
|
18
|
+
super(t), this.snapshotsService = e;
|
|
19
|
+
}
|
|
20
|
+
async fetchSnapshot() {
|
|
21
|
+
const t = await this.snapshotsService.getCommitments();
|
|
22
|
+
return {
|
|
23
|
+
latestBlockNumber: t.latestBlockNumber,
|
|
24
|
+
merkleTree: t.merkleTree,
|
|
25
|
+
encryptedOutputs: t.encryptedOutputs
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
persistSnapshot(t) {
|
|
29
|
+
return Promise.resolve();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
C as ClientSolanaCommitmentsSnapshotService
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../../constants/vite.constants.cjs");require("../../../error-handling/error-codes.constants.cjs");require("../../../constants/save-depths.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../../functions/utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("../../../constants/chains.constants.cjs");const i=require("../../event-service/solana/AbstractSolanaNullifierSnapshotService.cjs");require("@solana/web3.js");require("../../crypto-keys/keys.cjs");class s extends i.AbstractSolanaNullifierSnapshotService{snapshotsService;constructor(e,r){super(e),this.snapshotsService=r}async fetchSnapshot(){const e=await this.snapshotsService.getNullifiers();return{latestBlockNumber:e.latestBlockNumber,nullifiers:e.nullifiers}}persistSnapshot(e){return Promise.resolve()}}exports.ClientSolanaNullifierSnapshotService=s;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AbstractSolanaNullifierSnapshotService, SolanaBlockchainEventEmitter, SolanaNullifierSerializedSnapshot } from '../../event-service';
|
|
2
|
+
import { SnapshotFetcherService } from '../SnapshotFetcherService';
|
|
3
|
+
export declare class ClientSolanaNullifierSnapshotService extends AbstractSolanaNullifierSnapshotService {
|
|
4
|
+
private snapshotsService;
|
|
5
|
+
constructor(nullifierEventEmitter: SolanaBlockchainEventEmitter, snapshotFetcher: SnapshotFetcherService);
|
|
6
|
+
protected fetchSnapshot(): Promise<SolanaNullifierSerializedSnapshot>;
|
|
7
|
+
protected persistSnapshot(_serializedSnapshot: SolanaNullifierSerializedSnapshot): Promise<unknown>;
|
|
8
|
+
}
|