@sabaaa1/common 0.1.6 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API/API.cjs +1 -1
- package/API/API.d.ts +16 -12
- package/API/API.mjs +73 -69
- package/API/accessCodeCalls.cjs +1 -0
- package/API/accessCodeCalls.d.ts +23 -0
- package/API/accessCodeCalls.mjs +23 -0
- package/API/admin-calls.cjs +1 -1
- package/API/admin-calls.mjs +5 -7
- package/API/ai-calls.cjs +1 -1
- package/API/ai-calls.mjs +11 -10
- package/API/brotherhoodCalls.cjs +1 -1
- package/API/brotherhoodCalls.mjs +43 -69
- package/API/callLifiAPI.cjs +1 -1
- package/API/callLifiAPI.mjs +8 -7
- package/API/callOdosAPI.cjs +1 -1
- package/API/callOdosAPI.mjs +16 -16
- package/API/callOkxAPI.cjs +1 -0
- package/API/callOkxAPI.d.ts +10 -0
- package/API/callOkxAPI.mjs +13 -0
- package/API/callOneInchAPI.cjs +1 -1
- package/API/callOneInchAPI.mjs +8 -7
- package/API/callRelayer.cjs +1 -1
- package/API/callRelayer.d.ts +11 -0
- package/API/callRelayer.mjs +15 -7
- package/API/checkRisk.cjs +1 -1
- package/API/checkRisk.mjs +5 -4
- package/API/duneAPI.cjs +1 -1
- package/API/duneAPI.mjs +2 -3
- package/API/enclaveCalls.cjs +1 -1
- package/API/enclaveCalls.mjs +9 -11
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.d.ts +2 -2
- package/API/fetchCommitmentsCache.mjs +13 -10
- package/API/generate-trading-points.cjs +1 -1
- package/API/generate-trading-points.mjs +34 -39
- package/API/get-token-data.cjs +1 -1
- package/API/get-token-data.mjs +5 -4
- package/API/getBridgeProtocols.cjs +1 -1
- package/API/getBridgeProtocols.mjs +4 -3
- package/API/getGasEstimates.cjs +1 -1
- package/API/getGasEstimates.d.ts +2 -1
- package/API/getGasEstimates.mjs +14 -16
- package/API/getLifiStatus.cjs +1 -1
- package/API/getLifiStatus.mjs +11 -10
- package/API/getRelayerURL.cjs +1 -1
- package/API/getRelayerURL.mjs +4 -4
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.mjs +42 -36
- package/API/getTokenPrice.cjs +1 -1
- package/API/getTokenPrice.d.ts +0 -11
- package/API/getTokenPrice.mjs +8 -23
- package/API/getWebsiteURL.cjs +1 -1
- package/API/getWebsiteURL.d.ts +1 -1
- package/API/getWebsiteURL.mjs +6 -7
- package/API/index.d.ts +2 -1
- package/API/is-tx-stateless.cjs +1 -1
- package/API/is-tx-stateless.mjs +17 -22
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +2 -2
- package/API/kycCalls.mjs +31 -30
- package/API/leaderboardCalls.cjs +1 -1
- package/API/leaderboardCalls.mjs +11 -16
- package/API/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.mjs +19 -18
- package/API/referralsCalls.cjs +1 -1
- package/API/referralsCalls.mjs +16 -24
- package/API/relayCalls.cjs +1 -1
- package/API/relayCalls.mjs +6 -8
- package/API/resolve-sns.cjs +1 -0
- package/API/resolve-sns.d.ts +1 -0
- package/API/resolve-sns.mjs +12 -0
- package/API/restoreSnapshots.cjs +1 -1
- package/API/restoreSnapshots.mjs +5 -5
- package/API/rewardsUserCalls.cjs +1 -1
- package/API/rewardsUserCalls.mjs +37 -54
- package/API/seedless-calls.cjs +1 -0
- package/API/seedless-calls.d.ts +53 -0
- package/API/seedless-calls.mjs +12 -0
- package/API/send-telegram-callback.cjs +1 -1
- package/API/send-telegram-callback.mjs +9 -11
- package/API/simulate-batch-tx.cjs +1 -1
- package/API/simulate-batch-tx.mjs +11 -13
- package/API/solana-calls.cjs +1 -0
- package/API/solana-calls.d.ts +34 -0
- package/API/solana-calls.mjs +19 -0
- package/API/tenderly.api.cjs +1 -1
- package/API/tenderly.api.mjs +48 -59
- package/API/token-calls.cjs +1 -1
- package/API/token-calls.mjs +11 -13
- package/API/weeklyAnalyticCalls.cjs +1 -1
- package/API/weeklyAnalyticCalls.mjs +9 -14
- package/README.md +164 -0
- package/_virtual/_commonjsHelpers.cjs +1 -0
- package/_virtual/_commonjsHelpers.mjs +30 -0
- package/_virtual/bn.cjs +1 -0
- package/_virtual/bn.mjs +4 -0
- package/_virtual/bn2.cjs +1 -0
- package/_virtual/bn2.mjs +4 -0
- package/_virtual/common.cjs +1 -0
- package/_virtual/common.mjs +4 -0
- package/_virtual/common2.cjs +1 -0
- package/_virtual/common2.mjs +4 -0
- package/_virtual/hash.cjs +1 -0
- package/_virtual/hash.mjs +4 -0
- package/_virtual/index.cjs +1 -0
- package/_virtual/index.mjs +6 -0
- package/_virtual/index10.cjs +1 -0
- package/_virtual/index10.mjs +6 -0
- package/_virtual/index11.cjs +1 -0
- package/_virtual/index11.mjs +6 -0
- package/_virtual/index12.cjs +1 -0
- package/_virtual/index12.mjs +6 -0
- package/_virtual/index13.cjs +1 -0
- package/_virtual/index13.mjs +6 -0
- package/_virtual/index14.cjs +1 -0
- package/_virtual/index14.mjs +6 -0
- package/_virtual/index15.cjs +1 -0
- package/_virtual/index15.mjs +6 -0
- package/_virtual/index16.cjs +1 -0
- package/_virtual/index16.mjs +6 -0
- package/_virtual/index17.cjs +1 -0
- package/_virtual/index17.mjs +6 -0
- package/_virtual/index18.cjs +1 -0
- package/_virtual/index18.mjs +6 -0
- package/_virtual/index19.cjs +1 -0
- package/_virtual/index19.mjs +6 -0
- package/_virtual/index2.cjs +1 -0
- package/_virtual/index2.mjs +6 -0
- package/_virtual/index20.cjs +1 -0
- package/_virtual/index20.mjs +6 -0
- package/_virtual/index21.cjs +1 -0
- package/_virtual/index21.mjs +6 -0
- package/_virtual/index22.cjs +1 -0
- package/_virtual/index22.mjs +4 -0
- package/_virtual/index3.cjs +1 -0
- package/_virtual/index3.mjs +6 -0
- package/_virtual/index4.cjs +1 -0
- package/_virtual/index4.mjs +6 -0
- package/_virtual/index5.cjs +1 -0
- package/_virtual/index5.mjs +6 -0
- package/_virtual/index6.cjs +1 -0
- package/_virtual/index6.mjs +6 -0
- package/_virtual/index7.cjs +1 -0
- package/_virtual/index7.mjs +6 -0
- package/_virtual/index8.cjs +1 -0
- package/_virtual/index8.mjs +6 -0
- package/_virtual/index9.cjs +1 -0
- package/_virtual/index9.mjs +6 -0
- package/_virtual/inherits_browser.cjs +1 -0
- package/_virtual/inherits_browser.mjs +4 -0
- package/_virtual/ripemd.cjs +1 -0
- package/_virtual/ripemd.mjs +4 -0
- package/_virtual/scrypt.cjs +1 -0
- package/_virtual/scrypt.mjs +4 -0
- package/_virtual/sha.cjs +1 -0
- package/_virtual/sha.mjs +4 -0
- package/_virtual/sha3.cjs +1 -0
- package/_virtual/sha3.mjs +4 -0
- package/_virtual/utils.cjs +1 -0
- package/_virtual/utils.mjs +4 -0
- package/_virtual/utils2.cjs +1 -0
- package/_virtual/utils2.mjs +4 -0
- package/constants/backend.constants.cjs +1 -1
- package/constants/backend.constants.d.ts +2 -1
- package/constants/backend.constants.mjs +5 -7
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +5 -0
- package/constants/chains.constants.mjs +63 -35
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +1 -1
- package/constants/coingecko.constants.mjs +18 -11
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.mjs +19 -15
- package/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arbMainnet.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arcTestnet.json.mjs +1214 -4
- package/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-base.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-ethMainnet.json.mjs +1213 -3
- package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-optimism.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-polygon.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-solana.json.mjs +6111 -0
- package/constants/deploy-data/index.d.ts +2 -1
- package/constants/index.d.ts +1 -1
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +9 -0
- package/constants/mediaUrls.constants.mjs +13 -4
- package/constants/okx.constants.cjs +1 -0
- package/constants/okx.constants.d.ts +2 -0
- package/constants/okx.constants.mjs +5 -0
- package/constants/protocol.constants.cjs +1 -1
- package/constants/protocol.constants.d.ts +12 -1
- package/constants/protocol.constants.mjs +37 -29
- package/constants/save-depths.cjs +1 -1
- package/constants/save-depths.mjs +4 -1
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +23 -10
- package/constants/server.constants.mjs +102 -89
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +49 -35
- package/constants/token-data/index.cjs +1 -1
- package/constants/token-data/index.d.ts +17 -1
- package/constants/token-data/index.mjs +29 -25
- package/constants/token-data/solanaLocalnetRegistry.json.cjs +1 -0
- package/constants/token-data/solanaLocalnetRegistry.json.mjs +24 -0
- package/constants/token-data/solanaMainnetRegistry.json.cjs +1 -0
- package/constants/token-data/solanaMainnetRegistry.json.mjs +560 -0
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +41 -41
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +19 -10
- package/data-structures/Hinkal/Hinkal.mjs +290 -125
- package/data-structures/Hinkal/IHinkal.d.ts +18 -11
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +36 -32
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +24 -23
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.mjs +13 -12
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.cjs +1 -0
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.d.ts +3 -0
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.mjs +28 -0
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +11 -8
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +4 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +167 -0
- package/data-structures/Hinkal/hinkalGetRecipientInfo.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetRecipientInfo.d.ts +1 -1
- package/data-structures/Hinkal/hinkalGetRecipientInfo.mjs +4 -4
- package/data-structures/Hinkal/hinkalMultiSend.cjs +1 -1
- package/data-structures/Hinkal/hinkalMultiSend.mjs +6 -6
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +109 -93
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.mjs +23 -22
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -0
- package/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +6 -0
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +45 -0
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +11 -9
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +4 -0
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +133 -0
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +216 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +6 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +55 -0
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +6 -0
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +99 -0
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +5 -0
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +96 -0
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +4 -0
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +120 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +90 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +106 -0
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +33 -27
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +20 -14
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +15 -9
- package/data-structures/Hinkal/index.d.ts +4 -0
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +56 -23
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.d.ts +0 -1
- package/data-structures/IndexedDB/activity-db.mjs +86 -86
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +15 -12
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +29 -26
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +14 -10
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.d.ts +2 -2
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +32 -31
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.d.ts +6 -1
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +154 -79
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +24 -21
- package/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/PrivateTokensDB.mjs +39 -34
- package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.d.ts +15 -3
- package/data-structures/crypto-keys/decodeUTXO.mjs +84 -26
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +36 -30
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +19 -5
- package/data-structures/crypto-keys/keys.mjs +117 -60
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractAccessTokenSnapshotService.d.ts → evm/AbstractAccessTokenSnapshotService.d.ts} +2 -2
- package/data-structures/event-service/{AbstractAccessTokenSnapshotService.mjs → evm/AbstractAccessTokenSnapshotService.mjs} +6 -6
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractApprovalsSnapshotService.d.ts → evm/AbstractApprovalsSnapshotService.d.ts} +2 -2
- package/data-structures/event-service/{AbstractApprovalsSnapshotService.mjs → evm/AbstractApprovalsSnapshotService.mjs} +2 -2
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractCommitmentsSnapshotService.d.ts → evm/AbstractCommitmentsSnapshotService.d.ts} +3 -3
- package/data-structures/event-service/{AbstractCommitmentsSnapshotService.mjs → evm/AbstractCommitmentsSnapshotService.mjs} +24 -21
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -0
- package/data-structures/event-service/{AbstractEventService.d.ts → evm/AbstractEventService.d.ts} +1 -1
- package/data-structures/event-service/evm/AbstractEventService.mjs +37 -0
- package/data-structures/event-service/{AbstractNullifierSnapshotService.d.ts → evm/AbstractNullifierSnapshotService.d.ts} +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractSnapshotService.mjs → evm/AbstractSnapshotService.mjs} +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/{BlockchainEventEmitter.d.ts → evm/BlockchainEventEmitter.d.ts} +2 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +89 -0
- package/data-structures/event-service/index.d.ts +13 -7
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +34 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +87 -0
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.d.ts +29 -0
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +96 -0
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +22 -0
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +33 -0
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +21 -0
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +49 -0
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +22 -0
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +33 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +39 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +153 -0
- package/data-structures/http/BasicHttpClient.cjs +1 -0
- package/data-structures/http/BasicHttpClient.d.ts +11 -0
- package/data-structures/http/BasicHttpClient.mjs +25 -0
- package/data-structures/http/HttpClient.cjs +1 -0
- package/data-structures/http/HttpClient.d.ts +10 -0
- package/data-structures/http/HttpClient.mjs +15 -0
- package/data-structures/http/index.d.ts +2 -0
- package/data-structures/index.d.ts +1 -0
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +1 -3
- package/data-structures/snapshot/SnapshotFetcherService.d.ts +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientAccessTokenSnapshotService.d.ts → evm-snapshots/ClientAccessTokenSnapshotService.d.ts} +2 -2
- package/data-structures/snapshot/{ClientAccessTokenSnapshotService.mjs → evm-snapshots/ClientAccessTokenSnapshotService.mjs} +13 -9
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientApprovalsSnapshotService.d.ts → evm-snapshots/ClientApprovalsSnapshotService.d.ts} +2 -3
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +43 -0
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientCommitmentsSnapshotService.d.ts → evm-snapshots/ClientCommitmentsSnapshotService.d.ts} +2 -2
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +35 -0
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientNullifierSnapshotService.d.ts → evm-snapshots/ClientNullifierSnapshotService.d.ts} +2 -2
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +34 -0
- package/data-structures/snapshot/index.d.ts +7 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +42 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +34 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +34 -0
- package/data-structures/token-price-fetcher/TokenChecker.cjs +1 -1
- package/data-structures/token-price-fetcher/TokenChecker.mjs +5 -4
- package/data-structures/utxo/Utxo.cjs +1 -1
- package/data-structures/utxo/Utxo.d.ts +6 -1
- package/data-structures/utxo/Utxo.mjs +37 -24
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +2 -0
- package/error-handling/error-codes.constants.mjs +4 -2
- package/functions/connectors.types.d.ts +14 -0
- package/functions/index.d.ts +1 -0
- package/functions/pre-transaction/addressTableLookup.cjs +1 -0
- package/functions/pre-transaction/addressTableLookup.d.ts +4 -0
- package/functions/pre-transaction/addressTableLookup.mjs +44 -0
- package/functions/pre-transaction/constructAdminData.cjs +1 -1
- package/functions/pre-transaction/constructAdminData.d.ts +2 -1
- package/functions/pre-transaction/constructAdminData.mjs +30 -12
- package/functions/pre-transaction/convert-okx-instructions.cjs +1 -0
- package/functions/pre-transaction/convert-okx-instructions.d.ts +12 -0
- package/functions/pre-transaction/convert-okx-instructions.mjs +30 -0
- package/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -0
- package/functions/pre-transaction/getSolanaCalldataHash.d.ts +4 -0
- package/functions/pre-transaction/getSolanaCalldataHash.mjs +36 -0
- package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +11 -7
- package/functions/pre-transaction/index.d.ts +10 -0
- package/functions/pre-transaction/initTokenLimitIfNeeded.cjs +1 -0
- package/functions/pre-transaction/initTokenLimitIfNeeded.d.ts +3 -0
- package/functions/pre-transaction/initTokenLimitIfNeeded.mjs +20 -0
- package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.mjs +14 -13
- package/functions/pre-transaction/process-gas-estimates.cjs +1 -1
- package/functions/pre-transaction/process-gas-estimates.d.ts +2 -2
- package/functions/pre-transaction/process-gas-estimates.mjs +13 -12
- package/functions/pre-transaction/recipientUtxoProcessing.cjs +1 -0
- package/functions/pre-transaction/recipientUtxoProcessing.d.ts +3 -0
- package/functions/pre-transaction/recipientUtxoProcessing.mjs +36 -0
- package/functions/pre-transaction/sendInitNullifiersTransaction.cjs +1 -0
- package/functions/pre-transaction/sendInitNullifiersTransaction.d.ts +11 -0
- package/functions/pre-transaction/sendInitNullifiersTransaction.mjs +41 -0
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -0
- package/functions/pre-transaction/sendV0Transaction.d.ts +22 -0
- package/functions/pre-transaction/sendV0Transaction.mjs +121 -0
- package/functions/pre-transaction/solana-public-signals.cjs +1 -0
- package/functions/pre-transaction/solana-public-signals.d.ts +19 -0
- package/functions/pre-transaction/solana-public-signals.mjs +60 -0
- package/functions/pre-transaction/solana.cjs +1 -0
- package/functions/pre-transaction/solana.d.ts +17 -0
- package/functions/pre-transaction/solana.mjs +96 -0
- package/functions/pre-transaction/solanaTransfer.utils.cjs +1 -0
- package/functions/pre-transaction/solanaTransfer.utils.d.ts +6 -0
- package/functions/pre-transaction/solanaTransfer.utils.mjs +38 -0
- package/functions/pre-transaction/store-instructions.cjs +1 -0
- package/functions/pre-transaction/store-instructions.d.ts +4 -0
- package/functions/pre-transaction/store-instructions.mjs +9 -0
- package/functions/pre-transaction/store-proof.cjs +1 -0
- package/functions/pre-transaction/store-proof.d.ts +7 -0
- package/functions/pre-transaction/store-proof.mjs +55 -0
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.mjs +33 -29
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.d.ts +1 -1
- package/functions/private-wallet/emporium.swap.helpers.mjs +79 -69
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.d.ts +40 -0
- package/functions/snarkjs/constant.mjs +66 -23
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.mjs +32 -32
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +1 -1
- package/functions/snarkjs/constructGeneralZkProof.mjs +63 -61
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -0
- package/functions/snarkjs/constructSolanaZkProof.d.ts +13 -0
- package/functions/snarkjs/constructSolanaZkProof.mjs +109 -0
- package/functions/snarkjs/generateCircomData.cjs +1 -1
- package/functions/snarkjs/generateCircomData.d.ts +1 -1
- package/functions/snarkjs/generateCircomData.mjs +9 -9
- package/functions/snarkjs/generateZkProofEnclave.cjs +1 -1
- package/functions/snarkjs/generateZkProofEnclave.mjs +10 -9
- package/functions/snarkjs/getZKFiles.cjs +1 -1
- package/functions/snarkjs/getZKFiles.mjs +13 -13
- package/functions/snarkjs/index.d.ts +1 -0
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +1 -1
- package/functions/utils/addresses.mjs +21 -17
- package/functions/utils/amounts.utils.cjs +1 -1
- package/functions/utils/amounts.utils.d.ts +1 -0
- package/functions/utils/amounts.utils.mjs +53 -40
- package/functions/utils/bytes32.utils.cjs +1 -0
- package/functions/utils/bytes32.utils.d.ts +2 -0
- package/functions/utils/bytes32.utils.mjs +10 -0
- package/functions/utils/cacheDevice.utils.cjs +1 -1
- package/functions/utils/cacheDevice.utils.mjs +2 -3
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.mjs +53 -52
- package/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
- package/functions/utils/convertIntegrationProviderToExternalActionId.mjs +1 -0
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +4 -1
- package/functions/utils/create-provider.mjs +8 -6
- package/functions/utils/encodeTokenWithId.cjs +1 -1
- package/functions/utils/encodeTokenWithId.d.ts +1 -1
- package/functions/utils/encodeTokenWithId.mjs +6 -2
- package/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +29 -28
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.mjs +29 -29
- package/functions/utils/ethers-formatter.utils.cjs +1 -1
- package/functions/utils/ethers-formatter.utils.d.ts +2 -0
- package/functions/utils/ethers-formatter.utils.mjs +45 -15
- package/functions/utils/evmNetworkFunctions.cjs +1 -1
- package/functions/utils/evmNetworkFunctions.mjs +3 -4
- package/functions/utils/fees.utils.cjs +1 -1
- package/functions/utils/fees.utils.d.ts +1 -0
- package/functions/utils/fees.utils.mjs +19 -9
- package/functions/utils/get-hinkal-approvals.cjs +1 -1
- package/functions/utils/get-hinkal-approvals.mjs +1 -1
- package/functions/utils/getBlockExplorerUrl.cjs +1 -1
- package/functions/utils/getBlockExplorerUrl.mjs +2 -2
- package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.d.ts +0 -1
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +10 -13
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -0
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +4 -0
- package/functions/utils/getUtxosFromReceipt.utils.mjs +29 -0
- package/functions/utils/getUtxosFromReceiptSolana.cjs +1 -0
- package/functions/utils/getUtxosFromReceiptSolana.d.ts +5 -0
- package/functions/utils/getUtxosFromReceiptSolana.mjs +19 -0
- package/functions/utils/index.d.ts +5 -1
- package/functions/utils/networks.utils.cjs +1 -1
- package/functions/utils/networks.utils.mjs +2 -3
- package/functions/utils/nftTokenFunctions.cjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +8 -4
- package/functions/utils/prepareHinkal.cjs +1 -0
- package/functions/utils/prepareHinkal.d.ts +7 -1
- package/functions/utils/prepareHinkal.mjs +88 -0
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.d.ts +1 -0
- package/functions/utils/publicBalance.utils.mjs +75 -45
- package/functions/utils/solanaMint.utils.cjs +1 -0
- package/functions/utils/solanaMint.utils.d.ts +10 -0
- package/functions/utils/solanaMint.utils.mjs +14 -0
- package/functions/utils/time.utils.cjs +1 -1
- package/functions/utils/time.utils.d.ts +1 -1
- package/functions/utils/time.utils.mjs +11 -11
- package/functions/utils/userAgent.cjs +1 -1
- package/functions/utils/userAgent.mjs +6 -7
- package/functions/utils/walletBalances.utils.cjs +1 -1
- package/functions/utils/walletBalances.utils.d.ts +2 -1
- package/functions/utils/walletBalances.utils.mjs +18 -17
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.mjs +98 -91
- package/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
- package/functions/web3/events/getInputUtxosEnclave.mjs +38 -16
- package/functions/web3/events/getShieldedBalance.cjs +2 -2
- package/functions/web3/events/getShieldedBalance.mjs +70 -62
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.d.ts +3 -2
- package/functions/web3/events/getTransactionLogEvents.mjs +12 -9
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -0
- package/functions/web3/fetchSolanaMerkleTreeRootHash.d.ts +4 -0
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +45 -0
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +2 -0
- package/functions/web3/functionCalls/accessTokenCalls.mjs +25 -7
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +20 -0
- package/functions/web3/functionCalls/transactCallRelayer.mjs +61 -19
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +20 -50
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +29 -24
- package/functions/web3/index.d.ts +2 -0
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.mjs +11 -8
- package/functions/web3/okxAPI.cjs +1 -0
- package/functions/web3/okxAPI.d.ts +8 -0
- package/functions/web3/okxAPI.mjs +43 -0
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +7 -4
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +22 -18
- package/functions/web3/signAndSendSerializedTransaction.cjs +1 -0
- package/functions/web3/signAndSendSerializedTransaction.d.ts +2 -0
- package/functions/web3/signAndSendSerializedTransaction.mjs +11 -0
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +7 -4
- package/index.cjs +1 -1
- package/index.mjs +922 -810
- package/package.json +12 -16
- package/providers/CustomEthersProvider.cjs +1 -0
- package/providers/{TorExternalProvider.d.ts → CustomEthersProvider.d.ts} +2 -2
- package/providers/CustomEthersProvider.mjs +29 -0
- package/providers/CustomSolanaConnection.cjs +1 -0
- package/providers/CustomSolanaConnection.d.ts +4 -0
- package/providers/CustomSolanaConnection.mjs +33 -0
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +1 -2
- package/providers/EthersProviderAdapter.mjs +8 -48
- package/providers/SolanaProviderAdapter.cjs +1 -0
- package/providers/SolanaProviderAdapter.d.ts +44 -0
- package/providers/SolanaProviderAdapter.mjs +125 -0
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +1 -2
- package/providers/WagmiProviderAdapter.mjs +26 -24
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +10 -7
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +9 -6
- package/types/IMultiThreadedUtxoUtils.d.ts +2 -2
- package/types/TransactionSimulator.types.d.ts +1 -0
- package/types/activities.types.cjs +1 -1
- package/types/activities.types.d.ts +1 -0
- package/types/activities.types.mjs +6 -4
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +16 -0
- package/types/admin.types.mjs +1 -1
- package/types/all-points.types.d.ts +0 -1
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +8 -1
- package/types/cache.types.mjs +1 -1
- package/types/circom-data.types.d.ts +6 -0
- package/types/commitments.types.d.ts +12 -0
- package/types/ethereum-network.types.cjs +1 -1
- package/types/ethereum-network.types.d.ts +9 -3
- package/types/ethereum-network.types.mjs +1 -1
- package/types/external-action.types.cjs +1 -1
- package/types/external-action.types.d.ts +3 -1
- package/types/external-action.types.mjs +2 -2
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +3 -2
- package/types/hinkal.types.mjs +8 -8
- package/types/http.types.d.ts +8 -0
- package/types/index.d.ts +3 -2
- package/types/new-rewards.type.d.ts +2 -9
- package/types/offscreen.types.cjs +1 -1
- package/types/offscreen.types.d.ts +2 -1
- package/types/offscreen.types.mjs +2 -2
- package/types/okx.types.d.ts +57 -0
- package/types/rewards.types.d.ts +0 -11
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +19 -2
- package/types/sandbox.types.mjs +2 -2
- package/types/solana.types.d.ts +75 -0
- package/types/token.types.d.ts +6 -0
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.d.ts +0 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +28 -30
- package/webworker/utxoWorker/utxoWorker.types.d.ts +2 -0
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.mjs +33 -31
- package/webworker/viteWorkerURL.constant.cjs +21 -1
- package/webworker/viteWorkerURL.constant.mjs +21 -12
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
- package/API/mysteryBoxesCalls.cjs +0 -1
- package/API/mysteryBoxesCalls.d.ts +0 -60
- package/API/mysteryBoxesCalls.mjs +0 -66
- package/assets/snarkjsWorkerLauncher-CWaDqRaL.js +0 -14803
- package/assets/utxoWorkerLauncher-BUhBaUSg.js +0 -115868
- package/assets/zkProofWorkerLauncher-DlWQP3l9.js +0 -115360
- package/constants/mystery-boxes.constants.cjs +0 -1
- package/constants/mystery-boxes.constants.d.ts +0 -63
- package/constants/mystery-boxes.constants.mjs +0 -355
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractApprovalsSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractEventService.cjs +0 -1
- package/data-structures/event-service/AbstractEventService.mjs +0 -33
- package/data-structures/event-service/AbstractSnapshotService.cjs +0 -1
- package/data-structures/event-service/BlockchainEventEmitter.cjs +0 -1
- package/data-structures/event-service/BlockchainEventEmitter.mjs +0 -80
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientApprovalsSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientApprovalsSnapshotService.mjs +0 -23
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +0 -31
- package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +0 -30
- package/functions/utils/mystery-box-auction.utils.cjs +0 -1
- package/functions/utils/mystery-box-auction.utils.d.ts +0 -8
- package/functions/utils/mystery-box-auction.utils.mjs +0 -51
- package/providers/TorExternalProvider.cjs +0 -1
- package/providers/TorExternalProvider.mjs +0 -29
- package/types/merch-order.types.cjs +0 -1
- package/types/merch-order.types.d.ts +0 -16
- package/types/merch-order.types.mjs +0 -4
- package/types/mystery-boxes.types.cjs +0 -1
- package/types/mystery-boxes.types.d.ts +0 -43
- package/types/mystery-boxes.types.mjs +0 -6
- /package/data-structures/event-service/{AbstractNullifierSnapshotService.cjs → evm/AbstractNullifierSnapshotService.cjs} +0 -0
- /package/data-structures/event-service/{AbstractNullifierSnapshotService.mjs → evm/AbstractNullifierSnapshotService.mjs} +0 -0
- /package/data-structures/event-service/{AbstractSnapshotService.d.ts → evm/AbstractSnapshotService.d.ts} +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ethers as k } from "ethers";
|
|
2
|
-
import { get as
|
|
2
|
+
import { get as P, update as I } from "idb-keyval";
|
|
3
3
|
import { Mutex as b } from "async-mutex";
|
|
4
4
|
import { chainIds as f, ALCHEMY_API_KEY as T, networkRegistry as M } from "../../constants/chains.constants.mjs";
|
|
5
|
-
import { Logger as
|
|
5
|
+
import { Logger as C } from "../../error-handling/logger.mjs";
|
|
6
6
|
import { getStateKey as L } from "../../functions/utils/string.utils.mjs";
|
|
7
7
|
import { StorageKeys as S } from "../../types/cache.types.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { httpClient as R } from "../http/HttpClient.mjs";
|
|
9
|
+
import { API as $ } from "../../API/API.mjs";
|
|
9
10
|
import { RevokeType as w } from "../../types/approvals.types.mjs";
|
|
10
|
-
import { isNFTToken as
|
|
11
|
-
import {
|
|
12
|
-
import { EVENTS_INITIAL_BLOCKS as
|
|
11
|
+
import { isNFTToken as U } from "../../functions/utils/erc20tokenFunctions.mjs";
|
|
12
|
+
import { createCustomRpcProvider as F } from "../../functions/utils/create-provider.mjs";
|
|
13
|
+
import { EVENTS_INITIAL_BLOCKS as O } from "../../constants/events.constants.mjs";
|
|
13
14
|
import { caseInsensitiveEqual as y } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
14
|
-
import { zeroAddress as
|
|
15
|
-
import O from "axios";
|
|
15
|
+
import { zeroAddress as B } from "../../constants/protocol.constants.mjs";
|
|
16
16
|
class N {
|
|
17
17
|
updateMutexes = {};
|
|
18
18
|
approvalTopic = k.utils.id("Approval(address,address,uint256)");
|
|
@@ -39,11 +39,11 @@ class N {
|
|
|
39
39
|
}
|
|
40
40
|
async getApprovals(e, s) {
|
|
41
41
|
const r = L(s, e);
|
|
42
|
-
return (await
|
|
42
|
+
return (await P(S.EVENTS_PUBLIC_APPROVALS))?.[r] || [];
|
|
43
43
|
}
|
|
44
44
|
async getLastProcessedBlock(e, s) {
|
|
45
|
-
const r = await
|
|
46
|
-
return r[d] ||
|
|
45
|
+
const r = await P(S.PUBLIC_APPROVALS_LAST_PROCESSED_BLOCKS) || {}, d = L(s, e);
|
|
46
|
+
return r[d] || O[e];
|
|
47
47
|
}
|
|
48
48
|
async updateLastProcessedBlock(e, s, r) {
|
|
49
49
|
await I(S.PUBLIC_APPROVALS_LAST_PROCESSED_BLOCKS, (d = {}) => {
|
|
@@ -59,57 +59,57 @@ class N {
|
|
|
59
59
|
const { fetchRpcUrl: r } = M[s];
|
|
60
60
|
if (!r)
|
|
61
61
|
throw Error("No fetchRpcUrl in EventsPublicApprovalsDB");
|
|
62
|
-
const d =
|
|
62
|
+
const d = F(r), i = await this.getLastProcessedBlock(s, e) + 1, l = await d.getBlockNumber();
|
|
63
63
|
if (i > l)
|
|
64
64
|
return { approvalEvents: [], latestBlock: l };
|
|
65
|
-
const E = k.utils.hexZeroPad(e.toLowerCase(), 32),
|
|
65
|
+
const E = k.utils.hexZeroPad(e.toLowerCase(), 32), p = {
|
|
66
66
|
topics: [[this.approvalTopic, this.approvalForAllTopic], E],
|
|
67
67
|
fromBlock: i,
|
|
68
68
|
toBlock: l
|
|
69
69
|
};
|
|
70
|
-
return { approvalEvents: await d.getLogs(
|
|
70
|
+
return { approvalEvents: await d.getLogs(p), latestBlock: l };
|
|
71
71
|
} catch (r) {
|
|
72
|
-
return
|
|
72
|
+
return C.error("Failed to fetch approval events", r), { approvalEvents: [], latestBlock: void 0 };
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
async checkCurrentAllowances(e, s, r) {
|
|
76
|
-
const d = this.getAlchemyUrl(e), i = `0x${s.substring(2).padStart(64, "0")}`, l = [...new Set(r.map((t) => t.contractAddress))], E = (await
|
|
76
|
+
const d = this.getAlchemyUrl(e), i = `0x${s.substring(2).padStart(64, "0")}`, l = [...new Set(r.map((t) => t.contractAddress))], E = (await $.tokensInfoCall(e, l)).filter((t) => !!t), p = new Map(E.map((t) => [t.erc20TokenAddress.toLowerCase(), t])), c = [], v = [];
|
|
77
77
|
if (r.forEach((t, o) => {
|
|
78
|
-
const a =
|
|
78
|
+
const a = p.get(t.contractAddress.toLowerCase());
|
|
79
79
|
if (a)
|
|
80
|
-
if (
|
|
81
|
-
|
|
80
|
+
if (!U(a))
|
|
81
|
+
c.push({
|
|
82
82
|
jsonrpc: "2.0",
|
|
83
|
-
id:
|
|
83
|
+
id: c.length,
|
|
84
84
|
method: "alchemy_getTokenAllowance",
|
|
85
85
|
params: [{ contract: t.contractAddress, owner: s, spender: t.spenderAddress }]
|
|
86
86
|
}), v.push({ pairIndex: o, type: w.ERC20 });
|
|
87
87
|
else {
|
|
88
88
|
const m = `0x${t.spenderAddress.substring(2).padStart(64, "0")}`, g = `${this.isApprovedForAllSelector}${i.substring(2)}${m.substring(2)}`;
|
|
89
|
-
|
|
89
|
+
c.push({
|
|
90
90
|
jsonrpc: "2.0",
|
|
91
|
-
id:
|
|
91
|
+
id: c.length,
|
|
92
92
|
method: "eth_call",
|
|
93
93
|
params: [{ to: t.contractAddress, data: g }, "latest"]
|
|
94
94
|
}), v.push({ pairIndex: o, type: w.approvedForAll }), t.tokenIds && t.tokenIds.size > 0 && t.tokenIds.forEach((h) => {
|
|
95
|
-
const
|
|
96
|
-
|
|
95
|
+
const _ = k.BigNumber.from(h).toHexString().substring(2).padStart(64, "0"), x = `${this.getApprovedSelector}${_}`;
|
|
96
|
+
c.push({
|
|
97
97
|
jsonrpc: "2.0",
|
|
98
|
-
id:
|
|
98
|
+
id: c.length,
|
|
99
99
|
method: "eth_call",
|
|
100
|
-
params: [{ to: t.contractAddress, data:
|
|
100
|
+
params: [{ to: t.contractAddress, data: x }, "latest"]
|
|
101
101
|
}), v.push({ pairIndex: o, type: w.tokenId, tokenId: h });
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
-
}),
|
|
104
|
+
}), c.length === 0)
|
|
105
105
|
return [];
|
|
106
|
-
const
|
|
106
|
+
const n = await R.post(d, c), u = [], A = /* @__PURE__ */ new Set();
|
|
107
107
|
return n.forEach((t, o) => {
|
|
108
108
|
const a = v[o];
|
|
109
109
|
if (!a)
|
|
110
110
|
return;
|
|
111
|
-
const m = r[a.pairIndex], g =
|
|
112
|
-
if (!(!g || y(m.spenderAddress,
|
|
111
|
+
const m = r[a.pairIndex], g = p.get(m.contractAddress.toLowerCase());
|
|
112
|
+
if (!(!g || y(m.spenderAddress, B)) && !t?.error && t?.result && t.result !== "0x")
|
|
113
113
|
try {
|
|
114
114
|
if (a.type === w.ERC20 && BigInt(t.result) > 0n)
|
|
115
115
|
u.push({ token: g, spenderAddress: m.spenderAddress, allowance: BigInt(t.result) });
|
|
@@ -117,7 +117,7 @@ class N {
|
|
|
117
117
|
A.add(a.pairIndex), u.push({ token: g, spenderAddress: m.spenderAddress, allowance: 1n });
|
|
118
118
|
else if (a.type === w.tokenId && !A.has(a.pairIndex)) {
|
|
119
119
|
const h = `0x${t.result.substring(26)}`.toLowerCase();
|
|
120
|
-
!y(h,
|
|
120
|
+
!y(h, B) && y(h, m.spenderAddress) && u.push({
|
|
121
121
|
token: g,
|
|
122
122
|
spenderAddress: m.spenderAddress,
|
|
123
123
|
allowance: 1n,
|
|
@@ -125,7 +125,7 @@ class N {
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
} catch (h) {
|
|
128
|
-
|
|
128
|
+
C.error("Error processing approval response", h);
|
|
129
129
|
}
|
|
130
130
|
}), u;
|
|
131
131
|
}
|
|
@@ -136,34 +136,34 @@ class N {
|
|
|
136
136
|
const { approvalEvents: i, latestBlock: l } = await this.getApprovalEvents(e, s);
|
|
137
137
|
if (!l)
|
|
138
138
|
return;
|
|
139
|
-
const E = await this.getApprovals(s, e),
|
|
139
|
+
const E = await this.getApprovals(s, e), p = /* @__PURE__ */ new Map();
|
|
140
140
|
if (E.forEach((n) => {
|
|
141
141
|
const u = n.token.erc20TokenAddress.toLowerCase(), A = n.spenderAddress.toLowerCase(), t = `${u}_${A}`;
|
|
142
|
-
let o =
|
|
143
|
-
o || (o = { contractAddress: u, spenderAddress: A, tokenIds: /* @__PURE__ */ new Set() },
|
|
142
|
+
let o = p.get(t);
|
|
143
|
+
o || (o = { contractAddress: u, spenderAddress: A, tokenIds: /* @__PURE__ */ new Set() }, p.set(t, o)), n.tokenId && o.tokenIds && o.tokenIds.add(n.tokenId);
|
|
144
144
|
}), i.forEach((n) => {
|
|
145
145
|
if (!n.topics[2])
|
|
146
146
|
return;
|
|
147
147
|
const u = n.address.toLowerCase(), A = `0x${n.topics[2].substring(26)}`.toLowerCase();
|
|
148
|
-
if (y(A,
|
|
148
|
+
if (y(A, B))
|
|
149
149
|
return;
|
|
150
150
|
const t = `${u}_${A}`;
|
|
151
|
-
let o =
|
|
152
|
-
if (o || (o = { contractAddress: u, spenderAddress: A, tokenIds: /* @__PURE__ */ new Set() },
|
|
151
|
+
let o = p.get(t);
|
|
152
|
+
if (o || (o = { contractAddress: u, spenderAddress: A, tokenIds: /* @__PURE__ */ new Set() }, p.set(t, o)), n.topics.length === 4 && o.tokenIds) {
|
|
153
153
|
const a = BigInt(n.topics[3]).toString();
|
|
154
154
|
o.tokenIds.add(a);
|
|
155
155
|
}
|
|
156
|
-
}),
|
|
156
|
+
}), p.size === 0) {
|
|
157
157
|
await this.updateLastProcessedBlock(s, e, l);
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
|
-
const
|
|
160
|
+
const c = Array.from(p.values()), v = await this.checkCurrentAllowances(s, e, c);
|
|
161
161
|
await I(S.EVENTS_PUBLIC_APPROVALS, (n = {}) => ({
|
|
162
162
|
...n,
|
|
163
163
|
[r]: v
|
|
164
164
|
})), await this.updateLastProcessedBlock(s, e, l);
|
|
165
165
|
} catch (i) {
|
|
166
|
-
|
|
166
|
+
C.error("Failed to sync approvals", i);
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
169
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("../../types/hinkal.types.cjs"),v=require("../../types/ethereum-network.types.cjs"),m=require("../../functions/web3/functionCalls/accessTokenCalls.cjs"),F=require("../../functions/web3/events/getShieldedBalance.cjs"),k=require("../crypto-keys/keys.cjs"),q=require("./hinkalDeposit.cjs"),E=require("./hinkalSwap.cjs"),M=require("./hinkalWithdraw.cjs"),R=require("./resetMerkleTrees.cjs"),P=require("../merkle-tree/MerkleTree.cjs");require("ethers");const f=require("../../error-handling/error-codes.constants.cjs"),S=require("../../crypto/poseidon.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");const H=require("../../constants/chains.constants.cjs");require("../../API/getServerURL.cjs");require("axios");require("../../constants/coingecko.constants.cjs");require("../../constants/server.constants.cjs");const U=require("../../constants/vite.constants.cjs"),A=require("../../API/API.cjs");require("../../constants/token-data/index.cjs");require("../../constants/contracts.constants.cjs");const B=require("../../constants/kyc.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/mystery-boxes.constants.cjs");require("../../constants/activity.constants.cjs");require("../../constants/tasks.constants.cjs");require("../../constants/events.constants.cjs");require("../../API/tenderly.api.cjs");const b=require("../../functions/utils/reloadPage.cjs"),W=require("../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs"),D=require("./hinkalPrivateWallet.cjs"),K=require("../../functions/utils/cacheFunctions.cjs"),x=require("../../functions/utils/cacheDevice.utils.cjs"),N=require("../../functions/web3/getContractMetadata.cjs"),L=require("./hinkalGetRecipientInfo.cjs"),O=require("./hinkalApprove.cjs"),_=require("./hinkalInsideTransact.cjs"),u=require("../../functions/web3/events/getApprovedBalance.cjs"),y=require("../../functions/web3/functionCalls/inHinkalApprovalCalls.cjs"),j=require("./hinkalSignSubAccount.cjs"),G=require("./hinkalCheckTokenRegistry.cjs"),z=require("./hinkalActionReceive.cjs"),J=require("./hinkalActionFundApproveAndTransact.cjs"),Q=require("../TokenDBs/PrivateTokensDB.cjs");require("idb-keyval");const V=require("../../functions/utils/erc20tokenFunctions.cjs");require("multiformats");require("async-mutex");require("../../functions/utils/convertIntegrationProviderToExternalActionId.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");require("../../functions/utils/userAgent.cjs");require("../../functions/utils/mutexes.utils.cjs");require("node-forge");require("../../functions/web3/getTokenHolder.cjs");require("ethers-v6h");const X=require("./hinkalProoflessDeposit.cjs"),Y=require("./hinkalProxySwap.cjs"),Z=require("./hinkalMultiSend.cjs"),$=require("./hinkalTransfer.cjs");class ee{providerAdapter;userKeys;signingMessage="Login to Hinkal Protocol";merkleTreeHinkal;merkleTreeAccessToken;nullifiers;encryptedOutputs;approvals;commitmentsSnapshotService;nullifierSnapshotService;accessTokenSnapshotService;approvalsSnapshotService;utxoUtils;cacheDevice;generateProofRemotely;disableMerkleTreeUpdates;constructor(e){this.userKeys=new k.UserKeys(void 0),this.merkleTreeHinkal=P.MerkleTree.create(S.poseidonFunction,0n),this.merkleTreeAccessToken=P.MerkleTree.create(S.poseidonFunction,0n),this.nullifiers=new Set,this.encryptedOutputs=[],this.approvals=new Map,this.generateProofRemotely=e?.generateProofRemotely??!1,this.utxoUtils=new W.MultiThreadedUtxoUtils,this.cacheDevice=x.createCacheDevice(e),this.disableMerkleTreeUpdates=e?.disableMerkleTreeUpdates??!1}async initProviderAdapter(e,t){await this.updateProviderAdapter(t),this.providerAdapter?.initConnector(e);const r=await this.connectAndPatchProvider(e);await t.init(r),await this.setListeners()}async initUserKeys(){this.userKeys=new k.UserKeys(await this.getProviderAdapter().signMessage(this.signingMessage))}async initUserKeysWithPassword(e){this.userKeys=new k.UserKeys(e)}async resetMerkle(){this.disableMerkleTreeUpdates||this.isSelectedNetworkSupported()&&await R.resetMerkleTrees(this)}getProviderAdapter(){if(!this.providerAdapter)throw new Error("ProviderAdapter is not initialized");return this.providerAdapter}async waitForTransaction(e,t=1){return!!await this.providerAdapter?.waitForTransaction(e,t)}getContractMetadata(e,t){return this.getProviderAdapter().getContractMetadata(e,t)}getContract(e,t=void 0,r){return this.getProviderAdapter().getContract(e,t,r)}getContractWithFetcherByChainId(e,t,r=void 0){return N.getContractWithFetcherByChainId(e,t,r)}async signMessage(e){return await this.getProviderAdapter().signMessage(e)}async signTypedData(e,t,r){return await this.getProviderAdapter().signTypedData(e,t,r)}async signWithSubAccount(e,t,r){return j.hinkalSignSubAccount(this,e,t,r)}getContractWithSigner(e,t=""){return this.getProviderAdapter().getContractWithSigner(e,t)}getContractWithFetcher(e,t=""){return this.getProviderAdapter().getContractWithFetcher(e,t)}getContractWithFetcherForEthereum(e,t){return this.getProviderAdapter().getContractWithFetcherForEthereum(e,t)}isSelectedNetworkSupported(){return!!H.networkRegistry[this.getCurrentChainId()]}async switchNetwork(e){try{await this.getProviderAdapter().switchNetwork(e)}catch{throw new Error(f.transactionErrorCodes.FAILED_TO_SWITCH_NETWORKS)}}async switchAccount(e){await this.getProviderAdapter().switchAccount(e)}getCurrentChainId(){const{chainId:e}=this.getProviderAdapter();if(!e)throw new Error("Illegal State: no chainId");return e}getSelectedNetwork(){return this.providerAdapter?.getSelectedNetwork()}isPermitterAvailable(){return this.getProviderAdapter().isPermitterAvailable()}async connectAndPatchProvider(e){return await this.getProviderAdapter().connectAndPatchProvider(e)}async disconnectFromConnector(){await this.getProviderAdapter().disconnectFromConnector()}async updateProviderAdapter(e){try{this.providerAdapter&&this.providerAdapter.release(),this.providerAdapter=e}catch(t){throw console.error(t),Error("updateProviderAdapter failed, please try again.")}}async setListeners(){this.providerAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}})}async onAccountChanged(){await this.getProviderAdapter().onAccountChanged();const e=C.EventType.AccountChanged;typeof document<"u"?document?.dispatchEvent(new Event(e)):process?.emit("message",e,void 0)}async onChainChanged(e){if(e){await this.getProviderAdapter().onChainChanged(e);const t=C.EventType.NetworkChange;typeof document<"u"?document.dispatchEvent(new Event(t)):process?.emit("message",t,void 0)}else await this.disconnectFromConnector(),b.reloadPage()}async monitorConnectedAddress(){await A.API.monitor(await this.getEthereumAddress(),this.getCurrentChainId())}async getBalances(e,t,r,n,i=!1,s){return F.getShieldedBalance(this,e,t,r,n,i,this.generateProofRemotely,s)}async getApprovedBalances(e=!1,t=!1){return u.getApprovedBalance(this,e,t)}async getTotalBalance(e,t,r,n=!1,i){const s=e??this.getCurrentChainId(),a=r??await this.getEthereumAddress(),o=t??this.userKeys,c=await this.getBalances(s,o.getShieldedPrivateKey(),o.getShieldedPublicKey(),a,n,i),h=await this.getApprovedBalances(n,i),d=U.isExtension?await Q.privateTokensDB.getPrivateTokens(s,a):V.getErc20TokensForChain(s),l=[];return d.forEach(p=>{const T=p.erc20TokenAddress.toLowerCase(),g=c.get(T),w=h.get(T),I={token:p,balance:(g?.balance??0n)+(w?.balance??0n),timestamp:g?.timestamp||w?.timestamp||"0",nfts:g?.nfts||[]};l.push(I)}),l}getSupportedPassportLinks(){return B.supportedPassportLinks}checkAccessToken(){return m.checkHinkalAccessToken(this)}async mintHinkalAccessToken(e,t){return m.mintAccessToken(this,e,t)}async getHinkalTreeRootHash(){return this.getContractWithFetcher(v.ContractType.HinkalContract).getRootHash()}async getAccessTokenTreeRootHash(){return this.getContractWithFetcher(v.ContractType.AccessTokenContract).getRootHash()}async resetMerkleTreesIfNecessary(){if(!this.isSelectedNetworkSupported())throw new Error(f.transactionErrorCodes.UNSUPPORTED_NETWORK);const[e,t]=await Promise.all([this.getHinkalTreeRootHash(),this.getAccessTokenTreeRootHash()]);(e.toBigInt()!==this.merkleTreeHinkal.getRootHash()||t.toBigInt()!==this.merkleTreeAccessToken.getRootHash())&&(console.log("resetting merkle tree in resetMerkleTreesIfNecessary"),await this.resetMerkle())}async getEventsFromHinkal(){await Promise.all([this.accessTokenSnapshotService?.retrieveEventsFromLatestBlock(),this.commitmentsSnapshotService?.retrieveEventsFromLatestBlock(),this.nullifierSnapshotService?.retrieveEventsFromLatestBlock(),this.approvalsSnapshotService?.retrieveEventsFromLatestBlock()])}getEthereumAddress(){return this.getProviderAdapter().getAddress()}async getRandomRelay(e=!1){return(await A.API.getIdleRelay(this.getCurrentChainId(),e)).relay}getGasPrice(){if(!this.providerAdapter?.chainId)throw new Error("Illegal State of providerAdapter in Hinkal: no chainId");return this.providerAdapter.getGasPrice()}getAPI(){return A.API}resetCache(){K.resetCache(this,this.getCurrentChainId(),this.userKeys.getShieldedPublicKey())}snapshotsClearInterval(){this.commitmentsSnapshotService?.intervalClear(),this.accessTokenSnapshotService?.intervalClear(),this.nullifierSnapshotService?.intervalClear(),this.approvalsSnapshotService?.intervalClear()}checkTokenRegistry(e,t){const r=this.getContractWithFetcher(v.ContractType.HinkalHelperContract);return G.hinkalCheckTokenRegistry(r,e,t)}getRecipientInfo(e=!1){return L.getRecipientInfo(this,e)}async getInteractionApprovals(e){return await y.getInteractionApprovals(this,e)}getApprovedUtxos(e=!1){return u.getApprovedUtxos(this,e)}getApprovedUtxosForToken(e,t=!1){return u.getApprovedUtxosForToken(this,e,t)}getMyApprovalAmountForInteraction(e,t){return u.getMyApprovalAmountForInteraction(this,e,t)}async checkExistingApprovalFromHinkal(e,t){return await y.checkExistingApprovalFromHinkal(this,e,t)}async getBufferEntry(e,t,r){return y.getBufferEntry(this,e,t,r)}async deposit(e,t){return q.hinkalDeposit(this,e,t)}async depositForOther(e,t,r){return q.hinkalDepositForOther(this,e,t,r)}async prooflessDeposit(e,t,r){return X.hinkalProoflessDeposit(this,e,t,r)}async transfer(e,t,r,n,i,s,a=!1){return $.hinkalTransfer(this,e,t,r,n,i,s,a)}async withdraw(e,t,r,n,i,s,a,o=!1){return M.hinkalWithdraw(this,e,t,r,n,i,s,a,o)}async swap(e,t,r,n,i,s,a,o=!1,c=!1){return E.hinkalSwap(this,e,t,r,n,i,s,a,o,c)}async actionReceive(e,t,r,n,i,s,a=!1){return z.hinkalActionReceive(this,e,t,r,n,i,s,a)}async actionFundApproveAndTransact(e,t,r,n,i,s,a,o,c=!1,h,d,l){return J.hinkalActionFundApproveAndTransact(this,e,t,r,n,i,s,a,o,c,h,d,l)}async actionPrivateWallet(e,t,r,n,i,s,a,o,c,h=!1,d,l,p=!1){return D.hinkalPrivateWallet(this,e,t,r,n,i,s,a,o,c,h,d,l,p)}async approve(e,t,r,n,i,s=!1){return O.hinkalApprove(this,e,t,r,n,i,s)}async hinkalInsideTransact(e,t,r,n,i,s,a,o,c,h=!1){return _.hinkalInsideTransact(this,e,t,r,n,i,s,a,o,c,h)}async proxySwap(e,t,r,n,i,s,a,o,c=!1,h,d,l=!1){return Y.hinkalProxySwap(this,e,t,r,n,i,s,a,o,c,h,d,l)}async multiSendPrivateRecipients(e,t,r){return Z.hinkalMultiSendPrivateRecipients(this,e,t,r)}areMerkleTreeUpdatesDisabled(){return this.disableMerkleTreeUpdates}updateMerkleTreeUpdates(e){this.disableMerkleTreeUpdates=e}}exports.Hinkal=ee;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../types/hinkal.types.cjs"),S=require("../../types/ethereum-network.types.cjs"),b=require("./hinkalCheckSolanaTokenRegistry.cjs"),T=require("../../functions/web3/functionCalls/accessTokenCalls.cjs"),x=require("../../functions/web3/events/getShieldedBalance.cjs"),A=require("../crypto-keys/keys.cjs"),m=require("./hinkalDeposit.cjs"),W=require("./hinkalDepositAndWithdraw.cjs"),w=require("./hinkalSolanaDeposit.cjs"),K=require("./hinkalSwap.cjs"),U=require("./hinkalWithdraw.cjs"),B=require("./resetMerkleTrees.cjs"),I=require("../merkle-tree/MerkleTree.cjs");require("ethers");const M=require("../../error-handling/error-codes.constants.cjs"),R=require("../../crypto/poseidon.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");const h=require("../../constants/chains.constants.cjs");require("../../API/getServerURL.cjs");require("axios");require("../../constants/coingecko.constants.cjs");require("../../constants/server.constants.cjs");require("../http/HttpClient.cjs");const L=require("../../constants/vite.constants.cjs"),P=require("../../API/API.cjs");require("../../constants/token-data/index.cjs");require("../../constants/contracts.constants.cjs");const N=require("../../constants/kyc.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");require("../../API/tenderly.api.cjs");const _=require("../../functions/utils/reloadPage.cjs"),O=require("../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs"),j=require("./hinkalPrivateWallet.cjs"),z=require("../../functions/utils/cacheFunctions.cjs"),$=require("../../functions/utils/cacheDevice.utils.cjs"),J=require("../../functions/web3/getContractMetadata.cjs"),Q=require("./hinkalGetRecipientInfo.cjs"),V=require("./hinkalApprove.cjs"),X=require("./hinkalInsideTransact.cjs"),v=require("../../functions/web3/events/getApprovedBalance.cjs"),C=require("../../functions/web3/functionCalls/inHinkalApprovalCalls.cjs"),Y=require("./hinkalSignSubAccount.cjs"),Z=require("./hinkalCheckTokenRegistry.cjs"),G=require("./hinkalActionReceive.cjs"),ee=require("./hinkalActionFundApproveAndTransact.cjs"),te=require("../TokenDBs/PrivateTokensDB.cjs");require("idb-keyval");const re=require("../../functions/utils/erc20tokenFunctions.cjs");require("multiformats");const g=require("@solana/web3.js");require("@solana/spl-token");require("async-mutex");require("../../functions/utils/convertIntegrationProviderToExternalActionId.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");const F=require("../../functions/pre-transaction/solana.cjs");require("@coral-xyz/anchor");require("../../functions/utils/userAgent.cjs");require("../../functions/utils/mutexes.utils.cjs");require("node-forge");require("../../functions/web3/getTokenHolder.cjs");const ie=require("../../functions/private-wallet/emporium.helpers.cjs"),ne=require("./hinkalProoflessDeposit.cjs"),ae=require("./hinkalProxySwap.cjs"),se=require("./hinkalMultiSend.cjs"),oe=require("./hinkalTransfer.cjs"),ce=require("./hinkalProxyToPrivate.cjs"),he=require("./hinkalSolanaDepositAndWithdraw.cjs"),le=require("./hinkalSolanaWithdraw.cjs"),de=require("./hinkalSolanaTransfer.cjs"),pe=require("./hinkalSolanaSwap.cjs"),ue=require("./hinkalSolanaProxySend.cjs"),ge=require("./hinkalSolanaProxySwap.cjs"),E=require("./hinkalSolanaProxyShield.cjs"),D=require("../../functions/web3/fetchSolanaMerkleTreeRootHash.cjs");class ke{providerAdapter;userKeys;signingMessage="Login to Hinkal Protocol";merkleTreeHinkal;merkleTreeAccessToken;nullifiers;encryptedOutputs;approvals;commitmentsSnapshotService;nullifierSnapshotService;accessTokenSnapshotService;approvalsSnapshotService;utxoUtils;cacheDevice;generateProofRemotely;disableMerkleTreeUpdates;constructor(e){this.userKeys=new A.UserKeys(void 0),this.merkleTreeHinkal=I.MerkleTree.create(R.poseidonFunction,0n),this.merkleTreeAccessToken=I.MerkleTree.create(R.poseidonFunction,0n),this.nullifiers=new Set,this.encryptedOutputs=[],this.approvals=new Map,this.generateProofRemotely=e?.generateProofRemotely??!1,this.utxoUtils=new O.MultiThreadedUtxoUtils,this.cacheDevice=$.createCacheDevice(e),this.disableMerkleTreeUpdates=e?.disableMerkleTreeUpdates??!1}async initProviderAdapter(e,t){await this.updateProviderAdapter(t),this.providerAdapter?.initConnector(e);const r=await this.connectAndPatchProvider(e);await t.init(r),await this.setListeners()}async initUserKeys(){this.userKeys=new A.UserKeys(await this.getProviderAdapter().signMessage(this.signingMessage))}async initUserKeysWithPassword(e){this.userKeys=new A.UserKeys(e)}async resetMerkle(){this.disableMerkleTreeUpdates||this.isSelectedNetworkSupported()&&await B.resetMerkleTrees(this)}getProviderAdapter(){if(!this.providerAdapter)throw new Error("ProviderAdapter is not initialized");return this.providerAdapter}async waitForTransaction(e,t=1){return!!await this.providerAdapter?.waitForTransaction(e,t)}getContractMetadata(e,t){return this.getProviderAdapter().getContractMetadata(e,t)}getContract(e,t=void 0,r){return this.getProviderAdapter().getContract(e,t,r)}getContractWithFetcherByChainId(e,t,r=void 0){return J.getContractWithFetcherByChainId(e,t,r)}async signMessage(e){return await this.getProviderAdapter().signMessage(e)}async signTypedData(e,t,r){return await this.getProviderAdapter().signTypedData(e,t,r)}async signWithSubAccount(e,t,r){return Y.hinkalSignSubAccount(this,e,t,r)}getContractWithSigner(e,t=""){return this.getProviderAdapter().getContractWithSigner(e,t)}getContractWithFetcher(e,t=""){return this.getProviderAdapter().getContractWithFetcher(e,t)}getContractWithFetcherForEthereum(e,t){return this.getProviderAdapter().getContractWithFetcherForEthereum(e,t)}isSelectedNetworkSupported(){return!!h.networkRegistry[this.getCurrentChainId()]}async switchNetwork(e){try{await this.getProviderAdapter().switchNetwork(e)}catch{throw new Error(M.transactionErrorCodes.FAILED_TO_SWITCH_NETWORKS)}}async switchAccount(e){await this.getProviderAdapter().switchAccount(e)}getCurrentChainId(){const{chainId:e}=this.getProviderAdapter();if(!e)throw new Error("Illegal State: no chainId");return e}getSelectedNetwork(){return this.providerAdapter?.getSelectedNetwork()}isPermitterAvailable(){return this.getProviderAdapter().isPermitterAvailable()}async connectAndPatchProvider(e){return await this.getProviderAdapter().connectAndPatchProvider(e)}async disconnectFromConnector(){await this.getProviderAdapter().disconnectFromConnector()}async updateProviderAdapter(e){try{this.providerAdapter&&this.providerAdapter.release(),this.providerAdapter=e}catch(t){throw console.error(t),Error("updateProviderAdapter failed, please try again.")}}async setListeners(){this.providerAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}})}async onAccountChanged(){await this.getProviderAdapter().onAccountChanged();const e=f.EventType.AccountChanged;typeof document<"u"?document?.dispatchEvent(new Event(e)):process?.emit("message",e,void 0)}async onChainChanged(e){if(e){await this.getProviderAdapter().onChainChanged(e);const t=f.EventType.NetworkChange;typeof document<"u"?document.dispatchEvent(new Event(t)):process?.emit("message",t,void 0)}else await this.disconnectFromConnector(),_.reloadPage()}async monitorConnectedAddress(){const e=this.getCurrentChainId();h.isSolanaLike(e)||await P.API.monitor(await this.getEthereumAddress(),e)}async getBalances(e,t,r,i,n=!1,a){return x.getShieldedBalance(this,e,t,r,i,n,this.generateProofRemotely,a)}async getApprovedBalances(e=!1,t=!1){return v.getApprovedBalance(this,e,t)}async getTotalBalance(e,t,r,i=!1,n){const a=e??this.getCurrentChainId(),s=r??await this.getEthereumAddress(),o=t??this.userKeys,c=await this.getBalances(a,o.getShieldedPrivateKey(),o.getShieldedPublicKey(),s,i,n),d=h.isSolanaLike(a)?new Map:await this.getApprovedBalances(i,n),p=L.isExtension?await te.privateTokensDB.getPrivateTokens(a,s):re.getErc20TokensForChain(a),l=[];return p.forEach(u=>{const k=u.erc20TokenAddress.toLowerCase(),y=c.get(k),q=d.get(k),H={token:u,balance:(y?.balance??0n)+(q?.balance??0n),timestamp:y?.timestamp||q?.timestamp||"0",nfts:y?.nfts||[]};l.push(H)}),l}getSupportedPassportLinks(){return N.supportedPassportLinks}checkAccessToken(){return T.checkHinkalAccessToken(this)}async mintHinkalAccessToken(e,t){return T.mintAccessToken(this,e,t)}async getHinkalTreeRootHash(){const e=this.getCurrentChainId();if(h.isSolanaLike(e)){const{hinkalIdl:r,hinkalAddress:i,originalDeployer:n}=h.networkRegistry[e].contractData;if(!r||!i||!n)throw new Error(`Missing Solana configuration for chain ${e}`);const a=new g.PublicKey(n),s=new g.PublicKey(i),o=F.getMerkleAccountPublicKey(s,a),c=this.getSolanaProgram(r);return D.fetchSolanaMerkleTreeRootHash(c,o)}return this.getContractWithFetcher(S.ContractType.HinkalContract).getRootHash()}async getAccessTokenTreeRootHash(){const e=this.getCurrentChainId();if(h.isSolanaLike(e)){const{hinkalIdl:r,hinkalAddress:i,originalDeployer:n}=h.networkRegistry[e].contractData;if(!r||!i||!n)throw new Error(`Missing Solana configuration for chain ${e}`);const a=new g.PublicKey(n),s=new g.PublicKey(i),o=F.getAccessTokenMerkleAccountPublicKey(s,a),c=this.getSolanaProgram(r);return D.fetchSolanaMerkleTreeRootHash(c,o)}return this.getContractWithFetcher(S.ContractType.AccessTokenContract).getRootHash()}async resetMerkleTreesIfNecessary(){if(!this.isSelectedNetworkSupported())throw new Error(M.transactionErrorCodes.UNSUPPORTED_NETWORK);const[e,t]=await Promise.all([this.getHinkalTreeRootHash(),this.getAccessTokenTreeRootHash()]);(e.toBigInt()!==this.merkleTreeHinkal.getRootHash()||t.toBigInt()!==this.merkleTreeAccessToken.getRootHash())&&(console.log("resetting merkle tree in resetMerkleTreesIfNecessary"),await this.resetMerkle())}async getEventsFromHinkal(){await Promise.all([this.accessTokenSnapshotService?.retrieveEventsFromLatestBlock(),this.commitmentsSnapshotService?.retrieveEventsFromLatestBlock(),this.nullifierSnapshotService?.retrieveEventsFromLatestBlock(),this.approvalsSnapshotService?.retrieveEventsFromLatestBlock()])}getEthereumAddress(){return this.getProviderAdapter().getAddress()}async getRandomRelay(e=!1){const t=this.getCurrentChainId();return(await P.API.getIdleRelay(t,e)).relay}getGasPrice(){if(!this.providerAdapter?.chainId)throw new Error("Illegal State of providerAdapter in Hinkal: no chainId");return this.providerAdapter.getGasPrice()}getAPI(){return P.API}resetCache(){z.resetCache(this,this.getCurrentChainId(),this.userKeys.getShieldedPublicKey())}snapshotsClearInterval(){this.commitmentsSnapshotService?.intervalClear(),this.accessTokenSnapshotService?.intervalClear(),this.nullifierSnapshotService?.intervalClear(),this.approvalsSnapshotService?.intervalClear()}checkTokenRegistry(e,t){const r=this.getCurrentChainId();if(h.isSolanaLike(r)){const{hinkalIdl:n,hinkalAddress:a,originalDeployer:s}=h.networkRegistry[r].contractData;if(!n||!a||!s)throw new Error("missing solana data");const o=this.getSolanaProgram(n),c=new g.PublicKey(s);return b.hinkalCheckSolanaTokenRegistry(o,c,e,t)}const i=this.getContractWithFetcher(S.ContractType.HinkalHelperContract);return Z.hinkalCheckTokenRegistry(i,e,t)}getRecipientInfo(){return Q.getRecipientInfo(this)}async getInteractionApprovals(e){return await C.getInteractionApprovals(this,e)}getApprovedUtxos(e=!1){return v.getApprovedUtxos(this,e)}getApprovedUtxosForToken(e,t=!1){return v.getApprovedUtxosForToken(this,e,t)}getMyApprovalAmountForInteraction(e,t){return v.getMyApprovalAmountForInteraction(this,e,t)}async checkExistingApprovalFromHinkal(e,t){return await C.checkExistingApprovalFromHinkal(this,e,t)}async getBufferEntry(e,t,r){return C.getBufferEntry(this,e,t,r)}async deposit(e,t){return m.hinkalDeposit(this,e,t)}async depositForOther(e,t,r){return m.hinkalDepositForOther(this,e,t,r)}async depositAndWithdraw(e,t,r,i){return W.hinkalDepositAndWithdraw(this,e,t,r,i)}async prooflessDeposit(e,t,r){return ne.hinkalProoflessDeposit(this,e,t,r)}getSolanaProgram(e){if(!this.providerAdapter)throw new Error("No provider adapter initialized");if(!("getSolanaProgram"in this.providerAdapter))throw new Error("Current provider adapter is not a Solana provider adapter");return this.providerAdapter.getSolanaProgram(e)}getSolanaPublicKey(){if(!this.providerAdapter)throw new Error("No provider adapter initialized");if(!("getSolanaPublicKey"in this.providerAdapter))throw new Error("Current provider adapter is not a Solana provider adapter");return this.providerAdapter.getSolanaPublicKey()}async depositSolana(e,t){return w.hinkalSolanaDeposit(this,e,t)}async depositSolanaForOther(e,t,r){return w.hinkalSolanaDepositForOther(this,e,t,r)}async solanaMultiPaymentDeposit(e,t){return w.hinkalSolanaMultiPaymentDeposit(this,e,t)}async solanaDepositAndWithdraw(e,t,r,i){return he.hinkalSolanaDepositAndWithdraw(this,e,t,r,i)}async transfer(e,t,r,i,n,a,s=!1){return h.isSolanaLike(this.getCurrentChainId())?de.hinkalSolanaTransfer(this,e,t,r,i,n,s):oe.hinkalTransfer(this,e,t,r,i,n,a,s)}async withdraw(e,t,r,i,n,a,s,o=!1){return h.isSolanaLike(this.getCurrentChainId())?le.hinkalSolanaWithdraw(this,e.map(c=>c.erc20TokenAddress),t,r,n,a,o):U.hinkalWithdraw(this,e,t,r,i,n,a,s,o)}async swap(e,t,r,i,n,a,s,o=!1,c=!1){return h.isSolanaLike(this.getCurrentChainId())?this.swapSolana(e,t,i,n,a,o):K.hinkalSwap(this,e,t,r,i,n,a,s,o,c)}async swapSolana(e,t,r,i,n,a=!1){const s=JSON.parse(r),{instructionLists:o,addressLookupTableAccount:c}=s.data;return pe.hinkalSolanaSwap(this,e,t,o,c,i,n,a)}async actionReceive(e,t,r,i,n,a,s=!1){if(!n)throw new Error("subAccount is required");return h.isSolanaLike(this.getCurrentChainId())?E.hinkalSolanaProxyShield(this,e[0],t[0],n,void 0,s):G.hinkalActionReceive(this,e,t,r,i,n,a,s)}async actionFundApproveAndTransact(e,t,r,i,n,a,s,o,c=!1,d,p,l){return ee.hinkalActionFundApproveAndTransact(this,e,t,r,i,n,a,s,o,c,d,p,l)}async actionPrivateWallet(e,t,r,i,n,a,s,o,c,d=!1,p,l,u,k=!1){return j.hinkalPrivateWallet(this,e,t,r,i,n,a,s,o,c,d,p,l,u,k)}async approve(e,t,r,i,n,a=!1){return V.hinkalApprove(this,e,t,r,i,n,a)}async hinkalInsideTransact(e,t,r,i,n,a,s,o,c,d=!1){return X.hinkalInsideTransact(this,e,t,r,i,n,a,s,o,c,d)}async proxySwap(e,t,r,i,n,a,s,o,c=!1,d,p,l=!1){return h.isSolanaLike(this.getCurrentChainId())?ge.hinkalSolanaProxySwap(this,e,t,i,a,s,o,l):ae.hinkalProxySwap(this,e,t,r,i,n,a,s,o,c,d,p,l)}async proxyToPrivate(e,t,r,i,n,a,s,o=!1){return h.isSolanaLike(this.getCurrentChainId())?E.hinkalSolanaProxyShield(this,e[0],t[0],r,i,o):ce.hinkalProxyToPrivate(this,e,t,i,n,a,r,s,o)}async proxySend(e,t,r,i,n,a,s,o=!1){if(h.isSolanaLike(this.getCurrentChainId()))return ue.hinkalSolanaProxySend(this,e[0],t[0],r,i,o);const c=ie.createTransaferEmporiumOpsBatch(this,e.map(l=>l.erc20TokenAddress),t,i),d=e.map((l,u)=>({token:l,amount:-1n*t[u]}));return await this.actionPrivateWallet([],[],[],c,d,r,n,a,void 0,void 0,void 0,s,void 0,o)}async multiSendPrivateRecipients(e,t,r){return se.hinkalMultiSendPrivateRecipients(this,e,t,r)}areMerkleTreeUpdatesDisabled(){return this.disableMerkleTreeUpdates}updateMerkleTreeUpdates(e){this.disableMerkleTreeUpdates=e}}exports.Hinkal=ke;
|
|
@@ -6,12 +6,8 @@ import { ExternalActionId } from '../../types/external-action.types';
|
|
|
6
6
|
import { type IMultiThreadedUtxoUtils } from '../../types/IMultiThreadedUtxoUtils';
|
|
7
7
|
import { type RelayerTransaction } from '../../types/relayer.types';
|
|
8
8
|
import { type SignatureData } from '../../types/crypto.types';
|
|
9
|
-
import type { ERC20Token, TokenBalance, TokenChanges } from '../../types/token.types';
|
|
9
|
+
import type { ERC20Token, PrivateRecipientInfo, TokenBalance, TokenChanges } from '../../types/token.types';
|
|
10
10
|
import { UserKeys } from '../crypto-keys/keys';
|
|
11
|
-
import { type ClientAccessTokenSnapshotService } from '../snapshot/ClientAccessTokenSnapshotService';
|
|
12
|
-
import { type ClientCommitmentsSnapshotService } from '../snapshot/ClientCommitmentsSnapshotService';
|
|
13
|
-
import { type ClientNullifierSnapshotService } from '../snapshot/ClientNullifierSnapshotService';
|
|
14
|
-
import { type ClientApprovalsSnapshotService } from '../snapshot/ClientApprovalsSnapshotService';
|
|
15
11
|
import { type IProviderAdapter } from '../provider-adapter/IProviderAdapter';
|
|
16
12
|
import { type IHinkal } from './IHinkal';
|
|
17
13
|
import { MerkleTree } from '../merkle-tree';
|
|
@@ -20,6 +16,9 @@ import { type ICacheDevice } from '../../types/ICacheDevice';
|
|
|
20
16
|
import type { StealthAddressStructure, TypedData } from '../../types/circom-data.types';
|
|
21
17
|
import { SubAccount } from '../../types/proxy.types';
|
|
22
18
|
import { AdminTransactionType } from '../../types/admin.types';
|
|
19
|
+
import { ClientAccessTokenSnapshotService, ClientApprovalsSnapshotService, ClientCommitmentsSnapshotService, ClientNullifierSnapshotService, ClientSolanaAccessTokenSnapshotService, ClientSolanaCommitmentsSnapshotService, ClientSolanaNullifierSnapshotService } from '../snapshot';
|
|
20
|
+
import { Idl, Program } from '@coral-xyz/anchor';
|
|
21
|
+
import { PublicKey } from '@solana/web3.js';
|
|
23
22
|
export declare class Hinkal<ConnectorType> implements IHinkal {
|
|
24
23
|
private providerAdapter?;
|
|
25
24
|
userKeys: UserKeys;
|
|
@@ -29,9 +28,9 @@ export declare class Hinkal<ConnectorType> implements IHinkal {
|
|
|
29
28
|
nullifiers: Set<string>;
|
|
30
29
|
encryptedOutputs: EncryptedOutputWithSign[];
|
|
31
30
|
approvals: Map<string, ApprovedUtxo[]>;
|
|
32
|
-
commitmentsSnapshotService?: ClientCommitmentsSnapshotService;
|
|
33
|
-
nullifierSnapshotService?: ClientNullifierSnapshotService;
|
|
34
|
-
accessTokenSnapshotService?: ClientAccessTokenSnapshotService;
|
|
31
|
+
commitmentsSnapshotService?: ClientCommitmentsSnapshotService | ClientSolanaCommitmentsSnapshotService;
|
|
32
|
+
nullifierSnapshotService?: ClientNullifierSnapshotService | ClientSolanaNullifierSnapshotService;
|
|
33
|
+
accessTokenSnapshotService?: ClientAccessTokenSnapshotService | ClientSolanaAccessTokenSnapshotService;
|
|
35
34
|
approvalsSnapshotService?: ClientApprovalsSnapshotService;
|
|
36
35
|
utxoUtils: IMultiThreadedUtxoUtils;
|
|
37
36
|
cacheDevice: ICacheDevice;
|
|
@@ -83,7 +82,7 @@ export declare class Hinkal<ConnectorType> implements IHinkal {
|
|
|
83
82
|
resetCache(): void;
|
|
84
83
|
snapshotsClearInterval(): void;
|
|
85
84
|
checkTokenRegistry(erc20Addresses: string[], amountChanges: bigint[]): Promise<boolean>;
|
|
86
|
-
getRecipientInfo(
|
|
85
|
+
getRecipientInfo(): string;
|
|
87
86
|
getInteractionApprovals(interactionAddress: string): Promise<ApprovedUtxo[]>;
|
|
88
87
|
getApprovedUtxos(resetCacheBefore?: boolean): ApprovedUtxoWithInteractionAddress[];
|
|
89
88
|
getApprovedUtxosForToken(erc20Address: string, resetCacheBefore?: boolean): ApprovedUtxoWithInteractionAddress[];
|
|
@@ -92,16 +91,26 @@ export declare class Hinkal<ConnectorType> implements IHinkal {
|
|
|
92
91
|
getBufferEntry(approveTo: string, tokenAddress: string, inHinkalAddress: bigint): Promise<bigint>;
|
|
93
92
|
deposit(erc20Tokens: ERC20Token[], amountChanges: bigint[]): Promise<ethers.ContractTransaction>;
|
|
94
93
|
depositForOther(erc20Tokens: ERC20Token[], amountChanges: bigint[], recipientInfo: string): Promise<ethers.ContractTransaction>;
|
|
94
|
+
depositAndWithdraw(erc20Token: ERC20Token, recipientAmounts: Record<string, bigint>, txCompletionTime?: number, feeStructureOverride?: FeeStructure): Promise<string>;
|
|
95
95
|
prooflessDeposit(erc20Tokens: ERC20Token[], amountChanges: bigint[], stealthAddressStructures?: StealthAddressStructure[]): Promise<ethers.ContractTransaction>;
|
|
96
|
+
getSolanaProgram(idl: Idl): Program;
|
|
97
|
+
getSolanaPublicKey(): PublicKey;
|
|
98
|
+
depositSolana(amount: bigint, mintAddress: string): Promise<string>;
|
|
99
|
+
depositSolanaForOther(amount: bigint, mintAddress: string, recipientInfo: string): Promise<string>;
|
|
100
|
+
solanaMultiPaymentDeposit(amounts: bigint[], mintAddress: string): Promise<string>;
|
|
101
|
+
solanaDepositAndWithdraw(mintAddress: string, recipientAmounts: Record<string, bigint>, txCompletionTime?: number, feeStructureOverride?: FeeStructure): Promise<string>;
|
|
96
102
|
transfer(erc20Tokens: ERC20Token[], amountChanges: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
97
103
|
withdraw(erc20Tokens: ERC20Token[], deltaAmounts: bigint[], recipientAddress: string, isRelayerOff: boolean, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<ethers.ContractTransaction | RelayerTransaction | bigint>;
|
|
98
104
|
swap(erc20Tokens: ERC20Token[], deltaAmounts: bigint[], externalActionId: ExternalActionId, swapData: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean, withPrivateMempool?: boolean): Promise<RelayerTransaction | bigint>;
|
|
105
|
+
swapSolana(erc20Tokens: ERC20Token[], deltaAmounts: bigint[], swapData: string, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean): Promise<RelayerTransaction>;
|
|
99
106
|
actionReceive(erc20Tokens: ERC20Token[], deltaAmounts: bigint[], feeToken?: string, feeStructureOverride?: FeeStructure, subAccount?: SubAccount, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
100
107
|
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>;
|
|
101
|
-
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>;
|
|
108
|
+
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>;
|
|
102
109
|
approve(erc20Addresses: string[], amount: bigint, approveTo: string, feeToken?: string, feeStructureOverride?: FeeStructure, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
103
110
|
hinkalInsideTransact(erc20Addresses: string[], deltaChanges: bigint[], approvalChanges: bigint[], externalAddress: string, externalActionMetadata: string, parsedInLogicMetadata: ParsedInLogicMetadata, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
104
111
|
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>;
|
|
112
|
+
proxyToPrivate(erc20Tokens: ERC20Token[], deltaAmountsBase: bigint[], subAccount: SubAccount, recipientInfo: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
113
|
+
proxySend(erc20Tokens: ERC20Token[], amounts: bigint[], subAccount: SubAccount, recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean): Promise<RelayerTransaction | bigint>;
|
|
105
114
|
multiSendPrivateRecipients(erc20Tokens: ERC20Token[], amounts: bigint[], extendedRecipientInfos?: string[]): Promise<ethers.ContractTransaction>;
|
|
106
115
|
areMerkleTreeUpdatesDisabled(): boolean;
|
|
107
116
|
updateMerkleTreeUpdates(value: boolean): void;
|