Claimant
in package
Represents a claimant for claimable balances
A claimant is an account that can claim a claimable balance, subject to optional predicates that control when the balance can be claimed. Predicates can be based on time (absolute or relative) or combined using logical operators (AND, OR, NOT).
Tags
Table of Contents
Methods
- __construct() : mixed
- Claimant constructor
- fromXdr() : Claimant
- Creates a Claimant from XDR format
- getDestination() : string
- Gets the destination account ID
- getPredicate() : XdrClaimPredicate
- Gets the claim predicate
- predicateAnd() : XdrClaimPredicate
- Creates an AND predicate combining two predicates
- predicateBeforeAbsoluteTime() : XdrClaimPredicate
- Creates a predicate based on absolute time
- predicateBeforeRelativeTime() : XdrClaimPredicate
- Creates a predicate based on relative time
- predicateNot() : XdrClaimPredicate
- Creates a NOT predicate inverting another predicate
- predicateOr() : XdrClaimPredicate
- Creates an OR predicate combining two predicates
- predicateUnconditional() : XdrClaimPredicate
- Creates an unconditional claim predicate
- toXdr() : XdrClaimant
- Converts this claimant to XDR format
Methods
__construct()
Claimant constructor
public
__construct(string $destination, XdrClaimPredicate $predicate) : mixed
Parameters
- $destination : string
-
The account ID that can claim the balance
- $predicate : XdrClaimPredicate
-
The conditions under which the balance can be claimed
fromXdr()
Creates a Claimant from XDR format
public
static fromXdr(XdrClaimant $xdr) : Claimant
Parameters
- $xdr : XdrClaimant
-
The XDR encoded claimant
Return values
Claimant —The decoded claimant object
getDestination()
Gets the destination account ID
public
getDestination() : string
Return values
string —The account ID that can claim the balance
getPredicate()
Gets the claim predicate
public
getPredicate() : XdrClaimPredicate
Return values
XdrClaimPredicate —The conditions for claiming the balance
predicateAnd()
Creates an AND predicate combining two predicates
public
static predicateAnd(XdrClaimPredicate $left, XdrClaimPredicate $right) : XdrClaimPredicate
Both predicates must be satisfied for the balance to be claimable.
Parameters
- $left : XdrClaimPredicate
-
The first predicate
- $right : XdrClaimPredicate
-
The second predicate
Return values
XdrClaimPredicate —An AND predicate
predicateBeforeAbsoluteTime()
Creates a predicate based on absolute time
public
static predicateBeforeAbsoluteTime(int $unixEpoch) : XdrClaimPredicate
The balance can be claimed before the specified Unix timestamp.
Parameters
- $unixEpoch : int
-
The Unix timestamp (seconds since epoch)
Return values
XdrClaimPredicate —A time-based predicate
predicateBeforeRelativeTime()
Creates a predicate based on relative time
public
static predicateBeforeRelativeTime(int $unixEpoch) : XdrClaimPredicate
The balance can be claimed before the specified duration has elapsed since the claimable balance was created.
Parameters
- $unixEpoch : int
-
The number of seconds after the claimable balance creation (NOT a Unix timestamp)
Return values
XdrClaimPredicate —A relative time-based predicate
predicateNot()
Creates a NOT predicate inverting another predicate
public
static predicateNot(XdrClaimPredicate $predicate) : XdrClaimPredicate
The wrapped predicate must NOT be satisfied for the balance to be claimable.
Parameters
- $predicate : XdrClaimPredicate
-
The predicate to negate
Return values
XdrClaimPredicate —A NOT predicate
predicateOr()
Creates an OR predicate combining two predicates
public
static predicateOr(XdrClaimPredicate $left, XdrClaimPredicate $right) : XdrClaimPredicate
Either predicate can be satisfied for the balance to be claimable.
Parameters
- $left : XdrClaimPredicate
-
The first predicate
- $right : XdrClaimPredicate
-
The second predicate
Return values
XdrClaimPredicate —An OR predicate
predicateUnconditional()
Creates an unconditional claim predicate
public
static predicateUnconditional() : XdrClaimPredicate
The balance can be claimed at any time without restrictions.
Return values
XdrClaimPredicate —An unconditional predicate
toXdr()
Converts this claimant to XDR format
public
toXdr() : XdrClaimant
Return values
XdrClaimant —The XDR representation of this claimant