DhanHQ 2.8.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d2ca9bd3c9c4f61504d06e8b2736baf9ded579d04bb21523a9e0c5fe9a74298
4
- data.tar.gz: a981472b44efa9c86c1daa83461c27985664a0682022d3aa4b3e925a950788aa
3
+ metadata.gz: cf675947ad1be99c9af911e63ded9e131e85eec23703f9de3540c30a69b27749
4
+ data.tar.gz: 2248c7ea6c009e0017327d3483c2bf13354a4994bf7a4fc63b76519f44e93b07
5
5
  SHA512:
6
- metadata.gz: 03b2f01541f005e6d9ebd4d706023cf553b17bb80327f480f350e5d465a582006b0fc199cc541a804631a71a034b8cd454c8c715e962b95794df665e75eb0a63
7
- data.tar.gz: e7320d2ae5e332238cf0e11bcd0f29ecd368772242019567f5dcb525e4b8baa9e71c5191b51b25724cd090ac82fb113524bb0578480f1bf71b82834bc74cda6d
6
+ metadata.gz: e485bf1b92f5de3277b6cc611cc7f29035f70ccbea9c59bd8945c456382e5bc415795ba7d60f5d69b193c3c2d270a9cd2ed53502870fed6a4731e0b7fc2ac94d
7
+ data.tar.gz: eb094317cddd3d927bfbd54a8b0b8598b367217cf67c0a8fc1000d0f5258bd6009007bb6be30b36868746f1fa2b22037fad4a9ad872f3ca0b294bad388656b32
data/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## [3.0.0] - 2026-05-19
2
+
3
+ ### Breaking Changes
4
+
5
+ - **TA and analysis modules are now opt-in**. `require 'dhan_hq'` no longer auto-loads `DhanHQ::Analysis::*` or `TA::*`. Explicitly require what you need:
6
+ ```ruby
7
+ require 'dhan_hq/analysis' # OptionsBuyingAdvisor, MultiTimeframeAnalyzer
8
+ require 'dhan_hq/ta' # TA::TechnicalAnalysis, TA::Fetcher, TA::Candles
9
+ ```
10
+
11
+ ### Changed
12
+
13
+ - `exe/DhanHQ` now correctly uses `require "dhan_hq"` (was the old `require "DhanHQ"`).
14
+ - Gemspec file renamed back to `DhanHQ.gemspec` (was `dhan_hq.gemspec`) to resolve RubyGems "too similar" name collision and ensure successful push of the `DhanHQ` gem.
15
+ - Updated all `Gemfile` references and installation docs to use `DhanHQ` while maintaining `require 'dhan_hq'` for standard Ruby conventions.
16
+ - SimpleCov now tracks all `lib/**/*.rb` files (was models-only).
17
+
18
+ ---
19
+
1
20
  ## [2.8.0] - 2026-03-21
2
21
 
3
22
  ### Added
data/README.md CHANGED
@@ -153,16 +153,23 @@ gem install DhanHQ
153
153
 
154
154
  **`bundle update` / `bundle install` warnings** — If you see "Local specification for rexml-3.2.8 has different dependencies" or "Unresolved or ambiguous specs during Gem::Specification.reset: psych", the bundle still completes successfully. To clear the rexml warning once, run: `gem cleanup rexml`. The psych message is a known Bundler quirk and can be ignored.
155
155
 
156
- ### ⚠️ Breaking Change (v2.1.5+)
156
+ ### Gem name vs require path
157
157
 
158
- The require statement changed:
158
+ RubyGems normalizes names, so `DhanHQ` and `dhan_hq` refer to the same slot — the published name stays `DhanHQ` and will never change. The require path has used snake_case since v2.1.5:
159
159
 
160
160
  ```ruby
161
- # Before # Now
162
- require 'DhanHQ'require 'dhan_hq'
161
+ # Gemfile # Ruby file
162
+ gem 'DhanHQ' require 'dhan_hq'
163
163
  ```
164
164
 
165
- The gem name in your Gemfile stays `DhanHQ` — only the `require` changes.
165
+ ### Optional features
166
+
167
+ The core SDK (`require 'dhan_hq'`) only loads the API client. Technical analysis and the options advisor are opt-in:
168
+
169
+ ```ruby
170
+ require 'dhan_hq/analysis' # DhanHQ::Analysis::OptionsBuyingAdvisor, MultiTimeframeAnalyzer
171
+ require 'dhan_hq/ta' # TA::TechnicalAnalysis, TA::Fetcher, TA::Candles
172
+ ```
166
173
 
