xrpld
Loading...
Searching...
No Matches
/libxrpl/helpers/Account.h
1#pragma once
2
3#include <xrpl/protocol/AccountID.h>
4#include <xrpl/protocol/KeyType.h>
5#include <xrpl/protocol/PublicKey.h>
6#include <xrpl/protocol/SecretKey.h>
7
8#include <string>
9#include <string_view>
10#include <utility>
11
12namespace xrpl::test {
13
21{
22public:
29 static Account const kMaster;
30
40
42 [[nodiscard]] std::string const&
43 name() const noexcept
44 {
45 return name_;
46 }
47
49 [[nodiscard]] AccountID const&
50 id() const noexcept
51 {
52 return id_;
53 }
54
56 [[nodiscard]] PublicKey const&
57 pk() const noexcept
58 {
59 return keyPair_.first;
60 }
61
63 [[nodiscard]] SecretKey const&
64 sk() const noexcept
65 {
66 return keyPair_.second;
67 }
68
70 operator AccountID const&() const noexcept
71 {
72 return id_;
73 }
74
75private:
79};
80
81} // namespace xrpl::test
A public key.
Definition PublicKey.h:42
A secret key.
Definition SecretKey.h:18
Account(std::string_view name, KeyType type=KeyType::Secp256k1)
Create an account from a name.
SecretKey const & sk() const noexcept
Return the secret key.
std::pair< PublicKey, SecretKey > keyPair_
AccountID const & id() const noexcept
Return the AccountID.
static Account const kMaster
The master account that holds all XRP in genesis.
PublicKey const & pk() const noexcept
Return the public key.
std::string const & name() const noexcept
Return the human-readable name.
KeyType
Definition KeyType.h:8
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:28