SEP38PriceResponse
in package
Indicative price response for a single asset pair via SEP-38.
This class represents an indicative (non-binding) price quote for exchanging one asset for another. Unlike firm quotes, these prices are not guaranteed and are provided for estimation purposes only.
The price relationship follows the formula: sell_amount = total_price * buy_amount
Tags
Table of Contents
Properties
- $buyAmount : string
- $fee : SEP38Fee
- $price : string
- $sellAmount : string
- $totalPrice : string
Methods
- __construct() : mixed
- fromJson() : SEP38PriceResponse
- Constructs a new instance of SEP38PriceResponse by using the given data.
Properties
$buyAmount
public
string
$buyAmount
$fee
public
SEP38Fee
$fee
$price
public
string
$price
$sellAmount
public
string
$sellAmount
$totalPrice
public
string
$totalPrice
Methods
__construct()
public
__construct(string $totalPrice, string $price, string $sellAmount, string $buyAmount, SEP38Fee $fee) : mixed
Parameters
- $totalPrice : string
-
The total price of the quote including fees. Used in formula: sell_amount = total_price * buy_amount
- $price : string
-
The exchange rate without fees.
- $sellAmount : string
-
The amount of the sell asset.
- $buyAmount : string
-
The amount of the buy asset.
- $fee : SEP38Fee
-
The fee structure for this price.
fromJson()
Constructs a new instance of SEP38PriceResponse by using the given data.
public
static fromJson(array<string|int, mixed> $json) : SEP38PriceResponse
Parameters
- $json : array<string|int, mixed>
-
the data to construct the object from.
Return values
SEP38PriceResponse —the object containing the parsed data.