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.
Example
Section titled “Example”const signer = new ExternalKeySigner({ publicKey, viewPublicKey, network: Network.Esmeralda, sign: (hash) => vault.sign(keyId, hash),});const signed = await signTransaction([signer], unsignedTx);Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ExternalKeySigner(
options):ExternalKeySigner
Defined in: ootle/src/external-signer.ts:55
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”ExternalKeySigner
Properties
Section titled “Properties”address
Section titled “address”
readonlyaddress:string
Defined in: ootle/src/external-signer.ts:53
Methods
Section titled “Methods”getAddress()
Section titled “getAddress()”getAddress():
Promise<string>
Defined in: ootle/src/external-signer.ts:62
Returns the component address derived from this signer’s public key.
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”getPublicKey()
Section titled “getPublicKey()”getPublicKey():
Promise<Uint8Array<ArrayBufferLike>>
Defined in: ootle/src/external-signer.ts:66
Returns the raw public key bytes for this signer.
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
Implementation of
Section titled “Implementation of”signTransaction()
Section titled “signTransaction()”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.
Parameters
Section titled “Parameters”unsignedTx
Section titled “unsignedTx”UnsignedTransactionV1
sealPublicKey
Section titled “sealPublicKey”Uint8Array
authorizers
Section titled “authorizers”Uint8Array<ArrayBufferLike>[]
Returns
Section titled “Returns”Promise<TransactionSignature[]>