Module: Binance::Spot::Savings

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

Overview

all savings endpoints

Instance Method Summary collapse

Instance Method Details

#savings_account(**kwargs) ⇒ Object

Lending Account (USER_DATA)

GET /sapi/v1/lending/union/account

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



181
182
183
# File 'lib/binance/spot/savings.rb', line 181

def (**kwargs)
  @session.sign_request(:get, '/sapi/v1/lending/union/account', params: kwargs)
end

#savings_customized_position(asset:, **kwargs) ⇒ Object

Get Fixed/Activity Project Position (USER_DATA)

GET /sapi/v1/lending/project/position/list

Parameters:

  • asset (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :projectId (String)
  • :status (String)

    “HOLDING”, “REDEEMED”

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



166
167
168
169
170
171
172
# File 'lib/binance/spot/savings.rb', line 166

def savings_customized_position(asset:, **kwargs)
  Binance::Utils::Validation.require_param('asset', asset)

  @session.sign_request(:get, '/sapi/v1/lending/project/position/list', params: kwargs.merge(
    asset: asset
  ))
end

#savings_flexible_product_position(asset:, **kwargs) ⇒ Object

Get Flexible Product Position (USER_DATA)

GET /sapi/v1/lending/daily/token/position

Parameters:

  • asset (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



107
108
109
110
111
112
113
# File 'lib/binance/spot/savings.rb', line 107

def savings_flexible_product_position(asset:, **kwargs)
  Binance::Utils::Validation.require_param('asset', asset)

  @session.sign_request(:get, '/sapi/v1/lending/daily/token/position', params: kwargs.merge(
    asset: asset
  ))
end

#savings_flexible_products(**kwargs) ⇒ Object

Get Flexible Product List (USER_DATA)

GET /sapi/v1/lending/daily/product/list

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • :status (String)

    “ALL”, “SUBSCRIBABLE”, “UNSUBSCRIBABLE”; Default: “ALL”

  • :featured (String)

    “ALL”, “TRUE”; Default: “ALL”

  • :current (Integer)

    Current query page. Default: 1, Min: 1

  • :size (Integer)

    Default: 50, Max: 100

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



19
20
21
# File 'lib/binance/spot/savings.rb', line 19

def savings_flexible_products(**kwargs)
  @session.sign_request(:get, '/sapi/v1/lending/daily/product/list', params: kwargs)
end

#savings_flexible_redeem(productId:, amount:, type:, **kwargs) ⇒ Object

Redeem Flexible Product (USER_DATA)

POST /sapi/v1/lending/daily/redeem

Parameters:

  • productId (String)
  • amount (Float)

    ]

  • type (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/binance/spot/savings.rb', line 87

def savings_flexible_redeem(productId:, amount:, type:, **kwargs)
  Binance::Utils::Validation.require_param('productId', productId)
  Binance::Utils::Validation.require_param('amount', amount)
  Binance::Utils::Validation.require_param('type', type)

  @session.sign_request(:post, '/sapi/v1/lending/daily/redeem', params: kwargs.merge(
    productId: productId,
    amount: amount,
    type: type
  ))
end

#savings_flexible_user_left_quota(productId:, **kwargs) ⇒ Object

Get Left Daily Purchase Quota of Flexible Product (USER_DATA)

GET /sapi/v1/lending/daily/userLeftQuota

Parameters:

  • productId (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



31
32
33
34
35
36
37
# File 'lib/binance/spot/savings.rb', line 31

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

  @session.sign_request(:get, '/sapi/v1/lending/daily/userLeftQuota', params: kwargs.merge(
    productId: productId
  ))
end

#savings_flexible_user_redemption_quota(productId:, type:, **kwargs) ⇒ Object

Get Left Daily Redemption Quota of Flexible Product (USER_DATA)

GET /sapi/v1/lending/daily/userRedemptionQuota

Parameters:

  • productId (String)
  • type (String)

    “FAST”, “NORMAL”

  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



67
68
69
70
71
72
73
74
75
# File 'lib/binance/spot/savings.rb', line 67

def savings_flexible_user_redemption_quota(productId:, type:, **kwargs)
  Binance::Utils::Validation.require_param('productId', productId)
  Binance::Utils::Validation.require_param('type', type)

  @session.sign_request(:get, '/sapi/v1/lending/daily/userRedemptionQuota', params: kwargs.merge(
    productId: productId,
    type: type
  ))
end

#savings_interest_history(lendingType:, **kwargs) ⇒ Object

Get Interest History (USER_DATA)

GET /sapi/v1/lending/union/interestHistory

Parameters:

  • lendingType (String)
  • 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:



240
241
242
243
244
245
246
# File 'lib/binance/spot/savings.rb', line 240

def savings_interest_history(lendingType:, **kwargs)
  Binance::Utils::Validation.require_param('lendingType', lendingType)

  @session.sign_request(:get, '/sapi/v1/lending/union/interestHistory', params: kwargs.merge(
    lendingType: lendingType
  ))
end

#savings_position_changed(projectId:, lot:, **kwargs) ⇒ Object

Change Fixed/Activity Position to Daily Position(USER_DATA)

POST /sapi/v1/lending/positionChanged

Parameters:

  • projectId (String)
  • lot (Integer)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :positionId (Integer)
  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



258
259
260
261
262
263
264
265
266
# File 'lib/binance/spot/savings.rb', line 258

def savings_position_changed(projectId:, lot:, **kwargs)
  Binance::Utils::Validation.require_param('projectId', projectId)
  Binance::Utils::Validation.require_param('lot', lot)

  @session.sign_request(:post, '/sapi/v1/lending/positionChanged', params: kwargs.merge(
    projectId: projectId,
    lot: lot
  ))
end

#savings_product_list(type:, **kwargs) ⇒ Object

Get Fixed and Activity Project List(USER_DATA)

GET /sapi/v1/lending/project/list

Parameters:

  • type (String)

    “REGULAR”, “CUSTOMIZED_FIXED”

  • kwargs (Hash)

Options Hash (**kwargs):

  • :asset (String)
  • :status (String)

    “ALL”, “SUBSCRIBABLE”, “UNSUBSCRIBABLE”; default “ALL”

  • :isSortAsc (Boolean)

    default “true”

  • :sortBy (String)

    “START_TIME”, “LOT_SIZE”, “INTEREST_RATE”, “DURATION”; default “START_TIME”

  • :current (Integer)

    Currently querying page. Start from 1. Default:1

  • :size (Integer)

    Default:10, Max:100

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



129
130
131
132
133
134
135
# File 'lib/binance/spot/savings.rb', line 129

def savings_product_list(type:, **kwargs)
  Binance::Utils::Validation.require_param('type', type)

  @session.sign_request(:get, '/sapi/v1/lending/project/list', params: kwargs.merge(
    type: type
  ))
end

#savings_purchase_customized_project(projectId:, lot:, **kwargs) ⇒ Object

Purchase Fixed/Activity Project (USER_DATA)

POST /sapi/v1/lending/customizedFixed/purchase

Parameters:

  • projectId (String)
  • lot (String)
  • kwargs (Hash)

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



146
147
148
149
150
151
152
153
154
# File 'lib/binance/spot/savings.rb', line 146

def savings_purchase_customized_project(projectId:, lot:, **kwargs)
  Binance::Utils::Validation.require_param('projectId', projectId)
  Binance::Utils::Validation.require_param('lot', lot)

  @session.sign_request(:post, '/sapi/v1/lending/customizedFixed/purchase', params: kwargs.merge(
    projectId: projectId,
    lot: lot
  ))
end

#savings_purchase_flexible_product(productId:, amount:, **kwargs) ⇒ Object

Purchase Flexible Product (USER_DATA)

POST /sapi/v1/lending/daily/purchase

Parameters:

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

Options Hash (**kwargs):

  • :recvWindow (Integer)

    The value cannot be greater than 60000

See Also:



48
49
50
51
52
53
54
55
56
# File 'lib/binance/spot/savings.rb', line 48

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

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

#savings_purchase_record(lendingType:, **kwargs) ⇒ Object

Get Purchase Record (USER_DATA)

GET /sapi/v1/lending/union/purchaseRecord

Parameters:

  • lendingType (String)
  • 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:



198
199
200
201
202
203
204
# File 'lib/binance/spot/savings.rb', line 198

def savings_purchase_record(lendingType:, **kwargs)
  Binance::Utils::Validation.require_param('lendingType', lendingType)

  @session.sign_request(:get, '/sapi/v1/lending/union/purchaseRecord', params: kwargs.merge(
    lendingType: lendingType
  ))
end

#savings_redemption_record(lendingType:, **kwargs) ⇒ Object

Get Redemption Record (USER_DATA)

GET /sapi/v1/lending/union/redemptionRecord

Parameters:

  • lendingType (String)
  • 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:



219
220
221
222
223
224
225
# File 'lib/binance/spot/savings.rb', line 219

def savings_redemption_record(lendingType:, **kwargs)
  Binance::Utils::Validation.require_param('lendingType', lendingType)

  @session.sign_request(:get, '/sapi/v1/lending/union/redemptionRecord', params: kwargs.merge(
    lendingType: lendingType
  ))
end