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})")
}

See also

Constructors

Link copied to clipboard
constructor(amountRefunded: String, amountFee: String, payments: List<Sep31RefundPayment>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Total fee charged for processing all refund payments, in units of amount_in_asset.

Link copied to clipboard

Total amount refunded across all payments, in units of amount_in_asset.

Link copied to clipboard

Individual refund payments composing the aggregate.