Class: DhanHQ::Resources::Trades

Inherits:
BaseAPI
  • Object
show all
Defined in:
lib/DhanHQ/resources/trades.rb

Overview

Provides access to current day trades endpoints

Constant Summary collapse

API_TYPE =

Trade history is fetched from the trading API tier.

:order_api
HTTP_PATH =

Base path for trade retrieval.

"/v2/trades"

Instance Attribute Summary

Attributes inherited from BaseAPI

#client

Instance Method Summary collapse

Methods inherited from BaseAPI

#delete, #get, #initialize, #post, #put

Methods included from AttributeHelper

#camelize_keys, #deep_camelize_keys, #inspect, #normalize_keys, #snake_case, #titleize_keys

Methods included from APIHelper

#handle_response

Constructor Details

This class inherits a constructor from DhanHQ::BaseAPI

Instance Method Details

#allObject

GET /v2/trades



13
14
15
# File 'lib/DhanHQ/resources/trades.rb', line 13

def all
  get("")
end

#find(order_id) ⇒ Object

GET /v2/trades/order-id



18
19
20
# File 'lib/DhanHQ/resources/trades.rb', line 18

def find(order_id)
  get("/#{order_id}")
end