DECENT
Functions

Functions

vector< account_objectgraphene::wallet::wallet_api::list_my_accounts ()
 Lists all accounts controlled by this wallet. This returns a list of the full account objects for all accounts whose private keys we possess. More...
 
string graphene::wallet::wallet_api::get_wallet_filename () const
 Returns the current wallet filename. More...
 
string graphene::wallet::wallet_api::get_private_key (public_key_type pubkey) const
 Get the WIF private key corresponding to a public key. The private key must already be imported in the wallet. More...
 
bool graphene::wallet::wallet_api::is_new () const
 Checks whether the wallet has just been created and has not yet had a password set. Calling set_password() will transition the wallet to the locked state. More...
 
bool graphene::wallet::wallet_api::is_locked () const
 Checks whether the wallet is locked (is unable to use its private keys). This state can be changed by calling lock() or unlock(). More...
 
void graphene::wallet::wallet_api::lock ()
 Locks the wallet immediately. More...
 
void graphene::wallet::wallet_api::unlock (const string &password)
 Unlocks the wallet. The wallet remain unlocked until the lock() is called or the program exits. More...
 
void graphene::wallet::wallet_api::set_password (const string &password)
 Sets a new password on the wallet. The wallet must be either new or unlocked to execute this command. More...
 
bool graphene::wallet::wallet_api::load_wallet_file (const string &wallet_filename=string())
 Loads a specified wallet file. The current wallet is closed before the new wallet is loaded. More...
 
void graphene::wallet::wallet_api::save_wallet_file (const string &wallet_filename=string())
 Saves the current wallet to the given filename. More...
 
void graphene::wallet::wallet_api::set_wallet_filename (const string &wallet_filename)
 Sets the wallet filename used for future writes. This does not trigger a save, it only changes the default filename that will be used the next time a save is triggered. More...
 
bool graphene::wallet::wallet_api::import_key (const string &account_name_or_id, const string &wif_key)
 Imports the private key for an existing account. The private key should match either an owner key or an active key for the named account. More...
 
variant graphene::wallet::wallet_api::dump_private_keys ()
 Dumps all private keys successfully imported in the wallet. More...
 
vector< account_object > list_my_accounts ()
 Lists all accounts controlled by this wallet. This returns a list of the full account objects for all accounts whose private keys we possess. More...
 
string get_wallet_filename () const
 Returns the current wallet filename. More...
 
string get_private_key (public_key_type pubkey) const
 Get the WIF private key corresponding to a public key. The private key must already be imported in the wallet. More...
 
bool is_new () const
 Checks whether the wallet has just been created and has not yet had a password set. Calling set_password() will transition the wallet to the locked state. More...
 
bool is_locked () const
 Checks whether the wallet is locked (is unable to use its private keys). This state can be changed by calling lock() or unlock(). More...
 
void lock ()
 Locks the wallet immediately. More...
 
void unlock (const string &password)
 Unlocks the wallet. The wallet remain unlocked until the lock() is called or the program exits. More...
 
void set_password (const string &password)
 Sets a new password on the wallet. The wallet must be either new or unlocked to execute this command. More...
 
bool load_wallet_file (const string &wallet_filename=string())
 Loads a specified wallet file. The current wallet is closed before the new wallet is loaded. More...
 
void save_wallet_file (const string &wallet_filename=string())
 Saves the current wallet to the given filename. More...
 
void set_wallet_filename (const string &wallet_filename)
 Sets the wallet filename used for future writes. This does not trigger a save, it only changes the default filename that will be used the next time a save is triggered. More...
 
bool import_key (const string &account_name_or_id, const string &wif_key)
 Imports the private key for an existing account. The private key should match either an owner key or an active key for the named account. More...
 
variant dump_private_keys ()
 Dumps all private keys successfully imported in the wallet. More...
 

Detailed Description

Function Documentation

◆ dump_private_keys() [1/2]

variant dump_private_keys ( )

Dumps all private keys successfully imported in the wallet.

Note
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 and corresponding public keys

◆ dump_private_keys() [2/2]

variant wallet_api::dump_private_keys ( )

Dumps all private keys successfully imported in the wallet.

Note
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 and corresponding public keys

Definition at line 138 of file wallet.cpp.

◆ get_private_key() [1/2]

string get_private_key ( public_key_type  pubkey) const

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

Parameters
pubkeypublic key
Returns
WIF private key corresponding to a public key

◆ get_private_key() [2/2]

string wallet_api::get_private_key ( public_key_type  pubkey) const

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

Parameters
pubkeypublic key
Returns
WIF private key corresponding to a public key

Definition at line 13 of file wallet.cpp.

◆ get_wallet_filename() [1/2]

string get_wallet_filename ( ) const

Returns the current wallet filename.

Note
This is the filename that will be used when automatically saving the wallet.
See also
set_wallet_filename()
Returns
the wallet filename

◆ get_wallet_filename() [2/2]

string wallet_api::get_wallet_filename ( ) const

Returns the current wallet filename.

Note
This is the filename that will be used when automatically saving the wallet.
See also
set_wallet_filename()
Returns
the wallet filename

Definition at line 8 of file wallet.cpp.

◆ import_key() [1/2]

bool import_key ( const string &  account_name_or_id,
const string &  wif_key 
)

Imports the private key for an existing account. The private key should match either an owner key or an active key for the named account.

See also
dump_private_keys()
list_my_accounts()
Parameters
account_name_or_idthe account owning the key
wif_keythe private key in WIF format
Returns
true if the key was imported

