Sep31PostTransactionsResponse

data class Sep31PostTransactionsResponse(val id: String, val stellarAccountId: String? = null, val stellarMemoType: String? = null, val stellarMemo: String? = null)

Response payload returned by SEP-31 POST /transactions.

Carries the persistent transaction id and — when the anchor has already determined the on-chain payment instructions — the Stellar account and memo the Sending Anchor must use. The Stellar fields are optional: per spec "Success (201 Created)", absent values indicate the anchor is still processing the request. The transaction is in pending_receiver status; the anchor will advance it to pending_sender once payment fields are populated, or to error if the transaction cannot proceed. The Sending Anchor should poll or register a callback until one of those two transitions occurs.

Both HTTP 200 and HTTP 201 responses are accepted as success by the SDK.

Usage

val response = sep31Service.postTransactions(request, jwt)
if (response.stellarAccountId != null) {
println("Send payment to ${response.stellarAccountId} with memo ${response.stellarMemo}")
} else {
println("Anchor is still processing; poll GET /transactions/${response.id}")
}

Example JSON

{
"id": "11111111-1111-1111-1111-111111111111",
"stellar_account_id": "GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H",
"stellar_memo_type": "hash",
"stellar_memo": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
}

See also

Constructors

Link copied to clipboard
constructor(id: String, stellarAccountId: String? = null, stellarMemoType: String? = null, stellarMemo: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val id: String

Persistent transaction identifier to use for GET /transactions/:id and PATCH /transactions/:id.

Link copied to clipboard

Receiving Anchor's Stellar account to send the on-chain payment to. null while the anchor is still processing.

Link copied to clipboard

Memo to attach to the on-chain payment. null while the anchor is still processing.

Link copied to clipboard

Type of stellarMemo (text, hash, or id). Verbatim string; the SDK does not validate against an allow-list.