AllowTrustOperation

public class AllowTrustOperation : Operation, @unchecked Sendable

Represents an allow trust operation. Updates the authorized flag of an existing trustline. This can only be called by the issuer of a trustline’s asset. The issuer can only clear the authorized flag if the issuer has the AUTH_REVOCABLE_FLAG set. Otherwise, the issuer can only set the authorized flag. See Stellar developer docs

  • The account of the recipient of the trustline.

    Declaration

    Swift

    public let trustor: KeyPair
  • The asset code of the trustline.

    Declaration

    Swift

    public let assetCode: String
  • Flag indicating whether the trustline is authorized. 0, or any bitwise combination of TrustLineFlags.

    Declaration

    Swift

    public let authorize: UInt32
  • Creates a new AllowTrustOperation object.

    Throws

    Throws StellarSDKError.invalidArgument if the asset code is empty or has more then 12 characters.

    Declaration

    Swift

    public convenience init(sourceAccountId: String?, trustor: KeyPair, assetCode: String, authorize: Bool) throws

    Parameters

    sourceAccountId

    (optional) source account Id. must start with “M” or “G” and must be valid, otherwise it will be ignored.

    trustor

    The account of the recipient of the trustline.

    assetCode

    The asset code of the trustline. E.g. BTC

    authorize

    Flag indicating whether the trustline is authorized, true = TrustLineFlags.AUTHORIZED_FLAG

  • Creates a new AllowTrustOperation object.

    Throws

    Throws StellarSDKError.invalidArgument if the asset code is empty or has more then 12 characters.

    Declaration

    Swift

    public init(sourceAccountId: String?, trustor: KeyPair, assetCode: String, authorize: UInt32) throws

    Parameters

    sourceAccountId

    (optional) source account Id. must start with “M” or “G” and must be valid, otherwise it will be ignored.

    trustor

    The account of the recipient of the trustline.

    assetCode

    The asset code of the trustline. E.g. BTC

    authorize

    Flag indicating whether the trustline is authorized, 0, or any bitwise combination of TrustLineFlags

  • Creates a new AllowTrustOperation object from the given AllowTrustOperationXDR object.

    Declaration

    Swift

    public init(fromXDR: AllowTrustOperationXDR, sourceAccountId: String?)

    Parameters

    fromXDR

    the AllowTrustOperationXDR object to be used to create a new AllowTrustOperation object.

    sourceAccountId

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