167
174
  ---
168
175
 
@@ -485,6 +492,10 @@ bundle exec rubocop # lint
485
492
  bin/console # interactive console
486
493
  ```
487
494
 
495
+ ## Disclaimer
496
+
497
+ This gem is an independent, community-maintained project and is **not officially affiliated with, endorsed by, or supported by Dhan (Mirae Asset Capital Markets)**. Trading in financial instruments carries significant risk. Use this SDK at your own risk and always verify order placement in a sandbox environment before going live.
498
+
488
499
  ## License
489
500
 
490
501
  [MIT](LICENSE.txt)
@@ -19,7 +19,7 @@ This guide provides comprehensive instructions for integrating DhanHQ WebSocket
19
19
 
20
20
  ```ruby
21
21
  # Gemfile
22
- gem 'dhan_hq'
22
+ gem 'DhanHQ'
23
23
  ```
24
24
 
25
25
  ### 2. Configure DhanHQ
@@ -18,7 +18,7 @@ This guide provides comprehensive instructions for integrating DhanHQ WebSocket
18
18
  ### 1. Install the Gem
19
19
 
20
20
  ```bash
21
- gem install dhan_hq
21
+ gem install DhanHQ
22
22
  ```
23
23
 
24
24
  ### 2. Basic Configuration
@@ -65,7 +65,7 @@ indicators = TA::TechnicalAnalysis.new.compute_from_file(
65
65
  ## Analyze Multi-Timeframe Bias
66
66
 
67
67
  ```ruby
68
- require "DhanHQ"
68
+ require "dhan_hq/analysis"
69
69
 
70
70
  analyzer = DhanHQ::Analysis::MultiTimeframeAnalyzer.new(data: indicators)
71
71
  summary = analyzer.call
data/exe/DhanHQ CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require "DhanHQ"
4
+ require "dhan_hq"
@@ -2,5 +2,5 @@
2
2
 
3
3
  module DhanHQ
4
4
  # Semantic version of the DhanHQ client gem.
5
- VERSION = "2.8.0"
5
+ VERSION = "3.0.0"
6
6
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "dhan_hq"
4
+
5
+ require_relative "../dhanhq/contracts/options_buying_advisor_contract"
6
+ require_relative "../dhanhq/analysis/helpers/bias_aggregator"
7
+ require_relative "../dhanhq/analysis/helpers/moneyness_helper"
8
+ require_relative "../dhanhq/analysis/multi_timeframe_analyzer"
9
+ require_relative "../dhanhq/analysis/options_buying_advisor"
data/lib/dhan_hq/ta.rb ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "dhan_hq"
4
+
5
+ require_relative "../ta"
data/lib/dhan_hq.rb CHANGED
@@ -34,10 +34,8 @@ module DhanHQ
34
34
  "ws" => "WS"
35
35
  )
36
36
  LOADER.push_dir(File.join(__dir__, "DhanHQ"), namespace: self)
37
- LOADER.push_dir(File.join(__dir__, "dhanhq"), namespace: self)
38
37
  LOADER.collapse(File.join(__dir__, "DhanHQ", "core"))
39
38
  LOADER.collapse(File.join(__dir__, "DhanHQ", "helpers"))
40
- LOADER.collapse(File.join(__dir__, "dhanhq", "analysis", "helpers"))
41
39
  LOADER.ignore(
42
40
  File.join(__dir__, "DhanHQ", "errors.rb"),
43
41
  File.join(__dir__, "DhanHQ", "version.rb")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: DhanHQ
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shubham Taywade
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-21 00:00:00.000000000 Z
11
+ date: 2026-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -354,6 +354,8 @@ files:
354
354
  - lib/DhanHQ/ws/sub_state.rb
355
355
  - lib/DhanHQ/ws/websocket_packet_parser.rb
356
356
  - lib/dhan_hq.rb
357
+ - lib/dhan_hq/analysis.rb
358
+ - lib/dhan_hq/ta.rb
357
359
  - lib/dhanhq/analysis/helpers/bias_aggregator.rb
358
360
  - lib/dhanhq/analysis/helpers/moneyness_helper.rb
359
361
  - lib/dhanhq/analysis/multi_timeframe_analyzer.rb