Stellar PHP SDK API Documentation

WithdrawResponse extends Response

Response from withdraw endpoint containing instructions for completing the withdrawal.

Provides all information needed for the user to initiate a withdrawal, including the anchor's Stellar account to send funds to, memo requirements, fee details, and any additional information needed to complete the withdrawal.

Response includes transaction ID for status tracking, time estimates, and any amount limits or fees that apply to the withdrawal.

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

SEP-06 Specification

see
TransferServerService::withdraw()
see
WithdrawRequest
see
ExtraInfo

Table of Contents

Properties

$accountId  : string|null
$eta  : int|null
$extraInfo  : ExtraInfo|null
$feeFixed  : float|null
$feePercent  : float|null
$id  : string|null
$maxAmount  : float|null
$memo  : string|null
$memoType  : string|null
$minAmount  : float|null
$httpClient  : Client|null
$rateLimitLimit  : int|null
$rateLimitRemaining  : int|null
$rateLimitReset  : int|null

Methods

fromJson()  : WithdrawResponse
Constructs a new instance of WithdrawResponse by using the given data.
getHttpClient()  : Client|null
Gets the HTTP client used for pagination requests
getRateLimitLimit()  : int|null
Returns X-RateLimit-Limit header from the response.
getRateLimitRemaining()  : int|null
Returns X-RateLimit-Remaining header from the response.
getRateLimitReset()  : int|null
Returns X-RateLimit-Reset header from the response. Seconds until a new window starts.
setHeaders()  : void
Extracts and sets rate limiting information from HTTP response headers
setHttpClient()  : void
Sets the HTTP client for making follow-up requests
loadFromJson()  : void
Loads the needed data from a json array.

Properties

$accountId

public string|null $accountId = null

(optional) The account the user should send its token back to. This field can be omitted if the anchor cannot provide this information at the time of the request.

$eta

public int|null $eta = null

(optional) Estimate of how long the withdrawal will take to credit in seconds.

$extraInfo

public ExtraInfo|null $extraInfo = null

(optional) Any additional data needed as an input for this withdraw, example: Bank Name.

$feeFixed

public float|null $feeFixed = null

(optional) If there is a fee for withdraw. In units of the withdrawn asset

$feePercent

public float|null $feePercent = null

(optional) If there is a percent fee for withdraw.

$id

public string|null $id = null

(optional) The anchor's ID for this withdrawal. The wallet will use this ID to query the /transaction endpoint to check status of the request.

$maxAmount

public float|null $maxAmount = null

(optional) Maximum amount of asset that a user can withdraw.

$memo

public string|null $memo = null

(optional) Value of memo to attach to transaction, for hash this should be base64-encoded. The anchor should use this memo to match the Stellar transaction with the database entry associated created to represent it.

$memoType

public string|null $memoType = null

(optional) Type of memo to attach to transaction, one of text, id or hash.

$minAmount

public float|null $minAmount = null

(optional) Minimum amount of an asset that a user can withdraw.

$httpClient

protected Client|null $httpClient = null

$rateLimitLimit

protected int|null $rateLimitLimit = null

$rateLimitRemaining

protected int|null $rateLimitRemaining = null

$rateLimitReset

protected int|null $rateLimitReset = null

Methods

fromJson()

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

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

the data to construct the object from.

Return values
WithdrawResponse

the object containing the parsed data.

getHttpClient()

Gets the HTTP client used for pagination requests

public getHttpClient() : Client|null
Return values
Client|null

The HTTP client instance, or null if not set

getRateLimitLimit()

Returns X-RateLimit-Limit header from the response.

public getRateLimitLimit() : int|null

This number represents the he maximum number of requests that the current client can make in one hour.

Tags
see
https://developers.stellar.org

Stellar developer docs Rate limiting documentation

Return values
int|null

getRateLimitRemaining()

Returns X-RateLimit-Remaining header from the response.

public getRateLimitRemaining() : int|null

The number of remaining requests for the current window.

Tags
see
https://developers.stellar.org

Stellar developer docs Rate limiting documentation

Return values
int|null

getRateLimitReset()

Returns X-RateLimit-Reset header from the response. Seconds until a new window starts.

public getRateLimitReset() : int|null
Tags
see
https://developers.stellar.org

Stellar developer docs Rate limiting documentation

Return values
int|null

setHeaders()

Extracts and sets rate limiting information from HTTP response headers

public setHeaders(array<string|int, mixed> $headers) : void

This method processes the X-Ratelimit-* headers from the HTTP response and stores them for client access.

Parameters
$headers : array<string|int, mixed>

Associative array of HTTP headers from the response

setHttpClient()

Sets the HTTP client for making follow-up requests

public setHttpClient([Client|null $httpClient = null ]) : void

Paginated responses contain links to next/previous pages. This HTTP client is used when following those links to fetch additional pages.

Parameters
$httpClient : Client|null = null

The Guzzle HTTP client to use for pagination

loadFromJson()

Loads the needed data from a json array.

protected loadFromJson(array<string|int, mixed> $json) : void
Parameters
$json : array<string|int, mixed>

the data array to read from.


        
On this page

Search results