Struct Client

Source
pub struct Client { /* private fields */ }
Expand description

Client for Binance Public Spot API

OpenAPI Specifications for the Binance Public Spot API

API documents:

Version: 1.0

Implementations§

Source§

impl Client

Source

pub fn new(baseurl: &str, inner: AuthProvider) -> Self

Create a new client.

baseurl is the base URL provided to the internal reqwest::Client, and should include a scheme and hostname, as well as port and a path stem if applicable.

Source

pub fn new_with_client( baseurl: &str, client: Client, inner: AuthProvider, ) -> Self

Construct a new client with an existing reqwest::Client, allowing more control over its configuration.

baseurl is the base URL provided to the internal reqwest::Client, and should include a scheme and hostname, as well as port and a path stem if applicable.

Source

pub fn baseurl(&self) -> &String

Get the base URL to which requests are made.

Source

pub fn client(&self) -> &Client

Get the internal reqwest::Client used to make requests.

Source

pub fn api_version(&self) -> &'static str

Get the version of this API.

This string is pulled directly from the source OpenAPI document and may be in any format the API selects.

Source

pub fn inner(&self) -> &AuthProvider

Return a reference to the inner type stored in self.

Source§

impl Client

Source

pub async fn ping<'a>( &'a self, ) -> Result<ResponseValue<Map<String, Value>>, Error<()>>

Test Connectivity

Test connectivity to the Rest API.

Weight(IP): 1

Sends a GET request to /api/v3/ping

Source

pub async fn time<'a>( &'a self, ) -> Result<ResponseValue<TimeResponse>, Error<()>>

Check Server Time

Test connectivity to the Rest API and get the current server time.

Weight(IP): 1

Sends a GET request to /api/v3/time

Source

pub async fn exchange_info<'a>( &'a self, permissions: Option<&'a str>, symbol: Option<&'a str>, symbols: Option<&'a str>, ) -> Result<ResponseValue<ExchangeInfoResponse>, Error<Error>>

Exchange Information

Current exchange trading rules and symbol information

  • If any symbol provided in either symbol or symbols do not exist, the endpoint will throw an error.

Weight(IP): 10

Sends a GET request to /api/v3/exchangeInfo

Arguments:

  • permissions
  • symbol: Trading symbol, e.g. BNBUSDT
  • symbols
Source

pub async fn depth<'a>( &'a self, limit: Option<i64>, symbol: &'a str, ) -> Result<ResponseValue<DepthResponse>, Error<Error>>

Order Book

LimitWeight(IP)
1-1005
101-50025
501-100050
1001-5000250

Sends a GET request to /api/v3/depth

Arguments:

  • limit: If limit > 5000, then the response will truncate to 5000
  • symbol: Trading symbol, e.g. BNBUSDT
Source

pub async fn trades<'a>( &'a self, limit: Option<i32>, symbol: &'a str, ) -> Result<ResponseValue<Vec<Trade>>, Error<Error>>

Recent Trades List

Get recent trades.

Weight(IP): 10

Sends a GET request to /api/v3/trades

Arguments:

  • limit: Default 500; max 1000.
  • symbol: Trading symbol, e.g. BNBUSDT
Source

pub async fn historical_trades<'a>( &'a self, from_id: Option<i64>, limit: Option<i32>, symbol: &'a str, ) -> Result<ResponseValue<Vec<Trade>>, Error<()>>

Old Trade Lookup

Get older market trades.

Weight(IP): 10

Sends a GET request to /api/v3/historicalTrades

Arguments:

  • from_id: Trade id to fetch from. Default gets most recent trades.
  • limit: Default 500; max 1000.
  • symbol: Trading symbol, e.g. BNBUSDT
Source

pub async fn agg_trades<'a>( &'a self, end_time: Option<i64>, from_id: Option<i64>, limit: Option<i32>, start_time: Option<i64>, symbol: &'a str, ) -> Result<ResponseValue<Vec<AggTrade>>, Error<Error>>

Compressed/Aggregate Trades List

Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated.

  • If fromId, startTime, and endTime are not sent, the most recent aggregate trades will be returned.

  • Note that if a trade has the following values, this was a duplicate aggregate trade and marked as invalid:

    p = ‘0’ // price

    q = ‘0’ // qty

    f = -1 // first_trade_id

    l = -1 // last_trade_id

Weight(IP): 2

Sends a GET request to /api/v3/aggTrades

Arguments:

  • end_time: UTC timestamp in ms
  • from_id: Trade id to fetch from. Default gets most recent trades.
  • limit: Default 500; max 1000.
  • start_time: UTC timestamp in ms
  • symbol: Trading symbol, e.g. BNBUSDT
Source

pub async fn kline_candlestick_data<'a>( &'a self, end_time: Option<i64>, interval: KlineCandlestickDataInterval, limit: Option<i32>, start_time: Option<i64>, symbol: &'a str, ) -> Result<ResponseValue<Vec<Vec<KlineCandlestickDataResponseItemItem>>>, Error<Error>>

Kline/Candlestick Data

Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.

  • If startTime and endTime are not sent, the most recent klines are returned.

Weight(IP): 2

Sends a GET request to /api/v3/klines

Arguments:

  • end_time: UTC timestamp in ms
  • interval: kline intervals
  • limit: Default 500; max 1000.
  • start_time: UTC timestamp in ms
  • symbol: Trading symbol, e.g. BNBUSDT
Source

pub async fn ui_klines<'a>( &'a self, end_time: Option<i64>, interval: UiKlinesInterval, limit: Option<i32>, start_time: Option<i64>, symbol: &'a str, ) -> Result<ResponseValue<Vec<Vec<UiKlinesResponseItemItem>>>, Error<Error>>

UIKlines

The request is similar to klines having the same parameters and response.

uiKlines return modified kline data, optimized for presentation of candlestick charts.

Weight(IP): 2

Sends a GET request to /api/v3/uiKlines

Arguments:

  • end_time: UTC timestamp in ms
  • interval: kline intervals
  • limit: Default 500; max 1000.
  • start_time: UTC timestamp in ms
  • symbol: Trading symbol, e.g. BNBUSDT
Source

pub async fn avg_price<'a>( &'a self, symbol: &'a str, ) -> Result<ResponseValue<AvgPriceResponse>, Error<Error>>

Current Average Price

Current average price for a symbol.

Weight(IP): 2

Sends a GET request to /api/v3/avgPrice

Arguments:

  • symbol: Trading symbol, e.g. BNBUSDT
Source

pub async fn ticker_24hr<'a>( &'a self, symbol: Option<&'a str>, symbols: Option<&'a str>, type_: Option<&'a str>, ) -> Result<ResponseValue<Ticker24hrResponse>, Error<Error>>

24hr Ticker Price Change Statistics

24 hour rolling window price change statistics. Careful when accessing this with no symbol.

  • If the symbol is not sent, tickers for all symbols will be returned in an array.

Weight(IP):

  • 2 for a single symbol;
  • 80 when the symbol parameter is omitted;

Sends a GET request to /api/v3/ticker/24hr

Arguments:

  • symbol: Trading symbol, e.g. BNBUSDT
  • symbols
  • type_: Supported values: FULL or MINI. If none provided, the default is FULL
Source

pub async fn ticker_price<'a>( &'a self, symbol: Option<&'a str>, symbols: Option<&'a str>, ) -> Result<ResponseValue<TickerPriceResponse>, Error<Error>>

Symbol Price Ticker

Latest price for a symbol or symbols.

  • If the symbol is not sent, prices for all symbols will be returned in an array.

Weight(IP):

  • 2 for a single symbol;
  • 4 when the symbol parameter is omitted;

Sends a GET request to /api/v3/ticker/price

Arguments:

  • symbol: Trading symbol, e.g. BNBUSDT
  • symbols
Source

pub async fn ticker_order_book<'a>( &'a self, symbol: Option<&'a str>, symbols: Option<&'a str>, ) -> Result<ResponseValue<TickerOrderBookResponse>, Error<Error>>

Symbol Order Book Ticker

Best price/qty on the order book for a symbol or symbols.

  • If the symbol is not sent, bookTickers for all symbols will be returned in an array.

Weight(IP):

  • 2 for a single symbol;
  • 4 when the symbol parameter is omitted;

Sends a GET request to /api/v3/ticker/bookTicker

Arguments:

  • symbol: Trading symbol, e.g. BNBUSDT
  • symbols
Source

pub async fn ticker<'a>( &'a self, symbol: Option<&'a str>, symbols: Option<&'a str>, type_: Option<&'a str>, window_size: Option<&'a str>, ) -> Result<ResponseValue<TickerResponse>, Error<Error>>

Rolling window price change statistics

The window used to compute statistics is typically slightly wider than requested windowSize.

openTime for /api/v3/ticker always starts on a minute, while the closeTime is the current time of the request. As such, the effective window might be up to 1 minute wider than requested.

E.g. If the closeTime is 1641287867099 (January 04, 2022 09:17:47:099 UTC) , and the windowSize is 1d. the openTime will be: 1641201420000 (January 3, 2022, 09:17:00 UTC)

Weight(IP): 4 for each requested symbol regardless of windowSize.

The weight for this request will cap at 200 once the number of symbols in the request is more than 50.

Sends a GET request to /api/v3/ticker

Arguments:

  • symbol: Trading symbol, e.g. BNBUSDT
  • symbols
  • type_: Supported values: FULL or MINI. If none provided, the default is FULL
  • window_size: Defaults to 1d if no parameter provided. Supported windowSize values: 1m,2m….59m for minutes 1h, 2h….23h - for hours 1d…7d - for days.

Units cannot be combined (e.g. 1d2h is not allowed)

Source

pub async fn order_test<'a>( &'a self, iceberg_qty: Option<f64>, new_client_order_id: Option<&'a str>, new_order_resp_type: Option<OrderTestNewOrderRespType>, price: Option<f64>, quantity: Option<f64>, quote_order_qty: Option<f64>, recv_window: Option<i64>, side: OrderTestSide, signature: &'a str, stop_price: Option<f64>, strategy_id: Option<i64>, strategy_type: Option<i64>, symbol: &'a str, time_in_force: Option<OrderTestTimeInForce>, timestamp: i64, trailing_delta: Option<f64>, type_: OrderTestType, ) -> Result<ResponseValue<Map<String, Value>>, Error<Error>>

Test New Order (TRADE)

Test new order creation and signature/recvWindow long. Creates and validates a new order but does not send it into the matching engine.

Weight(IP): 1

Sends a POST request to /api/v3/order/test

Arguments:

  • iceberg_qty: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
  • new_client_order_id: Used to uniquely identify this cancel. Automatically generated by default
  • new_order_resp_type: Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK.
  • price: Order price
  • quantity: Order quantity
  • quote_order_qty: Quote quantity
  • recv_window: The value cannot be greater than 60000
  • side
  • signature: Signature
  • stop_price: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
  • strategy_id
  • strategy_type: The value cannot be less than 1000000.
  • symbol: Trading symbol, e.g. BNBUSDT
  • time_in_force: Order time in force
  • timestamp: UTC timestamp in ms
  • trailing_delta: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
  • type_: Order type
Source

pub async fn query_order<'a>( &'a self, order_id: Option<i64>, orig_client_order_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<OrderDetails>, Error<Error>>

Query Order (USER_DATA)

Check an order’s status.

  • Either orderId or origClientOrderId must be sent.
  • For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.

Weight(IP): 4

Sends a GET request to /api/v3/order

Arguments:

  • order_id: Order id
  • orig_client_order_id: Order id from client
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn place_new_order<'a>( &'a self, iceberg_qty: Option<f64>, new_client_order_id: Option<&'a str>, new_order_resp_type: Option<PlaceNewOrderNewOrderRespType>, price: Option<f64>, quantity: Option<f64>, quote_order_qty: Option<f64>, recv_window: Option<i64>, self_trade_prevention_mode: Option<PlaceNewOrderSelfTradePreventionMode>, side: PlaceNewOrderSide, signature: &'a str, stop_price: Option<f64>, strategy_id: Option<i64>, strategy_type: Option<i64>, symbol: &'a str, time_in_force: Option<PlaceNewOrderTimeInForce>, timestamp: i64, trailing_delta: Option<f64>, type_: PlaceNewOrderType, ) -> Result<ResponseValue<PlaceNewOrderResponse>, Error<Error>>

New Order (TRADE)

Send in a new order.

  • LIMIT_MAKER are LIMIT orders that will be rejected if they would immediately match and trade as a taker.
  • STOP_LOSS and TAKE_PROFIT will execute a MARKET order when the stopPrice is reached.
  • Any LIMIT or LIMIT_MAKER type order can be made an iceberg order by sending an icebergQty.
  • Any order with an icebergQty MUST have timeInForce set to GTC.
  • MARKET orders using quantity specifies how much a user wants to buy or sell based on the market price.
  • MARKET orders using quoteOrderQty specifies the amount the user wants to spend (when buying) or receive (when selling) of the quote asset; the correct quantity will be determined based on the market liquidity and quoteOrderQty.
  • MARKET orders using quoteOrderQty will not break LOT_SIZE filter rules; the order will execute a quantity that will have the notional value as close as possible to quoteOrderQty.
  • same newClientOrderId can be accepted only when the previous one is filled, otherwise the order will be rejected.

Trigger order price rules against market price for both MARKET and LIMIT versions:

  • Price above market price: STOP_LOSS BUY, TAKE_PROFIT SELL
  • Price below market price: STOP_LOSS SELL, TAKE_PROFIT BUY

Weight(IP): 1

Sends a POST request to /api/v3/order

Arguments:

  • iceberg_qty: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
  • new_client_order_id: Used to uniquely identify this cancel. Automatically generated by default
  • new_order_resp_type: Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK.
  • price: Order price
  • quantity: Order quantity
  • quote_order_qty: Quote quantity
  • recv_window: The value cannot be greater than 60000
  • self_trade_prevention_mode: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
  • side
  • signature: Signature
  • stop_price: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
  • strategy_id
  • strategy_type: The value cannot be less than 1000000.
  • symbol: Trading symbol, e.g. BNBUSDT
  • time_in_force: Order time in force
  • timestamp: UTC timestamp in ms
  • trailing_delta: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
  • type_: Order type
Source

pub async fn cancel_order<'a>( &'a self, cancel_restrictions: Option<CancelOrderCancelRestrictions>, new_client_order_id: Option<&'a str>, order_id: Option<i64>, orig_client_order_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<Order>, Error<Error>>

Cancel Order (TRADE)

Cancel an active order.

Either orderId or origClientOrderId must be sent.

Weight(IP): 1

Sends a DELETE request to /api/v3/order

Arguments:

  • cancel_restrictions
  • new_client_order_id: Used to uniquely identify this cancel. Automatically generated by default
  • order_id: Order id
  • orig_client_order_id: Order id from client
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn replace_order<'a>( &'a self, cancel_new_client_order_id: Option<&'a str>, cancel_order_id: Option<i64>, cancel_orig_client_order_id: Option<&'a str>, cancel_replace_mode: &'a str, cancel_restrictions: Option<ReplaceOrderCancelRestrictions>, iceberg_qty: Option<f64>, new_client_order_id: Option<&'a str>, new_order_resp_type: Option<ReplaceOrderNewOrderRespType>, price: Option<f64>, quantity: Option<f64>, quote_order_qty: Option<f64>, recv_window: Option<i64>, self_trade_prevention_mode: Option<ReplaceOrderSelfTradePreventionMode>, side: ReplaceOrderSide, signature: &'a str, stop_price: Option<f64>, strategy_id: Option<i64>, strategy_type: Option<i64>, symbol: &'a str, time_in_force: Option<ReplaceOrderTimeInForce>, timestamp: i64, trailing_delta: Option<f64>, type_: ReplaceOrderType, ) -> Result<ResponseValue<ReplaceOrderResponse>, Error<Error>>

Cancel an Existing Order and Send a New Order (Trade)

Cancels an existing order and places a new order on the same symbol.

Filters and Order Count are evaluated before the processing of the cancellation and order placement occurs.

A new order that was not attempted (i.e. when newOrderResult: NOT_ATTEMPTED), will still increase the order count by 1.

Weight(IP): 1

Sends a POST request to /api/v3/order/cancelReplace

Arguments:

  • cancel_new_client_order_id: Used to uniquely identify this cancel. Automatically generated by default
  • cancel_order_id: Either the cancelOrigClientOrderId or cancelOrderId must be provided. If both are provided, cancelOrderId takes precedence.
  • cancel_orig_client_order_id: Either the cancelOrigClientOrderId or cancelOrderId must be provided. If both are provided, cancelOrderId takes precedence.
  • cancel_replace_mode: - STOP_ON_FAILURE If the cancel request fails, the new order placement will not be attempted.
  • ALLOW_FAILURES If new order placement will be attempted even if cancel request fails.
  • cancel_restrictions
  • iceberg_qty: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
  • new_client_order_id: Used to uniquely identify this cancel. Automatically generated by default
  • new_order_resp_type: Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK.
  • price: Order price
  • quantity: Order quantity
  • quote_order_qty: Quote quantity
  • recv_window: The value cannot be greater than 60000
  • self_trade_prevention_mode: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
  • side
  • signature: Signature
  • stop_price: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
  • strategy_id
  • strategy_type: The value cannot be less than 1000000.
  • symbol: Trading symbol, e.g. BNBUSDT
  • time_in_force: Order time in force
  • timestamp: UTC timestamp in ms
  • trailing_delta: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
  • type_: Order type
Source

pub async fn list_open_orders<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, symbol: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<Vec<OrderDetails>>, Error<Error>>

Current Open Orders (USER_DATA)

Get all open orders on a symbol. Careful when accessing this with no symbol.

Weight(IP):

  • 6 for a single symbol;
  • 80 when the symbol parameter is omitted;

Sends a GET request to /api/v3/openOrders

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn cancel_open_orders<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<CancelOpenOrdersResponseItem>>, Error<Error>>

Cancel all Open Orders on a Symbol (TRADE)

Cancels all active orders on a symbol. This includes OCO orders.

Weight(IP): 1

Sends a DELETE request to /api/v3/openOrders

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn all_orders<'a>( &'a self, end_time: Option<i64>, limit: Option<i32>, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<OrderDetails>>, Error<Error>>

All Orders (USER_DATA)

Get all account orders; active, canceled, or filled..

  • If orderId is set, it will get orders >= that orderId. Otherwise most recent orders are returned.
  • For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.
  • If startTime and/or endTime provided, orderId is not required

Weight(IP): 20

Sends a GET request to /api/v3/allOrders

Arguments:

  • end_time: UTC timestamp in ms
  • limit: Default 500; max 1000.
  • order_id: Order id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn place_order_oco<'a>( &'a self, limit_client_order_id: Option<&'a str>, limit_iceberg_qty: Option<f64>, limit_strategy_id: Option<i64>, limit_strategy_type: Option<i64>, list_client_order_id: Option<&'a str>, new_order_resp_type: Option<PlaceOrderOcoNewOrderRespType>, price: f64, quantity: f64, recv_window: Option<i64>, self_trade_prevention_mode: Option<PlaceOrderOcoSelfTradePreventionMode>, side: PlaceOrderOcoSide, signature: &'a str, stop_client_order_id: Option<&'a str>, stop_iceberg_qty: Option<f64>, stop_limit_price: Option<f64>, stop_limit_time_in_force: Option<PlaceOrderOcoStopLimitTimeInForce>, stop_price: f64, stop_strategy_id: Option<i64>, stop_strategy_type: Option<i64>, symbol: &'a str, timestamp: i64, trailing_delta: Option<f64>, ) -> Result<ResponseValue<PlaceOrderOcoResponse>, Error<Error>>

New OCO (TRADE)

Send in a new OCO

  • Price Restrictions:
    • SELL: Limit Price > Last Price > Stop Price
    • BUY: Limit Price < Last Price < Stop Price
  • Quantity Restrictions:
    • Both legs must have the same quantity
    • ICEBERG quantities however do not have to be the same
  • Order Rate Limit
    • OCO counts as 2 orders against the order rate limit.

Weight(IP): 1

Sends a POST request to /api/v3/order/oco

Arguments:

  • limit_client_order_id: A unique Id for the limit order
  • limit_iceberg_qty
  • limit_strategy_id
  • limit_strategy_type: The value cannot be less than 1000000.
  • list_client_order_id: A unique Id for the entire orderList
  • new_order_resp_type: Set the response JSON.
  • price: Order price
  • quantity
  • recv_window: The value cannot be greater than 60000
  • self_trade_prevention_mode: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
  • side
  • signature: Signature
  • stop_client_order_id: A unique Id for the stop loss/stop loss limit leg
  • stop_iceberg_qty
  • stop_limit_price: If provided, stopLimitTimeInForce is required.
  • stop_limit_time_in_force
  • stop_price
  • stop_strategy_id
  • stop_strategy_type
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
  • trailing_delta
Source

pub async fn order_list<'a>( &'a self, order_list_id: Option<i64>, orig_client_order_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<OrderListResponse>, Error<Error>>

Query OCO (USER_DATA)

Retrieves a specific OCO based on provided optional parameters

Weight(IP): 4

Sends a GET request to /api/v3/orderList

Arguments:

  • order_list_id: Order list id
  • orig_client_order_id: Order id from client
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn delete_order_list<'a>( &'a self, list_client_order_id: Option<&'a str>, new_client_order_id: Option<&'a str>, order_list_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<OcoOrder>, Error<Error>>

Cancel OCO (TRADE)

Cancel an entire Order List

Canceling an individual leg will cancel the entire OCO

Weight(IP): 1

Sends a DELETE request to /api/v3/orderList

Arguments:

  • list_client_order_id: A unique Id for the entire orderList
  • new_client_order_id: Used to uniquely identify this cancel. Automatically generated by default
  • order_list_id: Order list id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn all_order_list<'a>( &'a self, end_time: Option<i64>, from_id: Option<i64>, limit: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<Vec<AllOrderListResponseItem>>, Error<Error>>

Query all OCO (USER_DATA)

Retrieves all OCO based on provided optional parameters

Weight(IP): 20

Sends a GET request to /api/v3/allOrderList

Arguments:

  • end_time: UTC timestamp in ms
  • from_id: Trade id to fetch from. Default gets most recent trades.
  • limit: Default 500; max 1000.
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn open_order_list<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<OpenOrderListResponseItem>>, Error<Error>>

Query Open OCO (USER_DATA)

