BSwapApi: BSwap operations

BSwapApiR Documentation

BSwap operations

Description

binanceRapi.BSwap

Format

An R6Class generator object

Methods

SapiV1BswapAddLiquidityPreviewGet Add Liquidity Preview (USER_DATA) Calculate expected share amount for adding liquidity in single or dual token. Weight(IP): 150

  • @param pool.id integer

  • @param type Enum < [SINGLE, COMBINATION] >

  • @param quote.asset character

  • @param quote.qty numeric

  • @param recv.window integer

  • @returnType OneOfbswapAddLiquidityPreviewCombinationbswapAddLiquidityPreviewSingle

  • status code : 200 | Add Liquidity Preview

  • return type : OneOfbswapAddLiquidityPreviewCombinationbswapAddLiquidityPreviewSingle

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

SapiV1BswapClaimRewardsPost Claim rewards (TRADE) Claim swap rewards or liquidity rewards Weight(UID): 1000

  • @param type integer

  • @param recv.window integer

  • @returnType InlineResponse200130

  • status code : 200 | Result of claim

  • return type : InlineResponse200130

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

SapiV1BswapClaimedHistoryGet Get Claimed History (USER_DATA) Get history of claimed rewards. Weight(UID): 1000

  • @param pool.id integer

  • @param asset.rewards character

  • @param type integer

  • @param start.time integer

  • @param end.time integer

  • @param limit integer

  • @param recv.window integer

  • @returnType list( inline_response_200_131 )

  • status code : 200 | Claimed History

  • return type : array[InlineResponse200131]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

SapiV1BswapLiquidityAddPost Add Liquidity (TRADE) Add liquidity to a pool. Weight(UID): 1000 (Additional: 3 times one second)

  • @param pool.id integer

  • @param asset character

  • @param quantity numeric

  • @param type Enum < [Single, Combination] >

  • @param recv.window integer

  • @returnType InlineResponse200113

  • status code : 200 | Operation Id

  • return type : InlineResponse200113

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

SapiV1BswapLiquidityGet Liquidity information of a pool (USER_DATA) Get liquidity information and user share of a pool. Weight(IP): - &#x60;1&#x60; for one pool; - &#x60;10&#x60; when the poolId parameter is omitted;

  • @param pool.id integer

  • @param recv.window integer

  • @returnType list( inline_response_200_122 )

  • status code : 200 | Pool Liquidation information

  • return type : array[InlineResponse200122]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

SapiV1BswapLiquidityOpsGet Liquidity Operation Record (USER_DATA) Get liquidity operation (add/remove) records. Weight(UID): 3000

  • @param operation.id integer

  • @param pool.id integer

  • @param operation Enum < [ADD, REMOVE] >

  • @param start.time integer

  • @param end.time integer

  • @param limit integer

  • @param recv.window integer

  • @returnType list( inline_response_200_124 )

  • status code : 200 | Liquidity Operation Record

  • return type : array[InlineResponse200124]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

SapiV1BswapLiquidityRemovePost Remove Liquidity (TRADE) Remove liquidity from a pool, &#x60;type&#x60; include &#x60;SINGLE&#x60; and &#x60;COMBINATION&#x60;, asset is mandatory for single asset removal Weight(UID): 1000 (Additional: 3 times one second)

  • @param pool.id integer

  • @param type Enum < [SINGLE, COMBINATION] >

  • @param share.amount numeric

  • @param asset character

  • @param recv.window integer

  • @returnType InlineResponse200123

  • status code : 200 | Operation Id

  • return type : InlineResponse200123

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

SapiV1BswapPoolConfigureGet Pool Configure (USER_DATA) Weight(IP): 150

  • @param pool.id integer

  • @param recv.window integer

  • @returnType list( inline_response_200_128 )

  • status code : 200 | Pool Information

  • return type : array[InlineResponse200128]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

SapiV1BswapPoolsGet List All Swap Pools (MARKET_DATA) Get metadata about all swap pools. Weight(IP): 1

  • @returnType list( inline_response_200_121 )

  • status code : 200 | List of Swap Pools

  • return type : array[InlineResponse200121]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

SapiV1BswapQuoteGet Request Quote (USER_DATA) Request a quote for swap quote asset (selling asset) for base asset (buying asset), essentially price/exchange rates. quoteQty is quantity of quote asset (to sell). Please be noted the quote is for reference only, the actual price will change as the liquidity changes, it&#39;s recommended to swap immediate after request a quote for slippage prevention. Weight(UID): 150

  • @param quote.asset character

  • @param base.asset character

  • @param quote.qty numeric

  • @param recv.window integer

  • @returnType InlineResponse200125

  • status code : 200 | Quote Info

  • return type : InlineResponse200125

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

SapiV1BswapRemoveLiquidityPreviewGet Remove Liquidity Preview (USER_DATA) Calculate the expected asset amount of single token redemption or dual token redemption. Weight(IP): 150

  • @param pool.id integer

  • @param type Enum < [SINGLE, COMBINATION] >

  • @param quote.asset character

  • @param share.amount numeric

  • @param recv.window integer

  • @returnType OneOfbswapRmvLiquidityPreviewCombinationbswapRmvLiquidityPreviewSingle

  • status code : 200 | Remove Liquidity Preview

  • return type : OneOfbswapRmvLiquidityPreviewCombinationbswapRmvLiquidityPreviewSingle

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

SapiV1BswapSwapGet Swap History (USER_DATA) Get swap history. Weight(UID): 3000

  • @param swap.id integer

  • @param start.time integer

  • @param end.time integer

  • @param status Enum < [0, 1, 2] >

  • @param quote.asset character

  • @param base.asset character

  • @param limit integer

  • @param recv.window integer

  • @returnType list( inline_response_200_126 )

  • status code : 200 | Swap History

  • return type : array[InlineResponse200126]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

SapiV1BswapSwapPost Swap (TRADE) Swap &#x60;quoteAsset&#x60; for &#x60;baseAsset&#x60;. Weight(UID): 1000 (Additional: 3 times one second)

  • @param quote.asset character

  • @param base.asset character

  • @param quote.qty numeric

  • @param recv.window integer

  • @returnType InlineResponse200127

  • status code : 200 | Swap Id

  • return type : InlineResponse200127

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

SapiV1BswapUnclaimedRewardsGet Get Unclaimed Rewards Record (USER_DATA) Get unclaimed rewards record. Weight(UID): 1000

  • @param type integer

  • @param recv.window integer

  • @returnType InlineResponse200129

  • status code : 200 | Unclaimed rewards record

  • return type : InlineResponse200129

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

Public fields

apiClient

Handles the client-server communication.

Methods

Public methods


Method new()

Usage
BSwapApi$new(apiClient)

Method SapiV1BswapAddLiquidityPreviewGet()

Usage
BSwapApi$SapiV1BswapAddLiquidityPreviewGet(
  pool.id,
  type,
  quote.asset,
  quote.qty,
  recv.window = NULL,
  ...
)

Method SapiV1BswapAddLiquidityPreviewGetWithHttpInfo()

Usage
BSwapApi$SapiV1BswapAddLiquidityPreviewGetWithHttpInfo(
  pool.id,
  type,
  quote.asset,
  quote.qty,
  recv.window = NULL,
  ...
)

Method SapiV1BswapClaimRewardsPost()

Usage
BSwapApi$SapiV1BswapClaimRewardsPost(type = NULL, recv.window = NULL, ...)

Method SapiV1BswapClaimRewardsPostWithHttpInfo()

Usage
BSwapApi$SapiV1BswapClaimRewardsPostWithHttpInfo(
  type = NULL,
  recv.window = NULL,
  ...
)

Method SapiV1BswapClaimedHistoryGet()

Usage
BSwapApi$SapiV1BswapClaimedHistoryGet(
  pool.id = NULL,
  asset.rewards = NULL,
  type = NULL,
  start.time = NULL,
  end.time = NULL,
  limit = NULL,
  recv.window = NULL,
  ...
)

Method SapiV1BswapClaimedHistoryGetWithHttpInfo()

Usage
BSwapApi$SapiV1BswapClaimedHistoryGetWithHttpInfo(
  pool.id = NULL,
  asset.rewards = NULL,
  type = NULL,
  start.time = NULL,
  end.time = NULL,
  limit = NULL,
  recv.window = NULL,
  ...
)

Method SapiV1BswapLiquidityAddPost()

Usage
BSwapApi$SapiV1BswapLiquidityAddPost(
  pool.id,
  asset,
  quantity,
  timestamp,
  signature,
  type = NULL,
  recv.window = NULL,
  ...
)

Method SapiV1BswapLiquidityAddPostWithHttpInfo()

Usage
BSwapApi$SapiV1BswapLiquidityAddPostWithHttpInfo(
  pool.id,
  asset,
  quantity,
  timestamp,
  signature,
  type = NULL,
  recv.window = NULL,
  ...
)

Method SapiV1BswapLiquidityGet()

Usage
BSwapApi$SapiV1BswapLiquidityGet(pool.id = NULL, recv.window = NULL, ...)

Method SapiV1BswapLiquidityGetWithHttpInfo()

Usage
BSwapApi$SapiV1BswapLiquidityGetWithHttpInfo(
  pool.id = NULL,
  recv.window = NULL,
  ...
)

Method SapiV1BswapLiquidityOpsGet()

Usage
BSwapApi$SapiV1BswapLiquidityOpsGet(
  operation.id = NULL,
  pool.id = NULL,
  operation = NULL,
  start.time = NULL,
  end.time = NULL,
  limit = NULL,
  recv.window = NULL,
  ...
)

Method SapiV1BswapLiquidityOpsGetWithHttpInfo()

Usage
BSwapApi$SapiV1BswapLiquidityOpsGetWithHttpInfo(
  operation.id = NULL,
  pool.id = NULL,
  operation = NULL,
  start.time = NULL,
  end.time = NULL,
  limit = NULL,
  recv.window = NULL,
  ...
)

Method SapiV1BswapLiquidityRemovePost()

Usage
BSwapApi$SapiV1BswapLiquidityRemovePost(
  pool.id,
  type,
  share.amount,
  asset = NULL,
  recv.window = NULL,
  ...
)

Method SapiV1BswapLiquidityRemovePostWithHttpInfo()

Usage
BSwapApi$SapiV1BswapLiquidityRemovePostWithHttpInfo(
  pool.id,
  type,
  share.amount,
  asset = NULL,
  recv.window = NULL,
  ...
)

Method SapiV1BswapPoolConfigureGet()

Usage
BSwapApi$SapiV1BswapPoolConfigureGet(pool.id = NULL, recv.window = NULL, ...)

Method SapiV1BswapPoolConfigureGetWithHttpInfo()

Usage
BSwapApi$SapiV1BswapPoolConfigureGetWithHttpInfo(
  pool.id = NULL,
  recv.window = NULL,
  ...
)

Method SapiV1BswapPoolsGet()

Usage
BSwapApi$SapiV1BswapPoolsGet(...)

Method SapiV1BswapPoolsGetWithHttpInfo()

Usage
BSwapApi$SapiV1BswapPoolsGetWithHttpInfo(...)

Method SapiV1BswapQuoteGet()

Usage
BSwapApi$SapiV1BswapQuoteGet(
  quote.asset,
  base.asset,
  quote.qty,
  recv.window = NULL,
  ...
)

Method SapiV1BswapQuoteGetWithHttpInfo()

Usage
BSwapApi$SapiV1BswapQuoteGetWithHttpInfo(
  quote.asset,
  base.asset,
  quote.qty,
  recv.window = NULL,
  ...
)

Method SapiV1BswapRemoveLiquidityPreviewGet()

Usage
BSwapApi$SapiV1BswapRemoveLiquidityPreviewGet(
  pool.id,
  type,
  quote.asset,
  share.amount,
  recv.window = NULL,
  ...
)

Method SapiV1BswapRemoveLiquidityPreviewGetWithHttpInfo()

Usage
BSwapApi$SapiV1BswapRemoveLiquidityPreviewGetWithHttpInfo(
  pool.id,
  type,
  quote.asset,
  share.amount,
  recv.window = NULL,
  ...
)

Method SapiV1BswapSwapGet()

Usage
BSwapApi$SapiV1BswapSwapGet(
  swap.id = NULL,
  start.time = NULL,
  end.time = NULL,
  status = NULL,
  quote.asset = NULL,
  base.asset = NULL,
  limit = NULL,
  recv.window = NULL,
  ...
)

Method SapiV1BswapSwapGetWithHttpInfo()

Usage
BSwapApi$SapiV1BswapSwapGetWithHttpInfo(
  swap.id = NULL,
  start.time = NULL,
  end.time = NULL,
  status = NULL,
  quote.asset = NULL,
  base.asset = NULL,
  limit = NULL,
  recv.window = NULL,
  ...
)

Method SapiV1BswapSwapPost()

Usage
BSwapApi$SapiV1BswapSwapPost(
  quote.asset,
  base.asset,
  quote.qty,
  recv.window = NULL,
  ...
)

Method SapiV1BswapSwapPostWithHttpInfo()

Usage
BSwapApi$SapiV1BswapSwapPostWithHttpInfo(
  quote.asset,
  base.asset,
  quote.qty,
  recv.window = NULL,
  ...
)

Method SapiV1BswapUnclaimedRewardsGet()

Usage
BSwapApi$SapiV1BswapUnclaimedRewardsGet(type = NULL, recv.window = NULL, ...)

Method SapiV1BswapUnclaimedRewardsGetWithHttpInfo()

Usage
BSwapApi$SapiV1BswapUnclaimedRewardsGetWithHttpInfo(
  type = NULL,
  recv.window = NULL,
  ...
)

Method clone()

The objects of this class are cloneable with this method.

Usage
BSwapApi$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

## Not run: 
####################  SapiV1BswapAddLiquidityPreviewGet  ####################

library(binanceRapi)
var.pool.id <- 2 # integer | 
var.type <- 'SINGLE' # character | * `SINGLE` - for adding a single token * `COMBINATION` - for adding dual tokens
var.quote.asset <- 'USDT' # character | 
var.quote.qty <- 3.4 # numeric | 
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Add Liquidity Preview (USER_DATA)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapAddLiquidityPreviewGet(var.pool.id, var.type, var.quote.asset, var.quote.qty, recv.window=var.recv.window)

####################  SapiV1BswapClaimRewardsPost  ####################

library(binanceRapi)
var.timestamp <- 56 # integer | UTC timestamp in ms
var.signature <- 'signature_example' # character | Signature
var.type <- 0 # integer | 0: Swap rewards, 1: Liquidity rewards, default to 0
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Claim rewards (TRADE)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapClaimRewardsPost(type=var.type, recv.window=var.recv.window)

####################  SapiV1BswapClaimedHistoryGet  ####################

library(binanceRapi)
var.timestamp <- 56 # integer | UTC timestamp in ms
var.signature <- 'signature_example' # character | Signature
var.pool.id <- 56 # integer | 
var.asset.rewards <- 'asset.rewards_example' # character | 
var.type <- 0 # integer | 0: Swap rewards, 1: Liquidity rewards, default to 0
var.start.time <- 56 # integer | UTC timestamp in ms
var.end.time <- 56 # integer | UTC timestamp in ms
var.limit <- 56 # integer | Default 3, max 100
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Get Claimed History (USER_DATA)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapClaimedHistoryGet(pool.id=var.pool.id, asset.rewards=var.asset.rewards, type=var.type, start.time=var.start.time, end.time=var.end.time, limit=var.limit, recv.window=var.recv.window)



####################  SapiV1BswapLiquidityAddPost  ####################

library(binanceRapi)
var.pool.id <- 56 # integer | 
var.asset <- 'BTC' # character | 
var.quantity <- 3.4 # numeric | 
var.type <- 'Single' # character | * `Single` - to add a single token * `Combination` - to add dual tokens
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Add Liquidity (TRADE)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapLiquidityAddPost(var.pool.id, var.asset, var.quantity, type=var.type, recv.window=var.recv.window)


####################  SapiV1BswapLiquidityGet  ####################

library(binanceRapi)
var.pool.id <- 56 # integer | 
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Liquidity information of a pool (USER_DATA)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapLiquidityGet(pool.id=var.pool.id, recv.window=var.recv.window)


####################  SapiV1BswapLiquidityOpsGet  ####################

