@hinkal/common 0.3.1 → 0.3.3
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/README.md +15 -18
- package/common/src/API/API.cjs +1 -1
- package/common/src/API/API.d.ts +12 -37
- package/common/src/API/API.mjs +80 -105
- package/common/src/API/callRelayer.d.ts +3 -0
- 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.cjs +1 -1
- package/common/src/API/enclaveUtxoCalls.d.ts +17 -8
- package/common/src/API/enclaveUtxoCalls.mjs +5 -3
- package/common/src/API/getOdosPriceForToken.cjs +1 -0
- package/common/src/API/getOdosPriceForToken.d.ts +1 -0
- package/common/src/API/getOdosPriceForToken.mjs +14 -0
- package/common/src/API/getWebsiteURL.d.ts +1 -3
- package/common/src/API/index.cjs +1 -1
- package/common/src/API/index.d.ts +1 -3
- package/common/src/API/index.mjs +3 -5
- 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 -40
- package/common/src/API/rewardsUserCalls.mjs +2 -10
- 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/tenderly.api.cjs +1 -1
- package/common/src/API/tenderly.api.d.ts +5 -10
- package/common/src/API/tenderly.api.mjs +1 -1
- 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/addresses.constants.cjs +1 -1
- package/common/src/constants/addresses.constants.d.ts +4 -46
- package/common/src/constants/addresses.constants.mjs +19 -60
- package/common/src/constants/balance.constants.cjs +1 -0
- package/common/src/constants/balance.constants.d.ts +1 -0
- package/common/src/constants/balance.constants.mjs +4 -0
- package/common/src/constants/chains.constants.cjs +1 -1
- package/common/src/constants/chains.constants.d.ts +3 -1
- package/common/src/constants/chains.constants.mjs +117 -138
- package/common/src/constants/coingecko.constants.cjs +1 -1
- package/common/src/constants/coingecko.constants.d.ts +2 -0
- package/common/src/constants/coingecko.constants.mjs +1 -1
- package/common/src/constants/contracts.constants.cjs +1 -1
- package/common/src/constants/contracts.constants.d.ts +0 -109
- package/common/src/constants/contracts.constants.mjs +9 -31
- package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.mjs +6 -9
- package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.mjs +6 -6
- package/common/src/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-base.json.mjs +6 -9
- package/common/src/constants/deploy-data/deploy-data-bnbMainnet.json.cjs +1 -0
- package/common/src/constants/deploy-data/deploy-data-bnbMainnet.json.mjs +10 -0
- package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.mjs +6 -9
- package/common/src/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-localhost.json.mjs +0 -3
- package/common/src/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-optimism.json.mjs +6 -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 +5 -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 +6 -9
- package/common/src/constants/deploy-data/deploy-data-sepoliaTestnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-sepoliaTestnet.json.mjs +0 -1
- package/common/src/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-solana.json.mjs +2 -2
- package/common/src/constants/deploy-data/deploy-data-tempo.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-tempo.json.mjs +6 -7
- package/common/src/constants/deploy-data/deploy-data-tronMainnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-tronMainnet.json.mjs +2 -4
- package/common/src/constants/deploy-data/deploy-data-tronNile.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-tronNile.json.mjs +2 -4
- package/common/src/constants/deploy-data/index.cjs +1 -1
- package/common/src/constants/deploy-data/index.d.ts +2 -1
- package/common/src/constants/deploy-data/index.mjs +16 -15
- 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 +2 -46
- package/common/src/constants/enclaveAuth.constants.d.ts +5 -0
- package/common/src/constants/events.constants.cjs +1 -1
- package/common/src/constants/events.constants.mjs +3 -2
- package/common/src/constants/fees.constants.cjs +1 -1
- package/common/src/constants/fees.constants.mjs +2 -2
- package/common/src/constants/index.cjs +1 -1
- package/common/src/constants/index.d.ts +1 -3
- package/common/src/constants/index.mjs +1 -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 +10 -6
- package/common/src/constants/protocol.constants.mjs +4 -11
- package/common/src/constants/server.constants.cjs +1 -1
- package/common/src/constants/server.constants.d.ts +6 -30
- package/common/src/constants/server.constants.mjs +11 -43
- package/common/src/constants/tokens.constants.cjs +1 -1
- package/common/src/constants/tokens.constants.mjs +1 -1
- 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 +88 -100
- 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.d.ts +1 -1
- package/common/src/data-structures/Hinkal/handleAutoDepositBack.mjs +24 -23
- package/common/src/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalActionReceive.mjs +3 -3
- package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.mjs +59 -57
- package/common/src/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalClaimUtxo.mjs +42 -50
- package/common/src/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDeposit.d.ts +1 -0
- package/common/src/data-structures/Hinkal/hinkalDeposit.mjs +50 -119
- package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.mjs +108 -100
- package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +3 -2
- package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +105 -64
- 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/hinkalNearDepositAndBridge.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.mjs +7 -3
- 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 +50 -38
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +2 -3
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.mjs +52 -117
- 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 -32
- package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.mjs +6 -6
- package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +71 -51
- package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +2 -2
- package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.mjs +47 -51
- package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +8 -4
- package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +155 -102
- package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.d.ts +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +16 -12
- package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +2 -2
- package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +61 -54
- package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaSwap.mjs +87 -51
- package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +1 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.mjs +97 -52
- package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +60 -34
- package/common/src/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSwap.mjs +29 -32
- package/common/src/data-structures/Hinkal/hinkalTransact.cjs +1 -0
- package/common/src/data-structures/Hinkal/hinkalTransact.d.ts +3 -0
- package/common/src/data-structures/Hinkal/hinkalTransact.mjs +90 -0
- package/common/src/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalTransfer.mjs +39 -44
- package/common/src/data-structures/Hinkal/hinkalTronDepositToSelf.cjs +1 -0
- package/common/src/data-structures/Hinkal/hinkalTronDepositToSelf.d.ts +8 -0
- package/common/src/data-structures/Hinkal/hinkalTronDepositToSelf.mjs +30 -0
- package/common/src/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalWithdraw.mjs +35 -49
- package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +170 -101
- package/common/src/data-structures/Hinkal/index.d.ts +0 -1
- package/common/src/data-structures/Hinkal/prepareTronDepositToSelf.cjs +1 -0
- package/common/src/data-structures/Hinkal/prepareTronDepositToSelf.d.ts +27 -0
- package/common/src/data-structures/Hinkal/prepareTronDepositToSelf.mjs +31 -0
- package/common/src/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/common/src/data-structures/Hinkal/resetMerkleTrees.mjs +5 -4
- 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/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 +15 -14
- package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.cjs +1 -1
- package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.mjs +7 -7
- package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.mjs +30 -30
- package/common/src/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
- package/common/src/data-structures/TokenDBs/PrivateTokensDB.mjs +6 -6
- package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.cjs +1 -1
- package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.mjs +12 -16
- package/common/src/data-structures/TokenDBs/TronPublicTokensDB.cjs +1 -1
- package/common/src/data-structures/TokenDBs/TronPublicTokensDB.d.ts +1 -0
- package/common/src/data-structures/TokenDBs/TronPublicTokensDB.mjs +22 -18
- 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 +9 -9
- package/common/src/data-structures/crypto-keys/decodeUTXO.mjs +37 -47
- 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 +14 -20
- 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/event-service/helpers/ClientEventHelper.cjs +1 -1
- package/common/src/data-structures/event-service/helpers/ClientEventHelper.mjs +6 -6
- package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
- package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +27 -23
- package/common/src/data-structures/merkle-tree/MerkleTree.cjs +1 -1
- package/common/src/data-structures/merkle-tree/MerkleTree.d.ts +10 -0
- package/common/src/data-structures/merkle-tree/MerkleTree.mjs +9 -1
- package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.cjs +1 -1
- package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.d.ts +3 -0
- package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.mjs +29 -19
- 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 +6 -14
- package/common/src/error-handling/error-codes.constants.mjs +21 -31
- package/common/src/error-handling/get-error.message.cjs +1 -1
- package/common/src/error-handling/get-error.message.mjs +27 -14
- 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/externalABIs/index.cjs +1 -1
- package/common/src/externalABIs/index.d.ts +1 -113
- package/common/src/externalABIs/index.mjs +2 -6
- package/common/src/functions/index.cjs +1 -1
- package/common/src/functions/index.d.ts +0 -1
- package/common/src/functions/index.mjs +13 -16
- 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/calculateSolanaNullifierCount.cjs +1 -1
- package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.mjs +39 -5
- package/common/src/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
- package/common/src/functions/pre-transaction/getExternalSwapAddress.mjs +2 -18
- package/common/src/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
- package/common/src/functions/pre-transaction/getSolanaCalldataHash.d.ts +1 -1
- package/common/src/functions/pre-transaction/getSolanaCalldataHash.mjs +11 -10
- package/common/src/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/common/src/functions/pre-transaction/getVolatileTransferAmount.mjs +12 -12
- package/common/src/functions/pre-transaction/index.cjs +1 -1
- package/common/src/functions/pre-transaction/index.d.ts +1 -2
- package/common/src/functions/pre-transaction/index.mjs +1 -2
- package/common/src/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/common/src/functions/pre-transaction/outputUtxoProcessing.d.ts +1 -1
- package/common/src/functions/pre-transaction/outputUtxoProcessing.mjs +9 -12
- 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.d.ts +13 -0
- package/common/src/functions/pre-transaction/solana.mjs +46 -21
- package/common/src/functions/pre-transaction/store-proof.cjs +1 -1
- package/common/src/functions/pre-transaction/store-proof.d.ts +1 -1
- package/common/src/functions/pre-transaction/store-proof.mjs +1 -0
- package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs +1 -1
- package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs +1 -1
- 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 +75 -50
- package/common/src/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/common/src/functions/private-wallet/emporium.swap.helpers.d.ts +0 -1
- package/common/src/functions/private-wallet/emporium.swap.helpers.mjs +34 -76
- package/common/src/functions/private-wallet/index.cjs +1 -1
- package/common/src/functions/private-wallet/index.d.ts +0 -1
- package/common/src/functions/private-wallet/index.mjs +0 -1
- package/common/src/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/common/src/functions/snarkjs/common.snarkjs.d.ts +3 -4
- package/common/src/functions/snarkjs/common.snarkjs.mjs +97 -62
- package/common/src/functions/snarkjs/constant.cjs +1 -1
- package/common/src/functions/snarkjs/constant.d.ts +183 -144
- package/common/src/functions/snarkjs/constant.mjs +183 -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 +69 -57
- 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.d.ts +4 -1
- package/common/src/functions/snarkjs/constructSolanaZkProof.mjs +63 -62
- package/common/src/functions/snarkjs/constructTxEnclave.cjs +1 -0
- package/common/src/functions/snarkjs/constructTxEnclave.d.ts +32 -0
- package/common/src/functions/snarkjs/constructTxEnclave.mjs +162 -0
- 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/fetchTronInsertionSiblings.cjs +1 -0
- package/common/src/functions/snarkjs/fetchTronInsertionSiblings.d.ts +7 -0
- package/common/src/functions/snarkjs/fetchTronInsertionSiblings.mjs +13 -0
- 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 +41 -31
- package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.cjs +1 -1
- package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.d.ts +1 -1
- package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.mjs +7 -7
- 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/generateZkProof.cjs +1 -1
- package/common/src/functions/snarkjs/generateZkProof.d.ts +1 -1
- package/common/src/functions/snarkjs/generateZkProof.mjs +9 -16
- 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 +12 -0
- package/common/src/functions/snarkjs/signedMessageHash.mjs +23 -3
- package/common/src/functions/snarkjs/verifySignedEnclaveResponse.cjs +1 -0
- package/common/src/functions/snarkjs/verifySignedEnclaveResponse.d.ts +1 -0
- package/common/src/functions/snarkjs/verifySignedEnclaveResponse.mjs +11 -0
- package/common/src/functions/utils/addresses.cjs +1 -1
- package/common/src/functions/utils/addresses.d.ts +1 -1
- package/common/src/functions/utils/addresses.mjs +13 -12
- package/common/src/functions/utils/bridge-flow.utils.d.ts +1 -1
- package/common/src/functions/utils/buildClaimableDepositPlan.d.ts +3 -2
- package/common/src/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -1
- package/common/src/functions/utils/convertEmporiumOpToCallInfo.mjs +5 -10
- package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
- package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.mjs +1 -1
- package/common/src/functions/utils/deposit-claimable.utils.cjs +1 -1
- package/common/src/functions/utils/deposit-claimable.utils.d.ts +1 -1
- package/common/src/functions/utils/deposit-claimable.utils.mjs +3 -1
- package/common/src/functions/utils/enclave-utxo-storage.cjs +1 -1
- package/common/src/functions/utils/enclave-utxo-storage.d.ts +3 -0
- package/common/src/functions/utils/enclave-utxo-storage.mjs +1 -1
- 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 +32 -28
- package/common/src/functions/utils/formatter.d.ts +1 -0
- 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/getUtxosFromReceipt.utils.cjs +1 -1
- package/common/src/functions/utils/getUtxosFromReceipt.utils.mjs +6 -6
- package/common/src/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
- package/common/src/functions/utils/getUtxosFromReceiptSolana.mjs +17 -18
- package/common/src/functions/utils/index.cjs +1 -1
- package/common/src/functions/utils/index.d.ts +7 -3
- package/common/src/functions/utils/index.mjs +16 -11
- 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/process.utils.cjs +1 -1
- package/common/src/functions/utils/process.utils.d.ts +0 -1
- package/common/src/functions/utils/process.utils.mjs +2 -11
- package/common/src/functions/utils/publicBalance.utils.cjs +1 -1
- package/common/src/functions/utils/publicBalance.utils.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/transfer-claimable.utils.cjs +1 -1
- package/common/src/functions/utils/transfer-claimable.utils.mjs +2 -2
- package/common/src/functions/utils/tron.utils.cjs +1 -1
- package/common/src/functions/utils/tron.utils.d.ts +5 -14
- package/common/src/functions/utils/tron.utils.mjs +91 -142
- 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/utils/waasStamp.cjs +1 -0
- package/common/src/functions/utils/waasStamp.d.ts +5 -0
- package/common/src/functions/utils/waasStamp.mjs +2 -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 +5 -12
- package/common/src/functions/web3/events/getInputUtxoAndBalance.mjs +50 -61
- package/common/src/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
- package/common/src/functions/web3/events/getInputUtxosEnclave.d.ts +4 -3
- package/common/src/functions/web3/events/getInputUtxosEnclave.mjs +34 -25
- package/common/src/functions/web3/events/getShieldedBalance.cjs +1 -1
- package/common/src/functions/web3/events/getShieldedBalance.d.ts +2 -2
- package/common/src/functions/web3/events/getShieldedBalance.mjs +89 -85
- package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +9 -6
- 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/submitProof.cjs +1 -0
- package/common/src/functions/web3/functionCalls/submitProof.d.ts +5 -0
- package/common/src/functions/web3/functionCalls/submitProof.mjs +26 -0
- package/common/src/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -1
- package/common/src/functions/web3/functionCalls/transactCallDirectTron.d.ts +7 -3
- package/common/src/functions/web3/functionCalls/transactCallDirectTron.mjs +81 -53
- package/common/src/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/common/src/functions/web3/functionCalls/transactCallRelayer.d.ts +6 -11
- package/common/src/functions/web3/functionCalls/transactCallRelayer.mjs +4 -2
- package/common/src/functions/web3/getContractMetadata.cjs +1 -1
- package/common/src/functions/web3/getContractMetadata.mjs +1 -1
- package/common/src/functions/web3/getTokenHolder.cjs +1 -1
- package/common/src/functions/web3/getTokenHolder.mjs +3 -2
- package/common/src/functions/web3/index.cjs +1 -1
- package/common/src/functions/web3/index.d.ts +0 -3
- package/common/src/functions/web3/index.mjs +0 -3
- package/common/src/functions/web3/lifiAPI.cjs +1 -1
- package/common/src/functions/web3/lifiAPI.mjs +1 -1
- 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 +7 -4
- package/common/src/providers/WagmiProviderAdapter.cjs +1 -1
- package/common/src/providers/WagmiProviderAdapter.d.ts +0 -1
- package/common/src/providers/WagmiProviderAdapter.mjs +0 -4
- package/common/src/types/API.types.d.ts +0 -4
- package/common/src/types/WeeklyAnalytics.types.d.ts +1 -26
- package/common/src/types/activities.types.cjs +1 -1
- package/common/src/types/activities.types.d.ts +0 -9
- package/common/src/types/activities.types.mjs +1 -1
- package/common/src/types/admin.types.cjs +1 -1
- package/common/src/types/admin.types.d.ts +3 -1
- package/common/src/types/admin.types.mjs +1 -1
- package/common/src/types/bridging-tx.types.d.ts +8 -0
- package/common/src/types/cache.types.cjs +1 -1
- package/common/src/types/cache.types.d.ts +3 -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 +32 -27
- package/common/src/types/circom-data.types.mjs +1 -1
- package/common/src/types/commitments.types.d.ts +2 -0
- 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/dashboard-transaction.types.d.ts +3 -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 +8 -27
- 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 +4 -8
- 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 +12 -29
- package/common/src/types/hinkal.types.mjs +12 -20
- package/common/src/types/index.cjs +1 -1
- package/common/src/types/index.d.ts +5 -5
- package/common/src/types/index.mjs +1 -1
- package/common/src/types/near-intents.types.d.ts +1 -0
- package/common/src/types/new-rewards.type.d.ts +0 -70
- package/common/src/types/offscreen.types.cjs +1 -1
- package/common/src/types/offscreen.types.d.ts +0 -1
- package/common/src/types/offscreen.types.mjs +1 -1
- package/common/src/types/pay-activities.types.d.ts +3 -0
- 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/remote-proof.types.d.ts +0 -6
- package/common/src/types/remote-tx-build.types.d.ts +242 -0
- package/common/src/types/scheduled-transactions.types.d.ts +3 -0
- package/common/src/types/snark.types.d.ts +1 -3
- package/common/src/types/solana.types.d.ts +7 -0
- package/common/src/types/tenderly.api.types.d.ts +70 -0
- package/common/src/types/token.types.cjs +1 -1
- package/common/src/types/token.types.mjs +1 -3
- package/common/src/types/transact.types.cjs +1 -0
- package/common/src/types/transact.types.d.ts +53 -0
- package/common/src/types/transact.types.mjs +6 -0
- 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-CxZzSALU.js +2 -0
- package/common/src/webworker/package.json +12 -12
- 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-swwPYw6e.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/index.cjs +1 -1
- package/index.mjs +1 -1
- package/internal/swapApi.cjs +1 -1
- package/internal/swapApi.d.ts +3 -3
- package/internal/swapApi.mjs +22 -25
- package/package.json +12 -12
- package/services/Hinkal.cjs +1 -1
- package/services/Hinkal.d.ts +4 -5
- package/services/Hinkal.mjs +11 -14
- package/types/IHinkal.d.ts +4 -5
- package/types/swap.types.d.ts +3 -20
- 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/callOdosAPI.cjs +0 -1
- package/common/src/API/callOdosAPI.d.ts +0 -63
- package/common/src/API/callOdosAPI.mjs +0 -18
- package/common/src/API/callOneInchAPI.cjs +0 -1
- package/common/src/API/callOneInchAPI.d.ts +0 -18
- package/common/src/API/callOneInchAPI.mjs +0 -13
- 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/rewards.constants.d.ts +0 -15
- 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/externalABIs/IQuoterV2.json.cjs +0 -1
- package/common/src/externalABIs/IQuoterV2.json.mjs +0 -203
- package/common/src/externalABIs/ISwapRouter.json.cjs +0 -1
- package/common/src/externalABIs/ISwapRouter.json.mjs +0 -537
- package/common/src/externalABIs/IUniswapV3Factory.json.cjs +0 -1
- package/common/src/externalABIs/IUniswapV3Factory.json.mjs +0 -188
- package/common/src/externalABIs/IUniswapV3Pool.json.cjs +0 -1
- package/common/src/externalABIs/IUniswapV3Pool.json.mjs +0 -938
- package/common/src/externalABIs/UniswapV2PoolAbi.json.cjs +0 -1
- package/common/src/externalABIs/UniswapV2PoolAbi.json.mjs +0 -78
- package/common/src/functions/pre-transaction/interaction-to-action.cjs +0 -1
- package/common/src/functions/pre-transaction/interaction-to-action.d.ts +0 -2
- package/common/src/functions/pre-transaction/interaction-to-action.mjs +0 -1
- package/common/src/functions/pre-transaction/recipientUtxoProcessing.cjs +0 -1
- package/common/src/functions/pre-transaction/recipientUtxoProcessing.d.ts +0 -3
- package/common/src/functions/pre-transaction/recipientUtxoProcessing.mjs +0 -32
- package/common/src/functions/private-wallet/opProducer.cjs +0 -1
- package/common/src/functions/private-wallet/opProducer.d.ts +0 -5
- package/common/src/functions/private-wallet/opProducer.mjs +0 -3
- package/common/src/functions/snarkjs/generateZkProofEnclave.cjs +0 -1
- package/common/src/functions/snarkjs/generateZkProofEnclave.d.ts +0 -5
- package/common/src/functions/snarkjs/generateZkProofEnclave.mjs +0 -27
- 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/functions/utils/get-signature-header.cjs +0 -1
- package/common/src/functions/utils/get-signature-header.d.ts +0 -5
- package/common/src/functions/utils/get-signature-header.mjs +0 -4
- package/common/src/functions/web3/odosAPI.cjs +0 -1
- package/common/src/functions/web3/odosAPI.d.ts +0 -5
- package/common/src/functions/web3/odosAPI.mjs +0 -35
- package/common/src/functions/web3/oneInchAPI.cjs +0 -1
- package/common/src/functions/web3/oneInchAPI.d.ts +0 -5
- package/common/src/functions/web3/oneInchAPI.mjs +0 -34
- package/common/src/functions/web3/uniswapAPI.cjs +0 -1
- package/common/src/functions/web3/uniswapAPI.d.ts +0 -16
- package/common/src/functions/web3/uniswapAPI.mjs +0 -60
- 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
|
@@ -33,9 +33,13 @@ var c = async (c, l, u, d, f, p, m, h, g, _) => {
|
|
|
33
33
|
depositAddress: r.depositAddress,
|
|
34
34
|
quote: r
|
|
35
35
|
};
|
|
36
|
-
})), S = m ?? await a(v, l, x[0].depositAddress), C = x.map((e) => e.amount), w = x.map((e) => e.depositAddress), T
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
})), S = m ?? await a(v, l, x[0].depositAddress), C = x.map((e) => e.amount), w = x.map((e) => e.depositAddress), T = {
|
|
37
|
+
chainId: f.destinationChainId === v ? void 0 : f.destinationChainId,
|
|
38
|
+
tokenAddress: f.destinationTokenAddress,
|
|
39
|
+
tokenAmounts: x.map((e) => e.quote.amountOut)
|
|
40
|
+
}, E;
|
|
41
|
+
return e(v) ? {depositTxHash: E} = await s(c, l, C, w, p, S, h, g, _, x.map((e) => e.destinationRecipient), T) : {depositTxHash: E} = await o(c, l, C, w, p, S, h, g, _, void 0, T), {
|
|
42
|
+
depositTxHash: E,
|
|
39
43
|
legs: x
|
|
40
44
|
};
|
|
41
45
|
};
|
|
@@ -6,4 +6,4 @@ export type PalEvmDepositPrepareResult = {
|
|
|
6
6
|
unsignedTx: ethers.TransactionRequest;
|
|
7
7
|
utxoAmounts: bigint[];
|
|
8
8
|
};
|
|
9
|
-
export declare const hinkalPalEvmDepositPrepare: (hinkal: IHinkal,
|
|
9
|
+
export declare const hinkalPalEvmDepositPrepare: (hinkal: IHinkal, token: ERC20Token, recipientAmounts: bigint[], feeStructure: FeeStructure, orderId: string) => Promise<PalEvmDepositPrepareResult>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { Types as TronWebTypes } from 'tronweb';
|
|
1
2
|
import { IHinkal } from './IHinkal';
|
|
2
3
|
import { ERC20Token } from '../../types';
|
|
3
4
|
import { FeeStructure } from '../../types/hinkal.types';
|
|
4
|
-
import { Types as TronWebTypes } from 'tronweb';
|
|
5
5
|
export type PalTronDepositPrepareResult = {
|
|
6
6
|
unsignedTx: TronWebTypes.Transaction;
|
|
7
7
|
utxoAmounts: bigint[];
|
|
8
8
|
};
|
|
9
|
-
export declare const hinkalPalTronDepositPrepare: (hinkal: IHinkal,
|
|
9
|
+
export declare const hinkalPalTronDepositPrepare: (hinkal: IHinkal, token: ERC20Token, recipientAmounts: bigint[], feeStructure: FeeStructure, orderId: string) => Promise<PalTronDepositPrepareResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/caseInsensitive.utils.cjs`),n=require(`../../
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/caseInsensitive.utils.cjs`),n=require(`../../crypto/poseidon.cjs`),r=require(`../../error-handling/error-codes.constants.cjs`),i=require(`../../functions/web3/etherFunctions.cjs`),a=require(`../../functions/utils/addresses.cjs`),o=require(`../../types/external-action.types.cjs`),s=require(`../../types/admin.types.cjs`),c=require(`../../types/transact.types.cjs`);require(`../../error-handling/index.cjs`);const l=require(`../../functions/pre-transaction/constructAdminData.cjs`),u=require(`../AccountActions/AccountActions.cjs`),d=require(`../../functions/pre-transaction/getFeeStructure.cjs`);require(`../../functions/pre-transaction/index.cjs`);const f=require(`../../functions/private-wallet/emporium.helpers.cjs`),p=require(`./hinkalTransact.cjs`),m=require(`../../functions/utils/involves-permit2-op.cjs`),h=require(`../../functions/utils/convertEmporiumOpToCallInfo.cjs`),g=require(`../../functions/pre-transaction/merge-with-fee-structure.cjs`),_=require(`../../functions/pre-transaction/merge-with-fee-structure-emporium.cjs`),v=require(`./handleAutoDepositBack.cjs`);var y=async(y,b,x,S,C,w,T,E,D,O,k,A=!1,j,M,N)=>{if(N&&!a.isValidPrivateAddress(N.recipientInfo))throw Error(r.transactionErrorCodes.RECIPIENT_FORMAT_INCORRECT);if(T.length>0&&!E)throw Error(`Subaccount is required for private wallet transactions`);let P=x.map(e=>e.erc20TokenAddress),F=await y.getEthereumAddressByChain(b),I=E?u.AccountActions.getAddressFromSubAccount(b,E):void 0,{contractData:L}=e.networkRegistry[b],{emporiumAddress:R}=L;if(!R)throw Error(`No Emporium Address Provided`);let z=O??await d.getFeeStructure(b,D,P,o.ExternalActionId.Emporium,w.map(e=>h.convertEmporiumOpToCallInfo(e,I??``,b)));for(I?await _.mergeWithFeeStructureEmporium(y,b,I,w,P,S,z,T.find(e=>t.caseInsensitiveEqual(e.token.erc20TokenAddress,z.feeToken))?.amount??0n):await g.mergeWithFeeStructure(b,P,S,z);C.length<P.length;)C.push(!1);let B=k??await y.getRandomRelay(b,!0);if(!B)throw Error(r.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let V=E?u.AccountActions.getPrivateKeyFromSubAccount(b,E):void 0,H=e.getOnchainChainId(b),U=V?u.AccountActions.getSignerAddressFromPrivateKey(H,V):void 0,W=i.randomBigInt(31),G=y.generateProofRemotely?await f.encodeEmporiumMetadata(b,R,V,w,n.poseidonFunction(W),U):void 0,K=await f.getAuthorizationDataIfNeeded(b,V),q=m.uniswapWorkaround(w),J=l.constructAdminData(M,b,T.map(e=>e.token.erc20TokenAddress),T.map(e=>e.amount),F,M===s.AdminTransactionType.PublicSwap?T.map(({token:e})=>e):void 0),Y,X=await p.hinkalTransact(y,{chainId:b,erc20Addresses:P,amountChanges:S,externalAddress:R,externalActionId:o.ExternalActionId.Emporium,externalActionMetadata:G,onChainCreation:C,feeStructure:z,relay:B,messageSeed:W,recipientAddress:N?[N.recipientInfo]:void 0,recipientAmounts:N?[P.map(e=>t.caseInsensitiveEqual(e,N.token.erc20TokenAddress)?N.amount:0n)]:void 0,subAccountPrivateKey:V,emporiumOps:w,onTxSubmitLocally:e=>{Y=e},submit:{mode:c.SubmitMode.Relayer,adminData:J,authorizationData:K,withUniswapWorkAround:q}});return A&&E&&v.handleAutoDepositBack(y,b,I,E,z.feeToken,j,T,Y),X};exports.hinkalPrivateWallet=y;
|
|
@@ -1,48 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { caseInsensitiveEqual as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { AdminTransactionType as a } from "../../types/admin.types.mjs";
|
|
1
|
+
import { getOnchainChainId as e, networkRegistry as t } from "../../constants/chains.constants.mjs";
|
|
2
|
+
import { caseInsensitiveEqual as n } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
3
|
+
import { poseidonFunction as r } from "../../crypto/poseidon.mjs";
|
|
4
|
+
import { transactionErrorCodes as i } from "../../error-handling/error-codes.constants.mjs";
|
|
5
|
+
import { randomBigInt as a } from "../../functions/web3/etherFunctions.mjs";
|
|
7
6
|
import { isValidPrivateAddress as o } from "../../functions/utils/addresses.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { ExternalActionId as s } from "../../types/external-action.types.mjs";
|
|
8
|
+
import { AdminTransactionType as c } from "../../types/admin.types.mjs";
|
|
9
|
+
import { SubmitMode as l } from "../../types/transact.types.mjs";
|
|
10
10
|
import "../../error-handling/index.mjs";
|
|
11
|
-
import { constructAdminData as
|
|
12
|
-
import { AccountActions as
|
|
13
|
-
import { recipientUtxoProcessing as d } from "../../functions/pre-transaction/recipientUtxoProcessing.mjs";
|
|
11
|
+
import { constructAdminData as u } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
12
|
+
import { AccountActions as d } from "../AccountActions/AccountActions.mjs";
|
|
14
13
|
import { getFeeStructure as f } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
15
14
|
import "../../functions/pre-transaction/index.mjs";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { transactCallRelayer as _ } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
15
|
+
import { encodeEmporiumMetadata as p, getAuthorizationDataIfNeeded as m } from "../../functions/private-wallet/emporium.helpers.mjs";
|
|
16
|
+
import { hinkalTransact as h } from "./hinkalTransact.mjs";
|
|
17
|
+
import { uniswapWorkaround as g } from "../../functions/utils/involves-permit2-op.mjs";
|
|
18
|
+
import { convertEmporiumOpToCallInfo as _ } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
21
19
|
import { mergeWithFeeStructure as v } from "../../functions/pre-transaction/merge-with-fee-structure.mjs";
|
|
22
20
|
import { mergeWithFeeStructureEmporium as y } from "../../functions/pre-transaction/merge-with-fee-structure-emporium.mjs";
|
|
23
21
|
import { handleAutoDepositBack as b } from "./handleAutoDepositBack.mjs";
|
|
24
22
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalPrivateWallet.ts
|
|
25
|
-
var x = async (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
23
|
+
var x = async (x, S, C, w, T, E, D, O, k, A, j, M = !1, N, P, F) => {
|
|
24
|
+
if (F && !o(F.recipientInfo)) throw Error(i.RECIPIENT_FORMAT_INCORRECT);
|
|
25
|
+
if (D.length > 0 && !O) throw Error("Subaccount is required for private wallet transactions");
|
|
26
|
+
let I = C.map((e) => e.erc20TokenAddress), L = await x.getEthereumAddressByChain(S), R = O ? d.getAddressFromSubAccount(S, O) : void 0, { contractData: z } = t[S], { emporiumAddress: B } = z;
|
|
27
|
+
if (!B) throw Error("No Emporium Address Provided");
|
|
28
|
+
let V = A ?? await f(S, k, I, s.Emporium, E.map((e) => _(e, R ?? "", S)));
|
|
29
|
+
for (R ? await y(x, S, R, E, I, w, V, D.find((e) => n(e.token.erc20TokenAddress, V.feeToken))?.amount ?? 0n) : await v(S, I, w, V); T.length < I.length;) T.push(!1);
|
|
30
|
+
let H = j ?? await x.getRandomRelay(S, !0);
|
|
31
|
+
if (!H) throw Error(i.RELAYER_NOT_AVAILABLE);
|
|
32
|
+
let U = O ? d.getPrivateKeyFromSubAccount(S, O) : void 0, W = e(S), G = U ? d.getSignerAddressFromPrivateKey(W, U) : void 0, K = a(31), q = x.generateProofRemotely ? await p(S, B, U, E, r(K), G) : void 0, J = await m(S, U), Y = g(E), X = u(P, S, D.map((e) => e.token.erc20TokenAddress), D.map((e) => e.amount), L, P === c.PublicSwap ? D.map(({ token: e }) => e) : void 0), Z, Q = await h(x, {
|
|
33
|
+
chainId: S,
|
|
34
|
+
erc20Addresses: I,
|
|
35
|
+
amountChanges: w,
|
|
36
|
+
externalAddress: B,
|
|
37
|
+
externalActionId: s.Emporium,
|
|
38
|
+
externalActionMetadata: q,
|
|
39
|
+
onChainCreation: T,
|
|
40
|
+
feeStructure: V,
|
|
41
|
+
relay: H,
|
|
42
|
+
messageSeed: K,
|
|
43
|
+
recipientAddress: F ? [F.recipientInfo] : void 0,
|
|
44
|
+
recipientAmounts: F ? [I.map((e) => n(e, F.token.erc20TokenAddress) ? F.amount : 0n)] : void 0,
|
|
45
|
+
subAccountPrivateKey: U,
|
|
46
|
+
emporiumOps: E,
|
|
47
|
+
onTxSubmitLocally: (e) => {
|
|
48
|
+
Z = e;
|
|
49
|
+
},
|
|
50
|
+
submit: {
|
|
51
|
+
mode: l.Relayer,
|
|
52
|
+
adminData: X,
|
|
53
|
+
authorizationData: J,
|
|
54
|
+
withUniswapWorkAround: Y
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return M && O && b(x, S, R, O, V.feeToken, N, D, Z), Q;
|
|
46
58
|
};
|
|
47
59
|
//#endregion
|
|
48
|
-
export {
|
|
60
|
+
export { x as hinkalPrivateWallet };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../types/hinkal.types.cjs`),r=require(`../../functions/utils/caseInsensitive.utils.cjs`),i=require(`../../types/ethereum-network.types.cjs`),a=require(`../../functions/utils/token-check.utils.cjs`),o=require(`../../functions/pre-transaction/constructAdminData.cjs`),s=require(`../../functions/utils/getContractAddress.cjs`),c=require(`../../functions/web3/functionCalls/constructBatchCall.cjs`),l=require(`../../functions/web3/functionCalls/waitForErc20Approvals.cjs`),u=require(`../../API/admin-calls.cjs`),d=require(`../../functions/utils/getRecipientInfoFromUserKeys.cjs`),f=require(`./hinkalProoflessDeposit.utils.cjs`);var p=async(p,m,h,g,_,v=!1,y=n.zeroProoflessFeeStructure,b=``,x,S=!1)=>{let C=a.validateAndGetChainId(m);if(e.isTronLike(C))throw Error(`Proofless deposit is not supported on Tron`);let w=await p.getEthereumAddressByChain(C),T=g??m.map(()=>d.getStealthAddressStructureFromUserKeys(p.userKeys));if(T.length!==m.length)throw Error(`Stealth address structures length must be equal to erc20 tokens length`);if(f.assertNoDuplicateStealthAddressStructures(T),g&&!_)throw Error(`recipientEncryptionKeysOverride is required whenever stealthAddressStructuresOverride is provided`);if(_&&_.length!==m.length)throw Error(`recipientEncryptionKeysOverride length must be equal to erc20 tokens length`);let E=f.buildProoflessEncryptedOutputs(T,_??f.getOwnRecipientEncryptionKeys(p.userKeys,m.length)),D=y.feeAmount>0n,O=D?p.getContractWithSigner(C,i.ContractType.HinkalWrapperContract):p.getContractWithSigner(C,i.ContractType.HinkalContract),k=D?[m.map(({erc20TokenAddress:e})=>e),h,T,E,v,y,b]:[m.map(({erc20TokenAddress:e})=>e),h,T,E,v,b],A=r.caseInsensitiveEqual(y.feeToken,t.zeroAddress),j=m.reduce((e,n,i)=>r.caseInsensitiveEqual(n.erc20TokenAddress,t.zeroAddress)?e+h[i]:e,0n)+(A?y.feeAmount:0n);if(S)return O.prooflessDeposit.populateTransaction(...k,{value:j>0n?j:void 0});let M=p.getProviderAdapter(C),N=f.aggregateAmountsForApproval(!A&&y.feeAmount>0n?[...m,{erc20TokenAddress:y.feeToken,chainId:C}]:m,!A&&y.feeAmount>0n?[...h,y.feeAmount]:h),P=N.filter(({token:e,balance:n})=>!r.caseInsensitiveEqual(e.erc20TokenAddress,t.zeroAddress)&&n>0n),F;if(P.length>0&&await M.supportsBatchCall?.(C)&&M.sendBatchCallsTransaction){let e=c.buildApproveAndProoflessDepositCalls(P.map(({token:e})=>e.erc20TokenAddress),P.map(({balance:e})=>e),s.getContractAddress(O),O,m.map(({erc20TokenAddress:e})=>e),h,T,E,v,D?y:void 0,b,j);F=await M.sendBatchCallsTransaction(C,e)}else{await f.approveTokens(p,C,s.getContractAddress(O),N);let e=await p.getEthereumAddressByChain(C),t=N.map(({token:e,balance:t})=>({tokenAddress:e.erc20TokenAddress,requiredAmount:t}));await l.waitForErc20Approvals(p,C,e,s.getContractAddress(O),t),F=await O.prooflessDeposit(...k,{value:j>0n?j:void 0})}let I=F.hash;return u.emitTxPublicData(o.constructAdminData(x,C,m.map(({erc20TokenAddress:e})=>e),h,w)),I};exports.hinkalProoflessDeposit=p;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
|
-
import { Types as TronWebTypes } from 'tronweb';
|
|
3
2
|
import { ERC20Token } from '../../types/token.types';
|
|
4
3
|
import { IHinkal } from './IHinkal';
|
|
5
4
|
import { StealthAddressStructure } from '../../types/circom-data.types';
|
|
5
|
+
import { ProoflessFeeStructure } from '../../types/hinkal.types';
|
|
6
6
|
import { AdminTransactionType } from '../../types/admin.types';
|
|
7
|
-
export declare const hinkalProoflessDeposit: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], stealthAddressStructuresOverride?: StealthAddressStructure[], action?: AdminTransactionType, returnTxData?: boolean) => Promise<string | ethers.TransactionRequest
|
|
8
|
-
export declare const hinkalProoflessDepositWithPublicFee: (hinkal: IHinkal, chainId: number, erc20Token: ERC20Token, amounts: bigint[], stealthAddressStructures: StealthAddressStructure[], feeAmount: bigint, action?: AdminTransactionType) => Promise<string>;
|
|
7
|
+
export declare const hinkalProoflessDeposit: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], stealthAddressStructuresOverride?: StealthAddressStructure[], recipientEncryptionKeysOverride?: string[], createBlockedUtxos?: boolean, feeStructure?: ProoflessFeeStructure, orderId?: string, action?: AdminTransactionType, returnTxData?: boolean) => Promise<string | ethers.TransactionRequest>;
|
|
@@ -1,123 +1,58 @@
|
|
|
1
|
-
import { isTronLike as e
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { emitTxPublicData as y } from "../../API/admin-calls.mjs";
|
|
15
|
-
import { aggregateAmountsForApproval as b, approveTokens as x, approveTronTokens as S, assertNoDuplicateStealthAddressStructures as C } from "./hinkalProoflessDeposit.utils.mjs";
|
|
16
|
-
import { hinkalEvmProoflessDepositViaWrapper as w, hinkalTronProoflessDepositViaWrapper as T } from "./hinkalProoflessDepositViaWrapper.mjs";
|
|
1
|
+
import { isTronLike as e } from "../../constants/chains.constants.mjs";
|
|
2
|
+
import { zeroAddress as t } from "../../constants/protocol.constants.mjs";
|
|
3
|
+
import { zeroProoflessFeeStructure as n } from "../../types/hinkal.types.mjs";
|
|
4
|
+
import { caseInsensitiveEqual as r } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
5
|
+
import { ContractType as i } from "../../types/ethereum-network.types.mjs";
|
|
6
|
+
import { validateAndGetChainId as a } from "../../functions/utils/token-check.utils.mjs";
|
|
7
|
+
import { constructAdminData as o } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
8
|
+
import { getContractAddress as s } from "../../functions/utils/getContractAddress.mjs";
|
|
9
|
+
import { buildApproveAndProoflessDepositCalls as c } from "../../functions/web3/functionCalls/constructBatchCall.mjs";
|
|
10
|
+
import { waitForErc20Approvals as l } from "../../functions/web3/functionCalls/waitForErc20Approvals.mjs";
|
|
11
|
+
import { emitTxPublicData as u } from "../../API/admin-calls.mjs";
|
|
12
|
+
import { getStealthAddressStructureFromUserKeys as d } from "../../functions/utils/getRecipientInfoFromUserKeys.mjs";
|
|
13
|
+
import { aggregateAmountsForApproval as f, approveTokens as p, assertNoDuplicateStealthAddressStructures as m, buildProoflessEncryptedOutputs as h, getOwnRecipientEncryptionKeys as g } from "./hinkalProoflessDeposit.utils.mjs";
|
|
17
14
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalProoflessDeposit.ts
|
|
18
|
-
var
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
e.H0.toString(),
|
|
36
|
-
e.H1.toString()
|
|
37
|
-
])
|
|
38
|
-
]), x);
|
|
39
|
-
}
|
|
40
|
-
let { transaction: T } = await p.transactionBuilder.triggerSmartContract(g, "prooflessDeposit(address[],uint256[],uint256[],(uint256,uint256,uint256,uint256)[])", {
|
|
41
|
-
feeLimit: n,
|
|
42
|
-
callValue: x > 0n ? Number(x) : 0
|
|
43
|
-
}, [
|
|
44
|
-
{
|
|
45
|
-
type: "address[]",
|
|
46
|
-
value: y
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
type: "uint256[]",
|
|
50
|
-
value: a.map(String)
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: "uint256[]",
|
|
54
|
-
value: b.map(String)
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
type: "tuple(uint256,uint256,uint256,uint256)[]",
|
|
58
|
-
value: w.map((e) => [
|
|
59
|
-
e.extraRandomization,
|
|
60
|
-
e.stealthAddress,
|
|
61
|
-
e.H0,
|
|
62
|
-
e.H1
|
|
63
|
-
])
|
|
64
|
-
}
|
|
65
|
-
], _);
|
|
66
|
-
if (f) return T;
|
|
67
|
-
await S(p, _, g, C), await v(p, _, g, Array.from(C.entries()).map(([e, t]) => ({
|
|
68
|
-
tokenAddress: e,
|
|
69
|
-
requiredAmount: t
|
|
70
|
-
}))), await h(r, g, "prooflessDeposit", t[r].contractData.hinkalABI, [
|
|
15
|
+
var _ = async (_, v, y, b, x, S = !1, C = n, w = "", T, E = !1) => {
|
|
16
|
+
let D = a(v);
|
|
17
|
+
if (e(D)) throw Error("Proofless deposit is not supported on Tron");
|
|
18
|
+
let O = await _.getEthereumAddressByChain(D), k = b ?? v.map(() => d(_.userKeys));
|
|
19
|
+
if (k.length !== v.length) throw Error("Stealth address structures length must be equal to erc20 tokens length");
|
|
20
|
+
if (m(k), b && !x) throw Error("recipientEncryptionKeysOverride is required whenever stealthAddressStructuresOverride is provided");
|
|
21
|
+
if (x && x.length !== v.length) throw Error("recipientEncryptionKeysOverride length must be equal to erc20 tokens length");
|
|
22
|
+
let A = h(k, x ?? g(_.userKeys, v.length)), j = C.feeAmount > 0n, M = j ? _.getContractWithSigner(D, i.HinkalWrapperContract) : _.getContractWithSigner(D, i.HinkalContract), N = j ? [
|
|
23
|
+
v.map(({ erc20TokenAddress: e }) => e),
|
|
24
|
+
y,
|
|
25
|
+
k,
|
|
26
|
+
A,
|
|
27
|
+
S,
|
|
28
|
+
C,
|
|
29
|
+
w
|
|
30
|
+
] : [
|
|
31
|
+
v.map(({ erc20TokenAddress: e }) => e),
|
|
71
32
|
y,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return O;
|
|
86
|
-
}, D = async (t, n, o, s, c, l = !1) => {
|
|
87
|
-
let u = d(n), h = e(u), v = await t.getEthereumAddressByChain(u), S = s ?? n.map(() => p(t.userKeys));
|
|
88
|
-
if (S.length !== n.length) throw Error("Stealth address structures length must be equal to erc20 tokens length");
|
|
89
|
-
C(S);
|
|
90
|
-
let w;
|
|
91
|
-
if (h) {
|
|
92
|
-
let e = await E(t, u, n, o, S, l);
|
|
93
|
-
if (l) return e;
|
|
94
|
-
w = e;
|
|
33
|
+
k,
|
|
34
|
+
A,
|
|
35
|
+
S,
|
|
36
|
+
w
|
|
37
|
+
], P = r(C.feeToken, t), F = v.reduce((e, n, i) => r(n.erc20TokenAddress, t) ? e + y[i] : e, 0n) + (P ? C.feeAmount : 0n);
|
|
38
|
+
if (E) return M.prooflessDeposit.populateTransaction(...N, { value: F > 0n ? F : void 0 });
|
|
39
|
+
let I = _.getProviderAdapter(D), L = f(!P && C.feeAmount > 0n ? [...v, {
|
|
40
|
+
erc20TokenAddress: C.feeToken,
|
|
41
|
+
chainId: D
|
|
42
|
+
}] : v, !P && C.feeAmount > 0n ? [...y, C.feeAmount] : y), R = L.filter(({ token: e, balance: n }) => !r(e.erc20TokenAddress, t) && n > 0n), z;
|
|
43
|
+
if (R.length > 0 && await I.supportsBatchCall?.(D) && I.sendBatchCallsTransaction) {
|
|
44
|
+
let e = c(R.map(({ token: e }) => e.erc20TokenAddress), R.map(({ balance: e }) => e), s(M), M, v.map(({ erc20TokenAddress: e }) => e), y, k, A, S, j ? C : void 0, w, F);
|
|
45
|
+
z = await I.sendBatchCallsTransaction(D, e);
|
|
95
46
|
} else {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (l) return e.prooflessDeposit.populateTransaction(...s);
|
|
103
|
-
let c = t.getProviderAdapter(u), d = b(n, o), f = n.reduce((e, t, n) => i(t.erc20TokenAddress, r) ? e + o[n] : e, 0n), p = d.filter(({ token: e, balance: t }) => !i(e.erc20TokenAddress, r) && t > 0n), h;
|
|
104
|
-
if (p.length > 0 && await c.supportsBatchCall?.(u) && c.sendBatchCallsTransaction) {
|
|
105
|
-
let t = g(p.map(({ token: e }) => e.erc20TokenAddress), p.map(({ balance: e }) => e), m(e), e, ...s, f);
|
|
106
|
-
h = await c.sendBatchCallsTransaction(u, t);
|
|
107
|
-
} else {
|
|
108
|
-
await x(t, u, m(e), d);
|
|
109
|
-
let n = await t.getEthereumAddressByChain(u), r = d.map(({ token: e, balance: t }) => ({
|
|
110
|
-
tokenAddress: e.erc20TokenAddress,
|
|
111
|
-
requiredAmount: t
|
|
112
|
-
}));
|
|
113
|
-
await _(t, u, n, m(e), r), h = await e.prooflessDeposit(...s, { value: f > 0n ? f : void 0 });
|
|
114
|
-
}
|
|
115
|
-
w = h.hash;
|
|
47
|
+
await p(_, D, s(M), L);
|
|
48
|
+
let e = await _.getEthereumAddressByChain(D), t = L.map(({ token: e, balance: t }) => ({
|
|
49
|
+
tokenAddress: e.erc20TokenAddress,
|
|
50
|
+
requiredAmount: t
|
|
51
|
+
}));
|
|
52
|
+
await l(_, D, e, s(M), t), z = await M.prooflessDeposit(...N, { value: F > 0n ? F : void 0 });
|
|
116
53
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
let l = a.map(() => i), u = i.erc20TokenAddress;
|
|
120
|
-
return e(r) ? T(n, r, u, s, l, a, o, c) : t[r]?.contractData?.hinkalWrapperAddress ? w(n, r, u, s, l, a, o, c) : await D(n, l, a, o, c, !0);
|
|
54
|
+
let B = z.hash;
|
|
55
|
+
return u(o(T, D, v.map(({ erc20TokenAddress: e }) => e), y, O)), B;
|
|
121
56
|
};
|
|
122
57
|
//#endregion
|
|
123
|
-
export {
|
|
58
|
+
export { _ as hinkalProoflessDeposit };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/protocol.constants.cjs`),t=require(`../../functions/utils/caseInsensitive.utils.cjs`),n=require(
|
|
1
|
+
const e=require(`../../constants/protocol.constants.cjs`),t=require(`../../functions/utils/caseInsensitive.utils.cjs`),n=require(`../crypto-keys/keys.cjs`),r=require(`../../types/ethereum-network.types.cjs`),i=require(`../../functions/utils/token-check.utils.cjs`),a=require(`../crypto-keys/encryptDecryptUtxo.cjs`);require(`../../externalABIs/index.cjs`);const o=require(`../../functions/utils/tx-confirmation.utils.cjs`);var s=(e,t)=>{if(e.length!==t.length)throw Error(`stealthAddressStructures and recipientEncryptionKeys must have equal length`);return e.map((e,n)=>{let r=t[n];if(!r)throw Error(`Missing encryptionKey for proofless deposit output ${n}: required so the enclave can attribute this UTXO to its owner`);return`0x${Buffer.from(a.encryptEncryptionKeyAndStealthAddress(r,e.stealthAddress)).toString(`hex`)}`})},c=(e,t)=>{let r=n.UserKeys.getEncryptionKeyPair(e.getShieldedPrivateKey()).publicKey;return Array.from({length:t},()=>r)},l=(e,t)=>{let n=[],r=0;for(let a=0;a<e.length;a+=1){let o=!1;for(let s=0;s<r;s+=1)if(i.isSameERC20Token(n[s].token,e[a])){n[s].balance+=t[a],o=!0;break}o||(n[r]={token:e[a],balance:t[a]},r+=1)}return n},u=async(n,i,a,s)=>{for(let c=0;c<s.length;c+=1)t.caseInsensitiveEqual(s[c].token.erc20TokenAddress,e.zeroAddress)||await o.waitForEthereumTransactionConfirmation(i,(await n.getContractWithSigner(i,r.ContractType.ERC20Contract,s[c].token.erc20TokenAddress).approve(a,s[c].balance)).hash)},d=e=>{let t=new Set;e.forEach(({H0x:e,stealthAddress:n})=>{let r=`${e.toString()}:${n.toString()}`;if(t.has(r))throw Error(`Duplicate randomization and stealth address pair detected in stealthAddressStructures`);t.add(r)})};exports.aggregateAmountsForApproval=l,exports.approveTokens=u,exports.assertNoDuplicateStealthAddressStructures=d,exports.buildProoflessEncryptedOutputs=s,exports.getOwnRecipientEncryptionKeys=c;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ERC20Token, TokenBalance } from '../../types/token.types';
|
|
2
2
|
import { StealthAddressStructure } from '../../types/circom-data.types';
|
|
3
|
+
import { UserKeys } from '../crypto-keys/keys';
|
|
3
4
|
import { IHinkal } from './IHinkal';
|
|
5
|
+
export declare const buildProoflessEncryptedOutputs: (stealthAddressStructures: StealthAddressStructure[], recipientEncryptionKeys: string[]) => string[];
|
|
6
|
+
export declare const getOwnRecipientEncryptionKeys: (userKeys: UserKeys, count: number) => string[];
|
|
4
7
|
export declare const aggregateAmountsForApproval: (erc20Tokens: ERC20Token[], amounts: bigint[]) => TokenBalance[];
|
|
5
8
|
export declare const approveTokens: (hinkal: IHinkal, chainId: number, spenderAddress: string, tokensWithBalances: TokenBalance[]) => Promise<void>;
|
|
6
9
|
export declare const approveTronTokens: (tronWeb: any, ethereumAddress: string, spenderAddress: string, tokensNeedingApproval: Map<string, bigint>) => Promise<void>;
|
|
@@ -1,51 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { caseInsensitiveEqual as
|
|
1
|
+
import { zeroAddress as e } from "../../constants/protocol.constants.mjs";
|
|
2
|
+
import { caseInsensitiveEqual as t } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
3
|
+
import { UserKeys as n } from "../crypto-keys/keys.mjs";
|
|
3
4
|
import { ContractType as r } from "../../types/ethereum-network.types.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
5
|
+
import { isSameERC20Token as i } from "../../functions/utils/token-check.utils.mjs";
|
|
6
|
+
import { encryptEncryptionKeyAndStealthAddress as a } from "../crypto-keys/encryptDecryptUtxo.mjs";
|
|
7
|
+
import "../../externalABIs/index.mjs";
|
|
6
8
|
import { waitForEthereumTransactionConfirmation as o } from "../../functions/utils/tx-confirmation.utils.mjs";
|
|
7
9
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.ts
|
|
8
10
|
var s = (e, t) => {
|
|
11
|
+
if (e.length !== t.length) throw Error("stealthAddressStructures and recipientEncryptionKeys must have equal length");
|
|
12
|
+
return e.map((e, n) => {
|
|
13
|
+
let r = t[n];
|
|
14
|
+
if (!r) throw Error(`Missing encryptionKey for proofless deposit output ${n}: required so the enclave can attribute this UTXO to its owner`);
|
|
15
|
+
return `0x${Buffer.from(a(r, e.stealthAddress)).toString("hex")}`;
|
|
16
|
+
});
|
|
17
|
+
}, c = (e, t) => {
|
|
18
|
+
let r = n.getEncryptionKeyPair(e.getShieldedPrivateKey()).publicKey;
|
|
19
|
+
return Array.from({ length: t }, () => r);
|
|
20
|
+
}, l = (e, t) => {
|
|
9
21
|
let n = [], r = 0;
|
|
10
|
-
for (let
|
|
22
|
+
for (let a = 0; a < e.length; a += 1) {
|
|
11
23
|
let o = !1;
|
|
12
|
-
for (let s = 0; s < r; s += 1) if (
|
|
13
|
-
n[s].balance += t[
|
|
24
|
+
for (let s = 0; s < r; s += 1) if (i(n[s].token, e[a])) {
|
|
25
|
+
n[s].balance += t[a], o = !0;
|
|
14
26
|
break;
|
|
15
27
|
}
|
|
16
28
|
o || (n[r] = {
|
|
17
|
-
token: e[
|
|
18
|
-
balance: t[
|
|
29
|
+
token: e[a],
|
|
30
|
+
balance: t[a]
|
|
19
31
|
}, r += 1);
|
|
20
32
|
}
|
|
21
33
|
return n;
|
|
22
|
-
},
|
|
23
|
-
for (let c = 0; c < s.length; c += 1)
|
|
24
|
-
},
|
|
25
|
-
let o = Array.from(a.entries());
|
|
26
|
-
for (let a = 0; a < o.length; a += 1) {
|
|
27
|
-
let [s, c] = o[a], l = await t.contract(i, s).allowance(n, r).call({ from: n });
|
|
28
|
-
if (BigInt(String(l)) < c) {
|
|
29
|
-
let { transaction: i } = await t.transactionBuilder.triggerSmartContract(s, "approve(address,uint256)", { feeLimit: e }, [{
|
|
30
|
-
type: "address",
|
|
31
|
-
value: r
|
|
32
|
-
}, {
|
|
33
|
-
type: "uint256",
|
|
34
|
-
value: c.toString()
|
|
35
|
-
}], n), a = await t.trx.sign(i), o = await t.trx.sendRawTransaction(a);
|
|
36
|
-
if (!o.result) {
|
|
37
|
-
let e = o.code ?? "UNKNOWN", t = o.message ? Buffer.from(o.message, "hex").toString() : "no message";
|
|
38
|
-
throw Error(`Tron token approval failed: ${e} - ${t}`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}, u = (e) => {
|
|
34
|
+
}, u = async (n, i, a, s) => {
|
|
35
|
+
for (let c = 0; c < s.length; c += 1) t(s[c].token.erc20TokenAddress, e) || await o(i, (await n.getContractWithSigner(i, r.ERC20Contract, s[c].token.erc20TokenAddress).approve(a, s[c].balance)).hash);
|
|
36
|
+
}, d = (e) => {
|
|
43
37
|
let t = /* @__PURE__ */ new Set();
|
|
44
|
-
e.forEach(({
|
|
38
|
+
e.forEach(({ H0x: e, stealthAddress: n }) => {
|
|
45
39
|
let r = `${e.toString()}:${n.toString()}`;
|
|
46
40
|
if (t.has(r)) throw Error("Duplicate randomization and stealth address pair detected in stealthAddressStructures");
|
|
47
41
|
t.add(r);
|
|
48
42
|
});
|
|
49
43
|
};
|
|
50
44
|
//#endregion
|
|
51
|
-
export {
|
|
45
|
+
export { l as aggregateAmountsForApproval, u as approveTokens, d as assertNoDuplicateStealthAddressStructures, s as buildProoflessEncryptedOutputs, c as getOwnRecipientEncryptionKeys };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../error-handling/error-codes.constants.cjs`),t=require(`../../
|
|
1
|
+
const e=require(`../../error-handling/error-codes.constants.cjs`),t=require(`../../functions/utils/addresses.cjs`),n=require(`../../types/external-action.types.cjs`),r=require(`../../functions/utils/token-check.utils.cjs`),i=require(`../../functions/pre-transaction/getVolatileTransferAmount.cjs`),a=require(`../AccountActions/AccountActions.cjs`),o=require(`../../functions/pre-transaction/getFeeStructure.cjs`),s=require(`../../functions/private-wallet/emporium.helpers.cjs`),c=require(`../../functions/utils/convertEmporiumOpToCallInfo.cjs`);var l=async(l,u,d,f,p,m,h,g)=>{if(!h)throw Error(`hinkalProxyToPrivate: subAccount should be provided`);if(!p)throw Error(`Fee token is required in hinkalProxyToPrivate`);if(!t.isValidPrivateAddress(f))throw Error(e.transactionErrorCodes.RECIPIENT_FORMAT_INCORRECT);let _=r.validateAndGetChainId(u),v=a.AccountActions.getAddressFromSubAccount(_,h);if(!v)throw Error(`Public account address is not available`);let y=u.map(e=>e.erc20TokenAddress),b=await i.modifyVolatileTokenAmountChanges(_,u,d,v),x=s.createTransaferEmporiumOpsBatch(l,_,y,b),S=m??await o.getFeeStructure(_,p,y,n.ExternalActionId.Emporium,x.map(e=>c.convertEmporiumOpToCallInfo(e,v,_))),C=u.map((e,t)=>({token:e,amount:-1n*b[t]}));return l.actionPrivateWallet(_,[u[0]],[0n],[!1],x,C,h,p,S,void 0,void 0,void 0,g,{recipientInfo:f,amount:b[0],token:u[0]})};exports.hinkalProxyToPrivate=l;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { transactionErrorCodes as e } from "../../error-handling/error-codes.constants.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { isValidPrivateAddress as t } from "../../functions/utils/addresses.mjs";
|
|
3
|
+
import { ExternalActionId as n } from "../../types/external-action.types.mjs";
|
|
4
4
|
import { validateAndGetChainId as r } from "../../functions/utils/token-check.utils.mjs";
|
|
5
5
|
import { modifyVolatileTokenAmountChanges as i } from "../../functions/pre-transaction/getVolatileTransferAmount.mjs";
|
|
6
6
|
import { AccountActions as a } from "../AccountActions/AccountActions.mjs";
|
|
7
7
|
import { getFeeStructure as o } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { createTransaferEmporiumOpsBatch as s } from "../../functions/private-wallet/emporium.helpers.mjs";
|
|
9
|
+
import { convertEmporiumOpToCallInfo as c } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
10
10
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalProxyToPrivate.ts
|
|
11
11
|
var l = async (l, u, d, f, p, m, h, g) => {
|
|
12
12
|
if (!h) throw Error("hinkalProxyToPrivate: subAccount should be provided");
|
|
13
13
|
if (!p) throw Error("Fee token is required in hinkalProxyToPrivate");
|
|
14
|
-
if (!
|
|
14
|
+
if (!t(f)) throw Error(e.RECIPIENT_FORMAT_INCORRECT);
|
|
15
15
|
let _ = r(u), v = a.getAddressFromSubAccount(_, h);
|
|
16
16
|
if (!v) throw Error("Public account address is not available");
|
|
17
|
-
let y = u.map((e) => e.erc20TokenAddress), b = await i(_, u, d, v), x =
|
|
17
|
+
let y = u.map((e) => e.erc20TokenAddress), b = await i(_, u, d, v), x = s(l, _, y, b), S = m ?? await o(_, p, y, n.Emporium, x.map((e) => c(e, v, _))), C = u.map((e, t) => ({
|
|
18
18
|
token: e,
|
|
19
19
|
amount: -1n * b[t]
|
|
20
20
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`../../functions/web3/etherFunctions.cjs`),i=require(`../crypto-keys/keys.cjs`),a=require(`../../functions/utils/time.utils.cjs`),o=require(`../utxo/Utxo.cjs`),s=require(`../../types/external-action.types.cjs`);require(`../../types/index.cjs`);const c=require(`../../functions/utils/token-check.utils.cjs`),l=require(`../../functions/snarkjs/constructTxEnclave.cjs`),u=require(`../../functions/pre-transaction/getFeeStructure.cjs`),d=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),f=require(`../../functions/snarkjs/constructSolanaZkProof.cjs`);var p=async(e,n,r,i,a,o,s,c,u,d,f)=>{let{jobId:p,signedMessageHash:m}=await l.prepareSolanaTxEnclaveCall(e,{chainId:n,mintAddresses:[r],amountChanges:i,relayAddress:a,recipient:t.solanaNativeAddress,signer:a,functionName:`transfer`,accounts:o,relayerFee:u,variableRate:0n,hinkalInstructions:[],remainingAccounts:[],recipientAddress:s,recipientAmounts:[c],inputCommitments:[f]},d),{R8:h,S:g}=d.signEddsa(BigInt(m));return l.finalizeSolanaTxEnclaveCallRelay(p,{R8:h,S:g},n)},m=async(l,m,h,g,_)=>{let v=c.validateAndGetChainId([m]),y=m.erc20TokenAddress;if(h.getTokenAddress(v)!==y)throw Error(`Off-chain UTXO token mismatch`);let b=_?new i.UserKeys(_):new i.UserKeys(h.nullifyingKey,h.nullifyingKey);if(!h.nullifyingKey&&!_)throw Error(`Claimable UTXO nullifyingKey is missing`);let x=b.getShieldedPrivateKey();if(h.nullifyingKey&&h.nullifyingKey!==x)throw Error(`Claimable UTXO key mismatch`);let{originalDeployer:S}=e.networkRegistry[v].contractData;if(!S)throw Error(`missing data`);let C=o.Utxo.createFrom(h,{nullifyingKey:x}),w=g??await u.getFeeStructure(v,y,[y],s.ExternalActionId.Transact,void 0,void 0,{mintTo:y,nullifierCount:1,rootInsertCount:2});if(w.feeToken!==y)throw Error(`Claim fee token mismatch: fee must be paid from claimed UTXO token`);let T=w.variableRate>0n?w.variableRate:t.HINKAL_PRIVATE_SEND_VARIABLE_RATE;if(C.amount<=w.flatFee)throw Error(n.transactionErrorCodes.INSUFFICIENT_FUNDS_TO_TRANSACT);let E=C.amount-w.flatFee,D=E*T/10000n,O=E-D;if(O<=0n)throw Error(n.transactionErrorCodes.RECIPIENT_AMOUNT_INVALID);let k=w.flatFee+D,A=l.getRecipientInfo(),[j,M,N,,,P]=A.split(`,`);if(!M||!N||!j||!P)throw Error(`Invalid recipient info`);let F=a.getCurrentTimeInSeconds().toString(),I=new o.Utxo({amount:0n,erc20TokenAddress:C.erc20TokenAddress,mintAddress:C.mintAddress,nullifyingKey:b.getShieldedPrivateKey(),spendingPublicKey:b.getSpendingKeyPair().pubSpendingBJJPoint}),L=new o.Utxo({amount:0n,erc20TokenAddress:C.erc20TokenAddress,mintAddress:C.mintAddress,nullifyingKey:b.getShieldedPrivateKey(),timeStamp:F,spendingPublicKey:b.getSpendingKeyPair().pubSpendingBJJPoint}),R=new o.Utxo({amount:O,erc20TokenAddress:C.erc20TokenAddress,mintAddress:C.mintAddress,timeStamp:F,H0:[BigInt(M),BigInt(N)],stealthAddress:j,encryptionKey:P}),z=[C,I],B=[L,R],V=await l.getRandomRelay(v,!0);if(!V)throw Error(n.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let H={recipient:V,mint:y===`11111111111111111111111111111111`?void 0:y};if(l.generateProofRemotely)return p(l,v,y,[-(O+k)],V,H,A,O,k,b,C.getCommitment());let U=i.UserKeys.findCorrectRandomization(r.randomBigInt(31),b.getShieldedPrivateKey()),W={tokenNumber:1,nullifierAmount:z.length,outputAmount:B.length},{proofAArr:G,proofBArr:K,proofCArr:q,publicInputsArr:J,commitmentValidationData:Y,rootHashHinkalIndex:X,encryptedOutputs:Z}=await f.constructSolanaZkProof(l.merkleTreeHinkalByChain[v],b,[y],[z],[B],U,k,0n,t.solanaNativeAddress,V,W,void 0,v);return d.solanaTransactCallRelayer({chainId:v,relayAddress:V,functionName:`transfer`,args:{proofAArr:G,proofBArr:K,proofCArr:q,publicInputsArr:J,encryptedOutputs:Z,relayerFee:k.toString(),dimensions:W,rootHashIndex:X.toString()},accounts:H,commitmentValidationData:Y})};exports.hinkalSolanaClaimUtxo=m;
|