Weight(IP): 6

Sends a GET request to /api/v3/openOrderList

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sor_order<'a>( &'a self, iceberg_qty: Option<f64>, new_client_order_id: Option<&'a str>, new_order_resp_type: Option<SorOrderNewOrderRespType>, price: Option<f64>, quantity: f64, recv_window: Option<i64>, self_trade_prevention_mode: Option<SorOrderSelfTradePreventionMode>, side: SorOrderSide, signature: &'a str, strategy_id: Option<i64>, strategy_type: Option<i64>, symbol: &'a str, time_in_force: Option<SorOrderTimeInForce>, timestamp: i64, type_: SorOrderType, ) -> Result<ResponseValue<SorOrderResponse>, Error<Error>>

New order using SOR (TRADE)

Weight(IP): 6

Sends a POST request to /api/v3/sor/order

Arguments:

  • iceberg_qty: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
  • new_client_order_id: Used to uniquely identify this cancel. Automatically generated by default
  • new_order_resp_type: Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK.
  • price
  • quantity
  • recv_window: The value cannot be greater than 60000
  • self_trade_prevention_mode: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
  • side
  • signature: Signature
  • strategy_id
  • strategy_type: The value cannot be less than 1000000.
  • symbol: Trading symbol, e.g. BNBUSDT
  • time_in_force: Order time in force
  • timestamp: UTC timestamp in ms
  • type_: Order type
Source

pub async fn sor_order_test<'a>( &'a self, iceberg_qty: Option<f64>, new_client_order_id: Option<&'a str>, new_order_resp_type: Option<SorOrderTestNewOrderRespType>, price: Option<f64>, quantity: f64, recv_window: Option<i64>, self_trade_prevention_mode: Option<SorOrderTestSelfTradePreventionMode>, side: SorOrderTestSide, signature: &'a str, strategy_id: Option<i64>, strategy_type: Option<i64>, symbol: &'a str, time_in_force: Option<SorOrderTestTimeInForce>, timestamp: i64, type_: SorOrderTestType, ) -> Result<ResponseValue<Map<String, Value>>, Error<Error>>

Test new order using SOR (TRADE)

Test new order creation and signature/recvWindow using smart order routing (SOR). Creates and validates a new order but does not send it into the matching engine.

Sends a POST request to /api/v3/sor/order/test

Arguments:

  • iceberg_qty: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
  • new_client_order_id: Used to uniquely identify this cancel. Automatically generated by default
  • new_order_resp_type: Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK.
  • price
  • quantity
  • recv_window: The value cannot be greater than 60000
  • self_trade_prevention_mode: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
  • side
  • signature: Signature
  • strategy_id
  • strategy_type: The value cannot be less than 1000000.
  • symbol: Trading symbol, e.g. BNBUSDT
  • time_in_force: Order time in force
  • timestamp: UTC timestamp in ms
  • type_: Order type
Source

pub async fn account<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Account>, Error<Error>>

Account Information (USER_DATA)

Get current account information.

Weight(IP): 20

Sends a GET request to /api/v3/account

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn my_trades<'a>( &'a self, end_time: Option<i64>, from_id: Option<i64>, limit: Option<i32>, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<MyTrade>>, Error<Error>>

Account Trade List (USER_DATA)

Get trades for a specific account and symbol.

If fromId is set, it will get id >= that fromId. Otherwise most recent orders are returned.

The time between startTime and endTime can’t be longer than 24 hours. These are the supported combinations of all parameters:

symbol

symbol + orderId

symbol + startTime

symbol + endTime

symbol + fromId

symbol + startTime + endTime

symbol+ orderId + fromId

Weight(IP): 20

Sends a GET request to /api/v3/myTrades

Arguments:

  • end_time: UTC timestamp in ms
  • from_id: Trade id to fetch from. Default gets most recent trades.
  • limit: Default 500; max 1000.
  • order_id: This can only be used in combination with symbol.
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn rate_limit_order<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<RateLimitOrderResponseItem>>, Error<Error>>

Query Current Order Count Usage (TRADE)

Displays the user’s current order count usage for all intervals.

Weight(IP): 40

Sends a GET request to /api/v3/rateLimit/order

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn my_prevented_matches<'a>( &'a self, from_prevented_match_id: Option<i64>, limit: Option<i32>, order_id: Option<i64>, prevented_match_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<MyPreventedMatchesResponseItem>>, Error<Error>>

Query Prevented Matches

Displays the list of orders that were expired because of STP.

For additional information on what a Prevented match is, as well as Self Trade Prevention (STP), please refer to our STP FAQ page.

These are the combinations supported:

  • symbol + preventedMatchId
  • symbol + orderId
  • symbol + orderId + fromPreventedMatchId (limit will default to 500)
  • symbol + orderId + fromPreventedMatchId + limit

Weight(IP):

Case Weight If symbol is invalid: 2 Querying by preventedMatchId: 2 Querying by orderId: 20

Sends a GET request to /api/v3/myPreventedMatches

Arguments:

  • from_prevented_match_id
  • limit: Default 500; max 1000.
  • order_id: Order id
  • prevented_match_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn my_allocations<'a>( &'a self, end_time: Option<i64>, from_allocation_id: Option<i64>, limit: Option<i32>, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<MyAllocationsResponseItem>>, Error<Error>>

Query Allocations (USER_DATA)

Retrieves allocations resulting from SOR order placement.

Weight: 20

Supported parameter combinations: Parameters Response symbol allocations from oldest to newest symbol + startTime oldest allocations since startTime symbol + endTime newest allocations until endTime symbol + startTime + endTime allocations within the time range symbol + fromAllocationId allocations by allocation ID symbol + orderId allocations related to an order starting with oldest symbol + orderId + fromAllocationId allocations related to an order by allocation ID

Note: The time between startTime and endTime can’t be longer than 24 hours.

Sends a GET request to /api/v3/myAllocations

Arguments:

  • end_time: UTC timestamp in ms
  • from_allocation_id
  • limit: Default 500; max 1000.
  • order_id: Order id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn get_margin_transfer<'a>( &'a self, archived: Option<&'a str>, asset: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, type_: Option<GetMarginTransferType>, ) -> Result<ResponseValue<GetMarginTransferResponse>, Error<Error>>

Get Cross Margin Transfer History (USER_DATA)

  • Response in descending order
  • Returns data for last 7 days by default
  • Set archived to true to query data from 6 months ago

Weight(IP): 1

Sends a GET request to /sapi/v1/margin/transfer

Arguments:

  • archived: Default: false. Set to true for archived data from 6 months ago
  • asset
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • type_
Source

pub async fn execute_margin_transfer<'a>( &'a self, amount: f64, asset: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, type_: i64, ) -> Result<ResponseValue<Transaction>, Error<Error>>

Cross Margin Account Transfer (MARGIN)

Execute transfer between spot account and cross margin account.

Weight(IP): 600

Sends a POST request to /sapi/v1/margin/transfer

Arguments:

  • amount
  • asset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • type_: * 1 - transfer from main account to margin account
  • 2 - transfer from margin account to main account
Source

pub async fn query_margin_loan_record<'a>( &'a self, archived: Option<&'a str>, asset: &'a str, current: Option<i32>, end_time: Option<i64>, isolated_symbol: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, tx_id: Option<i64>, ) -> Result<ResponseValue<QueryMarginLoanRecordResponse>, Error<Error>>

Query Loan Record (USER_DATA)

  • txId or startTime must be sent. txId takes precedence.
  • Response in descending order
  • If isolatedSymbol is not sent, crossed margin data will be returned
  • Set archived to true to query data from 6 months ago

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/loan

Arguments:

  • archived: Default: false. Set to true for archived data from 6 months ago
  • asset
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • isolated_symbol: Isolated symbol
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • tx_id: the tranId in POST /sapi/v1/margin/loan
Source

pub async fn apply_for_margin_loan<'a>( &'a self, amount: f64, asset: &'a str, is_isolated: Option<ApplyForMarginLoanIsIsolated>, recv_window: Option<i64>, signature: &'a str, symbol: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<Transaction>, Error<Error>>

Margin Account Borrow (MARGIN)

Apply for a loan.

  • If “isIsolated” = “TRUE”, “symbol” must be sent
  • “isIsolated” = “FALSE” for crossed margin loan

Weight(UID): 3000

Sends a POST request to /sapi/v1/margin/loan

Arguments:

  • amount
  • asset
  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn query_margin_repay<'a>( &'a self, archived: Option<&'a str>, asset: &'a str, current: Option<i32>, end_time: Option<i64>, isolated_symbol: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, tx_id: Option<i64>, ) -> Result<ResponseValue<QueryMarginRepayResponse>, Error<Error>>

Query Repay Record (USER_DATA)

  • txId or startTime must be sent. txId takes precedence.
  • Response in descending order
  • If isolatedSymbol is not sent, crossed margin data will be returned
  • Set archived to true to query data from 6 months ago

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/repay

Arguments:

  • archived: Default: false. Set to true for archived data from 6 months ago
  • asset
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • isolated_symbol: Isolated symbol
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • tx_id: the tranId in POST /sapi/v1/margin/repay
Source

pub async fn margin_repay<'a>( &'a self, amount: f64, asset: &'a str, is_isolated: Option<MarginRepayIsIsolated>, recv_window: Option<i64>, signature: &'a str, symbol: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<Transaction>, Error<Error>>

Margin Account Repay (MARGIN)

Repay loan for margin account.

  • If “isIsolated” = “TRUE”, “symbol” must be sent
  • “isIsolated” = “FALSE” for crossed margin repay

Weight(IP): 3000

Sends a POST request to /sapi/v1/margin/repay

Arguments:

  • amount
  • asset
  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_asset<'a>( &'a self, asset: &'a str, ) -> Result<ResponseValue<MarginAssetResponse>, Error<Error>>

Query Margin Asset (MARKET_DATA)

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/asset

Source

pub async fn margin_pair<'a>( &'a self, symbol: &'a str, ) -> Result<ResponseValue<MarginPairResponse>, Error<Error>>

Query Cross Margin Pair (MARKET_DATA)

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/pair

Arguments:

  • symbol: Trading symbol, e.g. BNBUSDT
Source

pub async fn margin_all_assets<'a>( &'a self, ) -> Result<ResponseValue<Vec<MarginAllAssetsResponseItem>>, Error<Error>>

Get All Margin Assets (MARKET_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/margin/allAssets

Source

pub async fn margin_all_pairs<'a>( &'a self, ) -> Result<ResponseValue<Vec<MarginAllPairsResponseItem>>, Error<Error>>

Get All Cross Margin Pairs (MARKET_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/margin/allPairs

Source

pub async fn margin_price_index<'a>( &'a self, symbol: &'a str, ) -> Result<ResponseValue<MarginPriceIndexResponse>, Error<Error>>

Query Margin PriceIndex (MARKET_DATA)

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/priceIndex

Arguments:

  • symbol: Trading symbol, e.g. BNBUSDT
Source

pub async fn margin_order<'a>( &'a self, is_isolated: Option<MarginOrderIsIsolated>, order_id: Option<i64>, orig_client_order_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<MarginOrderDetail>, Error<Error>>

Query Margin Account’s Order (USER_DATA)

  • Either orderId or origClientOrderId must be sent.
  • For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/order

Arguments:

  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • order_id: Order id
  • orig_client_order_id: Order id from client
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn post_margin_order<'a>( &'a self, auto_repay_at_cancel: bool, iceberg_qty: Option<f64>, is_isolated: Option<PostMarginOrderIsIsolated>, new_client_order_id: Option<&'a str>, new_order_resp_type: Option<PostMarginOrderNewOrderRespType>, price: Option<f64>, quantity: f64, quote_order_qty: Option<f64>, recv_window: Option<i64>, self_trade_prevention_mode: Option<PostMarginOrderSelfTradePreventionMode>, side: PostMarginOrderSide, side_effect_type: Option<PostMarginOrderSideEffectType>, signature: &'a str, stop_price: Option<f64>, symbol: &'a str, time_in_force: Option<PostMarginOrderTimeInForce>, timestamp: i64, type_: PostMarginOrderType, ) -> Result<ResponseValue<PostMarginOrderResponse>, Error<Error>>

Margin Account New Order (TRADE)

Post a new order for margin account.

Weight(UID): 6

Sends a POST request to /sapi/v1/margin/order

Arguments:

  • auto_repay_at_cancel
  • iceberg_qty: Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • new_client_order_id: Used to uniquely identify this cancel. Automatically generated by default
  • new_order_resp_type: Set the response JSON.
  • price: Order price
  • quantity
  • quote_order_qty: Quote quantity
  • recv_window: The value cannot be greater than 60000
  • self_trade_prevention_mode: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
  • side
  • side_effect_type: Default NO_SIDE_EFFECT
  • signature: Signature
  • stop_price: Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
  • symbol: Trading symbol, e.g. BNBUSDT
  • time_in_force: Order time in force
  • timestamp: UTC timestamp in ms
  • type_: Order type
Source

pub async fn cancel_margin_order<'a>( &'a self, is_isolated: Option<CancelMarginOrderIsIsolated>, new_client_order_id: Option<&'a str>, order_id: Option<i64>, orig_client_order_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<MarginOrder>, Error<Error>>

Margin Account Cancel Order (TRADE)

Cancel an active order for margin account.

Either orderId or origClientOrderId must be sent.

Weight(IP): 10

Sends a DELETE request to /sapi/v1/margin/order

Arguments:

  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • new_client_order_id: Used to uniquely identify this cancel. Automatically generated by default
  • order_id: Order id
  • orig_client_order_id: Order id from client
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_interest_history<'a>( &'a self, archived: Option<&'a str>, asset: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, isolated_symbol: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<MarginInterestHistoryResponse>, Error<Error>>

Get Interest History (USER_DATA)

  • Response in descending order
  • If isolatedSymbol is not sent, crossed margin data will be returned
  • Set archived to true to query data from 6 months ago
  • type in response has 4 enums:
    • PERIODIC interest charged per hour
    • ON_BORROW first interest charged on borrow
    • PERIODIC_CONVERTED interest charged per hour converted into BNB
    • ON_BORROW_CONVERTED first interest charged on borrow converted into BNB

Weight(IP): 1

Sends a GET request to /sapi/v1/margin/interestHistory

Arguments:

  • archived: Default: false. Set to true for archived data from 6 months ago
  • asset
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • isolated_symbol: Isolated symbol
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_force_liquidation_rec<'a>( &'a self, current: Option<i32>, end_time: Option<i64>, isolated_symbol: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<MarginForceLiquidationRecResponse>, Error<Error>>

Get Force Liquidation Record (USER_DATA)

  • Response in descending order

Weight(IP): 1

Sends a GET request to /sapi/v1/margin/forceLiquidationRec

Arguments:

  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • isolated_symbol: Isolated symbol
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_account<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<MarginAccountResponse>, Error<Error>>

Query Cross Margin Account Details (USER_DATA)

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/account

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_open_orders<'a>( &'a self, is_isolated: Option<MarginOpenOrdersIsIsolated>, recv_window: Option<i64>, signature: &'a str, symbol: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<Vec<MarginOrderDetail>>, Error<Error>>

Query Margin Account’s Open Orders (USER_DATA)

  • If the symbol is not sent, orders for all symbols will be returned in an array.
  • When all symbols are returned, the number of requests counted against the rate limiter is equal to the number of symbols currently trading on the exchange
  • If isIsolated =“TRUE”, symbol must be sent.

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/openOrders

Arguments:

  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_cancel_orders<'a>( &'a self, is_isolated: Option<MarginCancelOrdersIsIsolated>, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<MarginCancelOrdersResponseItem>>, Error<Error>>

Margin Account Cancel all Open Orders on a Symbol (TRADE)

  • Cancels all active orders on a symbol for margin account.
  • This includes OCO orders.

Weight(IP): 1

Sends a DELETE request to /sapi/v1/margin/openOrders

Arguments:

  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_query_all_orders<'a>( &'a self, end_time: Option<i64>, is_isolated: Option<MarginQueryAllOrdersIsIsolated>, limit: Option<i32>, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<MarginOrderDetail>>, Error<Error>>

Query Margin Account’s All Orders (USER_DATA)

  • If orderId is set, it will get orders >= that orderId. Otherwise most recent orders are returned.
  • For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.

Weight(IP): 200

Request Limit: 60 times/min per IP

Sends a GET request to /sapi/v1/margin/allOrders

Arguments:

  • end_time: UTC timestamp in ms
  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • limit: Default 500; max 1000.
  • order_id: Order id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn send_margin_query_oco<'a>( &'a self, is_isolated: Option<SendMarginQueryOcoIsIsolated>, limit_client_order_id: Option<&'a str>, limit_iceberg_qty: Option<f64>, list_client_order_id: Option<&'a str>, new_order_resp_type: Option<SendMarginQueryOcoNewOrderRespType>, price: f64, quantity: f64, recv_window: Option<i64>, self_trade_prevention_mode: Option<SendMarginQueryOcoSelfTradePreventionMode>, side: SendMarginQueryOcoSide, side_effect_type: Option<SendMarginQueryOcoSideEffectType>, signature: &'a str, stop_client_order_id: Option<&'a str>, stop_iceberg_qty: Option<f64>, stop_limit_price: Option<f64>, stop_limit_time_in_force: Option<SendMarginQueryOcoStopLimitTimeInForce>, stop_price: f64, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<SendMarginQueryOcoResponse>, Error<Error>>

Margin Account New OCO (TRADE)

Send in a new OCO for a margin account

  • Price Restrictions:
    • SELL: Limit Price > Last Price > Stop Price
    • BUY: Limit Price < Last Price < Stop Price
  • Quantity Restrictions:
    • Both legs must have the same quantity
    • ICEBERG quantities however do not have to be the same.
  • Order Rate Limit
    • OCO counts as 2 orders against the order rate limit.

Weight(UID): 6

Sends a POST request to /sapi/v1/margin/order/oco

Arguments:

  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • limit_client_order_id: A unique Id for the limit order
  • limit_iceberg_qty
  • list_client_order_id: A unique Id for the entire orderList
  • new_order_resp_type: Set the response JSON.
  • price: Order price
  • quantity
  • recv_window: The value cannot be greater than 60000
  • self_trade_prevention_mode: The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
  • side
  • side_effect_type: Default NO_SIDE_EFFECT
  • signature: Signature
  • stop_client_order_id: A unique Id for the stop loss/stop loss limit leg
  • stop_iceberg_qty
  • stop_limit_price: If provided, stopLimitTimeInForce is required.
  • stop_limit_time_in_force
  • stop_price
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_order_list<'a>( &'a self, is_isolated: Option<MarginOrderListIsIsolated>, order_list_id: Option<i64>, orig_client_order_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, symbol: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<MarginOrderListResponse>, Error<Error>>

Query Margin Account’s OCO (USER_DATA)

Retrieves a specific OCO based on provided optional parameters

  • Either orderListId or origClientOrderId must be provided

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/orderList

Arguments:

  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • order_list_id: Order list id
  • orig_client_order_id: Order id from client
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Mandatory for isolated margin, not supported for cross margin
  • timestamp: UTC timestamp in ms
Source

pub async fn cancel_margin_order_oco<'a>( &'a self, is_isolated: Option<CancelMarginOrderOcoIsIsolated>, list_client_order_id: Option<&'a str>, new_client_order_id: Option<&'a str>, order_list_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<MarginOcoOrder>, Error<Error>>

Margin Account Cancel OCO (TRADE)

Cancel an entire Order List for a margin account

  • Canceling an individual leg will cancel the entire OCO
  • Either orderListId or listClientOrderId must be provided

Weight(UID): 1

Sends a DELETE request to /sapi/v1/margin/orderList

Arguments:

  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • list_client_order_id: A unique Id for the entire orderList
  • new_client_order_id: Used to uniquely identify this cancel. Automatically generated by default
  • order_list_id: Order list id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_all_order_list<'a>( &'a self, end_time: Option<i64>, from_id: Option<&'a str>, is_isolated: Option<MarginAllOrderListIsIsolated>, limit: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, symbol: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<Vec<MarginAllOrderListResponseItem>>, Error<Error>>

Query Margin Account’s all OCO (USER_DATA)

Retrieves all OCO for a specific margin account based on provided optional parameters

Weight(IP): 200

Sends a GET request to /sapi/v1/margin/allOrderList

Arguments:

  • end_time: UTC timestamp in ms
  • from_id: If supplied, neither startTime or endTime can be provided
  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • limit: Default Value: 500; Max Value: 1000
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • symbol: Mandatory for isolated margin, not supported for cross margin
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_open_order_list<'a>( &'a self, is_isolated: Option<MarginOpenOrderListIsIsolated>, recv_window: Option<i64>, signature: &'a str, symbol: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<Vec<MarginOpenOrderListResponseItem>>, Error<Error>>

Query Margin Account’s Open OCO (USER_DATA)

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/openOrderList

Arguments:

  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Mandatory for isolated margin, not supported for cross margin
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_my_trades<'a>( &'a self, end_time: Option<i64>, from_id: Option<i64>, is_isolated: Option<MarginMyTradesIsIsolated>, limit: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<MarginTrade>>, Error<Error>>

Query Margin Account’s Trade List (USER_DATA)

  • If fromId is set, it will get orders >= that fromId. Otherwise most recent trades are returned.

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/myTrades

Arguments:

  • end_time: UTC timestamp in ms
  • from_id: Trade id to fetch from. Default gets most recent trades.
  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • limit: Default 500; max 1000.
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_max_borrowable<'a>( &'a self, asset: &'a str, isolated_symbol: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<MarginMaxBorrowableResponse>, Error<Error>>

Query Max Borrow (USER_DATA)

  • If isolatedSymbol is not sent, crossed margin data will be sent.
  • borrowLimit is also available from https://www.binance.com/en/margin-fee

Weight(IP): 50

Sends a GET request to /sapi/v1/margin/maxBorrowable

Arguments:

  • asset
  • isolated_symbol: Isolated symbol
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_max_transferable<'a>( &'a self, asset: &'a str, isolated_symbol: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<MarginMaxTransferableResponse>, Error<Error>>

Query Max Transfer-Out Amount (USER_DATA)

  • If isolatedSymbol is not sent, crossed margin data will be sent.

Weight(IP): 50

Sends a GET request to /sapi/v1/margin/maxTransferable

Arguments:

  • asset
  • isolated_symbol: Isolated symbol
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_trade_coeff<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<MarginTradeCoeffResponse>, Error<Error>>

Get Summary of Margin account (USER_DATA)

Get personal margin level information

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/tradeCoeff

Arguments:

  • email: Email Address
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn query_margin_isolated_transfer<'a>( &'a self, asset: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, symbol: &'a str, timestamp: i64, type_: Option<QueryMarginIsolatedTransferType>, ) -> Result<ResponseValue<MarginTransferDetails>, Error<Error>>

Get Isolated Margin Transfer History (USER_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/margin/isolated/transfer

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
  • type_
Source

pub async fn post_margin_isolated_transfer<'a>( &'a self, amount: f64, asset: &'a str, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, timestamp: i64, trans_from: PostMarginIsolatedTransferTransFrom, trans_to: PostMarginIsolatedTransferTransTo, ) -> Result<ResponseValue<Map<String, Value>>, Error<Error>>

Isolated Margin Account Transfer (MARGIN)

Weight(UID): 600

Sends a POST request to /sapi/v1/margin/isolated/transfer

Arguments:

  • amount
  • asset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
  • trans_from
  • trans_to
Source

pub async fn query_margin_isolated_account<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, symbols: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<IsolatedMarginAccountInfo>, Error<Error>>

Query Isolated Margin Account Info (USER_DATA)

  • If “symbols” is not sent, all isolated assets will be returned.
  • If “symbols” is sent, only the isolated assets of the sent symbols will be returned.

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/isolated/account

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbols: Max 5 symbols can be sent; separated by ‘,’
  • timestamp: UTC timestamp in ms
Source

pub async fn post_margin_isolated_account<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<PostMarginIsolatedAccountResponse>, Error<Error>>

Enable Isolated Margin Account (TRADE)

Enable isolated margin account for a specific symbol.

Weight(UID): 300

Sends a POST request to /sapi/v1/margin/isolated/account

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn disable_isolated_margin_account<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<DisableIsolatedMarginAccountResponse>, Error<Error>>

Disable Isolated Margin Account (TRADE)

Disable isolated margin account for a specific symbol. Each trading pair can only be deactivated once every 24 hours .

Weight(UID): 300

Sends a DELETE request to /sapi/v1/margin/isolated/account

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_isolated_account_limit<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<MarginIsolatedAccountLimitResponse>, Error<Error>>

Query Enabled Isolated Margin Account Limit (USER_DATA)

Query enabled isolated margin account limit.

Weight(IP): 1

Sends a GET request to /sapi/v1/margin/isolated/accountLimit

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_isolated_pair<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<MarginIsolatedPairResponse>, Error<Error>>

Query Isolated Margin Symbol (USER_DATA)

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/isolated/pair

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_isolated_all_pairs<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<MarginIsolatedAllPairsResponseItem>>, Error<Error>>

Get All Isolated Margin Symbol(USER_DATA)

Weight(IP): 10

Sends a GET request to /sapi/v1/margin/isolated/allPairs

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn query_toggle_bnb_burn_status<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<BnbBurnStatus>, Error<Error>>

Get BNB Burn Status(USER_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/bnbBurn

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn toggle_bnb_burn<'a>( &'a self, interest_bnb_burn: Option<ToggleBnbBurnInterestBnbBurn>, recv_window: Option<i64>, signature: &'a str, spot_bnb_burn: Option<ToggleBnbBurnSpotBnbBurn>, timestamp: i64, ) -> Result<ResponseValue<BnbBurnStatus>, Error<Error>>

Toggle BNB Burn On Spot Trade And Margin Interest (USER_DATA)

  • “spotBNBBurn” and “interestBNBBurn” should be sent at least one.

Weight(IP): 1

Sends a POST request to /sapi/v1/bnbBurn

Arguments:

  • interest_bnb_burn: Determines whether to use BNB to pay for margin loan’s interest
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • spot_bnb_burn: Determines whether to use BNB to pay for trading fees on SPOT
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_interest_rate_history<'a>( &'a self, asset: &'a str, end_time: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, vip_level: Option<i32>, ) -> Result<ResponseValue<Vec<MarginInterestRateHistoryResponseItem>>, Error<Error>>

Margin Interest Rate History (USER_DATA)

The max interval between startTime and endTime is 30 days.

Weight(IP): 1

Sends a GET request to /sapi/v1/margin/interestRateHistory

Arguments:

  • asset
  • end_time: UTC timestamp in ms
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • vip_level: Defaults to user’s vip level
Source

pub async fn margin_cross_margin_data<'a>( &'a self, coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, vip_level: Option<i32>, ) -> Result<ResponseValue<Vec<MarginCrossMarginDataResponseItem>>, Error<Error>>

Query Cross Margin Fee Data (USER_DATA)

Get cross margin fee data collection with any vip level or user’s current specific data as https://www.binance.com/en/margin-fee

Weight(IP): 1 when coin is specified; 5 when the coin parameter is omitted

Sends a GET request to /sapi/v1/margin/crossMarginData

Arguments:

  • coin: Coin name
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • vip_level: Defaults to user’s vip level
Source

pub async fn margin_isolated_margin_data<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, symbol: Option<&'a str>, timestamp: i64, vip_level: Option<i32>, ) -> Result<ResponseValue<Vec<MarginIsolatedMarginDataResponseItem>>, Error<Error>>

Query Isolated Margin Fee Data (USER_DATA)

Get isolated margin fee data collection with any vip level or user’s current specific data as https://www.binance.com/en/margin-fee

Weight(IP): 1 when a single is specified; 10 when the symbol parameter is omitted

Sends a GET request to /sapi/v1/margin/isolatedMarginData

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
  • vip_level: Defaults to user’s vip level
Source

pub async fn margin_isolated_margin_tier<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, symbol: &'a str, tier: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<Vec<MarginIsolatedMarginTierResponseItem>>, Error<Error>>

Query Isolated Margin Tier Data (USER_DATA)

Get isolated margin tier data collection with any tier as https://www.binance.com/en/margin-data

Weight(IP): 1

Sends a GET request to /sapi/v1/margin/isolatedMarginTier

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • tier: All margin tier data will be returned if tier is omitted
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_rate_limit_order<'a>( &'a self, is_isolated: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, symbol: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<Vec<MarginRateLimitOrderResponseItem>>, Error<Error>>

Query Current Margin Order Count Usage (TRADE)

Displays the user’s current margin order count usage for all intervals.

Weight(IP): 20

Sends a GET request to /sapi/v1/margin/rateLimit/order

Arguments:

  • is_isolated: * TRUE - For isolated margin
  • FALSE - Default, not for isolated margin
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: isolated symbol, mandatory for isolated margin
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_dribblet<'a>( &'a self, end_time: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<MarginDribbletResponse>, Error<Error>>

Margin Dustlog (USER_DATA)

Query the historical information of user margin account small-value asset conversion BNB.

Weight(IP): 1

Sends a GET request to /sapi/v1/margin/dribblet

Arguments:

  • end_time: UTC timestamp in ms
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_cross_margin_collateral_ratio<'a>( &'a self, ) -> Result<ResponseValue<Vec<MarginCrossMarginCollateralRatioResponseItem>>, Error<Error>>

Cross margin collateral ratio (MARKET_DATA)

Weight(IP): 100

Sends a GET request to /sapi/v1/margin/crossMarginCollateralRatio

Source

pub async fn margin_exchange_small_liability<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<MarginExchangeSmallLiabilityResponseItem>>, Error<Error>>

Get Small Liability Exchange Coin List (USER_DATA)

Query the coins which can be small liability exchange

Weight(UID): 100

Sends a GET request to /sapi/v1/margin/exchange-small-liability

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_exchange_small_liability_history<'a>( &'a self, current: Option<i32>, end_time: Option<i64>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<MarginExchangeSmallLiabilityHistoryResponse>, Error<Error>>

Get Small Liability Exchange History (USER_DATA)

Get Small liability Exchange History

Weight(UID): 100

Sends a GET request to /sapi/v1/margin/exchange-small-liability-history

Arguments:

  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_next_hourly_interest_rate<'a>( &'a self, assets: Option<&'a str>, is_isolated: Option<MarginNextHourlyInterestRateIsIsolated>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<MarginNextHourlyInterestRateResponseItem>>, Error<Error>>

Get a future hourly interest rate (USER_DATA)

Get user the next hourly estimate interest

Weight(UID): 100

Sends a GET request to /sapi/v1/margin/next-hourly-interest-rate

Arguments:

  • assets: List of assets, separated by commas, up to 20
  • is_isolated: for isolated margin or not, “TRUE”, “FALSE”
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_capital_flow<'a>( &'a self, asset: Option<&'a str>, end_time: Option<i64>, from_id: Option<i64>, limit: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, symbol: Option<&'a str>, timestamp: i64, type_: Option<MarginCapitalFlowType>, ) -> Result<ResponseValue<Vec<MarginCapitalFlowResponseItem>>, Error<Error>>

