@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,8 +1,9 @@
|
|
|
1
1
|
import { getWASMFile as f, getZKeyFile as k } from "./getZKFiles.mjs";
|
|
2
2
|
import { ENCLAVE_EC2_URL as y } from "./constant.mjs";
|
|
3
3
|
import { makeEnclaveHandshakeAndEncryptInput as E } from "../utils/encryptInputForEnclave.mjs";
|
|
4
|
-
import g from "
|
|
5
|
-
|
|
4
|
+
import { httpClient as g } from "../../data-structures/http/HttpClient.mjs";
|
|
5
|
+
import "axios";
|
|
6
|
+
const n = (t) => {
|
|
6
7
|
if (t.startsWith("http")) {
|
|
7
8
|
const e = t.split("/").at(-1);
|
|
8
9
|
if (!e)
|
|
@@ -10,17 +11,17 @@ const a = (t) => {
|
|
|
10
11
|
return e;
|
|
11
12
|
}
|
|
12
13
|
return t;
|
|
13
|
-
},
|
|
14
|
-
const
|
|
14
|
+
}, z = async (t, i, e, r) => {
|
|
15
|
+
const a = n(f(t, e, i)), o = n(k(t, e, i)), { keyCiphertext: s, inputCiphertext: l } = await E(r), p = {
|
|
15
16
|
chainId: i,
|
|
16
|
-
circuit_wasm:
|
|
17
|
-
circuit_zkey:
|
|
17
|
+
circuit_wasm: a,
|
|
18
|
+
circuit_zkey: o,
|
|
18
19
|
input: l,
|
|
19
|
-
key:
|
|
20
|
+
key: s,
|
|
20
21
|
version: t
|
|
21
|
-
},
|
|
22
|
+
}, c = await g.post(`${y}/generate`, p), { public_signals: m, zk_calldata: u } = c;
|
|
22
23
|
return { zkCallData: u, publicSignals: m };
|
|
23
24
|
};
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
z as generateZkProofEnclave
|
|
26
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../constants/chains.constants.cjs"),o=require("./constant.cjs"),l=(e,i,t)=>{const r=e==="v1x0"?"":e;if(t===s.chainIds.localhost||t===s.chainIds.solanaLocalnet)return o.localVerifiers[`${i}${r}Wasm`];const c=o.prodVerifiers(t,e)[`${i}${r}Wasm`];return console.log({verifier:c}),c},a=(e,i,t)=>{const r=e==="v1x0"?"":e;return t===s.chainIds.localhost||t===s.chainIds.solanaLocalnet?o.localVerifiers[`${i}${r}Zkey`]:o.prodVerifiers(t,e)[`${i}${r}Zkey`]};exports.getWASMFile=l;exports.getZKeyFile=a;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { chainIds as
|
|
2
|
-
import { prodVerifiers as c, localVerifiers as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
if (t ===
|
|
6
|
-
return
|
|
7
|
-
const
|
|
8
|
-
return console.log({ verifier:
|
|
9
|
-
},
|
|
10
|
-
const
|
|
11
|
-
return t ===
|
|
1
|
+
import { chainIds as i } from "../../constants/chains.constants.mjs";
|
|
2
|
+
import { prodVerifiers as c, localVerifiers as l } from "./constant.mjs";
|
|
3
|
+
const $ = (e, r, t) => {
|
|
4
|
+
const o = e === "v1x0" ? "" : e;
|
|
5
|
+
if (t === i.localhost || t === i.solanaLocalnet)
|
|
6
|
+
return l[`${r}${o}Wasm`];
|
|
7
|
+
const s = c(t, e)[`${r}${o}Wasm`];
|
|
8
|
+
return console.log({ verifier: s }), s;
|
|
9
|
+
}, v = (e, r, t) => {
|
|
10
|
+
const o = e === "v1x0" ? "" : e;
|
|
11
|
+
return t === i.localhost || t === i.solanaLocalnet ? l[`${r}${o}Zkey`] : c(t, e)[`${r}${o}Zkey`];
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
$ as getWASMFile,
|
|
15
|
+
v as getZKeyFile
|
|
16
16
|
};
|
|
@@ -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("ethers"),u=require("@solana/web3.js"),h=t=>{const[r,e,s,n,o]=t.split(","),c=!r||!e||!s||!n||!o,a=e?.substring(0,2)!=="0x"||s?.substring(0,2)!=="0x",d=s?.length!==66||e?.length>66||e?.length<64,l=t?.includes('"');return!(c||a||d||l)},g=t=>{const[r,e,,s,n]=t.split(",");return{extraRandomization:BigInt(r),stealthAddress:BigInt(e),H0:BigInt(s),H1:BigInt(n)}},b=t=>i.ethers.utils.keccak256(i.ethers.utils.toUtf8Bytes(t.toLowerCase())),y=t=>{try{return new u.PublicKey(t).toBase58()===t}catch{return!1}};exports.constructStealthAddressStructure=g;exports.hashEthereumAddress=b;exports.isValidPrivateAddress=h;exports.isValidSolanaPublicKey=y;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StealthAddressStructure } from '../../types/circom-data.types';
|
|
2
2
|
export declare const isValidPrivateAddress: (address: string) => boolean;
|
|
3
|
-
export declare const isValidExtendedPrivateAddress: (address: string) => boolean;
|
|
4
3
|
export declare const constructStealthAddressStructure: (recipientInfo: string) => StealthAddressStructure;
|
|
5
4
|
export declare const hashEthereumAddress: (ethereumAddress: string) => string;
|
|
5
|
+
export declare const isValidSolanaPublicKey: (str: string) => boolean;
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import { ethers as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}, u = (s) => {
|
|
9
|
-
const [e, t, n, r] = s.split(",");
|
|
1
|
+
import { ethers as o } from "ethers";
|
|
2
|
+
import { PublicKey as u } from "@solana/web3.js";
|
|
3
|
+
const m = (t) => {
|
|
4
|
+
const [n, s, e, r, i] = t.split(","), c = !n || !s || !e || !r || !i, a = s?.substring(0, 2) !== "0x" || e?.substring(0, 2) !== "0x", l = e?.length !== 66 || s?.length > 66 || s?.length < 64, d = t?.includes('"');
|
|
5
|
+
return !(c || a || l || d);
|
|
6
|
+
}, y = (t) => {
|
|
7
|
+
const [n, s, , e, r] = t.split(",");
|
|
10
8
|
return {
|
|
11
|
-
extraRandomization: BigInt(
|
|
12
|
-
stealthAddress: BigInt(
|
|
13
|
-
H0: BigInt(
|
|
9
|
+
extraRandomization: BigInt(n),
|
|
10
|
+
stealthAddress: BigInt(s),
|
|
11
|
+
H0: BigInt(e),
|
|
14
12
|
H1: BigInt(r)
|
|
15
13
|
};
|
|
16
|
-
},
|
|
14
|
+
}, b = (t) => o.utils.keccak256(o.utils.toUtf8Bytes(t.toLowerCase())), p = (t) => {
|
|
15
|
+
try {
|
|
16
|
+
return new u(t).toBase58() === t;
|
|
17
|
+
} catch {
|
|
18
|
+
return !1;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
17
21
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
y as constructStealthAddressStructure,
|
|
23
|
+
b as hashEthereumAddress,
|
|
24
|
+
m as isValidPrivateAddress,
|
|
25
|
+
p as isValidSolanaPublicKey
|
|
22
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=t=>t.reduce((n,e)=>n+e,0),s=t=>t.reduce((n,e)=>n+e,0n),u=t=>t/100,a=(t,n)=>n*t/10000n;function g(t){return typeof t=="object"&&"toBigInt"in t?t.toBigInt():BigInt(t)}const m=t=>{try{return BigInt(t)}catch{return}},
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=t=>t.reduce((n,e)=>n+e,0),s=t=>t.reduce((n,e)=>n+e,0n),u=t=>t/100,a=(t,n)=>n*t/10000n;function g(t){return typeof t=="object"&&"toBigInt"in t?t.toBigInt():BigInt(t)}const d=t=>{if(Array.isArray(t)&&t.length===32){let n=0n;for(let e=0;e<32;e+=1)n=n<<8n|BigInt(t[e]);return n}if(typeof t=="string"||typeof t=="number")return BigInt(t);if(typeof t=="bigint")return t;throw new Error(`Cannot convert value to BigInt: ${typeof t}, value: ${JSON.stringify(t)}`)},m=t=>{try{return BigInt(t)}catch{return}},f=t=>{const n=Number(t);return Number.isNaN(n)?void 0:n},l=(t,n)=>t?parseInt(t,10):n;function I(){BigInt.prototype.toJSON=function(){return this.toString()}}function B(...t){return t.reduce((n,e)=>e>n?e:n)}function p(t){return t===0?0:t<99999e-11?"< 0.000001":+Number(t).toFixed(6)}const b=(t,n)=>{const e=t.toFixed(20),r=e.indexOf(".");if(r===-1)return e;const i=r+n+1;return e.substring(0,i)},o=t=>{if(/^0+$/.test(t))return"0";if(/^0\.\d+$/.test(t))return t;const n=t.replace(/^0+/,"");return n.startsWith(".")?`0${n}`:n},S=t=>{const n=t.split("."),e=n[0],r=n.length>1?`.${n[1]}`:"";return`${o(e).replace(/\B(?=(\d{3})+(?!\d))/g,",")}${r}`},y=(t,n=18)=>{const e=t.match(/^(\d+)(\.(\d+))?$/);if(e){const r=e[1],i=e[3]?.slice(0,n)||"";return i?`${r}.${i}`:r}return t},N=t=>t<0n?-t:t,P=(t,n,e)=>{const r=t<n?t:n;return e?r<e?r:e:r},x=(t,n)=>t>n?t:n,O=t=>t.reduce((n,{amount:e})=>n+e,0n);exports.absBigInt=N;exports.advancedToBigInt=d;exports.beepsToPercentage=u;exports.bigintApplySugar=I;exports.bigintMax=B;exports.calculateAmountUsingBeeps=a;exports.calculateBigIntSum=s;exports.calculateSum=c;exports.countTotalAmountInUtxos=O;exports.fixDecimalsAmount=p;exports.getValueFirstNDigit=b;exports.maxBigInt=x;exports.minBigInt=P;exports.toBigInt=g;exports.toBigIntOrUndefined=m;exports.toCommaSeparatedNumberString=S;exports.toInt=l;exports.toNumberOrUndefined=f;exports.trimLeadingZeros=o;exports.truncateToDecimalPlaces=y;
|
|
@@ -5,6 +5,7 @@ export declare const calculateBigIntSum: (arr: bigint[]) => bigint;
|
|
|
5
5
|
export declare const beepsToPercentage: (beeps: number) => number;
|
|
6
6
|
export declare const calculateAmountUsingBeeps: (beep: bigint, amount: bigint) => bigint;
|
|
7
7
|
export declare function toBigInt(value: BigIntable): bigint;
|
|
8
|
+
export declare const advancedToBigInt: (value: number[] | string | number | bigint) => bigint;
|
|
8
9
|
/** Converts the value to a BigInt or returns undefined if can't */
|
|
9
10
|
export declare const toBigIntOrUndefined: (value: any) => bigint | undefined;
|
|
10
11
|
/** Converts the value to a number or returns undefined if can't */
|
|
@@ -1,34 +1,46 @@
|
|
|
1
|
-
const s = (t) => t.reduce((n,
|
|
2
|
-
function
|
|
1
|
+
const s = (t) => t.reduce((n, r) => n + r, 0), u = (t) => t.reduce((n, r) => n + r, 0n), g = (t) => t / 100, a = (t, n) => n * t / 10000n;
|
|
2
|
+
function d(t) {
|
|
3
3
|
return typeof t == "object" && "toBigInt" in t ? t.toBigInt() : BigInt(t);
|
|
4
4
|
}
|
|
5
|
-
const
|
|
5
|
+
const f = (t) => {
|
|
6
|
+
if (Array.isArray(t) && t.length === 32) {
|
|
7
|
+
let n = 0n;
|
|
8
|
+
for (let r = 0; r < 32; r += 1)
|
|
9
|
+
n = n << 8n | BigInt(t[r]);
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
if (typeof t == "string" || typeof t == "number")
|
|
13
|
+
return BigInt(t);
|
|
14
|
+
if (typeof t == "bigint")
|
|
15
|
+
return t;
|
|
16
|
+
throw new Error(`Cannot convert value to BigInt: ${typeof t}, value: ${JSON.stringify(t)}`);
|
|
17
|
+
}, m = (t) => {
|
|
6
18
|
try {
|
|
7
19
|
return BigInt(t);
|
|
8
20
|
} catch {
|
|
9
21
|
return;
|
|
10
22
|
}
|
|
11
|
-
},
|
|
23
|
+
}, I = (t) => {
|
|
12
24
|
const n = Number(t);
|
|
13
25
|
return Number.isNaN(n) ? void 0 : n;
|
|
14
|
-
},
|
|
15
|
-
function
|
|
26
|
+
}, p = (t, n) => t ? parseInt(t, 10) : n;
|
|
27
|
+
function B() {
|
|
16
28
|
BigInt.prototype.toJSON = function() {
|
|
17
29
|
return this.toString();
|
|
18
30
|
};
|
|
19
31
|
}
|
|
20
|
-
function
|
|
21
|
-
return t.reduce((n,
|
|
32
|
+
function l(...t) {
|
|
33
|
+
return t.reduce((n, r) => r > n ? r : n);
|
|
22
34
|
}
|
|
23
|
-
function
|
|
35
|
+
function y(t) {
|
|
24
36
|
return t === 0 ? 0 : t < 99999e-11 ? "< 0.000001" : +Number(t).toFixed(6);
|
|
25
37
|
}
|
|
26
38
|
const N = (t, n) => {
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
return
|
|
30
|
-
const o =
|
|
31
|
-
return
|
|
39
|
+
const r = t.toFixed(20), e = r.indexOf(".");
|
|
40
|
+
if (e === -1)
|
|
41
|
+
return r;
|
|
42
|
+
const o = e + n + 1;
|
|
43
|
+
return r.substring(0, o);
|
|
32
44
|
}, i = (t) => {
|
|
33
45
|
if (/^0+$/.test(t))
|
|
34
46
|
return "0";
|
|
@@ -36,38 +48,39 @@ const N = (t, n) => {
|
|
|
36
48
|
return t;
|
|
37
49
|
const n = t.replace(/^0+/, "");
|
|
38
50
|
return n.startsWith(".") ? `0${n}` : n;
|
|
39
|
-
},
|
|
40
|
-
const n = t.split("."),
|
|
41
|
-
return `${i(
|
|
42
|
-
},
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const
|
|
46
|
-
return o ? `${
|
|
51
|
+
}, $ = (t) => {
|
|
52
|
+
const n = t.split("."), r = n[0], e = n.length > 1 ? `.${n[1]}` : "";
|
|
53
|
+
return `${i(r).replace(/\B(?=(\d{3})+(?!\d))/g, ",")}${e}`;
|
|
54
|
+
}, P = (t, n = 18) => {
|
|
55
|
+
const r = t.match(/^(\d+)(\.(\d+))?$/);
|
|
56
|
+
if (r) {
|
|
57
|
+
const e = r[1], o = r[3]?.slice(0, n) || "";
|
|
58
|
+
return o ? `${e}.${o}` : e;
|
|
47
59
|
}
|
|
48
60
|
return t;
|
|
49
|
-
},
|
|
50
|
-
const
|
|
51
|
-
return
|
|
52
|
-
},
|
|
61
|
+
}, b = (t) => t < 0n ? -t : t, h = (t, n, r) => {
|
|
62
|
+
const e = t < n ? t : n;
|
|
63
|
+
return r ? e < r ? e : r : e;
|
|
64
|
+
}, x = (t, n) => t > n ? t : n, O = (t) => t.reduce((n, { amount: r }) => n + r, 0n);
|
|
53
65
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
66
|
+
b as absBigInt,
|
|
67
|
+
f as advancedToBigInt,
|
|
68
|
+
g as beepsToPercentage,
|
|
69
|
+
B as bigintApplySugar,
|
|
70
|
+
l as bigintMax,
|
|
71
|
+
a as calculateAmountUsingBeeps,
|
|
59
72
|
u as calculateBigIntSum,
|
|
60
73
|
s as calculateSum,
|
|
61
|
-
|
|
62
|
-
|
|
74
|
+
O as countTotalAmountInUtxos,
|
|
75
|
+
y as fixDecimalsAmount,
|
|
63
76
|
N as getValueFirstNDigit,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
77
|
+
x as maxBigInt,
|
|
78
|
+
h as minBigInt,
|
|
79
|
+
d as toBigInt,
|
|
67
80
|
m as toBigIntOrUndefined,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
81
|
+
$ as toCommaSeparatedNumberString,
|
|
82
|
+
p as toInt,
|
|
83
|
+
I as toNumberOrUndefined,
|
|
71
84
|
i as trimLeadingZeros,
|
|
72
|
-
|
|
85
|
+
P as truncateToDecimalPlaces
|
|
73
86
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@coral-xyz/anchor"),o=e=>{if(e.length!==32||e.some(t=>!Number.isInteger(t)||t<0||t>=256))throw new Error("invalid bytes32 value");return e.reduce((t,n)=>t*256n+BigInt(n),0n)},i=e=>[...new r.BN(e.toString()).toBuffer("be",32)];exports.convertBigIntToBytes32=i;exports.convertBytes32ToBigInt=o;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BN as t } from "@coral-xyz/anchor";
|
|
2
|
+
const i = (n) => {
|
|
3
|
+
if (n.length !== 32 || n.some((r) => !Number.isInteger(r) || r < 0 || r >= 256))
|
|
4
|
+
throw new Error("invalid bytes32 value");
|
|
5
|
+
return n.reduce((r, e) => r * 256n + BigInt(e), 0n);
|
|
6
|
+
}, B = (n) => [...new t(n.toString()).toBuffer("be", 32)];
|
|
7
|
+
export {
|
|
8
|
+
B as convertBigIntToBytes32,
|
|
9
|
+
i as convertBytes32ToBigInt
|
|
10
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../constants/token-data/index.cjs");require("../../constants/chains.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/server.constants.cjs");const t=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");require("../../constants/chains.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/server.constants.cjs");const t=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("../../data-structures/cacheDevices/FileCacheDevice.cjs"),u=require("../../data-structures/cacheDevices/LocalStorageCacheDevice.cjs"),s=e=>{if(t.isNode){let r,c;e&&({useFileCache:r,cacheFilePath:c}=e);const i=require("path").resolve(process.cwd(),"hinkalCache.json");return new a.FileCacheDevice(r,c??i)}else return new u.LocalStorageCacheDevice(e?.disableCaching,e?.serializedCache)};exports.createCacheDevice=s;
|
|
@@ -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
15
|
import { FileCacheDevice as c } from "../../data-structures/cacheDevices/FileCacheDevice.mjs";
|
|
17
16
|
import { LocalStorageCacheDevice as p } from "../../data-structures/cacheDevices/LocalStorageCacheDevice.mjs";
|
|
18
|
-
const
|
|
17
|
+
const q = (e) => {
|
|
19
18
|
if (i) {
|
|
20
19
|
let r, t;
|
|
21
20
|
e && ({ useFileCache: r, cacheFilePath: t } = e);
|
|
@@ -25,5 +24,5 @@ const x = (e) => {
|
|
|
25
24
|
return new p(e?.disableCaching, e?.serializedCache);
|
|
26
25
|
};
|
|
27
26
|
export {
|
|
28
|
-
|
|
27
|
+
q as createCacheDevice
|
|
29
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("../../types/ethereum-network.types.cjs"),y=require("./getDataFromTransaction.cjs"),A=require("idb-keyval"),T=require("../../constants/chains.constants.cjs"),C={encryptedOutputs:[],lastOutput:""},o=(s,t)=>{const e=s.substring(0,25),r=t.substring(0,25);return{shortPublicKey:e,shortHinkalAddress:r}},k=(s,t,e)=>`hinkalCache-${s}-${t}-${e}`,D=(s,t,e)=>{const{hinkalAddress:r}=T.networkRegistry[t].contractData;if(!t||!e||!r)throw Error("GetHinkalCache: incorrect arguments");const{shortPublicKey:a,shortHinkalAddress:n}=o(e,r);return JSON.parse(s.cacheDevice.get(k(t,a,n))??JSON.stringify(C))},x=(s,t,e,r)=>{const{hinkalAddress:a}=T.networkRegistry[e].contractData;if(!e||!r||!a)throw Error("SetHinkalCache: incorrect arguments");const{shortPublicKey:n,shortHinkalAddress:c}=o(r,a);t.cacheDevice.set(k(e,n,c),JSON.stringify(s))},S=(s,t,e)=>{x(C,s,t,e)},p=(s,t,e)=>`txsCache-${s}-${t}-${e}`,f=async(s,t,e,r,a,n)=>{if(!t||!e||!r)throw Error("saveTxsCache: incorrect arguments");const{shortPublicKey:c,shortHinkalAddress:i}=o(e,r),l=y.serializeDecodedTxs(s),h=p(t,c,i),g=JSON.stringify({serializedTxs:l,lastHash:a});try{await A.set(h,g)}catch{n.cacheDevice.set(h,g)}},m={serializedTxs:[],lastHash:""},w=async(s,t,e,r)=>{if(!s||!t||!e)throw Error("loadTxsCache: incorrect arguments");const{shortPublicKey:a,shortHinkalAddress:n}=o(t,e),c=p(s,a,n);let i;try{const d=await A.get(c);if(!d)throw new Error("Empty indexedDB cache");i=d}catch{i=r.cacheDevice.get(c)}const{serializedTxs:l,lastHash:h}=JSON.parse(i??JSON.stringify(m));return{decodedTxs:l.map(d=>y.deserializeDecodedTxs(d)),lastHash:h===""?void 0:h}},u=(s,t,e)=>`hinkalApprovalsCache-${s}-${t}-${e}`,v=(s,t,e,r)=>{const a=t.getContract(H.ContractType.HinkalContract,void 0,e).address;if(!e||!r||!a)throw Error("SetHinkalCache: incorrect arguments");const{shortPublicKey:n,shortHinkalAddress:c}=o(r,a);t.cacheDevice.set(u(e,n,c),JSON.stringify(s))},O=(s,t,e)=>{const r=s.getContract(H.ContractType.HinkalContract,void 0,t).address;if(!t||!e||!r)throw Error("GetHinkalCache: incorrect arguments");const{shortPublicKey:a,shortHinkalAddress:n}=o(e,r);return JSON.parse(s.cacheDevice.get(u(t,a,n))??JSON.stringify(C))},N=(s,t,e)=>{v({},s,t,e)};exports.getFilePath=k;exports.getHinkalCache=D;exports.getInHinkalAddressesCache=O;exports.getInHinkalAddressesFilePath=u;exports.loadTxsCache=w;exports.resetCache=S;exports.resetInHinkalAddressesCache=N;exports.saveTxsCache=f;exports.setHinkalCache=x;exports.setInHinkalAddressesCache=v;
|
|
@@ -1,81 +1,82 @@
|
|
|
1
|
-
import { ContractType as
|
|
1
|
+
import { ContractType as C } from "../../types/ethereum-network.types.mjs";
|
|
2
2
|
import { serializeDecodedTxs as p, deserializeDecodedTxs as f } from "./getDataFromTransaction.mjs";
|
|
3
|
-
import { set as
|
|
4
|
-
|
|
3
|
+
import { set as x, get as A } from "idb-keyval";
|
|
4
|
+
import { networkRegistry as H } from "../../constants/chains.constants.mjs";
|
|
5
|
+
const k = {
|
|
5
6
|
encryptedOutputs: [],
|
|
6
7
|
lastOutput: ""
|
|
7
|
-
},
|
|
8
|
-
const
|
|
9
|
-
return { shortPublicKey:
|
|
10
|
-
},
|
|
11
|
-
const r =
|
|
12
|
-
if (!
|
|
8
|
+
}, a = (e, s) => {
|
|
9
|
+
const t = e.substring(0, 25), r = s.substring(0, 25);
|
|
10
|
+
return { shortPublicKey: t, shortHinkalAddress: r };
|
|
11
|
+
}, u = (e, s, t) => `hinkalCache-${e}-${s}-${t}`, N = (e, s, t) => {
|
|
12
|
+
const { hinkalAddress: r } = H[s].contractData;
|
|
13
|
+
if (!s || !t || !r)
|
|
13
14
|
throw Error("GetHinkalCache: incorrect arguments");
|
|
14
|
-
const { shortPublicKey:
|
|
15
|
+
const { shortPublicKey: c, shortHinkalAddress: n } = a(t, r);
|
|
15
16
|
return JSON.parse(
|
|
16
|
-
e.cacheDevice.get(
|
|
17
|
+
e.cacheDevice.get(u(s, c, n)) ?? JSON.stringify(k)
|
|
17
18
|
);
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
19
|
+
}, D = (e, s, t, r) => {
|
|
20
|
+
const { hinkalAddress: c } = H[t].contractData;
|
|
21
|
+
if (!t || !r || !c)
|
|
21
22
|
throw Error("SetHinkalCache: incorrect arguments");
|
|
22
|
-
const { shortPublicKey:
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
if (!
|
|
23
|
+
const { shortPublicKey: n, shortHinkalAddress: o } = a(r, c);
|
|
24
|
+
s.cacheDevice.set(u(t, n, o), JSON.stringify(e));
|
|
25
|
+
}, $ = (e, s, t) => {
|
|
26
|
+
D(k, e, s, t);
|
|
27
|
+
}, y = (e, s, t) => `txsCache-${e}-${s}-${t}`, E = async (e, s, t, r, c, n) => {
|
|
28
|
+
if (!s || !t || !r)
|
|
28
29
|
throw Error("saveTxsCache: incorrect arguments");
|
|
29
|
-
const { shortPublicKey:
|
|
30
|
+
const { shortPublicKey: o, shortHinkalAddress: i } = a(t, r), l = p(e), h = y(s, o, i), g = JSON.stringify({ serializedTxs: l, lastHash: c });
|
|
30
31
|
try {
|
|
31
|
-
await
|
|
32
|
+
await x(h, g);
|
|
32
33
|
} catch {
|
|
33
|
-
|
|
34
|
+
n.cacheDevice.set(h, g);
|
|
34
35
|
}
|
|
35
|
-
}, S = { serializedTxs: [], lastHash: "" },
|
|
36
|
-
if (!e || !
|
|
36
|
+
}, S = { serializedTxs: [], lastHash: "" }, z = async (e, s, t, r) => {
|
|
37
|
+
if (!e || !s || !t)
|
|
37
38
|
throw Error("loadTxsCache: incorrect arguments");
|
|
38
|
-
const { shortPublicKey:
|
|
39
|
+
const { shortPublicKey: c, shortHinkalAddress: n } = a(s, t), o = y(e, c, n);
|
|
39
40
|
let i;
|
|
40
41
|
try {
|
|
41
|
-
const d = await
|
|
42
|
+
const d = await A(o);
|
|
42
43
|
if (!d)
|
|
43
44
|
throw new Error("Empty indexedDB cache");
|
|
44
45
|
i = d;
|
|
45
46
|
} catch {
|
|
46
|
-
i = r.cacheDevice.get(
|
|
47
|
+
i = r.cacheDevice.get(o);
|
|
47
48
|
}
|
|
48
|
-
const { serializedTxs:
|
|
49
|
-
return { decodedTxs:
|
|
50
|
-
},
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
49
|
+
const { serializedTxs: l, lastHash: h } = JSON.parse(i ?? JSON.stringify(S));
|
|
50
|
+
return { decodedTxs: l.map((d) => f(d)), lastHash: h === "" ? void 0 : h };
|
|
51
|
+
}, m = (e, s, t) => `hinkalApprovalsCache-${e}-${s}-${t}`, T = (e, s, t, r) => {
|
|
52
|
+
const c = s.getContract(C.HinkalContract, void 0, t).address;
|
|
53
|
+
if (!t || !r || !c)
|
|
53
54
|
throw Error("SetHinkalCache: incorrect arguments");
|
|
54
|
-
const { shortPublicKey:
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
const { shortPublicKey: n, shortHinkalAddress: o } = a(r, c);
|
|
56
|
+
s.cacheDevice.set(
|
|
57
|
+
m(t, n, o),
|
|
57
58
|
JSON.stringify(e)
|
|
58
59
|
);
|
|
59
|
-
},
|
|
60
|
-
const r = e.getContract(
|
|
61
|
-
if (!
|
|
60
|
+
}, b = (e, s, t) => {
|
|
61
|
+
const r = e.getContract(C.HinkalContract, void 0, s).address;
|
|
62
|
+
if (!s || !t || !r)
|
|
62
63
|
throw Error("GetHinkalCache: incorrect arguments");
|
|
63
|
-
const { shortPublicKey:
|
|
64
|
+
const { shortPublicKey: c, shortHinkalAddress: n } = a(t, r);
|
|
64
65
|
return JSON.parse(
|
|
65
|
-
e.cacheDevice.get(
|
|
66
|
+
e.cacheDevice.get(m(s, c, n)) ?? JSON.stringify(k)
|
|
66
67
|
);
|
|
67
|
-
},
|
|
68
|
-
T({}, e,
|
|
68
|
+
}, P = (e, s, t) => {
|
|
69
|
+
T({}, e, s, t);
|
|
69
70
|
};
|
|
70
71
|
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
u as getFilePath,
|
|
73
|
+
N as getHinkalCache,
|
|
74
|
+
b as getInHinkalAddressesCache,
|
|
75
|
+
m as getInHinkalAddressesFilePath,
|
|
76
|
+
z as loadTxsCache,
|
|
77
|
+
$ as resetCache,
|
|
78
|
+
P as resetInHinkalAddressesCache,
|
|
79
|
+
E as saveTxsCache,
|
|
80
|
+
D as setHinkalCache,
|
|
80
81
|
T as setInHinkalAddressesCache
|
|
81
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../types/hinkal.types.cjs"),t=require("../../types/external-action.types.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../types/hinkal.types.cjs"),t=require("../../types/external-action.types.cjs"),e={[n.IntegrationProvider.UNISWAP]:t.ExternalActionId.Uniswap,[n.IntegrationProvider.ODOS]:t.ExternalActionId.Odos,[n.IntegrationProvider.ONEINCH]:t.ExternalActionId.OneInch,[n.IntegrationProvider.LIFI]:t.ExternalActionId.Lifi,[n.IntegrationProvider.OKX]:t.ExternalActionId.Okx,[n.IntegrationProvider.ALL]:void 0,[n.IntegrationProvider.NONE]:void 0},o=r=>e[r];exports.convertIntegrationProviderToExternalActionId=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../providers/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../providers/CustomSolanaConnection.cjs"),n=require("../../providers/CustomEthersProvider.cjs"),o=require("ethers"),s=e=>new o.ethers.providers.JsonRpcProvider(e),c=e=>{const r=new n.CustomEthersProvider(e);return new o.ethers.providers.Web3Provider(r)},i=(e,r="confirmed")=>new t.CustomSolanaConnection(e,r);exports.createCustomRpcProvider=c;exports.createCustomSolanaConnection=i;exports.createProvider=s;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { CustomSolanaConnection } from '../../providers/CustomSolanaConnection';
|
|
2
|
+
import { Commitment, ConnectionConfig } from '@solana/web3.js';
|
|
1
3
|
import { ethers } from 'ethers';
|
|
2
4
|
export declare const createProvider: (rpcUrl: string) => ethers.providers.JsonRpcProvider;
|
|
3
|
-
export declare const
|
|
5
|
+
export declare const createCustomRpcProvider: (rpcUrl: string) => ethers.providers.Web3Provider;
|
|
6
|
+
export declare const createCustomSolanaConnection: (endpoint: string, commitmentOrConfig?: Commitment | ConnectionConfig) => CustomSolanaConnection;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CustomSolanaConnection as t } from "../../providers/CustomSolanaConnection.mjs";
|
|
2
|
+
import { CustomEthersProvider as n } from "../../providers/CustomEthersProvider.mjs";
|
|
2
3
|
import { ethers as e } from "ethers";
|
|
3
|
-
const
|
|
4
|
-
const o = new
|
|
4
|
+
const m = (r) => new e.providers.JsonRpcProvider(r), d = (r) => {
|
|
5
|
+
const o = new n(r);
|
|
5
6
|
return new e.providers.Web3Provider(o);
|
|
6
|
-
};
|
|
7
|
+
}, p = (r, o = "confirmed") => new t(r, o);
|
|
7
8
|
export {
|
|
8
|
-
d as
|
|
9
|
-
|
|
9
|
+
d as createCustomRpcProvider,
|
|
10
|
+
p as createCustomSolanaConnection,
|
|
11
|
+
m as createProvider
|
|
10
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../constants/chains.constants.cjs"),s=(n,e)=>{const o=`${e.erc20TokenAddress}-${e.tokenId}`;return t.isSolanaLike(n)?o:o.toLowerCase()};exports.encodeTokenWithId=s;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TokenWithId } from '../../types/token-with-id.types';
|
|
2
|
-
export declare const encodeTokenWithId: (tokenWithId: TokenWithId) => string;
|
|
2
|
+
export declare const encodeTokenWithId: (chainId: number, tokenWithId: TokenWithId) => string;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { isSolanaLike as n } from "../../constants/chains.constants.mjs";
|
|
2
|
+
const t = (r, e) => {
|
|
3
|
+
const o = `${e.erc20TokenAddress}-${e.tokenId}`;
|
|
4
|
+
return n(r) ? o : o.toLowerCase();
|
|
5
|
+
};
|
|
2
6
|
export {
|
|
3
|
-
|
|
7
|
+
t as encodeTokenWithId
|
|
4
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("node-forge"),m=require("../snarkjs/constant.cjs"),a=require("ethers"),o=require("libsodium-wrappers"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("node-forge"),m=require("../snarkjs/constant.cjs"),a=require("ethers"),o=require("libsodium-wrappers"),h=require("../../data-structures/http/HttpClient.cjs");require("axios");function b(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const c=b(l),f=214,p=async()=>{const t=(await h.httpClient.get(`${m.ENCLAVE_EC2_URL}/handshake`)).public_key,n=c.util.decode64(t),r=c.asn1.fromDer(n);return c.pki.publicKeyFromAsn1(r)},i=e=>typeof e=="bigint"||typeof e=="number"?e.toString():e,y=e=>c.util.hexToBytes(e.replace("0x","")),E=e=>{const t=structuredClone(e);return Object.entries(t).forEach(([n,r])=>{t[n]=i(r),Array.isArray(r)&&(Array.isArray(r[0])?t[n]=r.map(s=>s.map(i)):t[n]=r.map(i))}),t},k=(e,t)=>{const n=a.ethers.utils.hexlify(t).slice(2),r=y(n);if(r.length>f)throw new Error("too many bytes passed to assymetric_encrypt");const s=e.encrypt(r,"RSA-OAEP",{md:c.md.sha1.create(),mgf1:{md:c.md.sha1.create()},label:null});return c.util.encode64(s)},A=(e,t)=>{const n=o.randombytes_buf(o.crypto_secretbox_NONCEBYTES),r=o.crypto_secretbox_easy(t,n,e),s=a.ethers.utils.hexlify(n)+a.ethers.utils.hexlify(r).slice(2),d=y(s);return c.util.encode64(d)},u=(e,t)=>{const n=o.randombytes_buf(o.crypto_secretbox_KEYBYTES),r=k(t,n),s=A(n,e);return{keyCiphertext:r,inputCiphertext:s}},g=(e,t)=>{const n=E(e),r=JSON.stringify(n),s=new TextEncoder().encode(r);return u(s,t)},x=async e=>{const t=await p();return g(e,t)},_=async e=>{const t=await p();return u(e,t)};exports.makeEnclaveHandshakeAndEncryptInput=x;exports.makeEnclaveHandshakeAndEncryptUint8Array=_;
|