Sep31Refunds
data class Sep31Refunds(val amountRefunded: String, val amountFee: String, val payments: List<Sep31RefundPayment>)
Aggregate refund details for a SEP-31 transaction.
Captures the total amount refunded to the Sending Anchor, the total fee charged for processing those refunds, and the list of individual on-chain payments that compose the refund. The amountRefunded and amountFee aggregates must equal the sums of the corresponding fields across payments.
The aggregate amount fields are String (not numeric) because SEP-31 amounts must preserve decimal precision.
Usage
val response = sep31Service.getTransaction(id = "tx-id", jwt = jwt)
val refunds = response.refunds ?: return
println("Total refunded: ${refunds.amountRefunded} (fees: ${refunds.amountFee})")
for (payment in refunds.payments) {
println(" txn ${payment.id}: ${payment.amount} (fee ${payment.fee})")
}Content copied to clipboard