Get cross or isolated margin capital flow(USER_DATA)

Get cross or isolated margin capital flow

Weight(IP): 100

Sends a GET request to /sapi/v1/margin/capital-flow

Arguments:

  • asset
  • end_time: UTC timestamp in ms
  • from_id: If fromId is set, the data with id > fromId will be returned. Otherwise the latest data will be returned
  • limit: The number of data items returned each time is limited. Default 500; Max 1000.
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: Only supports querying the data of the last 90 days
  • symbol: Required when querying isolated data
  • timestamp: UTC timestamp in ms
  • type_
Source

pub async fn margin_delist_schedule<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<MarginDelistScheduleResponseItem>>, Error<Error>>

Get tokens or symbols delist schedule for cross margin and isolated margin (MARKET_DATA)

Get tokens or symbols delist schedule for cross margin and isolated margin

Weight(IP): 100

Sends a GET request to /sapi/v1/margin/delist-schedule

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_available_inventory<'a>( &'a self, signature: &'a str, timestamp: i64, type_: MarginAvailableInventoryType, ) -> Result<ResponseValue<MarginAvailableInventoryResponse>, Error<Error>>

Query Margin Available Inventory (USER_DATA)

Margin available Inventory query

Weight(UID): 50

Sends a GET request to /sapi/v1/margin/available-inventory

Arguments:

  • signature: Signature
  • timestamp: UTC timestamp in ms
  • type_
Source

pub async fn margin_manual_liquidation<'a>( &'a self, signature: &'a str, symbol: Option<&'a str>, timestamp: i64, type_: MarginManualLiquidationType, ) -> Result<ResponseValue<Vec<MarginManualLiquidationResponseItem>>, Error<Error>>

Margin manual liquidation(MARGIN)

Margin manual liquidation

Weight(UID): 3000

Sends a POST request to /sapi/v1/margin/manual-liquidation

Arguments:

  • signature: Signature
  • symbol
  • timestamp: UTC timestamp in ms
  • type_
Source

pub async fn margin_dust<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<MarginDustResponse>, Error<Error>>

Get Assets That Can Be Converted Into BNB (USER_DATA)

Get assets that can be converted into BNB.

Weight(IP): 100

Sends a GET request to /sapi/v1/margin/dust

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn convert_dust_assets_to_bnb<'a>( &'a self, asset: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<ConvertDustAssetsToBnbResponse>, Error<Error>>

Dust Transfer (TRADE)

Convert dust assets to BNB

Weight(UID): 3000

Sends a POST request to /sapi/v1/margin/dust

Arguments:

  • asset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_max_leverage<'a>( &'a self, max_leverage: i64, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<MarginMaxLeverageResponse>, Error<Error>>

Adjust cross margin max leverage (USER_DATA)

Adjust cross margin max leverage

Weight(UID): 3000

Sends a POST request to /sapi/v1/margin/max-leverage

Arguments:

  • max_leverage: Can only adjust 3 or 5
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn margin_leverage_bracket<'a>( &'a self, ) -> Result<ResponseValue<Vec<MarginLeverageBracketResponseItem>>, Error<Error>>

Query Liability Coin Leverage Bracket in Cross Margin Pro Mode (MARKET_DATA)

Liability Coin Leverage Bracket in Cross Margin Pro Mode

Weight(IP): 1

Sends a GET request to /sapi/v1/margin/leverageBracket

Source

pub async fn system_status<'a>( &'a self, ) -> Result<ResponseValue<SystemStatusResponse>, Error<()>>

System Status (System)

Fetch system status.

Weight(IP): 1

Sends a GET request to /sapi/v1/system/status

Source

pub async fn capital_config_getall<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<CapitalConfigGetallResponseItem>>, Error<Error>>

All Coins’ Information (USER_DATA)

Get information of coins (available for deposit and withdraw) for user.

Weight(IP): 10

Sends a GET request to /sapi/v1/capital/config/getall

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn account_snapshot<'a>( &'a self, end_time: Option<i64>, limit: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, type_: AccountSnapshotType, ) -> Result<ResponseValue<AccountSnapshotResponse>, Error<Error>>

Daily Account Snapshot (USER_DATA)

  • The query time period must be less than 30 days
  • Support query within the last one month only
  • If startTimeand endTime not sent, return records of the last 7 days by default

Weight(IP): 2400

Sends a GET request to /sapi/v1/accountSnapshot

Arguments:

  • end_time: UTC timestamp in ms
  • limit
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • type_
Source

pub async fn account_disable_fast_withdraw_switch<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Map<String, Value>>, Error<Error>>

Disable Fast Withdraw Switch (USER_DATA)

  • This request will disable fastwithdraw switch under your account.
  • You need to enable “trade” option for the api key which requests this endpoint.

Weight(IP): 1

Sends a POST request to /sapi/v1/account/disableFastWithdrawSwitch

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn account_enable_fast_withdraw_switch<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Map<String, Value>>, Error<Error>>

Enable Fast Withdraw Switch (USER_DATA)

  • This request will enable fastwithdraw switch under your account. You need to enable “trade” option for the api key which requests this endpoint.
  • When Fast Withdraw Switch is on, transferring funds to a Binance account will be done instantly. There is no on-chain transaction, no transaction ID and no withdrawal fee.

Weight(IP): 1

Sends a POST request to /sapi/v1/account/enableFastWithdrawSwitch

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn capital_withdraw_apply<'a>( &'a self, address: &'a str, address_tag: Option<&'a str>, amount: f64, coin: &'a str, name: Option<&'a str>, network: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, transaction_fee_flag: Option<bool>, wallet_type: Option<i32>, withdraw_order_id: Option<&'a str>, ) -> Result<ResponseValue<CapitalWithdrawApplyResponse>, Error<Error>>

Withdraw (USER_DATA)

Submit a withdraw request.

  • If network not send, return with default network of the coin.
  • You can get network and isDefault in networkList of a coin in the response of Get /sapi/v1/capital/config/getall (HMAC SHA256).

Weight(IP): 1

Sends a POST request to /sapi/v1/capital/withdraw/apply

Arguments:

  • address
  • address_tag: Secondary address identifier for coins like XRP,XMR etc.
  • amount
  • coin: Coin name
  • name
  • network
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • transaction_fee_flag: When making internal transfer
  • true -> returning the fee to the destination account;
  • false -> returning the fee back to the departure account.
  • wallet_type: The wallet type for withdraw,0-Spot wallet, 1- Funding wallet. Default is Spot wallet
  • withdraw_order_id: Client id for withdraw
Source

pub async fn capital_deposit_hisrec<'a>( &'a self, coin: Option<&'a str>, end_time: Option<i64>, limit: Option<i32>, offset: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, status: Option<i32>, timestamp: i64, ) -> Result<ResponseValue<Vec<CapitalDepositHisrecResponseItem>>, Error<Error>>

Deposit History(supporting network) (USER_DATA)

Fetch deposit history.

  • Please notice the default startTime and endTime to make sure that time interval is within 0-90 days.
  • If both startTime and endTime are sent, time between startTime and endTime must be less than 90 days.

Weight(IP): 1

Sends a GET request to /sapi/v1/capital/deposit/hisrec

Arguments:

  • coin: Coin name
  • end_time: UTC timestamp in ms
  • limit: Default 500; max 1000.
  • offset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • status: * 0 - pending
  • 6 - credited but cannot withdraw
  • 1 - success
  • timestamp: UTC timestamp in ms
Source

pub async fn capital_withdraw_history<'a>( &'a self, coin: Option<&'a str>, end_time: Option<i64>, limit: Option<i32>, offset: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, status: Option<i64>, timestamp: i64, withdraw_order_id: Option<&'a str>, ) -> Result<ResponseValue<Vec<CapitalWithdrawHistoryResponseItem>>, Error<Error>>

Withdraw History (supporting network) (USER_DATA)

Fetch withdraw history.

This endpoint specifically uses per second UID rate limit, user’s total second level IP rate limit is 180000/second. Response from the endpoint contains header key X-SAPI-USED-UID-WEIGHT-1S, which defines weight used by the current IP.

  • network may not be in the response for old withdraw.
  • Please notice the default startTime and endTime to make sure that time interval is within 0-90 days.
  • If both startTime and endTime are sent, time between startTime and endTime must be less than 90 days
  • If withdrawOrderId is sent, time between startTime and endTime must be less than 7 days.
  • If withdrawOrderId is sent, startTime and endTime are not sent, will return last 7 days records by default.

Weight(UID): 18000 Request Limit: 10 requests per second

Sends a GET request to /sapi/v1/capital/withdraw/history

Arguments:

  • coin: Coin name
  • end_time: UTC timestamp in ms
  • limit: Default 500; max 1000.
  • offset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • status: * 0 - Email Sent
  • 1 - Cancelled
  • 2 - Awaiting Approval
  • 3 - Rejected
  • 4 - Processing
  • 5 - Failure
  • 6 - Completed
  • timestamp: UTC timestamp in ms
  • withdraw_order_id
Source

pub async fn capital_deposit_address<'a>( &'a self, coin: &'a str, network: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<CapitalDepositAddressResponse>, Error<Error>>

Deposit Address (supporting network) (USER_DATA)

Fetch deposit address with network.

  • If network is not send, return with default network of the coin.
  • You can get network and isDefault in networkList in the response of Get /sapi/v1/capital/config/getall (HMAC SHA256).

Weight(IP): 10

Sends a GET request to /sapi/v1/capital/deposit/address

Arguments:

  • coin: Coin name
  • network
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn account_status<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<AccountStatusResponse>, Error<Error>>

Account Status (USER_DATA)

Fetch account status detail.

Weight(IP): 1

Sends a GET request to /sapi/v1/account/status

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn account_api_trading_status<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<AccountApiTradingStatusResponse>, Error<Error>>

Account API Trading Status (USER_DATA)

Fetch account API trading status with details.

Weight(IP): 1

Sends a GET request to /sapi/v1/account/apiTradingStatus

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn asset_dribblet<'a>( &'a self, end_time: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<AssetDribbletResponse>, Error<Error>>

DustLog(USER_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/asset/dribblet

Arguments:

  • end_time: UTC timestamp in ms
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn asset_dust_btc<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<AssetDustBtcResponse>, Error<Error>>

Get Assets That Can Be Converted Into BNB (USER_DATA)

Weight(IP): 1

Sends a POST request to /sapi/v1/asset/dust-btc

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn asset_asset_dividend<'a>( &'a self, asset: Option<&'a str>, end_time: Option<i64>, limit: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<AssetAssetDividendResponse>, Error<Error>>

Asset Dividend Record (USER_DATA)

Query asset Dividend Record

Weight(IP): 10

Sends a GET request to /sapi/v1/asset/assetDividend

Arguments:

  • asset
  • end_time: UTC timestamp in ms
  • limit
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn asset_asset_detail<'a>( &'a self, asset: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<AssetAssetDetailResponse>, Error<Error>>

Asset Detail (USER_DATA)

Fetch details of assets supported on Binance.

  • Please get network and other deposit or withdraw details from GET /sapi/v1/capital/config/getall.

Weight(IP): 1

Sends a GET request to /sapi/v1/asset/assetDetail

Arguments:

  • asset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn asset_trade_fee<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, symbol: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<Vec<AssetTradeFeeResponseItem>>, Error<Error>>

Trade Fee (USER_DATA)

Fetch trade fee

Weight(IP): 1

Sends a GET request to /sapi/v1/asset/tradeFee

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn asset_transfer<'a>( &'a self, current: Option<i32>, end_time: Option<i64>, from_symbol: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, to_symbol: Option<&'a str>, type_: AssetTransferType, ) -> Result<ResponseValue<AssetTransferResponse>, Error<Error>>

Query User Universal Transfer History (USER_DATA)

  • fromSymbol must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
  • toSymbol must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
  • Support query within the last 6 months only
  • If startTime and endTime not sent, return records of the last 7 days by default

Weight(IP): 1

Sends a GET request to /sapi/v1/asset/transfer

Arguments:

  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • from_symbol: Must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • to_symbol: Must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
  • type_: Universal transfer type
Source

pub async fn post_user_universal_transfer<'a>( &'a self, amount: f64, asset: &'a str, from_symbol: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, to_symbol: Option<&'a str>, type_: PostUserUniversalTransferType, ) -> Result<ResponseValue<PostUserUniversalTransferResponse>, Error<Error>>

User Universal Transfer (USER_DATA)

You need to enable Permits Universal Transfer option for the api key which requests this endpoint.

  • fromSymbol must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
  • toSymbol must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN

