Skip to content

Client API

Configuration

import type { SilentSwapConfig } from '@silentswap/sdk';
 
type 
type ConfigKeys = keyof SilentSwapConfig
ConfigKeys
= keyof SilentSwapConfig;
FieldRequiredPurpose
baseUrlNoDefaults to https://api.silentswap.com.
chainNoDefaults to the configured production gateway chain.
walletClientWallet callsDeposits, allowances, and refunds.
walletAdaptersNon-EVM wallet callsNarrow Solana, Bitcoin, TON, and TRON capabilities.
publicClientNoRead client for gateway allowance/receipt work.
rpcUrlForChainNoResolve read RPCs for source chain IDs.

Methods

MethodReturn
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.