tokenly/quotebot-client

A quotebot client library

v1.0.1 2017-08-30 15:37 UTC

This package is not auto-updated.

Last update: 2024-12-19 16:57:43 UTC


README

A quotebot client library for Tokenly.

Build Status

Installation

Add the package via composer

composer require tokenly/quotebot-client

Usage with Laravel

Add the Service Provider

Add the following to the providers array in your application config:

Tokenly\QuotebotClient\ServiceProvider\QuotebotServiceProvider::class,

Set the environment variables

QUOTEBOT_CONNECTION_URL=https://quotebot.tokenly.com
QUOTEBOT_API_TOKEN=my-api-token

Simple BTC quote

Get a BTC in USD. This will use bitcoinAverage and then fallback to bitstamp if the data is not current

$quotebot_client = app('Tokenly\QuotebotClient\Client');
$usd_float = $quotebot_client->getCurrentBTCQuoteWithFallback();

Get a token quote

Get a token quote by going to BTC and then from BTC to USD. This will use the default fallback sources of bitcoinAverage and bitstamp for the BTC quote.

$quotebot_client = app('Tokenly\QuotebotClient\Client');
$usd_float = $quotebot_client->getTokenValue('poloniex', 'XCP');