@hinkal/common 0.3.1 → 0.3.2
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/common/src/API/API.cjs +1 -1
- package/common/src/API/API.d.ts +9 -34
- package/common/src/API/API.mjs +75 -100
- package/common/src/API/callOneInchAPI.cjs +1 -1
- package/common/src/API/callOneInchAPI.d.ts +6 -0
- package/common/src/API/callOneInchAPI.mjs +5 -2
- package/common/src/API/dashboardAccountMemberCalls.cjs +1 -1
- package/common/src/API/dashboardAccountMemberCalls.d.ts +15 -0
- package/common/src/API/dashboardAccountMemberCalls.mjs +5 -2
- package/common/src/API/dashboardPayoutCalls.cjs +1 -1
- package/common/src/API/dashboardPayoutCalls.d.ts +2 -1
- package/common/src/API/dashboardPayoutCalls.mjs +4 -1
- package/common/src/API/enclaveUtxoCalls.d.ts +9 -1
- package/common/src/API/getWebsiteURL.d.ts +1 -2
- package/common/src/API/index.cjs +1 -1
- package/common/src/API/index.d.ts +1 -2
- package/common/src/API/index.mjs +2 -3
- package/common/src/API/payoutNotificationStateCalls.cjs +1 -0
- package/common/src/API/payoutNotificationStateCalls.d.ts +10 -0
- package/common/src/API/payoutNotificationStateCalls.mjs +10 -0
- package/common/src/API/proxyAccountsCalls.cjs +1 -1
- package/common/src/API/proxyAccountsCalls.d.ts +2 -3
- package/common/src/API/proxyAccountsCalls.mjs +11 -10
- package/common/src/API/rewardsUserCalls.cjs +1 -1
- package/common/src/API/rewardsUserCalls.d.ts +1 -38
- package/common/src/API/rewardsUserCalls.mjs +2 -9
- package/common/src/API/scheduled-transactions-calls.d.ts +1 -0
- package/common/src/API/temporaryWalletCalls.cjs +1 -1
- package/common/src/API/temporaryWalletCalls.mjs +8 -8
- package/common/src/API/weeklyAnalyticCalls.cjs +1 -1
- package/common/src/API/weeklyAnalyticCalls.d.ts +1 -11
- package/common/src/API/weeklyAnalyticCalls.mjs +2 -5
- package/common/src/constants/chains.constants.cjs +1 -1
- package/common/src/constants/chains.constants.mjs +3 -10
- package/common/src/constants/contracts.constants.cjs +1 -1
- package/common/src/constants/contracts.constants.mjs +19 -32
- package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.mjs +8 -9
- package/common/src/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-base.json.mjs +8 -9
- package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.mjs +8 -9
- package/common/src/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-optimism.json.mjs +8 -9
- package/common/src/constants/deploy-data/deploy-data-optimismTest.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-optimismTest.json.mjs +8 -9
- package/common/src/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-polygon.json.mjs +8 -9
- package/common/src/constants/deploy-data/shared-deploy-data-evm.json.cjs +1 -1
- package/common/src/constants/deploy-data/shared-deploy-data-evm.json.mjs +19 -45
- package/common/src/constants/deploy-data/shared-deploy-data-solana.json.cjs +1 -1
- package/common/src/constants/deploy-data/shared-deploy-data-solana.json.mjs +1 -1
- package/common/src/constants/deploy-data/shared-deploy-data-tron.json.cjs +1 -1
- package/common/src/constants/deploy-data/shared-deploy-data-tron.json.mjs +7 -18
- package/common/src/constants/enclaveAuth.constants.d.ts +5 -0
- package/common/src/constants/index.cjs +1 -1
- package/common/src/constants/index.d.ts +1 -2
- package/common/src/constants/index.mjs +0 -1
- package/common/src/constants/mediaUrls.constants.d.ts +0 -1
- package/common/src/constants/pay.constants.d.ts +1 -0
- package/common/src/constants/protocol.constants.cjs +2 -1
- package/common/src/constants/protocol.constants.d.ts +7 -5
- package/common/src/constants/protocol.constants.mjs +4 -11
- package/common/src/constants/rewards.constants.d.ts +0 -13
- package/common/src/constants/server.constants.cjs +1 -1
- package/common/src/constants/server.constants.d.ts +5 -28
- package/common/src/constants/server.constants.mjs +10 -41
- package/common/src/crypto/ecdh.cjs +1 -1
- package/common/src/crypto/ecdh.mjs +2 -9
- package/common/src/crypto/index.cjs +1 -1
- package/common/src/crypto/index.mjs +1 -1
- package/common/src/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/common/src/data-structures/Hinkal/Hinkal.d.ts +4 -8
- package/common/src/data-structures/Hinkal/Hinkal.mjs +83 -99
- package/common/src/data-structures/Hinkal/IHinkal.d.ts +5 -9
- package/common/src/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/common/src/data-structures/Hinkal/handleAutoDepositBack.mjs +22 -22
- package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.mjs +21 -21
- package/common/src/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalClaimUtxo.mjs +6 -9
- package/common/src/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDeposit.mjs +4 -7
- package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.mjs +64 -66
- package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +1 -1
- package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +47 -51
- package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +1 -1
- package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +33 -43
- package/common/src/data-structures/Hinkal/hinkalPalEvmDeposit.d.ts +1 -1
- package/common/src/data-structures/Hinkal/hinkalPalTronDepositPrepare.d.ts +2 -2
- package/common/src/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalPrivateWallet.mjs +6 -6
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +2 -2
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.mjs +107 -94
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.d.ts +3 -0
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.mjs +26 -14
- package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.mjs +4 -4
- package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +4 -9
- package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.mjs +26 -32
- package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +43 -42
- package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.mjs +4 -4
- package/common/src/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalTransfer.mjs +6 -6
- package/common/src/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalWithdraw.mjs +22 -26
- package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +21 -24
- package/common/src/data-structures/Hinkal/index.d.ts +0 -1
- package/common/src/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/common/src/data-structures/Hinkal/resetMerkleTrees.mjs +4 -4
- package/common/src/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/activity-db.mjs +34 -34
- package/common/src/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/contact-db.d.ts +0 -1
- package/common/src/data-structures/IndexedDB/contact-db.mjs +14 -28
- package/common/src/data-structures/IndexedDB/key-val-store.cjs +1 -1
- package/common/src/data-structures/IndexedDB/key-val-store.d.ts +2 -0
- package/common/src/data-structures/IndexedDB/key-val-store.mjs +14 -0
- package/common/src/data-structures/IndexedDB/private-balances-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/private-balances-db.d.ts +1 -0
- package/common/src/data-structures/IndexedDB/private-balances-db.mjs +3 -0
- package/common/src/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/signatures-db.mjs +11 -11
- package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
- package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +25 -25
- package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +1 -1
- package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +12 -12
- package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.cjs +1 -1
- package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.mjs +12 -12
- package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.mjs +24 -24
- package/common/src/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
- package/common/src/data-structures/TokenDBs/PrivateTokensDB.mjs +14 -14
- package/common/src/data-structures/TokenDBs/TronPublicTokensDB.cjs +1 -1
- package/common/src/data-structures/TokenDBs/TronPublicTokensDB.mjs +14 -14
- package/common/src/data-structures/WalletManager/WalletManager.d.ts +1 -0
- package/common/src/data-structures/cacheDevices/BaseCacheDevice.cjs +1 -1
- package/common/src/data-structures/cacheDevices/BaseCacheDevice.d.ts +1 -0
- package/common/src/data-structures/cacheDevices/BaseCacheDevice.mjs +3 -0
- package/common/src/data-structures/cacheDevices/FileCacheDevice.cjs +1 -1
- package/common/src/data-structures/cacheDevices/FileCacheDevice.d.ts +3 -0
- package/common/src/data-structures/cacheDevices/FileCacheDevice.mjs +12 -3
- package/common/src/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/common/src/data-structures/crypto-keys/decodeUTXO.d.ts +8 -9
- package/common/src/data-structures/crypto-keys/decodeUTXO.mjs +38 -48
- package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.d.ts +2 -3
- package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.mjs +26 -22
- package/common/src/data-structures/crypto-keys/keys.cjs +1 -1
- package/common/src/data-structures/crypto-keys/keys.d.ts +12 -27
- package/common/src/data-structures/crypto-keys/keys.mjs +61 -79
- package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +1 -2
- package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.mjs +4 -10
- package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +1 -1
- package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.d.ts +1 -1
- package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +2 -2
- package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.cjs +1 -1
- package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.mjs +40 -40
- package/common/src/data-structures/provider-adapter/IProviderAdapter.d.ts +0 -1
- package/common/src/data-structures/utxo/Utxo.cjs +1 -1
- package/common/src/data-structures/utxo/Utxo.d.ts +1 -4
- package/common/src/data-structures/utxo/Utxo.mjs +7 -17
- package/common/src/error-handling/error-codes.constants.cjs +2 -2
- package/common/src/error-handling/error-codes.constants.d.ts +0 -3
- package/common/src/error-handling/error-codes.constants.mjs +13 -18
- package/common/src/error-handling/index.cjs +1 -1
- package/common/src/error-handling/index.d.ts +1 -0
- package/common/src/error-handling/index.mjs +1 -0
- package/common/src/functions/auto-deposit-back-helpers/select-gas-token.cjs +1 -1
- package/common/src/functions/auto-deposit-back-helpers/select-gas-token.mjs +8 -8
- package/common/src/functions/index.cjs +1 -1
- package/common/src/functions/index.mjs +1 -1
- package/common/src/functions/pre-transaction/buildCommitmentValidationData.cjs +1 -1
- package/common/src/functions/pre-transaction/buildCommitmentValidationData.mjs +36 -38
- package/common/src/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/common/src/functions/pre-transaction/outputUtxoProcessing.mjs +3 -5
- package/common/src/functions/pre-transaction/recipientUtxoProcessing.cjs +1 -1
- package/common/src/functions/pre-transaction/recipientUtxoProcessing.mjs +3 -5
- package/common/src/functions/pre-transaction/solana-public-signals.d.ts +1 -0
- package/common/src/functions/pre-transaction/solana.cjs +1 -1
- package/common/src/functions/pre-transaction/solana.mjs +5 -4
- package/common/src/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/common/src/functions/private-wallet/emporium.helpers.d.ts +1 -2
- package/common/src/functions/private-wallet/emporium.helpers.mjs +83 -57
- package/common/src/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/common/src/functions/private-wallet/emporium.swap.helpers.mjs +19 -19
- package/common/src/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/common/src/functions/snarkjs/common.snarkjs.d.ts +2 -3
- package/common/src/functions/snarkjs/common.snarkjs.mjs +45 -47
- package/common/src/functions/snarkjs/constant.cjs +1 -1
- package/common/src/functions/snarkjs/constant.d.ts +151 -144
- package/common/src/functions/snarkjs/constant.mjs +151 -145
- package/common/src/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/common/src/functions/snarkjs/constructGeneralZkProof.d.ts +1 -1
- package/common/src/functions/snarkjs/constructGeneralZkProof.mjs +59 -60
- package/common/src/functions/snarkjs/constructSignatureFromMnemonicProofInput.cjs +1 -0
- package/common/src/functions/snarkjs/constructSignatureFromMnemonicProofInput.d.ts +7 -0
- package/common/src/functions/snarkjs/constructSignatureFromMnemonicProofInput.mjs +2 -0
- package/common/src/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/common/src/functions/snarkjs/constructSolanaZkProof.mjs +54 -58
- package/common/src/functions/snarkjs/fetchMerkleTreeSiblings.d.ts +1 -3
- package/common/src/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -1
- package/common/src/functions/snarkjs/fetchOnChainRootHashes.d.ts +1 -0
- package/common/src/functions/snarkjs/fetchOnChainRootHashes.mjs +14 -5
- package/common/src/functions/snarkjs/generateCircomData.cjs +1 -1
- package/common/src/functions/snarkjs/generateCircomData.d.ts +1 -1
- package/common/src/functions/snarkjs/generateCircomData.mjs +35 -31
- package/common/src/functions/snarkjs/generateSignatureFromMnemonicProof.cjs +1 -0
- package/common/src/functions/snarkjs/generateSignatureFromMnemonicProof.d.ts +2 -0
- package/common/src/functions/snarkjs/generateSignatureFromMnemonicProof.mjs +3 -0
- package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.cjs +1 -1
- package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.d.ts +2 -0
- package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +18 -12
- package/common/src/functions/snarkjs/getZKFiles.cjs +1 -1
- package/common/src/functions/snarkjs/getZKFiles.mjs +9 -3
- package/common/src/functions/snarkjs/index.cjs +1 -1
- package/common/src/functions/snarkjs/index.d.ts +2 -0
- package/common/src/functions/snarkjs/index.mjs +2 -0
- package/common/src/functions/snarkjs/signedMessageHash.cjs +1 -1
- package/common/src/functions/snarkjs/signedMessageHash.d.ts +1 -0
- package/common/src/functions/snarkjs/signedMessageHash.mjs +2 -0
- package/common/src/functions/utils/addresses.cjs +1 -1
- package/common/src/functions/utils/addresses.d.ts +0 -1
- package/common/src/functions/utils/addresses.mjs +10 -13
- package/common/src/functions/utils/bridge-flow.utils.d.ts +1 -1
- package/common/src/functions/utils/buildClaimableDepositPlan.d.ts +1 -0
- package/common/src/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -1
- package/common/src/functions/utils/convertEmporiumOpToCallInfo.mjs +5 -10
- package/common/src/functions/utils/enclave-utxo-storage.d.ts +3 -0
- package/common/src/functions/utils/enclaveSessionSigning.cjs +1 -0
- package/common/src/functions/utils/enclaveSessionSigning.d.ts +16 -0
- package/common/src/functions/utils/enclaveSessionSigning.mjs +2 -0
- package/common/src/functions/utils/encodeTokenWithId.cjs +1 -1
- package/common/src/functions/utils/encodeTokenWithId.d.ts +1 -2
- package/common/src/functions/utils/encodeTokenWithId.mjs +2 -5
- package/common/src/functions/utils/fees.utils.cjs +1 -1
- package/common/src/functions/utils/fees.utils.d.ts +1 -0
- package/common/src/functions/utils/fees.utils.mjs +5 -1
- package/common/src/functions/utils/getDataFromTransaction.d.ts +4 -3
- package/common/src/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/common/src/functions/utils/getRecipientInfoFromUserKeys.mjs +2 -3
- package/common/src/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
- package/common/src/functions/utils/getUtxosFromReceiptSolana.mjs +16 -18
- package/common/src/functions/utils/index.cjs +1 -1
- package/common/src/functions/utils/index.d.ts +5 -1
- package/common/src/functions/utils/index.mjs +5 -1
- package/common/src/functions/utils/legacyKeys.cjs +1 -0
- package/common/src/functions/utils/legacyKeys.d.ts +10 -0
- package/common/src/functions/utils/legacyKeys.mjs +8 -0
- package/common/src/functions/utils/mnemonics.cjs +1 -1
- package/common/src/functions/utils/mnemonics.mjs +4 -6
- package/common/src/functions/utils/nearIntents.utils.cjs +1 -1
- package/common/src/functions/utils/nearIntents.utils.mjs +1 -1
- package/common/src/functions/utils/networks.utils.d.ts +1 -0
- package/common/src/functions/utils/prepareHinkal.cjs +1 -1
- package/common/src/functions/utils/prepareHinkal.d.ts +1 -3
- package/common/src/functions/utils/prepareHinkal.mjs +2 -1
- package/common/src/functions/utils/resolve-domain-address.cjs +1 -0
- package/common/src/functions/utils/resolve-domain-address.d.ts +4 -0
- package/common/src/functions/utils/resolve-domain-address.mjs +3 -0
- package/common/src/functions/utils/serialize-utxos.utils.cjs +1 -1
- package/common/src/functions/utils/serialize-utxos.utils.mjs +6 -4
- package/common/src/functions/utils/tron.utils.cjs +1 -1
- package/common/src/functions/utils/tron.utils.d.ts +1 -1
- package/common/src/functions/utils/tron.utils.mjs +14 -29
- package/common/src/functions/utils/validateWalletAddress.cjs +1 -0
- package/common/src/functions/utils/validateWalletAddress.d.ts +1 -0
- package/common/src/functions/utils/validateWalletAddress.mjs +2 -0
- package/common/src/functions/utils/voidWallets.utils.cjs +1 -0
- package/common/src/functions/utils/voidWallets.utils.d.ts +4 -0
- package/common/src/functions/utils/voidWallets.utils.mjs +1 -0
- package/common/src/functions/web3/etherFunctions.d.ts +1 -0
- package/common/src/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/common/src/functions/web3/events/getInputUtxoAndBalance.d.ts +2 -4
- package/common/src/functions/web3/events/getInputUtxoAndBalance.mjs +9 -16
- package/common/src/functions/web3/events/getShieldedBalance.cjs +1 -1
- package/common/src/functions/web3/events/getShieldedBalance.d.ts +1 -1
- package/common/src/functions/web3/events/getShieldedBalance.mjs +21 -29
- package/common/src/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/common/src/functions/web3/functionCalls/approveToken.d.ts +1 -1
- package/common/src/functions/web3/functionCalls/approveToken.mjs +21 -107
- package/common/src/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
- package/common/src/functions/web3/functionCalls/constructBatchCall.d.ts +2 -2
- package/common/src/functions/web3/functionCalls/constructBatchCall.mjs +23 -18
- package/common/src/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -1
- package/common/src/functions/web3/functionCalls/transactCallDirectTron.mjs +37 -3
- package/common/src/functions/web3/functionCalls/waitForErc20Approvals.cjs +1 -1
- package/common/src/functions/web3/functionCalls/waitForErc20Approvals.mjs +6 -6
- package/common/src/functions/web3/oneInchAPI.cjs +1 -1
- package/common/src/functions/web3/oneInchAPI.mjs +31 -21
- package/common/src/functions/web3/uniswapAPI.cjs +1 -1
- package/common/src/functions/web3/uniswapAPI.mjs +6 -6
- package/common/src/providers/EthersProviderAdapter.cjs +1 -1
- package/common/src/providers/EthersProviderAdapter.d.ts +0 -1
- package/common/src/providers/EthersProviderAdapter.mjs +0 -3
- package/common/src/providers/SolanaProviderAdapter.cjs +1 -1
- package/common/src/providers/SolanaProviderAdapter.d.ts +0 -1
- package/common/src/providers/SolanaProviderAdapter.mjs +0 -3
- package/common/src/providers/TronProviderAdapter.cjs +1 -1
- package/common/src/providers/TronProviderAdapter.d.ts +0 -1
- package/common/src/providers/TronProviderAdapter.mjs +0 -3
- package/common/src/providers/WagmiProviderAdapter.cjs +1 -1
- package/common/src/providers/WagmiProviderAdapter.d.ts +0 -1
- package/common/src/providers/WagmiProviderAdapter.mjs +5 -9
- package/common/src/types/API.types.d.ts +0 -4
- package/common/src/types/WeeklyAnalytics.types.d.ts +1 -26
- package/common/src/types/cache.types.cjs +1 -1
- package/common/src/types/cache.types.d.ts +2 -2
- package/common/src/types/cache.types.mjs +1 -1
- package/common/src/types/circom-data.types.cjs +1 -1
- package/common/src/types/circom-data.types.d.ts +26 -27
- package/common/src/types/circom-data.types.mjs +1 -1
- package/common/src/types/dashboard-account.d.ts +15 -0
- package/common/src/types/dashboard-payout.types.d.ts +1 -0
- package/common/src/types/enclaveApi.types.d.ts +78 -0
- package/common/src/types/ethereum-network.types.cjs +1 -1
- package/common/src/types/ethereum-network.types.d.ts +13 -23
- package/common/src/types/ethereum-network.types.mjs +1 -1
- package/common/src/types/external-action.types.cjs +1 -1
- package/common/src/types/external-action.types.d.ts +2 -3
- package/common/src/types/external-action.types.mjs +1 -1
- package/common/src/types/hinkal.types.cjs +1 -1
- package/common/src/types/hinkal.types.d.ts +8 -22
- package/common/src/types/hinkal.types.mjs +11 -19
- package/common/src/types/index.cjs +1 -1
- package/common/src/types/index.d.ts +3 -5
- package/common/src/types/index.mjs +0 -1
- package/common/src/types/new-rewards.type.d.ts +0 -70
- package/common/src/types/payout-notification.types.d.ts +11 -0
- package/common/src/types/proxy-progress.types.d.ts +5 -0
- package/common/src/types/snark.types.d.ts +1 -3
- package/common/src/types/token.types.cjs +1 -1
- package/common/src/types/token.types.mjs +1 -3
- package/common/src/types/transaction.types.d.ts +0 -1
- package/common/src/types/transactions.types.d.ts +0 -1
- package/common/src/webworker/logError-uy41lNp1.js +2 -0
- package/common/src/webworker/package.json +1 -1
- package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.cjs +1 -1
- package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.mjs +1 -1
- package/common/src/webworker/snarkjsWorkerNode.cjs +1 -1
- package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -1
- package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +1 -1
- package/common/src/webworker/utxoWorkerNode.cjs +1 -1
- package/common/src/webworker/viteWorkerURL.constant.cjs +3 -3
- package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
- package/common/src/webworker/workerProxy-MheXtWa4.js +1 -0
- package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -1
- package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +1 -1
- package/common/src/webworker/zkProofWorkerNode.cjs +1 -1
- package/package.json +1 -1
- package/services/Hinkal.cjs +1 -1
- package/services/Hinkal.d.ts +1 -2
- package/services/Hinkal.mjs +4 -7
- package/types/IHinkal.d.ts +1 -2
- package/common/src/API/accessCodeCalls.cjs +0 -1
- package/common/src/API/accessCodeCalls.d.ts +0 -23
- package/common/src/API/accessCodeCalls.mjs +0 -13
- package/common/src/API/brotherhoodCalls.cjs +0 -1
- package/common/src/API/brotherhoodCalls.d.ts +0 -82
- package/common/src/API/brotherhoodCalls.mjs +0 -17
- package/common/src/API/generate-trading-points.cjs +0 -1
- package/common/src/API/generate-trading-points.d.ts +0 -27
- package/common/src/API/generate-trading-points.mjs +0 -23
- package/common/src/API/leaderboardCalls.cjs +0 -1
- package/common/src/API/leaderboardCalls.d.ts +0 -14
- package/common/src/API/leaderboardCalls.mjs +0 -8
- package/common/src/API/referralsCalls.cjs +0 -1
- package/common/src/API/referralsCalls.d.ts +0 -22
- package/common/src/API/referralsCalls.mjs +0 -11
- package/common/src/API/send-telegram-callback.cjs +0 -1
- package/common/src/API/send-telegram-callback.d.ts +0 -7
- package/common/src/API/send-telegram-callback.mjs +0 -11
- package/common/src/constants/mystery-boxes.constants.d.ts +0 -0
- package/common/src/constants/price-impact.constants.d.ts +0 -2
- package/common/src/constants/tasks.constants.cjs +0 -1
- package/common/src/constants/tasks.constants.d.ts +0 -9
- package/common/src/constants/tasks.constants.mjs +0 -124
- package/common/src/data-structures/Hinkal/hinkalMultiSend.cjs +0 -1
- package/common/src/data-structures/Hinkal/hinkalMultiSend.d.ts +0 -3
- package/common/src/data-structures/Hinkal/hinkalMultiSend.mjs +0 -12
- package/common/src/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.cjs +0 -1
- package/common/src/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.d.ts +0 -6
- package/common/src/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.mjs +0 -128
- package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.cjs +0 -1
- package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.d.ts +0 -22
- package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.mjs +0 -34
- package/common/src/functions/utils/bit.operations.cjs +0 -1
- package/common/src/functions/utils/bit.operations.d.ts +0 -3
- package/common/src/functions/utils/bit.operations.mjs +0 -4
- package/common/src/types/brotherhood-user.types.d.ts +0 -11
- package/common/src/types/crypto.types.d.ts +0 -8
- package/common/src/types/generatePoints.d.ts +0 -14
- package/common/src/types/new-rewards.type.cjs +0 -1
- package/common/src/types/new-rewards.type.mjs +0 -10
- package/common/src/types/referral.types.d.ts +0 -12
- package/common/src/types/rewards.types.d.ts +0 -34
- package/common/src/types/token-with-id.types.d.ts +0 -4
- package/common/src/webworker/logError-BR5TJP6T.js +0 -2
- package/common/src/webworker/workerProxy-Ddzxn23N.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../error-handling/logger.cjs`),t=require(`../../../functions/utils/resolve-sync.utils.cjs`),n=require(`../../../constants/reorg-depths.constants.cjs`),r=require(`../../../functions/utils/getSignerFromContract.cjs`),i=require(`../../BlockchainEvent/BlockchainEvent.cjs`);let a=require(`ethers`);var o=class{RETRY_MIN_PAGE_SIZE=100;MAX_RETRIES=20;_chainId;contract;
|
|
1
|
+
require(`../../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../error-handling/logger.cjs`),t=require(`../../../functions/utils/resolve-sync.utils.cjs`),n=require(`../../../constants/reorg-depths.constants.cjs`),r=require(`../../../functions/utils/getSignerFromContract.cjs`),i=require(`../../BlockchainEvent/BlockchainEvent.cjs`);let a=require(`ethers`);var o=class{RETRY_MIN_PAGE_SIZE=100;MAX_RETRIES=20;_chainId;contract;_latestBlockNumber;_initialBlockNumber;onEventsProcessed;eventProcessors=new Set;maxPageSize;_isReady=!1;isServer;inProgress;eventsFetchingMutex;constructor(e,t,n,r,i,a){this.contract=t,this._chainId=e,this._initialBlockNumber=n,this.maxPageSize=a,this.isServer=r,this.inProgress=!1,this.eventsFetchingMutex=i}get latestBlockNumber(){return this._latestBlockNumber??this._initialBlockNumber}get chainId(){return this._chainId}get isReady(){return this._isReady}syncFromAtMost(e){(this._latestBlockNumber===void 0||e<this._latestBlockNumber)&&(this._latestBlockNumber=e)}advanceLatestBlockNumber(e){e>(this._latestBlockNumber??this._initialBlockNumber)&&(this._latestBlockNumber=e)}intervalClear(){this._isReady=!1,this.eventProcessors=new Set,this.clear()}async init(){if(this._isReady)throw Error(`Already initialized`);this._isReady=!0,await this.retrieveEvents(this.latestBlockNumber+1),this.startUpdateListener()}requireReady(){if(!this._isReady)throw Error(`Not ready`)}async getEventsForSingleContract(e,t,n,r=0){try{return(await e.queryFilter(`*`,t,n)).filter(e=>e instanceof a.ethers.EventLog)}catch(i){if(r<this.MAX_RETRIES&&n-t>this.RETRY_MIN_PAGE_SIZE){let i=Math.floor((t+n)/2),a=await this.getEventsForSingleContract(e,t,i,r+1),o=await this.getEventsForSingleContract(e,i+1,n,r+1);return[...a,...o]}throw i}}addEventProcessorFunction(e){if(this._isReady)throw Error(`Can't add event processor after event emitter initialized`);this.eventProcessors.add(e)}async getEventsInRange(e,n){let r=[];return await t.resolveSync(t.getSequence(e,n,this.maxPageSize).map(({from:e,to:t})=>async()=>{let n=await this.getEventsForSingleContract(this.contract,e,t);r.push(...n)})),r.map(e=>i.BlockchainEvent.fromEthers(e))}async getLastBlockNumberForEventRequest(){let e=await r.getProviderFromContract(this.contract).getBlockNumber();if(!this.isServer)return e;let{chainId:t}=await r.getProviderFromContract(this.contract).getNetwork();return Math.max(this.latestBlockNumber,e-n.blockReorgDepth[Number(t)]+1)}async retrieveEvents(t,n=!1){return this.requireReady(),await this.eventsFetchingMutex.runExclusive(async()=>{try{if(this.inProgress&&!n)return!1;this.inProgress=!0;let e=await this.getLastBlockNumberForEventRequest();if(e<t)return this.inProgress=!1,!1;let r=await this.getEventsInRange(t,e);return await this.processEvents(r,e),this._latestBlockNumber=e,this.inProgress=!1,!0}catch(t){return e.Logger.error(`retrieveEvents error`,t),this.inProgress=!1,!1}})}async processEvents(e,t){let n=(await Promise.all([...this.eventProcessors].map(n=>n(e,t)))).reduce((e,t)=>e+t,0);this.onEventsProcessed?.(n)}};exports.BlockchainEventEmitter=o;
|
|
@@ -7,7 +7,6 @@ export declare abstract class BlockchainEventEmitter {
|
|
|
7
7
|
private readonly MAX_RETRIES;
|
|
8
8
|
private readonly _chainId;
|
|
9
9
|
readonly contract: ethers.Contract;
|
|
10
|
-
readonly depositOnChainUtxosContract?: ethers.Contract;
|
|
11
10
|
private _latestBlockNumber;
|
|
12
11
|
private _initialBlockNumber;
|
|
13
12
|
onEventsProcessed?: (acceptedEventCount: number) => void;
|
|
@@ -17,7 +16,7 @@ export declare abstract class BlockchainEventEmitter {
|
|
|
17
16
|
protected isServer: boolean;
|
|
18
17
|
private inProgress;
|
|
19
18
|
protected eventsFetchingMutex: ChainBalanceFetchingLock;
|
|
20
|
-
constructor(chainId: number, contract: ethers.Contract, initialBlockNumber: number, isServer: boolean, eventsFetchingMutex: ChainBalanceFetchingLock, maxPageSize?: number
|
|
19
|
+
constructor(chainId: number, contract: ethers.Contract, initialBlockNumber: number, isServer: boolean, eventsFetchingMutex: ChainBalanceFetchingLock, maxPageSize?: number);
|
|
21
20
|
get latestBlockNumber(): number;
|
|
22
21
|
get chainId(): number;
|
|
23
22
|
get isReady(): boolean;
|
|
@@ -10,7 +10,6 @@ var s = class {
|
|
|
10
10
|
MAX_RETRIES = 20;
|
|
11
11
|
_chainId;
|
|
12
12
|
contract;
|
|
13
|
-
depositOnChainUtxosContract;
|
|
14
13
|
_latestBlockNumber;
|
|
15
14
|
_initialBlockNumber;
|
|
16
15
|
onEventsProcessed;
|
|
@@ -20,8 +19,8 @@ var s = class {
|
|
|
20
19
|
isServer;
|
|
21
20
|
inProgress;
|
|
22
21
|
eventsFetchingMutex;
|
|
23
|
-
constructor(e, t, n, r, i, a
|
|
24
|
-
this.contract = t, this.
|
|
22
|
+
constructor(e, t, n, r, i, a) {
|
|
23
|
+
this.contract = t, this._chainId = e, this._initialBlockNumber = n, this.maxPageSize = a, this.isServer = r, this.inProgress = !1, this.eventsFetchingMutex = i;
|
|
25
24
|
}
|
|
26
25
|
get latestBlockNumber() {
|
|
27
26
|
return this._latestBlockNumber ?? this._initialBlockNumber;
|
|
@@ -64,15 +63,10 @@ var s = class {
|
|
|
64
63
|
this.eventProcessors.add(e);
|
|
65
64
|
}
|
|
66
65
|
async getEventsInRange(e, r) {
|
|
67
|
-
let i = []
|
|
68
|
-
await n(
|
|
66
|
+
let i = [];
|
|
67
|
+
return await n(t(e, r, this.maxPageSize).map(({ from: e, to: t }) => async () => {
|
|
69
68
|
let n = await this.getEventsForSingleContract(this.contract, e, t);
|
|
70
69
|
i.push(...n);
|
|
71
|
-
}));
|
|
72
|
-
let s = this.depositOnChainUtxosContract;
|
|
73
|
-
return s && await n(o.map(({ from: e, to: t }) => async () => {
|
|
74
|
-
let n = await this.getEventsForSingleContract(s, e, t);
|
|
75
|
-
i.push(...n);
|
|
76
70
|
})), i.map((e) => a.fromEthers(e));
|
|
77
71
|
}
|
|
78
72
|
async getLastBlockNumberForEventRequest() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./BlockchainEventEmitter.cjs`),t=require(`../helpers/ClientEventHelper.cjs`);var n=class extends e.BlockchainEventEmitter{clientEventHelper;constructor(e,n,r,i,a,o
|
|
1
|
+
const e=require(`./BlockchainEventEmitter.cjs`),t=require(`../helpers/ClientEventHelper.cjs`);var n=class extends e.BlockchainEventEmitter{clientEventHelper;constructor(e,n,r,i,a,o){super(n,r,i,!1,a,o),this.clientEventHelper=new t.ClientEventHelper(n,e)}clear(){this.clientEventHelper.clear()}startUpdateListener(){this.clientEventHelper.startUpdateListener(async e=>{await this.eventsFetchingMutex.runExclusive(async()=>{await this.processEvents(e)})},this.latestBlockNumber+1,e=>this.advanceLatestBlockNumber(e))}};exports.ClientBlockchainEventEmitter=n;
|
|
@@ -5,7 +5,7 @@ import { ChainBalanceFetchingLock } from '../../../mutexes/chainBalanceRwLock';
|
|
|
5
5
|
import { ClientEventHelper } from '../helpers/ClientEventHelper';
|
|
6
6
|
export declare class ClientBlockchainEventEmitter extends BlockchainEventEmitter {
|
|
7
7
|
clientEventHelper: ClientEventHelper;
|
|
8
|
-
constructor(eventCategory: EventCategory, chainId: number, contract: ethers.Contract, initialBlockNumber: number, eventsFetchingMutex: ChainBalanceFetchingLock, maxPageSize?: number
|
|
8
|
+
constructor(eventCategory: EventCategory, chainId: number, contract: ethers.Contract, initialBlockNumber: number, eventsFetchingMutex: ChainBalanceFetchingLock, maxPageSize?: number);
|
|
9
9
|
protected clear(): void;
|
|
10
10
|
protected startUpdateListener(): void;
|
|
11
11
|
}
|
|
@@ -3,8 +3,8 @@ import { ClientEventHelper as t } from "../helpers/ClientEventHelper.mjs";
|
|
|
3
3
|
//#region libs/shared/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.ts
|
|
4
4
|
var n = class extends e {
|
|
5
5
|
clientEventHelper;
|
|
6
|
-
constructor(e, n, r, i, a, o
|
|
7
|
-
super(n, r, i, !1, a, o
|
|
6
|
+
constructor(e, n, r, i, a, o) {
|
|
7
|
+
super(n, r, i, !1, a, o), this.clientEventHelper = new t(n, e);
|
|
8
8
|
}
|
|
9
9
|
clear() {
|
|
10
10
|
this.clientEventHelper.clear();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../functions/web3/etherFunctions.cjs`),t=require(`../../functions/utils/upToDateState.cjs`),n=require(`../../
|
|
1
|
+
const e=require(`../../functions/web3/etherFunctions.cjs`),t=require(`../../functions/utils/upToDateState.cjs`),n=require(`../../error-handling/logger.cjs`),r=require(`../../types/balances.types.cjs`),i=require(`../../functions/utils/string.utils.cjs`),a=require(`./BalanceChangedHandler.cjs`),o=require(`../IndexedDB/private-balances-db.cjs`),s=require(`../IndexedDB/prices-db.cjs`),c=require(`./privateBalancesReducer.cjs`);var l=class{privateBalancesState={};privateBalancesListeners=new Set;hinkal;unsubscribeBalanceChange;constructor(e){this.hinkal=e,this.unsubscribeBalanceChange=a.balanceChangedHandler.subscribe(e=>{this.applyRefreshFromBalanceChangeEvent(e).catch(e=>{n.Logger.error(`Private balance refresh from balance change failed:`,e)})})}getSnapshot(){return this.privateBalancesState}onPrivateBalancesWithUSDChange(e){return this.privateBalancesListeners.add(e),()=>this.privateBalancesListeners.delete(e)}dispose(){this.unsubscribeBalanceChange(),this.privateBalancesListeners.clear()}async applyRefreshFromBalanceChangeEvent(e){if(!e){await this.refreshInternal(r.PrivateBalanceUpdateType.FreshWithoutLoader);return}let{updateType:t,balanceChangeState:n,chainIdToUpdate:i,resetCacheBefore:a,updateTokensListBefore:o}=e;await this.refreshInternal(t,n,a,o,i)}dispatch(e){this.privateBalancesState=c.privateBalancesReducer(this.privateBalancesState,e);let t=this.privateBalancesState;this.privateBalancesListeners.forEach(e=>e(t))}async getAddressAndChain(e){try{return{ethAdd:e?.ethereumAddress??await this.hinkal.getEthereumAddress(),userKeys:e?.userKeys??this.hinkal.userKeys}}catch{return{ethAdd:void 0,userKeys:void 0}}}async hasCache(e,t){return await o.privateBalancesStorage.getBalancesByWallet(e,t)!==void 0}async getBalancesWithUsdValues(t,r){try{if(!r)return[];let n=t.map(e=>e.token.erc20TokenAddress);if(!n.length)return[];let i=await s.pricesStorage.getAndUpdatePrices(r,n),a=new Map(n.map((e,t)=>[e,i[t]]));return[...t.map(t=>{try{let n=t.token.erc20TokenAddress,r=a.get(n)??0,i=t.balance,o=Number(e.getAmountInToken(t.token,i))*r;return{...t,usdValue:o}}catch{return{...t,usdValue:0}}})]}catch{return n.Logger.log(`Error fetching private token balances`),[]}}handleCached=async(r,a)=>{try{await t.checkAddressNotUpdated(this.hinkal,r),this.dispatch({type:`SET_BALANCES`,chainId:a,balances:void 0});let n=await o.privateBalancesStorage.getBalancesByWallet(r,a),c=await s.pricesStorage.getPrices();if(await t.checkAddressNotUpdated(this.hinkal,r),!n||(this.dispatch({type:`SET_BALANCES`,chainId:a,balances:n}),!c))return;let l=n.map(t=>{let n=i.getTokenStateKey(t.token.erc20TokenAddress,a);return{...t,usdValue:c[n]?Number(e.getAmountInToken(t.token,t.balance))*c[n]:0}});this.dispatch({type:`SET_USD_BALANCES`,chainId:a,balances:l})}catch(e){n.Logger.error(`Error refreshing cached private balance:`,e)}};handleFresh=async(e,r,i,a,s,c)=>{let l=s;try{await t.checkAddressNotUpdated(this.hinkal,e);let n=await this.hasCache(e,r);await t.checkAddressNotUpdated(this.hinkal,e),l=s||!n,l&&this.dispatch({type:`SET_LOADING`,chainId:r,newValue:!0}),await t.checkAddressNotUpdated(this.hinkal,e),a&&await this.hinkal.resetMerkle([r]);let u=await this.hinkal.getTotalBalance(r,i,e,a,c);await t.checkAddressNotUpdated(this.hinkal,e);let d=u.filter(e=>e.balance>0n);this.dispatch({type:`SET_BALANCES`,chainId:r,balances:d}),await o.privateBalancesStorage.setBalances(e,r,d),await t.checkAddressNotUpdated(this.hinkal,e),l&&(this.dispatch({type:`SET_USD_LOADING`,chainId:r,newValue:!0}),this.dispatch({type:`SET_LOADING`,chainId:r,newValue:!1})),await t.checkAddressNotUpdated(this.hinkal,e);let f=await this.getBalancesWithUsdValues(d,r);await t.checkAddressNotUpdated(this.hinkal,e),f.length>0&&this.dispatch({type:`SET_USD_BALANCES`,chainId:r,balances:f})}catch(e){n.Logger.error(`Error refreshing private balance:`,e)}finally{l&&(this.dispatch({type:`SET_LOADING`,chainId:r,newValue:!1}),this.dispatch({type:`SET_USD_LOADING`,chainId:r,newValue:!1}))}};getSupportedChainsToUpdate(e){let t=this.hinkal.getSupportedChains();return e?t.includes(e)?[e]:[]:t}async refreshInternal(e=r.PrivateBalanceUpdateType.FreshWithoutLoader,t,n=!1,i=!1,a){let{ethAdd:o,userKeys:s}=await this.getAddressAndChain(t);!o||!s?.getShieldedPublicKey()||await Promise.all(this.getSupportedChainsToUpdate(a).map(async t=>{switch(e){case r.PrivateBalanceUpdateType.OnlyCache:await this.handleCached(o,t);break;case r.PrivateBalanceUpdateType.Fresh:await this.handleFresh(o,t,s,n,!0,i);break;case r.PrivateBalanceUpdateType.FreshWithoutLoader:await this.handleFresh(o,t,s,n,!1,i);break;default:break}}))}};exports.HinkalPrivateBalanceController=l;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAmountInToken as e } from "../../functions/web3/etherFunctions.mjs";
|
|
2
2
|
import { checkAddressNotUpdated as t } from "../../functions/utils/upToDateState.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Logger as n } from "../../error-handling/logger.mjs";
|
|
4
|
+
import { PrivateBalanceUpdateType as r } from "../../types/balances.types.mjs";
|
|
5
5
|
import { getTokenStateKey as i } from "../../functions/utils/string.utils.mjs";
|
|
6
6
|
import { balanceChangedHandler as a } from "./BalanceChangedHandler.mjs";
|
|
7
7
|
import { privateBalancesStorage as o } from "../IndexedDB/private-balances-db.mjs";
|
|
@@ -16,7 +16,7 @@ var l = class {
|
|
|
16
16
|
constructor(e) {
|
|
17
17
|
this.hinkal = e, this.unsubscribeBalanceChange = a.subscribe((e) => {
|
|
18
18
|
this.applyRefreshFromBalanceChangeEvent(e).catch((e) => {
|
|
19
|
-
|
|
19
|
+
n.error("Private balance refresh from balance change failed:", e);
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
22
|
}
|
|
@@ -31,11 +31,11 @@ var l = class {
|
|
|
31
31
|
}
|
|
32
32
|
async applyRefreshFromBalanceChangeEvent(e) {
|
|
33
33
|
if (!e) {
|
|
34
|
-
await this.refreshInternal(
|
|
34
|
+
await this.refreshInternal(r.FreshWithoutLoader);
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
let { updateType: t, balanceChangeState:
|
|
38
|
-
await this.refreshInternal(t,
|
|
37
|
+
let { updateType: t, balanceChangeState: n, chainIdToUpdate: i, resetCacheBefore: a, updateTokensListBefore: o } = e;
|
|
38
|
+
await this.refreshInternal(t, n, a, o, i);
|
|
39
39
|
}
|
|
40
40
|
dispatch(e) {
|
|
41
41
|
this.privateBalancesState = c(this.privateBalancesState, e);
|
|
@@ -58,12 +58,12 @@ var l = class {
|
|
|
58
58
|
async hasCache(e, t) {
|
|
59
59
|
return await o.getBalancesByWallet(e, t) !== void 0;
|
|
60
60
|
}
|
|
61
|
-
async getBalancesWithUsdValues(t,
|
|
61
|
+
async getBalancesWithUsdValues(t, r) {
|
|
62
62
|
try {
|
|
63
|
-
if (!
|
|
64
|
-
let
|
|
65
|
-
if (!
|
|
66
|
-
let i = await s.getAndUpdatePrices(
|
|
63
|
+
if (!r) return [];
|
|
64
|
+
let n = t.map((e) => e.token.erc20TokenAddress);
|
|
65
|
+
if (!n.length) return [];
|
|
66
|
+
let i = await s.getAndUpdatePrices(r, n), a = new Map(n.map((e, t) => [e, i[t]]));
|
|
67
67
|
return [...t.map((t) => {
|
|
68
68
|
try {
|
|
69
69
|
let n = t.token.erc20TokenAddress, r = a.get(n) ?? 0, i = t.balance, o = Number(e(t.token, i)) * r;
|
|
@@ -79,23 +79,23 @@ var l = class {
|
|
|
79
79
|
}
|
|
80
80
|
})];
|
|
81
81
|
} catch {
|
|
82
|
-
return
|
|
82
|
+
return n.log("Error fetching private token balances"), [];
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
handleCached = async (
|
|
85
|
+
handleCached = async (r, a) => {
|
|
86
86
|
try {
|
|
87
|
-
await t(this.hinkal,
|
|
87
|
+
await t(this.hinkal, r), this.dispatch({
|
|
88
88
|
type: "SET_BALANCES",
|
|
89
89
|
chainId: a,
|
|
90
90
|
balances: void 0
|
|
91
91
|
});
|
|
92
|
-
let
|
|
93
|
-
if (await t(this.hinkal,
|
|
92
|
+
let n = await o.getBalancesByWallet(r, a), c = await s.getPrices();
|
|
93
|
+
if (await t(this.hinkal, r), !n || (this.dispatch({
|
|
94
94
|
type: "SET_BALANCES",
|
|
95
95
|
chainId: a,
|
|
96
|
-
balances:
|
|
96
|
+
balances: n
|
|
97
97
|
}), !c)) return;
|
|
98
|
-
let l =
|
|
98
|
+
let l = n.map((t) => {
|
|
99
99
|
let n = i(t.token.erc20TokenAddress, a);
|
|
100
100
|
return {
|
|
101
101
|
...t,
|
|
@@ -108,51 +108,51 @@ var l = class {
|
|
|
108
108
|
balances: l
|
|
109
109
|
});
|
|
110
110
|
} catch (e) {
|
|
111
|
-
|
|
111
|
+
n.error("Error refreshing cached private balance:", e);
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
|
-
handleFresh = async (e,
|
|
114
|
+
handleFresh = async (e, r, i, a, s, c) => {
|
|
115
115
|
let l = s;
|
|
116
116
|
try {
|
|
117
117
|
await t(this.hinkal, e);
|
|
118
|
-
let
|
|
119
|
-
await t(this.hinkal, e), l = s || !
|
|
118
|
+
let n = await this.hasCache(e, r);
|
|
119
|
+
await t(this.hinkal, e), l = s || !n, l && this.dispatch({
|
|
120
120
|
type: "SET_LOADING",
|
|
121
|
-
chainId:
|
|
121
|
+
chainId: r,
|
|
122
122
|
newValue: !0
|
|
123
|
-
}), await t(this.hinkal, e), a && await this.hinkal.resetMerkle([
|
|
124
|
-
let u = await this.hinkal.getTotalBalance(
|
|
123
|
+
}), await t(this.hinkal, e), a && await this.hinkal.resetMerkle([r]);
|
|
124
|
+
let u = await this.hinkal.getTotalBalance(r, i, e, a, c);
|
|
125
125
|
await t(this.hinkal, e);
|
|
126
126
|
let d = u.filter((e) => e.balance > 0n);
|
|
127
127
|
this.dispatch({
|
|
128
128
|
type: "SET_BALANCES",
|
|
129
|
-
chainId:
|
|
129
|
+
chainId: r,
|
|
130
130
|
balances: d
|
|
131
|
-
}), await o.setBalances(e,
|
|
131
|
+
}), await o.setBalances(e, r, d), await t(this.hinkal, e), l && (this.dispatch({
|
|
132
132
|
type: "SET_USD_LOADING",
|
|
133
|
-
chainId:
|
|
133
|
+
chainId: r,
|
|
134
134
|
newValue: !0
|
|
135
135
|
}), this.dispatch({
|
|
136
136
|
type: "SET_LOADING",
|
|
137
|
-
chainId:
|
|
137
|
+
chainId: r,
|
|
138
138
|
newValue: !1
|
|
139
139
|
})), await t(this.hinkal, e);
|
|
140
|
-
let f = await this.getBalancesWithUsdValues(d,
|
|
140
|
+
let f = await this.getBalancesWithUsdValues(d, r);
|
|
141
141
|
await t(this.hinkal, e), f.length > 0 && this.dispatch({
|
|
142
142
|
type: "SET_USD_BALANCES",
|
|
143
|
-
chainId:
|
|
143
|
+
chainId: r,
|
|
144
144
|
balances: f
|
|
145
145
|
});
|
|
146
146
|
} catch (e) {
|
|
147
|
-
|
|
147
|
+
n.error("Error refreshing private balance:", e);
|
|
148
148
|
} finally {
|
|
149
149
|
l && (this.dispatch({
|
|
150
150
|
type: "SET_LOADING",
|
|
151
|
-
chainId:
|
|
151
|
+
chainId: r,
|
|
152
152
|
newValue: !1
|
|
153
153
|
}), this.dispatch({
|
|
154
154
|
type: "SET_USD_LOADING",
|
|
155
|
-
chainId:
|
|
155
|
+
chainId: r,
|
|
156
156
|
newValue: !1
|
|
157
157
|
}));
|
|
158
158
|
}
|
|
@@ -161,18 +161,18 @@ var l = class {
|
|
|
161
161
|
let t = this.hinkal.getSupportedChains();
|
|
162
162
|
return e ? t.includes(e) ? [e] : [] : t;
|
|
163
163
|
}
|
|
164
|
-
async refreshInternal(e =
|
|
164
|
+
async refreshInternal(e = r.FreshWithoutLoader, t, n = !1, i = !1, a) {
|
|
165
165
|
let { ethAdd: o, userKeys: s } = await this.getAddressAndChain(t);
|
|
166
166
|
!o || !s?.getShieldedPublicKey() || await Promise.all(this.getSupportedChainsToUpdate(a).map(async (t) => {
|
|
167
167
|
switch (e) {
|
|
168
|
-
case
|
|
168
|
+
case r.OnlyCache:
|
|
169
169
|
await this.handleCached(o, t);
|
|
170
170
|
break;
|
|
171
|
-
case
|
|
172
|
-
await this.handleFresh(o, t, s,
|
|
171
|
+
case r.Fresh:
|
|
172
|
+
await this.handleFresh(o, t, s, n, !0, i);
|
|
173
173
|
break;
|
|
174
|
-
case
|
|
175
|
-
await this.handleFresh(o, t, s,
|
|
174
|
+
case r.FreshWithoutLoader:
|
|
175
|
+
await this.handleFresh(o, t, s, n, !1, i);
|
|
176
176
|
break;
|
|
177
177
|
default: break;
|
|
178
178
|
}
|
|
@@ -27,7 +27,6 @@ export interface IProviderAdapter<ConnectorType = unknown> {
|
|
|
27
27
|
switchNetwork(network: EthereumNetwork): Promise<unknown>;
|
|
28
28
|
onAccountChanged(): Promise<unknown>;
|
|
29
29
|
onChainChanged(chainId?: number): Promise<unknown>;
|
|
30
|
-
isPermitterAvailable(): boolean;
|
|
31
30
|
getGasPrice(chainId: number): Promise<bigint>;
|
|
32
31
|
signTypedData(domain: ethers.TypedDataDomain, types: Record<string, ethers.TypedDataField[]>, value: Record<string, unknown>): Promise<string>;
|
|
33
32
|
sendBatchCallsTransaction?(chainId: number, calls: Call[]): Promise<ethers.TransactionResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../crypto/poseidon.cjs`),n=require(`../../functions/web3/etherFunctions.cjs`),r=require(`../crypto-keys/keys.cjs`),i=require(`../../functions/utils/time.utils.cjs`);var a=class a{amount;erc20TokenAddress;mintAddress;timeStamp;nullifyingKey;spendingPublicKey;
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../crypto/poseidon.cjs`),n=require(`../../functions/web3/etherFunctions.cjs`),r=require(`../crypto-keys/keys.cjs`),i=require(`../../functions/utils/time.utils.cjs`);var a=class a{amount;erc20TokenAddress;mintAddress;timeStamp;nullifyingKey;spendingPublicKey;H0;stealthAddress;encryptionKey;commitment;nullifier;isBlocked;constructor({amount:e,erc20TokenAddress:t,mintAddress:a,timeStamp:o,nullifyingKey:s,spendingPublicKey:c,randomization:l,H0:u,stealthAddress:d,encryptionKey:f,commitment:p=void 0,nullifier:m=void 0,isBlocked:h=!1}){if(this.amount=e,this.erc20TokenAddress=t,this.mintAddress=a,this.timeStamp=o??i.getCurrentTimeInSeconds().toString(),this.nullifyingKey=s,this.spendingPublicKey=c,this.stealthAddress=d,this.encryptionKey=f,this.commitment=p,this.nullifier=m,this.isBlocked=h,u!==void 0)this.H0=u;else{let e=l??(s?r.UserKeys.findCorrectRandomization(n.randomBigInt(31),s):void 0);if(this.H0=e?r.UserKeys.findH0(e,s):void 0,!this.H0)throw Error(`UTXO requires H0 or nullifyingKey`)}}static createFrom(e,t){return new a({...e.getConstructableParams(),nullifier:void 0,commitment:void 0,...t})}getConstructableParams(){return{amount:this.amount,erc20TokenAddress:this.erc20TokenAddress,mintAddress:this.mintAddress,timeStamp:this.timeStamp,nullifyingKey:this.nullifyingKey,spendingPublicKey:this.spendingPublicKey,stealthAddress:this.stealthAddress,encryptionKey:this.encryptionKey,commitment:this.commitment,nullifier:this.nullifier,isBlocked:this.isBlocked,H0:this.H0}}getBasicUtxoParams(){return{amount:this.amount,erc20TokenAddress:this.erc20TokenAddress,mintAddress:this.mintAddress,timeStamp:this.timeStamp,stealthAddress:this.stealthAddress,commitment:this.commitment,nullifier:this.nullifier,isBlocked:this.isBlocked,H0:this.H0}}getCommitment(){if(!this.commitment){let e=[this.amount,this.erc20TokenAddress,BigInt(this.getStealthAddress()),this.timeStamp];this.commitment=t.poseidonHash(...e)}return this.commitment}getNullifier(){if(!this.nullifier){if(!this.nullifyingKey)throw Error(`No Nullifiers if private key is not provided`);let e=this.getCommitment(),n=t.poseidonHash(this.nullifyingKey,e);this.nullifier=t.poseidonHash(e,n)}return this.nullifier}getStealthAddress(){if(!this.stealthAddress){if(!this.nullifyingKey)throw Error(`No stealth address in UTXO if private key is not provided`);if(!this.H0)throw Error(`No H0 point provided`);this.stealthAddress=r.UserKeys.getStealthAddress(this.H0,this.nullifyingKey,this.spendingPublicKey)}return this.stealthAddress}getTokenAddress(t){let n=e.isSolanaLike(t)?this.mintAddress:this.erc20TokenAddress;if(!n)throw Error(`No token address provided`);return n}getEncryptionKey(){if(!this.nullifyingKey){if(!this.encryptionKey)throw Error(`No encryption key provided in UTXO`);return this.encryptionKey}return r.UserKeys.getEncryptionKeyPair(this.nullifyingKey).publicKey}};exports.Utxo=a;
|
|
@@ -11,7 +11,6 @@ export type IUtxoConstructor<T = bigint> = {
|
|
|
11
11
|
stealthAddress?: string;
|
|
12
12
|
encryptionKey?: string;
|
|
13
13
|
isBlocked?: boolean;
|
|
14
|
-
isNewStyle?: boolean;
|
|
15
14
|
commitment?: string;
|
|
16
15
|
nullifier?: string;
|
|
17
16
|
};
|
|
@@ -25,14 +24,12 @@ export declare class Utxo {
|
|
|
25
24
|
timeStamp: string;
|
|
26
25
|
nullifyingKey?: string;
|
|
27
26
|
spendingPublicKey?: bigint[];
|
|
28
|
-
randomization?: bigint;
|
|
29
27
|
H0?: JubPoint;
|
|
30
28
|
stealthAddress?: string;
|
|
31
29
|
encryptionKey?: string;
|
|
32
30
|
commitment?: string;
|
|
33
31
|
nullifier?: string;
|
|
34
32
|
isBlocked: boolean;
|
|
35
|
-
isNewStyle?: boolean;
|
|
36
33
|
/**
|
|
37
34
|
* creates new UTXO instance
|
|
38
35
|
* @param amount UTXO amount
|
|
@@ -48,7 +45,7 @@ export declare class Utxo {
|
|
|
48
45
|
* @param nullifier [optional] nullifier value if already computed
|
|
49
46
|
* @param isBlocked [optional] whether the UTXO is blocked
|
|
50
47
|
*/
|
|
51
|
-
constructor({ amount, erc20TokenAddress, mintAddress, timeStamp, nullifyingKey, spendingPublicKey, randomization, H0, stealthAddress, encryptionKey, commitment, nullifier, isBlocked,
|
|
48
|
+
constructor({ amount, erc20TokenAddress, mintAddress, timeStamp, nullifyingKey, spendingPublicKey, randomization, H0, stealthAddress, encryptionKey, commitment, nullifier, isBlocked, }: IUtxoConstructor);
|
|
52
49
|
static createFrom(utxoToCreateFrom: Utxo, patch: Partial<IUtxoConstructor>): Utxo;
|
|
53
50
|
getConstructableParams(): IUtxoConstructor;
|
|
54
51
|
getBasicUtxoParams(): IUtxoConstructor;
|
|
@@ -11,21 +11,18 @@ var a = class a {
|
|
|
11
11
|
timeStamp;
|
|
12
12
|
nullifyingKey;
|
|
13
13
|
spendingPublicKey;
|
|
14
|
-
randomization;
|
|
15
14
|
H0;
|
|
16
15
|
stealthAddress;
|
|
17
16
|
encryptionKey;
|
|
18
17
|
commitment;
|
|
19
18
|
nullifier;
|
|
20
19
|
isBlocked;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (this.amount = e, this.erc20TokenAddress = t, this.mintAddress = a, this.timeStamp = o ?? i().toString(), this.nullifyingKey = s, this.spendingPublicKey = c, this.stealthAddress = d, this.encryptionKey = f, this.commitment = p, this.nullifier = m, this.isBlocked = h, this.isNewStyle = g, g) if (u !== void 0) this.H0 = u;
|
|
20
|
+
constructor({ amount: e, erc20TokenAddress: t, mintAddress: a, timeStamp: o, nullifyingKey: s, spendingPublicKey: c, randomization: l, H0: u, stealthAddress: d, encryptionKey: f, commitment: p = void 0, nullifier: m = void 0, isBlocked: h = !1 }) {
|
|
21
|
+
if (this.amount = e, this.erc20TokenAddress = t, this.mintAddress = a, this.timeStamp = o ?? i().toString(), this.nullifyingKey = s, this.spendingPublicKey = c, this.stealthAddress = d, this.encryptionKey = f, this.commitment = p, this.nullifier = m, this.isBlocked = h, u !== void 0) this.H0 = u;
|
|
24
22
|
else {
|
|
25
23
|
let e = l ?? (s ? r.findCorrectRandomization(n(31), s) : void 0);
|
|
26
|
-
if (this.H0 = e ? r.findH0(e, s) : void 0, !this.H0) throw Error("
|
|
24
|
+
if (this.H0 = e ? r.findH0(e, s) : void 0, !this.H0) throw Error("UTXO requires H0 or nullifyingKey");
|
|
27
25
|
}
|
|
28
|
-
else if (this.randomization = l ?? (s ? r.findCorrectRandomization(n(31), s) : void 0), !this.randomization) throw Error("Old-style UTXO requires randomization or nullifyingKey");
|
|
29
26
|
}
|
|
30
27
|
static createFrom(e, t) {
|
|
31
28
|
return new a({
|
|
@@ -48,8 +45,7 @@ var a = class a {
|
|
|
48
45
|
commitment: this.commitment,
|
|
49
46
|
nullifier: this.nullifier,
|
|
50
47
|
isBlocked: this.isBlocked,
|
|
51
|
-
|
|
52
|
-
...this.isNewStyle ? { H0: this.H0 } : { randomization: this.randomization }
|
|
48
|
+
H0: this.H0
|
|
53
49
|
};
|
|
54
50
|
}
|
|
55
51
|
getBasicUtxoParams() {
|
|
@@ -62,8 +58,7 @@ var a = class a {
|
|
|
62
58
|
commitment: this.commitment,
|
|
63
59
|
nullifier: this.nullifier,
|
|
64
60
|
isBlocked: this.isBlocked,
|
|
65
|
-
|
|
66
|
-
...this.isNewStyle ? { H0: this.H0 } : { randomization: this.randomization }
|
|
61
|
+
H0: this.H0
|
|
67
62
|
};
|
|
68
63
|
}
|
|
69
64
|
getCommitment() {
|
|
@@ -89,13 +84,8 @@ var a = class a {
|
|
|
89
84
|
getStealthAddress() {
|
|
90
85
|
if (!this.stealthAddress) {
|
|
91
86
|
if (!this.nullifyingKey) throw Error("No stealth address in UTXO if private key is not provided");
|
|
92
|
-
if (this.
|
|
93
|
-
|
|
94
|
-
this.stealthAddress = r.getStealthAddressNewStyle(this.H0, this.nullifyingKey, this.spendingPublicKey);
|
|
95
|
-
} else {
|
|
96
|
-
if (!this.randomization) throw Error("No randomization provided");
|
|
97
|
-
this.stealthAddress = r.getStealthAddress(this.randomization, this.nullifyingKey);
|
|
98
|
-
}
|
|
87
|
+
if (!this.H0) throw Error("No H0 point provided");
|
|
88
|
+
this.stealthAddress = r.getStealthAddress(this.H0, this.nullifyingKey, this.spendingPublicKey);
|
|
99
89
|
}
|
|
100
90
|
return this.stealthAddress;
|
|
101
91
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={
|
|
2
|
-
version`,CONNECTION_PROBLEM:`Failed to connect wallet. Please try again.`,REQUEST_PENDING:`request of type 'wallet_requestpermissions' already pending for origin`},n={INSUFFICIENT_FUNDS:`Insufficient funds`,INSUFFICIENT_FUNDS_WITHDRAW:`Not enough funds to withdraw`,INSUFFICIENT_FUNDS_TRANSFER:`Not enough funds to transfer`,INSUFFICIENT_FUNDS_TO_TRANSACT:`Not enough funds to transact`,INSUFFICIENT_FUNDS_GAS:`Insufficient funds for gas * price`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Insufficient TRX balance to cover transfer amount and transaction fee reserve`,INSUFFICIENT_SOL_BALANCE:`Insufficient SOL balance`},r={GAS_PRICE_EXCEEDS_AUTOSHIELD_LIMIT:`Skipped shielding due to gas fee exceeding your limit.`,AUTO_SHIELD_INSUFFICIENT_GAS:`Auto-Shield skipped due to insufficient gas.`},i={...e,...t,...n,...r,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`ApproxParamsInvalid`,NOT_ENOUGH_TOKENS:`Transfer amount exceeds balance`,TRANSACTION_NOT_CONFIRMED:`The transaction was not confirmed by the network. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Non-200 status code: '429'`,RELAYER_NOT_AVAILABLE:`All relayers are busy, please try in a few seconds`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,CONNECT_ERROR:`Connection error`,CONNECT_ERROR2:`DOMException: Failed`,USER_REJECTED_TX:`Transaction rejected`,USER_REJECTED_SIGN:`User rejected signing`,USER_REJECTED_TRANSACTION:`user rejected transaction`,USER_REJECTED_SIGN2:`User rejected the request`,USER_REJECTED_CONNECTION:`The user rejected connection.`,USER_REJECTED_RPC:`User has rejected`,SIMULATION_FAILED:`Simulation failed:`,USER_DENIED_TRANSACTION_SIGNATURE:`User denied transaction signature.`,USER_DENIED_REQUEST_SIGNATURE:`User denied request signature.`,SIGNING_FAILED:`The signing failed. Please, try again`,SIGNATURE_UNSUPPORTED_CHAINS:`Details: Unsupported chains`,SIGNATURE_UNSUPPORTED_CHAINS2:`User disapproved requested chains`,SIGNATURE_REQUEST_EXPIRED:`Request expired. Please try again`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`The method personal_sign does not exist`,USER_DISAPPROVED_REQUESTED_METHODS:`User disapproved requested methods`,INVALID_AUTHORIZATION:`The requested account and/or method has not been authorized by the user`,INVALID_NULLIFIER:`Nullifier cannot be reused`,SANCTIONED_ADDRESS:`Address is sanctioned`,INVALID_AMOUNT:`Please, select correct amount`,RECIPIENT_FORMAT_INCORRECT:`Recipient Information format is incorrect`,INVALID_TOKEN:`Invalid token provided`,STATE_TO_UPDATE:`Error in template Verifier_219 line: 121`,INVALID_RECEIVER:`Receiver address doesn't match`,INVALID_RELAYER:`Relayer address doesn't match`,INVALID_RELAYER_FEE:`Relayer fee amount is not valid`,TIMESTAMP_STALE:`Timestamp provided does not align with current time`,INVALID_ZKP:`Proof must be valid`,NO_TRANSACTIONS_TO_CERTIFY:`This week, you do not have transactions to certify`,RECIPIENT_AMOUNT_INVALID:`Recipient amount is invalid`,UNSUPPORTED_NETWORK:`The selected network is not supported. Please switch to another network to continue.`,SIG_BY_OWNER:`Signature must be signed by the owner of the contract`,AMOUNT_EMPTY:`Please, specify amount`,RELAYER_ISSUE:`Relayer has some issues. Try again later`,RELAYER_GAS_ESTIMATE:`Relayer was not able to estimate the gas costs of tx. Please, try later`,RECEIVER_EMPTY:`Please, enter recipient address`,VALID_ETHEREUM_ADDRESS:`Please, input valid ethereum address`,METAMASK_NOT_INSTALLED:`Please, install Metamask Wallet`,VIABLE_TX:`The transaction is not viable. Please increase the swap amount to swap with Relayer`,TRANSACTION_REPLACED:`transaction was replaced`,TRANSACTION_REPLACED2:`replacement fee too low`,TRANSACTION_CANCELED:`Transaction was cancelled. Please try again`,NONCE_HIGH:`Nonce too high`,WALLET_CONNECT_MATCHING_KEYS:`No matching key. keychain`,UNKNOWN_PROVIDER:`Unknown provider`,SAFE_ERC:`SafeERC20: low-level call failed`,SAFE_ERC_APPROVE:`SafeERC20: approve from non-zero to non-zero allowance`,SWAP_RELAYER_MIN:`Relayer minimum fee is not satisfied`,LOW_LEVEL_CALL:`low-level delegate call failed`,INTEGRAL_CURVE_ZERO:`previous integral cannot be zero`,ODOS_FETCH:`Odos API Fetch Error`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,SLIPPAGE_LIMIT:`Slippage Limit Exceeded`,SLIPPAGE_LIMIT_1:`Slippage screwed you`,QUOTE_EXPIRED:`Quote has expired`,REVERT_NO_STRING:`Transaction reverted without a reason string`,UNISWAP_NOT_ENOUGH_LIQUIDITY:`Not Enough Liquidity`,CONNECTION_FAILED:`Failed to connect`,FAILED_TO_SWITCH_NETWORKS:`Please switch networks in your wallet settings`,INVALID_FROM:`Invalid from token`,INVALID_TO:`Invalid to token`,Invalid_Password:`Invalid password`,INTERNAL_ERROR:`Internal error: please, try again`,INVALID_MERKLE_ROOT:`Invalid merkle tree root`,MERLE_TREE_SNARK:`Error in template ForceEqualIfEnabled`,ERROR_MESSAGE_CHAIN_ADDRESS_CHANGED:`Chain/address changed: balance updated canceled`,DECIMALS_LIMIT:`Number of decimals exceed maximum`,MERKLE_TREE_INCOMPLETE:`Merkle tree is incomplete`,FAIL_ESTIMATE_GAS:`Failed to estimate gas: check the transaction parameters`,LEDGER_IS_LOCKED:`Ledger device: Locked device`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Ledger device: UNKNOWN_ERROR (0x6a8c)`,LEDGER_IS_NOT_AVAILABLE:`Ledger device: UNKNOWN_ERROR`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,ODOS_SWAP_FAILED:`Odos swap call failed`,ONEINCH_SWAP_FAILED:`One inch swap failed`,GAS_ESTIMATION_ERROR:`Failed Gas Estimates Response`,GAS_ESTIMATE_INCORRECT_PARAMETERS:`Incorrect Parameters for Gas Estimate`,CONNECTIVITY_ERROR:`Request failed with status code 500`,TRANSACTION_FAILED:`Transaction Failed: Revert`,NO_SWAP_QUOTES:`No swap quotes available`,NO_UNISWAP_PRICE:`Cannot get Uniswap Price`,NO_ODOS_PRICE:`Cannot get Odos Price`,NO_ONEINCH_PRICE:`Cannot get OneInch Price`,NO_LIFI_PRICE:`Cannot get LiFi Price`,FEES_OVER_TRANSACTION_VALUE:`Fees are over transaction value. Please, increase the amount`,GAS_STATION_NOT_AVAILABLE:`Gas Station Not Available`,INBALANCE_IN_TOKEN:`Inbalance in token detected`,BALANCE_EQUATION_FAILED:`Balance Diff Should be equal to sum of onchain and offchain created commitments`,TOKEN_ADD_ERROR:`Error occoured while adding token. Please make sure you are adding a valid ERC-20 token`,CANNOT_ESTIMATE_GAS:`transaction may require manual gas limit`,NETWORK_ERROR:`Network Error`,MAX_FEE_GAS_ERROR:`max fee per gas less than block base fee`,CORS_ERROR:`has been blocked by CORS policy`,CANNOT_ESTIMATE_GAS2:`transaction may fail or may require manual gas limit`,NO_RESPONSE_PRIVATE:`No resonse from private relay`,TRY_AGAIN_AFTER_TRANSACTION:`Please, try again`,ALREADY_SUBSCRIBED:`User Already Subscribed`,PREFERRED_TOKEN_OR_ADDRESS_MISSING:`Please, specify both the preferred token and public wallet address`,SNAPSHOT_FILE_NOT_FOUND:`We are updating our servers. Please try again in some time`,SAME_ADDRESS_FORBIDDEN:`You cannot recieve staked tokens on the same ethereum address`,NOT_VALID_ETHEREUM_ADDRESS:`Please enter a valid Ethereum address`,MUST_STAKE_AT_LEAST_ONE_ETH:`Amount too low, Please stake at least 1 ETH`,OUT_OF_MEMORY:`Out of memory: Cannot allocate Wasm memory`,OUT_OF_MEMORY2:`could not allocate memory`,OUT_OF_MEMORY3:`out of memory`,UNKNOWN:`Unknown error`,TRANSACTION_WRONG_REQUEST:`The requested Transaction type is not supported`,INSUFFICIENT_LAMPORTS:`insufficient lamports`,TOKENS_DO_NOT_BELONG_SAME_CHAIN:`Tokens belong to different chains. All tokens must belong to the same chain`,OKX_MIN_RETURN_NOT_REACHED:`custom program error: 0x177a`,MIN_RETURNED_NOT_REACHED:`MinReturnNotReached`,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:`ReceivedAmountLowerThanExpected`,AUTO_SHIELD_SKIPPED:`We skipped auto-shield because the asset was an NFT or the remaining token was used as gas.`,LOW_OUTPUT_AMOUNT:`Gas fees exceed received amount. Please try adjusting amount or lowering slippage.`,EXECUTION_REVERTED:`execution reverted`,SOLANA_TRANSACTION_LOG_SIZE_LIMIT:`Transaction logs are too large. Please try again later`,COMPUTATIONAL_BUDGET_EXCEEDED:`ComputationalBudgetExceeded`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Relay Fee is over withdraw amount`,TRON_CONFIRMATION_DECLINED:`Confirmation declined by user`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`One of the source addresses is restricted from private transactions`,ACCOUNT_RESOURCE_INSUFFICIENT_ERROR:`Account resource insufficient error`},a=`Not enough memory. Please, close some tabs/applications to free up memory and try again`,o=`Your transaction didn’t go through due to price slippage. Try increasing your slippage tolerance`,s={USER_REJECTED_TRANSACTION:`You cancelled the transaction`,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`The amount you provided is too high, please adjust the amount`,WC_NO_MATCHING_KEY:`Wallet Connect error. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Rate Limit: please, use different rpc provider in your wallet`,INSUFFICIENT_FUNDS_GAS:`Your balance is too low to cover the transaction fees. Please add funds to proceed`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Your TRX balance is too low to cover amount and transaction fee`,INVALID_NULLIFIER:`There seems to be an issue with syncing your balance. Please press the refresh icon next to your shielded balance`,STATE_TO_UPDATE:`A technical issue has occurred. Please create a ticket on Hinkal discord server`,INVALID_ZKP:`The Zero Knowledge Proof provided is invalid. Please check and try again`,NONCE_HIGH:`To resolve this issue, please reset your wallet in the Settings`,UNKNOWN_PROVIDER:`The provider is not recognized. Please check your settings`,TRANSACTION_REPLACED:`Your transaction was replaced by another. Please submit your transaction again`,TRANSACTION_REPLACED2:`This transaction was replaced. Please try submitting again`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,SAFE_ERC:`Your approved amount is lower than what you’re trying to send. Increase the approval or adjust the amount, then try again.`,SIMULATION_FAILED:`Transaction simulation failed. Please try again.`,SAFE_ERC_APPROVE:`The selected ERC20 Token could not be approved. Please contact the Hinkal support team`,INTEGRAL_CURVE_ZERO:`There's an issue with the pool's staking function. Please contact the Hinkal support team for assistance`,LOW_LEVEL_CALL:`A technical issue occurred. Please contact the Hinkal team for assistance`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,USER_REJECTED_SIGN2:`You canceled the request`,USER_REJECTED_RPC:`You canceled the request`,USER_DENIED_TRANSACTION_SIGNATURE:`You canceled the request`,USER_DENIED_REQUEST_SIGNATURE:`You canceled the request`,ODOS_FETCH:`Current Odos price is unavailable. Please try again`,ODOS_SWAP_FAILED:`Your Odos Swap transaction didn’t go through. Please try again`,ONEINCH_SWAP_FAILED:`Your 1inch Swap transaction didn’t go through. Please try again`,CONNECT_ERROR2:`Oops, there are connectivity issues. Please check your internet connection and try again`,WALLET_CONNECT_MATCHING_KEYS:`An internal WalletConnect error occurred. Please try reconnecting`,SIGNATURE_UNSUPPORTED_CHAINS:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_CHAINS2:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`Your active wallet doesn't support personal signatures. Please use a different wallet`,REVERT_NO_STRING:`Your transaction didn’t go through due to technical issues. Please submit a ticket on Hinkal discord server`,INVALID_MERKLE_ROOT:`There's an issue with the merkle tree root. Please submit a ticket on Hinkal discord server`,MERLE_TREE_SNARK:`An error occurred in the circuit processing. Please submit a ticket on Hinkal discord server`,MAX_FEE_GAS_ERROR:`Your transaction was rejected due to high network congestion`,MERKLE_TREE_INCOMPLETE:`A technical issue has occurred. Please submit a ticket on Hinkal discord server`,CORS_ERROR:`Unable to reach the remote client. Please submit a ticket on Hinkal discord server`,NETWORK_ERROR:`Connection error. Please, check back later`,CONNECTIVITY_ERROR:`A connectivity issue occurred. Please check your network connection`,LEDGER_IS_LOCKED:`Your wallet is locked. Please unlock your wallet`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Your ledger is not allowed to sign transactions. Please allow blind signing`,LEDGER_IS_NOT_AVAILABLE:`Access denied to use Ledger device.`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,INBALANCE_IN_TOKEN:o,OKX_MIN_RETURN_NOT_REACHED:o,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:o,MIN_RETURNED_NOT_REACHED:o,BALANCE_EQUATION_FAILED:`There's an issue with the balance calculation. Please adjust your transaction parameters`,SLIPPAGE_LIMIT_1:`Your transaction didn’t go through due to price slippage. Adjust slippage settings and retry`,CANNOT_ESTIMATE_GAS:`Unable to estimate the gas required. Please set the gas limit manually`,CANNOT_ESTIMATE_GAS2:`Your transaction didn’t go through. Please try setting gas limit manually`,GAS_STATION_NOT_AVAILABLE:`The Gas Station service is currently unavailable. Please submit a ticket on Hinkal discord server`,TIMESTAMP_STALE:`This transaction is outdated. Please initiate a new transaction`,ALREADY_SUBSCRIBED:`This email is already subscribed to the Hinkal newsletter`,OUT_OF_MEMORY:a,OUT_OF_MEMORY2:a,OUT_OF_MEMORY3:a,INVALID_RECOVERY_PHRASE:`Invalid recovery phrase`,PHRASES_DONT_MATCH:`Phrases do not match. You can go back and verify your recovery phrase.`,PASSWORDS_DONT_MATCH:`Passwords do not match`,PASSWORD_SAME_AS_OLD:`Password cannot be the same as the old one`,PASSWORD_TOO_SMALL:`Password must be at least 8 characters`,PASSWORD_NOT_CORRECT:`Incorrect current password`,CODE_ALREADY_USED:`This code has already been used`,ACCESS_CODE_REQUIRED:`Access code is required`,ACCESS_CODE_IS_ALREADY_IN_USE:`Access code is already in use`,ACCESS_CODE_IS_ALREADY_IN_USE1:`Access code already in use. Import or connect existing wallet`,ERROR_DURING_PHRASE_CONFIRMATION:`Error during Phrase confirmation`,INSUFFICIENT_LAMPORTS:`Your SOL balance is too low to complete this transaction`,EXECUTION_REVERTED:`Your transaction reverted.`,COMPUTATIONAL_BUDGET_EXCEEDED:`Your transaction exceeded the limited compute units. Please try again.`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Your transaction didn’t go through because the relay fee exceeded the transaction amount`,TRON_CONFIRMATION_DECLINED:`You canceled the request`,INVALID_RELAYER_FEE:`The transaction fee changed while submitting. Please try again.`,REQUEST_PENDING:`A request is already pending in your wallet. Please confirm to connect.`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`The funds you’re trying to use have been flagged as sanctioned.`,NO_SWAP_QUOTES:`No swap route available for this token pair on the selected network at the moment. Please try again later or adjust the swap parameters.`},c={UTXO_LIMITATIONS:`Your transaction exceeds the UTXO limit`,INSUFFICIENT_BALANCE_FOR_FEES:`Fees are high right now and would consume a large portion of your balance. Consider reducing the amount or retrying later.`,HIGH_FEE_WARNING:`Total fees exceed your available balance. Consider adding funds or retry later when fees decrease.`};exports.DIRECTLY_SHOW_MESSAGE_ERROR_CODES=c,exports.UserFriendlyErrorCodes=s,exports.gasErrorCodes=r,exports.insufficientResourcesErrorCodes=n,exports.transactionErrorCodes=i;
|
|
1
|
+
var e={WC_NO_MATCHING_KEY:`creating the transaction failed
|
|
2
|
+
version`,CONNECTION_PROBLEM:`Failed to connect wallet. Please try again.`,REQUEST_PENDING:`request of type 'wallet_requestpermissions' already pending for origin`},t={INSUFFICIENT_FUNDS:`Insufficient funds`,INSUFFICIENT_FUNDS_WITHDRAW:`Not enough funds to withdraw`,INSUFFICIENT_FUNDS_TRANSFER:`Not enough funds to transfer`,INSUFFICIENT_FUNDS_TO_TRANSACT:`Not enough funds to transact`,INSUFFICIENT_FUNDS_GAS:`Insufficient funds for gas * price`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Insufficient TRX balance to cover transfer amount and transaction fee reserve`,INSUFFICIENT_SOL_BALANCE:`Insufficient SOL balance`},n={GAS_PRICE_EXCEEDS_AUTOSHIELD_LIMIT:`Skipped shielding due to gas fee exceeding your limit.`,AUTO_SHIELD_INSUFFICIENT_GAS:`Auto-Shield skipped due to insufficient gas.`},r={...e,...t,...n,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`ApproxParamsInvalid`,NOT_ENOUGH_TOKENS:`Transfer amount exceeds balance`,TRANSACTION_NOT_CONFIRMED:`The transaction was not confirmed by the network. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Non-200 status code: '429'`,RELAYER_NOT_AVAILABLE:`All relayers are busy, please try in a few seconds`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,CONNECT_ERROR:`Connection error`,CONNECT_ERROR2:`DOMException: Failed`,USER_REJECTED_TX:`Transaction rejected`,USER_REJECTED_SIGN:`User rejected signing`,USER_REJECTED_TRANSACTION:`user rejected transaction`,USER_REJECTED_SIGN2:`User rejected the request`,USER_REJECTED_CONNECTION:`The user rejected connection.`,USER_REJECTED_RPC:`User has rejected`,SIMULATION_FAILED:`Simulation failed:`,USER_DENIED_TRANSACTION_SIGNATURE:`User denied transaction signature.`,USER_DENIED_REQUEST_SIGNATURE:`User denied request signature.`,SIGNING_FAILED:`The signing failed. Please, try again`,SIGNATURE_UNSUPPORTED_CHAINS:`Details: Unsupported chains`,SIGNATURE_UNSUPPORTED_CHAINS2:`User disapproved requested chains`,SIGNATURE_REQUEST_EXPIRED:`Request expired. Please try again`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`The method personal_sign does not exist`,USER_DISAPPROVED_REQUESTED_METHODS:`User disapproved requested methods`,INVALID_AUTHORIZATION:`The requested account and/or method has not been authorized by the user`,INVALID_NULLIFIER:`Nullifier cannot be reused`,SANCTIONED_ADDRESS:`Address is sanctioned`,INVALID_AMOUNT:`Please, select correct amount`,RECIPIENT_FORMAT_INCORRECT:`Recipient Information format is incorrect`,INVALID_TOKEN:`Invalid token provided`,STATE_TO_UPDATE:`Error in template Verifier_219 line: 121`,INVALID_RECEIVER:`Receiver address doesn't match`,INVALID_RELAYER:`Relayer address doesn't match`,INVALID_RELAYER_FEE:`Relayer fee amount is not valid`,TIMESTAMP_STALE:`Timestamp provided does not align with current time`,INVALID_ZKP:`Proof must be valid`,NO_TRANSACTIONS_TO_CERTIFY:`This week, you do not have transactions to certify`,RECIPIENT_AMOUNT_INVALID:`Recipient amount is invalid`,UNSUPPORTED_NETWORK:`The selected network is not supported. Please switch to another network to continue.`,SIG_BY_OWNER:`Signature must be signed by the owner of the contract`,AMOUNT_EMPTY:`Please, specify amount`,RELAYER_ISSUE:`Relayer has some issues. Try again later`,RELAYER_GAS_ESTIMATE:`Relayer was not able to estimate the gas costs of tx. Please, try later`,RECEIVER_EMPTY:`Please, enter recipient address`,VALID_ETHEREUM_ADDRESS:`Please, input valid ethereum address`,METAMASK_NOT_INSTALLED:`Please, install Metamask Wallet`,VIABLE_TX:`The transaction is not viable. Please increase the swap amount to swap with Relayer`,TRANSACTION_REPLACED:`transaction was replaced`,TRANSACTION_REPLACED2:`replacement fee too low`,TRANSACTION_CANCELED:`Transaction was cancelled. Please try again`,NONCE_HIGH:`Nonce too high`,WALLET_CONNECT_MATCHING_KEYS:`No matching key. keychain`,UNKNOWN_PROVIDER:`Unknown provider`,SAFE_ERC:`SafeERC20: low-level call failed`,SAFE_ERC_APPROVE:`SafeERC20: approve from non-zero to non-zero allowance`,SWAP_RELAYER_MIN:`Relayer minimum fee is not satisfied`,LOW_LEVEL_CALL:`low-level delegate call failed`,INTEGRAL_CURVE_ZERO:`previous integral cannot be zero`,ODOS_FETCH:`Odos API Fetch Error`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,SLIPPAGE_LIMIT:`Slippage Limit Exceeded`,SLIPPAGE_LIMIT_1:`Slippage screwed you`,QUOTE_EXPIRED:`Quote has expired`,REVERT_NO_STRING:`Transaction reverted without a reason string`,UNISWAP_NOT_ENOUGH_LIQUIDITY:`Not Enough Liquidity`,CONNECTION_FAILED:`Failed to connect`,FAILED_TO_SWITCH_NETWORKS:`Please switch networks in your wallet settings`,INVALID_FROM:`Invalid from token`,INVALID_TO:`Invalid to token`,Invalid_Password:`Invalid password`,INTERNAL_ERROR:`Internal error: please, try again`,INVALID_MERKLE_ROOT:`Invalid merkle tree root`,MERLE_TREE_SNARK:`Error in template ForceEqualIfEnabled`,ERROR_MESSAGE_CHAIN_ADDRESS_CHANGED:`Chain/address changed: balance updated canceled`,DECIMALS_LIMIT:`Number of decimals exceed maximum`,MERKLE_TREE_INCOMPLETE:`Merkle tree is incomplete`,FAIL_ESTIMATE_GAS:`Failed to estimate gas: check the transaction parameters`,LEDGER_IS_LOCKED:`Ledger device: Locked device`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Ledger device: UNKNOWN_ERROR (0x6a8c)`,LEDGER_IS_NOT_AVAILABLE:`Ledger device: UNKNOWN_ERROR`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,ODOS_SWAP_FAILED:`Odos swap call failed`,ONEINCH_SWAP_FAILED:`One inch swap failed`,GAS_ESTIMATION_ERROR:`Failed Gas Estimates Response`,GAS_ESTIMATE_INCORRECT_PARAMETERS:`Incorrect Parameters for Gas Estimate`,CONNECTIVITY_ERROR:`Request failed with status code 500`,TRANSACTION_FAILED:`Transaction Failed: Revert`,NO_SWAP_QUOTES:`No swap quotes available`,NO_UNISWAP_PRICE:`Cannot get Uniswap Price`,NO_ODOS_PRICE:`Cannot get Odos Price`,NO_ONEINCH_PRICE:`Cannot get OneInch Price`,NO_LIFI_PRICE:`Cannot get LiFi Price`,FEES_OVER_TRANSACTION_VALUE:`Fees are over transaction value. Please, increase the amount`,GAS_STATION_NOT_AVAILABLE:`Gas Station Not Available`,INBALANCE_IN_TOKEN:`Inbalance in token detected`,BALANCE_EQUATION_FAILED:`Balance Diff Should be equal to sum of onchain and offchain created commitments`,TOKEN_ADD_ERROR:`Error occoured while adding token. Please make sure you are adding a valid ERC-20 token`,CANNOT_ESTIMATE_GAS:`transaction may require manual gas limit`,NETWORK_ERROR:`Network Error`,MAX_FEE_GAS_ERROR:`max fee per gas less than block base fee`,CORS_ERROR:`has been blocked by CORS policy`,CANNOT_ESTIMATE_GAS2:`transaction may fail or may require manual gas limit`,NO_RESPONSE_PRIVATE:`No resonse from private relay`,TRY_AGAIN_AFTER_TRANSACTION:`Please, try again`,ALREADY_SUBSCRIBED:`User Already Subscribed`,PREFERRED_TOKEN_OR_ADDRESS_MISSING:`Please, specify both the preferred token and public wallet address`,SNAPSHOT_FILE_NOT_FOUND:`We are updating our servers. Please try again in some time`,SAME_ADDRESS_FORBIDDEN:`You cannot recieve staked tokens on the same ethereum address`,NOT_VALID_ETHEREUM_ADDRESS:`Please enter a valid Ethereum address`,MUST_STAKE_AT_LEAST_ONE_ETH:`Amount too low, Please stake at least 1 ETH`,OUT_OF_MEMORY:`Out of memory: Cannot allocate Wasm memory`,OUT_OF_MEMORY2:`could not allocate memory`,OUT_OF_MEMORY3:`out of memory`,UNKNOWN:`Unknown error`,TRANSACTION_WRONG_REQUEST:`The requested Transaction type is not supported`,INSUFFICIENT_LAMPORTS:`insufficient lamports`,TOKENS_DO_NOT_BELONG_SAME_CHAIN:`Tokens belong to different chains. All tokens must belong to the same chain`,OKX_MIN_RETURN_NOT_REACHED:`custom program error: 0x177a`,MIN_RETURNED_NOT_REACHED:`MinReturnNotReached`,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:`ReceivedAmountLowerThanExpected`,AUTO_SHIELD_SKIPPED:`We skipped auto-shield because the asset was an NFT or the remaining token was used as gas.`,LOW_OUTPUT_AMOUNT:`Gas fees exceed received amount. Please try adjusting amount or lowering slippage.`,EXECUTION_REVERTED:`execution reverted`,SOLANA_TRANSACTION_LOG_SIZE_LIMIT:`Transaction logs are too large. Please try again later`,COMPUTATIONAL_BUDGET_EXCEEDED:`ComputationalBudgetExceeded`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Relay Fee is over withdraw amount`,TRON_CONFIRMATION_DECLINED:`Confirmation declined by user`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`One of the source addresses is restricted from private transactions`,ACCOUNT_RESOURCE_INSUFFICIENT_ERROR:`Account resource insufficient error`},i=`Not enough memory. Please, close some tabs/applications to free up memory and try again`,a=`Your transaction didn’t go through due to price slippage. Try increasing your slippage tolerance`,o={USER_REJECTED_TRANSACTION:`You cancelled the transaction`,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`The amount you provided is too high, please adjust the amount`,WC_NO_MATCHING_KEY:`Wallet Connect error. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Rate Limit: please, use different rpc provider in your wallet`,INSUFFICIENT_FUNDS_GAS:`Your balance is too low to cover the transaction fees. Please add funds to proceed`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Your TRX balance is too low to cover amount and transaction fee`,INVALID_NULLIFIER:`There seems to be an issue with syncing your balance. Please press the refresh icon next to your shielded balance`,STATE_TO_UPDATE:`A technical issue has occurred. Please create a ticket on Hinkal discord server`,INVALID_ZKP:`The Zero Knowledge Proof provided is invalid. Please check and try again`,NONCE_HIGH:`To resolve this issue, please reset your wallet in the Settings`,UNKNOWN_PROVIDER:`The provider is not recognized. Please check your settings`,TRANSACTION_REPLACED:`Your transaction was replaced by another. Please submit your transaction again`,TRANSACTION_REPLACED2:`This transaction was replaced. Please try submitting again`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,SAFE_ERC:`Your approved amount is lower than what you’re trying to send. Increase the approval or adjust the amount, then try again.`,SIMULATION_FAILED:`Transaction simulation failed. Please try again.`,SAFE_ERC_APPROVE:`The selected ERC20 Token could not be approved. Please contact the Hinkal support team`,INTEGRAL_CURVE_ZERO:`There's an issue with the pool's staking function. Please contact the Hinkal support team for assistance`,LOW_LEVEL_CALL:`A technical issue occurred. Please contact the Hinkal team for assistance`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,USER_REJECTED_SIGN2:`You canceled the request`,USER_REJECTED_RPC:`You canceled the request`,USER_DENIED_TRANSACTION_SIGNATURE:`You canceled the request`,USER_DENIED_REQUEST_SIGNATURE:`You canceled the request`,ODOS_FETCH:`Current Odos price is unavailable. Please try again`,ODOS_SWAP_FAILED:`Your Odos Swap transaction didn’t go through. Please try again`,ONEINCH_SWAP_FAILED:`Your 1inch Swap transaction didn’t go through. Please try again`,CONNECT_ERROR2:`Oops, there are connectivity issues. Please check your internet connection and try again`,WALLET_CONNECT_MATCHING_KEYS:`An internal WalletConnect error occurred. Please try reconnecting`,SIGNATURE_UNSUPPORTED_CHAINS:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_CHAINS2:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`Your active wallet doesn't support personal signatures. Please use a different wallet`,REVERT_NO_STRING:`Your transaction didn’t go through due to technical issues. Please submit a ticket on Hinkal discord server`,INVALID_MERKLE_ROOT:`There's an issue with the merkle tree root. Please submit a ticket on Hinkal discord server`,MERLE_TREE_SNARK:`An error occurred in the circuit processing. Please submit a ticket on Hinkal discord server`,MAX_FEE_GAS_ERROR:`Your transaction was rejected due to high network congestion`,MERKLE_TREE_INCOMPLETE:`A technical issue has occurred. Please submit a ticket on Hinkal discord server`,CORS_ERROR:`Unable to reach the remote client. Please submit a ticket on Hinkal discord server`,NETWORK_ERROR:`Connection error. Please, check back later`,CONNECTIVITY_ERROR:`A connectivity issue occurred. Please check your network connection`,LEDGER_IS_LOCKED:`Your wallet is locked. Please unlock your wallet`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Your ledger is not allowed to sign transactions. Please allow blind signing`,LEDGER_IS_NOT_AVAILABLE:`Access denied to use Ledger device.`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,INBALANCE_IN_TOKEN:a,OKX_MIN_RETURN_NOT_REACHED:a,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:a,MIN_RETURNED_NOT_REACHED:a,BALANCE_EQUATION_FAILED:`There's an issue with the balance calculation. Please adjust your transaction parameters`,SLIPPAGE_LIMIT_1:`Your transaction didn’t go through due to price slippage. Adjust slippage settings and retry`,CANNOT_ESTIMATE_GAS:`Unable to estimate the gas required. Please set the gas limit manually`,CANNOT_ESTIMATE_GAS2:`Your transaction didn’t go through. Please try setting gas limit manually`,GAS_STATION_NOT_AVAILABLE:`The Gas Station service is currently unavailable. Please submit a ticket on Hinkal discord server`,TIMESTAMP_STALE:`This transaction is outdated. Please initiate a new transaction`,ALREADY_SUBSCRIBED:`This email is already subscribed to the Hinkal newsletter`,OUT_OF_MEMORY:i,OUT_OF_MEMORY2:i,OUT_OF_MEMORY3:i,INVALID_RECOVERY_PHRASE:`Invalid recovery phrase`,PHRASES_DONT_MATCH:`Phrases do not match. You can go back and verify your recovery phrase.`,PASSWORDS_DONT_MATCH:`Passwords do not match`,PASSWORD_SAME_AS_OLD:`Password cannot be the same as the old one`,PASSWORD_TOO_SMALL:`Password must be at least 8 characters`,PASSWORD_NOT_CORRECT:`Incorrect current password`,CODE_ALREADY_USED:`This code has already been used`,ACCESS_CODE_REQUIRED:`Access code is required`,ACCESS_CODE_IS_ALREADY_IN_USE:`Access code is already in use`,ACCESS_CODE_IS_ALREADY_IN_USE1:`Access code already in use. Import or connect existing wallet`,ERROR_DURING_PHRASE_CONFIRMATION:`Error during Phrase confirmation`,INSUFFICIENT_LAMPORTS:`Your SOL balance is too low to complete this transaction`,EXECUTION_REVERTED:`Your transaction reverted.`,COMPUTATIONAL_BUDGET_EXCEEDED:`Your transaction exceeded the limited compute units. Please try again.`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Your transaction didn’t go through because the relay fee exceeded the transaction amount`,TRON_CONFIRMATION_DECLINED:`You canceled the request`,INVALID_RELAYER_FEE:`The transaction fee changed while submitting. Please try again.`,REQUEST_PENDING:`A request is already pending in your wallet. Please confirm to connect.`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`The funds you’re trying to use have been flagged as sanctioned.`,NO_SWAP_QUOTES:`No swap route available for this token pair on the selected network at the moment. Please try again later or adjust the swap parameters.`},s={UTXO_LIMITATIONS:`Your transaction exceeds the UTXO limit`,INSUFFICIENT_BALANCE_FOR_FEES:`Fees are high right now and would consume a large portion of your balance. Consider reducing the amount or retrying later.`,HIGH_FEE_WARNING:`Total fees exceed your available balance. Consider adding funds or retry later when fees decrease.`};exports.DIRECTLY_SHOW_MESSAGE_ERROR_CODES=s,exports.UserFriendlyErrorCodes=o,exports.gasErrorCodes=n,exports.insufficientResourcesErrorCodes=t,exports.transactionErrorCodes=r;
|
|
@@ -158,9 +158,6 @@ export declare const transactionErrorCodes: {
|
|
|
158
158
|
WC_NO_MATCHING_KEY: string;
|
|
159
159
|
CONNECTION_PROBLEM: string;
|
|
160
160
|
REQUEST_PENDING: string;
|
|
161
|
-
CANNOT_CERTIFY_FOR_PAST_WEEK: string;
|
|
162
|
-
CYCLICAL_REFERRALS_FORBIDDEN: string;
|
|
163
|
-
USER_IS_UNRANKED: string;
|
|
164
161
|
};
|
|
165
162
|
export declare const UserFriendlyErrorCodes: {
|
|
166
163
|
USER_REJECTED_TRANSACTION: string;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
//#region libs/shared/common/src/error-handling/error-codes.constants.ts
|
|
2
2
|
var e = {
|
|
3
|
-
CANNOT_CERTIFY_FOR_PAST_WEEK: "Certification for the past week is not available",
|
|
4
|
-
CYCLICAL_REFERRALS_FORBIDDEN: "Cyclical referrals are forbidden",
|
|
5
|
-
USER_IS_UNRANKED: "Please certify transactions to see rank"
|
|
6
|
-
}, t = {
|
|
7
3
|
WC_NO_MATCHING_KEY: "creating the transaction failed\nversion",
|
|
8
4
|
CONNECTION_PROBLEM: "Failed to connect wallet. Please try again.",
|
|
9
5
|
REQUEST_PENDING: "request of type 'wallet_requestpermissions' already pending for origin"
|
|
10
|
-
},
|
|
6
|
+
}, t = {
|
|
11
7
|
INSUFFICIENT_FUNDS: "Insufficient funds",
|
|
12
8
|
INSUFFICIENT_FUNDS_WITHDRAW: "Not enough funds to withdraw",
|
|
13
9
|
INSUFFICIENT_FUNDS_TRANSFER: "Not enough funds to transfer",
|
|
@@ -15,14 +11,13 @@ var e = {
|
|
|
15
11
|
INSUFFICIENT_FUNDS_GAS: "Insufficient funds for gas * price",
|
|
16
12
|
INSUFFICIENT_TRON_BALANCE_FOR_FEE: "Insufficient TRX balance to cover transfer amount and transaction fee reserve",
|
|
17
13
|
INSUFFICIENT_SOL_BALANCE: "Insufficient SOL balance"
|
|
18
|
-
},
|
|
14
|
+
}, n = {
|
|
19
15
|
GAS_PRICE_EXCEEDS_AUTOSHIELD_LIMIT: "Skipped shielding due to gas fee exceeding your limit.",
|
|
20
16
|
AUTO_SHIELD_INSUFFICIENT_GAS: "Auto-Shield skipped due to insufficient gas."
|
|
21
|
-
},
|
|
17
|
+
}, r = {
|
|
22
18
|
...e,
|
|
23
19
|
...t,
|
|
24
20
|
...n,
|
|
25
|
-
...r,
|
|
26
21
|
SOME_ERROR: "Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord",
|
|
27
22
|
TOO_HIGH_AMOUNT: "ApproxParamsInvalid",
|
|
28
23
|
NOT_ENOUGH_TOKENS: "Transfer amount exceeds balance",
|
|
@@ -153,7 +148,7 @@ var e = {
|
|
|
153
148
|
TRON_CONFIRMATION_DECLINED: "Confirmation declined by user",
|
|
154
149
|
BLACKLISTED_INPUT_COMMITMENT_ADDRESS: "One of the source addresses is restricted from private transactions",
|
|
155
150
|
ACCOUNT_RESOURCE_INSUFFICIENT_ERROR: "Account resource insufficient error"
|
|
156
|
-
},
|
|
151
|
+
}, i = "Not enough memory. Please, close some tabs/applications to free up memory and try again", a = "Your transaction didn’t go through due to price slippage. Try increasing your slippage tolerance", o = {
|
|
157
152
|
USER_REJECTED_TRANSACTION: "You cancelled the transaction",
|
|
158
153
|
SOME_ERROR: "Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord",
|
|
159
154
|
TOO_HIGH_AMOUNT: "The amount you provided is too high, please adjust the amount",
|
|
@@ -200,10 +195,10 @@ var e = {
|
|
|
200
195
|
LEDGER_BLIDN_SIGNING_NOT_ALLOWED: "Your ledger is not allowed to sign transactions. Please allow blind signing",
|
|
201
196
|
LEDGER_IS_NOT_AVAILABLE: "Access denied to use Ledger device.",
|
|
202
197
|
LEDGER_ACCESS_DENIED: "Access denied to use Ledger device.",
|
|
203
|
-
INBALANCE_IN_TOKEN:
|
|
204
|
-
OKX_MIN_RETURN_NOT_REACHED:
|
|
205
|
-
SOLANA_RECEIVED_LOWER_THAN_EXPECTED:
|
|
206
|
-
MIN_RETURNED_NOT_REACHED:
|
|
198
|
+
INBALANCE_IN_TOKEN: a,
|
|
199
|
+
OKX_MIN_RETURN_NOT_REACHED: a,
|
|
200
|
+
SOLANA_RECEIVED_LOWER_THAN_EXPECTED: a,
|
|
201
|
+
MIN_RETURNED_NOT_REACHED: a,
|
|
207
202
|
BALANCE_EQUATION_FAILED: "There's an issue with the balance calculation. Please adjust your transaction parameters",
|
|
208
203
|
SLIPPAGE_LIMIT_1: "Your transaction didn’t go through due to price slippage. Adjust slippage settings and retry",
|
|
209
204
|
CANNOT_ESTIMATE_GAS: "Unable to estimate the gas required. Please set the gas limit manually",
|
|
@@ -211,9 +206,9 @@ var e = {
|
|
|
211
206
|
GAS_STATION_NOT_AVAILABLE: "The Gas Station service is currently unavailable. Please submit a ticket on Hinkal discord server",
|
|
212
207
|
TIMESTAMP_STALE: "This transaction is outdated. Please initiate a new transaction",
|
|
213
208
|
ALREADY_SUBSCRIBED: "This email is already subscribed to the Hinkal newsletter",
|
|
214
|
-
OUT_OF_MEMORY:
|
|
215
|
-
OUT_OF_MEMORY2:
|
|
216
|
-
OUT_OF_MEMORY3:
|
|
209
|
+
OUT_OF_MEMORY: i,
|
|
210
|
+
OUT_OF_MEMORY2: i,
|
|
211
|
+
OUT_OF_MEMORY3: i,
|
|
217
212
|
INVALID_RECOVERY_PHRASE: "Invalid recovery phrase",
|
|
218
213
|
PHRASES_DONT_MATCH: "Phrases do not match. You can go back and verify your recovery phrase.",
|
|
219
214
|
PASSWORDS_DONT_MATCH: "Passwords do not match",
|
|
@@ -234,10 +229,10 @@ var e = {
|
|
|
234
229
|
REQUEST_PENDING: "A request is already pending in your wallet. Please confirm to connect.",
|
|
235
230
|
BLACKLISTED_INPUT_COMMITMENT_ADDRESS: "The funds you’re trying to use have been flagged as sanctioned.",
|
|
236
231
|
NO_SWAP_QUOTES: "No swap route available for this token pair on the selected network at the moment. Please try again later or adjust the swap parameters."
|
|
237
|
-
},
|
|
232
|
+
}, s = {
|
|
238
233
|
UTXO_LIMITATIONS: "Your transaction exceeds the UTXO limit",
|
|
239
234
|
INSUFFICIENT_BALANCE_FOR_FEES: "Fees are high right now and would consume a large portion of your balance. Consider reducing the amount or retrying later.",
|
|
240
235
|
HIGH_FEE_WARNING: "Total fees exceed your available balance. Consider adding funds or retry later when fees decrease."
|
|
241
236
|
};
|
|
242
237
|
//#endregion
|
|
243
|
-
export {
|
|
238
|
+
export { s as DIRECTLY_SHOW_MESSAGE_ERROR_CODES, o as UserFriendlyErrorCodes, n as gasErrorCodes, t as insufficientResourcesErrorCodes, r as transactionErrorCodes };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./error-codes.constants.cjs`),require(`./customErrors/ErrorWithAmount.cjs`),require(`./customErrors/FeeOverTransactionValueError.cjs`),require(`./types.cjs`),require(`./customErrors/customErrors.helpers.cjs`),require(`./customErrors/ErrorWithTx.cjs`),require(`./customErrors/index.cjs`),require(`./logError.cjs`),require(`./logger.cjs`),require(`./get-error.message.cjs`);
|
|
1
|
+
require(`./error-codes.constants.cjs`),require(`./customErrors/ErrorWithAmount.cjs`),require(`./customErrors/FeeOverTransactionValueError.cjs`),require(`./types.cjs`),require(`./customErrors/customErrors.helpers.cjs`),require(`./customErrors/ErrorWithTx.cjs`),require(`./customErrors/index.cjs`),require(`./logError.cjs`),require(`./logger.cjs`),require(`./isInsufficientFundsError.cjs`),require(`./get-error.message.cjs`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../utils/caseInsensitive.utils.cjs`),t=require(`../../error-handling/error-codes.constants.cjs`),n=require(`../../
|
|
1
|
+
const e=require(`../utils/caseInsensitive.utils.cjs`),t=require(`../../error-handling/error-codes.constants.cjs`),n=require(`../../error-handling/logger.cjs`),r=require(`../../types/external-action.types.cjs`),i=require(`../../types/offscreen.types.cjs`);require(`../../types/index.cjs`),require(`../../error-handling/index.cjs`);const a=require(`../pre-transaction/getFeeStructure.cjs`);require(`../pre-transaction/index.cjs`);const o=require(`../utils/convertEmporiumOpToCallInfo.cjs`),s=require(`../utils/postToOffscreen.cjs`);require(`../utils/index.cjs`);var c=async(c,l,u,d,f,p,m,h,g)=>{try{if(!((p.find(({erc20Token:t})=>e.caseInsensitiveEqual(t.erc20TokenAddress,c))?.totalUsdBalance??0)>=l)){let n=p.find(t=>t.totalUsdBalance<=l?!1:d.find(({erc20TokenAddress:n})=>e.caseInsensitiveEqual(n,t.erc20Token.erc20TokenAddress))?t.publicUsdBalance>l:!0);if(!n){s.postToOffscreen(i.MessagesFromOffscreen.AutoShieldTxStatus,{message:t.transactionErrorCodes.AUTO_SHIELD_INSUFFICIENT_GAS});return}c=n.erc20Token.erc20TokenAddress,m=await a.getFeeStructure(u,c,h,r.ExternalActionId.Emporium,f.map(e=>o.convertEmporiumOpToCallInfo(e,g,u)))}return{feeToken:c,feeStructure:m}}catch(e){n.Logger.error(`selectGasToken error`,{error:e});return}};exports.selectGasToken=c;
|