diff --git a/packages/checkout/widgets-lib/src/widgets/add-funds/functions/fetchChains.ts b/packages/checkout/widgets-lib/src/widgets/add-funds/functions/fetchChains.ts index bff3a07bac..7a5bde271f 100644 --- a/packages/checkout/widgets-lib/src/widgets/add-funds/functions/fetchChains.ts +++ b/packages/checkout/widgets-lib/src/widgets/add-funds/functions/fetchChains.ts @@ -6,11 +6,19 @@ type SquidChain = { chainName: string; chainIconURI: string; chainType: string; + nativeCurrency: SquidNativeCurrency; }; - type SquidChains = { - chains: SquidChain[]; - }; +type SquidChains = { + chains: SquidChain[]; +}; + +export type SquidNativeCurrency = { + name: string; + symbol: string; + decimals: number; + icon: string; +}; export const fetchChains = async (): Promise => { const url = `${SQUID_API_BASE_URL}/chains`; @@ -25,11 +33,16 @@ export const fetchChains = async (): Promise => { const data: SquidChains = await response.json(); - const chains = data.chains.map((chain: SquidChain) => ({ + return data.chains.map((chain: SquidChain) => ({ id: chain.chainId.toString(), name: chain.chainName, iconUrl: chain.chainIconURI, type: chain.chainType, + nativeCurrency: { + name: chain.nativeCurrency.name, + symbol: chain.nativeCurrency.symbol, + decimals: chain.nativeCurrency.decimals, + iconUrl: chain.nativeCurrency.icon, + }, })); - return chains; }; diff --git a/packages/checkout/widgets-lib/src/widgets/add-funds/types.ts b/packages/checkout/widgets-lib/src/widgets/add-funds/types.ts index c821fb5ea2..2b9119ed65 100644 --- a/packages/checkout/widgets-lib/src/widgets/add-funds/types.ts +++ b/packages/checkout/widgets-lib/src/widgets/add-funds/types.ts @@ -6,6 +6,14 @@ export type Chain = { type: string; name: string; iconUrl: string; + nativeCurrency: NativeCurrency; +}; + +export type NativeCurrency = { + name: string; + symbol: string; + decimals: number; + iconUrl:string; }; export type AmountData = {