# 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 `orderId` is set, it will get orders >= that `orderId`. Otherwise most recent orders are returned. - For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. - If `startTime` and/or `endTime` provided, `orderId` is not required Weight(IP): 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 `fromId` is set, it will get id >= that `fromId`. 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):\\ `3` for a single symbol;\\ `40` 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 `orderId` or `origClientOrderId` 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's status. - Either `orderId` or `origClientOrderId` must be sent. - For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. Weight(IP): 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: - `SELL`: Limit Price > Last Price > Stop Price - `BUY`: Limit Price < Last Price < Stop Price - Quantity Restrictions: - Both legs must have the same quantity - `ICEBERG` quantities however do not have to be the same - Order Rate Limit - `OCO` counts as 2 orders against the order rate limit. Weight(IP): 1
# @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. - `LIMIT_MAKER` are `LIMIT` orders that will be rejected if they would immediately match and trade as a taker. - `STOP_LOSS` and `TAKE_PROFIT` will execute a `MARKET` order when the `stopPrice` is reached. - Any `LIMIT` or `LIMIT_MAKER` type order can be made an iceberg order by sending an `icebergQty`. - Any order with an `icebergQty` MUST have `timeInForce` set to `GTC`. - `MARKET` orders using `quantity` specifies how much a user wants to buy or sell based on the market price. - `MARKET` orders using `quoteOrderQty` specifies the amount the user wants to spend (when buying) or receive (when selling) of the quote asset; the correct quantity will be determined based on the market liquidity and `quoteOrderQty`. - `MARKET` orders using `quoteOrderQty` will not break `LOT_SIZE` filter rules; the order will execute a quantity that will have the notional value as close as possible to `quoteOrderQty`. - same `newClientOrderId` can be accepted only when the previous one is filled, otherwise the order will be rejected. Trigger order price rules against market price for both `MARKET` and `LIMIT` versions: - Price above market price: `STOP_LOSS` `BUY`, `TAKE_PROFIT` `SELL` - Price below market price: `STOP_LOSS` `SELL`, `TAKE_PROFIT` `BUY` Weight(IP): 1
# @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'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")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.