@gurge/sdk 0.3.142 → 0.3.151
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 +43 -29
- package/common/src/API/API.cjs +1 -1
- package/common/src/API/API.d.ts +97 -0
- package/common/src/API/API.mjs +96 -121
- package/common/src/API/TokenCallsCachedHelper.d.ts +15 -0
- package/common/src/API/admin-calls.cjs +1 -1
- package/common/src/API/admin-calls.d.ts +9 -0
- package/common/src/API/admin-calls.mjs +3 -1
- package/common/src/API/callLifiAPI.cjs +1 -1
- package/common/src/API/callLifiAPI.d.ts +37 -0
- package/common/src/API/callLifiAPI.mjs +7 -2
- package/common/src/API/callMonitor.d.ts +9 -0
- package/common/src/API/callNearIntentsAPI.cjs +1 -1
- package/common/src/API/callNearIntentsAPI.d.ts +3 -0
- package/common/src/API/callNearIntentsAPI.mjs +2 -2
- package/common/src/API/callOkxAPI.d.ts +10 -0
- package/common/src/API/callRelayer.cjs +1 -1
- package/common/src/API/callRelayer.d.ts +76 -0
- package/common/src/API/callRelayer.mjs +7 -1
- package/common/src/API/checkRisk.d.ts +1 -0
- package/common/src/API/dashboardAccountCalls.d.ts +24 -0
- package/common/src/API/dashboardAccountMemberCalls.cjs +1 -1
- package/common/src/API/dashboardAccountMemberCalls.d.ts +49 -0
- package/common/src/API/dashboardAccountMemberCalls.mjs +5 -2
- package/common/src/API/dashboardBalanceCalls.d.ts +12 -0
- package/common/src/API/dashboardContactCalls.d.ts +9 -0
- package/common/src/API/dashboardPayoutCalls.cjs +1 -1
- package/common/src/API/dashboardPayoutCalls.d.ts +15 -0
- package/common/src/API/dashboardPayoutCalls.mjs +4 -1
- package/common/src/API/dashboardTransactionCalls.cjs +1 -1
- package/common/src/API/dashboardTransactionCalls.d.ts +6 -0
- package/common/src/API/dashboardTransactionCalls.mjs +2 -2
- package/common/src/API/enclaveRecipientInfoCalls.d.ts +12 -0
- package/common/src/API/enclaveSignatureCalls.cjs +1 -1
- package/common/src/API/enclaveSignatureCalls.d.ts +6 -0
- package/common/src/API/enclaveSignatureCalls.mjs +5 -8
- package/common/src/API/enclaveUtxoCalls.cjs +1 -1
- package/common/src/API/enclaveUtxoCalls.d.ts +59 -0
- package/common/src/API/enclaveUtxoCalls.mjs +16 -17
- package/common/src/API/evm-rpc-fallback.cjs +1 -0
- package/common/src/API/evm-rpc-fallback.d.ts +1 -0
- package/common/src/API/evm-rpc-fallback.mjs +17 -0
- package/common/src/API/evm-token-assets.d.ts +8 -0
- package/common/src/API/fetchCommitmentsCache.d.ts +19 -0
- package/common/src/API/get-token-data.d.ts +6 -0
- package/common/src/API/get-token-price-chart-data.d.ts +16 -0
- package/common/src/API/getCoingeckoPrice.d.ts +21 -0
- package/common/src/API/getGasEstimates.d.ts +10 -0
- 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/getServerURL.d.ts +7 -0
- package/common/src/API/getTokenPrice.d.ts +10 -0
- package/common/src/API/getWebsiteURL.d.ts +3 -0
- package/common/src/API/index.cjs +1 -1
- package/common/src/API/index.d.ts +24 -0
- package/common/src/API/index.mjs +4 -5
- package/common/src/API/onrampCalls.d.ts +20 -0
- 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/privacy-score-calls.d.ts +17 -0
- package/common/src/API/privateSendEmailNotificationsCalls.d.ts +8 -0
- package/common/src/API/privateSendNonceCalls.d.ts +13 -0
- package/common/src/API/privateSendRecipientInfoCalls.cjs +1 -1
- package/common/src/API/privateSendRecipientInfoCalls.d.ts +8 -0
- package/common/src/API/privateSendRecipientInfoCalls.mjs +12 -6
- package/common/src/API/proxyAccountsCalls.cjs +1 -1
- package/common/src/API/proxyAccountsCalls.d.ts +5 -0
- package/common/src/API/proxyAccountsCalls.mjs +11 -10
- package/common/src/API/relayCalls.d.ts +5 -0
- package/common/src/API/resolve-sns.d.ts +1 -0
- package/common/src/API/rewardsUserCalls.cjs +1 -1
- package/common/src/API/rewardsUserCalls.d.ts +21 -0
- package/common/src/API/rewardsUserCalls.mjs +2 -10
- package/common/src/API/route-config.cjs +1 -0
- package/common/src/API/route-config.d.ts +1 -0
- package/common/src/API/route-config.mjs +26 -0
- package/common/src/API/scheduled-transactions-calls.cjs +1 -1
- package/common/src/API/scheduled-transactions-calls.d.ts +17 -0
- package/common/src/API/scheduled-transactions-calls.mjs +2 -6
- package/common/src/API/seedless-calls.d.ts +53 -0
- package/common/src/API/simulate-batch-tx.d.ts +3 -0
- package/common/src/API/simulate-transaction.d.ts +5 -0
- package/common/src/API/snapshot-event-calls.d.ts +7 -0
- package/common/src/API/solana-nft-assets.d.ts +1 -0
- package/common/src/API/solana-priority-fee.cjs +1 -0
- package/common/src/API/solana-priority-fee.d.ts +3 -0
- package/common/src/API/solana-priority-fee.mjs +20 -0
- package/common/src/API/solana-rpc-fallback.cjs +1 -0
- package/common/src/API/solana-rpc-fallback.d.ts +1 -0
- package/common/src/API/solana-rpc-fallback.mjs +13 -0
- package/common/src/API/temporaryWalletCalls.cjs +1 -1
- package/common/src/API/temporaryWalletCalls.d.ts +11 -0
- package/common/src/API/temporaryWalletCalls.mjs +8 -9
- package/common/src/API/tenderly.api.cjs +1 -1
- package/common/src/API/tenderly.api.d.ts +15 -0
- package/common/src/API/tenderly.api.mjs +1 -1
- package/common/src/API/token-calls.d.ts +4 -0
- package/common/src/API/tronSubsidyCalls.d.ts +13 -0
- package/common/src/API/weeklyAnalyticCalls.cjs +1 -1
- package/common/src/API/weeklyAnalyticCalls.d.ts +12 -0
- package/common/src/API/weeklyAnalyticCalls.mjs +2 -5
- package/common/src/constants/activity.constants.d.ts +2 -0
- package/common/src/constants/addresses.constants.cjs +1 -1
- package/common/src/constants/addresses.constants.d.ts +28 -0
- package/common/src/constants/addresses.constants.mjs +19 -60
- package/common/src/constants/auth.constants.d.ts +2 -0
- package/common/src/constants/backend.constants.d.ts +12 -0
- package/common/src/constants/balance.constants.cjs +1 -0
- package/common/src/constants/balance.constants.d.ts +4 -0
- package/common/src/constants/balance.constants.mjs +4 -0
- package/common/src/constants/bridging.constants.cjs +1 -1
- package/common/src/constants/bridging.constants.d.ts +35 -0
- package/common/src/constants/bridging.constants.mjs +2 -1
- package/common/src/constants/chains.constants.cjs +1 -1
- package/common/src/constants/chains.constants.d.ts +74 -0
- package/common/src/constants/chains.constants.mjs +175 -198
- package/common/src/constants/coingecko.constants.cjs +1 -1
- package/common/src/constants/coingecko.constants.d.ts +46 -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 +11 -0
- package/common/src/constants/contracts.constants.mjs +16 -34
- package/common/src/constants/conversion.constants.d.ts +1 -0
- package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.mjs +8 -9
- package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.mjs +7 -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 +8 -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 +12 -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 +8 -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 +8 -9
- package/common/src/constants/deploy-data/deploy-data-optimismTest.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-optimismTest.json.mjs +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 +8 -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 +7 -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 +15 -0
- package/common/src/constants/deploy-data/index.mjs +16 -15
- package/common/src/constants/deploy-data/mergeDeployData.d.ts +4 -0
- 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 +36 -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.d.ts +1 -0
- package/common/src/constants/events.constants.mjs +1 -15
- package/common/src/constants/fees.constants.cjs +1 -1
- package/common/src/constants/fees.constants.d.ts +9 -0
- package/common/src/constants/fees.constants.mjs +2 -2
- package/common/src/constants/function-signatures.constants.d.ts +4 -0
- package/common/src/constants/images.constants.d.ts +1 -0
- package/common/src/constants/index.cjs +1 -1
- package/common/src/constants/index.d.ts +32 -0
- package/common/src/constants/index.mjs +1 -1
- package/common/src/constants/lifi.constants.cjs +1 -1
- package/common/src/constants/lifi.constants.d.ts +3 -0
- package/common/src/constants/lifi.constants.mjs +6 -3
- package/common/src/constants/link.constant.d.ts +1 -0
- package/common/src/constants/mediaUrls.constants.d.ts +43 -0
- package/common/src/constants/oauthUrls.constants.d.ts +4 -0
- package/common/src/constants/okx.constants.d.ts +3 -0
- package/common/src/constants/pay.constants.d.ts +2 -0
- package/common/src/constants/permit2.constants.d.ts +7 -0
- package/common/src/constants/presale.constants.d.ts +87 -0
- package/common/src/constants/protocol.constants.cjs +2 -1
- package/common/src/constants/protocol.constants.d.ts +74 -0
- package/common/src/constants/protocol.constants.mjs +3 -15
- package/common/src/constants/reorg-depths.constants.d.ts +17 -0
- package/common/src/constants/save-depths.d.ts +19 -0
- package/common/src/constants/schedule.constants.d.ts +2 -0
- package/common/src/constants/server.constants.cjs +1 -1
- package/common/src/constants/server.constants.d.ts +116 -0
- package/common/src/constants/server.constants.mjs +19 -49
- package/common/src/constants/tokens.constants.cjs +1 -1
- package/common/src/constants/tokens.constants.d.ts +5 -0
- package/common/src/constants/tokens.constants.mjs +4 -1
- package/common/src/constants/tx-confirmation.constants.cjs +1 -1
- package/common/src/constants/tx-confirmation.constants.d.ts +5 -0
- package/common/src/constants/tx-confirmation.constants.mjs +2 -2
- package/common/src/constants/vite.constants.d.ts +16 -0
- package/common/src/constants/wallet.constants.d.ts +1 -0
- package/common/src/crypto/babyJub.d.ts +16 -0
- package/common/src/crypto/ecdh-sealed-keys.cjs +1 -1
- package/common/src/crypto/ecdh-sealed-keys.d.ts +22 -0
- package/common/src/crypto/ecdh-sealed-keys.mjs +17 -2
- package/common/src/crypto/ecdh.d.ts +2 -0
- package/common/src/crypto/eddsa.d.ts +8 -0
- package/common/src/crypto/index.cjs +1 -1
- package/common/src/crypto/index.d.ts +6 -0
- package/common/src/crypto/index.mjs +1 -2
- package/common/src/crypto/poseidon.d.ts +15 -0
- package/common/src/crypto/preProcessing.d.ts +1 -0
- package/common/src/data-structures/AccountActions/AccountActions.d.ts +17 -0
- package/common/src/data-structures/AccountActions/index.d.ts +1 -0
- package/common/src/data-structures/ApprovalDBs/EventsPublicApprovalsDB.d.ts +17 -0
- package/common/src/data-structures/ApprovalDBs/index.d.ts +1 -0
- package/common/src/data-structures/BlockchainEvent/BlockchainEvent.d.ts +14 -0
- package/common/src/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/common/src/data-structures/Hinkal/Hinkal.d.ts +120 -0
- package/common/src/data-structures/Hinkal/Hinkal.mjs +142 -174
- package/common/src/data-structures/Hinkal/IHinkal.d.ts +106 -0
- package/common/src/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/common/src/data-structures/Hinkal/handleAutoDepositBack.d.ts +3 -0
- package/common/src/data-structures/Hinkal/handleAutoDepositBack.mjs +36 -35
- package/common/src/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalActionReceive.d.ts +7 -0
- package/common/src/data-structures/Hinkal/hinkalActionReceive.mjs +13 -11
- package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.cjs +1 -0
- package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.d.ts +6 -0
- package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.mjs +100 -0
- package/common/src/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalClaimUtxo.d.ts +5 -0
- package/common/src/data-structures/Hinkal/hinkalClaimUtxo.mjs +40 -50
- package/common/src/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDeposit.d.ts +7 -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.d.ts +4 -0
- package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.mjs +113 -109
- package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +7 -0
- package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +98 -64
- package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +21 -0
- package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +50 -48
- package/common/src/data-structures/Hinkal/hinkalGetRecipientInfo.d.ts +2 -0
- package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.d.ts +6 -0
- package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.mjs +8 -3
- package/common/src/data-structures/Hinkal/hinkalPalEvmDeposit.d.ts +9 -0
- package/common/src/data-structures/Hinkal/hinkalPalSolanaDepositPrepare.d.ts +9 -0
- package/common/src/data-structures/Hinkal/hinkalPalTronDepositPrepare.d.ts +9 -0
- package/common/src/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalPrivateWallet.d.ts +6 -0
- 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 +7 -0
- 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 +10 -0
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.mjs +26 -32
- package/common/src/data-structures/Hinkal/hinkalProxySend.cjs +1 -0
- package/common/src/data-structures/Hinkal/hinkalProxySend.d.ts +6 -0
- package/common/src/data-structures/Hinkal/hinkalProxySend.mjs +16 -0
- package/common/src/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalProxySwap.d.ts +7 -0
- package/common/src/data-structures/Hinkal/hinkalProxySwap.mjs +13 -12
- package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +6 -0
- package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.mjs +19 -17
- package/common/src/data-structures/Hinkal/hinkalSignSubAccount.d.ts +4 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.d.ts +5 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +50 -79
- package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +8 -0
- 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 +28 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +115 -133
- package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.d.ts +5 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +16 -12
- package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +6 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.mjs +1 -3
- package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +28 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +82 -56
- package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +6 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +11 -13
- package/common/src/data-structures/Hinkal/hinkalSolanaSponsoredShield.cjs +1 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaSponsoredShield.d.ts +8 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaSponsoredShield.mjs +32 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaSwap.d.ts +4 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaSwap.mjs +58 -79
- package/common/src/data-structures/Hinkal/hinkalSolanaTransact.cjs +1 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaTransact.d.ts +3 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaTransact.mjs +119 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +3 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.mjs +46 -77
- package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +4 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +46 -57
- package/common/src/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSwap.d.ts +7 -0
- package/common/src/data-structures/Hinkal/hinkalSwap.mjs +32 -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 +106 -0
- package/common/src/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalTransfer.d.ts +4 -0
- package/common/src/data-structures/Hinkal/hinkalTransfer.mjs +39 -44
- package/common/src/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalWithdraw.d.ts +7 -0
- package/common/src/data-structures/Hinkal/hinkalWithdraw.mjs +38 -49
- package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.d.ts +3 -0
- package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +160 -102
- package/common/src/data-structures/Hinkal/index.d.ts +25 -0
- package/common/src/data-structures/Hinkal/prepareTronDepositToSelf.d.ts +27 -0
- package/common/src/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/common/src/data-structures/Hinkal/resetMerkleTrees.d.ts +2 -0
- package/common/src/data-structures/Hinkal/resetMerkleTrees.mjs +7 -6
- package/common/src/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/activity-db.d.ts +14 -0
- package/common/src/data-structures/IndexedDB/activity-db.mjs +34 -34
- package/common/src/data-structures/IndexedDB/balances-db.d.ts +13 -0
- package/common/src/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/contact-db.d.ts +11 -0
- package/common/src/data-structures/IndexedDB/contact-db.mjs +14 -28
- package/common/src/data-structures/IndexedDB/index.cjs +1 -1
- package/common/src/data-structures/IndexedDB/index.d.ts +9 -0
- package/common/src/data-structures/IndexedDB/index.mjs +1 -0
- package/common/src/data-structures/IndexedDB/key-val-store.cjs +1 -1
- package/common/src/data-structures/IndexedDB/key-val-store.d.ts +8 -0
- package/common/src/data-structures/IndexedDB/key-val-store.mjs +14 -0
- package/common/src/data-structures/IndexedDB/pay-activity-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/pay-activity-db.d.ts +9 -0
- package/common/src/data-structures/IndexedDB/pay-activity-db.mjs +43 -1
- package/common/src/data-structures/IndexedDB/prices-db.d.ts +9 -0
- package/common/src/data-structures/IndexedDB/private-balances-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/private-balances-db.d.ts +10 -0
- package/common/src/data-structures/IndexedDB/private-balances-db.mjs +3 -0
- package/common/src/data-structures/IndexedDB/scheduled-transactions-db.cjs +1 -0
- package/common/src/data-structures/IndexedDB/scheduled-transactions-db.d.ts +11 -0
- package/common/src/data-structures/IndexedDB/scheduled-transactions-db.mjs +34 -0
- package/common/src/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/signatures-db.d.ts +10 -0
- package/common/src/data-structures/IndexedDB/signatures-db.mjs +11 -11
- package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
- package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.d.ts +21 -0
- package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +29 -26
- package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.d.ts +18 -0
- package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.d.ts +11 -0
- package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.d.ts +18 -0
- package/common/src/data-structures/TokenDBs/IPublicTokensDB.d.ts +6 -0
- package/common/src/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
- package/common/src/data-structures/TokenDBs/PrivateTokensDB.d.ts +11 -0
- package/common/src/data-structures/TokenDBs/PrivateTokensDB.mjs +17 -18
- package/common/src/data-structures/TokenDBs/PublicTokensDB.d.ts +9 -0
- package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.d.ts +9 -0
- package/common/src/data-structures/TokenDBs/TronPublicTokensDB.d.ts +10 -0
- package/common/src/data-structures/TokenDBs/index.d.ts +6 -0
- package/common/src/data-structures/TokenDBs/token-visibility-db.d.ts +17 -0
- package/common/src/data-structures/ValueCache/ValueCache.d.ts +10 -0
- package/common/src/data-structures/ValueCache/index.d.ts +1 -0
- package/common/src/data-structures/WalletManager/WalletManager.d.ts +52 -0
- package/common/src/data-structures/WalletManager/index.d.ts +1 -0
- package/common/src/data-structures/cacheDevices/AttachableMemoryCacheDevice.d.ts +8 -0
- package/common/src/data-structures/cacheDevices/BaseCacheDevice.cjs +1 -1
- package/common/src/data-structures/cacheDevices/BaseCacheDevice.d.ts +12 -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 +13 -0
- package/common/src/data-structures/cacheDevices/FileCacheDevice.mjs +12 -3
- package/common/src/data-structures/cacheDevices/LocalStorageCacheDevice.d.ts +8 -0
- package/common/src/data-structures/cacheDevices/index.d.ts +2 -0
- package/common/src/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/common/src/data-structures/crypto-keys/decodeUTXO.d.ts +28 -0
- package/common/src/data-structures/crypto-keys/decodeUTXO.mjs +11 -71
- package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.d.ts +17 -0
- package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.mjs +39 -23
- package/common/src/data-structures/crypto-keys/index.d.ts +4 -0
- package/common/src/data-structures/crypto-keys/keyUtils.d.ts +2 -0
- package/common/src/data-structures/crypto-keys/keys.cjs +1 -1
- package/common/src/data-structures/crypto-keys/keys.d.ts +117 -0
- package/common/src/data-structures/crypto-keys/keys.mjs +64 -79
- package/common/src/data-structures/custom-token-registry/CustomTokenRegistry.d.ts +12 -0
- package/common/src/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.d.ts +34 -0
- package/common/src/data-structures/event-service/evm/AbstractEventService.d.ts +14 -0
- package/common/src/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +22 -0
- package/common/src/data-structures/event-service/evm/AbstractSnapshotService.d.ts +22 -0
- package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +38 -0
- package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.mjs +46 -38
- package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +1 -1
- package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.d.ts +11 -0
- package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +2 -2
- package/common/src/data-structures/event-service/evm/PollingBlockchainEventEmitter.d.ts +6 -0
- package/common/src/data-structures/event-service/helpers/ClientEventHelper.d.ts +10 -0
- package/common/src/data-structures/event-service/helpers/PollingEventHelper.d.ts +7 -0
- package/common/src/data-structures/event-service/index.d.ts +14 -0
- package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
- package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.d.ts +34 -0
- package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +27 -23
- package/common/src/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +17 -0
- package/common/src/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +22 -0
- package/common/src/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +21 -0
- package/common/src/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.d.ts +11 -0
- package/common/src/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.d.ts +6 -0
- package/common/src/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +42 -0
- package/common/src/data-structures/http/BasicHttpClient.d.ts +11 -0
- package/common/src/data-structures/http/HttpClient.d.ts +10 -0
- package/common/src/data-structures/http/index.d.ts +2 -0
- package/common/src/data-structures/index.d.ts +22 -0
- package/common/src/data-structures/merkle-tree/MerkleTree.cjs +1 -1
- package/common/src/data-structures/merkle-tree/MerkleTree.d.ts +93 -0
- package/common/src/data-structures/merkle-tree/MerkleTree.mjs +12 -1
- package/common/src/data-structures/merkle-tree/MerkleTreeIncompleteError.d.ts +3 -0
- package/common/src/data-structures/merkle-tree/index.d.ts +2 -0
- package/common/src/data-structures/presale/PresaleContractWrapper.d.ts +23 -0
- package/common/src/data-structures/presale/index.d.ts +1 -0
- package/common/src/data-structures/private-balances/BalanceChangedHandler.d.ts +9 -0
- package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.cjs +1 -1
- package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.d.ts +25 -0
- package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.mjs +100 -86
- package/common/src/data-structures/private-balances/index.d.ts +3 -0
- package/common/src/data-structures/private-balances/privateBalancesReducer.d.ts +2 -0
- package/common/src/data-structures/provider-adapter/IProviderAdapter.d.ts +36 -0
- package/common/src/data-structures/snapshot/SnapshotFetcherService.d.ts +14 -0
- package/common/src/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.d.ts +8 -0
- package/common/src/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.d.ts +8 -0
- package/common/src/data-structures/snapshot/index.d.ts +5 -0
- package/common/src/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.d.ts +8 -0
- package/common/src/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.d.ts +8 -0
- package/common/src/data-structures/token-price-fetcher/TokenChecker.cjs +1 -1
- package/common/src/data-structures/token-price-fetcher/TokenChecker.d.ts +10 -0
- package/common/src/data-structures/token-price-fetcher/TokenChecker.mjs +5 -3
- package/common/src/data-structures/token-price-fetcher/index.d.ts +1 -0
- package/common/src/data-structures/transactions-manager/history/history.types.d.ts +16 -0
- package/common/src/data-structures/transactions-manager/index.d.ts +1 -0
- package/common/src/data-structures/utxo/Utxo.cjs +1 -1
- package/common/src/data-structures/utxo/Utxo.d.ts +66 -0
- package/common/src/data-structures/utxo/Utxo.mjs +7 -17
- package/common/src/error-handling/customErrors/ErrorWithAmount.d.ts +4 -0
- package/common/src/error-handling/customErrors/ErrorWithIndex.d.ts +4 -0
- package/common/src/error-handling/customErrors/ErrorWithTx.d.ts +4 -0
- package/common/src/error-handling/customErrors/FeeOverTransactionValueError.d.ts +9 -0
- package/common/src/error-handling/customErrors/HttpError.d.ts +4 -0
- package/common/src/error-handling/customErrors/SimulationFailureError.d.ts +10 -0
- package/common/src/error-handling/customErrors/customErrors.helpers.d.ts +5 -0
- package/common/src/error-handling/customErrors/index.d.ts +7 -0
- package/common/src/error-handling/error-codes.constants.cjs +2 -2
- package/common/src/error-handling/error-codes.constants.d.ts +249 -0
- package/common/src/error-handling/error-codes.constants.mjs +30 -32
- package/common/src/error-handling/get-error.message.cjs +1 -1
- package/common/src/error-handling/get-error.message.d.ts +5 -0
- package/common/src/error-handling/get-error.message.mjs +28 -18
- package/common/src/error-handling/index.cjs +1 -1
- package/common/src/error-handling/index.d.ts +7 -0
- package/common/src/error-handling/index.mjs +1 -0
- package/common/src/error-handling/isInsufficientFundsError.d.ts +1 -0
- package/common/src/error-handling/logError.d.ts +1 -0
- package/common/src/error-handling/logger.d.ts +5 -0
- package/common/src/error-handling/retrySolanaError.d.ts +1 -0
- package/common/src/error-handling/types.d.ts +10 -0
- package/common/src/externalABIs/BUSD.d.ts +38 -0
- package/common/src/externalABIs/DAI.d.ts +45 -0
- package/common/src/externalABIs/SanctionsList.d.ts +35 -0
- package/common/src/externalABIs/USDC.d.ts +28 -0
- package/common/src/externalABIs/USDR.d.ts +28 -0
- package/common/src/externalABIs/USDR3CRV.d.ts +49 -0
- package/common/src/externalABIs/USDT.d.ts +41 -0
- package/common/src/externalABIs/WETH.d.ts +38 -0
- package/common/src/externalABIs/amToken.d.ts +28 -0
- package/common/src/externalABIs/index.cjs +1 -1
- package/common/src/externalABIs/index.d.ts +107 -0
- package/common/src/externalABIs/index.mjs +2 -6
- package/common/src/externalABIs/swapAbi.d.ts +77 -0
- package/common/src/functions/auto-deposit-back-helpers/get-gas-token-records.cjs +1 -1
- package/common/src/functions/auto-deposit-back-helpers/get-gas-token-records.d.ts +9 -0
- package/common/src/functions/auto-deposit-back-helpers/get-gas-token-records.mjs +7 -6
- package/common/src/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.d.ts +3 -0
- package/common/src/functions/auto-deposit-back-helpers/index.d.ts +4 -0
- package/common/src/functions/auto-deposit-back-helpers/select-gas-token.cjs +1 -1
- package/common/src/functions/auto-deposit-back-helpers/select-gas-token.d.ts +13 -0
- package/common/src/functions/auto-deposit-back-helpers/select-gas-token.mjs +8 -8
- package/common/src/functions/auto-deposit-back-helpers/update-hinkal.d.ts +2 -0
- package/common/src/functions/connectors.types.d.ts +22 -0
- package/common/src/functions/index.cjs +1 -1
- package/common/src/functions/index.d.ts +11 -0
- package/common/src/functions/index.mjs +21 -20
- package/common/src/functions/pre-transaction/addressTableLookup.d.ts +4 -0
- package/common/src/functions/pre-transaction/buildCommitmentValidationData.cjs +1 -1
- package/common/src/functions/pre-transaction/buildCommitmentValidationData.d.ts +14 -0
- 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.d.ts +2 -0
- package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.mjs +38 -5
- package/common/src/functions/pre-transaction/constructAdminData.d.ts +3 -0
- package/common/src/functions/pre-transaction/convert-okx-instructions.d.ts +11 -0
- package/common/src/functions/pre-transaction/ensureAmountChanges.cjs +1 -1
- package/common/src/functions/pre-transaction/ensureAmountChanges.d.ts +2 -0
- package/common/src/functions/pre-transaction/ensureAmountChanges.mjs +3 -10
- package/common/src/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
- package/common/src/functions/pre-transaction/getExternalSwapAddress.d.ts +2 -0
- package/common/src/functions/pre-transaction/getExternalSwapAddress.mjs +2 -18
- package/common/src/functions/pre-transaction/getFeeStructure.d.ts +5 -0
- package/common/src/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
- package/common/src/functions/pre-transaction/getSolanaCalldataHash.d.ts +4 -0
- 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.d.ts +9 -0
- package/common/src/functions/pre-transaction/getVolatileTransferAmount.mjs +1 -1
- package/common/src/functions/pre-transaction/index.cjs +1 -1
- package/common/src/functions/pre-transaction/index.d.ts +19 -0
- package/common/src/functions/pre-transaction/index.mjs +2 -3
- package/common/src/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
- package/common/src/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +3 -0
- package/common/src/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +2 -2
- package/common/src/functions/pre-transaction/merge-with-fee-structure.d.ts +2 -0
- package/common/src/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/common/src/functions/pre-transaction/outputUtxoProcessing.d.ts +6 -0
- package/common/src/functions/pre-transaction/outputUtxoProcessing.mjs +19 -18
- package/common/src/functions/pre-transaction/process-gas-estimates.d.ts +5 -0
- package/common/src/functions/pre-transaction/sendInitNullifiersTransaction.d.ts +11 -0
- package/common/src/functions/pre-transaction/sendV0Transaction.cjs +2 -2
- package/common/src/functions/pre-transaction/sendV0Transaction.d.ts +21 -0
- package/common/src/functions/pre-transaction/sendV0Transaction.mjs +4 -4
- package/common/src/functions/pre-transaction/solana-public-signals.d.ts +22 -0
- package/common/src/functions/pre-transaction/solana.cjs +1 -1
- package/common/src/functions/pre-transaction/solana.d.ts +27 -0
- package/common/src/functions/pre-transaction/solana.mjs +46 -21
- package/common/src/functions/pre-transaction/solanaTransfer.utils.cjs +1 -1
- package/common/src/functions/pre-transaction/solanaTransfer.utils.d.ts +6 -0
- package/common/src/functions/pre-transaction/solanaTransfer.utils.mjs +16 -15
- package/common/src/functions/pre-transaction/speculativeUtxo.cjs +1 -0
- package/common/src/functions/pre-transaction/speculativeUtxo.d.ts +9 -0
- package/common/src/functions/pre-transaction/speculativeUtxo.mjs +19 -0
- package/common/src/functions/pre-transaction/store-instructions.d.ts +4 -0
- package/common/src/functions/pre-transaction/store-proof.cjs +1 -1
- package/common/src/functions/pre-transaction/store-proof.d.ts +7 -0
- package/common/src/functions/pre-transaction/store-proof.mjs +1 -0
- package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.d.ts +3 -0
- package/common/src/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/common/src/functions/private-wallet/emporium.helpers.d.ts +53 -0
- package/common/src/functions/private-wallet/emporium.helpers.mjs +116 -72
- package/common/src/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/common/src/functions/private-wallet/emporium.swap.helpers.d.ts +3 -0
- package/common/src/functions/private-wallet/emporium.swap.helpers.mjs +38 -80
- package/common/src/functions/private-wallet/index.cjs +1 -1
- package/common/src/functions/private-wallet/index.d.ts +2 -0
- 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 +32 -0
- package/common/src/functions/snarkjs/common.snarkjs.mjs +104 -65
- package/common/src/functions/snarkjs/constant.cjs +1 -1
- package/common/src/functions/snarkjs/constant.d.ts +236 -0
- package/common/src/functions/snarkjs/constant.mjs +231 -145
- package/common/src/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/common/src/functions/snarkjs/constructGeneralZkProof.d.ts +13 -0
- package/common/src/functions/snarkjs/constructGeneralZkProof.mjs +85 -69
- 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 +16 -0
- package/common/src/functions/snarkjs/constructSolanaZkProof.mjs +62 -61
- package/common/src/functions/snarkjs/constructTxEnclave.cjs +1 -0
- package/common/src/functions/snarkjs/constructTxEnclave.d.ts +34 -0
- package/common/src/functions/snarkjs/constructTxEnclave.mjs +95 -0
- package/common/src/functions/snarkjs/constructTxEnclaveVerify.cjs +1 -0
- package/common/src/functions/snarkjs/constructTxEnclaveVerify.d.ts +5 -0
- package/common/src/functions/snarkjs/constructTxEnclaveVerify.mjs +295 -0
- package/common/src/functions/snarkjs/fetchMerkleTreeSiblings.d.ts +9 -0
- package/common/src/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -1
- package/common/src/functions/snarkjs/fetchOnChainRootHashes.d.ts +4 -0
- package/common/src/functions/snarkjs/fetchOnChainRootHashes.mjs +16 -18
- 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 +5 -0
- 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 +11 -0
- 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 +5 -0
- package/common/src/functions/snarkjs/generateZkProof.mjs +9 -16
- package/common/src/functions/snarkjs/generateZkProofSelf.d.ts +5 -0
- package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.cjs +1 -1
- package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.d.ts +17 -0
- package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +19 -13
- package/common/src/functions/snarkjs/getOriginalSender.d.ts +1 -0
- package/common/src/functions/snarkjs/getZKFiles.cjs +1 -1
- package/common/src/functions/snarkjs/getZKFiles.d.ts +3 -0
- 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 +10 -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 +47 -0
- package/common/src/functions/snarkjs/signedMessageHash.mjs +36 -7
- package/common/src/functions/snarkjs/verifyCommitmentValidationData.d.ts +4 -0
- 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/abi.utils.d.ts +3 -0
- package/common/src/functions/utils/addresses.cjs +1 -1
- package/common/src/functions/utils/addresses.d.ts +12 -0
- package/common/src/functions/utils/addresses.mjs +30 -21
- package/common/src/functions/utils/aggregateTokenAmounts.d.ts +2 -0
- package/common/src/functions/utils/amounts.utils.d.ts +25 -0
- package/common/src/functions/utils/arraysMatch.d.ts +1 -0
- package/common/src/functions/utils/auth.utils.d.ts +5 -0
- package/common/src/functions/utils/bridge-arrival.utils.cjs +1 -0
- package/common/src/functions/utils/bridge-arrival.utils.d.ts +1 -0
- package/common/src/functions/utils/bridge-arrival.utils.mjs +16 -0
- package/common/src/functions/utils/bridge-claimable-utxo.utils.cjs +1 -0
- package/common/src/functions/utils/bridge-claimable-utxo.utils.d.ts +19 -0
- package/common/src/functions/utils/bridge-claimable-utxo.utils.mjs +24 -0
- package/common/src/functions/utils/bridge-claimable.utils.cjs +1 -0
- package/common/src/functions/utils/bridge-claimable.utils.d.ts +15 -0
- package/common/src/functions/utils/bridge-claimable.utils.mjs +3 -0
- package/common/src/functions/utils/bridge-flow.utils.cjs +1 -0
- package/common/src/functions/utils/bridge-flow.utils.d.ts +4 -0
- package/common/src/functions/utils/bridge-flow.utils.mjs +2 -0
- package/common/src/functions/utils/buildClaimableDepositPlan.d.ts +17 -0
- package/common/src/functions/utils/bytes32.utils.d.ts +2 -0
- package/common/src/functions/utils/cacheDevice.utils.d.ts +3 -0
- package/common/src/functions/utils/cacheFunctions.d.ts +16 -0
- package/common/src/functions/utils/caseInsensitive.utils.d.ts +3 -0
- package/common/src/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -1
- package/common/src/functions/utils/convertEmporiumOpToCallInfo.d.ts +2 -0
- package/common/src/functions/utils/convertEmporiumOpToCallInfo.mjs +5 -10
- package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
- package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.d.ts +3 -0
- package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.mjs +1 -1
- package/common/src/functions/utils/create-provider.cjs +1 -1
- package/common/src/functions/utils/create-provider.d.ts +11 -0
- package/common/src/functions/utils/create-provider.mjs +45 -9
- package/common/src/functions/utils/customEnclaveFunctionsRegister.d.ts +18 -0
- package/common/src/functions/utils/deposit-claimable.utils.cjs +1 -1
- package/common/src/functions/utils/deposit-claimable.utils.d.ts +3 -0
- package/common/src/functions/utils/deposit-claimable.utils.mjs +3 -6
- package/common/src/functions/utils/dispatchBalanceRefreshes.d.ts +4 -0
- package/common/src/functions/utils/enclave-recipient-info-storage.cjs +1 -1
- package/common/src/functions/utils/enclave-recipient-info-storage.d.ts +5 -0
- package/common/src/functions/utils/enclave-recipient-info-storage.mjs +1 -0
- package/common/src/functions/utils/enclave-signature-storage.cjs +1 -1
- package/common/src/functions/utils/enclave-signature-storage.d.ts +1 -0
- package/common/src/functions/utils/enclave-signature-storage.mjs +3 -3
- package/common/src/functions/utils/enclave-utxo-storage.cjs +1 -1
- package/common/src/functions/utils/enclave-utxo-storage.d.ts +6 -0
- package/common/src/functions/utils/enclave-utxo-storage.mjs +16 -2
- package/common/src/functions/utils/enclaveHandshakeService.d.ts +10 -0
- package/common/src/functions/utils/enclaveSessionSigning.cjs +1 -0
- package/common/src/functions/utils/enclaveSessionSigning.d.ts +16 -0
- package/common/src/functions/utils/enclaveSessionSigning.mjs +2 -0
- package/common/src/functions/utils/encodeTokenWithId.cjs +1 -1
- package/common/src/functions/utils/encodeTokenWithId.d.ts +1 -0
- package/common/src/functions/utils/encodeTokenWithId.mjs +2 -5
- package/common/src/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/common/src/functions/utils/encryptInputForEnclave.d.ts +16 -0
- package/common/src/functions/utils/encryptInputForEnclave.mjs +43 -23
- package/common/src/functions/utils/enum.utils.d.ts +9 -0
- package/common/src/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/common/src/functions/utils/erc20tokenFunctions.d.ts +20 -0
- package/common/src/functions/utils/erc20tokenFunctions.mjs +2 -15
- package/common/src/functions/utils/evmNetworkFunctions.d.ts +4 -0
- package/common/src/functions/utils/external-action.utils.d.ts +3 -0
- package/common/src/functions/utils/fees.utils.cjs +1 -1
- package/common/src/functions/utils/fees.utils.d.ts +9 -0
- package/common/src/functions/utils/fees.utils.mjs +42 -29
- package/common/src/functions/utils/formatter.d.ts +3 -0
- package/common/src/functions/utils/getBlockExplorerUrl.d.ts +1 -0
- package/common/src/functions/utils/getContractAddress.d.ts +2 -0
- package/common/src/functions/utils/getDataFromTransaction.d.ts +34 -0
- package/common/src/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/common/src/functions/utils/getRecipientInfoFromUserKeys.d.ts +4 -0
- package/common/src/functions/utils/getRecipientInfoFromUserKeys.mjs +2 -3
- package/common/src/functions/utils/getSignerFromContract.d.ts +3 -0
- package/common/src/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
- package/common/src/functions/utils/getUtxosFromReceipt.utils.d.ts +6 -0
- package/common/src/functions/utils/getUtxosFromReceipt.utils.mjs +2 -26
- package/common/src/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
- package/common/src/functions/utils/getUtxosFromReceiptSolana.d.ts +7 -0
- package/common/src/functions/utils/getUtxosFromReceiptSolana.mjs +7 -24
- package/common/src/functions/utils/getWalletGroupKey.utils.d.ts +1 -0
- package/common/src/functions/utils/inLogicMetadata.d.ts +2 -0
- package/common/src/functions/utils/index.cjs +1 -1
- package/common/src/functions/utils/index.d.ts +89 -0
- package/common/src/functions/utils/index.mjs +27 -13
- package/common/src/functions/utils/involves-permit2-op.d.ts +7 -0
- package/common/src/functions/utils/ipfs.d.ts +7 -0
- package/common/src/functions/utils/is-valid-url.d.ts +1 -0
- 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/lifi.utils.d.ts +7 -0
- package/common/src/functions/utils/map.utils.d.ts +1 -0
- package/common/src/functions/utils/memoize.utils.d.ts +1 -0
- package/common/src/functions/utils/merkleTree.utils.d.ts +2 -0
- package/common/src/functions/utils/mnemonics.cjs +1 -1
- package/common/src/functions/utils/mnemonics.d.ts +1 -0
- package/common/src/functions/utils/mnemonics.mjs +4 -6
- package/common/src/functions/utils/mutexes.utils.d.ts +2 -0
- package/common/src/functions/utils/nearIntents.utils.cjs +1 -1
- package/common/src/functions/utils/nearIntents.utils.d.ts +11 -0
- package/common/src/functions/utils/nearIntents.utils.mjs +27 -13
- package/common/src/functions/utils/networks.utils.d.ts +2 -0
- package/common/src/functions/utils/nftTokenFunctions.d.ts +2 -0
- package/common/src/functions/utils/nickname.utils.d.ts +1 -0
- package/common/src/functions/utils/pay-routing.utils.d.ts +4 -0
- package/common/src/functions/utils/postToOffscreen.d.ts +2 -0
- package/common/src/functions/utils/prepareHinkal.cjs +1 -1
- package/common/src/functions/utils/prepareHinkal.d.ts +9 -0
- 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 +13 -0
- package/common/src/functions/utils/process.utils.mjs +2 -11
- package/common/src/functions/utils/proxyAvatar.utils.cjs +1 -0
- package/common/src/functions/utils/proxyAvatar.utils.d.ts +2 -0
- package/common/src/functions/utils/proxyAvatar.utils.mjs +3 -0
- package/common/src/functions/utils/publicBalance.utils.cjs +1 -1
- package/common/src/functions/utils/publicBalance.utils.d.ts +6 -0
- package/common/src/functions/utils/publicBalance.utils.mjs +37 -23
- package/common/src/functions/utils/recovery-balance.utils.cjs +1 -0
- package/common/src/functions/utils/recovery-balance.utils.d.ts +2 -0
- package/common/src/functions/utils/recovery-balance.utils.mjs +1 -0
- package/common/src/functions/utils/reloadPage.d.ts +1 -0
- package/common/src/functions/utils/requireEnv.d.ts +1 -0
- 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/resolve-sync.utils.d.ts +6 -0
- package/common/src/functions/utils/rpc-int-encode.d.ts +1 -0
- package/common/src/functions/utils/serialize-utxos.utils.cjs +1 -1
- package/common/src/functions/utils/serialize-utxos.utils.d.ts +3 -0
- package/common/src/functions/utils/serialize-utxos.utils.mjs +6 -4
- package/common/src/functions/utils/serialize.utils.d.ts +10 -0
- package/common/src/functions/utils/solana-memo.d.ts +3 -0
- package/common/src/functions/utils/solana-program.utils.cjs +1 -0
- package/common/src/functions/utils/solana-program.utils.d.ts +3 -0
- package/common/src/functions/utils/solana-program.utils.mjs +17 -0
- package/common/src/functions/utils/solana-sponsored.utils.cjs +1 -0
- package/common/src/functions/utils/solana-sponsored.utils.d.ts +22 -0
- package/common/src/functions/utils/solana-sponsored.utils.mjs +30 -0
- package/common/src/functions/utils/solanaMint.utils.cjs +1 -1
- package/common/src/functions/utils/solanaMint.utils.d.ts +17 -0
- package/common/src/functions/utils/solanaMint.utils.mjs +18 -8
- package/common/src/functions/utils/solanaSendPreflight.utils.d.ts +6 -0
- package/common/src/functions/utils/sponsored-shield.utils.cjs +1 -0
- package/common/src/functions/utils/sponsored-shield.utils.d.ts +3 -0
- package/common/src/functions/utils/sponsored-shield.utils.mjs +3 -0
- package/common/src/functions/utils/string.utils.d.ts +16 -0
- package/common/src/functions/utils/temp-wallet.utils.cjs +1 -0
- package/common/src/functions/utils/temp-wallet.utils.d.ts +8 -0
- package/common/src/functions/utils/temp-wallet.utils.mjs +43 -0
- package/common/src/functions/utils/temporary-wallet-recovery.utils.cjs +1 -0
- package/common/src/functions/utils/temporary-wallet-recovery.utils.d.ts +7 -0
- package/common/src/functions/utils/temporary-wallet-recovery.utils.mjs +10 -0
- package/common/src/functions/utils/time.utils.d.ts +20 -0
- package/common/src/functions/utils/token-check.utils.d.ts +4 -0
- package/common/src/functions/utils/transfer-claimable.utils.cjs +1 -1
- package/common/src/functions/utils/transfer-claimable.utils.d.ts +8 -0
- package/common/src/functions/utils/transfer-claimable.utils.mjs +1 -4
- package/common/src/functions/utils/trimFieldValues.d.ts +4 -0
- package/common/src/functions/utils/tron.utils.cjs +1 -1
- package/common/src/functions/utils/tron.utils.d.ts +35 -0
- package/common/src/functions/utils/tron.utils.mjs +89 -152
- package/common/src/functions/utils/tronSimulation.utils.cjs +1 -1
- package/common/src/functions/utils/tronSimulation.utils.d.ts +1 -0
- package/common/src/functions/utils/tronSimulation.utils.mjs +4 -6
- package/common/src/functions/utils/tx-confirmation.utils.cjs +1 -1
- package/common/src/functions/utils/tx-confirmation.utils.d.ts +11 -0
- package/common/src/functions/utils/tx-confirmation.utils.mjs +16 -13
- package/common/src/functions/utils/upToDateState.d.ts +2 -0
- package/common/src/functions/utils/userAgent.d.ts +2 -0
- package/common/src/functions/utils/validateUsername.d.ts +5 -0
- 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/utils/walletBalances.utils.d.ts +2 -0
- package/common/src/functions/web3/EIP-712.d.ts +23 -0
- package/common/src/functions/web3/connectors.utils.d.ts +9 -0
- package/common/src/functions/web3/crypto.d.ts +1 -0
- package/common/src/functions/web3/etherFunctions.d.ts +21 -0
- package/common/src/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/common/src/functions/web3/events/getInputUtxoAndBalance.d.ts +31 -0
- 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 +10 -0
- package/common/src/functions/web3/events/getInputUtxosEnclave.mjs +42 -35
- package/common/src/functions/web3/events/getShieldedBalance.cjs +1 -1
- package/common/src/functions/web3/events/getShieldedBalance.d.ts +18 -0
- package/common/src/functions/web3/events/getShieldedBalance.mjs +109 -93
- package/common/src/functions/web3/events/getTransactionLogEvents.d.ts +13 -0
- package/common/src/functions/web3/events/index.d.ts +3 -0
- package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.d.ts +3 -0
- 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 +4 -0
- package/common/src/functions/web3/functionCalls/approveToken.mjs +21 -107
- package/common/src/functions/web3/functionCalls/approveTokensToHinkal.d.ts +4 -0
- package/common/src/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
- package/common/src/functions/web3/functionCalls/constructBatchCall.d.ts +7 -0
- package/common/src/functions/web3/functionCalls/constructBatchCall.mjs +23 -18
- package/common/src/functions/web3/functionCalls/estimateGasRelayer.d.ts +4 -0
- package/common/src/functions/web3/functionCalls/getRootHash.d.ts +2 -0
- package/common/src/functions/web3/functionCalls/recoverTransactionFromError.d.ts +2 -0
- package/common/src/functions/web3/functionCalls/relayFunctions.d.ts +3 -0
- 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/transactCallDirect.d.ts +6 -0
- package/common/src/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -1
- package/common/src/functions/web3/functionCalls/transactCallDirectTron.d.ts +16 -0
- 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 +32 -0
- package/common/src/functions/web3/functionCalls/transactCallRelayer.mjs +12 -8
- package/common/src/functions/web3/functionCalls/waitForErc20Approvals.d.ts +11 -0
- package/common/src/functions/web3/getContractMetadata.d.ts +5 -0
- package/common/src/functions/web3/getPublicAddressBalance.cjs +1 -1
- package/common/src/functions/web3/getPublicAddressBalance.d.ts +1 -0
- package/common/src/functions/web3/getPublicAddressBalance.mjs +6 -5
- package/common/src/functions/web3/getTokenHolder.cjs +1 -1
- package/common/src/functions/web3/getTokenHolder.d.ts +1 -0
- 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 +11 -0
- package/common/src/functions/web3/index.mjs +1 -4
- package/common/src/functions/web3/lifiAPI.cjs +1 -1
- package/common/src/functions/web3/lifiAPI.d.ts +6 -0
- package/common/src/functions/web3/lifiAPI.mjs +38 -7
- package/common/src/functions/web3/okxAPI.d.ts +8 -0
- package/common/src/functions/web3/runContractFunction.d.ts +16 -0
- package/common/src/functions/web3/signAndSendSerializedTransaction.d.ts +2 -0
- package/common/src/index.d.ts +9 -0
- package/common/src/mutexes/chainBalanceRwLock.d.ts +18 -0
- package/common/src/mutexes/index.d.ts +2 -0
- package/common/src/mutexes/mutex.d.ts +2 -0
- package/common/src/providers/EthersProviderAdapter.cjs +1 -1
- package/common/src/providers/EthersProviderAdapter.d.ts +35 -0
- package/common/src/providers/EthersProviderAdapter.mjs +0 -3
- package/common/src/providers/SolanaProviderAdapter.cjs +1 -1
- package/common/src/providers/SolanaProviderAdapter.d.ts +48 -0
- package/common/src/providers/SolanaProviderAdapter.mjs +4 -11
- package/common/src/providers/TronProviderAdapter.cjs +1 -1
- package/common/src/providers/TronProviderAdapter.d.ts +38 -0
- package/common/src/providers/TronProviderAdapter.mjs +7 -4
- package/common/src/providers/WagmiProviderAdapter.cjs +1 -1
- package/common/src/providers/WagmiProviderAdapter.d.ts +47 -0
- package/common/src/providers/WagmiProviderAdapter.mjs +32 -39
- package/common/src/providers/exportProviers.d.ts +3 -0
- package/common/src/types/API.types.d.ts +21 -0
- package/common/src/types/ICacheDevice.d.ts +5 -0
- package/common/src/types/IMultiThreadedUtxoUtils.d.ts +8 -0
- package/common/src/types/RewardUserEnums.d.ts +11 -0
- package/common/src/types/TransactionSimulator.types.d.ts +16 -0
- package/common/src/types/WeeklyAnalytics.types.d.ts +12 -0
- package/common/src/types/activities.types.cjs +1 -1
- package/common/src/types/activities.types.d.ts +68 -0
- 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 +45 -0
- package/common/src/types/admin.types.mjs +1 -1
- package/common/src/types/all-points.types.d.ts +7 -0
- package/common/src/types/approvals.types.d.ts +41 -0
- package/common/src/types/balances.types.d.ts +39 -0
- package/common/src/types/big-intable.types.d.ts +3 -0
- package/common/src/types/bridging-tx.types.d.ts +40 -0
- package/common/src/types/cache.types.cjs +1 -1
- package/common/src/types/cache.types.d.ts +61 -0
- package/common/src/types/cache.types.mjs +1 -1
- package/common/src/types/chains.types.d.ts +11 -0
- package/common/src/types/circom-data.types.cjs +1 -1
- package/common/src/types/circom-data.types.d.ts +112 -0
- package/common/src/types/circom-data.types.mjs +1 -1
- package/common/src/types/coingecko.types.d.ts +220 -0
- package/common/src/types/commitments.types.d.ts +34 -0
- package/common/src/types/confirmation-request.types.d.ts +10 -0
- package/common/src/types/connector.types.d.ts +5 -0
- package/common/src/types/contacts.types.d.ts +7 -0
- package/common/src/types/dashboard-account.d.ts +116 -0
- package/common/src/types/dashboard-payout.types.d.ts +30 -0
- package/common/src/types/dashboard-transaction.types.d.ts +25 -0
- package/common/src/types/eip5792.types.d.ts +33 -0
- package/common/src/types/enclaveApi.types.d.ts +77 -0
- package/common/src/types/ethereum-network.types.cjs +1 -1
- package/common/src/types/ethereum-network.types.d.ts +46 -0
- package/common/src/types/ethereum-network.types.mjs +1 -1
- package/common/src/types/events.types.d.ts +6 -0
- package/common/src/types/external-action.types.cjs +1 -1
- package/common/src/types/external-action.types.d.ts +14 -0
- package/common/src/types/external-action.types.mjs +1 -1
- package/common/src/types/fee.types.d.ts +13 -0
- package/common/src/types/hinkal.types.cjs +1 -1
- package/common/src/types/hinkal.types.d.ts +82 -0
- package/common/src/types/hinkal.types.mjs +12 -20
- package/common/src/types/http.types.d.ts +8 -0
- package/common/src/types/index.cjs +1 -1
- package/common/src/types/index.d.ts +61 -0
- package/common/src/types/index.mjs +3 -2
- package/common/src/types/message.types.d.ts +5 -0
- package/common/src/types/near-intents.types.d.ts +62 -0
- package/common/src/types/new-rewards.type.d.ts +82 -0
- package/common/src/types/offscreen.types.cjs +1 -1
- package/common/src/types/offscreen.types.d.ts +8 -0
- package/common/src/types/offscreen.types.mjs +1 -1
- package/common/src/types/okx.types.d.ts +57 -0
- package/common/src/types/onramp.types.d.ts +58 -0
- package/common/src/types/pay-activities.types.d.ts +52 -0
- package/common/src/types/pay-routing.types.d.ts +9 -0
- package/common/src/types/payout-notification.types.d.ts +11 -0
- package/common/src/types/presaleReferral.types.d.ts +4 -0
- package/common/src/types/proxy-progress.types.d.ts +5 -0
- package/common/src/types/proxy.types.d.ts +19 -0
- package/common/src/types/remote-proof.types.d.ts +14 -0
- package/common/src/types/remote-tx-build.types.d.ts +298 -0
- package/common/src/types/schedule.types.d.ts +7 -0
- package/common/src/types/scheduled-transactions.types.d.ts +67 -0
- package/common/src/types/session.types.d.ts +13 -0
- package/common/src/types/signature.types.d.ts +10 -0
- package/common/src/types/slippage.types.d.ts +3 -0
- package/common/src/types/snark.types.d.ts +38 -0
- package/common/src/types/solana-transact.types.cjs +1 -0
- package/common/src/types/solana-transact.types.d.ts +35 -0
- package/common/src/types/solana-transact.types.mjs +6 -0
- package/common/src/types/solana.types.cjs +1 -0
- package/common/src/types/solana.types.d.ts +96 -0
- package/common/src/types/solana.types.mjs +6 -0
- package/common/src/types/temp-wallet.types.d.ts +9 -0
- package/common/src/types/tenderly.api.types.d.ts +266 -0
- package/common/src/types/token-prices.types.d.ts +18 -0
- package/common/src/types/token.types.cjs +1 -1
- package/common/src/types/token.types.d.ts +98 -0
- package/common/src/types/token.types.mjs +2 -2
- 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 +159 -0
- package/common/src/types/transactions.types.d.ts +78 -0
- package/common/src/types/tron.types.d.ts +15 -0
- package/common/src/types/wc.types.d.ts +78 -0
- package/common/src/types/with-id.types.d.ts +3 -0
- package/common/src/webworker/WorkerWrapper.d.ts +9 -0
- package/common/src/webworker/logError-ScFy7p5w.js +2 -0
- package/common/src/webworker/package.json +26 -25
- package/common/src/webworker/performTaskWithWorker.d.ts +5 -0
- package/common/src/webworker/snarkjsWorker/snarkjsWorker.types.d.ts +14 -0
- package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.d.ts +1 -0
- 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/snarkjsWorker/snarkjsWorkerLogic.d.ts +2 -0
- package/common/src/webworker/snarkjsWorker/snarkjsWorkerNode.d.ts +1 -0
- package/common/src/webworker/snarkjsWorkerNode.cjs +1 -1
- package/common/src/webworker/utxoWorker/utxoWorker.types.d.ts +33 -0
- package/common/src/webworker/utxoWorker/utxoWorkerLauncher.d.ts +1 -0
- 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/utxoWorker/utxoWorkerLogic.d.ts +5 -0
- package/common/src/webworker/utxoWorker/utxoWorkerNode.d.ts +1 -0
- package/common/src/webworker/utxoWorkerNode.cjs +1 -1
- package/common/src/webworker/viteWorkerURL.constant.cjs +3 -3
- package/common/src/webworker/viteWorkerURL.constant.d.ts +10 -0
- package/common/src/webworker/viteWorkerURL.constant.fallback.d.ts +4 -0
- package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
- package/common/src/webworker/worker.registry.d.ts +10 -0
- package/common/src/webworker/worker.types.d.ts +33 -0
- package/common/src/webworker/workerErrorHandler.d.ts +1 -0
- package/common/src/webworker/workerFactory.d.ts +11 -0
- package/common/src/webworker/workerProxy-B_eSl85g.js +1 -0
- package/common/src/webworker/workerProxy.d.ts +39 -0
- package/common/src/webworker/zkProofWorker/zkProofWorker.types.d.ts +26 -0
- package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.d.ts +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/zkProofWorker/zkProofWorkerLogic.d.ts +4 -0
- package/common/src/webworker/zkProofWorker/zkProofWorkerNode.d.ts +1 -0
- 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 +26 -25
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.d.ts +1 -0
- package/providers/prepareEthersHinkal.mjs +2 -2
- package/providers/prepareSolanaHinkal.cjs +1 -1
- package/providers/prepareSolanaHinkal.d.ts +1 -0
- package/providers/prepareSolanaHinkal.mjs +2 -2
- package/providers/prepareTronHinkal.cjs +1 -1
- package/providers/prepareTronHinkal.d.ts +1 -0
- package/providers/prepareTronHinkal.mjs +2 -2
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.d.ts +1 -0
- package/providers/prepareWagmiHinkal.mjs +2 -2
- package/services/Hinkal.cjs +1 -1
- package/services/Hinkal.d.ts +16 -10
- package/services/Hinkal.mjs +29 -17
- package/types/IHinkal.d.ts +16 -10
- package/types/swap.types.d.ts +3 -20
- package/common/src/API/accessCodeCalls.cjs +0 -1
- package/common/src/API/accessCodeCalls.mjs +0 -13
- package/common/src/API/brotherhoodCalls.cjs +0 -1
- package/common/src/API/brotherhoodCalls.mjs +0 -17
- package/common/src/API/callOdosAPI.cjs +0 -1
- package/common/src/API/callOdosAPI.mjs +0 -18
- package/common/src/API/callOneInchAPI.cjs +0 -1
- package/common/src/API/callOneInchAPI.mjs +0 -13
- package/common/src/API/deposit-and-withdraw-status-calls.cjs +0 -1
- package/common/src/API/deposit-and-withdraw-status-calls.mjs +0 -13
- package/common/src/API/generate-trading-points.cjs +0 -1
- package/common/src/API/generate-trading-points.mjs +0 -23
- package/common/src/API/leaderboardCalls.cjs +0 -1
- package/common/src/API/leaderboardCalls.mjs +0 -8
- package/common/src/API/referralsCalls.cjs +0 -1
- 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.mjs +0 -11
- package/common/src/constants/tasks.constants.cjs +0 -1
- package/common/src/constants/tasks.constants.mjs +0 -124
- package/common/src/crypto/ecdh-dual-path.cjs +0 -1
- package/common/src/crypto/ecdh-dual-path.mjs +0 -6
- package/common/src/data-structures/Hinkal/hinkalMultiSend.cjs +0 -1
- 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.mjs +0 -128
- package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.cjs +0 -1
- package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.mjs +0 -34
- package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +0 -1
- package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +0 -172
- package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.cjs +0 -1
- package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.mjs +0 -94
- package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.cjs +0 -1
- package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.mjs +0 -134
- package/common/src/data-structures/TokenDBs/PublicTokensDB.cjs +0 -1
- package/common/src/data-structures/TokenDBs/PublicTokensDB.mjs +0 -32
- package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.cjs +0 -1
- package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.mjs +0 -41
- package/common/src/data-structures/TokenDBs/TronPublicTokensDB.cjs +0 -1
- package/common/src/data-structures/TokenDBs/TronPublicTokensDB.mjs +0 -47
- package/common/src/data-structures/TokenDBs/index.cjs +0 -1
- package/common/src/data-structures/TokenDBs/index.mjs +0 -6
- 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.mjs +0 -1
- package/common/src/functions/pre-transaction/recipientUtxoProcessing.cjs +0 -1
- package/common/src/functions/pre-transaction/recipientUtxoProcessing.mjs +0 -32
- package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs +0 -1
- package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs +0 -29
- package/common/src/functions/private-wallet/opProducer.cjs +0 -1
- 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.mjs +0 -27
- package/common/src/functions/utils/bit.operations.cjs +0 -1
- 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.mjs +0 -4
- package/common/src/functions/utils/ipfs.cjs +0 -1
- package/common/src/functions/utils/ipfs.mjs +0 -1
- package/common/src/functions/utils/reloadPage.cjs +0 -1
- package/common/src/functions/utils/reloadPage.mjs +0 -4
- package/common/src/functions/web3/getSolanaPriorityFee.cjs +0 -1
- package/common/src/functions/web3/getSolanaPriorityFee.mjs +0 -26
- package/common/src/functions/web3/odosAPI.cjs +0 -1
- package/common/src/functions/web3/odosAPI.mjs +0 -35
- package/common/src/functions/web3/oneInchAPI.cjs +0 -1
- package/common/src/functions/web3/oneInchAPI.mjs +0 -34
- package/common/src/functions/web3/uniswapAPI.cjs +0 -1
- package/common/src/functions/web3/uniswapAPI.mjs +0 -60
- package/common/src/types/new-rewards.type.cjs +0 -1
- package/common/src/types/new-rewards.type.mjs +0 -10
- package/common/src/types/scheduled-transactions.types.cjs +0 -1
- package/common/src/types/scheduled-transactions.types.mjs +0 -6
- package/common/src/webworker/logError-CZYZ3oyV.js +0 -2
- package/common/src/webworker/workerProxy-DPeuP2Mg.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`);require(`../../constants/protocol.constants.cjs`);const t=require(`../../functions/utils/caseInsensitive.utils.cjs`),n=require(`../../functions/utils/amounts.utils.cjs`),r=require(`../../error-handling/error-codes.constants.cjs`),i=require(`../../functions/utils/encodeTokenWithId.cjs`),a=require(`../../error-handling/logger.cjs`),o=require(`../../functions/utils/tron.utils.cjs`),s=require(`../../functions/utils/addresses.cjs`),c=require(`../../functions/web3/events/getInputUtxoAndBalance.cjs`),l=require(`../../types/external-action.types.cjs`),u=require(`../../types/transact.types.cjs`),d=require(`../../types/solana-transact.types.cjs`),f=require(`../../functions/utils/token-check.utils.cjs`),p=require(`../../functions/snarkjs/constructTxEnclave.cjs`),m=require(`../../functions/pre-transaction/getFeeStructure.cjs`),h=require(`./hinkalTransact.cjs`),g=require(`../../functions/auto-deposit-back-helpers/update-hinkal.cjs`),_=require(`../../functions/pre-transaction/merge-with-fee-structure.cjs`),v=require(`./hinkalSolanaTransact.cjs`);var y=6,b=async(t,n,i,c)=>{let u=i.erc20TokenAddress,d=await t.getEthereumAddressByChain(n),[f,h]=await Promise.all([m.getFeeStructure(n,u,[u],l.ExternalActionId.Transact),t.getRandomRelay(n,!0)]);if(!h)throw Error(r.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let g=await p.prepareStuckWithdrawEnclaveCall(t,{chainId:n,hinkalAddress:e.networkRegistry[n].contractData.hinkalAddress,erc20Address:u,externalAddress:o.addressToHexFormat(c),relay:h,feeStructure:f,hashedEthereumAddress:s.hashEthereumAddress(d)}),_=[];for(let e=0;e<g.length;e+=1)try{let{jobId:r,signedMessageHash:i}=g[e],{R8:a,S:o}=t.userKeys.signEddsa(BigInt(i));_.push(await p.finalizeTxEnclaveCallRelay(r,{R8:a,S:o},n))}catch(e){if(!_.length)throw e;return a.Logger.error(`Stuck withdrawal partially submitted (${_.length}/${g.length})`,e),_}return _},x=async(e,t,n)=>{let r=await Promise.all(Array.from({length:y},async(r,i)=>{let a=i+1,o=await m.getFeeStructure(e,t,[t],l.ExternalActionId.Transact,void 0,void 0,{mintTo:t,recipient:n,nullifierCount:a});return[String(a),o]}));return Object.fromEntries(r)},S=async(e,t,n,i)=>{let a=n.erc20TokenAddress,[o,c,l]=await Promise.all([e.getEthereumAddressByChain(t),e.getRandomRelay(t,!0),x(t,a,i)]);if(!c)throw Error(r.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let u=await p.prepareSolanaStuckWithdrawEnclaveCall(e,{chainId:t,mintAddress:a,recipient:i,relayAddress:c,accounts:{recipient:i,mint:a===`11111111111111111111111111111111`?void 0:a},feeStructures:l,hashedEthereumAddress:s.hashEthereumAddress(o)}),d=[];for(let n=0;n<u.length;n+=1){let{jobId:r,signedMessageHash:i}=u[n],{R8:a,S:o}=e.userKeys.signEddsa(BigInt(i));d.push(await p.finalizeSolanaTxEnclaveCallRelay(r,{R8:a,S:o},t))}return d},C=async(e,t,n,i,a)=>{let s=[n.erc20TokenAddress],c=n.erc20TokenAddress,[d,f]=await Promise.all([m.getFeeStructure(t,c,s,l.ExternalActionId.Transact),e.getRandomRelay(t,!0)]);if(!f)throw Error(r.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let p=o.addressToHexFormat(a),v=i-d.flatFee;if(v<=0n)throw Error(`Insufficient balance to cover fee. Balance: ${i}, Fee: ${d.flatFee}`);let y=[-v];return await _.mergeWithFeeStructure(t,s,y,d),{tx:await h.hinkalTransact(e,{chainId:t,erc20Addresses:s,amountChanges:y,externalAddress:p,feeStructure:d,relay:f,useBlockedUtxos:!0,onTxSubmitLocally:n=>{g.updateHinkal(t,e,n.inputNullifiers?.flat(),n.outCommitments?.flat(),n.encryptedOutputs?.flat())},submit:{mode:u.SubmitMode.Relayer}}),amountToRecipient:v}},w=async(t,n,i,a,o,s)=>{let c=[i.erc20TokenAddress],{originalDeployer:u}=e.networkRegistry[n].contractData;if(!u)throw Error(`missing data`);let f=i.erc20TokenAddress,[p,h]=await Promise.all([m.getFeeStructure(n,f,c,l.ExternalActionId.Transact,void 0,void 0,{mintTo:c[0],recipient:o,nullifierCount:s}),t.getRandomRelay(n,!0)]);if(!h)throw Error(r.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let _=a-p.flatFee;if(_<=0n)throw Error(`Insufficient balance to cover fee. Balance: ${a}, Fee: ${p.flatFee}`);let y=[-_];return y[0]-=p.flatFee,{tx:await v.hinkalSolanaTransact(t,{chainId:n,mintAddresses:c,amountChanges:y,relayAddress:h,recipient:o,signer:h,functionName:`transact`,accounts:{recipient:o,mint:c[0]===`11111111111111111111111111111111`?void 0:c[0]},relayerFee:p.flatFee,variableRate:p.variableRate,useBlockedUtxos:!0,onTxSubmitLocally:({inputNullifiers:e,outCommitments:r,encryptedOutputs:i})=>{g.updateHinkal(n,t,e,r,i)},submit:{mode:d.SolanaSubmitMode.Relayer}}),amountToRecipient:_}},T=async(t,n,r,i,a,o)=>e.isSolanaLike(n)?w(t,n,r,i,a,o):C(t,n,r,i,a),E=async(e,n,r)=>{try{return((await e.getStuckShieldedBalances([n])).get(n)??[]).find(e=>t.caseInsensitiveEqual(e.token.erc20TokenAddress,r.erc20TokenAddress))?.balance??0n}catch(e){return a.Logger.error(`Failed to read stuck balance after an empty stuck withdrawal`,e),0n}},D=async(t,o,s)=>{let l=f.validateAndGetChainId([o]);if(t.generateProofRemotely){let n=e.isSolanaLike(l)?await S(t,l,o,s):await b(t,l,o,s);if(!n.length)throw await E(t,l,o)>0n?Error(r.DIRECTLY_SHOW_MESSAGE_ERROR_CODES.INSUFFICIENT_FUNDS_FOR_RECOVERY_FEES):Error(r.transactionErrorCodes.NO_STUCK_BALANCE_TO_WITHDRAW);return n}let u=[],d=i.normalizeTokenAddress(l,o.erc20TokenAddress);await t.resetMerkleTreesIfNecessary([l]);let p=((await c.getInputUtxoAndBalancePerToken({hinkal:t,sliceIfMore6:!1,useBlockedUtxos:!0,chainId:l}))?.get(d)??[]).filter(e=>e.amount>0n).sort((e,t)=>Number(t.amount-e.amount));if(!p.length)throw Error(r.transactionErrorCodes.NO_STUCK_BALANCE_TO_WITHDRAW);for(let e=0;e<p.length;e+=y){let r=p.slice(e,e+y),i=n.countTotalAmountInUtxos(r);try{let{tx:e}=await T(t,l,o,i,s,r.length);u.push(e)}catch(e){if(!u.length)throw e;return a.Logger.error(`Stuck withdrawal partially submitted (${u.length}/${Math.ceil(p.length/y)})`,e),u}}return u};exports.hinkalWithdrawStuckUtxos=D;
|
|
@@ -1,116 +1,174 @@
|
|
|
1
|
-
import { isSolanaLike as e,
|
|
1
|
+
import { isSolanaLike as e, networkRegistry as t } from "../../constants/chains.constants.mjs";
|
|
2
2
|
import "../../constants/protocol.constants.mjs";
|
|
3
|
+
import { caseInsensitiveEqual as n } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
3
4
|
import { countTotalAmountInUtxos as r } from "../../functions/utils/amounts.utils.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { updateHinkal as C } from "../../functions/auto-deposit-back-helpers/update-hinkal.mjs";
|
|
21
|
-
import { mergeWithFeeStructure as w } from "../../functions/pre-transaction/merge-with-fee-structure.mjs";
|
|
22
|
-
import { ethers as T } from "ethers";
|
|
5
|
+
import { DIRECTLY_SHOW_MESSAGE_ERROR_CODES as i, transactionErrorCodes as a } from "../../error-handling/error-codes.constants.mjs";
|
|
6
|
+
import { normalizeTokenAddress as o } from "../../functions/utils/encodeTokenWithId.mjs";
|
|
7
|
+
import { Logger as s } from "../../error-handling/logger.mjs";
|
|
8
|
+
import { addressToHexFormat as c } from "../../functions/utils/tron.utils.mjs";
|
|
9
|
+
import { hashEthereumAddress as l } from "../../functions/utils/addresses.mjs";
|
|
10
|
+
import { getInputUtxoAndBalancePerToken as u } from "../../functions/web3/events/getInputUtxoAndBalance.mjs";
|
|
11
|
+
import { ExternalActionId as d } from "../../types/external-action.types.mjs";
|
|
12
|
+
import { SubmitMode as f } from "../../types/transact.types.mjs";
|
|
13
|
+
import { SolanaSubmitMode as p } from "../../types/solana-transact.types.mjs";
|
|
14
|
+
import { validateAndGetChainId as m } from "../../functions/utils/token-check.utils.mjs";
|
|
15
|
+
import { finalizeSolanaTxEnclaveCallRelay as h, finalizeTxEnclaveCallRelay as g, prepareSolanaStuckWithdrawEnclaveCall as _, prepareStuckWithdrawEnclaveCall as v } from "../../functions/snarkjs/constructTxEnclave.mjs";
|
|
16
|
+
import { getFeeStructure as y } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
17
|
+
import { hinkalTransact as b } from "./hinkalTransact.mjs";
|
|
18
|
+
import { updateHinkal as x } from "../../functions/auto-deposit-back-helpers/update-hinkal.mjs";
|
|
19
|
+
import { mergeWithFeeStructure as S } from "../../functions/pre-transaction/merge-with-fee-structure.mjs";
|
|
20
|
+
import { hinkalSolanaTransact as C } from "./hinkalSolanaTransact.mjs";
|
|
23
21
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.ts
|
|
24
|
-
var
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
var w = 6, T = async (e, n, r, i) => {
|
|
23
|
+
let o = r.erc20TokenAddress, u = await e.getEthereumAddressByChain(n), [f, p] = await Promise.all([y(n, o, [o], d.Transact), e.getRandomRelay(n, !0)]);
|
|
24
|
+
if (!p) throw Error(a.RELAYER_NOT_AVAILABLE);
|
|
25
|
+
let m = await v(e, {
|
|
26
|
+
chainId: n,
|
|
27
|
+
hinkalAddress: t[n].contractData.hinkalAddress,
|
|
28
|
+
erc20Address: o,
|
|
29
|
+
externalAddress: c(i),
|
|
30
|
+
relay: p,
|
|
31
|
+
feeStructure: f,
|
|
32
|
+
hashedEthereumAddress: l(u)
|
|
33
|
+
}), h = [];
|
|
34
|
+
for (let t = 0; t < m.length; t += 1) try {
|
|
35
|
+
let { jobId: r, signedMessageHash: i } = m[t], { R8: a, S: o } = e.userKeys.signEddsa(BigInt(i));
|
|
36
|
+
h.push(await g(r, {
|
|
37
|
+
R8: a,
|
|
38
|
+
S: o
|
|
39
|
+
}, n));
|
|
40
|
+
} catch (e) {
|
|
41
|
+
if (!h.length) throw e;
|
|
42
|
+
return s.error(`Stuck withdrawal partially submitted (${h.length}/${m.length})`, e), h;
|
|
29
43
|
}
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}, B = {
|
|
77
|
-
proofAArr: P,
|
|
78
|
-
proofBArr: F,
|
|
79
|
-
proofCArr: I,
|
|
80
|
-
publicInputsArr: L,
|
|
81
|
-
encryptedOutputs: [N],
|
|
82
|
-
relayerFee: y.flatFee.toString(),
|
|
83
|
-
dimensions: j
|
|
84
|
-
};
|
|
85
|
-
return C(t, e, D.map((e) => e.getNullifier()), g([k]).flat(), [M]), {
|
|
86
|
-
tx: await x({
|
|
44
|
+
return h;
|
|
45
|
+
}, E = async (e, t, n) => {
|
|
46
|
+
let r = await Promise.all(Array.from({ length: w }, async (r, i) => {
|
|
47
|
+
let a = i + 1, o = await y(e, t, [t], d.Transact, void 0, void 0, {
|
|
48
|
+
mintTo: t,
|
|
49
|
+
recipient: n,
|
|
50
|
+
nullifierCount: a
|
|
51
|
+
});
|
|
52
|
+
return [String(a), o];
|
|
53
|
+
}));
|
|
54
|
+
return Object.fromEntries(r);
|
|
55
|
+
}, D = async (e, t, n, r) => {
|
|
56
|
+
let i = n.erc20TokenAddress, [o, s, c] = await Promise.all([
|
|
57
|
+
e.getEthereumAddressByChain(t),
|
|
58
|
+
e.getRandomRelay(t, !0),
|
|
59
|
+
E(t, i, r)
|
|
60
|
+
]);
|
|
61
|
+
if (!s) throw Error(a.RELAYER_NOT_AVAILABLE);
|
|
62
|
+
let u = await _(e, {
|
|
63
|
+
chainId: t,
|
|
64
|
+
mintAddress: i,
|
|
65
|
+
recipient: r,
|
|
66
|
+
relayAddress: s,
|
|
67
|
+
accounts: {
|
|
68
|
+
recipient: r,
|
|
69
|
+
mint: i === "11111111111111111111111111111111" ? void 0 : i
|
|
70
|
+
},
|
|
71
|
+
feeStructures: c,
|
|
72
|
+
hashedEthereumAddress: l(o)
|
|
73
|
+
}), d = [];
|
|
74
|
+
for (let n = 0; n < u.length; n += 1) {
|
|
75
|
+
let { jobId: r, signedMessageHash: i } = u[n], { R8: a, S: o } = e.userKeys.signEddsa(BigInt(i));
|
|
76
|
+
d.push(await h(r, {
|
|
77
|
+
R8: a,
|
|
78
|
+
S: o
|
|
79
|
+
}, t));
|
|
80
|
+
}
|
|
81
|
+
return d;
|
|
82
|
+
}, O = async (e, t, n, r, i) => {
|
|
83
|
+
let o = [n.erc20TokenAddress], s = n.erc20TokenAddress, [l, u] = await Promise.all([y(t, s, o, d.Transact), e.getRandomRelay(t, !0)]);
|
|
84
|
+
if (!u) throw Error(a.RELAYER_NOT_AVAILABLE);
|
|
85
|
+
let p = c(i), m = r - l.flatFee;
|
|
86
|
+
if (m <= 0n) throw Error(`Insufficient balance to cover fee. Balance: ${r}, Fee: ${l.flatFee}`);
|
|
87
|
+
let h = [-m];
|
|
88
|
+
return await S(t, o, h, l), {
|
|
89
|
+
tx: await b(e, {
|
|
87
90
|
chainId: t,
|
|
88
|
-
|
|
91
|
+
erc20Addresses: o,
|
|
92
|
+
amountChanges: h,
|
|
93
|
+
externalAddress: p,
|
|
94
|
+
feeStructure: l,
|
|
95
|
+
relay: u,
|
|
96
|
+
useBlockedUtxos: !0,
|
|
97
|
+
onTxSubmitLocally: (n) => {
|
|
98
|
+
x(t, e, n.inputNullifiers?.flat(), n.outCommitments?.flat(), n.encryptedOutputs?.flat());
|
|
99
|
+
},
|
|
100
|
+
submit: { mode: f.Relayer }
|
|
101
|
+
}),
|
|
102
|
+
amountToRecipient: m
|
|
103
|
+
};
|
|
104
|
+
}, k = async (e, n, r, i, o, s) => {
|
|
105
|
+
let c = [r.erc20TokenAddress], { originalDeployer: l } = t[n].contractData;
|
|
106
|
+
if (!l) throw Error("missing data");
|
|
107
|
+
let u = r.erc20TokenAddress, [f, m] = await Promise.all([y(n, u, c, d.Transact, void 0, void 0, {
|
|
108
|
+
mintTo: c[0],
|
|
109
|
+
recipient: o,
|
|
110
|
+
nullifierCount: s
|
|
111
|
+
}), e.getRandomRelay(n, !0)]);
|
|
112
|
+
if (!m) throw Error(a.RELAYER_NOT_AVAILABLE);
|
|
113
|
+
let h = i - f.flatFee;
|
|
114
|
+
if (h <= 0n) throw Error(`Insufficient balance to cover fee. Balance: ${i}, Fee: ${f.flatFee}`);
|
|
115
|
+
let g = [-h];
|
|
116
|
+
return g[0] -= f.flatFee, {
|
|
117
|
+
tx: await C(e, {
|
|
118
|
+
chainId: n,
|
|
119
|
+
mintAddresses: c,
|
|
120
|
+
amountChanges: g,
|
|
121
|
+
relayAddress: m,
|
|
122
|
+
recipient: o,
|
|
123
|
+
signer: m,
|
|
89
124
|
functionName: "transact",
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
125
|
+
accounts: {
|
|
126
|
+
recipient: o,
|
|
127
|
+
mint: c[0] === "11111111111111111111111111111111" ? void 0 : c[0]
|
|
128
|
+
},
|
|
129
|
+
relayerFee: f.flatFee,
|
|
130
|
+
variableRate: f.variableRate,
|
|
131
|
+
useBlockedUtxos: !0,
|
|
132
|
+
onTxSubmitLocally: ({ inputNullifiers: t, outCommitments: r, encryptedOutputs: i }) => {
|
|
133
|
+
x(n, e, t, r, i);
|
|
134
|
+
},
|
|
135
|
+
submit: { mode: p.Relayer }
|
|
93
136
|
}),
|
|
94
|
-
amountToRecipient:
|
|
137
|
+
amountToRecipient: h
|
|
95
138
|
};
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
139
|
+
}, A = async (t, n, r, i, a, o) => e(n) ? k(t, n, r, i, a, o) : O(t, n, r, i, a), j = async (e, t, r) => {
|
|
140
|
+
try {
|
|
141
|
+
return ((await e.getStuckShieldedBalances([t])).get(t) ?? []).find((e) => n(e.token.erc20TokenAddress, r.erc20TokenAddress))?.balance ?? 0n;
|
|
142
|
+
} catch (e) {
|
|
143
|
+
return s.error("Failed to read stuck balance after an empty stuck withdrawal", e), 0n;
|
|
144
|
+
}
|
|
145
|
+
}, M = async (t, n, c) => {
|
|
146
|
+
let l = m([n]);
|
|
147
|
+
if (t.generateProofRemotely) {
|
|
148
|
+
let r = e(l) ? await D(t, l, n, c) : await T(t, l, n, c);
|
|
149
|
+
if (!r.length) throw await j(t, l, n) > 0n ? Error(i.INSUFFICIENT_FUNDS_FOR_RECOVERY_FEES) : Error(a.NO_STUCK_BALANCE_TO_WITHDRAW);
|
|
150
|
+
return r;
|
|
151
|
+
}
|
|
152
|
+
let d = [], f = o(l, n.erc20TokenAddress);
|
|
153
|
+
await t.resetMerkleTreesIfNecessary([l]);
|
|
154
|
+
let p = ((await u({
|
|
155
|
+
hinkal: t,
|
|
104
156
|
sliceIfMore6: !1,
|
|
105
157
|
useBlockedUtxos: !0,
|
|
106
|
-
chainId:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
for (let
|
|
110
|
-
let
|
|
111
|
-
|
|
158
|
+
chainId: l
|
|
159
|
+
}))?.get(f) ?? []).filter((e) => e.amount > 0n).sort((e, t) => Number(t.amount - e.amount));
|
|
160
|
+
if (!p.length) throw Error(a.NO_STUCK_BALANCE_TO_WITHDRAW);
|
|
161
|
+
for (let e = 0; e < p.length; e += w) {
|
|
162
|
+
let i = p.slice(e, e + w), a = r(i);
|
|
163
|
+
try {
|
|
164
|
+
let { tx: e } = await A(t, l, n, a, c, i.length);
|
|
165
|
+
d.push(e);
|
|
166
|
+
} catch (e) {
|
|
167
|
+
if (!d.length) throw e;
|
|
168
|
+
return s.error(`Stuck withdrawal partially submitted (${d.length}/${Math.ceil(p.length / w)})`, e), d;
|
|
169
|
+
}
|
|
112
170
|
}
|
|
113
|
-
return
|
|
171
|
+
return d;
|
|
114
172
|
};
|
|
115
173
|
//#endregion
|
|
116
174
|
export { M as hinkalWithdrawStuckUtxos };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from './Hinkal';
|
|
2
|
+
export * from './IHinkal';
|
|
3
|
+
export * from './hinkalDeposit';
|
|
4
|
+
export * from './hinkalSwap';
|
|
5
|
+
export * from './hinkalTransfer';
|
|
6
|
+
export * from './hinkalSolanaTransfer';
|
|
7
|
+
export * from './hinkalWithdraw';
|
|
8
|
+
export * from './hinkalPrivateWallet';
|
|
9
|
+
export * from './resetMerkleTrees';
|
|
10
|
+
export * from './hinkalProxySwap';
|
|
11
|
+
export * from './hinkalSolanaProxySwap';
|
|
12
|
+
export * from './hinkalSolanaProxySend';
|
|
13
|
+
export * from './hinkalSolanaProxyShield';
|
|
14
|
+
export * from './hinkalDepositAndWithdraw';
|
|
15
|
+
export * from './hinkalClaimUtxo';
|
|
16
|
+
export * from './hinkalSolanaProoflessDeposit';
|
|
17
|
+
export * from './hinkalSolanaClaimUtxo';
|
|
18
|
+
export * from './hinkalWithdrawStuckUtxos';
|
|
19
|
+
export * from './hinkalPalSolanaDepositPrepare';
|
|
20
|
+
export * from './hinkalPalEvmDeposit';
|
|
21
|
+
export * from './hinkalPalTronDepositPrepare';
|
|
22
|
+
export * from './hinkalSolanaDepositAndWithdraw';
|
|
23
|
+
export * from './hinkalNearDepositAndBridge';
|
|
24
|
+
export * from './hinkalBridgePrivateToPrivate';
|
|
25
|
+
export * from './hinkalSolanaSponsoredShield';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CircomDataType, DimDataType } from '../../types/circom-data.types';
|
|
2
|
+
import { NewZkCallDataType } from '../../types/snark.types';
|
|
3
|
+
import { ERC20Token } from '../../types';
|
|
4
|
+
import { FeeStructure } from '../../types/hinkal.types';
|
|
5
|
+
import { Utxo } from '../utxo/Utxo';
|
|
6
|
+
import { IHinkal } from './IHinkal';
|
|
7
|
+
interface PrepareTronDepositOptions {
|
|
8
|
+
extraData?: string;
|
|
9
|
+
}
|
|
10
|
+
interface TronDepositToSelf {
|
|
11
|
+
zkCallData: NewZkCallDataType;
|
|
12
|
+
circomData: CircomDataType;
|
|
13
|
+
dimData: DimDataType;
|
|
14
|
+
utxoAmounts: bigint[];
|
|
15
|
+
totalDepositAmount: bigint;
|
|
16
|
+
depositOutputUtxos: Utxo[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Builds the ZK proof for a Tron deposit to the user's own shielded key.
|
|
20
|
+
*
|
|
21
|
+
* Produces one output UTXO per recipient amount (each holding `amount + fee`),
|
|
22
|
+
* all assigned to the user's own shielded key so they can be spent in a
|
|
23
|
+
* subsequent withdrawal step. Inputs are zero-amount padding (the circuit skips
|
|
24
|
+
* the merkle membership check when amount is 0).
|
|
25
|
+
*/
|
|
26
|
+
export declare const prepareTronDepositToSelf: (hinkal: IHinkal, chainId: number, erc20Token: ERC20Token, recipientAmounts: bigint[], feeStructure: FeeStructure, options?: PrepareTronDepositOptions) => Promise<TronDepositToSelf>;
|
|
27
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../types/ethereum-network.types.cjs`),n=require(`../../types/balances.types.cjs`),r=require(`../../types/events.types.cjs`);require(`../../types/index.cjs`);const i=require(`../../functions/utils/map.utils.cjs`),a=require(`../../functions/utils/mutexes.utils.cjs`),o=require(`../../functions/utils/create-provider.cjs`),s=require(`../../functions/utils/getContractAddress.cjs`),c=require(`../private-balances/BalanceChangedHandler.cjs`),l=require(`../event-service/evm/ClientBlockchainEventEmitter.cjs`),u=require(`../event-service/solana/ClientSolanaBlockchainEventEmitter.cjs`);require(`../event-service/index.cjs`);const d=require(`../snapshot/SnapshotFetcherService.cjs`),f=require(`../snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs`),p=require(`../snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs`),m=require(`../snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs`),h=require(`../snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs`);require(`../snapshot/index.cjs`);let g=require(`@solana/web3.js`),_=require(`async-mutex`);var v=new Map,y=e=>i.getOrCreateMapValue(v,e,()=>new _.Mutex),b=async(i,_)=>{let v=(_??i.getSupportedChains()).map(_=>y(_).runExclusive(async()=>{i.commitmentsSnapshotServiceByChain[_]?.intervalClear(),i.nullifierSnapshotServiceByChain[_]?.intervalClear();let{maxPageSize:v,
|
|
1
|
+
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../types/ethereum-network.types.cjs`),n=require(`../../types/balances.types.cjs`),r=require(`../../types/events.types.cjs`);require(`../../types/index.cjs`);const i=require(`../../functions/utils/map.utils.cjs`),a=require(`../../functions/utils/mutexes.utils.cjs`),o=require(`../../functions/utils/create-provider.cjs`),s=require(`../../functions/utils/getContractAddress.cjs`),c=require(`../private-balances/BalanceChangedHandler.cjs`),l=require(`../event-service/evm/ClientBlockchainEventEmitter.cjs`),u=require(`../event-service/solana/ClientSolanaBlockchainEventEmitter.cjs`);require(`../event-service/index.cjs`);const d=require(`../snapshot/SnapshotFetcherService.cjs`),f=require(`../snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs`),p=require(`../snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs`),m=require(`../snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs`),h=require(`../snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs`);require(`../snapshot/index.cjs`);let g=require(`@solana/web3.js`),_=require(`async-mutex`);var v=new Map,y=e=>i.getOrCreateMapValue(v,e,()=>new _.Mutex),b=async(i,_)=>{let v=(_??i.getSupportedChains()).map(_=>y(_).runExclusive(async()=>{if(i.generateProofRemotely)return;i.commitmentsSnapshotServiceByChain[_]?.intervalClear(),i.nullifierSnapshotServiceByChain[_]?.intervalClear();let{maxPageSize:v,rpcUrl:y,contractData:b}=e.networkRegistry[_],x;if(e.isSolanaLike(_)){let e=b.hinkalAddress;if(!e)throw Error(`Solana program ID is not set`);x=new u.ClientSolanaBlockchainEventEmitter(_,o.createCustomSolanaConnection(y),new g.PublicKey(e),0,a.getChainBalanceFetchingMutex(_),v);let t=b.hinkalIdl;t&&x.setIdl(t);let n=new d.SnapshotFetcherService(_,e);i.commitmentsSnapshotServiceByChain[_]=new f.ClientSolanaCommitmentsSnapshotService(x,n),i.nullifierSnapshotServiceByChain[_]=new p.ClientSolanaNullifierSnapshotService(x,n)}else{let e=i.getContractWithFetcherByChainId(_,t.ContractType.HinkalContract),n=a.getChainBalanceFetchingMutex(_);x=new l.ClientBlockchainEventEmitter(r.EventCategory.MainContractEvents,_,e,0,n,v);let o=new d.SnapshotFetcherService(_,s.getContractAddress(e));i.commitmentsSnapshotServiceByChain[_]=new m.ClientCommitmentsSnapshotService(x,o),i.nullifierSnapshotServiceByChain[_]=new h.ClientNullifierSnapshotService(x,o)}let S=i.commitmentsSnapshotServiceByChain[_],C=i.nullifierSnapshotServiceByChain[_];if(!S||!C)throw Error(`Missing snapshot service for chain ${_}`);await Promise.all([S.init(),C.init()]),await x.init(),i.merkleTreeHinkalByChain[_]=S.merkleTree,i.nullifiersByChain[_]=C.nullifiers,i.encryptedOutputsByChain[_]=S.encryptedOutputs,x.onEventsProcessed=e=>{e>0&&c.balanceChangedHandler.dispatch({updateType:n.PrivateBalanceUpdateType.FreshWithoutLoader,updateTokensListBefore:!0,chainIdToUpdate:_})}}));await Promise.allSettled(v)};exports.resetMerkleTrees=b;
|
|
@@ -22,21 +22,22 @@ import { Mutex as v } from "async-mutex";
|
|
|
22
22
|
//#region libs/shared/common/src/data-structures/Hinkal/resetMerkleTrees.ts
|
|
23
23
|
var y = /* @__PURE__ */ new Map(), b = (e) => a(y, e, () => new v()), x = async (a, v) => {
|
|
24
24
|
let y = (v ?? a.getSupportedChains()).map((v) => b(v).runExclusive(async () => {
|
|
25
|
+
if (a.generateProofRemotely) return;
|
|
25
26
|
a.commitmentsSnapshotServiceByChain[v]?.intervalClear(), a.nullifierSnapshotServiceByChain[v]?.intervalClear();
|
|
26
|
-
let { maxPageSize: y,
|
|
27
|
+
let { maxPageSize: y, rpcUrl: b, contractData: x } = t[v], S;
|
|
27
28
|
if (e(v)) {
|
|
28
29
|
let e = x.hinkalAddress;
|
|
29
|
-
if (!
|
|
30
|
+
if (!e) throw Error("Solana program ID is not set");
|
|
30
31
|
S = new d(v, s(b), new _(e), 0, o(v), y);
|
|
31
32
|
let t = x.hinkalIdl;
|
|
32
33
|
t && S.setIdl(t);
|
|
33
34
|
let n = new f(v, e);
|
|
34
35
|
a.commitmentsSnapshotServiceByChain[v] = new p(S, n), a.nullifierSnapshotServiceByChain[v] = new m(S, n);
|
|
35
36
|
} else {
|
|
36
|
-
let e = a.getContractWithFetcherByChainId(v, n.HinkalContract), t =
|
|
37
|
-
S = new u(i.MainContractEvents, v, e, 0,
|
|
38
|
-
let
|
|
39
|
-
a.commitmentsSnapshotServiceByChain[v] = new h(S,
|
|
37
|
+
let e = a.getContractWithFetcherByChainId(v, n.HinkalContract), t = o(v);
|
|
38
|
+
S = new u(i.MainContractEvents, v, e, 0, t, y);
|
|
39
|
+
let r = new f(v, c(e));
|
|
40
|
+
a.commitmentsSnapshotServiceByChain[v] = new h(S, r), a.nullifierSnapshotServiceByChain[v] = new g(S, r);
|
|
40
41
|
}
|
|
41
42
|
let C = a.commitmentsSnapshotServiceByChain[v], w = a.nullifierSnapshotServiceByChain[v];
|
|
42
43
|
if (!C || !w) throw Error(`Missing snapshot service for chain ${v}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../error-handling/error-codes.constants.cjs`),t=require(`../../
|
|
1
|
+
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../error-handling/error-codes.constants.cjs`),t=require(`../../error-handling/logger.cjs`),n=require(`../../types/activities.types.cjs`),r=require(`../../types/cache.types.cjs`);require(`../../types/index.cjs`),require(`../../error-handling/index.cjs`);const i=require(`../../constants/tx-confirmation.constants.cjs`),a=require(`../../functions/utils/tx-confirmation.utils.cjs`);require(`../../functions/index.cjs`);const o=require(`../../functions/utils/aggregateTokenAmounts.cjs`);let s=require(`idb-keyval`);var c=class{generateTxId(){return`tx_${new Date().getTime()}_${Math.random().toString(36).substring(2,15)}`}async getTransactionRecord(){return await(0,s.get)(r.StorageKeys.TX_ACTIVITY)||{}}async saveTxRequest(e){let{from:t,to:i,gasInDollar:a,extraNativeTokenFee:c,chainId:l,status:u,txHash:d,activityType:f,tokensReceive:p,tokensSpend:m,tokensApprove:h,activityIcon:g,dappUrl:_,dappName:v,integrationProvider:y,knownPartialSignature:b}=e,x=this.generateTxId(),S=m?.length?o.aggregateTokensBySymbol(m):[],C=p?.length?o.aggregateTokensBySymbol(p):[],w={id:x,from:t,to:i,gasInDollar:a?.toString(),extraNativeTokenFee:c?.toString(),chainId:l,txHash:d,activityType:f,status:u??n.ActivityStatus.PENDING,timestamp:new Date,tokensReceive:C,tokensSpend:S,tokensApprove:h,activityIcon:g,dappUrl:_,dappName:v,integrationProvider:y,knownPartialSignature:b};return await(0,s.update)(r.StorageKeys.TX_ACTIVITY,(e={})=>(e[x]=w,e)),x}async getTxRequest(e){return(await this.getTransactionRecord())[e]||null}async getAllTxRequests(e){let t=await this.getTransactionRecord();return Object.values(t).filter(t=>t.chainId===e).sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime())}async updateTxHash(e,t){let n=await this.getTxRequest(e);if(!n)throw Error(`Activity not found`);let i={...n,txHash:t};await(0,s.update)(r.StorageKeys.TX_ACTIVITY,(t={})=>(t[e]=i,t))}async updateTxStatusAndHash(e,t,n){let i=await this.getTxRequest(e);if(!i)throw Error(`Transaction not found`);let a={...i,status:t,txHash:n,timestamp:new Date};return await(0,s.update)(r.StorageKeys.TX_ACTIVITY,(t={})=>(t[e]=a,t)),a}async updateActivity(e,n,r){try{await this.updateTxStatusAndHash(e,n,r)}catch(e){t.Logger.error(`error in updating tx request`,e)}}async removePendingTransactions(e){try{await(0,s.update)(r.StorageKeys.TX_ACTIVITY,(t={})=>(delete t[e],t))}catch(e){t.Logger.error(`error in deleting tx requests`,e)}}async updatePendingTransactions(r,o,s,c){try{let t=await this.getTxRequest(o);if(!t)throw Error(`Transaction not found`);let{chainId:l}=t;if(!r.success){c?.(r.error),await this.updateActivity(o,n.ActivityStatus.FAILED,`erroredTx`in r?r.erroredTx:void 0);return}if(`txHash`in r){let{txHash:t}=r;try{await a.waitForTransactionConfirmation(l,t,{evmTimeoutMs:i.RELAYER_TX_CONFIRMATION_TIMEOUT})}catch(r){let i=r instanceof Error?r:Error(e.transactionErrorCodes.UNKNOWN);c?.(i),await this.updateActivity(o,n.ActivityStatus.FAILED,t);return}s?.(),await this.updateActivity(o,n.ActivityStatus.SUCCESSFUL,t)}}catch(e){t.Logger.error(`error in updating pending transactions`,e)}}},l=new c;exports.ActivityStorage=c,exports.activityStorage=l;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Activity, ActivityAddRequest, TransactionResponse } from '../../types';
|
|
2
|
+
export declare class ActivityStorage {
|
|
3
|
+
protected generateTxId(): string;
|
|
4
|
+
private getTransactionRecord;
|
|
5
|
+
saveTxRequest(txRequest: ActivityAddRequest): Promise<string>;
|
|
6
|
+
getTxRequest(id: string): Promise<Activity>;
|
|
7
|
+
getAllTxRequests(chainId: number): Promise<Activity[]>;
|
|
8
|
+
updateTxHash(activityId: string, newTxHash: string): Promise<void>;
|
|
9
|
+
private updateTxStatusAndHash;
|
|
10
|
+
private updateActivity;
|
|
11
|
+
removePendingTransactions(pendingActivityId: string): Promise<void>;
|
|
12
|
+
updatePendingTransactions(transactionResponse: TransactionResponse, pendingActivityId: string, onTxSuccess?: () => void, onTxError?: (errorResponse: Error) => void): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare const activityStorage: ActivityStorage;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { transactionErrorCodes as e } from "../../error-handling/error-codes.constants.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Logger as t } from "../../error-handling/logger.mjs";
|
|
3
|
+
import { ActivityStatus as n } from "../../types/activities.types.mjs";
|
|
4
|
+
import { StorageKeys as r } from "../../types/cache.types.mjs";
|
|
4
5
|
import "../../types/index.mjs";
|
|
5
|
-
import { Logger as r } from "../../error-handling/logger.mjs";
|
|
6
6
|
import "../../error-handling/index.mjs";
|
|
7
7
|
import { RELAYER_TX_CONFIRMATION_TIMEOUT as i } from "../../constants/tx-confirmation.constants.mjs";
|
|
8
8
|
import { waitForTransactionConfirmation as a } from "../../functions/utils/tx-confirmation.utils.mjs";
|
|
@@ -15,19 +15,19 @@ var l = class {
|
|
|
15
15
|
return `tx_${(/* @__PURE__ */ new Date()).getTime()}_${Math.random().toString(36).substring(2, 15)}`;
|
|
16
16
|
}
|
|
17
17
|
async getTransactionRecord() {
|
|
18
|
-
return await s(
|
|
18
|
+
return await s(r.TX_ACTIVITY) || {};
|
|
19
19
|
}
|
|
20
20
|
async saveTxRequest(e) {
|
|
21
|
-
let { from:
|
|
21
|
+
let { from: t, to: i, gasInDollar: a, extraNativeTokenFee: s, chainId: l, status: u, txHash: d, activityType: f, tokensReceive: p, tokensSpend: m, tokensApprove: h, activityIcon: g, dappUrl: _, dappName: v, integrationProvider: y, knownPartialSignature: b } = e, x = this.generateTxId(), S = m?.length ? o(m) : [], C = p?.length ? o(p) : [], w = {
|
|
22
22
|
id: x,
|
|
23
|
-
from:
|
|
23
|
+
from: t,
|
|
24
24
|
to: i,
|
|
25
25
|
gasInDollar: a?.toString(),
|
|
26
26
|
extraNativeTokenFee: s?.toString(),
|
|
27
27
|
chainId: l,
|
|
28
28
|
txHash: d,
|
|
29
29
|
activityType: f,
|
|
30
|
-
status: u ??
|
|
30
|
+
status: u ?? n.PENDING,
|
|
31
31
|
timestamp: /* @__PURE__ */ new Date(),
|
|
32
32
|
tokensReceive: C,
|
|
33
33
|
tokensSpend: S,
|
|
@@ -38,7 +38,7 @@ var l = class {
|
|
|
38
38
|
integrationProvider: y,
|
|
39
39
|
knownPartialSignature: b
|
|
40
40
|
};
|
|
41
|
-
return await c(
|
|
41
|
+
return await c(r.TX_ACTIVITY, (e = {}) => (e[x] = w, e)), x;
|
|
42
42
|
}
|
|
43
43
|
async getTxRequest(e) {
|
|
44
44
|
return (await this.getTransactionRecord())[e] || null;
|
|
@@ -48,61 +48,61 @@ var l = class {
|
|
|
48
48
|
return Object.values(t).filter((t) => t.chainId === e).sort((e, t) => new Date(t.timestamp).getTime() - new Date(e.timestamp).getTime());
|
|
49
49
|
}
|
|
50
50
|
async updateTxHash(e, t) {
|
|
51
|
-
let
|
|
52
|
-
if (!
|
|
51
|
+
let n = await this.getTxRequest(e);
|
|
52
|
+
if (!n) throw Error("Activity not found");
|
|
53
53
|
let i = {
|
|
54
|
-
...
|
|
54
|
+
...n,
|
|
55
55
|
txHash: t
|
|
56
56
|
};
|
|
57
|
-
await c(
|
|
57
|
+
await c(r.TX_ACTIVITY, (t = {}) => (t[e] = i, t));
|
|
58
58
|
}
|
|
59
|
-
async updateTxStatusAndHash(e, t,
|
|
59
|
+
async updateTxStatusAndHash(e, t, n) {
|
|
60
60
|
let i = await this.getTxRequest(e);
|
|
61
61
|
if (!i) throw Error("Transaction not found");
|
|
62
62
|
let a = {
|
|
63
63
|
...i,
|
|
64
64
|
status: t,
|
|
65
|
-
txHash:
|
|
65
|
+
txHash: n,
|
|
66
66
|
timestamp: /* @__PURE__ */ new Date()
|
|
67
67
|
};
|
|
68
|
-
return await c(
|
|
68
|
+
return await c(r.TX_ACTIVITY, (t = {}) => (t[e] = a, t)), a;
|
|
69
69
|
}
|
|
70
|
-
async updateActivity(e,
|
|
70
|
+
async updateActivity(e, n, r) {
|
|
71
71
|
try {
|
|
72
|
-
await this.updateTxStatusAndHash(e,
|
|
72
|
+
await this.updateTxStatusAndHash(e, n, r);
|
|
73
73
|
} catch (e) {
|
|
74
|
-
|
|
74
|
+
t.error("error in updating tx request", e);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
async removePendingTransactions(e) {
|
|
78
78
|
try {
|
|
79
|
-
await c(
|
|
79
|
+
await c(r.TX_ACTIVITY, (t = {}) => (delete t[e], t));
|
|
80
80
|
} catch (e) {
|
|
81
|
-
|
|
81
|
+
t.error("error in deleting tx requests", e);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
async updatePendingTransactions(
|
|
84
|
+
async updatePendingTransactions(r, o, s, c) {
|
|
85
85
|
try {
|
|
86
|
-
let
|
|
87
|
-
if (!
|
|
88
|
-
let { chainId: l } =
|
|
89
|
-
if (!
|
|
90
|
-
c?.(
|
|
86
|
+
let t = await this.getTxRequest(o);
|
|
87
|
+
if (!t) throw Error("Transaction not found");
|
|
88
|
+
let { chainId: l } = t;
|
|
89
|
+
if (!r.success) {
|
|
90
|
+
c?.(r.error), await this.updateActivity(o, n.FAILED, "erroredTx" in r ? r.erroredTx : void 0);
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
if ("txHash" in
|
|
94
|
-
let { txHash:
|
|
93
|
+
if ("txHash" in r) {
|
|
94
|
+
let { txHash: t } = r;
|
|
95
95
|
try {
|
|
96
|
-
await a(l,
|
|
97
|
-
} catch (
|
|
98
|
-
let i =
|
|
99
|
-
c?.(i), await this.updateActivity(o,
|
|
96
|
+
await a(l, t, { evmTimeoutMs: i });
|
|
97
|
+
} catch (r) {
|
|
98
|
+
let i = r instanceof Error ? r : Error(e.UNKNOWN);
|
|
99
|
+
c?.(i), await this.updateActivity(o, n.FAILED, t);
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
s?.(), await this.updateActivity(o,
|
|
102
|
+
s?.(), await this.updateActivity(o, n.SUCCESSFUL, t);
|
|
103
103
|
}
|
|
104
104
|
} catch (e) {
|
|
105
|
-
|
|
105
|
+
t.error("error in updating pending transactions", e);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
}, u = new l();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ERC20Token, TokenBalance } from '../../types';
|
|
2
|
+
interface WalletBalances {
|
|
3
|
+
[key: string]: TokenBalance[];
|
|
4
|
+
}
|
|
5
|
+
declare class PublicBalancesStorage {
|
|
6
|
+
readonly balancesRecordLabel = "walletsBalances";
|
|
7
|
+
getBalances(): Promise<WalletBalances | undefined>;
|
|
8
|
+
getBalancesByWallet(address: string, chainId: number): Promise<TokenBalance[] | undefined>;
|
|
9
|
+
setBalances(chainId: number, ethereumAddress: string, balances: TokenBalance[], concreteTokensList: ERC20Token[] | undefined): Promise<TokenBalance[]>;
|
|
10
|
+
private createBalanceLookup;
|
|
11
|
+
}
|
|
12
|
+
export declare const publicBalancesStorage: PublicBalancesStorage;
|
|
13
|
+
export {};
|