@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 +0,0 @@
|
|
|
1
|
-
var e={_format:`hh-sol-artifact-1`,abi:[{inputs:[],name:`token0`,outputs:[{internalType:`address`,name:``,type:`address`}],stateMutability:`view`,type:`function`},{inputs:[],name:`token1`,outputs:[{internalType:`address`,name:``,type:`address`}],stateMutability:`view`,type:`function`},{inputs:[],name:`stable`,outputs:[{internalType:`bool`,name:``,type:`bool`}],stateMutability:`view`,type:`function`},{inputs:[],name:`getReserves`,outputs:[{internalType:`uint256`,name:`_reserve0`,type:`uint256`},{internalType:`uint256`,name:`_reserve1`,type:`uint256`},{internalType:`uint256`,name:`_blockTimestampLast`,type:`uint256`}],stateMutability:`view`,type:`function`},{inputs:[],name:`totalSupply`,outputs:[{internalType:`uint256`,name:``,type:`uint256`}],stateMutability:`view`,type:`function`}],bytecode:`0x`,deployedBytecode:`0x`,linkReferences:{},deployedLinkReferences:{}};exports.default=e;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
var e = {
|
|
2
|
-
_format: "hh-sol-artifact-1",
|
|
3
|
-
abi: [
|
|
4
|
-
{
|
|
5
|
-
inputs: [],
|
|
6
|
-
name: "token0",
|
|
7
|
-
outputs: [{
|
|
8
|
-
internalType: "address",
|
|
9
|
-
name: "",
|
|
10
|
-
type: "address"
|
|
11
|
-
}],
|
|
12
|
-
stateMutability: "view",
|
|
13
|
-
type: "function"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
inputs: [],
|
|
17
|
-
name: "token1",
|
|
18
|
-
outputs: [{
|
|
19
|
-
internalType: "address",
|
|
20
|
-
name: "",
|
|
21
|
-
type: "address"
|
|
22
|
-
}],
|
|
23
|
-
stateMutability: "view",
|
|
24
|
-
type: "function"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
inputs: [],
|
|
28
|
-
name: "stable",
|
|
29
|
-
outputs: [{
|
|
30
|
-
internalType: "bool",
|
|
31
|
-
name: "",
|
|
32
|
-
type: "bool"
|
|
33
|
-
}],
|
|
34
|
-
stateMutability: "view",
|
|
35
|
-
type: "function"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
inputs: [],
|
|
39
|
-
name: "getReserves",
|
|
40
|
-
outputs: [
|
|
41
|
-
{
|
|
42
|
-
internalType: "uint256",
|
|
43
|
-
name: "_reserve0",
|
|
44
|
-
type: "uint256"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
internalType: "uint256",
|
|
48
|
-
name: "_reserve1",
|
|
49
|
-
type: "uint256"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
internalType: "uint256",
|
|
53
|
-
name: "_blockTimestampLast",
|
|
54
|
-
type: "uint256"
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
|
-
stateMutability: "view",
|
|
58
|
-
type: "function"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
inputs: [],
|
|
62
|
-
name: "totalSupply",
|
|
63
|
-
outputs: [{
|
|
64
|
-
internalType: "uint256",
|
|
65
|
-
name: "",
|
|
66
|
-
type: "uint256"
|
|
67
|
-
}],
|
|
68
|
-
stateMutability: "view",
|
|
69
|
-
type: "function"
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
bytecode: "0x",
|
|
73
|
-
deployedBytecode: "0x",
|
|
74
|
-
linkReferences: {},
|
|
75
|
-
deployedLinkReferences: {}
|
|
76
|
-
};
|
|
77
|
-
//#endregion
|
|
78
|
-
export { e as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`../../types/index.cjs`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../../types/index.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../utils/caseInsensitive.utils.cjs`),t=require(`../../data-structures/utxo/Utxo.cjs`);var n=(n,r,i,a)=>{let{recipientInfo:o,amount:s,token:c}=n,[l,u,d,,f]=o.split(`,`),p=r.findIndex(t=>t.find(t=>e.caseInsensitiveEqual(t.erc20TokenAddress,n?.token.erc20TokenAddress))!==void 0),m=new t.Utxo({amount:s,erc20TokenAddress:c.erc20TokenAddress,timeStamp:a,H0:[BigInt(u),BigInt(d)],stealthAddress:l,encryptionKey:f,isNewStyle:!0});if(p===-1)throw Error(`Private recipient index not found`);r.forEach((e,n)=>{if(n===p)e.push(m),i[n]+=s;else{let n=new t.Utxo({amount:0n,erc20TokenAddress:e[0].erc20TokenAddress,timeStamp:a,H0:[BigInt(u),BigInt(d)],stealthAddress:l,encryptionKey:f,isNewStyle:!0});e.push(n)}})};exports.recipientUtxoProcessing=n;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Utxo } from '../../data-structures/utxo/Utxo';
|
|
2
|
-
import { PrivateRecipientInfo } from '../../types/token.types';
|
|
3
|
-
export declare const recipientUtxoProcessing: (privateRecipientInfo: PrivateRecipientInfo, outputUtxosArray: Utxo[][], deltaChanges: bigint[], timeStamp: string) => void;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { caseInsensitiveEqual as e } from "../utils/caseInsensitive.utils.mjs";
|
|
2
|
-
import { Utxo as t } from "../../data-structures/utxo/Utxo.mjs";
|
|
3
|
-
//#region libs/shared/common/src/functions/pre-transaction/recipientUtxoProcessing.ts
|
|
4
|
-
var n = (n, r, i, a) => {
|
|
5
|
-
let { recipientInfo: o, amount: s, token: c } = n, [l, u, d, , f] = o.split(","), p = r.findIndex((t) => t.find((t) => e(t.erc20TokenAddress, n?.token.erc20TokenAddress)) !== void 0), m = new t({
|
|
6
|
-
amount: s,
|
|
7
|
-
erc20TokenAddress: c.erc20TokenAddress,
|
|
8
|
-
timeStamp: a,
|
|
9
|
-
H0: [BigInt(u), BigInt(d)],
|
|
10
|
-
stealthAddress: l,
|
|
11
|
-
encryptionKey: f,
|
|
12
|
-
isNewStyle: !0
|
|
13
|
-
});
|
|
14
|
-
if (p === -1) throw Error("Private recipient index not found");
|
|
15
|
-
r.forEach((e, n) => {
|
|
16
|
-
if (n === p) e.push(m), i[n] += s;
|
|
17
|
-
else {
|
|
18
|
-
let n = new t({
|
|
19
|
-
amount: 0n,
|
|
20
|
-
erc20TokenAddress: e[0].erc20TokenAddress,
|
|
21
|
-
timeStamp: a,
|
|
22
|
-
H0: [BigInt(u), BigInt(d)],
|
|
23
|
-
stealthAddress: l,
|
|
24
|
-
encryptionKey: f,
|
|
25
|
-
isNewStyle: !0
|
|
26
|
-
});
|
|
27
|
-
e.push(n);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
//#endregion
|
|
32
|
-
export { n as recipientUtxoProcessing };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`../../externalABIs/index.cjs`),require(`./emporium.helpers.cjs`),require(`ethers`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./constant.cjs`),t=require(`../../data-structures/http/HttpClient.cjs`);require(`../../data-structures/http/index.cjs`);const n=require(`../utils/encryptInputForEnclave.cjs`),r=require(`./getZKFiles.cjs`);var i=e=>{if(e.startsWith(`http`)){let t=e.split(`/`).at(-1);if(!t)throw Error(`invalid verifierName`);return t}return e},a=async(a,o,s)=>{let c=o.map(e=>i(r.getWASMFile(e,a))),l=o.map(e=>i(r.getZKeyFile(e,a))),{keyCiphertext:u,inputCiphertext:d}=await n.makeEnclaveHandshakeAndEncryptInput(s),f={circuit_wasms:c,circuit_zkeys:l,inputs:d,key:u};return(await t.httpClient.post(`${e.ENCLAVE_URL}/generate-proofs`,f)).map(({zk_calldata:e,public_signals:t})=>({zkCallData:e,publicSignals:t}))};exports.generateZkProofEnclave=a;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ENCLAVE_URL as e } from "./constant.mjs";
|
|
2
|
-
import { httpClient as t } from "../../data-structures/http/HttpClient.mjs";
|
|
3
|
-
import "../../data-structures/http/index.mjs";
|
|
4
|
-
import { makeEnclaveHandshakeAndEncryptInput as n } from "../utils/encryptInputForEnclave.mjs";
|
|
5
|
-
import { getWASMFile as r, getZKeyFile as i } from "./getZKFiles.mjs";
|
|
6
|
-
//#region libs/shared/common/src/functions/snarkjs/generateZkProofEnclave.ts
|
|
7
|
-
var a = (e) => {
|
|
8
|
-
if (e.startsWith("http")) {
|
|
9
|
-
let t = e.split("/").at(-1);
|
|
10
|
-
if (!t) throw Error("invalid verifierName");
|
|
11
|
-
return t;
|
|
12
|
-
}
|
|
13
|
-
return e;
|
|
14
|
-
}, o = async (o, s, c) => {
|
|
15
|
-
let l = s.map((e) => a(r(e, o))), u = s.map((e) => a(i(e, o))), { keyCiphertext: d, inputCiphertext: f } = await n(c), p = {
|
|
16
|
-
circuit_wasms: l,
|
|
17
|
-
circuit_zkeys: u,
|
|
18
|
-
inputs: f,
|
|
19
|
-
key: d
|
|
20
|
-
};
|
|
21
|
-
return (await t.post(`${e}/generate-proofs`, p)).map(({ zk_calldata: e, public_signals: t }) => ({
|
|
22
|
-
zkCallData: e,
|
|
23
|
-
publicSignals: t
|
|
24
|
-
}));
|
|
25
|
-
};
|
|
26
|
-
//#endregion
|
|
27
|
-
export { o as generateZkProofEnclave };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=e=>e|2n**255n,t=e=>e&2n**255n-1n,n=e=>e>>255n&1n;exports.addHighestBitToNumber=e,exports.extractHighestBit=n,exports.takeOffHighestBit=t;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=e=>({headers:{"x-user-signature":e}});exports.getSignatureHeader=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`./etherFunctions.cjs`),i=require(`../../API/callOdosAPI.cjs`);require(`../../error-handling/index.cjs`),require(`../../constants/index.cjs`);var a=async(a,o,s,c,l=.7)=>{try{let{odosResponse:n,status:u}=await i.callOdosAPI(a,{chainId:a===31337?e.localhostNetwork:a,inputTokens:[{tokenAddress:o?.wrappedErc20TokenAddress??o.erc20TokenAddress,amount:r.getAmountInWei(o,c).toString()}],outputTokens:[{tokenAddress:s?.wrappedErc20TokenAddress??s.erc20TokenAddress,proportion:1}],userAddr:e.networkRegistry[a].contractData.odosExternalActionInstanceAddress||t.zeroAddress,slippageLimitPercent:l,disableRFQs:!0});if(u!==`success`)throw Error(`Odos API Fetch Error`);return{outSwapAmountValue:BigInt(n.outputTokens[0].amount),odosDataValue:n.transaction.data}}catch(e){throw console.log({error:e}),Error(n.transactionErrorCodes.NO_ODOS_PRICE)}};exports.getOdosPrice=a;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ERC20Token } from '../../types';
|
|
2
|
-
export declare const getOdosPrice: (chainId: number, inSwapToken: ERC20Token, outSwapToken: ERC20Token, inSwapAmount: string, slippagePercentage?: number) => Promise<{
|
|
3
|
-
outSwapAmountValue: bigint;
|
|
4
|
-
odosDataValue: string;
|
|
5
|
-
}>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { localhostNetwork as e, networkRegistry as t } from "../../constants/chains.constants.mjs";
|
|
2
|
-
import { zeroAddress as n } from "../../constants/protocol.constants.mjs";
|
|
3
|
-
import { transactionErrorCodes as r } from "../../error-handling/error-codes.constants.mjs";
|
|
4
|
-
import { getAmountInWei as i } from "./etherFunctions.mjs";
|
|
5
|
-
import { callOdosAPI as a } from "../../API/callOdosAPI.mjs";
|
|
6
|
-
import "../../error-handling/index.mjs";
|
|
7
|
-
import "../../constants/index.mjs";
|
|
8
|
-
//#region libs/shared/common/src/functions/web3/odosAPI.ts
|
|
9
|
-
var o = async (o, s, c, l, u = .7) => {
|
|
10
|
-
try {
|
|
11
|
-
let { odosResponse: r, status: d } = await a(o, {
|
|
12
|
-
chainId: o === 31337 ? e : o,
|
|
13
|
-
inputTokens: [{
|
|
14
|
-
tokenAddress: s?.wrappedErc20TokenAddress ?? s.erc20TokenAddress,
|
|
15
|
-
amount: i(s, l).toString()
|
|
16
|
-
}],
|
|
17
|
-
outputTokens: [{
|
|
18
|
-
tokenAddress: c?.wrappedErc20TokenAddress ?? c.erc20TokenAddress,
|
|
19
|
-
proportion: 1
|
|
20
|
-
}],
|
|
21
|
-
userAddr: t[o].contractData.odosExternalActionInstanceAddress || n,
|
|
22
|
-
slippageLimitPercent: u,
|
|
23
|
-
disableRFQs: !0
|
|
24
|
-
});
|
|
25
|
-
if (d !== "success") throw Error("Odos API Fetch Error");
|
|
26
|
-
return {
|
|
27
|
-
outSwapAmountValue: BigInt(r.outputTokens[0].amount),
|
|
28
|
-
odosDataValue: r.transaction.data
|
|
29
|
-
};
|
|
30
|
-
} catch (e) {
|
|
31
|
-
throw console.log({ error: e }), Error(r.NO_ODOS_PRICE);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
//#endregion
|
|
35
|
-
export { o as getOdosPrice };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../constants/protocol.constants.cjs`),t=require(`../../error-handling/error-codes.constants.cjs`),n=require(`./etherFunctions.cjs`),r=require(`../../types/ethereum-network.types.cjs`);require(`../../types/index.cjs`);const i=require(`../../error-handling/logger.cjs`);require(`../../error-handling/index.cjs`);const a=require(`./getContractMetadata.cjs`);require(`../../constants/index.cjs`);const o=require(`../../API/callOneInchAPI.cjs`);var s=async(s,c,l,u,d=.7)=>{try{let t=await o.callOneInchAPI(s,{fromTokenAddress:c.erc20TokenAddress===e.zeroAddress?e.oneInchZeroAddress:c.erc20TokenAddress,toTokenAddress:l.erc20TokenAddress===e.zeroAddress?e.oneInchZeroAddress:l.erc20TokenAddress,fromAddress:e.zeroAddress,destReceiver:a.getContractMetadata(r.ContractType.OneInchExternalActionContract,s).address,amount:n.getAmountInWei(c,u),slippage:d,disableEstimate:!0,allowPartialFill:!1});if(!t||!t.tx)throw Error(`OneInch API price fetch error`);return{outSwapAmountValue:BigInt(t.toAmount),oneInchDataValue:t.tx.data}}catch(e){throw i.Logger.log({error:e}),Error(t.transactionErrorCodes.NO_ONEINCH_PRICE)}};exports.getOneInchPrice=s;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ERC20Token } from '../../types';
|
|
2
|
-
export declare const getOneInchPrice: (chainId: number, inSwapToken: ERC20Token, outSwapToken: ERC20Token, inSwapAmount: string, slippagePercentage?: number) => Promise<{
|
|
3
|
-
outSwapAmountValue: bigint;
|
|
4
|
-
oneInchDataValue: string;
|
|
5
|
-
}>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { oneInchZeroAddress as e, zeroAddress as t } from "../../constants/protocol.constants.mjs";
|
|
2
|
-
import { transactionErrorCodes as n } from "../../error-handling/error-codes.constants.mjs";
|
|
3
|
-
import { getAmountInWei as r } from "./etherFunctions.mjs";
|
|
4
|
-
import { ContractType as i } from "../../types/ethereum-network.types.mjs";
|
|
5
|
-
import "../../types/index.mjs";
|
|
6
|
-
import { Logger as a } from "../../error-handling/logger.mjs";
|
|
7
|
-
import "../../error-handling/index.mjs";
|
|
8
|
-
import { getContractMetadata as o } from "./getContractMetadata.mjs";
|
|
9
|
-
import "../../constants/index.mjs";
|
|
10
|
-
import { callOneInchAPI as s } from "../../API/callOneInchAPI.mjs";
|
|
11
|
-
//#region libs/shared/common/src/functions/web3/oneInchAPI.ts
|
|
12
|
-
var c = async (c, l, u, d, f = .7) => {
|
|
13
|
-
try {
|
|
14
|
-
let n = await s(c, {
|
|
15
|
-
fromTokenAddress: l.erc20TokenAddress === t ? e : l.erc20TokenAddress,
|
|
16
|
-
toTokenAddress: u.erc20TokenAddress === t ? e : u.erc20TokenAddress,
|
|
17
|
-
fromAddress: t,
|
|
18
|
-
destReceiver: o(i.OneInchExternalActionContract, c).address,
|
|
19
|
-
amount: r(l, d),
|
|
20
|
-
slippage: f,
|
|
21
|
-
disableEstimate: !0,
|
|
22
|
-
allowPartialFill: !1
|
|
23
|
-
});
|
|
24
|
-
if (!n || !n.tx) throw Error("OneInch API price fetch error");
|
|
25
|
-
return {
|
|
26
|
-
outSwapAmountValue: BigInt(n.toAmount),
|
|
27
|
-
oneInchDataValue: n.tx.data
|
|
28
|
-
};
|
|
29
|
-
} catch (e) {
|
|
30
|
-
throw a.log({ error: e }), Error(n.NO_ONEINCH_PRICE);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
//#endregion
|
|
34
|
-
export { c as getOneInchPrice };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`./etherFunctions.cjs`),i=require(`../../types/ethereum-network.types.cjs`);require(`../../types/index.cjs`);const a=require(`../../error-handling/logError.cjs`);require(`../../error-handling/index.cjs`),require(`../../constants/index.cjs`);let o=require(`ethers`);var s=async(e,r,i,a)=>{let o=(await Promise.all([100,500,3e3,1e4].map(async e=>({poolAddress:await r.getPool(i,a,e),fee:e})))).filter(({poolAddress:e})=>e!==t.zeroAddress),s=await Promise.all(o.map(async t=>({poolAddress:t.poolAddress,fee:t.fee,token1Balance:await e.balanceOf(t.poolAddress)}))),c=s.map(e=>e.token1Balance).reduce((e,t)=>t>=e?t:e,0n);if(c===0n)throw Error(n.transactionErrorCodes.UNISWAP_NOT_ENOUGH_LIQUIDITY);return s.find(e=>e.token1Balance===c)},c=async(t,n,r,o,s,c)=>{try{if(!e.networkRegistry[n].quoterV2Address)throw Error(`No Quoter Contract Provided`);return(await t.getContractWithFetcherByChainId(n,i.ContractType.UniswapV3QuoterContract,e.networkRegistry[n].quoterV2Address).quoteExactInputSingle.staticCall({tokenIn:r.wrappedErc20TokenAddress??r.erc20TokenAddress,tokenOut:o.wrappedErc20TokenAddress??o.erc20TokenAddress,fee:s,amountIn:c,sqrtPriceLimitX96:0})).amountOut}catch(e){throw a.logError(e),e}},l=async(t,n,r,a)=>{try{let o=t.getContractWithFetcherByChainId(n,i.ContractType.UniswapV3FactoryContract,e.networkRegistry[n].uniswapV3FactoryAddress),{fee:c}=await s(t.getContractWithFetcherByChainId(n,i.ContractType.ERC20Contract,a.wrappedErc20TokenAddress??a.erc20TokenAddress),o,r.wrappedErc20TokenAddress??r.erc20TokenAddress,a.wrappedErc20TokenAddress??a.erc20TokenAddress);return c}catch(e){throw console.log(`Error in getUniswapFee`,e),e}},u=async(e,t,i,a,s)=>{try{let n=await l(e,t,a,s),u=o.ethers.AbiCoder.defaultAbiCoder().encode([`uint24`],[n]);return{tokenPrice:await c(e,t,a,s,n,r.getAmountInWei(a,i)),poolFee:u}}catch{throw Error(n.transactionErrorCodes.NO_UNISWAP_PRICE)}};exports.getUniswapFee=l,exports.getUniswapPrice=u,exports.getUniswapPriceHelper=c,exports.searchPoolAndFee=s;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ethers } from 'ethers';
|
|
2
|
-
import { ERC20Token } from '../../types';
|
|
3
|
-
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
4
|
-
interface PoolAndFee {
|
|
5
|
-
poolAddress: string;
|
|
6
|
-
fee: number;
|
|
7
|
-
token1Balance: bigint;
|
|
8
|
-
}
|
|
9
|
-
export declare const searchPoolAndFee: (token1Contract: ethers.Contract, factory: ethers.Contract, token0Address: string, token1Address: string) => Promise<PoolAndFee>;
|
|
10
|
-
export declare const getUniswapPriceHelper: (hinkal: IHinkal, chainId: number, token0: ERC20Token, token1: ERC20Token, fee: number, inSwapAmount: bigint) => Promise<bigint>;
|
|
11
|
-
export declare const getUniswapFee: (hinkal: IHinkal, chainId: number, token0: ERC20Token, token1: ERC20Token) => Promise<number>;
|
|
12
|
-
export declare const getUniswapPrice: (hinkal: IHinkal, chainId: number, inSwapAmount: string, inSwapToken: ERC20Token, outSwapToken: ERC20Token) => Promise<{
|
|
13
|
-
tokenPrice: bigint;
|
|
14
|
-
poolFee: string;
|
|
15
|
-
}>;
|
|
16
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { networkRegistry as e } from "../../constants/chains.constants.mjs";
|
|
2
|
-
import { zeroAddress as t } from "../../constants/protocol.constants.mjs";
|
|
3
|
-
import { transactionErrorCodes as n } from "../../error-handling/error-codes.constants.mjs";
|
|
4
|
-
import { getAmountInWei as r } from "./etherFunctions.mjs";
|
|
5
|
-
import { ContractType as i } from "../../types/ethereum-network.types.mjs";
|
|
6
|
-
import "../../types/index.mjs";
|
|
7
|
-
import { logError as a } from "../../error-handling/logError.mjs";
|
|
8
|
-
import "../../error-handling/index.mjs";
|
|
9
|
-
import "../../constants/index.mjs";
|
|
10
|
-
import { ethers as o } from "ethers";
|
|
11
|
-
//#region libs/shared/common/src/functions/web3/uniswapAPI.ts
|
|
12
|
-
var s = async (e, r, i, a) => {
|
|
13
|
-
let o = (await Promise.all([
|
|
14
|
-
100,
|
|
15
|
-
500,
|
|
16
|
-
3e3,
|
|
17
|
-
1e4
|
|
18
|
-
].map(async (e) => ({
|
|
19
|
-
poolAddress: await r.getPool(i, a, e),
|
|
20
|
-
fee: e
|
|
21
|
-
})))).filter(({ poolAddress: e }) => e !== t), s = await Promise.all(o.map(async (t) => ({
|
|
22
|
-
poolAddress: t.poolAddress,
|
|
23
|
-
fee: t.fee,
|
|
24
|
-
token1Balance: await e.balanceOf(t.poolAddress)
|
|
25
|
-
}))), c = s.map((e) => e.token1Balance).reduce((e, t) => t >= e ? t : e, 0n);
|
|
26
|
-
if (c === 0n) throw Error(n.UNISWAP_NOT_ENOUGH_LIQUIDITY);
|
|
27
|
-
return s.find((e) => e.token1Balance === c);
|
|
28
|
-
}, c = async (t, n, r, o, s, c) => {
|
|
29
|
-
try {
|
|
30
|
-
if (!e[n].quoterV2Address) throw Error("No Quoter Contract Provided");
|
|
31
|
-
return (await t.getContractWithFetcherByChainId(n, i.UniswapV3QuoterContract, e[n].quoterV2Address).quoteExactInputSingle.staticCall({
|
|
32
|
-
tokenIn: r.wrappedErc20TokenAddress ?? r.erc20TokenAddress,
|
|
33
|
-
tokenOut: o.wrappedErc20TokenAddress ?? o.erc20TokenAddress,
|
|
34
|
-
fee: s,
|
|
35
|
-
amountIn: c,
|
|
36
|
-
sqrtPriceLimitX96: 0
|
|
37
|
-
})).amountOut;
|
|
38
|
-
} catch (e) {
|
|
39
|
-
throw a(e), e;
|
|
40
|
-
}
|
|
41
|
-
}, l = async (t, n, r, a) => {
|
|
42
|
-
try {
|
|
43
|
-
let o = t.getContractWithFetcherByChainId(n, i.UniswapV3FactoryContract, e[n].uniswapV3FactoryAddress), { fee: c } = await s(t.getContractWithFetcherByChainId(n, i.ERC20Contract, a.wrappedErc20TokenAddress ?? a.erc20TokenAddress), o, r.wrappedErc20TokenAddress ?? r.erc20TokenAddress, a.wrappedErc20TokenAddress ?? a.erc20TokenAddress);
|
|
44
|
-
return c;
|
|
45
|
-
} catch (e) {
|
|
46
|
-
throw console.log("Error in getUniswapFee", e), e;
|
|
47
|
-
}
|
|
48
|
-
}, u = async (e, t, i, a, s) => {
|
|
49
|
-
try {
|
|
50
|
-
let n = await l(e, t, a, s), u = o.AbiCoder.defaultAbiCoder().encode(["uint24"], [n]);
|
|
51
|
-
return {
|
|
52
|
-
tokenPrice: await c(e, t, a, s, n, r(a, i)),
|
|
53
|
-
poolFee: u
|
|
54
|
-
};
|
|
55
|
-
} catch {
|
|
56
|
-
throw Error(n.NO_UNISWAP_PRICE);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
//#endregion
|
|
60
|
-
export { l as getUniswapFee, u as getUniswapPrice, c as getUniswapPriceHelper, s as searchPoolAndFee };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MemberStatus } from './RewardUserEnums';
|
|
2
|
-
import { AllPoints } from './all-points.types';
|
|
3
|
-
export interface BrotherhoodUserBase extends AllPoints {
|
|
4
|
-
ethereumAddress: string;
|
|
5
|
-
brotherhoodId: number;
|
|
6
|
-
memberStatus: MemberStatus;
|
|
7
|
-
}
|
|
8
|
-
export interface BrotherhoodUser extends BrotherhoodUserBase {
|
|
9
|
-
username: string;
|
|
10
|
-
profileImage: string;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=function(e){return e.Welcome=`welcome`,e.Daily=`daily`,e.Brotherhood=`brotherhood`,e.PointsBoost=`pointsBoost`,e}({}),t=function(e){return e.None=`None`,e.Bronze=`Bronze`,e.Silver=`Silver`,e.Gold=`Gold`,e.Diamond=`Diamond`,e}({}),n=function(e){return e.discord=`discord`,e.telegram=`telegram`,e.firstSwap=`firstSwap`,e.members=`members`,e.quests=`quests`,e.swaps=`swaps`,e.referrals=`referrals`,e.dApps=`dApps`,e.chains=`chains`,e.dailySwap=`dailySwap`,e.dailyDappTx=`dailyDappTx`,e.achievementSwaps=`achievementSwaps`,e.achievementReferrals=`achievementReferrals`,e.achievementDapps=`achievementDapps`,e.achievementChains=`achievementChains`,e.achievementPrivateSends=`achievementPrivateSends`,e.createOrJoinBH=`createOrJoinBH`,e.shieldUnshield=`shieldUnshield`,e.moneyComes=`moneyComes`,e.referralPrivateSendBonus=`referralPrivateSendBonus`,e}({});exports.AchievementTiers=t,exports.TaskCategory=e,exports.TaskTypes=n;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
//#region libs/shared/common/src/types/new-rewards.type.ts
|
|
2
|
-
var e = /* @__PURE__ */ function(e) {
|
|
3
|
-
return e.Welcome = "welcome", e.Daily = "daily", e.Brotherhood = "brotherhood", e.PointsBoost = "pointsBoost", e;
|
|
4
|
-
}({}), t = /* @__PURE__ */ function(e) {
|
|
5
|
-
return e.None = "None", e.Bronze = "Bronze", e.Silver = "Silver", e.Gold = "Gold", e.Diamond = "Diamond", e;
|
|
6
|
-
}({}), n = /* @__PURE__ */ function(e) {
|
|
7
|
-
return e.discord = "discord", e.telegram = "telegram", e.firstSwap = "firstSwap", e.members = "members", e.quests = "quests", e.swaps = "swaps", e.referrals = "referrals", e.dApps = "dApps", e.chains = "chains", e.dailySwap = "dailySwap", e.dailyDappTx = "dailyDappTx", e.achievementSwaps = "achievementSwaps", e.achievementReferrals = "achievementReferrals", e.achievementDapps = "achievementDapps", e.achievementChains = "achievementChains", e.achievementPrivateSends = "achievementPrivateSends", e.createOrJoinBH = "createOrJoinBH", e.shieldUnshield = "shieldUnshield", e.moneyComes = "moneyComes", e.referralPrivateSendBonus = "referralPrivateSendBonus", e;
|
|
8
|
-
}({});
|
|
9
|
-
//#endregion
|
|
10
|
-
export { t as AchievementTiers, e as TaskCategory, n as TaskTypes };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface FilledReferredUser {
|
|
2
|
-
referralEthereumAddress: string;
|
|
3
|
-
joinedAt: Date;
|
|
4
|
-
points: number;
|
|
5
|
-
username?: string;
|
|
6
|
-
profileImageUrl?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface Referral {
|
|
9
|
-
ethereumAddress: string;
|
|
10
|
-
referralCode: string;
|
|
11
|
-
referredUsers: FilledReferredUser[];
|
|
12
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export declare enum OldPointType {
|
|
2
|
-
CertificationPoints = "CertificationPoints",
|
|
3
|
-
TradePoints = "TradePoints",
|
|
4
|
-
LPPoints = "LPPoints",
|
|
5
|
-
ReferralPoints = "ReferralPoints",
|
|
6
|
-
GalxePoints = "GalxePoints",
|
|
7
|
-
ZealyPoints = "ZealyPoints",
|
|
8
|
-
TaskOnPoints = "TaskOnPoints",
|
|
9
|
-
BonusPoints = "BonusPoints"
|
|
10
|
-
}
|
|
11
|
-
export declare enum RafflePrizeType {
|
|
12
|
-
Gold = "Gold",
|
|
13
|
-
Silver = "Silver"
|
|
14
|
-
}
|
|
15
|
-
export type CountDown = {
|
|
16
|
-
daysLeft: number;
|
|
17
|
-
hoursLeft: number;
|
|
18
|
-
minutesLeft: number;
|
|
19
|
-
secondsLeft: number;
|
|
20
|
-
};
|
|
21
|
-
export interface DailyJobLock {
|
|
22
|
-
day: Date;
|
|
23
|
-
createdAt: Date;
|
|
24
|
-
}
|
|
25
|
-
export interface DailyBoxCounter {
|
|
26
|
-
date: Date;
|
|
27
|
-
rank: string;
|
|
28
|
-
count: number;
|
|
29
|
-
}
|
|
30
|
-
export interface DailyProxyProgress {
|
|
31
|
-
day: Date;
|
|
32
|
-
address: string;
|
|
33
|
-
chainId: number;
|
|
34
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require(`./workerProxy-Ddzxn23N.js`);let t=require(`buffer`),n=require(`process`);n=e.c(n);let r=require(`circomlibjs-hinkal-fork`),i=require(`ethers`),a=require(`libsodium-wrappers`);a=e.c(a);let o=require(`@solana/web3.js`),s=require(`bs58`);s=e.c(s);let c=require(`tweetnacl`);c=e.c(c);let l=require(`tronweb`);var u=e=>JSON.stringify(e,(e,t)=>typeof t==`bigint`?`bigint:${t.toString()}`:t),d=e=>JSON.parse(e,(e,t)=>typeof t==`string`&&t.startsWith(`bigint:`)?BigInt(t.slice(7)):t),f=new class{babyjub=void 0;async init(){this.babyjub||=e.o?(0,r.buildBabyJubRN)():await(0,r.buildBabyjub)()}getJub(){return this.babyjub}},p=()=>f.getJub(),m=new class{eddsa=void 0;async init(){this.eddsa||=e.o?await(0,r.buildEddsaRN)():await(0,r.buildEddsa)()}getEddsa(){return this.eddsa}},h=()=>m.getEddsa();function g(e){return typeof e==`object`&&`toBigInt`in e?e.toBigInt():BigInt(e)}var _=new class{poseidon=void 0;async init(){this.poseidon||=e.o?(0,r.buildPoseidonRN)():await(0,r.buildPoseidon)()}getPoseidon(){return this.poseidon}};function v(...e){let t=_.getPoseidon();return g(t.F.toString(t(e)))}var y=(...e)=>{let t=_.getPoseidon();return i.ethers.toBeHex(t.F.toString(t([...e])))},b=async(e=!1)=>{(typeof window<`u`||typeof self<`u`)&&(typeof window<`u`&&(window.global=window),globalThis.Buffer=t.Buffer,globalThis.process=n.default),await Promise.all([a.default.ready,_.init(),f.init(),...e?[]:[m.init()]])};`${`00`.repeat(20)}`;var x=21888242871839275222246405745257275088548364400416034343698204186575808495617n,S=x/2n,C=200n;`${`00`.repeat(32)}`;var w=class{inMemoryCache=new Map;constructor(e){e&&this.mergeWithSerialized(e)}getInMemory(e){return this.inMemoryCache.get(e)??void 0}setInMemory(e,t){this.inMemoryCache.set(e,t)}mergeWithSerialized(e){Object.entries(e).forEach(([e,t])=>{this.set(e,d(t))})}},T=class extends w{isAttached=!1;get(e){return this.getInMemory(e)}set(e,t){this.setInMemory(e,t)}serialize(){return Object.fromEntries([...this.inMemoryCache].map(([e,t])=>[e,u(t)]))}attach(e){if(this.isAttached)throw Error(`can't reattach cache device`);return this.isAttached=!0,(...t)=>{let n=u(t),r=this.get(n);if(r!==void 0)return r;let i=e(...t);return this.set(n,i),i}}},E=e=>{if(e<0n||e>=21888242871839275222246405745257275088548364400416034343698204186575808495617n)throw RangeError();return e>S},D=e=>E(e)?1n:0n,O=new T,k=new T,A=new T,j=class{signature;nullifyingKey;PREFIX_FOR_SPENDING_PAIR=`1`;PREFIX_FOR_NULLIFYING_PAIR=`2`;constructor(e,t){this.signature=e,this.nullifyingKey=t}getSignature(){return this.requireSignature(),this.signature}setSignature(e){this.signature=e}requireSignature(){if(!this.signature)throw Error(`No signature provided`)}requireKeyMaterial(){if(!this.signature&&!this.nullifyingKey)throw Error(`No signature or private key provided`)}verifyTronMessage(e,t){return this.requireSignature(),t===l.Trx.verifyMessageV2(e,this.signature)}getShieldedPrivateKey=()=>(this.requireKeyMaterial(),this.nullifyingKey||=i.ethers.keccak256(this.signature),this.nullifyingKey);getShieldedPublicKey=()=>(this.requireKeyMaterial(),y(this.getShieldedPrivateKey()));getSpendingKeyPair=()=>{this.requireSignature();let e=h(),t=p(),n=y(this.PREFIX_FOR_SPENDING_PAIR,this.getSignature()),r=Buffer.from(i.ethers.getBytes(n)),a=e.prv2pub(r);return{privSpendingKey:n,pubSpendingBJJPoint:[BigInt(t.F.toString(a[0])),BigInt(t.F.toString(a[1]))]}};signEddsa=e=>{this.requireSignature();let t=p(),n=h(),r=Buffer.from(i.ethers.getBytes(this.getSpendingKeyPair().privSpendingKey)),a=t.F.e(e),o=n.signPoseidon(r,a);return{R8:[BigInt(t.F.toString(o.R8[0])),BigInt(t.F.toString(o.R8[1]))],S:BigInt(o.S)}};getShieldedPrivateKeyFromNonce=e=>{this.requireKeyMaterial();let t=y(e,this.getShieldedPrivateKey(),this.getShieldedPublicKey());return i.ethers.keccak256(i.ethers.toUtf8Bytes(`hinkal-offchain-shielded-key:${t}`))};getClaimableSignatureFromNonce=e=>{this.requireKeyMaterial();let t=y(e,this.getShieldedPrivateKey(),this.getShieldedPublicKey());return i.ethers.keccak256(i.ethers.toUtf8Bytes(`hinkal-claimable-utxo-signature:${t}`))};getDerivedEthereumAddress=()=>(this.requireKeyMaterial(),new i.ethers.Wallet(this.getShieldedPrivateKey()).address);getDerivedSolanaPublicKey=()=>(this.requireKeyMaterial(),o.Keypair.fromSeed(i.ethers.getBytes(this.getShieldedPrivateKey())).publicKey.toBase58());getNearIntentsAccountId=()=>{this.requireKeyMaterial();let e=o.Keypair.fromSeed(i.ethers.getBytes(this.getShieldedPrivateKey()));return i.ethers.hexlify(e.publicKey.toBytes()).slice(2)};getNearIntentsKeyPairString=()=>{this.requireKeyMaterial();let e=o.Keypair.fromSeed(i.ethers.getBytes(this.getShieldedPrivateKey()));return`ed25519:${s.default.encode(e.secretKey)}`};getSignerPrivateKeyFromNonce=e=>{this.requireKeyMaterial();let t=y(e,this.getShieldedPrivateKey(),this.getShieldedPublicKey());return i.ethers.keccak256(i.ethers.toUtf8Bytes(t))};getSignerSolanaPrivateKeyFromNonce=e=>{let t=this.getSignerPrivateKeyFromNonce(e),n=i.ethers.getBytes(t),r=o.Keypair.fromSeed(n);return s.default.encode(r.secretKey)};verifyMessage(e){return this.requireSignature(),i.ethers.verifyMessage(e,this.signature)}verifySolanaMessage(e,t){this.requireSignature();let n=new TextEncoder().encode(e),r=i.ethers.getBytes(this.signature),a=new o.PublicKey(t).toBytes();return c.default.sign.detached.verify(n,r,a)}static getRandomizedStealthPairOld=k.attach((e,t)=>{let n=p(),r=e*(BigInt(t)%x)%x,i=n.mulPointEscalar(n.Base8,e),a=n.mulPointEscalar(n.Base8,r);return{H0:[BigInt(n.F.toString(i[0])),BigInt(n.F.toString(i[1]))],H1:[BigInt(n.F.toString(a[0])),BigInt(n.F.toString(a[1]))]}});static getRandomizedStealthPair=O.attach((e,t)=>{let n=p(),r=BigInt(t)%x,i=n.mulPointEscalar(n.Base8,e),a=n.mulPointEscalar(i,r);return{H0:[BigInt(n.F.toString(i[0])),BigInt(n.F.toString(i[1]))],H1:[BigInt(n.F.toString(a[0])),BigInt(n.F.toString(a[1]))]}});static getStealthAddressCompressedPoints=(e,t)=>{let{H0:n,H1:r}=this.getRandomizedStealthPairOld(e,t),[i,a]=[n,r].map(e=>BigInt(e[1])+2n**255n*D(e[0]));return{h0:i,h1:a}};static checkSignature=(e,t,n,r)=>{let{h0:i,h1:a}=this.getStealthAddressCompressedPoints(e,r);return t===i&&n===a};static getStealthAddress=A.attach((e,t)=>{let{H0:n,H1:r}=this.getRandomizedStealthPairOld(e,t);return y(2n*D(n[0])+D(r[0]),n[1],r[1])});static getH1FromH0=(e,t)=>{let n=p(),r=BigInt(t)%x,i=[n.F.e(e[0]),n.F.e(e[1])],a=n.mulPointEscalar(i,r);return[BigInt(n.F.toString(a[0])),BigInt(n.F.toString(a[1]))]};static verifyStealthPair=(e,t,n,r=!0)=>{let i=this.getH1FromH0(e,n);return r?i[1]===t[1]:i===t};static getStealthAddressNewStyle=(e,t,n)=>{if(n?.length!==2)throw Error(`Spending public key must be an array of 2 elements`);let r=this.getH1FromH0(e,t);return y(2n*D(e[0])+D(r[0]),e[1],r[1],n[0],n[1],t)};static findCorrectRandomization(e,t){if(!t)throw Error(`No Private Shielded Key Provided`);let n=BigInt(t)%x,r,i,a=0n;do r=e*10n**a%x,i=r*n%x,a+=1n;while(i>=2n**253n||r>=2n**253n);return r}static getH0FromRandomization=e=>{let t=p(),n=t.mulPointEscalar(t.Base8,e);return[BigInt(t.F.toString(n[0])),BigInt(t.F.toString(n[1]))]};static findH0(e,t){if(!t)return;let{H0:n}=this.getRandomizedStealthPair(e,t);return n}static getEncryptionKeyPair=e=>{let t=a.default.crypto_box_seed_keypair(i.ethers.getBytes(e));return{privateKey:i.ethers.hexlify(t.privateKey),publicKey:i.ethers.hexlify(t.publicKey)}};getAccessKey=()=>(this.requireKeyMaterial(),y(this.getShieldedPrivateKey(),this.getShieldedPublicKey()));getBackendToken=()=>(this.requireKeyMaterial(),y(this.getAccessKey(),this.getShieldedPublicKey()))},M={CANNOT_CERTIFY_FOR_PAST_WEEK:`Certification for the past week is not available`,CYCLICAL_REFERRALS_FORBIDDEN:`Cyclical referrals are forbidden`,USER_IS_UNRANKED:`Please certify transactions to see rank`},N={WC_NO_MATCHING_KEY:`creating the transaction failed
|
|
2
|
-
version`,CONNECTION_PROBLEM:`Failed to connect wallet. Please try again.`,REQUEST_PENDING:`request of type 'wallet_requestpermissions' already pending for origin`},P={INSUFFICIENT_FUNDS:`Insufficient funds`,INSUFFICIENT_FUNDS_WITHDRAW:`Not enough funds to withdraw`,INSUFFICIENT_FUNDS_TRANSFER:`Not enough funds to transfer`,INSUFFICIENT_FUNDS_TO_TRANSACT:`Not enough funds to transact`,INSUFFICIENT_FUNDS_GAS:`Insufficient funds for gas * price`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Insufficient TRX balance to cover transfer amount and transaction fee reserve`,INSUFFICIENT_SOL_BALANCE:`Insufficient SOL balance`},F={GAS_PRICE_EXCEEDS_AUTOSHIELD_LIMIT:`Skipped shielding due to gas fee exceeding your limit.`,AUTO_SHIELD_INSUFFICIENT_GAS:`Auto-Shield skipped due to insufficient gas.`};({...M,...N,...P,...F});var I=e=>BigInt(i.ethers.hexlify(i.ethers.randomBytes(e))),L=()=>Math.floor(Date.now()/1e3),R=class t{amount;erc20TokenAddress;mintAddress;timeStamp;nullifyingKey;spendingPublicKey;randomization;H0;stealthAddress;encryptionKey;commitment;nullifier;isBlocked;isNewStyle;constructor({amount:e,erc20TokenAddress:t,mintAddress:n,timeStamp:r,nullifyingKey:i,spendingPublicKey:a,randomization:o,H0:s,stealthAddress:c,encryptionKey:l,commitment:u=void 0,nullifier:d=void 0,isBlocked:f=!1,isNewStyle:p=!1}){if(this.amount=e,this.erc20TokenAddress=t,this.mintAddress=n,this.timeStamp=r??L().toString(),this.nullifyingKey=i,this.spendingPublicKey=a,this.stealthAddress=c,this.encryptionKey=l,this.commitment=u,this.nullifier=d,this.isBlocked=f,this.isNewStyle=p,p)if(s!==void 0)this.H0=s;else{let e=o??(i?j.findCorrectRandomization(I(31),i):void 0);if(this.H0=e?j.findH0(e,i):void 0,!this.H0)throw Error(`New-style UTXO requires H0 or nullifyingKey`)}else if(this.randomization=o??(i?j.findCorrectRandomization(I(31),i):void 0),!this.randomization)throw Error(`Old-style UTXO requires randomization or nullifyingKey`)}static createFrom(e,n){return new t({...e.getConstructableParams(),nullifier:void 0,commitment:void 0,...n})}getConstructableParams(){return{amount:this.amount,erc20TokenAddress:this.erc20TokenAddress,mintAddress:this.mintAddress,timeStamp:this.timeStamp,nullifyingKey:this.nullifyingKey,spendingPublicKey:this.spendingPublicKey,stealthAddress:this.stealthAddress,encryptionKey:this.encryptionKey,commitment:this.commitment,nullifier:this.nullifier,isBlocked:this.isBlocked,isNewStyle:this.isNewStyle,...this.isNewStyle?{H0:this.H0}:{randomization:this.randomization}}}getBasicUtxoParams(){return{amount:this.amount,erc20TokenAddress:this.erc20TokenAddress,mintAddress:this.mintAddress,timeStamp:this.timeStamp,stealthAddress:this.stealthAddress,commitment:this.commitment,nullifier:this.nullifier,isBlocked:this.isBlocked,isNewStyle:this.isNewStyle,...this.isNewStyle?{H0:this.H0}:{randomization:this.randomization}}}getCommitment(){if(!this.commitment){let e=[this.amount,this.erc20TokenAddress,BigInt(this.getStealthAddress()),this.timeStamp];this.commitment=y(...e)}return this.commitment}getNullifier(){if(!this.nullifier){if(!this.nullifyingKey)throw Error(`No Nullifiers if private key is not provided`);let e=this.getCommitment(),t=y(this.nullifyingKey,e);this.nullifier=y(e,t)}return this.nullifier}getStealthAddress(){if(!this.stealthAddress){if(!this.nullifyingKey)throw Error(`No stealth address in UTXO if private key is not provided`);if(this.isNewStyle){if(!this.H0)throw Error(`No H0 point provided`);this.stealthAddress=j.getStealthAddressNewStyle(this.H0,this.nullifyingKey,this.spendingPublicKey)}else{if(!this.randomization)throw Error(`No randomization provided`);this.stealthAddress=j.getStealthAddress(this.randomization,this.nullifyingKey)}}return this.stealthAddress}getTokenAddress(t){let n=e.r(t)?this.mintAddress:this.erc20TokenAddress;if(!n)throw Error(`No token address provided`);return n}getEncryptionKey(){if(!this.nullifyingKey){if(!this.encryptionKey)throw Error(`No encryption key provided in UTXO`);return this.encryptionKey}return j.getEncryptionKeyPair(this.nullifyingKey).publicKey}},z=()=>a.default.crypto_box_SEALBYTES+a.default.crypto_secretbox_KEYBYTES,B=e=>{let t=a.default.crypto_secretbox_NONCEBYTES,n=z(),r=0,i=e[r];r+=1;let o=e.slice(r,r+t);r+=t;let s=[];for(let t=0;t<i;t+=1)s.push(e.slice(r,r+n)),r+=n;return{nonce:o,sealedKeys:s,ciphertext:e.slice(r)}},V=(e,t,n,r)=>{let{nonce:o,sealedKeys:s,ciphertext:c}=B(e),l=a.default.crypto_box_seal_open(s[r],i.ethers.getBytes(n),i.ethers.getBytes(t)),u=a.default.crypto_secretbox_open_easy(c,o,l);return Buffer.from(u)},H=(e,t,n)=>{let r=a.default.crypto_box_seal_open(e,i.ethers.getBytes(n),i.ethers.getBytes(t));return Buffer.from(r)},U=54912,W=2,G=e=>e[0]*256+e[1],K=(e,t)=>{let{privateKey:n,publicKey:r}=j.getEncryptionKeyPair(t.getShieldedPrivateKey()),i=G(e)===U?V(e.slice(W),n,r,0):H(e,n,r),a=Buffer.from(i).toString(`utf-8`).split(`0x`).filter(e=>e.length!==0),s=e=>BigInt(`0x${e}`),c=e=>`0x${e}`,l=a.length>=8,u=l&&s(a[5])===1n,d=l?8:6,f=a[d]?c(a[d]):void 0,p=f?new o.PublicKey(Buffer.from(f.slice(2),`hex`)).toString():void 0;return{amount:s(a[0]),erc20TokenAddress:c(a[1]),stealthAddress:c(a[3]),nullifyingKey:t.getShieldedPrivateKey(),timeStamp:s(a[4]).toString(),isNewStyle:u,...u?{H0:[s(a[6]),s(a[7])]}:{randomization:s(a[2])},mintAddress:p}},q=(e,t)=>new R(K(e,t)),J=e=>e&2n**255n-1n,Y=e=>e>>255n&1n,X=(...t)=>{e.a&&console.log(...t)};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return C}});
|