ManageDataOperation

public class ManageDataOperation : Operation, @unchecked Sendable

Represents an manage data operation. Allows you to set,modify or delete a Data Entry (name/value pair) that is attached to a particular account. An account can have an arbitrary amount of DataEntries attached to it. Each DataEntry increases the minimum balance needed to be held by the account. See Stellar developer docs

  • The name of the data entry. Up to 64 bytes.

    Declaration

    Swift

    public let name: String
  • The value of the data entry. Up to 64 bytes. If nil, the existing data entry will be deleted.

    Declaration

    Swift

    public let data: Data?
  • Creates a new ManageDataOperation object.

    Declaration

    Swift

    public init(sourceAccountId: String?, name: String, data: Data? = nil)

    Parameters

    sourceAccountId

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

    name

    String up to 64 bytes long. If this is a new Name it will add the given name/value pair to the account. If this Name is already present then the associated value will be modified.

    value

    (optional) If not present then the existing Name will be deleted. If present then this value will be set in the DataEntry. Up to 64 bytes long.

  • Creates a new ManageDataOperation object from the given ManageDataOperationXDR object.

    Declaration

    Swift

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

    Parameters

    fromXDR

    the ManageDataOperationXDR object to be used to create a new ManageDataOperation object.

    sourceAccountId

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