Module: Fcoin::Endpoint::Market
- Included in:
- Fcoin::Endpoint
- Defined in:
- lib/fcoin/endpoint/market.rb
Instance Method Summary collapse
-
#market_candles(symbol:, resolution:) ⇒ Hash or JSON
Returns candles info of symbol specified by resolution.
-
#market_depth(symbol:, level:) ⇒ Hash or JSON
Returns depth info of symbol specified by level.
-
#market_ticker(symbol:) ⇒ Hash or JSON
Returns ticker info of symbol.
-
#market_trades(symbol:) ⇒ Hash or JSON
Returns trades info of symbol.
Instance Method Details
#market_candles(symbol:, resolution:) ⇒ Hash or JSON
Returns candles info of symbol specified by resolution.
curl: GET api.fcoin.com/v2/market/candles/$resolution/$symbol
81 82 83 84 85 86 87 88 |
# File 'lib/fcoin/endpoint/market.rb', line 81 def market_candles(symbol:, resolution:) validator = Fcoin::Validator.new(resolution: resolution, method_name: __method__) if skip_validation || validator.valid? get("market/candles/#{resolution}/#{symbol}", false) else raise InvalidValueError.new validator. end end |
#market_depth(symbol:, level:) ⇒ Hash or JSON
Returns depth info of symbol specified by level.
40 41 42 43 44 45 46 47 |
# File 'lib/fcoin/endpoint/market.rb', line 40 def market_depth(symbol:, level:) validator = Fcoin::Validator.new(level: level, method_name: __method__) if skip_validation || validator.valid? get("market/depth/#{level}/#{symbol}", false) else raise InvalidValueError.new validator. end end |
#market_ticker(symbol:) ⇒ Hash or JSON
Returns ticker info of symbol.
curl: GET api.fcoin.com/v2/market/ticker/$symbol
21 22 23 |
# File 'lib/fcoin/endpoint/market.rb', line 21 def market_ticker(symbol:) get("market/ticker/#{symbol}", false) end |
#market_trades(symbol:) ⇒ Hash or JSON
Returns trades info of symbol.
curl: GET api.fcoin.com/v2/market/trades/$symbol
62 63 64 |
# File 'lib/fcoin/endpoint/market.rb', line 62 def market_trades(symbol:) get("market/trades/#{symbol}", false) end |