@hinkal/common 0.2.21 → 0.2.22
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 +14 -14
- package/API/API.mjs +88 -87
- package/API/admin-calls.cjs +1 -1
- package/API/admin-calls.d.ts +1 -1
- package/API/admin-calls.mjs +4 -4
- package/API/ai-calls.cjs +1 -0
- package/API/ai-calls.d.ts +17 -0
- package/API/ai-calls.mjs +21 -0
- package/API/callLifiAPI.cjs +1 -1
- package/API/callLifiAPI.d.ts +1 -1
- package/API/callLifiAPI.mjs +5 -5
- package/API/callMonitor.cjs +1 -1
- package/API/callMonitor.d.ts +1 -1
- package/API/callMonitor.mjs +7 -7
- package/API/callOdosAPI.cjs +1 -1
- package/API/callOdosAPI.mjs +11 -11
- package/API/callOkxAPI.cjs +1 -1
- package/API/callOkxAPI.d.ts +1 -1
- package/API/callOkxAPI.mjs +5 -5
- package/API/callOneInchAPI.cjs +1 -1
- package/API/callOneInchAPI.mjs +11 -10
- package/API/callRelayer.cjs +1 -1
- package/API/callRelayer.d.ts +5 -6
- package/API/callRelayer.mjs +11 -11
- package/API/checkRisk.cjs +1 -1
- package/API/checkRisk.d.ts +1 -1
- package/API/checkRisk.mjs +4 -4
- package/API/deposit-and-withdraw-status-calls.cjs +1 -0
- package/API/deposit-and-withdraw-status-calls.d.ts +20 -0
- package/API/deposit-and-withdraw-status-calls.mjs +18 -0
- package/API/duneAPI.cjs +1 -0
- package/API/duneAPI.d.ts +11 -0
- package/API/duneAPI.mjs +25 -0
- package/API/enclaveCalls.cjs +1 -1
- package/API/enclaveCalls.mjs +4 -5
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.mjs +9 -9
- package/API/get-token-data.cjs +1 -1
- package/API/get-token-data.d.ts +1 -1
- package/API/get-token-data.mjs +5 -5
- package/API/getBridgeProtocols.cjs +1 -0
- package/API/getBridgeProtocols.d.ts +7 -0
- package/API/getBridgeProtocols.mjs +8 -0
- package/API/getGasEstimates.cjs +1 -1
- package/API/getGasEstimates.mjs +9 -9
- package/API/getLifiStatus.cjs +1 -0
- package/API/getLifiStatus.d.ts +24 -0
- package/API/getLifiStatus.mjs +15 -0
- package/API/getRelayerURL.cjs +1 -0
- package/API/getRelayerURL.d.ts +1 -0
- package/API/getRelayerURL.mjs +10 -0
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.d.ts +3 -3
- package/API/getServerURL.mjs +67 -51
- package/API/getTokenPrice.cjs +1 -1
- package/API/getTokenPrice.d.ts +0 -5
- package/API/getTokenPrice.mjs +7 -14
- package/API/index.d.ts +3 -1
- package/API/is-tx-stateless.cjs +1 -1
- package/API/is-tx-stateless.d.ts +1 -1
- package/API/is-tx-stateless.mjs +12 -10
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +8 -4
- package/API/kycCalls.mjs +26 -23
- package/API/passwordCalls.cjs +1 -0
- package/API/passwordCalls.d.ts +9 -0
- package/API/passwordCalls.mjs +13 -0
- package/API/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.d.ts +2 -7
- package/API/proxyAccountsCalls.mjs +21 -27
- package/API/relayCalls.cjs +1 -1
- package/API/relayCalls.mjs +4 -4
- package/API/restoreSnapshots.cjs +1 -0
- package/API/restoreSnapshots.d.ts +1 -0
- package/API/restoreSnapshots.mjs +10 -0
- package/API/scheduled-transactions-calls.cjs +1 -1
- package/API/scheduled-transactions-calls.d.ts +9 -1
- package/API/scheduled-transactions-calls.mjs +9 -5
- package/API/simulate-batch-tx.cjs +1 -1
- package/API/simulate-batch-tx.d.ts +2 -2
- package/API/simulate-batch-tx.mjs +6 -7
- package/API/solana-calls.cjs +1 -1
- package/API/solana-calls.d.ts +3 -6
- package/API/solana-calls.mjs +15 -15
- package/API/temporaryWalletCalls.cjs +1 -1
- package/API/temporaryWalletCalls.mjs +19 -13
- package/API/token-calls.cjs +1 -1
- package/API/token-calls.mjs +5 -6
- package/README.md +54 -42
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +6 -0
- package/constants/chains.constants.mjs +52 -58
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +0 -1
- package/constants/coingecko.constants.mjs +10 -11
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-solana.json.mjs +2 -28
- package/constants/function-signatures.constants.cjs +1 -1
- package/constants/function-signatures.constants.d.ts +1 -0
- package/constants/function-signatures.constants.mjs +4 -3
- package/constants/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.mjs +40 -39
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +0 -1
- package/constants/mediaUrls.constants.mjs +1 -2
- package/constants/permit2.constants.cjs +1 -1
- package/constants/permit2.constants.d.ts +1 -0
- package/constants/permit2.constants.mjs +11 -10
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +123 -19
- package/constants/server.constants.mjs +142 -38
- package/constants/vite.constants.cjs +1 -1
- package/constants/vite.constants.mjs +13 -36
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +71 -68
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +56 -45
- package/data-structures/Hinkal/Hinkal.mjs +348 -314
- package/data-structures/Hinkal/IHinkal.d.ts +54 -40
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.d.ts +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +49 -48
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +1 -0
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +7 -0
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +42 -0
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.mjs +24 -29
- package/data-structures/Hinkal/hinkalApprove.cjs +1 -0
- package/data-structures/Hinkal/hinkalApprove.d.ts +3 -0
- package/data-structures/Hinkal/hinkalApprove.mjs +114 -0
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +20 -20
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.mjs +84 -88
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +96 -77
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +4 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +80 -75
- package/data-structures/Hinkal/hinkalDepostAndBridge.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepostAndBridge.d.ts +1 -1
- package/data-structures/Hinkal/hinkalDepostAndBridge.mjs +150 -138
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +5 -4
- package/data-structures/Hinkal/hinkalInsideTransact.cjs +1 -0
- package/data-structures/Hinkal/hinkalInsideTransact.d.ts +4 -0
- package/data-structures/Hinkal/hinkalInsideTransact.mjs +119 -0
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +118 -114
- package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +34 -36
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.mjs +36 -40
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +32 -37
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +2 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +15 -17
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +3 -4
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +95 -84
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +1 -2
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +182 -155
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +3 -2
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +40 -43
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +67 -71
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +59 -63
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +45 -48
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +48 -49
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +1 -2
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +68 -71
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +78 -71
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +70 -71
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +79 -81
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +103 -105
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +53 -107
- 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 +75 -91
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +37 -40
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +13 -16
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +40 -25
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +84 -82
- package/data-structures/TokenDBs/token-visibility-db.cjs +1 -1
- package/data-structures/TokenDBs/token-visibility-db.mjs +36 -22
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +11 -0
- package/data-structures/crypto-keys/keys.mjs +107 -47
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.d.ts +2 -3
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.mjs +9 -9
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.d.ts +2 -3
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.mjs +5 -5
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.d.ts +2 -3
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.mjs +6 -6
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractEventService.d.ts +2 -4
- package/data-structures/event-service/evm/AbstractEventService.mjs +19 -19
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +3 -3
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +5 -6
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +2 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.mjs +4 -3
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +5 -10
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +35 -39
- package/data-structures/event-service/index.d.ts +0 -4
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +2 -3
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +6 -6
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.d.ts +3 -4
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +8 -8
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +10 -4
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +7 -10
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +2 -3
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +2 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +2 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +16 -11
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +66 -64
- package/data-structures/index.d.ts +0 -3
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +13 -8
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +4 -6
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +4 -6
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +4 -6
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +4 -6
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +4 -6
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +4 -5
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +4 -6
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +0 -1
- package/error-handling/error-codes.constants.mjs +3 -4
- package/error-handling/get-error.message.cjs +1 -1
- package/error-handling/get-error.message.mjs +27 -21
- package/error-handling/handleErrorRestore.cjs +1 -0
- package/error-handling/handleErrorRestore.d.ts +2 -0
- package/error-handling/handleErrorRestore.mjs +11 -0
- package/error-handling/index.d.ts +1 -0
- package/functions/kyc/authentoHelper.cjs +1 -0
- package/functions/kyc/authentoHelper.d.ts +12 -0
- package/functions/kyc/authentoHelper.mjs +30 -0
- package/functions/kyc/zkMeHelper.cjs +1 -1
- package/functions/kyc/zkMeHelper.mjs +17 -18
- package/functions/pre-transaction/constructAdminData.cjs +1 -1
- package/functions/pre-transaction/constructAdminData.d.ts +2 -2
- package/functions/pre-transaction/constructAdminData.mjs +18 -12
- package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
- package/functions/pre-transaction/getExternalSwapAddress.d.ts +2 -1
- package/functions/pre-transaction/getExternalSwapAddress.mjs +8 -8
- package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +36 -21
- package/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
- package/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +1 -1
- package/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +17 -17
- package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -1
- package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +9 -1
- package/functions/pre-transaction/outputApprovalDataProcessing.mjs +34 -19
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -1
- package/functions/pre-transaction/sendV0Transaction.mjs +50 -53
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +4 -4
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +6 -3
- package/functions/private-wallet/emporium.helpers.mjs +127 -89
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.d.ts +4 -1
- package/functions/private-wallet/emporium.swap.helpers.mjs +102 -100
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.mjs +49 -49
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/functions/snarkjs/constructSolanaZkProof.mjs +20 -18
- package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +10 -11
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +0 -1
- package/functions/utils/addresses.mjs +12 -13
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.mjs +2 -2
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +1 -1
- package/functions/utils/create-provider.mjs +9 -13
- package/functions/utils/get-hinkal-approvals.cjs +1 -0
- package/functions/utils/get-hinkal-approvals.d.ts +3 -0
- package/functions/utils/get-hinkal-approvals.mjs +38 -0
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.mjs +11 -11
- package/functions/utils/index.d.ts +1 -0
- package/functions/utils/involves-permit2-op.cjs +1 -1
- package/functions/utils/involves-permit2-op.d.ts +1 -0
- package/functions/utils/involves-permit2-op.mjs +6 -4
- package/functions/utils/mutexes.utils.cjs +1 -1
- package/functions/utils/mutexes.utils.d.ts +1 -1
- package/functions/utils/mutexes.utils.mjs +3 -3
- package/functions/utils/nftTokenFunctions.cjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +23 -8
- package/functions/utils/prepareHinkal.cjs +1 -1
- package/functions/utils/prepareHinkal.d.ts +13 -6
- package/functions/utils/prepareHinkal.mjs +72 -45
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.mjs +54 -49
- package/functions/utils/replaceAddressInCalldata.cjs +1 -0
- package/functions/utils/replaceAddressInCalldata.d.ts +1 -0
- package/functions/utils/replaceAddressInCalldata.mjs +7 -0
- package/functions/utils/string.utils.cjs +1 -1
- package/functions/utils/string.utils.d.ts +0 -1
- package/functions/utils/string.utils.mjs +14 -18
- package/functions/utils/token-check.utils.cjs +1 -1
- package/functions/utils/token-check.utils.d.ts +0 -3
- package/functions/utils/token-check.utils.mjs +7 -18
- package/functions/utils/upToDateState.cjs +1 -1
- package/functions/utils/upToDateState.d.ts +1 -1
- package/functions/utils/upToDateState.mjs +4 -4
- package/functions/utils/walletBalances.utils.cjs +1 -1
- package/functions/utils/walletBalances.utils.d.ts +17 -2
- package/functions/utils/walletBalances.utils.mjs +36 -5
- package/functions/web3/events/getApprovedBalance.cjs +1 -1
- package/functions/web3/events/getApprovedBalance.d.ts +4 -3
- package/functions/web3/events/getApprovedBalance.mjs +44 -39
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.d.ts +3 -3
- package/functions/web3/events/getInputUtxoAndBalance.mjs +150 -129
- package/functions/web3/events/getShieldedBalance.cjs +2 -2
- package/functions/web3/events/getShieldedBalance.d.ts +1 -1
- package/functions/web3/events/getShieldedBalance.mjs +75 -73
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.mjs +38 -38
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +10 -13
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +6 -1
- package/functions/web3/functionCalls/accessTokenCalls.mjs +21 -12
- package/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/functions/web3/functionCalls/approveToken.d.ts +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +46 -50
- package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -1
- package/functions/web3/functionCalls/approveTokensToHinkal.d.ts +1 -1
- package/functions/web3/functionCalls/approveTokensToHinkal.mjs +6 -6
- package/functions/web3/functionCalls/estimateGasRelayer.cjs +1 -1
- package/functions/web3/functionCalls/estimateGasRelayer.d.ts +2 -1
- package/functions/web3/functionCalls/estimateGasRelayer.mjs +10 -10
- package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +1 -0
- package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +5 -0
- package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +32 -0
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.d.ts +1 -1
- package/functions/web3/functionCalls/transactCallDirect.mjs +40 -36
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +3 -3
- package/functions/web3/functionCalls/transactCallRelayer.mjs +54 -54
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +22 -17
- package/functions/web3/getPublicAddressBalance.cjs +1 -1
- package/functions/web3/getPublicAddressBalance.d.ts +1 -1
- package/functions/web3/getPublicAddressBalance.mjs +6 -6
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +27 -27
- package/functions/web3/index.d.ts +0 -1
- package/functions/web3/lifiAPI.cjs +1 -1
- package/functions/web3/lifiAPI.d.ts +1 -1
- package/functions/web3/lifiAPI.mjs +12 -12
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.mjs +19 -6
- package/functions/web3/okxAPI.cjs +1 -1
- package/functions/web3/okxAPI.mjs +13 -13
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +20 -7
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +56 -38
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +34 -22
- package/index.cjs +1 -1
- package/index.mjs +922 -920
- package/package.json +2 -3
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +17 -10
- package/providers/EthersProviderAdapter.mjs +76 -45
- package/providers/SolanaProviderAdapter.cjs +1 -1
- package/providers/SolanaProviderAdapter.d.ts +11 -7
- package/providers/SolanaProviderAdapter.mjs +31 -16
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +17 -11
- package/providers/WagmiProviderAdapter.mjs +117 -86
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +9 -14
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +9 -15
- package/types/TransactionSimulator.types.d.ts +9 -2
- package/types/activities.types.d.ts +0 -2
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +6 -0
- package/types/admin.types.mjs +2 -2
- package/types/balances.types.d.ts +1 -0
- package/types/bridging.types.d.ts +29 -0
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +3 -6
- package/types/cache.types.mjs +1 -1
- package/types/coingecko.types.d.ts +0 -5
- package/types/duneAPI.types.d.ts +9 -0
- package/types/ethereum-network.types.d.ts +0 -1
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +1 -1
- package/types/hinkal.types.mjs +18 -18
- package/types/index.d.ts +2 -2
- package/types/proxy.types.d.ts +3 -6
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +39 -10
- package/types/sandbox.types.mjs +2 -2
- package/types/scheduled-transactions.types.cjs +1 -1
- package/types/scheduled-transactions.types.d.ts +6 -0
- package/types/scheduled-transactions.types.mjs +3 -2
- package/types/session.types.d.ts +0 -2
- package/types/solana.types.d.ts +0 -9
- package/types/token-prices.types.cjs +1 -1
- package/types/token-prices.types.d.ts +0 -7
- package/types/token-prices.types.mjs +2 -4
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/viteWorkerURL.constant.cjs +3 -3
- package/webworker/viteWorkerURL.constant.mjs +3 -3
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
- package/API/get-token-price-chart-data.cjs +0 -1
- package/API/get-token-price-chart-data.d.ts +0 -16
- package/API/get-token-price-chart-data.mjs +0 -13
- package/API/onrampCalls.cjs +0 -1
- package/API/onrampCalls.d.ts +0 -20
- package/API/onrampCalls.mjs +0 -15
- package/API/unspent-utxos-calls.cjs +0 -1
- package/API/unspent-utxos-calls.d.ts +0 -26
- package/API/unspent-utxos-calls.mjs +0 -26
- package/data-structures/AccountActions/AccountActions.cjs +0 -1
- package/data-structures/AccountActions/AccountActions.d.ts +0 -18
- package/data-structures/AccountActions/AccountActions.mjs +0 -78
- package/data-structures/AccountActions/index.d.ts +0 -1
- package/data-structures/BlockchainEvent/BlockchainEvent.cjs +0 -1
- package/data-structures/BlockchainEvent/BlockchainEvent.d.ts +0 -14
- package/data-structures/BlockchainEvent/BlockchainEvent.mjs +0 -41
- package/data-structures/PublicBalance/PublicBalanceWatcher.cjs +0 -1
- package/data-structures/PublicBalance/PublicBalanceWatcher.d.ts +0 -20
- package/data-structures/PublicBalance/PublicBalanceWatcher.mjs +0 -124
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.cjs +0 -1
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.d.ts +0 -15
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.mjs +0 -64
- package/data-structures/PublicBalance/index.d.ts +0 -2
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +0 -1
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.d.ts +0 -11
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +0 -21
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.cjs +0 -1
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.d.ts +0 -6
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.mjs +0 -16
- package/data-structures/event-service/helpers/ClientEventHelper.cjs +0 -1
- package/data-structures/event-service/helpers/ClientEventHelper.d.ts +0 -11
- package/data-structures/event-service/helpers/ClientEventHelper.mjs +0 -26
- package/data-structures/event-service/helpers/PollingEventHelper.cjs +0 -1
- package/data-structures/event-service/helpers/PollingEventHelper.d.ts +0 -5
- package/data-structures/event-service/helpers/PollingEventHelper.mjs +0 -14
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.cjs +0 -1
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.d.ts +0 -11
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.mjs +0 -22
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.cjs +0 -1
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.d.ts +0 -6
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.mjs +0 -16
- package/functions/utils/enum.utils.cjs +0 -1
- package/functions/utils/enum.utils.mjs +0 -14
- package/functions/utils/socket.utils.cjs +0 -1
- package/functions/utils/socket.utils.d.ts +0 -1
- package/functions/utils/socket.utils.mjs +0 -12
- package/functions/web3/crypto.cjs +0 -1
- package/functions/web3/crypto.d.ts +0 -1
- package/functions/web3/crypto.mjs +0 -7
- package/types/events.types.cjs +0 -1
- package/types/events.types.d.ts +0 -9
- package/types/events.types.mjs +0 -5
- package/types/onramp.types.cjs +0 -1
- package/types/onramp.types.d.ts +0 -58
- package/types/onramp.types.mjs +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TaskTypes } from '../types';
|
|
2
2
|
export declare const API_CONFIG: {
|
|
3
3
|
ROUTES: {
|
|
4
4
|
checkKycStatus: string;
|
|
@@ -6,32 +6,37 @@ export declare const API_CONFIG: {
|
|
|
6
6
|
startReclaimVerification: string;
|
|
7
7
|
startUserVerification: string;
|
|
8
8
|
zkMeAccessToken: string;
|
|
9
|
-
getSnapshots:
|
|
9
|
+
getSnapshots: string;
|
|
10
10
|
getMerkleTreeSiblings: string;
|
|
11
|
-
getSnapshotServerNamespace: (chainId: number, eventCategory: EventCategory) => string;
|
|
12
11
|
callOdosAPI: string;
|
|
13
12
|
callOneInchAPI: string;
|
|
14
13
|
callLifiAPI: string;
|
|
15
14
|
callOkxAPI: string;
|
|
16
|
-
getOdosPriceForToken: (
|
|
15
|
+
getOdosPriceForToken: (tokenAddress: string) => string;
|
|
16
|
+
userHasKyc: string;
|
|
17
|
+
restoreSnapshots: string;
|
|
17
18
|
monitor: string;
|
|
18
19
|
checkRisk: (address: string) => string;
|
|
20
|
+
userHasPassword: (ethereumAddress: string) => string;
|
|
21
|
+
userRegisterPassword: string;
|
|
22
|
+
getPublicWalletInformation: (ethereumAddress: string) => string;
|
|
23
|
+
getTokenApprovalAmount: string;
|
|
24
|
+
getTokenSpendsFromOrderMessage: string;
|
|
19
25
|
isTxStateless: string;
|
|
20
26
|
simulateBatchTx: string;
|
|
21
27
|
simulateVolatileTokenTransfer: string;
|
|
22
28
|
getTokensInfo: string;
|
|
23
29
|
getTokenData: (tokenSymbol: string) => string;
|
|
30
|
+
getBridgeProtocols: string;
|
|
31
|
+
lifiStatus: string;
|
|
24
32
|
getProxyAccounts: (secureKey: string) => string;
|
|
25
33
|
updateProxyAccounts: string;
|
|
26
|
-
isVersion1Account: (secureKey: string) => string;
|
|
27
34
|
generateProoflessDepositLimitless: string;
|
|
28
35
|
generateMultiPaymentDepositLimitless: string;
|
|
29
36
|
generateAddAccessToken: string;
|
|
30
37
|
getTemporaryWalletNonces: (hashedEthereumAddress: string, chainId: number) => string;
|
|
31
38
|
addTemporaryWalletNonce: string;
|
|
32
39
|
removeTemporaryWalletNonce: string;
|
|
33
|
-
encodeMoonPayBuyUrl: string;
|
|
34
|
-
getMoonPayQuote: string;
|
|
35
40
|
};
|
|
36
41
|
};
|
|
37
42
|
export declare const RELAYER_CONFIG: {
|
|
@@ -44,11 +49,8 @@ export declare const RELAYER_CONFIG: {
|
|
|
44
49
|
getIdleRelay: string;
|
|
45
50
|
emitTxPublicData: string;
|
|
46
51
|
getScheduledTransactions: (hashedEthereumAddress: string) => string;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
deleteUnspentUtxos: string;
|
|
50
|
-
getTokenPriceChartData: string;
|
|
51
|
-
getTokenPreviousDayPrices: string;
|
|
52
|
+
getScheduledTransactionsNullifierIndexes: string;
|
|
53
|
+
updateDepositAndWithdrawStatus: string;
|
|
52
54
|
};
|
|
53
55
|
export declare const WALLET_TASK_VERIFICATION_TYPES: TaskTypes[];
|
|
54
56
|
export declare const VERIFICATION_ROUTES: Partial<Record<TaskTypes, (ethereumAddress: string) => string>>;
|
|
@@ -91,11 +93,113 @@ export declare const DATA_SERVER_CONFIG: {
|
|
|
91
93
|
export declare const PLAYGROUND_URL = "https://wallet-playground.hinkal.pro";
|
|
92
94
|
export declare const STAGING_URL = "https://wallet-staging.hinkal.pro";
|
|
93
95
|
export declare const PRODUCTION_URL = "https://wallet-prod.hinkal.pro";
|
|
94
|
-
export declare const SERVER_URL_LOCAL = "http://localhost:7072";
|
|
95
|
-
export declare const SERVER_URL_ENDPOINT = "/server";
|
|
96
|
-
export declare const RELAYER_URL_LOCAL = "http://localhost:7073";
|
|
97
|
-
export declare const RELAYER_URL_ENDPOINT = "/relayer";
|
|
98
|
-
export declare const SNAPSHOT_SERVER_URL_LOCAL = "http://localhost:7074";
|
|
99
|
-
export declare const SNAPSHOT_SERVER_URL_ENDPOINT = "/snapshot-server";
|
|
100
96
|
export declare const DATA_SERVER_URL_LOCAL = "http://localhost:7090";
|
|
101
|
-
export declare const DATA_SERVER_URL_ENDPOINT = "/data-server";
|
|
97
|
+
export declare const DATA_SERVER_URL_ENDPOINT = "/ethMainnet-data-server";
|
|
98
|
+
export declare const STAGING_SERVER_URLS: {
|
|
99
|
+
polygon: string;
|
|
100
|
+
arbMainnet: string;
|
|
101
|
+
ethMainnet: string;
|
|
102
|
+
bnbMainnet: string;
|
|
103
|
+
avalanche: string;
|
|
104
|
+
optimism: string;
|
|
105
|
+
base: string;
|
|
106
|
+
arcTestnet: string;
|
|
107
|
+
solanaMainnet: string;
|
|
108
|
+
localhost: string;
|
|
109
|
+
};
|
|
110
|
+
export declare const PLAYGROUND_SERVER_URLS: {
|
|
111
|
+
polygon: string;
|
|
112
|
+
arbMainnet: string;
|
|
113
|
+
ethMainnet: string;
|
|
114
|
+
bnbMainnet: string;
|
|
115
|
+
avalanche: string;
|
|
116
|
+
optimism: string;
|
|
117
|
+
base: string;
|
|
118
|
+
arcTestnet: string;
|
|
119
|
+
solanaMainnet: string;
|
|
120
|
+
localhost: string;
|
|
121
|
+
};
|
|
122
|
+
export declare const PRODUCTION_SERVER_URLS: {
|
|
123
|
+
polygon: string;
|
|
124
|
+
arbMainnet: string;
|
|
125
|
+
ethMainnet: string;
|
|
126
|
+
bnbMainnet: string;
|
|
127
|
+
avalanche: string;
|
|
128
|
+
optimism: string;
|
|
129
|
+
base: string;
|
|
130
|
+
arcTestnet: string;
|
|
131
|
+
solanaMainnet: string;
|
|
132
|
+
localhost: string;
|
|
133
|
+
};
|
|
134
|
+
export declare const STAGING_RELAYER_URLS: {
|
|
135
|
+
polygon: string;
|
|
136
|
+
arbMainnet: string;
|
|
137
|
+
ethMainnet: string;
|
|
138
|
+
bnbMainnet: string;
|
|
139
|
+
avalanche: string;
|
|
140
|
+
optimism: string;
|
|
141
|
+
base: string;
|
|
142
|
+
arcTestnet: string;
|
|
143
|
+
solanaMainnet: string;
|
|
144
|
+
localhost: string;
|
|
145
|
+
};
|
|
146
|
+
export declare const PLAYGROUND_RELAYER_URLS: {
|
|
147
|
+
polygon: string;
|
|
148
|
+
arbMainnet: string;
|
|
149
|
+
ethMainnet: string;
|
|
150
|
+
bnbMainnet: string;
|
|
151
|
+
avalanche: string;
|
|
152
|
+
optimism: string;
|
|
153
|
+
base: string;
|
|
154
|
+
arcTestnet: string;
|
|
155
|
+
solanaMainnet: string;
|
|
156
|
+
localhost: string;
|
|
157
|
+
};
|
|
158
|
+
export declare const PRODUCTION_RELAYER_URLS: {
|
|
159
|
+
polygon: string;
|
|
160
|
+
arbMainnet: string;
|
|
161
|
+
ethMainnet: string;
|
|
162
|
+
bnbMainnet: string;
|
|
163
|
+
avalanche: string;
|
|
164
|
+
optimism: string;
|
|
165
|
+
base: string;
|
|
166
|
+
arcTestnet: string;
|
|
167
|
+
solanaMainnet: string;
|
|
168
|
+
localhost: string;
|
|
169
|
+
};
|
|
170
|
+
export declare const PLAYGROUND_SNAPSHOT_SERVER_URLS: {
|
|
171
|
+
polygon: string;
|
|
172
|
+
arbMainnet: string;
|
|
173
|
+
ethMainnet: string;
|
|
174
|
+
bnbMainnet: string;
|
|
175
|
+
avalanche: string;
|
|
176
|
+
optimism: string;
|
|
177
|
+
base: string;
|
|
178
|
+
arcTestnet: string;
|
|
179
|
+
solanaMainnet: string;
|
|
180
|
+
localhost: string;
|
|
181
|
+
};
|
|
182
|
+
export declare const STAGING_SNAPSHOT_SERVER_URLS: {
|
|
183
|
+
polygon: string;
|
|
184
|
+
arbMainnet: string;
|
|
185
|
+
ethMainnet: string;
|
|
186
|
+
bnbMainnet: string;
|
|
187
|
+
avalanche: string;
|
|
188
|
+
optimism: string;
|
|
189
|
+
base: string;
|
|
190
|
+
arcTestnet: string;
|
|
191
|
+
solanaMainnet: string;
|
|
192
|
+
localhost: string;
|
|
193
|
+
};
|
|
194
|
+
export declare const PRODUCTION_SNAPSHOT_SERVER_URLS: {
|
|
195
|
+
polygon: string;
|
|
196
|
+
arbMainnet: string;
|
|
197
|
+
ethMainnet: string;
|
|
198
|
+
bnbMainnet: string;
|
|
199
|
+
avalanche: string;
|
|
200
|
+
optimism: string;
|
|
201
|
+
base: string;
|
|
202
|
+
arcTestnet: string;
|
|
203
|
+
solanaMainnet: string;
|
|
204
|
+
localhost: string;
|
|
205
|
+
};
|
|
@@ -2,42 +2,47 @@ import "../types/circom-data.types.mjs";
|
|
|
2
2
|
import "../types/transactions.types.mjs";
|
|
3
3
|
import "../types/activities.types.mjs";
|
|
4
4
|
import { TaskTypes as r } from "../types/new-rewards.type.mjs";
|
|
5
|
-
const
|
|
5
|
+
const b = {
|
|
6
6
|
ROUTES: {
|
|
7
7
|
checkKycStatus: "/check-kyc-status",
|
|
8
8
|
getUserSignature: "/signature-request",
|
|
9
9
|
startReclaimVerification: "/start-reclaim-verification",
|
|
10
10
|
startUserVerification: "/start-aiprise-verification",
|
|
11
11
|
zkMeAccessToken: "/zkMeAccessToken",
|
|
12
|
-
getSnapshots:
|
|
12
|
+
getSnapshots: "/snapshots",
|
|
13
13
|
getMerkleTreeSiblings: "/merkle-tree-siblings",
|
|
14
|
-
getSnapshotServerNamespace: (e, t) => `/events-${e}-${t}`,
|
|
15
14
|
callOdosAPI: "/OdosSwapData",
|
|
16
15
|
callOneInchAPI: "/OneInchSwapData",
|
|
17
16
|
callLifiAPI: "/LifiBridgeData",
|
|
18
17
|
callOkxAPI: "/OkxSwapData",
|
|
19
|
-
getOdosPriceForToken: (e
|
|
18
|
+
getOdosPriceForToken: (e) => `/getOdosPriceForToken/${e}`,
|
|
19
|
+
userHasKyc: "/user-has-kyc",
|
|
20
|
+
restoreSnapshots: "/snapshots/restore",
|
|
20
21
|
monitor: "/monitor",
|
|
21
22
|
checkRisk: (e) => `/check-risk/${e}`,
|
|
23
|
+
userHasPassword: (e) => `/user-has-password/${e}`,
|
|
24
|
+
userRegisterPassword: "/user-register-password",
|
|
25
|
+
getPublicWalletInformation: (e) => `/get-public-wallet-data/${e}`,
|
|
26
|
+
getTokenApprovalAmount: "/get-token-approval-amount-from-html",
|
|
27
|
+
getTokenSpendsFromOrderMessage: "/get-token-spends-from-order-message",
|
|
22
28
|
isTxStateless: "/is-tx-stateless",
|
|
23
29
|
simulateBatchTx: "/simulate-batch-tx",
|
|
24
30
|
simulateVolatileTokenTransfer: "/simulate-volatile-token-transfer",
|
|
25
31
|
getTokensInfo: "/get-tokens-info",
|
|
26
32
|
getTokenData: (e) => `/get-token-data/${e}`,
|
|
33
|
+
getBridgeProtocols: "/get-bridge-protocols",
|
|
34
|
+
lifiStatus: "/LifiStatus",
|
|
27
35
|
getProxyAccounts: (e) => `/get-proxy-accounts/${e}`,
|
|
28
36
|
updateProxyAccounts: "/update-proxy-accounts",
|
|
29
|
-
isVersion1Account: (e) => `/is-version1-account/${e}`,
|
|
30
37
|
generateProoflessDepositLimitless: "/generate-proofless-deposit-limitless",
|
|
31
38
|
generateMultiPaymentDepositLimitless: "/generate-multi-payment-deposit",
|
|
32
39
|
generateAddAccessToken: "/generate-add-access-token",
|
|
33
|
-
getTemporaryWalletNonces: (e,
|
|
40
|
+
getTemporaryWalletNonces: (e, n) => `/temporary-wallets/nonces/${e}/${n}`,
|
|
34
41
|
addTemporaryWalletNonce: "/temporary-wallets/add-nonce",
|
|
35
|
-
removeTemporaryWalletNonce: "/temporary-wallets/remove-nonce"
|
|
36
|
-
encodeMoonPayBuyUrl: "/moonpay-buy-url",
|
|
37
|
-
getMoonPayQuote: "/moonpay-quote"
|
|
42
|
+
removeTemporaryWalletNonce: "/temporary-wallets/remove-nonce"
|
|
38
43
|
}
|
|
39
|
-
},
|
|
40
|
-
getGasEstimate: (e,
|
|
44
|
+
}, $ = {
|
|
45
|
+
getGasEstimate: (e, n, o, l) => `/gas-estimation/${e}/${o}/${n}/${l}`,
|
|
41
46
|
getTokenPrices: "/get-token-prices",
|
|
42
47
|
TRANSACT: "/general-transact",
|
|
43
48
|
TRANSACT_BATCH: "/general-transact-batch",
|
|
@@ -46,12 +51,9 @@ const d = {
|
|
|
46
51
|
getIdleRelay: "/get-idle-relay",
|
|
47
52
|
emitTxPublicData: "/emit-tx-public-data",
|
|
48
53
|
getScheduledTransactions: (e) => `/scheduled-transactions/${e}`,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
getTokenPriceChartData: "/get-token-price-chart-data",
|
|
53
|
-
getTokenPreviousDayPrices: "/get-token-previous-day-prices"
|
|
54
|
-
}, a = [
|
|
54
|
+
getScheduledTransactionsNullifierIndexes: "/scheduled-transactions/nullifier-indexes",
|
|
55
|
+
updateDepositAndWithdrawStatus: "/update-deposit-and-withdraw-status"
|
|
56
|
+
}, i = [
|
|
55
57
|
r.firstSwap,
|
|
56
58
|
r.reclaim,
|
|
57
59
|
r.dailySwap,
|
|
@@ -59,18 +61,18 @@ const d = {
|
|
|
59
61
|
r.createOrJoinBH,
|
|
60
62
|
r.shieldUnshield,
|
|
61
63
|
r.moneyComes
|
|
62
|
-
],
|
|
64
|
+
], g = {
|
|
63
65
|
[r.discord]: (e) => `/verify/discord/${e}`,
|
|
64
66
|
[r.x]: (e) => `/verify/x/${e}`,
|
|
65
67
|
[r.xReferral]: (e) => `/verify/x-referral/${e}`,
|
|
66
68
|
[r.telegram]: (e) => `/verify/telegram/${e}`,
|
|
67
69
|
...Object.fromEntries(
|
|
68
|
-
|
|
70
|
+
i.map((e) => [
|
|
69
71
|
e,
|
|
70
|
-
(
|
|
72
|
+
(n) => `/verify/wallet-task/${n}`
|
|
71
73
|
])
|
|
72
74
|
)
|
|
73
|
-
},
|
|
75
|
+
}, m = {
|
|
74
76
|
createPresaleReferral: "/create-presale-referral",
|
|
75
77
|
updatePresaleReferralList: "/update-presale-referral-list",
|
|
76
78
|
generateTradingPoints: "/generate-trading-points",
|
|
@@ -105,22 +107,124 @@ const d = {
|
|
|
105
107
|
seedlessCheckPassword: "/seedless/check-password",
|
|
106
108
|
seedlessStatus: "/seedless/status",
|
|
107
109
|
seedlessSalt: "/seedless/salt"
|
|
108
|
-
},
|
|
110
|
+
}, a = "https://wallet-playground.hinkal.pro", t = "https://wallet-staging.hinkal.pro", s = "https://wallet-prod.hinkal.pro", v = "http://localhost:7090", u = "/ethMainnet-data-server", M = {
|
|
111
|
+
polygon: `${t}/polygon-server`,
|
|
112
|
+
arbMainnet: `${t}/arbMainnet-server`,
|
|
113
|
+
ethMainnet: `${t}/ethMainnet-server`,
|
|
114
|
+
bnbMainnet: `${t}/bnbMainnet-server`,
|
|
115
|
+
avalanche: `${t}/avalanche-server`,
|
|
116
|
+
optimism: `${t}/optimism-server`,
|
|
117
|
+
base: `${t}/base-server`,
|
|
118
|
+
arcTestnet: `${t}/arcTestnet-server`,
|
|
119
|
+
solanaMainnet: `${t}/solanaMainnet-server`,
|
|
120
|
+
localhost: "http://localhost:7072"
|
|
121
|
+
}, y = {
|
|
122
|
+
polygon: `${a}/polygon-server`,
|
|
123
|
+
arbMainnet: `${a}/arbMainnet-server`,
|
|
124
|
+
ethMainnet: `${a}/ethMainnet-server`,
|
|
125
|
+
bnbMainnet: `${a}/bnbMainnet-server`,
|
|
126
|
+
avalanche: `${a}/avalanche-server`,
|
|
127
|
+
optimism: `${a}/optimism-server`,
|
|
128
|
+
base: `${a}/base-server`,
|
|
129
|
+
arcTestnet: `${a}/arcTestnet-server`,
|
|
130
|
+
solanaMainnet: `${a}/solanaMainnet-server`,
|
|
131
|
+
localhost: "http://localhost:7072"
|
|
132
|
+
}, T = {
|
|
133
|
+
polygon: `${s}/polygon-server`,
|
|
134
|
+
arbMainnet: `${s}/arbMainnet-server`,
|
|
135
|
+
ethMainnet: `${s}/ethMainnet-server`,
|
|
136
|
+
bnbMainnet: `${s}/bnbMainnet-server`,
|
|
137
|
+
avalanche: `${s}/avalanche-server`,
|
|
138
|
+
optimism: `${s}/optimism-server`,
|
|
139
|
+
base: `${s}/base-server`,
|
|
140
|
+
arcTestnet: `${s}/arcTestnet-server`,
|
|
141
|
+
solanaMainnet: `${s}/solanaMainnet-server`,
|
|
142
|
+
localhost: "http://localhost:7072"
|
|
143
|
+
}, R = {
|
|
144
|
+
polygon: `${t}/polygon-relayer`,
|
|
145
|
+
arbMainnet: `${t}/arbMainnet-relayer`,
|
|
146
|
+
ethMainnet: `${t}/ethMainnet-relayer`,
|
|
147
|
+
bnbMainnet: `${t}/bnbMainnet-relayer`,
|
|
148
|
+
avalanche: `${t}/avalanche-relayer`,
|
|
149
|
+
optimism: `${t}/optimism-relayer`,
|
|
150
|
+
base: `${t}/base-relayer`,
|
|
151
|
+
arcTestnet: `${t}/arcTestnet-relayer`,
|
|
152
|
+
solanaMainnet: `${t}/solanaMainnet-relayer`,
|
|
153
|
+
localhost: "http://localhost:7073"
|
|
154
|
+
}, A = {
|
|
155
|
+
polygon: `${a}/polygon-relayer`,
|
|
156
|
+
arbMainnet: `${a}/arbMainnet-relayer`,
|
|
157
|
+
ethMainnet: `${a}/ethMainnet-relayer`,
|
|
158
|
+
bnbMainnet: `${a}/bnbMainnet-relayer`,
|
|
159
|
+
avalanche: `${a}/avalanche-relayer`,
|
|
160
|
+
optimism: `${a}/optimism-relayer`,
|
|
161
|
+
base: `${a}/base-relayer`,
|
|
162
|
+
arcTestnet: `${a}/arcTestnet-relayer`,
|
|
163
|
+
solanaMainnet: `${a}/solanaMainnet-relayer`,
|
|
164
|
+
localhost: "http://localhost:7073"
|
|
165
|
+
}, S = {
|
|
166
|
+
polygon: `${s}/polygon-relayer`,
|
|
167
|
+
arbMainnet: `${s}/arbMainnet-relayer`,
|
|
168
|
+
ethMainnet: `${s}/ethMainnet-relayer`,
|
|
169
|
+
bnbMainnet: `${s}/bnbMainnet-relayer`,
|
|
170
|
+
avalanche: `${s}/avalanche-relayer`,
|
|
171
|
+
optimism: `${s}/optimism-relayer`,
|
|
172
|
+
base: `${s}/base-relayer`,
|
|
173
|
+
arcTestnet: `${s}/arcTestnet-relayer`,
|
|
174
|
+
solanaMainnet: `${s}/solanaMainnet-relayer`,
|
|
175
|
+
localhost: "http://localhost:7073"
|
|
176
|
+
}, k = {
|
|
177
|
+
polygon: `${a}/polygon-snapshot-server`,
|
|
178
|
+
arbMainnet: `${a}/arbMainnet-snapshot-server`,
|
|
179
|
+
ethMainnet: `${a}/ethMainnet-snapshot-server`,
|
|
180
|
+
bnbMainnet: `${a}/bnbMainnet-snapshot-server`,
|
|
181
|
+
avalanche: `${a}/avalanche-snapshot-server`,
|
|
182
|
+
optimism: `${a}/optimism-snapshot-server`,
|
|
183
|
+
base: `${a}/base-snapshot-server`,
|
|
184
|
+
arcTestnet: `${a}/arcTestnet-snapshot-server`,
|
|
185
|
+
solanaMainnet: `${a}/solanaMainnet-snapshot-server`,
|
|
186
|
+
localhost: "http://localhost:7074"
|
|
187
|
+
}, f = {
|
|
188
|
+
polygon: `${t}/polygon-snapshot-server`,
|
|
189
|
+
arbMainnet: `${t}/arbMainnet-snapshot-server`,
|
|
190
|
+
ethMainnet: `${t}/ethMainnet-snapshot-server`,
|
|
191
|
+
bnbMainnet: `${t}/bnbMainnet-snapshot-server`,
|
|
192
|
+
avalanche: `${t}/avalanche-snapshot-server`,
|
|
193
|
+
optimism: `${t}/optimism-snapshot-server`,
|
|
194
|
+
base: `${t}/base-snapshot-server`,
|
|
195
|
+
arcTestnet: `${t}/arcTestnet-snapshot-server`,
|
|
196
|
+
solanaMainnet: `${t}/solanaMainnet-snapshot-server`,
|
|
197
|
+
localhost: "http://localhost:7074"
|
|
198
|
+
}, _ = {
|
|
199
|
+
polygon: `${s}/polygon-snapshot-server`,
|
|
200
|
+
arbMainnet: `${s}/arbMainnet-snapshot-server`,
|
|
201
|
+
ethMainnet: `${s}/ethMainnet-snapshot-server`,
|
|
202
|
+
bnbMainnet: `${s}/bnbMainnet-snapshot-server`,
|
|
203
|
+
avalanche: `${s}/avalanche-snapshot-server`,
|
|
204
|
+
optimism: `${s}/optimism-snapshot-server`,
|
|
205
|
+
base: `${s}/base-snapshot-server`,
|
|
206
|
+
arcTestnet: `${s}/arcTestnet-snapshot-server`,
|
|
207
|
+
solanaMainnet: `${s}/solanaMainnet-snapshot-server`,
|
|
208
|
+
localhost: "http://localhost:7074"
|
|
209
|
+
};
|
|
109
210
|
export {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
211
|
+
b as API_CONFIG,
|
|
212
|
+
m as DATA_SERVER_CONFIG,
|
|
213
|
+
u as DATA_SERVER_URL_ENDPOINT,
|
|
214
|
+
v as DATA_SERVER_URL_LOCAL,
|
|
215
|
+
A as PLAYGROUND_RELAYER_URLS,
|
|
216
|
+
y as PLAYGROUND_SERVER_URLS,
|
|
217
|
+
k as PLAYGROUND_SNAPSHOT_SERVER_URLS,
|
|
218
|
+
a as PLAYGROUND_URL,
|
|
219
|
+
S as PRODUCTION_RELAYER_URLS,
|
|
220
|
+
T as PRODUCTION_SERVER_URLS,
|
|
221
|
+
_ as PRODUCTION_SNAPSHOT_SERVER_URLS,
|
|
222
|
+
s as PRODUCTION_URL,
|
|
223
|
+
$ as RELAYER_CONFIG,
|
|
224
|
+
R as STAGING_RELAYER_URLS,
|
|
225
|
+
M as STAGING_SERVER_URLS,
|
|
226
|
+
f as STAGING_SNAPSHOT_SERVER_URLS,
|
|
227
|
+
t as STAGING_URL,
|
|
228
|
+
g as VERIFICATION_ROUTES,
|
|
229
|
+
i as WALLET_TASK_VERIFICATION_TYPES
|
|
126
230
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=(o=>(o.DEVELOPMENT="development",o.PLAYGROUND="playground",o.PRODUCTION="production",o.STAGING="staging",o))(n||{});const c=typeof process<"u"&&process?.release?.name==="node",t=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,p=!t&&typeof window<"u"&&window.origin==="null",l=typeof __webpack_require__<"u",u=typeof window<"u"&&window?.location?.protocol==="chrome-extension:",a=()=>"production",e=a(),i=e==="development",s=e==="playground",d=e==="staging",r=d||i||s,g=r||c&&e==="production";exports.DEPLOYMENT_MODE=n;exports.deploymentMode=e;exports.isDevelopment=i;exports.isExtension=u;exports.isNode=t;exports.isNotClientProduction=g;exports.isNotProduction=r;exports.isPlayground=s;exports.isSandbox=p;exports.isStaging=d;exports.isWebpack=l;
|
|
@@ -1,38 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const t = {
|
|
4
|
-
development: ["localhost", "192.", "127."],
|
|
5
|
-
playground: ["playground"],
|
|
6
|
-
staging: ["working", "staging"]
|
|
7
|
-
}, r = typeof process < "u" && process?.release?.name === "node", p = typeof process < "u" && process.versions != null && process.versions.node != null, v = !p && typeof window < "u" && window.origin === "null", w = typeof __webpack_require__ < "u", D = typeof window < "u" && window?.location?.protocol === "chrome-extension:";
|
|
8
|
-
function i(e, n) {
|
|
9
|
-
return n.some((c) => e.includes(c));
|
|
10
|
-
}
|
|
11
|
-
const u = () => (require("dotenv").config({
|
|
12
|
-
// allow overriding .env file path, see startServer.sh script for explenation on why it is needed
|
|
13
|
-
path: "DOTENV_OVERRIDE" in process.env ? process.env.DOTENV_OVERRIDE : void 0
|
|
14
|
-
}), d(s, process.env.DEPLOYMENT_MODE) || "development"), l = () => {
|
|
15
|
-
if (!r && typeof window > "u")
|
|
16
|
-
return;
|
|
17
|
-
if (r)
|
|
18
|
-
return u();
|
|
19
|
-
if (window?.location?.protocol === "chrome-extension:") {
|
|
20
|
-
const n = d(s, WALLET_DEPLOYMENT_MODE);
|
|
21
|
-
return n || "staging";
|
|
22
|
-
}
|
|
23
|
-
const e = window?.location?.host;
|
|
24
|
-
return i(e, t.development) ? "development" : i(e, t.playground) ? "playground" : i(e, t.staging) ? "staging" : "production";
|
|
25
|
-
}, o = l(), g = o === "development", a = o === "playground", f = o === "staging", m = f || g || a, E = m || r && o === "production";
|
|
1
|
+
var e = /* @__PURE__ */ ((o) => (o.DEVELOPMENT = "development", o.PLAYGROUND = "playground", o.PRODUCTION = "production", o.STAGING = "staging", o))(e || {});
|
|
2
|
+
const s = typeof process < "u" && process?.release?.name === "node", t = typeof process < "u" && process.versions != null && process.versions.node != null, u = !t && typeof window < "u" && window.origin === "null", l = typeof __webpack_require__ < "u", a = typeof window < "u" && window?.location?.protocol === "chrome-extension:", i = () => "production", n = i(), d = n === "development", r = n === "playground", c = n === "staging", p = c || d || r, g = p || s && n === "production";
|
|
26
3
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
4
|
+
e as DEPLOYMENT_MODE,
|
|
5
|
+
n as deploymentMode,
|
|
6
|
+
d as isDevelopment,
|
|
7
|
+
a as isExtension,
|
|
8
|
+
t as isNode,
|
|
9
|
+
g as isNotClientProduction,
|
|
10
|
+
p as isNotProduction,
|
|
11
|
+
r as isPlayground,
|
|
12
|
+
u as isSandbox,
|
|
13
|
+
c as isStaging,
|
|
14
|
+
l as isWebpack
|
|
38
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("ethers"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("ethers"),w=require("idb-keyval"),T=require("async-mutex"),h=require("../../constants/chains.constants.cjs"),P=require("../../error-handling/logger.cjs"),L=require("../../functions/utils/string.utils.cjs"),I=require("../../types/cache.types.cjs"),q=require("../http/HttpClient.cjs"),x=require("../../API/API.cjs"),f=require("../../types/approvals.types.cjs"),R=require("../../functions/utils/erc20tokenFunctions.cjs"),M=require("../../functions/utils/create-provider.cjs"),$=require("../../constants/events.constants.cjs"),m=require("../../functions/utils/caseInsensitive.utils.cjs"),_=require("../../constants/protocol.constants.cjs");class B{updateMutexes={};approvalTopic=S.ethers.utils.id("Approval(address,address,uint256)");approvalForAllTopic=S.ethers.utils.id("ApprovalForAll(address,address,bool)");getApprovedSelector=S.ethers.utils.id("getApproved(uint256)").substring(0,10);isApprovedForAllSelector=S.ethers.utils.id("isApprovedForAll(address,address)").substring(0,10);ALCHEMY_URLS={[h.chainIds.ethMainnet]:"eth-mainnet",[h.chainIds.polygon]:"polygon-mainnet",[h.chainIds.arbMainnet]:"arb-mainnet",[h.chainIds.optimism]:"opt-mainnet",[h.chainIds.base]:"base-mainnet",[h.chainIds.arcTestnet]:"arc-testnet",[h.chainIds.avalanche]:"avax-mainnet"};getMutex(t){return this.updateMutexes[t]||(this.updateMutexes[t]=new T.Mutex),this.updateMutexes[t]}getAlchemyUrl(t){const s=this.ALCHEMY_URLS[t];if(!s)throw new Error(`Unsupported chainId for Alchemy: ${t}`);return`https://${s}.g.alchemy.com/v2/${h.ALCHEMY_API_KEY}`}async getApprovals(t,s){const r=L.getStateKey(s,t);return(await w.get(I.StorageKeys.EVENTS_PUBLIC_APPROVALS))?.[r]||[]}async getLastProcessedBlock(t,s){const r=await w.get(I.StorageKeys.PUBLIC_APPROVALS_LAST_PROCESSED_BLOCKS)||{},d=L.getStateKey(s,t);return r[d]||$.EVENTS_INITIAL_BLOCKS[t]}async updateLastProcessedBlock(t,s,r){await w.update(I.StorageKeys.PUBLIC_APPROVALS_LAST_PROCESSED_BLOCKS,(d={})=>{const p=L.getStateKey(s,t);return{...d,[p]:r}})}async getApprovalEvents(t,s){try{const{fetchRpcUrl:r}=h.networkRegistry[s];if(!r)throw Error("No fetchRpcUrl in EventsPublicApprovalsDB");const d=M.createCustomRpcProvider(r),p=await this.getLastProcessedBlock(s,t)+1,l=await d.getBlockNumber();if(p>l)return{approvalEvents:[],latestBlock:l};const E=S.ethers.utils.hexZeroPad(t.toLowerCase(),32),c={topics:[[this.approvalTopic,this.approvalForAllTopic],E],fromBlock:p,toBlock:l};return{approvalEvents:await d.getLogs(c),latestBlock:l}}catch(r){return P.Logger.error("Failed to fetch approval events",r),{approvalEvents:[],latestBlock:void 0}}}async checkCurrentAllowances(t,s,r){const d=this.getAlchemyUrl(t),p=`0x${s.substring(2).padStart(64,"0")}`,l=[...new Set(r.map(e=>e.contractAddress))],E=(await x.API.tokensInfoCall(t,l)).filter(e=>!!e),c=new Map(E.map(e=>[e.erc20TokenAddress.toLowerCase(),e])),i=[],k=[];if(r.forEach((e,o)=>{const a=c.get(e.contractAddress.toLowerCase());if(a)if(!R.isNFTToken(a))i.push({jsonrpc:"2.0",id:i.length,method:"alchemy_getTokenAllowance",params:[{contract:e.contractAddress,owner:s,spender:e.spenderAddress}]}),k.push({pairIndex:o,type:f.RevokeType.ERC20});else{const v=`0x${e.spenderAddress.substring(2).padStart(64,"0")}`,y=`${this.isApprovedForAllSelector}${p.substring(2)}${v.substring(2)}`;i.push({jsonrpc:"2.0",id:i.length,method:"eth_call",params:[{to:e.contractAddress,data:y},"latest"]}),k.push({pairIndex:o,type:f.RevokeType.approvedForAll}),e.tokenIds&&e.tokenIds.size>0&&e.tokenIds.forEach(g=>{const C=S.ethers.BigNumber.from(g).toHexString().substring(2).padStart(64,"0"),b=`${this.getApprovedSelector}${C}`;i.push({jsonrpc:"2.0",id:i.length,method:"eth_call",params:[{to:e.contractAddress,data:b},"latest"]}),k.push({pairIndex:o,type:f.RevokeType.tokenId,tokenId:g})})}}),i.length===0)return[];const n=await q.httpClient.post(d,i),u=[],A=new Set;return n.forEach((e,o)=>{const a=k[o];if(!a)return;const v=r[a.pairIndex],y=c.get(v.contractAddress.toLowerCase());if(!(!y||m.caseInsensitiveEqual(v.spenderAddress,_.zeroAddress))&&!e?.error&&e?.result&&e.result!=="0x")try{if(a.type===f.RevokeType.ERC20&&BigInt(e.result)>0n)u.push({token:y,spenderAddress:v.spenderAddress,allowance:BigInt(e.result)});else if(a.type===f.RevokeType.approvedForAll&&BigInt(e.result)===1n)A.add(a.pairIndex),u.push({token:y,spenderAddress:v.spenderAddress,allowance:1n});else if(a.type===f.RevokeType.tokenId&&!A.has(a.pairIndex)){const g=`0x${e.result.substring(26)}`.toLowerCase();!m.caseInsensitiveEqual(g,_.zeroAddress)&&m.caseInsensitiveEqual(g,v.spenderAddress)&&u.push({token:y,spenderAddress:v.spenderAddress,allowance:1n,tokenId:a.tokenId})}}catch(g){P.Logger.error("Error processing approval response",g)}}),u}async fetchAndUpdatePublicApprovals(t,s){const r=L.getStateKey(t,s);await this.getMutex(r).runExclusive(async()=>{try{const{approvalEvents:p,latestBlock:l}=await this.getApprovalEvents(t,s);if(!l)return;const E=await this.getApprovals(s,t),c=new Map;if(E.forEach(n=>{const u=n.token.erc20TokenAddress.toLowerCase(),A=n.spenderAddress.toLowerCase(),e=`${u}_${A}`;let o=c.get(e);o||(o={contractAddress:u,spenderAddress:A,tokenIds:new Set},c.set(e,o)),n.tokenId&&o.tokenIds&&o.tokenIds.add(n.tokenId)}),p.forEach(n=>{if(!n.topics[2])return;const u=n.address.toLowerCase(),A=`0x${n.topics[2].substring(26)}`.toLowerCase();if(m.caseInsensitiveEqual(A,_.zeroAddress))return;const e=`${u}_${A}`;let o=c.get(e);if(o||(o={contractAddress:u,spenderAddress:A,tokenIds:new Set},c.set(e,o)),n.topics.length===4&&o.tokenIds){const a=BigInt(n.topics[3]).toString();o.tokenIds.add(a)}}),c.size===0){await this.updateLastProcessedBlock(s,t,l);return}const i=Array.from(c.values()),k=await this.checkCurrentAllowances(s,t,i);await w.update(I.StorageKeys.EVENTS_PUBLIC_APPROVALS,(n={})=>({...n,[r]:k})),await this.updateLastProcessedBlock(s,t,l)}catch(p){P.Logger.error("Failed to sync approvals",p)}})}}const K=new B;exports.EventsPublicApprovalsDB=B;exports.eventsPublicApprovalsDB=K;
|