Thanks to visit codestin.com
Credit goes to github.com

Skip to content

thoran/gate.rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages