Skip to content

signTransaction

signTransaction(signers, unsignedTx, sealKeypair?): Promise<SignedTransaction>

Defined in: ootle/src/transaction.ts:243

Collects signatures from all provided signers and assembles a signed transaction.

Returns a SignedTransaction carrying the byte-exact sealedJson (the canonical bytes sealTransaction BOR-encodes) plus a parsed transaction view for inspection. The sealed JSON is not round-tripped through JSON.parse/JSON.stringify on its way to the envelope, so u64 amounts above 2^53 (e.g. a confidential output’s minimum_value_promise) survive byte-exact.

Signer[]

UnsignedTransactionV1

SealKeypair

Optional pre-generated seal keypair. When omitted, a fresh one is generated internally (the default for the plain transaction flow). The stealth spend authorizer passes one so the same seal public key flows into its one-time spend-key authorizations (which hash the tx with the seal public key) and into this final seal — otherwise those signatures would be over a different hash and fail to verify.

The main signer is settled first with resolveMainSigner: a transaction that declares none acts as the first signer.

The authorizer set is collected from every signer (collectAuthorizers) before any of them signs, since each signature commits to the whole set. The signatures are sealed in ascending public-key order, as schema V2 requires.

Promise<SignedTransaction>

when the signers’ signatures are not exactly one per authorizer key.