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
44 [[nodiscard]] std::string const&
45 name() const noexcept
46 {
47 return name_;
48 }
49
53 [[nodiscard]] AccountID const&
54 id() const noexcept
55 {
56 return id_;
57 }
58
62 [[nodiscard]] PublicKey const&
63 pk() const noexcept
64 {
65 return keyPair_.first;
66 }
67
71 [[nodiscard]] SecretKey const&
72 sk() const noexcept
73 {
74 return keyPair_.second;
75 }
76
80 operator AccountID const&() const noexcept
81 {
82 return id_;
83 }
84
85private:
89};
90
91} // namespace xrpl::test
A public key.
Definition PublicKey.h:53
A secret key.
Definition SecretKey.h:24
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:34