Skip to content

ExternalKeySigner

Defined in: ootle/src/external-signer.ts:50

A Signer whose key is held externally. Each signTransaction hashes the transaction against the supplied seal public key, asks sign for a signature over the hash, and verifies it before returning, so a wrong key or scheme fails here with a SignerError. An error thrown by sign itself (a vault rejection or timeout) is also rethrown as a SignerError, with the original as its cause.

const signer = new ExternalKeySigner({
publicKey,
viewPublicKey,
network: Network.Esmeralda,
sign: (hash) => vault.sign(keyId, hash),
});
const signed = await signTransaction([signer], unsignedTx);

new ExternalKeySigner(options): ExternalKeySigner

Defined in: ootle/src/external-signer.ts:55

ExternalKeySignerOptions

ExternalKeySigner

readonly address: string

Defined in: ootle/src/external-signer.ts:53

getAddress(): Promise<string>

Defined in: ootle/src/external-signer.ts:62

Returns the component address derived from this signer’s public key.

Promise<string>

Signer.getAddress


getPublicKey(): Promise<Uint8Array<ArrayBufferLike>>

Defined in: ootle/src/external-signer.ts:66

Returns the raw public key bytes for this signer.

Promise<Uint8Array<ArrayBufferLike>>

Signer.getPublicKey


signTransaction(unsignedTx, sealPublicKey, authorizers): Promise<TransactionSignature[]>

Defined in: ootle/src/external-signer.ts:70

Signs the given unsigned transaction and returns the collected signatures.

sealPublicKey and authorizers are mixed into the transaction hash (hashUnsignedTransaction(json, sealPublicKey, encodeAuthorizerSet(authorizers))) so every signature in the final envelope verifies against the SAME hash — the engine’s seal verification enforces this. authorizers is the public key of every authorizer of the transaction, this signer’s among them; the sealed transaction must carry an authorization from each key and no other. Implementations MUST hash with the supplied values, not their own.

UnsignedTransactionV1

Uint8Array

Uint8Array<ArrayBufferLike>[]

Promise<TransactionSignature[]>

Signer.signTransaction