SingleAddressWallet
Extends: RefCounted
Description
This class holds the [b]encrypted[/b] master private key of a user's wallet. It can be used for offline wallet operations and queries, such as signing, adding accounts and consulting addresses. You should create a SingleAddressWallet with [SingleAddressWalletLoader], by calling any of its creation or import methods. Refer to [OnlineWallet] for a class that has network connectivity and can do blockchain queries. In general, this class is the one you are interested in for dApp development.
This class holds the [b]encrypted[/b] master private key of a user's wallet. It can be used for offline wallet operations and queries, such as signing, adding accounts and consulting addresses. You should create a SingleAddressWallet with [SingleAddressWalletLoader], by calling any of its creation or import methods. Refer to [OnlineWallet] for a class that has network connectivity and can do blockchain queries. In general, this class is the one you are interested in for dApp development.
Constants Descriptions
Status
Method Descriptions
_init
WARNING: Do not use this constructor! Use any of the import/creation methods exposed in [SingleAddressWalletLoader].
get_address
Get the account's Address
get_address_bech32
Get the account's address as a BECH32-encoded [String].
get_address_hex
sign_transaction
Sign the given Transaction
sign_data
Sign the given [String] representing hex encoded payload and obtain a [DataSignature]
add_account
Adds an account to this wallet with the given index
switch_account
Switch to the account with the given account_index
. It may fail if no such account exists. It returns the account index when it succeeds.
accounts
Return a list of accounts currently available in the wallet
export
Export wallet to a resource.
Sub-classes
SignDataResult
Property Descriptions
value
- Getter:
@value_getter
WARNING: This function may fail! First match on Result.tag or call Result.is_ok.
error
- Getter:
@error_getter
WARNING: This function may fail! First match on Result.tag or call Result._is_err.
AddAccountResult
Property Descriptions
value
- Getter:
@value_getter
WARNING: This function may fail! First match on Result.tag or call Result.is_ok.
error
- Getter:
@error_getter
WARNING: This function may fail! First match on Result.tag or call Result._is_err.