Skip to content

[pull] master from zerodhatech:master#2

Open
pull[bot] wants to merge 136 commits intoVarunBatraIT:masterfrom
zerodha:master
Open

[pull] master from zerodhatech:master#2
pull[bot] wants to merge 136 commits intoVarunBatraIT:masterfrom
zerodha:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Oct 4, 2020

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added ⤵️ pull merge-conflict Resolve conflicts manually labels Oct 4, 2020
vividvilla and others added 20 commits October 22, 2020 12:11
feat: Add trigger_price and GetMFOrdersByDate
This commit adds the order margins API. A few internal refactors are
made to the .Do function to allow using json content type.
feat: add order-margins API
Fixes to code quality issues
* Updated mock response

Updated MF SIP info mock response to reflect correct JSON field name.

* Fixed MF SIPS mock response
* Add OI support in Historical Data

This adds OI support in historical data: 

https://kite.trade/docs/connect/v3/historical/#oi-data

Unfortunately, it is incompatible with previous versions - I am updating test as well.

* Update market_test.go

* Change oI to OI
OI support in historical data, mock_responses submodule, tags in order response, github actions
abhinandkakkadi and others added 30 commits August 31, 2023 11:38
* fix: Synchronize access to lastPingTime in Ticker struct

* fix: Synchronize access to lastPingTime in Ticker struct second pass

* updated lasPingTime visibility, gitignored .vscode/settings.json

* update: updated as specified
Use PAN instead of Pan in struct
fix: genHolAuthURL auth URL and json tag
Add `GetLoginURLWithparams()` to support `redir_params`.
feat: add mtf in holdings and orders
Add support for new portfolio holdings endpoints:
- GetHoldingsSummary() - returns holdings summary with PnL metrics
- GetHoldingsCompact() - returns compact holdings list

Added corresponding struct types:
- HoldingSummary - contains PnL and investment summary
- HoldingCompact - single compact holding item
- HoldingsCompact - slice of compact holdings

Added URI constants:
- URIGetHoldingsSummary = "/portfolio/holdings/summary"
- URIGetHoldingsCompact = "/portfolio/holdings/compact"
Import market protection changes from PR #122 - specifically adding the MarketProtection float64 field to the OrderParams struct to support market protection functionality in order placement.
Add Autoslice bool field to OrderParams for enabling auto-slicing
of large orders into smaller child orders.

Update OrderResponse to handle the new v2 autoslice response format:
- Parent order_id at the top level
- Children array with individual order_ids or errors for partial failures

New types:
- OrderChild: represents a child order (order_id or error)
- OrderChildError: error details for failed child orders

The response is backward compatible - regular (non-autoslice) orders
continue to work with just the order_id field.

Note: autoslice is only supported for order placement, not modification
(confirmed by techsup team).

Ref: API response format change effective 27th March 2026
- Fix matrix.go -> matrix.go-version (matrix was silently ignored)
- Update Go versions from 1.18/1.20/1.21/1.22 to 1.21/1.22/1.23/1.24
- Add go vet step to CI pipeline
- Fix unkeyed models.Time struct literals in market.go and ticker.go
- Fix duplicate json:"user_id" tag in UserSession by removing
  UserSessionTokens embed and inlining AccessToken/RefreshToken fields
  (minor breaking change: session.UserSessionTokens no longer available)
These fields are present in the order response per the Kite Connect
v3 API docs but were missing from the Go struct.
- Remove duplicate OHLC struct from alerts.go, use models.OHLC instead
  (models.OHLC has an extra InstrumentToken field with json:"-" so
  JSON deserialization is unaffected)
- Add comment to TestPlaceAutosliceOrder clarifying that production
  usage is variety "regular" with Autoslice: true
Upgrade from gopkg.in/jarcoal/httpmock.v1 (2018) to
github.com/jarcoal/httpmock v1.4.1. The old version had concurrency
issues with responders (fixed in v1.0.6) causing flaky parallel tests.

Test infrastructure changes:
- Use httpmock.File() to load mock responses instead of manual
  ioutil.ReadFile (also removes deprecated ioutil usage)
- Register NewNotFoundResponder(t.Fatal) to catch unmocked routes
  immediately instead of returning silent errors
- Use t.Cleanup() for teardown instead of commented-out defer
- Replace [][]string mock table with typed mockRoute struct
- Use t.Fatal in TestGetOrders for defensive early exit
- Remove unused SetupAPITest/TearDownAPITest per-test hooks
- Pass *testing.T to SetupAPITestSuit for proper error reporting
Add MarketProtectionAuto = -1 constant for automatic market protection.
Users can pass this instead of the raw -1 value when placing MARKET
or SL-M orders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⤵️ pull merge-conflict Resolve conflicts manually

Projects

None yet

Development

Successfully merging this pull request may close these issues.