Project

gate.rb

0.0
The project is in a healthy, maintained state
Access the Gate API with Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

 Project Readme

gate.rb

Access the Gate API with Ruby.

Installation

Add this line to your application's Gemfile:

gem 'gate.rb'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install gate.rb

Usage

client = Gate::Client.new(
  api_key: 'your_api_key',
  api_secret: 'your_api_secret',
)

Public API Methods

# Get all currencies
client.spot_currencies

# Get specific currency
client.spot_currencies('BTC')

# Get all symbol/currency pairs
client.currency_pairs

# Get one symbol/currency pair
client.currency_pairs('BTC_USDT')

# Get all ticker
client.spot_tickers

# Get ticker for one symbol/currency pair
client.spot_tickers(currency_pair: 'BTC_USDT')

# Get order book for a symbol/currency pair
client.spot_order_book(currency_pair: 'BTC_USDT')

# Get order book for a symbol/currency pair
client.spot_trades(currency_pair: 'BTC_USDT')

# Get OHLC for a symbol/currency pair
client.spot_candlesticks(currency_pair: 'BTC_USDT')

# Get OHLC for a symbol for specific period
client.spot_candlesticks('BTC_USDT', interval: '1d', start_time: 1648995780000, end_time: 1649082180000)

# Get server time
client.spot_time

A Private API Method

# Get the authenticated user's trades for specific symbol/currency pair
client.spot_orders(currency_pair: 'BTC_USDT')

Contributing

  1. Fork it (https://github.com/thoran/gate.rb/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new pull request

License

The gem is available as open source under the terms of the Ruby License.