@ledgerhq/coin-tron
Version:
Ledger Tron Coin integration
25 lines (19 loc) • 665 B
text/typescript
import { getTronSuperRepresentatives, hydrateSuperRepresentatives } from "../network";
import { SuperRepresentative } from "../types";
export const preload = async () => {
const superRepresentatives = await getTronSuperRepresentatives();
return {
superRepresentatives,
};
};
export const hydrate = (data?: { superRepresentatives?: SuperRepresentative[] }) => {
if (!data || !data.superRepresentatives) return;
const { superRepresentatives } = data;
if (
!superRepresentatives ||
typeof superRepresentatives !== "object" ||
!Array.isArray(superRepresentatives)
)
return;
hydrateSuperRepresentatives(superRepresentatives);
};