Offline Transaction Signing (OTS) 0.1.0
|
holds monero internal account and internal functions More...
#include <account.hpp>
Public Member Functions | |
Account (const std::array< unsigned char, 32 > &key, const Network network) | |
Construct a new Monero Account object. | |
Account (const crypto::secret_key &key, const Network network) | |
Construct a new Monero Account object. | |
Account (const KeyStore &key, const Network network) | |
Construct a new Monero Account object. | |
Account (const cryptonote::account_base &account, const Network network) | |
Construct a new Monero Account object. | |
Account (const Account &account) | |
Construct a new Monero Account object. | |
Address | address () const noexcept |
the public address of the wallet/account(0) | |
Address | address (uint32_t account, uint32_t index) const noexcept |
address of a certain account and index | |
Address | address (const cryptonote::subaddress_index index) const noexcept |
address of a certain subaddr_index | |
bool | hasAddress (const Address &address, uint32_t maxAccountDepth=DEFAULT_MAX_ACCOUNT_DEPTH, uint32_t maxIndexDepth=DEFAULT_MAX_INDEX_DEPTH) const noexcept |
check if the address is in the wallet, but restricted to the search depth | |
std::pair< uint32_t, uint32_t > | addressIndex (const Address &address, uint32_t maxAccountDepth=DEFAULT_MAX_ACCOUNT_DEPTH, uint32_t maxIndexDepth=DEFAULT_MAX_INDEX_DEPTH) const |
get the account and subindex of a address in the Wallet | |
WipeableString | secretSpendKey () const noexcept |
secret spend key of the wallet in hex digits | |
WipeableString | publicSpendKey () const noexcept |
public spend key of the wallet in hex digits | |
WipeableString | secretViewKey () const noexcept |
secret view key of the wallet in hex digits | |
WipeableString | publicViewKey () const noexcept |
public view key of the wallet in hex digits | |
void | clearAddressCache () const noexcept |
clear the address cache | |
size_t | importOutputs (const std::string &outputs) |
import outputs from a string | |
size_t | importOutputs (const std::tuple< uint64_t, uint64_t, std::vector< exported_transfer_details > > &outputs) |
import outputs from a tuple | |
size_t | importOutputs (const std::tuple< uint64_t, uint64_t, std::vector< transfer_details > > &outputs) |
import outputs from a tuple | |
std::string | signData (const std::string &data) const |
sign a message with the wallet | |
std::string | signData (const std::string &data, const std::pair< uint32_t, uint32_t > &index) const |
sign a message with subindex address of the wallet | |
std::string | signData (const std::string &data, const std::string &address, uint32_t maxAccountDepth=DEFAULT_MAX_ACCOUNT_DEPTH, uint32_t maxIndexDepth=DEFAULT_MAX_INDEX_DEPTH) const |
sign a message with the provided address of the wallet | |
std::string | signData (const std::string &data, const Address &address, uint32_t maxAccountDepth=DEFAULT_MAX_ACCOUNT_DEPTH, uint32_t maxIndexDepth=DEFAULT_MAX_INDEX_DEPTH) const |
sign a message with the provided address of the wallet | |
Static Public Member Functions | |
static bool | verifyData (const std::string &data, const Address &address, const std::string &signature) |
verify a signed message | |
static bool | verifyData (const std::string &data, const std::string &address, const std::string &signature) |
verify a signed message | |
static bool | verifyDataLegacy (const std::string &data, const Address &address, const std::string &signature) |
verify a signed message | |
static bool | verifyDataLegacy (const std::string &data, const std::string &address, const std::string &signature) |
verify a signed message | |
holds monero internal account and internal functions
|
explicit |
Construct a new Monero Account object.
key | is the secret spend key |
network | is the network type |
|
explicit |
Construct a new Monero Account object.
key | is the secret spend key, crypto::secret_key is a monero secure container for the key |
network | is the network type |
|
explicit |
Construct a new Monero Account object.
account | is the account object, account_base is the monero secure container for the account |
network | is the network type |
|
explicit |
|
noexcept |
the public address of the wallet/account(0)
|
noexcept |
address of a certain subaddr_index
|
noexcept |
address of a certain account and index
account | the account |
std::pair< uint32_t, uint32_t > ots::Account::addressIndex | ( | const Address & | address, |
uint32_t | maxAccountDepth = DEFAULT_MAX_ACCOUNT_DEPTH , |
||
uint32_t | maxIndexDepth = DEFAULT_MAX_INDEX_DEPTH |
||
) | const |
get the account and subindex of a address in the Wallet
address | the address to check |
maxAccountDepth | the maximum account depth to search |
maxIndexDepth | the maximum index depth to search |
ots::exception::address:NotFound | if the address is not in the wallet |
|
noexcept |
clear the address cache
|
noexcept |
check if the address is in the wallet, but restricted to the search depth
address | the address to check |
maxAccountDepth | the maximum account depth to search |
maxIndexDepth | the maximum index depth to search |
size_t ots::Account::importOutputs | ( | const std::string & | outputs | ) |
import outputs from a string
outputs | the outputs to import |
ots::exception::wallet::ImportOutputs | if the magic is bad or the data is bad |
size_t ots::Account::importOutputs | ( | const std::tuple< uint64_t, uint64_t, std::vector< exported_transfer_details > > & | outputs | ) |
import outputs from a tuple
outputs | the outputs to import |
size_t ots::Account::importOutputs | ( | const std::tuple< uint64_t, uint64_t, std::vector< transfer_details > > & | outputs | ) |
import outputs from a tuple
outputs | the outputs to import |
|
noexcept |
public spend key of the wallet in hex digits
|
noexcept |
public view key of the wallet in hex digits
|
noexcept |
secret spend key of the wallet in hex digits
|
noexcept |
secret view key of the wallet in hex digits
std::string ots::Account::signData | ( | const std::string & | data | ) | const |
sign a message with the wallet
data | the message to sign |
ots::exception::BufferOverflowException | if tools:write_varint fails in Account::hashData() (should not happen) |
std::string ots::Account::signData | ( | const std::string & | data, |
const Address & | address, | ||
uint32_t | maxAccountDepth = DEFAULT_MAX_ACCOUNT_DEPTH , |
||
uint32_t | maxIndexDepth = DEFAULT_MAX_INDEX_DEPTH |
||
) | const |
sign a message with the provided address of the wallet
data | the message to sign |
address | the address of the wallet |
maxAccountDepth | the maximum account depth to search |
maxIndexDepth | the maximum index depth to search |
ots::exception::address::Invalid | if the address is not valid |
ots::exception::BufferOverflowException | if tools:write_varint fails in Account::hashData() (should not happen) |
std::string ots::Account::signData | ( | const std::string & | data, |
const std::pair< uint32_t, uint32_t > & | index | ||
) | const |
sign a message with subindex address of the wallet
data | the message to sign |
index | the account and index to sign with |
ots::exception::BufferOverflowException | if tools:write_varint fails in Account::hashData() (should not happen) |
std::string ots::Account::signData | ( | const std::string & | data, |
const std::string & | address, | ||
uint32_t | maxAccountDepth = DEFAULT_MAX_ACCOUNT_DEPTH , |
||
uint32_t | maxIndexDepth = DEFAULT_MAX_INDEX_DEPTH |
||
) | const |
sign a message with the provided address of the wallet
data | the message to sign |
address | the address of the wallet |
maxAccountDepth | the maximum account depth to search |
maxIndexDepth | the maximum index depth to search |
ots::exception::address::Invalid | if the address is not valid |
ots::exception::BufferOverflowException | if tools:write_varint fails in Account::hashData() (should not happen) |
|
static |
verify a signed message
data | the message to verify |
address | of the signer |
signature | of the message |
|
static |
verify a signed message
data | the message to verify |
address | of the signer |
signature | of the message |
|
static |
verify a signed message
data | the message to verify |
address | of the signer |
signature | of the message |
|
static |
verify a signed message
data | the message to verify |
address | of the signer |
signature | of the message |