SEP24DepositAsset
extends Response
in package
Represents deposit configuration for a specific asset in SEP-24
This class contains the deposit parameters and constraints for a single asset as returned by the SEP-24 /info endpoint. It specifies whether deposits are enabled, amount limits, and the fee structure for deposit operations.
The fee structure can include a fixed fee, percentage-based fee, or both, along with a minimum fee threshold. If the fee schedule is too complex to express with these simple fields, the anchor should omit them and implement the /fee endpoint.
Tags
Table of Contents
Properties
- $enabled : bool
- $feeFixed : float|null
- $feeMinimum : float|null
- $feePercent : float|null
- $maxAmount : float|null
- $minAmount : float|null
- $httpClient : Client|null
- $rateLimitLimit : int|null
- $rateLimitRemaining : int|null
- $rateLimitReset : int|null
Methods
- fromJson() : SEP24DepositAsset
- Constructs a new instance of SEP24DepositAsset by using the given data.
- getFeeFixed() : float|null
- getFeeMinimum() : float|null
- getFeePercent() : float|null
- getHttpClient() : Client|null
- Gets the HTTP client used for pagination requests
- getMaxAmount() : float|null
- getMinAmount() : float|null
- 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.
- isEnabled() : bool
- setEnabled() : void
- setFeeFixed() : void
- setFeeMinimum() : void
- setFeePercent() : void
- setHeaders() : void
- Extracts and sets rate limiting information from HTTP response headers
- setHttpClient() : void
- Sets the HTTP client for making follow-up requests
- setMaxAmount() : void
- setMinAmount() : void
- loadFromJson() : void
- Loads the needed data from the given data array.
Properties
$enabled
public
bool
$enabled
true if deposit for this asset is supported
$feeFixed
public
float|null
$feeFixed
= null
Optional fixed (base) fee for deposit. In units of the deposited asset. This is in addition to any fee_percent. Omitted if there is no fee or the fee schedule is complex.
$feeMinimum
public
float|null
$feeMinimum
= null
Optional minimum fee in units of the deposited asset.
$feePercent
public
float|null
$feePercent
= null
Optional percentage fee for deposit. In percentage points. This is in addition to any fee_fixed. Omitted 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.
$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 SEP24DepositAsset by using the given data.
public
static fromJson(array<string|int, mixed> $json) : SEP24DepositAsset
Parameters
- $json : array<string|int, mixed>
-
the data to construct the object from.
Return values
SEP24DepositAsset —the object containing the parsed data.
getFeeFixed()
public
getFeeFixed() : float|null
Return values
float|null —Optional fixed (base) fee for deposit. In units of the deposited asset. This is in addition to any fee_percent. Omit if there is no fee or the fee schedule is complex.
getFeeMinimum()
public
getFeeMinimum() : float|null
Return values
float|null —Optional minimum fee in units of the deposited asset.
getFeePercent()
public
getFeePercent() : float|null
Return values
float|null —Optional percentage fee for deposit. In percentage points. This is in addition to any fee_fixed. Omit if there is no fee or the fee schedule is complex.
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
getMaxAmount()
public
getMaxAmount() : float|null
Return values
float|null —Optional maximum amount. No limit if not specified.
getMinAmount()
public
getMinAmount() : float|null
Return values
float|null —Optional minimum amount. No limit if not specified.
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
Return values
int|nullgetRateLimitRemaining()
Returns X-RateLimit-Remaining header from the response.
public
getRateLimitRemaining() : int|null
The number of remaining requests for the current window.
Tags
Return values
int|nullgetRateLimitReset()
Returns X-RateLimit-Reset header from the response. Seconds until a new window starts.
public
getRateLimitReset() : int|null
Tags
Return values
int|nullisEnabled()
public
isEnabled() : bool
Return values
bool —true if deposit for this asset is supported
setEnabled()
public
setEnabled(bool $enabled) : void
Parameters
- $enabled : bool
-
true if deposit for this asset is supported
setFeeFixed()
public
setFeeFixed(float|null $feeFixed) : void
Parameters
- $feeFixed : float|null
-
Optional fixed (base) fee for deposit. In units of the deposited asset. This is in addition to any fee_percent. Omit if there is no fee or the fee schedule is complex.
setFeeMinimum()
public
setFeeMinimum(float|null $feeMinimum) : void
Parameters
- $feeMinimum : float|null
-
Optional minimum fee in units of the deposited asset.
setFeePercent()
public
setFeePercent(float|null $feePercent) : void
Parameters
- $feePercent : float|null
-
Optional percentage fee for deposit. In percentage points. This is in addition to any fee_fixed. Omit if there is no fee or the fee schedule is complex.
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
setMaxAmount()
public
setMaxAmount(float|null $maxAmount) : void
Parameters
- $maxAmount : float|null
-
Optional maximum amount. No limit if not specified.
setMinAmount()
public
setMinAmount(float|null $minAmount) : void
Parameters
- $minAmount : float|null
-
Optional minimum amount. No limit if not specified.
loadFromJson()
Loads the needed data from the given data array.
protected
loadFromJson(array<string|int, mixed> $json) : void
Parameters
- $json : array<string|int, mixed>
-
the array containing the data to read from.