Documentation

UniswapPairService extends TokenService
in package
Uses DateTimeConvert, PairLib, WeiUtils

Table of Contents

MINIMUM_LIQUIDITY  = 10 ** 3
$contractAddress  : string|null
$contract  : UniswapPair
$contractWeth  : WETHContract
$FEE_DENOMINATOR  : string
$math  : MathInterface
$pairInfo  : Pair
$SLIPPAGE  : string
$tokeInfo  : Token
$tokenService  : TokenService
__construct()  : mixed
amountWithSlippage()  : string
convertCurrency()  : mixed
getAllowance()  : string|null
getAmountIn()  : mixed
getAmountOut()  : mixed
getBalance()  : string
getContract()  : UniswapPair
getContractAddress()  : string
getContractWeth()  : WETHContract|ContractService
getEventsTopics()  : array<string|int, mixed>
getFeeDenominator()  : string
getFunctionSelector()  : array<string|int, mixed>
getNonces()  : mixed
getPairInfo()  : Pair
getPairInfoJson()  : string
getReserves()  : array<string|int, mixed>
getSlippage()  : string
getToken0()  : string
getToken0Service()  : TokenService
getToken1()  : string
getToken1Service()  : TokenService
getTokenInfo()  : Token
getTokenInfoJson()  : string
loadKLast()  : self
loadLpInfo()  : self
loadPairInfo()  : void
loadPriceCumulative()  : self
loadReserves()  : self
loadToken0Info()  : self
loadToken1Info()  : self
loadTokenInfo()  : self
loadTokens()  : void
loadTokensInfo()  : self
quote()  : mixed
setContractAddress()  : TokenService
setFeeDenominator()  : void
setSlippage()  : void
toDateTimeZone()  : string
toFormat()  : string
updatePrices()  : self

Constants

Properties

$FEE_DENOMINATOR

private string $FEE_DENOMINATOR = "9998"

$SLIPPAGE

private string $SLIPPAGE = "10"

Methods

amountWithSlippage()

public amountWithSlippage(string $amount, MathInterface $math) : string
Parameters
$amount : string
$math : MathInterface
Return values
string

convertCurrency()

public convertCurrency(float $amount[, string $from = 'wei' ][, string $to = 'ether' ]) : mixed
Parameters
$amount : float
$from : string = 'wei'
$to : string = 'ether'
Return values
mixed

getAllowance()

public getAllowance(string $owner, string $spender) : string|null
Parameters
$owner : string
$spender : string
Return values
string|null

getAmountIn()

public getAmountIn(mixed $amountOut, mixed $reserveIn, mixed $reserveOut, MathInterface $math) : mixed
Parameters
$amountOut : mixed
$reserveIn : mixed
$reserveOut : mixed
$math : MathInterface
Return values
mixed

getAmountOut()

public getAmountOut(mixed $amountIn, mixed $reserveIn, mixed $reserveOut, MathInterface $math) : mixed
Parameters
$amountIn : mixed
$reserveIn : mixed
$reserveOut : mixed
$math : MathInterface
Return values
mixed

getBalance()

public getBalance(string $address) : string
Parameters
$address : string
Return values
string

getContractAddress()

public getContractAddress() : string
Return values
string

getEventsTopics()

public getEventsTopics() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFeeDenominator()

public getFeeDenominator() : string
Return values
string

getFunctionSelector()

public getFunctionSelector(string $name) : array<string|int, mixed>
Parameters
$name : string
Return values
array<string|int, mixed>

getNonces()

public getNonces(string $address) : mixed
Parameters
$address : string
Return values
mixed

getPairInfoJson()

public getPairInfoJson() : string
Tags
throws
JsonException
Return values
string

getReserves()

public getReserves() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSlippage()

public getSlippage() : string
Return values
string

getTokenInfoJson()

public getTokenInfoJson() : string
Tags
throws
JsonException
Return values
string

loadPriceCumulative()

public loadPriceCumulative() : self
Return values
self

loadTokenInfo()

public loadTokenInfo() : self
Return values
self

quote()

public quote(mixed $amountA, mixed $reserveA, mixed $reserveB, MathInterface $math) : mixed
Parameters
$amountA : mixed
$reserveA : mixed
$reserveB : mixed
$math : MathInterface
Return values
mixed

setFeeDenominator()

public setFeeDenominator(string $value) : void
Parameters
$value : string
Return values
void

setSlippage()

public setSlippage(string $value) : void
Parameters
$value : string
Return values
void

toDateTimeZone()

public toDateTimeZone(mixed $timestamp) : string
Parameters
$timestamp : mixed
Return values
string

toFormat()

public toFormat(string $amount, string $denominator) : string
Parameters
$amount : string
$denominator : string
Return values
string

Search results