@hinkal/common 0.2.29 → 0.2.30
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.mjs +1 -1
- 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/deploy-data-arbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arbMainnet.json.mjs +0 -2068
- package/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arcTestnet.json.mjs +0 -2246
- package/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-base.json.mjs +0 -2068
- package/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-ethMainnet.json.mjs +0 -2265
- package/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-localhost.json.mjs +1 -2266
- package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-optimism.json.mjs +0 -2068
- package/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-polygon.json.mjs +0 -2068
- 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/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.mjs +1 -1
- package/constants/token-data/index.mjs +1 -1
- 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.mjs +1 -1
- 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.mjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +2 -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.mjs +1 -1
- 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.mjs +1 -1
- package/error-handling/error-codes.constants.mjs +1 -1
- package/error-handling/get-error.message.mjs +1 -1
- 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.mjs +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.mjs +1 -1
- 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.d.ts +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.cjs +1 -1
- package/functions/utils/create-provider.d.ts +1 -1
- package/functions/utils/create-provider.mjs +5 -7
- 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.d.ts +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.d.ts +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.mjs +16 -14
- package/functions/web3/events/getInputUtxosEnclave.mjs +1 -1
- package/functions/web3/events/getShieldedBalance.cjs +1 -1
- package/functions/web3/events/getShieldedBalance.mjs +2 -2
- package/functions/web3/events/getTransactionLogEvents.d.ts +5 -8
- 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/mutexes/mutex.mjs +1 -1
- package/package.json +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/providers/CustomEthersProvider.cjs +0 -1
- package/providers/CustomEthersProvider.mjs +0 -28
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { caseInsensitiveEqual as e } from "./caseInsensitive.utils.mjs";
|
|
2
2
|
import { API as t } from "../../API/API.mjs";
|
|
3
3
|
import { transactionErrorCodes as n } from "../../error-handling/error-codes.constants.mjs";
|
|
4
|
-
//#region
|
|
4
|
+
//#region libs/shared/common/src/functions/utils/token-check.utils.ts
|
|
5
5
|
var r = async (e, n) => {
|
|
6
6
|
let r = await t.tokensInfoCall(e, n), i = [];
|
|
7
7
|
return r.forEach((e, t) => {
|
|
@@ -4,7 +4,7 @@ import { httpClient as r } from "../../data-structures/http/HttpClient.mjs";
|
|
|
4
4
|
import { ENCLAVE_EC2_URL as i } from "../snarkjs/constant.mjs";
|
|
5
5
|
import { ethers as a } from "ethers";
|
|
6
6
|
import { TronWeb as o } from "tronweb";
|
|
7
|
-
//#region
|
|
7
|
+
//#region libs/shared/common/src/functions/utils/tron.utils.ts
|
|
8
8
|
var s = ["https://nile.trongrid.io", "https://api.shasta.trongrid.io"], c = 1000n, l = (t) => {
|
|
9
9
|
let n = t.toLowerCase();
|
|
10
10
|
return s.some((e) => n.includes(e)) ? e.tronNile : e.tronMainnet;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { networkRegistry as e } from "../../constants/chains.constants.mjs";
|
|
2
2
|
import { httpClient as t } from "../../data-structures/http/HttpClient.mjs";
|
|
3
3
|
import { addressToHexFormat as n, createTronCallData as r } from "./tron.utils.mjs";
|
|
4
|
-
//#region
|
|
4
|
+
//#region libs/shared/common/src/functions/utils/tronSimulation.utils.ts
|
|
5
5
|
var i = async (i, a, o, s, c, l, u) => {
|
|
6
6
|
let d = n(a), f = n(l), p = e[i].fetchRpcUrl;
|
|
7
7
|
if (!p) throw Error("missing rpc url for tron simulation");
|
|
@@ -4,7 +4,7 @@ type TxConfirmationOptions = {
|
|
|
4
4
|
evmTimeoutMs?: number;
|
|
5
5
|
solanaCommitment?: Commitment;
|
|
6
6
|
};
|
|
7
|
-
export declare const waitForEthereumTransactionConfirmation: (chainId: number, txHash: string, opts?: TxConfirmationOptions) => Promise<
|
|
7
|
+
export declare const waitForEthereumTransactionConfirmation: (chainId: number, txHash: string, opts?: TxConfirmationOptions) => Promise<any>;
|
|
8
8
|
export declare const waitForSolanaTransactionConfirmation: (chainId: number, txHash: string, opts?: TxConfirmationOptions) => Promise<import('@solana/web3.js').RpcResponseAndContext<import('@solana/web3.js').SignatureResult>>;
|
|
9
9
|
export declare const waitForTransactionConfirmation: (chainId: number, txHash: string, opts?: TxConfirmationOptions) => Promise<void>;
|
|
10
10
|
export {};
|
|
@@ -4,7 +4,7 @@ import { TX_CONFIRMATION_TIMEOUT_EXTENDED as r } from "../../constants/tx-confir
|
|
|
4
4
|
import "../../constants/index.mjs";
|
|
5
5
|
import { Logger as i } from "../../error-handling/logger.mjs";
|
|
6
6
|
import { createCustomRpcProvider as a, createCustomSolanaConnection as o } from "./create-provider.mjs";
|
|
7
|
-
//#region
|
|
7
|
+
//#region libs/shared/common/src/functions/utils/tx-confirmation.utils.ts
|
|
8
8
|
var s = "confirmed", c = async (e, t, i = {}) => {
|
|
9
9
|
let { evmConfirmations: o = 1, evmTimeoutMs: s = r } = i, c = t.startsWith("0x") ? t : `0x${t}`, l = await a(e).waitForTransaction(c, o, s);
|
|
10
10
|
if (!l || l.status !== 1) throw Error(n.TRANSACTION_NOT_CONFIRMED);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { caseInsensitiveEqual as e } from "./caseInsensitive.utils.mjs";
|
|
2
2
|
import { transactionErrorCodes as t } from "../../error-handling/error-codes.constants.mjs";
|
|
3
|
-
//#region
|
|
3
|
+
//#region libs/shared/common/src/functions/utils/upToDateState.ts
|
|
4
4
|
var n = async (n, r) => {
|
|
5
5
|
if (!e(await n.getEthereumAddress(), r)) throw Error(t.ERROR_MESSAGE_CHAIN_ADDRESS_CHANGED);
|
|
6
6
|
return !0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UAParser as e } from "ua-parser-js";
|
|
2
|
-
//#region
|
|
2
|
+
//#region libs/shared/common/src/functions/utils/userAgent.ts
|
|
3
3
|
var t = new e(), n = 17, r = () => {
|
|
4
4
|
let { name: e, version: r } = t.getBrowser(), i = parseInt(r?.split(".")[0] ?? "0", 10);
|
|
5
5
|
return !(e === "Safari" && i && n > i);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getAmountInWei as e } from "../web3/etherFunctions.mjs";
|
|
2
|
-
//#region
|
|
2
|
+
//#region libs/shared/common/src/functions/utils/walletBalances.utils.ts
|
|
3
3
|
var t = (t, n, r, i, a) => {
|
|
4
4
|
try {
|
|
5
5
|
return !r || !t ? !0 : i ? a ? +t * a <= +n : !0 : e(r, t) <= e(r, n);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getWalletGroupKey as e } from "../utils/getWalletGroupKey.utils.mjs";
|
|
2
2
|
import "../utils/index.mjs";
|
|
3
|
-
//#region
|
|
3
|
+
//#region libs/shared/common/src/functions/web3/connectors.utils.ts
|
|
4
4
|
var t = { Trust: "Trust Wallet" }, n = (e) => e.type === "injected", r = (e) => e.id === "mock", i = (e) => e.id.startsWith("solana"), a = (e) => e.id.startsWith("tron-"), o = (n) => {
|
|
5
5
|
let r = /* @__PURE__ */ new Map();
|
|
6
6
|
return n.forEach((n) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region libs/shared/common/src/functions/web3/crypto.ts
|
|
2
2
|
var e = async (e, t) => {
|
|
3
3
|
let n = typeof e == "string" ? new TextEncoder().encode(e) : new Uint8Array(e), r = new Uint8Array(t), i = await crypto.subtle.importKey("raw", n, {
|
|
4
4
|
name: "HMAC",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { transactionErrorCodes as e } from "../../error-handling/error-codes.constants.mjs";
|
|
2
2
|
import { ethers as t } from "ethers";
|
|
3
|
-
//#region
|
|
3
|
+
//#region libs/shared/common/src/functions/web3/etherFunctions.ts
|
|
4
4
|
var n = (e) => t.parseEther(e), r = (e) => BigInt(t.hexlify(t.randomBytes(e))), i = (e, n) => t.formatUnits(n, e.decimals), a = (n, r) => {
|
|
5
5
|
let i = 10 ** (18 - n.decimals);
|
|
6
6
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventType as e } from "../../../types/hinkal.types.mjs";
|
|
2
2
|
import "../../../types/index.mjs";
|
|
3
|
-
//#region
|
|
3
|
+
//#region libs/shared/common/src/functions/web3/events/balanceChangedCustomHandler.ts
|
|
4
4
|
var t = (t) => {
|
|
5
5
|
let n = e.BalanceChange, r = new CustomEvent(n, { detail: t });
|
|
6
6
|
typeof document < "u" ? document.dispatchEvent(r) : process?.emit("message", r, void 0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventType as e } from "../../../types/hinkal.types.mjs";
|
|
2
2
|
import "../../../types/index.mjs";
|
|
3
|
-
//#region
|
|
3
|
+
//#region libs/shared/common/src/functions/web3/events/balanceChangedHandler.ts
|
|
4
4
|
var t = () => {
|
|
5
5
|
let t = e.BalanceChange;
|
|
6
6
|
typeof document < "u" ? document.dispatchEvent(new Event(t)) : process?.emit("message", t, void 0);
|
|
@@ -4,7 +4,7 @@ import { getErc20TokensForChain as n } from "../../utils/erc20tokenFunctions.mjs
|
|
|
4
4
|
import { getInHinkalAddressesCache as r, resetInHinkalAddressesCache as i, setInHinkalAddressesCache as a } from "../../utils/cacheFunctions.mjs";
|
|
5
5
|
import { privateTokensDB as o } from "../../../data-structures/TokenDBs/PrivateTokensDB.mjs";
|
|
6
6
|
import { Mutex as s } from "async-mutex";
|
|
7
|
-
//#region
|
|
7
|
+
//#region libs/shared/common/src/functions/web3/events/getApprovedBalance.ts
|
|
8
8
|
var c = new s(), l = (e, t, n) => (e.forEach((e) => {
|
|
9
9
|
e.inHinkalAddress === n && t.push(e);
|
|
10
10
|
}), t), u = (e, t, n = !1) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../constants/chains.constants.cjs`),t=require(`../../utils/caseInsensitive.utils.cjs`),n=require(`../../utils/addresses.cjs`),r=require(`../../../API/scheduled-transactions-calls.cjs`),i=require(`../../../data-structures/utxo/Utxo.cjs`),a=require(`../../utils/upToDateState.cjs`),o=require(`../../utils/cacheFunctions.cjs`),s=require(`../../utils/encodeTokenWithId.cjs`),c=require(`../../utils/solanaMint.utils.cjs`),l=require(`./getInputUtxosEnclave.cjs`),u=require(`../../utils/tron.utils.cjs`);var d=new(require(`async-mutex`)).Mutex,f=async(e,t,n,r,i,s,c,l,u)=>d.runExclusive(async()=>{u+=1;let d=s.slice(u),{lastOutput:f,additionalEncryptedOutputs:p}=await e.utxoUtils.batchProcess(d,l,t,n),m=[...c,...p];return await a.checkAddressNotUpdated(e,r),o.setHinkalCache({lastOutput:f,encryptedOutputs:m},e,n,i),await e.utxoUtils.buildBatchProcess(m,t,n)}),p=async(e,t,n,r)=>{let{utxos:i,encryptedOutputs:a,lastOutput:s}=await l.getInputUtxosEnclave(e,n,t);return o.setHinkalCache({encryptedOutputs:a,lastOutput:s},e,n,r),i},m=async(e,t,n,r,i,a,o,s,c)=>{try{return await p(e,t,n,i)}catch{return f(e,t,n,r,i,a,o,s,c)}},h=e=>{if(Array.isArray(e))return e;if(e!==void 0)return[e]},g=async(e,t,n)=>await e.utxoUtils.batchFilterUtxosWithNullifier(t,n),_=(e,t,n,r,a,o,s)=>{for(e.sort((e,t)=>e.amount<=t.amount?1:-1);e.length<t||e.length>t&&e.length<6;)if(e.push(new i.Utxo({amount:0n,erc20TokenAddress:a,mintAddress:s,shieldedPrivateKey:r,tokenId:o})),n)for(;e.length>6;)e.splice(e.length-1)},v=async({hinkal:e,chainId:t,passedShieldedPublicKey:n=void 0,ethAddress:r=void 0,resetCacheBefore:i=!1,allowRemoteDecryption:s=!1,useBlockedUtxos:c=!1})=>{let l=r??await e.getEthereumAddress(),u=n??e.userKeys.getShieldedPublicKey(),{userKeys:d}=e,p=e.encryptedOutputsByChain[t],h=e.nullifiersByChain[t],_=Array.from(p);i&&o.resetCache(e,t,u);let{encryptedOutputs:v,lastOutput:y}=o.getHinkalCache(e,t,u);await a.checkAddressNotUpdated(e,l);let b=y!==``,x=_.findIndex(e=>e.value===y),S=x>-1,C=!b&&x===-1,w=e.areMerkleTreeUpdatesDisabled(),T=!w&&(S||!s&&C),E=!w&&s&&C,D=!T&&!E,O=[];T?O=await f(e,d,t,l,u,_,v,y,x):E?O=await m(e,d,t,l,u,_,v,y,x):D&&(O=await e.utxoUtils.buildBatchProcess(v,d,t)),await a.checkAddressNotUpdated(e,l);let k=await g(e,O,h);return{inputUtxos:c?k.filter(e=>e.isBlocked):k.filter(e=>!e.isBlocked)}},y=async({hinkal:t,chainId:i,passedShieldedPublicKey:a=void 0,ethAddress:o=void 0,resetCacheBefore:s=!1,allowRemoteDecryption:c=!1})=>{let l=o??await t.getEthereumAddressByChain(i),d=n.hashEthereumAddress(e.isTronLike(i)?u.addressToHexFormat(l):l),{inputUtxos:f}=await v({hinkal:t,chainId:i,passedShieldedPublicKey:a,ethAddress:l,resetCacheBefore:s,allowRemoteDecryption:c,useBlockedUtxos:!0});if(!f.length)return{inputUtxos:[]};let{indexes:p}=await r.getScheduledTransactionsNullifierIndexes({hashedEthereumAddress:d,nullifiers:f.map(e=>e.getNullifier())});return{inputUtxos:p.map(e=>f[e]).filter(e=>!!e)}},b=async({hinkal:n,tokenWithId:r,minInput:i=2,sliceIfMore6:a=!0,chainId:o,passedShieldedPrivateKey:l=void 0,passedShieldedPublicKey:u=void 0,ethAddress:d=void 0,resetCacheBefore:f=!1,ensuredTokensWithId:p,useBlockedUtxos:m=!1})=>{let
|
|
1
|
+
require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../constants/chains.constants.cjs`),t=require(`../../utils/caseInsensitive.utils.cjs`),n=require(`../../utils/addresses.cjs`),r=require(`../../../API/scheduled-transactions-calls.cjs`),i=require(`../../../data-structures/utxo/Utxo.cjs`),a=require(`../../utils/upToDateState.cjs`),o=require(`../../utils/cacheFunctions.cjs`),s=require(`../../utils/encodeTokenWithId.cjs`),c=require(`../../utils/solanaMint.utils.cjs`),l=require(`./getInputUtxosEnclave.cjs`),u=require(`../../utils/tron.utils.cjs`);var d=new(require(`async-mutex`)).Mutex,f=async(e,t,n,r,i,s,c,l,u)=>d.runExclusive(async()=>{u+=1;let d=s.slice(u),{lastOutput:f,additionalEncryptedOutputs:p}=await e.utxoUtils.batchProcess(d,l,t,n),m=[...c,...p];return await a.checkAddressNotUpdated(e,r),o.setHinkalCache({lastOutput:f,encryptedOutputs:m},e,n,i),await e.utxoUtils.buildBatchProcess(m,t,n)}),p=async(e,t,n,r)=>{let{utxos:i,encryptedOutputs:a,lastOutput:s}=await l.getInputUtxosEnclave(e,n,t);return o.setHinkalCache({encryptedOutputs:a,lastOutput:s},e,n,r),i},m=async(e,t,n,r,i,a,o,s,c)=>{try{return await p(e,t,n,i)}catch{return f(e,t,n,r,i,a,o,s,c)}},h=e=>{if(Array.isArray(e))return e;if(e!==void 0)return[e]},g=async(e,t,n)=>await e.utxoUtils.batchFilterUtxosWithNullifier(t,n),_=(e,t,n,r,a,o,s)=>{for(e.sort((e,t)=>e.amount<=t.amount?1:-1);e.length<t||e.length>t&&e.length<6;)if(e.push(new i.Utxo({amount:0n,erc20TokenAddress:a,mintAddress:s,shieldedPrivateKey:r,tokenId:o})),n)for(;e.length>6;)e.splice(e.length-1)},v=async({hinkal:e,chainId:t,passedShieldedPublicKey:n=void 0,ethAddress:r=void 0,resetCacheBefore:i=!1,allowRemoteDecryption:s=!1,useBlockedUtxos:c=!1})=>{let l=r??await e.getEthereumAddress(),u=n??e.userKeys.getShieldedPublicKey(),{userKeys:d}=e,p=e.encryptedOutputsByChain[t],h=e.nullifiersByChain[t],_=Array.from(p);i&&o.resetCache(e,t,u);let{encryptedOutputs:v,lastOutput:y}=o.getHinkalCache(e,t,u);await a.checkAddressNotUpdated(e,l);let b=y!==``,x=_.findIndex(e=>e.value===y),S=x>-1,C=!b&&x===-1,w=e.areMerkleTreeUpdatesDisabled(),T=!w&&(S||!s&&C),E=!w&&s&&C,D=!T&&!E,O=[];T?O=await f(e,d,t,l,u,_,v,y,x):E?O=await m(e,d,t,l,u,_,v,y,x):D&&(O=await e.utxoUtils.buildBatchProcess(v,d,t)),await a.checkAddressNotUpdated(e,l);let k=await g(e,O,h);return{inputUtxos:c?k.filter(e=>e.isBlocked):k.filter(e=>!e.isBlocked)}},y=async({hinkal:t,chainId:i,passedShieldedPublicKey:a=void 0,ethAddress:o=void 0,resetCacheBefore:s=!1,allowRemoteDecryption:c=!1})=>{let l=o??await t.getEthereumAddressByChain(i),d=n.hashEthereumAddress(e.isTronLike(i)?u.addressToHexFormat(l):l),{inputUtxos:f}=await v({hinkal:t,chainId:i,passedShieldedPublicKey:a,ethAddress:l,resetCacheBefore:s,allowRemoteDecryption:c,useBlockedUtxos:!0});if(!f.length)return{inputUtxos:[]};let{indexes:p}=await r.getScheduledTransactionsNullifierIndexes({hashedEthereumAddress:d,nullifiers:f.map(e=>e.getNullifier())});return{inputUtxos:p.map(e=>f[e]).filter(e=>!!e)}},b=async({hinkal:n,tokenWithId:r,minInput:i=2,sliceIfMore6:a=!0,chainId:o,passedShieldedPrivateKey:l=void 0,passedShieldedPublicKey:u=void 0,ethAddress:d=void 0,resetCacheBefore:f=!1,ensuredTokensWithId:p,useBlockedUtxos:m=!1,allowRemoteDecryption:g=!0})=>{let b=l??n.userKeys.getShieldedPrivateKey(),{inputUtxos:x}=m?await y({hinkal:n,chainId:o,ethAddress:d,passedShieldedPrivateKey:l,resetCacheBefore:f,allowRemoteDecryption:g}):await v({hinkal:n,tokenWithId:r,minInput:i,sliceIfMore6:a,chainId:o,passedShieldedPrivateKey:l,passedShieldedPublicKey:u,ethAddress:d,resetCacheBefore:f,allowRemoteDecryption:g}),S=h(r),C=new Map;x.forEach(e=>{let n=e.getTokenAddress(o);if(S&&!S.some(r=>t.caseInsensitiveEqual(r.erc20TokenAddress,n)&&r.tokenId===e.tokenId))return;let r=s.encodeTokenWithId(o,{erc20TokenAddress:n,tokenId:e.tokenId}),i=C.get(r)??[];C.set(r,[...i,e])}),p?.forEach(e=>{let t=s.encodeTokenWithId(o,{erc20TokenAddress:e.erc20TokenAddress,tokenId:e.tokenId});C.set(t,C.get(t)??[])});for(let[t,n]of C){let r=t.split(`-`)[0],s=Number(t.split(`-`)[1]),l=e.isSolanaLike(o),u=l?r:void 0;_(n,i,a,b,l?c.formatMintAddress(r).compressedAddress.toLowerCase():r.toLowerCase(),s,u)}return C};exports.attemptGetInputUtxosRemotely=m,exports.getInputUtxoAndBalance=v,exports.getInputUtxoAndBalanceOfStuckUtxos=y,exports.getInputUtxoAndBalancePerToken=b,exports.getInputUtxosRemotely=p;
|
|
@@ -34,5 +34,5 @@ export declare const getInputUtxoAndBalance: ({ hinkal, chainId, passedShieldedP
|
|
|
34
34
|
export declare const getInputUtxoAndBalanceOfStuckUtxos: ({ hinkal, chainId, passedShieldedPublicKey, ethAddress, resetCacheBefore, allowRemoteDecryption, }: IGetInputUtxos) => Promise<{
|
|
35
35
|
inputUtxos: Utxo[];
|
|
36
36
|
}>;
|
|
37
|
-
export declare const getInputUtxoAndBalancePerToken: ({ hinkal, tokenWithId, minInput, sliceIfMore6, chainId, passedShieldedPrivateKey, passedShieldedPublicKey, ethAddress, resetCacheBefore, ensuredTokensWithId, useBlockedUtxos, }: IGetInputUtxos) => Promise<Map<string, Utxo[]>>;
|
|
37
|
+
export declare const getInputUtxoAndBalancePerToken: ({ hinkal, tokenWithId, minInput, sliceIfMore6, chainId, passedShieldedPrivateKey, passedShieldedPublicKey, ethAddress, resetCacheBefore, ensuredTokensWithId, useBlockedUtxos, allowRemoteDecryption, }: IGetInputUtxos) => Promise<Map<string, Utxo[]>>;
|
|
38
38
|
export {};
|
|
@@ -10,7 +10,7 @@ import { formatMintAddress as d } from "../../utils/solanaMint.utils.mjs";
|
|
|
10
10
|
import { getInputUtxosEnclave as f } from "./getInputUtxosEnclave.mjs";
|
|
11
11
|
import { addressToHexFormat as p } from "../../utils/tron.utils.mjs";
|
|
12
12
|
import { Mutex as m } from "async-mutex";
|
|
13
|
-
//#region
|
|
13
|
+
//#region libs/shared/common/src/functions/web3/events/getInputUtxoAndBalance.ts
|
|
14
14
|
var h = new m(), g = async (e, t, n, r, i, a, s, c, u) => h.runExclusive(async () => {
|
|
15
15
|
u += 1;
|
|
16
16
|
let d = a.slice(u), { lastOutput: f, additionalEncryptedOutputs: p } = await e.utxoUtils.batchProcess(d, c, t, n), m = [...s, ...p];
|
|
@@ -66,13 +66,14 @@ var h = new m(), g = async (e, t, n, r, i, a, s, c, u) => h.runExclusive(async (
|
|
|
66
66
|
nullifiers: d.map((e) => e.getNullifier())
|
|
67
67
|
});
|
|
68
68
|
return { inputUtxos: f.map((e) => d[e]).filter((e) => !!e) };
|
|
69
|
-
}, w = async ({ hinkal: t, tokenWithId: r, minInput: i = 2, sliceIfMore6: a = !0, chainId: o, passedShieldedPrivateKey: s = void 0, passedShieldedPublicKey: c = void 0, ethAddress: l = void 0, resetCacheBefore: f = !1, ensuredTokensWithId: p, useBlockedUtxos: m = !1 }) => {
|
|
70
|
-
let
|
|
69
|
+
}, w = async ({ hinkal: t, tokenWithId: r, minInput: i = 2, sliceIfMore6: a = !0, chainId: o, passedShieldedPrivateKey: s = void 0, passedShieldedPublicKey: c = void 0, ethAddress: l = void 0, resetCacheBefore: f = !1, ensuredTokensWithId: p, useBlockedUtxos: m = !1, allowRemoteDecryption: h = !0 }) => {
|
|
70
|
+
let g = s ?? t.userKeys.getShieldedPrivateKey(), { inputUtxos: _ } = m ? await C({
|
|
71
71
|
hinkal: t,
|
|
72
72
|
chainId: o,
|
|
73
73
|
ethAddress: l,
|
|
74
74
|
passedShieldedPrivateKey: s,
|
|
75
|
-
resetCacheBefore: f
|
|
75
|
+
resetCacheBefore: f,
|
|
76
|
+
allowRemoteDecryption: h
|
|
76
77
|
}) : await S({
|
|
77
78
|
hinkal: t,
|
|
78
79
|
tokenWithId: r,
|
|
@@ -82,28 +83,29 @@ var h = new m(), g = async (e, t, n, r, i, a, s, c, u) => h.runExclusive(async (
|
|
|
82
83
|
passedShieldedPrivateKey: s,
|
|
83
84
|
passedShieldedPublicKey: c,
|
|
84
85
|
ethAddress: l,
|
|
85
|
-
resetCacheBefore: f
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
resetCacheBefore: f,
|
|
87
|
+
allowRemoteDecryption: h
|
|
88
|
+
}), v = y(r), b = /* @__PURE__ */ new Map();
|
|
89
|
+
_.forEach((e) => {
|
|
88
90
|
let t = e.getTokenAddress(o);
|
|
89
|
-
if (
|
|
91
|
+
if (v && !v.some((r) => n(r.erc20TokenAddress, t) && r.tokenId === e.tokenId)) return;
|
|
90
92
|
let r = u(o, {
|
|
91
93
|
erc20TokenAddress: t,
|
|
92
94
|
tokenId: e.tokenId
|
|
93
|
-
}), i =
|
|
94
|
-
|
|
95
|
+
}), i = b.get(r) ?? [];
|
|
96
|
+
b.set(r, [...i, e]);
|
|
95
97
|
}), p?.forEach((e) => {
|
|
96
98
|
let t = u(o, {
|
|
97
99
|
erc20TokenAddress: e.erc20TokenAddress,
|
|
98
100
|
tokenId: e.tokenId
|
|
99
101
|
});
|
|
100
|
-
|
|
102
|
+
b.set(t, b.get(t) ?? []);
|
|
101
103
|
});
|
|
102
|
-
for (let [t, n] of
|
|
104
|
+
for (let [t, n] of b) {
|
|
103
105
|
let r = t.split("-")[0], s = Number(t.split("-")[1]), c = e(o), l = c ? r : void 0;
|
|
104
|
-
x(n, i, a,
|
|
106
|
+
x(n, i, a, g, c ? d(r).compressedAddress.toLowerCase() : r.toLowerCase(), s, l);
|
|
105
107
|
}
|
|
106
|
-
return
|
|
108
|
+
return b;
|
|
107
109
|
};
|
|
108
110
|
//#endregion
|
|
109
111
|
export { v as attemptGetInputUtxosRemotely, S as getInputUtxoAndBalance, C as getInputUtxoAndBalanceOfStuckUtxos, w as getInputUtxoAndBalancePerToken, _ as getInputUtxosRemotely };
|
|
@@ -5,7 +5,7 @@ import { makeEnclaveHandshakeAndEncryptUint8Array as r } from "../../utils/encry
|
|
|
5
5
|
import { formatMintAddress as i } from "../../utils/solanaMint.utils.mjs";
|
|
6
6
|
import { ethers as a } from "ethers";
|
|
7
7
|
import { PublicKey as o } from "@solana/web3.js";
|
|
8
|
-
//#region
|
|
8
|
+
//#region libs/shared/common/src/functions/web3/events/getInputUtxosEnclave.ts
|
|
9
9
|
var s = (e) => {
|
|
10
10
|
if (!e) return;
|
|
11
11
|
let t = a.getBytes(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../../constants/vite.constants.cjs`),t=require(`../../../constants/chains.constants.cjs`),n=require(`../../utils/caseInsensitive.utils.cjs`),r=require(`../../../error-handling/error-codes.constants.cjs`),i=require(`../etherFunctions.cjs`),a=require(`../../utils/erc20tokenFunctions.cjs`),o=require(`../../../data-structures/utxo/Utxo.cjs`),s=require(`../../../error-handling/customErrors/ErrorWithAmount.cjs`);require(`../../../error-handling/customErrors/index.cjs`);const c=require(`../../utils/encodeTokenWithId.cjs`),l=require(`../../utils/solanaMint.utils.cjs`),u=require(`./getInputUtxoAndBalance.cjs`),d=require(`../../../data-structures/TokenDBs/PrivateTokensDB.cjs`),f=require(`../../utils/mutexes.utils.cjs`);var p=async(t,r,i,o,s,c=!1,l,p=!1,m=!1)=>f.getChainBalanceFetchingMutex(r).runExclusive(async()=>{let{inputUtxos:f}=m?await u.getInputUtxoAndBalanceOfStuckUtxos({hinkal:t,chainId:r,ethAddress:s,passedShieldedPrivateKey:i,resetCacheBefore:c,allowRemoteDecryption:l}):await u.getInputUtxoAndBalance({hinkal:t,sliceIfMore6:!1,chainId:r,passedShieldedPrivateKey:i,passedShieldedPublicKey:o,ethAddress:s,resetCacheBefore:c,allowRemoteDecryption:l});p&&e.isExtension&&await d.privateTokensDB.fetchAndUpdatePrivateTokens(f.map(e=>e.getTokenAddress(r)).filter(e=>e!==void 0),r,s);let h=(e.isExtension?await d.privateTokensDB.getPrivateTokens(r,s):a.getErc20TokensForChain(r)).map(e=>({token:e,balance:f.reduce((t,i)=>{let a=e.erc20TokenAddress;return n.caseInsensitiveEqual(a,i.getTokenAddress(r))?t+i.amount:t},0n),timestamp:f.filter(t=>n.caseInsensitiveEqual(t.getTokenAddress(r),e.erc20TokenAddress))[0]?.timeStamp,nfts:f.filter(t=>n.caseInsensitiveEqual(t.getTokenAddress(r),e.erc20TokenAddress)&&t.tokenId!==0).map(e=>({tokenId:e.tokenId,timestamp:e.timeStamp}))})),g=new Map;return h.forEach(e=>{g.set(e.token.erc20TokenAddress.toLowerCase(),e)}),g}),m=async(e,n,d,f,p=6,m=d.map(()=>0),h=!1,g=!1)=>{let{userKeys:_}=e,v=[],y=[];if(d.length===0)return[];let b=await u.getInputUtxoAndBalancePerToken({hinkal:e,sliceIfMore6:!1,ensuredTokensWithId:d.map((e,t)=>({erc20TokenAddress:d[t],tokenId:m[t]})),allowRemoteDecryption:!
|
|
1
|
+
const e=require(`../../../constants/vite.constants.cjs`),t=require(`../../../constants/chains.constants.cjs`),n=require(`../../utils/caseInsensitive.utils.cjs`),r=require(`../../../error-handling/error-codes.constants.cjs`),i=require(`../etherFunctions.cjs`),a=require(`../../utils/erc20tokenFunctions.cjs`),o=require(`../../../data-structures/utxo/Utxo.cjs`),s=require(`../../../error-handling/customErrors/ErrorWithAmount.cjs`);require(`../../../error-handling/customErrors/index.cjs`);const c=require(`../../utils/encodeTokenWithId.cjs`),l=require(`../../utils/solanaMint.utils.cjs`),u=require(`./getInputUtxoAndBalance.cjs`),d=require(`../../../data-structures/TokenDBs/PrivateTokensDB.cjs`),f=require(`../../utils/mutexes.utils.cjs`);var p=async(t,r,i,o,s,c=!1,l,p=!1,m=!1)=>f.getChainBalanceFetchingMutex(r).runExclusive(async()=>{let{inputUtxos:f}=m?await u.getInputUtxoAndBalanceOfStuckUtxos({hinkal:t,chainId:r,ethAddress:s,passedShieldedPrivateKey:i,resetCacheBefore:c,allowRemoteDecryption:l}):await u.getInputUtxoAndBalance({hinkal:t,sliceIfMore6:!1,chainId:r,passedShieldedPrivateKey:i,passedShieldedPublicKey:o,ethAddress:s,resetCacheBefore:c,allowRemoteDecryption:l});p&&e.isExtension&&await d.privateTokensDB.fetchAndUpdatePrivateTokens(f.map(e=>e.getTokenAddress(r)).filter(e=>e!==void 0),r,s);let h=(e.isExtension?await d.privateTokensDB.getPrivateTokens(r,s):a.getErc20TokensForChain(r)).map(e=>({token:e,balance:f.reduce((t,i)=>{let a=e.erc20TokenAddress;return n.caseInsensitiveEqual(a,i.getTokenAddress(r))?t+i.amount:t},0n),timestamp:f.filter(t=>n.caseInsensitiveEqual(t.getTokenAddress(r),e.erc20TokenAddress))[0]?.timeStamp,nfts:f.filter(t=>n.caseInsensitiveEqual(t.getTokenAddress(r),e.erc20TokenAddress)&&t.tokenId!==0).map(e=>({tokenId:e.tokenId,timestamp:e.timeStamp}))})),g=new Map;return h.forEach(e=>{g.set(e.token.erc20TokenAddress.toLowerCase(),e)}),g}),m=async(e,n,d,f,p=6,m=d.map(()=>0),h=!1,g=!1)=>{let{userKeys:_}=e,v=[],y=[];if(d.length===0)return[];let b=await u.getInputUtxoAndBalancePerToken({hinkal:e,sliceIfMore6:!1,ensuredTokensWithId:d.map((e,t)=>({erc20TokenAddress:d[t],tokenId:m[t]})),allowRemoteDecryption:!0,useBlockedUtxos:g,chainId:n}),x=0;for(let e=0;e<d.length;e+=1)if(h===!1){let t=b.get(c.encodeTokenWithId(n,{erc20TokenAddress:d[e],tokenId:m[e]}))??[];if(!t)throw Error(`Missing utxos for token`);x=Math.max(t.length,x),y.push(t)}else y.push([]);return x===2?y:(y.forEach((e,c)=>{if(e.length>p){let t=e.slice(0,p),o=t.reduce((e,t)=>e+t.amount,0n);if(f[c]<0n&&o<-f[c]){let e=a.getERC20Token(d[c],n),t=e.decimals===18?6:2,l=Number(i.getAmountWithPrecision(o,e,t));throw new s.ErrorWithAmount(l,`${r.DIRECTLY_SHOW_MESSAGE_ERROR_CODES.UTXO_LIMITATIONS}. Please try again with ${l} ${e.symbol}, including gas fees.`)}v.push(t)}else if(e.length<=p){let r=[...e],i=p-e.length;for(;i>0;){--i;let e=t.isSolanaLike(n),a=e?d[c]:void 0,s=e?l.formatMintAddress(d[c]).compressedAddress:d[c];r.push(new o.Utxo({amount:0n,erc20TokenAddress:s,mintAddress:a,shieldedPrivateKey:_.getShieldedPrivateKey(),tokenId:m[c]}))}v.push(r)}}),v)};exports.addPaddingToUtxos=m,exports.getShieldedBalance=p;
|
|
@@ -12,7 +12,7 @@ import { formatMintAddress as u } from "../../utils/solanaMint.utils.mjs";
|
|
|
12
12
|
import { getInputUtxoAndBalance as d, getInputUtxoAndBalanceOfStuckUtxos as f, getInputUtxoAndBalancePerToken as p } from "./getInputUtxoAndBalance.mjs";
|
|
13
13
|
import { privateTokensDB as m } from "../../../data-structures/TokenDBs/PrivateTokensDB.mjs";
|
|
14
14
|
import { getChainBalanceFetchingMutex as h } from "../../utils/mutexes.utils.mjs";
|
|
15
|
-
//#region
|
|
15
|
+
//#region libs/shared/common/src/functions/web3/events/getShieldedBalance.ts
|
|
16
16
|
var g = async (t, r, i, a, s, c = !1, l, u = !1, p = !1) => h(r).runExclusive(async () => {
|
|
17
17
|
let { inputUtxos: h } = p ? await f({
|
|
18
18
|
hinkal: t,
|
|
@@ -57,7 +57,7 @@ var g = async (t, r, i, a, s, c = !1, l, u = !1, p = !1) => h(r).runExclusive(as
|
|
|
57
57
|
erc20TokenAddress: o[t],
|
|
58
58
|
tokenId: m[t]
|
|
59
59
|
})),
|
|
60
|
-
allowRemoteDecryption: !
|
|
60
|
+
allowRemoteDecryption: !0,
|
|
61
61
|
useBlockedUtxos: g,
|
|
62
62
|
chainId: n
|
|
63
63
|
}), x = 0;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
2
|
type ABIType = ConstructorParameters<typeof ethers.Interface>[0];
|
|
3
3
|
export declare function getTransactionLogEvents(chainId: number, txHash: string, contractAddress: string, contractABI: ABIType): Promise<{
|
|
4
|
-
transactionHash:
|
|
5
|
-
from:
|
|
6
|
-
to:
|
|
7
|
-
blockNumber:
|
|
8
|
-
events:
|
|
9
|
-
name: string;
|
|
10
|
-
args: ethers.Result;
|
|
11
|
-
}[];
|
|
4
|
+
transactionHash: any;
|
|
5
|
+
from: any;
|
|
6
|
+
to: any;
|
|
7
|
+
blockNumber: any;
|
|
8
|
+
events: any;
|
|
12
9
|
}>;
|
|
13
10
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCustomRpcProvider as e } from "../../utils/create-provider.mjs";
|
|
2
2
|
import "../../utils/index.mjs";
|
|
3
3
|
import { ethers as t } from "ethers";
|
|
4
|
-
//#region
|
|
4
|
+
//#region libs/shared/common/src/functions/web3/events/getTransactionLogEvents.ts
|
|
5
5
|
var n = (e, n) => {
|
|
6
6
|
let r = new t.Interface(n);
|
|
7
7
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { convertBytes32ToBigInt as e } from "../utils/bytes32.utils.mjs";
|
|
2
2
|
import "../utils/index.mjs";
|
|
3
|
-
//#region
|
|
3
|
+
//#region libs/shared/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.ts
|
|
4
4
|
var t = async (t, n) => {
|
|
5
5
|
let r = await t.account.merkle.fetch(n, "confirmed"), i = Number(e(r.rootIndex));
|
|
6
6
|
return e(r.roots.at(i - 1));
|
|
@@ -3,7 +3,7 @@ import { isSolanaLike as t, isTronLike as n, networkRegistry as r } from "../../
|
|
|
3
3
|
import "../../../types/index.mjs";
|
|
4
4
|
import { getAccessTokenAccountPublicKey as i } from "../../pre-transaction/solana.mjs";
|
|
5
5
|
import { PublicKey as a } from "@solana/web3.js";
|
|
6
|
-
//#region
|
|
6
|
+
//#region libs/shared/common/src/functions/web3/functionCalls/accessTokenCalls.ts
|
|
7
7
|
var o = async (t, n, r) => {
|
|
8
8
|
let i = r ?? t.userKeys.getAccessKey();
|
|
9
9
|
return (await t.getContractWithFetcher(n, e.AccessTokenContract).hasToken(i))[0];
|
|
@@ -6,7 +6,7 @@ import { getContractAddress as a } from "../../utils/getContractAddress.mjs";
|
|
|
6
6
|
import { getProviderFromContract as o, getSignerFromContract as s } from "../../utils/getSignerFromContract.mjs";
|
|
7
7
|
import { recoverTransactionFromError as c } from "./recoverTransactionFromError.mjs";
|
|
8
8
|
import { ethers as l } from "ethers";
|
|
9
|
-
//#region
|
|
9
|
+
//#region libs/shared/common/src/functions/web3/functionCalls/approveToken.ts
|
|
10
10
|
var u = async (e, t, n) => {
|
|
11
11
|
let r = s(n);
|
|
12
12
|
return await n.allowance(await r.getAddress(), t.target) >= e;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { zeroAddress as e } from "../../../constants/protocol.constants.mjs";
|
|
2
2
|
import { approveTokenToHinkal as t } from "./approveToken.mjs";
|
|
3
|
-
//#region
|
|
3
|
+
//#region libs/shared/common/src/functions/web3/functionCalls/approveTokensToHinkal.ts
|
|
4
4
|
var n = async (n, r, i, a, o) => {
|
|
5
5
|
for (let s = 0; s < o.length; s += 1) {
|
|
6
6
|
let c = o[s], l = a[s];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ERC20ABI as e } from "../../../externalABIs/index.mjs";
|
|
2
2
|
import { getContractAddress as t } from "../../utils/getContractAddress.mjs";
|
|
3
3
|
import { ethers as n } from "ethers";
|
|
4
|
-
//#region
|
|
4
|
+
//#region libs/shared/common/src/functions/web3/functionCalls/constructBatchCall.ts
|
|
5
5
|
var r = (t, r) => new n.Interface(e).encodeFunctionData("approve", [t, r]), i = (e, t, n, r) => r.encodeFunctionData("transact", [
|
|
6
6
|
e[0],
|
|
7
7
|
e[1],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TransactionReceiptStatus as e } from "../../../types/transactions.types.mjs";
|
|
2
2
|
import "../../../types/index.mjs";
|
|
3
3
|
import { waitLittle as t } from "../../utils/time.utils.mjs";
|
|
4
|
-
//#region
|
|
4
|
+
//#region libs/shared/common/src/functions/web3/functionCalls/recoverTransactionFromError.ts
|
|
5
5
|
var n = 1 * 1e3, r = 30 * 1e3, i = async (i, a, o = 0) => {
|
|
6
6
|
if ((await i.getTransactionReceipt(a))?.status !== e.Succeeded) return;
|
|
7
7
|
o > 0 && await i.waitForTransaction(a, o);
|
|
@@ -7,7 +7,7 @@ import { approveTokensToHinkal as a } from "./approveTokensToHinkal.mjs";
|
|
|
7
7
|
import { buildApproveAndTransactCalls as o } from "./constructBatchCall.mjs";
|
|
8
8
|
import { waitForErc20Approvals as s } from "./waitForErc20Approvals.mjs";
|
|
9
9
|
import { ethers as c } from "ethers";
|
|
10
|
-
//#region
|
|
10
|
+
//#region libs/shared/common/src/functions/web3/functionCalls/transactCallDirect.ts
|
|
11
11
|
var l = async (l, u, d, f, p, m, h, g, _, v = !0, y = !1) => {
|
|
12
12
|
let b = Array.isArray(d) ? d : [d], x = Array.isArray(f) ? f : [f];
|
|
13
13
|
if (b.length !== x.length) throw Error("token and amount length mismatch");
|
|
@@ -7,7 +7,7 @@ import { circomDataToArray as o, createTronCallData as s, estimateTronFeeSunWith
|
|
|
7
7
|
import { Logger as f } from "../../../error-handling/logger.mjs";
|
|
8
8
|
import { simulateTronTransaction as p } from "../../utils/tronSimulation.utils.mjs";
|
|
9
9
|
import { waitForTronErc20Approvals as m } from "./waitForErc20Approvals.mjs";
|
|
10
|
-
//#region
|
|
10
|
+
//#region libs/shared/common/src/functions/web3/functionCalls/transactCallDirectTron.ts
|
|
11
11
|
var h = async (h, g, _, v, y, b, x, S, C, w = !0) => {
|
|
12
12
|
let T = h.getTronWeb(), E = l(v.erc20TokenAddress), D = await h.getEthereumAddressByChain(g), { hinkalAddress: O, hinkalABI: k } = e[g].contractData, A = T.contract(k, l(O)), j = S ?? A, M = C ?? A;
|
|
13
13
|
if (!j.address) throw Error("contractForApproval address not set");
|
|
@@ -6,7 +6,7 @@ import { ErrorWithRelayerTransaction as o } from "../../../error-handling/custom
|
|
|
6
6
|
import { serializeCircomData as s } from "../../snarkjs/common.snarkjs.mjs";
|
|
7
7
|
import "../../../error-handling/index.mjs";
|
|
8
8
|
import "../../snarkjs/index.mjs";
|
|
9
|
-
//#region
|
|
9
|
+
//#region libs/shared/common/src/functions/web3/functionCalls/transactCallRelayer.ts
|
|
10
10
|
var c = (e) => {
|
|
11
11
|
if (e.status === "success") return e.message;
|
|
12
12
|
throw e.message && e.error ? new o(e.error, e.message) : Error(e.error);
|
|
@@ -3,7 +3,7 @@ import { zeroAddress as t } from "../../../constants/protocol.constants.mjs";
|
|
|
3
3
|
import { caseInsensitiveEqual as n } from "../../utils/caseInsensitive.utils.mjs";
|
|
4
4
|
import { ERC20ABI as r } from "../../../externalABIs/index.mjs";
|
|
5
5
|
import { waitLittle as i } from "../../utils/time.utils.mjs";
|
|
6
|
-
//#region
|
|
6
|
+
//#region libs/shared/common/src/functions/web3/functionCalls/waitForErc20Approvals.ts
|
|
7
7
|
var a = async (r, a, o, s, c, l = 30, u = 1e3) => {
|
|
8
8
|
let d = c.filter(({ tokenAddress: e, requiredAmount: r }) => r > 0n && !n(e, t));
|
|
9
9
|
if (d.length === 0) return;
|
|
@@ -4,7 +4,7 @@ import { transactionErrorCodes as n } from "../../error-handling/error-codes.con
|
|
|
4
4
|
import { addressToHexFormat as r } from "../utils/tron.utils.mjs";
|
|
5
5
|
import { createCustomRpcProvider as i } from "../utils/create-provider.mjs";
|
|
6
6
|
import { ethers as a } from "ethers";
|
|
7
|
-
//#region
|
|
7
|
+
//#region libs/shared/common/src/functions/web3/getContractMetadata.ts
|
|
8
8
|
var o = (r, i) => {
|
|
9
9
|
let a = e[i];
|
|
10
10
|
if (!a) throw Error(n.UNSUPPORTED_NETWORK);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ContractType as e } from "../../types/ethereum-network.types.mjs";
|
|
2
2
|
import { zeroAddress as t } from "../../constants/protocol.constants.mjs";
|
|
3
3
|
import { getProviderFromContract as n } from "../utils/getSignerFromContract.mjs";
|
|
4
|
-
//#region
|
|
4
|
+
//#region libs/shared/common/src/functions/web3/getPublicAddressBalance.ts
|
|
5
5
|
var r = async (r, i, a, o) => {
|
|
6
6
|
let s = r.getContractWithFetcher(i, e.ERC20Contract, a);
|
|
7
7
|
return a === t ? n(s).getBalance(o) : s.balanceOf(o);
|
|
@@ -4,7 +4,7 @@ import { httpClient as n } from "../../data-structures/http/HttpClient.mjs";
|
|
|
4
4
|
import "../../data-structures/http/index.mjs";
|
|
5
5
|
import { Logger as r } from "../../error-handling/logger.mjs";
|
|
6
6
|
import { SolanaPriorityFeeMode as i } from "../../types/fee.types.mjs";
|
|
7
|
-
//#region
|
|
7
|
+
//#region libs/shared/common/src/functions/web3/getSolanaPriorityFee.ts
|
|
8
8
|
var a = async (a, o = i.RECOMMENDED) => {
|
|
9
9
|
let s = a.map((e) => e.toBase58());
|
|
10
10
|
try {
|
|
@@ -5,7 +5,7 @@ import { ERC20ABI as n } from "../../externalABIs/index.mjs";
|
|
|
5
5
|
import { createCustomRpcProvider as r } from "../utils/create-provider.mjs";
|
|
6
6
|
import "../utils/index.mjs";
|
|
7
7
|
import { ethers as i } from "ethers";
|
|
8
|
-
//#region
|
|
8
|
+
//#region libs/shared/common/src/functions/web3/getTokenHolder.ts
|
|
9
9
|
var a = {
|
|
10
10
|
[e.base]: "base",
|
|
11
11
|
[e.optimism]: "optimism",
|
|
@@ -2,7 +2,7 @@ import { zeroAddress as e } from "../../constants/protocol.constants.mjs";
|
|
|
2
2
|
import { callLifiAPI as t } from "../../API/callLifiAPI.mjs";
|
|
3
3
|
import { transactionErrorCodes as n } from "../../error-handling/error-codes.constants.mjs";
|
|
4
4
|
import { getAmountInWei as r } from "./etherFunctions.mjs";
|
|
5
|
-
//#region
|
|
5
|
+
//#region libs/shared/common/src/functions/web3/lifiAPI.ts
|
|
6
6
|
var i = async (i, a, o, s, c, l) => {
|
|
7
7
|
try {
|
|
8
8
|
let n = r(i, o), { lifiResponse: u } = await t({
|
|
@@ -5,7 +5,7 @@ import { transactionErrorCodes as i } from "../../error-handling/error-codes.con
|
|
|
5
5
|
import { getAmountInWei as a } from "./etherFunctions.mjs";
|
|
6
6
|
import "../../constants/index.mjs";
|
|
7
7
|
import "../../error-handling/index.mjs";
|
|
8
|
-
//#region
|
|
8
|
+
//#region libs/shared/common/src/functions/web3/odosAPI.ts
|
|
9
9
|
var o = async (o, s, c, l, u = .7) => {
|
|
10
10
|
try {
|
|
11
11
|
let { odosResponse: i, status: d } = await r(o, {
|
|
@@ -4,7 +4,7 @@ import { getAmountInWei as r, randomBigInt as i } from "./etherFunctions.mjs";
|
|
|
4
4
|
import { getSwapperAccountPublicKeyFromSalt as a } from "../pre-transaction/solana.mjs";
|
|
5
5
|
import { callOkxAPI as o } from "../../API/callOkxAPI.mjs";
|
|
6
6
|
import { PublicKey as s } from "@solana/web3.js";
|
|
7
|
-
//#region
|
|
7
|
+
//#region libs/shared/common/src/functions/web3/okxAPI.ts
|
|
8
8
|
var c = (e, t, n, r, i = .7) => ({
|
|
9
9
|
amount: `${n}`,
|
|
10
10
|
chainIndex: "501",
|
|
@@ -8,7 +8,7 @@ import "../../constants/index.mjs";
|
|
|
8
8
|
import { Logger as o } from "../../error-handling/logger.mjs";
|
|
9
9
|
import "../../error-handling/index.mjs";
|
|
10
10
|
import { getContractMetadata as s } from "./getContractMetadata.mjs";
|
|
11
|
-
//#region
|
|
11
|
+
//#region libs/shared/common/src/functions/web3/oneInchAPI.ts
|
|
12
12
|
var c = async (c, l, u, d, f = .7) => {
|
|
13
13
|
try {
|
|
14
14
|
let i = await r(c, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UserFriendlyErrorCodes as e, transactionErrorCodes as t } from "../../error-handling/error-codes.constants.mjs";
|
|
2
2
|
import { getErrorMessage as n } from "../../error-handling/get-error.message.mjs";
|
|
3
3
|
import "../../error-handling/index.mjs";
|
|
4
|
-
//#region
|
|
4
|
+
//#region libs/shared/common/src/functions/web3/runContractFunction.ts
|
|
5
5
|
var r = 5e4, i = 1, a = 11, o = 15, s = /* @__PURE__ */ function(e) {
|
|
6
6
|
return e[e.Initial = 0] = "Initial", e[e.Secondary = 1] = "Secondary", e;
|
|
7
7
|
}(s || {}), c = async (e, t) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VersionedTransaction as e } from "@solana/web3.js";
|
|
2
|
-
//#region
|
|
2
|
+
//#region libs/shared/common/src/functions/web3/signAndSendSerializedTransaction.ts
|
|
3
3
|
var t = async (t, n, r, i) => {
|
|
4
4
|
let a = Buffer.from(n, "base64"), o = e.deserialize(a), { wallet: s, connection: c } = t;
|
|
5
5
|
if (!s) throw Error("missing solana wallet");
|
|
@@ -8,7 +8,7 @@ import "../../constants/index.mjs";
|
|
|
8
8
|
import { logError as a } from "../../error-handling/logError.mjs";
|
|
9
9
|
import "../../error-handling/index.mjs";
|
|
10
10
|
import { ethers as o } from "ethers";
|
|
11
|
-
//#region
|
|
11
|
+
//#region libs/shared/common/src/functions/web3/uniswapAPI.ts
|
|
12
12
|
var s = async (e, t, i, a) => {
|
|
13
13
|
let o = (await Promise.all([
|
|
14
14
|
100,
|
package/mutexes/mutex.mjs
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { safeJsonStringify as e } from "../functions/utils/serialize.utils.mjs";
|
|
|
2
2
|
import { httpClient as t } from "../data-structures/http/HttpClient.mjs";
|
|
3
3
|
import { Logger as n } from "../error-handling/logger.mjs";
|
|
4
4
|
import { Connection as r } from "@solana/web3.js";
|
|
5
|
-
//#region
|
|
5
|
+
//#region libs/shared/common/src/providers/CustomSolanaConnection.ts
|
|
6
6
|
var i = class extends r {
|
|
7
7
|
constructor(r, i = "confirmed") {
|
|
8
8
|
let a = async (r, i) => {
|
|
@@ -3,7 +3,7 @@ import { transactionErrorCodes as r } from "../error-handling/error-codes.consta
|
|
|
3
3
|
import { createCustomRpcProvider as i } from "../functions/utils/create-provider.mjs";
|
|
4
4
|
import { getContract as a } from "../functions/web3/getContractMetadata.mjs";
|
|
5
5
|
import { ethers as o } from "ethers";
|
|
6
|
-
//#region
|
|
6
|
+
//#region libs/shared/common/src/providers/EthersProviderAdapter.ts
|
|
7
7
|
var s = class {
|
|
8
8
|
signer;
|
|
9
9
|
chainId;
|