ENUM of transfer types:

  • MAIN_UMFUTURE Spot account transfer to USDⓈ-M Futures account
  • MAIN_CMFUTURE Spot account transfer to COIN-M Futures account
  • MAIN_MARGIN Spot account transfer to Margin(cross)account
  • UMFUTURE_MAIN USDⓈ-M Futures account transfer to Spot account
  • UMFUTURE_MARGIN USDⓈ-M Futures account transfer to Margin(cross)account
  • CMFUTURE_MAIN COIN-M Futures account transfer to Spot account
  • CMFUTURE_MARGIN COIN-M Futures account transfer to Margin(cross) account
  • MARGIN_MAIN Margin(cross)account transfer to Spot account
  • MARGIN_UMFUTURE Margin(cross)account transfer to USDⓈ-M Futures
  • MARGIN_CMFUTURE Margin(cross)account transfer to COIN-M Futures
  • ISOLATEDMARGIN_MARGIN Isolated margin account transfer to Margin(cross) account
  • MARGIN_ISOLATEDMARGIN Margin(cross) account transfer to Isolated margin account
  • ISOLATEDMARGIN_ISOLATEDMARGIN Isolated margin account transfer to Isolated margin account
  • MAIN_FUNDING Spot account transfer to Funding account
  • FUNDING_MAIN Funding account transfer to Spot account
  • FUNDING_UMFUTURE Funding account transfer to UMFUTURE account
  • UMFUTURE_FUNDING UMFUTURE account transfer to Funding account
  • MARGIN_FUNDING MARGIN account transfer to Funding account
  • FUNDING_MARGIN Funding account transfer to Margin account
  • FUNDING_CMFUTURE Funding account transfer to CMFUTURE account
  • CMFUTURE_FUNDING CMFUTURE account transfer to Funding account
  • MAIN_OPTION Spot account transfer to Options account
  • OPTION_MAIN Options account transfer to Spot account
  • UMFUTURE_OPTION USDⓈ-M Futures account transfer to Options account
  • OPTION_UMFUTURE Options account transfer to USDⓈ-M Futures account
  • MARGIN_OPTION Margin(cross)account transfer to Options account
  • OPTION_MARGIN Options account transfer to Margin(cross)account
  • FUNDING_OPTION Funding account transfer to Options account
  • OPTION_FUNDING Options account transfer to Funding account
  • MAIN_PORTFOLIO_MARGIN Spot account transfer to Portfolio Margin account
  • PORTFOLIO_MARGIN_MAIN Portfolio Margin account transfer to Spot account
  • MAIN_ISOLATED_MARGIN Spot account transfer to Isolated margin account
  • ISOLATED_MARGIN_MAIN Isolated margin account transfer to Spot account

Weight(IP): 1

Sends a POST request to /sapi/v1/asset/transfer

Arguments:

  • amount
  • asset
  • from_symbol: Must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • to_symbol: Must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
  • type_: Universal transfer type
Source

pub async fn asset_get_funding_asset<'a>( &'a self, asset: Option<&'a str>, need_btc_valuation: Option<AssetGetFundingAssetNeedBtcValuation>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<AssetGetFundingAssetResponseItem>>, Error<Error>>

Funding Wallet (USER_DATA)

  • Currently supports querying the following business assets:Binance Pay, Binance Card, Binance Gift Card, Stock Token

Weight(IP): 1

Sends a POST request to /sapi/v1/asset/get-funding-asset

Arguments:

  • asset
  • need_btc_valuation
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn asset_get_user_asset<'a>( &'a self, asset: Option<&'a str>, need_btc_valuation: Option<AssetGetUserAssetNeedBtcValuation>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<AssetGetUserAssetResponseItem>>, Error<Error>>

User Asset (USER_DATA)

Get user assets, just for positive data.

Weight(IP): 5

Sends a POST request to /sapi/v3/asset/getUserAsset

Arguments:

  • asset
  • need_btc_valuation
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn asset_convert_transfer<'a>( &'a self, amount: f64, asset: &'a str, client_tran_id: &'a str, recv_window: Option<i64>, signature: &'a str, target_asset: &'a str, timestamp: i64, ) -> Result<ResponseValue<AssetConvertTransferResponse>, Error<Error>>

Convert Transfer (USER_DATA)

Convert transfer, convert between BUSD and stablecoins. If the clientId has been used before, will not do the convert transfer, the original transfer will be returned.

Weight(UID): 5

Sends a POST request to /sapi/v1/asset/convert-transfer

Arguments:

  • amount
  • asset
  • client_tran_id: The unique flag, the min length is 20
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • target_asset: Target asset you want to convert
  • timestamp: UTC timestamp in ms
Source

pub async fn asset_convert_transfer_query_by_page<'a>( &'a self, account_type: Option<AssetConvertTransferQueryByPageAccountType>, asset: Option<&'a str>, current: Option<i32>, end_time: i64, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: i64, timestamp: i64, tran_id: Option<i64>, ) -> Result<ResponseValue<AssetConvertTransferQueryByPageResponse>, Error<Error>>

Query Convert Transfer (USER_DATA)

Weight(UID): 5

Sends a GET request to /sapi/v1/asset/convert-transfer/queryByPage

Arguments:

  • account_type: MAIN: main account. CARD: funding account. If it is blank, we will query spot and card wallet, otherwise, we just query the corresponding wallet
  • asset: If it is blank, we will match deducted asset and target asset.
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • tran_id: The transaction id
Source

pub async fn asset_ledger_transfer_cloud_mining_query_by_page<'a>( &'a self, asset: Option<&'a str>, client_tran_id: Option<&'a str>, current: Option<i32>, end_time: i64, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: i64, timestamp: i64, tran_id: Option<i64>, ) -> Result<ResponseValue<AssetLedgerTransferCloudMiningQueryByPageResponse>, Error<Error>>

Get Cloud-Mining payment and refund history (USER_DATA)

The query of Cloud-Mining payment and refund history

Weight(UID): 600

Sends a GET request to /sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage

Arguments:

  • asset: If it is blank, we will query all assets
  • client_tran_id: The unique flag
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • tran_id: The transaction id
Source

pub async fn account_api_restrictions<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<AccountApiRestrictionsResponse>, Error<Error>>

Get API Key Permission (USER_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/account/apiRestrictions

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn capital_contract_convertible_coins<'a>( &'a self, ) -> Result<ResponseValue<CapitalContractConvertibleCoinsResponse>, Error<Error>>

Query auto-converting stable coins (USER_DATA)

Get a user’s auto-conversion settings in deposit/withdrawal

Weight(UID): 600’

Sends a GET request to /sapi/v1/capital/contract/convertible-coins

Source

pub async fn toggle_stable_coin_conversion<'a>( &'a self, coin: &'a str, enable: bool, ) -> Result<ResponseValue<Map<String, Value>>, Error<Error>>

Switch on/off BUSD and stable coins conversion (USER_DATA) (USER_DATA)

User can use it to turn on or turn off the BUSD auto-conversion from/to a specific stable coin.

Weight(UID): 600’

Sends a POST request to /sapi/v1/capital/contract/convertible-coins

Arguments:

  • coin: Must be USDC, USDP or TUSD
  • enable: true: turn on the auto-conversion. false: turn off the auto-conversion
Source

pub async fn sub_account_virtual_sub_account<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, sub_account_string: &'a str, timestamp: i64, ) -> Result<ResponseValue<SubAccountVirtualSubAccountResponse>, Error<Error>>

Create a Virtual Sub-account(For Master Account)

  • This request will generate a virtual sub account under your master account.
  • You need to enable “trade” option for the api key which requests this endpoint.

Weight(IP): 1

Sends a POST request to /sapi/v1/sub-account/virtualSubAccount

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • sub_account_string: Please input a string. We will create a virtual email using that string for you to register
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_list<'a>( &'a self, email: Option<&'a str>, is_freeze: Option<SubAccountListIsFreeze>, limit: Option<i32>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SubAccountListResponse>, Error<Error>>

Query Sub-account List (For Master Account)

Weight(IP): 1

Sends a GET request to /sapi/v1/sub-account/list

Arguments:

  • email: Sub-account email
  • is_freeze
  • limit: Default 1; max 200
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_sub_transfer_history<'a>( &'a self, end_time: Option<i64>, from_email: Option<&'a str>, limit: Option<i32>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, to_email: Option<&'a str>, ) -> Result<ResponseValue<Vec<SubAccountSubTransferHistoryResponseItem>>, Error<Error>>

Sub-account Spot Asset Transfer History (For Master Account)

  • fromEmail and toEmail cannot be sent at the same time.
  • Return fromEmail equal master account email by default.

Weight(IP): 1

Sends a GET request to /sapi/v1/sub-account/sub/transfer/history

Arguments:

  • end_time: UTC timestamp in ms
  • from_email: Sub-account email
  • limit: Default 1
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • to_email: Sub-account email
Source

pub async fn sub_account_futures_internal_transfer<'a>( &'a self, email: &'a str, end_time: Option<i64>, futures_type: i32, limit: Option<i32>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<SubAccountFuturesInternalTransferResponse>, Error<Error>>

Sub-account Futures Asset Transfer History (For Master Account)

Weight(IP): 1

Sends a GET request to /sapi/v1/sub-account/futures/internalTransfer

Arguments:

  • email: Sub-account email
  • end_time: UTC timestamp in ms
  • futures_type: 1:USDT-margined Futures, 2: Coin-margined Futures
  • limit: Default value: 50, Max value: 500
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn post_sub_account_future_asset_transfer<'a>( &'a self, amount: f64, asset: &'a str, from_email: &'a str, futures_type: i32, recv_window: Option<i64>, signature: &'a str, timestamp: i64, to_email: &'a str, ) -> Result<ResponseValue<PostSubAccountFutureAssetTransferResponse>, Error<Error>>

Sub-account Futures Asset Transfer (For Master Account)

  • Master account can transfer max 2000 times a minute

Weight(IP): 1

Sends a POST request to /sapi/v1/sub-account/futures/internalTransfer

Arguments:

  • amount
  • asset
  • from_email: Sender email
  • futures_type: 1:USDT-margined Futures,2: Coin-margined Futures
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • to_email: Recipient email
Source

pub async fn set_sub_account_assets<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SetSubAccountAssetsResponse>, Error<Error>>

Sub-account Assets (For Master Account)

Fetch sub-account assets

Weight(IP): 1

Sends a GET request to /sapi/v3/sub-account/assets

Arguments:

  • email: Sub-account email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_spot_summary<'a>( &'a self, email: Option<&'a str>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, timestamp: i64, ) -> Result<ResponseValue<SubAccountSpotSummaryResponse>, Error<Error>>

Sub-account Spot Assets Summary (For Master Account)

Get BTC valued asset summary of subaccounts.

Weight(IP): 1

Sends a GET request to /sapi/v1/sub-account/spotSummary

Arguments:

  • email: Sub-account email
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:20
  • timestamp: UTC timestamp in ms
Source

pub async fn capital_deposit_sub_address<'a>( &'a self, coin: &'a str, email: &'a str, network: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<CapitalDepositSubAddressResponse>, Error<Error>>

Sub-account Spot Assets Summary (For Master Account)

Fetch sub-account deposit address

Weight(IP): 1

Sends a GET request to /sapi/v1/capital/deposit/subAddress

Arguments:

  • coin: Coin name
  • email: Sub-account email
  • network
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn capital_deposit_sub_hisrec<'a>( &'a self, coin: Option<&'a str>, email: &'a str, end_time: Option<i64>, limit: Option<i64>, offset: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, status: Option<i32>, timestamp: i64, ) -> Result<ResponseValue<Vec<CapitalDepositSubHisrecResponseItem>>, Error<Error>>

Sub-account Deposit History (For Master Account)

Fetch sub-account deposit history

Weight(IP): 1

Sends a GET request to /sapi/v1/capital/deposit/subHisrec

Arguments:

  • coin: Coin name
  • email: Sub-account email
  • end_time: UTC timestamp in ms
  • limit
  • offset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • status: 0(0:pending,6: credited but cannot withdraw, 1:success)
  • timestamp: UTC timestamp in ms
Source

pub async fn capital_deposit_credit_apply<'a>( &'a self, deposit_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, sub_account_id: Option<i64>, sub_user_id: Option<i64>, timestamp: i64, tx_id: Option<&'a str>, ) -> Result<ResponseValue<CapitalDepositCreditApplyResponse>, Error<Error>>

One click arrival deposit apply (USER_DATA)

Apply deposit credit for expired address (One click arrival)

Weight(IP): 1

Sends a POST request to /sapi/v1/capital/deposit/credit-apply

Arguments:

  • deposit_id: Deposit record Id, priority use
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • sub_account_id
  • sub_user_id
  • timestamp: UTC timestamp in ms
  • tx_id: Deposit txId, used when depositId is not specified
Source

pub async fn asset_wallet_balance<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<AssetWalletBalanceResponseItem>>, Error<Error>>

Query User Wallet Balance (USER_DATA)

Query User Wallet Balance

Weight(IP): 60

Sends a GET request to /sapi/v1/asset/wallet/balance

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn asset_custody_transfer_history<'a>( &'a self, asset: &'a str, current: Option<i32>, email: &'a str, end_time: i64, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: i64, timestamp: i64, type_: Option<&'a str>, ) -> Result<ResponseValue<AssetCustodyTransferHistoryResponse>, Error<Error>>

Query User Delegation History(For Master Account) (USER_DATA)

Query User Delegation History

Weight(IP): 60

Sends a GET request to /sapi/v1/asset/custody/transfer-history

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • email
  • end_time
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time
  • timestamp: UTC timestamp in ms
  • type_
Source

pub async fn capital_deposit_address_list<'a>( &'a self, coin: &'a str, network: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<CapitalDepositAddressListResponseItem>>, Error<Error>>

Fetch deposit address list with network (USER_DATA)

Fetch deposit address list with network.

Weight(IP): 10

Sends a GET request to /sapi/v1/capital/deposit/address/list

Arguments:

  • coin
  • network
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_status<'a>( &'a self, email: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<SubAccountStatusResponseItem>>, Error<Error>>

Sub-account’s Status on Margin/Futures (For Master Account)

  • If no email sent, all sub-accounts’ information will be returned.

Weight(IP): 10

Sends a GET request to /sapi/v1/sub-account/status

Arguments:

  • email: Sub-account email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_margin_enable<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SubAccountMarginEnableResponse>, Error<Error>>

Enable Margin for Sub-account (For Master Account)

Weight(IP): 1

Sends a POST request to /sapi/v1/sub-account/margin/enable

Arguments:

  • email: Sub-account email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_margin_account<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SubAccountMarginAccountResponse>, Error<Error>>

Detail on Sub-account’s Margin Account (For Master Account)

Weight(IP): 10

Sends a GET request to /sapi/v1/sub-account/margin/account

Arguments:

  • email: Sub-account email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_margin_account_summary<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SubAccountMarginAccountSummaryResponse>, Error<Error>>

Summary of Sub-account’s Margin Account (For Master Account)

Weight(IP): 10

Sends a GET request to /sapi/v1/sub-account/margin/accountSummary

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_futures_enable<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SubAccountFuturesEnableResponse>, Error<Error>>

Enable Futures for Sub-account (For Master Account)

Weight(IP): 1

Sends a POST request to /sapi/v1/sub-account/futures/enable

Arguments:

  • email: Sub-account email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn query_sub_account_futures_account_v1<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<QuerySubAccountFuturesAccountV1Response>, Error<Error>>

Detail on Sub-account’s Futures Account (For Master Account)

Weight(IP): 10

Sends a GET request to /sapi/v1/sub-account/futures/account

Arguments:

  • email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_futures_account_summary<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SubAccountFuturesAccountSummaryResponse>, Error<Error>>

Summary of Sub-account’s Futures Account (For Master Account)

Weight(IP): 1

Sends a GET request to /sapi/v1/sub-account/futures/accountSummary

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_futures_position_risk<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<SubAccountFuturesPositionRiskResponseItem>>, Error<Error>>

Futures Position-Risk of Sub-account (For Master Account)

Weight(IP): 10

Sends a GET request to /sapi/v1/sub-account/futures/positionRisk

Arguments:

  • email: Sub-account email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_futures_transfer<'a>( &'a self, amount: f64, asset: &'a str, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, type_: i64, ) -> Result<ResponseValue<SubAccountFuturesTransferResponse>, Error<Error>>

Transfer for Sub-account (For Master Account)

Weight(IP): 1

Sends a POST request to /sapi/v1/sub-account/futures/transfer

Arguments:

  • amount
  • asset
  • email: Sub-account email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • type_: * 1 - transfer from subaccount’s spot account to its USDT-margined futures account
  • 2 - transfer from subaccount’s USDT-margined futures account to its spot account
  • 3 - transfer from subaccount’s spot account to its COIN-margined futures account
  • 4 - transfer from subaccount’s COIN-margined futures account to its spot account
Source

pub async fn sub_account_margin_transfer<'a>( &'a self, amount: f64, asset: &'a str, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, type_: i64, ) -> Result<ResponseValue<SubAccountMarginTransferResponse>, Error<Error>>

Margin Transfer for Sub-account (For Master Account)

Weight(IP): 1

Sends a POST request to /sapi/v1/sub-account/margin/transfer

Arguments:

  • amount
  • asset
  • email: Sub-account email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • type_: * 1 - transfer from subaccount’s spot account to margin account
  • 2 - transfer from subaccount’s margin account to its spot account
Source

pub async fn sub_account_transfer_sub_to_sub<'a>( &'a self, amount: f64, asset: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, to_email: &'a str, ) -> Result<ResponseValue<SubAccountTransferSubToSubResponse>, Error<Error>>

Transfer to Sub-account of Same Master (For Sub-account)

Weight(IP): 1

Sends a POST request to /sapi/v1/sub-account/transfer/subToSub

Arguments:

  • amount
  • asset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • to_email: Recipient email
Source

pub async fn sub_account_transfer_sub_to_master<'a>( &'a self, amount: f64, asset: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SubAccountTransferSubToMasterResponse>, Error<Error>>

Transfer to Master (For Sub-account)

Weight(IP): 1

Sends a POST request to /sapi/v1/sub-account/transfer/subToMaster

Arguments:

  • amount
  • asset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_transfer_sub_user_history<'a>( &'a self, asset: Option<&'a str>, end_time: Option<i64>, limit: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, type_: Option<i32>, ) -> Result<ResponseValue<Vec<SubAccountTransferSubUserHistoryResponseItem>>, Error<Error>>

Sub-account Transfer History (For Sub-account)

  • If type is not sent, the records of type 2: transfer out will be returned by default.
  • If startTime and endTime are not sent, the recent 30-day data will be returned.

Weight(IP): 1

Sends a GET request to /sapi/v1/sub-account/transfer/subUserHistory

Arguments:

  • asset
  • end_time: UTC timestamp in ms
  • limit: Default 500; max 1000.
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • type_: * 1 - transfer in
  • 2 - transfer out
Source

pub async fn sub_account_universal_transfer<'a>( &'a self, client_tran_id: Option<&'a str>, end_time: Option<i64>, from_email: Option<&'a str>, limit: Option<i32>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, to_email: Option<&'a str>, ) -> Result<ResponseValue<Vec<SubAccountUniversalTransferResponseItem>>, Error<Error>>

Universal Transfer History (For Master Account)

  • fromEmail and toEmail cannot be sent at the same time.
  • Return fromEmail equal master account email by default.
  • The query time period must be less then 30 days.
  • If startTime and endTime not sent, return records of the last 30 days by default.

Weight(IP): 1

Sends a GET request to /sapi/v1/sub-account/universalTransfer

Arguments:

  • client_tran_id
  • end_time: UTC timestamp in ms
  • from_email: Sub-account email
  • limit: Default 500, Max 500
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • to_email: Sub-account email
Source

pub async fn universal_transfer_master_account<'a>( &'a self, amount: f64, asset: &'a str, client_tran_id: Option<&'a str>, from_account_type: UniversalTransferMasterAccountFromAccountType, from_email: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, symbol: Option<&'a str>, timestamp: i64, to_account_type: UniversalTransferMasterAccountToAccountType, to_email: Option<&'a str>, ) -> Result<ResponseValue<UniversalTransferMasterAccountResponse>, Error<Error>>

Universal Transfer (For Master Account)

  • You need to enable “internal transfer” option for the api key which requests this endpoint.
  • Transfer from master account by default if fromEmail is not sent.
  • Transfer to master account by default if toEmail is not sent.
  • Supported transfer scenarios:
    • Master account SPOT transfer to sub-account SPOT,USDT_FUTURE,COIN_FUTURE,MARGIN(Cross),ISOLATED_MARGIN
    • Sub-account SPOT,USDT_FUTURE,COIN_FUTURE,MARGIN(Cross),ISOLATED_MARGIN transfer to master account SPOT
    • Transfer between two sub-account SPOT accounts

Weight(IP): 1

Sends a POST request to /sapi/v1/sub-account/universalTransfer

Arguments:

  • amount
  • asset
  • client_tran_id
  • from_account_type
  • from_email: Sub-account email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • symbol: Only supported under ISOLATED_MARGIN type
  • timestamp: UTC timestamp in ms
  • to_account_type
  • to_email: Sub-account email
Source

pub async fn query_sub_account_futures_account_v2<'a>( &'a self, email: &'a str, futures_type: i32, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<QuerySubAccountFuturesAccountV2Response>, Error<Error>>

Detail on Sub-account’s Futures Account V2 (For Master Account)

Weight(IP): 1

Sends a GET request to /sapi/v2/sub-account/futures/account

Arguments:

  • email: Sub-account email
  • futures_type: * 1 - USDT Margined Futures
  • 2 - COIN Margined Futures
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn query_sub_account_futures_account_summary<'a>( &'a self, futures_type: i32, limit: Option<i32>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<QuerySubAccountFuturesAccountSummaryResponse>, Error<Error>>

Summary of Sub-account’s Futures Account V2 (For Master Account)

Weight(IP): 10

Sends a GET request to /sapi/v2/sub-account/futures/accountSummary

Arguments:

  • futures_type: * 1 - USDT Margined Futures
  • 2 - COIN Margined Futures
  • limit: Default 10, Max 20
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn query_sub_account_futures_position_risk<'a>( &'a self, email: &'a str, futures_type: i32, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<QuerySubAccountFuturesPositionRiskResponse>, Error<Error>>

Futures Position-Risk of Sub-account V2 (For Master Account)

Weight(IP): 1

Sends a GET request to /sapi/v2/sub-account/futures/positionRisk

Arguments:

  • email: Sub-account email
  • futures_type: * 1 - USDT Margined Futures
  • 2 - COIN Margined Futures
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_blvt_enable<'a>( &'a self, email: &'a str, enable_blvt: bool, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SubAccountBlvtEnableResponse>, Error<Error>>

Enable Leverage Token for Sub-account (For Master Account)

Weight(IP): 1

Sends a POST request to /sapi/v1/sub-account/blvt/enable

Arguments:

  • email: Sub-account email
  • enable_blvt: Only true for now
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn managed_subaccount_deposit<'a>( &'a self, amount: f64, asset: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, to_email: &'a str, ) -> Result<ResponseValue<ManagedSubaccountDepositResponse>, Error<Error>>

Deposit assets into the managed sub-account(For Investor Master Account)

Weight(IP): 1

Sends a POST request to /sapi/v1/managed-subaccount/deposit

Arguments:

  • amount
  • asset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • to_email: Recipient email
