File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 1.5.2 - 2024-07-23
4+
5+ ### Changed
6+ - Updated dependencies and resolve github security issue
7+ - Added ` permissions ` parameter to ` GET /api/v3/exchangeInfo `
8+
39## 1.5.1 - 2024-06-18
410
511### Changed
Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- binance-connector-ruby (1.5.1 )
4+ binance-connector-ruby (1.5.2 )
55 faraday (~> 1.8 )
66 websocket-eventmachine-client (~> 1.3 )
77
1212 adamantium (0.2.0 )
1313 ice_nine (~> 0.11.0 )
1414 memoizable (~> 0.4.0 )
15- addressable (2.8.6 )
16- public_suffix (>= 2.0.2 , < 6 .0 )
15+ addressable (2.8.7 )
16+ public_suffix (>= 2.0.2 , < 7 .0 )
1717 anima (0.3.2 )
1818 abstract_type (~> 0.0.7 )
1919 adamantium (~> 0.2 )
7272 procto (~> 0.0.2 )
7373 multipart-post (2.4.1 )
7474 parallel (1.25.1 )
75- parser (3.3.3 .0 )
75+ parser (3.3.4 .0 )
7676 ast (~> 2.4.1 )
7777 racc
7878 proc_to_ast (0.2.0 )
7979 parser
8080 rouge
8181 unparser
8282 procto (0.0.3 )
83- public_suffix (5.1 .0 )
83+ public_suffix (6.0 .0 )
8484 racc (1.8.0 )
8585 rainbow (3.1.1 )
8686 rake (13.2.1 )
8787 regexp_parser (2.9.2 )
88- rexml (3.3.0 )
88+ rexml (3.3.2 )
8989 strscan
9090 rouge (4.3.0 )
9191 rspec (3.13.0 )
@@ -112,13 +112,13 @@ GEM
112112 binding_of_caller
113113 rspec-parameterized-core (< 2 )
114114 rspec-support (3.13.1 )
115- rubocop (1.64.1 )
115+ rubocop (1.65.0 )
116116 json (~> 2.3 )
117117 language_server-protocol (>= 3.17.0 )
118118 parallel (~> 1.10 )
119119 parser (>= 3.3.0.2 )
120120 rainbow (>= 2.2.2 , < 4.0 )
121- regexp_parser (>= 1.8 , < 3.0 )
121+ regexp_parser (>= 2.4 , < 3.0 )
122122 rexml (>= 3.2.5 , < 4.0 )
123123 rubocop-ast (>= 1.31.1 , < 2.0 )
124124 ruby-progressbar (~> 1.7 )
150150 addressable (>= 2.8.0 )
151151 crack (>= 0.3.2 )
152152 hashdiff (>= 0.4.0 , < 2.0.0 )
153- websocket (1.2.10 )
153+ websocket (1.2.11 )
154154 websocket-eventmachine-base (1.2.0 )
155155 eventmachine (~> 1.0 )
156156 websocket (~> 1.0 )
Original file line number Diff line number Diff line change 99logger = Common . setup_logger
1010
1111client = Binance ::Spot . new ( base_url : 'https://testnet.binance.vision' )
12- logger . info ( client . exchange_info ( symbols : %w[ BTCUSDT BNBBUSD ] ) )
12+ logger . info ( client . exchange_info ( symbols : %w[ BTCUSDT ] ) )
1313logger . info ( client . exchange_info ( symbol : 'BTCUSDT' ) )
14+ logger . info ( client . exchange_info ( permissions : 'SPOT' ) )
Original file line number Diff line number Diff line change @@ -35,19 +35,20 @@ def time
3535 #
3636 # @option kwargs [string] :symbol
3737 # @option kwargs [string] :symbols
38+ # @option kwargs [string] :permissions
3839 # @see https://binance-docs.github.io/apidocs/spot/en/#exchange-information
39- def exchange_info ( symbol : nil , symbols : nil )
40+ def exchange_info ( symbol : nil , symbols : nil , permissions : nil )
4041 if symbols . is_a? ( Array )
4142 symbols = symbols . map { |v | "%22#{ v } %22" } . join ( ',' )
4243 symbols = "%5B#{ symbols } %5D"
4344 end
45+ if permissions . is_a? ( Array )
46+ permissions = permissions . map { |v | "%22#{ v } %22" } . join ( ',' )
47+ permissions = "%5B#{ permissions } %5D"
48+ end
4449 @session . public_request (
4550 path : '/api/v3/exchangeInfo' ,
46- params :
47- {
48- symbol : symbol ,
49- symbols : symbols
50- }
51+ params : { symbol : symbol , symbols : symbols , permissions : permissions }
5152 )
5253 end
5354
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33module Binance
4- VERSION = '1.5.1 '
4+ VERSION = '1.5.2 '
55end
Original file line number Diff line number Diff line change 4444 end
4545 end
4646 end
47+
48+ context 'with param permissions' do
49+ context 'one permission' do
50+ let ( :permissions ) { 'SPOT' }
51+ let ( :path ) { '/api/v3/exchangeInfo?permissions=SPOT' }
52+ it 'should return specific permission exchange Info' do
53+ spot_client . exchange_info ( permissions : permissions )
54+ expect ( send_a_request ( :get , path ) ) . to have_been_made
55+ end
56+ end
57+
58+ context 'two permission' do
59+ let ( :permissions ) { %w[ MARGIN LEVERAGED ] }
60+ let ( :path ) { '/api/v3/exchangeInfo?permissions=%5B%22MARGIN%22,%22LEVERAGED%22%5D' }
61+ it 'should return specific permission exchange Info' do
62+ spot_client . exchange_info ( permissions : permissions )
63+ expect ( send_a_request ( :get , path ) ) . to have_been_made
64+ end
65+ end
66+ end
4767end
You can’t perform that action at this time.
0 commit comments