# Binance Public Spot API
#
# OpenAPI Specifications for the Binance Public Spot API API documents: - [https://github.com/binance/binance-spot-api-docs](https://github.com/binance/binance-spot-api-docs) - [https://binance-docs.github.io/apidocs/spot/en](https://binance-docs.github.io/apidocs/spot/en)
#
# The version of the OpenAPI document: 1.0
#
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title C2C operations
#' @description binanceRapi.C2C
#' @format An \code{R6Class} generator object
#' @field apiClient Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ SapiV1C2cOrderMatchListUserOrderHistoryGet } \emph{ Get C2C Trade History (USER_DATA) }
#' - If startTimestamp and endTimestamp are not sent, the recent 30-day data will be returned. - The max interval between startTimestamp and endTimestamp is 30 days. Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } trade.type Enum < [BUY, SELL] >
#' \item \emph{ @param } start.timestamp integer
#' \item \emph{ @param } end.timestamp integer
#' \item \emph{ @param } page integer
#' \item \emph{ @param } rows integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse200132} \cr
#'
#'
#' \item status code : 200 | Trades history
#'
#' \item return type : InlineResponse200132
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### SapiV1C2cOrderMatchListUserOrderHistoryGet ####################
#'
#' library(binanceRapi)
#' var.trade.type <- 'trade.type_example' # character |
#' var.start.timestamp <- 56 # integer | UTC timestamp in ms
#' var.end.timestamp <- 56 # integer | UTC timestamp in ms
#' var.page <- 1 # integer | Default 1
#' var.rows <- 56 # integer | default 100, max 100
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Get C2C Trade History (USER_DATA)
#' api.instance <- C2CApi$new()
#'
#' result <- api.instance$SapiV1C2cOrderMatchListUserOrderHistoryGet(trade.type=var.trade.type, start.timestamp=var.start.timestamp, end.timestamp=var.end.timestamp, page=var.page, rows=var.rows, recv.window=var.recv.window)
#'
#'
#' }
#' @importFrom R6 R6Class
#' @importFrom base64enc base64encode
#' @export
C2CApi <- R6::R6Class(
'C2CApi',
public = list(
apiClient = NULL,
initialize = function(apiClient){
if (!missing(apiClient)) {
self$apiClient <- apiClient
}
else {
self$apiClient <- ApiClient$new()
}
},
SapiV1C2cOrderMatchListUserOrderHistoryGet = function(trade.type, start.timestamp=NULL, end.timestamp=NULL, page=NULL, rows=NULL, recv.window=NULL, ...){
apiResponse <- self$SapiV1C2cOrderMatchListUserOrderHistoryGetWithHttpInfo(trade.type, start.timestamp, end.timestamp, page, rows, recv.window, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
SapiV1C2cOrderMatchListUserOrderHistoryGetWithHttpInfo = function(trade.type, start.timestamp=NULL,
end.timestamp=NULL, page=NULL, rows=NULL,
recv.window=NULL, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`trade.type`)) {
stop("Missing required parameter `trade.type`.")
}
queryParams['tradeType'] <- trade.type
queryParams['startTimestamp'] <- start.timestamp
queryParams['endTimestamp'] <- end.timestamp
queryParams['page'] <- page
queryParams['rows'] <- rows
queryParams['recvWindow'] <- recv.window
queryParams['timestamp'] <- self$apiClient$Timestamp
queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)
body <- NULL
urlPath <- "/sapi/v1/c2c/orderMatch/listUserOrderHistory"
# API key authentication
if (nchar(self$apiClient$credentials$key) > 0) {
headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "InlineResponse200132", loadNamespace("binanceRapi")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.