iamirnet/azbitcom

PHP SDK for azbit.com

1.0.0 2022-04-22 07:26 UTC

This package is auto-updated.

Last update: 2024-05-22 12:35:25 UTC


README

Latest Version GitHub last commit Packagist Downloads

PHP Azbit API

This project is designed to help you make your own projects that interact with the Azbit API.

Installation

composer require iamirnet/azbitcom
Click for help with installation

Install Composer

If the above step didn't work, install composer and try again.

Debian / Ubuntu

sudo apt-get install curl php-curl
curl -s http://getcomposer.org/installer | php
php composer.phar install

Composer not found? Use this command instead:

php composer.phar require "iamirnet/azbitcom"

Installing on Windows

Download and install composer:

  1. https://getcomposer.org/download/
  2. Create a folder on your drive like C:\iAmirNet\Azbit
  3. Run command prompt and type cd C:\iAmirNet\Azbit
  4. composer require iamirnet/azbitcom
  5. Once complete copy the vendor folder into your project.

Getting started

composer require iamirnet/azbitcom

require 'vendor/autoload.php';
// config by specifying api key and secret
$api = new \iAmirNet\Azbit\Client("<api key>","<secret>");

=======

Get list of currency codes

//Call this before running any functions
print_r($api->currencies());

=======

Get list of currency pair settings

//Call this before running any functions
print_r($api->currenciesPairs());

=======

Get currency pair settings

//Call this before running any functions
print_r($api->currenciesPair("BTC_USDT"));

=======

Get currency pair commissions

//Call this before running any functions
print_r($api->currenciesCommissions());

=======

Get currency pair commissions and user commission info

//Call this before running any functions
print_r($api->currenciesUserCommissions());

Get history of trades for CurrencyPair (100)

//Call this before running any functions
$sinceDate = "2021-02-05T14:00:00";
$endDate = "2021-02-05T15:00:00";
$pageNumber = 1;
$pageSize = 20;
print_r($api->trades("BTC_USDT",/* optional */ $sinceDate,/* optional */  $endDate,/* optional */ $pageNumber,/* optional */  $pageSize));

Get history of trades for user per CurrencyPair (100)

//Call this before running any functions
$sinceDate = "2021-02-05T14:00:00";
$endDate = "2021-02-05T15:00:00";
$pageNumber = 1;
$pageSize = 20;
print_r($api->myTrades("BTC_USDT",/* optional */ $sinceDate,/* optional */  $endDate,/* optional */ $pageNumber,/* optional */  $pageSize));

Get ticker info

//Call this before running any functions
print_r($api->ticker("BTC_USDT"));

Get Kline/Candlestick Data

//Call this before running any functions
print_r($api->kline("BTC_USDT",/* year, month, day, hour4, hour, minutes30, minutes15, minutes5, minutes3, minute */  "minute",/* Example: "2021-02-05T14:00:00" */ false,/* Example: "2021-02-05T14:00:00" */ false));

Get orderbook (40 bids + 40 asks)

//Call this before running any functions
print_r($api->orderbook("BTC_USDT"));

Create Buy or Sell limit order

Buy
//Call this before running any functions
$quantity = 1;
$price = 0.0005;
print_r($api->buy("BTC_USDT", $quantity, $price, "LIMIT"));
Sell
//Call this before running any functions
$quantity = 1;
$price = 0.0006;
print_r($api->sell("BTC_USDT", $quantity, $price, "LIMIT"));

Delete selected order

//Call this before running any functions
$orderId = "3fa85f64-5717-4562-b3fc-2c963f66afa6";
print_r($api->cancel($orderId));

Delete all user orders for currency pair

//Call this before running any functions
print_r($api->cancel("BTC_USDT"));

Get user order info with deals

//Call this before running any functions
$orderId = "3fa85f64-5717-4562-b3fc-2c963f66afa6";
print_r($api->orderInfo($orderId));

Get orders of user

$orders = $api->orders("BTC_USDT",/* "all" / "active" / "canceled" */  "all");
print_r($orders);

Get deposits and withdrawals of user

//Call this before running any functions
print_r($api->wallet());

Get user balances (available and blocked in orders)

//Call this before running any functions
print_r($api->balances());

Get Limits

//Call this before running any functions
print_r($api->limits());

Get information for deposit

//Call this before running any functions
print_r($api->address("BTC_USDT"));

Withdraw money

//Call this before running any functions
print_r($api->withdrawal("BTC_USDT", "address", "addressPublicKey",/* amount */ 0.05));

Contribution

  • Give us a star ⭐
  • Fork and Clone! Awesome
  • Select existing issues or create a new issue and give us a PR with your bugfix or improvement after. We love it ❤️

Donate

  • USDT Or TRX: TUE8GiY4vmz831N65McwzZVbA9XEDaLinn 😘❤