Skip to content

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

PropertyTypeDefaultDescription
walletConnectProjectIdstringrequiredReown / WalletConnect project ID
environment'STAGING' | 'MAINNET''STAGING'SDK environment
integratorIdstringYour integrator ID for attribution and analytics
solanaRpcUrlstringCustom Solana RPC endpoint
bitcoinRpcUrlstringCustom Bitcoin RPC endpoint
evmRpcOverridesRecord<number, string>Custom EVM RPC URLs keyed by chain ID
assetBaseUrlstring'https://app.silentswap.com'Base URL for token icon images
defaultSourceAssetstringPre-select source asset (CAIP-19)
defaultDestinationAssetstringPre-select destination asset (CAIP-19)
defaultRecipientAddressstringPre-fill recipient address
defaultInputAmountstringPre-fill input amount
privacyEnabledbooleantrueEnable private (hidden) swap mode
maxTransactionUsdnumber25000Maximum transaction amount in USD
appMetadataobjectReown 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:

AssetCAIP-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