Stellar PHP SDK API Documentation

SEP38SellAsset
in package

Sell asset information with indicative price from SEP-38 prices endpoint.

This class represents a single sell asset option with its indicative exchange rate and decimal precision when exchanging for a specified buy asset. Added in SEP-38 v2.3.0 to support reverse price lookups.

Tags
see
https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0038.md#get-prices
see
SEP38PricesResponse

Table of Contents

Properties

$asset  : string
$decimals  : int
$price  : string

Methods

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

Properties

Methods

__construct()

public __construct(string $asset, string $price, int $decimals) : mixed
Parameters
$asset : string

The asset identifier that can be sold.

$price : string

The indicative price of one unit of the sell asset in terms of the buy asset.

$decimals : int

The number of decimal places precision supported for this asset.

fromJson()

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

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

the data to construct the object from.

Return values
SEP38SellAsset

the object containing the parsed data.


        
On this page

Search results