ClawbackOperation
extends AbstractOperation
in package
Represents clawback operation.
Burns an amount of an asset from an account, effectively destroying the asset. The asset must have the AUTH_CLAWBACK_ENABLED flag set.
Tags
Table of Contents
Methods
- __construct() : mixed
- Creates a new ClawbackOperation.
- fromXdr() : AbstractOperation
- Creates an operation from its XDR representation.
- fromXdrAmount() : string
- Converts an XDR amount (stroops) to a decimal string.
- fromXdrOperation() : ClawbackOperation
- Creates a ClawbackOperation from its XDR representation.
- getAmount() : string
- Gets the amount being clawed back.
- getAsset() : Asset
- Gets the asset being clawed back.
- getFrom() : MuxedAccount
- Gets the account from which the asset is clawed back.
- getSourceAccount() : MuxedAccount|null
- Gets the source account for this operation.
- setSourceAccount() : void
- Sets the source account for this operation.
- toOperationBody() : XdrOperationBody
- Converts this 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()
Creates a new ClawbackOperation.
public
__construct(Asset $asset, MuxedAccount $from, string $amount) : mixed
Parameters
- $asset : Asset
-
The asset being clawed back (must have AUTH_CLAWBACK_ENABLED flag set)
- $from : MuxedAccount
-
The account from which the asset is clawed back
- $amount : string
-
The amount of the asset to claw back (as a decimal string)
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 ClawbackOperation from its XDR representation.
public
static fromXdrOperation(XdrClawbackOperation $xdrOp) : ClawbackOperation
Parameters
- $xdrOp : XdrClawbackOperation
-
The XDR clawback operation to convert
Return values
ClawbackOperation —The resulting ClawbackOperation instance
getAmount()
Gets the amount being clawed back.
public
getAmount() : string
Return values
string —The amount as a decimal string
getAsset()
Gets the asset being clawed back.
public
getAsset() : Asset
Return values
Asset —The asset
getFrom()
Gets the account from which the asset is clawed back.
public
getFrom() : MuxedAccount
Return values
MuxedAccount —The source account
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
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 this 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)