h_test_1 0.0.46 → 0.0.48
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.mjs +1 -1
- package/API/accessCodeCalls.mjs +1 -1
- package/API/admin-calls.mjs +1 -1
- package/API/brotherhoodCalls.mjs +1 -1
- package/API/callLifiAPI.mjs +1 -1
- package/API/callMonitor.mjs +1 -1
- package/API/callOdosAPI.mjs +1 -1
- package/API/callOkxAPI.mjs +1 -1
- package/API/callOneInchAPI.mjs +1 -1
- package/API/callRelayer.mjs +1 -1
- package/API/checkRisk.mjs +1 -1
- package/API/deposit-and-withdraw-status-calls.mjs +1 -1
- package/API/enclaveSignatureCalls.mjs +1 -1
- package/API/enclaveUtxoCalls.mjs +1 -1
- package/API/fetchCommitmentsCache.mjs +1 -1
- package/API/generate-trading-points.mjs +1 -1
- package/API/get-token-data.mjs +1 -1
- package/API/get-token-price-chart-data.mjs +1 -1
- package/API/getCoingeckoPrice.mjs +1 -1
- package/API/getGasEstimates.mjs +1 -1
- package/API/getServerURL.mjs +1 -1
- package/API/getTokenPrice.mjs +1 -1
- package/API/getWebsiteURL.mjs +1 -1
- package/API/kycCalls.mjs +1 -1
- package/API/leaderboardCalls.mjs +1 -1
- package/API/onrampCalls.mjs +1 -1
- package/API/privacy-score-calls.mjs +1 -1
- package/API/privateSendEmailNotificationsCalls.mjs +1 -1
- package/API/privateSendNonceCalls.mjs +1 -1
- package/API/privateSendRecipientInfoCalls.mjs +1 -1
- package/API/proxyAccountsCalls.mjs +1 -1
- package/API/referralsCalls.mjs +1 -1
- package/API/relayCalls.mjs +1 -1
- package/API/resolve-sns.mjs +1 -1
- package/API/rewardsUserCalls.mjs +1 -1
- package/API/scheduled-transactions-calls.mjs +1 -1
- package/API/seedless-calls.mjs +1 -1
- package/API/send-telegram-callback.mjs +1 -1
- package/API/simulate-batch-tx.mjs +1 -1
- package/API/simulate-transaction.mjs +1 -1
- package/API/snapshot-event-calls.mjs +1 -1
- package/API/solana-calls.mjs +1 -1
- package/API/temporaryWalletCalls.mjs +1 -1
- package/API/tenderly.api.mjs +1 -1
- package/API/token-calls.mjs +1 -1
- package/API/tronSubsidyCalls.mjs +1 -1
- package/API/weeklyAnalyticCalls.mjs +1 -1
- package/constants/activity.constants.mjs +1 -1
- package/constants/addresses.constants.mjs +1 -1
- package/constants/assets.constants.mjs +1 -1
- package/constants/backend.constants.mjs +1 -1
- package/constants/balance.constants.mjs +1 -1
- package/constants/bridging.constants.mjs +1 -1
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.mjs +118 -120
- package/constants/coingecko.constants.mjs +1 -1
- package/constants/contracts.constants.mjs +1 -1
- package/constants/conversion.constants.mjs +1 -1
- package/constants/deploy-data/index.d.ts +1 -3
- package/constants/events.constants.mjs +1 -1
- package/constants/fees.constants.mjs +1 -1
- package/constants/function-signatures.constants.mjs +1 -1
- package/constants/images.constants.mjs +1 -1
- package/constants/index.cjs +1 -1
- package/constants/index.mjs +0 -2
- package/constants/kyc.constants.mjs +1 -1
- package/constants/lifi.constants.mjs +1 -1
- package/constants/link.constant.mjs +1 -1
- package/constants/mediaUrls.constants.mjs +1 -1
- package/constants/non-circular-tokens.constants.mjs +1 -1
- package/constants/oauthUrls.constants.mjs +1 -1
- package/constants/okx.constants.mjs +1 -1
- package/constants/pay.constants.mjs +1 -1
- package/constants/permit2.constants.mjs +1 -1
- package/constants/presale.constants.mjs +1 -1
- package/constants/protocol.constants.mjs +1 -1
- package/constants/reorg-depths.constants.mjs +1 -1
- package/constants/rewards.constants.mjs +1 -1
- package/constants/save-depths.mjs +1 -1
- package/constants/schedule.constants.mjs +1 -1
- package/constants/server.constants.mjs +1 -1
- package/constants/tasks.constants.mjs +1 -1
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +39 -51
- package/constants/token-data/index.cjs +1 -1
- package/constants/token-data/index.d.ts +1 -233
- package/constants/token-data/index.mjs +14 -18
- package/constants/token.limits.constants.mjs +1 -1
- package/constants/tokens.constants.mjs +1 -1
- package/constants/tx-confirmation.constants.mjs +1 -1
- package/constants/vite.constants.mjs +1 -1
- package/constants/wallet.constants.mjs +1 -1
- package/crypto/preProcessing.mjs +1 -1
- package/data-structures/AccountActions/AccountActions.mjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +1 -1
- package/data-structures/BlockchainEvent/BlockchainEvent.mjs +1 -1
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.mjs +2 -2
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.mjs +1 -1
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.mjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +1 -1
- package/data-structures/Hinkal/hinkalClaimUtxo.mjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.mjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndBridge.mjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +1 -1
- package/data-structures/Hinkal/hinkalGetRecipientInfo.mjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +1 -1
- package/data-structures/Hinkal/hinkalMultiSend.mjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +1 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.mjs +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +3 -9
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +1 -1
- package/data-structures/IndexedDB/activity-db.mjs +1 -1
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +1 -1
- package/data-structures/TokenDBs/ArcPublicTokensDB.mjs +1 -1
- package/data-structures/TokenDBs/PrivateTokensDB.mjs +1 -1
- package/data-structures/TokenDBs/PublicTokensDB.mjs +1 -1
- package/data-structures/ValueCache/ValueCache.mjs +1 -1
- package/data-structures/cacheDevices/AttachableMemoryCacheDevice.mjs +1 -1
- package/data-structures/cacheDevices/BaseCacheDevice.mjs +1 -1
- package/data-structures/cacheDevices/FileCacheDevice.mjs +1 -1
- package/data-structures/cacheDevices/LocalStorageCacheDevice.mjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.mjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +1 -1
- package/data-structures/crypto-keys/keyUtils.mjs +1 -1
- package/data-structures/crypto-keys/keys.mjs +1 -1
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.mjs +1 -1
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.mjs +1 -1
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.mjs +1 -1
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractEventService.mjs +2 -2
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.mjs +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +1 -1
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +1 -1
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.mjs +1 -1
- package/data-structures/event-service/helpers/ClientEventHelper.mjs +1 -1
- package/data-structures/event-service/helpers/PollingEventHelper.mjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +1 -1
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.mjs +1 -1
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.mjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +1 -1
- package/data-structures/http/BasicHttpClient.mjs +1 -1
- package/data-structures/http/HttpClient.mjs +1 -1
- package/data-structures/merkle-tree/MerkleTree.mjs +1 -1
- package/data-structures/merkle-tree/MerkleTreeIncompleteError.mjs +1 -1
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs +1 -1
- package/data-structures/presale/PresaleContractWrapper.mjs +1 -1
- package/data-structures/snapshot/SnapshotFetcherService.mjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +1 -1
- package/data-structures/token-price-fetcher/TokenChecker.mjs +1 -1
- package/data-structures/transactions-manager/history/history.types.mjs +1 -1
- package/data-structures/utxo/Utxo.mjs +1 -1
- package/error-handling/customErrors/ErrorWithAmount.mjs +1 -1
- package/error-handling/customErrors/ErrorWithIndex.mjs +1 -1
- package/error-handling/customErrors/ErrorWithTx.mjs +1 -1
- package/error-handling/customErrors/FeeOverTransactionValueError.mjs +1 -1
- package/error-handling/customErrors/SimulationFailureError.mjs +1 -1
- package/error-handling/customErrors/customErrors.helpers.cjs +1 -1
- package/error-handling/customErrors/customErrors.helpers.mjs +2 -2
- package/error-handling/error-codes.constants.mjs +1 -1
- package/error-handling/get-error.message.cjs +1 -1
- package/error-handling/get-error.message.mjs +2 -2
- package/error-handling/isInsufficientFundsError.mjs +1 -1
- package/error-handling/logError.mjs +1 -1
- package/error-handling/logger.mjs +1 -1
- package/error-handling/types.mjs +1 -1
- package/externalABIs/BUSD.mjs +1 -1
- package/externalABIs/DAI.mjs +1 -1
- package/externalABIs/NodeInterfaceABI.json.mjs +1 -1
- package/externalABIs/OptimismGasPriceOracle.json.mjs +1 -1
- package/externalABIs/SanctionsList.mjs +1 -1
- package/externalABIs/USDC.mjs +1 -1
- package/externalABIs/USDR.mjs +1 -1
- package/externalABIs/USDR3CRV.mjs +1 -1
- package/externalABIs/USDT.mjs +1 -1
- package/externalABIs/WETH.mjs +1 -1
- package/externalABIs/amToken.mjs +1 -1
- package/externalABIs/index.mjs +1 -1
- package/externalABIs/swapAbi.mjs +1 -1
- package/functions/auto-deposit-back-helpers/get-gas-token-records.mjs +1 -1
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.mjs +1 -1
- package/functions/auto-deposit-back-helpers/select-gas-token.mjs +1 -1
- package/functions/auto-deposit-back-helpers/update-hinkal.mjs +1 -1
- package/functions/kyc/checkTokenLimitsUSD.mjs +1 -1
- package/functions/kyc/openDefaultPassportWindow.mjs +1 -1
- package/functions/kyc/passportHelper.mjs +1 -1
- package/functions/kyc/zkMeHelper.mjs +1 -1
- package/functions/pre-transaction/addressTableLookup.mjs +1 -1
- package/functions/pre-transaction/constructAdminData.mjs +1 -1
- package/functions/pre-transaction/convert-okx-instructions.mjs +1 -1
- package/functions/pre-transaction/ensureAmountChanges.mjs +1 -1
- package/functions/pre-transaction/getExternalSwapAddress.mjs +1 -1
- package/functions/pre-transaction/getFeeStructure.mjs +1 -1
- package/functions/pre-transaction/getFlatFees.mjs +1 -1
- package/functions/pre-transaction/getKycAndSignatureData.mjs +1 -1
- package/functions/pre-transaction/getSignatureDataForTransact.mjs +1 -1
- package/functions/pre-transaction/getSolanaCalldataHash.mjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +1 -1
- package/functions/pre-transaction/initTokenLimitIfNeeded.mjs +1 -1
- package/functions/pre-transaction/interaction-to-action.mjs +1 -1
- package/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +1 -1
- package/functions/pre-transaction/merge-with-fee-structure.mjs +1 -1
- package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -1
- package/functions/pre-transaction/outputApprovalDataProcessing.mjs +3 -3
- package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.mjs +2 -5
- package/functions/pre-transaction/process-gas-estimates.mjs +1 -1
- package/functions/pre-transaction/recipientUtxoProcessing.mjs +1 -1
- package/functions/pre-transaction/sendInitNullifiersTransaction.mjs +1 -1
- package/functions/pre-transaction/sendV0Transaction.mjs +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +1 -1
- package/functions/pre-transaction/solana-public-signals.mjs +1 -1
- package/functions/pre-transaction/solana.mjs +1 -1
- package/functions/pre-transaction/solanaTransfer.utils.mjs +1 -1
- package/functions/pre-transaction/store-instructions.mjs +1 -1
- package/functions/pre-transaction/store-proof.mjs +1 -1
- package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs +1 -1
- package/functions/private-wallet/emporium.helpers.mjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.mjs +1 -1
- package/functions/private-wallet/opProducer.mjs +1 -1
- package/functions/snarkjs/common.snarkjs.mjs +1 -1
- package/functions/snarkjs/constant.mjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.mjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.mjs +1 -1
- package/functions/snarkjs/constructSolanaZkProof.mjs +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +1 -1
- package/functions/snarkjs/fetchOnChainRootHashes.mjs +1 -1
- package/functions/snarkjs/generateCircomData.mjs +1 -1
- package/functions/snarkjs/generateZkProof.mjs +1 -1
- package/functions/snarkjs/generateZkProofEnclave.mjs +1 -1
- package/functions/snarkjs/generateZkProofSelf.mjs +1 -1
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +1 -1
- package/functions/snarkjs/getOriginalSender.mjs +1 -1
- package/functions/snarkjs/getZKFiles.mjs +1 -1
- package/functions/utils/addresses.mjs +1 -1
- package/functions/utils/amounts.utils.mjs +1 -1
- package/functions/utils/arraysMatch.mjs +1 -1
- package/functions/utils/buildClaimableDepositPlan.mjs +1 -1
- package/functions/utils/bytes32.utils.mjs +1 -1
- package/functions/utils/cacheDevice.utils.mjs +1 -1
- package/functions/utils/cacheFunctions.mjs +1 -1
- package/functions/utils/caseInsensitive.utils.mjs +1 -1
- package/functions/utils/convertEmporiumOpToCallInfo.mjs +1 -1
- package/functions/utils/convertIntegrationProviderToExternalActionId.mjs +1 -1
- package/functions/utils/create-provider.mjs +1 -1
- package/functions/utils/enclave-signature-storage.mjs +1 -1
- package/functions/utils/enclave-utxo-storage.mjs +1 -1
- package/functions/utils/encodeTokenWithId.mjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +1 -1
- package/functions/utils/erc20tokenFunctions.mjs +1 -1
- package/functions/utils/evmNetworkFunctions.mjs +1 -1
- package/functions/utils/external-action.utils.mjs +1 -1
- package/functions/utils/fees.utils.mjs +1 -1
- package/functions/utils/get-signature-header.mjs +1 -1
- package/functions/utils/getBlockExplorerUrl.mjs +1 -1
- package/functions/utils/getContractAddress.mjs +1 -1
- package/functions/utils/getDataFromTransaction.mjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +1 -1
- package/functions/utils/getSignerFromContract.mjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.mjs +1 -1
- package/functions/utils/getUtxosFromReceiptSolana.mjs +1 -1
- package/functions/utils/getWalletGroupKey.utils.mjs +1 -1
- package/functions/utils/inLogicMetadata.mjs +1 -1
- package/functions/utils/involves-permit2-op.mjs +1 -1
- package/functions/utils/ipfs.mjs +1 -1
- package/functions/utils/is-valid-url.mjs +1 -1
- package/functions/utils/merkleTree.utils.mjs +1 -1
- package/functions/utils/mutexes.utils.mjs +1 -1
- package/functions/utils/networks.utils.mjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +1 -1
- package/functions/utils/nickname.utils.mjs +1 -1
- package/functions/utils/postToOffscreen.mjs +1 -1
- package/functions/utils/prepareHinkal.mjs +1 -1
- package/functions/utils/process.utils.mjs +1 -1
- package/functions/utils/processUseApprovalUtxoData.mjs +1 -1
- package/functions/utils/proxyAvatar.utils.mjs +1 -1
- package/functions/utils/publicBalance.utils.mjs +1 -1
- package/functions/utils/reloadPage.mjs +1 -1
- package/functions/utils/requireEnv.mjs +1 -1
- package/functions/utils/resolve-sync.utils.mjs +1 -1
- package/functions/utils/rpc-int-encode.mjs +1 -1
- package/functions/utils/serialize-utxos.utils.mjs +1 -1
- package/functions/utils/serialize.utils.mjs +1 -1
- package/functions/utils/solanaMint.utils.mjs +1 -1
- package/functions/utils/string.utils.mjs +1 -1
- package/functions/utils/time.utils.mjs +1 -1
- package/functions/utils/token-check.utils.mjs +1 -1
- package/functions/utils/trimFieldValues.mjs +1 -1
- package/functions/utils/tron.utils.mjs +1 -1
- package/functions/utils/tronSimulation.utils.mjs +1 -1
- package/functions/utils/tx-confirmation.utils.mjs +1 -1
- package/functions/utils/upToDateState.mjs +1 -1
- package/functions/utils/userAgent.mjs +1 -1
- package/functions/utils/validateUsername.mjs +1 -1
- package/functions/utils/walletBalances.utils.mjs +1 -1
- package/functions/web3/EIP-712.mjs +1 -1
- package/functions/web3/connectors.utils.mjs +1 -1
- package/functions/web3/crypto.mjs +1 -1
- package/functions/web3/etherFunctions.mjs +1 -1
- package/functions/web3/events/balanceChangedCustomHandler.mjs +1 -1
- package/functions/web3/events/balanceChangedHandler.mjs +1 -1
- package/functions/web3/events/getApprovedBalance.mjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.mjs +13 -60
- package/functions/web3/events/getInputUtxosEnclave.mjs +1 -1
- package/functions/web3/events/getShieldedBalance.cjs +1 -1
- package/functions/web3/events/getShieldedBalance.mjs +3 -13
- package/functions/web3/events/getTransactionLogEvents.mjs +1 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.mjs +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +1 -1
- package/functions/web3/functionCalls/approveTokensToHinkal.mjs +1 -1
- package/functions/web3/functionCalls/constructBatchCall.mjs +1 -1
- package/functions/web3/functionCalls/recoverTransactionFromError.mjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.mjs +1 -1
- package/functions/web3/functionCalls/transactCallDirectTron.mjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.mjs +1 -1
- package/functions/web3/functionCalls/waitForErc20Approvals.mjs +1 -1
- package/functions/web3/getContractMetadata.mjs +1 -1
- package/functions/web3/getPublicAddressBalance.mjs +1 -1
- package/functions/web3/getSolanaPriorityFee.mjs +1 -1
- package/functions/web3/getTokenHolder.mjs +1 -1
- package/functions/web3/lifiAPI.mjs +1 -1
- package/functions/web3/odosAPI.mjs +1 -1
- package/functions/web3/okxAPI.mjs +1 -1
- package/functions/web3/oneInchAPI.mjs +1 -1
- package/functions/web3/runContractFunction.mjs +1 -1
- package/functions/web3/signAndSendSerializedTransaction.mjs +1 -1
- package/functions/web3/tron-wagmi-adapter.mjs +1 -1
- package/functions/web3/uniswapAPI.mjs +1 -1
- package/index.cjs +1 -1
- package/index.mjs +308 -310
- package/mutexes/mutex.mjs +1 -1
- package/package.json +1 -1
- package/providers/CustomEthersProvider.mjs +1 -1
- package/providers/CustomSolanaConnection.mjs +1 -1
- package/providers/EthersProviderAdapter.mjs +1 -1
- package/providers/SolanaProviderAdapter.mjs +1 -1
- package/providers/TronProviderAdapter.mjs +1 -1
- package/providers/WagmiProviderAdapter.mjs +1 -1
- package/providers/prepareEthersHinkal.mjs +1 -1
- package/providers/prepareSolanaHinkal.mjs +1 -1
- package/providers/prepareTronHinkal.mjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +1 -1
- package/types/RewardUserEnums.mjs +1 -1
- package/types/activities.types.mjs +1 -1
- package/types/admin.types.mjs +1 -1
- package/types/approvals.types.mjs +1 -1
- package/types/balances.types.mjs +1 -1
- package/types/cache.types.mjs +1 -1
- package/types/circom-data.types.mjs +1 -1
- package/types/confirmation-request.types.mjs +1 -1
- package/types/eip5792.types.mjs +1 -1
- package/types/ethereum-network.types.mjs +1 -1
- package/types/events.types.mjs +1 -1
- package/types/external-action.types.mjs +1 -1
- package/types/fee.types.mjs +1 -1
- package/types/generatePoints.mjs +1 -1
- package/types/hinkal.types.mjs +1 -1
- package/types/kyc.types.mjs +1 -1
- package/types/new-rewards.type.mjs +1 -1
- package/types/offscreen.types.mjs +1 -1
- package/types/onramp.types.mjs +1 -1
- package/types/pay-activities.types.mjs +1 -1
- package/types/rewards.types.mjs +1 -1
- package/types/schedule.types.mjs +1 -1
- package/types/scheduled-transactions.types.mjs +1 -1
- package/types/slippage.types.mjs +1 -1
- package/types/token-prices.types.mjs +1 -1
- package/types/token.types.mjs +1 -1
- package/types/transaction.types.mjs +1 -1
- package/webworker/performTaskWithWorker.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorker.types.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.mjs +2 -2
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +1 -1
- package/webworker/utxoWorker/utxoWorker.types.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +2 -2
- package/webworker/utxoWorker/utxoWorkerLogic.mjs +1 -1
- package/webworker/worker.registry.mjs +1 -1
- package/webworker/workerFactory.mjs +1 -1
- package/webworker/workerProxy.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorker.types.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +2 -2
- package/webworker/zkProofWorker/zkProofWorkerLogic.mjs +1 -1
- package/constants/deploy-data/deploy-data-avalanche.json.cjs +0 -1
- package/constants/deploy-data/deploy-data-avalanche.json.mjs +0 -5352
- package/constants/deploy-data/deploy-data-bnbMainnet.json.cjs +0 -1
- package/constants/deploy-data/deploy-data-bnbMainnet.json.mjs +0 -5352
- package/constants/token-data/avalancheRegistry.json.cjs +0 -1
- package/constants/token-data/avalancheRegistry.json.mjs +0 -729
- package/constants/token-data/avalancheRegistryFixed.json.cjs +0 -1
- package/constants/token-data/avalancheRegistryFixed.json.mjs +0 -729
- package/constants/token-data/bnbMainnetRegistry.json.cjs +0 -1
- package/constants/token-data/bnbMainnetRegistry.json.mjs +0 -900
- package/constants/token-data/bnbMainnetRegistryFixed.json.cjs +0 -1
- package/constants/token-data/bnbMainnetRegistryFixed.json.mjs +0 -900
|
@@ -2,82 +2,70 @@ import { chainIds as e } from "../chains.constants.mjs";
|
|
|
2
2
|
import t from "./arcTestnetRegistry.json.mjs";
|
|
3
3
|
import n from "./ethMainnetRegistryFixed.json.mjs";
|
|
4
4
|
import r from "./arbMainnetRegistryFixed.json.mjs";
|
|
5
|
-
import i from "./
|
|
6
|
-
import a from "./
|
|
7
|
-
import o from "./
|
|
8
|
-
import s from "./
|
|
9
|
-
import c from "./
|
|
10
|
-
import l from "./
|
|
11
|
-
import u from "./
|
|
12
|
-
import d from "./
|
|
13
|
-
import f from "./
|
|
14
|
-
import p from "./
|
|
15
|
-
import m from "./
|
|
16
|
-
import h from "./
|
|
17
|
-
import g from "./
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import b from "./tronMainnetRegistry.json.mjs";
|
|
22
|
-
//#region libs/shared/common/src/constants/token-data/ERC20Registry.ts
|
|
23
|
-
var x = (n) => {
|
|
24
|
-
let r = g.networkRegistry.slice(0, 10);
|
|
5
|
+
import i from "./polygonRegistryFixed.json.mjs";
|
|
6
|
+
import a from "./optimismRegistryFixed.json.mjs";
|
|
7
|
+
import o from "./baseRegistryFixed.json.mjs";
|
|
8
|
+
import s from "./ethMainnetRegistry.json.mjs";
|
|
9
|
+
import c from "./arbMainnetRegistry.json.mjs";
|
|
10
|
+
import l from "./polygonRegistry.json.mjs";
|
|
11
|
+
import u from "./optimismRegistry.json.mjs";
|
|
12
|
+
import d from "./baseRegistry.json.mjs";
|
|
13
|
+
import f from "./localhostRegistry.json.mjs";
|
|
14
|
+
import p from "./solanaMainnetRegistry.json.mjs";
|
|
15
|
+
import m from "./solanaLocalnetRegistry.json.mjs";
|
|
16
|
+
import h from "./tronNileRegistry.json.mjs";
|
|
17
|
+
import g from "./tronMainnetRegistry.json.mjs";
|
|
18
|
+
//#region ../shared/common/src/constants/token-data/ERC20Registry.ts
|
|
19
|
+
var _ = (n) => {
|
|
20
|
+
let r = f.networkRegistry.slice(0, 10);
|
|
25
21
|
switch (n) {
|
|
26
|
-
case e.polygon: return
|
|
27
|
-
case e.arbMainnet: return
|
|
28
|
-
case e.ethMainnet: return
|
|
29
|
-
case e.
|
|
30
|
-
case e.
|
|
31
|
-
case e.optimism: return m.networkRegistry;
|
|
32
|
-
case e.base: return h.networkRegistry;
|
|
22
|
+
case e.polygon: return l.networkRegistry;
|
|
23
|
+
case e.arbMainnet: return c.networkRegistry;
|
|
24
|
+
case e.ethMainnet: return s.networkRegistry;
|
|
25
|
+
case e.optimism: return u.networkRegistry;
|
|
26
|
+
case e.base: return d.networkRegistry;
|
|
33
27
|
case e.arcTestnet: return t.networkRegistry;
|
|
34
|
-
case e.solanaMainnet: return
|
|
35
|
-
case e.solanaLocalnet: return
|
|
36
|
-
case e.tronNile: return
|
|
37
|
-
case e.tronMainnet: return
|
|
28
|
+
case e.solanaMainnet: return p.networkRegistry;
|
|
29
|
+
case e.solanaLocalnet: return m.networkRegistry;
|
|
30
|
+
case e.tronNile: return h.networkRegistry;
|
|
31
|
+
case e.tronMainnet: return g.networkRegistry;
|
|
38
32
|
default: return r;
|
|
39
33
|
}
|
|
40
|
-
},
|
|
41
|
-
let
|
|
34
|
+
}, v = (t) => {
|
|
35
|
+
let s;
|
|
42
36
|
switch (t) {
|
|
43
37
|
case e.polygon:
|
|
44
|
-
|
|
38
|
+
s = i;
|
|
45
39
|
break;
|
|
46
40
|
case e.arbMainnet:
|
|
47
|
-
|
|
41
|
+
s = r;
|
|
48
42
|
break;
|
|
49
43
|
case e.ethMainnet:
|
|
50
|
-
|
|
51
|
-
break;
|
|
52
|
-
case e.avalanche:
|
|
53
|
-
l = o;
|
|
54
|
-
break;
|
|
55
|
-
case e.bnbMainnet:
|
|
56
|
-
l = i;
|
|
44
|
+
s = n;
|
|
57
45
|
break;
|
|
58
46
|
case e.optimism:
|
|
59
|
-
|
|
47
|
+
s = a;
|
|
60
48
|
break;
|
|
61
49
|
case e.base:
|
|
62
|
-
|
|
50
|
+
s = o;
|
|
63
51
|
break;
|
|
64
52
|
case e.solanaMainnet:
|
|
65
|
-
|
|
53
|
+
s = p;
|
|
66
54
|
break;
|
|
67
55
|
case e.solanaLocalnet:
|
|
68
|
-
|
|
56
|
+
s = m;
|
|
69
57
|
break;
|
|
70
58
|
case e.tronNile:
|
|
71
|
-
|
|
59
|
+
s = h;
|
|
72
60
|
break;
|
|
73
61
|
case e.tronMainnet:
|
|
74
|
-
|
|
62
|
+
s = g;
|
|
75
63
|
break;
|
|
76
64
|
default:
|
|
77
|
-
|
|
65
|
+
s = n;
|
|
78
66
|
break;
|
|
79
67
|
}
|
|
80
|
-
return
|
|
68
|
+
return s.networkRegistry;
|
|
81
69
|
};
|
|
82
70
|
//#endregion
|
|
83
|
-
export {
|
|
71
|
+
export { _ as getERC20Registry, v as getFixedRegistry };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./arcTestnetRegistry.json.cjs`),t=require(`./ethMainnetRegistryFixed.json.cjs`),n=require(`./arbMainnetRegistryFixed.json.cjs`),r=require(`./
|
|
1
|
+
const e=require(`./arcTestnetRegistry.json.cjs`),t=require(`./ethMainnetRegistryFixed.json.cjs`),n=require(`./arbMainnetRegistryFixed.json.cjs`),r=require(`./polygonRegistryFixed.json.cjs`),i=require(`./optimismRegistryFixed.json.cjs`),a=require(`./baseRegistryFixed.json.cjs`),o=require(`./ethMainnetRegistry.json.cjs`),s=require(`./arbMainnetRegistry.json.cjs`),c=require(`./polygonRegistry.json.cjs`),l=require(`./optimismRegistry.json.cjs`),u=require(`./baseRegistry.json.cjs`),d=require(`./localhostRegistry.json.cjs`),f=require(`./solanaMainnetRegistry.json.cjs`),p=require(`./solanaLocalnetRegistry.json.cjs`);require(`./ERC20Registry.cjs`);var m=t.default.networkRegistry,h=n.default.networkRegistry,g=r.default.networkRegistry,_=i.default.networkRegistry,v=a.default.networkRegistry,y=o.default.networkRegistry,b=s.default.networkRegistry,x=c.default.networkRegistry,S=l.default.networkRegistry,C=u.default.networkRegistry,w=d.default.networkRegistry,T=e.default.networkRegistry,E=f.default.networkRegistry,D=p.default.networkRegistry;exports.arbMainnetRegistry=b,exports.arbMainnetRegistryFixed=h,exports.arcTestnetRegistry=T,exports.baseRegistry=C,exports.baseRegistryFixed=v,exports.ethMainnetRegistry=y,exports.ethMainnetRegistryFixed=m,exports.localhostRegistry=w,exports.optimismRegistry=S,exports.optimismRegistryFixed=_,exports.polygonRegistry=x,exports.polygonRegistryFixed=g,exports.solanaLocalnetRegistry=D,exports.solanaMainnetRegistry=E;
|
|
@@ -227,51 +227,6 @@ declare const arbMainnetRegistryFixed: ({
|
|
|
227
227
|
isVyper?: undefined;
|
|
228
228
|
balanceStorageOffset?: undefined;
|
|
229
229
|
})[];
|
|
230
|
-
declare const bnbMainnetRegistryFixed: ({
|
|
231
|
-
chainId: number;
|
|
232
|
-
erc20TokenAddress: string;
|
|
233
|
-
wrappedErc20TokenAddress: string;
|
|
234
|
-
name: string;
|
|
235
|
-
symbol: string;
|
|
236
|
-
decimals: number;
|
|
237
|
-
logoURI: string;
|
|
238
|
-
underlyingErc20TokenAddress?: undefined;
|
|
239
|
-
isVolatile?: undefined;
|
|
240
|
-
aaveToken?: undefined;
|
|
241
|
-
} | {
|
|
242
|
-
chainId: number;
|
|
243
|
-
erc20TokenAddress: string;
|
|
244
|
-
name: string;
|
|
245
|
-
symbol: string;
|
|
246
|
-
decimals: number;
|
|
247
|
-
logoURI: string;
|
|
248
|
-
wrappedErc20TokenAddress?: undefined;
|
|
249
|
-
underlyingErc20TokenAddress?: undefined;
|
|
250
|
-
isVolatile?: undefined;
|
|
251
|
-
aaveToken?: undefined;
|
|
252
|
-
} | {
|
|
253
|
-
chainId: number;
|
|
254
|
-
erc20TokenAddress: string;
|
|
255
|
-
underlyingErc20TokenAddress: string;
|
|
256
|
-
name: string;
|
|
257
|
-
symbol: string;
|
|
258
|
-
decimals: number;
|
|
259
|
-
logoURI: string;
|
|
260
|
-
isVolatile: boolean;
|
|
261
|
-
aaveToken: boolean;
|
|
262
|
-
wrappedErc20TokenAddress?: undefined;
|
|
263
|
-
} | {
|
|
264
|
-
chainId: number;
|
|
265
|
-
erc20TokenAddress: string;
|
|
266
|
-
underlyingErc20TokenAddress: string;
|
|
267
|
-
name: string;
|
|
268
|
-
symbol: string;
|
|
269
|
-
decimals: number;
|
|
270
|
-
logoURI: string;
|
|
271
|
-
isVolatile: boolean;
|
|
272
|
-
wrappedErc20TokenAddress?: undefined;
|
|
273
|
-
aaveToken?: undefined;
|
|
274
|
-
})[];
|
|
275
230
|
declare const polygonRegistryFixed: ({
|
|
276
231
|
chainId: number;
|
|
277
232
|
erc20TokenAddress: string;
|
|
@@ -363,77 +318,6 @@ declare const polygonRegistryFixed: ({
|
|
|
363
318
|
isVolatile?: undefined;
|
|
364
319
|
aaveToken?: undefined;
|
|
365
320
|
})[];
|
|
366
|
-
declare const avalancheRegistryFixed: ({
|
|
367
|
-
chainId: number;
|
|
368
|
-
erc20TokenAddress: string;
|
|
369
|
-
wrappedErc20TokenAddress: string;
|
|
370
|
-
name: string;
|
|
371
|
-
symbol: string;
|
|
372
|
-
decimals: number;
|
|
373
|
-
logoURI: string;
|
|
374
|
-
allowanceStorageOffset?: undefined;
|
|
375
|
-
isVyper?: undefined;
|
|
376
|
-
balanceStorageOffset?: undefined;
|
|
377
|
-
underlyingErc20TokenAddress?: undefined;
|
|
378
|
-
isVolatile?: undefined;
|
|
379
|
-
aaveToken?: undefined;
|
|
380
|
-
} | {
|
|
381
|
-
chainId: number;
|
|
382
|
-
erc20TokenAddress: string;
|
|
383
|
-
name: string;
|
|
384
|
-
symbol: string;
|
|
385
|
-
decimals: number;
|
|
386
|
-
logoURI: string;
|
|
387
|
-
allowanceStorageOffset: number;
|
|
388
|
-
isVyper: boolean;
|
|
389
|
-
balanceStorageOffset: number;
|
|
390
|
-
wrappedErc20TokenAddress?: undefined;
|
|
391
|
-
underlyingErc20TokenAddress?: undefined;
|
|
392
|
-
isVolatile?: undefined;
|
|
393
|
-
aaveToken?: undefined;
|
|
394
|
-
} | {
|
|
395
|
-
chainId: number;
|
|
396
|
-
erc20TokenAddress: string;
|
|
397
|
-
name: string;
|
|
398
|
-
symbol: string;
|
|
399
|
-
decimals: number;
|
|
400
|
-
logoURI: string;
|
|
401
|
-
wrappedErc20TokenAddress?: undefined;
|
|
402
|
-
allowanceStorageOffset?: undefined;
|
|
403
|
-
isVyper?: undefined;
|
|
404
|
-
balanceStorageOffset?: undefined;
|
|
405
|
-
underlyingErc20TokenAddress?: undefined;
|
|
406
|
-
isVolatile?: undefined;
|
|
407
|
-
aaveToken?: undefined;
|
|
408
|
-
} | {
|
|
409
|
-
chainId: number;
|
|
410
|
-
erc20TokenAddress: string;
|
|
411
|
-
underlyingErc20TokenAddress: string;
|
|
412
|
-
name: string;
|
|
413
|
-
symbol: string;
|
|
414
|
-
decimals: number;
|
|
415
|
-
logoURI: string;
|
|
416
|
-
isVolatile: boolean;
|
|
417
|
-
aaveToken: boolean;
|
|
418
|
-
wrappedErc20TokenAddress?: undefined;
|
|
419
|
-
allowanceStorageOffset?: undefined;
|
|
420
|
-
isVyper?: undefined;
|
|
421
|
-
balanceStorageOffset?: undefined;
|
|
422
|
-
} | {
|
|
423
|
-
chainId: number;
|
|
424
|
-
erc20TokenAddress: string;
|
|
425
|
-
name: string;
|
|
426
|
-
symbol: string;
|
|
427
|
-
decimals: number;
|
|
428
|
-
logoURI: string;
|
|
429
|
-
allowanceStorageOffset: number;
|
|
430
|
-
isVyper: boolean;
|
|
431
|
-
wrappedErc20TokenAddress?: undefined;
|
|
432
|
-
balanceStorageOffset?: undefined;
|
|
433
|
-
underlyingErc20TokenAddress?: undefined;
|
|
434
|
-
isVolatile?: undefined;
|
|
435
|
-
aaveToken?: undefined;
|
|
436
|
-
})[];
|
|
437
321
|
declare const optimismRegistryFixed: ({
|
|
438
322
|
chainId: number;
|
|
439
323
|
erc20TokenAddress: string;
|
|
@@ -804,51 +688,6 @@ declare const arbMainnetRegistry: ({
|
|
|
804
688
|
isVyper?: undefined;
|
|
805
689
|
balanceStorageOffset?: undefined;
|
|
806
690
|
})[];
|
|
807
|
-
declare const bnbMainnetRegistry: ({
|
|
808
|
-
chainId: number;
|
|
809
|
-
erc20TokenAddress: string;
|
|
810
|
-
wrappedErc20TokenAddress: string;
|
|
811
|
-
name: string;
|
|
812
|
-
symbol: string;
|
|
813
|
-
decimals: number;
|
|
814
|
-
logoURI: string;
|
|
815
|
-
underlyingErc20TokenAddress?: undefined;
|
|
816
|
-
isVolatile?: undefined;
|
|
817
|
-
aaveToken?: undefined;
|
|
818
|
-
} | {
|
|
819
|
-
chainId: number;
|
|
820
|
-
erc20TokenAddress: string;
|
|
821
|
-
name: string;
|
|
822
|
-
symbol: string;
|
|
823
|
-
decimals: number;
|
|
824
|
-
logoURI: string;
|
|
825
|
-
wrappedErc20TokenAddress?: undefined;
|
|
826
|
-
underlyingErc20TokenAddress?: undefined;
|
|
827
|
-
isVolatile?: undefined;
|
|
828
|
-
aaveToken?: undefined;
|
|
829
|
-
} | {
|
|
830
|
-
chainId: number;
|
|
831
|
-
erc20TokenAddress: string;
|
|
832
|
-
underlyingErc20TokenAddress: string;
|
|
833
|
-
name: string;
|
|
834
|
-
symbol: string;
|
|
835
|
-
decimals: number;
|
|
836
|
-
logoURI: string;
|
|
837
|
-
isVolatile: boolean;
|
|
838
|
-
aaveToken: boolean;
|
|
839
|
-
wrappedErc20TokenAddress?: undefined;
|
|
840
|
-
} | {
|
|
841
|
-
chainId: number;
|
|
842
|
-
erc20TokenAddress: string;
|
|
843
|
-
underlyingErc20TokenAddress: string;
|
|
844
|
-
name: string;
|
|
845
|
-
symbol: string;
|
|
846
|
-
decimals: number;
|
|
847
|
-
logoURI: string;
|
|
848
|
-
isVolatile: boolean;
|
|
849
|
-
wrappedErc20TokenAddress?: undefined;
|
|
850
|
-
aaveToken?: undefined;
|
|
851
|
-
})[];
|
|
852
691
|
declare const polygonRegistry: ({
|
|
853
692
|
chainId: number;
|
|
854
693
|
erc20TokenAddress: string;
|
|
@@ -940,77 +779,6 @@ declare const polygonRegistry: ({
|
|
|
940
779
|
isVolatile?: undefined;
|
|
941
780
|
aaveToken?: undefined;
|
|
942
781
|
})[];
|
|
943
|
-
declare const avalancheRegistry: ({
|
|
944
|
-
chainId: number;
|
|
945
|
-
erc20TokenAddress: string;
|
|
946
|
-
wrappedErc20TokenAddress: string;
|
|
947
|
-
name: string;
|
|
948
|
-
symbol: string;
|
|
949
|
-
decimals: number;
|
|
950
|
-
logoURI: string;
|
|
951
|
-
allowanceStorageOffset?: undefined;
|
|
952
|
-
isVyper?: undefined;
|
|
953
|
-
balanceStorageOffset?: undefined;
|
|
954
|
-
underlyingErc20TokenAddress?: undefined;
|
|
955
|
-
isVolatile?: undefined;
|
|
956
|
-
aaveToken?: undefined;
|
|
957
|
-
} | {
|
|
958
|
-
chainId: number;
|
|
959
|
-
erc20TokenAddress: string;
|
|
960
|
-
name: string;
|
|
961
|
-
symbol: string;
|
|
962
|
-
decimals: number;
|
|
963
|
-
logoURI: string;
|
|
964
|
-
allowanceStorageOffset: number;
|
|
965
|
-
isVyper: boolean;
|
|
966
|
-
balanceStorageOffset: number;
|
|
967
|
-
wrappedErc20TokenAddress?: undefined;
|
|
968
|
-
underlyingErc20TokenAddress?: undefined;
|
|
969
|
-
isVolatile?: undefined;
|
|
970
|
-
aaveToken?: undefined;
|
|
971
|
-
} | {
|
|
972
|
-
chainId: number;
|
|
973
|
-
erc20TokenAddress: string;
|
|
974
|
-
name: string;
|
|
975
|
-
symbol: string;
|
|
976
|
-
decimals: number;
|
|
977
|
-
logoURI: string;
|
|
978
|
-
wrappedErc20TokenAddress?: undefined;
|
|
979
|
-
allowanceStorageOffset?: undefined;
|
|
980
|
-
isVyper?: undefined;
|
|
981
|
-
balanceStorageOffset?: undefined;
|
|
982
|
-
underlyingErc20TokenAddress?: undefined;
|
|
983
|
-
isVolatile?: undefined;
|
|
984
|
-
aaveToken?: undefined;
|
|
985
|
-
} | {
|
|
986
|
-
chainId: number;
|
|
987
|
-
erc20TokenAddress: string;
|
|
988
|
-
underlyingErc20TokenAddress: string;
|
|
989
|
-
name: string;
|
|
990
|
-
symbol: string;
|
|
991
|
-
decimals: number;
|
|
992
|
-
logoURI: string;
|
|
993
|
-
isVolatile: boolean;
|
|
994
|
-
aaveToken: boolean;
|
|
995
|
-
wrappedErc20TokenAddress?: undefined;
|
|
996
|
-
allowanceStorageOffset?: undefined;
|
|
997
|
-
isVyper?: undefined;
|
|
998
|
-
balanceStorageOffset?: undefined;
|
|
999
|
-
} | {
|
|
1000
|
-
chainId: number;
|
|
1001
|
-
erc20TokenAddress: string;
|
|
1002
|
-
name: string;
|
|
1003
|
-
symbol: string;
|
|
1004
|
-
decimals: number;
|
|
1005
|
-
logoURI: string;
|
|
1006
|
-
allowanceStorageOffset: number;
|
|
1007
|
-
isVyper: boolean;
|
|
1008
|
-
wrappedErc20TokenAddress?: undefined;
|
|
1009
|
-
balanceStorageOffset?: undefined;
|
|
1010
|
-
underlyingErc20TokenAddress?: undefined;
|
|
1011
|
-
isVolatile?: undefined;
|
|
1012
|
-
aaveToken?: undefined;
|
|
1013
|
-
})[];
|
|
1014
782
|
declare const optimismRegistry: ({
|
|
1015
783
|
chainId: number;
|
|
1016
784
|
erc20TokenAddress: string;
|
|
@@ -1378,4 +1146,4 @@ declare const solanaLocalnetRegistry: {
|
|
|
1378
1146
|
decimals: number;
|
|
1379
1147
|
logoURI: string;
|
|
1380
1148
|
}[];
|
|
1381
|
-
export { ethMainnetRegistryFixed, arbMainnetRegistryFixed,
|
|
1149
|
+
export { ethMainnetRegistryFixed, arbMainnetRegistryFixed, polygonRegistryFixed, optimismRegistryFixed, baseRegistryFixed, ethMainnetRegistry, arbMainnetRegistry, polygonRegistry, optimismRegistry, baseRegistry, localhostRegistry, solanaMainnetRegistry, solanaLocalnetRegistry, arcTestnetRegistry, };
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import e from "./arcTestnetRegistry.json.mjs";
|
|
2
2
|
import t from "./ethMainnetRegistryFixed.json.mjs";
|
|
3
3
|
import n from "./arbMainnetRegistryFixed.json.mjs";
|
|
4
|
-
import r from "./
|
|
5
|
-
import i from "./
|
|
6
|
-
import a from "./
|
|
7
|
-
import o from "./
|
|
8
|
-
import s from "./
|
|
9
|
-
import c from "./
|
|
10
|
-
import l from "./
|
|
11
|
-
import u from "./
|
|
12
|
-
import d from "./
|
|
13
|
-
import f from "./
|
|
14
|
-
import p from "./
|
|
15
|
-
import m from "./baseRegistry.json.mjs";
|
|
16
|
-
import h from "./localhostRegistry.json.mjs";
|
|
17
|
-
import g from "./solanaMainnetRegistry.json.mjs";
|
|
18
|
-
import _ from "./solanaLocalnetRegistry.json.mjs";
|
|
4
|
+
import r from "./polygonRegistryFixed.json.mjs";
|
|
5
|
+
import i from "./optimismRegistryFixed.json.mjs";
|
|
6
|
+
import a from "./baseRegistryFixed.json.mjs";
|
|
7
|
+
import o from "./ethMainnetRegistry.json.mjs";
|
|
8
|
+
import s from "./arbMainnetRegistry.json.mjs";
|
|
9
|
+
import c from "./polygonRegistry.json.mjs";
|
|
10
|
+
import l from "./optimismRegistry.json.mjs";
|
|
11
|
+
import u from "./baseRegistry.json.mjs";
|
|
12
|
+
import d from "./localhostRegistry.json.mjs";
|
|
13
|
+
import f from "./solanaMainnetRegistry.json.mjs";
|
|
14
|
+
import p from "./solanaLocalnetRegistry.json.mjs";
|
|
19
15
|
import "./ERC20Registry.mjs";
|
|
20
|
-
//#region
|
|
21
|
-
var
|
|
16
|
+
//#region ../shared/common/src/constants/token-data/index.ts
|
|
17
|
+
var m = t.networkRegistry, h = n.networkRegistry, g = r.networkRegistry, _ = i.networkRegistry, v = a.networkRegistry, y = o.networkRegistry, b = s.networkRegistry, x = c.networkRegistry, S = l.networkRegistry, C = u.networkRegistry, w = d.networkRegistry, T = e.networkRegistry, E = f.networkRegistry, D = p.networkRegistry;
|
|
22
18
|
//#endregion
|
|
23
|
-
export {
|
|
19
|
+
export { b as arbMainnetRegistry, h as arbMainnetRegistryFixed, T as arcTestnetRegistry, C as baseRegistry, v as baseRegistryFixed, y as ethMainnetRegistry, m as ethMainnetRegistryFixed, w as localhostRegistry, S as optimismRegistry, _ as optimismRegistryFixed, x as polygonRegistry, g as polygonRegistryFixed, D as solanaLocalnetRegistry, E as solanaMainnetRegistry };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { chainIds as e } from "./chains.constants.mjs";
|
|
2
2
|
import { getAmountInWei as t } from "../functions/web3/etherFunctions.mjs";
|
|
3
3
|
import { getERC20TokenBySymbol as n } from "../functions/utils/erc20tokenFunctions.mjs";
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../shared/common/src/constants/token.limits.constants.ts
|
|
5
5
|
var r = { [e.optimism]: {
|
|
6
6
|
ETH: "0.5",
|
|
7
7
|
WETH: "0.5",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region ../shared/common/src/constants/tx-confirmation.constants.ts
|
|
2
2
|
var e = 30 * 1e3, t = 50 * 1e3, n = 120 * 1e3, r = 1;
|
|
3
3
|
//#endregion
|
|
4
4
|
export { t as RELAYER_TX_CONFIRMATION_TIMEOUT, r as TX_CONFIRMATION_CONFIRMATIONS_COUNT, e as TX_CONFIRMATION_TIMEOUT, n as TX_CONFIRMATION_TIMEOUT_EXTENDED };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region ../shared/common/src/constants/vite.constants.ts
|
|
2
2
|
var e = /* @__PURE__ */ function(e) {
|
|
3
3
|
return e.DEVELOPMENT = "development", e.PLAYGROUND = "playground", e.PRODUCTION = "production", e.STAGING = "staging", e;
|
|
4
4
|
}({});
|
package/crypto/preProcessing.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { jubHolder as t } from "./babyJub.mjs";
|
|
|
3
3
|
import n from "libsodium-wrappers";
|
|
4
4
|
import r from "process";
|
|
5
5
|
import { Buffer as i } from "buffer";
|
|
6
|
-
//#region
|
|
6
|
+
//#region ../shared/common/src/crypto/preProcessing.ts
|
|
7
7
|
var a = async () => {
|
|
8
8
|
(typeof window < "u" || typeof self < "u") && (typeof window < "u" && (window.global = window), globalThis.Buffer = i, globalThis.process = r), await Promise.all([
|
|
9
9
|
n.ready,
|
|
@@ -3,7 +3,7 @@ import { ethers as n } from "ethers";
|
|
|
3
3
|
import { Keypair as r } from "@solana/web3.js";
|
|
4
4
|
import i from "bs58";
|
|
5
5
|
import a from "tweetnacl";
|
|
6
|
-
//#region
|
|
6
|
+
//#region ../shared/common/src/data-structures/AccountActions/AccountActions.ts
|
|
7
7
|
var o = class {
|
|
8
8
|
static getEvmPrivateKeyFromSolanaPrivateKey = (e) => {
|
|
9
9
|
let t = i.decode(e).slice(0, 32);
|
|
@@ -13,7 +13,7 @@ import { createCustomRpcProvider as f } from "../../functions/utils/create-provi
|
|
|
13
13
|
import { Mutex as p } from "async-mutex";
|
|
14
14
|
import { ethers as m } from "ethers";
|
|
15
15
|
import { get as h, update as g } from "idb-keyval";
|
|
16
|
-
//#region
|
|
16
|
+
//#region ../shared/common/src/data-structures/ApprovalDBs/EventsPublicApprovalsDB.ts
|
|
17
17
|
var _ = class {
|
|
18
18
|
updateMutexes = {};
|
|
19
19
|
approvalTopic = m.id("Approval(address,address,uint256)");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { safeJsonStringify as e } from "../../functions/utils/serialize.utils.mjs";
|
|
2
|
-
//#region
|
|
2
|
+
//#region ../shared/common/src/data-structures/BlockchainEvent/BlockchainEvent.ts
|
|
3
3
|
var t = class t {
|
|
4
4
|
eventName;
|
|
5
5
|
transactionHash;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../types/ethereum-network.types.cjs`),t=require(`../../functions/utils/serialize.utils.cjs`),n=require(`../../constants/vite.constants.cjs`),r=require(`../../constants/chains.constants.cjs`),i=require(`../../types/hinkal.types.cjs`),a=require(`../../API/API.cjs`),o=require(`../../constants/kyc.constants.cjs`),s=require(`../../error-handling/error-codes.constants.cjs`),c=require(`../../functions/utils/erc20tokenFunctions.cjs`);require(`../../API/index.cjs`);const l=require(`../../crypto/poseidon.cjs`),u=require(`../crypto-keys/keys.cjs`),d=require(`../../functions/pre-transaction/solana.cjs`),f=require(`./hinkalCheckSolanaTokenRegistry.cjs`),p=require(`../../functions/web3/functionCalls/accessTokenCalls.cjs`),m=require(`../../functions/utils/token-check.utils.cjs`),h=require(`../TokenDBs/PrivateTokensDB.cjs`),g=require(`../../functions/web3/events/getShieldedBalance.cjs`),ee=require(`../../functions/utils/reloadPage.cjs`),_=require(`../../functions/utils/cacheDevice.utils.cjs`),v=require(`../../functions/web3/getContractMetadata.cjs`),y=require(`../../providers/SolanaProviderAdapter.cjs`),b=require(`./hinkalCheckTokenRegistry.cjs`),x=require(`../merkle-tree/MerkleTree.cjs`);require(`../merkle-tree/index.cjs`);const S=require(`./hinkalDeposit.cjs`),te=require(`../../functions/private-wallet/emporium.helpers.cjs`),C=require(`../../functions/web3/events/getApprovedBalance.cjs`),ne=require(`../../functions/kyc/checkTokenLimitsUSD.cjs`),w=require(`./hinkalDepositAndWithdraw.cjs`),T=require(`./hinkalSolanaDeposit.cjs`),E=require(`./hinkalSwap.cjs`),D=require(`./hinkalWithdraw.cjs`),O=require(`./resetMerkleTrees.cjs`),k=require(`../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs`),A=require(`./hinkalPrivateWallet.cjs`),j=require(`./hinkalGetRecipientInfo.cjs`),M=require(`./hinkalSignSubAccount.cjs`),N=require(`./hinkalActionReceive.cjs`);require(`../TokenDBs/index.cjs`);const P=require(`./hinkalProoflessDeposit.cjs`),F=require(`./hinkalProxySwap.cjs`),I=require(`./hinkalMultiSend.cjs`),L=require(`./hinkalTransfer.cjs`),R=require(`./hinkalProxyToPrivate.cjs`),z=require(`../../providers/TronProviderAdapter.cjs`),B=require(`./hinkalSolanaDepositAndWithdraw.cjs`),V=require(`./hinkalSolanaWithdraw.cjs`),H=require(`./hinkalSolanaTransfer.cjs`),U=require(`./hinkalSolanaSwap.cjs`),W=require(`./hinkalSolanaProxySend.cjs`),G=require(`./hinkalSolanaProxySwap.cjs`),K=require(`./hinkalSolanaProxyShield.cjs`),q=require(`../../functions/web3/fetchSolanaMerkleTreeRootHash.cjs`),J=require(`./hinkalDepositAndBridge.cjs`),Y=require(`./hinkalClaimUtxo.cjs`),X=require(`./hinkalSolanaProoflessDeposit.cjs`),Z=require(`./hinkalSolanaClaimUtxo.cjs`),re=require(`./hinkalWithdrawStuckUtxos.cjs`);let Q=require(`ethers`),$=require(`@solana/web3.js`);var ie=class{ethereumProviderAdapter;solanaProviderAdapter;tronProviderAdapter;userKeys;signingMessage=`Login to Hinkal Protocol`;privateTransferSigningMessage=`Login to Hinkal's Private Transfer App`;merkleTreeHinkalByChain={};merkleTreeAccessTokenByChain={};nullifiersByChain={};encryptedOutputsByChain={};approvalsByChain={};commitmentsSnapshotServiceByChain={};nullifierSnapshotServiceByChain={};accessTokenSnapshotServiceByChain={};approvalsSnapshotServiceByChain={};utxoUtils;lastCallState=new Map;cacheDevice;generateProofRemotely;disableMerkleTreeUpdates;constructor(e){this.userKeys=new u.UserKeys(void 0),r.HINKAL_SUPPORTED_CHAINS.forEach(e=>{this.merkleTreeHinkalByChain[e]=x.MerkleTree.create(l.poseidonFunction,0n),this.merkleTreeAccessTokenByChain[e]=x.MerkleTree.create(l.poseidonFunction,0n),this.nullifiersByChain[e]=new Set,this.encryptedOutputsByChain[e]=[],this.approvalsByChain[e]=new Map}),this.generateProofRemotely=e?.generateProofRemotely??!1,this.utxoUtils=new k.MultiThreadedUtxoUtils,this.cacheDevice=_.createCacheDevice(e),this.disableMerkleTreeUpdates=e?.disableMerkleTreeUpdates??!1}enforceRateLimit(e,n,r=1e3){let i=Date.now(),a=t.CustomJSONStringify(n),o=this.lastCallState.get(e);if(o&&o.argsKey===a&&i-o.timestamp<r)throw Error(`${e} was already called with the same arguments`);this.lastCallState.set(e,{timestamp:i,argsKey:a})}getProviderAdapter(e){let t=e;t||=this.ethereumProviderAdapter?r.chainIds.ethMainnet:this.solanaProviderAdapter?r.chainIds.solanaMainnet:r.chainIds.tronMainnet;let n;if(n=r.isSolanaLike(t)?this.solanaProviderAdapter:r.isTronLike(t)?this.tronProviderAdapter:this.ethereumProviderAdapter,!n)throw Error(`ProviderAdapter is not initialized`);return n}async initProviderAdapter(e,t){let n=r.chainIds.ethMainnet;t instanceof y.SolanaProviderAdapter?n=r.chainIds.solanaMainnet:t instanceof z.TronProviderAdapter&&(n=r.currentTronChainId),await this.updateProviderAdapter(n,t),t.initConnector(e);let i=await t.connectAndPatchProvider(e);await t.init(i),await this.setListeners()}getSigningMessage(e=i.LoginMessageMode.PROTOCOL){switch(e){case i.LoginMessageMode.PRIVATE_TRANSFER:return this.privateTransferSigningMessage;case i.LoginMessageMode.PROTOCOL:default:return this.signingMessage}}async initUserKeys(e=i.LoginMessageMode.PROTOCOL){let t=this.getSigningMessage(e);this.userKeys=new u.UserKeys(await this.getProviderAdapter().signMessage(t))}initUserKeysWithSignature(e){this.userKeys=new u.UserKeys(e)}async initUserKeysFromSeedPhrases(e){let t=e.join(` `),n=Q.ethers.toUtf8Bytes(t);this.userKeys=new u.UserKeys(Q.ethers.keccak256(n))}async resetMerkle(e){this.disableMerkleTreeUpdates||(e?.every(e=>this.isSelectedNetworkSupported(e))??!0)&&await O.resetMerkleTrees(this,e)}getTronWeb(){let e=this.tronProviderAdapter;if(!e)throw Error(`Tron provider adapter not initialized`);if(!(e instanceof z.TronProviderAdapter))throw Error(`Tron provider adapter is not a TronProviderAdapter`);let t=e.getTronWeb();if(!t)throw Error(`TronWeb not available`);return t}getSupportedChains(){return this.ethereumProviderAdapter&&this.solanaProviderAdapter?r.WALLET_SUPPORTED_CHAINS:this.ethereumProviderAdapter?r.HINKAL_SUPPORTED_CHAINS.filter(e=>!r.isSolanaLike(e)&&!r.isTronLike(e)):this.solanaProviderAdapter?r.HINKAL_SUPPORTED_CHAINS.filter(e=>r.isSolanaLike(e)):this.tronProviderAdapter?r.HINKAL_SUPPORTED_CHAINS.filter(e=>r.isTronLike(e)):[]}async waitForTransaction(e,t,n=1){return!!await this.getProviderAdapter(e).waitForTransaction(e,t,n)}getContract(e,t,n=void 0){return this.getProviderAdapter(e).getContract(e,t,n)}getContractWithFetcherByChainId(e,t,n=void 0){return v.getContractWithFetcherByChainId(e,t,n)}async signMessage(e){return await this.getProviderAdapter().signMessage(e)}async signTypedData(e,t,n){return await this.getProviderAdapter().signTypedData(e,t,n)}async signWithSubAccount(e,t,n,r){return M.hinkalSignSubAccount(e,t,n,r)}getContractWithSigner(e,t,n=``){return this.getProviderAdapter(e).getContractWithSigner(e,t,n)}getContractWithFetcher(e,t,n=``){return this.getProviderAdapter(e).getContractWithFetcher(e,t,n)}isSelectedNetworkSupported(e){return!!r.networkRegistry[e]}async switchNetwork(e){try{await this.getProviderAdapter().switchNetwork(e)}catch{throw Error(s.transactionErrorCodes.FAILED_TO_SWITCH_NETWORKS)}}isPermitterAvailable(e){return this.getProviderAdapter(e).isPermitterAvailable()}async disconnectFromConnector(){await this.ethereumProviderAdapter?.disconnectFromConnector(),await this.solanaProviderAdapter?.disconnectFromConnector(),await this.tronProviderAdapter?.disconnectFromConnector()}async resetProviderAdapters(){this.ethereumProviderAdapter=void 0,this.solanaProviderAdapter=void 0,this.tronProviderAdapter=void 0}async updateProviderAdapter(e,t){try{r.isSolanaLike(e)?(this.solanaProviderAdapter&&this.solanaProviderAdapter.release(),this.solanaProviderAdapter=t):r.isTronLike(e)?(this.tronProviderAdapter&&this.tronProviderAdapter.release(),this.tronProviderAdapter=t):(this.ethereumProviderAdapter&&this.ethereumProviderAdapter.release(),this.ethereumProviderAdapter=t)}catch(e){throw console.error(e),Error(`updateProviderAdapter failed, please try again.`)}}async setListeners(){this.ethereumProviderAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}}),this.solanaProviderAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}}),this.tronProviderAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}})}async onAccountChanged(){await this.ethereumProviderAdapter?.onAccountChanged(),await this.solanaProviderAdapter?.onAccountChanged(),await this.tronProviderAdapter?.onAccountChanged();let e=i.EventType.AccountChanged;typeof document<`u`?document?.dispatchEvent(new Event(e)):process?.emit(`message`,e,void 0)}async onChainChanged(e){e?await this.getProviderAdapter(e).onChainChanged(e):(await this.disconnectFromConnector(),ee.reloadPage())}async monitorConnectedAddress(e){await a.API.monitor(await this.getEthereumAddressByChain(e))}async getBalances(e,t,n,r,i=!1,a,o=!1){return g.getShieldedBalance(this,e,t,n,r,i,this.generateProofRemotely,a,o)}async getApprovedBalances(e,t=!1,n=!1){return C.getApprovedBalance(this,e,t,n)}async getTotalBalance(e,t,i,a=!1,o,s=!1){let l=i??await this.getEthereumAddressByChain(e),u=t??this.userKeys,d=await this.getBalances(e,u.getShieldedPrivateKey(),u.getShieldedPublicKey(),l,a,o,s),f=!r.isSolanaLike(e)&&!s?await this.getApprovedBalances(e,a,o):new Map,p=n.isExtension?await h.privateTokensDB.getPrivateTokens(e,l):c.getErc20TokensForChain(e),m=[];return p.forEach(e=>{let t=e.erc20TokenAddress.toLowerCase(),n=d.get(t),r=f.get(t),i={token:e,balance:(n?.balance??0n)+(r?.balance??0n),timestamp:n?.timestamp||r?.timestamp||`0`,nfts:n?.nfts||[]};m.push(i)}),m}async getStuckShieldedBalances(e,t,n){return(await this.getTotalBalance(e,t,n,!1,!1,!0)).filter(e=>e.balance>0n)}getSupportedPassportLinks(){return o.supportedPassportLinks}checkAccessToken(e,t){return p.checkHinkalAccessToken(this,e,t)}checkExternalTokenLimitsUSD(e,t,n){return ne.checkTokenLimitsUSD(e,t,n)}async getHinkalTreeRootHash(t){if(r.isSolanaLike(t)){let{hinkalIdl:e,hinkalAddress:n,originalDeployer:i}=r.networkRegistry[t].contractData;if(!e||!n||!i)throw Error(`Missing Solana configuration for chain ${t}`);let a=new $.PublicKey(i),o=d.getMerkleAccountPublicKey(new $.PublicKey(n),a);return q.fetchSolanaMerkleTreeRootHash(this.getSolanaProgram(e),o)}return this.getContractWithFetcherByChainId(t,e.ContractType.HinkalContract).getRootHash()}async getAccessTokenTreeRootHash(t){if(r.isSolanaLike(t)){let{hinkalIdl:e,hinkalAddress:n,originalDeployer:i}=r.networkRegistry[t].contractData;if(!e||!n||!i)throw Error(`Missing Solana configuration for chain ${t}`);let a=new $.PublicKey(i),o=d.getAccessTokenMerkleAccountPublicKey(new $.PublicKey(n),a);return q.fetchSolanaMerkleTreeRootHash(this.getSolanaProgram(e),o)}return this.getContractWithFetcherByChainId(t,e.ContractType.AccessTokenContract).getRootHash()}async resetMerkleTreesIfNecessary(e){let t=(await Promise.all((e??this.getSupportedChains()).map(async e=>{let[t,n]=await Promise.all([this.getHinkalTreeRootHash(e),this.getAccessTokenTreeRootHash(e)]);return{chainId:e,needsReset:BigInt(t)!==this.merkleTreeHinkalByChain[e].getRootHash()||BigInt(n)!==this.merkleTreeAccessTokenByChain[e].getRootHash()}}))).filter(e=>e.needsReset).map(e=>e.chainId);t.length>0&&(console.log(`resetting merkle tree in resetMerkleTreesIfNecessary for chains:`,t),await this.resetMerkle(t))}async getEthereumAddress(){let e=this.ethereumProviderAdapter??this.solanaProviderAdapter??this.tronProviderAdapter;if(!e)throw Error(`No provider adapter initialized`);return e.getAddress()}getEthereumAddressByChain(e){return this.getProviderAdapter(e).getAddress()}async getRandomRelay(e,t=!1){return(await a.API.getIdleRelay(e,t)).relay}getGasPrice(e){let t=this.getProviderAdapter(e);if(!t)throw Error(`Illegal State of providerAdapter in Hinkal: no providerAdapter initialized`);return t.getGasPrice(e)}getAPI(){return a.API}snapshotsClearInterval(){this.getSupportedChains().forEach(e=>{this.commitmentsSnapshotServiceByChain[e]?.intervalClear(),this.accessTokenSnapshotServiceByChain[e]?.intervalClear(),this.nullifierSnapshotServiceByChain[e]?.intervalClear(),this.approvalsSnapshotServiceByChain[e]?.intervalClear()})}checkTokenRegistry(t,n,i){if(r.isSolanaLike(t)){let{hinkalIdl:e,hinkalAddress:a,originalDeployer:o}=r.networkRegistry[t].contractData;if(!e||!a||!o)throw Error(`missing solana data`);return f.hinkalCheckSolanaTokenRegistry(this.getSolanaProgram(e),new $.PublicKey(o),n,i)}return r.isTronLike(t)?b.hinkalCheckTronTokenRegistry(n,i,t):b.hinkalCheckTokenRegistry(this.getContractWithFetcher(t,e.ContractType.HinkalHelperContract),n,i)}getRecipientInfo(){return j.getRecipientInfo(this)}getApprovedUtxos(e,t=!1){return C.getApprovedUtxos(this,e,t)}getApprovedUtxosForToken(e,t,n=!1){return C.getApprovedUtxosForToken(this,e,t,n)}async deposit(e,t,n=!0,r=!1){return S.hinkalDeposit(this,e,t,n,r)}async depositSolana(e,t){return T.hinkalSolanaDeposit(this,e,t)}async depositForOther(e,t,n,r=!0,i=!1){return this.enforceRateLimit(this.depositForOther.name,[e,t,n]),S.hinkalDepositForOther(this,e,t,n,r,i)}async depositSolanaForOther(e,t,n){return this.enforceRateLimit(this.depositSolanaForOther.name,[e,t,n]),T.hinkalSolanaDepositForOther(this,e,t,n)}async depositAndWithdraw(e,t,n,i,a,o,s,c=!0){return r.isSolanaLike(m.validateAndGetChainId([e]))?B.hinkalSolanaDepositAndWithdraw(this,e,t,n,i,a,o,s):w.hinkalDepositAndWithdraw(this,e,t,n,i,a,o,s,c)}async claimUtxo(e,t,n,i){return r.isSolanaLike(m.validateAndGetChainId([e]))?Z.hinkalSolanaClaimUtxo(this,e,t,n,i):Y.hinkalClaimUtxo(this,e,t,n,i)}async depositAndBridge(e,t,n,r,i,a,o=!0){return J.hinkalDepositAndBridge(this,e,t,n,r,i,a,o)}async prooflessDeposit(e,t,n,i){return r.isSolanaLike(m.validateAndGetChainId(e))?X.hinkalSolanaProoflessDeposit(this,e,t,n,i):P.hinkalProoflessDeposit(this,e,t,n,i)}getSolanaProgram(e){if(!this.solanaProviderAdapter)throw Error(`No provider adapter initialized`);if(!(`getSolanaProgram`in this.solanaProviderAdapter))throw Error(`Current provider adapter is not a Solana provider adapter`);return this.solanaProviderAdapter.getSolanaProgram(e)}getSolanaPublicKey(){if(!this.solanaProviderAdapter)throw Error(`No provider adapter initialized`);if(!(`getSolanaPublicKey`in this.solanaProviderAdapter))throw Error(`Current provider adapter is not a Solana provider adapter`);return this.solanaProviderAdapter.getSolanaPublicKey()}async transfer(e,t,n,i,a,o){return r.isSolanaLike(m.validateAndGetChainId(e))?H.hinkalSolanaTransfer(this,e,t,n,i,a,o):L.hinkalTransfer(this,e,t,n,i,a,o)}async withdraw(e,t,n,i,a,o,s){return r.isSolanaLike(m.validateAndGetChainId(e))?V.hinkalSolanaWithdraw(this,e,t,n,a,o,s):D.hinkalWithdraw(this,e,t,n,i,a,o,s)}async withdrawStuckUtxos(e,t){return re.hinkalWithdrawStuckUtxos(this,e,t)}async swap(e,t,n,i,a,o,s){return r.isSolanaLike(m.validateAndGetChainId(e))?this.swapSolana(e,t,i,a,o):E.hinkalSwap(this,e,t,n,i,a,o,s)}async swapSolana(e,t,n,r,i){let a=JSON.parse(n),o=BigInt(a.swapperAccountSalt),{instructionLists:s,addressLookupTableAccount:c}=a.data;return U.hinkalSolanaSwap(this,e,t,o,s,c,r,i)}async actionReceive(e,t,n,i,a,o){if(!a)throw Error(`subAccount is required`);return r.isSolanaLike(m.validateAndGetChainId(e))?K.hinkalSolanaProxyShield(this,e[0],t[0],a,void 0,o):N.hinkalActionReceive(this,e,t,n,i,a,o)}async actionPrivateWallet(e,t,n,r,i,a,o,s,c,l,u=!1,d,f,p){return this.enforceRateLimit(this.actionPrivateWallet.name,[e,t,n,r,i,a,o,s,c,p]),A.hinkalPrivateWallet(this,e,t,n,r,i,a,o,s,c,l,u,d,f,p)}async proxySwap(e,t,n,i,a,o,s,c,l=!1,u,d){return r.isSolanaLike(m.validateAndGetChainId(e))?G.hinkalSolanaProxySwap(this,e,t,i,o,s,c):F.hinkalProxySwap(this,e,t,n,i,a,o,s,c,l,u,d)}async proxyToPrivate(e,t,n,i,a,o,s){return r.isSolanaLike(m.validateAndGetChainId(e))?(this.enforceRateLimit(this.proxyToPrivate.name,[e[0],t[0],n,i]),K.hinkalSolanaProxyShield(this,e[0],t[0],n,i,s)):R.hinkalProxyToPrivate(this,e,t,i,a,o,n,s)}async proxySend(e,t,n,i,a,o,s){let c=m.validateAndGetChainId(e);if(r.isSolanaLike(c))return W.hinkalSolanaProxySend(this,e[0],t[0],n,i,s);let l=te.createTransaferEmporiumOpsBatch(this,c,e.map(e=>e.erc20TokenAddress),t,i),u=e.map((e,n)=>({token:e,amount:-1n*t[n]}));return await this.actionPrivateWallet(c,[],[],[],l,u,n,a,o,void 0,void 0,void 0,s,void 0)}async multiSendPrivateRecipients(e,t,n){return this.enforceRateLimit(this.multiSendPrivateRecipients.name,[e,t,n]),I.hinkalMultiSendPrivateRecipients(this,e,t,n)}areMerkleTreeUpdatesDisabled(){return this.disableMerkleTreeUpdates}updateMerkleTreeUpdates(e){this.disableMerkleTreeUpdates=e}};exports.Hinkal=ie;
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../types/ethereum-network.types.cjs`),t=require(`../../functions/utils/serialize.utils.cjs`),n=require(`../../constants/vite.constants.cjs`),r=require(`../../constants/chains.constants.cjs`),i=require(`../../types/hinkal.types.cjs`),a=require(`../../API/API.cjs`),o=require(`../../constants/kyc.constants.cjs`),s=require(`../../error-handling/error-codes.constants.cjs`),c=require(`../../functions/utils/erc20tokenFunctions.cjs`);require(`../../API/index.cjs`);const l=require(`../../crypto/poseidon.cjs`),u=require(`../crypto-keys/keys.cjs`),d=require(`../../functions/pre-transaction/solana.cjs`),f=require(`./hinkalCheckSolanaTokenRegistry.cjs`),p=require(`../../functions/web3/functionCalls/accessTokenCalls.cjs`),m=require(`../../functions/utils/token-check.utils.cjs`),h=require(`../TokenDBs/PrivateTokensDB.cjs`),g=require(`../../functions/web3/events/getShieldedBalance.cjs`),ee=require(`../../functions/utils/reloadPage.cjs`),_=require(`../../functions/utils/cacheDevice.utils.cjs`),v=require(`../../functions/web3/getContractMetadata.cjs`),y=require(`../../providers/SolanaProviderAdapter.cjs`),b=require(`./hinkalCheckTokenRegistry.cjs`),x=require(`../merkle-tree/MerkleTree.cjs`);require(`../merkle-tree/index.cjs`);const S=require(`./hinkalDeposit.cjs`),te=require(`../../functions/private-wallet/emporium.helpers.cjs`),C=require(`../../functions/web3/events/getApprovedBalance.cjs`),ne=require(`../../functions/kyc/checkTokenLimitsUSD.cjs`),w=require(`./hinkalDepositAndWithdraw.cjs`),T=require(`./hinkalSolanaDeposit.cjs`),E=require(`./hinkalSwap.cjs`),D=require(`./hinkalWithdraw.cjs`),O=require(`./resetMerkleTrees.cjs`),k=require(`../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs`),A=require(`./hinkalPrivateWallet.cjs`),j=require(`./hinkalGetRecipientInfo.cjs`),M=require(`./hinkalSignSubAccount.cjs`),N=require(`./hinkalActionReceive.cjs`);require(`../TokenDBs/index.cjs`);const P=require(`./hinkalProoflessDeposit.cjs`),F=require(`./hinkalProxySwap.cjs`),I=require(`./hinkalMultiSend.cjs`),L=require(`./hinkalTransfer.cjs`),R=require(`./hinkalProxyToPrivate.cjs`),z=require(`../../providers/TronProviderAdapter.cjs`),B=require(`./hinkalSolanaDepositAndWithdraw.cjs`),V=require(`./hinkalSolanaWithdraw.cjs`),H=require(`./hinkalSolanaTransfer.cjs`),U=require(`./hinkalSolanaSwap.cjs`),W=require(`./hinkalSolanaProxySend.cjs`),G=require(`./hinkalSolanaProxySwap.cjs`),K=require(`./hinkalSolanaProxyShield.cjs`),q=require(`../../functions/web3/fetchSolanaMerkleTreeRootHash.cjs`),J=require(`./hinkalDepositAndBridge.cjs`),Y=require(`./hinkalClaimUtxo.cjs`),X=require(`./hinkalSolanaProoflessDeposit.cjs`),Z=require(`./hinkalSolanaClaimUtxo.cjs`),re=require(`./hinkalWithdrawStuckUtxos.cjs`);let Q=require(`ethers`),$=require(`@solana/web3.js`);var ie=class{ethereumProviderAdapter;solanaProviderAdapter;tronProviderAdapter;userKeys;signingMessage=`Login to Hinkal Protocol`;privateTransferSigningMessage=`Login to Hinkal's Private Transfer App`;merkleTreeHinkalByChain={};merkleTreeAccessTokenByChain={};nullifiersByChain={};encryptedOutputsByChain={};approvalsByChain={};commitmentsSnapshotServiceByChain={};nullifierSnapshotServiceByChain={};accessTokenSnapshotServiceByChain={};approvalsSnapshotServiceByChain={};utxoUtils;lastCallState=new Map;cacheDevice;generateProofRemotely;disableMerkleTreeUpdates;constructor(e){this.userKeys=new u.UserKeys(void 0),r.HINKAL_SUPPORTED_CHAINS.forEach(e=>{this.merkleTreeHinkalByChain[e]=x.MerkleTree.create(l.poseidonFunction,0n),this.merkleTreeAccessTokenByChain[e]=x.MerkleTree.create(l.poseidonFunction,0n),this.nullifiersByChain[e]=new Set,this.encryptedOutputsByChain[e]=[],this.approvalsByChain[e]=new Map}),this.generateProofRemotely=e?.generateProofRemotely??!0,this.utxoUtils=new k.MultiThreadedUtxoUtils,this.cacheDevice=_.createCacheDevice(e),this.disableMerkleTreeUpdates=e?.disableMerkleTreeUpdates??!1}enforceRateLimit(e,n,r=1e3){let i=Date.now(),a=t.CustomJSONStringify(n),o=this.lastCallState.get(e);if(o&&o.argsKey===a&&i-o.timestamp<r)throw Error(`${e} was already called with the same arguments`);this.lastCallState.set(e,{timestamp:i,argsKey:a})}getProviderAdapter(e){let t=e;t||=this.ethereumProviderAdapter?r.chainIds.ethMainnet:this.solanaProviderAdapter?r.chainIds.solanaMainnet:r.chainIds.tronMainnet;let n;if(n=r.isSolanaLike(t)?this.solanaProviderAdapter:r.isTronLike(t)?this.tronProviderAdapter:this.ethereumProviderAdapter,!n)throw Error(`ProviderAdapter is not initialized`);return n}async initProviderAdapter(e,t){let n=r.chainIds.ethMainnet;t instanceof y.SolanaProviderAdapter?n=r.chainIds.solanaMainnet:t instanceof z.TronProviderAdapter&&(n=r.currentTronChainId),await this.updateProviderAdapter(n,t),t.initConnector(e);let i=await t.connectAndPatchProvider(e);await t.init(i),await this.setListeners()}getSigningMessage(e=i.LoginMessageMode.PROTOCOL){switch(e){case i.LoginMessageMode.PRIVATE_TRANSFER:return this.privateTransferSigningMessage;case i.LoginMessageMode.PROTOCOL:default:return this.signingMessage}}async initUserKeys(e=i.LoginMessageMode.PROTOCOL){let t=this.getSigningMessage(e);this.userKeys=new u.UserKeys(await this.getProviderAdapter().signMessage(t))}initUserKeysWithSignature(e){this.userKeys=new u.UserKeys(e)}async initUserKeysFromSeedPhrases(e){let t=e.join(` `),n=Q.ethers.toUtf8Bytes(t);this.userKeys=new u.UserKeys(Q.ethers.keccak256(n))}async resetMerkle(e){this.disableMerkleTreeUpdates||(e?.every(e=>this.isSelectedNetworkSupported(e))??!0)&&await O.resetMerkleTrees(this,e)}getTronWeb(){let e=this.tronProviderAdapter;if(!e)throw Error(`Tron provider adapter not initialized`);if(!(e instanceof z.TronProviderAdapter))throw Error(`Tron provider adapter is not a TronProviderAdapter`);let t=e.getTronWeb();if(!t)throw Error(`TronWeb not available`);return t}getSupportedChains(){return this.ethereumProviderAdapter&&this.solanaProviderAdapter?r.WALLET_SUPPORTED_CHAINS:this.ethereumProviderAdapter?r.HINKAL_SUPPORTED_CHAINS.filter(e=>!r.isSolanaLike(e)&&!r.isTronLike(e)):this.solanaProviderAdapter?r.HINKAL_SUPPORTED_CHAINS.filter(e=>r.isSolanaLike(e)):this.tronProviderAdapter?r.HINKAL_SUPPORTED_CHAINS.filter(e=>r.isTronLike(e)):[]}async waitForTransaction(e,t,n=1){return!!await this.getProviderAdapter(e).waitForTransaction(e,t,n)}getContract(e,t,n=void 0){return this.getProviderAdapter(e).getContract(e,t,n)}getContractWithFetcherByChainId(e,t,n=void 0){return v.getContractWithFetcherByChainId(e,t,n)}async signMessage(e){return await this.getProviderAdapter().signMessage(e)}async signTypedData(e,t,n){return await this.getProviderAdapter().signTypedData(e,t,n)}async signWithSubAccount(e,t,n,r){return M.hinkalSignSubAccount(e,t,n,r)}getContractWithSigner(e,t,n=``){return this.getProviderAdapter(e).getContractWithSigner(e,t,n)}getContractWithFetcher(e,t,n=``){return this.getProviderAdapter(e).getContractWithFetcher(e,t,n)}isSelectedNetworkSupported(e){return!!r.networkRegistry[e]}async switchNetwork(e){try{await this.getProviderAdapter().switchNetwork(e)}catch{throw Error(s.transactionErrorCodes.FAILED_TO_SWITCH_NETWORKS)}}isPermitterAvailable(e){return this.getProviderAdapter(e).isPermitterAvailable()}async disconnectFromConnector(){await this.ethereumProviderAdapter?.disconnectFromConnector(),await this.solanaProviderAdapter?.disconnectFromConnector(),await this.tronProviderAdapter?.disconnectFromConnector()}async resetProviderAdapters(){this.ethereumProviderAdapter=void 0,this.solanaProviderAdapter=void 0,this.tronProviderAdapter=void 0}async updateProviderAdapter(e,t){try{r.isSolanaLike(e)?(this.solanaProviderAdapter&&this.solanaProviderAdapter.release(),this.solanaProviderAdapter=t):r.isTronLike(e)?(this.tronProviderAdapter&&this.tronProviderAdapter.release(),this.tronProviderAdapter=t):(this.ethereumProviderAdapter&&this.ethereumProviderAdapter.release(),this.ethereumProviderAdapter=t)}catch(e){throw console.error(e),Error(`updateProviderAdapter failed, please try again.`)}}async setListeners(){this.ethereumProviderAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}}),this.solanaProviderAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}}),this.tronProviderAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}})}async onAccountChanged(){await this.ethereumProviderAdapter?.onAccountChanged(),await this.solanaProviderAdapter?.onAccountChanged(),await this.tronProviderAdapter?.onAccountChanged();let e=i.EventType.AccountChanged;typeof document<`u`?document?.dispatchEvent(new Event(e)):process?.emit(`message`,e,void 0)}async onChainChanged(e){e?await this.getProviderAdapter(e).onChainChanged(e):(await this.disconnectFromConnector(),ee.reloadPage())}async monitorConnectedAddress(e){await a.API.monitor(await this.getEthereumAddressByChain(e))}async getBalances(e,t,n,r,i=!1,a,o=!1){return g.getShieldedBalance(this,e,t,n,r,i,this.generateProofRemotely,a,o)}async getApprovedBalances(e,t=!1,n=!1){return C.getApprovedBalance(this,e,t,n)}async getTotalBalance(e,t,i,a=!1,o,s=!1){let l=i??await this.getEthereumAddressByChain(e),u=t??this.userKeys,d=await this.getBalances(e,u.getShieldedPrivateKey(),u.getShieldedPublicKey(),l,a,o,s),f=!r.isSolanaLike(e)&&!s?await this.getApprovedBalances(e,a,o):new Map,p=n.isExtension?await h.privateTokensDB.getPrivateTokens(e,l):c.getErc20TokensForChain(e),m=[];return p.forEach(e=>{let t=e.erc20TokenAddress.toLowerCase(),n=d.get(t),r=f.get(t),i={token:e,balance:(n?.balance??0n)+(r?.balance??0n),timestamp:n?.timestamp||r?.timestamp||`0`,nfts:n?.nfts||[]};m.push(i)}),m}async getStuckShieldedBalances(e,t,n){return(await this.getTotalBalance(e,t,n,!1,!1,!0)).filter(e=>e.balance>0n)}getSupportedPassportLinks(){return o.supportedPassportLinks}checkAccessToken(e,t){return p.checkHinkalAccessToken(this,e,t)}checkExternalTokenLimitsUSD(e,t,n){return ne.checkTokenLimitsUSD(e,t,n)}async getHinkalTreeRootHash(t){if(r.isSolanaLike(t)){let{hinkalIdl:e,hinkalAddress:n,originalDeployer:i}=r.networkRegistry[t].contractData;if(!e||!n||!i)throw Error(`Missing Solana configuration for chain ${t}`);let a=new $.PublicKey(i),o=d.getMerkleAccountPublicKey(new $.PublicKey(n),a);return q.fetchSolanaMerkleTreeRootHash(this.getSolanaProgram(e),o)}return this.getContractWithFetcherByChainId(t,e.ContractType.HinkalContract).getRootHash()}async getAccessTokenTreeRootHash(t){if(r.isSolanaLike(t)){let{hinkalIdl:e,hinkalAddress:n,originalDeployer:i}=r.networkRegistry[t].contractData;if(!e||!n||!i)throw Error(`Missing Solana configuration for chain ${t}`);let a=new $.PublicKey(i),o=d.getAccessTokenMerkleAccountPublicKey(new $.PublicKey(n),a);return q.fetchSolanaMerkleTreeRootHash(this.getSolanaProgram(e),o)}return this.getContractWithFetcherByChainId(t,e.ContractType.AccessTokenContract).getRootHash()}async resetMerkleTreesIfNecessary(e){let t=(await Promise.all((e??this.getSupportedChains()).map(async e=>{let[t,n]=await Promise.all([this.getHinkalTreeRootHash(e),this.getAccessTokenTreeRootHash(e)]);return{chainId:e,needsReset:BigInt(t)!==this.merkleTreeHinkalByChain[e].getRootHash()||BigInt(n)!==this.merkleTreeAccessTokenByChain[e].getRootHash()}}))).filter(e=>e.needsReset).map(e=>e.chainId);t.length>0&&(console.log(`resetting merkle tree in resetMerkleTreesIfNecessary for chains:`,t),await this.resetMerkle(t))}async getEthereumAddress(){let e=this.ethereumProviderAdapter??this.solanaProviderAdapter??this.tronProviderAdapter;if(!e)throw Error(`No provider adapter initialized`);return e.getAddress()}getEthereumAddressByChain(e){return this.getProviderAdapter(e).getAddress()}async getRandomRelay(e,t=!1){return(await a.API.getIdleRelay(e,t)).relay}getGasPrice(e){let t=this.getProviderAdapter(e);if(!t)throw Error(`Illegal State of providerAdapter in Hinkal: no providerAdapter initialized`);return t.getGasPrice(e)}getAPI(){return a.API}snapshotsClearInterval(){this.getSupportedChains().forEach(e=>{this.commitmentsSnapshotServiceByChain[e]?.intervalClear(),this.accessTokenSnapshotServiceByChain[e]?.intervalClear(),this.nullifierSnapshotServiceByChain[e]?.intervalClear(),this.approvalsSnapshotServiceByChain[e]?.intervalClear()})}checkTokenRegistry(t,n,i){if(r.isSolanaLike(t)){let{hinkalIdl:e,hinkalAddress:a,originalDeployer:o}=r.networkRegistry[t].contractData;if(!e||!a||!o)throw Error(`missing solana data`);return f.hinkalCheckSolanaTokenRegistry(this.getSolanaProgram(e),new $.PublicKey(o),n,i)}return r.isTronLike(t)?b.hinkalCheckTronTokenRegistry(n,i,t):b.hinkalCheckTokenRegistry(this.getContractWithFetcher(t,e.ContractType.HinkalHelperContract),n,i)}getRecipientInfo(){return j.getRecipientInfo(this)}getApprovedUtxos(e,t=!1){return C.getApprovedUtxos(this,e,t)}getApprovedUtxosForToken(e,t,n=!1){return C.getApprovedUtxosForToken(this,e,t,n)}async deposit(e,t,n=!0,r=!1){return S.hinkalDeposit(this,e,t,n,r)}async depositSolana(e,t){return T.hinkalSolanaDeposit(this,e,t)}async depositForOther(e,t,n,r=!0,i=!1){return this.enforceRateLimit(this.depositForOther.name,[e,t,n]),S.hinkalDepositForOther(this,e,t,n,r,i)}async depositSolanaForOther(e,t,n){return this.enforceRateLimit(this.depositSolanaForOther.name,[e,t,n]),T.hinkalSolanaDepositForOther(this,e,t,n)}async depositAndWithdraw(e,t,n,i,a,o,s,c=!0){return r.isSolanaLike(m.validateAndGetChainId([e]))?B.hinkalSolanaDepositAndWithdraw(this,e,t,n,i,a,o,s):w.hinkalDepositAndWithdraw(this,e,t,n,i,a,o,s,c)}async claimUtxo(e,t,n,i){return r.isSolanaLike(m.validateAndGetChainId([e]))?Z.hinkalSolanaClaimUtxo(this,e,t,n,i):Y.hinkalClaimUtxo(this,e,t,n,i)}async depositAndBridge(e,t,n,r,i,a,o=!0){return J.hinkalDepositAndBridge(this,e,t,n,r,i,a,o)}async prooflessDeposit(e,t,n,i){return r.isSolanaLike(m.validateAndGetChainId(e))?X.hinkalSolanaProoflessDeposit(this,e,t,n,i):P.hinkalProoflessDeposit(this,e,t,n,i)}getSolanaProgram(e){if(!this.solanaProviderAdapter)throw Error(`No provider adapter initialized`);if(!(`getSolanaProgram`in this.solanaProviderAdapter))throw Error(`Current provider adapter is not a Solana provider adapter`);return this.solanaProviderAdapter.getSolanaProgram(e)}getSolanaPublicKey(){if(!this.solanaProviderAdapter)throw Error(`No provider adapter initialized`);if(!(`getSolanaPublicKey`in this.solanaProviderAdapter))throw Error(`Current provider adapter is not a Solana provider adapter`);return this.solanaProviderAdapter.getSolanaPublicKey()}async transfer(e,t,n,i,a,o){return r.isSolanaLike(m.validateAndGetChainId(e))?H.hinkalSolanaTransfer(this,e,t,n,i,a,o):L.hinkalTransfer(this,e,t,n,i,a,o)}async withdraw(e,t,n,i,a,o,s){return r.isSolanaLike(m.validateAndGetChainId(e))?V.hinkalSolanaWithdraw(this,e,t,n,a,o,s):D.hinkalWithdraw(this,e,t,n,i,a,o,s)}async withdrawStuckUtxos(e,t){return re.hinkalWithdrawStuckUtxos(this,e,t)}async swap(e,t,n,i,a,o,s){return r.isSolanaLike(m.validateAndGetChainId(e))?this.swapSolana(e,t,i,a,o):E.hinkalSwap(this,e,t,n,i,a,o,s)}async swapSolana(e,t,n,r,i){let a=JSON.parse(n),o=BigInt(a.swapperAccountSalt),{instructionLists:s,addressLookupTableAccount:c}=a.data;return U.hinkalSolanaSwap(this,e,t,o,s,c,r,i)}async actionReceive(e,t,n,i,a,o){if(!a)throw Error(`subAccount is required`);return r.isSolanaLike(m.validateAndGetChainId(e))?K.hinkalSolanaProxyShield(this,e[0],t[0],a,void 0,o):N.hinkalActionReceive(this,e,t,n,i,a,o)}async actionPrivateWallet(e,t,n,r,i,a,o,s,c,l,u=!1,d,f,p){return this.enforceRateLimit(this.actionPrivateWallet.name,[e,t,n,r,i,a,o,s,c,p]),A.hinkalPrivateWallet(this,e,t,n,r,i,a,o,s,c,l,u,d,f,p)}async proxySwap(e,t,n,i,a,o,s,c,l=!1,u,d){return r.isSolanaLike(m.validateAndGetChainId(e))?G.hinkalSolanaProxySwap(this,e,t,i,o,s,c):F.hinkalProxySwap(this,e,t,n,i,a,o,s,c,l,u,d)}async proxyToPrivate(e,t,n,i,a,o,s){return r.isSolanaLike(m.validateAndGetChainId(e))?(this.enforceRateLimit(this.proxyToPrivate.name,[e[0],t[0],n,i]),K.hinkalSolanaProxyShield(this,e[0],t[0],n,i,s)):R.hinkalProxyToPrivate(this,e,t,i,a,o,n,s)}async proxySend(e,t,n,i,a,o,s){let c=m.validateAndGetChainId(e);if(r.isSolanaLike(c))return W.hinkalSolanaProxySend(this,e[0],t[0],n,i,s);let l=te.createTransaferEmporiumOpsBatch(this,c,e.map(e=>e.erc20TokenAddress),t,i),u=e.map((e,n)=>({token:e,amount:-1n*t[n]}));return await this.actionPrivateWallet(c,[],[],[],l,u,n,a,o,void 0,void 0,void 0,s,void 0)}async multiSendPrivateRecipients(e,t,n){return this.enforceRateLimit(this.multiSendPrivateRecipients.name,[e,t,n]),I.hinkalMultiSendPrivateRecipients(this,e,t,n)}areMerkleTreeUpdatesDisabled(){return this.disableMerkleTreeUpdates}updateMerkleTreeUpdates(e){this.disableMerkleTreeUpdates=e}};exports.Hinkal=ie;
|
|
@@ -59,7 +59,7 @@ import { hinkalSolanaClaimUtxo as he } from "./hinkalSolanaClaimUtxo.mjs";
|
|
|
59
59
|
import { hinkalWithdrawStuckUtxos as ge } from "./hinkalWithdrawStuckUtxos.mjs";
|
|
60
60
|
import { ethers as Q } from "ethers";
|
|
61
61
|
import { PublicKey as $ } from "@solana/web3.js";
|
|
62
|
-
//#region
|
|
62
|
+
//#region ../shared/common/src/data-structures/Hinkal/Hinkal.ts
|
|
63
63
|
var _e = class {
|
|
64
64
|
ethereumProviderAdapter;
|
|
65
65
|
solanaProviderAdapter;
|
|
@@ -84,7 +84,7 @@ var _e = class {
|
|
|
84
84
|
constructor(e) {
|
|
85
85
|
this.userKeys = new h(void 0), r.forEach((e) => {
|
|
86
86
|
this.merkleTreeHinkalByChain[e] = E.create(m, 0n), this.merkleTreeAccessTokenByChain[e] = E.create(m, 0n), this.nullifiersByChain[e] = /* @__PURE__ */ new Set(), this.encryptedOutputsByChain[e] = [], this.approvalsByChain[e] = /* @__PURE__ */ new Map();
|
|
87
|
-
}), this.generateProofRemotely = e?.generateProofRemotely ?? !
|
|
87
|
+
}), this.generateProofRemotely = e?.generateProofRemotely ?? !0, this.utxoUtils = new B(), this.cacheDevice = x(e), this.disableMerkleTreeUpdates = e?.disableMerkleTreeUpdates ?? !1;
|
|
88
88
|
}
|
|
89
89
|
enforceRateLimit(e, n, r = 1e3) {
|
|
90
90
|
let i = Date.now(), a = t(n), o = this.lastCallState.get(e);
|
|
@@ -30,7 +30,7 @@ import { updateHinkal as O } from "../../functions/auto-deposit-back-helpers/upd
|
|
|
30
30
|
import "../../functions/index.mjs";
|
|
31
31
|
import { activityStorage as k } from "../IndexedDB/activity-db.mjs";
|
|
32
32
|
import "../IndexedDB/index.mjs";
|
|
33
|
-
//#region
|
|
33
|
+
//#region ../shared/common/src/data-structures/Hinkal/handleAutoDepositBack.ts
|
|
34
34
|
var te = 3 * 1e3, ne = 13 * 1e3, A = async (A, j, M, N, P, F, I, L) => {
|
|
35
35
|
if (!M || I.length === 0) return;
|
|
36
36
|
let R;
|
|
@@ -5,7 +5,7 @@ import { AccountActions as r } from "../AccountActions/AccountActions.mjs";
|
|
|
5
5
|
import { getFeeStructure as i } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
6
6
|
import { convertEmporiumOpToCallInfo as a } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
7
7
|
import { createTransaferEmporiumOpsBatch as o } from "../../functions/private-wallet/emporium.helpers.mjs";
|
|
8
|
-
//#region
|
|
8
|
+
//#region ../shared/common/src/data-structures/Hinkal/hinkalActionReceive.ts
|
|
9
9
|
var s = async (s, c, l, u, d, f, p) => {
|
|
10
10
|
if (!f) throw Error("hinkalActionReceive: subAccount should be provided");
|
|
11
11
|
if (!u) throw Error("Fee token is required in hinkalActionReceive");
|