Skip to content

getConfig

The getConfig method returns the current configuration of the Symphony instance.

Signature

getConfig(): SymphonyConfig

Returns

Returns a SymphonyConfig object containing:

  • apiUrl: Symphony API URL
  • timeout: Request timeout in milliseconds
  • chainId: Chain ID for the network
  • chainName: Name of the chain
  • rpcUrl: RPC URL for the network
  • nativeAddress: Address used to refer to the native token
  • wrappedNativeAddress: Address of the wrapped native token
  • slippage: Default slippage percentage for swaps
  • publicClient / provider: Public client instance (viem) or provider (ethers)
  • tokens: Map of token addresses to token information

Example

const symphony = new Symphony();
const config = symphony.getConfig();
 
console.log(config);
// Example output:
{
  apiUrl: "https://route-api-url.com",
  timeout: 10000,
  chainId: 1329,
  chainName: "sei",
  rpcUrl: "https://sei-rpc.publicnode.com",
  nativeAddress: "0x0",
  wrappedNativeAddress: "0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7",
  slippage: "0.5",
  // ... other configuration options
}

Accessing Specific Configuration

const symphony = new Symphony();
const route = await symphony.getRoute(tokenIn, tokenOut, "1.0");
// Get the current slippage setting
const slippage = route.getConfig().slippage;
console.log(`Current slippage: ${slippage}%`);

For modifying the configuration, see setConfig.