signTransaction

suspend fun signTransaction(address: String, signingAddress: String, transaction: String, jwt: String): Sep30SignatureResponse

Requests the recovery server to sign a transaction.

Submits a transaction to be signed by one of the account's registered signing addresses. The signing address must correspond to one of the signers returned when the account was registered or queried.

The authenticated identity must have sufficient permissions for the signing address to authorize the signature.

Return

Sep30SignatureResponse with the signature and network passphrase

Parameters

address

The Stellar account address

signingAddress

The signing address from the account's registered signers

transaction

The base64-encoded transaction envelope XDR to sign

jwt

SEP-10 authentication token

Throws

If the request is malformed (HTTP 400)

If the JWT token is invalid or identity not authenticated (HTTP 401)

If the account or signing address is not found (HTTP 404)

If there is a signing conflict (HTTP 409)

If the server returns HTTP 200 with a malformed body

If the server returns an unexpected HTTP status code

Example:

val signatureResponse = sep30.signTransaction(
address = "GABC...",
signingAddress = "GDEF...",
transaction = transaction.toEnvelopeXdrBase64(),
jwt = jwtToken
)
println("Signature: ${signatureResponse.signature}")
println("Network: ${signatureResponse.networkPassphrase}")