tokenly / quotebot-client
A quotebot client library
Installs: 3 707
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: >=7.0.0
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- mockery/mockery: dev-master
- phpunit/phpunit: ^5
This package is not auto-updated.
Last update: 2024-12-19 16:57:43 UTC
README
A quotebot client library for Tokenly.
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');