binbot-charts 0.7.3 → 0.10.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 +49 -0
- package/dist/{main.mjs → main.cjs} +403 -113
- package/dist/main.cjs.map +1 -0
- package/dist/{main.d.mts → main.d.cts} +16 -1
- package/dist/main.d.ts +16 -1
- package/dist/main.js +380 -129
- package/dist/main.js.map +1 -1
- package/package.json +19 -16
- package/dist/main.mjs.map +0 -1
- package/public/index.html +0 -23
package/README.md
CHANGED
|
@@ -4,6 +4,55 @@ Import it in your project as a React component
|
|
|
4
4
|
`import TVChartContainer from 'binbot-charts'`
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## Multi-Exchange Support
|
|
8
|
+
|
|
9
|
+
This library now supports multiple cryptocurrency exchanges. You can configure which exchange to use and which exchanges to make available for symbol search.
|
|
10
|
+
|
|
11
|
+
### Supported Exchanges
|
|
12
|
+
- **Binance** - Default exchange
|
|
13
|
+
- **KuCoin** - Added in v0.7.3+
|
|
14
|
+
|
|
15
|
+
### Usage Example
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
import TVChartContainer, { SUPPORTED_EXCHANGES } from 'binbot-charts';
|
|
19
|
+
|
|
20
|
+
function MyChart() {
|
|
21
|
+
return (
|
|
22
|
+
<TVChartContainer
|
|
23
|
+
symbol="BTCUSDT"
|
|
24
|
+
interval="1h"
|
|
25
|
+
exchange="binance" // or "kucoin"
|
|
26
|
+
supportedExchanges={["binance", "kucoin"]}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Props
|
|
33
|
+
|
|
34
|
+
- `exchange` (optional, default: `"binance"`): The exchange to use for fetching data. Options: `"binance"`, `"kucoin"`
|
|
35
|
+
- `supportedExchanges` (optional, default: `["binance", "kucoin"]`): Array of exchanges to include in symbol search
|
|
36
|
+
- `symbol` (optional, default: `"BTCUSDT"`): Trading pair symbol
|
|
37
|
+
- `interval` (optional, default: `"1h"`): Chart interval/timeframe
|
|
38
|
+
- `timescaleMarks` (optional): Array of custom marks to display on the timeline
|
|
39
|
+
- `orderLines` (optional): Array of order lines to display on the chart
|
|
40
|
+
- `onTick` (optional): Callback function for real-time tick updates
|
|
41
|
+
- `getLatestBar` (optional): Callback function to get the latest bar data
|
|
42
|
+
|
|
43
|
+
### Exchange Configuration
|
|
44
|
+
|
|
45
|
+
You can also import and use the exchange configurations directly:
|
|
46
|
+
|
|
47
|
+
```jsx
|
|
48
|
+
import { SUPPORTED_EXCHANGES, ExchangeConfig } from 'binbot-charts';
|
|
49
|
+
|
|
50
|
+
// Access exchange configuration
|
|
51
|
+
const binanceConfig = SUPPORTED_EXCHANGES.binance;
|
|
52
|
+
console.log(binanceConfig.restApiUrl); // "https://api.binance.com"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
|
|
7
56
|
## How to start
|
|
8
57
|
|
|
9
58
|
1. Run `npm install && npm start`. It will build the project and open a default browser with the Charting Library.
|