RateClient
in package
Handles interactions with the rate endpoints.
Tags
Table of Contents
Properties
Methods
- getCurrencyPairRate() : Rate
- Retrieve the rate for a cryptocurrency / fiat pair
- getCurrencyRates() : Rates
- Retrieve all the rates for a given cryptocurrency
- getInstance() : static
- Factory method for Rate Client.
- getRates() : Rates
- Retrieve the exchange rate table maintained by BitPay. See https://bitpay.com/bitcoin-exchange-rates.
- __construct() : mixed
Properties
$instance
private
static self|null
$instance
= null
$restCli
private
RESTcli
$restCli
Methods
getCurrencyPairRate()
Retrieve the rate for a cryptocurrency / fiat pair
public
getCurrencyPairRate(string $baseCurrency, string $currency) : Rate
Parameters
- $baseCurrency : string
-
The cryptocurrency for which you want to fetch the fiat-equivalent rate. Current supported values are BTC, BCH, ETH, XRP, DOGE and LTC
- $currency : string
-
The fiat currency for which you want to fetch the baseCurrency rate
Tags
Return values
Rate —A Rate object populated with the currency rate for the requested baseCurrency.
getCurrencyRates()
Retrieve all the rates for a given cryptocurrency
public
getCurrencyRates(string $baseCurrency) : Rates
Parameters
- $baseCurrency : string
-
The cryptocurrency for which you want to fetch the rates. Current supported values are BTC, BCH, ETH, XRP, DOGE and LTC
Tags
Return values
Rates —A Rates object populated with the currency rates for the requested baseCurrency.
getInstance()
Factory method for Rate Client.
public
static getInstance(RESTcli $restCli) : static
Parameters
- $restCli : RESTcli
Return values
staticgetRates()
Retrieve the exchange rate table maintained by BitPay. See https://bitpay.com/bitcoin-exchange-rates.
public
getRates() : Rates
Tags
Return values
Rates__construct()
private
__construct(RESTcli $restCli) : mixed
Parameters
- $restCli : RESTcli