CreateClaimableBalanceOperation

public class CreateClaimableBalanceOperation : Operation, @unchecked Sendable

Represents a create claimable balance operation. Claimable Balances can be used to “split up” a payment into two parts, which allows the sending to only depend on the sending account, and the receipt to only depend on the receiving account. See Stellar developer docs.

  • An array of claimants that can claim this balance.

    Declaration

    Swift

    public let claimants: [Claimant]
  • The asset for the claimable balance.

    Declaration

    Swift

    public let asset: Asset
  • The amount for the claimable balance.

    Declaration

    Swift

    public let amount: Decimal
  • Creates a new CreateClaimableBalanceOperation object.

    Declaration

    Swift

    public init(asset: Asset, amount: Decimal, claimants: [Claimant], sourceAccountId: String? = nil)

    Parameters

    asset

    The asset for the claimable balance.

    amount

    The amount for the claimable balance.

    claimants

    An array of Claimants for the claimable balance.

    sourceAccountId

    The source account of the operation. Optional. Defaults to the transaction’s source account.

  • Creates a new CreateClaimableBalanceOperation object from the given CreateClaimableBalanceOpXDR object.

    Declaration

    Swift

    public init(fromXDR: CreateClaimableBalanceOpXDR, sourceAccountId: String?) throws

    Parameters

    fromXDR

    the CreateClaimableBalanceOpXDR object to be used to create a new CreateClaimableBalanceOperation object.

    sourceAccountId

    (optional) source account Id, must be valid, otherwise it will be ignored.