@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
|
@@ -5,20 +5,19 @@ import { ExternalActionId } from '../../types/external-action.types';
|
|
|
5
5
|
import { type IMultiThreadedUtxoUtils } from '../../types/IMultiThreadedUtxoUtils';
|
|
6
6
|
import { RelayerTransaction } from '../../types/relayer.types';
|
|
7
7
|
import { SignatureData } from '../../types/crypto.types';
|
|
8
|
-
import { ERC20Token, TokenBalance, TokenChanges } from '../../types/token.types';
|
|
8
|
+
import { ERC20Token, PrivateRecipientInfo, TokenBalance, TokenChanges } from '../../types/token.types';
|
|
9
9
|
import { Bytes, ethers } from 'ethers';
|
|
10
10
|
import { type UserKeys } from '../crypto-keys/keys';
|
|
11
11
|
import { IProviderAdapter } from '../provider-adapter/IProviderAdapter';
|
|
12
|
-
import { ClientAccessTokenSnapshotService } from '../snapshot
|
|
13
|
-
import { ClientCommitmentsSnapshotService } from '../snapshot/ClientCommitmentsSnapshotService';
|
|
14
|
-
import { ClientNullifierSnapshotService } from '../snapshot/ClientNullifierSnapshotService';
|
|
15
|
-
import { ClientApprovalsSnapshotService } from '../snapshot/ClientApprovalsSnapshotService';
|
|
12
|
+
import { ClientAccessTokenSnapshotService, ClientApprovalsSnapshotService, ClientCommitmentsSnapshotService, ClientNullifierSnapshotService, ClientSolanaAccessTokenSnapshotService, ClientSolanaCommitmentsSnapshotService, ClientSolanaNullifierSnapshotService } from '../snapshot';
|
|
16
13
|
import { MerkleTree } from '../merkle-tree';
|
|
17
14
|
import { IAPI } from '../../API/API';
|
|
18
15
|
import { type ICacheDevice } from '../../types/ICacheDevice';
|
|
19
16
|
import type { StealthAddressStructure, TypedData } from '../../types/circom-data.types';
|
|
20
17
|
import { SubAccount } from '../../types/proxy.types';
|
|
21
|
-
import { AdminTransactionType } from '../../types';
|
|
18
|
+
import { AdminTransactionType } from '../../types/admin.types';
|
|
19
|
+
import { Idl, Program } from '@coral-xyz/anchor';
|
|
20
|
+
import { PublicKey } from '@solana/web3.js';
|
|
22
21
|
export interface IHinkal<ConnectorType = unknown> {
|
|
23
22
|
userKeys: UserKeys;
|
|
24
23
|
readonly signingMessage: string;
|
|
@@ -27,9 +26,9 @@ export interface IHinkal<ConnectorType = unknown> {
|
|
|
27
26
|
nullifiers: Set<string>;
|
|
28
27
|
encryptedOutputs: EncryptedOutputWithSign[];
|
|
29
28
|
approvals: Map<string, ApprovedUtxo[]>;
|
|
30
|
-
commitmentsSnapshotService?: ClientCommitmentsSnapshotService;
|
|
31
|
-
nullifierSnapshotService?: ClientNullifierSnapshotService;
|
|
32
|
-
accessTokenSnapshotService?: ClientAccessTokenSnapshotService;
|
|
29
|
+
commitmentsSnapshotService?: ClientCommitmentsSnapshotService | ClientSolanaCommitmentsSnapshotService;
|
|
30
|
+
nullifierSnapshotService?: ClientNullifierSnapshotService | ClientSolanaNullifierSnapshotService;
|
|
31
|
+
accessTokenSnapshotService?: ClientAccessTokenSnapshotService | ClientSolanaAccessTokenSnapshotService;
|
|
33
32
|
approvalsSnapshotService?: ClientApprovalsSnapshotService;
|
|
34
33
|
generateProofRemotely: boolean;
|
|
35
34
|
utxoUtils: IMultiThreadedUtxoUtils;
|
|
@@ -50,7 +49,7 @@ export interface IHinkal<ConnectorType = unknown> {
|
|
|
50
49
|
resetCache(): void;
|
|
51
50
|
snapshotsClearInterval(): void;
|
|
52
51
|
checkTokenRegistry(erc20Addresses: string[], amountChanges: bigint[]): Promise<boolean>;
|
|
53
|
-
getRecipientInfo(
|
|
52
|
+
getRecipientInfo(): string;
|
|
54
53
|
getInteractionApprovals(interactionAddress: string): Promise<ApprovedUtxo[]>;
|
|
55
54
|
getApprovedUtxos(resetCacheBefore?: boolean): ApprovedUtxoWithInteractionAddress[];
|
|
56
55
|
getApprovedUtxosForToken(erc20Address: string, resetCacheBefore?: boolean): ApprovedUtxoWithInteractionAddress[];
|
|
@@ -59,7 +58,13 @@ export interface IHinkal<ConnectorType = unknown> {
|
|
|
59
58
|
getBufferEntry(approveTo: string, tokenAddress: string, inHinkalAddress: bigint): Promise<bigint>;
|
|
60
59
|
deposit(erc20Tokens: ERC20Token[], amountChanges: bigint[]): Promise<ethers.ContractTransaction>;
|
|
61
60
|
depositForOther(erc20Tokens: ERC20Token[], amountChanges: bigint[], recepinetInfo: string): Promise<ethers.ContractTransaction>;
|
|
61
|
+
depositAndWithdraw(erc20Token: ERC20Token, recipientAmounts: Record<string, bigint>, txCompletionTime?: number, feeStructureOverride?: FeeStructure): Promise<string>;
|
|
62
62
|
prooflessDeposit(erc20Tokens: ERC20Token[], amountChanges: bigint[], stealthAddressStructures?: StealthAddressStructure[]): Promise<ethers.ContractTransaction>;
|
|
63
|
+
getSolanaProgram(idl: Idl): Program;
|
|
64
|
+
getSolanaPublicKey(): PublicKey;
|
|
65
|
+
depositSolana(amount: bigint, mintAddress: string): Promise<string>;
|
|
66
|
+
depositSolanaForOther(amount: bigint, mintAddress: string, recipientInfo: string): Promise<string>;
|
|
67
|
+
solanaDepositAndWithdraw(mintAddress: string, recipientAmounts: Record<string, bigint>, txCompletionTime?: number, feeStructureOverride?: FeeStructure): Promise<string>;
|
|
63
68
|
transfer(erc20Tokens: ERC20Token[], amountChanges: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
64
69
|
withdraw(erc20Tokens: ERC20Token[], deltaAmounts: bigint[], recipientAddress: string, isRelayerOff: boolean, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<ethers.ContractTransaction | RelayerTransaction | bigint>;
|
|
65
70
|
swap(erc20Tokens: ERC20Token[], deltaAmounts: bigint[], externalActionId: ExternalActionId, swapData: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean, withPrivateMempool?: boolean): Promise<RelayerTransaction | bigint>;
|
|
@@ -89,11 +94,13 @@ export interface IHinkal<ConnectorType = unknown> {
|
|
|
89
94
|
signTypedData(domain: ethers.TypedDataDomain, types: Record<string, ethers.TypedDataField[]>, value: Record<string, unknown>): Promise<string>;
|
|
90
95
|
signWithSubAccount(messageToSign: string | undefined, typedData: TypedData | undefined, subAccount: SubAccount): Promise<string>;
|
|
91
96
|
actionFundApproveAndTransact(tokenChanges: TokenChanges<bigint>[], subAccount: SubAccount, spenderAddress?: string, to?: string, callDataString?: string, value?: bigint, feeToken?: string, feeStructureOverride?: FeeStructure, autoDepositBack?: boolean, maxGasInDollar?: string, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
92
|
-
actionPrivateWallet(erc20Addresses: string[], deltaAmounts: bigint[], onChainCreation: boolean[], ops: string[], emporiumTokenChanges: TokenChanges<bigint>[], subAccount: SubAccount, feeToken?: string, feeStructureOverride?: FeeStructure, relayOverride?: string, autoDepositBack?: boolean, maxGasInDollar?: string, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
97
|
+
actionPrivateWallet(erc20Addresses: string[], deltaAmounts: bigint[], onChainCreation: boolean[], ops: string[], emporiumTokenChanges: TokenChanges<bigint>[], subAccount: SubAccount, feeToken?: string, feeStructureOverride?: FeeStructure, relayOverride?: string, autoDepositBack?: boolean, maxGasInDollar?: string, action?: AdminTransactionType, privateRecipientInfo?: PrivateRecipientInfo, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
93
98
|
actionReceive(erc20Tokens: ERC20Token[], deltaAmounts: bigint[], feeTokens?: string, feeStructureOverride?: FeeStructure, subAccount?: SubAccount, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
94
99
|
approve(erc20Addresses: string[], amount: bigint, approvedTo: string, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
95
100
|
hinkalInsideTransact(erc20Addresses: string[], deltaChanges: bigint[], approvalChanges: bigint[], externalAddress: string, externalActionMetadata: string, parsedInLogicMetadata: ParsedInLogicMetadata, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
96
101
|
proxySwap(erc20Tokens: ERC20Token[], deltaAmounts: bigint[], externalActionId: ExternalActionId, swapData: string, isTheSameChainSwap: boolean, subAccount: SubAccount, feeToken?: string, feeStructureOverride?: FeeStructure, autoDepositBack?: boolean, maxGasInDollar?: string, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
102
|
+
proxyToPrivate(erc20Tokens: ERC20Token[], deltaAmountsBase: bigint[], subAccount: SubAccount, recipientInfo: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
103
|
+
proxySend(erc20Tokens: ERC20Token[], amounts: bigint[], subAccount: SubAccount, recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
97
104
|
multiSendPrivateRecipients(erc20Tokens: ERC20Token[], amounts: bigint[], extendedRecipientInfos?: string[]): Promise<ethers.ContractTransaction>;
|
|
98
105
|
areMerkleTreeUpdatesDisabled(): boolean;
|
|
99
106
|
updateMerkleTreeUpdates(value: boolean): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../../API/API.cjs"),P=require("../../constants/chains.constants.cjs"),R=require("../../error-handling/get-error.message.cjs"),B=require("../../types/external-action.types.cjs"),p=require("../../types/transactions.types.cjs"),M=require("../../types/sandbox.types.cjs"),w=require("../../functions/private-wallet/emporium.helpers.cjs");require("ethers");require("../../constants/addresses.constants.cjs");require("../../constants/token-data/index.cjs");const H=require("../../functions/utils/caseInsensitive.utils.cjs"),L=require("../../error-handling/logger.cjs");require("idb-keyval");const N=require("../../functions/utils/create-provider.cjs"),k=require("../../functions/utils/erc20tokenFunctions.cjs");require("../../functions/utils/convertIntegrationProviderToExternalActionId.cjs");require("../../types/circom-data.types.cjs");require("../../types/activities.types.cjs");const n=require("../../types/offscreen.types.cjs");require("circomlibjs-hinkal-fork");const U=require("../../functions/web3/etherFunctions.cjs");require("../crypto-keys/keys.cjs");const D=require("../../error-handling/error-codes.constants.cjs");require("../../constants/server.constants.cjs");require("../../constants/vite.constants.cjs");require("../http/HttpClient.cjs");require("axios");const V=require("../../functions/pre-transaction/getVolatileTransferAmount.cjs");require("@solana/web3.js");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/reorg-depths.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 j=require("../../functions/utils/convertEmporiumOpToCallInfo.cjs");require("libsodium-wrappers");const J=require("../../functions/utils/publicBalance.utils.cjs");require("../../functions/utils/mutexes.utils.cjs");require("../../API/getServerURL.cjs");require("process");require("buffer");require("../../constants/save-depths.cjs");require("../../API/tenderly.api.cjs");const i=require("../../functions/utils/postToOffscreen.cjs");require("node-forge");require("../../functions/web3/events/getApprovedBalance.cjs");require("../../functions/web3/getTokenHolder.cjs");const X=require("../../functions/pre-transaction/getFeeStructure.cjs"),$=async(t,o,h,g,d,E,u)=>{if(o)try{const r=t.getCurrentChainId(),s=E.filter(e=>!H.caseInsensitiveEqual(e.token.erc20TokenAddress,g)&&!k.isNFTToken(e.token)).map(e=>e.token);if(!s.length)return;const{fetchRpcUrl:T}=P.networkRegistry[r];if(!T)throw new Error(`No RPC URL configured for chain ${r}`);const A=N.createCustomRpcProvider(T),m=await Promise.all(s.map(async e=>{const y=await J.getPublicBalance(A,o,e);return BigInt(y?.balance||0)})),S=s.map(({erc20TokenAddress:e})=>e),I=await V.modifyVolatileTokenAmountChanges(r,s,m,o),O=w.createTransaferEmporiumOpsBatch(t,S,I),c=await X.getFeeStructure(r,g,S,B.ExternalActionId.Emporium,O.map(e=>j.convertEmporiumOpToCallInfo(e,o,r))),a=k.getERC20Token(c.feeToken,r);if(!a)return;const C=U.getAmountInToken(a,c.flatFee),{prices:F}=await b.API.getTokenPrices(r,[a.erc20TokenAddress]),_=F[0]*Number(C);if(d&&+d<_){i.postToOffscreen(n.MessagesFromOffscreen.AutoShieldTxStatus,{message:D.gasErrorCodes.GAS_PRICE_EXCEEDS_AUTOSHIELD_LIMIT});return}i.postToOffscreen(n.MessagesFromOffscreen.AutoShieldTxStatus,{status:p.TransactionStatus.Loading});const q=u.outCommitments?.flat(),f=u.encryptedOutputs?.flat(),l=u.inputNullifiers?.flat(),v=t.merkleTreeHinkal.getStartIndex(),x=BigInt(t.merkleTreeHinkal.toJSON().count);(q.length!==0||f.length!==0||l.length!==0)&&(q.length!==0&&q.forEach(e=>{e==="0"||e==="0x"||t.merkleTreeHinkal.insert(BigInt(e),v+x)}),f.length!==0&&f.forEach(e=>{e==="0"||e==="0x"||t.encryptedOutputs.push({value:e,isPositive:!0,isBlocked:!1})}),l.length!==0&&l.forEach(e=>{e==="0"||e==="0x"||t.nullifiers.add(e)}),t.updateMerkleTreeUpdates(!1)),await t.actionReceive(s,m,c?.feeToken,void 0,h),i.postToOffscreen(n.MessagesFromOffscreen.AutoShieldTxStatus,{status:p.TransactionStatus.Confirmed})}catch(r){i.postToOffscreen(n.MessagesFromOffscreen.AutoShieldTxStatus,{status:p.TransactionStatus.Failed,error:R.getErrorMessageFromSandboxRequest(r,M.SandboxRequestType.ReceiveFromShieldedAccount)}),L.Logger.error("Error in auto deposit back:",r)}};exports.handleAutoDepositBack=$;
|
|
@@ -1,44 +1,47 @@
|
|
|
1
|
-
import { API as
|
|
1
|
+
import { API as P } from "../../API/API.mjs";
|
|
2
2
|
import { networkRegistry as b } from "../../constants/chains.constants.mjs";
|
|
3
3
|
import { getErrorMessageFromSandboxRequest as y } from "../../error-handling/get-error.message.mjs";
|
|
4
|
-
import { ExternalActionId as
|
|
4
|
+
import { ExternalActionId as w } from "../../types/external-action.types.mjs";
|
|
5
5
|
import { TransactionStatus as l } from "../../types/transactions.types.mjs";
|
|
6
|
-
import { SandboxRequestType as
|
|
7
|
-
import { createTransaferEmporiumOpsBatch as
|
|
6
|
+
import { SandboxRequestType as H } from "../../types/sandbox.types.mjs";
|
|
7
|
+
import { createTransaferEmporiumOpsBatch as L } from "../../functions/private-wallet/emporium.helpers.mjs";
|
|
8
8
|
import "ethers";
|
|
9
9
|
import "../../constants/addresses.constants.mjs";
|
|
10
10
|
import "../../constants/token-data/index.mjs";
|
|
11
|
-
import { caseInsensitiveEqual as
|
|
12
|
-
import { Logger as
|
|
11
|
+
import { caseInsensitiveEqual as M } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
12
|
+
import { Logger as N } from "../../error-handling/logger.mjs";
|
|
13
13
|
import "idb-keyval";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { createCustomRpcProvider as U } from "../../functions/utils/create-provider.mjs";
|
|
15
|
+
import { isNFTToken as _, getERC20Token as q } from "../../functions/utils/erc20tokenFunctions.mjs";
|
|
16
16
|
import "../../functions/utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
17
17
|
import "../../types/circom-data.types.mjs";
|
|
18
18
|
import "../../types/activities.types.mjs";
|
|
19
19
|
import { MessagesFromOffscreen as m } from "../../types/offscreen.types.mjs";
|
|
20
20
|
import "circomlibjs-hinkal-fork";
|
|
21
|
-
import { getAmountInToken as
|
|
21
|
+
import { getAmountInToken as D } from "../../functions/web3/etherFunctions.mjs";
|
|
22
22
|
import "../crypto-keys/keys.mjs";
|
|
23
|
-
import { gasErrorCodes as
|
|
23
|
+
import { gasErrorCodes as J } from "../../error-handling/error-codes.constants.mjs";
|
|
24
24
|
import "../../constants/server.constants.mjs";
|
|
25
25
|
import "../../constants/vite.constants.mjs";
|
|
26
|
+
import "../http/HttpClient.mjs";
|
|
26
27
|
import "axios";
|
|
27
|
-
import { modifyVolatileTokenAmountChanges as
|
|
28
|
+
import { modifyVolatileTokenAmountChanges as V } from "../../functions/pre-transaction/getVolatileTransferAmount.mjs";
|
|
29
|
+
import "@solana/web3.js";
|
|
30
|
+
import "@coral-xyz/anchor";
|
|
31
|
+
import "@solana/spl-token";
|
|
28
32
|
import "../../constants/contracts.constants.mjs";
|
|
29
33
|
import "../../constants/kyc.constants.mjs";
|
|
30
34
|
import "../../constants/coingecko.constants.mjs";
|
|
31
35
|
import "../../constants/reorg-depths.constants.mjs";
|
|
32
36
|
import "../../constants/token.limits.constants.mjs";
|
|
33
37
|
import "../../constants/presale.constants.mjs";
|
|
34
|
-
import "../../constants/mystery-boxes.constants.mjs";
|
|
35
38
|
import "../../constants/activity.constants.mjs";
|
|
36
39
|
import "../../constants/tasks.constants.mjs";
|
|
37
40
|
import "../../constants/events.constants.mjs";
|
|
38
41
|
import "../../functions/utils/userAgent.mjs";
|
|
39
|
-
import { convertEmporiumOpToCallInfo as
|
|
42
|
+
import { convertEmporiumOpToCallInfo as X } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
40
43
|
import "libsodium-wrappers";
|
|
41
|
-
import { getPublicBalance as
|
|
44
|
+
import { getPublicBalance as $ } from "../../functions/utils/publicBalance.utils.mjs";
|
|
42
45
|
import "../../functions/utils/mutexes.utils.mjs";
|
|
43
46
|
import "../../API/getServerURL.mjs";
|
|
44
47
|
import "process";
|
|
@@ -49,11 +52,11 @@ import { postToOffscreen as n } from "../../functions/utils/postToOffscreen.mjs"
|
|
|
49
52
|
import "node-forge";
|
|
50
53
|
import "../../functions/web3/events/getApprovedBalance.mjs";
|
|
51
54
|
import "../../functions/web3/getTokenHolder.mjs";
|
|
52
|
-
import { getFeeStructure as
|
|
53
|
-
const
|
|
55
|
+
import { getFeeStructure as j } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
56
|
+
const Kt = async (o, i, E, d, g, h, s) => {
|
|
54
57
|
if (i)
|
|
55
58
|
try {
|
|
56
|
-
const r = o.getCurrentChainId(), e = h.filter((t) => !
|
|
59
|
+
const r = o.getCurrentChainId(), e = h.filter((t) => !M(t.token.erc20TokenAddress, d) && !_(t.token)).map((t) => t.token);
|
|
57
60
|
if (!e.length)
|
|
58
61
|
return;
|
|
59
62
|
const { fetchRpcUrl: T } = b[r];
|
|
@@ -61,33 +64,34 @@ const $t = async (o, i, E, d, g, h, s) => {
|
|
|
61
64
|
throw new Error(`No RPC URL configured for chain ${r}`);
|
|
62
65
|
const I = U(T), k = await Promise.all(
|
|
63
66
|
e.map(async (t) => {
|
|
64
|
-
const
|
|
65
|
-
return BigInt(
|
|
67
|
+
const O = await $(I, i, t);
|
|
68
|
+
return BigInt(O?.balance || 0);
|
|
66
69
|
})
|
|
67
|
-
), S = e.map(({ erc20TokenAddress: t }) => t), A = await
|
|
70
|
+
), S = e.map(({ erc20TokenAddress: t }) => t), A = await V(r, e, k, i), C = L(o, S, A), p = await j(
|
|
68
71
|
r,
|
|
69
72
|
d,
|
|
70
73
|
S,
|
|
71
|
-
|
|
72
|
-
C.map((t) =>
|
|
73
|
-
), a =
|
|
74
|
+
w.Emporium,
|
|
75
|
+
C.map((t) => X(t, i, r))
|
|
76
|
+
), a = q(p.feeToken, r);
|
|
74
77
|
if (!a)
|
|
75
78
|
return;
|
|
76
|
-
const x =
|
|
77
|
-
if (g && +g <
|
|
79
|
+
const x = D(a, p.flatFee), { prices: R } = await P.getTokenPrices(r, [a.erc20TokenAddress]), v = R[0] * Number(x);
|
|
80
|
+
if (g && +g < v) {
|
|
78
81
|
n(m.AutoShieldTxStatus, {
|
|
79
|
-
message:
|
|
82
|
+
message: J.GAS_PRICE_EXCEEDS_AUTOSHIELD_LIMIT
|
|
80
83
|
});
|
|
81
84
|
return;
|
|
82
85
|
}
|
|
83
86
|
n(m.AutoShieldTxStatus, { status: l.Loading });
|
|
84
|
-
const c = s.outCommitments?.flat(), f = s.encryptedOutputs?.flat(), u = s.inputNullifiers?.flat(),
|
|
87
|
+
const c = s.outCommitments?.flat(), f = s.encryptedOutputs?.flat(), u = s.inputNullifiers?.flat(), F = o.merkleTreeHinkal.getStartIndex(), B = BigInt(o.merkleTreeHinkal.toJSON().count);
|
|
85
88
|
(c.length !== 0 || f.length !== 0 || u.length !== 0) && (c.length !== 0 && c.forEach((t) => {
|
|
86
|
-
t === "0" || t === "0x" || o.merkleTreeHinkal.insert(BigInt(t),
|
|
89
|
+
t === "0" || t === "0x" || o.merkleTreeHinkal.insert(BigInt(t), F + B);
|
|
87
90
|
}), f.length !== 0 && f.forEach((t) => {
|
|
88
91
|
t === "0" || t === "0x" || o.encryptedOutputs.push({
|
|
89
92
|
value: t,
|
|
90
|
-
isPositive: !0
|
|
93
|
+
isPositive: !0,
|
|
94
|
+
isBlocked: !1
|
|
91
95
|
});
|
|
92
96
|
}), u.length !== 0 && u.forEach((t) => {
|
|
93
97
|
t === "0" || t === "0x" || o.nullifiers.add(t);
|
|
@@ -95,10 +99,10 @@ const $t = async (o, i, E, d, g, h, s) => {
|
|
|
95
99
|
} catch (r) {
|
|
96
100
|
n(m.AutoShieldTxStatus, {
|
|
97
101
|
status: l.Failed,
|
|
98
|
-
error: y(r,
|
|
99
|
-
}),
|
|
102
|
+
error: y(r, H.ReceiveFromShieldedAccount)
|
|
103
|
+
}), N.error("Error in auto deposit back:", r);
|
|
100
104
|
}
|
|
101
105
|
};
|
|
102
106
|
export {
|
|
103
|
-
|
|
107
|
+
Kt as handleAutoDepositBack
|
|
104
108
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../../functions/utils/walletBalances.utils.cjs"),w=require("../../functions/private-wallet/emporium.helpers.cjs"),K=require("../crypto-keys/keys.cjs"),O=async(e,t,r,a,d,i,p,c,u,A,l,m,v)=>{const T=e.getCurrentChainId(),y=K.UserKeys.getSignerAddressFromPrivateKey(T,r.privateKey),{fundAmounts:o,tokensToFund:F,approveTokenAddresses:g,approvedTokenAmounts:f}=await q.getNecessaryAssetsForFunding(e,r,t),s=F.map(n=>n.erc20TokenAddress),k=w.generateFundApproveAndTransactOps(e,s,o,g,f,y,a,d,i,p);return e.actionPrivateWallet(s,o.map(n=>-1n*n),s.map(()=>!1),k,t,r,c,u,void 0,A,l,m,void 0,v)};exports.hinkalActionFundApproveAndTransact=O;
|
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import { getNecessaryAssetsForFunding as
|
|
2
|
-
import { generateFundApproveAndTransactOps as
|
|
3
|
-
import { UserKeys as
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
e,
|
|
7
|
-
t,
|
|
8
|
-
o
|
|
9
|
-
), r = f.map((s) => s.erc20TokenAddress), l = k(
|
|
1
|
+
import { getNecessaryAssetsForFunding as w } from "../../functions/utils/walletBalances.utils.mjs";
|
|
2
|
+
import { generateFundApproveAndTransactOps as I } from "../../functions/private-wallet/emporium.helpers.mjs";
|
|
3
|
+
import { UserKeys as O } from "../crypto-keys/keys.mjs";
|
|
4
|
+
const C = async (e, n, r, d, a, p, i, m, c, A, v, u, F) => {
|
|
5
|
+
const T = e.getCurrentChainId(), f = O.getSignerAddressFromPrivateKey(T, r.privateKey), { fundAmounts: t, tokensToFund: g, approveTokenAddresses: y, approvedTokenAmounts: l } = await w(
|
|
10
6
|
e,
|
|
11
7
|
r,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
n
|
|
9
|
+
), s = g.map((o) => o.erc20TokenAddress), K = I(
|
|
10
|
+
e,
|
|
11
|
+
s,
|
|
15
12
|
t,
|
|
13
|
+
y,
|
|
14
|
+
l,
|
|
15
|
+
f,
|
|
16
|
+
d,
|
|
16
17
|
a,
|
|
17
18
|
p,
|
|
18
|
-
m,
|
|
19
19
|
i
|
|
20
20
|
);
|
|
21
21
|
return e.actionPrivateWallet(
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
s,
|
|
23
|
+
t.map((o) => -1n * o),
|
|
24
24
|
// deltaAmounts
|
|
25
|
-
|
|
25
|
+
s.map(() => !1),
|
|
26
26
|
// onChainCreation
|
|
27
|
-
|
|
28
|
-
o,
|
|
27
|
+
K,
|
|
29
28
|
n,
|
|
30
|
-
|
|
29
|
+
r,
|
|
30
|
+
m,
|
|
31
31
|
c,
|
|
32
32
|
void 0,
|
|
33
|
-
|
|
33
|
+
A,
|
|
34
34
|
v,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
u,
|
|
36
|
+
void 0,
|
|
37
|
+
F
|
|
37
38
|
);
|
|
38
39
|
};
|
|
39
40
|
export {
|
|
40
|
-
|
|
41
|
+
C as hinkalActionFundApproveAndTransact
|
|
41
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../functions/private-wallet/emporium.helpers.cjs"),g=require("../../functions/pre-transaction/getFeeStructure.cjs"),y=require("../../functions/utils/convertEmporiumOpToCallInfo.cjs"),q=require("../../types/external-action.types.cjs"),E=require("../../functions/pre-transaction/getVolatileTransferAmount.cjs"),w=require("../crypto-keys/keys.cjs"),C=async(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../functions/private-wallet/emporium.helpers.cjs"),g=require("../../functions/pre-transaction/getFeeStructure.cjs"),y=require("../../functions/utils/convertEmporiumOpToCallInfo.cjs"),q=require("../../types/external-action.types.cjs"),E=require("../../functions/pre-transaction/getVolatileTransferAmount.cjs"),w=require("../crypto-keys/keys.cjs"),C=async(o,i,l,n,d,s,m,p=!1)=>{if(!s)throw Error("hinkalActionReceive: subAccount should be provided");if(!n)throw new Error("Fee token is required in hinkalActionReceive");const r=o.getCurrentChainId(),c=w.UserKeys.getSignerAddressFromPrivateKey(r,s.privateKey),a=i.map(e=>e.erc20TokenAddress),t=await E.modifyVolatileTokenAmountChanges(r,i,l,c),u=f.createTransaferEmporiumOpsBatch(o,a,t),v=d??await g.getFeeStructure(r,n,a,q.ExternalActionId.Emporium,u.map(e=>y.convertEmporiumOpToCallInfo(e,c,r))),A=i.map((e,h)=>({token:e,amount:-1n*t[h]}));return o.actionPrivateWallet(a,t,t.map(()=>!1),u,A,s,n,v,void 0,void 0,void 0,m,void 0,p)};exports.hinkalActionReceive=C;
|
|
@@ -4,34 +4,35 @@ import { convertEmporiumOpToCallInfo as w } from "../../functions/utils/convertE
|
|
|
4
4
|
import { ExternalActionId as E } from "../../types/external-action.types.mjs";
|
|
5
5
|
import { modifyVolatileTokenAmountChanges as y } from "../../functions/pre-transaction/getVolatileTransferAmount.mjs";
|
|
6
6
|
import { UserKeys as C } from "../crypto-keys/keys.mjs";
|
|
7
|
-
const x = async (t,
|
|
8
|
-
if (!
|
|
7
|
+
const x = async (t, i, d, a, p, n, l, f = !1) => {
|
|
8
|
+
if (!n)
|
|
9
9
|
throw Error("hinkalActionReceive: subAccount should be provided");
|
|
10
|
-
if (!
|
|
10
|
+
if (!a)
|
|
11
11
|
throw new Error("Fee token is required in hinkalActionReceive");
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const e = t.getCurrentChainId(), s = C.getSignerAddressFromPrivateKey(e, n.privateKey), m = i.map((r) => r.erc20TokenAddress), o = await y(e, i, d, s), c = A(t, m, o), u = p ?? await g(
|
|
13
|
+
e,
|
|
14
|
+
a,
|
|
15
15
|
m,
|
|
16
16
|
E.Emporium,
|
|
17
|
-
c.map((r) => w(r, s,
|
|
18
|
-
), v =
|
|
17
|
+
c.map((r) => w(r, s, e))
|
|
18
|
+
), v = i.map((r, h) => ({
|
|
19
19
|
token: r,
|
|
20
|
-
amount: -1n *
|
|
20
|
+
amount: -1n * o[h]
|
|
21
21
|
}));
|
|
22
22
|
return t.actionPrivateWallet(
|
|
23
23
|
m,
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
o,
|
|
25
|
+
o.map(() => !1),
|
|
26
26
|
c,
|
|
27
27
|
v,
|
|
28
|
+
n,
|
|
28
29
|
a,
|
|
29
|
-
i,
|
|
30
30
|
u,
|
|
31
31
|
void 0,
|
|
32
32
|
void 0,
|
|
33
33
|
void 0,
|
|
34
34
|
l,
|
|
35
|
+
void 0,
|
|
35
36
|
f
|
|
36
37
|
);
|
|
37
38
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../functions/pre-transaction/solana.cjs"),r=require("@solana/web3.js"),s=require("../../functions/utils/amounts.utils.cjs"),g=async(n,c,o,a)=>{for(let t=0;t<o.length;t+=1){const e=u.getTokenLimitStorageAccountPublicKey(n.programId,c,new r.PublicKey(o[t]));if(!await n.provider.connection.getAccountInfo(e,"confirmed"))continue;const i=BigInt((await n.account.tokenLimitStorageAccount.fetch(e,"confirmed")).amountLimit.toString());if(i===0n)continue;if(s.absBigInt(a[t])>i)return!0}return!1};exports.hinkalCheckSolanaTokenRegistry=g;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getTokenLimitStorageAccountPublicKey as a } from "../../functions/pre-transaction/solana.mjs";
|
|
2
|
+
import { PublicKey as u } from "@solana/web3.js";
|
|
3
|
+
import { absBigInt as m } from "../../functions/utils/amounts.utils.mjs";
|
|
4
|
+
const S = async (o, c, n, r) => {
|
|
5
|
+
for (let t = 0; t < n.length; t += 1) {
|
|
6
|
+
const i = a(
|
|
7
|
+
o.programId,
|
|
8
|
+
c,
|
|
9
|
+
new u(n[t])
|
|
10
|
+
);
|
|
11
|
+
if (!await o.provider.connection.getAccountInfo(
|
|
12
|
+
i,
|
|
13
|
+
"confirmed"
|
|
14
|
+
))
|
|
15
|
+
continue;
|
|
16
|
+
const e = BigInt(
|
|
17
|
+
(await o.account.tokenLimitStorageAccount.fetch(i, "confirmed")).amountLimit.toString()
|
|
18
|
+
);
|
|
19
|
+
if (e === 0n)
|
|
20
|
+
continue;
|
|
21
|
+
if (m(r[t]) > e)
|
|
22
|
+
return !0;
|
|
23
|
+
}
|
|
24
|
+
return !1;
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
S as hinkalCheckSolanaTokenRegistry
|
|
28
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("ethers");require("idb-keyval");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("ethers");require("idb-keyval");const u=require("../../constants/chains.constants.cjs"),q=require("../../functions/utils/create-provider.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("../http/HttpClient.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/web3.js");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");require("multiformats");require("../../API/tenderly.api.cjs");const o=async(r,e,i)=>await r.checkTokenRegistry(e,i),a=r=>{const e=u.networkRegistry[r].contractData,{fetchRpcUrl:i}=u.networkRegistry[r];if(!i)throw new Error("RPC URL not found for the specified chain ID");const t=q.createCustomRpcProvider(i);if(!e.hinkalHelperAddress||!e.hinkalHelperABI)throw Error("hinkal helpercontract data not found");return new n.ethers.Contract(e.hinkalHelperAddress,e.hinkalHelperABI,t)};exports.createHinkalHelperFromData=a;exports.hinkalCheckTokenRegistry=o;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ethers as m } from "ethers";
|
|
2
2
|
import "idb-keyval";
|
|
3
|
-
import {
|
|
3
|
+
import { networkRegistry as p } from "../../constants/chains.constants.mjs";
|
|
4
|
+
import { createCustomRpcProvider as e } from "../../functions/utils/create-provider.mjs";
|
|
4
5
|
import "../../constants/token-data/index.mjs";
|
|
5
6
|
import "../../error-handling/error-codes.constants.mjs";
|
|
6
|
-
import { networkRegistry as p } from "../../constants/chains.constants.mjs";
|
|
7
7
|
import "../../functions/utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
8
8
|
import "../../types/circom-data.types.mjs";
|
|
9
9
|
import "../../types/transactions.types.mjs";
|
|
@@ -12,28 +12,31 @@ import "circomlibjs-hinkal-fork";
|
|
|
12
12
|
import "../crypto-keys/keys.mjs";
|
|
13
13
|
import "../../constants/server.constants.mjs";
|
|
14
14
|
import "../../constants/vite.constants.mjs";
|
|
15
|
+
import "../http/HttpClient.mjs";
|
|
15
16
|
import "axios";
|
|
16
17
|
import "../../API/getServerURL.mjs";
|
|
17
|
-
import "../../constants/reorg-depths.constants.mjs";
|
|
18
|
-
import "../../functions/utils/mutexes.utils.mjs";
|
|
19
18
|
import "libsodium-wrappers";
|
|
20
19
|
import "process";
|
|
21
20
|
import "buffer";
|
|
22
21
|
import "../../constants/save-depths.mjs";
|
|
22
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
23
|
+
import "../../functions/utils/mutexes.utils.mjs";
|
|
24
|
+
import "@coral-xyz/anchor";
|
|
25
|
+
import "@solana/web3.js";
|
|
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";
|
|
33
36
|
import "../../functions/utils/userAgent.mjs";
|
|
34
37
|
import "multiformats";
|
|
35
38
|
import "../../API/tenderly.api.mjs";
|
|
36
|
-
const
|
|
39
|
+
const Q = async (t, r, o) => await t.checkTokenRegistry(r, o), S = (t) => {
|
|
37
40
|
const r = p[t].contractData, { fetchRpcUrl: o } = p[t];
|
|
38
41
|
if (!o)
|
|
39
42
|
throw new Error("RPC URL not found for the specified chain ID");
|
|
@@ -43,6 +46,6 @@ const M = async (t, r, o) => await t.checkTokenRegistry(r, o), N = (t) => {
|
|
|
43
46
|
return new m.Contract(r.hinkalHelperAddress, r.hinkalHelperABI, i);
|
|
44
47
|
};
|
|
45
48
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
S as createHinkalHelperFromData,
|
|
50
|
+
Q as hinkalCheckTokenRegistry
|
|
48
51
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("ethers"),I=require("../../constants/protocol.constants.cjs"),W=require("../../error-handling/error-codes.constants.cjs"),z=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),M=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),j=require("../../functions/web3/events/getShieldedBalance.cjs"),B=require("../../functions/web3/functionCalls/transactCallDirect.cjs"),N=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),b=require("../../types/external-action.types.cjs"),Z=require("../utxo/Utxo.cjs");require("../../types/circom-data.types.cjs");const f=require("../../types/ethereum-network.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");const O=require("../../functions/pre-transaction/getSignatureDataForTransact.cjs"),F=require("../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs"),$=require("../../functions/utils/time.utils.cjs"),L=require("../../functions/utils/getUtxosFromReceipt.utils.cjs"),G=require("../../functions/pre-transaction/getFeeStructure.cjs"),V=require("../../functions/utils/fees.utils.cjs"),X=async(e,o,u,l)=>{const c=o.erc20TokenAddress,s={};Object.entries(u).forEach(([t,r])=>{s[t]=r+V.calculateTotalFee(r,l)});const a=Object.values(s),n=[c],p=[0n],q=[!0],{patchAccessTokenMerkleTree:x,kycRequired:C,hasAccessToken:k}=await F.shouldPatchAccessTokenMerkleTree(e,n,p),i=await O.getSignatureDataForTransact(e.getCurrentChainId(),await e.getEthereumAddress(),e.userKeys,C,k),d=[...await j.addPaddingToUtxos(e,n,p)],h=[];for(let t=0;t<d.length;t+=1){const{outputUtxos:r}=z.outputUtxoProcessing(e.userKeys,d[t],p[t]);h.push(r)}const v=a.reduce((t,r)=>t+r,0n),m=_.ethers.utils.defaultAbiCoder.encode(["uint256[]"],[a]),T=e.getContractWithSigner(f.ContractType.HinkalWrapper),w=e.getContractWithSigner(f.ContractType.DepositOnChainUtxos),{zkCallData:y,circomData:S,dimData:P}=await M.constructZkProof("v1x1",e.merkleTreeHinkal,e.merkleTreeAccessToken,d,h,e.userKeys,`swapperM1x${d[0].length}x1`,b.ExternalActionId.DepositOnChainUtxos,w.address,m,e.generateProofRemotely,I.zeroAddress,e.getCurrentChainId(),q,void 0,void 0,void 0,x,void 0,void 0,void 0,e.getContractWithFetcher(f.ContractType.HinkalHelperContract),i,T.address),E=await(await B.transactCallDirect(e,v,o,y,S,P,w,T)).wait(),R=L.getUtxosFromReceipt(E,e,c),U=new Map,A=[...R];return Object.entries(s).forEach(([t,r])=>{const g=A.find(K=>K.amount===r);if(!g)throw new Error(`Could not find newly created UTXO with amount ${r} for recipient ${t}.`);U.set(t,g);const H=A.indexOf(g);A.splice(H,1)}),U},Y=async(e,o,u,l,c)=>{const s=Array.from(u.entries());if(s.length===0)throw new Error("userDepositedUtxos must not be empty");const a=o.erc20TokenAddress,n=await e.getRandomRelay();if(!n)throw Error(W.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const p=await e.getEthereumAddress(),q=$.getCurrentTimeInSeconds().toString(),x=e.generateProofRemotely?5:1,C=[];for(let i=0;i<s.length;i+=x){const d=s.slice(i,i+x),h=await Promise.all(d.map(async([v,m])=>{const T=[-m.amount],w=new Z.Utxo({amount:0n,erc20TokenAddress:a,shieldedPrivateKey:e.userKeys.getShieldedPrivateKey(),timeStamp:q,tokenId:0}),y=[[m,w]],S=[[w]],P=`swapperM1x${y[0].length}x1`,D={externalActionId:0n,externalAddress:v,externalActionMetadata:"0x00"},{patchAccessTokenMerkleTree:E,kycRequired:R,hasAccessToken:U}=await F.shouldPatchAccessTokenMerkleTree(e,[a],T),A=await O.getSignatureDataForTransact(e.getCurrentChainId(),p,e.userKeys,R,U),{zkCallData:t,circomData:r,dimData:g}=await M.constructZkProof("v1x1",e.merkleTreeHinkal,e.merkleTreeAccessToken,y,S,e.userKeys,P,D.externalActionId,D.externalAddress,D.externalActionMetadata,e.generateProofRemotely,n??I.zeroAddress,e.getCurrentChainId(),void 0,void 0,void 0,void 0,E,void 0,void 0,l,e.getContractWithFetcher(f.ContractType.HinkalHelperContract),A);return{zkCallData:t,dimData:g,circomData:r}}));C.push(...h)}return await N.transactCallRelayerBatch(e.getCurrentChainId(),C,c)},J=async(e,o,u,l,c)=>{const s=o.erc20TokenAddress,a=c??await G.getFeeStructure(e.getCurrentChainId(),s,[s],b.ExternalActionId.Transact,[],0n),n=await X(e,o,u,a);return await e.getEventsFromHinkal(),await e.resetMerkleTreesIfNecessary(),Y(e,o,n,a,l)};exports.hinkalDepositAndWithdraw=J;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IHinkal } from './IHinkal';
|
|
2
|
+
import { ERC20Token } from '../../types';
|
|
3
|
+
import { FeeStructure } from '../../types/hinkal.types';
|
|
4
|
+
export declare const hinkalDepositAndWithdraw: (hinkal: IHinkal, erc20Token: ERC20Token, recipientAmounts: Record<string, bigint>, txCompletionTime?: number, feeStructureOverride?: FeeStructure) => Promise<string>;
|