Menu

## RateClient
in package

RateClient.php : 26

Handles interactions with the rate endpoints.

##### Tags

author

  BitPay Integrations integrations@bitpay.com

license

  http://www.opensource.org/licenses/mit-license.php MIT

### Table of Contents

#### Properties

$instance : self|null
$restCli : RESTcli

#### 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

RateClient.php : 28
`private static self|null $instance = null`

#### $restCli

RateClient.php : 29
`private RESTcli $restCli`

### Methods

#### getCurrencyPairRate()

RateClient.php : 138

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

throws
  BitPayException

##### Return values

Rate —

A Rate object populated with the currency rate for the requested baseCurrency.

#### getCurrencyRates()

RateClient.php : 97

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

throws
  BitPayException

##### Return values

Rates —

A Rates object populated with the currency rates for the requested baseCurrency.

#### getInstance()

RateClient.php : 42

Factory method for Rate Client.

`public static getInstance(RESTcli $restCli) : static`

##### Parameters

$restCli : RESTcli

##### Return values

static

#### getRates()

RateClient.php : 57

Retrieve the exchange rate table maintained by BitPay. See https://bitpay.com/bitcoin-exchange-rates.

`public getRates() : Rates`

##### Tags

throws
  BitPayException

##### Return values

Rates

#### __construct()

RateClient.php : 31
`private __construct(RESTcli $restCli) : mixed`

##### Parameters

$restCli : RESTcli

## Search results