CreateAccountOperation
extends AbstractOperation
in package
Represents a create account operation.
Creates and funds a new account with the specified starting balance of XLM.
Tags
Table of Contents
Methods
- __construct() : mixed
- Creates a new CreateAccountOperation object.
- fromXdr() : AbstractOperation
- Creates an operation from its XDR representation.
- fromXdrAmount() : string
- Converts an XDR amount (stroops) to a decimal string.
- fromXdrOperation() : CreateAccountOperation
- Creates a CreateAccountOperation from its XDR representation.
- getDestination() : string
- Gets the destination account ID.
- getSourceAccount() : MuxedAccount|null
- Gets the source account for this operation.
- getStartingBalance() : string
- Gets the starting balance amount.
- 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 CreateAccountOperation object.
public
__construct(string $destination, string $startingBalance) : mixed
Parameters
- $destination : string
-
The account ID of the account being created and funded.
- $startingBalance : string
-
The amount of XLM to send to the newly created account (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 CreateAccountOperation from its XDR representation.
public
static fromXdrOperation(XdrCreateAccountOperation $xdrOp) : CreateAccountOperation
Parameters
- $xdrOp : XdrCreateAccountOperation
-
The XDR create account operation to convert
Return values
CreateAccountOperation —The resulting CreateAccountOperation instance
getDestination()
Gets the destination account ID.
public
getDestination() : string
Return values
string —The destination account ID
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
getStartingBalance()
Gets the starting balance amount.
public
getStartingBalance() : string
Return values
string —The starting balance as a decimal string
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)