Tx History

The MNEE SDK provides methods to retrieve transaction history for addresses, with support for pagination and batch queries.

Recent Transaction History

The recentTxHistory method retrieves the transaction history for a single address.

Usage

const history = await mnee.recentTxHistory('your-address-here');
console.log('History:', history);

With Pagination

// Get first page (most recent transactions)
const firstPage = await mnee.recentTxHistory(address, undefined, 10);

// Get next page using nextScore
const secondPage = await mnee.recentTxHistory(
  address, 
  firstPage.nextScore, 
  10
);

Parameters

  • address: The Bitcoin address to query

  • fromScore (optional): Starting score for pagination

  • limit (optional): Maximum number of transactions to return

Response

Returns a TxHistoryResponse object:

Sample Response

Recent Transaction Histories (Multiple)

The recentTxHistories method retrieves transaction histories for multiple addresses in a single call.

Usage

Parameters

Array of AddressHistoryParams, each containing:

  • address: The Bitcoin address

  • fromScore (optional): Starting score for pagination

  • limit (optional): Maximum transactions per address

Response

Returns an array of TxHistoryResponse objects, one for each address.

Transaction History Properties

TxHistory Object

  • txid: Transaction identifier

  • height: Block height (0 for unconfirmed)

  • status: "confirmed" or "unconfirmed"

  • type: "send" or "receive"

  • amount: Amount in atomic units

  • counterparties: Array of addresses and amounts involved

  • fee: Transaction fee in atomic units

  • score: Sortable score for pagination

Counterparty Object

  • address: The counterparty's address

  • amount: Amount sent to/from this address

Common Use Cases

Display Transaction List

Calculate Total Received

Monitor for New Transactions

Multi-Address Portfolio History

Export Transaction History

Find Transactions with Specific Address

Pagination Best Practices

  • Start with fromScore: undefined for the most recent transactions

  • Use the returned nextScore to fetch the next page

  • When history.length < limit, you've reached the end

  • Store nextScore to resume pagination later

  • Higher scores represent more recent transactions

Performance Tips

  • Use recentTxHistories for multiple addresses instead of multiple recentTxHistory calls

  • Limit page size based on your UI needs (10-50 for display, 100+ for analysis)

  • Cache results when appropriate

  • For large-scale analysis, consider using batch operations

See Also

Last updated