ManageDataOperation
extends AbstractOperation
in package
Represents ManageData operation.
Sets, modifies, or deletes a data entry (key/value pair) attached to an account. This allows for storing arbitrary data on the ledger in the form of key/value pairs.
Tags
Table of Contents
Methods
- __construct() : mixed
- Constructs a new ManageDataOperation object.
- fromXdr() : AbstractOperation
- Creates an operation from its XDR representation.
- fromXdrAmount() : string
- Converts an XDR amount (stroops) to a decimal string.
- fromXdrOperation() : ManageDataOperation
- Creates a ManageDataOperation from XDR operation object.
- getKey() : string
- Returns the name of the data entry.
- getSourceAccount() : MuxedAccount|null
- Gets the source account for this operation.
- getValue() : string|null
- Returns the value of the data entry.
- setSourceAccount() : void
- Sets the source account for this operation.
- toOperationBody() : XdrOperationBody
- Converts the operation to its XDR operation body representation.
- toXdr() : XdrOperation
- Converts this operation to its XDR representation.
- toXdrAmount() : BigInteger
- Converts a decimal amount string to XDR amount format (stroops).
Methods
__construct()
Constructs a new ManageDataOperation object.
public
__construct(string $key[, string|null $value = null ]) : mixed
Parameters
- $key : string
-
The name of the data entry (up to 64 bytes).
- $value : string|null = null
-
The value to store (up to 64 bytes), or null to delete the entry.
fromXdr()
Creates an operation from its XDR representation.
public
static fromXdr(XdrOperation $xdrOp) : AbstractOperation
Parameters
- $xdrOp : XdrOperation
-
The XDR operation to convert
Return values
AbstractOperation —The resulting operation instance
fromXdrAmount()
Converts an XDR amount (stroops) to a decimal string.
public
static fromXdrAmount(BigInteger $stroops) : string
Parameters
- $stroops : BigInteger
-
The amount in stroops (1 stroop = 0.0000001)
Return values
string —The amount as a decimal string
fromXdrOperation()
Creates a ManageDataOperation from XDR operation object.
public
static fromXdrOperation(XdrManageDataOperation $xdrOp) : ManageDataOperation
Parameters
- $xdrOp : XdrManageDataOperation
-
The XDR operation object to convert.
Return values
ManageDataOperation —The created operation instance.
getKey()
Returns the name of the data entry.
public
getKey() : string
Return values
string —The data entry key.
getSourceAccount()
Gets the source account for this operation.
public
getSourceAccount() : MuxedAccount|null
Return values
MuxedAccount|null —The source account, or null if using the transaction's source account
getValue()
Returns the value of the data entry.
public
getValue() : string|null
Return values
string|null —The data entry value, or null if the entry is being deleted.
setSourceAccount()
Sets the source account for this operation.
public
setSourceAccount(MuxedAccount|null $sourceAccount) : void
Parameters
- $sourceAccount : MuxedAccount|null
-
The source account, or null to use the transaction's source account
toOperationBody()
Converts the operation to its XDR operation body representation.
public
toOperationBody() : XdrOperationBody
Return values
XdrOperationBody —The XDR operation body.
toXdr()
Converts this operation to its XDR representation.
public
toXdr() : XdrOperation
Return values
XdrOperation —The XDR operation
toXdrAmount()
Converts a decimal amount string to XDR amount format (stroops).
public
static toXdrAmount(string $strAmount) : BigInteger
Parameters
- $strAmount : string
-
The amount as a decimal string
Return values
BigInteger —The amount in stroops (1 stroop = 0.0000001)