binance-connector-ruby 1.7.1 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b448b0cb73b0fbe3eb12d41830d72590539c6ae27b4697d7c9b6d3d5af0b0b0
4
- data.tar.gz: 8ff261ede671030d907d0fd7365f406ce9880fc276386267f493220b1fd534fb
3
+ metadata.gz: 95acd1d2aa51eb375828b3d66166a23b481cf4b6608560ea3e6f7f127ff2be20
4
+ data.tar.gz: f3606637c10bb21eaf337db3f47744a8e5d0a551ac41e19a1bbc9e0390d8e11c
5
5
  SHA512:
6
- metadata.gz: d99941f064ad0efff71b122d530b7b42361e4c80a7096a07ab64694a4702def1c0e613cbe3218acef10c87ff5a85eb88e641a2a8e8ff85fc3112070760c5237a
7
- data.tar.gz: 587bf09d4ac3df83601e6ff8311cfcc26313d3b3c09849f871af3c49fd29a97dd0cf0398c8f2c4eea8fae4e43951a22c941c004828539bea89f47099debf948c
6
+ metadata.gz: 458304fbc42b6aaecfb59fbb94a52cd65ff42cc1b9c3b67b8fc0050ebd271902407f5fc55233decaa357b20952dbd697150a4a477f82ef00754935febb954d8a
7
+ data.tar.gz: 1f93772a1bf824caad274ad74def4619f29bbefef982c923adf3e1133bfe2b665e29647bab25309efb43eb9c495c7eaca8aec98919c7979c2c804b642e270cec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.0 - 2026-10-30
4
+ ### Added
5
+ - Dual Investment endpoints:
6
+ - `GET /sapi/v1/dci/product/list`
7
+ - `GET /sapi/v1/dci/product/positions`
8
+
9
+ ### Changed
10
+ - Bumped `faraday` to `1.10.6` and `json` to `2.21.2` to address security advisories.
11
+
12
+ ### Fixed
13
+ - `new_oco_order` now sends requests to `POST /api/v3/orderList/oco` instead of the deprecated `POST /api/v3/order/oco`, matching its `aboveType`/`belowType` parameters (#28).
14
+ - Fixed OCO examples parameters and order list examples to pass parameters as keyword arguments.
15
+ - `ticker_trading_day` sent the `symbols` parameter as a nested hash, which Binance rejected.
16
+ - `delist_schedule` now sends the API key, which `GET /sapi/v1/spot/delist-schedule` requires.
17
+ - Renamed 60 spec files missing the `_spec.rb` suffix so they run with the test suite, and fixed the failing ones.
18
+
19
+ ## 1.8.0 - 2026-06-18
20
+ ### Added
21
+ - Market endpoints:
22
+ - `GET /api/v3/executionRules`
23
+ - `GET /api/v3/referencePrice`
24
+ - `GET /api/v3/referencePrice/calculation`
25
+ - `GET /api/v3/historicalBlockTrades`
26
+
27
+ - Trade endpoints:
28
+ - `GET /api/v3/order/amendments`
29
+ - `GET /api/v3/myFilters`
30
+ - `PUT /api/v3/order/amend/keepPriority`
31
+ - `POST /api/v3/orderList/oco`
32
+ - `POST /api/v3/orderList/oto`
33
+ - `POST /api/v3/orderList/otoco`
34
+ - `POST /api/v3/orderList/opo`
35
+ - `POST /api/v3/orderList/opoco`
36
+
37
+ ### Changed
38
+ - Added new parameter `symbolStatus` to endpoints:
39
+ - `GET /api/v3/depth`
40
+ - `GET /api/v3/ticker/price`
41
+ - `GET /api/v3/ticker/bookTicker`
42
+ - `GET /api/v3/ticker/24hr`
43
+ - `GET /api/v3/ticker/tradingDay`
44
+ - `GET /api/v3/ticker`
45
+
3
46
  ## 1.7.1 - 2025-01-13
4
47
  ### Changed
5
48
  - Updated documentation links.
@@ -16,7 +16,7 @@ module Binance
16
16
  # @option kwargs [Integer] :rows
17
17
  # @option kwargs [Integer] :recvWindow
18
18
  # @option kwargs [Integer] :timestamp
19
- # @see https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History
19
+ # @see https://developers.binance.com/docs/c2c/rest-api
20
20
  def c2c_trade_history(tradeType:, **kwargs)
21
21
  Binance::Utils::Validation.require_param('tradeType', tradeType)
22
22
 
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Binance
4
+ class Spot
5
+ # Dual Investment endpoints
6
+ # @see https://developers.binance.com/en/docs/catalog/investment-and-services-dual-investment
7
+ module DCI
8
+ # Get Dual Investment product list (USER_DATA)
9
+ #
10
+ # GET /sapi/v1/dci/product/list
11
+ #
12
+ # @param optionType [String] CALL or PUT
13
+ # @param exercisedCoin [String] Target exercised asset
14
+ # @param investCoin [String] Asset used for subscribing
15
+ # @param kwargs [Hash]
16
+ # @option kwargs [Integer] :pageSize Number of records per page
17
+ # @option kwargs [Integer] :pageIndex Page index
18
+ # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
19
+ # @see https://developers.binance.com/en/docs/catalog/investment-and-services-dual-investment/api/rest-api/market-data#get-dual-investment-product-list
20
+ def dual_investment_products(optionType:, exercisedCoin:, investCoin:, **kwargs)
21
+ Binance::Utils::Validation.require_param('optionType', optionType)
22
+ Binance::Utils::Validation.require_param('exercisedCoin', exercisedCoin)
23
+ Binance::Utils::Validation.require_param('investCoin', investCoin)
24
+
25
+ @session.sign_request(:get, '/sapi/v1/dci/product/list', params: kwargs.merge(
26
+ optionType: optionType,
27
+ exercisedCoin: exercisedCoin,
28
+ investCoin: investCoin
29
+ ))
30
+ end
31
+
32
+ # Get Dual Investment positions (USER_DATA)
33
+ #
34
+ # GET /sapi/v1/dci/product/positions
35
+ #
36
+ # @param kwargs [Hash]
37
+ # @option kwargs [String] :status PENDING, PURCHASE_SUCCESS, SETTLED, PURCHASE_FAIL, REFUNDING, REFUND_SUCCESS or SETTLING. All statuses if omitted
38
+ # @option kwargs [Integer] :pageSize Number of records per page
39
+ # @option kwargs [Integer] :pageIndex Page index
40
+ # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
41
+ # @see https://developers.binance.com/en/docs/catalog/investment-and-services-dual-investment/api/rest-api/trade#get-dual-investment-positions
42
+ def dual_investment_positions(**kwargs)
43
+ @session.sign_request(:get, '/sapi/v1/dci/product/positions', params: kwargs)
44
+ end
45
+ end
46
+ end
47
+ end
@@ -9,7 +9,7 @@ module Binance
9
9
  # - trades
10
10
  # - orderbook
11
11
  # - etc
12
- # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#market-data-endpoints
12
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints
13
13
  module Market
14
14
  # Test Connectivity
15
15
  #
@@ -54,6 +54,26 @@ module Binance
54
54
  )
55
55
  end
56
56
 
57
+ # Query Execution Rules
58
+ #
59
+ # GET /api/v3/executionRules
60
+ #
61
+ # @param kwargs [Hash]
62
+ # @option kwargs [string] :symbol
63
+ # @option kwargs [string] :symbols
64
+ # @option kwargs [string] :symbolStatus Supported values: TRADING, HALT, BREAK
65
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints#query-execution-rules
66
+ def execution_rules(**kwargs)
67
+ if kwargs[:symbols].is_a?(Array)
68
+ kwargs[:symbols] = kwargs[:symbols].map { |v| "%22#{v}%22" }.join(',')
69
+ kwargs[:symbols] = "%5B#{kwargs[:symbols]}%5D"
70
+ end
71
+ @session.public_request(
72
+ path: '/api/v3/executionRules',
73
+ params: kwargs
74
+ )
75
+ end
76
+
57
77
  # Order Book
58
78
  #
59
79
  # GET /api/v3/depth
@@ -61,6 +81,7 @@ module Binance
61
81
  # @param symbol [String] the symbol
62
82
  # @param kwargs [Hash]
63
83
  # @option kwargs [Integer] :limit Default 100; max 1000. Valid limits:[5, 10, 20, 50, 100, 500, 1000, 5000]
84
+ # @option kwargs [String] :symbolStatus Valid values: TRADING, HALT, BREAK
64
85
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#order-book
65
86
  def depth(symbol:, **kwargs)
66
87
  Binance::Utils::Validation.require_param('symbol', symbol)
@@ -209,11 +230,16 @@ module Binance
209
230
  # GET /api/v3/ticker/24hr
210
231
  #
211
232
  # @param symbol [String] the symbol
233
+ # @param kwargs [Hash]
234
+ # @option kwargs [String] :symbol Either symbol or symbols must be provided
235
+ # @option kwargs [String] :symbols
236
+ # @option kwargs [String] :type Default: FULL Supported values: FULL or MINI
237
+ # @option kwargs [String] :symbolStatus Valid values: TRADING, HALT, BREAK
212
238
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#24hr-ticker-price-change-statistics
213
- def ticker_24hr(symbol: nil)
239
+ def ticker_24hr(symbol: nil, **kwargs)
214
240
  @session.public_request(
215
241
  path: '/api/v3/ticker/24hr',
216
- params: { symbol: symbol }
242
+ params: kwargs.merge(symbol: symbol)
217
243
  )
218
244
  end
219
245
 
@@ -228,13 +254,14 @@ module Binance
228
254
  # @option kwargs [string] :symbols
229
255
  # @option kwargs [String] :timeZone Default: 0 (UTC)
230
256
  # @option kwargs [String] :type Supported values: FULL or MINI. Default: FULL
257
+ # @option kwargs [String] :symbolStatus Valid values: TRADING, HALT, BREAK
231
258
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#trading-day-ticker
232
259
  def ticker_trading_day(symbol: nil, symbols: nil, **kwargs)
233
260
  raise Binance::DuplicatedParametersError.new('symbol', 'symbols') unless symbols.nil? || symbol.nil?
234
261
 
235
262
  if symbols
236
263
  symbols = symbols.map { |s| "\"#{s}\"" }.join(',')
237
- symbols = { symbols: "\[#{symbols}\]".upcase }
264
+ symbols = "\[#{symbols}\]".upcase
238
265
  end
239
266
 
240
267
  @session.public_request(
@@ -253,11 +280,13 @@ module Binance
253
280
  # GET /api/v3/ticker/price
254
281
  #
255
282
  # @param symbol [String] the symbol
283
+ # @param kwargs [Hash]
284
+ # @option kwargs [String] :symbolStatus Valid values: TRADING, HALT, BREAK
256
285
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-price-ticker
257
- def ticker_price(symbol: nil)
286
+ def ticker_price(symbol: nil, **kwargs)
258
287
  @session.public_request(
259
288
  path: '/api/v3/ticker/price',
260
- params: { symbol: symbol }
289
+ params: kwargs.merge(symbol: symbol)
261
290
  )
262
291
  end
263
292
 
@@ -268,11 +297,13 @@ module Binance
268
297
  # GET /api/v3/ticker/bookTicker
269
298
  #
270
299
  # @param symbol [String] the symbol
300
+ # @param kwargs [Hash]
301
+ # @option kwargs [String] :symbolStatus Valid values: TRADING, HALT, BREAK
271
302
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-order-book-ticker
272
- def book_ticker(symbol: nil)
303
+ def book_ticker(symbol: nil, **kwargs)
273
304
  @session.public_request(
274
305
  path: '/api/v3/ticker/bookTicker',
275
- params: { symbol: symbol }
306
+ params: kwargs.merge(symbol: symbol)
276
307
  )
277
308
  end
278
309
 
@@ -283,7 +314,10 @@ module Binance
283
314
  # GET /api/v3/ticker
284
315
  #
285
316
  # @param symbol [String] the symbol
286
- # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#rolling-window-price-change-statistics
317
+ # @param kwargs [Hash]
318
+ # @option kwargs [String] :windowSize Default: 1d
319
+ # @option kwargs [String] :symbolStatus Valid values: TRADING, HALT, BREAK
320
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-order-book-ticker
287
321
  def ticker(symbol: nil, symbols: nil, windowSize: '1d')
288
322
  raise Binance::DuplicatedParametersError.new('symbol', 'symbols') unless symbols.nil? || symbol.nil?
289
323
 
@@ -301,6 +335,56 @@ module Binance
301
335
  params: params
302
336
  )
303
337
  end
338
+
339
+ # Query Reference Price
340
+ #
341
+ # GET /api/v3/referencePrice
342
+ #
343
+ # @param symbol [String] the symbol
344
+ # see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#query-reference-price
345
+ def reference_price(symbol:)
346
+ Binance::Utils::Validation.require_param('symbol', symbol)
347
+
348
+ @session.public_request(
349
+ path: '/api/v3/referencePrice',
350
+ params: { symbol: symbol }
351
+ )
352
+ end
353
+
354
+ # Query Reference Price Calculation
355
+ #
356
+ # GET /api/v3/referencePrice/calculation
357
+ #
358
+ # @param symbol [String] the symbol
359
+ # @param kwargs [Hash]
360
+ # @option kwargs [Integer] :symbolStatus Supported values: TRADING, HALT, BREAK
361
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#query-reference-price-calculation
362
+ def reference_price_calculation(symbol:, **kwargs)
363
+ Binance::Utils::Validation.require_param('symbol', symbol)
364
+
365
+ @session.public_request(
366
+ path: '/api/v3/referencePrice/calculation',
367
+ params: { symbol: symbol }.merge(kwargs)
368
+ )
369
+ end
370
+
371
+ # Historical Block Trades
372
+ #
373
+ # GET /api/v3/historicalBlockTrades
374
+ #
375
+ # @param symbol [String] the symbol
376
+ # @param kwargs [Hash]
377
+ # @option kwargs [Integer] :limit Default 500; max 1000.
378
+ # @option kwargs [Integer] :fromId
379
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#historical-block-trades
380
+ def historical_block_trades(symbol:, **kwargs)
381
+ Binance::Utils::Validation.require_param('symbol', symbol)
382
+
383
+ @session.public_request(
384
+ path: '/api/v3/historicalBlockTrades',
385
+ params: { symbol: symbol }.merge(kwargs)
386
+ )
387
+ end
304
388
  end
305
389
  end
306
390
  end
@@ -14,7 +14,7 @@ module Binance
14
14
  # @option kwargs [Integer] :current Currently querying page. Start from 1. Default:1
15
15
  # @option kwargs [Integer] :size Default:10, Max:100
16
16
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
17
- # @see https://developers.binance.com/docs/simple_earn/account/Get-Simple-Earn-Flexible-Product-List
17
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Simple-Earn-Flexible-Product-List
18
18
  def flexible_product_list(**kwargs)
19
19
  @session.sign_request(:get, '/sapi/v1/simple-earn/flexible/list', params: kwargs)
20
20
  end
