Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::wallet::wallet_api Class Referenceabstract

#include <wallet_api.hpp>

Inheritance diagram for sysio::wallet::wallet_api:

Public Member Functions

virtual ~wallet_api ()
 
virtual private_key_type get_private_key (public_key_type pubkey) const =0
 
virtual bool is_locked () const =0
 
virtual void lock ()=0
 
virtual void unlock (string password)=0
 
virtual void check_password (string password)=0
 
virtual void set_password (string password)=0
 
virtual map< public_key_type, private_key_typelist_keys ()=0
 
virtual flat_set< public_key_typelist_public_keys ()=0
 
virtual bool import_key (string wif_key)=0
 
virtual bool remove_key (string key)=0
 
virtual string create_key (string key_type)=0
 
virtual std::optional< signature_typetry_sign_digest (const digest_type digest, const public_key_type public_key)=0
 

Detailed Description

Definition at line 11 of file wallet_api.hpp.

Constructor & Destructor Documentation

◆ ~wallet_api()

virtual sysio::wallet::wallet_api::~wallet_api ( )
inlinevirtual

Definition at line 14 of file wallet_api.hpp.

14{}

Member Function Documentation

◆ check_password()

virtual void sysio::wallet::wallet_api::check_password ( string password)
pure virtual

Checks the password of the wallet

Validates the password on a wallet even if the wallet is already unlocked, throws if bad password given.

Parameters
passwordthe password previously set with set_password()

Implemented in sysio::wallet::se_wallet, sysio::wallet::soft_wallet, and sysio::wallet::yubihsm_wallet.

◆ create_key()

virtual string sysio::wallet::wallet_api::create_key ( string key_type)
pure virtual

Creates a key within the wallet to be used to sign transactions by an account.

example: create_key K1

Parameters
key_typethe key type to create. May be empty to allow wallet to pick appropriate/"best" key type

Implemented in sysio::wallet::se_wallet, sysio::wallet::soft_wallet, and sysio::wallet::yubihsm_wallet.

◆ get_private_key()

virtual private_key_type sysio::wallet::wallet_api::get_private_key ( public_key_type pubkey) const
pure virtual

Get the private key corresponding to a public key. The private key must already be in the wallet.

Implemented in sysio::wallet::se_wallet, sysio::wallet::soft_wallet, and sysio::wallet::yubihsm_wallet.

◆ import_key()

virtual bool sysio::wallet::wallet_api::import_key ( string wif_key)
pure virtual

Imports a WIF Private Key into the wallet to be used to sign transactions by an account.

example: import_key 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3

Parameters
wif_keythe WIF Private Key to import

Implemented in sysio::wallet::se_wallet, sysio::wallet::soft_wallet, and sysio::wallet::yubihsm_wallet.

◆ is_locked()

virtual bool sysio::wallet::wallet_api::is_locked ( ) const
pure virtual

Checks whether the wallet is locked (is unable to use its private keys).

This state can be changed by calling lock() or unlock().

Returns
true if the wallet is locked

Implemented in sysio::wallet::se_wallet, sysio::wallet::soft_wallet, and sysio::wallet::yubihsm_wallet.

◆ list_keys()

virtual map< public_key_type, private_key_type > sysio::wallet::wallet_api::list_keys ( )
pure virtual

Dumps all private keys owned by the wallet.

The keys are printed in WIF format. You can import these keys into another wallet using import_key()

Returns
a map containing the private keys, indexed by their public key

Implemented in sysio::wallet::se_wallet, sysio::wallet::soft_wallet, and sysio::wallet::yubihsm_wallet.

◆ list_public_keys()

virtual flat_set< public_key_type > sysio::wallet::wallet_api::list_public_keys ( )
pure virtual

Dumps all public keys owned by the wallet.

Returns
a vector containing the public keys

Implemented in sysio::wallet::se_wallet, sysio::wallet::soft_wallet, and sysio::wallet::yubihsm_wallet.

◆ lock()

virtual void sysio::wallet::wallet_api::lock ( )
pure virtual

Locks the wallet immediately

Implemented in sysio::wallet::se_wallet, sysio::wallet::soft_wallet, and sysio::wallet::yubihsm_wallet.

◆ remove_key()

virtual bool sysio::wallet::wallet_api::remove_key ( string key)
pure virtual

Removes a key from the wallet.

example: remove_key SYS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV

Parameters
keythe Public Key to remove

Implemented in sysio::wallet::se_wallet, sysio::wallet::soft_wallet, and sysio::wallet::yubihsm_wallet.

◆ set_password()

virtual void sysio::wallet::wallet_api::set_password ( string password)
pure virtual

Sets a new password on the wallet.

The wallet must be either 'new' or 'unlocked' to execute this command.

Implemented in sysio::wallet::se_wallet, sysio::wallet::soft_wallet, and sysio::wallet::yubihsm_wallet.

◆ try_sign_digest()

virtual std::optional< signature_type > sysio::wallet::wallet_api::try_sign_digest ( const digest_type digest,
const public_key_type public_key )
pure virtual

Returns a signature given the digest and public_key, if this wallet can sign via that public key

Implemented in sysio::wallet::se_wallet, sysio::wallet::soft_wallet, and sysio::wallet::yubihsm_wallet.

◆ unlock()

virtual void sysio::wallet::wallet_api::unlock ( string password)
pure virtual

Unlocks the wallet.

The wallet remain unlocked until the lock is called or the program exits.

Parameters
passwordthe password previously set with set_password()

Implemented in sysio::wallet::se_wallet, sysio::wallet::soft_wallet, and sysio::wallet::yubihsm_wallet.


The documentation for this class was generated from the following file: