# 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 BookTicker
#'
#' @description BookTicker Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field symbol character
#'
#' @field bidPrice character
#'
#' @field bidQty character
#'
#' @field askPrice character
#'
#' @field askQty character
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
BookTicker <- R6::R6Class(
'BookTicker',
public = list(
`symbol` = NULL,
`bidPrice` = NULL,
`bidQty` = NULL,
`askPrice` = NULL,
`askQty` = NULL,
initialize = function(
`symbol`, `bidPrice`, `bidQty`, `askPrice`, `askQty`, ...
) {
local.optional.var <- list(...)
if (!missing(`symbol`)) {
stopifnot(is.character(`symbol`), length(`symbol`) == 1)
self$`symbol` <- `symbol`
}
if (!missing(`bidPrice`)) {
stopifnot(is.character(`bidPrice`), length(`bidPrice`) == 1)
self$`bidPrice` <- `bidPrice`
}
if (!missing(`bidQty`)) {
stopifnot(is.character(`bidQty`), length(`bidQty`) == 1)
self$`bidQty` <- `bidQty`
}
if (!missing(`askPrice`)) {
stopifnot(is.character(`askPrice`), length(`askPrice`) == 1)
self$`askPrice` <- `askPrice`
}
if (!missing(`askQty`)) {
stopifnot(is.character(`askQty`), length(`askQty`) == 1)
self$`askQty` <- `askQty`
}
},
toJSON = function() {
BookTickerObject <- list()
if (!is.null(self$`symbol`)) {
BookTickerObject[['symbol']] <-
self$`symbol`
}
if (!is.null(self$`bidPrice`)) {
BookTickerObject[['bidPrice']] <-
self$`bidPrice`
}
if (!is.null(self$`bidQty`)) {
BookTickerObject[['bidQty']] <-
self$`bidQty`
}
if (!is.null(self$`askPrice`)) {
BookTickerObject[['askPrice']] <-
self$`askPrice`
}
if (!is.null(self$`askQty`)) {
BookTickerObject[['askQty']] <-
self$`askQty`
}
BookTickerObject
},
fromJSON = function(BookTickerJson) {
BookTickerObject <- jsonlite::fromJSON(BookTickerJson)
if (!is.null(BookTickerObject$`symbol`)) {
self$`symbol` <- BookTickerObject$`symbol`
}
if (!is.null(BookTickerObject$`bidPrice`)) {
self$`bidPrice` <- BookTickerObject$`bidPrice`
}
if (!is.null(BookTickerObject$`bidQty`)) {
self$`bidQty` <- BookTickerObject$`bidQty`
}
if (!is.null(BookTickerObject$`askPrice`)) {
self$`askPrice` <- BookTickerObject$`askPrice`
}
if (!is.null(BookTickerObject$`askQty`)) {
self$`askQty` <- BookTickerObject$`askQty`
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`symbol`)) {
sprintf(
'"symbol":
"%s"
',
self$`symbol`
)},
if (!is.null(self$`bidPrice`)) {
sprintf(
'"bidPrice":
"%s"
',
self$`bidPrice`
)},
if (!is.null(self$`bidQty`)) {
sprintf(
'"bidQty":
"%s"
',
self$`bidQty`
)},
if (!is.null(self$`askPrice`)) {
sprintf(
'"askPrice":
"%s"
',
self$`askPrice`
)},
if (!is.null(self$`askQty`)) {
sprintf(
'"askQty":
"%s"
',
self$`askQty`
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(BookTickerJson) {
BookTickerObject <- jsonlite::fromJSON(BookTickerJson)
self$`symbol` <- BookTickerObject$`symbol`
self$`bidPrice` <- BookTickerObject$`bidPrice`
self$`bidQty` <- BookTickerObject$`bidQty`
self$`askPrice` <- BookTickerObject$`askPrice`
self$`askQty` <- BookTickerObject$`askQty`
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.