Claimant

public final class Claimant : Sendable

Represents a claimant authorized to claim a claimable balance with optional predicates.

  • The account ID that can claim the balance.

    Declaration

    Swift

    public final let destination: String
  • The conditions that must be met for the destination to claim the balance.

    Declaration

    Swift

    public final let predicate: ClaimPredicateXDR
  • Constructor

    Declaration

    Swift

    public init(destination: String, predicate: ClaimPredicateXDR? = nil)

    Parameters

    destination

    The destination account ID.

    predicate

    The claim predicate. Optional, if none is passed an unconditional predicate will be used.

  • Returns an unconditional claim predicate

    Declaration

    Swift

    public static func predicateUnconditional() -> ClaimPredicateXDR
  • Returns an and claim predicate

    Declaration

    Swift

    public static func predicateAnd(left: ClaimPredicateXDR, right: ClaimPredicateXDR) -> ClaimPredicateXDR

    Parameters

    left

    a claim predicate

    right

    a claim predicate

  • Returns an or claim predicate

    Declaration

    Swift

    public static func predicateOr(left: ClaimPredicateXDR, right: ClaimPredicateXDR) -> ClaimPredicateXDR

    Parameters

    left

    a claim predicate

    right

    a claim predicate

  • Returns a not claim predicate

    Declaration

    Swift

    public static func predicateNot(predicate: ClaimPredicateXDR) -> ClaimPredicateXDR

    Parameters

    predicate

    a claim predicate

  • Returns a BeforeAbsoluteTime claim predicate. This predicate will be fulfilled if the closing time of the ledger that includes the CreateClaimableBalance operation is less than this (absolute) Unix timestamp.

    Declaration

    Swift

    public static func predicateBeforeAbsoluteTime(unixEpoch: Int64) -> ClaimPredicateXDR

    Parameters

    unixEpoch

    Unix timestamp

  • Returns a BeforeRelativeTime claim predicate. This predicate will be fulfilled if the closing time of the ledger that includes the CreateClaimableBalance operation plus this relative time delta (in seconds) is less than the current time.

    Declaration

    Swift

    public static func predicateBeforeRelativeTime(seconds: Int64) -> ClaimPredicateXDR

    Parameters

    seconds

    seconds seconds since closeTime of the ledger in which the ClaimableBalanceEntry was created

  • Returns the xdr object for this claimant.

    Throws

    Throws StellarSDKError.xdrEncodingError if the XDR Object could not be created.

    Declaration

    Swift

    public func toXDR() throws -> ClaimantXDR
  • Returns a claimant object from its XDR object representation.

    Throws

    Throws StellarSDKError.xdrDecodingError if the Claimant object could not be created from the given ClaimantXDR object.

    Declaration

    Swift

    public static func fromXDR(claimantXDR: ClaimantXDR) throws -> Claimant

    Parameters

    claimantXDR

    the ClaimantXDR object to be used create the Claimant object.