SwaggerClient-php

The Binance Chain HTTP API provides access to a Binance Chain node deployment and market data services.

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/SwaggerClient-php/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\AccountApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$address = "address_example"; // string | The account address to query

try {
    $result = $apiInstance->getAccount($address);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->getAccount: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Swagger\Client\Api\AccountApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$address = "address_example"; // string | The account address to query

try {
    $result = $apiInstance->getAccountSequence($address);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->getAccountSequence: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Swagger\Client\Api\AccountApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$address = "address_example"; // string | The account address to query
$id = 789; // int | the record id of timelock to query

try {
    $result = $apiInstance->getTimeLocks($address, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->getTimeLocks: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to https://dex.binance.org

Class Method HTTP request Description
AccountApi getAccount GET /api/v1/account/{address} Get an account.
AccountApi getAccountSequence GET /api/v1/account/{address}/sequence Get an account sequence.
AccountApi getTimeLocks GET /api/v1/timelocks/{address} Gets time lock records given an address
AtomicSwapApi getAtomicSwapUsingGET GET /api/v1/atomic-swaps/{id} AtomicSwap
AtomicSwapApi getAtomicSwapsByAddrUsingGET GET /api/v1/atomic-swaps AtomicSwap
InfoApi getFees GET /api/v1/fees Obtain trading fees information.
InfoApi getNodeInfo GET /api/v1/node-info Get node information.
InfoApi getPeers GET /api/v1/peers Get network peers.
InfoApi getValidators GET /api/v1/validators Get validators.
MarketApi get24HrPriceStatistics GET /api/v1/ticker/24hr Get a market ticker.
MarketApi getCandlestickBars GET /api/v1/klines Get candlestick bars.
MarketApi getDepth GET /api/v1/depth Get the order book.
MarketApi getFees GET /api/v1/fees Obtain trading fees information.
MarketApi getPairs GET /api/v1/markets Get market pairs.
MiscApi getTime GET /api/v1/time Get the block time.
NodeApi broadcastTx POST /api/v1/broadcast Broadcast a transaction.
NodeApi getAccount GET /api/v1/account/{address} Get an account.
NodeApi getAccountSequence GET /api/v1/account/{address}/sequence Get an account sequence.
NodeApi getNodeInfo GET /api/v1/node-info Get node information.
NodeApi getPeers GET /api/v1/peers Get network peers.
NodeApi getTimeLocks GET /api/v1/timelocks/{address} Gets time lock records given an address
NodeApi getTransaction GET /api/v1/tx/{hash} Get a transaction.
NodeApi getValidators GET /api/v1/validators Get validators.
OrderApi getClosedOrders GET /api/v1/orders/closed Get closed orders.
OrderApi getOpenOrders GET /api/v1/orders/open Get open orders.
OrderApi getOrder GET /api/v1/orders/{id} Get an order.
TimelockRecordsApi getTimeLock GET /api/v1/timelock/{account_addr} Get timelock records of an address.
TokensApi getTokens GET /api/v1/tokens Get tokens list.
TradeApi getTrades GET /api/v1/trades Get market trades.
TradingFeeApi getBlockExchangeFee GET /api/v1/block-exchange-fee Trading fee of the address grouped by block
TransactionApi getTransactionsInBlockV2 GET /api/v2/transactions-in-block/{blockHeight} transactions in Block
TransactionApi txns GET /api/v1/transactions Get transactions.
TransactionInBlockApi getTransactionsInBlock GET /api/v1/transactions-in-block/{blockHeight} Get transactions in the specific block.
TxApi getTransaction GET /api/v1/tx/{hash} Get a transaction.

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author