Stellar PHP SDK API Documentation

AllowTrustOperationBuilder
in package

Builder for creating AllowTrust operations.

This builder implements the builder pattern to construct AllowTrustOperation instances with a fluent interface. AllowTrust operations allow an issuing account to authorize or revoke authorization for another account to hold its assets.

Tags
see
AllowTrustOperation
see
https://developers.stellar.org

Stellar developer docs

since
1.0.0
example

$operation = (new AllowTrustOperationBuilder($trustorId, 'USD', true, false)) ->setSourceAccount($issuerId) ->build();

Table of Contents

Methods

__construct()  : mixed
Creates a new AllowTrust operation builder.
build()  : AllowTrustOperation
Builds the AllowTrust operation.
setMuxedSourceAccount()  : $this
Sets the muxed source account for this operation.
setSourceAccount()  : $this
Sets the source account for this operation.

Methods

__construct()

Creates a new AllowTrust operation builder.

public __construct(string $trustor, string $assetCode, bool $authorized, bool $authorizedToMaintainLiabilities) : mixed
Parameters
$trustor : string

The account ID of the trustor being authorized or deauthorized

$assetCode : string

The asset code (1-12 characters)

$authorized : bool

Whether to authorize the trustline

$authorizedToMaintainLiabilities : bool

Whether to authorize only maintaining liabilities

Tags
throws
InvalidArgumentException

If asset code length is invalid (must be 1-12 characters)

setMuxedSourceAccount()

Sets the muxed source account for this operation.

public setMuxedSourceAccount(MuxedAccount $sourceAccount) : $this
Parameters
$sourceAccount : MuxedAccount

The muxed account to use as source

Return values
$this

Returns the builder instance for method chaining

setSourceAccount()

Sets the source account for this operation.

public setSourceAccount(string $accountId) : $this
Parameters
$accountId : string

The Stellar account ID (G...)

Return values
$this

Returns the builder instance for method chaining


        
On this page

Search results