ledger-core
Public Member Functions | Static Public Member Functions | List of all members
ledger::core::api::Address Class Referenceabstract
+ Inheritance diagram for ledger::core::api::Address:

Public Member Functions

virtual std::experimental::optional< std::string > getDerivationPath ()=0
 
virtual std::string toString ()=0
 
virtual std::shared_ptr< BitcoinLikeAddressasBitcoinLikeAddress ()=0
 
virtual bool isInstanceOfBitcoinLikeAddress ()=0
 
virtual Currency getCurrency ()=0
 

Static Public Member Functions

static std::shared_ptr< Addressparse (const std::string &address, const Currency &currency)
 
static bool isValid (const std::string &address, const Currency &currency)
 

Member Function Documentation

◆ getDerivationPath()

virtual std::experimental::optional<std::string> ledger::core::api::Address::getDerivationPath ( )
pure virtual

Gets an optional derivation path (if the address is owned by an account).

Returns
The derivation path of the address

Implemented in ledger::core::TezosLikeAddress, ledger::core::BitcoinLikeAddress, ledger::core::RippleLikeAddress, ledger::core::EthereumLikeAddress, and ledger::core::AbstractAddress.

◆ isValid()

bool ledger::core::api::Address::isValid ( const std::string &  address,
const Currency currency 
)
static

Checks if the given string formatted address is valid or not.

Parameters
addressThe string to parse
currencyThe currency used to parse the address
Returns
If successful returns true, false otherwise.

◆ parse()

std::shared_ptr< api::Address > ledger::core::api::Address::parse ( const std::string &  address,
const Currency currency 
)
static

Attempt to parse a string address. If the address can be parse return it otherwise return a NONE (depending on you host this may be a null, nil, None...).

Parameters
addressThe string to parse
currencyThe currency used to parse the address
Returns
If successful returns the address object otherwise null.

◆ toString()

virtual std::string ledger::core::api::Address::toString ( )
pure virtual

Serialize the address to a string. The serialization method depends of the underlying currency and format (Base58, Bech32, Ethereum...).

Implemented in ledger::core::TezosLikeAddress, ledger::core::BitcoinLikeAddress, ledger::core::RippleLikeAddress, and ledger::core::EthereumLikeAddress.


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