RegulatedAsset

public class RegulatedAsset : Asset, @unchecked Sendable

Represents a regulated asset that requires issuer approval for transactions.

A regulated asset is defined in stellar.toml with the regulated flag set to true and includes an approval server URL where transactions must be submitted for validation.

  • The asset code (e.g., “USD”, “EURT”).

    Declaration

    Swift

    public let assetCode: String
  • The Stellar account ID of the asset issuer.

    Declaration

    Swift

    public let issuerId: String
  • The URL of the approval server for transaction validation.

    Declaration

    Swift

    public let approvalServer: String
  • Optional criteria description for when transactions require approval.

    Declaration

    Swift

    public let approvalCriteria: String?
  • Creates a new regulated asset instance.

    Throws

    If the issuer ID is invalid.

    Declaration

    Swift

    public init?(type: Int32, assetCode: String, issuerId: String, approvalServer: String, approvalCriteria: String? = nil) throws

    Parameters

    type

    The asset type (ASSET_TYPE_CREDIT_ALPHANUM4 or ASSET_TYPE_CREDIT_ALPHANUM12).

    assetCode

    The asset code.

    issuerId

    The Stellar account ID of the issuer.

    approvalServer

    The URL of the approval server.

    approvalCriteria

    Optional description of approval criteria.