UNPKG

@ledgerhq/coin-tron

Version:
22 lines (17 loc) 592 B
import type { SyncConfig } from "@ledgerhq/types-live"; export function getOperationsPageSize( accountId: string | null | undefined, syncConfig: SyncConfig, ): number { const { paginationConfig } = syncConfig; const { operationsPerAccountId, operations } = paginationConfig; const numbers: number[] = []; if (operationsPerAccountId && accountId && accountId in operationsPerAccountId) { numbers.push(operationsPerAccountId[accountId]); } if (operations) { numbers.push(operations); } if (numbers.length === 0) return Infinity; return Math.max(...numbers); }