Source

pub async fn managed_subaccount_asset<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<ManagedSubaccountAssetResponseItem>>, Error<Error>>

Managed sub-account asset details(For Investor Master Account)

Weight(IP): 1

Sends a GET request to /sapi/v1/managed-subaccount/asset

Arguments:

  • email: Sub-account email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn managed_subaccount_withdraw<'a>( &'a self, amount: f64, asset: &'a str, from_email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, transfer_date: Option<i64>, ) -> Result<ResponseValue<ManagedSubaccountWithdrawResponse>, Error<Error>>

Withdrawl assets from the managed sub-account(For Investor Master Account)

Weight(IP): 1

Sends a POST request to /sapi/v1/managed-subaccount/withdraw

Arguments:

  • amount
  • asset
  • from_email: Sender email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • transfer_date: Withdrawals is automatically occur on the transfer date(UTC0). If a date is not selected, the withdrawal occurs right now
Source

pub async fn managed_subaccount_account_snapshot<'a>( &'a self, email: &'a str, end_time: Option<i64>, limit: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, type_: &'a str, ) -> Result<ResponseValue<ManagedSubaccountAccountSnapshotResponse>, Error<Error>>

Managed sub-account snapshot (For Investor Master Account)

  • The query time period must be less then 30 days
  • Support query within the last one month only
  • If startTime and endTime not sent, return records of the last 7 days by default

Weight(IP): 2400

Sends a GET request to /sapi/v1/managed-subaccount/accountSnapshot

Arguments:

  • email: Sub-account email
  • end_time: UTC timestamp in ms
  • limit: min 7, max 30, default 7
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • type_: “SPOT”, “MARGIN”(cross), “FUTURES”(UM)
Source

pub async fn managed_subaccount_query_trans_log_for_investor<'a>( &'a self, email: &'a str, end_time: Option<i64>, limit: Option<i32>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, transfer_function_account_type: Option<&'a str>, transfers: Option<&'a str>, ) -> Result<ResponseValue<ManagedSubaccountQueryTransLogForInvestorResponse>, Error<Error>>

Query Managed Sub Account Transfer Log (For Investor Master Account)

Investor can use this api to query managed sub account transfer log. This endpoint is available for investor of Managed Sub-Account. A Managed Sub-Account is an account type for investors who value flexibility in asset allocation and account application, while delegating trades to a professional trading team.

Weight(IP): 1

Sends a GET request to /sapi/v1/managed-subaccount/queryTransLogForInvestor

Arguments:

  • email
  • end_time: UTC timestamp in ms
  • limit: Default 500; max 1000.
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • transfer_function_account_type: Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)
  • transfers: Transfer Direction (FROM/TO)
Source

pub async fn managed_subaccount_query_trans_log_for_trade_parent<'a>( &'a self, email: &'a str, end_time: Option<i64>, limit: Option<i32>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, transfer_function_account_type: Option<&'a str>, transfers: Option<&'a str>, ) -> Result<ResponseValue<ManagedSubaccountQueryTransLogForTradeParentResponse>, Error<Error>>

Query Managed Sub Account Transfer Log (For Trading Team Master Account)

Trading team can use this api to query managed sub account transfer log. This endpoint is available for trading team of Managed Sub-Account. A Managed Sub-Account is an account type for investors who value flexibility in asset allocation and account application, while delegating trades to a professional trading team

Weight(IP): 60

Sends a GET request to /sapi/v1/managed-subaccount/queryTransLogForTradeParent

Arguments:

  • email
  • end_time: UTC timestamp in ms
  • limit: Default 500; max 1000.
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • transfer_function_account_type: Transfer function account type (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)
  • transfers: Transfer Direction (FROM/TO)
Source

pub async fn managed_subaccount_fetch_future_asset<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<ManagedSubaccountFetchFutureAssetResponse>, Error<Error>>

Query Managed Sub-account Futures Asset Details (For Investor Master Account)

Investor can use this api to query managed sub account futures asset details

Sends a GET request to /sapi/v1/managed-subaccount/fetch-future-asset

Arguments:

  • email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn managed_subaccount_margin_asset<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<ManagedSubaccountMarginAssetResponse>, Error<Error>>

Query Managed Sub-account Margin Asset Details (For Investor Master Account)

Investor can use this api to query managed sub account margin asset details

Sends a GET request to /sapi/v1/managed-subaccount/marginAsset

Arguments:

  • email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn managed_subaccount_info<'a>( &'a self, email: &'a str, limit: Option<i32>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<ManagedSubaccountInfoResponse>, Error<Error>>

Query Managed Sub-account List (For Investor)

Get investor’s managed sub-account list.

Weight(UID): 60

Sends a GET request to /sapi/v1/managed-subaccount/info

Arguments:

  • email
  • limit: Default 500; max 1000.
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn managed_subaccount_deposit_address<'a>( &'a self, coin: &'a str, email: &'a str, network: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<ManagedSubaccountDepositAddressResponse>, Error<Error>>

Get Managed Sub-account Deposit Address (For Investor Master Account)

Get investor’s managed sub-account deposit address

Weight(UID): 1

Sends a GET request to /sapi/v1/managed-subaccount/deposit/address

Arguments:

  • coin: Coin name
  • email
  • network
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn managed_subaccount_query_trans_log<'a>( &'a self, end_time: Option<i64>, limit: Option<i32>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, transfer_function_account_type: ManagedSubaccountQueryTransLogTransferFunctionAccountType, transfers: ManagedSubaccountQueryTransLogTransfers, ) -> Result<ResponseValue<ManagedSubaccountQueryTransLogResponse>, Error<Error>>

Query Managed Sub Account Transfer Log (For Trading Team Sub Account)(USER_DATA)

Query Managed Sub Account Transfer Log (For Trading Team Sub Account)

Weight(UID): 60

Sends a GET request to /sapi/v1/managed-subaccount/query-trans-log

Arguments:

  • end_time: UTC timestamp in ms
  • limit: Default 500; max 1000.
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • transfer_function_account_type: Transfer function account type
  • transfers: Transfer Direction
Source

pub async fn query_sub_account_sub_account_api_ip_restriction<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, sub_account_api_key: &'a str, timestamp: i64, ) -> Result<ResponseValue<QuerySubAccountSubAccountApiIpRestrictionResponse>, Error<Error>>

Get IP Restriction for a Sub-account API Key (For Master Account)

Weight(UID): 3000

Sends a GET request to /sapi/v1/sub-account/subAccountApi/ipRestriction

Arguments:

  • email: Sub-account email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • sub_account_api_key
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_delete_ip_list<'a>( &'a self, email: &'a str, ip_address: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, sub_account_api_key: &'a str, third_party_name: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<SubAccountDeleteIpListResponse>, Error<Error>>

Delete IP List for a Sub-account API Key (For Master Account)

Weight(UID): 3000

Sends a DELETE request to /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList

Arguments:

  • email: Sub-account email
  • ip_address: Can be added in batches, separated by commas
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • sub_account_api_key
  • third_party_name: third party IP list name
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_transaction_statistics<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SubAccountTransactionStatisticsResponse>, Error<Error>>

Query Sub-account Transaction Statistics (For Master Account)

Query Sub-account Transaction statistics (For Master Account).

Weight(UID): 60

Sends a GET request to /sapi/v1/sub-account/transaction-statistics

Arguments:

  • email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn sub_account_eoptions_enable<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SubAccountEoptionsEnableResponse>, Error<Error>>

Enable Options for Sub-account (For Master Account)(USER_DATA)

Enable Options for Sub-account (For Master Account).

Weight(IP): 1

Sends a POST request to /sapi/v1/sub-account/eoptions/enable

Arguments:

  • email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn set_sub_account_sub_account_api_ip_restriction<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, status: &'a str, sub_account_api_key: &'a str, third_party_name: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<SetSubAccountSubAccountApiIpRestrictionResponse>, Error<Error>>

Update IP Restriction for Sub-Account API key (For Master Account)

Update IP Restriction for Sub-Account API key

Weight(UID): 3000

Sends a POST request to /sapi/v2/sub-account/subAccountApi/ipRestriction

Arguments:

  • email: Sub-account email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • status: IP Restriction status. 1 = IP Unrestricted. 2 = Restrict access to trusted IPs only. 3 = Restrict access to users’ trusted third party IPs only
  • sub_account_api_key
  • third_party_name: third party IP list name
  • timestamp: UTC timestamp in ms
Source

pub async fn query_sub_account_assets<'a>( &'a self, email: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<QuerySubAccountAssetsResponse>, Error<Error>>

Query Sub-account Assets (For Master Account)

Fetch sub-account assets

Weight(UID): 60

Sends a GET request to /sapi/v4/sub-account/assets

Arguments:

  • email
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn ping_keep_alive_listen_key<'a>( &'a self, listen_key: Option<&'a str>, ) -> Result<ResponseValue<Map<String, Value>>, Error<Error>>

Ping/Keep-alive a ListenKey (USER_STREAM)

Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It’s recommended to send a ping about every 30 minutes.

Weight: 2

Sends a PUT request to /api/v3/userDataStream

Arguments:

  • listen_key: User websocket listen key
Source

pub async fn create_user_data_stream<'a>( &'a self, ) -> Result<ResponseValue<CreateUserDataStreamResponse>, Error<()>>

Create a ListenKey (USER_STREAM)

Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.

Weight: 2

Sends a POST request to /api/v3/userDataStream

Source

pub async fn close_listen_key<'a>( &'a self, listen_key: Option<&'a str>, ) -> Result<ResponseValue<Map<String, Value>>, Error<Error>>

Close a ListenKey (USER_STREAM)

Close out a user data stream.

Weight: 2

Sends a DELETE request to /api/v3/userDataStream

Arguments:

  • listen_key: User websocket listen key
Source

pub async fn ping_keep_alive_user_stream<'a>( &'a self, listen_key: Option<&'a str>, ) -> Result<ResponseValue<Map<String, Value>>, Error<Error>>

Ping/Keep-alive a ListenKey (USER_STREAM)

Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It’s recommended to send a ping about every 30 minutes.

Weight: 1

Sends a PUT request to /sapi/v1/userDataStream

Arguments:

  • listen_key: User websocket listen key
Source

pub async fn create_listen_key_user_data_stream<'a>( &'a self, ) -> Result<ResponseValue<CreateListenKeyUserDataStreamResponse>, Error<()>>

Create a ListenKey (USER_STREAM)

Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.

Weight: 1

Sends a POST request to /sapi/v1/userDataStream

Source

pub async fn close_listen_key_user_stream<'a>( &'a self, listen_key: Option<&'a str>, ) -> Result<ResponseValue<Map<String, Value>>, Error<Error>>

Close a ListenKey (USER_STREAM)

Close out a user data stream.

Weight: 1

Sends a DELETE request to /sapi/v1/userDataStream

Arguments:

  • listen_key: User websocket listen key
Source

pub async fn ping_keep_alive_user_stream_again<'a>( &'a self, listen_key: Option<&'a str>, ) -> Result<ResponseValue<Map<String, Value>>, Error<Error>>

Ping/Keep-alive a Listen Key (USER_STREAM)

Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It’s recommended to send a ping about every 30 minutes.

Weight: 1

Sends a PUT request to /sapi/v1/userDataStream/isolated

Arguments:

  • listen_key: User websocket listen key
Source

pub async fn user_data_stream_isolated<'a>( &'a self, ) -> Result<ResponseValue<UserDataStreamIsolatedResponse>, Error<()>>

Generate a Listen Key (USER_STREAM)

Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.

Weight: 1

Sends a POST request to /sapi/v1/userDataStream/isolated

Source

pub async fn close_listen_key_us<'a>( &'a self, listen_key: Option<&'a str>, ) -> Result<ResponseValue<Map<String, Value>>, Error<Error>>

Close a ListenKey (USER_STREAM)

Close out a user data stream.

Weight: 1

Sends a DELETE request to /sapi/v1/userDataStream/isolated

Arguments:

  • listen_key: User websocket listen key
Source

pub async fn fiat_orders<'a>( &'a self, begin_time: Option<i64>, end_time: Option<i64>, page: Option<i32>, recv_window: Option<i64>, rows: Option<i32>, signature: &'a str, timestamp: i64, transaction_type: i64, ) -> Result<ResponseValue<FiatOrdersResponse>, Error<Error>>

Fiat Deposit/Withdraw History (USER_DATA)

  • If beginTime and endTime are not sent, the recent 30-day data will be returned.

Weight(UID): 90000

Sends a GET request to /sapi/v1/fiat/orders

Arguments:

  • begin_time
  • end_time: UTC timestamp in ms
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • rows: Default 100, max 500
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • transaction_type: * 0 - deposit
  • 1 - withdraw
Source

pub async fn fiat_payments<'a>( &'a self, begin_time: Option<i64>, end_time: Option<i64>, page: Option<i32>, recv_window: Option<i64>, rows: Option<i32>, signature: &'a str, timestamp: i64, transaction_type: i64, ) -> Result<ResponseValue<FiatPaymentsResponse>, Error<Error>>

Fiat Payments History (USER_DATA)

  • If beginTime and endTime are not sent, the recent 30-day data will be returned.

Weight(IP): 1

Sends a GET request to /sapi/v1/fiat/payments

Arguments:

  • begin_time
  • end_time: UTC timestamp in ms
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • rows: Default 100, max 500
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • transaction_type: * 0 - deposit
  • 1 - withdraw
Source

pub async fn lending_project_list<'a>( &'a self, asset: Option<&'a str>, current: Option<i32>, is_sort_asc: Option<bool>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, sort_by: Option<LendingProjectListSortBy>, status: Option<LendingProjectListStatus>, timestamp: i64, type_: LendingProjectListType, ) -> Result<ResponseValue<Vec<LendingProjectListResponseItem>>, Error<Error>>

Get Fixed/Activity Project List(USER_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/lending/project/list

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • is_sort_asc: default “true”
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • sort_by: Default START_TIME
  • status: Default ALL
  • timestamp: UTC timestamp in ms
  • type_
Source

pub async fn lending_customized_fixed_purchase<'a>( &'a self, lot: &'a str, project_id: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LendingCustomizedFixedPurchaseResponse>, Error<Error>>

Purchase Fixed/Activity Project (USER_DATA)

Weight(IP): 1

Sends a POST request to /sapi/v1/lending/customizedFixed/purchase

Arguments:

  • lot
  • project_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn lending_project_position_list<'a>( &'a self, asset: &'a str, project_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, status: Option<LendingProjectPositionListStatus>, timestamp: i64, ) -> Result<ResponseValue<Vec<LendingProjectPositionListResponseItem>>, Error<Error>>

Get Fixed/Activity Project Position (USER_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/lending/project/position/list

Arguments:

  • asset
  • project_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • status: Default ALL
  • timestamp: UTC timestamp in ms
Source

pub async fn lending_position_changed<'a>( &'a self, lot: &'a str, position_id: Option<&'a str>, project_id: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LendingPositionChangedResponse>, Error<Error>>

Change Fixed/Activity Position to Daily Position (USER_DATA)

  • PositionId is mandatory parameter for fixed position.

Weight(IP): 1

Sends a POST request to /sapi/v1/lending/positionChanged

Arguments:

  • lot
  • position_id
  • project_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn staking_product_list<'a>( &'a self, asset: Option<&'a str>, current: Option<i32>, product: &'a str, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, timestamp: i64, ) -> Result<ResponseValue<Vec<StakingProductListResponseItem>>, Error<Error>>

Get Staking Product List (USER_DATA)

Get available Staking product list.

Weight(IP): 1

Sends a GET request to /sapi/v1/staking/productList

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • product: * STAKING - for Locked Staking
  • F_DEFI - for flexible DeFi Staking
  • L_DEFI - for locked DeFi Staking
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • timestamp: UTC timestamp in ms
Source

pub async fn staking_purchase<'a>( &'a self, amount: f64, product: &'a str, product_id: &'a str, recv_window: Option<i64>, renewable: Option<&'a str>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<StakingPurchaseResponse>, Error<Error>>

Purchase Staking Product (USER_DATA)

Weight(IP): 1

Sends a POST request to /sapi/v1/staking/purchase

Arguments:

  • amount
  • product: * STAKING - for Locked Staking
  • F_DEFI - for flexible DeFi Staking
  • L_DEFI - for locked DeFi Staking
  • product_id
  • recv_window: The value cannot be greater than 60000
  • renewable: true or false, default false. Active if product is STAKING or L_DEFI
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn staking_redeem<'a>( &'a self, amount: Option<f64>, position_id: Option<&'a str>, product: &'a str, product_id: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<StakingRedeemResponse>, Error<Error>>

Redeem Staking Product (USER_DATA)

Redeem Staking product. Locked staking and Locked DeFI staking belong to early redemption, redeeming in advance will result in loss of interest that you have earned.

Weight(IP): 1

Sends a POST request to /sapi/v1/staking/redeem

Arguments:

  • amount: Mandatory if product is F_DEFI
  • position_id: Mandatory if product is STAKING or L_DEFI
  • product: * STAKING - for Locked Staking
  • F_DEFI - for flexible DeFi Staking
  • L_DEFI - for locked DeFi Staking
  • product_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn staking_position<'a>( &'a self, asset: Option<&'a str>, current: Option<i32>, product: &'a str, product_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, timestamp: i64, ) -> Result<ResponseValue<Vec<StakingPositionResponseItem>>, Error<Error>>

Get Staking Product Position (USER_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/staking/position

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • product: * STAKING - for Locked Staking
  • F_DEFI - for flexible DeFi Staking
  • L_DEFI - for locked DeFi Staking
  • product_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • timestamp: UTC timestamp in ms
Source

pub async fn staking_staking_record<'a>( &'a self, asset: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, product: &'a str, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, txn_type: &'a str, ) -> Result<ResponseValue<Vec<StakingStakingRecordResponseItem>>, Error<Error>>

Get Staking History (USER_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/staking/stakingRecord

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • product: * STAKING - for Locked Staking
  • F_DEFI - for flexible DeFi Staking
  • L_DEFI - for locked DeFi Staking
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • txn_type: SUBSCRIPTION, REDEMPTION, INTEREST
Source

pub async fn staking_set_auto_staking<'a>( &'a self, position_id: &'a str, product: &'a str, recv_window: Option<i64>, renewable: &'a str, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<StakingSetAutoStakingResponse>, Error<Error>>

Set Auto Staking (USER_DATA)

Set auto staking on Locked Staking or Locked DeFi Staking

Weight(IP): 1

Sends a POST request to /sapi/v1/staking/setAutoStaking

Arguments:

  • position_id
  • product: * STAKING - for Locked Staking
  • L_DEFI - for locked DeFi Staking
  • recv_window: The value cannot be greater than 60000
  • renewable: true or false
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn staking_personal_left_quota<'a>( &'a self, product: &'a str, product_id: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<StakingPersonalLeftQuotaResponseItem>>, Error<Error>>

Get Personal Left Quota of Staking Product (USER_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/staking/personalLeftQuota

Arguments:

  • product: * STAKING - for Locked Staking
  • F_DEFI - for flexible DeFi Staking
  • L_DEFI - for locked DeFi Staking
  • product_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn mining_pub_algo_list<'a>( &'a self, ) -> Result<ResponseValue<MiningPubAlgoListResponse>, Error<Error>>

Acquiring Algorithm (MARKET_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/mining/pub/algoList

Source

pub async fn mining_pub_coin_list<'a>( &'a self, ) -> Result<ResponseValue<MiningPubCoinListResponse>, Error<Error>>

Acquiring CoinName (MARKET_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/mining/pub/coinList

Source

pub async fn mining_worker_detail<'a>( &'a self, algo: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, user_name: &'a str, worker_name: &'a str, ) -> Result<ResponseValue<MiningWorkerDetailResponse>, Error<Error>>

Request for Detail Miner List (USER_DATA)

Weight(IP): 5

Sends a GET request to /sapi/v1/mining/worker/detail

Arguments:

  • algo: Algorithm(sha256)
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • user_name: Mining Account
  • worker_name: Miner’s name
Source

pub async fn mining_worker_list<'a>( &'a self, algo: &'a str, page_index: Option<i32>, recv_window: Option<i64>, signature: &'a str, sort: Option<i32>, sort_column: Option<i32>, timestamp: i64, user_name: &'a str, worker_status: Option<i32>, ) -> Result<ResponseValue<MiningWorkerListResponse>, Error<Error>>

Request for Miner List (USER_DATA)

Weight(IP): 5

Sends a GET request to /sapi/v1/mining/worker/list

Arguments:

  • algo: Algorithm(sha256)
  • page_index: Page number, default is first page, start form 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • sort: sort sequence(default=0)0 positive sequence, 1 negative sequence
  • sort_column: Sort by( default 1): 1: miner name, 2: real-time computing power, 3: daily average computing power, 4: real-time rejection rate, 5: last submission time
  • timestamp: UTC timestamp in ms
  • user_name: Mining Account
  • worker_status: miners status(default=0)0 all, 1 valid, 2 invalid, 3 failure
Source

pub async fn mining_payment_list<'a>( &'a self, algo: &'a str, coin: Option<&'a str>, end_date: Option<&'a str>, page_index: Option<i32>, page_size: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, start_date: Option<&'a str>, timestamp: i64, user_name: &'a str, ) -> Result<ResponseValue<MiningPaymentListResponse>, Error<Error>>

Earnings List (USER_DATA)

Weight(IP): 5

Sends a GET request to /sapi/v1/mining/payment/list

Arguments:

  • algo: Algorithm(sha256)
  • coin: Coin name
  • end_date: Search date, millisecond timestamp, while empty query all
  • page_index: Page number, default is first page, start form 1
  • page_size: Number of pages, minimum 10, maximum 200
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_date: Search date, millisecond timestamp, while empty query all
  • timestamp: UTC timestamp in ms
  • user_name: Mining Account
Source

pub async fn mining_payment_other<'a>( &'a self, algo: &'a str, coin: Option<&'a str>, end_date: Option<&'a str>, page_index: Option<i32>, page_size: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, start_date: Option<&'a str>, timestamp: i64, user_name: &'a str, ) -> Result<ResponseValue<MiningPaymentOtherResponse>, Error<Error>>

Extra Bonus List (USER_DATA)

Weight(IP): 5

Sends a GET request to /sapi/v1/mining/payment/other

Arguments:

  • algo: Algorithm(sha256)
  • coin: Coin name
  • end_date: Search date, millisecond timestamp, while empty query all
  • page_index: Page number, default is first page, start form 1
  • page_size: Number of pages, minimum 10, maximum 200
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_date: Search date, millisecond timestamp, while empty query all
  • timestamp: UTC timestamp in ms
  • user_name: Mining Account
Source

pub async fn mining_hash_transfer_config_details_list<'a>( &'a self, page_index: Option<i32>, page_size: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<MiningHashTransferConfigDetailsListResponse>, Error<Error>>

Hashrate Resale List (USER_DATA)

Weight(IP): 5

Sends a GET request to /sapi/v1/mining/hash-transfer/config/details/list

Arguments:

  • page_index: Page number, default is first page, start form 1
  • page_size: Number of pages, minimum 10, maximum 200
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn mining_hash_transfer_profit_details<'a>( &'a self, config_id: &'a str, page_index: Option<i32>, page_size: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, user_name: &'a str, ) -> Result<ResponseValue<MiningHashTransferProfitDetailsResponse>, Error<Error>>

