DhanHQ 2.4.0 → 2.5.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.
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DhanHQ
4
+ module Resources
5
+ # Resource for P&L Based Exit endpoints per https://dhanhq.co/docs/v2/traders-control/
6
+ # POST /v2/pnlExit — configure, DELETE /v2/pnlExit — stop, GET /v2/pnlExit — status.
7
+ class PnlExit < BaseAPI
8
+ API_TYPE = :order_api
9
+ HTTP_PATH = "/v2/pnlExit"
10
+
11
+ ##
12
+ # Configure automatic P&L-based position exit.
13
+ #
14
+ # @param params [Hash] Request body with profitValue, lossValue, productType, enableKillSwitch.
15
+ # @return [Hash] API response containing pnlExitStatus and message.
16
+ def configure(params)
17
+ post("", params: params)
18
+ end
19
+
20
+ ##
21
+ # Stop/disable the active P&L-based exit configuration.
22
+ #
23
+ # @return [Hash] API response containing pnlExitStatus and message.
24
+ def stop
25
+ delete("")
26
+ end
27
+
28
+ ##
29
+ # Fetch the currently active P&L-based exit configuration.
30
+ #
31
+ # @return [Hash] API response containing pnlExitStatus, profit, loss, segments, enable_kill_switch.
32
+ def status
33
+ get("")
34
+ end
35
+ end
36
+ end
37
+ end
@@ -24,6 +24,14 @@ module DhanHQ
24
24
  def convert(params)
25
25
  post("/convert", params: params)
26
26
  end
27
+
28
+ ##
29
+ # Exit all active positions and cancel all open orders.
30
+ #
31
+ # @return [Hash] API response containing status and message.
32
+ def exit_all
33
+ delete("")
34
+ end
27
35
  end
28
36
  end
29
37
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module DhanHQ
4
4
  # Semantic version of the DhanHQ client gem.
5
- VERSION = "2.4.0"
5
+ VERSION = "2.5.0"
6
6
  end
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.4.0
4
+ version: 2.5.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-02-18 00:00:00.000000000 Z
11
+ date: 2026-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -196,7 +196,6 @@ files:
196
196
  - GUIDE.md
197
197
  - LICENSE.txt
198
198
  - README.md
199
- - README1.md
200
199
  - RELEASING.md
201
200
  - REVIEW_SUMMARY.md
202
201
  - Rakefile
@@ -212,11 +211,16 @@ files:
212
211
  - diagram.html
213
212
  - diagram.md
214
213
  - docs/API_VERIFICATION.md
214
+ - docs/ARCHIVE_README.md
215
215
  - docs/AUTHENTICATION.md
216
+ - docs/CONFIGURATION.md
216
217
  - docs/DATA_API_PARAMETERS.md
217
218
  - docs/PR_2.2.0.md
218
219
  - docs/RELEASE_GUIDE.md
220
+ - docs/SUPER_ORDERS.md
219
221
  - docs/TESTING_GUIDE.md
222
+ - docs/TROUBLESHOOTING.md
223
+ - docs/WEBSOCKET_PROTOCOL.md
220
224
  - docs/live_order_updates.md
221
225
  - docs/rails_integration.md
222
226
  - docs/rails_websocket_integration.md
@@ -268,6 +272,7 @@ files:
268
272
  - lib/DhanHQ/helpers/validation_helper.rb
269
273
  - lib/DhanHQ/json_loader.rb
270
274
  - lib/DhanHQ/models/alert_order.rb
275
+ - lib/DhanHQ/models/edis.rb
271
276
  - lib/DhanHQ/models/expired_options_data.rb
272
277
  - lib/DhanHQ/models/forever_order.rb
273
278
  - lib/DhanHQ/models/funds.rb
@@ -282,7 +287,9 @@ files:
282
287
  - lib/DhanHQ/models/option_chain.rb
283
288
  - lib/DhanHQ/models/order.rb
284
289
  - lib/DhanHQ/models/order_update.rb
290
+ - lib/DhanHQ/models/pnl_exit.rb
285
291
  - lib/DhanHQ/models/position.rb
292
+ - lib/DhanHQ/models/postback.rb
286
293
  - lib/DhanHQ/models/profile.rb
287
294
  - lib/DhanHQ/models/super_order.rb
288
295
  - lib/DhanHQ/models/token_response.rb
@@ -305,6 +312,7 @@ files:
305
312
  - lib/DhanHQ/resources/market_feed.rb
306
313
  - lib/DhanHQ/resources/option_chain.rb
307
314
  - lib/DhanHQ/resources/orders.rb
315
+ - lib/DhanHQ/resources/pnl_exit.rb
308
316
  - lib/DhanHQ/resources/positions.rb
309
317
  - lib/DhanHQ/resources/profile.rb
310
318
  - lib/DhanHQ/resources/statements.rb
File without changes