@@ -28,7 +28,7 @@ module Binance
28
28
  # @option kwargs [Integer] :current Currently querying page. Start from 1. Default:1
29
29
  # @option kwargs [Integer] :size Default:10, Max:100
30
30
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
31
- # @see https://developers.binance.com/docs/simple_earn/account/Get-Simple-Earn-Locked-Product-List
31
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Simple-Earn-Locked-Product-List
32
32
  def locked_product_list(**kwargs)
33
33
  @session.sign_request(:get, '/sapi/v1/simple-earn/locked/list', params: kwargs)
34
34
  end
@@ -43,7 +43,7 @@ module Binance
43
43
  # @option kwargs [Boolean] :autoSubscribe true or false, default true
44
44
  # @option kwargs [String] :sourceAccount SPOT,FUND,ALL, default SPOT
45
45
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
46
- # @see https://developers.binance.com/docs/simple_earn/earn/Subscribe-Flexible-Product
46
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/earn
47
47
  def flexible_subscribe(productId:, amount:, **kwargs)
48
48
  Binance::Utils::Validation.require_param('productId', productId)
49
49
  Binance::Utils::Validation.require_param('amount', amount)
@@ -65,7 +65,7 @@ module Binance
65
65
  # @option kwargs [String] :sourceAccount SPOT,FUND,ALL, default SPOT
66
66
  # @option kwargs [String] :redeemTo SPOT,FLEXIBLE, default FLEXIBLE
67
67
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
68
- # @see https://developers.binance.com/docs/simple_earn/earn/Subscribe-Locked-Product
68
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Subscribe-Locked-Product
69
69
  def locked_subscribe(projectId:, amount:, **kwargs)
70
70
  Binance::Utils::Validation.require_param('projectId', projectId)
71
71
  Binance::Utils::Validation.require_param('amount', amount)
@@ -86,7 +86,7 @@ module Binance
86
86
  # @option kwargs [Float] :amount if redeemAll is false, amount is mandatory
87
87
  # @option kwargs [String] :destAccount SPOT,FUND,ALL, default SPOT
88
88
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
89
- # @see https://developers.binance.com/docs/simple_earn/earn/Redeem-Flexible-Product
89
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Redeem-Flexible-Product
90
90
  def flexible_redeem_product(productId:, **kwargs)
91
91
  Binance::Utils::Validation.require_param('productId', productId)
92
92
 
@@ -102,7 +102,7 @@ module Binance
102
102
  # @param positionId [String]
103
103
  # @param kwargs [Hash]
104
104
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
105
- # @see https://developers.binance.com/docs/simple_earn/earn/Redeem-Locked-Product
105
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Redeem-Locked-Product
106
106
  def locked_redeem_product(positionId:, **kwargs)
107
107
  Binance::Utils::Validation.require_param('positionId', positionId)
108
108
 
@@ -121,7 +121,7 @@ module Binance
121
121
  # @option kwargs [Integer] :current Currently querying the page. Start from 1. Default:1
122
122
  # @option kwargs [Integer] :size Default:10, Max:100
123
123
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
124
- # @see https://developers.binance.com/docs/simple_earn/account/Get-Flexible-Product-Position
124
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Flexible-Product-Position
125
125
  def flexible_product_position(**kwargs)
126
126
  @session.sign_request(:get, '/sapi/v1/simple-earn/flexible/position', params: kwargs)
127
127
  end
@@ -137,7 +137,7 @@ module Binance
137
137
  # @option kwargs [Integer] :current Currently querying the page. Start from 1. Default:1
138
138
  # @option kwargs [Integer] :size Default:10, Max:100
139
139
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
140
- # @see https://developers.binance.com/docs/simple_earn/account/Get-Locked-Product-Position
140
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Locked-Product-Position
141
141
  def locked_product_position(**kwargs)
142
142
  @session.sign_request(:get, '/sapi/v1/simple-earn/locked/position', params: kwargs)
143
143
  end
@@ -148,7 +148,7 @@ module Binance
148
148
  #
149
149
  # @param kwargs [Hash]
150
150
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
151
- # @see https://developers.binance.com/docs/simple_earn/account/Simple-Account
151
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/account
152
152
  def simple_earn_account(**kwargs)
153
153
  @session.sign_request(:get, '/sapi/v1/simple-earn/account', params: kwargs)
154
154
  end
@@ -166,7 +166,7 @@ module Binance
166
166
  # @option kwargs [Integer] :current Currently querying the page. Start from 1. Default:1
167
167
  # @option kwargs [Integer] :size Default:10, Max:100
168
168
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
169
- # @see https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Subscription-Record
169
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/history
170
170
  def flexible_subscription_record(**kwargs)
171
171
  @session.sign_request(:get, '/sapi/v1/simple-earn/flexible/history/subscriptionRecord', params: kwargs)
172
172
  end
@@ -183,7 +183,7 @@ module Binance
183
183
  # @option kwargs [Integer] :current Currently querying the page. Start from 1. Default:1
184
184
  # @option kwargs [Integer] :size Default:10, Max:100
185
185
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
186
- # @see https://developers.binance.com/docs/simple_earn/history/Get-Locked-Subscription-Record
186
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Locked-Subscription-Record
187
187
  def locked_subscription_record(**kwargs)
188
188
  @session.sign_request(:get, '/sapi/v1/simple-earn/locked/history/subscriptionRecord', params: kwargs)
189
189
  end
@@ -201,7 +201,7 @@ module Binance
201
201
  # @option kwargs [Integer] :current Currently querying the page. Start from 1. Default:1
202
202
  # @option kwargs [Integer] :size Default:10, Max:100
203
203
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
204
- # @see https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Redemption-Record
204
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Flexible-Redemption-Record
205
205
  def flexible_redemption_record(**kwargs)
206
206
  @session.sign_request(:get, '/sapi/v1/simple-earn/flexible/history/redemptionRecord', params: kwargs)
207
207
  end
@@ -219,7 +219,7 @@ module Binance
219
219
  # @option kwargs [Integer] :current Currently querying the page. Start from 1. Default:1
220
220
  # @option kwargs [Integer] :size Default:10, Max:100
221
221
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
222
- # @see https://developers.binance.com/docs/simple_earn/history/Get-Locked-Redemption-Record
222
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Locked-Redemption-Record
223
223
  def locked_redemption_record(**kwargs)
224
224
  @session.sign_request(:get, '/sapi/v1/simple-earn/locked/history/redemptionRecord', params: kwargs)
225
225
  end
@@ -237,7 +237,7 @@ module Binance
237
237
  # @option kwargs [Integer] :current Currently querying the page. Start from 1. Default:1
238
238
  # @option kwargs [Integer] :size Default:10, Max:100
239
239
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
240
- # @see https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Rewards-History
240
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Flexible-Rewards-History
241
241
  def flexible_rewards_history(type:, **kwargs)
242
242
  Binance::Utils::Validation.require_param('type', type)
243
243
 
@@ -256,7 +256,7 @@ module Binance
256
256
  # @option kwargs [Integer] :current Currently querying the page. Start from 1. Default:1
257
257
  # @option kwargs [Integer] :size Default:10, Max:100
258
258
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
259
- # @see https://developers.binance.com/docs/simple_earn/history/Get-Locked-Rewards-History
259
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Locked-Rewards-History
260
260
  def locked_rewards_history(**kwargs)
261
261
  @session.sign_request(:get, '/sapi/v1/simple-earn/locked/history/rewardsRecord', params: kwargs)
262
262
  end
@@ -269,7 +269,7 @@ module Binance
269
269
  # @param autoSubscribe [Boolean] true or false
270
270
  # @param kwargs [Hash]