Hashrate Resale Details (USER_DATA)

Weight(IP): 5

Sends a GET request to /sapi/v1/mining/hash-transfer/profit/details

Arguments:

  • config_id: Mining ID
  • page_index: Page number, default is first page, start form 1
  • page_size: Number of pages, minimum 10, maximum 200
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • user_name: Mining Account
Source

pub async fn mining_hash_transfer_config<'a>( &'a self, algo: &'a str, end_date: Option<&'a str>, hash_rate: &'a str, recv_window: Option<i64>, signature: &'a str, start_date: Option<&'a str>, timestamp: i64, to_pool_user: &'a str, user_name: &'a str, ) -> Result<ResponseValue<MiningHashTransferConfigResponse>, Error<Error>>

Hashrate Resale Request (USER_DATA)

Weight(IP): 5

Sends a POST request to /sapi/v1/mining/hash-transfer/config

Arguments:

  • algo: Algorithm(sha256)
  • end_date: Search date, millisecond timestamp, while empty query all
  • hash_rate: Resale hashrate h/s must be transferred (BTC is greater than 500000000000 ETH is greater than 500000)
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_date: Search date, millisecond timestamp, while empty query all
  • timestamp: UTC timestamp in ms
  • to_pool_user: Mining Account
  • user_name: Mining Account
Source

pub async fn mining_hash_transfer_config_cancel<'a>( &'a self, config_id: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, user_name: &'a str, ) -> Result<ResponseValue<MiningHashTransferConfigCancelResponse>, Error<Error>>

Cancel Hashrate Resale configuration (USER_DATA)

Weight(IP): 5

Sends a POST request to /sapi/v1/mining/hash-transfer/config/cancel

Arguments:

  • config_id: Mining ID
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • user_name: Mining Account
Source

pub async fn mining_statistics_user_status<'a>( &'a self, algo: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, user_name: &'a str, ) -> Result<ResponseValue<MiningStatisticsUserStatusResponse>, Error<Error>>

Statistic List (USER_DATA)

Weight(IP): 5

Sends a GET request to /sapi/v1/mining/statistics/user/status

Arguments:

  • algo: Algorithm(sha256)
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • user_name: Mining Account
Source

pub async fn mining_statistics_user_list<'a>( &'a self, algo: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, user_name: &'a str, ) -> Result<ResponseValue<MiningStatisticsUserListResponse>, Error<Error>>

Account List (USER_DATA)

Weight(IP): 5

Sends a GET request to /sapi/v1/mining/statistics/user/list

Arguments:

  • algo: Algorithm(sha256)
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • user_name: Mining Account
Source

pub async fn mining_payment_uid<'a>( &'a self, algo: &'a str, end_date: Option<&'a str>, page_index: Option<i32>, page_size: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, start_date: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<MiningPaymentUidResponse>, Error<Error>>

Mining Account Earning (USER_DATA)

Weight(IP): 5

Sends a GET request to /sapi/v1/mining/payment/uid

Arguments:

  • algo: Algorithm(sha256)
  • end_date: Search date, millisecond timestamp, while empty query all
  • page_index: Page number, default is first page, start form 1
  • page_size: Number of pages, minimum 10, maximum 200
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_date: Search date, millisecond timestamp, while empty query all
  • timestamp: UTC timestamp in ms
Source

pub async fn get_future_account_transaction_history<'a>( &'a self, asset: &'a str, current: Option<i32>, end_time: Option<i64>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: i64, timestamp: i64, ) -> Result<ResponseValue<GetFutureAccountTransactionHistoryResponse>, Error<Error>>

Get Future Account Transaction History List (USER_DATA)

Weight(IP): 10

Sends a GET request to /sapi/v1/futures/transfer

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn futures_transfer<'a>( &'a self, amount: f64, asset: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, type_: i64, ) -> Result<ResponseValue<FuturesTransferResponse>, Error<Error>>

New Future Account Transfer (USER_DATA)

Execute transfer between spot account and futures account.

Weight(IP): 1

Sends a POST request to /sapi/v1/futures/transfer

Arguments:

  • amount
  • asset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • type_: 1: transfer from spot account to USDT-Ⓜ futures account. 2: transfer from USDT-Ⓜ futures account to spot account. 3: transfer from spot account to COIN-Ⓜ futures account. 4: transfer from COIN-Ⓜ futures account to spot account.

Get Future TickLevel Orderbook Historical Data Download Link (USER_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/futures/histDataLink

Arguments:

  • data_type
  • end_time: UTC timestamp in ms
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • symbol
  • timestamp: UTC timestamp in ms
Source

pub async fn algo_futures_new_order_vp<'a>( &'a self, client_algo_id: Option<&'a str>, limit_price: Option<f64>, position_side: Option<AlgoFuturesNewOrderVpPositionSide>, quantity: f64, recv_window: Option<i64>, reduce_only: Option<bool>, side: AlgoFuturesNewOrderVpSide, signature: &'a str, symbol: &'a str, timestamp: i64, urgency: AlgoFuturesNewOrderVpUrgency, ) -> Result<ResponseValue<AlgoFuturesNewOrderVpResponse>, Error<Error>>

Volume Participation(VP) New Order (TRADE)

Send in a VP new order. Only support on USDⓈ-M Contracts.

  • You need to enable Futures Trading Permission for the api key which requests this endpoint.

  • Base URL: https://api.binance.com

  • Total Algo open orders max allowed: 10 orders.

  • Leverage of symbols and position mode will be the same as your futures account settings. You can set up through the trading page or fapi.

  • Receiving “success”: true does not mean that your order will be executed. Please use the query order endpoints(GET sapi/v1/algo/futures/openOrders or GET sapi/v1/algo/futures/historicalOrders) to check the order status. For example: Your futures balance is insufficient, or open position with reduce only or position side is inconsistent with your own setting. In these cases you will receive “success”: true, but the order status will be expired after we check it.

Weight(UID): 3000

Sends a POST request to /sapi/v1/algo/futures/newOrderVp

Arguments:

  • client_algo_id: A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
  • limit_price: Limit price of the order; If it is not sent, will place order by market price by default
  • position_side: Default BOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent in Hedge Mode.
  • quantity: Quantity of base asset; The notional (quantity * mark price(base asset)) must be more than the equivalent of 10,000 USDT and less than the equivalent of 1,000,000 USDT
  • recv_window: The value cannot be greater than 60000
  • reduce_only: ‘true’ or ‘false’. Default ‘false’; Cannot be sent in Hedge Mode; Cannot be sent when you open a position
  • side
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
  • urgency: Represent the relative speed of the current execution; ENUM: LOW, MEDIUM, HIGH
Source

pub async fn algo_futures_new_order_twap<'a>( &'a self, client_algo_id: Option<&'a str>, duration: i64, limit_price: Option<f64>, position_side: Option<AlgoFuturesNewOrderTwapPositionSide>, quantity: f64, recv_window: Option<i64>, reduce_only: Option<bool>, side: AlgoFuturesNewOrderTwapSide, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<AlgoFuturesNewOrderTwapResponse>, Error<Error>>

Time-Weighted Average Price(Twap) New Order (TRADE)

Send in a Twap new order. Only support on USDⓈ-M Contracts.

You need to enable Futures Trading Permission for the api key which requests this endpoint. Base URL: https://api.binance.com

  • Total Algo open orders max allowed: 10 orders.
  • Leverage of symbols and position mode will be the same as your futures account settings. You can set up through the trading page or fapi.
  • Receiving “success”: true does not mean that your order will be executed. Please use the query order endpoints(GET sapi/v1/algo/futures/openOrders or GET sapi/v1/algo/futures/historicalOrders) to check the order status. For example: Your futures balance is insufficient, or open position with reduce only or position side is inconsistent with your own setting. In these cases you will receive “success”: true, but the order status will be expired after we check it.
  • quantity * 60 / duration should be larger than minQty
  • duration cannot be less than 5 mins or more than 24 hours.
  • For delivery contracts, TWAP end time should be one hour earlier than the delivery time of the symbol.

Weight(UID): 3000

Sends a POST request to /sapi/v1/algo/futures/newOrderTwap

Arguments:

  • client_algo_id: A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
  • duration: Duration for TWAP orders in seconds. [300, 86400];Less than 5min => defaults to 5 min; Greater than 24h => defaults to 24h
  • limit_price: Limit price of the order; If it is not sent, will place order by market price by default
  • position_side: Default BOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent in Hedge Mode.
  • quantity: Quantity of base asset; The notional (quantity * mark price(base asset)) must be more than the equivalent of 10,000 USDT and less than the equivalent of 1,000,000 USDT
  • recv_window: The value cannot be greater than 60000
  • reduce_only: ‘true’ or ‘false’. Default ‘false’; Cannot be sent in Hedge Mode; Cannot be sent when you open a position
  • side
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn cancel_algo_futures_order<'a>( &'a self, algo_id: i64, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<CancelAlgoFuturesOrderResponse>, Error<Error>>

Cancel Algo Order(TRADE)

Cancel an active order.

  • You need to enable Futures Trading Permission for the api key which requests this endpoint.
  • Base URL: https://api.binance.com

Weight(IP): 1

Sends a DELETE request to /sapi/v1/algo/futures/order

Arguments:

  • algo_id: Eg. 14511
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn algo_futures_open_orders<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<AlgoFuturesOpenOrdersResponse>, Error<Error>>

Query Current Algo Open Orders (USER_DATA)

  • You need to enable Futures Trading Permission for the api key which requests this endpoint.
  • Base URL: https://api.binance.com

Weight(IP): 1

Sends a GET request to /sapi/v1/algo/futures/openOrders

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn algo_futures_historical_orders<'a>( &'a self, end_time: Option<i64>, page: Option<i32>, page_size: Option<&'a str>, recv_window: Option<i64>, side: Option<AlgoFuturesHistoricalOrdersSide>, signature: &'a str, start_time: Option<i64>, symbol: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<AlgoFuturesHistoricalOrdersResponse>, Error<Error>>

Query Historical Algo Orders (USER_DATA)

  • You need to enable Futures Trading Permission for the api key which requests this endpoint.
  • Base URL: https://api.binance.com

Weight(IP): 1

Sends a GET request to /sapi/v1/algo/futures/historicalOrders

Arguments:

  • end_time: UTC timestamp in ms
  • page: Default 1
  • page_size: Page size, minimum 1, maximum 100, default 100
  • recv_window: The value cannot be greater than 60000
  • side
  • signature: Signature
  • start_time: UTC timestamp in ms
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn algo_futures_sub_orders<'a>( &'a self, algo_id: i64, page: Option<i32>, page_size: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<AlgoFuturesSubOrdersResponse>, Error<Error>>

Query Sub Orders (USER_DATA)

  • You need to enable Futures Trading Permission for the api key which requests this endpoint.
  • Base URL: https://api.binance.com

Weight(IP): 1

Sends a GET request to /sapi/v1/algo/futures/subOrders

Arguments:

  • algo_id
  • page: Default 1
  • page_size: Page size, minimum 1, maximum 100, default 100
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn algo_spot_new_order_twap<'a>( &'a self, client_algo_id: Option<&'a str>, duration: i32, limit_price: Option<f32>, quantity: f64, recv_window: Option<i64>, side: AlgoSpotNewOrderTwapSide, signature: &'a str, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<AlgoSpotNewOrderTwapResponse>, Error<Error>>

Time-Weighted Average Price (Twap) New Order

Place a new spot TWAP order with Algo service.

Weight(UID): 3000

Sends a POST request to /sapi/v1/algo/spot/newOrderTwap

Arguments:

  • client_algo_id
  • duration
  • limit_price
  • quantity
  • recv_window: The value cannot be greater than 60000
  • side
  • signature: Signature
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn cancel_algo_spot_order<'a>( &'a self, algo_id: i64, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<CancelAlgoSpotOrderResponse>, Error<Error>>

Cancel Algo Order

Cancel an open TWAP order

Weight(IP): 1

Sends a DELETE request to /sapi/v1/algo/spot/order

Arguments:

  • algo_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn algo_spot_open_orders<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<AlgoSpotOpenOrdersResponse>, Error<Error>>

Query Current Algo Open Orders

Get all open SPOT TWAP orders

Weight(IP): 1

Sends a GET request to /sapi/v1/algo/spot/openOrders

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn algo_spot_historical_orders<'a>( &'a self, end_time: Option<i64>, page: Option<i32>, page_size: Option<&'a str>, recv_window: Option<i64>, side: AlgoSpotHistoricalOrdersSide, signature: &'a str, start_time: Option<i64>, symbol: &'a str, timestamp: i64, ) -> Result<ResponseValue<AlgoSpotHistoricalOrdersResponse>, Error<Error>>

Query Historical Algo Orders

Get all historical SPOT TWAP orders

Weight(IP): 1

Sends a GET request to /sapi/v1/algo/spot/historicalOrders

Arguments:

  • end_time: UTC timestamp in ms
  • page: Default 1
  • page_size: Number of pages, minimum 10, maximum 200
  • recv_window: The value cannot be greater than 60000
  • side
  • signature: Signature
  • start_time: UTC timestamp in ms
  • symbol: Trading symbol, e.g. BNBUSDT
  • timestamp: UTC timestamp in ms
Source

pub async fn algo_spot_sub_orders<'a>( &'a self, algo_id: i64, page: Option<i32>, page_size: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<AlgoSpotSubOrdersResponse>, Error<Error>>

Query Sub Orders

Get respective sub orders for a specified algoId

Weight(IP): 1

Sends a GET request to /sapi/v1/algo/spot/subOrders

Arguments:

  • algo_id
  • page: Default 1
  • page_size: Number of pages, minimum 10, maximum 200
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn portfolio_account<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<PortfolioAccountResponse>, Error<Error>>

Portfolio Margin Account (USER_DATA)

Get the account info

‘Weight(IP): 1’

Sends a GET request to /sapi/v1/portfolio/account

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn portfolio_collateral_rate<'a>( &'a self, ) -> Result<ResponseValue<Vec<PortfolioCollateralRateResponseItem>>, Error<Error>>

Portfolio Margin Collateral Rate (MARKET_DATA)

Portfolio Margin Collateral Rate.

Weight(IP): 50

Sends a GET request to /sapi/v1/portfolio/collateralRate

Source

pub async fn portfolio_pm_loan<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<PortfolioPmLoanResponse>, Error<Error>>

Portfolio Margin Bankruptcy Loan Amount (USER_DATA)

Query Portfolio Margin Bankruptcy Loan Amount.

Weight(UID): 500

Sends a GET request to /sapi/v1/portfolio/pmLoan

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn portfolio_repay<'a>( &'a self, from: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<PortfolioRepayResponse>, Error<Error>>

Portfolio Margin Bankruptcy Loan Repay (USER_DATA)

Repay Portfolio Margin Bankruptcy Loan.

Weight(UID): 3000

Sends a POST request to /sapi/v1/portfolio/repay

Arguments:

  • from
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn portfolio_interest_history<'a>( &'a self, asset: &'a str, end_time: Option<i64>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<Vec<PortfolioInterestHistoryResponseItem>>, Error<Error>>

Query Classic Portfolio Margin Negative Balance Interest History (USER_DATA)

Query interest history of negative balance for portfolio margin.

Weight(IP): 50

Sends a GET request to /sapi/v1/portfolio/interest-history

Arguments:

  • asset
  • end_time: UTC timestamp in ms
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn portfolio_asset_index_price<'a>( &'a self, asset: Option<&'a str>, ) -> Result<ResponseValue<Vec<PortfolioAssetIndexPriceResponseItem>>, Error<Error>>

Query Portfolio Margin Asset Index Price (MARKET_DATA)

Query Portfolio Margin Asset Index Price

Weight(IP):

  • 1 if send asset
  • 50 if not send asset

Sends a GET request to /sapi/v1/portfolio/asset-index-price

Source

pub async fn portfolio_auto_collection<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<PortfolioAutoCollectionResponse>, Error<Error>>

Fund Auto-collection (USER_DATA)

Transfers all assets from Futures Account to Margin account

Weight(IP): 1500

Sends a POST request to /sapi/v1/portfolio/auto-collection

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn portfolio_bnb_transfer<'a>( &'a self, amount: f64, recv_window: Option<i64>, signature: &'a str, timestamp: i64, transfer_side: PortfolioBnbTransferTransferSide, ) -> Result<ResponseValue<PortfolioBnbTransferResponse>, Error<Error>>

BNB Transfer (USER_DATA)

BNB transfer can be between Margin Account and USDM Account

Weight(IP): 1500

Sends a POST request to /sapi/v1/portfolio/bnb-transfer

Arguments:

  • amount
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • transfer_side
Source

pub async fn get_auto_repay_futures_status<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<GetAutoRepayFuturesStatusResponse>, Error<Error>>

Get Auto-repay-futures Status (USER_DATA)

Query Auto-repay-futures Status

Weight(IP): 30

Sends a GET request to /sapi/v1/portfolio/repay-futures-switch

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn portfolio_repay_futures_switch<'a>( &'a self, auto_repay: bool, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<PortfolioRepayFuturesSwitchResponse>, Error<Error>>

Change Auto-repay-futures Status (USER_DATA)

Change Auto-repay-futures Status

Weight(IP): 1500

Sends a POST request to /sapi/v1/portfolio/repay-futures-switch

Arguments:

  • auto_repay
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn portfolio_repay_futures_negative_balance<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<PortfolioRepayFuturesNegativeBalanceResponse>, Error<Error>>

Repay futures Negative Balance (USER_DATA)

Repay futures Negative Balance

Weight(IP): 1500

Sends a POST request to /sapi/v1/portfolio/repay-futures-negative-balance

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn portfolio_margin_asset_leverage<'a>( &'a self, ) -> Result<ResponseValue<Vec<PortfolioMarginAssetLeverageResponseItem>>, Error<Error>>

Get Portfolio Margin Asset Leverage (USER_DATA)

Weight(IP): 50

Sends a GET request to /sapi/v1/portfolio/margin-asset-leverage

Source

pub async fn portfolio_asset_collection<'a>( &'a self, asset: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<PortfolioAssetCollectionResponse>, Error<Error>>

Fund Collection by Asset (USER_DATA)

Transfers specific asset from Futures Account to Margin account

Weight(IP): 60

Sends a POST request to /sapi/v1/portfolio/asset-collection

Arguments:

  • asset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn blvt_token_info<'a>( &'a self, token_name: Option<&'a str>, ) -> Result<ResponseValue<Vec<BlvtTokenInfoResponseItem>>, Error<Error>>

BLVT Info (MARKET_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/blvt/tokenInfo

Arguments:

  • token_name: BTCDOWN, BTCUP
Source

pub async fn blvt_subscribe<'a>( &'a self, cost: f64, recv_window: Option<i64>, signature: &'a str, timestamp: i64, token_name: &'a str, ) -> Result<ResponseValue<BlvtSubscribeResponse>, Error<Error>>

Subscribe BLVT (USER_DATA)

Weight(IP): 1

Sends a POST request to /sapi/v1/blvt/subscribe

Arguments:

  • cost: Spot balance
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • token_name: BTCDOWN, BTCUP
Source

pub async fn blvt_subscribe_record<'a>( &'a self, end_time: Option<i64>, id: Option<i64>, limit: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, token_name: Option<&'a str>, ) -> Result<ResponseValue<BlvtSubscribeRecordResponse>, Error<Error>>

Query Subscription Record (USER_DATA)

  • Only the data of the latest 90 days is available

Weight(IP): 1

Sends a GET request to /sapi/v1/blvt/subscribe/record

Arguments:

  • end_time: UTC timestamp in ms
  • id
  • limit: Default 500; max 1000.
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • token_name: BTCDOWN, BTCUP
Source

pub async fn blvt_redeem<'a>( &'a self, amount: f64, recv_window: Option<i64>, signature: &'a str, timestamp: i64, token_name: &'a str, ) -> Result<ResponseValue<BlvtRedeemResponse>, Error<Error>>

Redeem BLVT (USER_DATA)

Weight(IP): 1

Sends a POST request to /sapi/v1/blvt/redeem

Arguments:

  • amount
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • token_name: BTCDOWN, BTCUP
Source

pub async fn blvt_redeem_record<'a>( &'a self, end_time: Option<i64>, id: Option<i64>, limit: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, token_name: Option<&'a str>, ) -> Result<ResponseValue<Vec<BlvtRedeemRecordResponseItem>>, Error<Error>>

Redemption Record (USER_DATA)

  • Only the data of the latest 90 days is available

Weight(IP): 1

Sends a GET request to /sapi/v1/blvt/redeem/record

Arguments:

  • end_time: UTC timestamp in ms
  • id
  • limit: default 1000, max 1000
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • token_name: BTCDOWN, BTCUP
Source

pub async fn blvt_user_limit<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, token_name: Option<&'a str>, ) -> Result<ResponseValue<Vec<BlvtUserLimitResponseItem>>, Error<Error>>

BLVT User Limit Info (USER_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/blvt/userLimit

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • token_name: BTCDOWN, BTCUP
Source

pub async fn bswap_pools<'a>( &'a self, ) -> Result<ResponseValue<Vec<BswapPoolsResponseItem>>, Error<Error>>

List All Swap Pools (MARKET_DATA)

Get metadata about all swap pools.

Weight(IP): 1

Sends a GET request to /sapi/v1/bswap/pools

Source

