Offline Transaction Signing (OTS) 0.1.0
Loading...
Searching...
No Matches
ots::LegacySeed Class Reference

Represents a monero 13-words seed type for backward compatibility. More...

#include <ots.hpp>

Inheritance diagram for ots::LegacySeed:
Collaboration diagram for ots::LegacySeed:

Public Member Functions

const WipeableString phrase (const SeedLanguage &language, const std::string &password="") const override
 seed phrase in a specified language
 
const SeedIndices indices (const std::string &password="") const override
 Gets the raw numeric values representing the seed (indices)
 
- Public Member Functions inherited from ots::Seed
virtual ~Seed ()=default
 Virtual destructor to ensure proper cleanup of derived classes.
 
virtual const std::string & fingerprint () const noexcept
 Provides a unique fingerprint for the seed.
 
virtual const Addressaddress () const noexcept
 Address of the seed.
 
virtual const uint64_t timestamp () const noexcept
 Gets the seed's creation timestamp.
 
virtual const uint64_t height () const noexcept
 Gets the blockchain height associated with the seed.
 
virtual const Networknetwork () const noexcept
 Gets the network associated with the seed.
 
virtual std::shared_ptr< Walletwallet () noexcept
 Creates a wallet from the seed.
 
 Seed (const Seed &)=delete
 
Seedoperator= (const Seed &)=delete
 
 Seed (Seed &&) noexcept=default
 
Seedoperator= (Seed &&) noexcept=default
 

Static Public Member Functions

static LegacySeed decode (const std::string &phrase, uint64_t height=0, uint64_t time=0, Network network=Network::MAIN)
 Decodes a seed from a phrase.
 
static LegacySeed decode (const SeedIndices &indices, uint64_t height=0, uint64_t time=0, Network network=Network::MAIN)
 Decodes a seed from numeric values.
 
static LegacySeed decode (const std::vector< uint16_t > &values, uint64_t height=0, uint64_t time=0, Network network=Network::MAIN)
 Decodes a seed from numeric values.
 
- Static Public Member Functions inherited from ots::Seed
static std::vector< uint16_t > mergeValues (const std::vector< uint16_t > &values1, const std::vector< uint16_t > &values2)
 Merges two seed values, so you can join multiple SeedQRs to one seed.
 
static std::vector< uint16_t > mergeValues (const std::vector< std::vector< uint16_t > > &values)
 Merges multiple seed values, so you can join multiple SeedQRs to one seed.
 
static std::vector< uint16_t > mergeAndZeorizeValues (std::vector< uint16_t > &values1, std::vector< uint16_t > &values2, bool del=true)
 Merges two seed values, so you can join multiple SeedQRs to one seed.
 
static std::vector< uint16_t > mergeAndZeorizeValues (std::vector< std::vector< uint16_t > > &values, bool del=true)
 Merges multiple seed values, so you can join multiple SeedQRs to one seed.
 
static std::vector< uint16_t > mergeWithPassword (const std::string &password, const std::vector< uint16_t > &values)
 Merge password with seed values.
 
static std::vector< uint16_t > mergeWithPasswordAndZeorize (std::string &password, std::vector< uint16_t > &values, bool del=true)
 Merge password with seed values and zeroize password.
 
static std::vector< uint16_t > mergeWithPassword (const WipeableString &password, const std::vector< uint16_t > &values)
 Merge password with seed values.
 
static std::vector< uint16_t > mergeWithPasswordAndZeorize (const WipeableString &password, std::vector< uint16_t > &values, bool del=true)
 Merge password with seed values and zeroize values.
 

Protected Member Functions

 LegacySeed ()
 
- Protected Member Functions inherited from ots::Seed
 Seed ()
 

Protected Attributes

std::unique_ptr< KeyStore, KeyStoreDeleterm_seed
 
- Protected Attributes inherited from ots::Seed
std::unique_ptr< Addressm_address
 
std::shared_ptr< Walletm_wallet
 
uint64_t m_timestamp = 0
 
uint64_t m_height = 0
 
std::unique_ptr< KeyStore, KeyStoreDeleterm_key
 
Network m_network
 

Detailed Description

Represents a monero 13-words seed type for backward compatibility.

Provides only decoding

Constructor & Destructor Documentation

◆ LegacySeed()

ots::LegacySeed::LegacySeed ( )
explicitprotected

Member Function Documentation

◆ decode() [1/3]

LegacySeed ots::LegacySeed::decode ( const SeedIndices indices,
uint64_t  height = 0,
uint64_t  time = 0,
Network  network = Network::MAIN 
)
static

Decodes a seed from numeric values.

Parameters
indicesSeedIndices to decode
heightOptional blockchain height
timeOptional timestamp
networkNetwork type (default: MAIN)
Returns
LegacySeed Decoded seed
Todo:
TODO: should use a protected constructor LegacySeed(const char* data, uint64_t height, uint64_t time, Network network) to avoid code duplication

◆ decode() [2/3]

LegacySeed ots::LegacySeed::decode ( const std::string &  phrase,
uint64_t  height = 0,
uint64_t  time = 0,
Network  network = Network::MAIN 
)
static

Decodes a seed from a phrase.

Parameters
phraseSeed phrase
heightOptional blockchain height
timeOptional timestamp
networkNetwork type (default: MAIN)
Returns
LegacySeed Decoded seed
Exceptions
ots::exception::seed::SeedDecodingFailedIf decoding fails
ots::exception::legacyseed::InvalidSeedFormatIf the seed phrase is not in the expected format

◆ decode() [3/3]

LegacySeed ots::LegacySeed::decode ( const std::vector< uint16_t > &  values,
uint64_t  height = 0,
uint64_t  time = 0,
Network  network = Network::MAIN 
)
static

Decodes a seed from numeric values.

Parameters
valuesNumeric representation of the seed
heightOptional blockchain height
timeOptional timestamp
networkNetwork type (default: MAIN)
Returns
LegacySeed Decoded seed

◆ indices()

const SeedIndices ots::LegacySeed::indices ( const std::string &  password = "") const
overridevirtual

Gets the raw numeric values representing the seed (indices)

Returns
Seed numeric representation

Implements ots::Seed.

◆ phrase()

const WipeableString ots::LegacySeed::phrase ( const SeedLanguage language,
const std::string &  password = "" 
) const
overridevirtual

seed phrase in a specified language

Parameters
languageSeedLanguage to use
Returns
std::string Seed phrase

Implements ots::Seed.

Member Data Documentation

◆ m_seed

std::unique_ptr<KeyStore, KeyStoreDeleter> ots::LegacySeed::m_seed
protected

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