BitPay PHP SDK

RateClient
in package

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

private static self|null $instance = null

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

        
On this page

Search results