Stellar PHP SDK API Documentation

AllowTrustOperation extends AbstractOperation
in package

Represents an allow trust operation.

Use SetTrustLineFlagsOperation instead

Updates the authorized flag of an existing trust line. This operation is deprecated in favor of SetTrustLineFlags.

Tags
see

Stellar developer docs

see
SetTrustLineFlagsOperation

For the newer operation

since
1.0.0

Table of Contents

Methods

__construct()  : mixed
Creates a new AllowTrustOperation.
fromXdr()  : AbstractOperation
Creates an operation from its XDR representation.
fromXdrAmount()  : string
Converts an XDR amount (stroops) to a decimal string.
fromXdrOperation()  : AllowTrustOperation
Creates an AllowTrustOperation from its XDR representation.
getAssetCode()  : string
Gets the asset code being authorized.
getSourceAccount()  : MuxedAccount|null
Gets the source account for this operation.
getTrustor()  : string
Gets the trustor account ID.
isAuthorize()  : bool
Checks if the trust line is fully authorized.
isAuthorizeToMaintainLiabilities()  : bool
Checks if the trust line is authorized to maintain liabilities only.
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 AllowTrustOperation.

public __construct(string $trustor, string $assetCode, bool $authorize, bool $authorizeToMaintainLiabilities) : mixed
Parameters
$trustor : string

The account ID of the trustor (the account that created the trust line)

$assetCode : string

The asset code being authorized

$authorize : bool

Whether to authorize the trustor to transact the asset

$authorizeToMaintainLiabilities : bool

Whether to authorize the trustor to maintain liabilities but not receive new assets

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

getAssetCode()

Gets the asset code being authorized.

public getAssetCode() : string
Return values
string

The asset code

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

getTrustor()

Gets the trustor account ID.

public getTrustor() : string
Return values
string

The trustor account ID

isAuthorize()

Checks if the trust line is fully authorized.

public isAuthorize() : bool
Return values
bool

True if fully authorized, false otherwise

isAuthorizeToMaintainLiabilities()

Checks if the trust line is authorized to maintain liabilities only.

public isAuthorizeToMaintainLiabilities() : bool
Return values
bool

True if authorized to maintain liabilities, false otherwise

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

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)


        
On this page

Search results