pub async fn bswap_liquidity<'a>( &'a self, pool_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<BswapLiquidityResponseItem>>, Error<Error>>

Liquidity information of a pool (USER_DATA)

Get liquidity information and user share of a pool.

Weight(IP):

  • 1 for one pool;
  • 10 when the poolId parameter is omitted;

Sends a GET request to /sapi/v1/bswap/liquidity

Arguments:

  • pool_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn bswap_liquidity_add<'a>( &'a self, asset: &'a str, pool_id: i64, quantity: f64, recv_window: Option<i64>, signature: &'a str, timestamp: i64, type_: Option<BswapLiquidityAddType>, ) -> Result<ResponseValue<BswapLiquidityAddResponse>, Error<Error>>

Add Liquidity (TRADE)

Add liquidity to a pool.

Weight(UID): 1000 (Additional: 3 times one second)

Sends a POST request to /sapi/v1/bswap/liquidityAdd

Arguments:

  • asset
  • pool_id
  • quantity
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • type_: * Single - to add a single token
  • Combination - to add dual tokens
Source

pub async fn bswap_liquidity_remove<'a>( &'a self, asset: Option<&'a str>, pool_id: i64, recv_window: Option<i64>, share_amount: f64, signature: &'a str, timestamp: i64, type_: BswapLiquidityRemoveType, ) -> Result<ResponseValue<BswapLiquidityRemoveResponse>, Error<Error>>

Remove Liquidity (TRADE)

Remove liquidity from a pool, type include SINGLE and COMBINATION, asset is mandatory for single asset removal

Weight(UID): 1000 (Additional: 3 times one second)

Sends a POST request to /sapi/v1/bswap/liquidityRemove

Arguments:

  • asset: Mandatory for single asset removal
  • pool_id
  • recv_window: The value cannot be greater than 60000
  • share_amount
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • type_: * SINGLE - for single asset removal
  • COMBINATION - for combination of all coins removal
Source

pub async fn bswap_liquidity_ops<'a>( &'a self, end_time: Option<i64>, limit: Option<i32>, operation: Option<BswapLiquidityOpsOperation>, operation_id: Option<i64>, pool_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<Vec<BswapLiquidityOpsResponseItem>>, Error<Error>>

Liquidity Operation Record (USER_DATA)

Get liquidity operation (add/remove) records.

Weight(UID): 3000

Sends a GET request to /sapi/v1/bswap/liquidityOps

Arguments:

  • end_time: UTC timestamp in ms
  • limit: Default 500; max 1000.
  • operation
  • operation_id
  • pool_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn bswap_quote<'a>( &'a self, base_asset: &'a str, quote_asset: &'a str, quote_qty: f64, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<BswapQuoteResponse>, Error<Error>>

Request Quote (USER_DATA)

Request a quote for swap quote asset (selling asset) for base asset (buying asset), essentially price/exchange rates.

quoteQty is quantity of quote asset (to sell).

Please be noted the quote is for reference only, the actual price will change as the liquidity changes, it’s recommended to swap immediate after request a quote for slippage prevention.

Weight(UID): 150

Sends a GET request to /sapi/v1/bswap/quote

Arguments:

  • base_asset
  • quote_asset
  • quote_qty
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn swap_history<'a>( &'a self, base_asset: Option<&'a str>, end_time: Option<i64>, limit: Option<i32>, quote_asset: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, status: Option<i32>, swap_id: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<Vec<SwapHistoryResponseItem>>, Error<Error>>

Swap History (USER_DATA)

Get swap history.

Weight(UID): 3000

Sends a GET request to /sapi/v1/bswap/swap

Arguments:

  • base_asset
  • end_time: UTC timestamp in ms
  • limit: default 3, max 100
  • quote_asset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • status: * 0 - pending for swap
  • 1 - success
  • 2 - failed
  • swap_id
  • timestamp: UTC timestamp in ms
Source

pub async fn bswap_swap<'a>( &'a self, base_asset: &'a str, quote_asset: &'a str, quote_qty: f64, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<BswapSwapResponse>, Error<Error>>

Swap (TRADE)

Swap quoteAsset for baseAsset.

Weight(UID): 1000 (Additional: 3 times one second)

Sends a POST request to /sapi/v1/bswap/swap

Arguments:

  • base_asset
  • quote_asset
  • quote_qty
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn bswap_pool_configure<'a>( &'a self, pool_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<BswapPoolConfigureResponseItem>>, Error<Error>>

Pool Configure (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/bswap/poolConfigure

Arguments:

  • pool_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn bswap_add_liquidity_preview<'a>( &'a self, pool_id: i64, quote_asset: &'a str, quote_qty: f64, recv_window: Option<i64>, signature: &'a str, timestamp: i64, type_: BswapAddLiquidityPreviewType, ) -> Result<ResponseValue<BswapAddLiquidityPreviewResponse>, Error<Error>>

Add Liquidity Preview (USER_DATA)

Calculate expected share amount for adding liquidity in single or dual token.

Weight(IP): 150

Sends a GET request to /sapi/v1/bswap/addLiquidityPreview

Arguments:

  • pool_id
  • quote_asset
  • quote_qty
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • type_: * SINGLE - for adding a single token
  • COMBINATION - for adding dual tokens
Source

pub async fn bswap_remove_liquidity_preview<'a>( &'a self, pool_id: i64, quote_asset: &'a str, recv_window: Option<i64>, share_amount: f64, signature: &'a str, timestamp: i64, type_: BswapRemoveLiquidityPreviewType, ) -> Result<ResponseValue<BswapRemoveLiquidityPreviewResponse>, Error<Error>>

Remove Liquidity Preview (USER_DATA)

Calculate the expected asset amount of single token redemption or dual token redemption.

Weight(IP): 150

Sends a GET request to /sapi/v1/bswap/removeLiquidityPreview

Arguments:

  • pool_id
  • quote_asset
  • recv_window: The value cannot be greater than 60000
  • share_amount
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • type_: * SINGLE - remove and obtain a single token
  • COMBINATION - remove and obtain dual token
Source

pub async fn bswap_unclaimed_rewards<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, type_: Option<i32>, ) -> Result<ResponseValue<BswapUnclaimedRewardsResponse>, Error<Error>>

Get Unclaimed Rewards Record (USER_DATA)

Get unclaimed rewards record.

Weight(UID): 1000

Sends a GET request to /sapi/v1/bswap/unclaimedRewards

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • type_: 0: Swap rewards, 1: Liquidity rewards, default to 0
Source

pub async fn bswap_claim_rewards<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, type_: Option<i32>, ) -> Result<ResponseValue<BswapClaimRewardsResponse>, Error<Error>>

Claim rewards (TRADE)

Claim swap rewards or liquidity rewards

Weight(UID): 1000

Sends a POST request to /sapi/v1/bswap/claimRewards

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • type_: 0: Swap rewards, 1: Liquidity rewards, default to 0
Source

pub async fn bswap_claimed_history<'a>( &'a self, asset_rewards: Option<&'a str>, end_time: Option<i64>, limit: Option<i32>, pool_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, type_: Option<i32>, ) -> Result<ResponseValue<Vec<BswapClaimedHistoryResponseItem>>, Error<Error>>

Get Claimed History (USER_DATA)

Get history of claimed rewards.

Weight(UID): 1000

Sends a GET request to /sapi/v1/bswap/claimedHistory

Arguments:

  • asset_rewards
  • end_time: UTC timestamp in ms
  • limit: Default 3, max 100
  • pool_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • type_: 0: Swap rewards, 1: Liquidity rewards, default to 0
Source

pub async fn c2c_order_match_list_user_order_history<'a>( &'a self, end_timestamp: Option<i64>, page: Option<i32>, recv_window: Option<i64>, rows: Option<i32>, signature: &'a str, start_timestamp: Option<i64>, timestamp: i64, trade_type: C2cOrderMatchListUserOrderHistoryTradeType, ) -> Result<ResponseValue<C2cOrderMatchListUserOrderHistoryResponse>, Error<Error>>

Get C2C Trade History (USER_DATA)

  • If startTimestamp and endTimestamp are not sent, the recent 30-day data will be returned.
  • The max interval between startTimestamp and endTimestamp is 30 days.

Weight(IP): 1

Sends a GET request to /sapi/v1/c2c/orderMatch/listUserOrderHistory

Arguments:

  • end_timestamp: UTC timestamp in ms
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • rows: default 100, max 100
  • signature: Signature
  • start_timestamp: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • trade_type
Source

pub async fn loan_vip_ongoing_orders<'a>( &'a self, collateral_account_id: Option<i64>, collateral_coin: Option<&'a str>, current: Option<i32>, limit: Option<i32>, loan_coin: Option<&'a str>, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanVipOngoingOrdersResponse>, Error<Error>>

Get VIP Loan Ongoing Orders (USER_DATA)

VIP loan is available for VIP users only.

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/vip/ongoing/orders

Arguments:

  • collateral_account_id
  • collateral_coin: Coin used as collateral
  • current: Current querying page. Start from 1. Default:1
  • limit: Default 10; max 100.
  • loan_coin: Coin loaned
  • order_id: Order id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_vip_repay<'a>( &'a self, amount: f64, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanVipRepayResponse>, Error<Error>>

VIP Loan Repay (TRADE)

VIP loan is available for VIP users only.

Weight(UID): 6000

Sends a POST request to /sapi/v1/loan/vip/repay

Arguments:

  • amount
  • order_id: Order id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_vip_repay_history<'a>( &'a self, current: Option<i32>, end_time: Option<i64>, limit: Option<i32>, loan_coin: Option<&'a str>, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<LoanVipRepayHistoryResponse>, Error<Error>>

Get VIP Loan Repayment History (USER_DATA)

VIP loan is available for VIP users only.

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/vip/repay/history

Arguments:

  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • limit: Default 10; max 100.
  • loan_coin: Coin loaned
  • order_id: Order id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_vip_collateral_account<'a>( &'a self, collateral_account_id: Option<i64>, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanVipCollateralAccountResponse>, Error<Error>>

Check Locked Value of VIP Collateral Account (USER_DATA)

VIP loan is available for VIP users only.

Weight(IP): 6000

Sends a GET request to /sapi/v1/loan/vip/collateral/account

Arguments:

  • collateral_account_id
  • order_id: Order id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_vip_borrow<'a>( &'a self, collateral_account_id: &'a str, collateral_coin: &'a str, is_flexible_rate: LoanVipBorrowIsFlexibleRate, loan_account_id: i64, loan_amount: f32, loan_coin: Option<&'a str>, loan_term: Option<i64>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanVipBorrowResponse>, Error<Error>>

VIP Loan Borrow

VIP loan is available for VIP users only.

Weight(UID): 6000

Sends a POST request to /sapi/v1/loan/vip/borrow

Arguments:

  • collateral_account_id
  • collateral_coin
  • is_flexible_rate
  • loan_account_id
  • loan_amount
  • loan_coin: Coin loaned
  • loan_term
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_vip_loanable_data<'a>( &'a self, loan_coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, vip_level: Option<i32>, ) -> Result<ResponseValue<LoanVipLoanableDataResponse>, Error<Error>>

Get Loanable Assets Data

Get interest rate and borrow limit of loanable assets. The borrow limit is shown in USD value.

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/vip/loanable/data

Arguments:

  • loan_coin: Coin loaned
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • vip_level: Defaults to user’s vip level
Source

pub async fn loan_vip_collateral_data<'a>( &'a self, collateral_coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanVipCollateralDataResponse>, Error<Error>>

Get Collateral Asset Data (USER_DATA)

Get collateral asset data.

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/vip/collateral/data

Arguments:

  • collateral_coin: Coin used as collateral
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_vip_request_data<'a>( &'a self, current: Option<i32>, limit: Option<i32>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanVipRequestDataResponse>, Error<Error>>

Query Application Status (USER_DATA)

Get Application Status

Weight(UID): 400

Sends a GET request to /sapi/v1/loan/vip/request/data

Arguments:

  • current: Current querying page. Start from 1. Default:1
  • limit: Default 500; max 1000.
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_vip_request_interest_rate<'a>( &'a self, loan_coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<LoanVipRequestInterestRateResponseItem>>, Error<Error>>

Get Borrow Interest Rate (USER_DATA)

Get borrow interest rate.

Weight(UID): 400

Sends a GET request to /sapi/v1/loan/vip/request/interestRate

Arguments:

  • loan_coin: Max 10 assets, Multiple split by “,”
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_vip_renew<'a>( &'a self, loan_term: Option<i64>, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanVipRenewResponse>, Error<Error>>

VIP Loan Renew

VIP loan is available for VIP users only.

Weight(UID): 6000

Sends a POST request to /sapi/v1/loan/vip/renew

Arguments:

  • loan_term
  • order_id: Order id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_income<'a>( &'a self, asset: Option<&'a str>, end_time: Option<i64>, limit: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, type_: Option<LoanIncomeType>, ) -> Result<ResponseValue<Vec<LoanIncomeResponseItem>>, Error<Error>>

Get Crypto Loans Income History (USER_DATA)

  • If startTime and endTime are not sent, the recent 7-day data will be returned.
  • The max interval between startTime and endTime is 30 days.

Weight(UID): 6000

Sends a GET request to /sapi/v1/loan/income

Arguments:

  • asset
  • end_time: UTC timestamp in ms
  • limit: default 20, max 100
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
  • type_: All types will be returned by default.
    • borrowIn
    • collateralSpent
    • repayAmount
    • collateralReturn - Collateral return after repayment
    • addCollateral
    • removeCollateral
    • collateralReturnAfterLiquidation
Source

pub async fn loan_borrow<'a>( &'a self, collateral_amount: Option<f32>, collateral_coin: &'a str, loan_amount: Option<f32>, loan_coin: &'a str, loan_term: i32, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanBorrowResponse>, Error<Error>>

Crypto Loan Borrow (TRADE)

Weight(UID): 6000

Sends a POST request to /sapi/v1/loan/borrow

Arguments:

  • collateral_amount
  • collateral_coin: Coin used as collateral
  • loan_amount: Loan amount
  • loan_coin: Coin loaned
  • loan_term: 7/14/30/90/180 days
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_borrow_history<'a>( &'a self, collateral_coin: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, limit: Option<i64>, loan_coin: Option<&'a str>, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<LoanBorrowHistoryResponse>, Error<Error>>

Get Crypto Loans Borrow History (USER_DATA)

  • If startTime and endTime are not sent, the recent 90-day data will be returned.
  • The max interval between startTime and endTime is 180 days.

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/borrow/history

Arguments:

  • collateral_coin: Coin used as collateral
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • limit: default 10, max 100
  • loan_coin: Coin loaned
  • order_id: orderId in POST /sapi/v1/loan/borrow
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_ongoing_orders<'a>( &'a self, collateral_coin: Option<&'a str>, current: Option<i32>, limit: Option<i64>, loan_coin: Option<&'a str>, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanOngoingOrdersResponse>, Error<Error>>

Get Loan Ongoing Orders (USER_DATA)

Weight(IP): 300

Sends a GET request to /sapi/v1/loan/ongoing/orders

Arguments:

  • collateral_coin: Coin used as collateral
  • current: Current querying page. Start from 1; default:1, max:1000
  • limit: default 10, max 100
  • loan_coin: Coin loaned
  • order_id: orderId in POST /sapi/v1/loan/borrow
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_repay<'a>( &'a self, amount: f64, collateral_return: Option<bool>, order_id: i64, recv_window: Option<i64>, signature: &'a str, timestamp: i64, type_: Option<i32>, ) -> Result<ResponseValue<LoanRepayResponse>, Error<Error>>

Crypto Loan Repay (TRADE)

Weight(UID): 6000

Sends a POST request to /sapi/v1/loan/repay

Arguments:

  • amount: Repayment Amount
  • collateral_return: Default: TRUE. TRUE: Return extra collateral to spot account; FALSE: Keep extra collateral in the order.
  • order_id: Order ID
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • type_: Default: 1. 1 for ‘repay with borrowed coin’; 2 for ‘repay with collateral’.
Source

pub async fn loan_repay_history<'a>( &'a self, collateral_coin: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, limit: Option<i64>, loan_coin: Option<&'a str>, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<LoanRepayHistoryResponse>, Error<Error>>

Get Loan Repayment History (USER_DATA)

If startTime and endTime are not sent, the recent 90-day data will be returned. The max interval between startTime and endTime is 180 days.

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/repay/history

Arguments:

  • collateral_coin: Coin used as collateral
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • limit: default 10, max 100
  • loan_coin: Coin loaned
  • order_id: Order ID
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_adjust_ltv<'a>( &'a self, amount: f64, direction: LoanAdjustLtvDirection, order_id: i64, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanAdjustLtvResponse>, Error<Error>>

Crypto Loan Adjust LTV (TRADE)

Weight(UID): 6000

Sends a POST request to /sapi/v1/loan/adjust/ltv

Arguments:

  • amount: Amount
  • direction: ‘ADDITIONAL’, ‘REDUCED’
  • order_id: Order ID
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_ltv_adjustment_history<'a>( &'a self, collateral_coin: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, limit: Option<i64>, loan_coin: Option<&'a str>, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<LoanLtvAdjustmentHistoryResponse>, Error<Error>>

Get Loan LTV Adjustment History (USER_DATA)

If startTime and endTime are not sent, the recent 90-day data will be returned. The max interval between startTime and endTime is 180 days.

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/ltv/adjustment/history

Arguments:

  • collateral_coin: Coin used as collateral
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • limit: default 10, max 100
  • loan_coin: Coin loaned
  • order_id: Order ID
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_loanable_data<'a>( &'a self, loan_coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, vip_level: Option<i32>, ) -> Result<ResponseValue<LoanLoanableDataResponse>, Error<Error>>

Get Loanable Assets Data (USER_DATA)

Get interest rate and borrow limit of loanable assets. The borrow limit is shown in USD value.

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/loanable/data

Arguments:

  • loan_coin: Coin loaned
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • vip_level: Defaults to user’s vip level
Source

pub async fn loan_collateral_data<'a>( &'a self, collateral_coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, vip_level: Option<i32>, ) -> Result<ResponseValue<LoanCollateralDataResponse>, Error<Error>>

Get Collateral Assets Data (USER_DATA)

Get LTV information and collateral limit of collateral assets. The collateral limit is shown in USD value.

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/collateral/data

Arguments:

  • collateral_coin: Coin used as collateral
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • vip_level: Defaults to user’s vip level
Source

pub async fn loan_repay_collateral_rate<'a>( &'a self, collateral_coin: &'a str, loan_coin: &'a str, recv_window: Option<i64>, repay_amount: f32, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanRepayCollateralRateResponse>, Error<Error>>

Check Collateral Repay Rate (USER_DATA)

Get the the rate of collateral coin / loan coin when using collateral repay, the rate will be valid within 8 second.

Weight(IP): 6000

Sends a GET request to /sapi/v1/loan/repay/collateral/rate

Arguments:

  • collateral_coin: Coin used as collateral
  • loan_coin: Coin loaned
  • recv_window: The value cannot be greater than 60000
  • repay_amount: repay amount of loanCoin
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_customize_margin_call<'a>( &'a self, collateral_coin: Option<&'a str>, margin_call: f32, order_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanCustomizeMarginCallResponse>, Error<Error>>

Crypto Loan Customize Margin Call (TRADE)

Customize margin call for ongoing orders only.

Weight(UID): 6000

Sends a POST request to /sapi/v1/loan/customize/margin_call

Arguments:

  • collateral_coin: Coin used as collateral
  • margin_call
  • order_id: Mandatory when collateralCoin is empty. Send either orderId or collateralCoin, if both parameters are sent, take orderId only.
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_flexible_borrow<'a>( &'a self, collateral_amount: Option<f32>, collateral_coin: Option<&'a str>, loan_amount: Option<f32>, loan_coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanFlexibleBorrowResponse>, Error<Error>>

Borrow - Flexible Loan Borrow (TRADE)

Weight(UID): 6000

Sends a POST request to /sapi/v1/loan/flexible/borrow

Arguments:

  • collateral_amount
  • collateral_coin: Coin used as collateral
  • loan_amount: Loan amount
  • loan_coin: Coin loaned
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_flexible_ongoing_orders<'a>( &'a self, collateral_coin: Option<&'a str>, current: Option<i32>, limit: Option<i32>, loan_coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanFlexibleOngoingOrdersResponse>, Error<Error>>

Borrow - Get Flexible Loan Ongoing Orders (USER_DATA)

Weight(IP): 300

Sends a GET request to /sapi/v1/loan/flexible/ongoing/orders

Arguments:

  • collateral_coin: Coin used as collateral
  • current: Current querying page. Start from 1. Default:1
  • limit: Default 500; max 1000.
  • loan_coin: Coin loaned
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_flexible_borrow_history<'a>( &'a self, collateral_coin: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, limit: Option<i32>, loan_coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<LoanFlexibleBorrowHistoryResponse>, Error<Error>>

Borrow - Get Flexible Loan Borrow History (USER_DATA)

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/flexible/borrow/history

Arguments:

  • collateral_coin: Coin used as collateral
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • limit: Default 500; max 1000.
  • loan_coin: Coin loaned
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_flexible_repay<'a>( &'a self, collateral_coin: Option<&'a str>, collateral_return: Option<bool>, full_repayment: Option<bool>, loan_coin: Option<&'a str>, recv_window: Option<i64>, repay_amount: f32, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanFlexibleRepayResponse>, Error<Error>>

Repay - Flexible Loan Repay (TRADE)

Weight(IP): 6000

Sends a POST request to /sapi/v1/loan/flexible/repay

Arguments:

  • collateral_coin: Coin used as collateral
  • collateral_return
  • full_repayment
  • loan_coin: Coin loaned
  • recv_window: The value cannot be greater than 60000
  • repay_amount: repay amount of loanCoin
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_flexible_repay_history<'a>( &'a self, collateral_coin: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, limit: Option<i32>, loan_coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<LoanFlexibleRepayHistoryResponse>, Error<Error>>

Repay - Get Flexible Loan Repayment History (USER_DATA)

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/flexible/repay/history

Arguments:

  • collateral_coin: Coin used as collateral
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • limit: Default 500; max 1000.
  • loan_coin: Coin loaned
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_flexible_adjust_ltv<'a>( &'a self, adjustment_amount: f32, collateral_coin: Option<&'a str>, direction: LoanFlexibleAdjustLtvDirection, loan_coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanFlexibleAdjustLtvResponse>, Error<Error>>

