feat: add mptoken_issuance_history RPC
Summary
Adds mptoken_issuance_history, a Clio-only method that returns the
transaction history for a given MPT issuance — the MPT-scoped sibling of
nft_history. You can optionally filter by account and/or tx_type.
The index tables, backend fetch methods, and live ETL indexing landed
earlier; this wires up the handler on top of them.
The handler
- Routes to fetchMPTokenIssuanceTransactions or
fetchAccountMPTokenIssuanceTransactions depending on whether account is
set. When tx_type is given, it filters on TransactionType post-fetch,
exactly like account_tx.
- Follows the nft_history/account_tx conventions for ledger ranges,
markers, binary, forward, and limit ([1,100], default 50), including
api-version response branching.
- Gated on backfill completion so it never returns partial history:
until this node's MPTTransactionHistoryMigrator reports Migrated,
requests get notReady with a message pointing at the --migrate command.
Once migrated, the result is cached and the check is skipped — the
method turns on automatically, no restart.
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds an optional `mpt_issuance_id ` field to Account_tx so that users
can filter Account transactions if the transaction is involved in a
specific `mpt_issuance_id `
## Summary
Adds live ETL indexing for mptoken_issuance_history by extracting MPT
issuance references from transaction metadata and transaction fields,
then writing both MPT transaction index shapes during the existing MPT
ETL pass. Successful transactions are indexed from affected MPT ledger
objects; failed transactions are indexed only when they carry an
attached MPT issuance reference.
## Changes
- Adds `getMPTokenIssuanceTxsFromTx` to extract issuance transaction
index records from `tesSUCCESS` transactions.
- Scans `AffectedNodes` generically for `MPToken` and `MPTokenIssuance`
ledger objects instead of relying on a transaction-type allowlist.
- Reconstructs issuance IDs for `MPTokenIssuance` objects with
`makeMptID(sequence, issuer)`, avoiding the hashed ledger-key trap.
- Deduplicates distinct issuances per transaction and attaches the
transaction’s affected accounts for account-level fanout.
- Extends `MPTExt` so live and initial ETL data writes:
- existing MPT holder index data
- `mptoken_issuance_transactions`
- `account_mptoken_issuance_transactions`
- Adds a Prometheus counter for MPT issuance transaction index rows
written by ETL.
- Logs unexpectedly large per-transaction fanout.
## Tests
Adds unit coverage for:
- failed transactions producing no records
- `MPTokenIssuanceCreate`, `Destroy`, `Set`, and `MPTokenAuthorize`
- generic transaction-type coverage through `Payment`, `Clawback`,
`OfferCreate`, and `AMMDeposit`
- ID reconstruction from issuance nodes
- multi-issuance fanout and deduplication
- affected-account propagation
- ETL extension writes to both backend index paths while preserving
existing holder indexing
---------
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
`ResponseExpirationCache` is using only `method` (or `command`) as a
key, but responses might be different with different params. This may
lead to a client getting incorrect response because of caching. This PR
fixes it by caching only requests without any additional params.