Client API
Configuration
import type { SilentSwapConfig } from '@silentswap/sdk';
type type ConfigKeys = keyof SilentSwapConfigConfigKeys = keyof SilentSwapConfig;
| Field | Required | Purpose |
|---|---|---|
baseUrl | No | Defaults to https://api.silentswap.com. |
chain | No | Defaults to the configured production gateway chain. |
walletClient | Wallet calls | Deposits, allowances, and refunds. |
walletAdapters | Non-EVM wallet calls | Narrow Solana, Bitcoin, TON, and TRON capabilities. |
publicClient | No | Read client for gateway allowance/receipt work. |
rpcUrlForChain | No | Resolve read RPCs for source chain IDs. |
Methods
| Method | Return |
|---|---|
quote(request) | Promise<PrivateQuote | SimpleBridgeQuote> |
hasAllowance(quote) | Promise<boolean> |
ensureAllowance(quote) | Approval hash and sufficiency |
previewDepositCost(quote) | Native-gas cost breakdown |
hasSufficientGasForDeposit(quote) | Balance/cost comparison |
placeOrder(quote) | Serializable reference, transaction hashes, or external pay-in instructions |
getOrder(privateReference) | Promise<OrderState> |
trackOrderViaWebSocket(reference, onState, onError?) | Unsubscribe function |
executeRefund(privateReference) | Refund transaction hash |
The class SilentSwap, factory createSilentSwapClient, and type alias
SilentSwapClient refer to the same canonical client surface.