@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
10 lines (7 loc) • 340 B
text/typescript
import { ResponseDataAll } from "../api/v5/fetchCurrencyAll";
export function flattenV5CurrenciesAll(response: ResponseDataAll): string[] {
const flattenedAll = [...response.from, ...response.to].reduce<string[]>((acc, curr) => {
return [...acc, ...curr.supportedCurrencies];
}, []);
return Array.from(new Set(flattenedAll));
}