UNPKG

@ledgerhq/coin-stellar

Version:
36 lines 1.26 kB
// SPDX-FileCopyrightText: © 2026 LEDGER SAS // SPDX-License-Identifier: Apache-2.0 import { fetchOperations } from '../network'; export async function listOperations(address, { limit, cursor, order, minHeight }) { // Fake accountId const accountId = ''; const { items: operations, next: nextCursor } = await fetchOperations({ accountId, addr: address, minHeight, order: order || 'desc', limit, cursor: cursor, }); const mappedOperations = operations.map((op) => convertToLegacyOperation(op)); return { items: mappedOperations, next: nextCursor }; } function convertToLegacyOperation(operation) { const details = operation.details; return { id: `${operation.tx.hash}-${details?.index ?? ''}`, asset: operation.asset, tx: operation.tx, details: { sequence: details?.sequence, ledgerOpType: details?.ledgerOpType, assetAmount: details?.assetAmount ?? operation.value.toString(), memo: details?.memo, }, type: operation.type, value: operation.value, senders: operation.senders, recipients: operation.recipients, }; } //# sourceMappingURL=listOperations.js.map