Scorum
Functions
Helpers

Wallet Helpers. More...

Functions

operation scorum::wallet::wallet_api::get_prototype_operation (const std::string &operation_type)
 
std::string scorum::wallet::wallet_api::serialize_transaction (const signed_transaction &tx) const
 
annotated_signed_transaction scorum::wallet::wallet_api::sign_transaction (const signed_transaction &tx, bool broadcast=false)
 
void scorum::wallet::wallet_api::set_transaction_expiration (uint32_t seconds)
 
void scorum::wallet::wallet_api::network_add_nodes (const std::vector< std::string > &nodes)
 
std::vector< variant > scorum::wallet::wallet_api::network_get_connected_peers ()
 

Detailed Description

Wallet Helpers.

Function Documentation

◆ get_prototype_operation()

operation scorum::wallet::wallet_api::get_prototype_operation ( const std::string &  operation_type)

Returns an uninitialized object representing a given blockchain operation.

This returns a default-initialized object of the given type; it can be used during early development of the wallet when we don't yet have custom commands for creating all of the operations the blockchain supports.

Any operation the blockchain supports can be created using the transaction builder's add_operation_to_builder_transaction() , but to do that from the CLI you need to know what the JSON form of the operation looks like. This will give you a template you can fill in. It's better than nothing.

Parameters
operation_typethe type of operation to return, must be one of the operations defined in scorum/chain/operations.hpp (e.g., "global_parameters_update_operation")
Returns
a default-constructed operation of the given type

Definition at line 1239 of file wallet.cpp.

◆ network_add_nodes()

void scorum::wallet::wallet_api::network_add_nodes ( const std::vector< std::string > &  nodes)

Network add nodes

Parameters
nodes

Definition at line 1244 of file wallet.cpp.

◆ network_get_connected_peers()

std::vector< variant > scorum::wallet::wallet_api::network_get_connected_peers ( )

Get connected peers

Returns
std::vector<variant>

Definition at line 1249 of file wallet.cpp.

◆ serialize_transaction()

std::string scorum::wallet::wallet_api::serialize_transaction ( const signed_transaction tx) const

Converts a signed_transaction in JSON form to its binary representation.

Parameters
txthe transaction to serialize
Returns
the binary form of the transaction. It will not be hex encoded, this returns a raw string that may have null characters embedded in it

Definition at line 1149 of file wallet.cpp.

◆ set_transaction_expiration()

void scorum::wallet::wallet_api::set_transaction_expiration ( uint32_t  seconds)

Sets the amount of time in the futrue until a transaction expires.

Definition at line 2487 of file wallet.cpp.

◆ sign_transaction()

annotated_signed_transaction scorum::wallet::wallet_api::sign_transaction ( const signed_transaction tx,
bool  broadcast = false 
)

Signs a transaction.

Given a fully-formed transaction that is only lacking signatrues, this signs the transaction with the necessary keys and optionally broadcasts the transaction

Parameters
txthe unsigned transaction
broadcasttrue if you wish to broadcast the transaction
Returns
the signed version of the transaction

Definition at line 1230 of file wallet.cpp.