Adjust LTV - Flexible Loan Adjust LTV (TRADE)

Weight(UID): 6000

Sends a POST request to /sapi/v1/loan/flexible/adjust/ltv

Arguments:

  • adjustment_amount
  • collateral_coin: Coin used as collateral
  • direction
  • loan_coin: Coin loaned
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_flexible_ltv_adjustment_history<'a>( &'a self, collateral_coin: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, limit: Option<i32>, loan_coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<LoanFlexibleLtvAdjustmentHistoryResponse>, Error<Error>>

Adjust LTV - Get Flexible Loan LTV Adjustment History (USER_DATA)

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/flexible/ltv/adjustment/history

Arguments:

  • collateral_coin: Coin used as collateral
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • limit: Default 500; max 1000.
  • loan_coin: Coin loaned
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_flexible_loanable_data<'a>( &'a self, loan_coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanFlexibleLoanableDataResponse>, Error<Error>>

Get Flexible Loan Assets Data (USER_DATA)

Get interest rate and borrow limit of flexible loanable assets. The borrow limit is shown in USD value.

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/flexible/loanable/data

Arguments:

  • loan_coin: Coin loaned
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn loan_flexible_collateral_data<'a>( &'a self, collateral_coin: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LoanFlexibleCollateralDataResponse>, Error<Error>>

Get Flexible Loan Collateral Assets Data (USER_DATA)

Get LTV information and collateral limit of flexible loan’s collateral assets. The collateral limit is shown in USD value.

Weight(IP): 400

Sends a GET request to /sapi/v1/loan/flexible/collateral/data

Arguments:

  • collateral_coin: Coin used as collateral
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn pay_transactions<'a>( &'a self, end_time: Option<i64>, limit: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<PayTransactionsResponse>, Error<Error>>

Get Pay Trade History (USER_DATA)

  • If startTime and endTime are not sent, the recent 90 days’ data will be returned.
  • The max interval between startTime and endTime is 90 days.
  • Support for querying orders within the last 18 months.

Weight(UID): 3000

Sends a GET request to /sapi/v1/pay/transactions

Arguments:

  • end_time: UTC timestamp in ms
  • limit: default 100, max 100
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn convert_exchange_info<'a>( &'a self, from_asset: Option<&'a str>, to_asset: Option<&'a str>, ) -> Result<ResponseValue<Vec<ConvertExchangeInfoResponseItem>>, Error<Error>>

List All Convert Pairs

Query for all convertible token pairs and the tokens’ respective upper/lower limits

Weight(IP): 3000

Sends a GET request to /sapi/v1/convert/exchangeInfo

Arguments:

  • from_asset: User spends coin
  • to_asset: User receives coin
Source

pub async fn convert_asset_info<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<ConvertAssetInfoResponseItem>>, Error<Error>>

Query order quantity precision per asset (USER_DATA)

Query for supported asset precision information

Weight(IP): 100

Sends a GET request to /sapi/v1/convert/assetInfo

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn convert_get_quote<'a>( &'a self, from_amount: Option<f32>, from_asset: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, to_amount: Option<f32>, to_asset: &'a str, valid_time: Option<&'a str>, wallet_type: Option<&'a str>, ) -> Result<ResponseValue<ConvertGetQuoteResponse>, Error<Error>>

Send quote request (USER_DATA)

Request a quote for the requested token pairs

Weight(UID): 200

Sends a POST request to /sapi/v1/convert/getQuote

Arguments:

  • from_amount: When specified, it is the amount you will be debited after the conversion
  • from_asset
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • to_amount: When specified, it is the amount you will be debited after the conversion
  • to_asset
  • valid_time: 10s, 30s, 1m, 2m, default 10s
  • wallet_type: SPOT or FUNDING. Default is SPOT
Source

pub async fn convert_accept_quote<'a>( &'a self, quote_id: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<ConvertAcceptQuoteResponse>, Error<Error>>

Accept Quote (TRADE)

Accept the offered quote by quote ID.

Weight(UID): 500

Sends a POST request to /sapi/v1/convert/acceptQuote

Arguments:

  • quote_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn convert_order_status<'a>( &'a self, order_id: Option<&'a str>, quote_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<ConvertOrderStatusResponse>, Error<Error>>

Order status (USER_DATA)

Query order status by order ID.

Weight(UID): 100

Sends a GET request to /sapi/v1/convert/orderStatus

Arguments:

  • order_id
  • quote_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn convert_trade_flow<'a>( &'a self, end_time: i64, limit: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: i64, timestamp: i64, ) -> Result<ResponseValue<ConvertTradeFlowResponse>, Error<Error>>

Get Convert Trade History (USER_DATA)

  • The max interval between startTime and endTime is 30 days.

Weight(UID): 3000

Sends a GET request to /sapi/v1/convert/tradeFlow

Arguments:

  • end_time: UTC timestamp in ms
  • limit: default 100, max 1000
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn rebate_tax_query<'a>( &'a self, end_time: Option<i64>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<RebateTaxQueryResponse>, Error<Error>>

Get Spot Rebate History Records (USER_DATA)

  • The max interval between startTime and endTime is 90 days.
  • If startTime and endTime are not sent, the recent 7 days’ data will be returned.
  • The earliest startTime is supported on June 10, 2020

Weight(UID): 3000

Sends a GET request to /sapi/v1/rebate/taxQuery

Arguments:

  • end_time: UTC timestamp in ms
  • page: default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn nft_history_transactions<'a>( &'a self, end_time: Option<i64>, limit: Option<i32>, order_type: i32, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<NftHistoryTransactionsResponse>, Error<Error>>

Get NFT Transaction History (USER_DATA)

  • The max interval between startTime and endTime is 90 days.
  • If startTime and endTime are not sent, the recent 7 days’ data will be returned.

Weight(UID): 3000

Sends a GET request to /sapi/v1/nft/history/transactions

Arguments:

  • end_time: UTC timestamp in ms
  • limit: Default 50, Max 50
  • order_type: 0: purchase order, 1: sell order, 2: royalty income, 3: primary market order, 4: mint fee
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn nft_history_deposit<'a>( &'a self, end_time: Option<i64>, limit: Option<i32>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<NftHistoryDepositResponse>, Error<Error>>

Get NFT Deposit History(USER_DATA)

  • The max interval between startTime and endTime is 90 days.
  • If startTime and endTime are not sent, the recent 7 days’ data will be returned.

Weight(UID): 3000

Sends a GET request to /sapi/v1/nft/history/deposit

Arguments:

  • end_time: UTC timestamp in ms
  • limit: Default 50, Max 50
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn nft_history_withdraw<'a>( &'a self, end_time: Option<i64>, limit: Option<i32>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<NftHistoryWithdrawResponse>, Error<Error>>

Get NFT Withdraw History (USER_DATA)

  • The max interval between startTime and endTime is 90 days.
  • If startTime and endTime are not sent, the recent 7 days’ data will be returned.

Weight(UID): 3000

Sends a GET request to /sapi/v1/nft/history/withdraw

Arguments:

  • end_time: UTC timestamp in ms
  • limit: Default 50, Max 50
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn nft_user_get_asset<'a>( &'a self, limit: Option<i32>, page: Option<i32>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<NftUserGetAssetResponse>, Error<Error>>

Get NFT Asset (USER_DATA)

Weight(UID): 3000

Sends a GET request to /sapi/v1/nft/user/getAsset

Arguments:

  • limit: Default 50, Max 50
  • page: Default 1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn giftcard_create_code<'a>( &'a self, amount: f64, recv_window: Option<i64>, signature: &'a str, timestamp: i64, token: &'a str, ) -> Result<ResponseValue<GiftcardCreateCodeResponse>, Error<Error>>

Create a Binance Code (USER_DATA)

This API is for creating a Binance Code. To get started with, please make sure:

  • You have a Binance account
  • You have passed kyc
  • You have a sufficient balance in your Binance funding wallet
  • You need Enable Withdrawals for the API Key which requests this endpoint.

Daily creation volume: 2 BTC / 24H Daily creation times: 200 Codes / 24H

Weight(IP): 1

Sends a POST request to /sapi/v1/giftcard/createCode

Arguments:

  • amount: The amount of the coin
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
  • token: The coin type contained in the Binance Code
Source

pub async fn giftcard_redeem_code<'a>( &'a self, code: &'a str, external_uid: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<GiftcardRedeemCodeResponse>, Error<Error>>

Redeem a Binance Code (USER_DATA)

This API is for redeeming the Binance Code. Once redeemed, the coins will be deposited in your funding wallet.

Please note that if you enter the wrong code 5 times within 24 hours, you will no longer be able to redeem any Binance Code that day.

Weight(IP): 1

Sends a POST request to /sapi/v1/giftcard/redeemCode

Arguments:

  • code: Binance Code
  • external_uid: Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users, such as redemption frequency and amount. It also helps risk and limit control of a single account, such as daily limit on redemption volume, frequency, and incorrect number of entries. This will also prevent a single user account reach the partner’s daily redemption limits. We strongly recommend you to use this feature and transfer us the User ID of your users if you have different users redeeming Binance codes on your platform. To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters).
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn giftcard_verify<'a>( &'a self, recv_window: Option<i64>, reference_no: &'a str, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<GiftcardVerifyResponse>, Error<Error>>

Verify a Binance Code (USER_DATA)

This API is for verifying whether the Binance Code is valid or not by entering Binance Code or reference number.

Please note that if you enter the wrong binance code 5 times within an hour, you will no longer be able to verify any binance code for that hour.

Weight(IP): 1

Sends a GET request to /sapi/v1/giftcard/verify

Arguments:

  • recv_window: The value cannot be greater than 60000
  • reference_no: reference number
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn giftcard_cryptography_rsa_public_key<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<GiftcardCryptographyRsaPublicKeyResponse>, Error<Error>>

Fetch RSA Public Key (USER_DATA)

This API is for fetching the RSA Public Key. This RSA Public key will be used to encrypt the card code. Please note that the RSA Public key fetched is valid only for the current day.

Weight(IP): 1

Sends a GET request to /sapi/v1/giftcard/cryptography/rsa-public-key

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn giftcard_buy_code<'a>( &'a self, base_token: &'a str, base_token_amount: f64, face_token: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<GiftcardBuyCodeResponse>, Error<Error>>

Buy a Binance Code (TRADE)

This API is for buying a fixed-value Binance Code, which means your Binance Code will be redeemable to a token that is different to the token that you are paying in. If the token you’re paying and the redeemable token are the same, please use the Create Binance Code endpoint. You can use supported crypto currency or fiat token as baseToken to buy Binance Code that is redeemable to your chosen faceToken. Once successfully purchased, the amount of baseToken would be deducted from your funding wallet.

To get started with, please make sure:

  • You have a Binance account
  • You have passed kyc
  • You have a sufficient balance in your Binance funding wallet
  • You need Enable Withdrawals for the API Key which requests this endpoint.

Daily creation volume: 2 BTC / 24H Daily creation times: 200 Codes / 24H

Weight(IP): 1

Sends a POST request to /sapi/v1/giftcard/buyCode

Arguments:

  • base_token: The token you want to pay, example BUSD
  • base_token_amount: The base token asset quantity, example 1.002
  • face_token: The token you want to buy, example BNB. If faceToken = baseToken, it’s the same as createCode endpoint.
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn giftcard_buy_code_token_limit<'a>( &'a self, base_token: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<GiftcardBuyCodeTokenLimitResponse>, Error<Error>>

Fetch Token Limit (USER_DATA)

This API is to help you verify which tokens are available for you to purchase fixed-value gift cards as mentioned in section 2 and it’s limitation.

Weight(IP): 1

Sends a GET request to /sapi/v1/giftcard/buyCode/token-limit

Arguments:

  • base_token: The token you want to pay, example BUSD
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn lending_auto_invest_target_asset_list<'a>( &'a self, current: Option<i32>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, target_asset: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<LendingAutoInvestTargetAssetListResponse>, Error<Error>>

Get target asset list (USER_DATA)

Weight(IP): 1

Sends a GET request to /sapi/v1/lending/auto-invest/target-asset/list

Arguments:

  • current: Current querying page. Start from 1. Default:1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • target_asset
  • timestamp: UTC timestamp in ms
Source

pub async fn lending_auto_invest_target_asset_roi_list<'a>( &'a self, his_roi_type: &'a str, recv_window: Option<i64>, signature: &'a str, target_asset: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<LendingAutoInvestTargetAssetRoiListResponseItem>>, Error<Error>>

Get target asset ROI data (USER_DATA)

ROI return list for target asset

Weight(IP): 1

Sends a GET request to /sapi/v1/lending/auto-invest/target-asset/roi/list

Arguments:

  • his_roi_type
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • target_asset
  • timestamp: UTC timestamp in ms
Source

pub async fn lending_auto_invest_all_asset<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<LendingAutoInvestAllAssetResponse>, Error<Error>>

Query all source asset and target asset (USER_DATA)

Query all source assets and target assets

Weight(IP): 1

Sends a GET request to /sapi/v1/lending/auto-invest/all/asset

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn lending_auto_invest_source_asset_list<'a>( &'a self, flexible_allowed_to_use: Option<bool>, index_id: Option<i64>, recv_window: Option<i64>, signature: &'a str, target_asset: Option<&'a str>, timestamp: i64, usage_type: &'a str, ) -> Result<ResponseValue<LendingAutoInvestSourceAssetListResponse>, Error<Error>>

Query source asset list (USER_DATA)

Query Source Asset to be used for investment

Weight(IP): 1

Sends a GET request to /sapi/v1/lending/auto-invest/source-asset/list

Arguments:

  • flexible_allowed_to_use
  • index_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • target_asset
  • timestamp: UTC timestamp in ms
  • usage_type
Source

pub async fn simple_earn_flexible_list<'a>( &'a self, asset: Option<&'a str>, current: Option<i32>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnFlexibleListResponse>, Error<Error>>

Get Simple Earn Flexible Product List (USER_DATA)

Get available Simple Earn flexible product list

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/flexible/list

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_locked_list<'a>( &'a self, asset: Option<&'a str>, current: Option<i32>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnLockedListResponse>, Error<Error>>

Get Simple Earn Locked Product List (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/locked/list

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_flexible_subscribe<'a>( &'a self, amount: f64, auto_subscribe: Option<bool>, product_id: &'a str, recv_window: Option<i64>, signature: &'a str, source_account: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnFlexibleSubscribeResponse>, Error<Error>>

Subscribe Flexible Product (TRADE)

Weight(IP): 1

Rate Limit: 1/3s per account

Sends a POST request to /sapi/v1/simple-earn/flexible/subscribe

Arguments:

  • amount
  • auto_subscribe: true or false, default true.
  • product_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • source_account: SPOT,FUND,ALL, default SPOT
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_locked_subscribe<'a>( &'a self, amount: f64, auto_subscribe: Option<bool>, project_id: &'a str, recv_window: Option<i64>, signature: &'a str, source_account: Option<&'a str>, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnLockedSubscribeResponse>, Error<Error>>

Subscribe Locked Product (TRADE)

Weight(IP): 1

Rate Limit: 1/3s per account

Sends a POST request to /sapi/v1/simple-earn/locked/subscribe

Arguments:

  • amount
  • auto_subscribe: true or false, default true.
  • project_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • source_account: SPOT,FUND,ALL, default SPOT
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_flexible_redeem<'a>( &'a self, amount: Option<f64>, dest_account: Option<&'a str>, product_id: &'a str, recv_window: Option<i64>, redeem_all: Option<bool>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnFlexibleRedeemResponse>, Error<Error>>

Redeem Flexible Product (TRADE)

Weight(IP): 1

Rate Limit: 1/3s per account

Sends a POST request to /sapi/v1/simple-earn/flexible/redeem

Arguments:

  • amount: if redeemAll is false, amount is mandatory
  • dest_account: SPOT,FUND,ALL, default SPOT
  • product_id
  • recv_window: The value cannot be greater than 60000
  • redeem_all: true or false, default to false
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_locked_redeem<'a>( &'a self, position_id: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnLockedRedeemResponse>, Error<Error>>

Redeem Locked Product (TRADE)

Weight(IP): 1

Rate Limit: 1/3s per account

Sends a POST request to /sapi/v1/simple-earn/locked/redeem

Arguments:

  • position_id: 1234
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_flexible_position<'a>( &'a self, asset: Option<&'a str>, current: Option<i32>, product_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnFlexiblePositionResponse>, Error<Error>>

Get Flexible Product Position (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/flexible/position

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • product_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_locked_position<'a>( &'a self, asset: Option<&'a str>, current: Option<i32>, position_id: Option<&'a str>, project_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnLockedPositionResponse>, Error<Error>>

Get Locked Product Position (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/locked/position

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • position_id
  • project_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_account<'a>( &'a self, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnAccountResponse>, Error<Error>>

Simple Account (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/account

Arguments:

  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_flexible_history_subscription_record<'a>( &'a self, asset: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, product_id: Option<&'a str>, purchase_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnFlexibleHistorySubscriptionRecordResponse>, Error<Error>>

Get Flexible Subscription Record (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/flexible/history/subscriptionRecord

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • product_id
  • purchase_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_locked_history_subscription_record<'a>( &'a self, asset: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, purchase_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnLockedHistorySubscriptionRecordResponse>, Error<Error>>

Get Locked Subscription Record (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/locked/history/subscriptionRecord

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • purchase_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_flexible_history_redemption_record<'a>( &'a self, asset: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, product_id: Option<&'a str>, redeem_id: Option<&'a str>, size: Option<i32>, start_time: Option<i64>, ) -> Result<ResponseValue<SimpleEarnFlexibleHistoryRedemptionRecordResponse>, Error<Error>>

Get Flexible Redemption Record (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/flexible/history/redemptionRecord

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • product_id
  • redeem_id
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
Source

pub async fn simple_earn_locked_history_redemption_record<'a>( &'a self, asset: Option<&'a str>, current: Option<i32>, end_time: Option<i64>, position_id: Option<&'a str>, recv_window: Option<i64>, redeem_id: Option<&'a str>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnLockedHistoryRedemptionRecordResponse>, Error<Error>>

Get Locked Redemption Record (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/locked/history/redemptionRecord

Arguments:

  • asset
  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • position_id
  • recv_window: The value cannot be greater than 60000
  • redeem_id
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_flexible_history_rewards_record<'a>( &'a self, asset: Option<&'a str>, end_time: Option<i64>, product_id: Option<&'a str>, start_time: Option<i64>, type_: &'a str, ) -> Result<ResponseValue<SimpleEarnFlexibleHistoryRewardsRecordResponse>, Error<Error>>

Get Flexible Rewards History (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/flexible/history/rewardsRecord

Arguments:

  • asset
  • end_time: UTC timestamp in ms
  • product_id
  • start_time: UTC timestamp in ms
  • type_: “BONUS”, “REALTIME”, “REWARDS”
Source

pub async fn simple_earn_locked_history_rewards_record<'a>( &'a self, asset: Option<&'a str>, end_time: Option<i64>, position_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnLockedHistoryRewardsRecordResponse>, Error<Error>>

Get Locked Rewards History (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/locked/history/rewardsRecord

Arguments:

  • asset
  • end_time: UTC timestamp in ms
  • position_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_flexible_set_auto_subscribe<'a>( &'a self, auto_subscribe: bool, product_id: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnFlexibleSetAutoSubscribeResponse>, Error<Error>>

Set Flexible Auto Subscribe (USER_DATA)

Weight(IP): 150

Sends a POST request to /sapi/v1/simple-earn/flexible/setAutoSubscribe

Arguments:

  • auto_subscribe: true or false
  • product_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_locked_set_auto_subscribe<'a>( &'a self, auto_subscribe: bool, position_id: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnLockedSetAutoSubscribeResponse>, Error<Error>>

Set Locked Auto Subscribe (USER_DATA)

Weight(IP): 150

Sends a POST request to /sapi/v1/simple-earn/locked/setAutoSubscribe

Arguments:

  • auto_subscribe: true or false
  • position_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_flexible_personal_left_quota<'a>( &'a self, product_id: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnFlexiblePersonalLeftQuotaResponse>, Error<Error>>

Get Flexible Personal Left Quota (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/flexible/personalLeftQuota

Arguments:

  • product_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_locked_personal_left_quota<'a>( &'a self, project_id: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnLockedPersonalLeftQuotaResponse>, Error<Error>>

Get Locked Personal Left Quota (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/locked/personalLeftQuota

Arguments:

  • project_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_flexible_subscription_preview<'a>( &'a self, amount: f64, product_id: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnFlexibleSubscriptionPreviewResponse>, Error<Error>>

Get Flexible Subscription Preview (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/flexible/subscriptionPreview

Arguments:

  • amount
  • product_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_locked_subscription_preview<'a>( &'a self, amount: f64, auto_subscribe: Option<bool>, project_id: &'a str, recv_window: Option<i64>, signature: &'a str, timestamp: i64, ) -> Result<ResponseValue<Vec<SimpleEarnLockedSubscriptionPreviewResponseItem>>, Error<Error>>

Get Locked Subscription Preview (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/locked/subscriptionPreview

Arguments:

  • amount
  • auto_subscribe: true or false, default true.
  • project_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_flexible_history_rate_history<'a>( &'a self, current: Option<i32>, end_time: Option<i64>, product_id: &'a str, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnFlexibleHistoryRateHistoryResponse>, Error<Error>>

Get Rate History (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/flexible/history/rateHistory

Arguments:

  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • product_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms
Source

pub async fn simple_earn_flexible_history_collateral_record<'a>( &'a self, current: Option<i32>, end_time: Option<i64>, product_id: Option<&'a str>, recv_window: Option<i64>, signature: &'a str, size: Option<i32>, start_time: Option<i64>, timestamp: i64, ) -> Result<ResponseValue<SimpleEarnFlexibleHistoryCollateralRecordResponse>, Error<Error>>

Get Collateral Record (USER_DATA)

Weight(IP): 150

Sends a GET request to /sapi/v1/simple-earn/flexible/history/collateralRecord

Arguments:

  • current: Current querying page. Start from 1. Default:1
  • end_time: UTC timestamp in ms
  • product_id
  • recv_window: The value cannot be greater than 60000
  • signature: Signature
  • size: Default:10 Max:100
  • start_time: UTC timestamp in ms
  • timestamp: UTC timestamp in ms

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,