Sep38FeeDetail

@Serializable
data class Sep38FeeDetail(val name: String, val amount: String, val description: String? = null)

Detailed breakdown of a single fee component.

Provides transparency about individual fees that make up the total fee for an exchange operation. Each detail represents one type of fee charged by the anchor (e.g., network fee, processing fee, conversion fee).

The sum of all amount values across all fee details should equal the total fee amount specified in the parent Sep38Fee object.

Example - Network fee:

val networkFee = Sep38FeeDetail(
name = "Network fee",
amount = "5.00",
description = "Fee charged to cover blockchain transaction costs"
)

Example - Processing fee:

val processingFee = Sep38FeeDetail(
name = "Processing fee",
amount = "10.00",
description = "Fee for processing the exchange operation"
)

Example - Fee without description:

val serviceFee = Sep38FeeDetail(
name = "Service fee",
amount = "8.40"
)
// Description is optional

Example - Displaying fee breakdown to users:

val quote = sep38Service.postQuote(request, jwtToken)

println("Total fee: ${quote.fee.total} ${quote.fee.asset}")
quote.fee.details?.forEach { detail ->
println(" ${detail.name}: ${detail.amount}")
detail.description?.let { println(" ($it)") }
}
// Output:
// Total fee: 42.00 iso4217:BRL
// PIX fee: 12.00
// (Fee charged in order to process the outgoing PIX transaction.)
// Brazilian conciliation fee: 15.00
// (Fee charged in order to process conciliation costs with intermediary banks.)
// Service fee: 15.00

See also:

Constructors

Link copied to clipboard
constructor(name: String, amount: String, description: String? = null)

Properties

Link copied to clipboard
@SerialName(value = "amount")
val amount: String

Amount for this fee component as a string decimal

Link copied to clipboard
@SerialName(value = "description")
val description: String?

Optional human-readable explanation of this fee component

Link copied to clipboard
@SerialName(value = "name")
val name: String

Name identifying this fee component (e.g., "Network fee", "Processing fee", "Service fee")