Signing
Sign transactions, messages, and Soroban authorization entries via WalletConnect.
Assumes provider and modal are initialized as shown in Installation.
Signing a Transaction
stellar_signXDR
Sign a transaction and return the signed XDR. The transaction is not submitted to the network — your dapp is responsible for submission.
Parameters
xdr
string
Required. Base64-encoded TransactionEnvelope or FeeBumpTransactionEnvelope XDR.
Response
signedXDR
string
Base64-encoded signed transaction XDR.
const result = await provider.request(
{
method: "stellar_signXDR",
params: { xdr: "AAAAAgAAAAA..." },
},
"stellar:pubnet",
);
console.log("Signed XDR:", result.signedXDR);Errors
Chain not supported
"Unsupported chain: <chainId>"
Wrong active network
"Please switch to <network> and try again"
XDR parse failure
"Failed to sign transaction"
User rejected
"User rejected the request"
stellar_signAndSubmitXDR
Sign a transaction and submit it to Horizon in one step.
Parameters
xdr
string
Required. Base64-encoded TransactionEnvelope or FeeBumpTransactionEnvelope XDR.
Response
status
string
"success" when the transaction is signed and submitted.
Errors
Chain not supported
"Unsupported chain: <chainId>"
Wrong active network
"Please switch to <network> and try again"
XDR parse / sign failure
"Failed to sign transaction"
Horizon submission failure
"Failed to submit transaction"
User rejected
"User rejected the request"
Signing a Message
stellar_signMessage
Sign an arbitrary UTF-8 text message with the wallet's active key, following SEP-53.
Parameters
message
string
Non-empty, max 1024 UTF-8 bytes
The plaintext message to sign.
Response
signature
string
Base64-encoded Ed25519 signature (per SEP-53).
Errors
Missing or non-string message
"Invalid message"
Empty message
"Cannot sign empty message"
Message exceeds 1 KB
"Message too long (max 1KB)"
Signing failed
"Failed to sign message"
User rejected
"User rejected the request"
Signing an Auth Entry
stellar_signAuthEntry
Sign a Soroban authorization entry preimage for multi-auth and custom-account smart contract workflows. Follows SEP-43.
Your dapp constructs the HashIdPreimage (network ID + nonce + expiry + invocation), and Freighter hashes it with SHA-256 and signs the digest.
Freighter Mobile performs a Blockaid site scan during the initial WalletConnect session connection — no additional scan runs at auth-entry signing time. Review the contract address, function name, and subinvocations displayed in the UI before confirming.
Parameters
entryXdr
string
Non-empty, non-whitespace
Base64-encoded HashIdPreimage XDR (envelope type envelopeTypeSorobanAuthorization). Build from the SorobanAuthorizationEntry returned by contract simulation.
Response
signedAuthEntry
Base64-encoded 64-byte Ed25519 signature over SHA-256(preimage).
signerAddress
Stellar public key (G-address) of the account that produced the signature.
Errors
Missing, non-string, or whitespace-only entryXdr
"Invalid authorization entry"
XDR parse failure
"Failed to process auth entry"
networkId doesn't match active network
"Authorization entry is for a different network"
User rejected
"User rejected the request"
Full Example: Connect, Sign, and Submit
A complete flow from connection to transaction signing. The AppKit modal displays both a QR code and a list of wallets. When a user opens your dapp in Freighter Mobile's in-app browser, they select Freighter from the wallet list to deep-link into the connection approval — no QR code scanning needed. From an external browser, the user scans the QR code with their phone instead.
Last updated
Was this helpful?