271
271
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
272
- # @see https://developers.binance.com/docs/simple_earn/earn/Set-Flexible-Auto-Subscribe
272
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Set-Flexible-Auto-Subscribe
273
273
  def flexible_auto_subscribe(productId:, autoSubscribe:, **kwargs)
274
274
  Binance::Utils::Validation.require_param('productId', productId)
275
275
  Binance::Utils::Validation.require_param('autoSubscribe', autoSubscribe)
@@ -288,7 +288,7 @@ module Binance
288
288
  # @param autoSubscribe [Boolean] true or false
289
289
  # @param kwargs [Hash]
290
290
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
291
- # @see https://developers.binance.com/docs/simple_earn/earn/Set-Locked-Auto-Subscribe
291
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Set-Locked-Auto-Subscribe
292
292
  def locked_auto_subscribe(positionId:, autoSubscribe:, **kwargs)
293
293
  Binance::Utils::Validation.require_param('positionId', positionId)
294
294
  Binance::Utils::Validation.require_param('autoSubscribe', autoSubscribe)
@@ -306,7 +306,7 @@ module Binance
306
306
  # @param productId [String]
307
307
  # @param kwargs [Hash]
308
308
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
309
- # @see https://developers.binance.com/docs/simple_earn/account/Get-Flexible-Personal-Left-Quota
309
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Flexible-Personal-Left-Quota
310
310
  def flexible_personal_left_quota(productId:, **kwargs)
311
311
  Binance::Utils::Validation.require_param('productId', productId)
312
312
 
@@ -320,7 +320,7 @@ module Binance
320
320
  # @param projectId [String]
321
321
  # @param kwargs [Hash]
322
322
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
323
- # @see https://developers.binance.com/docs/simple_earn/account/Get-Locked-Personal-Left-Quota
323
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Locked-Personal-Left-Quota
324
324
  def locked_personal_left_quota(projectId:, **kwargs)
325
325
  Binance::Utils::Validation.require_param('projectId', projectId)
326
326
 
@@ -335,7 +335,7 @@ module Binance
335
335
  # @param amount [Float]
336
336
  # @param kwargs [Hash]
337
337
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
338
- # @see https://developers.binance.com/docs/simple_earn/earn/Get-Flexible-Subscription-Preview
338
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Get-Flexible-Subscription-Preview
339
339
  def flexible_subscription_preview(productId:, amount:, **kwargs)
340
340
  Binance::Utils::Validation.require_param('productId', productId)
341
341
  Binance::Utils::Validation.require_param('amount', amount)
@@ -355,7 +355,7 @@ module Binance
355
355
  # @param kwargs [Hash]
356
356
  # @option kwargs [Boolean] :autoSubscribe true or false, default true
357
357
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
358
- # @see https://developers.binance.com/docs/simple_earn/earn/Get-Locked-Subscription-Preview
358
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Get-Locked-Subscription-Preview
359
359
  def locked_subscription_preview(projectId:, amount:, **kwargs)
360
360
  Binance::Utils::Validation.require_param('projectId', projectId)
361
361
  Binance::Utils::Validation.require_param('amount', amount)
@@ -374,7 +374,7 @@ module Binance
374
374
  # @param redeemTo [String] SPOT or FLEXIBLE
375
375
  # @param kwargs [Hash]
376
376
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
377
- # @see https://developers.binance.com/docs/simple_earn/earn/Set-Locked-Redeem-Option
377
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Set-Locked-Redeem-Option
378
378
  def locked_redeem_option(positionId:, redeemTo:, **kwargs)
379
379
  Binance::Utils::Validation.require_param('positionId', positionId)
380
380
  Binance::Utils::Validation.require_param('redeemTo', redeemTo)
@@ -396,7 +396,7 @@ module Binance
396
396
  # @option kwargs [Integer] :current Currently querying the page. Start from 1. Default:1
397
397
  # @option kwargs [Integer] :size Default:10, Max:100
398
398
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
399
- # @see https://developers.binance.com/docs/simple_earn/history/Get-Rate-History
399
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Rate-History
400
400
  def rate_history(productId:, **kwargs)
401
401
  Binance::Utils::Validation.require_param('productId', productId)
402
402
 
@@ -414,7 +414,7 @@ module Binance
414
414
  # @option kwargs [Integer] :current Currently querying the page. Start from 1. Default:1
415
415
  # @option kwargs [Integer] :size Default:10, Max:100
416
416
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
417
- # @see https://developers.binance.com/docs/simple_earn/history/Get-Collateral-Record
417
+ # @see https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Collateral-Record
418
418
  def collateral_record(**kwargs)
419
419
  @session.sign_request(:get, '/sapi/v1/simple-earn/flexible/history/collateralRecord', params: kwargs)
420
420
  end
@@ -9,6 +9,7 @@ module Binance
9
9
  # - account information
10
10
  # - my trades
11
11
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints
12
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints
12
13
  module Trade
13
14
  # TestNew Order
14
15
  #
@@ -30,6 +31,7 @@ module Binance
30
31
  # @option kwargs [String] :newOrderRespType Set the response JSON. ACK, RESULT, or FULL.
31
32
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
32
33
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#test-new-order-trade
34
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#test-new-order-trade
33
35
  def new_order_test(symbol:, side:, type:, **kwargs)
34
36
  Binance::Utils::Validation.require_param('symbol', symbol)
35
37
  Binance::Utils::Validation.require_param('side', side)
@@ -57,11 +59,19 @@ module Binance
57
59
  # @option kwargs [Float] :quoteOrderQty
58
60
  # @option kwargs [Float] :price
59
61
  # @option kwargs [String] :newClientOrderId
62
+ # @option kwargs [Integer] :strategyId
63
+ # @option kwargs [Integer] :strategyType
60
64
  # @option kwargs [Float] :stopPrice
65
+ # @option kwargs [Integer] :trailingDelta
61
66
  # @option kwargs [Float] :icebergeQty
62
67
  # @option kwargs [String] :newOrderRespType Set the response JSON. ACK, RESULT, or FULL.
68
+ # @option kwargs [String] :selfTradePreventionMode
69
+ # @option kwargs [String] :pegPriceType PRIMARY_PEG or MARKET_PEG.
70
+ # @option kwargs [Integer] :pegOffsetValue
71
+ # @option kwargs [String] :pegOffsetType
63
72
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
64
73
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade
74
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade
65
75
  def new_order(symbol:, side:, type:, **kwargs)
66
76
  Binance::Utils::Validation.require_param('symbol', symbol)
67
77
  Binance::Utils::Validation.require_param('side', side)
@@ -99,6 +109,7 @@ module Binance
99
109
  # @param kwargs [Hash]
100
110
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
101
111
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade
112
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade
102
113
  def cancel_open_orders(symbol:, **kwargs)
103
114
  Binance::Utils::Validation.require_param('symbol', symbol)
104
115
 
@@ -115,6 +126,7 @@ module Binance
115
126
  # @option kwargs [String] :origClientOrderId
116
127
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
117
128
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-user_data
129
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-user_data
118
130
  def get_order(symbol:, **kwargs)
119
131
  Binance::Utils::Validation.require_param('symbol', symbol)
120
132
 
@@ -129,6 +141,7 @@ module Binance
129
141
  # @option kwargs [String] :symbol the symbol
130
142
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
131
143
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#current-open-orders-user_data
144
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#current-open-orders-user_data
132
145
  def open_orders(**kwargs)
133
146
  @session.sign_request(:get, '/api/v3/openOrders', params: kwargs)
134
147
  end
@@ -147,6 +160,7 @@ module Binance
147
160
  # @option kwargs [String] :limit Default 500; max 1000.
