SDK Config Settings
Get config data to use with your implementation of the SDK
The SDK provides an endpoint to get all of the configuration data to use for building quotes. This includes the list of supported tokens, chains, and services. This is useful for building a UI that allows users to select different tokens and chains to use for their on-ramp experience.
Get SDK config
This is not the same as the SDK configuration that you set when you initialize
the SDK. The fetchConfig
is a separate endpoint that returns the configuration data for
the SDK.
import { fetchConfig, } from "zksync-easy-onramp";
const config = await fetchConfig();
Config data
The config data returned from the SDK includes the following:
tokens
: A list of all supported tokens for the SDK. This includes the token name, address, chainId, symbol, decimals, marketCap, usdPrice, and iconUrl.chains
: A list of all supported chains for the SDK. This includes the chain ID, and name.providers
: A list of all supported services for the SDK. This includes the service name, logo, type, and supported tokens.fiatCurrencies
: A list of all supported fiat currencies for the SDK. This is an array of currency codes in string format.