@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Binance Public Spot API
@base https://api.binance.com
@version 1.0
@auth ApiKey X-MBX-APIKEY in header
@endpoints 340
@hint download_for_search
@toc api(41), sapi(299)

@group api
@endpoint GET /api/v3/ping
@returns(200)

@endpoint GET /api/v3/time
@returns(200) {serverTime: int(int64)}

@endpoint GET /api/v3/exchangeInfo
@optional {symbol: str, symbols: str, permissions: str}
@returns(200) {timezone: str, serverTime: int(int64), rateLimits: [map], exchangeFilters: [map], symbols: [map]}
@errors {400}

@endpoint GET /api/v3/depth
@required {symbol: str}
@optional {limit: int(int32)=100}
@returns(200) {lastUpdateId: int(int64), bids: [[str]], asks: [[str]]}
@errors {400}

@endpoint GET /api/v3/trades
@required {symbol: str}
@optional {limit: int(int32)}
@returns(200)
@errors {400}

@endpoint GET /api/v3/historicalTrades
@required {symbol: str}
@optional {limit: int(int32), fromId: int(int64)}
@returns(200)

@endpoint GET /api/v3/aggTrades
@required {symbol: str}
@optional {fromId: int(int64), startTime: int(int64), endTime: int(int64), limit: int(int32)}
@returns(200)
@errors {400}

@endpoint GET /api/v3/klines
@required {symbol: str, interval: str(1s/1m/3m/5m/15m/30m/1h/2h/4h/6h/8h/12h/1d/3d/1w/1M)}
@optional {startTime: int(int64), endTime: int(int64), timeZone: str, limit: int(int32)}
@returns(200)
@errors {400}

@endpoint GET /api/v3/uiKlines
@required {symbol: str, interval: str(1s/1m/3m/5m/15m/30m/1h/2h/4h/6h/8h/12h/1d/3d/1w/1M)}
@optional {startTime: int(int64), endTime: int(int64), timeZone: str, limit: int(int32)}
@returns(200)
@errors {400}

@endpoint GET /api/v3/avgPrice
@required {symbol: str}
@returns(200) {mins: int(int64), price: str, closeTime: int(int64)}
@errors {400}

@endpoint GET /api/v3/ticker/24hr
@optional {symbol: str, symbols: str, type: str(FULL/MINI)}
@returns(200)
@errors {400}

@endpoint GET /api/v3/ticker/tradingDay
@optional {symbol: str, symbols: str, timeZone: str, type: str(FULL/MINI)}
@returns(200)
@errors {400}

@endpoint GET /api/v3/ticker/price
@optional {symbol: str, symbols: str}
@returns(200)
@errors {400}

@endpoint GET /api/v3/ticker/bookTicker
@optional {symbol: str, symbols: str}
@returns(200)
@errors {400}

@endpoint GET /api/v3/ticker
@optional {symbol: str, symbols: str, windowSize: str, type: str}
@returns(200) {symbol: str, priceChange: str, priceChangePercent: str, weightedAvgPrice: str, openPrice: str, highPrice: str, lowPrice: str, lastPrice: str, volume: str, quoteVolume: str, openTime: int(int64), closeTime: int(int64), firstId: int(int64), lastId: int(int64), count: int(int64)}
@errors {400}

@endpoint POST /api/v3/order/test
@required {symbol: str, side: str(SELL/BUY), type: str(LIMIT/MARKET/STOP_LOSS/STOP_LOSS_LIMIT/TAKE_PROFIT/TAKE_PROFIT_LIMIT/LIMIT_MAKER), timestamp: int(int64), signature: str}
@optional {timeInForce: str(GTC/IOC/FOK), quantity: num(double), quoteOrderQty: num(double), price: num(double), newClientOrderId: str, strategyId: int(int64), strategyType: int(int64), stopPrice: num(double), trailingDelta: num(double), icebergQty: num(double), newOrderRespType: str(ACK/RESULT/FULL), recvWindow: int(int64), computeCommissionRates: bool}
@returns(200)
@errors {400, 401}

@endpoint GET /api/v3/order
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {orderId: int(int64), origClientOrderId: str, recvWindow: int(int64)}
@returns(200) {symbol: str, orderId: int(int64), orderListId: int(int64), clientOrderId: str, price: str, origQty: str, executedQty: str, cummulativeQuoteQty: str, status: str, timeInForce: str, type: str, side: str, stopPrice: str, icebergQty: str, time: int(int64), updateTime: int(int64), isWorking: bool, workingTime: int(int64), origQuoteOrderQty: str, selfTradePreventionMode: str, preventedMatchId: int, preventedQuantity: str}
@errors {400, 401}

