OotleWallet
Defined in: ootle/src/wallet.ts:33
A wallet that manages multiple key providers (one per component address) and can sign transactions on behalf of any registered signer.
Mirrors OotleWallet from the Rust ootle-rs crate.
Example
Section titled “Example”const wallet = new OotleWallet();wallet.registerKeyProvider(myAddress, mySecretKeyWallet);wallet.setDefaultSigner(myAddress);
const signed = await wallet.authorizeTransaction(unsignedTx);Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new OotleWallet():
OotleWallet
Defined in: ootle/src/wallet.ts:37
Returns
Section titled “Returns”OotleWallet
Methods
Section titled “Methods”addStealthSignature()
Section titled “addStealthSignature()”addStealthSignature(
unsignedJson,publicNonce,sealPublicKey,ctx):Promise<TransactionSignature>
Defined in: ootle/src/wallet.ts:130
Produces a one-time spend-key signature for a stealth input using the default signer.
Parameters
Section titled “Parameters”unsignedJson
Section titled “unsignedJson”string
publicNonce
Section titled “publicNonce”Uint8Array
sealPublicKey
Section titled “sealPublicKey”Uint8Array
authorizers
Section titled “authorizers”Uint8Array<ArrayBufferLike>[]
crypto
Section titled “crypto”viewSecret
Section titled “viewSecret”Uint8Array
Returns
Section titled “Returns”Promise<TransactionSignature>
Throws
Section titled “Throws”when no default signer is configured.
Throws
Section titled “Throws”when the default address has no registered provider.
Throws
Section titled “Throws”when the default signer does not implement addStealthSignature.
Implementation of
Section titled “Implementation of”authorizeTransaction()
Section titled “authorizeTransaction()”authorizeTransaction(
signerAddress,unsignedTx,sealPublicKey,authorizers):Promise<TransactionAuthorization>
Defined in: ootle/src/wallet.ts:153
Generates TransactionAuthorization (signatures) for a specific registered signer.
Mirrors OotleWallet::authorize_transaction from ootle-rs.
authorizers is the transaction’s full authorizer set, this signer’s keys among them.
Parameters
Section titled “Parameters”signerAddress
Section titled “signerAddress”string
unsignedTx
Section titled “unsignedTx”UnsignedTransactionV1
sealPublicKey
Section titled “sealPublicKey”Uint8Array
authorizers
Section titled “authorizers”Uint8Array<ArrayBufferLike>[]
Returns
Section titled “Returns”Promise<TransactionAuthorization>
Throws
Section titled “Throws”when no provider is registered for signerAddress.
authorizeTransactionAll()
Section titled “authorizeTransactionAll()”authorizeTransactionAll(
unsignedTx,sealPublicKey,authorizers?):Promise<TransactionAuthorization[]>
Defined in: ootle/src/wallet.ts:171
Collects authorizations from all registered key providers. Useful when a transaction requires multiple signers.
authorizers defaults to the keys of every registered provider; pass the full set when the
transaction has authorizers outside this wallet.
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<TransactionAuthorization[]>
getAddress()
Section titled “getAddress()”getAddress():
Promise<string>
Defined in: ootle/src/wallet.ts:69
Returns the default signer address, or throws if none is set.
Returns
Section titled “Returns”Promise<string>
Throws
Section titled “Throws”when no default signer is configured.
Implementation of
Section titled “Implementation of”getAuthorizerPublicKeys()
Section titled “getAuthorizerPublicKeys()”getAuthorizerPublicKeys():
Promise<Uint8Array<ArrayBufferLike>[]>
Defined in: ootle/src/wallet.ts:104
The default signer’s authorizer keys.
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>[]>
Throws
Section titled “Throws”when no default signer is configured.
Throws
Section titled “Throws”when the default address has no registered provider.
Implementation of
Section titled “Implementation of”Signer.getAuthorizerPublicKeys
getKeyProvider()
Section titled “getKeyProvider()”getKeyProvider(
address):Signer|undefined
Defined in: ootle/src/wallet.ts:185
Returns the key provider for a specific address, if registered.
Parameters
Section titled “Parameters”address
Section titled “address”string
Returns
Section titled “Returns”Signer | undefined
getPublicKey()
Section titled “getPublicKey()”getPublicKey():
Promise<Uint8Array<ArrayBufferLike>>
Defined in: ootle/src/wallet.ts:80
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
Throws
Section titled “Throws”when no default signer is configured.
Throws
Section titled “Throws”when the default address has no registered provider.
Implementation of
Section titled “Implementation of”getSignerAddresses()
Section titled “getSignerAddresses()”getSignerAddresses():
string[]
Defined in: ootle/src/wallet.ts:192
Returns all registered signer addresses.
Returns
Section titled “Returns”string[]
getViewSecret()
Section titled “getViewSecret()”getViewSecret():
Promise<Uint8Array<ArrayBufferLike>>
Defined in: ootle/src/wallet.ts:115
Returns the default signer’s view-only secret for stealth scanning/spending.
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
Throws
Section titled “Throws”when no default signer is configured.
Throws
Section titled “Throws”when the default address has no registered provider.
Throws
Section titled “Throws”when the default signer does not implement getViewSecret.
Implementation of
Section titled “Implementation of”registerKeyProvider()
Section titled “registerKeyProvider()”registerKeyProvider(
address,provider):this
Defined in: ootle/src/wallet.ts:47
Registers a key provider (a Signer) for the given component address.
Stealth capabilities (getViewSecret/addStealthSignature) are optional methods on
Signer (see Signer); the stealth spend authorizer uses them when present.
Parameters
Section titled “Parameters”address
Section titled “address”string
provider
Section titled “provider”Returns
Section titled “Returns”this
setDefaultSigner()
Section titled “setDefaultSigner()”setDefaultSigner(
address):this
Defined in: ootle/src/wallet.ts:58
Sets the address used when signTransaction is called without specifying a signer.
Parameters
Section titled “Parameters”address
Section titled “address”string
Returns
Section titled “Returns”this
Throws
Section titled “Throws”when no key provider has been registered for
address.
signTransaction()
Section titled “signTransaction()”signTransaction(
unsignedTx,sealPublicKey,authorizers):Promise<TransactionSignature[]>
Defined in: ootle/src/wallet.ts:90
Signs using the default signer.
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[]>
Throws
Section titled “Throws”when no default signer is configured.
Throws
Section titled “Throws”when the default address has no registered provider.