@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
15 lines • 720 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.useNetworkAccountCounts = void 0;
const getAccountTuplesForCurrency_1 = require("../../utils/getAccountTuplesForCurrency");
const useNetworkAccountCounts = ({ networks, nestedAccounts, formatLabel, }) => networks.map(network => {
const asset = network.type === "TokenCurrency" ? network.parentCurrency : network;
const { length } = (0, getAccountTuplesForCurrency_1.getAccountTuplesForCurrency)(asset, nestedAccounts);
return {
asset,
label: formatLabel(length),
count: length,
};
});
exports.useNetworkAccountCounts = useNetworkAccountCounts;
//# sourceMappingURL=useNetworkAccountCounts.js.map