@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
|
@@ -1,120 +1,128 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PAY_SEND_VARIABLE_RATE as
|
|
3
|
-
import { caseInsensitiveEqual as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { getOnchainChainId as e, networkRegistry as t } from "../../constants/chains.constants.mjs";
|
|
2
|
+
import { PAY_SEND_VARIABLE_RATE as n, zeroAddress as r } from "../../constants/protocol.constants.mjs";
|
|
3
|
+
import { caseInsensitiveEqual as i } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
4
|
+
import { poseidonFunction as a } from "../../crypto/poseidon.mjs";
|
|
5
|
+
import { transactionErrorCodes as o } from "../../error-handling/error-codes.constants.mjs";
|
|
6
|
+
import { randomBigInt as s } from "../../functions/web3/etherFunctions.mjs";
|
|
7
|
+
import { hashEthereumAddress as c, hashString as l } from "../../functions/utils/addresses.mjs";
|
|
8
|
+
import { ExternalActionId as u } from "../../types/external-action.types.mjs";
|
|
9
|
+
import { DepositAndWithdrawPhase as d } from "../../types/scheduled-transactions.types.mjs";
|
|
10
|
+
import { SubmitMode as f } from "../../types/transact.types.mjs";
|
|
9
11
|
import "../../types/index.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { getFeeStructure as
|
|
16
|
-
import { waitForDepositedUtxosInMerkleTree as
|
|
17
|
-
import {
|
|
18
|
-
import { convertEmporiumOpToCallInfo as v } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
19
|
-
import { calculateModifiedFeeStructure as y } from "../../functions/utils/fees.utils.mjs";
|
|
20
|
-
import "../../functions/utils/index.mjs";
|
|
21
|
-
import { createLifiBridgeOps as b, getAuthorizationDataIfNeeded as x } from "../../functions/private-wallet/emporium.helpers.mjs";
|
|
22
|
-
import { constructZkProof as S } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
|
|
12
|
+
import { API as p } from "../../API/API.mjs";
|
|
13
|
+
import { validateAndGetChainId as m } from "../../functions/utils/token-check.utils.mjs";
|
|
14
|
+
import { getErc20TokenFromAPI as h } from "../../functions/utils/erc20tokenFunctions.mjs";
|
|
15
|
+
import { constructAdminData as g } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
16
|
+
import { AccountActions as _ } from "../AccountActions/AccountActions.mjs";
|
|
17
|
+
import { getFeeStructure as v } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
18
|
+
import { waitForDepositedUtxosInMerkleTree as y } from "../../functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs";
|
|
19
|
+
import { createLifiBridgeOps as b, encodeEmporiumMetadata as x, getAuthorizationDataIfNeeded as S } from "../../functions/private-wallet/emporium.helpers.mjs";
|
|
23
20
|
import { transactCallRelayerBatch as C } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
21
|
+
import { hinkalTransact as w } from "./hinkalTransact.mjs";
|
|
22
|
+
import { SWAP_ROUTER_ADDRESSES as T } from "../../constants/addresses.constants.mjs";
|
|
23
|
+
import { safeUpdateDepositAndWithdrawStatus as E } from "../../API/deposit-and-withdraw-status-calls.mjs";
|
|
24
|
+
import { hinkalDepositOnChainUtxos as D } from "./hinkalDepositOnChainUtxos.mjs";
|
|
25
|
+
import { convertEmporiumOpToCallInfo as O } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
26
|
+
import { calculateGrossAmountWithFee as k } from "../../functions/utils/fees.utils.mjs";
|
|
27
|
+
import "../../functions/utils/index.mjs";
|
|
26
28
|
import "../../functions/index.mjs";
|
|
27
29
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalDepositAndBridge.ts
|
|
28
|
-
var
|
|
29
|
-
if (
|
|
30
|
-
let
|
|
31
|
-
if (!
|
|
32
|
-
let
|
|
33
|
-
if (!
|
|
34
|
-
let
|
|
35
|
-
if (!
|
|
36
|
-
let
|
|
37
|
-
for (let
|
|
38
|
-
let
|
|
39
|
-
await
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
30
|
+
var A = async (n, c, l, m, h, v, y, D, O, k, A) => {
|
|
31
|
+
if (m.length === 0) throw Error("No recipients to bridge");
|
|
32
|
+
let j = l.erc20TokenAddress, { contractData: M } = t[c], { emporiumAddress: N } = M;
|
|
33
|
+
if (!N) throw Error("No Emporium Address");
|
|
34
|
+
let P = T[u.Lifi][c];
|
|
35
|
+
if (!P) throw Error(`LIFI not configured for chain ${c}`);
|
|
36
|
+
let F = await n.getRandomRelay(c);
|
|
37
|
+
if (!F) throw Error(o.RELAYER_NOT_AVAILABLE);
|
|
38
|
+
let I = await n.getEthereumAddressByChain(c), L = n.generateProofRemotely, R = L ? 5 : 1, z = [];
|
|
39
|
+
for (let t = 0; t < m.length; t += R) {
|
|
40
|
+
let o = m.slice(t, t + R), l = await Promise.all(o.map(async ({ utxo: t, nativeUtxo: o, bridgeAmount: l, quote: d, temporarySubAccount: m, recipientAddress: y, destinationChainId: C, destinationTokenAddress: T }) => {
|
|
41
|
+
await p.addTemporaryWalletNonce(c, v, m.index);
|
|
42
|
+
let E = i(j, r), D = d.nativeFee > 0n && !E, O = [j], A = [-t.amount], M = [!1], R = [[t]];
|
|
43
|
+
D && o && (O.push(r), A.push(-o.amount), M.push(!1), R.push([o]));
|
|
44
|
+
let z = b(n, c, m.ethAddress, P, j, t.amount, l, d), B = g(k, c, O, [-t.amount], I), [V, H] = await Promise.all([(async () => {
|
|
45
|
+
let t = s(31), i = L ? await x(c, N, m.privateKey, z, a(t), _.getSignerAddressFromPrivateKey(e(c), m.privateKey)) : void 0;
|
|
46
|
+
return w(n, {
|
|
47
|
+
chainId: c,
|
|
48
|
+
erc20Addresses: O,
|
|
49
|
+
amountChanges: A,
|
|
50
|
+
externalAddress: N,
|
|
51
|
+
externalActionId: u.Emporium,
|
|
52
|
+
externalActionMetadata: i,
|
|
53
|
+
onChainCreation: M,
|
|
54
|
+
feeStructure: h,
|
|
55
|
+
relay: F ?? r,
|
|
56
|
+
messageSeed: t,
|
|
57
|
+
inputUtxos: R,
|
|
58
|
+
useBlockedUtxos: !0,
|
|
59
|
+
subAccountPrivateKey: m.privateKey,
|
|
60
|
+
emporiumOps: z,
|
|
61
|
+
submit: { mode: f.ProofOnly }
|
|
60
62
|
});
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
let I = b(t, l, f.ethAddress, j, O, e.amount, a, c), L = await y(l, u, a, p), R = m(E, l, C, [-e.amount], N), [{ zkCallData: z, circomData: B, dimData: V, commitmentValidationData: H }, U] = await Promise.all([S(t.merkleTreeHinkalByChain[l], k, F, t.userKeys, s.Emporium, A, I, t.generateProofRemotely, L, M ?? n, l, T, void 0, void 0, f.privateKey), x(l, f.privateKey)]);
|
|
63
|
+
})(), S(c, m.privateKey)]), { zkCallData: U, circomData: W, dimData: G, commitmentValidationData: K, tronProofSignature: q } = V;
|
|
64
64
|
return {
|
|
65
|
-
zkCallData:
|
|
66
|
-
dimData:
|
|
67
|
-
circomData:
|
|
68
|
-
commitmentValidationData:
|
|
69
|
-
authorizationData:
|
|
70
|
-
recipientAddress:
|
|
71
|
-
adminData:
|
|
65
|
+
zkCallData: U,
|
|
66
|
+
dimData: G,
|
|
67
|
+
circomData: W,
|
|
68
|
+
commitmentValidationData: K,
|
|
69
|
+
authorizationData: H,
|
|
70
|
+
recipientAddress: y,
|
|
71
|
+
adminData: B,
|
|
72
|
+
tronProofSignature: q,
|
|
73
|
+
destinationChainId: C,
|
|
74
|
+
destinationTokenAddress: T,
|
|
75
|
+
destinationTokenAmount: d.expectedAmount.toString()
|
|
72
76
|
};
|
|
73
77
|
}));
|
|
74
|
-
|
|
78
|
+
z.push(...l);
|
|
75
79
|
}
|
|
76
|
-
await
|
|
77
|
-
id:
|
|
78
|
-
chainId:
|
|
79
|
-
hashedEthereumAddress:
|
|
80
|
-
phase:
|
|
80
|
+
await E({
|
|
81
|
+
id: y,
|
|
82
|
+
chainId: c,
|
|
83
|
+
hashedEthereumAddress: v,
|
|
84
|
+
phase: d.BEFORE_SCHEDULE_WITHDRAW
|
|
81
85
|
});
|
|
82
|
-
let
|
|
83
|
-
return await
|
|
84
|
-
id:
|
|
85
|
-
chainId:
|
|
86
|
-
hashedEthereumAddress:
|
|
87
|
-
phase:
|
|
88
|
-
scheduleId:
|
|
89
|
-
}),
|
|
90
|
-
},
|
|
91
|
-
let
|
|
92
|
-
if (!
|
|
93
|
-
let
|
|
94
|
-
if (
|
|
86
|
+
let B = await C(c, z, v, D, O, A);
|
|
87
|
+
return await E({
|
|
88
|
+
id: y,
|
|
89
|
+
chainId: c,
|
|
90
|
+
hashedEthereumAddress: v,
|
|
91
|
+
phase: d.AFTER_SCHEDULE_WITHDRAW,
|
|
92
|
+
scheduleId: B
|
|
93
|
+
}), B;
|
|
94
|
+
}, j = async (e, t, a, o, s, d, f, p, g = !0) => {
|
|
95
|
+
let _ = t.erc20TokenAddress, x = m([t]), S = p ? l(p) : void 0, C = c(await e.getEthereumAddressByChain(x)), w = T[u.Lifi][x];
|
|
96
|
+
if (!w) throw Error("LIFI router not configured");
|
|
97
|
+
let E, j = i(_, r);
|
|
98
|
+
if (s) E = s;
|
|
95
99
|
else {
|
|
96
|
-
let
|
|
97
|
-
|
|
100
|
+
let t = a[0], r = j ? t.bridgeAmount + t.quote.nativeFee : t.bridgeAmount, i = b(e, x, t.temporarySubAccount.ethAddress, w, _, r, t.bridgeAmount, t.quote).map((e) => O(e, t.temporarySubAccount.ethAddress, x));
|
|
101
|
+
E = await v(x, _, [_], u.Emporium, i, n);
|
|
98
102
|
}
|
|
99
|
-
let
|
|
100
|
-
feeToken:
|
|
103
|
+
let M = {
|
|
104
|
+
feeToken: E.feeToken,
|
|
101
105
|
flatFee: 0n,
|
|
102
106
|
variableRate: 0n
|
|
103
|
-
},
|
|
104
|
-
if (
|
|
105
|
-
let t = await
|
|
107
|
+
}, N = a.reduce((e, t) => e + t.quote.nativeFee, 0n) > 0n && !i(_, r), P = a.map((e) => k(j ? e.bridgeAmount + e.quote.nativeFee : e.bridgeAmount, E)), F = a.map((e) => e.recipientAddress), { userDepositedUtxos: I, statusId: L, depositTxHash: R } = await D(e, x, t, P, F, M, C, g), z = [];
|
|
108
|
+
if (N) {
|
|
109
|
+
let t = await h(x, r);
|
|
106
110
|
if (!t) throw Error("No native token");
|
|
107
|
-
let { userDepositedUtxos:
|
|
108
|
-
|
|
111
|
+
let { userDepositedUtxos: n } = await D(e, x, t, a.map((e) => k(e.quote.nativeFee, {
|
|
112
|
+
feeToken: E.feeToken,
|
|
113
|
+
flatFee: 0n,
|
|
114
|
+
variableRate: E.variableRate
|
|
115
|
+
})), F, M, C, g);
|
|
116
|
+
z = n;
|
|
109
117
|
}
|
|
110
|
-
return await
|
|
111
|
-
depositTxHash:
|
|
112
|
-
scheduleId: await
|
|
118
|
+
return await y(e, x, [...I, ...z]), {
|
|
119
|
+
depositTxHash: R,
|
|
120
|
+
scheduleId: await A(e, x, t, a.map((e, t) => ({
|
|
113
121
|
...e,
|
|
114
|
-
utxo:
|
|
115
|
-
nativeUtxo:
|
|
116
|
-
})),
|
|
122
|
+
utxo: I[t].utxo,
|
|
123
|
+
nativeUtxo: N ? z[t]?.utxo : void 0
|
|
124
|
+
})), E, C, L, o, d, f, S)
|
|
117
125
|
};
|
|
118
126
|
};
|
|
119
127
|
//#endregion
|
|
120
|
-
export {
|
|
128
|
+
export { j as hinkalDepositAndBridge };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../functions/utils/caseInsensitive.utils.cjs`),r=require(`../../error-handling/error-codes.constants.cjs`),i=require(`../../functions/utils/
|
|
1
|
+
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../functions/utils/caseInsensitive.utils.cjs`),r=require(`../../error-handling/error-codes.constants.cjs`),i=require(`../utxo/Utxo.cjs`),a=require(`../../functions/utils/addresses.cjs`),o=require(`../../functions/utils/tron.utils.cjs`),s=require(`../../types/external-action.types.cjs`),c=require(`../../types/scheduled-transactions.types.cjs`),l=require(`../../types/transact.types.cjs`);require(`../../types/index.cjs`);const u=require(`../../functions/utils/token-check.utils.cjs`),d=require(`../crypto-keys/encryptDecryptUtxo.cjs`),f=require(`../../functions/snarkjs/common.snarkjs.cjs`),p=require(`../../functions/pre-transaction/constructAdminData.cjs`),m=require(`../../functions/snarkjs/constructTxEnclave.cjs`),h=require(`../../functions/pre-transaction/getFeeStructure.cjs`),g=require(`../../functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs`),_=require(`../../functions/web3/functionCalls/transactCallDirectTron.cjs`),v=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),y=require(`./hinkalTransact.cjs`),b=require(`../../functions/utils/tx-confirmation.utils.cjs`),x=require(`../../API/deposit-and-withdraw-status-calls.cjs`),S=require(`./hinkalDepositOnChainUtxos.cjs`),C=require(`./hinkalTronDepositToSelf.cjs`);require(`../../functions/index.cjs`);let w=require(`ethers`);var T=async(e,t,n,r,i,a,s,l=!0)=>{let u=n.erc20TokenAddress,p=r.map(e=>e+a.flatFee),h=p.reduce((e,t)=>e+t,0n),g=(await x.updateDepositAndWithdrawStatus({chainId:t,hashedEthereumAddress:s,phase:c.DepositAndWithdrawPhase.BEFORE_DEPOSIT})).id??void 0,{jobId:v,signedMessageHash:y}=await m.prepareTxEnclaveCall(e,{chainId:t,erc20Addresses:[u],amountChanges:[h],externalAddress:o.addressToHexFormat(await e.getEthereumAddressByChain(t)),selfOutputAmounts:p,createBlockedUtxos:!0}),{R8:S,S:C}=e.userKeys.signEddsa(BigInt(y)),{zkCallData:T,circomData:E,dimData:D,tronProofSignature:O}=await m.finalizeTxEnclaveCall(v,{R8:S,S:C}),k=f.deserializeCircomData(E),A=await _.transactCallDirectTron(e,t,h,n,T,k,D,void 0,void 0,l,O);await b.waitForEthereumTransactionConfirmation(t,A),await x.safeUpdateDepositAndWithdrawStatus({id:g,chainId:t,hashedEthereumAddress:s,phase:c.DepositAndWithdrawPhase.AFTER_DEPOSIT,depositTxHash:A});let j=k.encryptedOutputs?.[0];if(!j||j.length!==p.length)throw Error(`Enclave response missing encryptedOutputs for deposited UTXOs`);return{userDepositedUtxos:j.map((t,n)=>({recipientAddress:i[n],utxo:d.decryptUtxo(w.ethers.getBytes(t),e.userKeys)})),statusId:g,depositTxHash:A}},E=async(e,a,s,u,d,f,m,h,g,_,b,S)=>{if(u.length===0)throw Error(`userDepositedUtxos must not be empty`);let C=s.erc20TokenAddress,[w,T]=await Promise.all([e.getRandomRelay(a),e.getEthereumAddressByChain(a)]);if(!w)throw Error(r.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let E=e.generateProofRemotely?5:1,D=[],O=o.addressToHexFormat(T);for(let r=0;r<u.length;r+=E){let s=u.slice(r,r+E),c=await Promise.all(s.map(async({recipientAddress:s,utxo:c},u)=>{let f=r+u,m=o.addressToHexFormat(s),h=n.caseInsensitiveEqual(c.erc20TokenAddress,C)?c:i.Utxo.createFrom(c,{erc20TokenAddress:C}),g=p.constructAdminData(_,a,[C],[-c.amount],O),{zkCallData:v,circomData:b,dimData:x,commitmentValidationData:T,tronProofSignature:E}=await y.hinkalTransact(e,{chainId:a,erc20Addresses:[C],amountChanges:[-c.amount],externalAddress:m,feeStructure:d,relay:w??t.zeroAddress,inputUtxos:[[h]],useBlockedUtxos:!0,submit:{mode:l.SubmitMode.ProofOnly},skipLock:!0});return{zkCallData:v,dimData:x,circomData:b,commitmentValidationData:T,adminData:g,recipientAddress:s,tronProofSignature:E,destinationChainId:S?.chainId,destinationTokenAddress:S?.tokenAddress,destinationTokenAmount:S?.tokenAmounts?.[f]}}));D.push(...c)}await x.safeUpdateDepositAndWithdrawStatus({id:m,chainId:a,hashedEthereumAddress:f,phase:c.DepositAndWithdrawPhase.BEFORE_SCHEDULE_WITHDRAW});let k=await v.transactCallRelayerBatch(a,D,f,h,g,b);return await x.safeUpdateDepositAndWithdrawStatus({id:m,chainId:a,hashedEthereumAddress:f,phase:c.DepositAndWithdrawPhase.AFTER_SCHEDULE_WITHDRAW,scheduleId:k}),k},D=async(t,n,r,i,c,l,d,f,p,m=!0,_)=>{let v=u.validateAndGetChainId([n]),y=p?a.hashString(p):void 0,b=n.erc20TokenAddress,x=a.hashEthereumAddress(o.addressToHexFormat(await t.getEthereumAddressByChain(v))),w=l??await h.getFeeStructure(v,b,[b],s.ExternalActionId.Transact,[],10n),D=e.isTronLike(v),O=S.hinkalDepositOnChainUtxos;D&&(O=t.generateProofRemotely?T:C.hinkalTronDepositToSelf);let{userDepositedUtxos:k,statusId:A,depositTxHash:j}=await O(t,v,n,r,i,w,x,m);return await g.waitForDepositedUtxosInMerkleTree(t,v,k),{depositTxHash:j,scheduleId:await E(t,v,n,k,w,x,A,c,d,f,y,_)}};exports.hinkalDepositAndWithdraw=D;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IHinkal } from './IHinkal';
|
|
2
2
|
import { AdminTransactionType, DepositAndSendExtendedResult, ERC20Token, RecipientUtxo } from '../../types';
|
|
3
|
+
import { DestinationMetadata } from '../../types/bridging-tx.types';
|
|
3
4
|
import { FeeStructure } from '../../types/hinkal.types';
|
|
4
|
-
export declare const hinkalWithdrawBatch: (hinkal: IHinkal, chainId: number, erc20Token: ERC20Token, userDepositedUtxos: RecipientUtxo[],
|
|
5
|
+
export declare const hinkalWithdrawBatch: (hinkal: IHinkal, chainId: number, erc20Token: ERC20Token, userDepositedUtxos: RecipientUtxo[], feeStructure: FeeStructure, hashedEthereumAddress: string, statusId: string | undefined, txCompletionTime?: number, ref?: string, action?: AdminTransactionType, hashedDashboardAccountId?: string, destination?: DestinationMetadata) => Promise<string>;
|
|
5
6
|
export declare const hinkalDepositAndWithdraw: (hinkal: IHinkal, erc20Token: ERC20Token, recipientAmounts: bigint[], recipientAddresses: string[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, // Should be passed fee for only one withdraw transaction, multiplication happening in this function
|
|
6
|
-
ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, preEstimateGas?: boolean) => Promise<DepositAndSendExtendedResult>;
|
|
7
|
+
ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, preEstimateGas?: boolean, destination?: DestinationMetadata) => Promise<DepositAndSendExtendedResult>;
|
|
@@ -2,78 +2,119 @@ import { isTronLike as e } from "../../constants/chains.constants.mjs";
|
|
|
2
2
|
import { zeroAddress as t } from "../../constants/protocol.constants.mjs";
|
|
3
3
|
import { caseInsensitiveEqual as n } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
4
4
|
import { transactionErrorCodes as r } from "../../error-handling/error-codes.constants.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { Utxo as i } from "../utxo/Utxo.mjs";
|
|
6
|
+
import { hashEthereumAddress as a, hashString as o } from "../../functions/utils/addresses.mjs";
|
|
7
|
+
import { addressToHexFormat as s } from "../../functions/utils/tron.utils.mjs";
|
|
8
|
+
import { ExternalActionId as c } from "../../types/external-action.types.mjs";
|
|
9
|
+
import { DepositAndWithdrawPhase as l } from "../../types/scheduled-transactions.types.mjs";
|
|
10
|
+
import { SubmitMode as u } from "../../types/transact.types.mjs";
|
|
9
11
|
import "../../types/index.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { constructAdminData as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { transactCallRelayerBatch as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
12
|
+
import { validateAndGetChainId as d } from "../../functions/utils/token-check.utils.mjs";
|
|
13
|
+
import { decryptUtxo as f } from "../crypto-keys/encryptDecryptUtxo.mjs";
|
|
14
|
+
import { deserializeCircomData as p } from "../../functions/snarkjs/common.snarkjs.mjs";
|
|
15
|
+
import { constructAdminData as m } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
16
|
+
import { finalizeTxEnclaveCall as h, prepareTxEnclaveCall as g } from "../../functions/snarkjs/constructTxEnclave.mjs";
|
|
17
|
+
import { getFeeStructure as _ } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
18
|
+
import { waitForDepositedUtxosInMerkleTree as v } from "../../functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs";
|
|
19
|
+
import { transactCallDirectTron as y } from "../../functions/web3/functionCalls/transactCallDirectTron.mjs";
|
|
20
|
+
import { transactCallRelayerBatch as b } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
21
|
+
import { hinkalTransact as x } from "./hinkalTransact.mjs";
|
|
22
|
+
import { waitForEthereumTransactionConfirmation as S } from "../../functions/utils/tx-confirmation.utils.mjs";
|
|
23
|
+
import { safeUpdateDepositAndWithdrawStatus as C, updateDepositAndWithdrawStatus as w } from "../../API/deposit-and-withdraw-status-calls.mjs";
|
|
24
|
+
import { hinkalDepositOnChainUtxos as T } from "./hinkalDepositOnChainUtxos.mjs";
|
|
25
|
+
import { hinkalTronDepositToSelf as E } from "./hinkalTronDepositToSelf.mjs";
|
|
21
26
|
import "../../functions/index.mjs";
|
|
27
|
+
import { ethers as D } from "ethers";
|
|
22
28
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.ts
|
|
23
|
-
var
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
29
|
+
var O = async (e, t, n, r, i, a, o, c = !0) => {
|
|
30
|
+
let u = n.erc20TokenAddress, d = r.map((e) => e + a.flatFee), m = d.reduce((e, t) => e + t, 0n), _ = (await w({
|
|
31
|
+
chainId: t,
|
|
32
|
+
hashedEthereumAddress: o,
|
|
33
|
+
phase: l.BEFORE_DEPOSIT
|
|
34
|
+
})).id ?? void 0, { jobId: v, signedMessageHash: b } = await g(e, {
|
|
35
|
+
chainId: t,
|
|
36
|
+
erc20Addresses: [u],
|
|
37
|
+
amountChanges: [m],
|
|
38
|
+
externalAddress: s(await e.getEthereumAddressByChain(t)),
|
|
39
|
+
selfOutputAmounts: d,
|
|
40
|
+
createBlockedUtxos: !0
|
|
41
|
+
}), { R8: x, S: T } = e.userKeys.signEddsa(BigInt(b)), { zkCallData: E, circomData: O, dimData: k, tronProofSignature: A } = await h(v, {
|
|
42
|
+
R8: x,
|
|
43
|
+
S: T
|
|
44
|
+
}), j = p(O), M = await y(e, t, m, n, E, j, k, void 0, void 0, c, A);
|
|
45
|
+
await S(t, M), await C({
|
|
46
|
+
id: _,
|
|
47
|
+
chainId: t,
|
|
48
|
+
hashedEthereumAddress: o,
|
|
49
|
+
phase: l.AFTER_DEPOSIT,
|
|
50
|
+
depositTxHash: M
|
|
51
|
+
});
|
|
52
|
+
let N = j.encryptedOutputs?.[0];
|
|
53
|
+
if (!N || N.length !== d.length) throw Error("Enclave response missing encryptedOutputs for deposited UTXOs");
|
|
54
|
+
return {
|
|
55
|
+
userDepositedUtxos: N.map((t, n) => ({
|
|
56
|
+
recipientAddress: i[n],
|
|
57
|
+
utxo: f(D.getBytes(t), e.userKeys)
|
|
58
|
+
})),
|
|
59
|
+
statusId: _,
|
|
60
|
+
depositTxHash: M
|
|
61
|
+
};
|
|
62
|
+
}, k = async (e, a, o, c, d, f, p, h, g, _, v, y) => {
|
|
63
|
+
if (c.length === 0) throw Error("userDepositedUtxos must not be empty");
|
|
64
|
+
let S = o.erc20TokenAddress, [w, T] = await Promise.all([e.getRandomRelay(a), e.getEthereumAddressByChain(a)]);
|
|
65
|
+
if (!w) throw Error(r.RELAYER_NOT_AVAILABLE);
|
|
66
|
+
let E = e.generateProofRemotely ? 5 : 1, D = [], O = s(T);
|
|
67
|
+
for (let r = 0; r < c.length; r += E) {
|
|
68
|
+
let o = c.slice(r, r + E), l = await Promise.all(o.map(async ({ recipientAddress: o, utxo: c }, l) => {
|
|
69
|
+
let f = r + l, p = s(o), h = n(c.erc20TokenAddress, S) ? c : i.createFrom(c, { erc20TokenAddress: S }), g = m(_, a, [S], [-c.amount], O), { zkCallData: v, circomData: b, dimData: C, commitmentValidationData: T, tronProofSignature: E } = await x(e, {
|
|
70
|
+
chainId: a,
|
|
71
|
+
erc20Addresses: [S],
|
|
72
|
+
amountChanges: [-c.amount],
|
|
73
|
+
externalAddress: p,
|
|
74
|
+
feeStructure: d,
|
|
75
|
+
relay: w ?? t,
|
|
76
|
+
inputUtxos: [[h]],
|
|
77
|
+
useBlockedUtxos: !0,
|
|
78
|
+
submit: { mode: u.ProofOnly },
|
|
79
|
+
skipLock: !0
|
|
80
|
+
});
|
|
45
81
|
return {
|
|
46
|
-
zkCallData:
|
|
47
|
-
dimData:
|
|
48
|
-
circomData:
|
|
49
|
-
commitmentValidationData:
|
|
50
|
-
adminData:
|
|
51
|
-
recipientAddress:
|
|
52
|
-
tronProofSignature:
|
|
82
|
+
zkCallData: v,
|
|
83
|
+
dimData: C,
|
|
84
|
+
circomData: b,
|
|
85
|
+
commitmentValidationData: T,
|
|
86
|
+
adminData: g,
|
|
87
|
+
recipientAddress: o,
|
|
88
|
+
tronProofSignature: E,
|
|
89
|
+
destinationChainId: y?.chainId,
|
|
90
|
+
destinationTokenAddress: y?.tokenAddress,
|
|
91
|
+
destinationTokenAmount: y?.tokenAmounts?.[f]
|
|
53
92
|
};
|
|
54
93
|
}));
|
|
55
|
-
|
|
94
|
+
D.push(...l);
|
|
56
95
|
}
|
|
57
|
-
await
|
|
58
|
-
id:
|
|
59
|
-
chainId:
|
|
60
|
-
hashedEthereumAddress:
|
|
61
|
-
phase:
|
|
96
|
+
await C({
|
|
97
|
+
id: p,
|
|
98
|
+
chainId: a,
|
|
99
|
+
hashedEthereumAddress: f,
|
|
100
|
+
phase: l.BEFORE_SCHEDULE_WITHDRAW
|
|
62
101
|
});
|
|
63
|
-
let
|
|
64
|
-
return await
|
|
65
|
-
id:
|
|
66
|
-
chainId:
|
|
67
|
-
hashedEthereumAddress:
|
|
68
|
-
phase:
|
|
69
|
-
scheduleId:
|
|
70
|
-
}),
|
|
71
|
-
},
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
102
|
+
let k = await b(a, D, f, h, g, v);
|
|
103
|
+
return await C({
|
|
104
|
+
id: p,
|
|
105
|
+
chainId: a,
|
|
106
|
+
hashedEthereumAddress: f,
|
|
107
|
+
phase: l.AFTER_SCHEDULE_WITHDRAW,
|
|
108
|
+
scheduleId: k
|
|
109
|
+
}), k;
|
|
110
|
+
}, A = async (t, n, r, i, l, u, f, p, m, h = !0, g) => {
|
|
111
|
+
let y = d([n]), b = m ? o(m) : void 0, x = n.erc20TokenAddress, S = a(s(await t.getEthereumAddressByChain(y))), C = u ?? await _(y, x, [x], c.Transact, [], 10n), w = e(y), D = T;
|
|
112
|
+
w && (D = t.generateProofRemotely ? O : E);
|
|
113
|
+
let { userDepositedUtxos: A, statusId: j, depositTxHash: M } = await D(t, y, n, r, i, C, S, h);
|
|
114
|
+
return await v(t, y, A), {
|
|
115
|
+
depositTxHash: M,
|
|
116
|
+
scheduleId: await k(t, y, n, A, C, S, j, l, f, p, b, g)
|
|
76
117
|
};
|
|
77
118
|
};
|
|
78
119
|
//#endregion
|
|
79
|
-
export {
|
|
120
|
+
export { A as hinkalDepositAndWithdraw };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../
|
|
1
|
+
const e=require(`../../types/scheduled-transactions.types.cjs`);require(`../../types/index.cjs`);const t=require(`../../functions/utils/tx-confirmation.utils.cjs`),n=require(`../../functions/utils/getUtxosFromReceipt.utils.cjs`),r=require(`../../functions/utils/getRecipientInfoFromUserKeys.cjs`),i=require(`./hinkalProoflessDeposit.utils.cjs`),a=require(`./hinkalProoflessDeposit.cjs`),o=require(`../../API/deposit-and-withdraw-status-calls.cjs`);var s=async(s,c,l,u,d,f,p,m=!0)=>{let h=l.erc20TokenAddress,g=u.map(e=>e+f.flatFee),_=g.map(()=>l),v=g.map(()=>r.getStealthAddressStructureFromUserKeys(s.userKeys)),y=(await o.updateDepositAndWithdrawStatus({chainId:c,hashedEthereumAddress:p,phase:e.DepositAndWithdrawPhase.BEFORE_DEPOSIT})).id??void 0,b=await a.hinkalProoflessDeposit(s,_,g,v,i.getOwnRecipientEncryptionKeys(s.userKeys,g.length),!0);if(!b)throw Error(`Deposit transaction hash not found`);let x=await t.waitForEthereumTransactionConfirmation(c,b);await o.safeUpdateDepositAndWithdrawStatus({id:y,chainId:c,hashedEthereumAddress:p,phase:e.DepositAndWithdrawPhase.AFTER_DEPOSIT,depositTxHash:b});let S=n.getOnChainUtxosFromReceipt(x,s,c,h);if(S.length===0)throw Error(`No UTXOs found in deposit transaction. Check contract address and ABI.`);let C=[],w=[...S];return d.forEach((e,t)=>{let n=g[t],r=w.find(e=>e.amount===n);if(!r)throw Error(`Could not find newly created UTXO with amount ${n} for recipient ${e}.`);C.push({recipientAddress:e,utxo:r});let i=w.indexOf(r);w.splice(i,1)}),{userDepositedUtxos:C,statusId:y,depositTxHash:b}};exports.hinkalDepositOnChainUtxos=s;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IHinkal } from './IHinkal';
|
|
2
2
|
import { ERC20Token, RecipientUtxo } from '../../types';
|
|
3
3
|
import { FeeStructure } from '../../types/hinkal.types';
|
|
4
|
-
export declare const hinkalDepositOnChainUtxos: (hinkal: IHinkal, chainId: number, erc20Token: ERC20Token, recipientAmounts: bigint[], recipientAddresses: string[], feeStructure: FeeStructure, hashedEthereumAddress: string,
|
|
4
|
+
export declare const hinkalDepositOnChainUtxos: (hinkal: IHinkal, chainId: number, erc20Token: ERC20Token, recipientAmounts: bigint[], recipientAddresses: string[], feeStructure: FeeStructure, hashedEthereumAddress: string, _preEstimateGas?: boolean) => Promise<{
|
|
5
5
|
userDepositedUtxos: RecipientUtxo[];
|
|
6
6
|
statusId?: string;
|
|
7
7
|
depositTxHash: string;
|
|
@@ -1,54 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ContractType as t } from "../../types/ethereum-network.types.mjs";
|
|
3
|
-
import { DepositAndWithdrawPhase as n } from "../../types/scheduled-transactions.types.mjs";
|
|
1
|
+
import { DepositAndWithdrawPhase as e } from "../../types/scheduled-transactions.types.mjs";
|
|
4
2
|
import "../../types/index.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { getOnChainUtxosFromReceipt as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { safeUpdateDepositAndWithdrawStatus as
|
|
11
|
-
import { prepareDepositOnChainUtxosZkProof as u } from "./prepareDepositOnChainUtxosZkProof.mjs";
|
|
3
|
+
import { waitForEthereumTransactionConfirmation as t } from "../../functions/utils/tx-confirmation.utils.mjs";
|
|
4
|
+
import { getOnChainUtxosFromReceipt as n } from "../../functions/utils/getUtxosFromReceipt.utils.mjs";
|
|
5
|
+
import { getStealthAddressStructureFromUserKeys as r } from "../../functions/utils/getRecipientInfoFromUserKeys.mjs";
|
|
6
|
+
import { getOwnRecipientEncryptionKeys as i } from "./hinkalProoflessDeposit.utils.mjs";
|
|
7
|
+
import { hinkalProoflessDeposit as a } from "./hinkalProoflessDeposit.mjs";
|
|
8
|
+
import { safeUpdateDepositAndWithdrawStatus as o, updateDepositAndWithdrawStatus as s } from "../../API/deposit-and-withdraw-status-calls.mjs";
|
|
12
9
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.ts
|
|
13
|
-
var
|
|
14
|
-
let
|
|
15
|
-
chainId:
|
|
16
|
-
hashedEthereumAddress:
|
|
17
|
-
phase:
|
|
18
|
-
})).id ?? void 0,
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
let M = await a(f, j);
|
|
28
|
-
await c({
|
|
29
|
-
id: A,
|
|
30
|
-
chainId: f,
|
|
31
|
-
hashedEthereumAddress: _,
|
|
32
|
-
phase: n.AFTER_DEPOSIT,
|
|
33
|
-
depositTxHash: j
|
|
10
|
+
var c = async (c, l, u, d, f, p, m, h = !0) => {
|
|
11
|
+
let g = u.erc20TokenAddress, _ = d.map((e) => e + p.flatFee), v = _.map(() => u), y = _.map(() => r(c.userKeys)), b = (await s({
|
|
12
|
+
chainId: l,
|
|
13
|
+
hashedEthereumAddress: m,
|
|
14
|
+
phase: e.BEFORE_DEPOSIT
|
|
15
|
+
})).id ?? void 0, x = await a(c, v, _, y, i(c.userKeys, _.length), !0);
|
|
16
|
+
if (!x) throw Error("Deposit transaction hash not found");
|
|
17
|
+
let S = await t(l, x);
|
|
18
|
+
await o({
|
|
19
|
+
id: b,
|
|
20
|
+
chainId: l,
|
|
21
|
+
hashedEthereumAddress: m,
|
|
22
|
+
phase: e.AFTER_DEPOSIT,
|
|
23
|
+
depositTxHash: x
|
|
34
24
|
});
|
|
35
|
-
let
|
|
36
|
-
if (
|
|
37
|
-
let
|
|
38
|
-
return
|
|
39
|
-
let n =
|
|
25
|
+
let C = n(S, c, l, g);
|
|
26
|
+
if (C.length === 0) throw Error("No UTXOs found in deposit transaction. Check contract address and ABI.");
|
|
27
|
+
let w = [], T = [...C];
|
|
28
|
+
return f.forEach((e, t) => {
|
|
29
|
+
let n = _[t], r = T.find((e) => e.amount === n);
|
|
40
30
|
if (!r) throw Error(`Could not find newly created UTXO with amount ${n} for recipient ${e}.`);
|
|
41
|
-
|
|
31
|
+
w.push({
|
|
42
32
|
recipientAddress: e,
|
|
43
33
|
utxo: r
|
|
44
34
|
});
|
|
45
|
-
let i =
|
|
46
|
-
|
|
35
|
+
let i = T.indexOf(r);
|
|
36
|
+
T.splice(i, 1);
|
|
47
37
|
}), {
|
|
48
|
-
userDepositedUtxos:
|
|
49
|
-
statusId:
|
|
50
|
-
depositTxHash:
|
|
38
|
+
userDepositedUtxos: w,
|
|
39
|
+
statusId: b,
|
|
40
|
+
depositTxHash: x
|
|
51
41
|
};
|
|
52
42
|
};
|
|
53
43
|
//#endregion
|
|
54
|
-
export {
|
|
44
|
+
export { c as hinkalDepositOnChainUtxos };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/time.utils.cjs`),n=require(`../../functions/utils/token-check.utils.cjs`),r=require(`../../constants/bridging.constants.cjs`),i=require(`../../API/callNearIntentsAPI.cjs`),a=require(`../../functions/utils/nearIntents.utils.cjs`),o=require(`./hinkalDepositAndWithdraw.cjs`),s=require(`./hinkalSolanaDepositAndWithdraw.cjs`);var c=async(c,l,u,d,f,p,m,h,g,_)=>{if(u.length!==d.length)throw Error(`recipientAmounts and recipientAddresses length mismatch`);if(u.length===0)throw Error(`No recipients to bridge`);let v=n.validateAndGetChainId([l]),y=t.secondsToMs(p),b=new Date(y+r.NEAR_BRIDGE_QUOTE_DEADLINE_BUFFER_MS).toISOString(),x=await Promise.all(d.map(async(e,t)=>{let n=u[t],{quote:r}=await i.getNearIntentsQuote({dry:!1,swapType:`EXACT_INPUT`,slippageTolerance:f.slippageBps??100,originAsset:f.originAsset,depositType:`ORIGIN_CHAIN`,destinationAsset:f.destinationAsset,amount:n.toString(),recipient:e,recipientType:`DESTINATION_CHAIN`,refundTo:c.userKeys.getNearIntentsAccountId(),refundType:`INTENTS`,deadline:b});if(!r.depositAddress)throw Error(`NEAR Intents quote returned no deposit address for recipient ${e}`);if(r.deadline&&new Date(r.deadline).getTime()<y)throw Error(`Bridge quote expires before the scheduled execution time. Choose a sooner time.`);return{destinationRecipient:e,amount:n,depositAddress:r.depositAddress,quote:r}})),S=m??await a.buildNearBridgeFeeStructure(v,l,x[0].depositAddress),C=x.map(e=>e.amount),w=x.map(e=>e.depositAddress),T;return e.isSolanaLike(v)?{depositTxHash:
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../functions/utils/time.utils.cjs`),n=require(`../../functions/utils/token-check.utils.cjs`),r=require(`../../constants/bridging.constants.cjs`),i=require(`../../API/callNearIntentsAPI.cjs`),a=require(`../../functions/utils/nearIntents.utils.cjs`),o=require(`./hinkalDepositAndWithdraw.cjs`),s=require(`./hinkalSolanaDepositAndWithdraw.cjs`);var c=async(c,l,u,d,f,p,m,h,g,_)=>{if(u.length!==d.length)throw Error(`recipientAmounts and recipientAddresses length mismatch`);if(u.length===0)throw Error(`No recipients to bridge`);let v=n.validateAndGetChainId([l]),y=t.secondsToMs(p),b=new Date(y+r.NEAR_BRIDGE_QUOTE_DEADLINE_BUFFER_MS).toISOString(),x=await Promise.all(d.map(async(e,t)=>{let n=u[t],{quote:r}=await i.getNearIntentsQuote({dry:!1,swapType:`EXACT_INPUT`,slippageTolerance:f.slippageBps??100,originAsset:f.originAsset,depositType:`ORIGIN_CHAIN`,destinationAsset:f.destinationAsset,amount:n.toString(),recipient:e,recipientType:`DESTINATION_CHAIN`,refundTo:c.userKeys.getNearIntentsAccountId(),refundType:`INTENTS`,deadline:b});if(!r.depositAddress)throw Error(`NEAR Intents quote returned no deposit address for recipient ${e}`);if(r.deadline&&new Date(r.deadline).getTime()<y)throw Error(`Bridge quote expires before the scheduled execution time. Choose a sooner time.`);return{destinationRecipient:e,amount:n,depositAddress:r.depositAddress,quote:r}})),S=m??await a.buildNearBridgeFeeStructure(v,l,x[0].depositAddress),C=x.map(e=>e.amount),w=x.map(e=>e.depositAddress),T={chainId:f.destinationChainId===v?void 0:f.destinationChainId,tokenAddress:f.destinationTokenAddress,tokenAmounts:x.map(e=>e.quote.amountOut)},E;return e.isSolanaLike(v)?{depositTxHash:E}=await s.hinkalSolanaDepositAndWithdraw(c,l,C,w,p,S,h,g,_,x.map(e=>e.destinationRecipient),T):{depositTxHash:E}=await o.hinkalDepositAndWithdraw(c,l,C,w,p,S,h,g,_,void 0,T),{depositTxHash:E,legs:x}};exports.hinkalNearDepositAndBridge=c;
|