Skip to Content
API ReferencesignTransaction()

signTransaction()

Shows the user a biometric approval prompt for a transaction you’ve built, and returns the signed XDR. Orbi signs only — submitting to the network is up to you.

signTransaction(params: SignTransactionParams): Promise<SignTransactionResult>

Parameters

ParamTypeRequiredDescription
xdrstringYesThe unsigned transaction, as a base64 XDR string.
walletAddressstringYesThe G... address that should sign — usually getAddress().

Returns

Promise<{ signedXdr: string }> — the signed transaction as base64 XDR, ready to submit.

FieldTypeDescription
signedXdrstringThe signed transaction envelope (XDR).

Example

// Build a transaction (see the Send a payment guide), then: const { signedXdr } = await orbi.signTransaction({ xdr: tx.toXDR(), walletAddress: orbi.getAddress(), }) // Submit it yourself const signed = TransactionBuilder.fromXDR(signedXdr, Networks.PUBLIC) await server.submitTransaction(signed)

Build the transaction for the same network you passed to OrbiClient. A testnet client cannot sign a mainnet transaction, and vice versa.

Errors

The promise rejects if the user declines the biometric prompt or the passkey flow is cancelled. Treat a rejection as “the user said no” and leave their funds untouched.

Last updated on