Module: Binance::Spot::Bswap
- Included in:
- Binance::Spot
- Defined in:
- lib/binance/spot/bswap.rb
Overview
Bswap endpoints
Instance Method Summary collapse
-
#add_liquidity(poolId:, asset:, quantity:, **kwargs) ⇒ Object
Add Liquidity (TRADE).
-
#add_liquidity_preview(poolId:, type:, quoteAsset:, quoteQty:, **kwargs) ⇒ Object
Add Liquidity Preview (USER_DATA).
-
#get_liquidity_info(**kwargs) ⇒ Object
Get liquidity information of a pool (USER_DATA).
-
#get_liquidity_operation_record(**kwargs) ⇒ Object
Get Liquidity Operation Record (USER_DATA).
-
#get_pool_config(**kwargs) ⇒ Object
Get Pool Configure (USER_DATA).
-
#get_swap_history(**kwargs) ⇒ Object
Get Swap History (USER_DATA).
-
#remove_liquidity(poolId:, type:, shareAmount:, **kwargs) ⇒ Object
Remove Liquidity (TRADE).
-
#remove_liquidity_preview(poolId:, type:, quoteAsset:, shareAmount:, **kwargs) ⇒ Object
Remove Liquidity Preview (USER_DATA).
-
#request_quote(quoteAsset:, baseAsset:, quoteQty:, **kwargs) ⇒ Object
Request Quote (USER_DATA).
-
#swap(quoteAsset:, baseAsset:, quoteQty:, **kwargs) ⇒ Object
Swap (TRADE).
-
#swap_pools ⇒ Object
List All Swap Pools (MARKET_DATA).
Instance Method Details
#add_liquidity(poolId:, asset:, quantity:, **kwargs) ⇒ Object
Add Liquidity (TRADE)
POST /sapi/v1/bswap/liquidityAdd
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/binance/spot/bswap.rb', line 40 def add_liquidity(poolId:, asset:, quantity:, **kwargs) Binance::Utils::Validation.require_param('poolId', poolId) Binance::Utils::Validation.require_param('asset', asset) Binance::Utils::Validation.require_param('quantity', quantity) @session.sign_request(:post, '/sapi/v1/bswap/liquidityAdd', params: kwargs.merge( poolId: poolId, asset: asset, quantity: quantity )) end |
#add_liquidity_preview(poolId:, type:, quoteAsset:, quoteQty:, **kwargs) ⇒ Object
Add Liquidity Preview (USER_DATA)
GET /sapi/v1/bswap/addLiquidityPreview
177 178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/binance/spot/bswap.rb', line 177 def add_liquidity_preview(poolId:, type:, quoteAsset:, quoteQty:, **kwargs) Binance::Utils::Validation.require_param('poolId', poolId) Binance::Utils::Validation.require_param('type', type) Binance::Utils::Validation.require_param('quoteAsset', quoteAsset) Binance::Utils::Validation.require_param('quoteQty', quoteQty) @session.sign_request(:get, '/sapi/v1/bswap/addLiquidityPreview', params: kwargs.merge( poolId: poolId, type: type, quoteAsset: quoteAsset, quoteQty: quoteQty )) end |
#get_liquidity_info(**kwargs) ⇒ Object
Get liquidity information of a pool (USER_DATA)
GET /sapi/v1/bswap/liquidity
25 26 27 |
# File 'lib/binance/spot/bswap.rb', line 25 def get_liquidity_info(**kwargs) @session.sign_request(:get, '/sapi/v1/bswap/liquidity', params: kwargs) end |
#get_liquidity_operation_record(**kwargs) ⇒ Object
Get Liquidity Operation Record (USER_DATA)
GET /sapi/v1/bswap/liquidityOps
88 89 90 |
# File 'lib/binance/spot/bswap.rb', line 88 def get_liquidity_operation_record(**kwargs) @session.sign_request(:get, '/sapi/v1/bswap/liquidityOps', params: kwargs) end |
#get_pool_config(**kwargs) ⇒ Object
Get Pool Configure (USER_DATA)
GET /sapi/v1/bswap/poolConfigure
162 163 164 |
# File 'lib/binance/spot/bswap.rb', line 162 def get_pool_config(**kwargs) @session.sign_request(:get, '/sapi/v1/bswap/poolConfigure', params: kwargs) end |
#get_swap_history(**kwargs) ⇒ Object
Get Swap History (USER_DATA)
GET /sapi/v1/bswap/swap
150 151 152 |
# File 'lib/binance/spot/bswap.rb', line 150 def get_swap_history(**kwargs) @session.sign_request(:get, '/sapi/v1/bswap/swap', params: kwargs) end |
#remove_liquidity(poolId:, type:, shareAmount:, **kwargs) ⇒ Object
Remove Liquidity (TRADE)
POST /sapi/v1/bswap/liquidityRemove
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/binance/spot/bswap.rb', line 63 def remove_liquidity(poolId:, type:, shareAmount:, **kwargs) Binance::Utils::Validation.require_param('poolId', poolId) Binance::Utils::Validation.require_param('type', type) Binance::Utils::Validation.require_param('shareAmount', shareAmount) @session.sign_request(:post, '/sapi/v1/bswap/liquidityRemove', params: kwargs.merge( poolId: poolId, type: type, shareAmount: shareAmount )) end |
#remove_liquidity_preview(poolId:, type:, quoteAsset:, shareAmount:, **kwargs) ⇒ Object
Remove Liquidity Preview (USER_DATA)
GET /sapi/v1/bswap/removeLiquidityPreview
202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/binance/spot/bswap.rb', line 202 def remove_liquidity_preview(poolId:, type:, quoteAsset:, shareAmount:, **kwargs) Binance::Utils::Validation.require_param('poolId', poolId) Binance::Utils::Validation.require_param('type', type) Binance::Utils::Validation.require_param('quoteAsset', quoteAsset) Binance::Utils::Validation.require_param('shareAmount', shareAmount) @session.sign_request(:get, '/sapi/v1/bswap/removeLiquidityPreview', params: kwargs.merge( poolId: poolId, type: type, quoteAsset: quoteAsset, shareAmount: shareAmount )) end |
#request_quote(quoteAsset:, baseAsset:, quoteQty:, **kwargs) ⇒ Object
Request Quote (USER_DATA)
GET /sapi/v1/bswap/quote
102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/binance/spot/bswap.rb', line 102 def request_quote(quoteAsset:, baseAsset:, quoteQty:, **kwargs) Binance::Utils::Validation.require_param('quoteAsset', quoteAsset) Binance::Utils::Validation.require_param('baseAsset', baseAsset) Binance::Utils::Validation.require_param('quoteQty', quoteQty) @session.sign_request(:get, '/sapi/v1/bswap/quote', params: kwargs.merge( quoteAsset: quoteAsset, baseAsset: baseAsset, quoteQty: quoteQty )) end |
#swap(quoteAsset:, baseAsset:, quoteQty:, **kwargs) ⇒ Object
Swap (TRADE)
POST /sapi/v1/bswap/swap
124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/binance/spot/bswap.rb', line 124 def swap(quoteAsset:, baseAsset:, quoteQty:, **kwargs) Binance::Utils::Validation.require_param('quoteAsset', quoteAsset) Binance::Utils::Validation.require_param('baseAsset', baseAsset) Binance::Utils::Validation.require_param('quoteQty', quoteQty) @session.sign_request(:post, '/sapi/v1/bswap/swap', params: kwargs.merge( quoteAsset: quoteAsset, baseAsset: baseAsset, quoteQty: quoteQty )) end |
#swap_pools ⇒ Object
List All Swap Pools (MARKET_DATA)
GET /sapi/v1/bswap/pools
13 14 15 |
# File 'lib/binance/spot/bswap.rb', line 13 def swap_pools @session.limit_request(path: '/sapi/v1/bswap/pools') end |