Stellar PHP SDK API Documentation

SEP38BuyAsset
in package

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

This class represents a single buy asset option with its indicative exchange rate and decimal precision when exchanging from a specified sell asset.

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()  : SEP38BuyAsset
Constructs a new instance of SEP38BuyAsset 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 purchased.

$price : string

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

$decimals : int

The number of decimal places precision supported for this asset.

fromJson()

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

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

the data to construct the object from.

Return values
SEP38BuyAsset

the object containing the parsed data.


        
On this page

Search results