@endpoint POST /api/v3/order
@required {symbol: str, side: str(SELL/BUY), type: str(LIMIT/MARKET/STOP_LOSS/STOP_LOSS_LIMIT/TAKE_PROFIT/TAKE_PROFIT_LIMIT/LIMIT_MAKER), timestamp: int(int64), signature: str}
@optional {timeInForce: str(GTC/IOC/FOK), quantity: num(double), quoteOrderQty: num(double), price: num(double), newClientOrderId: str, strategyId: int(int64), strategyType: int(int64), stopPrice: num(double), trailingDelta: num(double), icebergQty: num(double), newOrderRespType: str(ACK/RESULT/FULL), selfTradePreventionMode: str(EXPIRE_TAKER/EXPIRE_MAKER/EXPIRE_BOTH/NONE), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint DELETE /api/v3/order
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {orderId: int(int64), origClientOrderId: str, newClientOrderId: str, cancelRestrictions: str(ONLY_NEW/ONLY_PARTIALLY_FILLED), recvWindow: int(int64)}
@returns(200) {symbol: str, origClientOrderId: str, orderId: int(int64), orderListId: int(int64), clientOrderId: str, transactTime: int(int64), price: str, origQty: str, executedQty: str, cummulativeQuoteQty: str, status: str, timeInForce: str, type: str, side: str, selfTradePreventionMode: str}
@errors {400, 401}

@endpoint POST /api/v3/order/cancelReplace
@required {symbol: str, side: str(SELL/BUY), type: str(LIMIT/MARKET/STOP_LOSS/STOP_LOSS_LIMIT/TAKE_PROFIT/TAKE_PROFIT_LIMIT/LIMIT_MAKER), cancelReplaceMode: str, timestamp: int(int64), signature: str}
@optional {cancelRestrictions: str(ONLY_NEW/ONLY_PARTIALLY_FILLED), timeInForce: str(GTC/IOC/FOK), quantity: num(double), quoteOrderQty: num(double), price: num(double), cancelNewClientOrderId: str, cancelOrigClientOrderId: str, cancelOrderId: int(int64), newClientOrderId: str, strategyId: int(int64), strategyType: int(int64), stopPrice: num(double), trailingDelta: num(double), icebergQty: num(double), newOrderRespType: str(ACK/RESULT/FULL), selfTradePreventionMode: str(EXPIRE_TAKER/EXPIRE_MAKER/EXPIRE_BOTH/NONE), recvWindow: int(int64)}
@returns(200) {cancelResult: str, newOrderResult: str, cancelResponse: map{symbol: str, origClientOrderId: str, orderId: int(int64), orderListId: int(int64), clientOrderId: str, price: str, origQty: str, executedQty: str, cummulativeQuoteQty: str, status: str, timeInForce: str, type: str, side: str, selfTradePreventionMode: str, transactTime: int(int64)}, newOrderResponse: map{symbol: str, orderId: int(int64), orderListId: int(int64), clientOrderId: str, transactTime: int(int64), price: str, origQty: str, executedQty: str, cummulativeQuoteQty: str, status: str, timeInForce: str, type: str, side: str, workingTime: int(int64), fills: [str], selfTradePreventionMode: str}}
@errors {400, 401}

@endpoint GET /api/v3/openOrders
@required {timestamp: int(int64), signature: str}
@optional {symbol: str, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint DELETE /api/v3/openOrders
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /api/v3/allOrders
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {orderId: int(int64), startTime: int(int64), endTime: int(int64), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /api/v3/orderList/oco
@required {symbol: str, side: str(SELL/BUY), quantity: num(double), aboveType: str, belowType: str, timestamp: int(int64), signature: str}
@optional {listClientOrderId: str, aboveClientOrderId: str, aboveIcebergQty: num(double), abovePrice: num(double), aboveStopPrice: num(double), aboveTrailingDelta: num(double), aboveTimeInForce: str(GTC/IOC/FOK), aboveStrategyId: num(double), aboveStrategyType: int(int64), belowClientOrderId: str, belowIcebergQty: num(double), belowPrice: num(double), belowStopPrice: num(double), belowTrailingDelta: num(double), belowTimeInForce: str(GTC/IOC/FOK), belowStrategyId: num(double), belowStrategyType: int(int64), newOrderRespType: str(ACK/RESULT/FULL), selfTradePreventionMode: str(EXPIRE_TAKER/EXPIRE_MAKER/EXPIRE_BOTH/NONE), recvWindow: int(int64)}
@returns(200) {orderListId: int(int64), contingencyType: str, listStatusType: str, listOrderStatus: str, listClientOrderId: str, transactionTime: int(int64), symbol: str, orders: [map], orderReports: [map]}
@errors {400, 401}

@endpoint POST /api/v3/orderList/oto
@required {symbol: str, workingType: str(LIMIT/LIMIT_MAKER), workingSide: str(BUY/SELL), workingPrice: num(double), workingQuantity: num(double), workingIcebergQty: num(double), pendingType: str(LIMIT/MARKET/STOP_LOSS/STOP_LOSS_LIMIT/TAKE_PROFIT/TAKE_PROFIT_LIMIT/LIMIT_MAKER), pendingSide: str(BUY/SELL), pendingQuantity: num(double), timestamp: int(int64), signature: str}
@optional {listClientOrderId: str, newOrderRespType: str(ACK/RESULT/FULL), selfTradePreventionMode: str(EXPIRE_TAKER/EXPIRE_MAKER/EXPIRE_BOTH/NONE), workingClientOrderId: str, workingTimeInForce: str(GTC/IOC/FOK), workingStrategyId: num(double), workingStrategyType: int(int64), pendingClientOrderId: str, pendingPrice: num(double), pendingStopPrice: num(double), pendingTrailingDelta: num(double), pendingIcebergQty: num(double), pendingTimeInForce: str(GTC/IOC/FOK), pendingStrategyId: num(double), pendingStrategyType: int(int64)}
@returns(200) {orderListId: int(int64), contingencyType: str, listStatusType: str, listOrderStatus: str, listClientOrderId: str, transactionTime: int(int64), symbol: str, orders: [map], orderReports: [map]}
@errors {400, 401}

@endpoint POST /api/v3/orderList/otoco
@required {symbol: str, workingType: str(LIMIT/LIMIT_MAKER), workingSide: str(BUY/SELL), workingPrice: num(double), workingQuantity: num(double), workingIcebergQty: num(double), pendingSide: str(BUY/SELL), pendingQuantity: num(double), pendingAboveType: str(LIMIT_MAKER/STOP_LOSS/STOP_LOSS_LIMIT), timestamp: int(int64), signature: str}
@optional {listClientOrderId: str, newOrderRespType: str(ACK/RESULT/FULL), selfTradePreventionMode: str(EXPIRE_TAKER/EXPIRE_MAKER/EXPIRE_BOTH/NONE), workingClientOrderId: str, workingTimeInForce: str(GTC/IOC/FOK), workingStrategyId: num(double), workingStrategyType: int(int64), pendingAboveClientOrderId: str, pendingAbovePrice: num(double), pendingAboveStopPrice: num(double), pendingAboveTrailingDelta: num(double), pendingAboveIcebergQty: num(double), pendingAboveTimeInForce: str(GTC/IOC/FOK), pendingAboveStrategyId: num(double), pendingAboveStrategyType: int(int64), pendingBelowType: str(LIMIT_MAKER/STOP_LOSS/STOP_LOSS_LIMIT), pendingBelowClientOrderId: str, pendingBelowPrice: num(double), pendingBelowStopPrice: num(double), pendingBelowTrailingDelta: num(double), pendingBelowIcebergQty: num(double), pendingBelowTimeInForce: str(GTC/IOC/FOK), pendingBelowStrategyId: num(double), pendingBelowStrategyType: int(int64), recvWindow: int(int64)}
@returns(200) {orderListId: int(int64), contingencyType: str, listStatusType: str, listOrderStatus: str, listClientOrderId: str, transactionTime: int(int64), symbol: str, orders: [map], orderReports: [map]}
@errors {400, 401}

@endpoint GET /api/v3/orderList
@required {timestamp: int(int64), signature: str}
@optional {orderListId: int(int64), origClientOrderId: str, recvWindow: int(int64)}
@returns(200) {orderListId: int(int64), contingencyType: str, listStatusType: str, listOrderStatus: str, listClientOrderId: str, transactionTime: int(int64), symbol: str, orders: [map]}
@errors {400, 401}

@endpoint DELETE /api/v3/orderList
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {orderListId: int(int64), listClientOrderId: str, newClientOrderId: str, recvWindow: int(int64)}
@returns(200) {orderListId: int(int64), contingencyType: str, listStatusType: str, listOrderStatus: str, listClientOrderId: str, transactionTime: int(int64), symbol: str, orders: [map], orderReports: [map]}
@errors {400, 401}

@endpoint GET /api/v3/allOrderList
@required {timestamp: int(int64), signature: str}
@optional {fromId: int(int64), startTime: int(int64), endTime: int(int64), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /api/v3/openOrderList
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /api/v3/sor/order
@required {symbol: str, side: str(SELL/BUY), type: str(LIMIT/MARKET/STOP_LOSS/STOP_LOSS_LIMIT/TAKE_PROFIT/TAKE_PROFIT_LIMIT/LIMIT_MAKER), quantity: num(double), timestamp: int(int64), signature: str}
@optional {timeInForce: str(GTC/IOC/FOK), price: num(double), newClientOrderId: str, strategyId: int(int64), strategyType: int(int64), icebergQty: num(double), newOrderRespType: str(ACK/RESULT/FULL), selfTradePreventionMode: str(EXPIRE_TAKER/EXPIRE_MAKER/EXPIRE_BOTH/NONE), recvWindow: int(int64)}
@returns(200) {symbol: str, orderId: int(int64), orderListId: int(int64), clientOrderId: str, transactTime: int(int64), price: str, origQty: str, executedQty: str, cummulativeQuoteQty: str, status: str, timeInForce: str, type: str, side: str, workingTime: int(int64), fills: [map], workingFloor: str, selfTradePreventionMode: str, usedSor: bool}
@errors {400, 401}

@endpoint POST /api/v3/sor/order/test
@required {symbol: str, side: str(SELL/BUY), type: str(LIMIT/MARKET/STOP_LOSS/STOP_LOSS_LIMIT/TAKE_PROFIT/TAKE_PROFIT_LIMIT/LIMIT_MAKER), quantity: num(double), timestamp: int(int64), signature: str}
@optional {timeInForce: str(GTC/IOC/FOK), price: num(double), newClientOrderId: str, strategyId: int(int64), strategyType: int(int64), icebergQty: num(double), newOrderRespType: str(ACK/RESULT/FULL), selfTradePreventionMode: str(EXPIRE_TAKER/EXPIRE_MAKER/EXPIRE_BOTH/NONE), computeCommissionRates: bool, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /api/v3/account
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {makerCommission: int(int64), takerCommission: int(int64), buyerCommission: int(int64), sellerCommission: int(int64), commissionRates: map{maker: str, taker: str, buyer: str, seller: str}, canTrade: bool, canWithdraw: bool, canDeposit: bool, brokered: bool, requireSelfTradePrevention: bool, preventSor: bool, updateTime: int(int64), accountType: str, balances: [map], permissions: [str], uid: int(int64)}
@errors {400, 401}

@endpoint GET /api/v3/myTrades
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {orderId: int(int64), startTime: int(int64), endTime: int(int64), fromId: int(int64), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /api/v3/rateLimit/order
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /api/v3/myPreventedMatches
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {preventedMatchId: int(int64), orderId: int(int64), fromPreventedMatchId: int(int64), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /api/v3/myAllocations
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), fromAllocationId: int(int64), limit: int(int32), orderId: int(int64), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /api/v3/account/commission
@required {symbol: str, timestamp: int(int64), signature: str}
@returns(200) {symbol: str, standardCommission: map{maker: str, taker: str, buyer: str, seller: str}, taxCommission: map{maker: str, taker: str, buyer: str, seller: str}, discount: map{enabledForAccount: bool, enabledForSymbol: bool, discountAsset: str, discount: str}}
@errors {400, 401}

@endgroup

@group sapi
@endpoint POST /sapi/v1/margin/borrow-repay
@required {asset: str, isIsolated: str, symbol: str, amount: num(double), type: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {tranId: int(int64)}
@errors {400}

@endpoint GET /sapi/v1/margin/borrow-repay
@required {asset: str, type: str, timestamp: int(int64), signature: str}
@optional {isolatedSymbol: str, txId: int(int64), startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400}

@endpoint GET /sapi/v1/margin/transfer
@required {timestamp: int(int64), signature: str}
@optional {asset: str, type: str(ROLL_IN/ROLL_OUT), startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), isolatedSymbol: str, recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/allAssets
@required {asset: str}
@returns(200)
@errors {400}

@endpoint GET /sapi/v1/margin/allPairs
@required {symbol: str}
@returns(200)
@errors {400}

@endpoint GET /sapi/v1/margin/priceIndex
@required {symbol: str}
@returns(200) {calcTime: int(int64), price: str, symbol: str}
@errors {400}

@endpoint GET /sapi/v1/margin/order
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {isIsolated: str(TRUE/FALSE), orderId: int(int64), origClientOrderId: str, recvWindow: int(int64)}
@returns(200) {clientOrderId: str, cummulativeQuoteQty: str, executedQty: str, icebergQty: str, isWorking: bool, orderId: int(int64), origQty: str, price: str, side: str, status: str, stopPrice: str, symbol: str, isIsolated: bool, time: int(int64), timeInForce: str, type: str, updateTime: int(int64), selfTradePreventionMode: str}
@errors {400, 401}

@endpoint POST /sapi/v1/margin/order
@required {symbol: str, side: str(SELL/BUY), type: str(LIMIT/MARKET/STOP_LOSS/STOP_LOSS_LIMIT/TAKE_PROFIT/TAKE_PROFIT_LIMIT/LIMIT_MAKER), quantity: num(double), autoRepayAtCancel: bool, timestamp: int(int64), signature: str}
@optional {isIsolated: str(TRUE/FALSE), quoteOrderQty: num(double), price: num(double), stopPrice: num(double), newClientOrderId: str, icebergQty: num(double), newOrderRespType: str(ACK/RESULT/FULL), sideEffectType: str(NO_SIDE_EFFECT/MARGIN_BUY/AUTO_REPAY), timeInForce: str(GTC/IOC/FOK), selfTradePreventionMode: str(EXPIRE_TAKER/EXPIRE_MAKER/EXPIRE_BOTH/NONE), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint DELETE /sapi/v1/margin/order
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {isIsolated: str(TRUE/FALSE), orderId: int(int64), origClientOrderId: str, newClientOrderId: str, recvWindow: int(int64)}
@returns(200) {symbol: str, orderId: int(int64), origClientOrderId: str, clientOrderId: str, price: str, origQty: str, executedQty: str, cummulativeQuoteQty: str, status: str, timeInForce: str, type: str, side: str}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/interestHistory
@required {timestamp: int(int64), signature: str}
@optional {asset: str, isolatedSymbol: str, startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), archived: str, recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/forceLiquidationRec
@required {timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), isolatedSymbol: str, current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/account
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {created: bool, borrowEnabled: bool, marginLevel: str, collateralMarginLevel: str, totalAssetOfBtc: str, totalLiabilityOfBtc: str, totalNetAssetOfBtc: str, TotalCollateralValueInUSDT: str, tradeEnabled: bool, transferInEnabled: bool, transferOutEnabled: bool, accountType: str, userAssets: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/openOrders
@required {timestamp: int(int64), signature: str}
@optional {symbol: str, isIsolated: str(TRUE/FALSE), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint DELETE /sapi/v1/margin/openOrders
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {isIsolated: str(TRUE/FALSE), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/margin/allOrders
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {isIsolated: str(TRUE/FALSE), orderId: int(int64), startTime: int(int64), endTime: int(int64), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/margin/order/oco
@required {symbol: str, side: str(SELL/BUY), quantity: num(double), price: num(double), stopPrice: num(double), timestamp: int(int64), signature: str}
@optional {isIsolated: str(TRUE/FALSE), listClientOrderId: str, limitClientOrderId: str, limitIcebergQty: num(double), stopClientOrderId: str, stopLimitPrice: num(double), stopIcebergQty: num(double), stopLimitTimeInForce: str(GTC/FOK/IOC), newOrderRespType: str(ACK/RESULT/FULL), sideEffectType: str(NO_SIDE_EFFECT/MARGIN_BUY/AUTO_REPAY), selfTradePreventionMode: str(EXPIRE_TAKER/EXPIRE_MAKER/EXPIRE_BOTH/NONE), recvWindow: int(int64)}
@returns(200) {orderListId: int(int64), contingencyType: str, listStatusType: str, listOrderStatus: str, listClientOrderId: str, transactionTime: int(int64), symbol: str, marginBuyBorrowAmount: str, marginBuyBorrowAsset: str, isIsolated: bool, orders: [map], orderReports: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/orderList
@required {timestamp: int(int64), signature: str}
@optional {isIsolated: str(TRUE/FALSE), symbol: str, orderListId: int(int64), origClientOrderId: str, recvWindow: int(int64)}
@returns(200) {orderListId: int(int64), contingencyType: str, listStatusType: str, listOrderStatus: str, listClientOrderId: str, transactionTime: int(int64), symbol: str, isIsolated: bool, orders: [map]}
@errors {400, 401}

@endpoint DELETE /sapi/v1/margin/orderList
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {isIsolated: str(TRUE/FALSE), orderListId: int(int64), listClientOrderId: str, newClientOrderId: str, recvWindow: int(int64)}
@returns(200) {orderListId: int(int64), contingencyType: str, listStatusType: str, listOrderStatus: str, listClientOrderId: str, transactionTime: int(int64), symbol: str, isIsolated: bool, orders: [map], orderReports: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/allOrderList
@required {timestamp: int(int64), signature: str}
@optional {isIsolated: str(TRUE/FALSE), symbol: str, fromId: str, startTime: int(int64), endTime: int(int64), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/margin/openOrderList
@required {timestamp: int(int64), signature: str}
@optional {isIsolated: str(TRUE/FALSE), symbol: str, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/margin/myTrades
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {isIsolated: str(TRUE/FALSE), startTime: int(int64), endTime: int(int64), fromId: int(int64), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/margin/maxBorrowable
@required {asset: str, timestamp: int(int64), signature: str}
@optional {isolatedSymbol: str, recvWindow: int(int64)}
@returns(200) {amount: str, borrowLimit: str}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/maxTransferable
@required {asset: str, timestamp: int(int64), signature: str}
@optional {isolatedSymbol: str, recvWindow: int(int64)}
@returns(200) {amount: str, borrowLimit: str}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/tradeCoeff
@required {email: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {normalBar: str, marginCallBar: str, forceLiquidationBar: str}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/isolated/account
@required {timestamp: int(int64), signature: str}
@optional {symbols: str, recvWindow: int(int64)}
@returns(200) {assets: [map], totalAssetOfBtc: str, totalLiabilityOfBtc: str, totalNetAssetOfBtc: str}
@errors {400, 401}

@endpoint DELETE /sapi/v1/margin/isolated/account
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {success: bool, symbol: str}
@errors {400, 401}

@endpoint POST /sapi/v1/margin/isolated/account
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {success: bool, symbol: str}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/isolated/accountLimit
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {enabledAccount: int(int64), maxAccount: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/isolated/allPairs
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/bnbBurn
@required {timestamp: int(int64), signature: str}
@optional {spotBNBBurn: str(true/false), interestBNBBurn: str(true/false), recvWindow: int(int64)}
@returns(200) {spotBNBBurn: bool, interestBNBBurn: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/bnbBurn
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {spotBNBBurn: bool, interestBNBBurn: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/interestRateHistory
@required {asset: str, timestamp: int(int64), signature: str}
@optional {vipLevel: int(int32), startTime: int(int64), endTime: int(int64), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/margin/crossMarginData
@required {timestamp: int(int64), signature: str}
@optional {vipLevel: int(int32), coin: str, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/margin/isolatedMarginData
@required {timestamp: int(int64), signature: str}
@optional {vipLevel: int(int32), symbol: str, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/margin/isolatedMarginTier
@required {symbol: str, timestamp: int(int64), signature: str}
@optional {tier: str, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/margin/rateLimit/order
@required {timestamp: int(int64), signature: str}
@optional {isIsolated: str, symbol: str, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/margin/crossMarginCollateralRatio
@returns(200)
@errors {400}

@endpoint GET /sapi/v1/margin/exchange-small-liability
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/margin/exchange-small-liability-history
@required {timestamp: int(int64), signature: str}
@optional {current: int(int32), size: int(int32), startTime: int(int64), endTime: int(int64), recvWindow: int(int64)}
@returns(200) {total: int, rows: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/next-hourly-interest-rate
@required {timestamp: int(int64), signature: str}
@optional {assets: str, isIsolated: str(TRUE/FALSE), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/margin/capital-flow
@required {timestamp: int(int64), signature: str}
@optional {asset: str, symbol: str, type: str(TRANSFER/BORROW/REPAY/BUY_INCOME/BUY_EXPENSE/SELL_INCOME/SELL_EXPENSE/TRADING_COMMISSION/BUY_LIQUIDATION/SELL_LIQUIDATION/REPAY_LIQUIDATION/OTHER_LIQUIDATION/LIQUIDATION_FEE/SMALL_BALANCE_CONVERT/COMMISSION_RETURN/SMALL_CONVERT), startTime: int(int64), endTime: int(int64), fromId: int(int64), limit: int(int64), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/margin/delist-schedule
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/margin/available-inventory
@required {type: str(MARGIN/ISOLATED), timestamp: int(int64), signature: str}
@returns(200) {assets: map{MATIC: str, STPT: str, TVK: str, SHIB: str}, updateTime: int(int64)}
@errors {400, 401}

@endpoint POST /sapi/v1/margin/manual-liquidation
@required {type: str(MARGIN/ISOLATED), timestamp: int(int64), signature: str}
@optional {symbol: str}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/margin/order/oto
@required {symbol: str, workingType: str(LIMIT/LIMIT_MAKER), workingSide: str(BUY/SELL), workingPrice: num(double), workingQuantity: num(double), workingIcebergQty: num(double), pendingType: str(LIMIT/MARKET/STOP_LOSS/STOP_LOSS_LIMIT/TAKE_PROFIT/TAKE_PROFIT_LIMIT/LIMIT_MAKER), pendingSide: str(BUY/SELL), pendingQuantity: num(double), timestamp: int(int64), signature: str}
@optional {isIsolated: str(TRUE/FALSE), listClientOrderId: str, newOrderRespType: str(ACK/RESULT/FULL), sideEffectType: str(NO_SIDE_EFFECT/MARGIN_BUY), selfTradePreventionMode: str(EXPIRE_TAKER/EXPIRE_MAKER/EXPIRE_BOTH/NONE), autoRepayAtCancel: bool, workingClientOrderId: str, workingTimeInForce: str(GTC/IOC/FOK), pendingClientOrderId: str, pendingPrice: num(double), pendingStopPrice: num(double), pendingTrailingDelta: num(double), pendingIcebergQty: num(double), pendingTimeInForce: str(GTC/IOC/FOK)}
@returns(200) {orderListId: int(int64), contingencyType: str, listStatusType: str, listOrderStatus: str, listClientOrderId: str, transactionTime: int(int64), symbol: str, isIsolated: bool, orders: [map], orderReports: [map]}
@errors {400, 401}

@endpoint POST /sapi/v1/margin/order/otoco
@required {symbol: str, workingType: str(LIMIT/LIMIT_MAKER), workingSide: str(BUY/SELL), workingPrice: num(double), workingQuantity: num(double), workingIcebergQty: num(double), pendingSide: str(BUY/SELL), pendingQuantity: num(double), pendingAboveType: str(LIMIT_MAKER/STOP_LOSS/STOP_LOSS_LIMIT), timestamp: int(int64), signature: str}
@optional {isIsolated: str(TRUE/FALSE), sideEffectType: str(NO_SIDE_EFFECT/MARGIN_BUY), autoRepayAtCancel: bool, listClientOrderId: str, newOrderRespType: str(ACK/RESULT/FULL), selfTradePreventionMode: str(EXPIRE_TAKER/EXPIRE_MAKER/EXPIRE_BOTH/NONE), workingClientOrderId: str, workingTimeInForce: str(GTC/IOC/FOK), pendingAboveClientOrderId: str, pendingAbovePrice: num(double), pendingAboveStopPrice: num(double), pendingAboveTrailingDelta: num(double), pendingAboveIcebergQty: num(double), pendingAboveTimeInForce: str(GTC/IOC/FOK), pendingBelowType: str(LIMIT_MAKER/STOP_LOSS/STOP_LOSS_LIMIT), pendingBelowClientOrderId: str, pendingBelowPrice: num(double), pendingBelowStopPrice: num(double), pendingBelowTrailingDelta: num(double), pendingBelowIcebergQty: num(double), pendingBelowTimeInForce: str(GTC/IOC/FOK)}
@returns(200) {orderListId: int(int64), contingencyType: str, listStatusType: str, listOrderStatus: str, listClientOrderId: str, transactionTime: int(int64), symbol: str, isIsolated: bool, orders: [map], orderReports: [map]}
@errors {400, 401}

@endpoint POST /sapi/v1/margin/max-leverage
@required {maxLeverage: int, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/margin/leverageBracket
@returns(200)
@errors {400}

@endpoint GET /sapi/v1/system/status
@returns(200) {status: int(int32), msg: str}

@endpoint GET /sapi/v1/capital/config/getall
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/accountSnapshot
@required {type: str(SPOT/MARGIN/FUTURES), timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), limit: int(int32)=7, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/account/disableFastWithdrawSwitch
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/account/enableFastWithdrawSwitch
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/capital/withdraw/apply
@required {coin: str, address: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {withdrawOrderId: str, network: str, addressTag: str, transactionFeeFlag: bool=false, name: str, walletType: int(int32), recvWindow: int(int64)}
@returns(200) {id: str}
@errors {400, 401}

@endpoint GET /sapi/v1/capital/deposit/hisrec
@required {timestamp: int(int64), signature: str}
@optional {coin: str, status: int(int32), startTime: int(int64), endTime: int(int64), offset: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/capital/withdraw/history
@required {timestamp: int(int64), signature: str}
@optional {coin: str, withdrawOrderId: str, status: int(int32), startTime: int(int64), endTime: int(int64), offset: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/capital/deposit/address
@required {coin: str, timestamp: int(int64), signature: str}
@optional {network: str, recvWindow: int(int64)}
@returns(200) {address: str, coin: str, tag: str, url: str}
@errors {400, 401}

@endpoint GET /sapi/v1/account/status
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {data: str}
@errors {400, 401}

@endpoint GET /sapi/v1/account/apiTradingStatus
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {data: map{isLocked: bool, plannedRecoverTime: int(int64), triggerCondition: map{GCR: int(int64), IFER: int(int64), UFR: int(int64)}, indicators: map{BTCUSDT: [map]}, updateTime: int(int64)}}
@errors {400, 401}

@endpoint GET /sapi/v1/asset/dribblet
@required {timestamp: int(int64), signature: str}
@optional {accountType: str(SPOT/MARGIN), startTime: int(int64), endTime: int(int64), recvWindow: int(int64)}
@returns(200) {total: int(int64), userAssetDribblets: [map]}
@errors {400, 401}

@endpoint POST /sapi/v1/asset/dust-btc
@required {timestamp: int(int64), signature: str}
@optional {accountType: str(SPOT/MARGIN), recvWindow: int(int64)}
@returns(200) {details: [map], totalTransferBtc: str, totalTransferBNB: str, dribbletPercentage: str}
@errors {400, 401}

@endpoint POST /sapi/v1/asset/dust
@required {asset: [str], timestamp: int(int64), signature: str}
@optional {accountType: str(SPOT/MARGIN), recvWindow: int(int64)}
@returns(200) {totalServiceCharge: str, totalTransfered: str, transferResult: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/asset/assetDividend
@required {timestamp: int(int64), signature: str}
@optional {asset: str, startTime: int(int64), endTime: int(int64), limit: int(int32)=20, recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v1/asset/assetDetail
@required {timestamp: int(int64), signature: str}
@optional {asset: str, recvWindow: int(int64)}
@returns(200) {CTR: map{minWithdrawAmount: str, depositStatus: bool, withdrawFee: int(int64), withdrawStatus: bool, depositTip: str}}
@errors {400, 401}

@endpoint GET /sapi/v1/asset/tradeFee
@required {timestamp: int(int64), signature: str}
@optional {symbol: str, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/asset/transfer
@required {type: str(MAIN_C2C/MAIN_UMFUTURE/MAIN_CMFUTURE/MAIN_MARGIN/MAIN_MINING/C2C_MAIN/C2C_UMFUTURE/C2C_MINING/C2C_MARGIN/UMFUTURE_MAIN/UMFUTURE_C2C/UMFUTURE_MARGIN/CMFUTURE_MAIN/CMFUTURE_MARGIN/MARGIN_MAIN/MARGIN_UMFUTURE/MARGIN_CMFUTURE/MARGIN_MINING/MARGIN_C2C/MINING_MAIN/MINING_UMFUTURE/MINING_C2C/MINING_MARGIN/MAIN_PAY/PAY_MAIN/ISOLATEDMARGIN_MARGIN/MARGIN_ISOLATEDMARGIN/ISOLATEDMARGIN_ISOLATEDMARGIN), timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), fromSymbol: str, toSymbol: str, recvWindow: int(int64)}
@returns(200) {total: int(int32), rows: [map]}
@errors {400, 401}

@endpoint POST /sapi/v1/asset/transfer
@required {type: str(MAIN_C2C/MAIN_UMFUTURE/MAIN_CMFUTURE/MAIN_MARGIN/MAIN_MINING/C2C_MAIN/C2C_UMFUTURE/C2C_MINING/C2C_MARGIN/UMFUTURE_MAIN/UMFUTURE_C2C/UMFUTURE_MARGIN/CMFUTURE_MAIN/CMFUTURE_MARGIN/MARGIN_MAIN/MARGIN_UMFUTURE/MARGIN_CMFUTURE/MARGIN_MINING/MARGIN_C2C/MINING_MAIN/MINING_UMFUTURE/MINING_C2C/MINING_MARGIN/MAIN_PAY/PAY_MAIN/ISOLATEDMARGIN_MARGIN/MARGIN_ISOLATEDMARGIN/ISOLATEDMARGIN_ISOLATEDMARGIN), asset: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {fromSymbol: str, toSymbol: str, recvWindow: int(int64)}
@returns(200) {tranId: int(int64)}
@errors {400, 401}

@endpoint POST /sapi/v1/asset/get-funding-asset
@required {timestamp: int(int64), signature: str}
@optional {asset: str, needBtcValuation: str(true/false), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v3/asset/getUserAsset
@required {timestamp: int(int64), signature: str}
@optional {asset: str, needBtcValuation: str(true/false), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/asset/convert-transfer
@required {clientTranId: str, asset: str, amount: num(double), targetAsset: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {tranId: int(int64), status: str}
@errors {400, 401}

@endpoint GET /sapi/v1/asset/convert-transfer/queryByPage
@required {startTime: int(int64), endTime: int(int64), timestamp: int(int64), signature: str}
@optional {tranId: int(int64), asset: str, accountType: str(MAIN/CARD), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {total: int(int32), rows: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage
@required {startTime: int(int64), endTime: int(int64), timestamp: int(int64), signature: str}
@optional {tranId: int(int64), clientTranId: str, asset: str, current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {total: int(int32), rows: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/account/apiRestrictions
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {ipRestrict: bool, createTime: int(int64), enableInternalTransfer: bool, enableFutures: bool, enablePortfolioMarginTrading: bool, enableVanillaOptions: bool, permitsUniversalTransfer: bool, enableReading: bool, enableSpotAndMarginTrading: bool, enableWithdrawals: bool, enableMargin: bool, tradingAuthorityExpirationTime: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/capital/contract/convertible-coins
@returns(200) {convertEnabled: bool, coins: [str], exchangeRates: map{USDC: str, TUSD: str, USDP: str}}
@errors {400, 401}

@endpoint POST /sapi/v1/capital/contract/convertible-coins
@required {coin: str, enable: bool}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/sub-account/virtualSubAccount
@required {subAccountString: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {email: str}
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/list
@required {timestamp: int(int64), signature: str}
@optional {email: str, isFreeze: str(true/false), page: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200) {subAccounts: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/sub/transfer/history
@required {timestamp: int(int64), signature: str}
@optional {fromEmail: str, toEmail: str, startTime: int(int64), endTime: int(int64), page: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/futures/internalTransfer
@required {email: str, futuresType: int(int32), timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), page: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200) {success: bool, futuresType: int(int32), transfers: [map]}
@errors {400, 401}

@endpoint POST /sapi/v1/sub-account/futures/internalTransfer
@required {fromEmail: str, toEmail: str, futuresType: int(int32), asset: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {success: bool, txnId: str}
@errors {400, 401}

@endpoint GET /sapi/v3/sub-account/assets
@required {email: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {balances: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/spotSummary
@required {timestamp: int(int64), signature: str}
@optional {email: str, page: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {totalCount: int(int64), masterAccountTotalAsset: str, spotSubUserAssetBtcVoList: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/capital/deposit/subAddress
@required {email: str, coin: str, timestamp: int(int64), signature: str}
@optional {network: str, recvWindow: int(int64)}
@returns(200) {address: str, coin: str, tag: str, url: str}
@errors {400, 401}

@endpoint GET /sapi/v1/capital/deposit/subHisrec
@required {email: str, timestamp: int(int64), signature: str}
@optional {coin: str, status: int(int32), startTime: int(int64), endTime: int(int64), limit: int(int64), offset: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/capital/deposit/credit-apply
@required {timestamp: int(int64), signature: str}
@optional {depositId: int(int64), txId: str, subAccountId: int(int64), subUserId: int(int64), recvWindow: int(int64)}
@returns(200) {code: str, message: str, data: bool, success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/asset/wallet/balance
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/asset/custody/transfer-history
@required {email: str, startTime: int(int64), endTime: int(int64), asset: str, timestamp: int(int64), signature: str}
@optional {type: str, current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {total: int, rows: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/capital/deposit/address/list
@required {coin: str, timestamp: int(int64), signature: str}
@optional {network: str, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/spot/delist-schedule
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/capital/withdraw/address/list
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/account/info
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {vipLevel: int(int32), isMarginEnabled: bool, isFutureEnabled: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/status
@required {timestamp: int(int64), signature: str}
@optional {email: str, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/sub-account/margin/enable
@required {email: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {email: str, isMarginEnabled: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/margin/account
@required {email: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {email: str, marginLevel: str, totalAssetOfBtc: str, totalLiabilityOfBtc: str, totalNetAssetOfBtc: str, marginTradeCoeffVo: map{forceLiquidationBar: str, marginCallBar: str, normalBar: str}, marginUserAssetVoList: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/margin/accountSummary
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {totalAssetOfBtc: str, totalLiabilityOfBtc: str, totalNetAssetOfBtc: str, subAccountList: [map]}
@errors {400, 401}

@endpoint POST /sapi/v1/sub-account/futures/enable
@required {email: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {email: str, isFuturesEnabled: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/futures/account
@required {email: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {email: str, asset: str, assets: [map], canDeposit: bool, canTrade: bool, canWithdraw: bool, feeTier: int(int64), maxWithdrawAmount: str, totalInitialMargin: str, totalMaintenanceMargin: str, totalMarginBalance: str, totalOpenOrderInitialMargin: str, totalPositionInitialMargin: str, totalUnrealizedProfit: str, totalWalletBalance: str, updateTime: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/futures/accountSummary
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {totalInitialMargin: str, totalMaintenanceMargin: str, totalMarginBalance: str, totalOpenOrderInitialMargin: str, totalPositionInitialMargin: str, totalUnrealizedProfit: str, totalWalletBalance: str, asset: str, subAccountList: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/futures/positionRisk
@required {email: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/sub-account/futures/transfer
@required {email: str, asset: str, amount: num(double), type: int(int32), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {txnId: str}
@errors {400, 401}

@endpoint POST /sapi/v1/sub-account/margin/transfer
@required {email: str, asset: str, amount: num(double), type: int(int32), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {txnId: str}
@errors {400, 401}

@endpoint POST /sapi/v1/sub-account/transfer/subToSub
@required {toEmail: str, asset: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {txnId: str}
@errors {400, 401}

@endpoint POST /sapi/v1/sub-account/transfer/subToMaster
@required {asset: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {txnId: str}
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/transfer/subUserHistory
@required {timestamp: int(int64), signature: str}
@optional {asset: str, type: int(int32), startTime: int(int64), endTime: int(int64), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/universalTransfer
@required {timestamp: int(int64), signature: str}
@optional {fromEmail: str, toEmail: str, clientTranId: str, startTime: int(int64), endTime: int(int64), page: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/sub-account/universalTransfer
@required {fromAccountType: str(SPOT/USDT_FUTURE/COIN_FUTURE/MARGIN/ISOLATED_MARGIN), toAccountType: str(SPOT/USDT_FUTURE/COIN_FUTURE/MARGIN/ISOLATED_MARGIN), asset: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {fromEmail: str, toEmail: str, clientTranId: str, symbol: str, recvWindow: int(int64)}
@returns(200) {tranId: int(int64), clientTranId: str}
@errors {400, 401}

@endpoint GET /sapi/v2/sub-account/futures/account
@required {email: str, futuresType: int(int32), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v2/sub-account/futures/accountSummary
@required {futuresType: int(int32), timestamp: int(int64), signature: str}
@optional {page: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v2/sub-account/futures/positionRisk
@required {email: str, futuresType: int(int32), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/sub-account/blvt/enable
@required {email: str, enableBlvt: bool, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {email: str, enableBlvt: bool}
@errors {400, 401}

@endpoint POST /sapi/v1/managed-subaccount/deposit
@required {toEmail: str, asset: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {tranId: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/managed-subaccount/asset
@required {email: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/managed-subaccount/withdraw
@required {fromEmail: str, asset: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {transferDate: int(int64), recvWindow: int(int64)}
@returns(200) {tranId: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/managed-subaccount/accountSnapshot
@required {email: str, type: str, timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), limit: int(int32), recvWindow: int(int64)}
@returns(200) {code: int(int32), msg: str, snapshotVos: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/managed-subaccount/queryTransLogForInvestor
@required {email: str, timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), page: int(int32), limit: int(int32), transfers: str, transferFunctionAccountType: str, recvWindow: int(int64)}
@returns(200) {count: int(int32), managerSubTransferHistoryVos: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/managed-subaccount/queryTransLogForTradeParent
@required {email: str, timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), page: int(int32), limit: int(int32), transfers: str, transferFunctionAccountType: str, recvWindow: int(int64)}
@returns(200) {count: int(int32), managerSubTransferHistoryVos: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/managed-subaccount/fetch-future-asset
@required {email: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {code: int(int32), message: str, snapshotVos: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/managed-subaccount/marginAsset
@required {email: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {marginLevel: str, totalAssetOfBtc: str, totalLiabilityOfBtc: str, totalNetAssetOfBtc: str, userAssets: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/managed-subaccount/info
@required {email: str, timestamp: int(int64), signature: str}
@optional {page: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200) {total: int, managerSubUserInfoVoList: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/managed-subaccount/deposit/address
@required {email: str, coin: str, timestamp: int(int64), signature: str}
@optional {network: str, recvWindow: int(int64)}
@returns(200) {coin: str, address: str, tag: str, url: str}
@errors {400, 401}

@endpoint GET /sapi/v1/managed-subaccount/query-trans-log
@required {transfers: str(FROM/TO), transferFunctionAccountType: str(SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE), timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), page: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200) {count: int, managerSubTransferHistoryVos: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/subAccountApi/ipRestriction
@required {email: str, subAccountApiKey: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {ipRestrict: str, ipList: [str], updateTime: int(int64), apiKey: str}
@errors {400, 401}

@endpoint DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList
@required {email: str, subAccountApiKey: str, timestamp: int(int64), signature: str}
@optional {ipAddress: str, thirdPartyName: str, recvWindow: int(int64)}
@returns(200) {ipRestrict: str, ipList: [str], updateTime: int(int64), apiKey: str}
@errors {400, 401}

@endpoint GET /sapi/v1/sub-account/transaction-statistics
@required {email: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {recent30BtcTotal: str, recent30BtcFuturesTotal: str, recent30BtcMarginTotal: str, recent30BusdTotal: str, recent30BusdFuturesTotal: str, recent30BusdMarginTotal: str, tradeInfoVos: [map]}
@errors {400, 401}

@endpoint POST /sapi/v1/sub-account/eoptions/enable
@required {email: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {email: str, isEOptionsEnabled: bool}
@errors {400, 401}

@endpoint POST /sapi/v2/sub-account/subAccountApi/ipRestriction
@required {email: str, subAccountApiKey: str, status: str, timestamp: int(int64), signature: str}
@optional {thirdPartyName: str, recvWindow: int(int64)}
@returns(200) {status: str, ipList: [str], updateTime: int(int64), apiKey: str}
@errors {400, 401}

@endpoint GET /sapi/v4/sub-account/assets
@required {email: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {balances: [map]}
@errors {400, 401}

@endgroup

@group api
@endpoint POST /api/v3/userDataStream
@returns(200) {listenKey: str}

@endpoint PUT /api/v3/userDataStream
@optional {listenKey: str}
@returns(200)
@errors {400}

@endpoint DELETE /api/v3/userDataStream
@optional {listenKey: str}
@returns(200)
@errors {400}

@endgroup

@group sapi
@endpoint POST /sapi/v1/userDataStream
@returns(200) {listenKey: str}

@endpoint PUT /sapi/v1/userDataStream
@optional {listenKey: str}
@returns(200)
@errors {400}

@endpoint DELETE /sapi/v1/userDataStream
@optional {listenKey: str}
@returns(200)
@errors {400}

@endpoint POST /sapi/v1/userDataStream/isolated
@returns(200) {listenKey: str}

@endpoint PUT /sapi/v1/userDataStream/isolated
@optional {listenKey: str}
@returns(200)
@errors {400}

@endpoint DELETE /sapi/v1/userDataStream/isolated
@optional {listenKey: str}
@returns(200)
@errors {400}

@endpoint GET /sapi/v1/fiat/orders
@required {transactionType: int(int32), timestamp: int(int64), signature: str}
@optional {beginTime: int(int64), endTime: int(int64), page: int(int32), rows: int(int32), recvWindow: int(int64)}
@returns(200) {code: str, message: str, data: [map], total: int(int32), success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/fiat/payments
@required {transactionType: int(int32), timestamp: int(int64), signature: str}
@optional {beginTime: int(int64), endTime: int(int64), page: int(int32), rows: int(int32), recvWindow: int(int64)}
@returns(200) {code: str, message: str, data: [map], total: int(int32), success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/lending/project/list
@required {type: str(ACTIVITY/CUSTOMIZED_FIXED), timestamp: int(int64), signature: str}
@optional {asset: str, status: str(ALL/SUBSCRIBABLE/UNSUBSCRIBABLE), isSortAsc: bool, sortBy: str(START_TIME/LOT_SIZE/INTEREST_RATE/DURATION), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/lending/customizedFixed/purchase
@required {projectId: str, lot: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {purchaseId: str}
@errors {400, 401}

@endpoint GET /sapi/v1/lending/project/position/list
@required {asset: str, timestamp: int(int64), signature: str}
@optional {projectId: str, status: str(ALL/SUBSCRIBABLE/UNSUBSCRIBABLE), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/lending/positionChanged
@required {projectId: str, lot: str, timestamp: int(int64), signature: str}
@optional {positionId: str, recvWindow: int(int64)}
@returns(200) {dailyPurchaseId: int(int64), success: bool, time: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/mining/pub/algoList
@returns(200) {code: int(int64), msg: str, data: [map]}
@errors {400}

@endpoint GET /sapi/v1/mining/pub/coinList
@returns(200) {code: int(int64), msg: str, data: [map]}
@errors {400}

@endpoint GET /sapi/v1/mining/worker/detail
@required {algo: str, userName: str, workerName: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {code: int(int64), msg: str, data: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/mining/worker/list
@required {algo: str, userName: str, timestamp: int(int64), signature: str}
@optional {pageIndex: int(int32), sort: int(int32), sortColumn: int(int32), workerStatus: int(int32), recvWindow: int(int64)}
@returns(200) {code: int(int64), msg: str, data: map{workerDatas: [map], totalNum: int(int64), pageSize: int(int64)}}
@errors {400, 401}

@endpoint GET /sapi/v1/mining/payment/list
@required {algo: str, userName: str, timestamp: int(int64), signature: str}
@optional {coin: str, startDate: str, endDate: str, pageIndex: int(int32), pageSize: str, recvWindow: int(int64)}
@returns(200) {code: int(int64), msg: str, data: map{accountProfits: [map], totalNum: int(int64), pageSize: int(int64)}}
@errors {400, 401}

@endpoint GET /sapi/v1/mining/payment/other
@required {algo: str, userName: str, timestamp: int(int64), signature: str}
@optional {coin: str, startDate: str, endDate: str, pageIndex: int(int32), pageSize: str, recvWindow: int(int64)}
@returns(200) {code: int(int64), msg: str, data: map{otherProfits: [map], totalNum: int(int64), pageSize: int(int64)}}
@errors {400, 401}

@endpoint GET /sapi/v1/mining/hash-transfer/config/details/list
@required {timestamp: int(int64), signature: str}
@optional {pageIndex: int(int32), pageSize: str, recvWindow: int(int64)}
@returns(200) {code: int(int64), msg: str, data: map{configDetails: [map], totalNum: int(int64), pageSize: int(int64)}}
@errors {400, 401}

@endpoint GET /sapi/v1/mining/hash-transfer/profit/details
@required {configId: str, userName: str, timestamp: int(int64), signature: str}
@optional {pageIndex: int(int32), pageSize: str, recvWindow: int(int64)}
@returns(200) {code: int(int64), msg: str, data: map{profitTransferDetails: [map], totalNum: int(int64), pageSize: int(int64)}}
@errors {400, 401}

@endpoint POST /sapi/v1/mining/hash-transfer/config
@required {userName: str, algo: str, toPoolUser: str, hashRate: str, timestamp: int(int64), signature: str}
@optional {startDate: str, endDate: str, recvWindow: int(int64)}
@returns(200) {code: int(int64), msg: str, data: int(int64)}
@errors {400, 401}

@endpoint POST /sapi/v1/mining/hash-transfer/config/cancel
@required {configId: str, userName: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {code: int(int64), msg: str, data: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/mining/statistics/user/status
@required {algo: str, userName: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {code: int(int64), msg: str, data: map{fifteenMinHashRate: str, dayHashRate: str, validNum: int(int64), invalidNum: int(int64), profitToday: map{BTC: str, BSV: str, BCH: str}, profitYesterday: map{BTC: str, BSV: str, BCH: str}, userName: str, unit: str, algo: str}}
@errors {400, 401}

@endpoint GET /sapi/v1/mining/statistics/user/list
@required {algo: str, userName: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {code: int(int64), msg: str, data: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/mining/payment/uid
@required {algo: str, timestamp: int(int64), signature: str}
@optional {startDate: str, endDate: str, pageIndex: int(int32), pageSize: str, recvWindow: int(int64)}
@returns(200) {code: int(int32), msg: str, data: map{accountProfits: [map], totalNum: int(int32), pageSize: int(int32)}}
@errors {400, 401}

@endpoint POST /sapi/v1/futures/transfer
@required {asset: str, amount: num(double), type: int(int64), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {tranId: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/futures/transfer
@required {asset: str, startTime: int(int64), timestamp: int(int64), signature: str}
@optional {endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v1/futures/histDataLink
@required {symbol: str, dataType: str(T_DEPTH/S_DEPTH), timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), recvWindow: int(int64)}
@returns(200) {data: [map]}
@errors {400, 401}

@endpoint POST /sapi/v1/algo/futures/newOrderVp
@required {symbol: str, side: str(SELL/BUY), quantity: num(double), urgency: str(LOW/MEDIUM/HIGH), timestamp: int(int64), signature: str}
@optional {positionSide: str(BOTH/LONG/SHORT), clientAlgoId: str, reduceOnly: bool, limitPrice: num(double), recvWindow: int(int64)}
@returns(200) {clientAlgoId: str, success: bool, code: int(int64), msg: str}
@errors {400, 401}

@endpoint POST /sapi/v1/algo/futures/newOrderTwap
@required {symbol: str, side: str(SELL/BUY), quantity: num(double), duration: int(int64), timestamp: int(int64), signature: str}
@optional {positionSide: str(BOTH/LONG/SHORT), clientAlgoId: str, reduceOnly: bool, limitPrice: num(double), recvWindow: int(int64)}
@returns(200) {clientAlgoId: str, success: bool, code: int(int64), msg: str}
@errors {400, 401}

@endpoint DELETE /sapi/v1/algo/futures/order
@required {algoId: int(int64), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {algoId: int(int64), success: bool, code: int(int64), msg: str}
@errors {400, 401}

@endpoint GET /sapi/v1/algo/futures/openOrders
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {total: int(int32), orders: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/algo/futures/historicalOrders
@required {timestamp: int(int64), signature: str}
@optional {symbol: str, side: str(SELL/BUY), startTime: int(int64), endTime: int(int64), page: int(int32), pageSize: str, recvWindow: int(int64)}
@returns(200) {total: int(int32), orders: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/algo/futures/subOrders
@required {algoId: int(int64), timestamp: int(int64), signature: str}
@optional {page: int(int32), pageSize: str, recvWindow: int(int64)}
@returns(200) {total: int(int32), executedQty: str, executedAmt: str, subOrders: [map]}
@errors {400, 401}

@endpoint POST /sapi/v1/algo/spot/newOrderTwap
@required {symbol: str, side: str(SELL/BUY), quantity: num(double), duration: int(int32), timestamp: int(int64), signature: str}
@optional {clientAlgoId: str, limitPrice: num(float), recvWindow: int(int64)}
@returns(200) {clientAlgoId: str, success: bool, code: int, msg: str}
@errors {400, 401}

@endpoint DELETE /sapi/v1/algo/spot/order
@required {algoId: int(int64), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {algoId: int(int64), success: bool, code: int, msg: str}
@errors {400, 401}

@endpoint GET /sapi/v1/algo/spot/openOrders
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {total: int(int64), orders: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/algo/spot/historicalOrders
@required {symbol: str, side: str(SELL/BUY), timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), page: int(int32), pageSize: str, recvWindow: int(int64)}
@returns(200) {total: int(int64), orders: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/algo/spot/subOrders
@required {algoId: int(int64), timestamp: int(int64), signature: str}
@optional {page: int(int32), pageSize: str, recvWindow: int(int64)}
@returns(200) {total: int(int64), executedQty: str, executedAmt: str, subOrders: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/portfolio/account
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {uniMMR: str, accountEquity: str, actualEquity: str, accountMaintMargin: str, accountStatus: str, accountType: str}
@errors {400, 401}

@endpoint GET /sapi/v1/portfolio/collateralRate
@returns(200)
@errors {400}

@endpoint GET /sapi/v2/portfolio/collateralRate
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/portfolio/pmLoan
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {asset: str, amount: str}
@errors {400, 401}

@endpoint POST /sapi/v1/portfolio/repay
@required {timestamp: int(int64), signature: str}
@optional {from: str, recvWindow: int(int64)}
@returns(200) {tranId: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/portfolio/interest-history
@required {asset: str, timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), size: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/portfolio/asset-index-price
@optional {asset: str}
@returns(200)
@errors {400}

@endpoint POST /sapi/v1/portfolio/auto-collection
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {msg: str}
@errors {400, 401}

@endpoint POST /sapi/v1/portfolio/bnb-transfer
@required {transferSide: str(TO_UM/FROM_UM), amount: num(double), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {tranId: int(int64)}
@errors {400, 401}

@endpoint POST /sapi/v1/portfolio/repay-futures-switch
@required {autoRepay: bool, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {msg: str}
@errors {400, 401}

@endpoint GET /sapi/v1/portfolio/repay-futures-switch
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {autoRepay: bool}
@errors {400, 401}

@endpoint POST /sapi/v1/portfolio/repay-futures-negative-balance
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {msg: str}
@errors {400, 401}

@endpoint GET /sapi/v1/portfolio/margin-asset-leverage
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/portfolio/asset-collection
@required {asset: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {msg: str}
@errors {400, 401}

@endpoint GET /sapi/v1/blvt/tokenInfo
@optional {tokenName: str}
@returns(200)
@errors {400}

@endpoint POST /sapi/v1/blvt/subscribe
@required {tokenName: str, cost: num(double), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {id: int(int64), status: str, tokenName: str, amount: str, cost: str, timestamp: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/blvt/subscribe/record
@required {timestamp: int(int64), signature: str}
@optional {tokenName: str, id: int(int64), startTime: int(int64), endTime: int(int64), limit: int(int32), recvWindow: int(int64)}
@returns(200) {id: int(int64), tokenName: str, amount: str, nav: str, fee: str, totalCharge: str, timestamp: int(int64)}
@errors {400, 401}

@endpoint POST /sapi/v1/blvt/redeem
@required {tokenName: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {id: int(int64), status: str, tokenName: str, redeemAmount: str, amount: str, timestamp: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/blvt/redeem/record
@required {timestamp: int(int64), signature: str}
@optional {tokenName: str, id: int(int64), startTime: int(int64), endTime: int(int64), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/blvt/userLimit
@required {timestamp: int(int64), signature: str}
@optional {tokenName: str, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/c2c/orderMatch/listUserOrderHistory
@required {tradeType: str(BUY/SELL), timestamp: int(int64), signature: str}
@optional {startTimestamp: int(int64), endTimestamp: int(int64), page: int(int32), rows: int(int32), recvWindow: int(int64)}
@returns(200) {code: str, message: str, data: [map], total: int(int32), success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/vip/ongoing/orders
@required {timestamp: int(int64), signature: str}
@optional {orderId: int(int64), collateralAccountId: int(int64), loanCoin: str, collateralCoin: str, current: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint POST /sapi/v1/loan/vip/repay
@required {amount: num(double), timestamp: int(int64), signature: str}
@optional {orderId: int(int64), recvWindow: int(int64)}
@returns(200) {loanCoin: str, repayAmount: str, remainingPrincipal: str, remainingInterest: str, collateralCoin: str, currentLTV: str, repayStatus: str}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/vip/repay/history
@required {timestamp: int(int64), signature: str}
@optional {orderId: int(int64), loanCoin: str, startTime: int(int64), endTime: int(int64), current: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/vip/collateral/account
@required {timestamp: int(int64), signature: str}
@optional {orderId: int(int64), collateralAccountId: int(int64), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint POST /sapi/v1/loan/vip/borrow
@required {loanAccountId: int(int64), loanAmount: num(float), collateralAccountId: str, collateralCoin: str, isFlexibleRate: str(TRUE/FALSE), timestamp: int(int64), signature: str}
@optional {loanCoin: str, loanTerm: int, recvWindow: int(int64)}
@returns(200) {loanAccountId: str, requestId: str, loanCoin: str, isFlexibleRate: str, loanAmount: str, collateralAccountId: str, collateralCoin: str, loanTerm: str}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/vip/loanable/data
@required {timestamp: int(int64), signature: str}
@optional {loanCoin: str, vipLevel: int(int32), recvWindow: int(int64)}
@returns(200) {total: int, rows: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/vip/collateral/data
@required {timestamp: int(int64), signature: str}
@optional {collateralCoin: str, recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/vip/request/data
@required {timestamp: int(int64), signature: str}
@optional {current: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200) {total: int, rows: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/vip/request/interestRate
@required {timestamp: int(int64), signature: str}
@optional {loanCoin: str, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/loan/vip/renew
@required {timestamp: int(int64), signature: str}
@optional {orderId: int(int64), loanTerm: int, recvWindow: int(int64)}
@returns(200) {loanAccountId: str, loanCoin: str, loanAmount: str, collateralAccountId: str, collateralCoin: str, loanTerm: str}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/income
@required {timestamp: int(int64), signature: str}
@optional {asset: str, type: str(borrowIn/collateralSpent/repayAmount/collateralReturn/addCollateral/removeCollateral/collateralReturnAfterLiquidation), startTime: int(int64), endTime: int(int64), limit: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/loan/borrow
@required {loanCoin: str, collateralCoin: str, loanTerm: int(int32), timestamp: int(int64), signature: str}
@optional {loanAmount: num(float), collateralAmount: num(float), recvWindow: int(int64)}
@returns(200) {loanCoin: str, loanAmount: str, collateralCoin: str, collateralAmount: str, hourlyInterestRate: str, orderId: str}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/borrow/history
@required {timestamp: int(int64), signature: str}
@optional {orderId: int(int64), loanCoin: str, collateralCoin: str, startTime: int(int64), endTime: int(int64), current: int(int32), limit: int(int64), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/ongoing/orders
@required {timestamp: int(int64), signature: str}
@optional {orderId: int(int64), loanCoin: str, collateralCoin: str, current: int(int32), limit: int(int64), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint POST /sapi/v1/loan/repay
@required {orderId: int(int64), amount: num(double), timestamp: int(int64), signature: str}
@optional {type: int(int32), collateralReturn: bool, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/loan/repay/history
@required {timestamp: int(int64), signature: str}
@optional {orderId: int(int64), loanCoin: str, collateralCoin: str, startTime: int(int64), endTime: int(int64), current: int(int32), limit: int(int64), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint POST /sapi/v1/loan/adjust/ltv
@required {orderId: int(int64), amount: num(double), direction: str(ADDITIONAL/REDUCED), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {loanCoin: str, collateralCoin: str, direction: str, amount: str, currentLTV: str}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/ltv/adjustment/history
@required {timestamp: int(int64), signature: str}
@optional {orderId: int(int64), loanCoin: str, collateralCoin: str, startTime: int(int64), endTime: int(int64), current: int(int32), limit: int(int64), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/loanable/data
@required {timestamp: int(int64), signature: str}
@optional {loanCoin: str, vipLevel: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/collateral/data
@required {timestamp: int(int64), signature: str}
@optional {collateralCoin: str, vipLevel: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v1/loan/repay/collateral/rate
@required {loanCoin: str, collateralCoin: str, repayAmount: num(float), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {loanCoin: str, collateralCoin: str, repayAmount: str, rate: str}
@errors {400, 401}

@endpoint POST /sapi/v1/loan/customize/margin_call
@required {marginCall: num(float), timestamp: int(int64), signature: str}
@optional {orderId: int(int64), collateralCoin: str, recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint POST /sapi/v2/loan/flexible/borrow
@required {timestamp: int(int64), signature: str}
@optional {loanCoin: str, loanAmount: num(float), collateralCoin: str, collateralAmount: num(float), recvWindow: int(int64)}
@returns(200) {loanCoin: str, loanAmount: str, collateralCoin: str, collateralAmount: str, status: str}
@errors {400, 401}

@endpoint GET /sapi/v2/loan/flexible/ongoing/orders
@required {timestamp: int(int64), signature: str}
@optional {loanCoin: str, collateralCoin: str, current: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200) {total: int(int32), rows: [map]}
@errors {400, 401}

@endpoint GET /sapi/v2/loan/flexible/borrow/history
@required {timestamp: int(int64), signature: str}
@optional {loanCoin: str, collateralCoin: str, startTime: int(int64), endTime: int(int64), current: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200) {total: int, rows: [map]}
@errors {400, 401}

@endpoint POST /sapi/v2/loan/flexible/repay
@required {repayAmount: num(float), timestamp: int(int64), signature: str}
@optional {loanCoin: str, collateralCoin: str, collateralReturn: bool, fullRepayment: bool, recvWindow: int(int64)}
@returns(200) {loanCoin: str, collateralCoin: str, remainingDebt: str, remainingCollateral: str, fullRepayment: bool, currentLTV: str, repayStatus: str}
@errors {400, 401}

@endpoint GET /sapi/v2/loan/flexible/repay/history
@required {timestamp: int(int64), signature: str}
@optional {loanCoin: str, collateralCoin: str, startTime: int(int64), endTime: int(int64), current: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint POST /sapi/v2/loan/flexible/adjust/ltv
@required {adjustmentAmount: num(float), direction: str(ADDITIONAL/REDUCED), timestamp: int(int64), signature: str}
@optional {loanCoin: str, collateralCoin: str, recvWindow: int(int64)}
@returns(200) {loanCoin: str, collateralCoin: str, direction: str, adjustmentAmount: str, currentLTV: str}
@errors {400, 401}

@endpoint GET /sapi/v2/loan/flexible/ltv/adjustment/history
@required {timestamp: int(int64), signature: str}
@optional {loanCoin: str, collateralCoin: str, startTime: int(int64), endTime: int(int64), current: int(int32), limit: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v2/loan/flexible/loanable/data
@required {timestamp: int(int64), signature: str}
@optional {loanCoin: str, recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v2/loan/flexible/collateral/data
@required {timestamp: int(int64), signature: str}
@optional {collateralCoin: str, recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v1/pay/transactions
@required {timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), limit: int(int32), recvWindow: int(int64)}
@returns(200) {code: str, message: str, data: [map], success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/convert/exchangeInfo
@optional {fromAsset: str, toAsset: str}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/convert/assetInfo
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v1/convert/getQuote
@required {fromAsset: str, toAsset: str, timestamp: int(int64), signature: str}
@optional {fromAmount: num(float), toAmount: num(float), validTime: str, walletType: str, recvWindow: int(int64)}
@returns(200) {quoteId: str, ratio: str, inverseRatio: str, validTimestamp: int(int64), toAmount: str, fromAmount: str}
@errors {400, 401}

@endpoint POST /sapi/v1/convert/acceptQuote
@required {quoteId: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {orderId: str, createTime: int(int64), orderStatus: str}
@errors {400, 401}

@endpoint GET /sapi/v1/convert/orderStatus
@required {timestamp: int(int64), signature: str}
@optional {orderId: str, quoteId: str, recvWindow: int(int64)}
@returns(200) {orderId: int(int64), orderStatus: str, fromAsset: str, fromAmount: str, toAsset: str, toAmount: str, ratio: str, inverseRatio: str, createTime: int(int64)}
@errors {400, 401}

@endpoint POST /sapi/v1/convert/limit/placeOrder
@required {baseAsset: str, quoteAsset: str, limitPrice: num(double), side: str(SELL/BUY), timestamp: int(int64), signature: str}
@optional {baseAmount: num(double), quoteAmount: num(double), walletType: str(SPOT/FUNDING/SPOT_FUNDING), expiredType: str(1_D/3_D/7_D/30_D), recvWindow: int(int64)}
@returns(200) {orderId: int(int64), status: str}
@errors {400, 401}

@endpoint POST /sapi/v1/convert/limit/cancelOrder
@required {orderId: int(int64), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {orderId: int(int64), status: str}
@errors {400, 401}

@endpoint GET /sapi/v1/convert/limit/queryOpenOrders
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {list: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/convert/tradeFlow
@required {startTime: int(int64), endTime: int(int64), timestamp: int(int64), signature: str}
@optional {limit: int(int32), recvWindow: int(int64)}
@returns(200) {list: [map], startTime: int(int64), endTime: int(int64), limit: int(int32), moreData: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/rebate/taxQuery
@required {timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), page: int(int32), recvWindow: int(int64)}
@returns(200) {status: str, type: str, code: str, data: map{page: int(int32), totalRecords: int(int32), totalPageNum: int(int32), data: [map]}}
@errors {400, 401}

@endpoint GET /sapi/v1/nft/history/transactions
@required {orderType: int(int32), timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), limit: int(int32), page: int(int32), recvWindow: int(int64)}
@returns(200) {total: int(int32), list: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/nft/history/deposit
@required {timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), limit: int(int32), page: int(int32), recvWindow: int(int64)}
@returns(200) {total: int(int32), list: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/nft/history/withdraw
@required {timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), limit: int(int32), page: int(int32), recvWindow: int(int64)}
@returns(200) {total: int(int32), list: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/nft/user/getAsset
@required {timestamp: int(int64), signature: str}
@optional {limit: int(int32), page: int(int32), recvWindow: int(int64)}
@returns(200) {total: int(int32), list: [map]}
@errors {400, 401}

@endpoint POST /sapi/v1/giftcard/createCode
@required {token: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {code: str, message: str, data: map{referenceNo: str, code: str, expiredTime: int(int64)}, success: bool}
@errors {400, 401}

@endpoint POST /sapi/v1/giftcard/redeemCode
@required {code: str, timestamp: int(int64), signature: str}
@optional {externalUid: str, recvWindow: int(int64)}
@returns(200) {code: str, message: str, data: map{token: str, amount: str, referenceNo: str, identityNo: str}, success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/giftcard/verify
@required {referenceNo: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {code: str, message: str, data: map{valid: bool, token: str, amount: str}, success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/giftcard/cryptography/rsa-public-key
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {code: str, message: str, data: str, success: bool}
@errors {400, 401}

@endpoint POST /sapi/v1/giftcard/buyCode
@required {baseToken: str, faceToken: str, baseTokenAmount: num(double), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {code: str, message: str, data: map{referenceNo: str, code: str, expiredTime: int(int64)}, success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/giftcard/buyCode/token-limit
@required {baseToken: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {code: str, message: str, data: map{coin: str, fromMin: str, fromMax: str}, success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/lending/auto-invest/target-asset/list
@required {timestamp: int(int64), signature: str}
@optional {targetAsset: str, size: int(int32), current: int(int32), recvWindow: int(int64)}
@returns(200) {targetAssets: str, autoInvestAssetList: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/lending/auto-invest/target-asset/roi/list
@required {targetAsset: str, hisRoiType: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/lending/auto-invest/all/asset
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {targetAssets: [str], sourceAssets: [str]}
@errors {400, 401}

@endpoint GET /sapi/v1/lending/auto-invest/source-asset/list
@required {usageType: str, timestamp: int(int64), signature: str}
@optional {targetAsset: str, indexId: int(int64), flexibleAllowedToUse: bool, recvWindow: int(int64)}
@returns(200) {feeRate: str, sourceAssets: [map]}
@errors {400, 401}

@endpoint POST /sapi/v1/lending/auto-invest/plan/add
@required {sourceType: str(MAIN_SITE/TR), planType: str(SINGLE/PORTFOLIO/INDEX), subscriptionAmount: num(float), subscriptionCycle: str(H1/H4/H8/H12/WEEKLY/DAILY/MONTHLY/BI_WEEKLY), subscriptionStartTime: int, sourceAsset: str, details: [map], timestamp: int(int64), signature: str}
@optional {requestId: str, IndexId: int(int64), subscriptionStartDay: int, subscriptionStartWeekday: str(MON/TUE/WED/THU/FRI/SAT/SUN), flexibleAllowedToUse: bool, recvWindow: int(int64)}
@returns(200) {planId: int, nextExecutionDateTime: int(int64)}
@errors {400, 401}

@endpoint POST /sapi/v1/lending/auto-invest/plan/edit
@required {planId: int, subscriptionAmount: num(float), subscriptionCycle: str(H1/H4/H8/H12/WEEKLY/DAILY/MONTHLY/BI_WEEKLY), subscriptionStartTime: int, sourceAsset: str, timestamp: int(int64), signature: str}
@optional {subscriptionStartDay: int, subscriptionStartWeekday: str(MON/TUE/WED/THU/FRI/SAT/SUN), flexibleAllowedToUse: bool, details: [map], recvWindow: int(int64)}
@returns(200) {planId: int, nextExecutionDateTime: int(int64)}
@errors {400, 401}

@endpoint POST /sapi/v1/lending/auto-invest/plan/edit-status
@required {planId: int, status: str(ONGOING/PAUSED/REMOVED), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {planId: int, nextExecutionDateTime: int(int64), status: str}
@errors {400, 401}

@endpoint GET /sapi/v1/lending/auto-invest/plan/list
@required {planType: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {planValueInUSD: str, planValueInBTC: str, pnlInUSD: str, roi: str, plan: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/lending/auto-invest/plan/id
@required {timestamp: int(int64), signature: str}
@optional {planId: int(int64), requestId: str, recvWindow: int(int64)}
@returns(200) {planValueInUSD: str, planValueInBTC: str, pnlInUSD: str, roi: str, plan: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/lending/auto-invest/history/list
@required {timestamp: int(int64), signature: str}
@optional {planId: int(int64), startTime: int(int64), endTime: int(int64), targetAsset: num(int64), planType: str(SINGLE/PORTFOLIO/INDEX/ALL), size: int(int32), current: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/lending/auto-invest/index/info
@required {indexId: int(int64), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {indexId: int(int64), indexName: str, status: str, assetAllocation: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/lending/auto-invest/index/user-summary
@required {indexId: int(int64), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {indexId: int(int64), totalInvestedInUSD: str, currentInvestedInUSD: str, pnlInUSD: str, roi: str, assetAllocation: [map], details: [map]}
@errors {400, 401}

@endpoint POST /sapi/v1/lending/auto-invest/one-off
@required {sourceType: str, subscriptionAmount: num(float), sourceAsset: str, timestamp: int(int64), signature: str}
@optional {requestId: str, flexibleAllowedToUse: bool, planId: int(int64), indexId: int(int64), details: [map], recvWindow: int(int64)}
@returns(200) {transactionId: int(int64), waitSecond: int(int32)}
@errors {400, 401}

@endpoint GET /sapi/v1/lending/auto-invest/one-off/status
@required {transactionId: int(int64), timestamp: int(int64), signature: str}
@optional {requestId: str, recvWindow: int(int64)}
@returns(200) {transactionId: int(int64), status: str}
@errors {400, 401}

@endpoint POST /sapi/v1/lending/auto-invest/redeem
@required {indexId: int(int64), redemptionPercentage: int, timestamp: int(int64), signature: str}
@optional {requestId: str, recvWindow: int(int64)}
@returns(200) {redemptionId: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/lending/auto-invest/redeem/history
@required {requestId: int(int64), timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), current: int(int32), asset: str, size: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/lending/auto-invest/rebalance/history
@required {timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint POST /sapi/v2/eth-staking/eth/stake
@required {amount: num(double), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {success: bool, wbethAmount: str, conversionRatio: str}
@errors {400, 401}

@endpoint POST /sapi/v1/eth-staking/eth/redeem
@required {amount: num(double), timestamp: int(int64), signature: str}
@optional {asset: str, recvWindow: int(int64)}
@returns(200) {success: bool, arrivalTime: int(int64), ethAmount: str, conversionRatio: str}
@errors {400, 401}

@endpoint GET /sapi/v1/eth-staking/eth/history/stakingHistory
@required {timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/eth-staking/eth/history/redemptionHistory
@required {timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/eth-staking/eth/history/rewardsHistory
@required {timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/eth-staking/eth/quota
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {leftStakingPersonalQuota: str, leftRedemptionPersonalQuota: str}
@errors {400, 401}

@endpoint GET /sapi/v1/eth-staking/eth/history/rateHistory
@required {timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v2/eth-staking/account
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {holdingInETH: str, holdings: map{wbethAmount: str, bethAmount: str}, thirtyDaysProfitInETH: str, profit: map{amountFromWBETH: str, amountFromBETH: str}}
@errors {400, 401}

@endpoint POST /sapi/v1/eth-staking/wbeth/wrap
@required {amount: num(double), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {success: bool, wbethAmount: str, exchangeRate: str}
@errors {400, 401}

@endpoint GET /sapi/v1/eth-staking/wbeth/history/wrapHistory
@required {timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/eth-staking/wbeth/history/unwrapHistory
@required {timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/eth-staking/eth/history/wbethRewardsHistory
@required {timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {estRewardsInETH: str, rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/copyTrading/futures/userStatus
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {code: str, message: str, data: map{isLeadTrader: bool, time: int(int64)}, success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/copyTrading/futures/leadSymbol
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {code: str, message: str, data: map{symbol: str, baseAsset: str, quoteAsset: str}}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/flexible/list
@required {timestamp: int(int64), signature: str}
@optional {asset: str, current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/locked/list
@required {timestamp: int(int64), signature: str}
@optional {asset: str, current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint POST /sapi/v1/simple-earn/flexible/subscribe
@required {productId: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {autoSubscribe: bool, sourceAccount: str, recvWindow: int(int64)}
@returns(200) {purchaseId: int(int64), success: bool}
@errors {400, 401}

@endpoint POST /sapi/v1/simple-earn/locked/subscribe
@required {projectId: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {autoSubscribe: bool, sourceAccount: str, redeemTo: str(SPOT/FLEXIBLE), recvWindow: int(int64)}
@returns(200) {purchaseId: int(int64), positionId: str, success: bool}
@errors {400, 401}

@endpoint POST /sapi/v1/simple-earn/flexible/redeem
@required {productId: str, timestamp: int(int64), signature: str}
@optional {redeemAll: bool, amount: num(double), destAccount: str, recvWindow: int(int64)}
@returns(200) {redeemId: int(int64), success: bool}
@errors {400, 401}

@endpoint POST /sapi/v1/simple-earn/locked/redeem
@required {positionId: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {redeemId: int(int64), success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/flexible/position
@required {timestamp: int(int64), signature: str}
@optional {asset: str, productId: str, current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/locked/position
@required {timestamp: int(int64), signature: str}
@optional {asset: str, positionId: str, projectId: str, current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/account
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {totalAmountInBTC: str, totalAmountInUSDT: str, totalFlexibleAmountInBTC: str, totalFlexibleAmountInUSDT: str, totalLockedInBTC: str, totalLockedInUSDT: str}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/flexible/history/subscriptionRecord
@required {timestamp: int(int64), signature: str}
@optional {productId: str, purchaseId: str, asset: str, startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/locked/history/subscriptionRecord
@required {timestamp: int(int64), signature: str}
@optional {purchaseId: str, asset: str, startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/flexible/history/redemptionRecord
@optional {productId: str, redeemId: str, asset: str, startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/locked/history/redemptionRecord
@required {timestamp: int(int64), signature: str}
@optional {positionId: str, redeemId: str, asset: str, startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/flexible/history/rewardsRecord
@required {type: str}
@optional {productId: str, asset: str, startTime: int(int64), endTime: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/locked/history/rewardsRecord
@required {timestamp: int(int64), signature: str}
@optional {positionId: str, asset: str, startTime: int(int64), endTime: int(int64), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint POST /sapi/v1/simple-earn/flexible/setAutoSubscribe
@required {productId: str, autoSubscribe: bool, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {success: bool}
@errors {400, 401}

@endpoint POST /sapi/v1/simple-earn/locked/setAutoSubscribe
@required {positionId: str, autoSubscribe: bool, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/flexible/personalLeftQuota
@required {productId: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {leftPersonalQuota: str}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/locked/personalLeftQuota
@required {projectId: str, timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {leftPersonalQuota: str}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/flexible/subscriptionPreview
@required {productId: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {totalAmount: str, rewardAsset: str, airDropAsset: str, estDailyBonusRewards: str, estDailyRealTimeRewards: str, estDailyAirdropRewards: str}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/locked/subscriptionPreview
@required {projectId: str, amount: num(double), timestamp: int(int64), signature: str}
@optional {autoSubscribe: bool, recvWindow: int(int64)}
@returns(200)
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/locked/setRedeemOption
@required {positionId: str, timestamp: int(int64), signature: str}
@optional {redeemTo: str(SPOT/FLEXIBLE), recvWindow: int(int64)}
@returns(200) {success: bool}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/flexible/history/rateHistory
@required {productId: str, timestamp: int(int64), signature: str}
@optional {startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/simple-earn/flexible/history/collateralRecord
@required {timestamp: int(int64), signature: str}
@optional {productId: str, startTime: int(int64), endTime: int(int64), current: int(int32), size: int(int32), recvWindow: int(int64)}
@returns(200) {rows: [map], total: int(int64)}
@errors {400, 401}

@endpoint GET /sapi/v1/dci/product/list
@required {optionType: str(CALL/PUT), exercisedCoin: str, investCoin: str, timestamp: int(int64), signature: str}
@optional {pageSize: str, pageIndex: int(int32), recvWindow: int(int64)}
@returns(200) {total: int(int64), list: [map]}
@errors {400, 401}

@endpoint POST /sapi/v1/dci/product/subscribe
@required {id: str, orderId: str, depositAmount: num(double), autoCompoundPlan: str(NONE/STANDARD/ADVANCE), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {positionId: int(int64), investCoin: str, exercisedCoin: str, subscriptionAmount: str, duration: int(int32), autoCompoundPlan: str, strikePrice: str, settleDate: int(int64), purchaseStatus: str, apr: str, orderId: int(int64), purchaseTime: int(int64), optionType": str}
@errors {400, 401}

@endpoint GET /sapi/v1/dci/product/positions
@required {timestamp: int(int64), signature: str}
@optional {status: str(PENDING/PURCHASE_SUCCESS/SETTLED/PURCHASE_FAIL/REFUNDING/REFUND_SUCCESS/SETTLING), pageSize: str, pageIndex: int(int32), recvWindow: int(int64)}
@returns(200) {total: int(int64), list: [map]}
@errors {400, 401}

@endpoint GET /sapi/v1/dci/product/accounts
@required {timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {totalAmountInBTC: str, totalAmountInUSDT: str}
@errors {400, 401}

@endpoint POST /sapi/v1/dci/product/auto_compound/edit-status
@required {positionId: int(int64), autoCompoundPlan: str(NONE/STANDARD/ADVANCE), timestamp: int(int64), signature: str}
@optional {recvWindow: int(int64)}
@returns(200) {positionId: str, autoCompoundPlan: str}
@errors {400, 401}

@endgroup

@end
