@sabaaa1/common 0.1.7 → 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/estimateGasRelayer.cjs +1 -1
- package/functions/web3/functionCalls/estimateGasRelayer.mjs +12 -12
- 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,12 +1,12 @@
|
|
|
1
|
-
import { get as
|
|
2
|
-
import { BigNumber as
|
|
1
|
+
import { get as k, update as g } from "idb-keyval";
|
|
2
|
+
import { BigNumber as T } from "ethers";
|
|
3
3
|
import "../../types/circom-data.types.mjs";
|
|
4
|
-
import { zeroAddress as
|
|
4
|
+
import { solanaNativeAddress as P, zeroAddress as C } from "../../constants/protocol.constants.mjs";
|
|
5
5
|
import "../../types/transactions.types.mjs";
|
|
6
|
-
import { ActivityStatus as
|
|
7
|
-
import { StorageKeys as
|
|
6
|
+
import { ActivityStatus as f } from "../../types/activities.types.mjs";
|
|
7
|
+
import { StorageKeys as l } from "../../types/cache.types.mjs";
|
|
8
8
|
import "../../constants/token-data/index.mjs";
|
|
9
|
-
import "../../constants/chains.constants.mjs";
|
|
9
|
+
import { isSolanaLike as N } from "../../constants/chains.constants.mjs";
|
|
10
10
|
import "../../constants/contracts.constants.mjs";
|
|
11
11
|
import "../../constants/kyc.constants.mjs";
|
|
12
12
|
import "../../constants/server.constants.mjs";
|
|
@@ -16,123 +16,123 @@ import "../../constants/reorg-depths.constants.mjs";
|
|
|
16
16
|
import "../../constants/addresses.constants.mjs";
|
|
17
17
|
import "../../constants/token.limits.constants.mjs";
|
|
18
18
|
import "../../constants/presale.constants.mjs";
|
|
19
|
-
import "../../constants/mystery-boxes.constants.mjs";
|
|
20
19
|
import "../../constants/activity.constants.mjs";
|
|
21
20
|
import "../../constants/tasks.constants.mjs";
|
|
22
21
|
import "../../constants/events.constants.mjs";
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import "
|
|
26
|
-
import
|
|
22
|
+
import "@coral-xyz/anchor";
|
|
23
|
+
import "@solana/web3.js";
|
|
24
|
+
import { fixDecimalsAmount as b } from "../../functions/utils/amounts.utils.mjs";
|
|
25
|
+
import "../http/HttpClient.mjs";
|
|
26
|
+
import { Logger as q } from "../../error-handling/logger.mjs";
|
|
27
|
+
import { getERC20Token as _ } from "../../functions/utils/erc20tokenFunctions.mjs";
|
|
27
28
|
import "../../functions/utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
28
29
|
import "circomlibjs-hinkal-fork";
|
|
29
|
-
import { getAmountInToken as
|
|
30
|
+
import { getAmountInToken as E } from "../../functions/web3/etherFunctions.mjs";
|
|
30
31
|
import "../crypto-keys/keys.mjs";
|
|
31
32
|
import "../../error-handling/error-codes.constants.mjs";
|
|
33
|
+
import "axios";
|
|
32
34
|
import "../../API/getServerURL.mjs";
|
|
33
|
-
import "../../functions/utils/mutexes.utils.mjs";
|
|
34
35
|
import "libsodium-wrappers";
|
|
35
36
|
import "process";
|
|
36
37
|
import "buffer";
|
|
37
38
|
import "../../constants/save-depths.mjs";
|
|
39
|
+
import "../../functions/utils/mutexes.utils.mjs";
|
|
40
|
+
import "@solana/spl-token";
|
|
38
41
|
import "../../functions/utils/userAgent.mjs";
|
|
39
42
|
import "multiformats";
|
|
40
|
-
import {
|
|
43
|
+
import { API as H } from "../../API/API.mjs";
|
|
41
44
|
import "../../API/tenderly.api.mjs";
|
|
42
45
|
import "node-forge";
|
|
43
46
|
import "../../functions/web3/events/getApprovedBalance.mjs";
|
|
44
47
|
import "../../functions/web3/getTokenHolder.mjs";
|
|
45
48
|
import "ethers-v6h";
|
|
46
|
-
class
|
|
49
|
+
class R {
|
|
47
50
|
generateTxId() {
|
|
48
51
|
const t = (/* @__PURE__ */ new Date()).getTime(), o = Math.random().toString(36).substring(2, 15);
|
|
49
52
|
return `tx_${t}_${o}`;
|
|
50
53
|
}
|
|
51
54
|
async getTransactionRecord() {
|
|
52
|
-
return await
|
|
53
|
-
}
|
|
54
|
-
async saveTransactionRecord(t) {
|
|
55
|
-
await R(h.TX_ACTIVITY, t);
|
|
55
|
+
return await k(l.TX_ACTIVITY) || {};
|
|
56
56
|
}
|
|
57
57
|
async saveTxRequest(t) {
|
|
58
58
|
const {
|
|
59
59
|
from: o,
|
|
60
60
|
to: r,
|
|
61
|
-
gas:
|
|
62
|
-
gasPrice:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
gas: i,
|
|
62
|
+
gasPrice: a,
|
|
63
|
+
gasInDollar: s,
|
|
64
|
+
value: n,
|
|
65
|
+
chainId: m,
|
|
66
|
+
status: e,
|
|
67
|
+
txHash: u,
|
|
68
|
+
activityType: c,
|
|
69
|
+
tokensReceive: p,
|
|
70
|
+
tokensSpend: v,
|
|
71
|
+
tokensApprove: y,
|
|
72
|
+
ownerPublicAddress: w,
|
|
73
|
+
activityIcon: A,
|
|
74
|
+
dappUrl: h,
|
|
75
|
+
dappName: x,
|
|
76
|
+
integrationProvider: D
|
|
77
|
+
} = t, d = this.generateTxId(), S = {
|
|
78
|
+
id: d,
|
|
78
79
|
from: o,
|
|
79
80
|
to: r,
|
|
80
|
-
gas:
|
|
81
|
-
gasPrice:
|
|
82
|
-
gasInDollar:
|
|
83
|
-
value:
|
|
84
|
-
chainId:
|
|
85
|
-
txHash:
|
|
86
|
-
activityType:
|
|
87
|
-
status:
|
|
81
|
+
gas: i,
|
|
82
|
+
gasPrice: a,
|
|
83
|
+
gasInDollar: s?.toString(),
|
|
84
|
+
value: n,
|
|
85
|
+
chainId: m,
|
|
86
|
+
txHash: u,
|
|
87
|
+
activityType: c,
|
|
88
|
+
status: e ?? f.PENDING,
|
|
88
89
|
timestamp: /* @__PURE__ */ new Date(),
|
|
89
|
-
tokensReceive:
|
|
90
|
-
tokensSpend:
|
|
91
|
-
tokensApprove:
|
|
92
|
-
ownerPublicAddress:
|
|
93
|
-
activityIcon:
|
|
94
|
-
dappUrl:
|
|
95
|
-
dappName:
|
|
96
|
-
integrationProvider:
|
|
90
|
+
tokensReceive: p,
|
|
91
|
+
tokensSpend: v,
|
|
92
|
+
tokensApprove: y,
|
|
93
|
+
ownerPublicAddress: w,
|
|
94
|
+
activityIcon: A,
|
|
95
|
+
dappUrl: h,
|
|
96
|
+
dappName: x,
|
|
97
|
+
integrationProvider: D
|
|
97
98
|
};
|
|
98
|
-
return
|
|
99
|
+
return await g(l.TX_ACTIVITY, (I = {}) => (I[d] = S, I)), d;
|
|
99
100
|
}
|
|
100
101
|
async getTxRequest(t) {
|
|
101
102
|
return (await this.getTransactionRecord())[t] || null;
|
|
102
103
|
}
|
|
103
104
|
async getAllTxRequests(t) {
|
|
104
105
|
const o = await this.getTransactionRecord();
|
|
105
|
-
return Object.values(o).filter((r) => r.chainId === t).sort((r,
|
|
106
|
+
return Object.values(o).filter((r) => r.chainId === t).sort((r, i) => new Date(i.timestamp).getTime() - new Date(r.timestamp).getTime());
|
|
106
107
|
}
|
|
107
|
-
async updateTxStatusAndHash(t, o, r,
|
|
108
|
-
const
|
|
109
|
-
if (!
|
|
108
|
+
async updateTxStatusAndHash(t, o, r, i, a, s, n, m) {
|
|
109
|
+
const e = await this.getTxRequest(t);
|
|
110
|
+
if (!e)
|
|
110
111
|
throw new Error("Transaction not found");
|
|
111
|
-
const
|
|
112
|
-
...
|
|
112
|
+
const u = await this.getGasInDollar(n, m, e.chainId), c = {
|
|
113
|
+
...e,
|
|
113
114
|
status: o,
|
|
114
115
|
txHash: r,
|
|
115
|
-
value:
|
|
116
|
-
from:
|
|
117
|
-
to:
|
|
116
|
+
value: e.value ?? i,
|
|
117
|
+
from: e.from ?? a,
|
|
118
|
+
to: e.to ?? s,
|
|
118
119
|
gas: n,
|
|
119
|
-
gasPrice:
|
|
120
|
-
gasInDollar:
|
|
120
|
+
gasPrice: m,
|
|
121
|
+
gasInDollar: e.gasInDollar ?? u?.toString(),
|
|
121
122
|
timestamp: /* @__PURE__ */ new Date()
|
|
122
123
|
};
|
|
123
|
-
return
|
|
124
|
+
return await g(l.TX_ACTIVITY, (p = {}) => (p[t] = c, p)), c;
|
|
124
125
|
}
|
|
125
|
-
async updateActivity(t, o, r,
|
|
126
|
+
async updateActivity(t, o, r, i, a, s, n, m) {
|
|
126
127
|
try {
|
|
127
|
-
await this.updateTxStatusAndHash(t, o, r,
|
|
128
|
-
} catch (
|
|
129
|
-
console.log("error in updating tx request",
|
|
128
|
+
await this.updateTxStatusAndHash(t, o, r, i, a, s, n, m);
|
|
129
|
+
} catch (e) {
|
|
130
|
+
console.log("error in updating tx request", e);
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
133
|
async removePendingTransactions(t) {
|
|
133
134
|
try {
|
|
134
|
-
|
|
135
|
-
delete o[t], await this.saveTransactionRecord(o);
|
|
135
|
+
await g(l.TX_ACTIVITY, (o = {}) => (delete o[t], o));
|
|
136
136
|
} catch (o) {
|
|
137
137
|
console.log("error in deleting tx requests", o);
|
|
138
138
|
}
|
|
@@ -142,7 +142,7 @@ class E {
|
|
|
142
142
|
if (!t.success) {
|
|
143
143
|
await this.updateActivity(
|
|
144
144
|
o,
|
|
145
|
-
|
|
145
|
+
f.FAILED,
|
|
146
146
|
"erroredTx" in t ? t.erroredTx?.transactionHash : void 0
|
|
147
147
|
);
|
|
148
148
|
return;
|
|
@@ -151,13 +151,13 @@ class E {
|
|
|
151
151
|
const { tx: r } = t;
|
|
152
152
|
await this.updateActivity(
|
|
153
153
|
o,
|
|
154
|
-
|
|
154
|
+
f.SUCCESSFUL,
|
|
155
155
|
r.hash,
|
|
156
|
-
|
|
156
|
+
T.from(r.value ?? 0n).toHexString(),
|
|
157
157
|
r.from,
|
|
158
158
|
r.to,
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
T.from(r.gas ?? 0n),
|
|
160
|
+
T.from(r.gasPrice ?? 0n)
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
} catch (r) {
|
|
@@ -167,21 +167,21 @@ class E {
|
|
|
167
167
|
getGasInDollar = async (t, o, r) => {
|
|
168
168
|
if (!(!t || !o))
|
|
169
169
|
try {
|
|
170
|
-
const
|
|
171
|
-
if (!
|
|
170
|
+
const i = N(r) ? P : C, a = _(i, r);
|
|
171
|
+
if (!a)
|
|
172
172
|
return;
|
|
173
|
-
const
|
|
174
|
-
if (!
|
|
173
|
+
const { prices: s } = await H.getTokenPrices(r, [a.erc20TokenAddress]), n = s[0];
|
|
174
|
+
if (!n)
|
|
175
175
|
return;
|
|
176
|
-
const
|
|
177
|
-
return
|
|
178
|
-
} catch (
|
|
179
|
-
|
|
176
|
+
const e = n * Number(E(a, o.toBigInt())) * Number(t.toBigInt());
|
|
177
|
+
return b(e);
|
|
178
|
+
} catch (i) {
|
|
179
|
+
q.error("Failed to calculate gas cost in dollars:", { chainId: r, error: i });
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
const
|
|
184
|
+
const qt = new R();
|
|
185
185
|
export {
|
|
186
|
-
|
|
186
|
+
qt as activityStorage
|
|
187
187
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("idb-keyval");require("ethers");const B=require("../../error-handling/logger.cjs");require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("idb-keyval");require("ethers");require("../../constants/chains.constants.cjs");require("@solana/web3.js");require("../http/HttpClient.cjs");const B=require("../../error-handling/logger.cjs");require("../../constants/token-data/index.cjs");require("../../error-handling/error-codes.constants.cjs");require("../../functions/utils/convertIntegrationProviderToExternalActionId.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");require("circomlibjs-hinkal-fork");require("../crypto-keys/keys.cjs");require("../../constants/server.constants.cjs");require("../../constants/vite.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("../../functions/utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("@solana/spl-token");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("../../functions/utils/userAgent.cjs");const q=require("../../functions/utils/string.utils.cjs");require("multiformats");require("../../API/tenderly.api.cjs");class y{balancesRecordLabel="walletsBalances";async getBalances(){return await c.get(this.balancesRecordLabel)}async getBalancesByWallet(r,a){const e=await this.getBalances();if(!e)return;const i=q.getStateKey(r,a);return e[i]}async setBalances(r,a,e,i){let n=[];if(!i)return await c.update(this.balancesRecordLabel,(t={})=>{const u=q.getStateKey(a,r);return{...t,[u]:e}}),e;if(i.length===0)return await this.getBalancesByWallet(a,r)??[];try{await c.update(this.balancesRecordLabel,(t={})=>{const u=q.getStateKey(a,r),s=this.createBalanceLookup(t[u]),o=this.createBalanceLookup(e);return i.forEach(({erc20TokenAddress:g})=>{const l=g.toLowerCase();l in o?s[l]=o[l]:delete s[l]}),n=Object.values(s),{...t,[u]:n}})}catch(t){B.Logger.error("Failed to update wallet balances:",t)}return n}createBalanceLookup(r=[]){return r.reduce((a,e)=>({...a,[e.token.erc20TokenAddress.toLowerCase()]:e}),{})}}const w=new y;exports.publicBalancesStorage=w;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { get as u, update as
|
|
1
|
+
import { get as u, update as s } from "idb-keyval";
|
|
2
2
|
import "ethers";
|
|
3
|
+
import "../../constants/chains.constants.mjs";
|
|
4
|
+
import "@solana/web3.js";
|
|
5
|
+
import "../http/HttpClient.mjs";
|
|
3
6
|
import { Logger as w } from "../../error-handling/logger.mjs";
|
|
4
|
-
import "axios";
|
|
5
7
|
import "../../constants/token-data/index.mjs";
|
|
6
8
|
import "../../error-handling/error-codes.constants.mjs";
|
|
7
|
-
import "../../constants/chains.constants.mjs";
|
|
8
9
|
import "../../functions/utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
9
10
|
import "../../types/circom-data.types.mjs";
|
|
10
11
|
import "../../types/transactions.types.mjs";
|
|
@@ -13,20 +14,22 @@ import "circomlibjs-hinkal-fork";
|
|
|
13
14
|
import "../crypto-keys/keys.mjs";
|
|
14
15
|
import "../../constants/server.constants.mjs";
|
|
15
16
|
import "../../constants/vite.constants.mjs";
|
|
17
|
+
import "axios";
|
|
16
18
|
import "../../API/getServerURL.mjs";
|
|
17
|
-
import "../../constants/reorg-depths.constants.mjs";
|
|
18
|
-
import "../../functions/utils/mutexes.utils.mjs";
|
|
19
19
|
import "libsodium-wrappers";
|
|
20
20
|
import "process";
|
|
21
21
|
import "buffer";
|
|
22
22
|
import "../../constants/save-depths.mjs";
|
|
23
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
24
|
+
import "../../functions/utils/mutexes.utils.mjs";
|
|
25
|
+
import "@coral-xyz/anchor";
|
|
26
|
+
import "@solana/spl-token";
|
|
23
27
|
import "../../constants/contracts.constants.mjs";
|
|
24
28
|
import "../../constants/kyc.constants.mjs";
|
|
25
29
|
import "../../constants/coingecko.constants.mjs";
|
|
26
30
|
import "../../constants/addresses.constants.mjs";
|
|
27
31
|
import "../../constants/token.limits.constants.mjs";
|
|
28
32
|
import "../../constants/presale.constants.mjs";
|
|
29
|
-
import "../../constants/mystery-boxes.constants.mjs";
|
|
30
33
|
import "../../constants/activity.constants.mjs";
|
|
31
34
|
import "../../constants/tasks.constants.mjs";
|
|
32
35
|
import "../../constants/events.constants.mjs";
|
|
@@ -49,7 +52,7 @@ class g {
|
|
|
49
52
|
async setBalances(e, r, t, o) {
|
|
50
53
|
let l = [];
|
|
51
54
|
if (!o)
|
|
52
|
-
return await
|
|
55
|
+
return await s(this.balancesRecordLabel, (a = {}) => {
|
|
53
56
|
const i = c(r, e);
|
|
54
57
|
return {
|
|
55
58
|
...a,
|
|
@@ -59,11 +62,11 @@ class g {
|
|
|
59
62
|
if (o.length === 0)
|
|
60
63
|
return await this.getBalancesByWallet(r, e) ?? [];
|
|
61
64
|
try {
|
|
62
|
-
await
|
|
63
|
-
const i = c(r, e), n = this.createBalanceLookup(a[i]),
|
|
65
|
+
await s(this.balancesRecordLabel, (a = {}) => {
|
|
66
|
+
const i = c(r, e), n = this.createBalanceLookup(a[i]), m = this.createBalanceLookup(t);
|
|
64
67
|
return o.forEach(({ erc20TokenAddress: B }) => {
|
|
65
68
|
const p = B.toLowerCase();
|
|
66
|
-
p in
|
|
69
|
+
p in m ? n[p] = m[p] : delete n[p];
|
|
67
70
|
}), l = Object.values(n), {
|
|
68
71
|
...a,
|
|
69
72
|
[i]: l
|
|
@@ -84,7 +87,7 @@ class g {
|
|
|
84
87
|
);
|
|
85
88
|
}
|
|
86
89
|
}
|
|
87
|
-
const
|
|
90
|
+
const rt = new g();
|
|
88
91
|
export {
|
|
89
|
-
|
|
92
|
+
rt as publicBalancesStorage
|
|
90
93
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("idb-keyval"),q=require("../../error-handling/logger.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");require("../../constants/kyc.constants.cjs");require("ethers");require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("idb-keyval"),q=require("../../error-handling/logger.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");require("../../constants/chains.constants.cjs");require("@coral-xyz/anchor");require("@solana/web3.js");require("../../constants/kyc.constants.cjs");require("ethers");require("../http/HttpClient.cjs");require("../../constants/token-data/index.cjs");require("../../error-handling/error-codes.constants.cjs");require("../../functions/utils/convertIntegrationProviderToExternalActionId.cjs");require("circomlibjs-hinkal-fork");require("../crypto-keys/keys.cjs");require("../../constants/server.constants.cjs");require("../../constants/vite.constants.cjs");require("axios");const d=require("../../functions/utils/caseInsensitive.utils.cjs");require("../../API/getServerURL.cjs");require("libsodium-wrappers");require("process");require("buffer");require("../../constants/save-depths.cjs");require("../../constants/reorg-depths.constants.cjs");require("../../functions/utils/mutexes.utils.cjs");require("@solana/spl-token");require("../../constants/contracts.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("../../functions/utils/userAgent.cjs");require("multiformats");require("../../API/tenderly.api.cjs");require("node-forge");require("../../functions/web3/events/getApprovedBalance.cjs");require("../../functions/web3/getTokenHolder.cjs");require("ethers-v6h");class l{STORAGE_KEY="contacts";checkForDuplicate(o,e,r){if(o.find(({ethereumAddress:t,nickname:i})=>(t===e.ethereumAddress||i===e.nickname)&&t!==r)!==void 0)throw new Error("Duplicate Contact attribute")}async createContact(o,e){const r=o.toLowerCase();await s.update(this.STORAGE_KEY,c=>{const t=c??{},i=t[r]??[];return this.checkForDuplicate(i,e),i.push(e),t[r]=i,t})}async getContacts(o){try{const e=o.toLowerCase(),r=await s.get(this.STORAGE_KEY);return!r||!r[e]?[]:r[e]}catch(e){return q.Logger.error("Error while getting contacts:",e),[]}}async editContact(o,e,r){const c=o.toLowerCase();await s.update(this.STORAGE_KEY,t=>{const i=t??{},a=i[c];if(!i||!a)throw new Error("Contacts could not be fetched");this.checkForDuplicate(a,r,e);const n=a.findIndex(({ethereumAddress:u})=>d.caseInsensitiveEqual(u,e));if(n===-1)throw new Error("Contact to be edited was not found");return a[n]=r,i[c]=a,i})}async deleteContact(o,e){const r=o.toLowerCase();await s.update(this.STORAGE_KEY,c=>{const t=c??{},i=t[r];if(!t||!i)throw new Error("Contacts could not be fetched");const a=i.filter(({ethereumAddress:n})=>n!==e);return t[r]=a,t})}}const w=new l;exports.contactStorage=w;
|
|
@@ -3,31 +3,34 @@ import { Logger as d } from "../../error-handling/logger.mjs";
|
|
|
3
3
|
import "../../types/circom-data.types.mjs";
|
|
4
4
|
import "../../types/transactions.types.mjs";
|
|
5
5
|
import "../../types/activities.types.mjs";
|
|
6
|
+
import "../../constants/chains.constants.mjs";
|
|
7
|
+
import "@coral-xyz/anchor";
|
|
8
|
+
import "@solana/web3.js";
|
|
6
9
|
import "../../constants/kyc.constants.mjs";
|
|
7
10
|
import "ethers";
|
|
8
|
-
import "
|
|
11
|
+
import "../http/HttpClient.mjs";
|
|
9
12
|
import "../../constants/token-data/index.mjs";
|
|
10
13
|
import "../../error-handling/error-codes.constants.mjs";
|
|
11
|
-
import "../../constants/chains.constants.mjs";
|
|
12
14
|
import "../../functions/utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
13
15
|
import "circomlibjs-hinkal-fork";
|
|
14
16
|
import "../crypto-keys/keys.mjs";
|
|
15
17
|
import "../../constants/server.constants.mjs";
|
|
16
18
|
import "../../constants/vite.constants.mjs";
|
|
19
|
+
import "axios";
|
|
17
20
|
import { caseInsensitiveEqual as l } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
18
21
|
import "../../API/getServerURL.mjs";
|
|
19
|
-
import "../../constants/reorg-depths.constants.mjs";
|
|
20
|
-
import "../../functions/utils/mutexes.utils.mjs";
|
|
21
22
|
import "libsodium-wrappers";
|
|
22
23
|
import "process";
|
|
23
24
|
import "buffer";
|
|
24
25
|
import "../../constants/save-depths.mjs";
|
|
26
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
27
|
+
import "../../functions/utils/mutexes.utils.mjs";
|
|
28
|
+
import "@solana/spl-token";
|
|
25
29
|
import "../../constants/contracts.constants.mjs";
|
|
26
30
|
import "../../constants/coingecko.constants.mjs";
|
|
27
31
|
import "../../constants/addresses.constants.mjs";
|
|
28
32
|
import "../../constants/token.limits.constants.mjs";
|
|
29
33
|
import "../../constants/presale.constants.mjs";
|
|
30
|
-
import "../../constants/mystery-boxes.constants.mjs";
|
|
31
34
|
import "../../constants/activity.constants.mjs";
|
|
32
35
|
import "../../constants/tasks.constants.mjs";
|
|
33
36
|
import "../../constants/events.constants.mjs";
|
|
@@ -40,32 +43,32 @@ import "../../functions/web3/getTokenHolder.mjs";
|
|
|
40
43
|
import "ethers-v6h";
|
|
41
44
|
class w {
|
|
42
45
|
STORAGE_KEY = "contacts";
|
|
43
|
-
checkForDuplicate(
|
|
44
|
-
if (
|
|
45
|
-
({ ethereumAddress: r, nickname:
|
|
46
|
+
checkForDuplicate(e, t, o) {
|
|
47
|
+
if (e.find(
|
|
48
|
+
({ ethereumAddress: r, nickname: i }) => (r === t.ethereumAddress || i === t.nickname) && r !== o
|
|
46
49
|
) !== void 0)
|
|
47
50
|
throw new Error("Duplicate Contact attribute");
|
|
48
51
|
}
|
|
49
|
-
async createContact(
|
|
50
|
-
const o =
|
|
52
|
+
async createContact(e, t) {
|
|
53
|
+
const o = e.toLowerCase();
|
|
51
54
|
await s(this.STORAGE_KEY, (c) => {
|
|
52
|
-
const r = c ?? {},
|
|
53
|
-
return this.checkForDuplicate(
|
|
55
|
+
const r = c ?? {}, i = r[o] ?? [];
|
|
56
|
+
return this.checkForDuplicate(i, t), i.push(t), r[o] = i, r;
|
|
54
57
|
});
|
|
55
58
|
}
|
|
56
|
-
async getContacts(
|
|
59
|
+
async getContacts(e) {
|
|
57
60
|
try {
|
|
58
|
-
const t =
|
|
61
|
+
const t = e.toLowerCase(), o = await p(this.STORAGE_KEY);
|
|
59
62
|
return !o || !o[t] ? [] : o[t];
|
|
60
63
|
} catch (t) {
|
|
61
64
|
return d.error("Error while getting contacts:", t), [];
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
|
-
async editContact(
|
|
65
|
-
const c =
|
|
67
|
+
async editContact(e, t, o) {
|
|
68
|
+
const c = e.toLowerCase();
|
|
66
69
|
await s(this.STORAGE_KEY, (r) => {
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
70
|
+
const i = r ?? {}, a = i[c];
|
|
71
|
+
if (!i || !a)
|
|
69
72
|
throw new Error("Contacts could not be fetched");
|
|
70
73
|
this.checkForDuplicate(a, o, t);
|
|
71
74
|
const n = a.findIndex(
|
|
@@ -73,23 +76,23 @@ class w {
|
|
|
73
76
|
);
|
|
74
77
|
if (n === -1)
|
|
75
78
|
throw new Error("Contact to be edited was not found");
|
|
76
|
-
return a[n] = o,
|
|
79
|
+
return a[n] = o, i[c] = a, i;
|
|
77
80
|
});
|
|
78
81
|
}
|
|
79
|
-
async deleteContact(
|
|
80
|
-
const o =
|
|
82
|
+
async deleteContact(e, t) {
|
|
83
|
+
const o = e.toLowerCase();
|
|
81
84
|
await s(this.STORAGE_KEY, (c) => {
|
|
82
|
-
const r = c ?? {},
|
|
83
|
-
if (!r || !
|
|
85
|
+
const r = c ?? {}, i = r[o];
|
|
86
|
+
if (!r || !i)
|
|
84
87
|
throw new Error("Contacts could not be fetched");
|
|
85
|
-
const a =
|
|
88
|
+
const a = i.filter(
|
|
86
89
|
({ ethereumAddress: n }) => n !== t
|
|
87
90
|
);
|
|
88
91
|
return r[o] = a, r;
|
|
89
92
|
});
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
|
-
const
|
|
95
|
+
const et = new w();
|
|
93
96
|
export {
|
|
94
|
-
|
|
97
|
+
et as contactStorage
|
|
95
98
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("idb-keyval");require("../../error-handling/error-codes.constants.cjs");require("ethers");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");const a=require("../../types/cache.types.cjs");require("../../constants/server.constants.cjs");require("../../API/getServerURL.cjs");require("../http/HttpClient.cjs");require("axios");require("../../constants/chains.constants.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../constants/vite.constants.cjs");require("../../constants/save-depths.cjs");require("../../constants/reorg-depths.constants.cjs");require("../../functions/utils/mutexes.utils.cjs");require("@coral-xyz/anchor");const o=require("../../error-handling/logger.cjs");require("@solana/web3.js");require("../crypto-keys/keys.cjs");class c{generateMessageId(){const e=new Date().getTime(),r=Math.random().toString(36).substring(2,15);return`msg_${e}_${r}`}async saveSignedMessage(e,r,t,n,u,S){try{const s=this.generateMessageId(),g=await i.get(a.StorageKeys.SIGNED_MESSAGES)||{},q={chainId:e,messageText:r,messageType:t,subAccountAddress:n,signature:u,appMetaData:S};g[s]={timestamp:new Date().toISOString(),...q},await i.set(a.StorageKeys.SIGNED_MESSAGES,g)}catch(s){o.Logger.error("Failed to save signed message:",s,{chainId:e,messageType:t})}}async getAllSignedMessages(){try{const e=await i.get(a.StorageKeys.SIGNED_MESSAGES)||{};return Object.values(e).sort((r,t)=>new Date(t.timestamp).getTime()-new Date(r.timestamp).getTime())}catch(e){return o.Logger.error("Failed to retrieve signed messages:",e),[]}}}const d=new c;exports.signedMessagesStorage=d;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { get as
|
|
1
|
+
import { get as m, set as c } from "idb-keyval";
|
|
2
2
|
import "../../error-handling/error-codes.constants.mjs";
|
|
3
3
|
import "ethers";
|
|
4
4
|
import "../../types/circom-data.types.mjs";
|
|
@@ -7,17 +7,21 @@ import "../../types/activities.types.mjs";
|
|
|
7
7
|
import { StorageKeys as s } from "../../types/cache.types.mjs";
|
|
8
8
|
import "../../constants/server.constants.mjs";
|
|
9
9
|
import "../../API/getServerURL.mjs";
|
|
10
|
+
import "../http/HttpClient.mjs";
|
|
10
11
|
import "axios";
|
|
11
12
|
import "../../constants/chains.constants.mjs";
|
|
12
|
-
import "../../constants/reorg-depths.constants.mjs";
|
|
13
|
-
import "../../functions/utils/mutexes.utils.mjs";
|
|
14
13
|
import "circomlibjs-hinkal-fork";
|
|
15
14
|
import "libsodium-wrappers";
|
|
16
15
|
import "process";
|
|
17
16
|
import "buffer";
|
|
18
17
|
import "../../constants/vite.constants.mjs";
|
|
19
18
|
import "../../constants/save-depths.mjs";
|
|
20
|
-
import
|
|
19
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
20
|
+
import "../../functions/utils/mutexes.utils.mjs";
|
|
21
|
+
import "@coral-xyz/anchor";
|
|
22
|
+
import { Logger as a } from "../../error-handling/logger.mjs";
|
|
23
|
+
import "@solana/web3.js";
|
|
24
|
+
import "../crypto-keys/keys.mjs";
|
|
21
25
|
class d {
|
|
22
26
|
generateMessageId() {
|
|
23
27
|
const t = (/* @__PURE__ */ new Date()).getTime(), e = Math.random().toString(36).substring(2, 15);
|
|
@@ -25,7 +29,7 @@ class d {
|
|
|
25
29
|
}
|
|
26
30
|
async saveSignedMessage(t, e, r, g, n, p) {
|
|
27
31
|
try {
|
|
28
|
-
const o = this.generateMessageId(), i = await
|
|
32
|
+
const o = this.generateMessageId(), i = await m(s.SIGNED_MESSAGES) || {}, S = {
|
|
29
33
|
chainId: t,
|
|
30
34
|
messageText: e,
|
|
31
35
|
messageType: r,
|
|
@@ -38,7 +42,7 @@ class d {
|
|
|
38
42
|
...S
|
|
39
43
|
}, await c(s.SIGNED_MESSAGES, i);
|
|
40
44
|
} catch (o) {
|
|
41
|
-
|
|
45
|
+
a.error("Failed to save signed message:", o, {
|
|
42
46
|
chainId: t,
|
|
43
47
|
messageType: r
|
|
44
48
|
});
|
|
@@ -46,14 +50,14 @@ class d {
|
|
|
46
50
|
}
|
|
47
51
|
async getAllSignedMessages() {
|
|
48
52
|
try {
|
|
49
|
-
const t = await
|
|
53
|
+
const t = await m(s.SIGNED_MESSAGES) || {};
|
|
50
54
|
return Object.values(t).sort((e, r) => new Date(r.timestamp).getTime() - new Date(e.timestamp).getTime());
|
|
51
55
|
} catch (t) {
|
|
52
|
-
return
|
|
56
|
+
return a.error("Failed to retrieve signed messages:", t), [];
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
|
-
const
|
|
60
|
+
const q = new d();
|
|
57
61
|
export {
|
|
58
|
-
|
|
62
|
+
q as signedMessagesStorage
|
|
59
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../crypto-keys/keys.cjs"),R=require("../utxo/Utxo.cjs"),p=require("../../webworker/utxoWorker/utxoWorker.types.cjs"),S=require("../../webworker/performTaskWithWorker.cjs"),m=require("../../webworker/worker.registry.cjs"),_=require("../../constants/vite.constants.cjs");class O{NUM_WORKERS;NUM_WORKERS_BATCH_PROCESS;constructor(){_.isNode?(this.NUM_WORKERS=1,this.NUM_WORKERS_BATCH_PROCESS=1):(this.NUM_WORKERS=3,this.NUM_WORKERS_BATCH_PROCESS=Math.ceil(navigator.deviceMemory??4))}async createUtxoPromise(s){return await S.performTaskWithWorker({type:m.WorkerVariant.UTXO,payload:s})}async batchFilterUtxosWithNullifier(s,t){const a=this.sliceArrayIntoParts(s,this.NUM_WORKERS).map(e=>this.createUtxoPromise({type:p.UtxoWorkerActionType.BATCH_FILTER_UTXOS_WITH_NULLIFIER,data:{utxos:e.map(u=>u.getConstructableParams()),nullifiers:t}})),i=await Promise.all(a);return i.forEach(e=>{d.stealthPairCacheDevice.mergeWithSerialized(e.stealthPairCache),d.stealthAddressCacheDevice.mergeWithSerialized(e.stealthAddressCache)}),i.flatMap(e=>e.utxoConstructors).map(e=>new R.Utxo(e))}async buildBatchProcess(s,t,r){const i=this.sliceArrayIntoParts(s,this.NUM_WORKERS).map(n=>this.createUtxoPromise({type:p.UtxoWorkerActionType.BUILD_UTXOS,data:{signature:t.getSignature(),encryptedOutputs:n,chainId:r}}));return(await Promise.all(i)).flat().map(n=>new R.Utxo(n))}sliceArrayIntoParts(s,t){const r=Math.ceil(s.length/t);return Array.from({length:t},(i,e)=>s.slice(r*e,r*(e+1)))}findLastOutput(s,t){let r=t;return s.forEach(a=>{a!==t&&(r=a)}),r}async batchProcess(s,t,r,a){const i=this.sliceArrayIntoParts(s,this.NUM_WORKERS_BATCH_PROCESS),e=r.getSignature(),u=i.map(o=>{const c={type:p.UtxoWorkerActionType.DECIPHER_OUTPUTS,data:{encryptedOutputs:o,lastOutput:t,signature:e,chainId:a}};return this.createUtxoPromise(c)}),l=await Promise.all(u),n=l.map(({additionalEncryptedOutputs:o})=>o).flat(),h=new Set,y=n.reduce((o,c)=>h.has(c.value)?o:(h.add(c.value),[...o,c]),[]),U=this.findLastOutput(l.map(o=>o.lastOutput),t);return{additionalEncryptedOutputs:y,lastOutput:U??t}}}exports.MultiThreadedUtxoUtils=O;
|
|
@@ -13,8 +13,8 @@ export declare class MultiThreadedUtxoUtils implements IMultiThreadedUtxoUtils {
|
|
|
13
13
|
constructor();
|
|
14
14
|
private createUtxoPromise;
|
|
15
15
|
batchFilterUtxosWithNullifier(allUtxos: Utxo[], nullifiers: Set<string>): Promise<Utxo[]>;
|
|
16
|
-
buildBatchProcess(encryptedOutputs: EncryptedOutputWithSign[], userKeys: UserKeys): Promise<Utxo[]>;
|
|
16
|
+
buildBatchProcess(encryptedOutputs: EncryptedOutputWithSign[], userKeys: UserKeys, chainId: number): Promise<Utxo[]>;
|
|
17
17
|
sliceArrayIntoParts<T>(arr: T[], numberOfParts: number): T[][];
|
|
18
18
|
findLastOutput(lastOutputsArray: string[], lastOutput: string): string;
|
|
19
|
-
batchProcess(encryptedOutputs: EncryptedOutputWithSign[], lastOutput: string, userKeys: UserKeys): Promise<OutputsWithSignAndLast<boolean>>;
|
|
19
|
+
batchProcess(encryptedOutputs: EncryptedOutputWithSign[], lastOutput: string, userKeys: UserKeys, chainId: number): Promise<OutputsWithSignAndLast<boolean>>;
|
|
20
20
|
}
|