AccountDataResponse

@Serializable
data class AccountDataResponse(val value: String) : Response

Represents an account data response from the Horizon API.

This response contains a single data entry (key-value pair) stored on an account. The value is base64-encoded and can be decoded to bytes or (if valid UTF-8) to a string.

Usage

val horizonServer = HorizonServer("https://horizon-testnet.stellar.org")
val dataResponse = horizonServer.accounts().accountData(accountId, "config")

// Get base64 value
println(dataResponse.value)

// Get decoded bytes
val bytes = dataResponse.decodedValue

// Get decoded string (throws if not valid UTF-8)
val string = dataResponse.decodedString

// Get decoded string or null (safe for binary data)
val stringOrNull = dataResponse.decodedStringOrNull

See also

Constructors

Link copied to clipboard
constructor(value: String)

Properties

Link copied to clipboard

Decodes the base64-encoded value to a UTF-8 string.

Link copied to clipboard

Decodes the base64-encoded value to a UTF-8 string, or returns null if not valid UTF-8.

Link copied to clipboard

Decodes the base64-encoded value to a ByteArray.

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

The base64-encoded data value

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String