Demo
Build a Settlement Report
TypeScript backend
Memo immediately follows its parent Transfer, so (transactionHash, logIndex - 1) joins the reference to the operation. Plain USDC has no memo event; join those transfers to your stored transaction hash, authorization nonce, or contract event.
Every returned row has a stable transaction/log identity, direction, counterparty, amount, and an order reference when the token emitted a memo.
Classify Outgoing Transfers
A rawTransfer from the merchant can be a refund, payout, treasury move, or split leg. Join it to your refund ledger or the PayoutSent(reference, ...) event rather than guessing from direction alone.
See Also
Reconcile with B20 Memos
Learn the token-level memo ordering guarantee.
Watch for Payments
Keep the underlying event index current.