148
161
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
149
162
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#all-orders-user_data
163
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#all-orders-user_data
150
164
  def all_orders(symbol:, **kwargs)
151
165
  Binance::Utils::Validation.require_param('symbol', symbol)
152
166
 
@@ -155,9 +169,10 @@ module Binance
155
169
 
156
170
  # New OCO (TRADE)
157
171
  #
158
- # POST /api/v3/order/oco
172
+ # POST /api/v3/orderList/oco
159
173
  #
160
- # Send in a new OCO
174
+ # Send in a new OCO. Same as {#new_oco_order_list}.
175
+ # The deprecated POST /api/v3/order/oco endpoint is no longer used.
161
176
  #
162
177
  # @param symbol [String] the symbol
163
178
  # @param side [String]
@@ -168,20 +183,21 @@ module Binance
168
183
  # @option kwargs [String] :listClientOrderId
169
184
  # @option kwargs [String] :aboveClientOrderId Arbitrary unique ID among open orders for the above order. Automatically generated if not sent
170
185
  # @option kwargs [Integer] :aboveIcebergQty Note that this can only be used if aboveTimeInForce is GTC
171
- # @option kwargs [Float] :abovePrice
172
- # @option kwargs [Float] :aboveStopPriceCan be used if aboveType is STOP_LOSS or STOP_LOSS_LIMIT. Either aboveStopPrice or aboveTrailingDelta or both, must be specified.
186
+ # @option kwargs [Float] :abovePrice Can be used if aboveType is STOP_LOSS_LIMIT, LIMIT_MAKER or TAKE_PROFIT_LIMIT to specify the limit price.
187
+ # @option kwargs [Float] :aboveStopPrice Can be used if aboveType is STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT or TAKE_PROFIT_LIMIT. Either this, aboveTrailingDelta or both must be sent
173
188
  # @option kwargs [Integer] :aboveTrailingDelta
174
- # @option kwargs [Float] :aboveTimeInForce Required if the aboveType is STOP_LOSS_LIMIT.
189
+ # @option kwargs [String] :aboveTimeInForce Required if aboveType is STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT
175
190
  # @option kwargs [Integer] :aboveStrategyId Arbitrary numeric value identifying the above order within an order strategy.
176
191
  # @option kwargs [Integer] :aboveStrategyType Arbitrary numeric value identifying the above order strategy. Values smaller than 1000000 are reserved and cannot be used.
177
192
  # @option kwargs [String] :belowClientOrderId Arbitrary unique ID among open orders for the below order. Automatically generated if not sent
178
193
  # @option kwargs [Integer] :belowIcebergQty Note that this can only be used if belowTimeInForce is GTC
179
- # @option kwargs [Float] :belowPrice Can be used if belowType is STOP_LOSS_LIMIT or LIMIT_MAKER to specify the limit price.
180
- # @option kwargs [Float] :belowStopPrice Can be used if belowType is STOP_LOSS or STOP_LOSS_LIMIT. Either belowStopPrice or belowTrailingDelta or both, must be specified.
194
+ # @option kwargs [Float] :belowPrice Can be used if belowType is STOP_LOSS_LIMIT, LIMIT_MAKER or TAKE_PROFIT_LIMIT to specify the limit price.
195
+ # @option kwargs [Float] :belowStopPrice Can be used if belowType is STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT or TAKE_PROFIT_LIMIT. Either this, belowTrailingDelta or both must be sent
181
196
  # @option kwargs [Integer] :belowTrailingDelta
182
- # @option kwargs [String] :belowTimeInForce Required if the belowType is STOP_LOSS_LIMIT
197
+ # @option kwargs [String] :belowTimeInForce Required if belowType is STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT
183
198
  # @option kwargs [Integer] :belowStrategyId Arbitrary numeric value identifying the below order within an order strategy
184
- # @option kwargs [String] :belowStrategyType Arbitrary numeric value identifying the below order strategy. Values smaller than 1000000 are reserved and cannot be used.
199
+ # @option kwargs [Integer] :belowStrategyType Arbitrary numeric value identifying the below order strategy. Values smaller than 1000000 are reserved and cannot be used.
200
+ # @option kwargs [String] :selfTradePreventionMode
185
201
  # @option kwargs [String] :newOrderRespType
186
202
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
187
203
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oco-trade
@@ -192,7 +208,7 @@ module Binance
192
208
  Binance::Utils::Validation.require_param('aboveType', aboveType)
193
209
  Binance::Utils::Validation.require_param('belowType', belowType)
194
210
 
