1. Go to this page and download the library: Download buttercoin/buttercoin-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
buttercoin / buttercoin-sdk example snippets
use Buttercoin\Client\ButtercoinClient;
date_default_timezone_set('UTC'); // for $timestamp
$client = ButtercoinClient::factory([
'publicKey' => '<public_key>',
'secretKey' => '<secret_key>',
'environment' => 'sandbox' // leave this blank for production
]);
date_default_timezone_set('UTC'); // Do this only once
$timestamp = round(microtime(true) * 1000);
$client->getKey($timestamp);
$client->getKey();
$client->getOrderBook();
$client->getTradeHistory();
$client->getTicker();
$client->getKey($timestamp);
$client->getBalances($timestamp);
$client->getDepositAddress($timestamp);
// query for multiple orders
$orderParams = [ "status" => "canceled", "side" => "sell" ];
$client->getOrders($orderParams, $timestamp);
// single order by id
$orderId = '<order_id>';
$client->getOrderById($orderId, $timestamp);
// single order by url
$url = 'https://api.buttercoin.com/v1/orders/{order_id}';
$client->getOrderByUrl($url, $timestamp);