From 044985d723d697c951ca145cd2d0118b89cb6efc Mon Sep 17 00:00:00 2001 From: WayToFuture Date: Tue, 3 Jan 2023 16:34:28 +0800 Subject: [PATCH] api: re-org api docs and clean up apis (#62) --- README.md | 4 +- .../develop/api-reference/api-server.md | 156 - .../api-reference/dex-api/paths-testnet.md | 584 +- .../develop/api-reference/dex-api/paths.md | 590 +- .../develop/api-reference/dex-api/staking.md | 2 +- sidebars.js | 11 +- static/api-swagger/.swagger-codegen-ignore | 23 + static/api-swagger/.swagger-codegen/VERSION | 1 + static/api-swagger/index.html | 7657 ++++------------- swagger.json | 1209 +-- swagger.yml | 1845 +--- swagger_testnet.yml | 1812 +--- 12 files changed, 2140 insertions(+), 11754 deletions(-) create mode 100644 static/api-swagger/.swagger-codegen-ignore create mode 100644 static/api-swagger/.swagger-codegen/VERSION diff --git a/README.md b/README.md index 892b10f676..d3b9bd507c 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ $ cp ./docs/jsdoc.md ../docs-site/docs/api-reference/js-sdk/jsdoc.md #### Generate swagger doc ```bash -$ swagger-codegen generate -i ./rpc-openapi.json -l html2 -o ./site/rpc-swagger -$ swagger-codegen generate -i ./swagger.json -l html2 -o ./site/api-swagger +$ swagger-codegen generate -i ./rpc-openapi.json -l html2 -o ./static/rpc-swagger +$ swagger-codegen generate -i ./swagger.json -l html2 -o ./static/api-swagger ``` diff --git a/docs/beaconchain/develop/api-reference/api-server.md b/docs/beaconchain/develop/api-reference/api-server.md index ec2727ad26..c3d1c4b540 100644 --- a/docs/beaconchain/develop/api-reference/api-server.md +++ b/docs/beaconchain/develop/api-reference/api-server.md @@ -53,8 +53,6 @@ Replace the `platform` variable with `mac`, `windows` or `linux` in the followin http://localhost:8080/version ``` - - ### /api/v1/account/{address} --- ##### ***GET*** @@ -88,114 +86,6 @@ http://localhost:8080/api/v1/account/tbnb1ke87gxdtsk32kuaqxj6skhhmn79ma89cx2ep4g | default | Generic error response | [Error](#error) | - - -### /api/v1/markets ---- -##### ***GET*** -**Summary:** Get market pairs. - -**Description:** Gets the list of market pairs that have been listed. - -**Example for mainnet** -``` -http://localhost:8080/api/v1/markets -``` - -**Example for testnet:** - -``` -http://localhost:8080/api/v1/markets -``` - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| limit | query | default 100; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | Success | [ [Market](#market) ] | -| 500 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - - -### /api/v1/depth ---- -##### ***GET*** -**Summary:** Get the order book. - -**Description:** Gets the order book depth data for a given pair symbol. - - -**Example for mainnet** -``` -http://localhost:8080/api/v1/depth?symbol=SPNDB-916_BNB -``` -**Example for testnet:** - -``` -http://localhost:8080/api/v1/depth?symbol=GEOP-152_BNB -``` -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| symbol | query | Market pair symbol, e.g. NNB-0AD_BNB | Yes | string | -| limit | query | The limit of results. Default: 100 Allowed limits: [5, 10, 20, 50, 100] | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | Success | [MarketDepth](#marketdepth) | -| 500 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - - -### /api/v1/orders/open ---- -##### ***GET*** -**Summary:** Get open orders. - -**Description:** Gets open orders for a given address. - - -**Example for mainnet** -``` -http://localhost:8080/api/v1/orders/open?address=bnb1g9rzc0e2jf8ef3qp9ax8h0pmpmvjzwmtwqmzfj&symbol=SPNDB-916_BNB - -``` -**Example for testnet:** - -``` -http://localhost:8080/api/v1/orders/open?address=tbnb1g9rzc0e2jf8ef3qp9ax8h0pmpmvjzwmtq4jxfr&symbol=TEST-599_BNB -``` -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| address | query | the owner address | Yes | string | -| limit | query | default 100; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | -| symbol | query | symbol | No | string | -| total | query | total number required, 0 for not required and 1 for required; default not required, return total =-1 in response | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [OrderList](#orderlist) | -| 500 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - ### /api/v1/tokens --- ##### ***GET*** @@ -459,16 +349,6 @@ http://localhost:8080/api/v1/timelock/timelock/tbnb1g9rzc0e2jf7ef3qp9ax8h0pmpmvj | total_supply | string (fixed8) | total token supply in decimal form, e.g. 1.00000000 | 0.00000000 | | owner | string (address) | Address which issue the token | | -### Market - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| base_asset_symbol | string (currency) | symbol of base asset | BNB | -| quote_asset_symbol | string (currency) | symbol of quote asset | ABC-5CA | -| price | string (fixed8) | In decimal form, e.g. 1.00000000 | 0.00000000 | -| tick_size | string (fixed8) | Minimum price change in decimal form, e.g. 1.00000000 | 0.00000001 | -| lot_size | string (fixed8) | Minimum trading quantity in decimal form, e.g. 1.00000000 | 0.000001 | - ### Fee | Name | Type | Description | Example | @@ -504,42 +384,6 @@ http://localhost:8080/api/v1/timelock/timelock/tbnb1g9rzc0e2jf7ef3qp9ax8h0pmpmvj | code | long | error code | 400 | | message | string | error message | | -### MarketDepth - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| asks | [ string (fixed8) ] | Price and qty in decimal form, e.g. 1.00000000 | ["1.00000000","800.00000000"] | -| bids | [ string (fixed8) ] | Price and qty in decimal form, e.g. 1.00000000 | ["1.00000000","800.00000000"] | - -### OrderList - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| order | [ [Order](#order) ] | list of orders | | -| total | long | | | - -### Order - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| cumulateQuantity | string | | | -| fee | string | trading fee on the block of this order | | -| lastExecutedPrice | string | price of last execution | | -| lastExecutedQuantity | string | quantity of last execution | | -| orderCreateTime | dateTime | time of order creation | | -| orderId | string | order ID | | -| owner | string | order issuer | | -| price | string | order price | | -| quantity | string | order quantity | | -| side | integer | 1 for buy and 2 for sell | | -| status | string | enum [Ack, PartialFill, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching, IocExpire] | | -| symbol | string | | | -| timeInForce | integer | 1 for Good Till Expire(GTE) order and 3 for Immediate Or Cancel (IOC) | | -| tradeId | string | trade ID | | -| transactionHash | string | | | -| transactionTime | dateTime | time of transaction | | -| type | integer | only 2 is available for now, meaning limit order | | - ### TimelockList | Name | Type | Description | Example | diff --git a/docs/beaconchain/develop/api-reference/dex-api/paths-testnet.md b/docs/beaconchain/develop/api-reference/dex-api/paths-testnet.md index 0ac35b8d7c..e5230fad17 100644 --- a/docs/beaconchain/develop/api-reference/dex-api/paths-testnet.md +++ b/docs/beaconchain/develop/api-reference/dex-api/paths-testnet.md @@ -1,6 +1,6 @@ HTTP API ======== -Within the ecosystem of Binance Chain, there are several accelerated nodes which provides more secure and faster lines to access Binance Chain and DEX data service including HTTP API. +Within the ecosystem of Binance Chain, there are several accelerated nodes which provides more secure and faster lines to access Binance Chain data service including HTTP API. For testnet, there are 2 accelerated nodes setup as below. API users should try to use them directly. @@ -291,36 +291,6 @@ Below is an example response of a send transaction when `?format=json` is used. | 404 | Not Found | | | default | Generic error response | [Error](#error) | -### /api/v1/markets ---- -##### ***GET*** -**Summary:** Get market pairs. - -**Description:** Gets the list of market pairs that have been listed. - -**Destination:** Witness node. - -**Rate Limit:** 1 request per IP per second. - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/markets](https://testnet-dex.binance.org/api/v1/markets) - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | Success | [ [Market](#market) ] | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - ### /api/v1/fees --- ##### ***GET*** @@ -342,38 +312,6 @@ Below is an example response of a send transaction when `?format=json` is used. | 200 | Success | [ [Fee](#fee) ] | | default | Generic error response | [Error](#error) | -### /api/v1/depth ---- -##### ***GET*** -**Summary:** Get the order book. - -**Description:** Gets the order book depth data for a given pair symbol. - -The given _limit_ must be one of the allowed limits below. - -**Destination:** Validator node. - -**Rate Limit:** 10 requests per IP per second. - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/depth?symbol=xxx-000_BNB](https://testnet-dex.binance.org/api/v1/depth?symbol=xxx-000_BNB) - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| symbol | query | Market pair symbol, e.g. NNB-0AD_BNB | Yes | string | -| limit | query | The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000] | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | Success | [MarketDepth](#marketdepth) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - ### /api/v1/broadcast --- ##### ***POST*** @@ -405,201 +343,6 @@ The given _limit_ must be one of the allowed limits below. | 404 | Not Found | | | default | Generic error response | [Error](#error) | -### /api/v1/klines ---- -##### ***GET*** -**Summary:** Get candlestick bars. - -**Description:** Gets candlestick/kline bars for a symbol. Bars are uniquely identified by their open time. - -If the time window is larger than limits, only the first n klines will return. In this case, please either shrink the window or increase the limit to get proper amount of klines. - -**Rate Limit:** 10 requests per IP per second. - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m](https://testnet-dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m) - -**Example** - -``` -[ - 1499040000000, // Open time - "0.01634790", // Open - "0.80000000", // High - "0.01575800", // Low - "0.01577100", // Close - "148976.11427815", // Volume - 1499644799999, // Close time - "2434.19055334", // Quote asset volume - 308 // Number of trades -] -``` - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| symbol | query | symbol | Yes | string | -| interval | query | interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M] | Yes | enum string | -| limit | query | default 300; max 1000. | No | integer | -| startTime | query | start time in Milliseconds | No | long | -| endTime | query | end time in Milliseconds | No | long | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [ [Candlestick](#candlestick) ] | - -### /api/v1/orders/closed ---- -##### ***GET*** -**Summary:** Get closed orders. - -**Description:** Gets closed (filled and cancelled) orders for a given address. - -**Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| address | query | the owner address | Yes | string | -| end | query | end time in Milliseconds | No | long | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | -| side | query | order side. 1 for buy and 2 for sell. | No | integer | -| start | query | start time in Milliseconds | No | long | -| status | query | order status list. Allowed value: [Ack, IocExpire, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching] | No | enum string | -| symbol | query | symbol | No | string | -| total | query | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [OrderList](#orderlist) | - -### /api/v1/orders/open ---- -##### ***GET*** -**Summary:** Get open orders. - -**Description:** Gets open orders for a given address. - -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| address | query | the owner address | Yes | string | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | -| symbol | query | symbol | No | string | -| total | query | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [OrderList](#orderlist) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - -### /api/v1/orders/{id} ---- -##### ***GET*** -**Summary:** Get an order. - -**Description:** Gets metadata for an individual order by its ID. - -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| id | path | order id | Yes | string | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [Order](#order) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - -### /api/v1/ticker/24hr ---- -##### ***GET*** -**Summary:** Get a market ticker. - -**Description:** Gets 24 hour price change statistics for a market pair symbol. Updated every second. - -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| symbol | query | symbol | No | string | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [ [TickerStatistics](#tickerstatistics) ] | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - -### /api/v1/trades ---- -##### ***GET*** -**Summary:** Get market trades. - -**Description:** Gets a list of historical trades. - -**Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| address | query | the buyer/seller address | No | string | -| buyerOrderId | query | buyer order id | No | string | -| end | query | end time in Milliseconds | No | long | -| height | query | block height | No | long | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | -| quoteAsset | query | quote asset | No | string | -| sellerOrderId | query | seller order id | No | string | -| side | query | order side. 1 for buy and 2 for sell. | No | integer | -| start | query | start time in Milliseconds | No | long | -| symbol | query | symbol | No | string | -| total | query | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [TradePage](#tradepage) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - ### /api/v1/block-exchange-fee --- ##### ***GET*** @@ -832,213 +575,6 @@ If the time window is larger than limits, only the first n klines will return. I | 400 | Bad Request | [Error](#error) | | 500 | internal server error | [Error](#error) | -### /api/v1/mini/markets ---- -##### ***GET*** -**Summary:** Gets a list of mini market pairs. - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| offset | query | offset | No | integer | -| limit | query | limit | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | Success | [Markets](#markets) | -| 400 | Bad Request | [Error](#error) | - -### /api/v1/mini/klines ---- -##### ***GET*** -**Summary:** Get mini-token candlestick bars. - -**Description:** Gets candlestick/kline bars for a mini-token symbol pair. Bars are uniquely identified by their open time. - -If the time window is larger than limits, only the first n klines will return. In this case, please either shrink the window or increase the limit to get proper amount of klines. - -**Rate Limit:** 10 requests per IP per second. - -**Example** - -``` -[ - 1499040000000, // Open time - "0.01634790", // Open - "0.80000000", // High - "0.01575800", // Low - "0.01577100", // Close - "148976.11427815", // Volume - 1499644799999, // Close time - "2434.19055334", // Quote asset volume - 308 // Number of trades -] -``` - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| symbol | query | symbol | Yes | string | -| interval | query | interval. Allowed value: [1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M] | Yes | enum string | -| limit | query | default 300; max 1000. | No | integer | -| startTime | query | start time in Milliseconds | No | long | -| endTime | query | end time in Milliseconds | No | long | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [ [Candlestick](#candlestick) ] | - -### /api/v1/mini/orders/closed ---- -##### ***GET*** -**Summary:** Get closed orders of mini-token pairs. - -**Description:** Gets closed (filled and cancelled) orders for a given address. - -**Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| address | query | the owner address | Yes | string | -| end | query | end time in Milliseconds | No | long | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | -| side | query | order side. 1 for buy and 2 for sell. | No | integer | -| start | query | start time in Milliseconds | No | long | -| status | query | order status list. Allowed value: [Ack, IocExpire, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching] | No | enum string | -| symbol | query | symbol | No | string | -| total | query | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [OrderList](#orderlist) | - -### /api/v1/mini/orders/open ---- -##### ***GET*** -**Summary:** Get open orders of mini-token pairs. - -**Description:** Gets open orders for a given address. -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| address | query | the owner address | Yes | string | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | -| symbol | query | symbol | No | string | -| total | query | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [OrderList](#orderlist) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - -### /api/v1/mini/orders/{id} ---- -##### ***GET*** -**Summary:** Get an order of mini-token pairs. - -**Description:** Gets metadata for an individual order by its ID. -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| id | path | order id | Yes | string | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [Order](#order) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - -### /api/v1/mini/ticker/24hr ---- -##### ***GET*** -**Summary:** Get a market ticker of mini-token pairs. - -**Description:** Gets 24 hour price change statistics for a market pair symbol. Updated every second. -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| symbol | query | symbol | No | string | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [ [TickerStatistics](#tickerstatistics) ] | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - -### /api/v1/mini/trades ---- -##### ***GET*** -**Summary:** Get market trades of mini-token pairs. - -**Description:** Gets a list of historical trades. -**Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| address | query | the buyer/seller address | No | string | -| buyerOrderId | query | buyer order id | No | string | -| end | query | end time in Milliseconds | No | long | -| height | query | block height | No | long | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | -| quoteAsset | query | quote asset | No | string | -| sellerOrderId | query | seller order id | No | string | -| side | query | order side. 1 for buy and 2 for sell. | No | integer | -| start | query | start time in Milliseconds | No | long | -| symbol | query | symbol | No | string | -| total | query | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [TradePage](#tradepage) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - ### Models --- @@ -1191,16 +727,6 @@ varies with msg type, if you query with --format=json. | contract_address | string | smart contract address for this token | | | contract_decimals | int | the token decimals | | -### Market - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| base_asset_symbol | string (currency) | symbol of base asset | BNB | -| quote_asset_symbol | string (currency) | symbol of quote asset | ABC-5CA | -| list_price | string (fixed8) | In decimal form | 1.00000000 | -| tick_size | string (fixed8) | Minimium price change in decimal form | 0.00000001 | -| lot_size | string (fixed8) | Minimium trading quantity in decimal form | 1.00000000 | - ### Fee | Name | Type | Description | Example | @@ -1228,57 +754,6 @@ varies with msg type, if you query with --format=json. | fee_name | string | fee name | | | fee_value | integer | fee value | | -### MarketDepth - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| asks | [ string (fixed8) ] | Price and qty in decimal form, e.g. 1.00000000 | ["1.00000000","800.00000000"] | -| bids | [ string (fixed8) ] | Price and qty in decimal form, e.g. 1.00000000 | ["1.00000000","800.00000000"] | -| pending_match | boolean | If new orders inserted in current block and the matching process has not started in the block, return true. | | - -### Candlestick - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| close | number | closing price | | -| closeTime | long | time of closing trade | | -| high | number | the highest price | | -| low | number | the lowest price | | -| numberOfTrades | integer | total trades | | -| open | number | open price | | -| openTime | long | time of open trade | | -| quoteAssetVolume | number | the total trading volume in quote asset | | -| volume | number | the total trading volume | | - -### OrderList - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| order | [ [Order](#order) ] | list of orders | | -| total | long | | | - -### Order - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| cumulateQuantity | string | total amount of trades that have made | | -| fee | string | trading fee on the latest updated block of this order. Multiple assets are split by semicolon. | | -| lastExecutedPrice | string | price of last execution | | -| lastExecutedQuantity | string | quantity of last execution | | -| orderCreateTime | dateTime | time of order creation | | -| orderId | string | order ID | | -| owner | string | order issuer | | -| price | string | order price | | -| quantity | string | order quantity | | -| side | integer | 1 for buy and 2 for sell | | -| status | string | enum [Ack, PartialFill, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching, IocExpire] | | -| symbol | string | trading pair symbol | | -| timeInForce | integer | 1 for Good Till Expire(GTE) order and 3 for Immediate Or Cancel (IOC) | | -| tradeId | string | trade ID | | -| transactionHash | string | hash of transaction | | -| transactionTime | dateTime | time of latest order update, for example, cancel, expire | | -| type | integer | only 2 is available for now, meaning limit order | | - ### SubTx | Name | Type | Description | Example | @@ -1292,63 +767,6 @@ varies with msg type, if you query with --format=json. | txType | string | | | | value | string | | | -### TickerStatistics - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| askPrice | string | sell price | | -| askQuantity | string | sell quantity | | -| bidPrice | string | buy price | | -| bidQuantity | string | buy quantity | | -| closeTime | long | time of closing | | -| count | long | total trade count | | -| firstId | string | ID of first trade | | -| highPrice | string | highest price | | -| lastId | string | ID of last trade | | -| lastPrice | string | last price | | -| lastQuantity | string | last quantity | | -| lowPrice | string | lowest price | | -| openPrice | string | open price | | -| openTime | long | open time | | -| prevClosePrice | string | last close price | | -| priceChange | string | change of price | | -| priceChangePercent | string | change of price in percentage | | -| quoteVolume | string | trading volume in quote asset | | -| symbol | string | trading symbol | | -| volume | string | trading volume | | -| weightedAvgPrice | string | weighted average price | | - -### TradePage - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| total | long | total number of trades | | -| trade | [ [Trade](#trade) ] | | | - -### Trade - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| baseAsset | string | base asset symbol | | -| blockHeight | long | block height | | -| buyFee | string | trading fee for the buyer address on the block of this trade | | -| buyerId | string | id of buyer | | -| buyerOrderId | string | order id for buyer | | -| buySingleFee | string | trading fee for the buyer address on this single trade | BNB:0.00000172; | -| buyerSource | long | tx source of buy order | 1 | -| price | string | trade price | | -| quantity | string | trade quantity | | -| quoteAsset | string | quote asset symbol | | -| sellFee | string | trading fee for the seller address on the block of this trade | | -| sellerId | string | seller ID | | -| sellerOrderId | string | seller order ID | | -| sellSingleFee | string | trading fee for the seller address on this single trade | BNB:0.00000216; | -| sellerSource | long | tx source of sell order | 1 | -| symbol | string | asset symbol | | -| tickType | string | enum [Unknown,SellTaker,BuyTaker,BuySurplus,SellSurplus,Neutral] | | -| time | long | trade time | | -| tradeId | string | trade ID | | - ### BlockExchangeFeePage | Name | Type | Description | Example | diff --git a/docs/beaconchain/develop/api-reference/dex-api/paths.md b/docs/beaconchain/develop/api-reference/dex-api/paths.md index 9ba638b0e8..61e9e49f7c 100644 --- a/docs/beaconchain/develop/api-reference/dex-api/paths.md +++ b/docs/beaconchain/develop/api-reference/dex-api/paths.md @@ -1,6 +1,6 @@ HTTP API ======== -Within the ecosystem of Binance Chain, there are several accelerated nodes which provides more secure and faster lines to access Binance Chain and DEX data service including HTTP API. +Within the ecosystem of Binance Chain, there are several accelerated nodes which provides more secure and faster lines to access Binance Chain data service including HTTP API. For mainnet, there are more accelerated nodes. @@ -306,38 +306,6 @@ Below is an example response of a send transaction when `?format=json` is used. | 404 | Not Found | | | default | Generic error response | [Error](#error) | -### /api/v1/markets ---- -##### ***GET*** -**Summary:** Get market pairs. - -**Description:** Gets the list of market pairs that have been listed. - -**Destination:** Witness node. - -**Rate Limit:** 1 request per IP per second. - -**URL for mainnet:** [https://dex.binance.org/api/v1/markets](https://dex.binance.org/api/v1/markets) - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/markets](https://testnet-dex.binance.org/api/v1/markets) - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | Success | [ [Market](#market) ] | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - ### /api/v1/fees --- ##### ***GET*** @@ -361,40 +329,6 @@ Below is an example response of a send transaction when `?format=json` is used. | 200 | Success | [ [Fee](#fee) ] | | default | Generic error response | [Error](#error) | -### /api/v1/depth ---- -##### ***GET*** -**Summary:** Get the order book. - -**Description:** Gets the order book depth data for a given pair symbol. - -The given _limit_ must be one of the allowed limits below. - -**Destination:** Validator node. - -**Rate Limit:** 10 requests per IP per second. - -**URL for mainnet:** [https://dex.binance.org/api/v1/depth?symbol=xxx-000_BNB](https://dex.binance.org/api/v1/depth?symbol=xxx-000_BNB) - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/depth?symbol=xxx-000_BNB](https://testnet-dex.binance.org/api/v1/depth?symbol=xxx-000_BNB) - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| symbol | query | Market pair symbol, e.g. NNB-0AD_BNB | Yes | string | -| limit | query | The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000] | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | Success | [MarketDepth](#marketdepth) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - ### /api/v1/broadcast --- ##### ***POST*** @@ -428,204 +362,6 @@ The given _limit_ must be one of the allowed limits below. | 404 | Not Found | | | default | Generic error response | [Error](#error) | -### /api/v1/klines ---- -##### ***GET*** -**Summary:** Get candlestick bars. - -**Description:** Gets candlestick/kline bars for a symbol. Bars are uniquely identified by their open time. - -If the time window is larger than limits, only the first n klines will return. In this case, please either shrink the window or increase the limit to get proper amount of klines. - -**Rate Limit:** 10 requests per IP per second. - -**URL for mainnet:** [https://dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m](https://dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m) - - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m](https://testnet-dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m) - -**Example** - -``` -[ - 1499040000000, // Open time - "0.01634790", // Open - "0.80000000", // High - "0.01575800", // Low - "0.01577100", // Close - "148976.11427815", // Volume - 1499644799999, // Close time - "2434.19055334", // Quote asset volume - 308 // Number of trades -] -``` - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| symbol | query | symbol | Yes | string | -| interval | query | interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M] | Yes | enum string | -| limit | query | default 300; max 1000. | No | integer | -| startTime | query | start time in Milliseconds | No | long | -| endTime | query | end time in Milliseconds | No | long | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [ [Candlestick](#candlestick) ] | - -### /api/v1/orders/closed ---- -##### ***GET*** -**Summary:** Get closed orders. - -**Description:** Gets closed (filled and cancelled) orders for a given address. - -**Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| address | query | the owner address | Yes | string | -| end | query | end time in Milliseconds | No | long | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | -| side | query | order side. 1 for buy and 2 for sell. | No | integer | -| start | query | start time in Milliseconds | No | long | -| status | query | order status list. Allowed value: [Ack, IocExpire, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching] | No | enum string | -| symbol | query | symbol | No | string | -| total | query | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [OrderList](#orderlist) | - -### /api/v1/orders/open ---- -##### ***GET*** -**Summary:** Get open orders. - -**Description:** Gets open orders for a given address. - -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| address | query | the owner address | Yes | string | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | -| symbol | query | symbol | No | string | -| total | query | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [OrderList](#orderlist) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - -### /api/v1/orders/{id} ---- -##### ***GET*** -**Summary:** Get an order. - -**Description:** Gets metadata for an individual order by its ID. - -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| id | path | order id | Yes | string | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [Order](#order) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - -### /api/v1/ticker/24hr ---- -##### ***GET*** -**Summary:** Get a market ticker. - -**Description:** Gets 24 hour price change statistics for a market pair symbol. Updated every second. - -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| symbol | query | symbol | No | string | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [ [TickerStatistics](#tickerstatistics) ] | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - -### /api/v1/trades ---- -##### ***GET*** -**Summary:** Get market trades. - -**Description:** Gets a list of historical trades. - -**Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| address | query | the buyer/seller address | No | string | -| buyerOrderId | query | buyer order id | No | string | -| end | query | end time in Milliseconds | No | long | -| height | query | block height | No | long | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | -| quoteAsset | query | quote asset | No | string | -| sellerOrderId | query | seller order id | No | string | -| side | query | order side. 1 for buy and 2 for sell. | No | integer | -| start | query | start time in Milliseconds | No | long | -| symbol | query | symbol | No | string | -| total | query | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [TradePage](#tradepage) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - ### /api/v1/block-exchange-fee --- ##### ***GET*** @@ -867,212 +603,6 @@ If the time window is larger than limits, only the first n klines will return. I | 400 | Bad Request | [Error](#error) | | 500 | internal server error | [Error](#error) | -### /api/v1/mini/markets ---- -##### ***GET*** -**Summary:** Gets a list of mini market pairs. - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| offset | query | offset | No | integer | -| limit | query | limit | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | Success | [Markets](#markets) | -| 400 | Bad Request | [Error](#error) | - -### /api/v1/mini/klines ---- -##### ***GET*** -**Summary:** Get mini-token candlestick bars. - -**Description:** Gets candlestick/kline bars for a mini-token symbol pair. Bars are uniquely identified by their open time. - -If the time window is larger than limits, only the first n klines will return. In this case, please either shrink the window or increase the limit to get proper amount of klines. - -**Rate Limit:** 10 requests per IP per second. - -**Example** - -``` -[ - 1499040000000, // Open time - "0.01634790", // Open - "0.80000000", // High - "0.01575800", // Low - "0.01577100", // Close - "148976.11427815", // Volume - 1499644799999, // Close time - "2434.19055334", // Quote asset volume - 308 // Number of trades -] -``` - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| symbol | query | symbol | Yes | string | -| interval | query | interval. Allowed value: [1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M] | Yes | enum string | -| limit | query | default 300; max 1000. | No | integer | -| startTime | query | start time in Milliseconds | No | long | -| endTime | query | end time in Milliseconds | No | long | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [ [Candlestick](#candlestick) ] | - -### /api/v1/mini/orders/closed ---- -##### ***GET*** -**Summary:** Get closed orders of mini-token pairs. - -**Description:** Gets closed (filled and cancelled) orders for a given address. - -**Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| address | query | the owner address | Yes | string | -| end | query | end time in Milliseconds | No | long | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | -| side | query | order side. 1 for buy and 2 for sell. | No | integer | -| start | query | start time in Milliseconds | No | long | -| status | query | order status list. Allowed value: [Ack, IocExpire, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching] | No | enum string | -| symbol | query | symbol | No | string | -| total | query | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [OrderList](#orderlist) | - -### /api/v1/mini/orders/open ---- -##### ***GET*** -**Summary:** Get open orders of mini-token pairs. - -**Description:** Gets open orders for a given address. -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| address | query | the owner address | Yes | string | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | -| symbol | query | symbol | No | string | -| total | query | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [OrderList](#orderlist) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - -### /api/v1/mini/orders/{id} ---- -##### ***GET*** -**Summary:** Get an order of mini-token pairs. - -**Description:** Gets metadata for an individual order by its ID. -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| id | path | order id | Yes | string | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [Order](#order) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - -### /api/v1/mini/ticker/24hr ---- -##### ***GET*** -**Summary:** Get a market ticker of mini-token pairs. - -**Description:** Gets 24 hour price change statistics for a market pair symbol. Updated every second. -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| symbol | query | symbol | No | string | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [ [TickerStatistics](#tickerstatistics) ] | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | - -### /api/v1/mini/trades ---- -##### ***GET*** -**Summary:** Get market trades of mini-token pairs. - -**Description:** Gets a list of historical trades. -**Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. -**Rate Limit:** 5 requests per IP per second. - - -**Parameters** - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| address | query | the buyer/seller address | No | string | -| buyerOrderId | query | buyer order id | No | string | -| end | query | end time in Milliseconds | No | long | -| height | query | block height | No | long | -| limit | query | default 500; max 1000. | No | integer | -| offset | query | start with 0; default 0. | No | integer | -| quoteAsset | query | quote asset | No | string | -| sellerOrderId | query | seller order id | No | string | -| side | query | order side. 1 for buy and 2 for sell. | No | integer | -| start | query | start time in Milliseconds | No | long | -| symbol | query | symbol | No | string | -| total | query | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response | No | integer | - -**Responses** - -| Code | Description | Schema | -| ---- | ----------- | ------ | -| 200 | OK | [TradePage](#tradepage) | -| 400 | Bad Request | [Error](#error) | -| 404 | Not Found | | -| default | Generic error response | [Error](#error) | ### Models --- @@ -1226,16 +756,6 @@ varies with msg type, if you query with --format=json. | contract_address | string | smart contract address for this token | | | contract_decimals | int | the token decimals | | -### Market - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| base_asset_symbol | string (currency) | symbol of base asset | BNB | -| quote_asset_symbol | string (currency) | symbol of quote asset | ABC-5CA | -| list_price | string (fixed8) | In decimal form | 1.00000000 | -| tick_size | string (fixed8) | Minimium price change in decimal form | 0.00000001 | -| lot_size | string (fixed8) | Minimium trading quantity in decimal form | 1.00000000 | - ### Fee | Name | Type | Description | Example | @@ -1263,57 +783,6 @@ varies with msg type, if you query with --format=json. | fee_name | string | fee name | | | fee_value | integer | fee value | | -### MarketDepth - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| asks | [ string (fixed8) ] | Price and qty in decimal form, e.g. 1.00000000 | ["1.00000000","800.00000000"] | -| bids | [ string (fixed8) ] | Price and qty in decimal form, e.g. 1.00000000 | ["1.00000000","800.00000000"] | -| pending_match | boolean | If new orders inserted in current block and the matching process has not started in the block, return true. | | - -### Candlestick - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| close | number | closing price | | -| closeTime | long | time of closing trade | | -| high | number | the highest price | | -| low | number | the lowest price | | -| numberOfTrades | integer | total trades | | -| open | number | open price | | -| openTime | long | time of open trade | | -| quoteAssetVolume | number | the total trading volume in quote asset | | -| volume | number | the total trading volume | | - -### OrderList - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| order | [ [Order](#order) ] | list of orders | | -| total | long | | | - -### Order - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| cumulateQuantity | string | total amount of trades that have made | | -| fee | string | trading fee on the latest updated block of this order. Multiple assets are split by semicolon. | | -| lastExecutedPrice | string | price of last execution | | -| lastExecutedQuantity | string | quantity of last execution | | -| orderCreateTime | dateTime | time of order creation | | -| orderId | string | order ID | | -| owner | string | order issuer | | -| price | string | order price | | -| quantity | string | order quantity | | -| side | integer | 1 for buy and 2 for sell | | -| status | string | enum [Ack, PartialFill, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching, IocExpire] | | -| symbol | string | trading pair symbol | | -| timeInForce | integer | 1 for Good Till Expire(GTE) order and 3 for Immediate Or Cancel (IOC) | | -| tradeId | string | trade ID | | -| transactionHash | string | hash of transaction | | -| transactionTime | dateTime | time of latest order update, for example, cancel, expire | | -| type | integer | only 2 is available for now, meaning limit order | | - ### SubTx | Name | Type | Description | Example | @@ -1327,63 +796,6 @@ varies with msg type, if you query with --format=json. | txType | string | | | | value | string | | | -### TickerStatistics - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| askPrice | string | sell price | | -| askQuantity | string | sell quantity | | -| bidPrice | string | buy price | | -| bidQuantity | string | buy quantity | | -| closeTime | long | time of closing | | -| count | long | total trade count | | -| firstId | string | ID of first trade | | -| highPrice | string | highest price | | -| lastId | string | ID of last trade | | -| lastPrice | string | last price | | -| lastQuantity | string | last quantity | | -| lowPrice | string | lowest price | | -| openPrice | string | open price | | -| openTime | long | open time | | -| prevClosePrice | string | last close price | | -| priceChange | string | change of price | | -| priceChangePercent | string | change of price in percentage | | -| quoteVolume | string | trading volume in quote asset | | -| symbol | string | trading symbol | | -| volume | string | trading volume | | -| weightedAvgPrice | string | weighted average price | | - -### TradePage - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| total | long | total number of trades | | -| trade | [ [Trade](#trade) ] | | | - -### Trade - -| Name | Type | Description | Example | -| ---- | ---- | ----------- | ------- | -| baseAsset | string | base asset symbol | | -| blockHeight | long | block height | | -| buyFee | string | trading fee for the buyer address on the block of this trade | | -| buyerId | string | id of buyer | | -| buyerOrderId | string | order id for buyer | | -| buySingleFee | string | trading fee for the buyer address on this single trade | BNB:0.00000172; | -| buyerSource | long | tx source of buy order | 1 | -| price | string | trade price | | -| quantity | string | trade quantity | | -| quoteAsset | string | quote asset symbol | | -| sellFee | string | trading fee for the seller address on the block of this trade | | -| sellerId | string | seller ID | | -| sellerOrderId | string | seller order ID | | -| sellSingleFee | string | trading fee for the seller address on this single trade | BNB:0.00000216; | -| sellerSource | long | tx source of sell order | 1 | -| symbol | string | asset symbol | | -| tickType | string | enum [Unknown,SellTaker,BuyTaker,BuySurplus,SellSurplus,Neutral] | | -| time | long | trade time | | -| tradeId | string | trade ID | | - ### BlockExchangeFeePage | Name | Type | Description | Example | diff --git a/docs/beaconchain/develop/api-reference/dex-api/staking.md b/docs/beaconchain/develop/api-reference/dex-api/staking.md index bbad078a30..9992380d3e 100644 --- a/docs/beaconchain/develop/api-reference/dex-api/staking.md +++ b/docs/beaconchain/develop/api-reference/dex-api/staking.md @@ -1,5 +1,5 @@ --- -sidebar_label: Staking +sidebar_label: Staking API hide_table_of_contents: true sidebar_position: 2 --- diff --git a/sidebars.js b/sidebars.js index 9fd1455fef..df016b2843 100644 --- a/sidebars.js +++ b/sidebars.js @@ -250,7 +250,7 @@ const sidebars = { 'beaconchain/develop/node/join-testnet', 'beaconchain/develop/node/synctypes', 'beaconchain/develop/node/extra-info', 'beaconchain/develop/node/nodetypes', 'beaconchain/develop/node/upgrade', 'beaconchain/develop/node/localnetwork', - 'beaconchain/develop/node/fullnodeissue', 'beaconchain/develop/api-reference/dex-api/staking', + 'beaconchain/develop/node/fullnodeissue', 'beaconchain/develop/node/snapshot' ] }, @@ -259,15 +259,16 @@ const sidebars = { {type:'doc', id: 'beaconchain/tokens', label:'Asset Management'}, {type:'doc', id: 'beaconchain/develop/api-reference/api-server', label:'Simple API Server'}, {type:'doc', id: 'beaconchain/develop/bcsdk', label:'BNB Beacon Chain SDK'}, - {type:'doc', id: 'beaconchain/develop/testnetandexplorer', label:'BNB Beacon Chain Testnet & SDK'}, + {type:'doc', id: 'beaconchain/develop/testnetandexplorer', label:'BNB Beacon Chain Testnet'}, { type: 'category', - label:'BNB Beacon Chain and DEX API Reference', + label:'BNB Beacon Chain API Reference', items:[ {type:'doc', id:'beaconchain/develop/api-reference/dex-api/paths', label: 'Accelerated Node HTTP API Mainnet - Paths and Models'}, - {type:'doc', id:'beaconchain/develop/api-reference/dex-api/block-service', label: 'New Accelerated Node HTTP API Mainnet'}, - {type:'link', href:"pathname:///api-swagger/index.html", label: 'Accelerated Node HTTP API Swagger'}, {type:'doc', id:'beaconchain/develop/api-reference/dex-api/paths-testnet', label: 'Accelerated Node HTTP API Testnet- Paths and Models'}, + {type:'link', href:"pathname:///api-swagger/index.html", label: 'Accelerated Node HTTP API Swagger'}, + {type:'doc', id:'beaconchain/develop/api-reference/dex-api/block-service', label: 'New Accelerated Node HTTP API Mainnet'}, + {type:'doc', id:'beaconchain/develop/api-reference/dex-api/staking', label: 'Staking API'}, {type:'doc', id:'beaconchain/develop/api-reference/dex-api/ws-connection', label: 'WebSockets - Connecting'}, {type:'doc', id:'beaconchain/develop/api-reference/dex-api/ws-streams', label: 'WebSockets - Streams'}, {type:'doc', id:'beaconchain/develop/api-reference/node-rpc', label: 'Node RPC - Paths and Models'}, diff --git a/static/api-swagger/.swagger-codegen-ignore b/static/api-swagger/.swagger-codegen-ignore new file mode 100644 index 0000000000..c5fa491b4c --- /dev/null +++ b/static/api-swagger/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/static/api-swagger/.swagger-codegen/VERSION b/static/api-swagger/.swagger-codegen/VERSION new file mode 100644 index 0000000000..3356a5d935 --- /dev/null +++ b/static/api-swagger/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.36 \ No newline at end of file diff --git a/static/api-swagger/index.html b/static/api-swagger/index.html index 63cf055fd2..512f41e93c 100644 --- a/static/api-swagger/index.html +++ b/static/api-swagger/index.html @@ -934,50 +934,6 @@ } } } -}; - defs["Candlestick"] = { - "type" : "object", - "properties" : { - "close" : { - "type" : "number", - "description" : "closing price" - }, - "closeTime" : { - "type" : "integer", - "description" : "time of closing trade", - "format" : "int64" - }, - "high" : { - "type" : "number", - "description" : "the highest price" - }, - "low" : { - "type" : "number", - "description" : "the lowest price" - }, - "numberOfTrades" : { - "type" : "integer", - "description" : "total trades", - "format" : "int32" - }, - "open" : { - "type" : "number", - "description" : "open price" - }, - "openTime" : { - "type" : "integer", - "description" : "time of open trade", - "format" : "int64" - }, - "quoteAssetVolume" : { - "type" : "number", - "description" : "the total trading volume in quote asset" - }, - "volume" : { - "type" : "number", - "description" : "the total trading volume" - } - } }; defs["DexFeeFieldParams"] = { "type" : "object", @@ -1071,70 +1027,6 @@ "example" : 1 } } -}; - defs["Market"] = { - "required" : [ "base_asset_symbol", "list_price", "lot_size", "quote_asset_symbol", "tick_size" ], - "type" : "object", - "properties" : { - "base_asset_symbol" : { - "type" : "string", - "description" : "symbol of base asset", - "format" : "currency", - "example" : "BNB" - }, - "quote_asset_symbol" : { - "type" : "string", - "description" : "symbol of quote asset", - "format" : "currency", - "example" : "ABC-5CA" - }, - "list_price" : { - "type" : "string", - "description" : "In decimal form", - "format" : "fixed8", - "example" : "1.00000000" - }, - "tick_size" : { - "type" : "string", - "description" : "Minimium price change in decimal form", - "format" : "fixed8", - "example" : "0.00000001" - }, - "lot_size" : { - "type" : "string", - "description" : "Minimium trading quantity in decimal form", - "format" : "fixed8", - "example" : "1.00000000" - } - } -}; - defs["MarketDepth"] = { - "required" : [ "asks", "bids" ], - "type" : "object", - "properties" : { - "asks" : { - "maxItems" : 2, - "minItems" : 2, - "type" : "array", - "description" : "Price and qty in decimal form, e.g. 1.00000000", - "example" : "[\"1.00000000\",\"800.00000000\"]", - "items" : { - "type" : "string", - "format" : "fixed8" - } - }, - "bids" : { - "maxItems" : 2, - "minItems" : 2, - "type" : "array", - "description" : "Price and qty in decimal form, e.g. 1.00000000", - "example" : "[\"1.00000000\",\"800.00000000\"]", - "items" : { - "type" : "string", - "format" : "fixed8" - } - } - } }; defs["NodeInfo"] = { "type" : "object", @@ -1168,101 +1060,6 @@ "properties" : { } } } -}; - defs["Order"] = { - "title" : "Order", - "type" : "object", - "properties" : { - "cumulateQuantity" : { - "type" : "string", - "description" : "total amount of trades that have made" - }, - "fee" : { - "type" : "string", - "description" : "trading fee on the latest updated block of this order. Multiple assets are split by semicolon." - }, - "lastExecutedPrice" : { - "type" : "string", - "description" : "price of last execution" - }, - "lastExecutedQuantity" : { - "type" : "string", - "description" : "quantity of last execution" - }, - "orderCreateTime" : { - "type" : "string", - "description" : "time of order creation", - "format" : "date-time" - }, - "orderId" : { - "type" : "string", - "description" : "order ID" - }, - "owner" : { - "type" : "string", - "description" : "order issuer" - }, - "price" : { - "type" : "string", - "description" : "order price" - }, - "quantity" : { - "type" : "string", - "description" : "order quantity" - }, - "side" : { - "type" : "integer", - "description" : "1 for buy and 2 for sell", - "format" : "int32" - }, - "status" : { - "type" : "string", - "description" : "enum [Ack, PartialFill, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching, IocExpire]" - }, - "symbol" : { - "type" : "string", - "description" : "trading pair symbol" - }, - "timeInForce" : { - "type" : "integer", - "description" : "1 for Good Till Expire(GTE) order and 3 for Immediate Or Cancel (IOC)", - "format" : "int32" - }, - "tradeId" : { - "type" : "string", - "description" : "trade ID" - }, - "transactionHash" : { - "type" : "string", - "description" : "hash of transaction" - }, - "transactionTime" : { - "type" : "string", - "description" : "time of latest order update, for example, cancel, expire", - "format" : "date-time" - }, - "type" : { - "type" : "integer", - "description" : "only 2 is available for now, meaning limit order", - "format" : "int32" - } - } -}; - defs["OrderList"] = { - "type" : "object", - "properties" : { - "order" : { - "type" : "array", - "description" : "list of orders", - "items" : { - "$ref" : "#/components/schemas/Order" - } - }, - "total" : { - "type" : "integer", - "format" : "int64" - } - } }; defs["Peer"] = { "required" : [ "accelerated", "access_addr", "capabilities", "id", "listen_addr", "moniker", "network", "original_listen_addr", "stream_addr", "version" ], @@ -1416,99 +1213,6 @@ "type" : "boolean" } } -}; - defs["TickerStatistics"] = { - "title" : "TickerStatistics", - "type" : "object", - "properties" : { - "askPrice" : { - "type" : "string", - "description" : "sell price" - }, - "askQuantity" : { - "type" : "string", - "description" : "sell quantity" - }, - "bidPrice" : { - "type" : "string", - "description" : "buy price" - }, - "bidQuantity" : { - "type" : "string", - "description" : "buy quantity" - }, - "closeTime" : { - "type" : "integer", - "description" : "time of closing", - "format" : "int64" - }, - "count" : { - "type" : "integer", - "description" : "total trade count", - "format" : "int64" - }, - "firstId" : { - "type" : "string", - "description" : "ID of first trade" - }, - "highPrice" : { - "type" : "string", - "description" : "highest price" - }, - "lastId" : { - "type" : "string", - "description" : "ID of last trade" - }, - "lastPrice" : { - "type" : "string", - "description" : "last price" - }, - "lastQuantity" : { - "type" : "string", - "description" : "last quantity" - }, - "lowPrice" : { - "type" : "string", - "description" : "lowest price" - }, - "openPrice" : { - "type" : "string", - "description" : "open price" - }, - "openTime" : { - "type" : "integer", - "description" : "open time", - "format" : "int64" - }, - "prevClosePrice" : { - "type" : "string", - "description" : "last close price" - }, - "priceChange" : { - "type" : "string", - "description" : "change of price" - }, - "priceChangePercent" : { - "type" : "string", - "description" : "change of price in percentage" - }, - "quoteVolume" : { - "type" : "string", - "description" : "trading volume in quote asset" - }, - "symbol" : { - "type" : "string", - "description" : "trading symbol" - }, - "volume" : { - "type" : "string", - "description" : "trading volume" - }, - "weightedAvgPrice" : { - "type" : "string", - "description" : "weighted average price" - } - } }; defs["TimeLock"] = { "type" : "object", @@ -1611,109 +1315,6 @@ "format" : "address" } } -}; - defs["Trade"] = { - "type" : "object", - "properties" : { - "baseAsset" : { - "type" : "string", - "description" : "base asset symbol" - }, - "blockHeight" : { - "type" : "integer", - "description" : "block height", - "format" : "int64" - }, - "buyFee" : { - "type" : "string", - "description" : "trading fee for the buyer address on the block of this trade" - }, - "buyerId" : { - "type" : "string", - "description" : "id of buyer" - }, - "buyerOrderId" : { - "type" : "string", - "description" : "order id for buyer" - }, - "buySingleFee" : { - "type" : "string", - "description" : "trading fee for the buyer address on this single trade", - "example" : "BNB:0.00000172;" - }, - "buyerSource" : { - "type" : "integer", - "description" : "tx source of buy order", - "example" : 1 - }, - "price" : { - "type" : "string", - "description" : "trade price" - }, - "quantity" : { - "type" : "string", - "description" : "trade quantity" - }, - "quoteAsset" : { - "type" : "string", - "description" : "quote asset symbol" - }, - "sellFee" : { - "type" : "string", - "description" : "trading fee for the seller address on the block of this trade" - }, - "sellerId" : { - "type" : "string", - "description" : "seller ID" - }, - "sellerOrderId" : { - "type" : "string", - "description" : "seller order ID" - }, - "sellSingleFee" : { - "type" : "string", - "description" : "trading fee for the seller address on this single trade", - "example" : "BNB:0.00000216;" - }, - "sellerSource" : { - "type" : "integer", - "description" : "tx source of sell order", - "example" : 1 - }, - "symbol" : { - "type" : "string", - "description" : "asset symbol" - }, - "tickType" : { - "type" : "string", - "description" : "enum [Unknown,SellTaker,BuyTaker,BuySurplus,SellSurplus,Neutral]" - }, - "time" : { - "type" : "integer", - "description" : "trade time", - "format" : "int64" - }, - "tradeId" : { - "type" : "string", - "description" : "trade ID" - } - } -}; - defs["TradePage"] = { - "type" : "object", - "properties" : { - "total" : { - "type" : "integer", - "description" : "total number of trades", - "format" : "int64" - }, - "trade" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/Trade" - } - } - } }; defs["Transaction"] = { "type" : "object", @@ -2036,21 +1637,9 @@ getValidators -
  • - get24HrPriceStatistics -
  • -
  • - getCandlestickBars -
  • -
  • - getDepth -
  • getFees
  • -
  • - getPairs -
  • getTime @@ -2080,16 +1669,6 @@
  • getValidators
  • - -
  • - getClosedOrders -
  • -
  • - getOpenOrders -
  • -
  • - getOrder -
  • getTimeLock @@ -2098,10 +1677,6 @@
  • getTokens
  • - -
  • - getTrades -
  • getBlockExchangeFee @@ -2136,7 +1711,7 @@

    HTTP API

    API and SDK Documentation

    Version: 1.0.0

    -
    The Binance Chain HTTP API provides access to a Binance Chain node deployment and market data services.
    +
    The Binance Chain HTTP API provides access to a Beacon Chain node deployment and related data services.
    @@ -5495,46 +5070,52 @@

    Status: default - Generic error response

    Market

    -
    -
    +
    +
    -

    get24HrPriceStatistics

    -

    Get a market ticker.

    +

    getFees

    +

    Obtain trading fees information.

    -

    Gets 24 hour price change statistics for a market pair symbol. Updated every second. +

    Gets the current trading fees settings. -**Rate Limit:** 5 requests per IP per second. +**Destination:** Witness node. + +**Rate Limit:** 1 request per IP per second. + +**URL for mainnet:** [https://dex.binance.org/api/v1/fees](https://dex.binance.org/api/v1/fees) + +**URL for testnet:** [https://testnet-dex.binance.org/api/v1/fees](https://testnet-dex.binance.org/api/v1/fees)


    -
    /api/v1/ticker/24hr
    +
    /api/v1/fees

    Usage and SDK Samples

    - +
  • Curl
  • +
  • Java
  • +
  • Android
  • + +
  • Obj-C
  • +
  • JavaScript
  • + +
  • C#
  • +
  • PHP
  • +
  • Perl
  • +
  • Python
  • + +
    -
    +
    curl -X GET\
     -H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/ticker/24hr?symbol="
    +"https://dex.binance.org/api/v1/fees"
    -
    +
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    @@ -5548,48 +5129,45 @@ 

    Usage and SDK Samples

    public static void main(String[] args) { MarketApi apiInstance = new MarketApi(); - String symbol = symbol_example; // String | symbol try { - array[TickerStatistics] result = apiInstance.get24HrPriceStatistics(symbol); + array[Fee] result = apiInstance.getFees(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling MarketApi#get24HrPriceStatistics"); + System.err.println("Exception when calling MarketApi#getFees"); e.printStackTrace(); } } }
    -
    +
    import io.swagger.client.api.MarketApi;
     
     public class MarketApiExample {
     
         public static void main(String[] args) {
             MarketApi apiInstance = new MarketApi();
    -        String symbol = symbol_example; // String | symbol
             try {
    -            array[TickerStatistics] result = apiInstance.get24HrPriceStatistics(symbol);
    +            array[Fee] result = apiInstance.getFees();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling MarketApi#get24HrPriceStatistics");
    +            System.err.println("Exception when calling MarketApi#getFees");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    String *symbol = symbol_example; // symbol (optional)
    -
    +                            
    +
    
     MarketApi *apiInstance = [[MarketApi alloc] init];
     
    -// Get a market ticker.
    -[apiInstance get24HrPriceStatisticsWith:symbol
    -              completionHandler: ^(array[TickerStatistics] output, NSError* error) {
    +// Obtain trading fees information.
    +[apiInstance getFeesWithCompletionHandler: 
    +              ^(array[Fee] output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -5600,13 +5178,10 @@ 

    Usage and SDK Samples

    -
    +
    var HttpApi = require('http_api');
     
     var api = new HttpApi.MarketApi()
    -var opts = { 
    -  'symbol': symbol_example // {{String}} symbol
    -};
     var callback = function(error, data, response) {
       if (error) {
         console.error(error);
    @@ -5614,14 +5189,14 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.get24HrPriceStatistics(opts, callback); +api.getFees(callback);
    - -
    +
    using System;
     using System.Diagnostics;
     using IO.Swagger.Api;
    @@ -5630,23 +5205,22 @@ 

    Usage and SDK Samples

    namespace Example { - public class get24HrPriceStatisticsExample + public class getFeesExample { public void main() { var apiInstance = new MarketApi(); - var symbol = symbol_example; // String | symbol (optional) try { - // Get a market ticker. - array[TickerStatistics] result = apiInstance.get24HrPriceStatistics(symbol); + // Obtain trading fees information. + array[Fee] result = apiInstance.getFees(); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling MarketApi.get24HrPriceStatistics: " + e.Message ); + Debug.Print("Exception when calling MarketApi.getFees: " + e.Message ); } } } @@ -5654,40 +5228,38 @@

    Usage and SDK Samples

    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\ApiMarketApi();
    -$symbol = symbol_example; // String | symbol
     
     try {
    -    $result = $api_instance->get24HrPriceStatistics($symbol);
    +    $result = $api_instance->getFees();
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling MarketApi->get24HrPriceStatistics: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling MarketApi->getFees: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use WWW::SwaggerClient::Configuration;
     use WWW::SwaggerClient::MarketApi;
     
     my $api_instance = WWW::SwaggerClient::MarketApi->new();
    -my $symbol = symbol_example; # String | symbol
     
     eval { 
    -    my $result = $api_instance->get24HrPriceStatistics(symbol => $symbol);
    +    my $result = $api_instance->getFees();
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling MarketApi->get24HrPriceStatistics: $@\n";
    +    warn "Exception when calling MarketApi->getFees: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_client
    @@ -5696,14 +5268,13 @@ 

    Usage and SDK Samples

    # create an instance of the API class api_instance = swagger_client.MarketApi() -symbol = symbol_example # String | symbol (optional) try: - # Get a market ticker. - api_response = api_instance.get24_hr_price_statistics(symbol=symbol) + # Obtain trading fees information. + api_response = api_instance.get_fees() pprint(api_response) except ApiException as e: - print("Exception when calling MarketApi->get24HrPriceStatistics: %s\n" % e)
    + print("Exception when calling MarketApi->getFees: %s\n" % e)
    @@ -5713,56 +5284,30 @@

    Parameters

    -
    Query parameters
    - - - - - - - - -
    NameDescription
    symbol - - -
    -
    -
    - - String - - -
    - symbol -
    -
    -
    -
    -

    Responses

    -

    Status: 200 - OK

    +

    Status: 200 - Success

    -
    -
    +
    +
    -
    - -
    -
    - -

    Status: 400 - Bad Request

    - - - -
    -
    -
    -
    - +
    -

    Status: 404 - Not Found

    - - - -
    -
    -

    Status: default - Generic error response

    -
    -
    +
    +
    - +

    -
    -
    +
    +
    +

    Misc

    +
    +
    -

    getCandlestickBars

    -

    Get candlestick bars.

    +

    getTime

    +

    Get the block time.

    -

    Gets candlestick/kline bars for a symbol. Bars are uniquely identified by their open time. - -If the time window is larger than limits, only the first n klines will return. In this case, please either shrink the window or increase the limit to get proper amount of klines. - -**Rate Limit:** 10 requests per IP per second. - -**URL for mainnet:** [https://dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m](https://dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m) +

    Gets the latest block time and the current time according to the HTTP service. +**Destination:** Validator node. -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m](https://testnet-dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m) +**Rate Limit:** 1 request per IP per second. -**Example** +**URL for mainnet:** [https://dex.binance.org/api/v1/time](https://dex.binance.org/api/v1/time) -``` -[ - 1499040000000, // Open time - "0.01634790", // Open - "0.80000000", // High - "0.01575800", // Low - "0.01577100", // Close - "148976.11427815", // Volume - 1499644799999, // Close time - "2434.19055334", // Quote asset volume - 308 // Number of trades -] -``` +**URL for testnet:** [https://testnet-dex.binance.org/api/v1/time](https://testnet-dex.binance.org/api/v1/time)


    -
    /api/v1/klines
    +
    /api/v1/time

    Usage and SDK Samples

    -
    +
    curl -X GET\
     -H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/klines?symbol=&interval=&limit=&startTime=&endTime="
    +"https://dex.binance.org/api/v1/time"
    -
    +
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import io.swagger.client.api.MarketApi;
    +import io.swagger.client.api.MiscApi;
     
     import java.io.File;
     import java.util.*;
     
    -public class MarketApiExample {
    +public class MiscApiExample {
     
         public static void main(String[] args) {
             
    -        MarketApi apiInstance = new MarketApi();
    -        String symbol = symbol_example; // String | symbol
    -        String interval = interval_example; // String | interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M]
    -        Integer limit = 56; // Integer | default 300; max 1000.
    -        Long startTime = 789; // Long | start time in Milliseconds
    -        Long endTime = 789; // Long | end time in Milliseconds
    +        MiscApi apiInstance = new MiscApi();
             try {
    -            array[Candlestick] result = apiInstance.getCandlestickBars(symbol, interval, limit, startTime, endTime);
    +            Times result = apiInstance.getTime();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling MarketApi#getCandlestickBars");
    +            System.err.println("Exception when calling MiscApi#getTime");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    import io.swagger.client.api.MarketApi;
    +                          
    +
    import io.swagger.client.api.MiscApi;
     
    -public class MarketApiExample {
    +public class MiscApiExample {
     
         public static void main(String[] args) {
    -        MarketApi apiInstance = new MarketApi();
    -        String symbol = symbol_example; // String | symbol
    -        String interval = interval_example; // String | interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M]
    -        Integer limit = 56; // Integer | default 300; max 1000.
    -        Long startTime = 789; // Long | start time in Milliseconds
    -        Long endTime = 789; // Long | end time in Milliseconds
    +        MiscApi apiInstance = new MiscApi();
             try {
    -            array[Candlestick] result = apiInstance.getCandlestickBars(symbol, interval, limit, startTime, endTime);
    +            Times result = apiInstance.getTime();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling MarketApi#getCandlestickBars");
    +            System.err.println("Exception when calling MiscApi#getTime");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    String *symbol = symbol_example; // symbol
    -String *interval = interval_example; // interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M]
    -Integer *limit = 56; // default 300; max 1000. (optional)
    -Long *startTime = 789; // start time in Milliseconds (optional)
    -Long *endTime = 789; // end time in Milliseconds (optional)
    -
    -MarketApi *apiInstance = [[MarketApi alloc] init];
    +                            
    +
    
    +MiscApi *apiInstance = [[MiscApi alloc] init];
     
    -// Get candlestick bars.
    -[apiInstance getCandlestickBarsWith:symbol
    -    interval:interval
    -    limit:limit
    -    startTime:startTime
    -    endTime:endTime
    -              completionHandler: ^(array[Candlestick] output, NSError* error) {
    +// Get the block time.
    +[apiInstance getTimeWithCompletionHandler: 
    +              ^(Times output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -6044,17 +5500,10 @@ 

    Usage and SDK Samples

    -
    +
    var HttpApi = require('http_api');
     
    -var api = new HttpApi.MarketApi()
    -var symbol = symbol_example; // {{String}} symbol
    -var interval = interval_example; // {{String}} interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M]
    -var opts = { 
    -  'limit': 56, // {{Integer}} default 300; max 1000.
    -  'startTime': 789, // {{Long}} start time in Milliseconds
    -  'endTime': 789 // {{Long}} end time in Milliseconds
    -};
    +var api = new HttpApi.MiscApi()
     var callback = function(error, data, response) {
       if (error) {
         console.error(error);
    @@ -6062,14 +5511,14 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.getCandlestickBars(symbol, interval, opts, callback); +api.getTime(callback);
    - -
    +
    using System;
     using System.Diagnostics;
     using IO.Swagger.Api;
    @@ -6078,27 +5527,22 @@ 

    Usage and SDK Samples

    namespace Example { - public class getCandlestickBarsExample + public class getTimeExample { public void main() { - var apiInstance = new MarketApi(); - var symbol = symbol_example; // String | symbol - var interval = interval_example; // String | interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M] - var limit = 56; // Integer | default 300; max 1000. (optional) - var startTime = 789; // Long | start time in Milliseconds (optional) - var endTime = 789; // Long | end time in Milliseconds (optional) + var apiInstance = new MiscApi(); try { - // Get candlestick bars. - array[Candlestick] result = apiInstance.getCandlestickBars(symbol, interval, limit, startTime, endTime); + // Get the block time. + Times result = apiInstance.getTime(); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling MarketApi.getCandlestickBars: " + e.Message ); + Debug.Print("Exception when calling MiscApi.getTime: " + e.Message ); } } } @@ -6106,48 +5550,38 @@

    Usage and SDK Samples

    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new Swagger\Client\ApiMarketApi();
    -$symbol = symbol_example; // String | symbol
    -$interval = interval_example; // String | interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M]
    -$limit = 56; // Integer | default 300; max 1000.
    -$startTime = 789; // Long | start time in Milliseconds
    -$endTime = 789; // Long | end time in Milliseconds
    +$api_instance = new Swagger\Client\ApiMiscApi();
     
     try {
    -    $result = $api_instance->getCandlestickBars($symbol, $interval, $limit, $startTime, $endTime);
    +    $result = $api_instance->getTime();
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling MarketApi->getCandlestickBars: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling MiscApi->getTime: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::MarketApi;
    +use WWW::SwaggerClient::MiscApi;
     
    -my $api_instance = WWW::SwaggerClient::MarketApi->new();
    -my $symbol = symbol_example; # String | symbol
    -my $interval = interval_example; # String | interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M]
    -my $limit = 56; # Integer | default 300; max 1000.
    -my $startTime = 789; # Long | start time in Milliseconds
    -my $endTime = 789; # Long | end time in Milliseconds
    +my $api_instance = WWW::SwaggerClient::MiscApi->new();
     
     eval { 
    -    my $result = $api_instance->getCandlestickBars(symbol => $symbol, interval => $interval, limit => $limit, startTime => $startTime, endTime => $endTime);
    +    my $result = $api_instance->getTime();
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling MarketApi->getCandlestickBars: $@\n";
    +    warn "Exception when calling MiscApi->getTime: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_client
    @@ -6155,19 +5589,14 @@ 

    Usage and SDK Samples

    from pprint import pprint # create an instance of the API class -api_instance = swagger_client.MarketApi() -symbol = symbol_example # String | symbol -interval = interval_example # String | interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M] -limit = 56 # Integer | default 300; max 1000. (optional) -startTime = 789 # Long | start time in Milliseconds (optional) -endTime = 789 # Long | end time in Milliseconds (optional) +api_instance = swagger_client.MiscApi() try: - # Get candlestick bars. - api_response = api_instance.get_candlestick_bars(symbol, interval, limit=limit, startTime=startTime, endTime=endTime) + # Get the block time. + api_response = api_instance.get_time() pprint(api_response) except ApiException as e: - print("Exception when calling MarketApi->getCandlestickBars: %s\n" % e)
    + print("Exception when calling MiscApi->getTime: %s\n" % e)
    @@ -6177,3345 +5606,132 @@

    Parameters

    -
    Query parameters
    - - - - - - - - - - - - - - - - - - - - -
    NameDescription
    symbol* - - -
    -
    -
    - - String - - -
    - symbol -
    -
    -
    - Required -
    -
    -
    -
    interval* - - -
    -
    -
    - - String - - -
    - interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M] -
    -
    -
    - Required -
    -
    -
    -
    limit - - -
    -
    -
    - - Integer - - - (int32) - - -
    - default 300; max 1000. -
    -
    -
    -
    -
    startTime - - -
    -
    -
    - - Long - - - (int64) - - -
    - start time in Milliseconds -
    -
    -
    -
    -
    endTime - - -
    -
    -
    - - Long - - - (int64) - - -
    - end time in Milliseconds -
    -
    -
    -
    -
    - -

    Responses

    -

    Status: 200 - OK

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    getDepth

    -

    Get the order book.

    -
    -
    -
    -

    -

    Gets the order book depth data for a given pair symbol. - -The given _limit_ must be one of the allowed limits below. - -**Destination:** Validator node. - -**Rate Limit:** 10 requests per IP per second. - -**URL for mainnet:** [https://dex.binance.org/api/v1/depth?symbol=xxx-000_BNB](https://dex.binance.org/api/v1/depth?symbol=xxx-000_BNB) - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/depth?symbol=xxx-000_BNB](https://testnet-dex.binance.org/api/v1/depth?symbol=xxx-000_BNB) -

    -

    -
    -
    /api/v1/depth
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET\
    --H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/depth?symbol=&limit="
    -
    -
    -
    import io.swagger.client.*;
    -import io.swagger.client.auth.*;
    -import io.swagger.client.model.*;
    -import io.swagger.client.api.MarketApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class MarketApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        MarketApi apiInstance = new MarketApi();
    -        String symbol = symbol_example; // String | Market pair symbol, e.g. NNB-0AD_BNB
    -        Integer limit = 56; // Integer | The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000]
    -        try {
    -            MarketDepth result = apiInstance.getDepth(symbol, limit);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling MarketApi#getDepth");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import io.swagger.client.api.MarketApi;
    -
    -public class MarketApiExample {
    -
    -    public static void main(String[] args) {
    -        MarketApi apiInstance = new MarketApi();
    -        String symbol = symbol_example; // String | Market pair symbol, e.g. NNB-0AD_BNB
    -        Integer limit = 56; // Integer | The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000]
    -        try {
    -            MarketDepth result = apiInstance.getDepth(symbol, limit);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling MarketApi#getDepth");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    String *symbol = symbol_example; // Market pair symbol, e.g. NNB-0AD_BNB
    -Integer *limit = 56; // The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000] (optional)
    -
    -MarketApi *apiInstance = [[MarketApi alloc] init];
    -
    -// Get the order book.
    -[apiInstance getDepthWith:symbol
    -    limit:limit
    -              completionHandler: ^(MarketDepth output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var HttpApi = require('http_api');
    -
    -var api = new HttpApi.MarketApi()
    -var symbol = symbol_example; // {{String}} Market pair symbol, e.g. NNB-0AD_BNB
    -var opts = { 
    -  'limit': 56 // {{Integer}} The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000]
    -};
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.getDepth(symbol, opts, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using IO.Swagger.Api;
    -using IO.Swagger.Client;
    -using IO.Swagger.Model;
    -
    -namespace Example
    -{
    -    public class getDepthExample
    -    {
    -        public void main()
    -        {
    -
    -            var apiInstance = new MarketApi();
    -            var symbol = symbol_example;  // String | Market pair symbol, e.g. NNB-0AD_BNB
    -            var limit = 56;  // Integer | The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000] (optional) 
    -
    -            try
    -            {
    -                // Get the order book.
    -                MarketDepth result = apiInstance.getDepth(symbol, limit);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling MarketApi.getDepth: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\ApiMarketApi();
    -$symbol = symbol_example; // String | Market pair symbol, e.g. NNB-0AD_BNB
    -$limit = 56; // Integer | The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000]
    -
    -try {
    -    $result = $api_instance->getDepth($symbol, $limit);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling MarketApi->getDepth: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::MarketApi;
    -
    -my $api_instance = WWW::SwaggerClient::MarketApi->new();
    -my $symbol = symbol_example; # String | Market pair symbol, e.g. NNB-0AD_BNB
    -my $limit = 56; # Integer | The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000]
    -
    -eval { 
    -    my $result = $api_instance->getDepth(symbol => $symbol, limit => $limit);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling MarketApi->getDepth: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_client
    -from swagger_client.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_client.MarketApi()
    -symbol = symbol_example # String | Market pair symbol, e.g. NNB-0AD_BNB
    -limit = 56 # Integer | The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000] (optional)
    -
    -try: 
    -    # Get the order book.
    -    api_response = api_instance.get_depth(symbol, limit=limit)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling MarketApi->getDepth: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - -
    Query parameters
    - - - - - - - - - - - -
    NameDescription
    symbol* - - -
    -
    -
    - - String - - -
    - Market pair symbol, e.g. NNB-0AD_BNB -
    -
    -
    - Required -
    -
    -
    -
    limit - - -
    -
    -
    - - Integer - - - (int32) - - -
    - The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000] -
    -
    -
    -
    -
    - -

    Responses

    -

    Status: 200 - Success

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 400 - Bad Request

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 404 - Not Found

    - - - -
    -
    - -

    Status: default - Generic error response

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    getFees

    -

    Obtain trading fees information.

    -
    -
    -
    -

    -

    Gets the current trading fees settings. - -**Destination:** Witness node. - -**Rate Limit:** 1 request per IP per second. - -**URL for mainnet:** [https://dex.binance.org/api/v1/fees](https://dex.binance.org/api/v1/fees) - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/fees](https://testnet-dex.binance.org/api/v1/fees) -

    -

    -
    -
    /api/v1/fees
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET\
    --H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/fees"
    -
    -
    -
    import io.swagger.client.*;
    -import io.swagger.client.auth.*;
    -import io.swagger.client.model.*;
    -import io.swagger.client.api.MarketApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class MarketApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        MarketApi apiInstance = new MarketApi();
    -        try {
    -            array[Fee] result = apiInstance.getFees();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling MarketApi#getFees");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import io.swagger.client.api.MarketApi;
    -
    -public class MarketApiExample {
    -
    -    public static void main(String[] args) {
    -        MarketApi apiInstance = new MarketApi();
    -        try {
    -            array[Fee] result = apiInstance.getFees();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling MarketApi#getFees");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -MarketApi *apiInstance = [[MarketApi alloc] init];
    -
    -// Obtain trading fees information.
    -[apiInstance getFeesWithCompletionHandler: 
    -              ^(array[Fee] output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var HttpApi = require('http_api');
    -
    -var api = new HttpApi.MarketApi()
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.getFees(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using IO.Swagger.Api;
    -using IO.Swagger.Client;
    -using IO.Swagger.Model;
    -
    -namespace Example
    -{
    -    public class getFeesExample
    -    {
    -        public void main()
    -        {
    -
    -            var apiInstance = new MarketApi();
    -
    -            try
    -            {
    -                // Obtain trading fees information.
    -                array[Fee] result = apiInstance.getFees();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling MarketApi.getFees: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\ApiMarketApi();
    -
    -try {
    -    $result = $api_instance->getFees();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling MarketApi->getFees: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::MarketApi;
    -
    -my $api_instance = WWW::SwaggerClient::MarketApi->new();
    -
    -eval { 
    -    my $result = $api_instance->getFees();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling MarketApi->getFees: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_client
    -from swagger_client.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_client.MarketApi()
    -
    -try: 
    -    # Obtain trading fees information.
    -    api_response = api_instance.get_fees()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling MarketApi->getFees: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - Success

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: default - Generic error response

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    getPairs

    -

    Get market pairs.

    -
    -
    -
    -

    -

    Gets the list of market pairs that have been listed. - -**Destination:** Witness node. - -**Rate Limit:** 1 request per IP per second. - -**URL for mainnet:** [https://dex.binance.org/api/v1/markets](https://dex.binance.org/api/v1/markets) - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/markets](https://testnet-dex.binance.org/api/v1/markets) -

    -

    -
    -
    /api/v1/markets
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET\
    --H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/markets?limit=&offset="
    -
    -
    -
    import io.swagger.client.*;
    -import io.swagger.client.auth.*;
    -import io.swagger.client.model.*;
    -import io.swagger.client.api.MarketApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class MarketApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        MarketApi apiInstance = new MarketApi();
    -        Integer limit = 56; // Integer | default 500; max 1000.
    -        Integer offset = 56; // Integer | start with 0; default 0.
    -        try {
    -            array[Market] result = apiInstance.getPairs(limit, offset);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling MarketApi#getPairs");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import io.swagger.client.api.MarketApi;
    -
    -public class MarketApiExample {
    -
    -    public static void main(String[] args) {
    -        MarketApi apiInstance = new MarketApi();
    -        Integer limit = 56; // Integer | default 500; max 1000.
    -        Integer offset = 56; // Integer | start with 0; default 0.
    -        try {
    -            array[Market] result = apiInstance.getPairs(limit, offset);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling MarketApi#getPairs");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    Integer *limit = 56; // default 500; max 1000. (optional) (default to 500)
    -Integer *offset = 56; // start with 0; default 0. (optional) (default to 0)
    -
    -MarketApi *apiInstance = [[MarketApi alloc] init];
    -
    -// Get market pairs.
    -[apiInstance getPairsWith:limit
    -    offset:offset
    -              completionHandler: ^(array[Market] output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var HttpApi = require('http_api');
    -
    -var api = new HttpApi.MarketApi()
    -var opts = { 
    -  'limit': 56, // {{Integer}} default 500; max 1000.
    -  'offset': 56 // {{Integer}} start with 0; default 0.
    -};
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.getPairs(opts, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using IO.Swagger.Api;
    -using IO.Swagger.Client;
    -using IO.Swagger.Model;
    -
    -namespace Example
    -{
    -    public class getPairsExample
    -    {
    -        public void main()
    -        {
    -
    -            var apiInstance = new MarketApi();
    -            var limit = 56;  // Integer | default 500; max 1000. (optional)  (default to 500)
    -            var offset = 56;  // Integer | start with 0; default 0. (optional)  (default to 0)
    -
    -            try
    -            {
    -                // Get market pairs.
    -                array[Market] result = apiInstance.getPairs(limit, offset);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling MarketApi.getPairs: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\ApiMarketApi();
    -$limit = 56; // Integer | default 500; max 1000.
    -$offset = 56; // Integer | start with 0; default 0.
    -
    -try {
    -    $result = $api_instance->getPairs($limit, $offset);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling MarketApi->getPairs: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::MarketApi;
    -
    -my $api_instance = WWW::SwaggerClient::MarketApi->new();
    -my $limit = 56; # Integer | default 500; max 1000.
    -my $offset = 56; # Integer | start with 0; default 0.
    -
    -eval { 
    -    my $result = $api_instance->getPairs(limit => $limit, offset => $offset);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling MarketApi->getPairs: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_client
    -from swagger_client.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_client.MarketApi()
    -limit = 56 # Integer | default 500; max 1000. (optional) (default to 500)
    -offset = 56 # Integer | start with 0; default 0. (optional) (default to 0)
    -
    -try: 
    -    # Get market pairs.
    -    api_response = api_instance.get_pairs(limit=limit, offset=offset)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling MarketApi->getPairs: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - -
    Query parameters
    - - - - - - - - - - - -
    NameDescription
    limit - - -
    -
    -
    - - Integer - - - (int32) - - -
    - default 500; max 1000. -
    -
    -
    -
    -
    offset - - -
    -
    -
    - - Integer - - - (int32) - - -
    - start with 0; default 0. -
    -
    -
    -
    -
    - -

    Responses

    -

    Status: 200 - Success

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 400 - Bad Request

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 404 - Not Found

    - - - -
    -
    - -

    Status: default - Generic error response

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -

    Misc

    -
    -
    -
    -

    getTime

    -

    Get the block time.

    -
    -
    -
    -

    -

    Gets the latest block time and the current time according to the HTTP service. - -**Destination:** Validator node. - -**Rate Limit:** 1 request per IP per second. - -**URL for mainnet:** [https://dex.binance.org/api/v1/time](https://dex.binance.org/api/v1/time) - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/time](https://testnet-dex.binance.org/api/v1/time) -

    -

    -
    -
    /api/v1/time
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET\
    --H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/time"
    -
    -
    -
    import io.swagger.client.*;
    -import io.swagger.client.auth.*;
    -import io.swagger.client.model.*;
    -import io.swagger.client.api.MiscApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class MiscApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        MiscApi apiInstance = new MiscApi();
    -        try {
    -            Times result = apiInstance.getTime();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling MiscApi#getTime");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import io.swagger.client.api.MiscApi;
    -
    -public class MiscApiExample {
    -
    -    public static void main(String[] args) {
    -        MiscApi apiInstance = new MiscApi();
    -        try {
    -            Times result = apiInstance.getTime();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling MiscApi#getTime");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -MiscApi *apiInstance = [[MiscApi alloc] init];
    -
    -// Get the block time.
    -[apiInstance getTimeWithCompletionHandler: 
    -              ^(Times output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var HttpApi = require('http_api');
    -
    -var api = new HttpApi.MiscApi()
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.getTime(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using IO.Swagger.Api;
    -using IO.Swagger.Client;
    -using IO.Swagger.Model;
    -
    -namespace Example
    -{
    -    public class getTimeExample
    -    {
    -        public void main()
    -        {
    -
    -            var apiInstance = new MiscApi();
    -
    -            try
    -            {
    -                // Get the block time.
    -                Times result = apiInstance.getTime();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling MiscApi.getTime: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\ApiMiscApi();
    -
    -try {
    -    $result = $api_instance->getTime();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling MiscApi->getTime: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::MiscApi;
    -
    -my $api_instance = WWW::SwaggerClient::MiscApi->new();
    -
    -eval { 
    -    my $result = $api_instance->getTime();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling MiscApi->getTime: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_client
    -from swagger_client.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_client.MiscApi()
    -
    -try: 
    -    # Get the block time.
    -    api_response = api_instance.get_time()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling MiscApi->getTime: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - Success

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 400 - Bad Request

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 404 - Not Found

    - - - -
    -
    - -

    Status: default - Generic error response

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -

    Node

    -
    -
    -
    -

    broadcastTx

    -

    Broadcast a transaction.

    -
    -
    -
    -

    -

    Broadcasts a signed transaction. A single transaction must be sent hex-encoded with a `content-type` of `text/plain`. - -**Destination:** Witness node. - -**Rate Limit:** 5 requests per IP per second. - -**URL for mainnet:** [https://dex.binance.org/api/v1/broadcast](https://dex.binance.org/api/v1/broadcast) - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/broadcast](https://testnet-dex.binance.org/api/v1/broadcast) -

    -

    -
    -
    /api/v1/broadcast
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X POST\
    --H "Accept: application/json"\
    --H "Content-Type: text/plain"\
    -"https://dex.binance.org/api/v1/broadcast?sync="
    -
    -
    -
    import io.swagger.client.*;
    -import io.swagger.client.auth.*;
    -import io.swagger.client.model.*;
    -import io.swagger.client.api.NodeApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class NodeApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        NodeApi apiInstance = new NodeApi();
    -        Object body = ; // Object | 
    -        Boolean sync = true; // Boolean | Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))?
    -
    -        try {
    -            array[Transaction] result = apiInstance.broadcastTx(body, sync);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling NodeApi#broadcastTx");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import io.swagger.client.api.NodeApi;
    -
    -public class NodeApiExample {
    -
    -    public static void main(String[] args) {
    -        NodeApi apiInstance = new NodeApi();
    -        Object body = ; // Object | 
    -        Boolean sync = true; // Boolean | Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))?
    -
    -        try {
    -            array[Transaction] result = apiInstance.broadcastTx(body, sync);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling NodeApi#broadcastTx");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    Object *body = ; // 
    -Boolean *sync = true; // Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))?
    - (optional) (default to false)
    -
    -NodeApi *apiInstance = [[NodeApi alloc] init];
    -
    -// Broadcast a transaction.
    -[apiInstance broadcastTxWith:body
    -    sync:sync
    -              completionHandler: ^(array[Transaction] output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var HttpApi = require('http_api');
    -
    -var api = new HttpApi.NodeApi()
    -var body = ; // {{Object}} 
    -var opts = { 
    -  'sync': true // {{Boolean}} Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))?
    -
    -};
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.broadcastTx(body, opts, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using IO.Swagger.Api;
    -using IO.Swagger.Client;
    -using IO.Swagger.Model;
    -
    -namespace Example
    -{
    -    public class broadcastTxExample
    -    {
    -        public void main()
    -        {
    -
    -            var apiInstance = new NodeApi();
    -            var body = new Object(); // Object | 
    -            var sync = true;  // Boolean | Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))?
    - (optional)  (default to false)
    -
    -            try
    -            {
    -                // Broadcast a transaction.
    -                array[Transaction] result = apiInstance.broadcastTx(body, sync);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling NodeApi.broadcastTx: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\ApiNodeApi();
    -$body = ; // Object | 
    -$sync = true; // Boolean | Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))?
    -
    -
    -try {
    -    $result = $api_instance->broadcastTx($body, $sync);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling NodeApi->broadcastTx: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::NodeApi;
    -
    -my $api_instance = WWW::SwaggerClient::NodeApi->new();
    -my $body = WWW::SwaggerClient::Object::Object->new(); # Object | 
    -my $sync = true; # Boolean | Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))?
    -
    -
    -eval { 
    -    my $result = $api_instance->broadcastTx(body => $body, sync => $sync);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling NodeApi->broadcastTx: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_client
    -from swagger_client.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_client.NodeApi()
    -body =  # Object | 
    -sync = true # Boolean | Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))?
    - (optional) (default to false)
    -
    -try: 
    -    # Broadcast a transaction.
    -    api_response = api_instance.broadcast_tx(body, sync=sync)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling NodeApi->broadcastTx: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - -
    NameDescription
    body * - - - -
    -
    - - -
    Query parameters
    - - - - - - - - -
    NameDescription
    sync - - -
    -
    -
    - - Boolean - - -
    - Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))? - -
    -
    -
    -
    -
    - -

    Responses

    -

    Status: 200 - Success

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 400 - Bad Request

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 401 - Bad Signature

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 404 - Not Found

    - - - -
    -
    - -

    Status: default - Generic error response

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    getAccount

    -

    Get an account.

    -
    -
    -
    -

    -

    Gets account metadata for an address. - -**Destination:** Witness node. - -**Rate Limit:** 5 requests per IP per second. - -**URL for mainnet:** [https://dex.binance.org/api/v1/account/bnb1jxfh2g85q3v0tdq56fnevx6xcxtcnhtsmcu64m](https://dex.binance.org/api/v1/account/bnb1jxfh2g85q3v0tdq56fnevx6xcxtcnhtsmcu64m) - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/account/tbnb185tqzq3j6y7yep85lncaz9qeectjxqe5054cgn](https://testnet-dex.binance.org/api/v1/account/tbnb185tqzq3j6y7yep85lncaz9qeectjxqe5054cgn) -

    -

    -
    -
    /api/v1/account/{address}
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET\
    --H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/account/{address}"
    -
    -
    -
    import io.swagger.client.*;
    -import io.swagger.client.auth.*;
    -import io.swagger.client.model.*;
    -import io.swagger.client.api.NodeApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class NodeApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        NodeApi apiInstance = new NodeApi();
    -        String address = address_example; // String | The account address to query
    -        try {
    -            Account result = apiInstance.getAccount(address);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling NodeApi#getAccount");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import io.swagger.client.api.NodeApi;
    -
    -public class NodeApiExample {
    -
    -    public static void main(String[] args) {
    -        NodeApi apiInstance = new NodeApi();
    -        String address = address_example; // String | The account address to query
    -        try {
    -            Account result = apiInstance.getAccount(address);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling NodeApi#getAccount");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    String *address = address_example; // The account address to query
    -
    -NodeApi *apiInstance = [[NodeApi alloc] init];
    -
    -// Get an account.
    -[apiInstance getAccountWith:address
    -              completionHandler: ^(Account output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var HttpApi = require('http_api');
    -
    -var api = new HttpApi.NodeApi()
    -var address = address_example; // {{String}} The account address to query
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.getAccount(address, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using IO.Swagger.Api;
    -using IO.Swagger.Client;
    -using IO.Swagger.Model;
    -
    -namespace Example
    -{
    -    public class getAccountExample
    -    {
    -        public void main()
    -        {
    -
    -            var apiInstance = new NodeApi();
    -            var address = address_example;  // String | The account address to query
    -
    -            try
    -            {
    -                // Get an account.
    -                Account result = apiInstance.getAccount(address);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling NodeApi.getAccount: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\ApiNodeApi();
    -$address = address_example; // String | The account address to query
    -
    -try {
    -    $result = $api_instance->getAccount($address);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling NodeApi->getAccount: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::NodeApi;
    -
    -my $api_instance = WWW::SwaggerClient::NodeApi->new();
    -my $address = address_example; # String | The account address to query
    -
    -eval { 
    -    my $result = $api_instance->getAccount(address => $address);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling NodeApi->getAccount: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_client
    -from swagger_client.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_client.NodeApi()
    -address = address_example # String | The account address to query
    -
    -try: 
    -    # Get an account.
    -    api_response = api_instance.get_account(address)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling NodeApi->getAccount: %s\n" % e)
    -
    -
    - -

    Parameters

    - -
    Path parameters
    - - - - - - - - -
    NameDescription
    address* - - -
    -
    -
    - - String - - -
    - The account address to query -
    -
    -
    - Required -
    -
    -
    -
    - - - - - -

    Responses

    -

    Status: 200 - Success

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 400 - Bad Request

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 404 - Not Found

    - - - -
    -
    - -

    Status: default - Generic error response

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    getAccountSequence

    -

    Get an account sequence.

    -
    -
    -
    -

    -

    Gets an account sequence for an address. - -**Destination:** Validator node. - -**Rate Limit:** 5 requests per IP per second. - -**URL for mainnet:** [https://dex.binance.org/api/v1/account/bnb1jxfh2g85q3v0tdq56fnevx6xcxtcnhtsmcu64m/sequence](https://dex.binance.org/api/v1/account/bnb1jxfh2g85q3v0tdq56fnevx6xcxtcnhtsmcu64m/sequence) - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/account/tbnb13g2le062t340klgm2l2khzr57y3qxlekuhfuch/sequence](https://testnet-dex.binance.org/api/v1/account/tbnb13g2le062t340klgm2l2khzr57y3qxlekuhfuch/sequence) -

    -

    -
    -
    /api/v1/account/{address}/sequence
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET\
    --H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/account/{address}/sequence"
    -
    -
    -
    import io.swagger.client.*;
    -import io.swagger.client.auth.*;
    -import io.swagger.client.model.*;
    -import io.swagger.client.api.NodeApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class NodeApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        NodeApi apiInstance = new NodeApi();
    -        String address = address_example; // String | The account address to query
    -        try {
    -            AccountSequence result = apiInstance.getAccountSequence(address);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling NodeApi#getAccountSequence");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import io.swagger.client.api.NodeApi;
    -
    -public class NodeApiExample {
    -
    -    public static void main(String[] args) {
    -        NodeApi apiInstance = new NodeApi();
    -        String address = address_example; // String | The account address to query
    -        try {
    -            AccountSequence result = apiInstance.getAccountSequence(address);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling NodeApi#getAccountSequence");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    String *address = address_example; // The account address to query
    -
    -NodeApi *apiInstance = [[NodeApi alloc] init];
    -
    -// Get an account sequence.
    -[apiInstance getAccountSequenceWith:address
    -              completionHandler: ^(AccountSequence output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var HttpApi = require('http_api');
    -
    -var api = new HttpApi.NodeApi()
    -var address = address_example; // {{String}} The account address to query
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.getAccountSequence(address, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using IO.Swagger.Api;
    -using IO.Swagger.Client;
    -using IO.Swagger.Model;
    -
    -namespace Example
    -{
    -    public class getAccountSequenceExample
    -    {
    -        public void main()
    -        {
    -
    -            var apiInstance = new NodeApi();
    -            var address = address_example;  // String | The account address to query
    -
    -            try
    -            {
    -                // Get an account sequence.
    -                AccountSequence result = apiInstance.getAccountSequence(address);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling NodeApi.getAccountSequence: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\ApiNodeApi();
    -$address = address_example; // String | The account address to query
    -
    -try {
    -    $result = $api_instance->getAccountSequence($address);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling NodeApi->getAccountSequence: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::NodeApi;
    -
    -my $api_instance = WWW::SwaggerClient::NodeApi->new();
    -my $address = address_example; # String | The account address to query
    -
    -eval { 
    -    my $result = $api_instance->getAccountSequence(address => $address);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling NodeApi->getAccountSequence: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_client
    -from swagger_client.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_client.NodeApi()
    -address = address_example # String | The account address to query
    -
    -try: 
    -    # Get an account sequence.
    -    api_response = api_instance.get_account_sequence(address)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling NodeApi->getAccountSequence: %s\n" % e)
    -
    -
    - -

    Parameters

    - -
    Path parameters
    - - - - - - - - -
    NameDescription
    address* - - -
    -
    -
    - - String - - -
    - The account address to query -
    -
    -
    - Required -
    -
    -
    -
    - - - - - -

    Responses

    -

    Status: 200 - Success

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 400 - Bad Request

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 404 - Not Found

    - - - -
    -
    - -

    Status: default - Generic error response

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    getNodeInfo

    -

    Get node information.

    -
    -
    -
    -

    -

    Gets runtime information about the node. - -Return block height, current timestamp and the number of connected peers. - -**Destination:** Validator node. - -**Rate Limit:** 1 request per IP per second. - -**URL for mainnet:** [https://dex.binance.org/api/v1/node-info](https://dex.binance.org/api/v1/node-info) - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/node-info](https://testnet-dex.binance.org/api/v1/node-info) -

    -

    -
    -
    /api/v1/node-info
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET\
    --H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/node-info"
    -
    -
    -
    import io.swagger.client.*;
    -import io.swagger.client.auth.*;
    -import io.swagger.client.model.*;
    -import io.swagger.client.api.NodeApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class NodeApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        NodeApi apiInstance = new NodeApi();
    -        try {
    -            ResultStatus result = apiInstance.getNodeInfo();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling NodeApi#getNodeInfo");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    -
    -
    import io.swagger.client.api.NodeApi;
    -
    -public class NodeApiExample {
    -
    -    public static void main(String[] args) {
    -        NodeApi apiInstance = new NodeApi();
    -        try {
    -            ResultStatus result = apiInstance.getNodeInfo();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling NodeApi#getNodeInfo");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -NodeApi *apiInstance = [[NodeApi alloc] init];
    +                          

    Responses

    +

    Status: 200 - Success

    -// Get node information. -[apiInstance getNodeInfoWithCompletionHandler: - ^(ResultStatus output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error: %@", error); - } - }]; -
    -
    + -var api = new HttpApi.NodeApi() -var callback = function(error, data, response) { - if (error) { - console.error(error); - } else { - console.log('API called successfully. Returned data: ' + data); +
    +
    +
    + +
    + +
    -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\ApiNodeApi();
    -
    -try {
    -    $result = $api_instance->getNodeInfo();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling NodeApi->getNodeInfo: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    +

    Status: 400 - Bad Request

    -
    -
    use Data::Dumper;
    -use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::NodeApi;
    +                            
     
    -eval { 
    -    my $result = $api_instance->getNodeInfo();
    -    print Dumper($result);
    +                            
    +
    +
    + +
    + +
    -
    - -

    Parameters

    - - +

    Status: 404 - Not Found

    + +
    +
    -

    Responses

    -

    Status: 200 - Success

    +

    Status: default - Generic error response

    -
    -
    +
    +
    - +

    -
    -
    +
    +
    +

    Node

    +
    +
    -

    getPeers

    -

    Get network peers.

    +

    broadcastTx

    +

    Broadcast a transaction.

    -

    Gets the list of network peers. +

    Broadcasts a signed transaction. A single transaction must be sent hex-encoded with a `content-type` of `text/plain`. **Destination:** Witness node. -**Rate Limit:** 1 request per IP per second. +**Rate Limit:** 5 requests per IP per second. -**URL for mainnet:** [https://dex.binance.org/api/v1/peers](https://dex.binance.org/api/v1/peers) +**URL for mainnet:** [https://dex.binance.org/api/v1/broadcast](https://dex.binance.org/api/v1/broadcast) -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/peers](https://testnet-dex.binance.org/api/v1/peers) +**URL for testnet:** [https://testnet-dex.binance.org/api/v1/broadcast](https://testnet-dex.binance.org/api/v1/broadcast)


    -
    /api/v1/peers
    +
    /api/v1/broadcast

    Usage and SDK Samples

    -
    -
    curl -X GET\
    +                          
    +
    curl -X POST\
     -H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/peers"
    +-H "Content-Type: text/plain"\ +"https://dex.binance.org/api/v1/broadcast?sync="
    -
    +
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    @@ -9606,45 +5826,55 @@ 

    Usage and SDK Samples

    public static void main(String[] args) { NodeApi apiInstance = new NodeApi(); + Object body = ; // Object | + Boolean sync = true; // Boolean | Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))? + try { - array[Peer] result = apiInstance.getPeers(); + array[Transaction] result = apiInstance.broadcastTx(body, sync); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling NodeApi#getPeers"); + System.err.println("Exception when calling NodeApi#broadcastTx"); e.printStackTrace(); } } }
    -
    +
    import io.swagger.client.api.NodeApi;
     
     public class NodeApiExample {
     
         public static void main(String[] args) {
             NodeApi apiInstance = new NodeApi();
    +        Object body = ; // Object | 
    +        Boolean sync = true; // Boolean | Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))?
    +
             try {
    -            array[Peer] result = apiInstance.getPeers();
    +            array[Transaction] result = apiInstance.broadcastTx(body, sync);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling NodeApi#getPeers");
    +            System.err.println("Exception when calling NodeApi#broadcastTx");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    
    +                            
    +
    Object *body = ; // 
    +Boolean *sync = true; // Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))?
    + (optional) (default to false)
    +
     NodeApi *apiInstance = [[NodeApi alloc] init];
     
    -// Get network peers.
    -[apiInstance getPeersWithCompletionHandler: 
    -              ^(array[Peer] output, NSError* error) {
    +// Broadcast a transaction.
    +[apiInstance broadcastTxWith:body
    +    sync:sync
    +              completionHandler: ^(array[Transaction] output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -9655,10 +5885,15 @@ 

    Usage and SDK Samples

    -
    +
    var HttpApi = require('http_api');
     
     var api = new HttpApi.NodeApi()
    +var body = ; // {{Object}} 
    +var opts = { 
    +  'sync': true // {{Boolean}} Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))?
    +
    +};
     var callback = function(error, data, response) {
       if (error) {
         console.error(error);
    @@ -9666,14 +5901,14 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.getPeers(callback); +api.broadcastTx(body, opts, callback);
    - -
    +
    using System;
     using System.Diagnostics;
     using IO.Swagger.Api;
    @@ -9682,22 +5917,25 @@ 

    Usage and SDK Samples

    namespace Example { - public class getPeersExample + public class broadcastTxExample { public void main() { var apiInstance = new NodeApi(); + var body = new Object(); // Object | + var sync = true; // Boolean | Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))? + (optional) (default to false) try { - // Get network peers. - array[Peer] result = apiInstance.getPeers(); + // Broadcast a transaction. + array[Transaction] result = apiInstance.broadcastTx(body, sync); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling NodeApi.getPeers: " + e.Message ); + Debug.Print("Exception when calling NodeApi.broadcastTx: " + e.Message ); } } } @@ -9705,38 +5943,44 @@

    Usage and SDK Samples

    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\ApiNodeApi();
    +$body = ; // Object | 
    +$sync = true; // Boolean | Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))?
    +
     
     try {
    -    $result = $api_instance->getPeers();
    +    $result = $api_instance->broadcastTx($body, $sync);
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling NodeApi->getPeers: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling NodeApi->broadcastTx: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use WWW::SwaggerClient::Configuration;
     use WWW::SwaggerClient::NodeApi;
     
     my $api_instance = WWW::SwaggerClient::NodeApi->new();
    +my $body = WWW::SwaggerClient::Object::Object->new(); # Object | 
    +my $sync = true; # Boolean | Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))?
    +
     
     eval { 
    -    my $result = $api_instance->getPeers();
    +    my $result = $api_instance->broadcastTx(body => $body, sync => $sync);
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling NodeApi->getPeers: $@\n";
    +    warn "Exception when calling NodeApi->broadcastTx: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_client
    @@ -9745,48 +5989,172 @@ 

    Usage and SDK Samples

    # create an instance of the API class api_instance = swagger_client.NodeApi() +body = # Object | +sync = true # Boolean | Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))? + (optional) (default to false) try: - # Get network peers. - api_response = api_instance.get_peers() + # Broadcast a transaction. + api_response = api_instance.broadcast_tx(body, sync=sync) pprint(api_response) except ApiException as e: - print("Exception when calling NodeApi->getPeers: %s\n" % e)
    + print("Exception when calling NodeApi->broadcastTx: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + +
    Query parameters
    + + + + + + + + +
    NameDescription
    sync + + +
    +
    +
    + + Boolean + + +
    + Synchronous broadcast (wait for [DeliverTx](https://github.com/tendermint/tendermint/wiki/Application-Developers#delivertx))? + +
    +
    +
    +
    +
    + +

    Responses

    +

    Status: 200 - Success

    + + + +
    +
    +
    + +
    + +
    -
    - -

    Parameters

    - - - - - -

    Responses

    -

    Status: 200 - Success

    +

    Status: 400 - Bad Request

    -
    -
    +
    +
    - +
    -

    Status: 400 - Bad Request

    +

    Status: 401 - Bad Signature

    -
    -
    +
    +
    - +
    @@ -9875,14 +6243,14 @@

    Status: default - Generic error response

    -
    -
    +
    +
    - +

    -
    -
    +
    +
    -

    getTimeLocks

    -

    Gets time lock records given an address

    +

    getAccount

    +

    Get an account.

    -

    +

    Gets account metadata for an address. + +**Destination:** Witness node. + +**Rate Limit:** 5 requests per IP per second. + +**URL for mainnet:** [https://dex.binance.org/api/v1/account/bnb1jxfh2g85q3v0tdq56fnevx6xcxtcnhtsmcu64m](https://dex.binance.org/api/v1/account/bnb1jxfh2g85q3v0tdq56fnevx6xcxtcnhtsmcu64m) + +**URL for testnet:** [https://testnet-dex.binance.org/api/v1/account/tbnb185tqzq3j6y7yep85lncaz9qeectjxqe5054cgn](https://testnet-dex.binance.org/api/v1/account/tbnb185tqzq3j6y7yep85lncaz9qeectjxqe5054cgn) +


    -
    /api/v1/timelocks/{address}
    +
    /api/v1/account/{address}

    Usage and SDK Samples

    -
    +
    curl -X GET\
     -H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/timelocks/{address}?id="
    +"https://dex.binance.org/api/v1/account/{address}"
    -
    +
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    @@ -9973,19 +6350,18 @@ 

    Usage and SDK Samples

    NodeApi apiInstance = new NodeApi(); String address = address_example; // String | The account address to query - Long id = 789; // Long | the record id of timelock to query try { - TimeLocks result = apiInstance.getTimeLocks(address, id); + Account result = apiInstance.getAccount(address); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling NodeApi#getTimeLocks"); + System.err.println("Exception when calling NodeApi#getAccount"); e.printStackTrace(); } } }
    -
    +
    import io.swagger.client.api.NodeApi;
     
     public class NodeApiExample {
    @@ -9993,31 +6369,28 @@ 

    Usage and SDK Samples

    public static void main(String[] args) { NodeApi apiInstance = new NodeApi(); String address = address_example; // String | The account address to query - Long id = 789; // Long | the record id of timelock to query try { - TimeLocks result = apiInstance.getTimeLocks(address, id); + Account result = apiInstance.getAccount(address); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling NodeApi#getTimeLocks"); + System.err.println("Exception when calling NodeApi#getAccount"); e.printStackTrace(); } } }
    -
    +
    String *address = address_example; // The account address to query
    -Long *id = 789; // the record id of timelock to query (optional)
     
     NodeApi *apiInstance = [[NodeApi alloc] init];
     
    -// Gets time lock records given an address
    -[apiInstance getTimeLocksWith:address
    -    id:id
    -              completionHandler: ^(TimeLocks output, NSError* error) {
    +// Get an account.
    +[apiInstance getAccountWith:address
    +              completionHandler: ^(Account output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -10028,14 +6401,12 @@ 

    Usage and SDK Samples

    -
    +
    var HttpApi = require('http_api');
     
     var api = new HttpApi.NodeApi()
     var address = address_example; // {{String}} The account address to query
    -var opts = { 
    -  'id': 789 // {{Long}} the record id of timelock to query
    -};
    +
     var callback = function(error, data, response) {
       if (error) {
         console.error(error);
    @@ -10043,14 +6414,14 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.getTimeLocks(address, opts, callback); +api.getAccount(address, callback);
    - -
    +
    using System;
     using System.Diagnostics;
     using IO.Swagger.Api;
    @@ -10059,24 +6430,23 @@ 

    Usage and SDK Samples

    namespace Example { - public class getTimeLocksExample + public class getAccountExample { public void main() { var apiInstance = new NodeApi(); var address = address_example; // String | The account address to query - var id = 789; // Long | the record id of timelock to query (optional) try { - // Gets time lock records given an address - TimeLocks result = apiInstance.getTimeLocks(address, id); + // Get an account. + Account result = apiInstance.getAccount(address); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling NodeApi.getTimeLocks: " + e.Message ); + Debug.Print("Exception when calling NodeApi.getAccount: " + e.Message ); } } } @@ -10084,42 +6454,40 @@

    Usage and SDK Samples

    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\ApiNodeApi();
     $address = address_example; // String | The account address to query
    -$id = 789; // Long | the record id of timelock to query
     
     try {
    -    $result = $api_instance->getTimeLocks($address, $id);
    +    $result = $api_instance->getAccount($address);
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling NodeApi->getTimeLocks: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling NodeApi->getAccount: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use WWW::SwaggerClient::Configuration;
     use WWW::SwaggerClient::NodeApi;
     
     my $api_instance = WWW::SwaggerClient::NodeApi->new();
     my $address = address_example; # String | The account address to query
    -my $id = 789; # Long | the record id of timelock to query
     
     eval { 
    -    my $result = $api_instance->getTimeLocks(address => $address, id => $id);
    +    my $result = $api_instance->getAccount(address => $address);
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling NodeApi->getTimeLocks: $@\n";
    +    warn "Exception when calling NodeApi->getAccount: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_client
    @@ -10129,14 +6497,13 @@ 

    Usage and SDK Samples

    # create an instance of the API class api_instance = swagger_client.NodeApi() address = address_example # String | The account address to query -id = 789 # Long | the record id of timelock to query (optional) try: - # Gets time lock records given an address - api_response = api_instance.get_time_locks(address, id=id) + # Get an account. + api_response = api_instance.get_account(address) pprint(api_response) except ApiException as e: - print("Exception when calling NodeApi->getTimeLocks: %s\n" % e)
    + print("Exception when calling NodeApi->getAccount: %s\n" % e)
    @@ -10152,7 +6519,7 @@

    Parameters

    -
    +
    @@ -10175,49 +6542,20 @@

    Parameters

    -
    Query parameters
    - - - - - - - - -
    NameDescription
    id - - -
    -
    -
    - - Long - - - (int64) - - -
    - the record id of timelock to query -
    -
    -
    -
    -

    Responses

    Status: 200 - Success

    -
    -
    +
    +
    - +
    @@ -10258,14 +6596,14 @@

    Status: 400 - Bad Request

    -
    -
    +
    +
    - +
    -

    Status: 500 - internal server error

    +

    Status: 404 - Not Found

    + + + +
    +
    + +

    Status: default - Generic error response

    -
    -
    +
    +
    - +

    -
    -
    +
    +
    -

    getTransaction

    -

    Get a transaction.

    +

    getAccountSequence

    +

    Get an account sequence.

    -

    Gets transaction metadata by transaction ID. By default, transactions are returned in a raw format. You may add `?format=json` to the end of the path to obtain a more readable response. - -**Destination:** Seed node. - -**Rate Limit:** 10 requests per IP per second. - -**Example:** - -Below is an example response of a send transaction when `?format=json` is used. -``` - { - code:0, - hash:"433806D6A4AB6359CB56EC55BA99896DFAB2AF11326B74881A2ABA7049C492D3", - height:"7850389", - log:"Msg 0: ", - ok:true, - tx:{ - type:"auth/StdTx", - value:{ - data:null, - memo:"101192150", - msg:[ - { - type:"cosmos-sdk/Send", - value:{ - inputs:[ - { - address:"bnb1jafs33u9u6f7w7wzfmm4rr9rzy2cgqzp78kwaw", - coins:[ - { - amount:"496429373", - denom:"BNB", - - } - ], - - } - ], - outputs:[ - { - address:"bnb136ns6lfw4zs5hg4n85vdthaad7hq5m4gtkgf23", - coins:[ - { - amount:"496429373", - denom:"BNB", - - } - ], - - } - ], - - }, - - } - ], - signatures:[ - { - account_number:"438", - pub_key:{ - type:"tendermint/PubKeySecp256k1", - value:"A3mfgg/i12XNyy9esqCjI7yrkrOs9dngP7c9cDUEJly5", - - }, - sequence:"0", - signature:"VvvGz3qbyirJ7vv01Df8tuAd7K4I+HK+yEBfep+qwtMKuHWQQH3XtMB9Pqtc2jlia0AtDe+BUEMtIyh3/N66IQ==", +

    Gets an account sequence for an address. - } - ], - source:"1", +**Destination:** Validator node. - }, +**Rate Limit:** 5 requests per IP per second. - }, +**URL for mainnet:** [https://dex.binance.org/api/v1/account/bnb1jxfh2g85q3v0tdq56fnevx6xcxtcnhtsmcu64m/sequence](https://dex.binance.org/api/v1/account/bnb1jxfh2g85q3v0tdq56fnevx6xcxtcnhtsmcu64m/sequence) - } -``` +**URL for testnet:** [https://testnet-dex.binance.org/api/v1/account/tbnb13g2le062t340klgm2l2khzr57y3qxlekuhfuch/sequence](https://testnet-dex.binance.org/api/v1/account/tbnb13g2le062t340klgm2l2khzr57y3qxlekuhfuch/sequence)


    -
    /api/v1/tx/{hash}
    +
    /api/v1/account/{address}/sequence

    Usage and SDK Samples

    -
    +
    curl -X GET\
     -H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/tx/{hash}?format="
    +"https://dex.binance.org/api/v1/account/{address}/sequence"
    -
    +
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    @@ -10480,52 +6758,48 @@ 

    Usage and SDK Samples

    public static void main(String[] args) { NodeApi apiInstance = new NodeApi(); - String hash = hash_example; // String | The transaction hash to query - String format = format_example; // String | Response format (`json` or amino) + String address = address_example; // String | The account address to query try { - Transaction result = apiInstance.getTransaction(hash, format); + AccountSequence result = apiInstance.getAccountSequence(address); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling NodeApi#getTransaction"); + System.err.println("Exception when calling NodeApi#getAccountSequence"); e.printStackTrace(); } } }
    -
    +
    import io.swagger.client.api.NodeApi;
     
     public class NodeApiExample {
     
         public static void main(String[] args) {
             NodeApi apiInstance = new NodeApi();
    -        String hash = hash_example; // String | The transaction hash to query
    -        String format = format_example; // String | Response format (`json` or amino)
    +        String address = address_example; // String | The account address to query
             try {
    -            Transaction result = apiInstance.getTransaction(hash, format);
    +            AccountSequence result = apiInstance.getAccountSequence(address);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling NodeApi#getTransaction");
    +            System.err.println("Exception when calling NodeApi#getAccountSequence");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    String *hash = hash_example; // The transaction hash to query
    -String *format = format_example; // Response format (`json` or amino) (optional)
    +                            
    +
    String *address = address_example; // The account address to query
     
     NodeApi *apiInstance = [[NodeApi alloc] init];
     
    -// Get a transaction.
    -[apiInstance getTransactionWith:hash
    -    format:format
    -              completionHandler: ^(Transaction output, NSError* error) {
    +// Get an account sequence.
    +[apiInstance getAccountSequenceWith:address
    +              completionHandler: ^(AccountSequence output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -10536,14 +6810,12 @@ 

    Usage and SDK Samples

    -
    +
    var HttpApi = require('http_api');
     
     var api = new HttpApi.NodeApi()
    -var hash = hash_example; // {{String}} The transaction hash to query
    -var opts = { 
    -  'format': format_example // {{String}} Response format (`json` or amino)
    -};
    +var address = address_example; // {{String}} The account address to query
    +
     var callback = function(error, data, response) {
       if (error) {
         console.error(error);
    @@ -10551,14 +6823,14 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.getTransaction(hash, opts, callback); +api.getAccountSequence(address, callback);
    - -
    +
    using System;
     using System.Diagnostics;
     using IO.Swagger.Api;
    @@ -10567,24 +6839,23 @@ 

    Usage and SDK Samples

    namespace Example { - public class getTransactionExample + public class getAccountSequenceExample { public void main() { var apiInstance = new NodeApi(); - var hash = hash_example; // String | The transaction hash to query - var format = format_example; // String | Response format (`json` or amino) (optional) + var address = address_example; // String | The account address to query try { - // Get a transaction. - Transaction result = apiInstance.getTransaction(hash, format); + // Get an account sequence. + AccountSequence result = apiInstance.getAccountSequence(address); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling NodeApi.getTransaction: " + e.Message ); + Debug.Print("Exception when calling NodeApi.getAccountSequence: " + e.Message ); } } } @@ -10592,42 +6863,40 @@

    Usage and SDK Samples

    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\ApiNodeApi();
    -$hash = hash_example; // String | The transaction hash to query
    -$format = format_example; // String | Response format (`json` or amino)
    +$address = address_example; // String | The account address to query
     
     try {
    -    $result = $api_instance->getTransaction($hash, $format);
    +    $result = $api_instance->getAccountSequence($address);
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling NodeApi->getTransaction: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling NodeApi->getAccountSequence: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use WWW::SwaggerClient::Configuration;
     use WWW::SwaggerClient::NodeApi;
     
     my $api_instance = WWW::SwaggerClient::NodeApi->new();
    -my $hash = hash_example; # String | The transaction hash to query
    -my $format = format_example; # String | Response format (`json` or amino)
    +my $address = address_example; # String | The account address to query
     
     eval { 
    -    my $result = $api_instance->getTransaction(hash => $hash, format => $format);
    +    my $result = $api_instance->getAccountSequence(address => $address);
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling NodeApi->getTransaction: $@\n";
    +    warn "Exception when calling NodeApi->getAccountSequence: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_client
    @@ -10636,15 +6905,14 @@ 

    Usage and SDK Samples

    # create an instance of the API class api_instance = swagger_client.NodeApi() -hash = hash_example # String | The transaction hash to query -format = format_example # String | Response format (`json` or amino) (optional) +address = address_example # String | The account address to query try: - # Get a transaction. - api_response = api_instance.get_transaction(hash, format=format) + # Get an account sequence. + api_response = api_instance.get_account_sequence(address) pprint(api_response) except ApiException as e: - print("Exception when calling NodeApi->getTransaction: %s\n" % e)
    + print("Exception when calling NodeApi->getAccountSequence: %s\n" % e)
    @@ -10656,11 +6924,11 @@

    Parameters

    Name Description - hash* + address* -
    +
    @@ -10668,7 +6936,7 @@

    Parameters

    - The transaction hash to query + The account address to query
    @@ -10683,46 +6951,20 @@

    Parameters

    -
    Query parameters
    - - - - - - - - -
    NameDescription
    format - - -
    -
    -
    - - String - - -
    - Response format (`json` or amino) -
    -
    -
    -
    -

    Responses

    Status: 200 - Success

    -
    -
    +
    +
    - -
    -
    - -

    Status: 404 - Not Found

    - - - -
    + +
    -

    Status: 500 - Bad Request

    +

    Status: 400 - Bad Request

    -
    -
    +
    +
    - +
    +

    Status: 404 - Not Found

    + + + +
    +
    +

    Status: default - Generic error response

    -
    -
    +
    +
    - +

    -
    -
    +
    +
    -

    getValidators

    -

    Get validators.

    +

    getNodeInfo

    +

    Get node information.

    -

    Gets the list of validators used in consensus. +

    Gets runtime information about the node. -**Destination:** Witness node. +Return block height, current timestamp and the number of connected peers. -**Rate Limit:** 10 requests per IP per second. +**Destination:** Validator node. -**URL for mainnet:** [https://dex.binance.org/api/v1/validators](https://dex.binance.org/api/v1/validators) +**Rate Limit:** 1 request per IP per second. -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/validators](https://testnet-dex.binance.org/api/v1/validators) +**URL for mainnet:** [https://dex.binance.org/api/v1/node-info](https://dex.binance.org/api/v1/node-info) + +**URL for testnet:** [https://testnet-dex.binance.org/api/v1/node-info](https://testnet-dex.binance.org/api/v1/node-info)


    -
    /api/v1/validators
    +
    /api/v1/node-info

    Usage and SDK Samples

    -
    +
    curl -X GET\
     -H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/validators"
    +"https://dex.binance.org/api/v1/node-info"
    -
    +
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    @@ -10926,17 +7170,17 @@ 

    Usage and SDK Samples

    NodeApi apiInstance = new NodeApi(); try { - array[Validators] result = apiInstance.getValidators(); + ResultStatus result = apiInstance.getNodeInfo(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling NodeApi#getValidators"); + System.err.println("Exception when calling NodeApi#getNodeInfo"); e.printStackTrace(); } } }
    -
    +
    import io.swagger.client.api.NodeApi;
     
     public class NodeApiExample {
    @@ -10944,26 +7188,26 @@ 

    Usage and SDK Samples

    public static void main(String[] args) { NodeApi apiInstance = new NodeApi(); try { - array[Validators] result = apiInstance.getValidators(); + ResultStatus result = apiInstance.getNodeInfo(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling NodeApi#getValidators"); + System.err.println("Exception when calling NodeApi#getNodeInfo"); e.printStackTrace(); } } }
    -
    +
    
     NodeApi *apiInstance = [[NodeApi alloc] init];
     
    -// Get validators.
    -[apiInstance getValidatorsWithCompletionHandler: 
    -              ^(array[Validators] output, NSError* error) {
    +// Get node information.
    +[apiInstance getNodeInfoWithCompletionHandler: 
    +              ^(ResultStatus output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -10974,7 +7218,7 @@ 

    Usage and SDK Samples

    -
    +
    var HttpApi = require('http_api');
     
     var api = new HttpApi.NodeApi()
    @@ -10985,14 +7229,14 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.getValidators(callback); +api.getNodeInfo(callback);
    - -
    +
    using System;
     using System.Diagnostics;
     using IO.Swagger.Api;
    @@ -11001,7 +7245,7 @@ 

    Usage and SDK Samples

    namespace Example { - public class getValidatorsExample + public class getNodeInfoExample { public void main() { @@ -11010,13 +7254,13 @@

    Usage and SDK Samples

    try { - // Get validators. - array[Validators] result = apiInstance.getValidators(); + // Get node information. + ResultStatus result = apiInstance.getNodeInfo(); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling NodeApi.getValidators: " + e.Message ); + Debug.Print("Exception when calling NodeApi.getNodeInfo: " + e.Message ); } } } @@ -11024,22 +7268,22 @@

    Usage and SDK Samples

    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\ApiNodeApi();
     
     try {
    -    $result = $api_instance->getValidators();
    +    $result = $api_instance->getNodeInfo();
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling NodeApi->getValidators: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling NodeApi->getNodeInfo: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use WWW::SwaggerClient::Configuration;
     use WWW::SwaggerClient::NodeApi;
    @@ -11047,15 +7291,15 @@ 

    Usage and SDK Samples

    my $api_instance = WWW::SwaggerClient::NodeApi->new(); eval { - my $result = $api_instance->getValidators(); + my $result = $api_instance->getNodeInfo(); print Dumper($result); }; if ($@) { - warn "Exception when calling NodeApi->getValidators: $@\n"; + warn "Exception when calling NodeApi->getNodeInfo: $@\n"; }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_client
    @@ -11066,11 +7310,11 @@ 

    Usage and SDK Samples

    api_instance = swagger_client.NodeApi() try: - # Get validators. - api_response = api_instance.get_validators() + # Get node information. + api_response = api_instance.get_node_info() pprint(api_response) except ApiException as e: - print("Exception when calling NodeApi->getValidators: %s\n" % e)
    + print("Exception when calling NodeApi->getNodeInfo: %s\n" % e)
    @@ -11086,14 +7330,14 @@

    Status: 200 - Success

    -
    -
    +
    +
    -
    - -
    -
    - -

    Status: 400 - Bad Request

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 404 - Not Found

    - - - -
    -
    - -

    Status: default - Generic error response

    - - - -
    -
    -
    -
    - +

    -
    -
    -

    Order

    -
    -
    +
    +
    -

    getClosedOrders

    -

    Get closed orders.

    +

    getPeers

    +

    Get network peers.

    -

    Gets closed (filled and cancelled) orders for a given address. +

    Gets the list of network peers. -**Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. +**Destination:** Witness node. -**Rate Limit:** 5 requests per IP per second. +**Rate Limit:** 1 request per IP per second. + +**URL for mainnet:** [https://dex.binance.org/api/v1/peers](https://dex.binance.org/api/v1/peers) + +**URL for testnet:** [https://testnet-dex.binance.org/api/v1/peers](https://testnet-dex.binance.org/api/v1/peers)


    -
    /api/v1/orders/closed
    +
    /api/v1/peers

    Usage and SDK Samples

    -
    +
    curl -X GET\
     -H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/orders/closed?address=&end=&limit=&offset=&side=&start=&status=&symbol=&total="
    +"https://dex.binance.org/api/v1/peers"
    -
    +
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import io.swagger.client.api.OrderApi;
    +import io.swagger.client.api.NodeApi;
     
     import java.io.File;
     import java.util.*;
     
    -public class OrderApiExample {
    +public class NodeApiExample {
     
         public static void main(String[] args) {
             
    -        OrderApi apiInstance = new OrderApi();
    -        String address = address_example; // String | the owner address
    -        Long end = 789; // Long | end time in Milliseconds
    -        Integer limit = 56; // Integer | default 500; max 1000.
    -        Integer offset = 56; // Integer | start with 0; default 0.
    -        Integer side = 56; // Integer | order side. 1 for buy and 2 for sell.
    -        Long start = 789; // Long | start time in Milliseconds
    -        String status = status_example; // String | order status list. 
    -Allowed value: [Ack, IocExpire, IocNoFill,
    -FullyFill, Canceled, Expired, FailedBlocking, FailedMatching]
    -
    -        String symbol = symbol_example; // String | symbol
    -        Integer total = 56; // Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
    +        NodeApi apiInstance = new NodeApi();
             try {
    -            OrderList result = apiInstance.getClosedOrders(address, end, limit, offset, side, start, status, symbol, total);
    +            array[Peer] result = apiInstance.getPeers();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling OrderApi#getClosedOrders");
    +            System.err.println("Exception when calling NodeApi#getPeers");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    import io.swagger.client.api.OrderApi;
    +                          
    +
    import io.swagger.client.api.NodeApi;
     
    -public class OrderApiExample {
    +public class NodeApiExample {
     
         public static void main(String[] args) {
    -        OrderApi apiInstance = new OrderApi();
    -        String address = address_example; // String | the owner address
    -        Long end = 789; // Long | end time in Milliseconds
    -        Integer limit = 56; // Integer | default 500; max 1000.
    -        Integer offset = 56; // Integer | start with 0; default 0.
    -        Integer side = 56; // Integer | order side. 1 for buy and 2 for sell.
    -        Long start = 789; // Long | start time in Milliseconds
    -        String status = status_example; // String | order status list. 
    -Allowed value: [Ack, IocExpire, IocNoFill,
    -FullyFill, Canceled, Expired, FailedBlocking, FailedMatching]
    -
    -        String symbol = symbol_example; // String | symbol
    -        Integer total = 56; // Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
    +        NodeApi apiInstance = new NodeApi();
             try {
    -            OrderList result = apiInstance.getClosedOrders(address, end, limit, offset, side, start, status, symbol, total);
    +            array[Peer] result = apiInstance.getPeers();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling OrderApi#getClosedOrders");
    +            System.err.println("Exception when calling NodeApi#getPeers");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    String *address = address_example; // the owner address
    -Long *end = 789; // end time in Milliseconds (optional)
    -Integer *limit = 56; // default 500; max 1000. (optional) (default to 500)
    -Integer *offset = 56; // start with 0; default 0. (optional) (default to 0)
    -Integer *side = 56; // order side. 1 for buy and 2 for sell. (optional)
    -Long *start = 789; // start time in Milliseconds (optional)
    -String *status = status_example; // order status list. 
    -Allowed value: [Ack, IocExpire, IocNoFill,
    -FullyFill, Canceled, Expired, FailedBlocking, FailedMatching]
    - (optional)
    -String *symbol = symbol_example; // symbol (optional)
    -Integer *total = 56; // total number required, 0 for not required and 1 for required; default not required, return total=-1 in response (optional)
    -
    -OrderApi *apiInstance = [[OrderApi alloc] init];
    +                            
    +
    
    +NodeApi *apiInstance = [[NodeApi alloc] init];
     
    -// Get closed orders.
    -[apiInstance getClosedOrdersWith:address
    -    end:end
    -    limit:limit
    -    offset:offset
    -    side:side
    -    start:start
    -    status:status
    -    symbol:symbol
    -    total:total
    -              completionHandler: ^(OrderList output, NSError* error) {
    +// Get network peers.
    +[apiInstance getPeersWithCompletionHandler: 
    +              ^(array[Peer] output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -11392,24 +7485,10 @@ 

    Usage and SDK Samples

    -
    +
    var HttpApi = require('http_api');
     
    -var api = new HttpApi.OrderApi()
    -var address = address_example; // {{String}} the owner address
    -var opts = { 
    -  'end': 789, // {{Long}} end time in Milliseconds
    -  'limit': 56, // {{Integer}} default 500; max 1000.
    -  'offset': 56, // {{Integer}} start with 0; default 0.
    -  'side': 56, // {{Integer}} order side. 1 for buy and 2 for sell.
    -  'start': 789, // {{Long}} start time in Milliseconds
    -  'status': status_example, // {{String}} order status list. 
    -Allowed value: [Ack, IocExpire, IocNoFill,
    -FullyFill, Canceled, Expired, FailedBlocking, FailedMatching]
    -
    -  'symbol': symbol_example, // {{String}} symbol
    -  'total': 56 // {{Integer}} total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
    -};
    +var api = new HttpApi.NodeApi()
     var callback = function(error, data, response) {
       if (error) {
         console.error(error);
    @@ -11417,14 +7496,14 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.getClosedOrders(address, opts, callback); +api.getPeers(callback);
    - -
    +
    using System;
     using System.Diagnostics;
     using IO.Swagger.Api;
    @@ -11433,34 +7512,22 @@ 

    Usage and SDK Samples

    namespace Example { - public class getClosedOrdersExample + public class getPeersExample { public void main() { - var apiInstance = new OrderApi(); - var address = address_example; // String | the owner address - var end = 789; // Long | end time in Milliseconds (optional) - var limit = 56; // Integer | default 500; max 1000. (optional) (default to 500) - var offset = 56; // Integer | start with 0; default 0. (optional) (default to 0) - var side = 56; // Integer | order side. 1 for buy and 2 for sell. (optional) - var start = 789; // Long | start time in Milliseconds (optional) - var status = status_example; // String | order status list. -Allowed value: [Ack, IocExpire, IocNoFill, -FullyFill, Canceled, Expired, FailedBlocking, FailedMatching] - (optional) - var symbol = symbol_example; // String | symbol (optional) - var total = 56; // Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response (optional) + var apiInstance = new NodeApi(); try { - // Get closed orders. - OrderList result = apiInstance.getClosedOrders(address, end, limit, offset, side, start, status, symbol, total); + // Get network peers. + array[Peer] result = apiInstance.getPeers(); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling OrderApi.getClosedOrders: " + e.Message ); + Debug.Print("Exception when calling NodeApi.getPeers: " + e.Message ); } } } @@ -11468,62 +7535,38 @@

    Usage and SDK Samples

    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new Swagger\Client\ApiOrderApi();
    -$address = address_example; // String | the owner address
    -$end = 789; // Long | end time in Milliseconds
    -$limit = 56; // Integer | default 500; max 1000.
    -$offset = 56; // Integer | start with 0; default 0.
    -$side = 56; // Integer | order side. 1 for buy and 2 for sell.
    -$start = 789; // Long | start time in Milliseconds
    -$status = status_example; // String | order status list. 
    -Allowed value: [Ack, IocExpire, IocNoFill,
    -FullyFill, Canceled, Expired, FailedBlocking, FailedMatching]
    -
    -$symbol = symbol_example; // String | symbol
    -$total = 56; // Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
    +$api_instance = new Swagger\Client\ApiNodeApi();
     
     try {
    -    $result = $api_instance->getClosedOrders($address, $end, $limit, $offset, $side, $start, $status, $symbol, $total);
    +    $result = $api_instance->getPeers();
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling OrderApi->getClosedOrders: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling NodeApi->getPeers: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::OrderApi;
    -
    -my $api_instance = WWW::SwaggerClient::OrderApi->new();
    -my $address = address_example; # String | the owner address
    -my $end = 789; # Long | end time in Milliseconds
    -my $limit = 56; # Integer | default 500; max 1000.
    -my $offset = 56; # Integer | start with 0; default 0.
    -my $side = 56; # Integer | order side. 1 for buy and 2 for sell.
    -my $start = 789; # Long | start time in Milliseconds
    -my $status = status_example; # String | order status list. 
    -Allowed value: [Ack, IocExpire, IocNoFill,
    -FullyFill, Canceled, Expired, FailedBlocking, FailedMatching]
    +use WWW::SwaggerClient::NodeApi;
     
    -my $symbol = symbol_example; # String | symbol
    -my $total = 56; # Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
    +my $api_instance = WWW::SwaggerClient::NodeApi->new();
     
     eval { 
    -    my $result = $api_instance->getClosedOrders(address => $address, end => $end, limit => $limit, offset => $offset, side => $side, start => $start, status => $status, symbol => $symbol, total => $total);
    +    my $result = $api_instance->getPeers();
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling OrderApi->getClosedOrders: $@\n";
    +    warn "Exception when calling NodeApi->getPeers: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_client
    @@ -11531,259 +7574,153 @@ 

    Usage and SDK Samples

    from pprint import pprint # create an instance of the API class -api_instance = swagger_client.OrderApi() -address = address_example # String | the owner address -end = 789 # Long | end time in Milliseconds (optional) -limit = 56 # Integer | default 500; max 1000. (optional) (default to 500) -offset = 56 # Integer | start with 0; default 0. (optional) (default to 0) -side = 56 # Integer | order side. 1 for buy and 2 for sell. (optional) -start = 789 # Long | start time in Milliseconds (optional) -status = status_example # String | order status list. -Allowed value: [Ack, IocExpire, IocNoFill, -FullyFill, Canceled, Expired, FailedBlocking, FailedMatching] - (optional) -symbol = symbol_example # String | symbol (optional) -total = 56 # Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response (optional) - -try: - # Get closed orders. - api_response = api_instance.get_closed_orders(address, end=end, limit=limit, offset=offset, side=side, start=start, status=status, symbol=symbol, total=total) - pprint(api_response) -except ApiException as e: - print("Exception when calling OrderApi->getClosedOrders: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - -
    Query parameters
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescription
    address* - - -
    -
    -
    - - String - - -
    - the owner address -
    -
    -
    - Required -
    -
    -
    -
    end - - -
    -
    -
    - - Long - - - (int64) - - -
    - end time in Milliseconds -
    -
    -
    -
    -
    limit - - -
    -
    -
    - - Integer - - - (int32) - - -
    - default 500; max 1000. -
    -
    -
    -
    -
    offset - - -
    -
    -
    - - Integer - - - (int32) - - -
    - start with 0; default 0. -
    -
    -
    -
    -
    side - - -
    -
    -
    - - Integer - - - (int32) - - -
    - order side. 1 for buy and 2 for sell. -
    -
    -
    -
    -
    start - - -
    -
    -
    - - Long - - - (int64) - - -
    - start time in Milliseconds -
    -
    -
    -
    -
    status - - -
    -
    -
    - - String - - -
    - order status list. -Allowed value: [Ack, IocExpire, IocNoFill, -FullyFill, Canceled, Expired, FailedBlocking, FailedMatching] +api_instance = swagger_client.NodeApi() + +try: + # Get network peers. + api_response = api_instance.get_peers() + pprint(api_response) +except ApiException as e: + print("Exception when calling NodeApi->getPeers: %s\n" % e) +
    +
    + +

    Parameters

    + + + + -
    -
    - - -
    symbol - - -
    -
    -
    - - String - - -
    - symbol -
    -
    -
    -
    -
    total - - -
    -
    -
    - - Integer - - - (int32) - - -
    - total number required, 0 for not required and 1 for required; default not required, return total=-1 in response -
    -
    -
    -
    -

    Responses

    -

    Status: 200 - OK

    +

    Status: 200 - Success

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Bad Request

    -
    -
    +
    +
    +
    + +
    +
    + +

    Status: 404 - Not Found

    + + + +
    +
    + +

    Status: default - Generic error response

    + + + +
    +
    +
    +
    - +

    -
    -
    +
    +
    -

    getOpenOrders

    -

    Get open orders.

    +

    getTimeLocks

    +

    Gets time lock records given an address

    -

    Gets open orders for a given address. - -**Rate Limit:** 5 requests per IP per second. -

    +


    -
    /api/v1/orders/open
    +
    /api/v1/timelocks/{address}

    Usage and SDK Samples

    -
    +
    curl -X GET\
     -H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/orders/open?address=&limit=&offset=&symbol=&total="
    +"https://dex.binance.org/api/v1/timelocks/{address}?id="
    -
    +
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import io.swagger.client.api.OrderApi;
    +import io.swagger.client.api.NodeApi;
     
     import java.io.File;
     import java.util.*;
     
    -public class OrderApiExample {
    +public class NodeApiExample {
     
         public static void main(String[] args) {
             
    -        OrderApi apiInstance = new OrderApi();
    -        String address = address_example; // String | the owner address
    -        Integer limit = 56; // Integer | default 500; max 1000.
    -        Integer offset = 56; // Integer | start with 0; default 0.
    -        String symbol = symbol_example; // String | symbol
    -        Integer total = 56; // Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
    +        NodeApi apiInstance = new NodeApi();
    +        String address = address_example; // String | The account address to query
    +        Long id = 789; // Long | the record id of timelock to query
             try {
    -            OrderList result = apiInstance.getOpenOrders(address, limit, offset, symbol, total);
    +            TimeLocks result = apiInstance.getTimeLocks(address, id);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling OrderApi#getOpenOrders");
    +            System.err.println("Exception when calling NodeApi#getTimeLocks");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    import io.swagger.client.api.OrderApi;
    +                          
    +
    import io.swagger.client.api.NodeApi;
     
    -public class OrderApiExample {
    +public class NodeApiExample {
     
         public static void main(String[] args) {
    -        OrderApi apiInstance = new OrderApi();
    -        String address = address_example; // String | the owner address
    -        Integer limit = 56; // Integer | default 500; max 1000.
    -        Integer offset = 56; // Integer | start with 0; default 0.
    -        String symbol = symbol_example; // String | symbol
    -        Integer total = 56; // Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
    +        NodeApi apiInstance = new NodeApi();
    +        String address = address_example; // String | The account address to query
    +        Long id = 789; // Long | the record id of timelock to query
             try {
    -            OrderList result = apiInstance.getOpenOrders(address, limit, offset, symbol, total);
    +            TimeLocks result = apiInstance.getTimeLocks(address, id);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling OrderApi#getOpenOrders");
    +            System.err.println("Exception when calling NodeApi#getTimeLocks");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    String *address = address_example; // the owner address
    -Integer *limit = 56; // default 500; max 1000. (optional) (default to 500)
    -Integer *offset = 56; // start with 0; default 0. (optional) (default to 0)
    -String *symbol = symbol_example; // symbol (optional)
    -Integer *total = 56; // total number required, 0 for not required and 1 for required; default not required, return total=-1 in response (optional)
    +                            
    +
    String *address = address_example; // The account address to query
    +Long *id = 789; // the record id of timelock to query (optional)
     
    -OrderApi *apiInstance = [[OrderApi alloc] init];
    +NodeApi *apiInstance = [[NodeApi alloc] init];
     
    -// Get open orders.
    -[apiInstance getOpenOrdersWith:address
    -    limit:limit
    -    offset:offset
    -    symbol:symbol
    -    total:total
    -              completionHandler: ^(OrderList output, NSError* error) {
    +// Gets time lock records given an address
    +[apiInstance getTimeLocksWith:address
    +    id:id
    +              completionHandler: ^(TimeLocks output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -11936,16 +7858,13 @@ 

    Usage and SDK Samples

    -
    +
    var HttpApi = require('http_api');
     
    -var api = new HttpApi.OrderApi()
    -var address = address_example; // {{String}} the owner address
    +var api = new HttpApi.NodeApi()
    +var address = address_example; // {{String}} The account address to query
     var opts = { 
    -  'limit': 56, // {{Integer}} default 500; max 1000.
    -  'offset': 56, // {{Integer}} start with 0; default 0.
    -  'symbol': symbol_example, // {{String}} symbol
    -  'total': 56 // {{Integer}} total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
    +  'id': 789 // {{Long}} the record id of timelock to query
     };
     var callback = function(error, data, response) {
       if (error) {
    @@ -11954,14 +7873,14 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.getOpenOrders(address, opts, callback); +api.getTimeLocks(address, opts, callback);
    - -
    +
    using System;
     using System.Diagnostics;
     using IO.Swagger.Api;
    @@ -11970,27 +7889,24 @@ 

    Usage and SDK Samples

    namespace Example { - public class getOpenOrdersExample + public class getTimeLocksExample { public void main() { - var apiInstance = new OrderApi(); - var address = address_example; // String | the owner address - var limit = 56; // Integer | default 500; max 1000. (optional) (default to 500) - var offset = 56; // Integer | start with 0; default 0. (optional) (default to 0) - var symbol = symbol_example; // String | symbol (optional) - var total = 56; // Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response (optional) + var apiInstance = new NodeApi(); + var address = address_example; // String | The account address to query + var id = 789; // Long | the record id of timelock to query (optional) try { - // Get open orders. - OrderList result = apiInstance.getOpenOrders(address, limit, offset, symbol, total); + // Gets time lock records given an address + TimeLocks result = apiInstance.getTimeLocks(address, id); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling OrderApi.getOpenOrders: " + e.Message ); + Debug.Print("Exception when calling NodeApi.getTimeLocks: " + e.Message ); } } } @@ -11998,48 +7914,42 @@

    Usage and SDK Samples

    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new Swagger\Client\ApiOrderApi();
    -$address = address_example; // String | the owner address
    -$limit = 56; // Integer | default 500; max 1000.
    -$offset = 56; // Integer | start with 0; default 0.
    -$symbol = symbol_example; // String | symbol
    -$total = 56; // Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
    -
    +$api_instance = new Swagger\Client\ApiNodeApi();
    +$address = address_example; // String | The account address to query
    +$id = 789; // Long | the record id of timelock to query
    +
     try {
    -    $result = $api_instance->getOpenOrders($address, $limit, $offset, $symbol, $total);
    +    $result = $api_instance->getTimeLocks($address, $id);
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling OrderApi->getOpenOrders: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling NodeApi->getTimeLocks: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::OrderApi;
    +use WWW::SwaggerClient::NodeApi;
     
    -my $api_instance = WWW::SwaggerClient::OrderApi->new();
    -my $address = address_example; # String | the owner address
    -my $limit = 56; # Integer | default 500; max 1000.
    -my $offset = 56; # Integer | start with 0; default 0.
    -my $symbol = symbol_example; # String | symbol
    -my $total = 56; # Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
    +my $api_instance = WWW::SwaggerClient::NodeApi->new();
    +my $address = address_example; # String | The account address to query
    +my $id = 789; # Long | the record id of timelock to query
     
     eval { 
    -    my $result = $api_instance->getOpenOrders(address => $address, limit => $limit, offset => $offset, symbol => $symbol, total => $total);
    +    my $result = $api_instance->getTimeLocks(address => $address, id => $id);
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling OrderApi->getOpenOrders: $@\n";
    +    warn "Exception when calling NodeApi->getTimeLocks: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_client
    @@ -12047,24 +7957,50 @@ 

    Usage and SDK Samples

    from pprint import pprint # create an instance of the API class -api_instance = swagger_client.OrderApi() -address = address_example # String | the owner address -limit = 56 # Integer | default 500; max 1000. (optional) (default to 500) -offset = 56 # Integer | start with 0; default 0. (optional) (default to 0) -symbol = symbol_example # String | symbol (optional) -total = 56 # Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response (optional) +api_instance = swagger_client.NodeApi() +address = address_example # String | The account address to query +id = 789 # Long | the record id of timelock to query (optional) try: - # Get open orders. - api_response = api_instance.get_open_orders(address, limit=limit, offset=offset, symbol=symbol, total=total) + # Gets time lock records given an address + api_response = api_instance.get_time_locks(address, id=id) pprint(api_response) except ApiException as e: - print("Exception when calling OrderApi->getOpenOrders: %s\n" % e)
    + print("Exception when calling NodeApi->getTimeLocks: %s\n" % e)

    Parameters

    +
    Path parameters
    + + + + + + + + +
    NameDescription
    address* + + +
    +
    +
    + + String + + +
    + The account address to query +
    +
    +
    + Required +
    +
    +
    +
    @@ -12075,107 +8011,22 @@

    Parameters

    Name Description - address* - - - -
    -
    -
    - - String - - -
    - the owner address -
    -
    -
    - Required -
    -
    -
    - - - limit - - - -
    -
    -
    - - Integer - - - (int32) - - -
    - default 500; max 1000. -
    -
    -
    -
    - - - offset - - - -
    -
    -
    - - Integer - - - (int32) - - -
    - start with 0; default 0. -
    -
    -
    -
    - - - symbol - - - -
    -
    -
    - - String - - -
    - symbol -
    -
    -
    -
    - - - total + id -
    +
    - Integer + Long - (int32) + (int64)
    - total number required, 0 for not required and 1 for required; default not required, return total=-1 in response + the record id of timelock to query
    @@ -12185,26 +8036,26 @@

    Parameters

    Responses

    -

    Status: 200 - OK

    +

    Status: 200 - Success

    -
    -
    +
    +
    - +
    @@ -12237,14 +8088,14 @@

    Status: 400 - Bad Request

    -
    -
    +
    +
    - +
    -

    Status: 404 - Not Found

    - - - -
    -
    - -

    Status: default - Generic error response

    +

    Status: 500 - internal server error

    -
    -
    +
    +
    -
    - -
    -
    + //console.log(JSON.stringify(schema)); + var view = new JSONSchemaView(schema, 3); + $('#responses-getTimeLocks-500-schema-data').val(stringify(schema)); + var result = $('#responses-getTimeLocks-500-schema-500'); + result.empty(); + result.append(view.render()); + }); + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    getTransaction

    +

    Get a transaction.

    +
    +
    +
    +

    +

    Gets transaction metadata by transaction ID. By default, transactions are returned in a raw format. You may add `?format=json` to the end of the path to obtain a more readable response. + +**Destination:** Seed node. + +**Rate Limit:** 10 requests per IP per second. + +**Example:** + +Below is an example response of a send transaction when `?format=json` is used. +``` + { + code:0, + hash:"433806D6A4AB6359CB56EC55BA99896DFAB2AF11326B74881A2ABA7049C492D3", + height:"7850389", + log:"Msg 0: ", + ok:true, + tx:{ + type:"auth/StdTx", + value:{ + data:null, + memo:"101192150", + msg:[ + { + type:"cosmos-sdk/Send", + value:{ + inputs:[ + { + address:"bnb1jafs33u9u6f7w7wzfmm4rr9rzy2cgqzp78kwaw", + coins:[ + { + amount:"496429373", + denom:"BNB", + + } + ], + + } + ], + outputs:[ + { + address:"bnb136ns6lfw4zs5hg4n85vdthaad7hq5m4gtkgf23", + coins:[ + { + amount:"496429373", + denom:"BNB", + + } + ], + + } + ], + + }, + + } + ], + signatures:[ + { + account_number:"438", + pub_key:{ + type:"tendermint/PubKeySecp256k1", + value:"A3mfgg/i12XNyy9esqCjI7yrkrOs9dngP7c9cDUEJly5", + + }, + sequence:"0", + signature:"VvvGz3qbyirJ7vv01Df8tuAd7K4I+HK+yEBfep+qwtMKuHWQQH3XtMB9Pqtc2jlia0AtDe+BUEMtIyh3/N66IQ==", -

    -
    -
    -
    -
    -
    -

    getOrder

    -

    Get an order.

    -
    -
    -
    -

    -

    Gets metadata for an individual order by its ID. + } + ], + source:"1", -**Rate Limit:** 5 requests per IP per second. + }, + + }, + + } +```


    -
    /api/v1/orders/{id}
    +
    /api/v1/tx/{hash}

    Usage and SDK Samples

    -
    +
    curl -X GET\
     -H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/orders/{id}"
    +"https://dex.binance.org/api/v1/tx/{hash}?format="
    -
    +
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import io.swagger.client.api.OrderApi;
    +import io.swagger.client.api.NodeApi;
     
     import java.io.File;
     import java.util.*;
     
    -public class OrderApiExample {
    +public class NodeApiExample {
     
         public static void main(String[] args) {
             
    -        OrderApi apiInstance = new OrderApi();
    -        String id = id_example; // String | order id
    +        NodeApi apiInstance = new NodeApi();
    +        String hash = hash_example; // String | The transaction hash to query
    +        String format = format_example; // String | Response format (`json` or amino)
             try {
    -            Order result = apiInstance.getOrder(id);
    +            Transaction result = apiInstance.getTransaction(hash, format);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling OrderApi#getOrder");
    +            System.err.println("Exception when calling NodeApi#getTransaction");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    import io.swagger.client.api.OrderApi;
    +                          
    +
    import io.swagger.client.api.NodeApi;
     
    -public class OrderApiExample {
    +public class NodeApiExample {
     
         public static void main(String[] args) {
    -        OrderApi apiInstance = new OrderApi();
    -        String id = id_example; // String | order id
    +        NodeApi apiInstance = new NodeApi();
    +        String hash = hash_example; // String | The transaction hash to query
    +        String format = format_example; // String | Response format (`json` or amino)
             try {
    -            Order result = apiInstance.getOrder(id);
    +            Transaction result = apiInstance.getTransaction(hash, format);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling OrderApi#getOrder");
    +            System.err.println("Exception when calling NodeApi#getTransaction");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    String *id = id_example; // order id
    +                            
    +
    String *hash = hash_example; // The transaction hash to query
    +String *format = format_example; // Response format (`json` or amino) (optional)
     
    -OrderApi *apiInstance = [[OrderApi alloc] init];
    +NodeApi *apiInstance = [[NodeApi alloc] init];
     
    -// Get an order.
    -[apiInstance getOrderWith:id
    -              completionHandler: ^(Order output, NSError* error) {
    +// Get a transaction.
    +[apiInstance getTransactionWith:hash
    +    format:format
    +              completionHandler: ^(Transaction output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -12445,12 +8366,14 @@ 

    Usage and SDK Samples

    -
    +
    var HttpApi = require('http_api');
     
    -var api = new HttpApi.OrderApi()
    -var id = id_example; // {{String}} order id
    -
    +var api = new HttpApi.NodeApi()
    +var hash = hash_example; // {{String}} The transaction hash to query
    +var opts = { 
    +  'format': format_example // {{String}} Response format (`json` or amino)
    +};
     var callback = function(error, data, response) {
       if (error) {
         console.error(error);
    @@ -12458,14 +8381,14 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.getOrder(id, callback); +api.getTransaction(hash, opts, callback);
    - -
    +
    using System;
     using System.Diagnostics;
     using IO.Swagger.Api;
    @@ -12474,23 +8397,24 @@ 

    Usage and SDK Samples

    namespace Example { - public class getOrderExample + public class getTransactionExample { public void main() { - var apiInstance = new OrderApi(); - var id = id_example; // String | order id + var apiInstance = new NodeApi(); + var hash = hash_example; // String | The transaction hash to query + var format = format_example; // String | Response format (`json` or amino) (optional) try { - // Get an order. - Order result = apiInstance.getOrder(id); + // Get a transaction. + Transaction result = apiInstance.getTransaction(hash, format); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling OrderApi.getOrder: " + e.Message ); + Debug.Print("Exception when calling NodeApi.getTransaction: " + e.Message ); } } } @@ -12498,40 +8422,42 @@

    Usage and SDK Samples

    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new Swagger\Client\ApiOrderApi();
    -$id = id_example; // String | order id
    +$api_instance = new Swagger\Client\ApiNodeApi();
    +$hash = hash_example; // String | The transaction hash to query
    +$format = format_example; // String | Response format (`json` or amino)
     
     try {
    -    $result = $api_instance->getOrder($id);
    +    $result = $api_instance->getTransaction($hash, $format);
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling OrderApi->getOrder: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling NodeApi->getTransaction: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::OrderApi;
    +use WWW::SwaggerClient::NodeApi;
     
    -my $api_instance = WWW::SwaggerClient::OrderApi->new();
    -my $id = id_example; # String | order id
    +my $api_instance = WWW::SwaggerClient::NodeApi->new();
    +my $hash = hash_example; # String | The transaction hash to query
    +my $format = format_example; # String | Response format (`json` or amino)
     
     eval { 
    -    my $result = $api_instance->getOrder(id => $id);
    +    my $result = $api_instance->getTransaction(hash => $hash, format => $format);
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling OrderApi->getOrder: $@\n";
    +    warn "Exception when calling NodeApi->getTransaction: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_client
    @@ -12539,15 +8465,16 @@ 

    Usage and SDK Samples

    from pprint import pprint # create an instance of the API class -api_instance = swagger_client.OrderApi() -id = id_example # String | order id +api_instance = swagger_client.NodeApi() +hash = hash_example # String | The transaction hash to query +format = format_example # String | Response format (`json` or amino) (optional) try: - # Get an order. - api_response = api_instance.get_order(id) + # Get a transaction. + api_response = api_instance.get_transaction(hash, format=format) pprint(api_response) except ApiException as e: - print("Exception when calling OrderApi->getOrder: %s\n" % e)
    + print("Exception when calling NodeApi->getTransaction: %s\n" % e)
    @@ -12559,11 +8486,11 @@

    Parameters

    Name Description - id* + hash* -
    +
    @@ -12571,7 +8498,7 @@

    Parameters

    - order id + The transaction hash to query
    @@ -12586,28 +8513,54 @@

    Parameters

    +
    Query parameters
    + + + + + + + + +
    NameDescription
    format + + +
    +
    +
    + + String + + +
    + Response format (`json` or amino) +
    +
    +
    +
    +

    Responses

    -

    Status: 200 - OK

    +

    Status: 200 - Success

    -
    -
    +
    +
    - +
    -

    Status: 400 - Bad Request

    +

    Status: 404 - Not Found

    + + + +
    +
    + +

    Status: 500 - Bad Request

    -
    -
    +
    +
    - +
    -

    Status: 404 - Not Found

    - - - -
    -
    -

    Status: default - Generic error response

    -
    -
    +
    +
    - +

    -
    -
    -

    TimelockRecords

    -
    -
    +
    +
    -

    getTimeLock

    -

    Get timelock records of an address.

    +

    getValidators

    +

    Get validators.

    -

    Get the timelock history of an address. -**Rate Limit:** 60 requests per IP per minute. +

    Gets the list of validators used in consensus. + +**Destination:** Witness node. + +**Rate Limit:** 10 requests per IP per second. + +**URL for mainnet:** [https://dex.binance.org/api/v1/validators](https://dex.binance.org/api/v1/validators) + +**URL for testnet:** [https://testnet-dex.binance.org/api/v1/validators](https://testnet-dex.binance.org/api/v1/validators)


    -
    /api/v1/timelock/{account_addr}
    +
    /api/v1/validators

    Usage and SDK Samples

    -
    +
    curl -X GET\
     -H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/timelock/{account_addr}?id="
    +"https://dex.binance.org/api/v1/validators"
    -
    +
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import io.swagger.client.api.TimelockRecordsApi;
    +import io.swagger.client.api.NodeApi;
     
     import java.io.File;
     import java.util.*;
     
    -public class TimelockRecordsApiExample {
    +public class NodeApiExample {
     
         public static void main(String[] args) {
             
    -        TimelockRecordsApi apiInstance = new TimelockRecordsApi();
    -        String accountAddr = accountAddr_example; // String | The account address to query
    -        Long id = 789; // Long | the record id of timelock to query
    +        NodeApi apiInstance = new NodeApi();
             try {
    -            TimeLocks result = apiInstance.getTimeLock(accountAddr, id);
    +            array[Validators] result = apiInstance.getValidators();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling TimelockRecordsApi#getTimeLock");
    +            System.err.println("Exception when calling NodeApi#getValidators");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    import io.swagger.client.api.TimelockRecordsApi;
    +                          
    +
    import io.swagger.client.api.NodeApi;
     
    -public class TimelockRecordsApiExample {
    +public class NodeApiExample {
     
         public static void main(String[] args) {
    -        TimelockRecordsApi apiInstance = new TimelockRecordsApi();
    -        String accountAddr = accountAddr_example; // String | The account address to query
    -        Long id = 789; // Long | the record id of timelock to query
    +        NodeApi apiInstance = new NodeApi();
             try {
    -            TimeLocks result = apiInstance.getTimeLock(accountAddr, id);
    +            array[Validators] result = apiInstance.getValidators();
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling TimelockRecordsApi#getTimeLock");
    +            System.err.println("Exception when calling NodeApi#getValidators");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    String *accountAddr = accountAddr_example; // The account address to query
    -Long *id = 789; // the record id of timelock to query (optional)
    -
    -TimelockRecordsApi *apiInstance = [[TimelockRecordsApi alloc] init];
    +                            
    +
    
    +NodeApi *apiInstance = [[NodeApi alloc] init];
     
    -// Get timelock records of an address.
    -[apiInstance getTimeLockWith:accountAddr
    -    id:id
    -              completionHandler: ^(TimeLocks output, NSError* error) {
    +// Get validators.
    +[apiInstance getValidatorsWithCompletionHandler: 
    +              ^(array[Validators] output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -12854,14 +8804,10 @@ 

    Usage and SDK Samples

    -
    +
    var HttpApi = require('http_api');
     
    -var api = new HttpApi.TimelockRecordsApi()
    -var accountAddr = accountAddr_example; // {{String}} The account address to query
    -var opts = { 
    -  'id': 789 // {{Long}} the record id of timelock to query
    -};
    +var api = new HttpApi.NodeApi()
     var callback = function(error, data, response) {
       if (error) {
         console.error(error);
    @@ -12869,14 +8815,14 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.getTimeLock(accountAddr, opts, callback); +api.getValidators(callback);
    - -
    +
    using System;
     using System.Diagnostics;
     using IO.Swagger.Api;
    @@ -12885,24 +8831,22 @@ 

    Usage and SDK Samples

    namespace Example { - public class getTimeLockExample + public class getValidatorsExample { public void main() { - var apiInstance = new TimelockRecordsApi(); - var accountAddr = accountAddr_example; // String | The account address to query - var id = 789; // Long | the record id of timelock to query (optional) + var apiInstance = new NodeApi(); try { - // Get timelock records of an address. - TimeLocks result = apiInstance.getTimeLock(accountAddr, id); + // Get validators. + array[Validators] result = apiInstance.getValidators(); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling TimelockRecordsApi.getTimeLock: " + e.Message ); + Debug.Print("Exception when calling NodeApi.getValidators: " + e.Message ); } } } @@ -12910,42 +8854,38 @@

    Usage and SDK Samples

    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new Swagger\Client\ApiTimelockRecordsApi();
    -$accountAddr = accountAddr_example; // String | The account address to query
    -$id = 789; // Long | the record id of timelock to query
    +$api_instance = new Swagger\Client\ApiNodeApi();
     
     try {
    -    $result = $api_instance->getTimeLock($accountAddr, $id);
    +    $result = $api_instance->getValidators();
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling TimelockRecordsApi->getTimeLock: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling NodeApi->getValidators: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::TimelockRecordsApi;
    +use WWW::SwaggerClient::NodeApi;
     
    -my $api_instance = WWW::SwaggerClient::TimelockRecordsApi->new();
    -my $accountAddr = accountAddr_example; # String | The account address to query
    -my $id = 789; # Long | the record id of timelock to query
    +my $api_instance = WWW::SwaggerClient::NodeApi->new();
     
     eval { 
    -    my $result = $api_instance->getTimeLock(accountAddr => $accountAddr, id => $id);
    +    my $result = $api_instance->getValidators();
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling TimelockRecordsApi->getTimeLock: $@\n";
    +    warn "Exception when calling NodeApi->getValidators: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_client
    @@ -12953,97 +8893,37 @@ 

    Usage and SDK Samples

    from pprint import pprint # create an instance of the API class -api_instance = swagger_client.TimelockRecordsApi() -accountAddr = accountAddr_example # String | The account address to query -id = 789 # Long | the record id of timelock to query (optional) +api_instance = swagger_client.NodeApi() try: - # Get timelock records of an address. - api_response = api_instance.get_time_lock(accountAddr, id=id) + # Get validators. + api_response = api_instance.get_validators() pprint(api_response) except ApiException as e: - print("Exception when calling TimelockRecordsApi->getTimeLock: %s\n" % e)
    + print("Exception when calling NodeApi->getValidators: %s\n" % e)

    Parameters

    -
    Path parameters
    - - - - - - - - -
    NameDescription
    account_addr* - - -
    -
    -
    - - String - - -
    - The account address to query -
    -
    -
    - Required -
    -
    -
    -
    -
    Query parameters
    - - - - - - - - -
    NameDescription
    id - - -
    -
    -
    - - Long - - - (int64) - - -
    - the record id of timelock to query -
    -
    -
    -
    -

    Responses

    Status: 200 - Success

    -
    -
    +
    +
    - +
    @@ -13084,14 +8968,14 @@

    Status: 400 - Bad Request

    -
    -
    +
    +
    - +
    @@ -13136,22 +9020,22 @@

    Status: 404 - Not Found

    -

    Status: 500 - internal server error

    +

    Status: default - Generic error response

    -
    -
    +
    +
    - +
    @@ -13188,113 +9072,106 @@

    Status: 500 - internal server error


    -
    -

    Tokens

    -
    -
    +
    +

    TimelockRecords

    +
    +
    -

    getTokens

    -

    Get tokens list.

    +

    getTimeLock

    +

    Get timelock records of an address.

    -

    Gets a list of tokens that have been issued. - -**Destination:** Witness node. - -**Rate Limit:** 1 request per IP per second. - -**URL for mainnet:** [https://dex.binance.org/api/v1/tokens](https://dex.binance.org/api/v1/tokens) - -**URL for testnet:** [https://testnet-dex.binance.org/api/v1/tokens](https://testnet-dex.binance.org/api/v1/tokens) +

    Get the timelock history of an address. +**Rate Limit:** 60 requests per IP per minute.


    -
    /api/v1/tokens
    +
    /api/v1/timelock/{account_addr}

    Usage and SDK Samples

    -
    +
    curl -X GET\
     -H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/tokens?limit=&offset="
    +"https://dex.binance.org/api/v1/timelock/{account_addr}?id="
    -
    +
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import io.swagger.client.api.TokensApi;
    +import io.swagger.client.api.TimelockRecordsApi;
     
     import java.io.File;
     import java.util.*;
     
    -public class TokensApiExample {
    +public class TimelockRecordsApiExample {
     
         public static void main(String[] args) {
             
    -        TokensApi apiInstance = new TokensApi();
    -        Integer limit = 56; // Integer | default 100.
    -        Integer offset = 56; // Integer | start with 0; default 0.
    +        TimelockRecordsApi apiInstance = new TimelockRecordsApi();
    +        String accountAddr = accountAddr_example; // String | The account address to query
    +        Long id = 789; // Long | the record id of timelock to query
             try {
    -            array[Token] result = apiInstance.getTokens(limit, offset);
    +            TimeLocks result = apiInstance.getTimeLock(accountAddr, id);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling TokensApi#getTokens");
    +            System.err.println("Exception when calling TimelockRecordsApi#getTimeLock");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    import io.swagger.client.api.TokensApi;
    +                          
    +
    import io.swagger.client.api.TimelockRecordsApi;
     
    -public class TokensApiExample {
    +public class TimelockRecordsApiExample {
     
         public static void main(String[] args) {
    -        TokensApi apiInstance = new TokensApi();
    -        Integer limit = 56; // Integer | default 100.
    -        Integer offset = 56; // Integer | start with 0; default 0.
    +        TimelockRecordsApi apiInstance = new TimelockRecordsApi();
    +        String accountAddr = accountAddr_example; // String | The account address to query
    +        Long id = 789; // Long | the record id of timelock to query
             try {
    -            array[Token] result = apiInstance.getTokens(limit, offset);
    +            TimeLocks result = apiInstance.getTimeLock(accountAddr, id);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling TokensApi#getTokens");
    +            System.err.println("Exception when calling TimelockRecordsApi#getTimeLock");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    Integer *limit = 56; // default 100. (optional) (default to 100)
    -Integer *offset = 56; // start with 0; default 0. (optional) (default to 0)
    +                            
    +
    String *accountAddr = accountAddr_example; // The account address to query
    +Long *id = 789; // the record id of timelock to query (optional)
     
    -TokensApi *apiInstance = [[TokensApi alloc] init];
    +TimelockRecordsApi *apiInstance = [[TimelockRecordsApi alloc] init];
     
    -// Get tokens list.
    -[apiInstance getTokensWith:limit
    -    offset:offset
    -              completionHandler: ^(array[Token] output, NSError* error) {
    +// Get timelock records of an address.
    +[apiInstance getTimeLockWith:accountAddr
    +    id:id
    +              completionHandler: ^(TimeLocks output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -13305,13 +9182,13 @@ 

    Usage and SDK Samples

    -
    +
    var HttpApi = require('http_api');
     
    -var api = new HttpApi.TokensApi()
    +var api = new HttpApi.TimelockRecordsApi()
    +var accountAddr = accountAddr_example; // {{String}} The account address to query
     var opts = { 
    -  'limit': 56, // {{Integer}} default 100.
    -  'offset': 56 // {{Integer}} start with 0; default 0.
    +  'id': 789 // {{Long}} the record id of timelock to query
     };
     var callback = function(error, data, response) {
       if (error) {
    @@ -13320,14 +9197,14 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.getTokens(opts, callback); +api.getTimeLock(accountAddr, opts, callback);
    - -
    +
    using System;
     using System.Diagnostics;
     using IO.Swagger.Api;
    @@ -13336,24 +9213,24 @@ 

    Usage and SDK Samples

    namespace Example { - public class getTokensExample + public class getTimeLockExample { public void main() { - var apiInstance = new TokensApi(); - var limit = 56; // Integer | default 100. (optional) (default to 100) - var offset = 56; // Integer | start with 0; default 0. (optional) (default to 0) + var apiInstance = new TimelockRecordsApi(); + var accountAddr = accountAddr_example; // String | The account address to query + var id = 789; // Long | the record id of timelock to query (optional) try { - // Get tokens list. - array[Token] result = apiInstance.getTokens(limit, offset); + // Get timelock records of an address. + TimeLocks result = apiInstance.getTimeLock(accountAddr, id); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling TokensApi.getTokens: " + e.Message ); + Debug.Print("Exception when calling TimelockRecordsApi.getTimeLock: " + e.Message ); } } } @@ -13361,42 +9238,42 @@

    Usage and SDK Samples

    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new Swagger\Client\ApiTokensApi();
    -$limit = 56; // Integer | default 100.
    -$offset = 56; // Integer | start with 0; default 0.
    +$api_instance = new Swagger\Client\ApiTimelockRecordsApi();
    +$accountAddr = accountAddr_example; // String | The account address to query
    +$id = 789; // Long | the record id of timelock to query
     
     try {
    -    $result = $api_instance->getTokens($limit, $offset);
    +    $result = $api_instance->getTimeLock($accountAddr, $id);
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling TokensApi->getTokens: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling TimelockRecordsApi->getTimeLock: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::TokensApi;
    +use WWW::SwaggerClient::TimelockRecordsApi;
     
    -my $api_instance = WWW::SwaggerClient::TokensApi->new();
    -my $limit = 56; # Integer | default 100.
    -my $offset = 56; # Integer | start with 0; default 0.
    +my $api_instance = WWW::SwaggerClient::TimelockRecordsApi->new();
    +my $accountAddr = accountAddr_example; # String | The account address to query
    +my $id = 789; # Long | the record id of timelock to query
     
     eval { 
    -    my $result = $api_instance->getTokens(limit => $limit, offset => $offset);
    +    my $result = $api_instance->getTimeLock(accountAddr => $accountAddr, id => $id);
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling TokensApi->getTokens: $@\n";
    +    warn "Exception when calling TimelockRecordsApi->getTimeLock: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_client
    @@ -13404,21 +9281,50 @@ 

    Usage and SDK Samples

    from pprint import pprint # create an instance of the API class -api_instance = swagger_client.TokensApi() -limit = 56 # Integer | default 100. (optional) (default to 100) -offset = 56 # Integer | start with 0; default 0. (optional) (default to 0) +api_instance = swagger_client.TimelockRecordsApi() +accountAddr = accountAddr_example # String | The account address to query +id = 789 # Long | the record id of timelock to query (optional) try: - # Get tokens list. - api_response = api_instance.get_tokens(limit=limit, offset=offset) + # Get timelock records of an address. + api_response = api_instance.get_time_lock(accountAddr, id=id) pprint(api_response) except ApiException as e: - print("Exception when calling TokensApi->getTokens: %s\n" % e)
    + print("Exception when calling TimelockRecordsApi->getTimeLock: %s\n" % e)

    Parameters

    +
    Path parameters
    + + + + + + + + +
    NameDescription
    account_addr* + + +
    +
    +
    + + String + + +
    + The account address to query +
    +
    +
    + Required +
    +
    +
    +
    @@ -13429,44 +9335,22 @@

    Parameters

    Name Description - limit - - - -
    -
    -
    - - Integer - - - (int32) - - -
    - default 100. -
    -
    -
    -
    - - - offset + id -
    +
    - Integer + Long - (int32) + (int64)
    - start with 0; default 0. + the record id of timelock to query
    @@ -13480,14 +9364,14 @@

    Status: 200 - Success

    -
    -
    +
    +
    - +
    @@ -13532,14 +9412,14 @@

    Status: 400 - Bad Request

    -
    -
    +
    +
    - +
    @@ -13584,22 +9464,22 @@

    Status: 404 - Not Found

    -

    Status: default - Generic error response

    +

    Status: 500 - internal server error

    -
    -
    +
    +
    - +
    @@ -13636,149 +9516,113 @@

    Status: default - Generic error response


    -
    -

    Trade

    -
    -
    +
    +

    Tokens

    +
    +
    -

    getTrades

    -

    Get market trades.

    +

    getTokens

    +

    Get tokens list.

    -

    Gets a list of historical trades. +

    Gets a list of tokens that have been issued. -**Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. +**Destination:** Witness node. -**Rate Limit:** 5 requests per IP per second. +**Rate Limit:** 1 request per IP per second. + +**URL for mainnet:** [https://dex.binance.org/api/v1/tokens](https://dex.binance.org/api/v1/tokens) + +**URL for testnet:** [https://testnet-dex.binance.org/api/v1/tokens](https://testnet-dex.binance.org/api/v1/tokens)


    -
    /api/v1/trades
    +
    /api/v1/tokens

    Usage and SDK Samples

    -
    +
    curl -X GET\
     -H "Accept: application/json"\
    -"https://dex.binance.org/api/v1/trades?address=&buyerOrderId=&end=&height=&limit=&offset="eAsset=&sellerOrderId=&side=&start=&symbol=&total="
    +"https://dex.binance.org/api/v1/tokens?limit=&offset="
    -
    +
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import io.swagger.client.api.TradeApi;
    +import io.swagger.client.api.TokensApi;
     
     import java.io.File;
     import java.util.*;
     
    -public class TradeApiExample {
    +public class TokensApiExample {
     
         public static void main(String[] args) {
             
    -        TradeApi apiInstance = new TradeApi();
    -        String address = address_example; // String | the buyer/seller address
    -        String buyerOrderId = buyerOrderId_example; // String | buyer order id
    -        Long end = 789; // Long | end time in Milliseconds
    -        Long height = 789; // Long | block height
    -        Integer limit = 56; // Integer | default 500; max 1000.
    +        TokensApi apiInstance = new TokensApi();
    +        Integer limit = 56; // Integer | default 100.
             Integer offset = 56; // Integer | start with 0; default 0.
    -        String quoteAsset = quoteAsset_example; // String | quote asset
    -        String sellerOrderId = sellerOrderId_example; // String | seller order id
    -        Integer side = 56; // Integer | order side. 1 for buy and 2 for sell.
    -        Long start = 789; // Long | start time in Milliseconds
    -        String symbol = symbol_example; // String | symbol
    -        Integer total = 56; // Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
             try {
    -            TradePage result = apiInstance.getTrades(address, buyerOrderId, end, height, limit, offset, quoteAsset, sellerOrderId, side, start, symbol, total);
    +            array[Token] result = apiInstance.getTokens(limit, offset);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling TradeApi#getTrades");
    +            System.err.println("Exception when calling TokensApi#getTokens");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    import io.swagger.client.api.TradeApi;
    +                          
    +
    import io.swagger.client.api.TokensApi;
     
    -public class TradeApiExample {
    +public class TokensApiExample {
     
         public static void main(String[] args) {
    -        TradeApi apiInstance = new TradeApi();
    -        String address = address_example; // String | the buyer/seller address
    -        String buyerOrderId = buyerOrderId_example; // String | buyer order id
    -        Long end = 789; // Long | end time in Milliseconds
    -        Long height = 789; // Long | block height
    -        Integer limit = 56; // Integer | default 500; max 1000.
    +        TokensApi apiInstance = new TokensApi();
    +        Integer limit = 56; // Integer | default 100.
             Integer offset = 56; // Integer | start with 0; default 0.
    -        String quoteAsset = quoteAsset_example; // String | quote asset
    -        String sellerOrderId = sellerOrderId_example; // String | seller order id
    -        Integer side = 56; // Integer | order side. 1 for buy and 2 for sell.
    -        Long start = 789; // Long | start time in Milliseconds
    -        String symbol = symbol_example; // String | symbol
    -        Integer total = 56; // Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
             try {
    -            TradePage result = apiInstance.getTrades(address, buyerOrderId, end, height, limit, offset, quoteAsset, sellerOrderId, side, start, symbol, total);
    +            array[Token] result = apiInstance.getTokens(limit, offset);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling TradeApi#getTrades");
    +            System.err.println("Exception when calling TokensApi#getTokens");
                 e.printStackTrace();
             }
         }
     }
    -
    -
    String *address = address_example; // the buyer/seller address (optional)
    -String *buyerOrderId = buyerOrderId_example; // buyer order id (optional)
    -Long *end = 789; // end time in Milliseconds (optional)
    -Long *height = 789; // block height (optional)
    -Integer *limit = 56; // default 500; max 1000. (optional) (default to 500)
    +                            
    +
    Integer *limit = 56; // default 100. (optional) (default to 100)
     Integer *offset = 56; // start with 0; default 0. (optional) (default to 0)
    -String *quoteAsset = quoteAsset_example; // quote asset (optional)
    -String *sellerOrderId = sellerOrderId_example; // seller order id (optional)
    -Integer *side = 56; // order side. 1 for buy and 2 for sell. (optional)
    -Long *start = 789; // start time in Milliseconds (optional)
    -String *symbol = symbol_example; // symbol (optional)
    -Integer *total = 56; // total number required, 0 for not required and 1 for required; default not required, return total=-1 in response (optional)
     
    -TradeApi *apiInstance = [[TradeApi alloc] init];
    -
    -// Get market trades.
    -[apiInstance getTradesWith:address
    -    buyerOrderId:buyerOrderId
    -    end:end
    -    height:height
    -    limit:limit
    +TokensApi *apiInstance = [[TokensApi alloc] init];
    +
    +// Get tokens list.
    +[apiInstance getTokensWith:limit
         offset:offset
    -    quoteAsset:quoteAsset
    -    sellerOrderId:sellerOrderId
    -    side:side
    -    start:start
    -    symbol:symbol
    -    total:total
    -              completionHandler: ^(TradePage output, NSError* error) {
    +              completionHandler: ^(array[Token] output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
                                 }
    @@ -13789,23 +9633,13 @@ 

    Usage and SDK Samples

    -
    +
    var HttpApi = require('http_api');
     
    -var api = new HttpApi.TradeApi()
    +var api = new HttpApi.TokensApi()
     var opts = { 
    -  'address': address_example, // {{String}} the buyer/seller address
    -  'buyerOrderId': buyerOrderId_example, // {{String}} buyer order id
    -  'end': 789, // {{Long}} end time in Milliseconds
    -  'height': 789, // {{Long}} block height
    -  'limit': 56, // {{Integer}} default 500; max 1000.
    -  'offset': 56, // {{Integer}} start with 0; default 0.
    -  'quoteAsset': quoteAsset_example, // {{String}} quote asset
    -  'sellerOrderId': sellerOrderId_example, // {{String}} seller order id
    -  'side': 56, // {{Integer}} order side. 1 for buy and 2 for sell.
    -  'start': 789, // {{Long}} start time in Milliseconds
    -  'symbol': symbol_example, // {{String}} symbol
    -  'total': 56 // {{Integer}} total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
    +  'limit': 56, // {{Integer}} default 100.
    +  'offset': 56 // {{Integer}} start with 0; default 0.
     };
     var callback = function(error, data, response) {
       if (error) {
    @@ -13814,14 +9648,14 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.getTrades(opts, callback); +api.getTokens(opts, callback);
    - -
    +
    using System;
     using System.Diagnostics;
     using IO.Swagger.Api;
    @@ -13830,34 +9664,24 @@ 

    Usage and SDK Samples

    namespace Example { - public class getTradesExample + public class getTokensExample { public void main() { - var apiInstance = new TradeApi(); - var address = address_example; // String | the buyer/seller address (optional) - var buyerOrderId = buyerOrderId_example; // String | buyer order id (optional) - var end = 789; // Long | end time in Milliseconds (optional) - var height = 789; // Long | block height (optional) - var limit = 56; // Integer | default 500; max 1000. (optional) (default to 500) + var apiInstance = new TokensApi(); + var limit = 56; // Integer | default 100. (optional) (default to 100) var offset = 56; // Integer | start with 0; default 0. (optional) (default to 0) - var quoteAsset = quoteAsset_example; // String | quote asset (optional) - var sellerOrderId = sellerOrderId_example; // String | seller order id (optional) - var side = 56; // Integer | order side. 1 for buy and 2 for sell. (optional) - var start = 789; // Long | start time in Milliseconds (optional) - var symbol = symbol_example; // String | symbol (optional) - var total = 56; // Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response (optional) try { - // Get market trades. - TradePage result = apiInstance.getTrades(address, buyerOrderId, end, height, limit, offset, quoteAsset, sellerOrderId, side, start, symbol, total); + // Get tokens list. + array[Token] result = apiInstance.getTokens(limit, offset); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling TradeApi.getTrades: " + e.Message ); + Debug.Print("Exception when calling TokensApi.getTokens: " + e.Message ); } } } @@ -13865,62 +9689,42 @@

    Usage and SDK Samples

    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new Swagger\Client\ApiTradeApi();
    -$address = address_example; // String | the buyer/seller address
    -$buyerOrderId = buyerOrderId_example; // String | buyer order id
    -$end = 789; // Long | end time in Milliseconds
    -$height = 789; // Long | block height
    -$limit = 56; // Integer | default 500; max 1000.
    +$api_instance = new Swagger\Client\ApiTokensApi();
    +$limit = 56; // Integer | default 100.
     $offset = 56; // Integer | start with 0; default 0.
    -$quoteAsset = quoteAsset_example; // String | quote asset
    -$sellerOrderId = sellerOrderId_example; // String | seller order id
    -$side = 56; // Integer | order side. 1 for buy and 2 for sell.
    -$start = 789; // Long | start time in Milliseconds
    -$symbol = symbol_example; // String | symbol
    -$total = 56; // Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
     
     try {
    -    $result = $api_instance->getTrades($address, $buyerOrderId, $end, $height, $limit, $offset, $quoteAsset, $sellerOrderId, $side, $start, $symbol, $total);
    +    $result = $api_instance->getTokens($limit, $offset);
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling TradeApi->getTrades: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling TokensApi->getTokens: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use WWW::SwaggerClient::Configuration;
    -use WWW::SwaggerClient::TradeApi;
    -
    -my $api_instance = WWW::SwaggerClient::TradeApi->new();
    -my $address = address_example; # String | the buyer/seller address
    -my $buyerOrderId = buyerOrderId_example; # String | buyer order id
    -my $end = 789; # Long | end time in Milliseconds
    -my $height = 789; # Long | block height
    -my $limit = 56; # Integer | default 500; max 1000.
    +use WWW::SwaggerClient::TokensApi;
    +
    +my $api_instance = WWW::SwaggerClient::TokensApi->new();
    +my $limit = 56; # Integer | default 100.
     my $offset = 56; # Integer | start with 0; default 0.
    -my $quoteAsset = quoteAsset_example; # String | quote asset
    -my $sellerOrderId = sellerOrderId_example; # String | seller order id
    -my $side = 56; # Integer | order side. 1 for buy and 2 for sell.
    -my $start = 789; # Long | start time in Milliseconds
    -my $symbol = symbol_example; # String | symbol
    -my $total = 56; # Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response
     
     eval { 
    -    my $result = $api_instance->getTrades(address => $address, buyerOrderId => $buyerOrderId, end => $end, height => $height, limit => $limit, offset => $offset, quoteAsset => $quoteAsset, sellerOrderId => $sellerOrderId, side => $side, start => $start, symbol => $symbol, total => $total);
    +    my $result = $api_instance->getTokens(limit => $limit, offset => $offset);
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling TradeApi->getTrades: $@\n";
    +    warn "Exception when calling TokensApi->getTokens: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_client
    @@ -13928,26 +9732,16 @@ 

    Usage and SDK Samples

    from pprint import pprint # create an instance of the API class -api_instance = swagger_client.TradeApi() -address = address_example # String | the buyer/seller address (optional) -buyerOrderId = buyerOrderId_example # String | buyer order id (optional) -end = 789 # Long | end time in Milliseconds (optional) -height = 789 # Long | block height (optional) -limit = 56 # Integer | default 500; max 1000. (optional) (default to 500) +api_instance = swagger_client.TokensApi() +limit = 56 # Integer | default 100. (optional) (default to 100) offset = 56 # Integer | start with 0; default 0. (optional) (default to 0) -quoteAsset = quoteAsset_example # String | quote asset (optional) -sellerOrderId = sellerOrderId_example # String | seller order id (optional) -side = 56 # Integer | order side. 1 for buy and 2 for sell. (optional) -start = 789 # Long | start time in Milliseconds (optional) -symbol = symbol_example # String | symbol (optional) -total = 56 # Integer | total number required, 0 for not required and 1 for required; default not required, return total=-1 in response (optional) try: - # Get market trades. - api_response = api_instance.get_trades(address=address, buyerOrderId=buyerOrderId, end=end, height=height, limit=limit, offset=offset, quoteAsset=quoteAsset, sellerOrderId=sellerOrderId, side=side, start=start, symbol=symbol, total=total) + # Get tokens list. + api_response = api_instance.get_tokens(limit=limit, offset=offset) pprint(api_response) except ApiException as e: - print("Exception when calling TradeApi->getTrades: %s\n" % e)
    + print("Exception when calling TokensApi->getTokens: %s\n" % e)
    @@ -13963,93 +9757,11 @@

    Parameters

    Name Description - address - - - -
    -
    -
    - - String - - -
    - the buyer/seller address -
    -
    -
    -
    - - - buyerOrderId - - - -
    -
    -
    - - String - - -
    - buyer order id -
    -
    -
    -
    - - - end - - - -
    -
    -
    - - Long - - - (int64) - - -
    - end time in Milliseconds -
    -
    -
    -
    - - - height - - - -
    -
    -
    - - Long - - - (int64) - - -
    - block height -
    -
    -
    -
    - - limit -
    +
    @@ -14060,7 +9772,7 @@

    Parameters

    - default 500; max 1000. + default 100.
    @@ -14071,7 +9783,7 @@

    Parameters

    -
    +
    @@ -14089,152 +9801,33 @@

    Parameters

    - quoteAsset - - - -
    -
    -
    - - String - - -
    - quote asset -
    -
    -
    -
    - - - sellerOrderId - - - -
    -
    -
    - - String - - -
    - seller order id -
    -
    -
    -
    - - - side - - - -
    -
    -
    - - Integer - - - (int32) - - -
    - order side. 1 for buy and 2 for sell. -
    -
    -
    -
    - - - start - - - -
    -
    -
    - - Long - - - (int64) - - -
    - start time in Milliseconds -
    -
    -
    -
    - - - symbol - - - -
    -
    -
    - - String - - -
    - symbol -
    -
    -
    -
    - - - total - - - -
    -
    -
    - - Integer - - - (int32) - - -
    - total number required, 0 for not required and 1 for required; default not required, return total=-1 in response -
    -
    -
    -
    - -

    Responses

    -

    Status: 200 - OK

    +

    Status: 200 - Success

    -
    -
    +
    +
    - +
    @@ -14267,14 +9860,14 @@

    Status: 400 - Bad Request

    -
    -
    +
    +
    - +
    @@ -14323,14 +9916,14 @@

    Status: default - Generic error response

    -
    -
    +
    +
    - +
    diff --git a/swagger.json b/swagger.json index 61328fd0c8..bbbb38eb81 100644 --- a/swagger.json +++ b/swagger.json @@ -2,7 +2,7 @@ "openapi": "3.0.0", "info": { "title": "HTTP API", - "description": "The Binance Chain HTTP API provides access to a Binance Chain node deployment and market data services.", + "description": "The Binance Chain HTTP API provides access to a Beacon Chain node deployment and related data services.", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" @@ -36,18 +36,6 @@ "name": "tokens", "description": "Access to tokens metadata" }, - { - "name": "market", - "description": "Access to DEX market data" - }, - { - "name": "order", - "description": "Access to historical orders" - }, - { - "name": "trade", - "description": "Access to historical trading activity" - }, { "name": "userdata", "description": "Access to an individual user's trading activity" @@ -490,79 +478,6 @@ } } }, - "/api/v1/markets": { - "get": { - "tags": [ - "market" - ], - "summary": "Get market pairs.", - "description": "Gets the list of market pairs that have been listed.\n\n**Destination:** Witness node.\n\n**Rate Limit:** 1 request per IP per second.\n\n**URL for mainnet:** [https://dex.binance.org/api/v1/markets](https://dex.binance.org/api/v1/markets)\n\n**URL for testnet:** [https://testnet-dex.binance.org/api/v1/markets](https://testnet-dex.binance.org/api/v1/markets)\n", - "operationId": "getPairs", - "parameters": [ - { - "name": "limit", - "in": "query", - "description": "default 500; max 1000.", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 500 - } - }, - { - "name": "offset", - "in": "query", - "description": "start with 0; default 0.", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Market" - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not Found", - "content": {} - }, - "default": { - "description": "Generic error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - } - } - }, "/api/v1/fees": { "get": { "tags": [ @@ -599,81 +514,6 @@ } } }, - "/api/v1/depth": { - "get": { - "tags": [ - "market" - ], - "summary": "Get the order book.", - "description": "Gets the order book depth data for a given pair symbol.\n\nThe given _limit_ must be one of the allowed limits below.\n\n**Destination:** Validator node.\n\n**Rate Limit:** 10 requests per IP per second.\n\n**URL for mainnet:** [https://dex.binance.org/api/v1/depth?symbol=xxx-000_BNB](https://dex.binance.org/api/v1/depth?symbol=xxx-000_BNB)\n\n**URL for testnet:** [https://testnet-dex.binance.org/api/v1/depth?symbol=xxx-000_BNB](https://testnet-dex.binance.org/api/v1/depth?symbol=xxx-000_BNB)\n", - "operationId": "getDepth", - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Market pair symbol, e.g. NNB-0AD_BNB", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "description": "The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000]", - "schema": { - "type": "integer", - "format": "int32", - "enum": [ - 5, - 10, - 20, - 50, - 100, - 500, - 1000 - ] - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MarketDepth" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not Found", - "content": {} - }, - "default": { - "description": "Generic error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - } - } - }, "/api/v1/broadcast": { "post": { "tags": [ @@ -704,631 +544,18 @@ } } }, - "required": true - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Transaction" - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "401": { - "description": "Bad Signature", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not Found", - "content": {} - }, - "default": { - "description": "Generic error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "x-codegen-request-body-name": "body" - } - }, - "/api/v1/klines": { - "get": { - "tags": [ - "market" - ], - "summary": "Get candlestick bars.", - "description": "Gets candlestick/kline bars for a symbol. Bars are uniquely identified by their open time.\n\nIf the time window is larger than limits, only the first n klines will return. In this case, please either shrink the window or increase the limit to get proper amount of klines.\n\n**Rate Limit:** 10 requests per IP per second.\n\n**URL for mainnet:** [https://dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m](https://dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m)\n\n\n**URL for testnet:** [https://testnet-dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m](https://testnet-dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m)\n\n**Example**\n\n```\n[\n 1499040000000, // Open time\n \"0.01634790\", // Open\n \"0.80000000\", // High\n \"0.01575800\", // Low\n \"0.01577100\", // Close\n \"148976.11427815\", // Volume\n 1499644799999, // Close time\n \"2434.19055334\", // Quote asset volume\n 308 // Number of trades\n]\n```\n", - "operationId": "getCandlestickBars", - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "interval", - "in": "query", - "description": "interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M]", - "required": true, - "allowEmptyValue": false, - "schema": { - "type": "string", - "enum": [ - "1m", - "3m", - "5m", - "15m", - "30m", - "1h", - "2h", - "4h", - "6h", - "8h", - "12h", - "1d", - "3d", - "1w", - "1M" - ] - } - }, - { - "name": "limit", - "in": "query", - "description": "default 300; max 1000.", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "startTime", - "in": "query", - "description": "start time in Milliseconds", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endTime", - "in": "query", - "description": "end time in Milliseconds", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "example": " [[\n1499040000000, // Open time\n\"0.01634790\", // Open\n\"0.80000000\", // High\n\"0.01575800\", // Low\n\"0.01577100\", // Close\n\"148976.11427815\", // Volume\n1499644799999, // Close time\n\"2434.19055334\", // Quote asset volume\n308 // Number of trades\n]] ", - "items": { - "$ref": "#/components/schemas/Candlestick" - } - } - } - } - } - }, - "deprecated": false - } - }, - "/api/v1/orders/closed": { - "get": { - "tags": [ - "order" - ], - "summary": "Get closed orders.", - "description": "Gets closed (filled and cancelled) orders for a given address.\n\n**Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months.\n\n**Rate Limit:** 5 requests per IP per second.\n", - "operationId": "getClosedOrders", - "parameters": [ - { - "name": "address", - "in": "query", - "description": "the owner address", - "required": true, - "allowEmptyValue": false, - "schema": { - "type": "string" - } - }, - { - "name": "end", - "in": "query", - "description": "end time in Milliseconds", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "default 500; max 1000.", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 500 - } - }, - { - "name": "offset", - "in": "query", - "description": "start with 0; default 0.", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "side", - "in": "query", - "description": "order side. 1 for buy and 2 for sell.", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "start", - "in": "query", - "description": "start time in Milliseconds", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "status", - "in": "query", - "description": "order status list. \nAllowed value: [Ack, IocExpire, IocNoFill,\nFullyFill, Canceled, Expired, FailedBlocking, FailedMatching]\n", - "allowEmptyValue": false, - "schema": { - "type": "string" - } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "schema": { - "type": "string" - } - }, - { - "name": "total", - "in": "query", - "description": "total number required, 0 for not required and 1 for required; default not required, return total=-1 in response", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32", - "enum": [ - 0, - 1 - ] - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OrderList" - } - } - } - } - }, - "deprecated": false - } - }, - "/api/v1/orders/open": { - "get": { - "tags": [ - "order" - ], - "summary": "Get open orders.", - "description": "Gets open orders for a given address.\n\n**Rate Limit:** 5 requests per IP per second.\n", - "operationId": "getOpenOrders", - "parameters": [ - { - "name": "address", - "in": "query", - "description": "the owner address", - "required": true, - "allowEmptyValue": false, - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "description": "default 500; max 1000.", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 500 - } - }, - { - "name": "offset", - "in": "query", - "description": "start with 0; default 0.", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "schema": { - "type": "string" - } - }, - { - "name": "total", - "in": "query", - "description": "total number required, 0 for not required and 1 for required; default not required, return total=-1 in response", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32", - "enum": [ - 0, - 1 - ] - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OrderList" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not Found", - "content": {} - }, - "default": { - "description": "Generic error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "deprecated": false - } - }, - "/api/v1/orders/{id}": { - "get": { - "tags": [ - "order" - ], - "summary": "Get an order.", - "description": "Gets metadata for an individual order by its ID.\n\n**Rate Limit:** 5 requests per IP per second.\n", - "operationId": "getOrder", - "parameters": [ - { - "name": "id", - "in": "path", - "description": "order id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Order" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not Found", - "content": {} - }, - "default": { - "description": "Generic error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "deprecated": false - } - }, - "/api/v1/ticker/24hr": { - "get": { - "tags": [ - "market" - ], - "summary": "Get a market ticker.", - "description": "Gets 24 hour price change statistics for a market pair symbol. Updated every second.\n\n**Rate Limit:** 5 requests per IP per second.\n", - "operationId": "get24HrPriceStatistics", - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TickerStatistics" - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "404": { - "description": "Not Found", - "content": {} - }, - "default": { - "description": "Generic error response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - }, - "deprecated": false - } - }, - "/api/v1/trades": { - "get": { - "tags": [ - "trade" - ], - "summary": "Get market trades.", - "description": "Gets a list of historical trades.\n\n**Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months.\n\n**Rate Limit:** 5 requests per IP per second.\n", - "operationId": "getTrades", - "parameters": [ - { - "name": "address", - "in": "query", - "description": "the buyer/seller address", - "allowEmptyValue": false, - "schema": { - "type": "string" - } - }, - { - "name": "buyerOrderId", - "in": "query", - "description": "buyer order id", - "allowEmptyValue": false, - "schema": { - "type": "string" - } - }, - { - "name": "end", - "in": "query", - "description": "end time in Milliseconds", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "height", - "in": "query", - "description": "block height", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "default 500; max 1000.", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 500 - } - }, - { - "name": "offset", - "in": "query", - "description": "start with 0; default 0.", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "quoteAsset", - "in": "query", - "description": "quote asset", - "allowEmptyValue": false, - "schema": { - "type": "string" - } - }, - { - "name": "sellerOrderId", - "in": "query", - "description": "seller order id", - "allowEmptyValue": false, - "schema": { - "type": "string" - } - }, - { - "name": "side", - "in": "query", - "description": "order side. 1 for buy and 2 for sell.", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "start", - "in": "query", - "description": "start time in Milliseconds", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "schema": { - "type": "string" - } - }, - { - "name": "total", - "in": "query", - "description": "total number required, 0 for not required and 1 for required; default not required, return total=-1 in response", - "allowEmptyValue": false, - "schema": { - "type": "integer", - "format": "int32", - "enum": [ - 0, - 1 - ] - } - } - ], + "required": true + }, "responses": { "200": { - "description": "OK", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TradePage" + "type": "array", + "items": { + "$ref": "#/components/schemas/Transaction" + } } } } @@ -1343,6 +570,16 @@ } } }, + "401": { + "description": "Bad Signature", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, "404": { "description": "Not Found", "content": {} @@ -1358,7 +595,7 @@ } } }, - "deprecated": false + "x-codegen-request-body-name": "body" } }, "/api/v1/block-exchange-fee": { @@ -2309,48 +1546,6 @@ } } }, - "Market": { - "required": [ - "base_asset_symbol", - "list_price", - "lot_size", - "quote_asset_symbol", - "tick_size" - ], - "type": "object", - "properties": { - "base_asset_symbol": { - "type": "string", - "description": "symbol of base asset", - "format": "currency", - "example": "BNB" - }, - "quote_asset_symbol": { - "type": "string", - "description": "symbol of quote asset", - "format": "currency", - "example": "ABC-5CA" - }, - "list_price": { - "type": "string", - "description": "In decimal form", - "format": "fixed8", - "example": "1.00000000" - }, - "tick_size": { - "type": "string", - "description": "Minimium price change in decimal form", - "format": "fixed8", - "example": "0.00000001" - }, - "lot_size": { - "type": "string", - "description": "Minimium trading quantity in decimal form", - "format": "fixed8", - "example": "1.00000000" - } - } - }, "Fee": { "type": "object", "properties": { @@ -2432,176 +1627,6 @@ } } }, - "MarketDepth": { - "required": [ - "asks", - "bids" - ], - "type": "object", - "properties": { - "asks": { - "maxItems": 2, - "minItems": 2, - "type": "array", - "description": "Price and qty in decimal form, e.g. 1.00000000", - "example": "[\"1.00000000\",\"800.00000000\"]", - "items": { - "type": "string", - "format": "fixed8" - } - }, - "bids": { - "maxItems": 2, - "minItems": 2, - "type": "array", - "description": "Price and qty in decimal form, e.g. 1.00000000", - "example": "[\"1.00000000\",\"800.00000000\"]", - "items": { - "type": "string", - "format": "fixed8" - } - } - } - }, - "Candlestick": { - "type": "object", - "properties": { - "close": { - "type": "number", - "description": "closing price" - }, - "closeTime": { - "type": "integer", - "description": "time of closing trade", - "format": "int64" - }, - "high": { - "type": "number", - "description": "the highest price" - }, - "low": { - "type": "number", - "description": "the lowest price" - }, - "numberOfTrades": { - "type": "integer", - "description": "total trades", - "format": "int32" - }, - "open": { - "type": "number", - "description": "open price" - }, - "openTime": { - "type": "integer", - "description": "time of open trade", - "format": "int64" - }, - "quoteAssetVolume": { - "type": "number", - "description": "the total trading volume in quote asset" - }, - "volume": { - "type": "number", - "description": "the total trading volume" - } - } - }, - "OrderList": { - "type": "object", - "properties": { - "order": { - "type": "array", - "description": "list of orders", - "items": { - "$ref": "#/components/schemas/Order" - } - }, - "total": { - "type": "integer", - "format": "int64" - } - } - }, - "Order": { - "title": "Order", - "type": "object", - "properties": { - "cumulateQuantity": { - "type": "string", - "description": "total amount of trades that have made" - }, - "fee": { - "type": "string", - "description": "trading fee on the latest updated block of this order. Multiple assets are split by semicolon." - }, - "lastExecutedPrice": { - "type": "string", - "description": "price of last execution" - }, - "lastExecutedQuantity": { - "type": "string", - "description": "quantity of last execution" - }, - "orderCreateTime": { - "type": "string", - "description": "time of order creation", - "format": "date-time" - }, - "orderId": { - "type": "string", - "description": "order ID" - }, - "owner": { - "type": "string", - "description": "order issuer" - }, - "price": { - "type": "string", - "description": "order price" - }, - "quantity": { - "type": "string", - "description": "order quantity" - }, - "side": { - "type": "integer", - "description": "1 for buy and 2 for sell", - "format": "int32" - }, - "status": { - "type": "string", - "description": "enum [Ack, PartialFill, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching, IocExpire]" - }, - "symbol": { - "type": "string", - "description": "trading pair symbol" - }, - "timeInForce": { - "type": "integer", - "description": "1 for Good Till Expire(GTE) order and 3 for Immediate Or Cancel (IOC)", - "format": "int32" - }, - "tradeId": { - "type": "string", - "description": "trade ID" - }, - "transactionHash": { - "type": "string", - "description": "hash of transaction" - }, - "transactionTime": { - "type": "string", - "description": "time of latest order update, for example, cancel, expire", - "format": "date-time" - }, - "type": { - "type": "integer", - "description": "only 2 is available for now, meaning limit order", - "format": "int32" - } - } - }, "SubTx": { "title": "SubTx", "type": "object", @@ -2633,202 +1658,6 @@ } } }, - "TickerStatistics": { - "title": "TickerStatistics", - "type": "object", - "properties": { - "askPrice": { - "type": "string", - "description": "sell price" - }, - "askQuantity": { - "type": "string", - "description": "sell quantity" - }, - "bidPrice": { - "type": "string", - "description": "buy price" - }, - "bidQuantity": { - "type": "string", - "description": "buy quantity" - }, - "closeTime": { - "type": "integer", - "description": "time of closing", - "format": "int64" - }, - "count": { - "type": "integer", - "description": "total trade count", - "format": "int64" - }, - "firstId": { - "type": "string", - "description": "ID of first trade" - }, - "highPrice": { - "type": "string", - "description": "highest price" - }, - "lastId": { - "type": "string", - "description": "ID of last trade" - }, - "lastPrice": { - "type": "string", - "description": "last price" - }, - "lastQuantity": { - "type": "string", - "description": "last quantity" - }, - "lowPrice": { - "type": "string", - "description": "lowest price" - }, - "openPrice": { - "type": "string", - "description": "open price" - }, - "openTime": { - "type": "integer", - "description": "open time", - "format": "int64" - }, - "prevClosePrice": { - "type": "string", - "description": "last close price" - }, - "priceChange": { - "type": "string", - "description": "change of price" - }, - "priceChangePercent": { - "type": "string", - "description": "change of price in percentage" - }, - "quoteVolume": { - "type": "string", - "description": "trading volume in quote asset" - }, - "symbol": { - "type": "string", - "description": "trading symbol" - }, - "volume": { - "type": "string", - "description": "trading volume" - }, - "weightedAvgPrice": { - "type": "string", - "description": "weighted average price" - } - } - }, - "TradePage": { - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "total number of trades", - "format": "int64" - }, - "trade": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Trade" - } - } - } - }, - "Trade": { - "type": "object", - "properties": { - "baseAsset": { - "type": "string", - "description": "base asset symbol" - }, - "blockHeight": { - "type": "integer", - "description": "block height", - "format": "int64" - }, - "buyFee": { - "type": "string", - "description": "trading fee for the buyer address on the block of this trade" - }, - "buyerId": { - "type": "string", - "description": "id of buyer" - }, - "buyerOrderId": { - "type": "string", - "description": "order id for buyer" - }, - "buySingleFee": { - "type": "string", - "description": "trading fee for the buyer address on this single trade", - "example": "BNB:0.00000172;" - }, - "buyerSource": { - "type": "integer", - "description": "tx source of buy order", - "example": 1 - }, - "price": { - "type": "string", - "description": "trade price" - }, - "quantity": { - "type": "string", - "description": "trade quantity" - }, - "quoteAsset": { - "type": "string", - "description": "quote asset symbol" - }, - "sellFee": { - "type": "string", - "description": "trading fee for the seller address on the block of this trade" - }, - "sellerId": { - "type": "string", - "description": "seller ID" - }, - "sellerOrderId": { - "type": "string", - "description": "seller order ID" - }, - "sellSingleFee": { - "type": "string", - "description": "trading fee for the seller address on this single trade", - "example": "BNB:0.00000216;" - }, - "sellerSource": { - "type": "integer", - "description": "tx source of sell order", - "example": 1 - }, - "symbol": { - "type": "string", - "description": "asset symbol" - }, - "tickType": { - "type": "string", - "description": "enum [Unknown,SellTaker,BuyTaker,BuySurplus,SellSurplus,Neutral]" - }, - "time": { - "type": "integer", - "description": "trade time", - "format": "int64" - }, - "tradeId": { - "type": "string", - "description": "trade ID" - } - } - }, "BlockExchangeFeePage": { "title": "BlockExchangeFeePage", "type": "object", diff --git a/swagger.yml b/swagger.yml index d840c00bfd..38b8c70f84 100644 --- a/swagger.yml +++ b/swagger.yml @@ -3,7 +3,7 @@ info: title: 'HTTP API' version: 1.0.0 description: | - Within the ecosystem of Binance Chain, there are several accelerated nodes which provides more secure and faster lines to access Binance Chain and DEX data service including HTTP API. + Within the ecosystem of Binance Chain, there are several accelerated nodes which provides more secure and faster lines to access Binance Chain data service including HTTP API. For mainnet, there are more accelerated nodes. @@ -35,15 +35,6 @@ tags: - name: tokens description: 'Access to tokens metadata' -- - name: market - description: 'Access to DEX market data' -- - name: order - description: 'Access to historical orders' -- - name: trade - description: 'Access to historical trading activity' - name: userdata description: 'Access to an individual user''s trading activity' @@ -442,58 +433,6 @@ paths: description: Generic error response schema: $ref: "#/definitions/Error" - /api/v1/markets: - get: - tags: - - market - summary: Get market pairs. - description: | - Gets the list of market pairs that have been listed. - - **Destination:** Witness node. - - **Rate Limit:** 1 request per IP per second. - - **URL for mainnet:** [https://dex.binance.org/api/v1/markets](https://dex.binance.org/api/v1/markets) - - **URL for testnet:** [https://testnet-dex.binance.org/api/v1/markets](https://testnet-dex.binance.org/api/v1/markets) - operationId: getPairs - produces: - - application/json - parameters: - - name: limit - in: query - description: default 500; max 1000. - required: false - type: integer - default: 500 - format: int32 - allowEmptyValue: false - - name: offset - in: query - description: start with 0; default 0. - required: false - type: integer - default: 0 - format: int32 - allowEmptyValue: false - responses: - '200': - description: Success - schema: - type: array - items: - $ref: '#/definitions/Market' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" /api/v1/fees: get: summary: Obtain trading fees information. @@ -525,63 +464,6 @@ paths: description: Generic error response schema: $ref: "#/definitions/Error" - /api/v1/depth: - get: - tags: - - market - summary: Get the order book. - description: | - Gets the order book depth data for a given pair symbol. - - The given _limit_ must be one of the allowed limits below. - - **Destination:** Validator node. - - **Rate Limit:** 10 requests per IP per second. - - **URL for mainnet:** [https://dex.binance.org/api/v1/depth?symbol=xxx-000_BNB](https://dex.binance.org/api/v1/depth?symbol=xxx-000_BNB) - - **URL for testnet:** [https://testnet-dex.binance.org/api/v1/depth?symbol=xxx-000_BNB](https://testnet-dex.binance.org/api/v1/depth?symbol=xxx-000_BNB) - operationId: getDepth - produces: - - application/json - parameters: - - - in: query - name: symbol - description: Market pair symbol, e.g. NNB-0AD_BNB - required: true - type: string - - - in: query - name: limit - description: "The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000]" - required: false - type: integer - format: int32 - enum: - - 5 - - 10 - - 20 - - 50 - - 100 - - 500 - - 1000 - responses: - '200': - description: Success - schema: - $ref: "#/definitions/MarketDepth" - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" /api/v1/broadcast: post: tags: @@ -641,154 +523,38 @@ paths: description: Generic error response schema: $ref: "#/definitions/Error" - /api/v1/klines: - get: - tags: - - market - summary: Get candlestick bars. - description: | - Gets candlestick/kline bars for a symbol. Bars are uniquely identified by their open time. - - If the time window is larger than limits, only the first n klines will return. In this case, please either shrink the window or increase the limit to get proper amount of klines. - - **Rate Limit:** 10 requests per IP per second. - - **URL for mainnet:** [https://dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m](https://dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m) - - - **URL for testnet:** [https://testnet-dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m](https://testnet-dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m) - - **Example** - - ``` - [ - 1499040000000, // Open time - "0.01634790", // Open - "0.80000000", // High - "0.01575800", // Low - "0.01577100", // Close - "148976.11427815", // Volume - 1499644799999, // Close time - "2434.19055334", // Quote asset volume - 308 // Number of trades - ] - ``` - operationId: getCandlestickBars - produces: - - application/json - parameters: - - name: symbol - in: query - description: symbol - required: true - type: string - - name: interval - in: query - description: "interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M]" - required: true - type: enum string - allowEmptyValue: false - enum: - - 1m - - 3m - - 5m - - 15m - - 30m - - 1h - - 2h - - 4h - - 6h - - 8h - - 12h - - 1d - - 3d - - 1w - - 1M - - name: limit - in: query - description: default 300; max 1000. - required: false - type: integer - format: int32 - allowEmptyValue: false - - name: startTime - in: query - description: start time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: endTime - in: query - description: end time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - responses: - '200': - description: OK - schema: - type: array - items: - $ref: '#/definitions/Candlestick' - example: ' [[ - - 1499040000000, // Open time - - "0.01634790", // Open - - "0.80000000", // High - - "0.01575800", // Low - - "0.01577100", // Close - - "148976.11427815", // Volume - - 1499644799999, // Close time - - "2434.19055334", // Quote asset volume - - 308 // Number of trades - - ]] ' - deprecated: false - /api/v1/orders/closed: + /api/v1/block-exchange-fee: get: tags: - - order - summary: Get closed orders. + - trading fee + summary: Trading fee of the address grouped by block description: | - Gets closed (filled and cancelled) orders for a given address. - + Get historical trading fees of the address, including fees of trade/canceled order/expired order. Transfer and other transaction fees are not included. Order by block height DESC. **Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - **Rate Limit:** 5 requests per IP per second. - - operationId: getClosedOrders + operationId: getBlockExchangeFee produces: - application/json parameters: - name: address in: query - description: the owner address - required: true + description: the seller/buyer address + required: false type: string allowEmptyValue: false - name: end in: query - description: end time in Milliseconds + description: end time required: false type: integer format: int64 allowEmptyValue: false - name: limit in: query - description: default 500; max 1000. + description: default 50; max 1000. required: false type: integer - default: 500 + default: 50 format: int32 allowEmptyValue: false - name: offset @@ -799,16 +565,6 @@ paths: default: 0 format: int32 allowEmptyValue: false - - name: side - in: query - description: order side. 1 for buy and 2 for sell. - required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - BUY - - SELL - name: start in: query description: start time in Milliseconds @@ -816,20 +572,6 @@ paths: type: integer format: int64 allowEmptyValue: false - - name: status - in: query - description: "order status list. Allowed value: [Ack, IocExpire, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching]" - required: false - type: enum string - items: - type: string - collectionFormat: multi - allowEmptyValue: false - - name: symbol - in: query - description: symbol - required: false - type: string - name: total in: query description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' @@ -844,963 +586,232 @@ paths: '200': description: OK schema: - $ref: '#/definitions/OrderList' + $ref: '#/definitions/BlockExchangeFeePage' deprecated: false - /api/v1/orders/open: + /api/v1/transactions: get: tags: - - order - summary: Get open orders. + - transaction + summary: Get transactions. description: | - Gets open orders for a given address. + Gets a list of transactions. Multisend transaction is not available in this API. Currently 'confirmBlocks' and 'txAge' are not supported. - **Rate Limit:** 5 requests per IP per second. - operationId: getOpenOrders + **Query Window:** Default query window is latest 24 hours; The maximum start - end query window is 3 months. + + **Rate Limit:** 60 requests per IP per minute. + operationId: txns produces: - application/json parameters: - name: address in: query - description: the owner address + description: address required: true type: string - allowEmptyValue: false + - name: blockHeight + in: query + description: blockHeight + required: false + type: integer + format: int64 + - name: endTime + in: query + description: endTime in Milliseconds + required: false + type: integer + format: int64 - name: limit in: query - description: default 500; max 1000. + description: limit required: false type: integer default: 500 format: int32 - allowEmptyValue: false - name: offset in: query - description: start with 0; default 0. + description: offset required: false type: integer default: 0 format: int32 + - name: side + in: query + description: "transaction side. Allowed value: [ RECEIVE, SEND]" + required: false + type: enum string allowEmptyValue: false - - name: symbol + enum: + - RECEIVE + - SEND + - name: startTime + in: query + description: start time in Milliseconds + required: false + type: integer + format: int64 + - name: txAsset in: query - description: symbol + description: txAsset required: false type: string - - name: total + - name: txType in: query - description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' + description: "transaction type. Allowed value: [ NEW_ORDER,ISSUE_TOKEN,BURN_TOKEN,LIST_TOKEN,CANCEL_ORDER,FREEZE_TOKEN,UN_FREEZE_TOKEN,TRANSFER,PROPOSAL,VOTE,MINT,DEPOSIT,CREATE_VALIDATOR,REMOVE_VALIDATOR,TIME_LOCK,TIME_UNLOCK,TIME_RELOCK,SET_ACCOUNT_FLAG,HTL_TRANSFER,CLAIM_HTL,DEPOSIT_HTL,REFUND_HTL]" required: false - type: integer - format: int32 + type: enum string allowEmptyValue: false enum: - - 0 - - 1 + - TRANSFER + - NEW_ORDER + - ISSUE_TOKEN + - BURN_TOKEN + - LIST_TOKEN + - CANCEL_ORDER + - FREEZE_TOKEN + - UN_FREEZE_TOKEN + - TRANSFER + - PROPOSAL + - VOTE + - MINT + - DEPOSIT + - CREATE_VALIDATOR + - REMOVE_VALIDATOR + - TIME_LOCK + - TIME_UNLOCK + - TIME_RELOCK + - SET_ACCOUNT_FLAG + - HTL_TRANSFER + - CLAIM_HTL + - DEPOSIT_HTL + - REFUND_HTL responses: '200': description: OK schema: - $ref: '#/definitions/OrderList' + $ref: '#/definitions/TxPage' '400': description: 'Bad Request' schema: $ref: "#/definitions/Error" '404': description: 'Not Found' + '403': + description: 'Tx is not within 24h query window' default: description: Generic error response schema: $ref: "#/definitions/Error" - deprecated: false - /api/v1/orders/{id}: + /api/v1/transactions-in-block/{blockHeight}: get: tags: - - order - summary: Get an order. - description: | - Gets metadata for an individual order by its ID. - - **Rate Limit:** 5 requests per IP per second. - operationId: getOrder - produces: - - application/json - parameters: - - name: id - in: path - description: order id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/Order' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: false - /api/v1/ticker/24hr: - get: - tags: - - market - summary: Get a market ticker. - description: | - Gets 24 hour price change statistics for a market pair symbol. Updated every second. - - **Rate Limit:** 5 requests per IP per second. - operationId: get24HrPriceStatistics - produces: - - application/json - parameters: - - name: symbol - in: query - description: symbol - required: false - type: string - responses: - '200': - description: OK - schema: - type: array - items: - $ref: '#/definitions/TickerStatistics' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: false - /api/v1/trades: - get: - tags: - - trade - summary: Get market trades. - description: | - Gets a list of historical trades. - - **Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - - **Rate Limit:** 5 requests per IP per second. - operationId: getTrades - produces: - - application/json - parameters: - - name: address - in: query - description: the buyer/seller address - required: false - type: string - allowEmptyValue: false - - name: buyerOrderId - in: query - description: buyer order id - required: false - type: string - allowEmptyValue: false - - name: end - in: query - description: end time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: height - in: query - description: block height - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: limit - in: query - description: default 500; max 1000. - required: false - type: integer - default: 500 - format: int32 - allowEmptyValue: false - - name: offset - in: query - description: start with 0; default 0. - required: false - type: integer - default: 0 - format: int32 - allowEmptyValue: false - - name: quoteAsset - in: query - description: quote asset - required: false - type: string - allowEmptyValue: false - - name: sellerOrderId - in: query - description: seller order id - required: false - type: string - allowEmptyValue: false - - name: side - in: query - description: order side. 1 for buy and 2 for sell. - required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - BUY - - SELL - - name: start - in: query - description: start time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: symbol - in: query - description: symbol - required: false - type: string - - name: total - in: query - description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' - required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - 0 - - 1 - responses: - '200': - description: OK - schema: - $ref: '#/definitions/TradePage' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: false - /api/v1/block-exchange-fee: - get: - tags: - - trading fee - summary: Trading fee of the address grouped by block - description: | - Get historical trading fees of the address, including fees of trade/canceled order/expired order. Transfer and other transaction fees are not included. Order by block height DESC. - **Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - **Rate Limit:** 5 requests per IP per second. - operationId: getBlockExchangeFee - produces: - - application/json - parameters: - - name: address - in: query - description: the seller/buyer address - required: false - type: string - allowEmptyValue: false - - name: end - in: query - description: end time - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: limit - in: query - description: default 50; max 1000. - required: false - type: integer - default: 50 - format: int32 - allowEmptyValue: false - - name: offset - in: query - description: start with 0; default 0. - required: false - type: integer - default: 0 - format: int32 - allowEmptyValue: false - - name: start - in: query - description: start time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: total - in: query - description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' - required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - 0 - - 1 - responses: - '200': - description: OK - schema: - $ref: '#/definitions/BlockExchangeFeePage' - deprecated: false - /api/v1/transactions: - get: - tags: - - transaction - summary: Get transactions. - description: | - Gets a list of transactions. Multisend transaction is not available in this API. Currently 'confirmBlocks' and 'txAge' are not supported. - - **Query Window:** Default query window is latest 24 hours; The maximum start - end query window is 3 months. - - **Rate Limit:** 60 requests per IP per minute. - operationId: txns - produces: - - application/json - parameters: - - name: address - in: query - description: address - required: true - type: string - - name: blockHeight - in: query - description: blockHeight - required: false - type: integer - format: int64 - - name: endTime - in: query - description: endTime in Milliseconds - required: false - type: integer - format: int64 - - name: limit - in: query - description: limit - required: false - type: integer - default: 500 - format: int32 - - name: offset - in: query - description: offset - required: false - type: integer - default: 0 - format: int32 - - name: side - in: query - description: "transaction side. Allowed value: [ RECEIVE, SEND]" - required: false - type: enum string - allowEmptyValue: false - enum: - - RECEIVE - - SEND - - name: startTime - in: query - description: start time in Milliseconds - required: false - type: integer - format: int64 - - name: txAsset - in: query - description: txAsset - required: false - type: string - - name: txType - in: query - description: "transaction type. Allowed value: [ NEW_ORDER,ISSUE_TOKEN,BURN_TOKEN,LIST_TOKEN,CANCEL_ORDER,FREEZE_TOKEN,UN_FREEZE_TOKEN,TRANSFER,PROPOSAL,VOTE,MINT,DEPOSIT,CREATE_VALIDATOR,REMOVE_VALIDATOR,TIME_LOCK,TIME_UNLOCK,TIME_RELOCK,SET_ACCOUNT_FLAG,HTL_TRANSFER,CLAIM_HTL,DEPOSIT_HTL,REFUND_HTL]" - required: false - type: enum string - allowEmptyValue: false - enum: - - TRANSFER - - NEW_ORDER - - ISSUE_TOKEN - - BURN_TOKEN - - LIST_TOKEN - - CANCEL_ORDER - - FREEZE_TOKEN - - UN_FREEZE_TOKEN - - TRANSFER - - PROPOSAL - - VOTE - - MINT - - DEPOSIT - - CREATE_VALIDATOR - - REMOVE_VALIDATOR - - TIME_LOCK - - TIME_UNLOCK - - TIME_RELOCK - - SET_ACCOUNT_FLAG - - HTL_TRANSFER - - CLAIM_HTL - - DEPOSIT_HTL - - REFUND_HTL - responses: - '200': - description: OK - schema: - $ref: '#/definitions/TxPage' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - '403': - description: 'Tx is not within 24h query window' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - /api/v1/transactions-in-block/{blockHeight}: - get: - tags: - - transaction in block - summary: Get transactions in the specific block. - description: | - Get transactions in the block. Multi-send and multi-coin transactions are flattened as transactions. This API is deprecated. - - **Rate Limit:** 5 requests per IP per second. - - **Rate Limit:** 60 requests per IP per minute. - operationId: getTransactionsInBlock - produces: - - application/json - parameters: - - name: blockHeight - in: path - description: block height - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/BlockTx' - '400': - description: 'Bad Request. The block to query is higher than current highest block.' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: true - '/api/v2/transactions-in-block/{blockHeight}': - get: - tags: - - transaction - summary: transactions in Block - description: | - Get transactions in the block. Multi-send and multi-coin transactions are included as sub-transactions. - - **Rate Limit:** 5 request per IP per second. - - **Rate Limit:** 60 requests per IP per minute. - - operationId: getTransactionsInBlockV2 - produces: - - application/json - parameters: - - name: blockHeight - in: path - description: blockHeight - required: true - type: integer - format: int64 - responses: - '200': - description: OK - schema: - $ref: '#/definitions/BlockTxV2' - '400': - description: 'Bad Request. The block to query is higher than current highest block.' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: false - /api/v1/atomic-swaps: - get: - tags: - - atomicSwap - summary: AtomicSwap - description: | - Get atomic swaps by address. - - **Rate Limit:** 5 request per IP per second. - - **Rate Limit:** 60 requests per IP per minute. - - operationId: getAtomicSwapsByAddrUsingGET - produces: - - '*/*' - - application/json - parameters: - - name: endTime - in: query - description: end time of blockTimestamp - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: fromAddress - in: query - description: At least one of toAddress and fromAddress should be provided as parameter - required: false - type: string - allowEmptyValue: false - - name: limit - in: query - description: default 25; max 1000. - required: false - type: integer - default: 25 - format: int32 - - name: offset - in: query - description: start with 0; default 0. - required: false - type: integer - default: 0 - format: int32 - - name: startTime - in: query - description: start time of blockTimestamp in Milliseconds; The maximum start - end query window is 3 months; Default query window is the latest 30 days. - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: toAddress - in: query - description: At least one of toAddress and fromAddress should be provided as parameter - required: false - type: string - allowEmptyValue: false - responses: - '200': - description: OK - schema: - $ref: '#/definitions/AtomicSwapPage' - /api/v1/atomic-swaps/{id}: - get: - tags: - - atomicSwap - summary: AtomicSwap - description: | - Get an AtomicSwap by swap id - - **Rate Limit:** 5 request per IP per second. - - **Rate Limit:** 60 request per IP per minute. - operationId: getAtomicSwapUsingGET - produces: - - application/json - parameters: - - name: id - in: path - description: swap id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/AtomicSwap' - /api/v1/timelocks/{address}: - get: - summary: 'Gets time lock records given an address' - operationId: getTimeLocks - produces: - - application/json - tags: - - node - - account - responses: - '200': - description: Success - schema: - $ref: '#/definitions/TimeLocks' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '500': - description: 'internal server error' - schema: - $ref: "#/definitions/Error" - parameters: - - - name: address - in: path - type: string - description: 'The account address to query' - required: true - - - in: query - name: id - description: "the record id of timelock to query" - required: false - type: integer - format: int64 - /api/v1/timelock/{account_addr}?(id={recordid}): - get: - tags: - - timelock records - summary: Get timelock records of an address. - description: | - Get the timelock history of an address. - **Rate Limit:** 60 requests per IP per minute. - operationId: getTimeLocks - produces: - - application/json - parameters: - - name: address - in: path - type: string - description: 'The account address to query' - required: true - - in: query - name: id - description: "the record id of timelock to query" - required: false - type: integer - format: int64 - responses: - '200': - description: Success - schema: - $ref: '#/definitions/TimeLocks' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - '500': - description: 'internal server error' - schema: - $ref: "#/definitions/Error" - /api/v1/mini/tokens: - get: - tags: - - mini - summary: Gets a list of available mini tokens. - operationId: getMiniTokens - parameters: - - in: query - name: offset - description: offset - required: false - type: integer - default: 0 - format: int32 - - in: query - name: limit - description: limit - required: false - type: integer - default: 100 - format: int32 - produces: - - application/json - responses: - '200': - description: Success - schema: - $ref: '#/definitions/MiniTokens' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '500': - description: 'internal server error' - schema: - $ref: "#/definitions/Error" - /api/v1/mini/markets: - get: - tags: - - mini - summary: Gets a list of mini market pairs. - parameters: - - in: query - name: offset - description: offset - required: false - type: integer - default: 0 - format: int32 - - in: query - name: limit - description: limit - required: false - type: integer - default: 100 - format: int32 - operationId: getMiniPairs + - transaction in block + summary: Get transactions in the specific block. + description: | + Get transactions in the block. Multi-send and multi-coin transactions are flattened as transactions. This API is deprecated. + + **Rate Limit:** 5 requests per IP per second. + + **Rate Limit:** 60 requests per IP per minute. + operationId: getTransactionsInBlock produces: - application/json + parameters: + - name: blockHeight + in: path + description: block height + required: true + type: string responses: '200': - description: Success + description: OK schema: - $ref: '#/definitions/Markets' + $ref: '#/definitions/BlockTx' '400': - description: 'Bad Request' + description: 'Bad Request. The block to query is higher than current highest block.' + schema: + $ref: "#/definitions/Error" + '404': + description: 'Not Found' + default: + description: Generic error response schema: $ref: "#/definitions/Error" - /api/v1/mini/klines: + deprecated: true + '/api/v2/transactions-in-block/{blockHeight}': get: tags: - - market - summary: Get mini-token candlestick bars. + - transaction + summary: transactions in Block description: | - Gets candlestick/kline bars for a mini-token symbol pair. Bars are uniquely identified by their open time. - - If the time window is larger than limits, only the first n klines will return. In this case, please either shrink the window or increase the limit to get proper amount of klines. + Get transactions in the block. Multi-send and multi-coin transactions are included as sub-transactions. - **Rate Limit:** 10 requests per IP per second. + **Rate Limit:** 5 request per IP per second. - **Example** + **Rate Limit:** 60 requests per IP per minute. - ``` - [ - 1499040000000, // Open time - "0.01634790", // Open - "0.80000000", // High - "0.01575800", // Low - "0.01577100", // Close - "148976.11427815", // Volume - 1499644799999, // Close time - "2434.19055334", // Quote asset volume - 308 // Number of trades - ] - ``` - operationId: getCandlestickBars + operationId: getTransactionsInBlockV2 produces: - application/json parameters: - - name: symbol - in: query - description: symbol - required: true - type: string - - name: interval - in: query - description: "interval. Allowed value: [1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M]" + - name: blockHeight + in: path + description: blockHeight required: true - type: enum string - allowEmptyValue: false - enum: - - 1h - - 2h - - 4h - - 6h - - 8h - - 12h - - 1d - - 3d - - 1w - - 1M - - name: limit - in: query - description: default 300; max 1000. - required: false - type: integer - format: int32 - allowEmptyValue: false - - name: startTime - in: query - description: start time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: endTime - in: query - description: end time in Milliseconds - required: false type: integer format: int64 - allowEmptyValue: false responses: '200': description: OK schema: - type: array - items: - $ref: '#/definitions/Candlestick' - example: ' [[ - - 1499040000000, // Open time - - "0.01634790", // Open - - "0.80000000", // High - - "0.01575800", // Low - - "0.01577100", // Close - - "148976.11427815", // Volume - - 1499644799999, // Close time - - "2434.19055334", // Quote asset volume - - 308 // Number of trades - - ]] ' + $ref: '#/definitions/BlockTxV2' + '400': + description: 'Bad Request. The block to query is higher than current highest block.' + schema: + $ref: "#/definitions/Error" + '404': + description: 'Not Found' + default: + description: Generic error response + schema: + $ref: "#/definitions/Error" deprecated: false - /api/v1/mini/orders/closed: + /api/v1/atomic-swaps: get: tags: - - order - summary: Get closed orders of mini-token pairs. + - atomicSwap + summary: AtomicSwap description: | - Gets closed (filled and cancelled) orders for a given address. + Get atomic swaps by address. - **Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. + **Rate Limit:** 5 request per IP per second. - **Rate Limit:** 5 requests per IP per second. + **Rate Limit:** 60 requests per IP per minute. - operationId: getClosedOrders + operationId: getAtomicSwapsByAddrUsingGET produces: + - '*/*' - application/json parameters: - - name: address - in: query - description: the owner address - required: true - type: string - allowEmptyValue: false - - name: end - in: query - description: end time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: limit - in: query - description: default 500; max 1000. - required: false - type: integer - default: 500 - format: int32 - allowEmptyValue: false - - name: offset - in: query - description: start with 0; default 0. - required: false - type: integer - default: 0 - format: int32 - allowEmptyValue: false - - name: side - in: query - description: order side. 1 for buy and 2 for sell. - required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - BUY - - SELL - - name: start + - name: endTime in: query - description: start time in Milliseconds + description: end time of blockTimestamp required: false type: integer format: int64 allowEmptyValue: false - - name: status - in: query - description: "order status list. Allowed value: [Ack, IocExpire, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching]" - required: false - type: enum string - items: - type: string - collectionFormat: multi - allowEmptyValue: false - - name: symbol - in: query - description: symbol - required: false - type: string - - name: total + - name: fromAddress in: query - description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' + description: At least one of toAddress and fromAddress should be provided as parameter required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - 0 - - 1 - responses: - '200': - description: OK - schema: - $ref: '#/definitions/OrderList' - deprecated: false - /api/v1/mini/orders/open: - get: - tags: - - order - summary: Get open orders of mini-token pairs. - description: | - Gets open orders for a given address. - **Rate Limit:** 5 requests per IP per second. - operationId: getOpenOrders - produces: - - application/json - parameters: - - name: address - in: query - description: the owner address - required: true type: string allowEmptyValue: false - name: limit in: query - description: default 500; max 1000. + description: default 25; max 1000. required: false type: integer - default: 500 + default: 25 format: int32 - allowEmptyValue: false - name: offset in: query description: start with 0; default 0. @@ -1808,221 +819,159 @@ paths: type: integer default: 0 format: int32 - allowEmptyValue: false - - name: symbol + - name: startTime in: query - description: symbol + description: start time of blockTimestamp in Milliseconds; The maximum start - end query window is 3 months; Default query window is the latest 30 days. required: false - type: string - - name: total + type: integer + format: int64 + allowEmptyValue: false + - name: toAddress in: query - description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' + description: At least one of toAddress and fromAddress should be provided as parameter required: false - type: integer - format: int32 + type: string allowEmptyValue: false - enum: - - 0 - - 1 responses: '200': description: OK schema: - $ref: '#/definitions/OrderList' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: false - /api/v1/mini/orders/{id}: + $ref: '#/definitions/AtomicSwapPage' + /api/v1/atomic-swaps/{id}: get: tags: - - order - summary: Get an order of mini-token pairs. + - atomicSwap + summary: AtomicSwap description: | - Gets metadata for an individual order by its ID. - **Rate Limit:** 5 requests per IP per second. - operationId: getOrder + Get an AtomicSwap by swap id + + **Rate Limit:** 5 request per IP per second. + + **Rate Limit:** 60 request per IP per minute. + operationId: getAtomicSwapUsingGET produces: - application/json parameters: - name: id in: path - description: order id + description: swap id required: true type: string responses: '200': description: OK schema: - $ref: '#/definitions/Order' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: false - /api/v1/mini/ticker/24hr: + $ref: '#/definitions/AtomicSwap' + /api/v1/timelocks/{address}: get: - tags: - - market - summary: Get a market ticker of mini-token pairs. - description: | - Gets 24 hour price change statistics for a market pair symbol. Updated every second. - **Rate Limit:** 5 requests per IP per second. - operationId: get24HrPriceStatistics + summary: 'Gets time lock records given an address' + operationId: getTimeLocks produces: - application/json - parameters: - - name: symbol - in: query - description: symbol - required: false - type: string + tags: + - node + - account responses: '200': - description: OK + description: Success schema: - type: array - items: - $ref: '#/definitions/TickerStatistics' + $ref: '#/definitions/TimeLocks' '400': description: 'Bad Request' schema: $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response + '500': + description: 'internal server error' schema: $ref: "#/definitions/Error" - deprecated: false - /api/v1/mini/trades: - get: - tags: - - trade - summary: Get market trades of mini-token pairs. - description: | - Gets a list of historical trades. - **Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - **Rate Limit:** 5 requests per IP per second. - operationId: getTrades - produces: - - application/json parameters: - - name: address - in: query - description: the buyer/seller address - required: false - type: string - allowEmptyValue: false - - name: buyerOrderId - in: query - description: buyer order id - required: false + - + name: address + in: path type: string - allowEmptyValue: false - - name: end - in: query - description: end time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: height + description: 'The account address to query' + required: true + - in: query - description: block height + name: id + description: "the record id of timelock to query" required: false type: integer format: int64 - allowEmptyValue: false - - name: limit - in: query - description: default 500; max 1000. - required: false - type: integer - default: 500 - format: int32 - allowEmptyValue: false - - name: offset - in: query - description: start with 0; default 0. + /api/v1/timelock/{account_addr}?(id={recordid}): + get: + tags: + - timelock records + summary: Get timelock records of an address. + description: | + Get the timelock history of an address. + **Rate Limit:** 60 requests per IP per minute. + operationId: getTimeLocks + produces: + - application/json + parameters: + - name: address + in: path + type: string + description: 'The account address to query' + required: true + - in: query + name: id + description: "the record id of timelock to query" + required: false + type: integer + format: int64 + responses: + '200': + description: Success + schema: + $ref: '#/definitions/TimeLocks' + '400': + description: 'Bad Request' + schema: + $ref: "#/definitions/Error" + '404': + description: 'Not Found' + '500': + description: 'internal server error' + schema: + $ref: "#/definitions/Error" + /api/v1/mini/tokens: + get: + tags: + - mini + summary: Gets a list of available mini tokens. + operationId: getMiniTokens + parameters: + - in: query + name: offset + description: offset required: false type: integer default: 0 format: int32 - allowEmptyValue: false - - name: quoteAsset - in: query - description: quote asset - required: false - type: string - allowEmptyValue: false - - name: sellerOrderId - in: query - description: seller order id - required: false - type: string - allowEmptyValue: false - - name: side - in: query - description: order side. 1 for buy and 2 for sell. - required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - BUY - - SELL - - name: start - in: query - description: start time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: symbol - in: query - description: symbol - required: false - type: string - - name: total - in: query - description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' + - in: query + name: limit + description: limit required: false type: integer + default: 100 format: int32 - allowEmptyValue: false - enum: - - 0 - - 1 + produces: + - application/json responses: '200': - description: OK + description: Success schema: - $ref: '#/definitions/TradePage' + $ref: '#/definitions/MiniTokens' '400': description: 'Bad Request' schema: $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response + '500': + description: 'internal server error' schema: $ref: "#/definitions/Error" - deprecated: false definitions: Error: type: object @@ -2315,39 +1264,6 @@ definitions: type: int description: "the token decimals" x-omitempty: true - Market: - type: object - properties: - base_asset_symbol: - type: string - description: symbol of base asset - example: BNB - format: currency - required: true - quote_asset_symbol: - type: string - description: symbol of quote asset - example: ABC-5CA - format: currency - required: true - list_price: - type: string - description: "In decimal form" - example: "1.00000000" - format: fixed8 - required: true - tick_size: - type: string - description: "Minimium price change in decimal form" - example: "0.00000001" - format: fixed8 - required: true - lot_size: - type: string - description: "Minimium trading quantity in decimal form" - example: "1.00000000" - format: fixed8 - required: true Fee: type: object properties: @@ -2401,146 +1317,6 @@ definitions: fee_value: type: integer description: fee value - MarketDepth: - type: object - properties: - asks: - type: array - description: "Price and qty in decimal form, e.g. 1.00000000" - example: "[\"1.00000000\",\"800.00000000\"]" - items: - type: string - format: fixed8 - minItems: 2 - maxItems: 2 - required: true - bids: - type: array - description: "Price and qty in decimal form, e.g. 1.00000000" - example: "[\"1.00000000\",\"800.00000000\"]" - items: - type: string - format: fixed8 - minItems: 2 - maxItems: 2 - required: true - pending_match: - type: boolean - description: "If new orders inserted in current block and the matching process has not started in the block, return true." - Candlestick: - type: object - properties: - close: - type: number - description: closing price - closeTime: - type: integer - format: int64 - description: time of closing trade - high: - type: number - description: the highest price - low: - type: number - description: the lowest price - numberOfTrades: - type: integer - format: int32 - description: total trades - open: - type: number - description: open price - openTime: - type: integer - format: int64 - description: time of open trade - quoteAssetVolume: - type: number - description: the total trading volume in quote asset - volume: - type: number - description: the total trading volume - - OrderList: - type: object - properties: - order: - type: array - description: list of orders - items: - $ref: '#/definitions/Order' - total: - type: integer - format: int64 - Order: - type: object - properties: - cumulateQuantity: - type: string - description: total amount of trades that have made - fee: - type: string - description: trading fee on the latest updated block of this order. Multiple assets are split by semicolon. - lastExecutedPrice: - type: string - description: price of last execution - lastExecutedQuantity: - type: string - description: quantity of last execution - orderCreateTime: - type: string - description: time of order creation - format: date-time - orderId: - type: string - description: order ID - owner: - type: string - description: order issuer - price: - type: string - description: order price - quantity: - type: string - description: order quantity - side: - type: integer - format: int32 - description: "1 for buy and 2 for sell" - enum: - - BUY - - SELL - status: - type: string - description: "enum [Ack, PartialFill, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching, IocExpire]" - symbol: - type: string - description: trading pair symbol - timeInForce: - type: integer - format: int32 - description: "1 for Good Till Expire(GTE) order and 3 for Immediate Or Cancel (IOC)" - enum: - - GTE - - IOC - - UNKNOWN - tradeId: - type: string - description: trade ID - transactionHash: - type: string - description: hash of transaction - transactionTime: - type: string - description: time of latest order update, for example, cancel, expire - format: date-time - type: - type: integer - format: int32 - description: "only 2 is available for now, meaning limit order" - enum: - - LIMIT - title: Order SubTx: type: object properties: @@ -2562,153 +1338,6 @@ definitions: value: type: string title: SubTx - TickerStatistics: - type: object - properties: - askPrice: - type: string - description: sell price - askQuantity: - type: string - description: sell quantity - bidPrice: - type: string - description: buy price - bidQuantity: - type: string - description: buy quantity - closeTime: - type: integer - description: time of closing - format: int64 - count: - type: integer - description: total trade count - format: int64 - firstId: - type: string - description: ID of first trade - highPrice: - type: string - description: highest price - lastId: - type: string - description: ID of last trade - lastPrice: - type: string - description: last price - lastQuantity: - type: string - description: last quantity - lowPrice: - type: string - description: lowest price - openPrice: - type: string - description: open price - openTime: - type: integer - format: int64 - description: open time - prevClosePrice: - type: string - description: last close price - priceChange: - type: string - description: change of price - priceChangePercent: - type: string - description: change of price in percentage - quoteVolume: - type: string - description: trading volume in quote asset - symbol: - type: string - description: trading symbol - volume: - type: string - description: trading volume - weightedAvgPrice: - type: string - description: weighted average price - title: TickerStatistics - TradePage: - type: object - properties: - total: - type: integer - format: int64 - description: total number of trades - trade: - type: array - items: - $ref: '#/definitions/Trade' - Trade: - type: object - properties: - baseAsset: - type: string - description: base asset symbol - blockHeight: - type: integer - description: block height - format: int64 - buyFee: - type: string - description: trading fee for the buyer address on the block of this trade - buyerId: - type: string - description: id of buyer - buyerOrderId: - type: string - description: order id for buyer - buySingleFee: - type: string - description: trading fee for the buyer address on this single trade - example: "BNB:0.00000172;" - buyerSource: - type: long - description: tx source of buy order - example: 1 - price: - type: string - description: trade price - quantity: - type: string - description: trade quantity - quoteAsset: - type: string - description: quote asset symbol - sellFee: - type: string - description: trading fee for the seller address on the block of this trade - sellerId: - type: string - description: seller ID - sellerOrderId: - type: string - description: seller order ID - sellSingleFee: - type: string - description: trading fee for the seller address on this single trade - example: "BNB:0.00000216;" - sellerSource: - type: long - description: tx source of sell order - example: 1 - symbol: - type: string - description: asset symbol - tickType: - type: string - description: "enum [Unknown,SellTaker,BuyTaker,BuySurplus,SellSurplus,Neutral]" - time: - type: integer - description: trade time - format: int64 - tradeId: - type: string - description: trade ID BlockExchangeFeePage: type: object properties: diff --git a/swagger_testnet.yml b/swagger_testnet.yml index 2bb8f6d238..6c2e96d760 100644 --- a/swagger_testnet.yml +++ b/swagger_testnet.yml @@ -3,7 +3,7 @@ info: title: 'HTTP API' version: 1.0.0 description: | - Within the ecosystem of Binance Chain, there are several accelerated nodes which provides more secure and faster lines to access Binance Chain and DEX data service including HTTP API. + Within the ecosystem of Binance Chain, there are several accelerated nodes which provides more secure and faster lines to access Binance Chain data service including HTTP API. For testnet, there are 2 accelerated nodes setup as below. API users should try to use them directly. @@ -34,15 +34,6 @@ tags: - name: tokens description: 'Access to tokens metadata' -- - name: market - description: 'Access to DEX market data' -- - name: order - description: 'Access to historical orders' -- - name: trade - description: 'Access to historical trading activity' - name: userdata description: 'Access to an individual user''s trading activity' @@ -427,56 +418,6 @@ paths: description: Generic error response schema: $ref: "#/definitions/Error" - /api/v1/markets: - get: - tags: - - market - summary: Get market pairs. - description: | - Gets the list of market pairs that have been listed. - - **Destination:** Witness node. - - **Rate Limit:** 1 request per IP per second. - - **URL for testnet:** [https://testnet-dex.binance.org/api/v1/markets](https://testnet-dex.binance.org/api/v1/markets) - operationId: getPairs - produces: - - application/json - parameters: - - name: limit - in: query - description: default 500; max 1000. - required: false - type: integer - default: 500 - format: int32 - allowEmptyValue: false - - name: offset - in: query - description: start with 0; default 0. - required: false - type: integer - default: 0 - format: int32 - allowEmptyValue: false - responses: - '200': - description: Success - schema: - type: array - items: - $ref: '#/definitions/Market' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" /api/v1/fees: get: summary: Obtain trading fees information. @@ -506,61 +447,6 @@ paths: description: Generic error response schema: $ref: "#/definitions/Error" - /api/v1/depth: - get: - tags: - - market - summary: Get the order book. - description: | - Gets the order book depth data for a given pair symbol. - - The given _limit_ must be one of the allowed limits below. - - **Destination:** Validator node. - - **Rate Limit:** 10 requests per IP per second. - - **URL for testnet:** [https://testnet-dex.binance.org/api/v1/depth?symbol=xxx-000_BNB](https://testnet-dex.binance.org/api/v1/depth?symbol=xxx-000_BNB) - operationId: getDepth - produces: - - application/json - parameters: - - - in: query - name: symbol - description: Market pair symbol, e.g. NNB-0AD_BNB - required: true - type: string - - - in: query - name: limit - description: "The limit of results. Allowed limits: [5, 10, 20, 50, 100, 500, 1000]" - required: false - type: integer - format: int32 - enum: - - 5 - - 10 - - 20 - - 50 - - 100 - - 500 - - 1000 - responses: - '200': - description: Success - schema: - $ref: "#/definitions/MarketDepth" - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" /api/v1/broadcast: post: tags: @@ -618,151 +504,38 @@ paths: description: Generic error response schema: $ref: "#/definitions/Error" - /api/v1/klines: - get: - tags: - - market - summary: Get candlestick bars. - description: | - Gets candlestick/kline bars for a symbol. Bars are uniquely identified by their open time. - - If the time window is larger than limits, only the first n klines will return. In this case, please either shrink the window or increase the limit to get proper amount of klines. - - **Rate Limit:** 10 requests per IP per second. - - **URL for testnet:** [https://testnet-dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m](https://testnet-dex.binance.org/api/v1/klines?symbol=NNB-338_BNB&interval=5m) - - **Example** - - ``` - [ - 1499040000000, // Open time - "0.01634790", // Open - "0.80000000", // High - "0.01575800", // Low - "0.01577100", // Close - "148976.11427815", // Volume - 1499644799999, // Close time - "2434.19055334", // Quote asset volume - 308 // Number of trades - ] - ``` - operationId: getCandlestickBars - produces: - - application/json - parameters: - - name: symbol - in: query - description: symbol - required: true - type: string - - name: interval - in: query - description: "interval. Allowed value: [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M]" - required: true - type: enum string - allowEmptyValue: false - enum: - - 1m - - 3m - - 5m - - 15m - - 30m - - 1h - - 2h - - 4h - - 6h - - 8h - - 12h - - 1d - - 3d - - 1w - - 1M - - name: limit - in: query - description: default 300; max 1000. - required: false - type: integer - format: int32 - allowEmptyValue: false - - name: startTime - in: query - description: start time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: endTime - in: query - description: end time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - responses: - '200': - description: OK - schema: - type: array - items: - $ref: '#/definitions/Candlestick' - example: ' [[ - - 1499040000000, // Open time - - "0.01634790", // Open - - "0.80000000", // High - - "0.01575800", // Low - - "0.01577100", // Close - - "148976.11427815", // Volume - - 1499644799999, // Close time - - "2434.19055334", // Quote asset volume - - 308 // Number of trades - - ]] ' - deprecated: false - /api/v1/orders/closed: + /api/v1/block-exchange-fee: get: tags: - - order - summary: Get closed orders. + - trading fee + summary: Trading fee of the address grouped by block description: | - Gets closed (filled and cancelled) orders for a given address. - + Get historical trading fees of the address, including fees of trade/canceled order/expired order. Transfer and other transaction fees are not included. Order by block height DESC. **Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - **Rate Limit:** 5 requests per IP per second. - - operationId: getClosedOrders + operationId: getBlockExchangeFee produces: - application/json parameters: - name: address in: query - description: the owner address - required: true + description: the seller/buyer address + required: false type: string allowEmptyValue: false - name: end in: query - description: end time in Milliseconds + description: end time required: false type: integer format: int64 allowEmptyValue: false - name: limit in: query - description: default 500; max 1000. + description: default 50; max 1000. required: false type: integer - default: 500 + default: 50 format: int32 allowEmptyValue: false - name: offset @@ -773,16 +546,6 @@ paths: default: 0 format: int32 allowEmptyValue: false - - name: side - in: query - description: order side. 1 for buy and 2 for sell. - required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - BUY - - SELL - name: start in: query description: start time in Milliseconds @@ -790,20 +553,6 @@ paths: type: integer format: int64 allowEmptyValue: false - - name: status - in: query - description: "order status list. Allowed value: [Ack, IocExpire, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching]" - required: false - type: enum string - items: - type: string - collectionFormat: multi - allowEmptyValue: false - - name: symbol - in: query - description: symbol - required: false - type: string - name: total in: query description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' @@ -818,63 +567,108 @@ paths: '200': description: OK schema: - $ref: '#/definitions/OrderList' + $ref: '#/definitions/BlockExchangeFeePage' deprecated: false - /api/v1/orders/open: + /api/v1/transactions: get: tags: - - order - summary: Get open orders. + - transaction + summary: Get transactions. description: | - Gets open orders for a given address. + Gets a list of transactions. Multisend transaction is not available in this API. Currently 'confirmBlocks' and 'txAge' are not supported. - **Rate Limit:** 5 requests per IP per second. - operationId: getOpenOrders + **Query Window:** Default query window is latest 24 hours; The maximum start - end query window is 3 months. + + **Rate Limit:** 60 requests per IP per minute. + operationId: txns produces: - application/json parameters: - name: address in: query - description: the owner address + description: address required: true type: string - allowEmptyValue: false + - name: blockHeight + in: query + description: blockHeight + required: false + type: integer + format: int64 + - name: endTime + in: query + description: endTime in Milliseconds + required: false + type: integer + format: int64 - name: limit in: query - description: default 500; max 1000. + description: limit required: false type: integer default: 500 format: int32 - allowEmptyValue: false - name: offset in: query - description: start with 0; default 0. + description: offset required: false type: integer default: 0 format: int32 + - name: side + in: query + description: "transaction side. Allowed value: [ RECEIVE, SEND]" + required: false + type: enum string allowEmptyValue: false - - name: symbol + enum: + - RECEIVE + - SEND + - name: startTime + in: query + description: start time in Milliseconds + required: false + type: integer + format: int64 + - name: txAsset in: query - description: symbol + description: txAsset required: false type: string - - name: total + - name: txType in: query - description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' + description: "transaction type. Allowed value: [ NEW_ORDER,ISSUE_TOKEN,BURN_TOKEN,LIST_TOKEN,CANCEL_ORDER,FREEZE_TOKEN,UN_FREEZE_TOKEN,TRANSFER,PROPOSAL,VOTE,MINT,DEPOSIT,CREATE_VALIDATOR,REMOVE_VALIDATOR,TIME_LOCK,TIME_UNLOCK,TIME_RELOCK,SET_ACCOUNT_FLAG,HTL_TRANSFER,CLAIM_HTL,DEPOSIT_HTL,REFUND_HTL]" required: false - type: integer - format: int32 + type: enum string allowEmptyValue: false enum: - - 0 - - 1 + - NEW_ORDER + - ISSUE_TOKEN + - BURN_TOKEN + - LIST_TOKEN + - CANCEL_ORDER + - FREEZE_TOKEN + - UN_FREEZE_TOKEN + - TRANSFER + - PROPOSAL + - VOTE + - MINT + - DEPOSIT + - CREATE_VALIDATOR + - REMOVE_VALIDATOR + - TIME_LOCK + - TIME_UNLOCK + - TIME_RELOCK + - SET_ACCOUNT_FLAG + - HTL_TRANSFER + - CLAIM_HTL + - DEPOSIT_HTL + - REFUND_HTL responses: '200': description: OK schema: - $ref: '#/definitions/OrderList' + $ref: '#/definitions/TxPage' '400': description: 'Bad Request' schema: @@ -885,383 +679,20 @@ paths: description: Generic error response schema: $ref: "#/definitions/Error" - deprecated: false - /api/v1/orders/{id}: + /api/v1/transactions-in-block/{blockHeight}: get: tags: - - order - summary: Get an order. + - transaction in block + summary: Get transactions in the specific block. description: | - Gets metadata for an individual order by its ID. + Get transactions in the block. Multi-send and multi-coin transactions are flattened as transactions. This API is deprecated. **Rate Limit:** 5 requests per IP per second. - operationId: getOrder + + **Rate Limit:** 60 requests per IP per minute. + operationId: getTransactionsInBlock produces: - - application/json - parameters: - - name: id - in: path - description: order id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/Order' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: false - /api/v1/ticker/24hr: - get: - tags: - - market - summary: Get a market ticker. - description: | - Gets 24 hour price change statistics for a market pair symbol. Updated every second. - - **Rate Limit:** 5 requests per IP per second. - operationId: get24HrPriceStatistics - produces: - - application/json - parameters: - - name: symbol - in: query - description: symbol - required: false - type: string - responses: - '200': - description: OK - schema: - type: array - items: - $ref: '#/definitions/TickerStatistics' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: false - /api/v1/trades: - get: - tags: - - trade - summary: Get market trades. - description: | - Gets a list of historical trades. - - **Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - - **Rate Limit:** 5 requests per IP per second. - operationId: getTrades - produces: - - application/json - parameters: - - name: address - in: query - description: the buyer/seller address - required: false - type: string - allowEmptyValue: false - - name: buyerOrderId - in: query - description: buyer order id - required: false - type: string - allowEmptyValue: false - - name: end - in: query - description: end time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: height - in: query - description: block height - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: limit - in: query - description: default 500; max 1000. - required: false - type: integer - default: 500 - format: int32 - allowEmptyValue: false - - name: offset - in: query - description: start with 0; default 0. - required: false - type: integer - default: 0 - format: int32 - allowEmptyValue: false - - name: quoteAsset - in: query - description: quote asset - required: false - type: string - allowEmptyValue: false - - name: sellerOrderId - in: query - description: seller order id - required: false - type: string - allowEmptyValue: false - - name: side - in: query - description: order side. 1 for buy and 2 for sell. - required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - BUY - - SELL - - name: start - in: query - description: start time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: symbol - in: query - description: symbol - required: false - type: string - - name: total - in: query - description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' - required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - 0 - - 1 - responses: - '200': - description: OK - schema: - $ref: '#/definitions/TradePage' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: false - /api/v1/block-exchange-fee: - get: - tags: - - trading fee - summary: Trading fee of the address grouped by block - description: | - Get historical trading fees of the address, including fees of trade/canceled order/expired order. Transfer and other transaction fees are not included. Order by block height DESC. - **Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - **Rate Limit:** 5 requests per IP per second. - operationId: getBlockExchangeFee - produces: - - application/json - parameters: - - name: address - in: query - description: the seller/buyer address - required: false - type: string - allowEmptyValue: false - - name: end - in: query - description: end time - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: limit - in: query - description: default 50; max 1000. - required: false - type: integer - default: 50 - format: int32 - allowEmptyValue: false - - name: offset - in: query - description: start with 0; default 0. - required: false - type: integer - default: 0 - format: int32 - allowEmptyValue: false - - name: start - in: query - description: start time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: total - in: query - description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' - required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - 0 - - 1 - responses: - '200': - description: OK - schema: - $ref: '#/definitions/BlockExchangeFeePage' - deprecated: false - /api/v1/transactions: - get: - tags: - - transaction - summary: Get transactions. - description: | - Gets a list of transactions. Multisend transaction is not available in this API. Currently 'confirmBlocks' and 'txAge' are not supported. - - **Query Window:** Default query window is latest 24 hours; The maximum start - end query window is 3 months. - - **Rate Limit:** 60 requests per IP per minute. - operationId: txns - produces: - - application/json - parameters: - - name: address - in: query - description: address - required: true - type: string - - name: blockHeight - in: query - description: blockHeight - required: false - type: integer - format: int64 - - name: endTime - in: query - description: endTime in Milliseconds - required: false - type: integer - format: int64 - - name: limit - in: query - description: limit - required: false - type: integer - default: 500 - format: int32 - - name: offset - in: query - description: offset - required: false - type: integer - default: 0 - format: int32 - - name: side - in: query - description: "transaction side. Allowed value: [ RECEIVE, SEND]" - required: false - type: enum string - allowEmptyValue: false - enum: - - RECEIVE - - SEND - - name: startTime - in: query - description: start time in Milliseconds - required: false - type: integer - format: int64 - - name: txAsset - in: query - description: txAsset - required: false - type: string - - name: txType - in: query - description: "transaction type. Allowed value: [ NEW_ORDER,ISSUE_TOKEN,BURN_TOKEN,LIST_TOKEN,CANCEL_ORDER,FREEZE_TOKEN,UN_FREEZE_TOKEN,TRANSFER,PROPOSAL,VOTE,MINT,DEPOSIT,CREATE_VALIDATOR,REMOVE_VALIDATOR,TIME_LOCK,TIME_UNLOCK,TIME_RELOCK,SET_ACCOUNT_FLAG,HTL_TRANSFER,CLAIM_HTL,DEPOSIT_HTL,REFUND_HTL]" - required: false - type: enum string - allowEmptyValue: false - enum: - - NEW_ORDER - - ISSUE_TOKEN - - BURN_TOKEN - - LIST_TOKEN - - CANCEL_ORDER - - FREEZE_TOKEN - - UN_FREEZE_TOKEN - - TRANSFER - - PROPOSAL - - VOTE - - MINT - - DEPOSIT - - CREATE_VALIDATOR - - REMOVE_VALIDATOR - - TIME_LOCK - - TIME_UNLOCK - - TIME_RELOCK - - SET_ACCOUNT_FLAG - - HTL_TRANSFER - - CLAIM_HTL - - DEPOSIT_HTL - - REFUND_HTL - responses: - '200': - description: OK - schema: - $ref: '#/definitions/TxPage' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - /api/v1/transactions-in-block/{blockHeight}: - get: - tags: - - transaction in block - summary: Get transactions in the specific block. - description: | - Get transactions in the block. Multi-send and multi-coin transactions are flattened as transactions. This API is deprecated. - - **Rate Limit:** 5 requests per IP per second. - - **Rate Limit:** 60 requests per IP per minute. - operationId: getTransactionsInBlock - produces: - - application/json + - application/json parameters: - name: blockHeight in: path @@ -1270,508 +701,95 @@ paths: type: string responses: '200': - description: OK - schema: - $ref: '#/definitions/BlockTx' - '400': - description: 'Bad Request. The block to query is higher than current highest block.' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: true - '/api/v2/transactions-in-block/{blockHeight}': - get: - tags: - - transaction - summary: transactions in Block - description: | - Get transactions in the block. Multi-send and multi-coin transactions are included as sub-transactions. - - **Rate Limit:** 5 request per IP per second. - - **Rate Limit:** 60 requests per IP per minute. - - operationId: getTransactionsInBlockV2 - produces: - - application/json - parameters: - - name: blockHeight - in: path - description: blockHeight - required: true - type: integer - format: int64 - responses: - '200': - description: OK - schema: - $ref: '#/definitions/BlockTxV2' - '400': - description: 'Bad Request. The block to query is higher than current highest block.' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: false - /api/v1/atomic-swaps: - get: - tags: - - atomicSwap - summary: AtomicSwap - description: | - Get atomic swaps by address. - - **Rate Limit:** 5 request per IP per second. - - **Rate Limit:** 60 requests per IP per minute. - - operationId: getAtomicSwapsByAddrUsingGET - produces: - - '*/*' - - application/json - parameters: - - name: endTime - in: query - description: end time of blockTimestamp - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: fromAddress - in: query - description: At least one of toAddress and fromAddress should be provided as parameter - required: false - type: string - allowEmptyValue: false - - name: limit - in: query - description: default 25; max 1000. - required: false - type: integer - default: 25 - format: int32 - - name: offset - in: query - description: start with 0; default 0. - required: false - type: integer - default: 0 - format: int32 - - name: startTime - in: query - description: start time of blockTimestamp in Milliseconds; The maximum start - end query window is 3 months; Default query window is the latest 30 days. - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: toAddress - in: query - description: At least one of toAddress and fromAddress should be provided as parameter - required: false - type: string - allowEmptyValue: false - responses: - '200': - description: OK - schema: - $ref: '#/definitions/AtomicSwapPage' - /api/v1/atomic-swaps/{id}: - get: - tags: - - atomicSwap - summary: AtomicSwap - description: | - Get an AtomicSwap by swap id - - **Rate Limit:** 5 request per IP per second. - - **Rate Limit:** 60 request per IP per minute. - operationId: getAtomicSwapUsingGET - produces: - - application/json - parameters: - - name: id - in: path - description: swap id - required: true - type: string - responses: - '200': - description: OK - schema: - $ref: '#/definitions/AtomicSwap' - /api/v1/timelocks/{address}: - get: - summary: 'Gets time lock records given an address' - operationId: getTimeLocks - produces: - - application/json - tags: - - node - - account - responses: - '200': - description: Success - schema: - $ref: '#/definitions/TimeLocks' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '500': - description: 'internal server error' - schema: - $ref: "#/definitions/Error" - parameters: - - - name: address - in: path - type: string - description: 'The account address to query' - required: true - - - in: query - name: id - description: "the record id of timelock to query" - required: false - type: integer - format: int64 - /api/v1/timelock/{account_addr}?(id={recordid}): - get: - tags: - - timelock records - summary: Get timelock records of an address. - description: | - Get the timelock history of an address. - **Rate Limit:** 60 requests per IP per minute. - operationId: getTimeLocks - produces: - - application/json - parameters: - - name: address - in: path - type: string - description: 'The account address to query' - required: true - - in: query - name: id - description: "the record id of timelock to query" - required: false - type: integer - format: int64 - responses: - '200': - description: Success - schema: - $ref: '#/definitions/TimeLocks' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - '500': - description: 'internal server error' - schema: - $ref: "#/definitions/Error" - /api/v1/mini/tokens: - get: - tags: - - mini - summary: Gets a list of available mini tokens. - operationId: getMiniTokens - parameters: - - in: query - name: offset - description: offset - required: false - type: integer - default: 0 - format: int32 - - in: query - name: limit - description: limit - required: false - type: integer - default: 100 - format: int32 - produces: - - application/json - responses: - '200': - description: Success + description: OK schema: - $ref: '#/definitions/MiniTokens' + $ref: '#/definitions/BlockTx' '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '500': - description: 'internal server error' + description: 'Bad Request. The block to query is higher than current highest block.' schema: $ref: "#/definitions/Error" - /api/v1/mini/markets: - get: - tags: - - mini - summary: Gets a list of mini market pairs. - parameters: - - in: query - name: offset - description: offset - required: false - type: integer - default: 0 - format: int32 - - in: query - name: limit - description: limit - required: false - type: integer - default: 100 - format: int32 - operationId: getMiniPairs - produces: - - application/json - responses: - '200': - description: Success - schema: - $ref: '#/definitions/Markets' - '400': - description: 'Bad Request' + '404': + description: 'Not Found' + default: + description: Generic error response schema: $ref: "#/definitions/Error" - /api/v1/mini/klines: + deprecated: true + '/api/v2/transactions-in-block/{blockHeight}': get: tags: - - market - summary: Get mini-token candlestick bars. + - transaction + summary: transactions in Block description: | - Gets candlestick/kline bars for a mini-token symbol pair. Bars are uniquely identified by their open time. - - If the time window is larger than limits, only the first n klines will return. In this case, please either shrink the window or increase the limit to get proper amount of klines. + Get transactions in the block. Multi-send and multi-coin transactions are included as sub-transactions. - **Rate Limit:** 10 requests per IP per second. + **Rate Limit:** 5 request per IP per second. - **Example** + **Rate Limit:** 60 requests per IP per minute. - ``` - [ - 1499040000000, // Open time - "0.01634790", // Open - "0.80000000", // High - "0.01575800", // Low - "0.01577100", // Close - "148976.11427815", // Volume - 1499644799999, // Close time - "2434.19055334", // Quote asset volume - 308 // Number of trades - ] - ``` - operationId: getCandlestickBars + operationId: getTransactionsInBlockV2 produces: - application/json parameters: - - name: symbol - in: query - description: symbol - required: true - type: string - - name: interval - in: query - description: "interval. Allowed value: [1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M]" + - name: blockHeight + in: path + description: blockHeight required: true - type: enum string - allowEmptyValue: false - enum: - - 1h - - 2h - - 4h - - 6h - - 8h - - 12h - - 1d - - 3d - - 1w - - 1M - - name: limit - in: query - description: default 300; max 1000. - required: false - type: integer - format: int32 - allowEmptyValue: false - - name: startTime - in: query - description: start time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: endTime - in: query - description: end time in Milliseconds - required: false type: integer format: int64 - allowEmptyValue: false responses: '200': description: OK schema: - type: array - items: - $ref: '#/definitions/Candlestick' - example: ' [[ - - 1499040000000, // Open time - - "0.01634790", // Open - - "0.80000000", // High - - "0.01575800", // Low - - "0.01577100", // Close - - "148976.11427815", // Volume - - 1499644799999, // Close time - - "2434.19055334", // Quote asset volume - - 308 // Number of trades - - ]] ' + $ref: '#/definitions/BlockTxV2' + '400': + description: 'Bad Request. The block to query is higher than current highest block.' + schema: + $ref: "#/definitions/Error" + '404': + description: 'Not Found' + default: + description: Generic error response + schema: + $ref: "#/definitions/Error" deprecated: false - /api/v1/mini/orders/closed: + /api/v1/atomic-swaps: get: tags: - - order - summary: Get closed orders of mini-token pairs. + - atomicSwap + summary: AtomicSwap description: | - Gets closed (filled and cancelled) orders for a given address. + Get atomic swaps by address. - **Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. + **Rate Limit:** 5 request per IP per second. - **Rate Limit:** 5 requests per IP per second. + **Rate Limit:** 60 requests per IP per minute. - operationId: getClosedOrders + operationId: getAtomicSwapsByAddrUsingGET produces: + - '*/*' - application/json parameters: - - name: address - in: query - description: the owner address - required: true - type: string - allowEmptyValue: false - - name: end - in: query - description: end time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: limit - in: query - description: default 500; max 1000. - required: false - type: integer - default: 500 - format: int32 - allowEmptyValue: false - - name: offset - in: query - description: start with 0; default 0. - required: false - type: integer - default: 0 - format: int32 - allowEmptyValue: false - - name: side - in: query - description: order side. 1 for buy and 2 for sell. - required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - BUY - - SELL - - name: start + - name: endTime in: query - description: start time in Milliseconds + description: end time of blockTimestamp required: false type: integer format: int64 allowEmptyValue: false - - name: status - in: query - description: "order status list. Allowed value: [Ack, IocExpire, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching]" - required: false - type: enum string - items: - type: string - collectionFormat: multi - allowEmptyValue: false - - name: symbol - in: query - description: symbol - required: false - type: string - - name: total + - name: fromAddress in: query - description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' + description: At least one of toAddress and fromAddress should be provided as parameter required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - 0 - - 1 - responses: - '200': - description: OK - schema: - $ref: '#/definitions/OrderList' - deprecated: false - /api/v1/mini/orders/open: - get: - tags: - - order - summary: Get open orders of mini-token pairs. - description: | - Gets open orders for a given address. - **Rate Limit:** 5 requests per IP per second. - operationId: getOpenOrders - produces: - - application/json - parameters: - - name: address - in: query - description: the owner address - required: true type: string allowEmptyValue: false - name: limit in: query - description: default 500; max 1000. + description: default 25; max 1000. required: false type: integer - default: 500 + default: 25 format: int32 - allowEmptyValue: false - name: offset in: query description: start with 0; default 0. @@ -1779,221 +797,159 @@ paths: type: integer default: 0 format: int32 - allowEmptyValue: false - - name: symbol + - name: startTime in: query - description: symbol + description: start time of blockTimestamp in Milliseconds; The maximum start - end query window is 3 months; Default query window is the latest 30 days. required: false - type: string - - name: total + type: integer + format: int64 + allowEmptyValue: false + - name: toAddress in: query - description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' + description: At least one of toAddress and fromAddress should be provided as parameter required: false - type: integer - format: int32 + type: string allowEmptyValue: false - enum: - - 0 - - 1 responses: '200': description: OK schema: - $ref: '#/definitions/OrderList' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: false - /api/v1/mini/orders/{id}: + $ref: '#/definitions/AtomicSwapPage' + /api/v1/atomic-swaps/{id}: get: tags: - - order - summary: Get an order of mini-token pairs. + - atomicSwap + summary: AtomicSwap description: | - Gets metadata for an individual order by its ID. - **Rate Limit:** 5 requests per IP per second. - operationId: getOrder + Get an AtomicSwap by swap id + + **Rate Limit:** 5 request per IP per second. + + **Rate Limit:** 60 request per IP per minute. + operationId: getAtomicSwapUsingGET produces: - application/json parameters: - name: id in: path - description: order id + description: swap id required: true type: string responses: '200': description: OK schema: - $ref: '#/definitions/Order' - '400': - description: 'Bad Request' - schema: - $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response - schema: - $ref: "#/definitions/Error" - deprecated: false - /api/v1/mini/ticker/24hr: + $ref: '#/definitions/AtomicSwap' + /api/v1/timelocks/{address}: get: - tags: - - market - summary: Get a market ticker of mini-token pairs. - description: | - Gets 24 hour price change statistics for a market pair symbol. Updated every second. - **Rate Limit:** 5 requests per IP per second. - operationId: get24HrPriceStatistics + summary: 'Gets time lock records given an address' + operationId: getTimeLocks produces: - application/json - parameters: - - name: symbol - in: query - description: symbol - required: false - type: string + tags: + - node + - account responses: '200': - description: OK + description: Success schema: - type: array - items: - $ref: '#/definitions/TickerStatistics' + $ref: '#/definitions/TimeLocks' '400': description: 'Bad Request' schema: $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response + '500': + description: 'internal server error' schema: $ref: "#/definitions/Error" - deprecated: false - /api/v1/mini/trades: - get: - tags: - - trade - summary: Get market trades of mini-token pairs. - description: | - Gets a list of historical trades. - **Query Window:** Default query window is latest 7 days; The maximum start - end query window is 3 months. - **Rate Limit:** 5 requests per IP per second. - operationId: getTrades - produces: - - application/json parameters: - - name: address - in: query - description: the buyer/seller address - required: false - type: string - allowEmptyValue: false - - name: buyerOrderId - in: query - description: buyer order id - required: false + - + name: address + in: path type: string - allowEmptyValue: false - - name: end - in: query - description: end time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: height + description: 'The account address to query' + required: true + - in: query - description: block height + name: id + description: "the record id of timelock to query" required: false type: integer format: int64 - allowEmptyValue: false - - name: limit - in: query - description: default 500; max 1000. - required: false - type: integer - default: 500 - format: int32 - allowEmptyValue: false - - name: offset - in: query - description: start with 0; default 0. + /api/v1/timelock/{account_addr}?(id={recordid}): + get: + tags: + - timelock records + summary: Get timelock records of an address. + description: | + Get the timelock history of an address. + **Rate Limit:** 60 requests per IP per minute. + operationId: getTimeLocks + produces: + - application/json + parameters: + - name: address + in: path + type: string + description: 'The account address to query' + required: true + - in: query + name: id + description: "the record id of timelock to query" + required: false + type: integer + format: int64 + responses: + '200': + description: Success + schema: + $ref: '#/definitions/TimeLocks' + '400': + description: 'Bad Request' + schema: + $ref: "#/definitions/Error" + '404': + description: 'Not Found' + '500': + description: 'internal server error' + schema: + $ref: "#/definitions/Error" + /api/v1/mini/tokens: + get: + tags: + - mini + summary: Gets a list of available mini tokens. + operationId: getMiniTokens + parameters: + - in: query + name: offset + description: offset required: false type: integer default: 0 format: int32 - allowEmptyValue: false - - name: quoteAsset - in: query - description: quote asset - required: false - type: string - allowEmptyValue: false - - name: sellerOrderId - in: query - description: seller order id - required: false - type: string - allowEmptyValue: false - - name: side - in: query - description: order side. 1 for buy and 2 for sell. - required: false - type: integer - format: int32 - allowEmptyValue: false - enum: - - BUY - - SELL - - name: start - in: query - description: start time in Milliseconds - required: false - type: integer - format: int64 - allowEmptyValue: false - - name: symbol - in: query - description: symbol - required: false - type: string - - name: total - in: query - description: 'total number required, 0 for not required and 1 for required; default not required, return total=-1 in response' + - in: query + name: limit + description: limit required: false type: integer + default: 100 format: int32 - allowEmptyValue: false - enum: - - 0 - - 1 + produces: + - application/json responses: '200': - description: OK + description: Success schema: - $ref: '#/definitions/TradePage' + $ref: '#/definitions/MiniTokens' '400': description: 'Bad Request' schema: $ref: "#/definitions/Error" - '404': - description: 'Not Found' - default: - description: Generic error response + '500': + description: 'internal server error' schema: $ref: "#/definitions/Error" - deprecated: false definitions: Error: type: object @@ -2286,39 +1242,6 @@ definitions: type: int description: "the token decimals" x-omitempty: true - Market: - type: object - properties: - base_asset_symbol: - type: string - description: symbol of base asset - example: BNB - format: currency - required: true - quote_asset_symbol: - type: string - description: symbol of quote asset - example: ABC-5CA - format: currency - required: true - list_price: - type: string - description: "In decimal form" - example: "1.00000000" - format: fixed8 - required: true - tick_size: - type: string - description: "Minimium price change in decimal form" - example: "0.00000001" - format: fixed8 - required: true - lot_size: - type: string - description: "Minimium trading quantity in decimal form" - example: "1.00000000" - format: fixed8 - required: true Fee: type: object properties: @@ -2372,146 +1295,6 @@ definitions: fee_value: type: integer description: fee value - MarketDepth: - type: object - properties: - asks: - type: array - description: "Price and qty in decimal form, e.g. 1.00000000" - example: "[\"1.00000000\",\"800.00000000\"]" - items: - type: string - format: fixed8 - minItems: 2 - maxItems: 2 - required: true - bids: - type: array - description: "Price and qty in decimal form, e.g. 1.00000000" - example: "[\"1.00000000\",\"800.00000000\"]" - items: - type: string - format: fixed8 - minItems: 2 - maxItems: 2 - required: true - pending_match: - type: boolean - description: "If new orders inserted in current block and the matching process has not started in the block, return true." - Candlestick: - type: object - properties: - close: - type: number - description: closing price - closeTime: - type: integer - format: int64 - description: time of closing trade - high: - type: number - description: the highest price - low: - type: number - description: the lowest price - numberOfTrades: - type: integer - format: int32 - description: total trades - open: - type: number - description: open price - openTime: - type: integer - format: int64 - description: time of open trade - quoteAssetVolume: - type: number - description: the total trading volume in quote asset - volume: - type: number - description: the total trading volume - - OrderList: - type: object - properties: - order: - type: array - description: list of orders - items: - $ref: '#/definitions/Order' - total: - type: integer - format: int64 - Order: - type: object - properties: - cumulateQuantity: - type: string - description: total amount of trades that have made - fee: - type: string - description: trading fee on the latest updated block of this order. Multiple assets are split by semicolon. - lastExecutedPrice: - type: string - description: price of last execution - lastExecutedQuantity: - type: string - description: quantity of last execution - orderCreateTime: - type: string - description: time of order creation - format: date-time - orderId: - type: string - description: order ID - owner: - type: string - description: order issuer - price: - type: string - description: order price - quantity: - type: string - description: order quantity - side: - type: integer - format: int32 - description: "1 for buy and 2 for sell" - enum: - - BUY - - SELL - status: - type: string - description: "enum [Ack, PartialFill, IocNoFill, FullyFill, Canceled, Expired, FailedBlocking, FailedMatching, IocExpire]" - symbol: - type: string - description: trading pair symbol - timeInForce: - type: integer - format: int32 - description: "1 for Good Till Expire(GTE) order and 3 for Immediate Or Cancel (IOC)" - enum: - - GTE - - IOC - - UNKNOWN - tradeId: - type: string - description: trade ID - transactionHash: - type: string - description: hash of transaction - transactionTime: - type: string - description: time of latest order update, for example, cancel, expire - format: date-time - type: - type: integer - format: int32 - description: "only 2 is available for now, meaning limit order" - enum: - - LIMIT - title: Order SubTx: type: object properties: @@ -2533,153 +1316,6 @@ definitions: value: type: string title: SubTx - TickerStatistics: - type: object - properties: - askPrice: - type: string - description: sell price - askQuantity: - type: string - description: sell quantity - bidPrice: - type: string - description: buy price - bidQuantity: - type: string - description: buy quantity - closeTime: - type: integer - description: time of closing - format: int64 - count: - type: integer - description: total trade count - format: int64 - firstId: - type: string - description: ID of first trade - highPrice: - type: string - description: highest price - lastId: - type: string - description: ID of last trade - lastPrice: - type: string - description: last price - lastQuantity: - type: string - description: last quantity - lowPrice: - type: string - description: lowest price - openPrice: - type: string - description: open price - openTime: - type: integer - format: int64 - description: open time - prevClosePrice: - type: string - description: last close price - priceChange: - type: string - description: change of price - priceChangePercent: - type: string - description: change of price in percentage - quoteVolume: - type: string - description: trading volume in quote asset - symbol: - type: string - description: trading symbol - volume: - type: string - description: trading volume - weightedAvgPrice: - type: string - description: weighted average price - title: TickerStatistics - TradePage: - type: object - properties: - total: - type: integer - format: int64 - description: total number of trades - trade: - type: array - items: - $ref: '#/definitions/Trade' - Trade: - type: object - properties: - baseAsset: - type: string - description: base asset symbol - blockHeight: - type: integer - description: block height - format: int64 - buyFee: - type: string - description: trading fee for the buyer address on the block of this trade - buyerId: - type: string - description: id of buyer - buyerOrderId: - type: string - description: order id for buyer - buySingleFee: - type: string - description: trading fee for the buyer address on this single trade - example: "BNB:0.00000172;" - buyerSource: - type: long - description: tx source of buy order - example: 1 - price: - type: string - description: trade price - quantity: - type: string - description: trade quantity - quoteAsset: - type: string - description: quote asset symbol - sellFee: - type: string - description: trading fee for the seller address on the block of this trade - sellerId: - type: string - description: seller ID - sellerOrderId: - type: string - description: seller order ID - sellSingleFee: - type: string - description: trading fee for the seller address on this single trade - example: "BNB:0.00000216;" - sellerSource: - type: long - description: tx source of sell order - example: 1 - symbol: - type: string - description: asset symbol - tickType: - type: string - description: "enum [Unknown,SellTaker,BuyTaker,BuySurplus,SellSurplus,Neutral]" - time: - type: integer - description: trade time - format: int64 - tradeId: - type: string - description: trade ID BlockExchangeFeePage: type: object properties: