30 #include <iota/crypto/kerl.hpp> 31 #include <iota/types/trinary.hpp> 45 enum Type { NORMAL, MULTISIG };
56 Address(
const Types::Trytes& address =
"",
const int64_t& balance = 0,
57 const int32_t& keyIndex = 0,
const int32_t& security = 2,
const Type& type = NORMAL);
67 Address(
const char* address,
const int64_t& balance = 0,
const int32_t& keyIndex = 0,
68 const int32_t& security = 2,
const Type& type = NORMAL);
75 explicit Address(
const Type& type);
86 const Types::Trytes&
toTrytes()
const;
105 void setAddress(
const Types::Trytes& address);
118 const Types::Trytes&
getChecksum(
bool validChecksum =
false);
149 bool validate(
const std::vector<std::vector<uint8_t>>& digests);
211 bool operator==(
const Types::Trytes& rhs)
const;
220 bool operator!=(
const Types::Trytes& rhs)
const;
226 Types::Trytes address_;
231 int64_t balance_ = 0;
236 int32_t keyIndex_ = 0;
241 int32_t security_ = 2;
251 Types::Trytes checksum_;
257 std::shared_ptr<Crypto::Kerl> k_;
260 std::ostream& operator<<(std::ostream& os,
const Address& address);
bool operator!=(const Address &rhs) const
Types::Trytes toTrytesWithChecksum(bool validChecksum=false)
const int64_t & getBalance() const
void setSecurity(const int32_t &security)
Definition: address.hpp:43
const Types::Trytes & toTrytes() const
void setKeyIndex(const int32_t &keyIndex)
void absorbDigests(const std::vector< uint8_t > &digests)
const int32_t & getKeyIndex() const
Address(const Types::Trytes &address="", const int64_t &balance=0, const int32_t &keyIndex=0, const int32_t &security=2, const Type &type=NORMAL)
bool validate(const std::vector< std::vector< uint8_t >> &digests)
const Types::Trytes & getChecksum(bool validChecksum=false)
void setBalance(const int64_t &balance)
bool operator==(const Address &rhs) const
void setAddress(const Types::Trytes &address)
const int32_t & getSecurity() const