OotleWallet
Defined in: ootle/src/wallet.ts:32
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:36
Returns
Section titled “Returns”OotleWallet
Methods
Section titled “Methods”authorizeTransaction()
Section titled “authorizeTransaction()”authorizeTransaction(
signerAddress,unsignedTx,sealPublicKey):Promise<TransactionAuthorization>
Defined in: ootle/src/wallet.ts:102
Generates TransactionAuthorization (signatures) for a specific registered signer.
Mirrors OotleWallet::authorize_transaction from ootle-rs.
Parameters
Section titled “Parameters”signerAddress
Section titled “signerAddress”string
unsignedTx
Section titled “unsignedTx”UnsignedTransactionV1
sealPublicKey
Section titled “sealPublicKey”Uint8Array
Returns
Section titled “Returns”Promise<TransactionAuthorization>
Throws
Section titled “Throws”when no provider is registered for signerAddress.
authorizeTransactionAll()
Section titled “authorizeTransactionAll()”authorizeTransactionAll(
unsignedTx,sealPublicKey):Promise<TransactionAuthorization[]>
Defined in: ootle/src/wallet.ts:116
Collects authorizations from all registered key providers. Useful when a transaction requires multiple signers.
Parameters
Section titled “Parameters”unsignedTx
Section titled “unsignedTx”UnsignedTransactionV1
sealPublicKey
Section titled “sealPublicKey”Uint8Array
Returns
Section titled “Returns”Promise<TransactionAuthorization[]>
getAddress()
Section titled “getAddress()”getAddress():
Promise<string>
Defined in: ootle/src/wallet.ts:68
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”getKeyProvider()
Section titled “getKeyProvider()”getKeyProvider(
address):Signer|undefined
Defined in: ootle/src/wallet.ts:128
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:79
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:135
Returns all registered signer addresses.
Returns
Section titled “Returns”string[]
registerKeyProvider()
Section titled “registerKeyProvider()”registerKeyProvider(
address,provider):this
Defined in: ootle/src/wallet.ts:46
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:57
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):Promise<TransactionSignature[]>
Defined in: ootle/src/wallet.ts:89
Signs using the default signer.
Parameters
Section titled “Parameters”unsignedTx
Section titled “unsignedTx”UnsignedTransactionV1
sealPublicKey
Section titled “sealPublicKey”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.