Skip to content

Commit

Permalink
Release v1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
alplabin committed Jul 23, 2024
1 parent 1591716 commit 6bef192
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.5.2 - 2024-07-23

### Changed
- Updated dependencies and resolve github security issue
- Added `permissions` parameter to `GET /api/v3/exchangeInfo`

## 1.5.1 - 2024-06-18

### Changed
Expand Down
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
binance-connector-ruby (1.5.1)
binance-connector-ruby (1.5.2)
faraday (~> 1.8)
websocket-eventmachine-client (~> 1.3)

Expand All @@ -12,8 +12,8 @@ GEM
adamantium (0.2.0)
ice_nine (~> 0.11.0)
memoizable (~> 0.4.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
anima (0.3.2)
abstract_type (~> 0.0.7)
adamantium (~> 0.2)
Expand Down Expand Up @@ -72,20 +72,20 @@ GEM
procto (~> 0.0.2)
multipart-post (2.4.1)
parallel (1.25.1)
parser (3.3.3.0)
parser (3.3.4.0)
ast (~> 2.4.1)
racc
proc_to_ast (0.2.0)
parser
rouge
unparser
procto (0.0.3)
public_suffix (5.1.0)
public_suffix (6.0.0)
racc (1.8.0)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
rexml (3.3.0)
rexml (3.3.2)
strscan
rouge (4.3.0)
rspec (3.13.0)
Expand All @@ -112,13 +112,13 @@ GEM
binding_of_caller
rspec-parameterized-core (< 2)
rspec-support (3.13.1)
rubocop (1.64.1)
rubocop (1.65.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
regexp_parser (>= 2.4, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
Expand Down Expand Up @@ -150,7 +150,7 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
websocket (1.2.10)
websocket (1.2.11)
websocket-eventmachine-base (1.2.0)
eventmachine (~> 1.0)
websocket (~> 1.0)
Expand Down
3 changes: 2 additions & 1 deletion examples/spot/market/exchange_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
logger = Common.setup_logger

client = Binance::Spot.new(base_url: 'https://testnet.binance.vision')
logger.info(client.exchange_info(symbols: %w[BTCUSDT BNBBUSD]))
logger.info(client.exchange_info(symbols: %w[BTCUSDT]))
logger.info(client.exchange_info(symbol: 'BTCUSDT'))
logger.info(client.exchange_info(permissions: 'SPOT'))
13 changes: 7 additions & 6 deletions lib/binance/spot/market.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,20 @@ def time
#
# @option kwargs [string] :symbol
# @option kwargs [string] :symbols
# @option kwargs [string] :permissions
# @see https://binance-docs.github.io/apidocs/spot/en/#exchange-information
def exchange_info(symbol: nil, symbols: nil)
def exchange_info(symbol: nil, symbols: nil, permissions: nil)
if symbols.is_a?(Array)
symbols = symbols.map { |v| "%22#{v}%22" }.join(',')
symbols = "%5B#{symbols}%5D"
end
if permissions.is_a?(Array)
permissions = permissions.map { |v| "%22#{v}%22" }.join(',')
permissions = "%5B#{permissions}%5D"
end
@session.public_request(
path: '/api/v3/exchangeInfo',
params:
{
symbol: symbol,
symbols: symbols
}
params: { symbol: symbol, symbols: symbols, permissions: permissions }
)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/binance/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Binance
VERSION = '1.5.1'
VERSION = '1.5.2'
end
20 changes: 20 additions & 0 deletions spec/binance/spot/market/exchangeinfo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,24 @@
end
end
end

context 'with param permissions' do
context 'one permission' do
let(:permissions) { 'SPOT' }
let(:path) { '/api/v3/exchangeInfo?permissions=SPOT' }
it 'should return specific permission exchange Info' do
spot_client.exchange_info(permissions: permissions)
expect(send_a_request(:get, path)).to have_been_made
end
end

context 'two permission' do
let(:permissions) { %w[MARGIN LEVERAGED] }
let(:path) { '/api/v3/exchangeInfo?permissions=%5B%22MARGIN%22,%22LEVERAGED%22%5D' }
it 'should return specific permission exchange Info' do
spot_client.exchange_info(permissions: permissions)
expect(send_a_request(:get, path)).to have_been_made
end
end
end
end

0 comments on commit 6bef192

Please sign in to comment.