Skip to content

Commit

Permalink
Merge pull request #27 from binance/rc-v1.7.1
Browse files Browse the repository at this point in the history
Release v1.7.1
  • Loading branch information
dimitrisn442 authored Jan 13, 2025
2 parents 1621b2e + 78d4f5e commit 9a20211
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [3.0, 3.1, 3.2, 3.3]
ruby: ['3.0', '3.1', '3.2', '3.3']

runs-on: ubuntu-latest

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.7.1 - 2025-01-13
### Changed
- Updated documentation links.

## 1.7.0 -2024-12-05
### Added
- Convert endpoints:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
binance-connector-ruby (1.7.0)
binance-connector-ruby (1.7.1)
faraday (~> 1.8)
websocket-eventmachine-client (~> 1.3)

Expand Down
32 changes: 16 additions & 16 deletions lib/binance/spot/market.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Market
#
# GET /api/v3/ping
#
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-connectivity
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints#test-connectivity
def ping
@session.public_request(path: '/api/v3/ping')
end
Expand All @@ -24,7 +24,7 @@ def ping
#
# GET /api/v3/time
#
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#check-server-time
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints#check-server-time
def time
@session.public_request(path: '/api/v3/time')
end
Expand All @@ -38,7 +38,7 @@ def time
# @option kwargs [string] :permissions
# @option kwargs [Boolean] :feature Controls whether the content of the permissionSets field is populated or not. Defaults to true
# @option kwargs [string] :symbolStatus Filters symbols that have this tradingStatus. Valid values: TRADING, HALT, BREAK. Cannot be used in combination with symbols or symbol.
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#exchange-information
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints#exchange-information
def exchange_info(symbol: nil, symbols: nil, permissions: nil)
if symbols.is_a?(Array)
symbols = symbols.map { |v| "%22#{v}%22" }.join(',')
Expand All @@ -61,7 +61,7 @@ def exchange_info(symbol: nil, symbols: nil, permissions: nil)
# @param symbol [String] the symbol
# @param kwargs [Hash]
# @option kwargs [Integer] :limit Default 100; max 1000. Valid limits:[5, 10, 20, 50, 100, 500, 1000, 5000]
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#order-book
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#order-book
def depth(symbol:, **kwargs)
Binance::Utils::Validation.require_param('symbol', symbol)

Expand All @@ -78,7 +78,7 @@ def depth(symbol:, **kwargs)
# @param symbol [String] the symbol
# @param kwargs [Hash]
# @option kwargs [Integer] :limit Default 500; max 1000.
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#recent-trades-list
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#recent-trades-list
def trades(symbol:, **kwargs)
Binance::Utils::Validation.require_param('symbol', symbol)

Expand All @@ -98,7 +98,7 @@ def trades(symbol:, **kwargs)
# @param kwargs [Hash]
# @option kwargs [Integer] :limit Default 500; max 1000.
# @option kwargs [Integer] :fromId Trade id to fetch from. Default gets most recent trades.
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#old-trade-lookup
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#old-trade-lookup
def historical_trades(symbol:, **kwargs)
Binance::Utils::Validation.require_param('symbol', symbol)

Expand All @@ -120,7 +120,7 @@ def historical_trades(symbol:, **kwargs)
# @option kwargs [Integer] :endTime Timestamp in ms to get aggregate trades until INCLUSIVE.
# @option kwargs [Integer] :fromId Trade id to fetch from. Default gets most recent trades.
# @option kwargs [Integer] :limit Default 500; max 1000.
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#compressedaggregate-trades-list
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#compressedaggregate-trades-list
def agg_trades(symbol:, **kwargs)
Binance::Utils::Validation.require_param('symbol', symbol)

Expand All @@ -144,7 +144,7 @@ def agg_trades(symbol:, **kwargs)
# @option kwargs [Integer] :endTime Timestamp in ms to get aggregate trades until INCLUSIVE.
# @option kwargs [String] :timeZone Default: 0 (UTC)
# @option kwargs [Integer] :limit Default 500; max 1000.
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#klinecandlestick-data
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#klinecandlestick-data
def klines(symbol:, interval:, **kwargs)
Binance::Utils::Validation.require_param('symbol', symbol)
Binance::Utils::Validation.require_param('interval', interval)
Expand All @@ -171,7 +171,7 @@ def klines(symbol:, interval:, **kwargs)
# @option kwargs [Integer] :endTime
# @option kwargs [String] :timeZone Default: 0 (UTC)
# @option kwargs [Integer] :limit Default 500; max 1000.
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#uiklines
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#uiklines
def ui_klines(symbol:, interval:, **kwargs)
Binance::Utils::Validation.require_param('symbol', symbol)
Binance::Utils::Validation.require_param('interval', interval)
Expand All @@ -192,7 +192,7 @@ def ui_klines(symbol:, interval:, **kwargs)
# GET /api/v3/avgPrice
#
# @param symbol [String] the symbol
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#current-average-price
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#current-average-price
def avg_price(symbol:)
Binance::Utils::Validation.require_param('symbol', symbol)

Expand All @@ -209,7 +209,7 @@ def avg_price(symbol:)
# GET /api/v3/ticker/24hr
#
# @param symbol [String] the symbol
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#24hr-ticker-price-change-statistics
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#24hr-ticker-price-change-statistics
def ticker_24hr(symbol: nil)
@session.public_request(
path: '/api/v3/ticker/24hr',
Expand All @@ -228,7 +228,7 @@ def ticker_24hr(symbol: nil)
# @option kwargs [string] :symbols
# @option kwargs [String] :timeZone Default: 0 (UTC)
# @option kwargs [String] :type Supported values: FULL or MINI. Default: FULL
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#trading-day-ticker
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#trading-day-ticker
def ticker_trading_day(symbol: nil, symbols: nil, **kwargs)
raise Binance::DuplicatedParametersError.new('symbol', 'symbols') unless symbols.nil? || symbol.nil?

Expand All @@ -253,7 +253,7 @@ def ticker_trading_day(symbol: nil, symbols: nil, **kwargs)
# GET /api/v3/ticker/price
#
# @param symbol [String] the symbol
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#symbol-price-ticker
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-price-ticker
def ticker_price(symbol: nil)
@session.public_request(
path: '/api/v3/ticker/price',
Expand All @@ -268,7 +268,7 @@ def ticker_price(symbol: nil)
# GET /api/v3/ticker/bookTicker
#
# @param symbol [String] the symbol
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#symbol-order-book-ticker
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-order-book-ticker
def book_ticker(symbol: nil)
@session.public_request(
path: '/api/v3/ticker/bookTicker',
Expand All @@ -280,10 +280,10 @@ def book_ticker(symbol: nil)
#
# Best price/qty on the order book for a symbol or symbols.
#
# GET /api/v3/ticker/bookTicker
# GET /api/v3/ticker
#
# @param symbol [String] the symbol
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#symbol-order-book-ticker
# @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#rolling-window-price-change-statistics
def ticker(symbol: nil, symbols: nil, windowSize: '1d')
raise Binance::DuplicatedParametersError.new('symbol', 'symbols') unless symbols.nil? || symbol.nil?

Expand Down
Loading

0 comments on commit 9a20211

Please sign in to comment.