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). |
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. |
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. |
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:error | Error, DetectedDeposit? | Sweep failed. |
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. |
status:change | ClientStatus | Status changed. |
