getConfig
The getConfig method returns the current configuration of the Symphony instance.
Signature
getConfig(): SymphonyConfigTypeScript Types
// Import for viem
import type { SymphonyConfig } from 'symphony-sdk/types/viem';
// Import for ethersV5
import type { SymphonyConfig } from 'symphony-sdk/types/ethersV5';
// Import for ethers v6
import type { SymphonyConfig } from 'symphony-sdk/types/ethers';
interface SymphonyConfig {
apiUrl?: string;
timeout?: number;
chainId?: number;
chainName?: string;
rpcUrl?: string;
nativeAddress?: Address;
wrappedNativeAddress?: Address;
slippage?: string;
additionalTokens?: TokenList;
overrideDefaultTokens?: boolean;
feeParams?: FeeParams;
publicClient?: any; // viem PublicClient
provider?: any; // ethers Provider
tokens?: TokenList;
}Returns
Returns a SymphonyConfig object containing:
apiUrl: Symphony API URLtimeout: Request timeout in millisecondschainId: Chain ID for the networkchainName: Name of the chainrpcUrl: RPC URL for the networknativeAddress: Address used to refer to the native tokenwrappedNativeAddress: Address of the wrapped native tokenslippage: Default slippage percentage for swapspublicClient / provider: Public client instance (viem) or provider (ethers)tokens: Map of token addresses to token informationadditionalTokens: Object containing custom tokens provided by the useroverrideDefaultTokens: Boolean indicating if the default token list is overridden
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",
additionalTokens: {},
overrideDefaultTokens: false,
// ... 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.