library(binanceRapi)
var.operation.id <- 56 # integer | 
var.pool.id <- 56 # integer | 
var.operation <- 'operation_example' # character | 
var.start.time <- 56 # integer | UTC timestamp in ms
var.end.time <- 56 # integer | UTC timestamp in ms
var.limit <- 500 # integer | Default 500; max 1000.
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Liquidity Operation Record (USER_DATA)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapLiquidityOpsGet(operation.id=var.operation.id, pool.id=var.pool.id, operation=var.operation, start.time=var.start.time, end.time=var.end.time, limit=var.limit, recv.window=var.recv.window)


####################  SapiV1BswapLiquidityRemovePost  ####################

library(binanceRapi)
var.pool.id <- 56 # integer | 
var.type <- 'SINGLE' # character | * `SINGLE` - for single asset removal * `COMBINATION` - for combination of all coins removal
var.share.amount <- 3.4 # numeric | 
var.asset <- 'BNB' # character | Mandatory for single asset removal
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Remove Liquidity (TRADE)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapLiquidityRemovePost(var.pool.id, var.type, var.share.amount, asset=var.asset, recv.window=var.recv.window)


####################  SapiV1BswapPoolConfigureGet  ####################

library(binanceRapi)
var.pool.id <- 2 # integer | 
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Pool Configure (USER_DATA)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapPoolConfigureGet(pool.id=var.pool.id, recv.window=var.recv.window)


####################  SapiV1BswapPoolsGet  ####################

library(binanceRapi)

#List All Swap Pools (MARKET_DATA)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapPoolsGet()


####################  SapiV1BswapQuoteGet  ####################

library(binanceRapi)
var.quote.asset <- 'USDT' # character | 
var.base.asset <- 'BUSD' # character | 
var.quote.qty <- 3.4 # numeric | 
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Request Quote (USER_DATA)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapQuoteGet(var.quote.asset, var.base.asset, var.quote.qty, recv.window=var.recv.window)


####################  SapiV1BswapRemoveLiquidityPreviewGet  ####################

library(binanceRapi)
var.pool.id <- 2 # integer | 
var.type <- 'SINGLE' # character | * `SINGLE` - remove and obtain a single token * `COMBINATION` - remove and obtain dual token
var.quote.asset <- 'USDT' # character | 
var.share.amount <- 3.4 # numeric | 
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Remove Liquidity Preview (USER_DATA)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapRemoveLiquidityPreviewGet(var.pool.id, var.type, var.quote.asset, var.share.amount, recv.window=var.recv.window)


####################  SapiV1BswapSwapGet  ####################

library(binanceRapi)
var.swap.id <- 56 # integer | 
var.start.time <- 56 # integer | UTC timestamp in ms
var.end.time <- 56 # integer | UTC timestamp in ms
var.status <- 56 # integer | * `0` - pending for swap * `1` - success * `2` - failed
var.quote.asset <- 'USDT' # character | 
var.base.asset <- 'BUSD' # character | 
var.limit <- 56 # integer | default 3, max 100
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Swap History (USER_DATA)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapSwapGet(swap.id=var.swap.id, start.time=var.start.time, end.time=var.end.time, status=var.status, quote.asset=var.quote.asset, base.asset=var.base.asset, limit=var.limit, recv.window=var.recv.window)


####################  SapiV1BswapSwapPost  ####################

library(binanceRapi)
var.quote.asset <- 'USDT' # character | 
var.base.asset <- 'BUSD' # character | 
var.quote.qty <- 3.4 # numeric | 
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Swap (TRADE)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapSwapPost(var.quote.asset, var.base.asset, var.quote.qty, recv.window=var.recv.window)


####################  SapiV1BswapUnclaimedRewardsGet  ####################

library(binanceRapi)
var.timestamp <- 56 # integer | UTC timestamp in ms
var.signature <- 'signature_example' # character | Signature
var.type <- 0 # integer | 0: Swap rewards, 1: Liquidity rewards, default to 0
var.recv.window <- 5000 # integer | The value cannot be greater than 60000

#Get Unclaimed Rewards Record (USER_DATA)
api.instance <- BSwapApi$new()

result <- api.instance$SapiV1BswapUnclaimedRewardsGet(type=var.type, recv.window=var.recv.window)



## End(Not run)

grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.