Module: Kucoin::Rest::Public::Markets
- Included in:
- Client
- Defined in:
- lib/kucoin/rest/public/markets.rb
Instance Method Summary collapse
- #coin_info(coin, options: {}) ⇒ Object
- #coins(options: {}) ⇒ Object
- #market_symbols(market: nil, options: {}) ⇒ Object
- #markets(options: {}) ⇒ Object
- #trending_symbols(market: nil, options: {}) ⇒ Object
Instance Method Details
#coin_info(coin, options: {}) ⇒ Object
36 37 38 39 |
# File 'lib/kucoin/rest/public/markets.rb', line 36 def coin_info(coin, options: {}) response = get("/market/open/coin-info", params: {coin: coin}, options: )&.fetch("data", {}) ::Kucoin::Models::Coin.new(response) if response end |
#coins(options: {}) ⇒ Object
31 32 33 34 |
# File 'lib/kucoin/rest/public/markets.rb', line 31 def coins(options: {}) response = get("/market/open/coins", options: )&.fetch("data", {}) ::Kucoin::Models::Coin.parse(response) if response end |
#market_symbols(market: nil, options: {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/kucoin/rest/public/markets.rb', line 10 def market_symbols(market: nil, options: {}) params = { market: market.to_s.upcase, } params.delete_if { |key, value| value.nil? || value.to_s.empty? } response = get("/market/open/symbols", params: params, options: )&.fetch("data", {}) ::Kucoin::Models::Ticker.parse(response) if response end |
#markets(options: {}) ⇒ Object
6 7 8 |
# File 'lib/kucoin/rest/public/markets.rb', line 6 def markets(options: {}) get("/open/markets", options: )&.fetch("data", {}) end |
#trending_symbols(market: nil, options: {}) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/kucoin/rest/public/markets.rb', line 21 def trending_symbols(market: nil, options: {}) params = { market: market.to_s.upcase, } params.delete_if { |key, value| value.nil? || value.to_s.empty? } response = get("/market/open/coins-trending", params: params, options: )&.fetch("data", {}) end |