# GraphSense API
#
# GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks.
#
# The version of the OpenAPI document: 1.0.1
# Contact: contact@ikna.io
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title TxValue
#'
#' @description TxValue Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field address list( character )
#'
#' @field value \link{Values}
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
TxValue <- R6::R6Class(
'TxValue',
public = list(
`address` = NULL,
`value` = NULL,
initialize = function(
`address`, `value`, ...
) {
local.optional.var <- list(...)
if (!missing(`address`)) {
stopifnot(is.vector(`address`), length(`address`) != 0)
sapply(`address`, function(x) stopifnot(is.character(x)))
self$`address` <- `address`
}
if (!missing(`value`)) {
stopifnot(R6::is.R6(`value`))
self$`value` <- `value`
}
},
toJSON = function() {
TxValueObject <- list()
if (!is.null(self$`address`)) {
TxValueObject[['address']] <-
self$`address`
}
if (!is.null(self$`value`)) {
TxValueObject[['value']] <-
self$`value`$toJSON()
}
TxValueObject
},
fromJSON = function(TxValueJson) {
TxValueObject <- jsonlite::fromJSON(TxValueJson)
if (!is.null(TxValueObject$`address`)) {
self$`address` <- ApiClient$new()$deserializeObj(TxValueObject$`address`, "array[character]", loadNamespace("graphsense"))
}
if (!is.null(TxValueObject$`value`)) {
valueObject <- Values$new()
valueObject$fromJSON(jsonlite::toJSON(TxValueObject$value, auto_unbox = TRUE, digits = NA))
self$`value` <- valueObject
}
self
},
toJSONString = function() {
jsoncontent <- c(
if (!is.null(self$`address`)) {
sprintf(
'"address":
[%s]
',
paste(unlist(lapply(self$`address`, function(x) paste0('"', x, '"'))), collapse=",")
)},
if (!is.null(self$`value`)) {
sprintf(
'"value":
%s
',
jsonlite::toJSON(self$`value`$toJSON(), auto_unbox=TRUE, digits = NA)
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
paste('{', jsoncontent, '}', sep = "")
},
fromJSONString = function(TxValueJson) {
TxValueObject <- jsonlite::fromJSON(TxValueJson)
self$`address` <- ApiClient$new()$deserializeObj(TxValueObject$`address`, "array[character]", loadNamespace("graphsense"))
self$`value` <- Values$new()$fromJSON(jsonlite::toJSON(TxValueObject$value, auto_unbox = TRUE, digits = NA))
self
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.