DepositClient provides full deposit functionality without React. Use it for server-side scripts, Node.js backends, or custom UI frameworks.
DepositClient
Constructor Config
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
ownerAddress | string | Yes | — | User’s wallet address. |
intermediaryAddress | string | Yes | — | JWT wallet from Auth Core. |
authCoreProvider | AuthCoreProvider | No* | — | Provider for signing. *Required for sweeps. |
destination | DestinationConfig | Yes | — | Where swept funds go (chainId required). |
supportedTokens | TokenType[] | No | All | Tokens to watch. |
supportedChains | number[] | No | All 17 | Chains to watch. |
autoSweep | boolean | No | true | Auto-sweep on detection. |
minValueUSD | number | No | 0.50 | Minimum USD threshold. |
pollingIntervalMs | number | No | 3000 | Polling interval (ms). |
recovery | RecoveryConfig | No | — | Recovery behavior. |
refund | RefundConfig | No | { enabled: false } | Auto-refund (experimental). |
funding | FundingConfig | No | { enabled: false } | Fund the deposit address from a connected browser wallet (zero-config). |
onDepositEvent | (event: DepositLifecycleEvent) => void | No | — | Deposit-lifecycle callback. Best-effort and client-side (not a server webhook). |
uaProjectId | string | No | SDK default | Particle project ID for UA operations only. |
Methods
| Method | Parameters | Returns | Description |
|---|---|---|---|
initialize() | — | Promise<void> | Initialize client (call first). |
destroy() | — | void | Cleanup resources. |
getDepositAddresses() | — | Promise<DepositAddresses> | Get EVM + Solana addresses. |
startWatching() | — | void | Start balance polling. |
stopWatching() | — | void | Stop balance polling. |
checkBalances() | — | Promise<DetectedDeposit[]> | Get current balances (above threshold). |
sweep(depositId?) | string? | Promise<SweepResult[]> | Sweep specific or all deposits. |
getStatus() | — | ClientStatus | Current status. |
getPendingDeposits() | — | DetectedDeposit[] | Unsent deposits. |
getConfig() | — | ResolvedConfig | Resolved config. |
setDestination(dest) | Partial<DestinationConfig> | void | Change destination at runtime. |
getDestination() | — | { address, chainId } | Current destination. |
getStuckFunds() | — | Promise<DetectedDeposit[]> | All non-zero balances (no threshold). |
recoverAllFunds() | — | Promise<RecoveryResult[]> | Sweep all stuck funds. |
refund(id, reason?) | string, RefundReason? | Promise<RefundResult> | Refund specific deposit. |
refundAll(reason?) | RefundReason? | Promise<RefundResult[]> | Refund all pending. |
canRefund(id) | string | Promise<{ eligible, reason? }> | Check refund eligibility. |
getRefundConfig() | — | RefundConfig | Current refund config. |
getWalletBalances(wallet) | FundingWallet | Promise<FundingBalance[]> | Discover a connected wallet’s cross-chain balances. |
fundFromWallet(wallet, balance, opts?) | FundingWallet, FundingBalance, FundOptions? | Promise<FundingTransferResult> | Transfer a discovered balance to the deposit address. |
getTransactions(page, pageSize) | number, number | Promise<TransactionsResponse> | Page-based transaction history. |
getTokenTransactions(filter, cursor?) | TokenTransactionFilter, string? | Promise<TokenTransactionsResponse> | Cursor-based filtered transactions. |
getTransaction(id) | string | Promise<UATransaction> | Single transaction lookup. |
Notifications (Headless)
Track each deposit through its lifecycle without any UI. Pass theonDepositEvent
callback, or subscribe to the deposit:lifecycle event — both deliver the same
normalized DepositLifecycleEvent, with a stable id across phase transitions
(detected → processing → credited, or failed / below_threshold).
Fund from Wallet (Headless)
Let a user top up their deposit address from a connected browser wallet (MetaMask / Rabby / Phantom / any injected EIP-1193 or Solana wallet). The SDK discovers the wallet’s cross-chain balances, builds a plain transfer to the deposit address, and submits it through the wallet; the watcher then detects and sweeps it as usual. The browser wallet is a funding source only — it never becomes the Universal Account owner/signer. Balance discovery is zero-config (Particle’s hosted service — no Moralis key, proxy, or backend). Enable it on the client:Flow
Detection Utilities
Framework-agnostic helpers for discovering and connecting injected wallets:Balance discovery covers Ethereum, BNB Chain, Base, Arbitrum, and Solana. X Layer is not supported by the Moralis-backed service, so it is skipped during discovery — other supported chains are unaffected.
Transaction History
Query the Universal Account’s transaction history. Results are cached (30s TTL, LRU) to avoid redundant API calls when paginating.Page-Based Pagination
Filter by Token and Chain (Cursor-Based)
Single Transaction Lookup
Events
Subscribe to events usingon / off:
Event Reference
| Event | Payload | Description |
|---|---|---|
deposit:detected | DetectedDeposit | New deposit found. |
deposit:processing | DetectedDeposit | Sweep started. |
deposit:complete | SweepResult | Sweep succeeded. |
deposit:below_threshold | DetectedDeposit | Deposit detected below minValueUSD. |
deposit:error | Error, DetectedDeposit? | Sweep failed. |
deposit:lifecycle | DepositLifecycleEvent | Normalized phase transition (mirrors the events above). |
recovery:started | — | Recovery started. |
recovery:complete | RecoveryResult[] | Recovery finished. |
recovery:failed | DetectedDeposit, Error | Single recovery failed. |
refund:started | DetectedDeposit, RefundReason | Refund initiated. |
refund:processing | DetectedDeposit, attempt | Refund attempt. |
refund:complete | RefundResult | Refund succeeded. |
refund:failed | DetectedDeposit, Error, exhausted | Refund failed. |
funding:started | FundingBalance | Wallet-funding transfer started. |
funding:complete | FundingTransferResult | Wallet-funding transfer submitted. |
funding:error | Error, FundingBalance? | Wallet-funding transfer failed. |
status:change | ClientStatus | Status changed. |
Next Steps
React SDK
DepositProvider, hooks, and UI components.
Reference
Types, constants, and advanced topics.