◆ import_key() [2/2]

bool wallet_api::import_key ( const string &  account_name_or_id,
const string &  wif_key 
)

Imports the private key for an existing account. The private key should match either an owner key or an active key for the named account.

See also
dump_private_keys()
list_my_accounts()
Parameters
account_name_or_idthe account owning the key
wif_keythe private key in WIF format
Returns
true if the key was imported

Definition at line 125 of file wallet.cpp.

◆ is_locked() [1/2]

bool is_locked ( ) const

Checks whether the wallet is locked (is unable to use its private keys). This state can be changed by calling lock() or unlock().

See also
unlock()
Returns
true if the wallet is locked

◆ is_locked() [2/2]

bool wallet_api::is_locked ( ) const

Checks whether the wallet is locked (is unable to use its private keys). This state can be changed by calling lock() or unlock().

See also
unlock()
Returns
true if the wallet is locked

Definition at line 23 of file wallet.cpp.

◆ is_new() [1/2]

bool is_new ( ) const

Checks whether the wallet has just been created and has not yet had a password set. Calling set_password() will transition the wallet to the locked state.

Returns
true if the wallet is new

◆ is_new() [2/2]

bool wallet_api::is_new ( ) const

Checks whether the wallet has just been created and has not yet had a password set. Calling set_password() will transition the wallet to the locked state.

Returns
true if the wallet is new

Definition at line 18 of file wallet.cpp.

◆ list_my_accounts() [1/2]

vector<account_object> list_my_accounts ( )

Lists all accounts controlled by this wallet. This returns a list of the full account objects for all accounts whose private keys we possess.

Returns
a list of accounts imported in the wallet

◆ list_my_accounts() [2/2]

vector< account_object > wallet_api::list_my_accounts ( )

Lists all accounts controlled by this wallet. This returns a list of the full account objects for all accounts whose private keys we possess.

Returns
a list of accounts imported in the wallet

Definition at line 3 of file wallet.cpp.

◆ load_wallet_file() [1/2]

bool load_wallet_file ( const string &  wallet_filename = string())

Loads a specified wallet file. The current wallet is closed before the new wallet is loaded.

Warning
This does not change the filename that will be used for future wallet writes, so this may cause you to overwrite your original wallet unless you also call set_wallet_filename()
Parameters
wallet_filenamethe filename of the wallet JSON file to load. If wallet_filename is empty, it reloads the existing wallet file
Returns
true if the specified wallet is loaded

◆ load_wallet_file() [2/2]

bool wallet_api::load_wallet_file ( const string &  wallet_filename = string())

Loads a specified wallet file. The current wallet is closed before the new wallet is loaded.

Warning
This does not change the filename that will be used for future wallet writes, so this may cause you to overwrite your original wallet unless you also call set_wallet_filename()
Parameters
wallet_filenamethe filename of the wallet JSON file to load. If wallet_filename is empty, it reloads the existing wallet file
Returns
true if the specified wallet is loaded

Definition at line 110 of file wallet.cpp.

◆ lock() [1/2]

void lock ( )

Locks the wallet immediately.

See also
unlock()

◆ lock() [2/2]

void wallet_api::lock ( )

Locks the wallet immediately.

See also
unlock()

Definition at line 28 of file wallet.cpp.

◆ save_wallet_file() [1/2]

void save_wallet_file ( const string &  wallet_filename = string())

Saves the current wallet to the given filename.

Warning
This does not change the wallet filename that will be used for future writes, so think of this function as 'Save a Copy As...' instead of 'Save As...'. Use set_wallet_filename() to make the filename persist.
Parameters
wallet_filenamethe filename of the new wallet JSON file to create or overwrite. If wallet_filename is empty, save to the current filename.

◆ save_wallet_file() [2/2]

void wallet_api::save_wallet_file ( const string &  wallet_filename = string())

Saves the current wallet to the given filename.

Warning
This does not change the wallet filename that will be used for future writes, so think of this function as 'Save a Copy As...' instead of 'Save As...'. Use set_wallet_filename() to make the filename persist.
Parameters
wallet_filenamethe filename of the new wallet JSON file to create or overwrite. If wallet_filename is empty, save to the current filename.

Definition at line 115 of file wallet.cpp.

◆ set_password() [1/2]

void set_password ( const string &  password)

Sets a new password on the wallet. The wallet must be either new or unlocked to execute this command.

Parameters
password

◆ set_password() [2/2]

void wallet_api::set_password ( const string &  password)

Sets a new password on the wallet. The wallet must be either new or unlocked to execute this command.

Parameters
password

Definition at line 102 of file wallet.cpp.

◆ set_wallet_filename() [1/2]

void set_wallet_filename ( const string &  wallet_filename)

Sets the wallet filename used for future writes. This does not trigger a save, it only changes the default filename that will be used the next time a save is triggered.

Parameters
wallet_filenamethe new filename to use for future saves

◆ set_wallet_filename() [2/2]

void wallet_api::set_wallet_filename ( const string &  wallet_filename)

Sets the wallet filename used for future writes. This does not trigger a save, it only changes the default filename that will be used the next time a save is triggered.

Parameters
wallet_filenamethe new filename to use for future saves

Definition at line 120 of file wallet.cpp.

◆ unlock() [1/2]

void unlock ( const string &  password)

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

Parameters
passwordthe password previously set with set_password()

◆ unlock() [2/2]

void wallet_api::unlock ( const string &  password)

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

Parameters
passwordthe password previously set with set_password()

Definition at line 40 of file wallet.cpp.