Menu

## RateClient
in package

RateClient.php : 27

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 : 29
`private static self|null $instance = null`

#### $restCli

RateClient.php : 30
`private RESTcli $restCli`

### Methods

#### getCurrencyPairRate()

RateClient.php : 112

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
  BitPayApiException
throws
  BitPayGenericException

##### Return values

Rate —

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

#### getCurrencyRates()

RateClient.php : 85

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
  BitPayApiException
throws
  BitPayGenericException

##### Return values

Rates —

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

#### getInstance()

RateClient.php : 43

Factory method for Rate Client.

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

##### Parameters

$restCli : RESTcli

##### Return values

static

#### getRates()

RateClient.php : 59

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

`public getRates() : Rates`

##### Tags

throws
  BitPayApiException
throws
  BitPayGenericException

##### Return values

Rates

#### __construct()

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

##### Parameters

$restCli : RESTcli

## Search results