tests/testthat/test_trade_api.R

# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate

context("Test TradeApi")

api.instance <- TradeApi$new()

test_that("ApiV3AccountGet", {
  # tests for ApiV3AccountGet
  # base path: https://api.binance.com
  # Account Information (USER_DATA)
  # Get current account information.  Weight(IP): 10
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [Account]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3AllOrderListGet", {
  # tests for ApiV3AllOrderListGet
  # base path: https://api.binance.com
  # Query all OCO (USER_DATA)
  # Retrieves all OCO based on provided optional parameters  Weight(IP): 10
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param from.id integer Trade id to fetch from. Default gets most recent trades. (optional)
  # @param start.time integer UTC timestamp in ms (optional)
  # @param end.time integer UTC timestamp in ms (optional)
  # @param limit integer Default 500; max 1000. (optional)
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [array[InlineResponse2006]]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3AllOrdersGet", {
  # tests for ApiV3AllOrdersGet
  # base path: https://api.binance.com
  # All Orders (USER_DATA)
  # Get all account orders; active, canceled, or filled..  - If &#x60;orderId&#x60; is set, it will get orders &gt;&#x3D; that &#x60;orderId&#x60;. Otherwise most recent orders are returned. - For some historical orders &#x60;cummulativeQuoteQty&#x60; will be &lt; 0, meaning the data is not available at this time. - If &#x60;startTime&#x60; and/or &#x60;endTime&#x60; provided, &#x60;orderId&#x60; is not required  Weight(IP): 10
  # @param symbol character Trading symbol, e.g. BNBUSDT
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param order.id integer Order id (optional)
  # @param start.time integer UTC timestamp in ms (optional)
  # @param end.time integer UTC timestamp in ms (optional)
  # @param limit integer Default 500; max 1000. (optional)
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [array[OrderDetails]]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3MyTradesGet", {
  # tests for ApiV3MyTradesGet
  # base path: https://api.binance.com
  # Account Trade List (USER_DATA)
  # Get trades for a specific account and symbol.  If &#x60;fromId&#x60; is set, it will get id &gt;&#x3D; that &#x60;fromId&#x60;. Otherwise most recent orders are returned.  Weight(IP): 10
  # @param symbol character Trading symbol, e.g. BNBUSDT
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param order.id integer This can only be used in combination with symbol. (optional)
  # @param start.time integer UTC timestamp in ms (optional)
  # @param end.time integer UTC timestamp in ms (optional)
  # @param from.id integer Trade id to fetch from. Default gets most recent trades. (optional)
  # @param limit integer Default 500; max 1000. (optional)
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [array[MyTrade]]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3OpenOrderListGet", {
  # tests for ApiV3OpenOrderListGet
  # base path: https://api.binance.com
  # Query Open OCO (USER_DATA)
  # Weight(IP): 3
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [array[InlineResponse2007]]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3OpenOrdersDelete", {
  # tests for ApiV3OpenOrdersDelete
  # base path: https://api.binance.com
  # Cancel all Open Orders on a Symbol (TRADE)
  # Cancels all active orders on a symbol.\\ This includes OCO orders.  Weight(IP): 1
  # @param symbol character Trading symbol, e.g. BNBUSDT
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [array[AnyOforderocoOrder]]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3OpenOrdersGet", {
  # tests for ApiV3OpenOrdersGet
  # base path: https://api.binance.com
  # Current Open Orders (USER_DATA)
  # Get all open orders on a symbol. Careful when accessing this with no symbol.  Weight(IP):\\ &#x60;3&#x60; for a single symbol;\\ &#x60;40&#x60; when the symbol parameter is omitted;
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param symbol character Trading symbol, e.g. BNBUSDT (optional)
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [array[OrderDetails]]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3OrderDelete", {
  # tests for ApiV3OrderDelete
  # base path: https://api.binance.com
  # Cancel Order (TRADE)
  # Cancel an active order.  Either &#x60;orderId&#x60; or &#x60;origClientOrderId&#x60; must be sent.  Weight(IP): 1
  # @param symbol character Trading symbol, e.g. BNBUSDT
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param order.id integer Order id (optional)
  # @param orig.client.order.id character Order id from client (optional)
  # @param new.client.order.id character Used to uniquely identify this cancel. Automatically generated by default (optional)
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [Order]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3OrderGet", {
  # tests for ApiV3OrderGet
  # base path: https://api.binance.com
  # Query Order (USER_DATA)
  # Check an order&#39;s status.  - Either &#x60;orderId&#x60; or &#x60;origClientOrderId&#x60; must be sent. - For some historical orders &#x60;cummulativeQuoteQty&#x60; will be &lt; 0, meaning the data is not available at this time.  Weight(IP): 2
  # @param symbol character Trading symbol, e.g. BNBUSDT
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param order.id integer Order id (optional)
  # @param orig.client.order.id character Order id from client (optional)
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [OrderDetails]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3OrderListDelete", {
  # tests for ApiV3OrderListDelete
  # base path: https://api.binance.com
  # Cancel OCO (TRADE)
  # Cancel an entire Order List  Canceling an individual leg will cancel the entire OCO  Weight(IP): 1
  # @param symbol character Trading symbol, e.g. BNBUSDT
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param order.list.id integer Order list id (optional)
  # @param list.client.order.id character A unique Id for the entire orderList (optional)
  # @param new.client.order.id character Used to uniquely identify this cancel. Automatically generated by default (optional)
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [OcoOrder]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3OrderListGet", {
  # tests for ApiV3OrderListGet
  # base path: https://api.binance.com
  # Query OCO (USER_DATA)
  # Retrieves a specific OCO based on provided optional parameters  Weight(IP): 2
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param order.list.id integer Order list id (optional)
  # @param orig.client.order.id character Order id from client (optional)
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [InlineResponse2005]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3OrderOcoPost", {
  # tests for ApiV3OrderOcoPost
  # base path: https://api.binance.com
  # New OCO (TRADE)
  # Send in a new OCO  - Price Restrictions:   - &#x60;SELL&#x60;: Limit Price &gt; Last Price &gt; Stop Price   - &#x60;BUY&#x60;: Limit Price &lt; Last Price &lt; Stop Price - Quantity Restrictions:     - Both legs must have the same quantity     - &#x60;ICEBERG&#x60; quantities however do not have to be the same - Order Rate Limit     - &#x60;OCO&#x60; counts as 2 orders against the order rate limit.      Weight(IP): 1
  # @param symbol character Trading symbol, e.g. BNBUSDT
  # @param side character SELL or BUY
  # @param quantity numeric 
  # @param price numeric Order price
  # @param stop.price numeric 
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param list.client.order.id character A unique Id for the entire orderList (optional)
  # @param limit.client.order.id character A unique Id for the limit order (optional)
  # @param limit.iceberg.qty numeric  (optional)
  # @param stop.client.order.id character A unique Id for the stop loss/stop loss limit leg (optional)
  # @param stop.limit.price numeric If provided, stopLimitTimeInForce is required. (optional)
  # @param stop.iceberg.qty numeric  (optional)
  # @param stop.limit.time.in.force character  (optional)
  # @param new.order.resp.type character Set the response JSON. (optional)
  # @param side.effect.type character Default NO_SIDE_EFFECT (optional)
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [InlineResponse2004]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3OrderPost", {
  # tests for ApiV3OrderPost
  # base path: https://api.binance.com
  # New Order (TRADE)
  # Send in a new order.  - &#x60;LIMIT_MAKER&#x60; are &#x60;LIMIT&#x60; orders that will be rejected if they would immediately match and trade as a taker. - &#x60;STOP_LOSS&#x60; and &#x60;TAKE_PROFIT&#x60; will execute a &#x60;MARKET&#x60; order when the &#x60;stopPrice&#x60; is reached. - Any &#x60;LIMIT&#x60; or &#x60;LIMIT_MAKER&#x60; type order can be made an iceberg order by sending an &#x60;icebergQty&#x60;. - Any order with an &#x60;icebergQty&#x60; MUST have &#x60;timeInForce&#x60; set to &#x60;GTC&#x60;. - &#x60;MARKET&#x60; orders using &#x60;quantity&#x60; specifies how much a user wants to buy or sell based on the market price. - &#x60;MARKET&#x60; orders using &#x60;quoteOrderQty&#x60; specifies the amount the user wants to spend (when buying) or receive (when selling) of the quote asset; the correct quantity will be determined based on the market liquidity and &#x60;quoteOrderQty&#x60;. - &#x60;MARKET&#x60; orders using &#x60;quoteOrderQty&#x60; will not break &#x60;LOT_SIZE&#x60; filter rules; the order will execute a quantity that will have the notional value as close as possible to &#x60;quoteOrderQty&#x60;. - same &#x60;newClientOrderId&#x60; can be accepted only when the previous one is filled, otherwise the order will be rejected.  Trigger order price rules against market price for both &#x60;MARKET&#x60; and &#x60;LIMIT&#x60; versions:  - Price above market price: &#x60;STOP_LOSS&#x60; &#x60;BUY&#x60;, &#x60;TAKE_PROFIT&#x60; &#x60;SELL&#x60; - Price below market price: &#x60;STOP_LOSS&#x60; &#x60;SELL&#x60;, &#x60;TAKE_PROFIT&#x60; &#x60;BUY&#x60;   Weight(IP): 1
  # @param symbol character Trading symbol, e.g. BNBUSDT
  # @param side character SELL or BUY
  # @param type character Order type
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param time.in.force character Order time in force (optional)
  # @param quantity numeric Order quantity (optional)
  # @param quote.order.qty numeric Quote quantity (optional)
  # @param price numeric Order price (optional)
  # @param new.client.order.id character Used to uniquely identify this cancel. Automatically generated by default (optional)
  # @param stop.price numeric Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders. (optional)
  # @param iceberg.qty numeric Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order. (optional)
  # @param new.order.resp.type character Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK. (optional)
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [OneOforderResponseAckorderResponseResultorderResponseFull]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3OrderTestPost", {
  # tests for ApiV3OrderTestPost
  # base path: https://api.binance.com
  # Test New Order (TRADE)
  # Test new order creation and signature/recvWindow long. Creates and validates a new order but does not send it into the matching engine.  Weight(IP): 1
  # @param symbol character Trading symbol, e.g. BNBUSDT
  # @param side character SELL or BUY
  # @param type character Order type
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param time.in.force character Order time in force (optional)
  # @param quantity numeric Order quantity (optional)
  # @param quote.order.qty numeric Quote quantity (optional)
  # @param price numeric Order price (optional)
  # @param new.client.order.id character Used to uniquely identify this cancel. Automatically generated by default (optional)
  # @param stop.price numeric Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders. (optional)
  # @param iceberg.qty numeric Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order. (optional)
  # @param new.order.resp.type character Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK. (optional)
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [object]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})

test_that("ApiV3RateLimitOrderGet", {
  # tests for ApiV3RateLimitOrderGet
  # base path: https://api.binance.com
  # Query Current Order Count Usage (TRADE)
  # Displays the user&#39;s current order count usage for all intervals.  Weight(IP): 20
  # @param timestamp integer UTC timestamp in ms
  # @param signature character Signature
  # @param recv.window integer The value cannot be greater than 60000 (optional)
  # @return [array[InlineResponse2008]]

  # uncomment below to test the operation
  #expect_equal(result, "EXPECTED_RESULT")
})
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.