@nabeeltahirdeveloper/chart-sdk 1.2.1 → 2.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.
package/README.md CHANGED
@@ -45,9 +45,25 @@ Wraps your app and provides trading state (symbols, prices, orders, drawing tool
45
45
 
46
46
  | Prop | Type | Description |
47
47
  |------|------|-------------|
48
- | `baseUrl` | `string` | API server URL |
48
+ | `baseUrl` | `string` | **Your project's backend API URL.** All SDK API calls (trades, candles, symbols, account) go to this URL. If omitted, uses `VITE_BASE_URL` env or `http://localhost:8000`. |
49
+ | `endpoints` | `object` | **Optional:** Custom endpoint paths. If your backend uses different paths, override them here. Default: `{ candles: '/api/chart/candles', symbols: '/api/symbols', trades: '/api/trades', account: '/api/user/account' }` |
49
50
  | `children` | `ReactNode` | Child components |
50
51
 
52
+ **Example with custom endpoints:**
53
+ ```jsx
54
+ <TradingProvider
55
+ baseUrl="https://api-mt5-project.com"
56
+ endpoints={{
57
+ candles: '/api/v1/chart/candles', // MT5 backend path
58
+ symbols: '/api/v1/symbols',
59
+ trades: '/api/v1/trades',
60
+ account: '/api/v1/user/account'
61
+ }}
62
+ >
63
+ <Chart />
64
+ </TradingProvider>
65
+ ```
66
+
51
67
  ### Chart
52
68
 
53
69
  Full-featured candlestick chart with real-time price updates, order lines, and drawing tools.