@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
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { JubPoint } from '../../crypto/babyJub';
|
|
2
|
+
import { AttachableMemoryCacheDevice } from '../cacheDevices/AttachableMemoryCacheDevice';
|
|
3
|
+
export declare const stealthPairCacheDevice: AttachableMemoryCacheDevice<{
|
|
4
|
+
H0: [bigint, bigint];
|
|
5
|
+
H1: [bigint, bigint];
|
|
6
|
+
}>;
|
|
7
|
+
export interface EncryptionKeyPair {
|
|
8
|
+
privateKey: string;
|
|
9
|
+
publicKey: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const EncryptionKeyPairDefaultValue: EncryptionKeyPair;
|
|
12
|
+
export declare class UserKeys {
|
|
13
|
+
private signature;
|
|
14
|
+
private nullifyingKey;
|
|
15
|
+
private readonly PREFIX_FOR_SPENDING_PAIR;
|
|
16
|
+
constructor(_signature?: string, _nullifyingKey?: string);
|
|
17
|
+
getSignature(): string;
|
|
18
|
+
hasSignature(): boolean;
|
|
19
|
+
setSignature(_signature: string): void;
|
|
20
|
+
private requireSignature;
|
|
21
|
+
private requireKeyMaterial;
|
|
22
|
+
verifyTronMessage(signingMessage: string, signerAddress: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* get shielded private key from message signature used to login to the application,
|
|
25
|
+
* this private key is used to generate encryption keypairs as well as public key
|
|
26
|
+
* @retuns 0x-prefixed shielded private key
|
|
27
|
+
*/
|
|
28
|
+
getShieldedPrivateKey: () => string;
|
|
29
|
+
/**
|
|
30
|
+
* getShieldedPrivateKey() is constrained to < 2^250 to match the circuit's nullifyingPrivateKey
|
|
31
|
+
* range check, so it's no longer 32 bytes and can't be used directly as raw key material for
|
|
32
|
+
* libraries that require a full-length seed.
|
|
33
|
+
* This re-expands it back to a full 32-byte seed via keccak256 for those use sites.
|
|
34
|
+
* @returns 32-byte 0x-prefixed seed
|
|
35
|
+
*/
|
|
36
|
+
private getShieldedPrivateKeySeed;
|
|
37
|
+
/**
|
|
38
|
+
* generate shielded public key from private key
|
|
39
|
+
* @param privateKey the key used to generate the shielded public key, this should be the signature
|
|
40
|
+
* that the user provided
|
|
41
|
+
* @retuns shielded public key in hexstring with 0x prefixed
|
|
42
|
+
*/
|
|
43
|
+
getShieldedPublicKey: () => string;
|
|
44
|
+
/**
|
|
45
|
+
* derive the EdDSA-Poseidon BabyJubJub public key for the spending private key. This must match
|
|
46
|
+
* the key that `signEddsa` (circomlib's signPoseidon) signs with, i.e. the scalar is derived from
|
|
47
|
+
* blake512(prv) + clamping, not from privSpendingKey directly.
|
|
48
|
+
*/
|
|
49
|
+
getSpendingKeyPair: () => {
|
|
50
|
+
privSpendingKey: string;
|
|
51
|
+
pubSpendingBJJPoint: JubPoint;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* EdDSA-Poseidon sign a message (a circom field element as bigint) using the shielded private key
|
|
55
|
+
* as the EdDSA secret. Returns { R8, S } with R8 as a JubPoint and S as a bigint scalar.
|
|
56
|
+
*/
|
|
57
|
+
signEddsa: (message: bigint) => {
|
|
58
|
+
R8: JubPoint;
|
|
59
|
+
S: bigint;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Currently used for creating shielded private keys for deposit UTXOs, which are encrypted and sent to enclave for private send
|
|
63
|
+
* @param nonce Used to deterministically generate new shielded private key
|
|
64
|
+
* @returns new shielded private key in hexstring with 0x prefixed
|
|
65
|
+
*/
|
|
66
|
+
getShieldedPrivateKeyFromNonce: (nonce: bigint) => string;
|
|
67
|
+
getClaimableSignatureFromNonce: (nonce: bigint) => string;
|
|
68
|
+
/**
|
|
69
|
+
* deterministically derive the user's NEAR Intents account id from the shielded private key.
|
|
70
|
+
* The account id is the NEAR implicit account (lowercase hex of the ed25519 public key) of the
|
|
71
|
+
* same keypair returned by getDerivedSolanaPublicKey. Used as a private cross-chain refund
|
|
72
|
+
* destination so refunds never expose the user's public main wallet.
|
|
73
|
+
*/
|
|
74
|
+
getNearIntentsAccountId: () => string;
|
|
75
|
+
/**
|
|
76
|
+
* deterministically derive the NEAR Intents signing key from the shielded private key,
|
|
77
|
+
* formatted as a near-api-js KeyPair string ("ed25519:<base58 secret>"). Pairs with
|
|
78
|
+
* getNearIntentsAccountId() and is used client-side to authorize claiming cross-chain
|
|
79
|
+
* bridge refunds back out of the user's Intents account.
|
|
80
|
+
*/
|
|
81
|
+
getNearIntentsKeyPairString: () => string;
|
|
82
|
+
/**
|
|
83
|
+
* generate access token, this accessKey is what should be sent to the server for signing
|
|
84
|
+
* @returns accessKey in hexstring with 0x prefixed
|
|
85
|
+
*/
|
|
86
|
+
getSignerPrivateKeyFromNonce: (walletNonce: bigint) => string;
|
|
87
|
+
getSignerSolanaPrivateKeyFromNonce: (walletNonce: bigint) => string;
|
|
88
|
+
verifyMessage(signingMessage: string): string;
|
|
89
|
+
verifySolanaMessage(signingMessage: string, signerPublicKey: string): boolean;
|
|
90
|
+
static getRandomizedStealthPair: (s: bigint, privateKey: string) => {
|
|
91
|
+
H0: [bigint, bigint];
|
|
92
|
+
H1: [bigint, bigint];
|
|
93
|
+
};
|
|
94
|
+
static getH1FromH0: (H0: JubPoint, privateKey: string) => JubPoint;
|
|
95
|
+
static verifyStealthPair: (H0: JubPoint, H1: JubPoint, privateKey: string, onlyYCheck?: boolean) => boolean;
|
|
96
|
+
static getStealthAddress: (H0: JubPoint, nullifyingPrivateKey: string, spendingPublicKey?: bigint[]) => string;
|
|
97
|
+
static findCorrectRandomization(initialRandomization: bigint, privateKey?: string): bigint;
|
|
98
|
+
static getH0FromRandomization: (randomization: bigint) => JubPoint;
|
|
99
|
+
static findH0(randomization: bigint, privateKey: string | undefined): JubPoint | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* generate private and public keypair
|
|
102
|
+
* @param privateKey seed to use to deterministically generate key, any DataHexString;
|
|
103
|
+
* since nullifyingKey/shieldedPrivateKey are now constrained to < 2^250 (not 32 bytes),
|
|
104
|
+
* this re-expands the input via keccak256 to get a full 32-byte seed for sodium
|
|
105
|
+
*/
|
|
106
|
+
static getEncryptionKeyPair: (privateKey: string) => EncryptionKeyPair;
|
|
107
|
+
/**
|
|
108
|
+
* generate access token, this accessKey is what should be sent to the server for signing
|
|
109
|
+
* @returns accessKey in hexstring with 0x prefixed
|
|
110
|
+
*/
|
|
111
|
+
getAccessKey: () => string;
|
|
112
|
+
/**
|
|
113
|
+
* generate backend token, which is used for access control on backend
|
|
114
|
+
* @returns accessKey in hexstring with 0x prefixed
|
|
115
|
+
*/
|
|
116
|
+
getBackendToken: () => string;
|
|
117
|
+
}
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import { CIRCOM_P as e } from "../../constants/protocol.constants.mjs";
|
|
2
|
-
import { poseidonHash as
|
|
3
|
-
import { babyJubInstance as
|
|
4
|
-
import { eddsaInstance as
|
|
5
|
-
import { AttachableMemoryCacheDevice as
|
|
6
|
-
import { getCircomSign as
|
|
7
|
-
import { ethers as
|
|
8
|
-
import { Keypair as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { Trx as
|
|
1
|
+
import { CIRCOM_P as e, NULLIFYING_PRIVATE_KEY_MOD as t } from "../../constants/protocol.constants.mjs";
|
|
2
|
+
import { poseidonHash as n } from "../../crypto/poseidon.mjs";
|
|
3
|
+
import { babyJubInstance as r } from "../../crypto/babyJub.mjs";
|
|
4
|
+
import { eddsaInstance as i } from "../../crypto/eddsa.mjs";
|
|
5
|
+
import { AttachableMemoryCacheDevice as a } from "../cacheDevices/AttachableMemoryCacheDevice.mjs";
|
|
6
|
+
import { getCircomSign as o } from "./keyUtils.mjs";
|
|
7
|
+
import { ethers as s } from "ethers";
|
|
8
|
+
import { Keypair as c, PublicKey as l } from "@solana/web3.js";
|
|
9
|
+
import u from "bs58";
|
|
10
|
+
import d from "libsodium-wrappers";
|
|
11
|
+
import f from "tweetnacl";
|
|
12
|
+
import { Trx as p } from "tronweb";
|
|
13
13
|
//#region libs/shared/common/src/data-structures/crypto-keys/keys.ts
|
|
14
|
-
var
|
|
14
|
+
var m = new a(), h = class {
|
|
15
15
|
signature;
|
|
16
16
|
nullifyingKey;
|
|
17
17
|
PREFIX_FOR_SPENDING_PAIR = "1";
|
|
18
|
-
PREFIX_FOR_NULLIFYING_PAIR = "2";
|
|
19
18
|
constructor(e, t) {
|
|
20
19
|
this.signature = e, this.nullifyingKey = t;
|
|
21
20
|
}
|
|
22
21
|
getSignature() {
|
|
23
22
|
return this.requireSignature(), this.signature;
|
|
24
23
|
}
|
|
24
|
+
hasSignature() {
|
|
25
|
+
return !!this.signature;
|
|
26
|
+
}
|
|
25
27
|
setSignature(e) {
|
|
26
28
|
this.signature = e;
|
|
27
29
|
}
|
|
@@ -32,21 +34,28 @@ var p = new i(), m = new i(), h = new i(), g = class {
|
|
|
32
34
|
if (!this.signature && !this.nullifyingKey) throw Error("No signature or private key provided");
|
|
33
35
|
}
|
|
34
36
|
verifyTronMessage(e, t) {
|
|
35
|
-
return this.requireSignature(), t ===
|
|
37
|
+
return this.requireSignature(), t === p.verifyMessageV2(e, this.signature);
|
|
36
38
|
}
|
|
37
|
-
getShieldedPrivateKey = () =>
|
|
38
|
-
|
|
39
|
+
getShieldedPrivateKey = () => {
|
|
40
|
+
if (this.requireKeyMaterial(), !this.nullifyingKey) {
|
|
41
|
+
let e = BigInt(n(this.signature));
|
|
42
|
+
this.nullifyingKey = s.toBeHex(e % t);
|
|
43
|
+
}
|
|
44
|
+
return this.nullifyingKey;
|
|
45
|
+
};
|
|
46
|
+
getShieldedPrivateKeySeed = () => s.keccak256(this.getShieldedPrivateKey());
|
|
47
|
+
getShieldedPublicKey = () => (this.requireKeyMaterial(), n(this.getShieldedPrivateKey()));
|
|
39
48
|
getSpendingKeyPair = () => {
|
|
40
49
|
this.requireSignature();
|
|
41
|
-
let e =
|
|
50
|
+
let e = i(), t = r(), a = n(this.PREFIX_FOR_SPENDING_PAIR, this.getSignature()), o = Buffer.from(s.getBytes(a)), c = e.prv2pub(o);
|
|
42
51
|
return {
|
|
43
52
|
privSpendingKey: a,
|
|
44
|
-
pubSpendingBJJPoint: [BigInt(
|
|
53
|
+
pubSpendingBJJPoint: [BigInt(t.F.toString(c[0])), BigInt(t.F.toString(c[1]))]
|
|
45
54
|
};
|
|
46
55
|
};
|
|
47
56
|
signEddsa = (e) => {
|
|
48
57
|
this.requireSignature();
|
|
49
|
-
let t =
|
|
58
|
+
let t = r(), n = i(), a = Buffer.from(s.getBytes(this.getSpendingKeyPair().privSpendingKey)), o = t.F.e(e), c = n.signPoseidon(a, o);
|
|
50
59
|
return {
|
|
51
60
|
R8: [BigInt(t.F.toString(c.R8[0])), BigInt(t.F.toString(c.R8[1]))],
|
|
52
61
|
S: BigInt(c.S)
|
|
@@ -54,96 +63,72 @@ var p = new i(), m = new i(), h = new i(), g = class {
|
|
|
54
63
|
};
|
|
55
64
|
getShieldedPrivateKeyFromNonce = (e) => {
|
|
56
65
|
this.requireKeyMaterial();
|
|
57
|
-
let
|
|
58
|
-
return
|
|
66
|
+
let t = n(e, this.getShieldedPrivateKey(), this.getShieldedPublicKey());
|
|
67
|
+
return s.keccak256(s.toUtf8Bytes(`hinkal-offchain-shielded-key:${t}`));
|
|
59
68
|
};
|
|
60
69
|
getClaimableSignatureFromNonce = (e) => {
|
|
61
70
|
this.requireKeyMaterial();
|
|
62
|
-
let
|
|
63
|
-
return
|
|
71
|
+
let t = n(e, this.getShieldedPrivateKey(), this.getShieldedPublicKey());
|
|
72
|
+
return s.keccak256(s.toUtf8Bytes(`hinkal-claimable-utxo-signature:${t}`));
|
|
64
73
|
};
|
|
65
|
-
getDerivedEthereumAddress = () => (this.requireKeyMaterial(), new o.Wallet(this.getShieldedPrivateKey()).address);
|
|
66
|
-
getDerivedSolanaPublicKey = () => (this.requireKeyMaterial(), s.fromSeed(o.getBytes(this.getShieldedPrivateKey())).publicKey.toBase58());
|
|
67
74
|
getNearIntentsAccountId = () => {
|
|
68
75
|
this.requireKeyMaterial();
|
|
69
|
-
let e =
|
|
70
|
-
return
|
|
76
|
+
let e = c.fromSeed(s.getBytes(this.getShieldedPrivateKeySeed()));
|
|
77
|
+
return s.hexlify(e.publicKey.toBytes()).slice(2);
|
|
71
78
|
};
|
|
72
79
|
getNearIntentsKeyPairString = () => {
|
|
73
80
|
this.requireKeyMaterial();
|
|
74
|
-
let e =
|
|
75
|
-
return `ed25519:${
|
|
81
|
+
let e = c.fromSeed(s.getBytes(this.getShieldedPrivateKeySeed()));
|
|
82
|
+
return `ed25519:${u.encode(e.secretKey)}`;
|
|
76
83
|
};
|
|
77
84
|
getSignerPrivateKeyFromNonce = (e) => {
|
|
78
85
|
this.requireKeyMaterial();
|
|
79
|
-
let
|
|
80
|
-
return
|
|
86
|
+
let t = n(e, this.getShieldedPrivateKey(), this.getShieldedPublicKey());
|
|
87
|
+
return s.keccak256(s.toUtf8Bytes(t));
|
|
81
88
|
};
|
|
82
89
|
getSignerSolanaPrivateKeyFromNonce = (e) => {
|
|
83
|
-
let t = this.getSignerPrivateKeyFromNonce(e), n =
|
|
84
|
-
return
|
|
90
|
+
let t = this.getSignerPrivateKeyFromNonce(e), n = s.getBytes(t), r = c.fromSeed(n);
|
|
91
|
+
return u.encode(r.secretKey);
|
|
85
92
|
};
|
|
86
93
|
verifyMessage(e) {
|
|
87
|
-
return this.requireSignature(),
|
|
94
|
+
return this.requireSignature(), s.verifyMessage(e, this.signature);
|
|
88
95
|
}
|
|
89
96
|
verifySolanaMessage(e, t) {
|
|
90
97
|
this.requireSignature();
|
|
91
|
-
let n = new TextEncoder().encode(e), r =
|
|
92
|
-
return
|
|
98
|
+
let n = new TextEncoder().encode(e), r = s.getBytes(this.signature), i = new l(t).toBytes();
|
|
99
|
+
return f.sign.detached.verify(n, r, i);
|
|
93
100
|
}
|
|
94
|
-
static
|
|
95
|
-
let
|
|
96
|
-
return {
|
|
97
|
-
H0: [BigInt(i.F.toString(o[0])), BigInt(i.F.toString(o[1]))],
|
|
98
|
-
H1: [BigInt(i.F.toString(s[0])), BigInt(i.F.toString(s[1]))]
|
|
99
|
-
};
|
|
100
|
-
});
|
|
101
|
-
static getRandomizedStealthPair = p.attach((t, r) => {
|
|
102
|
-
let i = n(), a = BigInt(r) % e, o = i.mulPointEscalar(i.Base8, t), s = i.mulPointEscalar(o, a);
|
|
101
|
+
static getRandomizedStealthPair = m.attach((e, t) => {
|
|
102
|
+
let n = r(), i = n.mulPointEscalar(n.Base8, e), a = n.mulPointEscalar(i, BigInt(t));
|
|
103
103
|
return {
|
|
104
|
-
H0: [BigInt(
|
|
105
|
-
H1: [BigInt(
|
|
104
|
+
H0: [BigInt(n.F.toString(i[0])), BigInt(n.F.toString(i[1]))],
|
|
105
|
+
H1: [BigInt(n.F.toString(a[0])), BigInt(n.F.toString(a[1]))]
|
|
106
106
|
};
|
|
107
107
|
});
|
|
108
|
-
static
|
|
109
|
-
let
|
|
110
|
-
return
|
|
111
|
-
h0: i,
|
|
112
|
-
h1: o
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
static checkSignature = (e, t, n, r) => {
|
|
116
|
-
let { h0: i, h1: a } = this.getStealthAddressCompressedPoints(e, r);
|
|
117
|
-
return t === i && n === a;
|
|
118
|
-
};
|
|
119
|
-
static getStealthAddress = h.attach((e, n) => {
|
|
120
|
-
let { H0: r, H1: i } = this.getRandomizedStealthPairOld(e, n);
|
|
121
|
-
return t(2n * a(r[0]) + a(i[0]), r[1], i[1]);
|
|
122
|
-
});
|
|
123
|
-
static getH1FromH0 = (t, r) => {
|
|
124
|
-
let i = n(), a = BigInt(r) % e, o = [i.F.e(t[0]), i.F.e(t[1])], s = i.mulPointEscalar(o, a);
|
|
125
|
-
return [BigInt(i.F.toString(s[0])), BigInt(i.F.toString(s[1]))];
|
|
108
|
+
static getH1FromH0 = (e, t) => {
|
|
109
|
+
let n = r(), i = [n.F.e(e[0]), n.F.e(e[1])], a = n.mulPointEscalar(i, BigInt(t));
|
|
110
|
+
return [BigInt(n.F.toString(a[0])), BigInt(n.F.toString(a[1]))];
|
|
126
111
|
};
|
|
127
112
|
static verifyStealthPair = (e, t, n, r = !0) => {
|
|
128
113
|
let i = this.getH1FromH0(e, n);
|
|
129
114
|
return r ? i[1] === t[1] : i === t;
|
|
130
115
|
};
|
|
131
|
-
static
|
|
116
|
+
static getStealthAddress = (e, t, r) => {
|
|
132
117
|
if (r?.length !== 2) throw Error("Spending public key must be an array of 2 elements");
|
|
133
|
-
let i = this.getH1FromH0(e,
|
|
134
|
-
return
|
|
118
|
+
let i = this.getH1FromH0(e, t);
|
|
119
|
+
return n(2n * o(e[0]) + o(i[0]), e[1], i[1], r[0], r[1], t);
|
|
135
120
|
};
|
|
136
121
|
static findCorrectRandomization(t, n) {
|
|
137
122
|
if (!n) throw Error("No Private Shielded Key Provided");
|
|
138
|
-
let r = BigInt(n)
|
|
123
|
+
let r = BigInt(n), i, a, o = 0n;
|
|
139
124
|
do
|
|
140
125
|
i = t * 10n ** o % e, a = i * r % e, o += 1n;
|
|
141
|
-
while (a >= 2n **
|
|
126
|
+
while (a >= 2n ** 250n || i >= 2n ** 250n);
|
|
142
127
|
return i;
|
|
143
128
|
}
|
|
144
129
|
static getH0FromRandomization = (e) => {
|
|
145
|
-
let t =
|
|
146
|
-
return [BigInt(t.F.toString(
|
|
130
|
+
let t = r(), n = t.mulPointEscalar(t.Base8, e);
|
|
131
|
+
return [BigInt(t.F.toString(n[0])), BigInt(t.F.toString(n[1]))];
|
|
147
132
|
};
|
|
148
133
|
static findH0(e, t) {
|
|
149
134
|
if (!t) return;
|
|
@@ -151,14 +136,14 @@ var p = new i(), m = new i(), h = new i(), g = class {
|
|
|
151
136
|
return n;
|
|
152
137
|
}
|
|
153
138
|
static getEncryptionKeyPair = (e) => {
|
|
154
|
-
let t =
|
|
139
|
+
let t = d.crypto_box_seed_keypair(s.getBytes(s.keccak256(e)));
|
|
155
140
|
return {
|
|
156
|
-
privateKey:
|
|
157
|
-
publicKey:
|
|
141
|
+
privateKey: s.hexlify(t.privateKey),
|
|
142
|
+
publicKey: s.hexlify(t.publicKey)
|
|
158
143
|
};
|
|
159
144
|
};
|
|
160
|
-
getAccessKey = () => (this.requireKeyMaterial(),
|
|
161
|
-
getBackendToken = () => (this.requireKeyMaterial(),
|
|
145
|
+
getAccessKey = () => (this.requireKeyMaterial(), n(this.getShieldedPrivateKey(), this.getShieldedPublicKey()));
|
|
146
|
+
getBackendToken = () => (this.requireKeyMaterial(), n(this.getAccessKey(), this.getShieldedPublicKey()));
|
|
162
147
|
};
|
|
163
148
|
//#endregion
|
|
164
|
-
export {
|
|
149
|
+
export { h as UserKeys, m as stealthPairCacheDevice };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ERC20Token } from '../../types';
|
|
2
|
+
declare class CustomTokenRegistry {
|
|
3
|
+
tokenRegistry: ERC20Token[];
|
|
4
|
+
constructor();
|
|
5
|
+
setTokensFromCache(newTokenRegistries: ERC20Token[]): void;
|
|
6
|
+
getCustomTokens(chainId: number): ERC20Token[];
|
|
7
|
+
tokenExists(registry: ERC20Token[], tokenToCheck: ERC20Token): ERC20Token | undefined;
|
|
8
|
+
addCustomToken(token: ERC20Token): void;
|
|
9
|
+
removeCustomToken(tokenToRemove: ERC20Token): void;
|
|
10
|
+
}
|
|
11
|
+
export declare const customTokenRegistry: CustomTokenRegistry;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { MerkleTree, MerkleTreeJson } from '../../merkle-tree';
|
|
2
|
+
import { CommitmentEvent, EncryptedOutputWithCommitment, EncryptedOutputWithSign } from '../../../types';
|
|
3
|
+
import { AbstractSnapshotService, Snapshot } from './AbstractSnapshotService';
|
|
4
|
+
import { BlockchainEventEmitter } from './BlockchainEventEmitter';
|
|
5
|
+
import { BlockchainEvent } from '../../BlockchainEvent/BlockchainEvent';
|
|
6
|
+
export type CommitmentsSnapshotPayload = {
|
|
7
|
+
readonly merkleTree: MerkleTree<bigint>;
|
|
8
|
+
readonly encryptedOutputs: EncryptedOutputWithSign[];
|
|
9
|
+
readonly encryptedOutputsByCommitment: Map<bigint, string>;
|
|
10
|
+
};
|
|
11
|
+
export type CommitmentsSerializedSnapshot = {
|
|
12
|
+
latestBlockNumber?: number;
|
|
13
|
+
merkleTree?: MerkleTreeJson;
|
|
14
|
+
encryptedOutputs?: EncryptedOutputWithSign<string>[];
|
|
15
|
+
encryptedOutputsByCommitment?: EncryptedOutputWithCommitment[];
|
|
16
|
+
};
|
|
17
|
+
export declare abstract class AbstractCommitmentsSnapshotService extends AbstractSnapshotService<CommitmentEvent<bigint>, CommitmentsSnapshotPayload, CommitmentsSerializedSnapshot> {
|
|
18
|
+
constructor(hinkalEventEmitter: BlockchainEventEmitter);
|
|
19
|
+
private _merkleTree;
|
|
20
|
+
private _encryptedOutputs;
|
|
21
|
+
private _encryptedOutputsByCommitment;
|
|
22
|
+
get merkleTree(): MerkleTree<bigint>;
|
|
23
|
+
get encryptedOutputs(): EncryptedOutputWithSign<boolean>[];
|
|
24
|
+
protected serializeSnapshot(snapshot: Snapshot<CommitmentsSnapshotPayload>): CommitmentsSerializedSnapshot;
|
|
25
|
+
protected deserializeSnapshot(serializedSnapshot: CommitmentsSerializedSnapshot): Snapshot<CommitmentsSnapshotPayload>;
|
|
26
|
+
protected getSnapshotPayload(): {
|
|
27
|
+
merkleTree: MerkleTree<bigint>;
|
|
28
|
+
encryptedOutputs: EncryptedOutputWithSign<boolean>[];
|
|
29
|
+
encryptedOutputsByCommitment: Map<bigint, string>;
|
|
30
|
+
};
|
|
31
|
+
protected populateSnapshot({ payload: { merkleTree, encryptedOutputs, encryptedOutputsByCommitment }, }: Snapshot<CommitmentsSnapshotPayload>): void;
|
|
32
|
+
protected mapEvent(event: BlockchainEvent): CommitmentEvent<bigint>;
|
|
33
|
+
protected acceptEvent(event: CommitmentEvent<bigint>, _blockNumber: number, _txHash?: string, isBlocked?: boolean): boolean;
|
|
34
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BlockchainEvent } from '../../BlockchainEvent/BlockchainEvent';
|
|
2
|
+
import { BlockchainEventEmitter } from './BlockchainEventEmitter';
|
|
3
|
+
export declare abstract class AbstractEventService<EventType> {
|
|
4
|
+
protected blockchainEventEmitter: BlockchainEventEmitter;
|
|
5
|
+
protected readonly eventName: string;
|
|
6
|
+
protected constructor(blockchainEventEmitter: BlockchainEventEmitter, eventName: string);
|
|
7
|
+
get latestBlockNumber(): number;
|
|
8
|
+
get chainId(): number;
|
|
9
|
+
intervalClear(): void;
|
|
10
|
+
private processEventsPage;
|
|
11
|
+
protected abstract acceptEvent(event: EventType, blockNumber: number, txHash?: string, isBlocked?: boolean): boolean | Promise<boolean>;
|
|
12
|
+
protected abstract mapEvent(event: BlockchainEvent): EventType;
|
|
13
|
+
protected abstract afterEventsAccepted(eventsCount: number): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NullifierEvent } from '../../../types/commitments.types';
|
|
2
|
+
import { AbstractSnapshotService, Snapshot } from './AbstractSnapshotService';
|
|
3
|
+
import { BlockchainEventEmitter } from './BlockchainEventEmitter';
|
|
4
|
+
import { BlockchainEvent } from '../../BlockchainEvent/BlockchainEvent';
|
|
5
|
+
export type NullifierSnapshotPayload = {
|
|
6
|
+
readonly nullifiers: Set<string>;
|
|
7
|
+
};
|
|
8
|
+
export type NullifierSerializedSnapshot = {
|
|
9
|
+
latestBlockNumber?: number;
|
|
10
|
+
nullifiers?: string[];
|
|
11
|
+
};
|
|
12
|
+
export declare abstract class AbstractNullifierSnapshotService extends AbstractSnapshotService<NullifierEvent<string>, NullifierSnapshotPayload, NullifierSerializedSnapshot> {
|
|
13
|
+
constructor(hinkalEventEmitter: BlockchainEventEmitter);
|
|
14
|
+
private _nullifiers;
|
|
15
|
+
get nullifiers(): Set<string>;
|
|
16
|
+
protected serializeSnapshot(snapshot: Snapshot<NullifierSnapshotPayload>): NullifierSerializedSnapshot;
|
|
17
|
+
protected deserializeSnapshot(serializedSnapshot: NullifierSerializedSnapshot): Snapshot<NullifierSnapshotPayload>;
|
|
18
|
+
protected acceptEvent(event: NullifierEvent<string>, _blockNumber: number): boolean;
|
|
19
|
+
protected mapEvent(event: BlockchainEvent): NullifierEvent<string>;
|
|
20
|
+
protected getSnapshotPayload(): NullifierSnapshotPayload;
|
|
21
|
+
protected populateSnapshot({ payload: { nullifiers } }: Snapshot<NullifierSnapshotPayload>): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AbstractEventService } from './AbstractEventService';
|
|
2
|
+
import { BlockchainEventEmitter } from './BlockchainEventEmitter';
|
|
3
|
+
export interface Snapshot<SnapshotPayloadType> {
|
|
4
|
+
readonly latestBlockNumber: number;
|
|
5
|
+
readonly payload: SnapshotPayloadType;
|
|
6
|
+
}
|
|
7
|
+
export declare abstract class AbstractSnapshotService<EventType, SnapshotPayloadType, SerializedSnapshotType> extends AbstractEventService<EventType> {
|
|
8
|
+
private savedLatestBlockNumber;
|
|
9
|
+
protected constructor(blockchainEventEmitter: BlockchainEventEmitter, eventName: string);
|
|
10
|
+
init(): Promise<void>;
|
|
11
|
+
retrieveEventsFromLatestBlock(): Promise<void>;
|
|
12
|
+
get isReady(): boolean;
|
|
13
|
+
private loadSnapshot;
|
|
14
|
+
protected saveSnapshot(): Promise<unknown>;
|
|
15
|
+
protected afterEventsAccepted(eventsCount: number): Promise<void>;
|
|
16
|
+
protected abstract getSnapshotPayload(): SnapshotPayloadType;
|
|
17
|
+
protected abstract populateSnapshot(snapshot: Snapshot<SnapshotPayloadType>): void;
|
|
18
|
+
protected abstract serializeSnapshot(snapshot: Snapshot<SnapshotPayloadType>): SerializedSnapshotType;
|
|
19
|
+
protected abstract deserializeSnapshot(serializedSnapshot: SerializedSnapshotType): Snapshot<SnapshotPayloadType>;
|
|
20
|
+
protected abstract fetchSnapshot(): Promise<SerializedSnapshotType>;
|
|
21
|
+
protected abstract persistSnapshot(serializedSnapshot: SerializedSnapshotType): Promise<unknown>;
|
|
22
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../error-handling/logger.cjs`),
|
|
1
|
+
require(`../../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../constants/chains.constants.cjs`),t=require(`../../../error-handling/logger.cjs`),n=require(`../../../types/ethereum-network.types.cjs`),r=require(`../../../constants/contracts.constants.cjs`),i=require(`../../../functions/web3/getContractMetadata.cjs`),a=require(`../../../functions/utils/getSignerFromContract.cjs`),o=require(`../../../functions/utils/resolve-sync.utils.cjs`),s=require(`../../../constants/reorg-depths.constants.cjs`),c=require(`../../BlockchainEvent/BlockchainEvent.cjs`);let l=require(`ethers`);var u=class{RETRY_MIN_PAGE_SIZE=100;MAX_RETRIES=20;_chainId;contract;_latestBlockNumber;_blockedUtxosContract;_initialBlockNumber;onEventsProcessed;eventProcessors=new Set;maxPageSize;_isReady=!1;isServer;inProgress;eventsFetchingMutex;constructor(e,t,n,r,i,a){this.contract=t,this._chainId=e,this._initialBlockNumber=n,this.maxPageSize=a,this.isServer=r,this.inProgress=!1,this.eventsFetchingMutex=i}get latestBlockNumber(){return this._latestBlockNumber??this._initialBlockNumber}get chainId(){return this._chainId}get isReady(){return this._isReady}syncFromAtMost(e){(this._latestBlockNumber===void 0||e<this._latestBlockNumber)&&(this._latestBlockNumber=e)}advanceLatestBlockNumber(e){e>(this._latestBlockNumber??this._initialBlockNumber)&&(this._latestBlockNumber=e)}intervalClear(){this._isReady=!1,this.eventProcessors=new Set,this.clear()}async init(){if(this._isReady)throw Error(`Already initialized`);this._isReady=!0,await this.retrieveEvents(this.latestBlockNumber+1),this.startUpdateListener()}requireReady(){if(!this._isReady)throw Error(`Not ready`)}async getEventsForSingleContract(e,t,n,r=0,i=`*`){try{return(await e.queryFilter(i,t,n)).filter(e=>e instanceof l.ethers.EventLog)}catch(a){if(r<this.MAX_RETRIES&&n-t>this.RETRY_MIN_PAGE_SIZE){let a=Math.floor((t+n)/2),o=await this.getEventsForSingleContract(e,t,a,r+1,i),s=await this.getEventsForSingleContract(e,a+1,n,r+1,i);return[...o,...s]}throw a}}get blockedUtxosContract(){if(this._blockedUtxosContract===void 0){let t=e.getNonLocalhostChainId(this._chainId);this._blockedUtxosContract=r.getDepositOnChainUtxosAddress(t)?i.getContractWithFetcherByChainId(t,n.ContractType.DepositOnChainUtxosContract):null}return this._blockedUtxosContract??void 0}addEventProcessorFunction(e){if(this._isReady)throw Error(`Can't add event processor after event emitter initialized`);this.eventProcessors.add(e)}async getEventsInRange(e,t){let n=[];return await o.resolveSync(o.getSequence(e,t,this.maxPageSize).map(({from:e,to:t})=>async()=>{let r=await this.getEventsForSingleContract(this.contract,e,t);n.push(...r);let i=this.blockedUtxosContract;i&&n.push(...await this.getEventsForSingleContract(i,e,t,0,`BlockedUtxosCreated`))})),n.map(e=>c.BlockchainEvent.fromEthers(e))}async getLastBlockNumberForEventRequest(){let e=await a.getProviderFromContract(this.contract).getBlockNumber();if(!this.isServer)return e;let{chainId:t}=await a.getProviderFromContract(this.contract).getNetwork();return Math.max(this.latestBlockNumber,e-s.blockReorgDepth[Number(t)]+1)}async retrieveEvents(e,n=!1){return this.requireReady(),await this.eventsFetchingMutex.runExclusive(async()=>{try{if(this.inProgress&&!n)return!1;this.inProgress=!0;let t=await this.getLastBlockNumberForEventRequest();if(t<e)return this.inProgress=!1,!1;let r=await this.getEventsInRange(e,t);return await this.processEvents(r,t),this._latestBlockNumber=t,this.inProgress=!1,!0}catch(e){return t.Logger.error(`retrieveEvents error`,e),this.inProgress=!1,!1}})}async processEvents(e,t){let n=(await Promise.all([...this.eventProcessors].map(n=>n(e,t)))).reduce((e,t)=>e+t,0);this.onEventsProcessed?.(n)}};exports.BlockchainEventEmitter=u;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
2
|
+
import { ChainBalanceFetchingLock } from '../../../mutexes/chainBalanceRwLock';
|
|
3
|
+
import { EventProcessorFunction } from '../../../types/events.types';
|
|
4
|
+
import { BlockchainEvent } from '../../BlockchainEvent/BlockchainEvent';
|
|
5
|
+
export declare abstract class BlockchainEventEmitter {
|
|
6
|
+
private readonly RETRY_MIN_PAGE_SIZE;
|
|
7
|
+
private readonly MAX_RETRIES;
|
|
8
|
+
private readonly _chainId;
|
|
9
|
+
readonly contract: ethers.Contract;
|
|
10
|
+
private _latestBlockNumber;
|
|
11
|
+
private _blockedUtxosContract;
|
|
12
|
+
private _initialBlockNumber;
|
|
13
|
+
onEventsProcessed?: (acceptedEventCount: number) => void;
|
|
14
|
+
private eventProcessors;
|
|
15
|
+
private readonly maxPageSize?;
|
|
16
|
+
private _isReady;
|
|
17
|
+
protected isServer: boolean;
|
|
18
|
+
private inProgress;
|
|
19
|
+
protected eventsFetchingMutex: ChainBalanceFetchingLock;
|
|
20
|
+
constructor(chainId: number, contract: ethers.Contract, initialBlockNumber: number, isServer: boolean, eventsFetchingMutex: ChainBalanceFetchingLock, maxPageSize?: number);
|
|
21
|
+
get latestBlockNumber(): number;
|
|
22
|
+
get chainId(): number;
|
|
23
|
+
get isReady(): boolean;
|
|
24
|
+
syncFromAtMost(blockNumber: number): void;
|
|
25
|
+
protected advanceLatestBlockNumber(blockNumber: number): void;
|
|
26
|
+
intervalClear(): void;
|
|
27
|
+
init(): Promise<void>;
|
|
28
|
+
private requireReady;
|
|
29
|
+
private getEventsForSingleContract;
|
|
30
|
+
private get blockedUtxosContract();
|
|
31
|
+
addEventProcessorFunction(eventProcessorFunction: EventProcessorFunction): void;
|
|
32
|
+
getEventsInRange(fromBlockNumber: number, toBlockNumber: number): Promise<BlockchainEvent[]>;
|
|
33
|
+
getLastBlockNumberForEventRequest(): Promise<number>;
|
|
34
|
+
retrieveEvents(fromBlockNumber: number, useForce?: boolean): Promise<boolean>;
|
|
35
|
+
protected processEvents(events: BlockchainEvent[], scannedToBlock?: number): Promise<void>;
|
|
36
|
+
protected abstract clear(): void;
|
|
37
|
+
protected abstract startUpdateListener(): void;
|
|
38
|
+
}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { getNonLocalhostChainId as e } from "../../../constants/chains.constants.mjs";
|
|
2
|
+
import { Logger as t } from "../../../error-handling/logger.mjs";
|
|
3
|
+
import { ContractType as n } from "../../../types/ethereum-network.types.mjs";
|
|
4
|
+
import { getDepositOnChainUtxosAddress as r } from "../../../constants/contracts.constants.mjs";
|
|
5
|
+
import { getContractWithFetcherByChainId as i } from "../../../functions/web3/getContractMetadata.mjs";
|
|
6
|
+
import { getProviderFromContract as a } from "../../../functions/utils/getSignerFromContract.mjs";
|
|
7
|
+
import { getSequence as o, resolveSync as s } from "../../../functions/utils/resolve-sync.utils.mjs";
|
|
8
|
+
import { blockReorgDepth as c } from "../../../constants/reorg-depths.constants.mjs";
|
|
9
|
+
import { BlockchainEvent as l } from "../../BlockchainEvent/BlockchainEvent.mjs";
|
|
10
|
+
import { ethers as u } from "ethers";
|
|
7
11
|
//#region libs/shared/common/src/data-structures/event-service/evm/BlockchainEventEmitter.ts
|
|
8
|
-
var
|
|
12
|
+
var d = class {
|
|
9
13
|
RETRY_MIN_PAGE_SIZE = 100;
|
|
10
14
|
MAX_RETRIES = 20;
|
|
11
15
|
_chainId;
|
|
12
16
|
contract;
|
|
13
|
-
depositOnChainUtxosContract;
|
|
14
17
|
_latestBlockNumber;
|
|
18
|
+
_blockedUtxosContract;
|
|
15
19
|
_initialBlockNumber;
|
|
16
20
|
onEventsProcessed;
|
|
17
21
|
eventProcessors = /* @__PURE__ */ new Set();
|
|
@@ -20,8 +24,8 @@ var s = class {
|
|
|
20
24
|
isServer;
|
|
21
25
|
inProgress;
|
|
22
26
|
eventsFetchingMutex;
|
|
23
|
-
constructor(e, t, n, r, i, a
|
|
24
|
-
this.contract = t, this.
|
|
27
|
+
constructor(e, t, n, r, i, a) {
|
|
28
|
+
this.contract = t, this._chainId = e, this._initialBlockNumber = n, this.maxPageSize = a, this.isServer = r, this.inProgress = !1, this.eventsFetchingMutex = i;
|
|
25
29
|
}
|
|
26
30
|
get latestBlockNumber() {
|
|
27
31
|
return this._latestBlockNumber ?? this._initialBlockNumber;
|
|
@@ -48,50 +52,54 @@ var s = class {
|
|
|
48
52
|
requireReady() {
|
|
49
53
|
if (!this._isReady) throw Error("Not ready");
|
|
50
54
|
}
|
|
51
|
-
async getEventsForSingleContract(e, t, n, r = 0) {
|
|
55
|
+
async getEventsForSingleContract(e, t, n, r = 0, i = "*") {
|
|
52
56
|
try {
|
|
53
|
-
return (await e.queryFilter(
|
|
54
|
-
} catch (
|
|
57
|
+
return (await e.queryFilter(i, t, n)).filter((e) => e instanceof u.EventLog);
|
|
58
|
+
} catch (a) {
|
|
55
59
|
if (r < this.MAX_RETRIES && n - t > this.RETRY_MIN_PAGE_SIZE) {
|
|
56
|
-
let
|
|
57
|
-
return [...
|
|
60
|
+
let a = Math.floor((t + n) / 2), o = await this.getEventsForSingleContract(e, t, a, r + 1, i), s = await this.getEventsForSingleContract(e, a + 1, n, r + 1, i);
|
|
61
|
+
return [...o, ...s];
|
|
58
62
|
}
|
|
59
|
-
throw
|
|
63
|
+
throw a;
|
|
60
64
|
}
|
|
61
65
|
}
|
|
66
|
+
get blockedUtxosContract() {
|
|
67
|
+
if (this._blockedUtxosContract === void 0) {
|
|
68
|
+
let t = e(this._chainId);
|
|
69
|
+
this._blockedUtxosContract = r(t) ? i(t, n.DepositOnChainUtxosContract) : null;
|
|
70
|
+
}
|
|
71
|
+
return this._blockedUtxosContract ?? void 0;
|
|
72
|
+
}
|
|
62
73
|
addEventProcessorFunction(e) {
|
|
63
74
|
if (this._isReady) throw Error("Can't add event processor after event emitter initialized");
|
|
64
75
|
this.eventProcessors.add(e);
|
|
65
76
|
}
|
|
66
|
-
async getEventsInRange(e,
|
|
67
|
-
let
|
|
68
|
-
await
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
let n = await this.getEventsForSingleContract(s, e, t);
|
|
75
|
-
i.push(...n);
|
|
76
|
-
})), i.map((e) => a.fromEthers(e));
|
|
77
|
+
async getEventsInRange(e, t) {
|
|
78
|
+
let n = [];
|
|
79
|
+
return await s(o(e, t, this.maxPageSize).map(({ from: e, to: t }) => async () => {
|
|
80
|
+
let r = await this.getEventsForSingleContract(this.contract, e, t);
|
|
81
|
+
n.push(...r);
|
|
82
|
+
let i = this.blockedUtxosContract;
|
|
83
|
+
i && n.push(...await this.getEventsForSingleContract(i, e, t, 0, "BlockedUtxosCreated"));
|
|
84
|
+
})), n.map((e) => l.fromEthers(e));
|
|
77
85
|
}
|
|
78
86
|
async getLastBlockNumberForEventRequest() {
|
|
79
|
-
let e = await
|
|
87
|
+
let e = await a(this.contract).getBlockNumber();
|
|
80
88
|
if (!this.isServer) return e;
|
|
81
|
-
let { chainId: t } = await
|
|
82
|
-
return Math.max(this.latestBlockNumber, e -
|
|
89
|
+
let { chainId: t } = await a(this.contract).getNetwork();
|
|
90
|
+
return Math.max(this.latestBlockNumber, e - c[Number(t)] + 1);
|
|
83
91
|
}
|
|
84
|
-
async retrieveEvents(
|
|
92
|
+
async retrieveEvents(e, n = !1) {
|
|
85
93
|
return this.requireReady(), await this.eventsFetchingMutex.runExclusive(async () => {
|
|
86
94
|
try {
|
|
87
95
|
if (this.inProgress && !n) return !1;
|
|
88
96
|
this.inProgress = !0;
|
|
89
|
-
let
|
|
90
|
-
if (
|
|
91
|
-
let r = await this.getEventsInRange(
|
|
92
|
-
return await this.processEvents(r,
|
|
93
|
-
} catch (
|
|
94
|
-
return
|
|
97
|
+
let t = await this.getLastBlockNumberForEventRequest();
|
|
98
|
+
if (t < e) return this.inProgress = !1, !1;
|
|
99
|
+
let r = await this.getEventsInRange(e, t);
|
|
100
|
+
return await this.processEvents(r, t), this._latestBlockNumber = t, this.inProgress = !1, !0;
|
|
101
|
+
} catch (e) {
|
|
102
|
+
return t.error("retrieveEvents error", e), this.inProgress = !1, !1;
|
|
95
103
|
}
|
|
96
104
|
});
|
|
97
105
|
}
|
|
@@ -101,4 +109,4 @@ var s = class {
|
|
|
101
109
|
}
|
|
102
110
|
};
|
|
103
111
|
//#endregion
|
|
104
|
-
export {
|
|
112
|
+
export { d as BlockchainEventEmitter };
|