xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
xrpld
rpc
detail
MPT.h
1
#pragma once
2
3
#include <xrpl/protocol/AccountID.h>
4
#include <xrpl/protocol/MPTIssue.h>
5
#include <xrpl/protocol/UintTypes.h>
6
7
namespace
xrpl
{
8
9
class
PathFindMPT
final
10
{
11
private
:
12
MPTID
const
mptID_
;
13
// If true then holder's balance is 0, always false for issuer
14
bool
const
zeroBalance_
;
15
// OutstandingAmount is equal to MaximumAmount
16
bool
const
maxedOut_
;
17
18
public
:
19
PathFindMPT
(
MPTID
const
& mptID) :
mptID_
(mptID),
zeroBalance_
(false),
maxedOut_
(false)
20
{
21
}
22
PathFindMPT
(
MPTID
const
& mptID,
bool
zeroBalance,
bool
maxedOut)
23
:
mptID_
(mptID),
zeroBalance_
(zeroBalance),
maxedOut_
(maxedOut)
24
{
25
}
26
operator
MPTID
const
&()
const
27
{
28
return
mptID_
;
29
}
30
[[nodiscard]]
MPTID
const
&
31
getMptID
()
const
32
{
33
return
mptID_
;
34
}
35
[[nodiscard]]
bool
36
canSend
(
AccountID
const
& account)
const
37
{
38
// A maxed-out issuance only prevents the issuer from creating more
39
// MPT. Holders can still send existing balances.
40
return
account ==
getMPTIssuer
(
mptID_
) ? !
maxedOut_
: !
zeroBalance_
;
41
}
42
};
43
44
}
// namespace xrpl
xrpl::PathFindMPT::maxedOut_
bool const maxedOut_
Definition
MPT.h:16
xrpl::PathFindMPT::PathFindMPT
PathFindMPT(MPTID const &mptID)
Definition
MPT.h:19
xrpl::PathFindMPT::canSend
bool canSend(AccountID const &account) const
Definition
MPT.h:36
xrpl::PathFindMPT::mptID_
MPTID const mptID_
Definition
MPT.h:12
xrpl::PathFindMPT::getMptID
MPTID const & getMptID() const
Definition
MPT.h:31
xrpl::PathFindMPT::PathFindMPT
PathFindMPT(MPTID const &mptID, bool zeroBalance, bool maxedOut)
Definition
MPT.h:22
xrpl::PathFindMPT::zeroBalance_
bool const zeroBalance_
Definition
MPT.h:14
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::getMPTIssuer
AccountID getMPTIssuer(MPTID const &mptid)
Definition
MPTIssue.h:95
xrpl::MPTID
BaseUInt< 192 > MPTID
MPTID is a 192-bit value representing MPT Issuance ID, which is a concatenation of a 32-bit sequence ...
Definition
UintTypes.h:54
xrpl::AccountID
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition
AccountID.h:34
Generated by
1.17.0