LiquidityPoolPriceResponse
in package
Represents a price as a rational number for liquidity pools
Stores price as a fraction with numerator (n) and denominator (d). The price value equals n/d.
Tags
Table of Contents
Methods
- fromJson() : LiquidityPoolPriceResponse
- getD() : int
- Gets the denominator of the price fraction
- getN() : int
- Gets the numerator of the price fraction
- loadFromJson() : void
Methods
fromJson()
public
static fromJson(array<string|int, mixed> $json) : LiquidityPoolPriceResponse
Parameters
- $json : array<string|int, mixed>
Return values
LiquidityPoolPriceResponsegetD()
Gets the denominator of the price fraction
public
getD() : int
Return values
int —The denominator
getN()
Gets the numerator of the price fraction
public
getN() : int
Return values
int —The numerator
loadFromJson()
protected
loadFromJson(array<string|int, mixed> $json) : void
Parameters
- $json : array<string|int, mixed>