@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
13 lines • 492 B
JavaScript
/**
* Sorts accounts by their fiat value in descending order
* @param accounts - List of accounts with fiat values to sort
* @returns Sorted list of accounts by fiat value balance in descending order
*/
export function sortAccountsByFiatValue(accounts) {
return [...accounts].sort((a, b) => {
const fiatValueA = a.fiatValue ?? 0;
const fiatValueB = b.fiatValue ?? 0;
return fiatValueB - fiatValueA;
});
}
//# sourceMappingURL=sortAccountsByFiatValue.js.map