Stellar PHP SDK API Documentation

WithdrawAsset

Describes anchor support and parameters for a withdrawal asset.

Contains information about whether withdrawals are enabled for an asset, authentication requirements, fee structure, amount limits, and supported withdrawal types with their respective field requirements.

The types field defines different withdrawal methods (e.g., bank_account, cash, crypto) and what fields are needed for each type. Returned as part of the info endpoint response.

Tags
see
https://github.com/stellar/stellar-protocol/blob/v4.3.0/ecosystem/sep-0006.md

SEP-06 Specification

see
https://github.com/stellar/stellar-protocol/blob/v1.17.0/ecosystem/sep-0009.md

SEP-9 v1.17.0 Financial Account Fields

see
InfoResponse
see
AnchorField

Table of Contents

Properties

$authenticationRequired  : bool|null
$enabled  : bool
$feeFixed  : float|null
$feePercent  : float|null
$maxAmount  : float|null
$minAmount  : float|null
$types  : array<string|int, array<string|int, AnchorField>|null>|null
A field with each type of withdrawal supported for that asset as a key.

Methods

__construct()  : mixed
fromJson()  : WithdrawAsset
Constructs a new instance of WithdrawAsset by using the given data.

Properties

$authenticationRequired

public bool|null $authenticationRequired = null

Optional. true if client must be authenticated before accessing the withdraw endpoint for this asset. false if not specified.

$enabled

public bool $enabled

true if SEP-6 withdrawal for this asset is supported

$feeFixed

public float|null $feeFixed = null

Optional fixed (flat) fee for withdraw, in units of the Stellar asset. Null if there is no fee or the fee schedule is complex.

$feePercent

public float|null $feePercent = null

Optional percentage fee for withdraw, in percentage points of the Stellar asset. Null if there is no fee or the fee schedule is complex.

$maxAmount

public float|null $maxAmount = null

Optional maximum amount. No limit if not specified.

$minAmount

public float|null $minAmount = null

Optional minimum amount. No limit if not specified.

$types

A field with each type of withdrawal supported for that asset as a key.

public array<string|int, array<string|int, AnchorField>|null>|null $types = null

Each type can specify a fields object explaining what fields are needed and what they do. Anchors are encouraged to use SEP-9 financial account fields, but can also define custom fields if necessary. If a fields object is not specified, the wallet should assume that no extra fields are needed for that type of withdrawal. In the case that the Anchor requires additional fields for a withdrawal, it should set the transaction status to pending_customer_info_update. The wallet can query the /transaction endpoint to get the fields needed to complete the transaction in required_customer_info_updates and then use SEP-12 to collect the information from the user.

Methods

__construct()

public __construct(bool $enabled) : mixed
Parameters
$enabled : bool

true if SEP-6 withdrawal for this asset is supported

fromJson()

Constructs a new instance of WithdrawAsset by using the given data.

public static fromJson(array<string|int, mixed> $json) : WithdrawAsset
Parameters
$json : array<string|int, mixed>

the data to construct the object from.

Return values
WithdrawAsset

the object containing the parsed data.


        
On this page

Search results