Module: Binance::Spot::Staking

Included in:
Binance::Spot
Defined in:
lib/binance/spot/staking.rb

Overview

all savings endpoints

Instance Method Summary collapse

Instance Method Details

#staking_history(product:, txnType:, **kwargs) ⇒ Object

Get Staking History(USER_DATA)

GET /sapi/v1/staking/stakingRecord

Parameters:

  • product (String)

    “STAKING” for Locked Staking, “F_DEFI” for flexible DeFi Staking, “L_DEFI” for locked DeFi Staking

  • txnType (String)

    “SUBSCRIPTION”, “REDEMPTION”, “INTEREST”

  • kwargs (Hash)

Options Hash (**kwargs):

  • :asset (String)
  • :startTime (Integer)
  • :endTime (Integer)
  • :current (Integer)
  • :size (Integer)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



94
95
96
97
98
99
# File 'lib/binance/spot/staking.rb', line 94

def staking_history(product:, txnType:, **kwargs)
  Binance::Utils::Validation.require_param('product', product)
  Binance::Utils::Validation.require_param('txnType', txnType)

  @session.sign_request(:get, '/sapi/v1/staking/stakingRecord', params: kwargs.merge(product: product, txnType: txnType))
end

#staking_personal_quota_remain(product:, productId:, **kwargs) ⇒ Object

Get Personal Left Quota of Staking Product(USER_DATA)

GET /sapi/v1/staking/personalLeftQuota

Parameters:

  • product (String)

    “STAKING” for Locked Staking, “F_DEFI” for flexible DeFi Staking, “L_DEFI” for locked DeFi Staking

  • productId (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



128
129
130
131
132
133
# File 'lib/binance/spot/staking.rb', line 128

def staking_personal_quota_remain(product:, productId:, **kwargs)
  Binance::Utils::Validation.require_param('product', product)
  Binance::Utils::Validation.require_param('productId', productId)

  @session.sign_request(:get, '/sapi/v1/staking/personalLeftQuota', params: kwargs.merge(product: product, productId: productId))
end

#staking_position(product:, **kwargs) ⇒ Object

Get Staking Product Position(USER_DATA)

GET /sapi/v1/staking/position

Parameters:

  • product (String)

    “STAKING” for Locked Staking, “F_DEFI” for flexible DeFi Staking, “L_DEFI” for locked DeFi Staking

  • kwargs (Hash)

Options Hash (**kwargs):

  • :productId (String)
  • :asset (String)
  • :current (Integer)
  • :size (Integer)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



74
75
76
77
78
# File 'lib/binance/spot/staking.rb', line 74

def staking_position(product:, **kwargs)
  Binance::Utils::Validation.require_param('product', product)

  @session.sign_request(:get, '/sapi/v1/staking/position', params: kwargs.merge(product: product))
end

#staking_product_list(product:, **kwargs) ⇒ Object

Get Staking Product List(USER_DATA)

GET /sapi/v1/staking/productList

Parameters:

  • product (String)

    “STAKING” for Locked Staking, “F_DEFI” for flexible DeFi Staking, “L_DEFI” for locked DeFi Staking

  • kwargs (Hash)

Options Hash (**kwargs):

  • :asset (String)
  • :current (Integer)
  • :size (Integer)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



19
20
21
22
23
# File 'lib/binance/spot/staking.rb', line 19

def staking_product_list(product:, **kwargs)
  Binance::Utils::Validation.require_param('product', product)

  @session.sign_request(:get, '/sapi/v1/staking/productList', params: kwargs.merge(product: product))
end

#staking_purchase(product:, productId:, amount:, **kwargs) ⇒ Object

Purchase Staking Product(USER_DATA)

POST /sapi/v1/staking/purchase

Parameters:

  • product (String)

    “STAKING” for Locked Staking, “F_DEFI” for flexible DeFi Staking, “L_DEFI” for locked DeFi Staking

  • productId (String)
  • amount (Float)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :renewable (String)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



36
37
38
39
40
41
42
# File 'lib/binance/spot/staking.rb', line 36

def staking_purchase(product:, productId:, amount:, **kwargs)
  Binance::Utils::Validation.require_param('product', product)
  Binance::Utils::Validation.require_param('productId', productId)
  Binance::Utils::Validation.require_param('amount', amount)

  @session.sign_request(:post, '/sapi/v1/staking/purchase', params: kwargs.merge(product: product, productId: productId, amount: amount))
end

#staking_redeem(product:, productId:, **kwargs) ⇒ Object

Redeem Staking Product(USER_DATA)

POST /sapi/v1/staking/redeem

Parameters:

  • product (String)

    “STAKING” for Locked Staking, “F_DEFI” for flexible DeFi Staking, “L_DEFI” for locked DeFi Staking

  • productId (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :amount (Float)
  • :positionId (String)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



55
56
57
58
59
60
# File 'lib/binance/spot/staking.rb', line 55

def staking_redeem(product:, productId:, **kwargs)
  Binance::Utils::Validation.require_param('product', product)
  Binance::Utils::Validation.require_param('productId', productId)

  @session.sign_request(:post, '/sapi/v1/staking/redeem', params: kwargs.merge(product: product, productId: productId))
end

#staking_set_auto(product:, positionId:, renewable:, **kwargs) ⇒ Object

Set Auto Staking(USER_DATA)

POST /sapi/v1/staking/setAutoStaking

Parameters:

  • product (String)

    “STAKING” for Locked Staking, “F_DEFI” for flexible DeFi Staking, “L_DEFI” for locked DeFi Staking

  • positionId (String)
  • renewable (String)

    true or false

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



111
112
113
114
115
116
117
# File 'lib/binance/spot/staking.rb', line 111

def staking_set_auto(product:, positionId:, renewable:, **kwargs)
  Binance::Utils::Validation.require_param('product', product)
  Binance::Utils::Validation.require_param('positionId', positionId)
  Binance::Utils::Validation.require_param('renewable', renewable)

  @session.sign_request(:post, '/sapi/v1/staking/setAutoStaking', params: kwargs.merge(product: product, positionId: positionId, renewable: renewable))
end