Configuration
All widget components and the vanilla JS API accept a config object that controls behavior and an optional theme object for visual customization.
SilentSwapWidgetConfig
| Property | Type | Default | Description |
|---|---|---|---|
walletConnectProjectId | string | required | Reown / WalletConnect project ID |
environment | 'STAGING' | 'MAINNET' | 'STAGING' | SDK environment |
integratorId | string | — | Your integrator ID for attribution and analytics |
solanaRpcUrl | string | — | Custom Solana RPC endpoint |
bitcoinRpcUrl | string | — | Custom Bitcoin RPC endpoint |
evmRpcOverrides | Record<number, string> | — | Custom EVM RPC URLs keyed by chain ID |
assetBaseUrl | string | 'https://app.silentswap.com' | Base URL for token icon images |
defaultSourceAsset | string | — | Pre-select source asset (CAIP-19) |
defaultDestinationAsset | string | — | Pre-select destination asset (CAIP-19) |
defaultRecipientAddress | string | — | Pre-fill recipient address |
defaultInputAmount | string | — | Pre-fill input amount |
privacyEnabled | boolean | true | Enable private (hidden) swap mode |
maxTransactionUsd | number | 25000 | Maximum transaction amount in USD |
appMetadata | object | — | Reown AppKit metadata (see below) |
appMetadata
{
name?: string; // App name shown in wallet prompts
description?: string; // App description
url?: string; // App URL
icons?: string[]; // Array of icon URLs
}Minimal Example
const config = {
walletConnectProjectId: 'YOUR_PROJECT_ID',
environment: 'MAINNET',
};Full Example
const config = {
walletConnectProjectId: 'YOUR_PROJECT_ID',
environment: 'MAINNET',
integratorId: 'my-dapp',
solanaRpcUrl: 'https://my-solana-rpc.com',
evmRpcOverrides: {
1: 'https://my-eth-rpc.com',
43114: 'https://my-avax-rpc.com',
},
defaultSourceAsset: 'eip155:1/slip44:60', // ETH on Ethereum
defaultDestinationAsset: 'eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
defaultInputAmount: '0.1',
privacyEnabled: true,
maxTransactionUsd: 10000,
appMetadata: {
name: 'My DApp',
description: 'Cross-chain swaps powered by SilentSwap',
url: 'https://mydapp.com',
icons: ['https://mydapp.com/icon.png'],
},
};CAIP-19 Asset Identifiers
Assets are identified using the CAIP-19 standard. Common examples:
| Asset | CAIP-19 |
|---|---|
| ETH (Ethereum) | eip155:1/slip44:60 |
| USDC (Ethereum) | eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 |
| USDC (Avalanche) | eip155:43114/erc20:0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E |
| SOL (Solana) | solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501 |
| BTC (Bitcoin) | bip122:000000000019d6689c085ae165831e93/slip44:0 |