195
- @session.sign_request(:post, '/api/v3/order/oco', params: kwargs.merge(
211
+ @session.sign_request(:post, '/api/v3/orderList/oco', params: kwargs.merge(
196
212
  symbol: symbol,
197
213
  side: side,
198
214
  quantity: quantity,
@@ -212,6 +228,7 @@ module Binance
212
228
  # @option kwargs [String] :newClientOrderId
213
229
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
214
230
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-list-trade
231
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-list-trade
215
232
  def cancel_order_list(symbol:, **kwargs)
216
233
  Binance::Utils::Validation.require_param('symbol', symbol)
217
234
 
@@ -229,6 +246,7 @@ module Binance
229
246
  # @option kwargs [String] :orgClientOrderId
230
247
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
231
248
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-list-user_data
249
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-list-user_data
232
250
  def order_list(**kwargs)
233
251
  @session.sign_request(:get, '/api/v3/orderList', params: kwargs)
234
252
  end
@@ -246,6 +264,7 @@ module Binance
246
264
  # @option kwargs [String] :limit Default 500; max 1000.
247
265
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
248
266
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-all-order-lists-user_data
267
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-all-order-lists-user_data
249
268
  def all_order_list(**kwargs)
250
269
  @session.sign_request(:get, '/api/v3/allOrderList', params: kwargs)
251
270
  end
@@ -257,6 +276,7 @@ module Binance
257
276
  # @param kwargs [Hash]
258
277
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
259
278
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-open-order-lists-user_data
279
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-open-order-lists-user_data
260
280
  def open_order_list(**kwargs)
261
281
  @session.sign_request(:get, '/api/v3/openOrderList', params: kwargs)
262
282
  end
@@ -267,7 +287,7 @@ module Binance
267
287
  #
268
288
  # @param kwargs [Hash]
269
289
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
270
- # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-information-user_data
290
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#account-information-user_data
271
291
  def account(**kwargs)
272
292
  @session.sign_request(:get, '/api/v3/account', params: kwargs)
273
293
  end
@@ -284,7 +304,7 @@ module Binance
284
304
  # @option kwargs [Integer] :fromId TradeId to fetch from. Default gets most recent trades.
285
305
  # @option kwargs [Integer] :limit Default 500; max 1000.
286
306
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
287
- # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-trade-list-user_data
307
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#account-trade-list-user_data
288
308
  def my_trades(symbol:, **kwargs)
289
309
  @session.sign_request(:get, '/api/v3/myTrades', params: kwargs.merge(symbol: symbol))
290
310
  end
@@ -295,7 +315,7 @@ module Binance
295
315
  #
296
316
  # @param kwargs [Hash]
297
317
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
298
- # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-unfilled-order-count-user_data
318
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-unfilled-order-count-user_data
299
319
  def get_order_rate_limit(**kwargs)
300
320
  @session.sign_request(:get, '/api/v3/rateLimit/order', params: kwargs)
301
321
  end
@@ -311,7 +331,7 @@ module Binance
311
331
  # @param kwargs [Integer] :fromPreventedMatchId
312
332
  # @param kwargs [Integer] :limit Default: 500; Max: 1000
313
333
  # @param kwargs [Integer] :recvWindow The value cannot be greater than 60000
314
- # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-prevented-matches-user_data
334
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-prevented-matches-user_data
315
335
  def my_prevented_matches(symbol:, **kwargs)
316
336
  Binance::Utils::Validation.require_param('symbol', symbol)
317
337
 
@@ -329,7 +349,7 @@ module Binance
329
349
  # @param kwargs [Integer] :fromAllocationId
330
350
  # @param kwargs [Integer] :limit Default 500;Max 1000
331
351
  # @param kwargs [Integer] :orderId
332
- # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-allocations-user_data
352
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-allocations-user_data
333
353
  def my_allocations(symbol:, **kwargs)
334
354
  Binance::Utils::Validation.require_param('symbol', symbol)
335
355
 
@@ -341,13 +361,45 @@ module Binance
341
361
  # GET /api/v3/account/commission
342
362
  #
343
363
  # @param symbol [String]
344
- # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-commission-rates-user_data
364
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-commission-rates-user_data
345
365
  def commission_rate(symbol:)
346
366
  Binance::Utils::Validation.require_param('symbol', symbol)
347
367
 
348
368
  @session.sign_request(:get, '/api/v3/account/commission', params: { symbol: symbol })
349
369
  end
350
370
 
371
+ # Query Order Amendments (USER_DATA)
372
+ #
373
+ # GET /api/v3/order/amendments
374
+ #
375
+ # @param symbol [String]
376
+ # @param orderId [Integer]
377
+ # @param kwargs [Hash]
378
+ # @option kwargs [Integer] :fromExecutionId
379
+ # @option kwargs [Integer] :limit
380
+ # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
381
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-order-amendments-user_data
382
+ def order_amendments(symbol:, orderId:, **kwargs)
383
+ Binance::Utils::Validation.require_param('symbol', symbol)
384
+ Binance::Utils::Validation.require_param('orderId', orderId)
385
+
386
+ @session.sign_request(:get, '/api/v3/order/amendments', params: kwargs.merge(symbol: symbol, orderId: orderId))
387
+ end
388
+
389
+ # Query relevant filters (USER_DATA)
390
+ #
391
+ # GET /api/v3/myFilters
392
+ #
393
+ # @param symbol [String]
394
+ # @param kwargs [Hash]
395
+ # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
396
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-relevant-filters-user_data
397
+ def my_filters(symbol:, **kwargs)
398
+ Binance::Utils::Validation.require_param('symbol', symbol)
399
+
400
+ @session.sign_request(:get, '/api/v3/myFilters', params: kwargs.merge(symbol: symbol))
401
+ end
402
+
351
403
  # Cancel an Existing Order and Send a New Order (TRADE)
352
404
  #
353
405
  # POST /api/v3/order/cancelReplace
@@ -375,6 +427,9 @@ module Binance
375
427
  # @option kwargs [String] :cancelRestrictions ONLY_NEW - Cancel will succeed if the order status is NEW. ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED
376
428
  # @option kwargs [String] :orderRateLimitExceededMode DO_NOTHING (default)- will only attempt to cancel the order if account has not exceeded the unfilled order rate limit
377
429
  # CANCEL_ONLY - will always cancel the order
430
+ # @option kwargs [String] :pegPriceType PRIMARY_PEG or MARKET_PEG.
431
+ # @option kwargs [Integer] :pegOffsetValue
432
+ # @option kwargs [String] :pegOffsetType
378
433
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
379
434
  # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-an-existing-order-and-send-a-new-order-trade
380
435
  def cancel_replace(symbol:, side:, type:, cancelReplaceMode:, **kwargs)
@@ -391,6 +446,350 @@ module Binance
391
446
  cancelReplaceMode: cancelReplaceMode
392
447
  ))
393
448
  end
449
+
450
+ # Order Amend Keep Priority (TRADE)
451
+ #
452
+ # PUT /api/v3/order/amend/keepPriority
453
+ #
454
+ # @param symbol [String]
455
+ # @param newQty [Float]
456
+ # @param kwargs [Hash]
457
+ # @option kwargs [Integer] :orderId
458
+ # @option kwargs [String] :origClientOrderId
459
+ # @option kwargs [String] :newClientOrderId
460
+ # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
461
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#order-amend-keep-priority-trade
462
+ def amend_keep_priority(symbol:, newQty:, **kwargs)
463
+ Binance::Utils::Validation.require_param('symbol', symbol)
464
+ Binance::Utils::Validation.require_param('newQty', newQty)
465
+
466
+ @session.sign_request(:put, '/api/v3/order/amend/keepPriority',
467
+ params: kwargs.merge(
468
+ symbol: symbol,
469
+ newQty: newQty
470
+ ))
471
+ end
472
+
473
+ # New Order list - OCO (TRADE)
474
+ #
475
+ # POST /api/v3/orderList/oco
476
+ #
477
+ # @param symbol [String]
478
+ # @param side [String]
479
+ # @param quantity [Float]
480
+ # @param aboveType [String]
481
+ # @param belowType [String]
482
+ # @param kwargs [Hash]
483
+ # @option kwargs [String] :listClientOrderId
484
+ # @option kwargs [String] :aboveClientOrderId
485
+ # @option kwargs [Integer] :aboveIcebergQty
486
+ # @option kwargs [Float] :abovePrice
487
+ # @option kwargs [Float] :aboveStopPrice
488
+ # @option kwargs [Integer] :aboveTrailingDelta
489
+ # @option kwargs [String] :aboveTimeInForce
490
+ # @option kwargs [Integer] :aboveStrategyId
491
+ # @option kwargs [Integer] :aboveStrategyType
492
+ # @option kwargs [Integer] :abovePegPriceType
493
+ # @option kwargs [Integer] :abovePegOffsetType
494
+ # @option kwargs [Integer] :abovePegOffsetValue
495
+ # @option kwargs [String] :belowClientOrderId
496
+ # @option kwargs [Integer] :belowIcebergQty
497
+ # @option kwargs [Float] :belowPrice
498
+ # @option kwargs [Float] :belowStopPrice
499
+ # @option kwargs [Integer] :belowTrailingDelta
500
+ # @option kwargs [String] :belowTimeInForce
501
+ # @option kwargs [Integer] :belowStrategyId
502
+ # @option kwargs [Integer] :belowStrategyType
503
+ # @option kwargs [Integer] :belowPegPriceType
504
+ # @option kwargs [Integer] :belowPegOffsetType
505
+ # @option kwargs [Integer] :belowPegOffsetValue
506
+ # @option kwargs [String] :selfTradePreventionMode
507
+ # @option kwargs [String] :newOrderRespType
508
+ # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
509
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oco-trade
510
+ def new_oco_order_list(symbol:, side:, quantity:, aboveType:, belowType:, **kwargs)
511
+ Binance::Utils::Validation.require_param('symbol', symbol)
512
+ Binance::Utils::Validation.require_param('side', side)
513
+ Binance::Utils::Validation.require_param('quantity', quantity)
514
+ Binance::Utils::Validation.require_param('aboveType', aboveType)
515
+ Binance::Utils::Validation.require_param('belowType', belowType)
516
+
517
+ @session.sign_request(:post, '/api/v3/orderList/oco',
518
+ params: kwargs.merge(
519
+ symbol: symbol,
520
+ side: side,
521
+ quantity: quantity,
522
+ aboveType: aboveType,
523
+ belowType: belowType
524
+ ))
525
+ end
526
+
527
+ # New Order list - OTO (TRADE)
528
+ #
529
+ # POST /api/v3/orderList/oto
530
+ #
531
+ # @param symbol [String]
532
+ # @param workingType [String] Supported values: LIMIT, LIMIT_MAKER
533
+ # @param workingSide [String]
534
+ # @param workingPrice [Float]
535
+ # @param workingQuantity [Float]
536
+ # @param pendingType [String]
537
+ # @param pendingSide [String]
538
+ # @param pendingQuantity [Float]
539
+ # @param kwargs [Hash]
540
+ # @option kwargs [String] :listClientOrderId
541
+ # @option kwargs [String] :newOrderRespType
542
+ # @option kwargs [String] :selfTradePreventionMode
543
+ # @option kwargs [String] :workingClientOrderId
544
+ # @option kwargs [Float] :workingIcebergQty
545
+ # @option kwargs [String] :workingTimeInForce
546
+ # @option kwargs [Integer] :workingStrategyId
547
+ # @option kwargs [Integer] :workingStrategyType
548
+ # @option kwargs [String] :workingPegPriceType
549
+ # @option kwargs [String] :workingPegOffsetType
550
+ # @option kwargs [Integer] :workingPegOffsetValue
551
+ # @option kwargs [String] :pendingClientOrderId
552
+ # @option kwargs [Float] :pendingPrice
553
+ # @option kwargs [Float] :pendingStopPrice
554
+ # @option kwargs [Float] :pendingTrailingDelta
555
+ # @option kwargs [Float] :pendingIcebergQty
556
+ # @option kwargs [String] :pendingTimeInForce
557
+ # @option kwargs [Integer] :pendingStrategyId
558
+ # @option kwargs [Integer] :pendingStrategyType
559
+ # @option kwargs [String] :pendingPegPriceType
560
+ # @option kwargs [String] :pendingPegOffsetType
561
+ # @option kwargs [Integer] :pendingPegOffsetValue
562
+ # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
563
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oto-trade
564
+ def new_oto_order_list(
565
+ symbol:,
566
+ workingType:,
567
+ workingSide:,
568
+ workingPrice:,
569
+ workingQuantity:,
570
+ pendingType:,
571
+ pendingSide:,
572
+ pendingQuantity:,
573
+ **kwargs
574
+ )
575
+ params = {
576
+ symbol: symbol,
577
+ workingType: workingType,
578
+ workingSide: workingSide,
579
+ workingPrice: workingPrice,
580
+ workingQuantity: workingQuantity,
581
+ pendingType: pendingType,
582
+ pendingSide: pendingSide,
583
+ pendingQuantity: pendingQuantity
584
+ }
585
+
586
+ params.each do |name, value|
587
+ Binance::Utils::Validation.require_param(name.to_s, value)
588
+ end
589
+
590
+ @session.sign_request(:post, '/api/v3/orderList/oto',
591
+ params: kwargs.merge(params))
592
+ end
593
+
594
+ # New Order list - OTOCO (TRADE)
595
+ #
596
+ # POST /api/v3/orderList/otoco
597
+ #
598
+ # @param symbol [String]
599
+ # @param workingType [String] Supported values: LIMIT, LIMIT_MAKER
600
+ # @param workingSide [String]
601
+ # @param workingPrice [Float]
602
+ # @param workingQuantity [Float]
603
+ # @param pendingSide [String]
604
+ # @param pendingQuantity [Float]
605
+ # @param pendingAboveType [String]
606
+ # @param kwargs [Hash]
607
+ # @option kwargs [String] :listClientOrderId
608
+ # @option kwargs [String] :newOrderRespType
609
+ # @option kwargs [String] :selfTradePreventionMode
610
+ # @option kwargs [String] :workingClientOrderId
611
+ # @option kwargs [Float] :workingIcebergQty
612
+ # @option kwargs [String] :workingTimeInForce
613
+ # @option kwargs [Integer] :workingStrategyId
614
+ # @option kwargs [Integer] :workingStrategyType
615
+ # @option kwargs [String] :workingPegPriceType
616
+ # @option kwargs [String] :workingPegOffsetType
617
+ # @option kwargs [Integer] :workingPegOffsetValue
618
+ # @option kwargs [String] :pendingAboveClientOrderId
619
+ # @option kwargs [Float] :pendingAbovePrice
620
+ # @option kwargs [Float] :pendingAboveStopPrice
621
+ # @option kwargs [Float] :pendingAboveTrailingDelta
622
+ # @option kwargs [Float] :pendingAboveIcebergQty
623
+ # @option kwargs [String] :pendingAboveTimeInForce
624
+ # @option kwargs [Integer] :pendingAboveStrategyId
625
+ # @option kwargs [Integer] :pendingAboveStrategyType
626
+ # @option kwargs [String] :pendingAbovePegPriceType
627
+ # @option kwargs [String] :pendingAbovePegOffsetType
628
+ # @option kwargs [Integer] :pendingAbovePegOffsetValue
629
+ # @option kwargs [String] :pendingBelowType
630
+ # @option kwargs [String] :pendingBelowClientOrderId
631
+ # @option kwargs [Float] :pendingBelowPrice
632
+ # @option kwargs [Float] :pendingBelowStopPrice
633
+ # @option kwargs [Float] :pendingBelowTrailingDelta
634
+ # @option kwargs [Float] :pendingBelowIcebergQty
635
+ # @option kwargs [String] :pendingBelowTimeInForce
636
+ # @option kwargs [Integer] :pendingBelowStrategyId
637
+ # @option kwargs [Integer] :pendingBelowStrategyType
638
+ # @option kwargs [String] :pendingBelowPegPriceType
639
+ # @option kwargs [String] :pendingBelowPegOffsetType
640
+ # @option kwargs [Integer] :pendingBelowPegOffsetValue
641
+ # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
642
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---otoco-trade
643
+ def new_otoco_order_list(symbol:, workingType:, workingSide:, workingPrice:, workingQuantity:, pendingSide:, pendingQuantity:, pendingAboveType:, **kwargs)
644
+ params = {
645
+ symbol: symbol,
646
+ workingType: workingType,
647
+ workingSide: workingSide,
648
+ workingPrice: workingPrice,
649
+ workingQuantity: workingQuantity,
650
+ pendingSide: pendingSide,
651
+ pendingQuantity: pendingQuantity,
652
+ pendingAboveType: pendingAboveType
653
+ }
654
+
655
+ params.each do |name, value|
656
+ Binance::Utils::Validation.require_param(name.to_s, value)
657
+ end
658
+
659
+ @session.sign_request(:post, '/api/v3/orderList/otoco',
660
+ params: kwargs.merge(params))
661
+ end
662
+
663
+ # New Order List - OPO (TRADE)
664
+ #
665
+ # POST /api/v3/orderList/opo
666
+ #
667
+ # @param symbol [String]
668
+ # @param workingType [String] Supported values: LIMIT, LIMIT_MAKER
669
+ # @param workingSide [String]
670
+ # @param workingPrice [Float]
671
+ # @param workingQuantity [Float]
672
+ # @param pendingType [String]
673
+ # @param pendingSide [String]
674
+ # @param kwargs [Hash]
675
+ # @option kwargs [String] :listClientOrderId
676
+ # @option kwargs [String] :newOrderRespType
677
+ # @option kwargs [String] :selfTradePreventionMode
678
+ # @option kwargs [String] :workingClientOrderId
679
+ # @option kwargs [Float] :workingIcebergQty
680
+ # @option kwargs [String] :workingTimeInForce
681
+ # @option kwargs [Integer] :workingStrategyId
682
+ # @option kwargs [Integer] :workingStrategyType
683
+ # @option kwargs [String] :workingPegPriceType
684
+ # @option kwargs [String] :workingPegOffsetType
685
+ # @option kwargs [Integer] :workingPegOffsetValue
686
+ # @option kwargs [String] :pendingClientOrderId
687
+ # @option kwargs [Float] :pendingPrice
688
+ # @option kwargs [Float] :pendingStopPrice
689
+ # @option kwargs [Float] :pendingTrailingDelta
690
+ # @option kwargs [Float] :pendingIcebergQty
691
+ # @option kwargs [String] :pendingTimeInForce
692
+ # @option kwargs [Integer] :pendingStrategyId
693
+ # @option kwargs [Integer] :pendingStrategyType
694
+ # @option kwargs [String] :pendingPegPriceType
695
+ # @option kwargs [String] :pendingPegOffsetType
696
+ # @option kwargs [Integer] :pendingPegOffsetValue
697
+ # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
698
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---opo-trade
699
+ def new_opo_order_list(symbol:, workingType:, workingSide:, workingPrice:, workingQuantity:, pendingType:, pendingSide:, **kwargs)
700
+ params = {
701
+ symbol: symbol,
702
+ workingType: workingType,
703
+ workingSide: workingSide,
704
+ workingPrice: workingPrice,
705
+ workingQuantity: workingQuantity,
706
+ pendingType: pendingType,
707
+ pendingSide: pendingSide
708
+ }
709
+
710
+ params.each do |name, value|
711
+ Binance::Utils::Validation.require_param(name.to_s, value)
712
+ end
713
+
714
+ @session.sign_request(:post, '/api/v3/orderList/opo',
715
+ params: kwargs.merge(params))
716
+ end
717
+
718
+ # New Order List - OPOCO (TRADE)
719
+ #
720
+ # POST /api/v3/orderList/opoco
721
+ #
722
+ # @param symbol [String]
723
+ # @param workingType [String] Supported values: LIMIT, LIMIT_MAKER
724
+ # @param workingSide [String]
725
+ # @param workingPrice [Float]
726
+ # @param workingQuantity [Float]
727
+ # @param pendingSide [String]
728
+ # @param pendingAboveType [String]
729
+ # @param kwargs [Hash]
730
+ # @option kwargs [String] :listClientOrderId
731
+ # @option kwargs [String] :newOrderRespType
732
+ # @option kwargs [String] :selfTradePreventionMode
733
+ # @option kwargs [String] :workingClientOrderId
734
+ # @option kwargs [Float] :workingIcebergQty
735
+ # @option kwargs [String] :workingTimeInForce
736
+ # @option kwargs [Integer] :workingStrategyId
737
+ # @option kwargs [Integer] :workingStrategyType
738
+ # @option kwargs [String] :workingPegPriceType
739
+ # @option kwargs [String] :workingPegOffsetType
740
+ # @option kwargs [Integer] :workingPegOffsetValue
741
+ # @option kwargs [String] :pendingAboveClientOrderId
742
+ # @option kwargs [Float] :pendingAbovePrice
743
+ # @option kwargs [Float] :pendingAboveStopPrice
744
+ # @option kwargs [Float] :pendingAboveTrailingDelta
745
+ # @option kwargs [Float] :pendingAboveIcebergQty
746
+ # @option kwargs [String] :pendingAboveTimeInForce
747
+ # @option kwargs [Integer] :pendingAboveStrategyId
748
+ # @option kwargs [Integer] :pendingAboveStrategyType
749
+ # @option kwargs [String] :pendingAbovePegPriceType
750
+ # @option kwargs [String] :pendingAbovePegOffsetType
751
+ # @option kwargs [Integer] :pendingAbovePegOffsetValue
752
+ # @option kwargs [String] :pendingBelowType
753
+ # @option kwargs [String] :pendingBelowClientOrderId
754
+ # @option kwargs [Float] :pendingBelowPrice
755
+ # @option kwargs [Float] :pendingBelowStopPrice
756
+ # @option kwargs [Float] :pendingBelowTrailingDelta
757
+ # @option kwargs [Float] :pendingBelowIcebergQty
758
+ # @option kwargs [String] :pendingBelowTimeInForce
759
+ # @option kwargs [Integer] :pendingBelowStrategyId
760
+ # @option kwargs [Integer] :pendingBelowStrategyType
761
+ # @option kwargs [String] :pendingBelowPegPriceType
762
+ # @option kwargs [String] :pendingBelowPegOffsetType
763
+ # @option kwargs [Integer] :pendingBelowPegOffsetValue
764
+ # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
765
+ # @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---opoco-trade
766
+ def new_opoco_order_list(
767
+ symbol:,
768
+ workingType:,
769
+ workingSide:,
770
+ workingPrice:,
771
+ workingQuantity:,
772
+ pendingSide:,
773
+ pendingAboveType:,
774
+ **kwargs
775
+ )
776
+ params = {
777
+ symbol: symbol,
778
+ workingType: workingType,
779
+ workingSide: workingSide,
780
+ workingPrice: workingPrice,
781
+ workingQuantity: workingQuantity,
782
+ pendingSide: pendingSide,
783
+ pendingAboveType: pendingAboveType
784
+ }
785
+
786
+ params.each do |name, value|
787
+ Binance::Utils::Validation.require_param(name.to_s, value)
788
+ end
789
+
790
+ @session.sign_request(:post, '/api/v3/orderList/opoco',
791
+ params: kwargs.merge(params))
792
+ end
394
793
  end
395
794
  end
396
795
  end
@@ -24,7 +24,7 @@ module Binance
24
24
  # @option kwargs [Integer] :recvWindow The value cannot be greater than 60000
25
25
  # @see https://developers.binance.com/docs/wallet/others/delist-schedule
26
26
  def delist_schedule(**kwargs)
27
- @session.public_request(path: '/sapi/v1/spot/delist-schedule', params: kwargs)
27
+ @session.limit_request(path: '/sapi/v1/spot/delist-schedule', params: kwargs)
28
28
  end
29
29
 
30
30
  # All Coins' Information (USER_DATA)
data/lib/binance/spot.rb CHANGED
@@ -7,6 +7,7 @@ require 'binance/utils/url'
7
7
  require 'binance/error'
8
8
  require 'binance/spot/c2c'
9
9
  require 'binance/spot/convert'
10
+ require 'binance/spot/dci'
10
11
  require 'binance/spot/fiat'
11
12
  require 'binance/spot/loan'
12
13
  require 'binance/spot/margin'
@@ -24,6 +25,7 @@ module Binance
24
25
  # - Blvt
25
26
  # - C2C
26
27
  # - Convert
28
+ # - DCI
27
29
  # - Fiat
28
30
  # - Futures
29
31
  # - Loan
@@ -39,6 +41,7 @@ module Binance
39
41
  class Spot
40
42
  include Binance::Spot::C2C
41
43
  include Binance::Spot::Convert
44
+ include Binance::Spot::DCI
42
45
  include Binance::Spot::Fiat
43
46
  include Binance::Spot::Loan
44
47
  include Binance::Spot::Margin
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Binance
4
- VERSION = '1.7.1'
4
+ VERSION = '1.9.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: binance-connector-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Binance
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-13 00:00:00.000000000 Z
11
+ date: 2026-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.8'
75
+ version: 1.10.6
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.8'
82
+ version: 1.10.6
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: websocket-eventmachine-client
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -110,6 +110,7 @@ files:
110
110
  - lib/binance/spot.rb
111
111
  - lib/binance/spot/c2c.rb
112
112
  - lib/binance/spot/convert.rb
113
+ - lib/binance/spot/dci.rb
113
114
  - lib/binance/spot/fiat.rb
114
115
  - lib/binance/spot/loan.rb
115
116
  - lib/binance/spot/margin.rb