@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
|
@@ -1,150 +1,157 @@
|
|
|
1
|
-
import { Utxo as
|
|
2
|
-
import { checkChainOrAddressNotUpdated as
|
|
3
|
-
import { setHinkalCache as E, resetCache as
|
|
1
|
+
import { Utxo as h } from "../../../data-structures/utxo/Utxo.mjs";
|
|
2
|
+
import { checkChainOrAddressNotUpdated as T } from "../../utils/upToDateState.mjs";
|
|
3
|
+
import { setHinkalCache as E, resetCache as L, getHinkalCache as S } from "../../utils/cacheFunctions.mjs";
|
|
4
4
|
import { caseInsensitiveEqual as B } from "../../utils/caseInsensitive.utils.mjs";
|
|
5
|
-
import { encodeTokenWithId as
|
|
6
|
-
import { getInputUtxosEnclave as
|
|
7
|
-
import { Logger as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
import { encodeTokenWithId as C } from "../../utils/encodeTokenWithId.mjs";
|
|
6
|
+
import { getInputUtxosEnclave as K } from "./getInputUtxosEnclave.mjs";
|
|
7
|
+
import { Logger as N } from "../../../error-handling/logger.mjs";
|
|
8
|
+
import { formatMintAddress as k } from "../../utils/solanaMint.utils.mjs";
|
|
9
|
+
import { isSolanaLike as R } from "../../../constants/chains.constants.mjs";
|
|
10
|
+
const b = async (t, s, e, n, c, d, r, o, a) => {
|
|
11
|
+
a += 1;
|
|
12
|
+
const U = d.slice(a), { lastOutput: w, additionalEncryptedOutputs: l } = await t.utxoUtils.batchProcess(
|
|
13
|
+
U,
|
|
14
|
+
o,
|
|
15
|
+
s,
|
|
16
|
+
e
|
|
17
|
+
), f = [...r, ...l];
|
|
18
|
+
return await T(t, e, n), E(
|
|
16
19
|
{
|
|
17
20
|
lastOutput: w,
|
|
18
|
-
encryptedOutputs:
|
|
21
|
+
encryptedOutputs: f
|
|
19
22
|
},
|
|
20
23
|
t,
|
|
21
24
|
e,
|
|
22
|
-
|
|
23
|
-
), await t.utxoUtils.buildBatchProcess(
|
|
24
|
-
},
|
|
25
|
+
c
|
|
26
|
+
), await t.utxoUtils.buildBatchProcess(f, s, e);
|
|
27
|
+
}, F = async (t, s, e, n) => {
|
|
25
28
|
const {
|
|
26
|
-
utxos:
|
|
27
|
-
encryptedOutputs:
|
|
29
|
+
utxos: c,
|
|
30
|
+
encryptedOutputs: d,
|
|
28
31
|
lastOutput: r
|
|
29
|
-
} = await
|
|
32
|
+
} = await K(t, e, s);
|
|
30
33
|
return E(
|
|
31
34
|
{
|
|
32
|
-
encryptedOutputs:
|
|
35
|
+
encryptedOutputs: d,
|
|
33
36
|
lastOutput: r
|
|
34
37
|
},
|
|
35
38
|
t,
|
|
36
39
|
e,
|
|
37
|
-
|
|
38
|
-
),
|
|
39
|
-
},
|
|
40
|
+
n
|
|
41
|
+
), c;
|
|
42
|
+
}, H = async (t, s, e, n, c, d, r, o, a) => {
|
|
40
43
|
try {
|
|
41
|
-
return await
|
|
44
|
+
return await F(t, s, e, c);
|
|
42
45
|
} catch {
|
|
43
46
|
return b(
|
|
44
47
|
t,
|
|
45
48
|
s,
|
|
46
49
|
e,
|
|
50
|
+
n,
|
|
47
51
|
c,
|
|
48
|
-
|
|
49
|
-
u,
|
|
52
|
+
d,
|
|
50
53
|
r,
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
o,
|
|
55
|
+
a
|
|
53
56
|
);
|
|
54
57
|
}
|
|
55
|
-
},
|
|
58
|
+
}, M = (t) => {
|
|
56
59
|
if (Array.isArray(t))
|
|
57
60
|
return t;
|
|
58
61
|
if (t !== void 0)
|
|
59
62
|
return [t];
|
|
60
|
-
},
|
|
61
|
-
for (t.sort((
|
|
62
|
-
if (t.push(new
|
|
63
|
+
}, q = async (t, s, e) => await t.utxoUtils.batchFilterUtxosWithNullifier(s, e), G = (t, s, e, n, c, d, r) => {
|
|
64
|
+
for (t.sort((o, a) => o.amount <= a.amount ? 1 : -1); t.length < s || t.length > s && t.length < 6; )
|
|
65
|
+
if (t.push(new h({ amount: 0n, erc20TokenAddress: c, mintAddress: r, shieldedPrivateKey: n, tokenId: d })), e)
|
|
63
66
|
for (; t.length > 6; )
|
|
64
67
|
t.splice(t.length - 1);
|
|
65
|
-
},
|
|
68
|
+
}, j = async ({
|
|
66
69
|
hinkal: t,
|
|
67
70
|
chainId: s = void 0,
|
|
68
71
|
passedShieldedPublicKey: e = void 0,
|
|
69
|
-
ethAddress:
|
|
70
|
-
resetCacheBefore:
|
|
71
|
-
allowRemoteDecryption:
|
|
72
|
+
ethAddress: n = void 0,
|
|
73
|
+
resetCacheBefore: c = !1,
|
|
74
|
+
allowRemoteDecryption: d = !1
|
|
72
75
|
}) => {
|
|
73
76
|
if (!t.getCurrentChainId || !t.getSelectedNetwork())
|
|
74
|
-
return
|
|
75
|
-
const r =
|
|
76
|
-
|
|
77
|
-
let { encryptedOutputs:
|
|
77
|
+
return N.log("returning empty balance"), { inputUtxos: [] };
|
|
78
|
+
const r = n ?? await t.getEthereumAddress(), o = s ?? t.getCurrentChainId(), a = e ?? t.userKeys.getShieldedPublicKey(), { encryptedOutputs: U, nullifiers: w, userKeys: l } = t, f = Array.from(U);
|
|
79
|
+
c && L(t, o, a);
|
|
80
|
+
let { encryptedOutputs: x, lastOutput: p } = S(
|
|
78
81
|
t,
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
o,
|
|
83
|
+
a
|
|
81
84
|
);
|
|
82
|
-
await
|
|
83
|
-
const
|
|
84
|
-
let
|
|
85
|
-
return
|
|
85
|
+
await T(t, o, r);
|
|
86
|
+
const u = p !== "", i = f.findIndex((I) => I.value === p), y = i > -1, g = !u && i === -1, m = t.areMerkleTreeUpdatesDisabled(), A = !m && (y || !d && g), v = !m && d && g, P = !A && !v;
|
|
87
|
+
let O = [];
|
|
88
|
+
return A ? O = await b(
|
|
86
89
|
t,
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
l,
|
|
91
|
+
o,
|
|
89
92
|
r,
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
a,
|
|
94
|
+
f,
|
|
95
|
+
x,
|
|
92
96
|
p,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
) : I ? m = await k(
|
|
97
|
+
i
|
|
98
|
+
) : v ? O = await H(
|
|
96
99
|
t,
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
l,
|
|
101
|
+
o,
|
|
99
102
|
r,
|
|
100
|
-
|
|
101
|
-
|
|
103
|
+
a,
|
|
104
|
+
f,
|
|
105
|
+
x,
|
|
102
106
|
p,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}, X = async ({
|
|
107
|
+
i
|
|
108
|
+
) : P && (O = await t.utxoUtils.buildBatchProcess(x, l, o)), await T(t, o, r), { inputUtxos: (await q(t, O, w)).filter((I) => !I.isBlocked) };
|
|
109
|
+
}, tt = async ({
|
|
107
110
|
hinkal: t,
|
|
108
111
|
tokenWithId: s,
|
|
109
112
|
minInput: e = 2,
|
|
110
|
-
sliceIfMore6:
|
|
111
|
-
chainId:
|
|
112
|
-
passedShieldedPrivateKey:
|
|
113
|
+
sliceIfMore6: n = !0,
|
|
114
|
+
chainId: c = void 0,
|
|
115
|
+
passedShieldedPrivateKey: d = void 0,
|
|
113
116
|
passedShieldedPublicKey: r = void 0,
|
|
114
|
-
ethAddress:
|
|
115
|
-
resetCacheBefore:
|
|
116
|
-
ensuredTokensWithId:
|
|
117
|
+
ethAddress: o = void 0,
|
|
118
|
+
resetCacheBefore: a = !1,
|
|
119
|
+
ensuredTokensWithId: U
|
|
117
120
|
}) => {
|
|
118
|
-
const w =
|
|
121
|
+
const w = d ?? t.userKeys.getShieldedPrivateKey(), l = c ?? t.getCurrentChainId(), { inputUtxos: f } = await j({
|
|
119
122
|
hinkal: t,
|
|
120
123
|
minInput: e,
|
|
121
|
-
sliceIfMore6:
|
|
122
|
-
chainId:
|
|
123
|
-
passedShieldedPrivateKey:
|
|
124
|
+
sliceIfMore6: n,
|
|
125
|
+
chainId: c,
|
|
126
|
+
passedShieldedPrivateKey: d,
|
|
124
127
|
passedShieldedPublicKey: r,
|
|
125
|
-
ethAddress:
|
|
126
|
-
resetCacheBefore:
|
|
127
|
-
}),
|
|
128
|
-
f.forEach((
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
ethAddress: o,
|
|
129
|
+
resetCacheBefore: a
|
|
130
|
+
}), x = M(s), p = /* @__PURE__ */ new Map();
|
|
131
|
+
f.forEach((u) => {
|
|
132
|
+
const i = u.getTokenAddress(l);
|
|
133
|
+
if (x && !x.some(
|
|
134
|
+
(m) => B(m.erc20TokenAddress, i) && m.tokenId === u.tokenId
|
|
131
135
|
))
|
|
132
136
|
return;
|
|
133
|
-
const
|
|
134
|
-
p.set(
|
|
135
|
-
}),
|
|
136
|
-
const
|
|
137
|
-
|
|
137
|
+
const y = C(l, { erc20TokenAddress: i, tokenId: u.tokenId }), g = p.get(y) ?? [];
|
|
138
|
+
p.set(y, [...g, u]);
|
|
139
|
+
}), U?.forEach((u) => {
|
|
140
|
+
const i = C(l, {
|
|
141
|
+
erc20TokenAddress: u.erc20TokenAddress,
|
|
142
|
+
tokenId: u.tokenId
|
|
143
|
+
});
|
|
144
|
+
p.set(i, p.get(i) ?? []);
|
|
138
145
|
});
|
|
139
|
-
for (const [
|
|
140
|
-
const y =
|
|
141
|
-
|
|
146
|
+
for (const [u, i] of p) {
|
|
147
|
+
const y = u.split("-")[0], g = Number(u.split("-")[1]), m = R(l), A = m ? y : void 0, v = m ? k(y).compressedAddress.toLowerCase() : y.toLowerCase();
|
|
148
|
+
G(i, e, n, w, v, g, A);
|
|
142
149
|
}
|
|
143
150
|
return p;
|
|
144
151
|
};
|
|
145
152
|
export {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
153
|
+
H as attemptGetInputUtxosRemotely,
|
|
154
|
+
j as getInputUtxoAndBalance,
|
|
155
|
+
tt as getInputUtxoAndBalancePerToken,
|
|
156
|
+
F as getInputUtxosRemotely
|
|
150
157
|
};
|
|
@@ -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("ethers"),g=require("../../../data-structures/utxo/Utxo.cjs"),x=require("../../../data-structures/crypto-keys/keys.cjs"),A=require("../../utils/encryptInputForEnclave.cjs"),k=require("../../../constants/chains.constants.cjs"),U=require("../../utils/solanaMint.utils.cjs"),f=require("@solana/web3.js"),E=s=>{if(!s)return;const t=a.ethers.utils.arrayify(s);if(t.length!==32)return;const r=new f.PublicKey(t),n=r.toBase58(),{compressedAddress:i}=U.formatMintAddress(r);return{mintBase58:n,compressedAddress:i}},P=async(s,t,r)=>{const n=r.getShieldedPrivateKey(),{privateKey:i,publicKey:d}=x.UserKeys.getEncryptionKeyPair(n),u=a.ethers.utils.solidityPack(["uint256","uint256","uint256"],[d,i,n]),l=a.ethers.utils.arrayify(u),{keyCiphertext:y,inputCiphertext:p}=await A.makeEnclaveHandshakeAndEncryptUint8Array(l),{utxos:m,lastOutput:v,encryptedOutputs:h}=await s.getAPI().decryptUtxoEnclaveCall(t,y,p);return{utxos:m.map(c=>{let e=c;if(k.isSolanaLike(t)){const o=E(c.mintAddress);if(!o)throw new Error("Invalid mint address");e={...e,erc20TokenAddress:o.compressedAddress,mintAddress:o.mintBase58}}return new g.Utxo({...e,amount:BigInt(e.amount),randomization:e.randomization?BigInt(e.randomization):void 0,shieldedPrivateKey:n})}),encryptedOutputs:h,lastOutput:v}};exports.getInputUtxosEnclave=P;
|
|
@@ -1,25 +1,47 @@
|
|
|
1
|
-
import { ethers as
|
|
2
|
-
import { Utxo as
|
|
3
|
-
import { UserKeys as
|
|
4
|
-
import { makeEnclaveHandshakeAndEncryptUint8Array as
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ethers as a } from "ethers";
|
|
2
|
+
import { Utxo as A } from "../../../data-structures/utxo/Utxo.mjs";
|
|
3
|
+
import { UserKeys as x } from "../../../data-structures/crypto-keys/keys.mjs";
|
|
4
|
+
import { makeEnclaveHandshakeAndEncryptUint8Array as h } from "../../utils/encryptInputForEnclave.mjs";
|
|
5
|
+
import { isSolanaLike as k } from "../../../constants/chains.constants.mjs";
|
|
6
|
+
import { formatMintAddress as g } from "../../utils/solanaMint.utils.mjs";
|
|
7
|
+
import { PublicKey as K } from "@solana/web3.js";
|
|
8
|
+
const P = (n) => {
|
|
9
|
+
if (!n)
|
|
10
|
+
return;
|
|
11
|
+
const e = a.utils.arrayify(n);
|
|
12
|
+
if (e.length !== 32)
|
|
13
|
+
return;
|
|
14
|
+
const i = new K(e), r = i.toBase58(), { compressedAddress: o } = g(i);
|
|
15
|
+
return { mintBase58: r, compressedAddress: o };
|
|
16
|
+
}, S = async (n, e, i) => {
|
|
17
|
+
const r = i.getShieldedPrivateKey(), { privateKey: o, publicKey: c } = x.getEncryptionKeyPair(r), m = a.utils.solidityPack(
|
|
7
18
|
["uint256", "uint256", "uint256"],
|
|
8
|
-
[
|
|
9
|
-
),
|
|
19
|
+
[c, o, r]
|
|
20
|
+
), u = a.utils.arrayify(m), { keyCiphertext: l, inputCiphertext: p } = await h(u), { utxos: y, lastOutput: f, encryptedOutputs: v } = await n.getAPI().decryptUtxoEnclaveCall(e, l, p);
|
|
10
21
|
return {
|
|
11
|
-
utxos: y.map(
|
|
12
|
-
|
|
22
|
+
utxos: y.map((d) => {
|
|
23
|
+
let t = d;
|
|
24
|
+
if (k(e)) {
|
|
25
|
+
const s = P(d.mintAddress);
|
|
26
|
+
if (!s)
|
|
27
|
+
throw new Error("Invalid mint address");
|
|
28
|
+
t = {
|
|
29
|
+
...t,
|
|
30
|
+
erc20TokenAddress: s.compressedAddress,
|
|
31
|
+
mintAddress: s.mintBase58
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return new A({
|
|
13
35
|
...t,
|
|
14
36
|
amount: BigInt(t.amount),
|
|
15
37
|
randomization: t.randomization ? BigInt(t.randomization) : void 0,
|
|
16
|
-
shieldedPrivateKey:
|
|
17
|
-
})
|
|
18
|
-
),
|
|
19
|
-
encryptedOutputs:
|
|
20
|
-
lastOutput:
|
|
38
|
+
shieldedPrivateKey: r
|
|
39
|
+
});
|
|
40
|
+
}),
|
|
41
|
+
encryptedOutputs: v,
|
|
42
|
+
lastOutput: f
|
|
21
43
|
};
|
|
22
44
|
};
|
|
23
45
|
export {
|
|
24
|
-
|
|
46
|
+
S as getInputUtxosEnclave
|
|
25
47
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
Please try again with ${
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../../utils/erc20tokenFunctions.cjs"),p=require("../../utils/caseInsensitive.utils.cjs"),v=require("../../../data-structures/utxo/Utxo.cjs"),U=require("../etherFunctions.cjs"),w=require("../../../error-handling/customErrors/ErrorWithAmount.cjs");require("../../../error-handling/error-codes.constants.cjs");const x=require("./getInputUtxoAndBalance.cjs"),y=require("../../../data-structures/TokenDBs/PrivateTokensDB.cjs"),A=require("../../../constants/vite.constants.cjs"),E=require("../../utils/encodeTokenWithId.cjs"),P=require("../../utils/mutexes.utils.cjs"),S=require("../../utils/solanaMint.utils.cjs"),I=require("../../../constants/chains.constants.cjs"),M=async(a,t,f,u,c,m=!1,k,l=!1)=>P.balanceFetchingMutex.runExclusive(async()=>{const{inputUtxos:s}=await x.getInputUtxoAndBalance({hinkal:a,sliceIfMore6:!1,chainId:t,passedShieldedPrivateKey:f,passedShieldedPublicKey:u,ethAddress:c,resetCacheBefore:m,allowRemoteDecryption:k});l&&A.isExtension&&await y.privateTokensDB.fetchAndUpdatePrivateTokens(s.map(e=>e.getTokenAddress(t)).filter(e=>e!==void 0),t,c);const g=(A.isExtension?await y.privateTokensDB.getPrivateTokens(t,c):q.getErc20TokensForChain(t)).map(e=>({token:e,balance:s.reduce((n,i)=>{const r=e.erc20TokenAddress,d=i.getTokenAddress(t);return p.caseInsensitiveEqual(r,d)?n+i.amount:n},0n),timestamp:s.filter(n=>p.caseInsensitiveEqual(n.getTokenAddress(t),e.erc20TokenAddress))[0]?.timeStamp,nfts:s.filter(n=>p.caseInsensitiveEqual(n.getTokenAddress(t),e.erc20TokenAddress)&&n.tokenId!==0).map(n=>({tokenId:n.tokenId,timestamp:n.timeStamp}))})),o=new Map;return g.forEach(e=>{o.set(e.token.erc20TokenAddress.toLowerCase(),e)}),o}),B=async(a,t,f,u=6,c=t.map(()=>0),m=!1)=>{const{userKeys:k}=a,l=[],s=[],h=await x.getInputUtxoAndBalancePerToken({hinkal:a,sliceIfMore6:!1,ensuredTokensWithId:t.map((o,e)=>({erc20TokenAddress:t[e],tokenId:c[e]})),allowRemoteDecryption:!1});let g=0;for(let o=0;o<t.length;o+=1)if(m===!1){const e=h.get(E.encodeTokenWithId(a.getCurrentChainId(),{erc20TokenAddress:t[o],tokenId:c[o]}))??[];if(!e)throw new Error("Missing utxos for token");g=Math.max(e.length,g),s.push(e)}else s.push([]);return g===2?s:(s.forEach((o,e)=>{if(o.length>u){const n=o.slice(0,u),i=n.reduce((r,d)=>r+d.amount,0n);if(f[e]<0n&&i<-f[e]){const r=q.getERC20Token(t[e],a.getCurrentChainId()),d=Number(U.getAmountWithPrecision(i,r,2)),T=`Unfortunately your transaction did not go through due to UTXOs limitations.
|
|
2
|
+
Please try again with ${r.symbol}`;throw new w.ErrorWithAmount(d,T)}l.push(n)}else if(o.length<=u){const n=[...o];let i=u-o.length;for(;i>0;){i-=1;const r=I.isSolanaLike(a.getCurrentChainId()),d=r?t[e]:void 0,T=r?S.formatMintAddress(t[e]).compressedAddress:t[e];n.push(new v.Utxo({amount:0n,erc20TokenAddress:T,mintAddress:d,shieldedPrivateKey:k.getShieldedPrivateKey(),tokenId:c[e]}))}l.push(n)}}),l)};exports.addPaddingToUtxos=B;exports.getShieldedBalance=M;
|
|
@@ -1,88 +1,96 @@
|
|
|
1
|
-
import { getErc20TokensForChain as
|
|
2
|
-
import { caseInsensitiveEqual as
|
|
3
|
-
import { Utxo as
|
|
1
|
+
import { getErc20TokensForChain as w, getERC20Token as x } from "../../utils/erc20tokenFunctions.mjs";
|
|
2
|
+
import { caseInsensitiveEqual as T } from "../../utils/caseInsensitive.utils.mjs";
|
|
3
|
+
import { Utxo as U } from "../../../data-structures/utxo/Utxo.mjs";
|
|
4
4
|
import { getAmountWithPrecision as P } from "../etherFunctions.mjs";
|
|
5
5
|
import { ErrorWithAmount as E } from "../../../error-handling/customErrors/ErrorWithAmount.mjs";
|
|
6
6
|
import "../../../error-handling/error-codes.constants.mjs";
|
|
7
|
-
import { getInputUtxoAndBalance as
|
|
8
|
-
import { privateTokensDB as
|
|
9
|
-
import { isExtension as
|
|
10
|
-
import { encodeTokenWithId as
|
|
11
|
-
import { balanceFetchingMutex as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
import { getInputUtxoAndBalance as C, getInputUtxoAndBalancePerToken as S } from "./getInputUtxoAndBalance.mjs";
|
|
8
|
+
import { privateTokensDB as y } from "../../../data-structures/TokenDBs/PrivateTokensDB.mjs";
|
|
9
|
+
import { isExtension as A } from "../../../constants/vite.constants.mjs";
|
|
10
|
+
import { encodeTokenWithId as v } from "../../utils/encodeTokenWithId.mjs";
|
|
11
|
+
import { balanceFetchingMutex as M } from "../../utils/mutexes.utils.mjs";
|
|
12
|
+
import { formatMintAddress as b } from "../../utils/solanaMint.utils.mjs";
|
|
13
|
+
import { isSolanaLike as B } from "../../../constants/chains.constants.mjs";
|
|
14
|
+
const j = async (a, t, p, f, m, u = !1, g, l = !1) => M.runExclusive(async () => {
|
|
15
|
+
const { inputUtxos: r } = await C({
|
|
16
|
+
hinkal: a,
|
|
15
17
|
sliceIfMore6: !1,
|
|
16
|
-
chainId:
|
|
17
|
-
passedShieldedPrivateKey:
|
|
18
|
-
passedShieldedPublicKey:
|
|
19
|
-
ethAddress:
|
|
20
|
-
resetCacheBefore:
|
|
21
|
-
allowRemoteDecryption:
|
|
18
|
+
chainId: t,
|
|
19
|
+
passedShieldedPrivateKey: p,
|
|
20
|
+
passedShieldedPublicKey: f,
|
|
21
|
+
ethAddress: m,
|
|
22
|
+
resetCacheBefore: u,
|
|
23
|
+
allowRemoteDecryption: g
|
|
22
24
|
});
|
|
23
|
-
|
|
24
|
-
r.map((e) => e.
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
l && A && await y.fetchAndUpdatePrivateTokens(
|
|
26
|
+
r.map((e) => e.getTokenAddress(t)).filter((e) => e !== void 0),
|
|
27
|
+
t,
|
|
28
|
+
m
|
|
27
29
|
);
|
|
28
|
-
const
|
|
30
|
+
const c = (A ? await y.getPrivateTokens(t, m) : w(t)).map((e) => ({
|
|
29
31
|
token: e,
|
|
30
|
-
balance: r.reduce((
|
|
31
|
-
const
|
|
32
|
-
return
|
|
32
|
+
balance: r.reduce((o, i) => {
|
|
33
|
+
const s = e.erc20TokenAddress, d = i.getTokenAddress(t);
|
|
34
|
+
return T(s, d) ? o + i.amount : o;
|
|
33
35
|
}, 0n),
|
|
34
36
|
timestamp: r.filter(
|
|
35
|
-
(
|
|
37
|
+
(o) => T(o.getTokenAddress(t), e.erc20TokenAddress)
|
|
36
38
|
)[0]?.timeStamp,
|
|
37
39
|
nfts: r.filter(
|
|
38
|
-
(
|
|
39
|
-
).map((
|
|
40
|
-
})),
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
}),
|
|
44
|
-
}),
|
|
45
|
-
const { userKeys:
|
|
46
|
-
hinkal:
|
|
40
|
+
(o) => T(o.getTokenAddress(t), e.erc20TokenAddress) && o.tokenId !== 0
|
|
41
|
+
).map((o) => ({ tokenId: o.tokenId, timestamp: o.timeStamp }))
|
|
42
|
+
})), n = /* @__PURE__ */ new Map();
|
|
43
|
+
return c.forEach((e) => {
|
|
44
|
+
n.set(e.token.erc20TokenAddress.toLowerCase(), e);
|
|
45
|
+
}), n;
|
|
46
|
+
}), z = async (a, t, p, f = 6, m = t.map(() => 0), u = !1) => {
|
|
47
|
+
const { userKeys: g } = a, l = [], r = [], h = await S({
|
|
48
|
+
hinkal: a,
|
|
47
49
|
sliceIfMore6: !1,
|
|
48
|
-
ensuredTokensWithId:
|
|
50
|
+
ensuredTokensWithId: t.map((n, e) => ({ erc20TokenAddress: t[e], tokenId: m[e] })),
|
|
49
51
|
allowRemoteDecryption: !1
|
|
50
52
|
});
|
|
51
|
-
let
|
|
52
|
-
for (let
|
|
53
|
-
if (
|
|
54
|
-
const e =
|
|
53
|
+
let c = 0;
|
|
54
|
+
for (let n = 0; n < t.length; n += 1)
|
|
55
|
+
if (u === !1) {
|
|
56
|
+
const e = h.get(
|
|
57
|
+
v(a.getCurrentChainId(), { erc20TokenAddress: t[n], tokenId: m[n] })
|
|
58
|
+
) ?? [];
|
|
55
59
|
if (!e)
|
|
56
60
|
throw new Error("Missing utxos for token");
|
|
57
|
-
|
|
61
|
+
c = Math.max(e.length, c), r.push(e);
|
|
58
62
|
} else
|
|
59
63
|
r.push([]);
|
|
60
|
-
return
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
const
|
|
65
|
-
Please try again with ${
|
|
66
|
-
throw new E(
|
|
64
|
+
return c === 2 ? r : (r.forEach((n, e) => {
|
|
65
|
+
if (n.length > f) {
|
|
66
|
+
const o = n.slice(0, f), i = o.reduce((s, d) => s + d.amount, 0n);
|
|
67
|
+
if (p[e] < 0n && i < -p[e]) {
|
|
68
|
+
const s = x(t[e], a.getCurrentChainId()), d = Number(P(i, s, 2)), k = `Unfortunately your transaction did not go through due to UTXOs limitations.
|
|
69
|
+
Please try again with ${s.symbol}`;
|
|
70
|
+
throw new E(d, k);
|
|
67
71
|
}
|
|
68
|
-
|
|
69
|
-
} else if (
|
|
70
|
-
const
|
|
71
|
-
let
|
|
72
|
-
for (;
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
l.push(o);
|
|
73
|
+
} else if (n.length <= f) {
|
|
74
|
+
const o = [...n];
|
|
75
|
+
let i = f - n.length;
|
|
76
|
+
for (; i > 0; ) {
|
|
77
|
+
i -= 1;
|
|
78
|
+
const s = B(a.getCurrentChainId()), d = s ? t[e] : void 0, k = s ? b(t[e]).compressedAddress : t[e];
|
|
79
|
+
o.push(
|
|
80
|
+
new U({
|
|
75
81
|
amount: 0n,
|
|
76
|
-
erc20TokenAddress:
|
|
77
|
-
|
|
78
|
-
|
|
82
|
+
erc20TokenAddress: k,
|
|
83
|
+
mintAddress: d,
|
|
84
|
+
shieldedPrivateKey: g.getShieldedPrivateKey(),
|
|
85
|
+
tokenId: m[e]
|
|
79
86
|
})
|
|
80
87
|
);
|
|
81
|
-
|
|
88
|
+
}
|
|
89
|
+
l.push(o);
|
|
82
90
|
}
|
|
83
|
-
}),
|
|
91
|
+
}), l);
|
|
84
92
|
};
|
|
85
93
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
94
|
+
z as addPaddingToUtxos,
|
|
95
|
+
j as getShieldedBalance
|
|
88
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../constants/token-data/index.cjs");const c=require("../../../constants/chains.constants.cjs");require("../../../constants/contracts.constants.cjs");require("../../../constants/kyc.constants.cjs");require("../../../constants/server.constants.cjs");require("../../../constants/vite.constants.cjs");require("../../../constants/coingecko.constants.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../../constants/addresses.constants.cjs");require("../../../constants/token.limits.constants.cjs");require("../../../constants/presale.constants.cjs");require("../../../constants/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../constants/token-data/index.cjs");const c=require("../../../constants/chains.constants.cjs");require("../../../constants/contracts.constants.cjs");require("../../../constants/kyc.constants.cjs");require("../../../constants/server.constants.cjs");require("../../../constants/vite.constants.cjs");require("../../../constants/coingecko.constants.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../../constants/addresses.constants.cjs");require("../../../constants/token.limits.constants.cjs");require("../../../constants/presale.constants.cjs");require("../../../constants/activity.constants.cjs");require("../../../constants/tasks.constants.cjs");require("../../../constants/events.constants.cjs");const a=require("ethers");require("idb-keyval");const q=require("../../utils/create-provider.cjs");require("../../../error-handling/error-codes.constants.cjs");require("../../utils/convertIntegrationProviderToExternalActionId.cjs");require("../../../types/circom-data.types.cjs");require("../../../types/transactions.types.cjs");require("../../../types/activities.types.cjs");require("circomlibjs-hinkal-fork");require("../../../data-structures/crypto-keys/keys.cjs");require("../../../data-structures/http/HttpClient.cjs");require("axios");require("../../../API/getServerURL.cjs");require("libsodium-wrappers");require("process");require("buffer");require("../../../constants/save-depths.cjs");require("../../utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("@solana/web3.js");require("@solana/spl-token");require("../../utils/userAgent.cjs");require("multiformats");require("../../../API/tenderly.api.cjs");const l=(o,n)=>{const u=new a.ethers.utils.Interface(n);try{const e=u.parseLog(o);return{name:e.name,args:e.args}}catch{return console.warn("Could not decode log"),null}};async function d(o,n,u,e){try{const t=c.networkRegistry[o].fetchRpcUrl;if(!t)throw new Error("RPC URL not found for the specified chain ID");const r=await q.createCustomRpcProvider(t).getTransactionReceipt(n);if(!r)throw new Error("Transaction receipt not found");if(r.status!==1)throw new Error("Transaction failed");const s=r.logs.filter(i=>i.address.toLowerCase()===u.toLowerCase()).map(i=>l(i,e)).filter(i=>i!==null);return{transactionHash:r.transactionHash,from:r.from,to:r.to,blockNumber:r.blockNumber,events:s}}catch(t){throw console.error("Error retrieving transaction events:",t),t}}exports.getTransactionLogEvents=d;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
|
-
|
|
3
|
-
export declare function getTransactionLogEvents(chainId: number, txHash: string, contractAddress: string, contractABI:
|
|
2
|
+
type ABIType = ConstructorParameters<typeof ethers.utils.Interface>[0];
|
|
3
|
+
export declare function getTransactionLogEvents(chainId: number, txHash: string, contractAddress: string, contractABI: ABIType): Promise<{
|
|
4
4
|
transactionHash: string;
|
|
5
5
|
from: string;
|
|
6
6
|
to: string;
|
|
@@ -10,3 +10,4 @@ export declare function getTransactionLogEvents(chainId: number, txHash: string,
|
|
|
10
10
|
args: ethers.utils.Result;
|
|
11
11
|
}[];
|
|
12
12
|
}>;
|
|
13
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../../constants/token-data/index.mjs";
|
|
2
|
-
import { networkRegistry as
|
|
2
|
+
import { networkRegistry as s } from "../../../constants/chains.constants.mjs";
|
|
3
3
|
import "../../../constants/contracts.constants.mjs";
|
|
4
4
|
import "../../../constants/kyc.constants.mjs";
|
|
5
5
|
import "../../../constants/server.constants.mjs";
|
|
@@ -9,13 +9,12 @@ import "../../../constants/reorg-depths.constants.mjs";
|
|
|
9
9
|
import "../../../constants/addresses.constants.mjs";
|
|
10
10
|
import "../../../constants/token.limits.constants.mjs";
|
|
11
11
|
import "../../../constants/presale.constants.mjs";
|
|
12
|
-
import "../../../constants/mystery-boxes.constants.mjs";
|
|
13
12
|
import "../../../constants/activity.constants.mjs";
|
|
14
13
|
import "../../../constants/tasks.constants.mjs";
|
|
15
14
|
import "../../../constants/events.constants.mjs";
|
|
16
|
-
import { ethers as
|
|
15
|
+
import { ethers as a } from "ethers";
|
|
17
16
|
import "idb-keyval";
|
|
18
|
-
import {
|
|
17
|
+
import { createCustomRpcProvider as c } from "../../utils/create-provider.mjs";
|
|
19
18
|
import "../../../error-handling/error-codes.constants.mjs";
|
|
20
19
|
import "../../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
21
20
|
import "../../../types/circom-data.types.mjs";
|
|
@@ -23,18 +22,22 @@ import "../../../types/transactions.types.mjs";
|
|
|
23
22
|
import "../../../types/activities.types.mjs";
|
|
24
23
|
import "circomlibjs-hinkal-fork";
|
|
25
24
|
import "../../../data-structures/crypto-keys/keys.mjs";
|
|
25
|
+
import "../../../data-structures/http/HttpClient.mjs";
|
|
26
26
|
import "axios";
|
|
27
27
|
import "../../../API/getServerURL.mjs";
|
|
28
|
-
import "../../utils/mutexes.utils.mjs";
|
|
29
28
|
import "libsodium-wrappers";
|
|
30
29
|
import "process";
|
|
31
30
|
import "buffer";
|
|
32
31
|
import "../../../constants/save-depths.mjs";
|
|
32
|
+
import "../../utils/mutexes.utils.mjs";
|
|
33
|
+
import "@coral-xyz/anchor";
|
|
34
|
+
import "@solana/web3.js";
|
|
35
|
+
import "@solana/spl-token";
|
|
33
36
|
import "../../utils/userAgent.mjs";
|
|
34
37
|
import "multiformats";
|
|
35
38
|
import "../../../API/tenderly.api.mjs";
|
|
36
39
|
const f = (e, n) => {
|
|
37
|
-
const p = new
|
|
40
|
+
const p = new a.utils.Interface(n);
|
|
38
41
|
try {
|
|
39
42
|
const o = p.parseLog(e);
|
|
40
43
|
return {
|
|
@@ -45,9 +48,9 @@ const f = (e, n) => {
|
|
|
45
48
|
return console.warn("Could not decode log"), null;
|
|
46
49
|
}
|
|
47
50
|
};
|
|
48
|
-
async function
|
|
51
|
+
async function Z(e, n, p, o) {
|
|
49
52
|
try {
|
|
50
|
-
const t =
|
|
53
|
+
const t = s[e].fetchRpcUrl;
|
|
51
54
|
if (!t)
|
|
52
55
|
throw new Error("RPC URL not found for the specified chain ID");
|
|
53
56
|
const r = await c(t).getTransactionReceipt(n);
|
|
@@ -68,5 +71,5 @@ async function V(e, n, p, o) {
|
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
export {
|
|
71
|
-
|
|
74
|
+
Z as getTransactionLogEvents
|
|
72
75
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("ethers");require("idb-keyval");require("../../constants/chains.constants.cjs");require("@solana/web3.js");require("../../data-structures/http/HttpClient.cjs");require("../../constants/vite.constants.cjs");require("../../constants/token-data/index.cjs");require("../../error-handling/error-codes.constants.cjs");require("../utils/convertIntegrationProviderToExternalActionId.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");require("circomlibjs-hinkal-fork");require("../../data-structures/crypto-keys/keys.cjs");require("../../constants/server.constants.cjs");require("axios");require("../../API/getServerURL.cjs");require("libsodium-wrappers");require("process");require("buffer");require("../../constants/save-depths.cjs");require("../../constants/reorg-depths.constants.cjs");require("../utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("@solana/spl-token");const r=require("../utils/bytes32.utils.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/addresses.constants.cjs");require("../../constants/token.limits.constants.cjs");require("../../constants/presale.constants.cjs");require("../../constants/activity.constants.cjs");require("../../constants/tasks.constants.cjs");require("../../constants/events.constants.cjs");require("../utils/userAgent.cjs");require("multiformats");require("../../API/tenderly.api.cjs");const n=async(i,u)=>{const e=await i.account.merkle.fetch(u,"confirmed"),q=Number(r.convertBytes32ToBigInt(e.rootIndex)),t=e.roots.at(q-1);return o.ethers.BigNumber.from(r.convertBytes32ToBigInt(t).toString())};exports.fetchSolanaMerkleTreeRootHash=n;
|