kline-orderbook-chart 1.1.0 → 1.1.2

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/CHANGELOG.md CHANGED
@@ -5,6 +5,68 @@ This project follows [Semantic Versioning](https://semver.org/).
5
5
 
6
6
  ---
7
7
 
8
+ ## 1.1.1 — Security hardening (Rust-side license enforcement)
9
+
10
+ This release closes the last "patch the JS bundle to bypass licensing"
11
+ gap that existed since `1.0.0`. The public API is unchanged — existing
12
+ Ed25519 tokens continue to work, you do not need to do anything when
13
+ upgrading.
14
+
15
+ ### What changed
16
+
17
+ - **License verification now runs inside the wasm engine.** Up to
18
+ `1.1.0`, the Ed25519 signature check happened in JavaScript
19
+ (`license.js`). An attacker who took the bundled JS and replaced
20
+ `validateLicense()` with `return { valid: true }` could ship the
21
+ engine with no badge and no license server. Now the wasm engine
22
+ itself parses the JWS-compact token, verifies the Ed25519 signature,
23
+ and applies the expiry / domain-whitelist policy. The JS bridge
24
+ passes the raw token string to wasm via `set_license_token(token,
25
+ Date.now(), location.hostname)`; the verdict comes from inside the
26
+ binary.
27
+ - **Watermark badge is drawn from the wasm render loop.** The previous
28
+ build called a `drawWatermark()` function in JavaScript after each
29
+ frame. That function was also a one-line patch in the minified
30
+ bundle. The badge now emits as the LAST `FillRect + StrokeRect +
31
+ Text` commands of every render frame, straight from wasm — there
32
+ is no JavaScript surface to disable. Suppressing the badge now
33
+ requires modifying the `.wasm` binary itself (wasm2wat → edit →
34
+ wat2wasm) and breaks on every release.
35
+ - **Engine default state is "watermarked".** A consumer who forgets
36
+ to call `setLicenseKey(token)` no longer ships a clean chart —
37
+ the badge shows `"Activate license →"` until a valid token lands.
38
+ Fails loud instead of silent.
39
+
40
+ ### Internals
41
+
42
+ - Added `ed25519-compact` (pure Rust, no_std, ~25 KB wasm) to the
43
+ Rust core. No new JavaScript dependencies.
44
+ - New Rust module `license.rs` holds the verifier and policy logic.
45
+ 5 unit tests cover the parser, base64url decoder, and domain
46
+ matcher.
47
+ - Removed dead JS code: ~380 lines of canvas watermark renderer,
48
+ logo SVG, and overlay-positioning helpers.
49
+
50
+ ### What did NOT change
51
+
52
+ - The Ed25519 public key is the same as `1.0.0` / `1.1.0`. Tokens
53
+ issued for any of those versions validate identically on `1.1.1`.
54
+ - The bridge surface (`createChartBridge`, `setLicenseKey`,
55
+ `getDataMethods`, …) is identical.
56
+ - The visible badge text formats (`"Trial: Nd left →"`,
57
+ `"License expired →"`, etc.) match the previous build so existing
58
+ documentation and screenshots stay accurate.
59
+
60
+ ### Upgrade
61
+
62
+ ```bash
63
+ npm install kline-orderbook-chart@1.1.1
64
+ ```
65
+
66
+ No code changes required.
67
+
68
+ ---
69
+
8
70
  ## 1.0.0 — Security release (breaking change)
9
71
 
10
72
  > **All `0.x` versions are deprecated and contain a critical license-validation flaw. Please upgrade.**
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MRD CHART ENGINE — COMMERCIAL SOFTWARE LICENSE AGREEMENT
2
2
 
3
- Copyright (c) 2026 MRD Technologies. All rights reserved.
3
+ Copyright (c) 2025-2026 MRD Technologies. All rights reserved.
4
4
 
5
5
  This software and associated documentation files (the "Software") are proprietary
6
6
  and confidential. The Software is licensed, not sold.
@@ -48,7 +48,11 @@ and confidential. The Software is licensed, not sold.
48
48
 
49
49
  The Software is the intellectual property of MRD Technologies. This
50
50
  license does not grant you ownership of the Software. All rights not
51
- expressly granted are reserved.
51
+ expressly granted are reserved. The Software's underlying algorithms,
52
+ data structures, rendering pipeline, license-enforcement subsystem,
53
+ and DeltaDSL interpreter sandbox are protected by copyright laws,
54
+ international copyright treaties (including the Berne Convention),
55
+ and applicable trade-secret laws.
52
56
 
53
57
  7. WARRANTY DISCLAIMER
54
58
 
@@ -72,7 +76,11 @@ and confidential. The Software is licensed, not sold.
72
76
  10. GOVERNING LAW
73
77
 
74
78
  This agreement shall be governed by and construed in accordance with the
75
- laws of the jurisdiction of MRD Technologies' principal place of business.
79
+ laws of the Socialist Republic of Vietnam. Any dispute arising out of
80
+ or in connection with this agreement shall be subject to the exclusive
81
+ jurisdiction of the competent courts of Vietnam. The United Nations
82
+ Convention on Contracts for the International Sale of Goods (CISG)
83
+ shall not apply.
76
84
 
77
85
  11. CONTACT
78
86
 
package/README.md CHANGED
@@ -9,9 +9,9 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
+ <a href="https://mrd-indicators.com/docs/getting-started"><strong>📖 Docs</strong></a>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
12
13
  <a href="https://app.mrd-indicators.com/trading/chart-terminal">Live Demo</a>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
13
14
  <a href="#run-demo-locally">Run Demo Locally</a>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
14
- <a href="#documentation">Documentation</a>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
15
15
  <a href="https://discord.gg/buX2h5ZZm">Discord</a>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
16
16
  <a href="https://x.com/mrDocTradingIO">X</a>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
17
17
  <a href="mailto:support@mrd-indicators.com">Contact</a>
@@ -26,6 +26,10 @@
26
26
  <img alt="license" src="https://img.shields.io/badge/license-commercial-orange" />
27
27
  </p>
28
28
 
29
+ <p align="center">
30
+ 📖 <strong>Full documentation:</strong> <a href="https://mrd-indicators.com/docs/getting-started"><code>mrd-indicators.com/docs/getting-started</code></a>
31
+ </p>
32
+
29
33
  ---
30
34
 
31
35
  > **Upgrading from `0.x`?** `1.0.0` replaces the license layer with Ed25519
@@ -250,10 +254,10 @@ npm install kline-orderbook-chart
250
254
  ### Basic usage
251
255
 
252
256
  ```javascript
253
- import { createChartBridge, prefetchWasm } from 'kline-orderbook-chart'
257
+ import { createChartBridge, prefetchEngine } from 'kline-orderbook-chart'
254
258
 
255
259
  // Pre-load engine for faster first render (optional)
256
- prefetchWasm()
260
+ prefetchEngine()
257
261
 
258
262
  // Create chart
259
263
  const canvas = document.getElementById('chart')
@@ -378,9 +382,9 @@ For the **full experience** with all features:
378
382
 
379
383
  ```jsx
380
384
  import { useEffect, useRef } from 'react'
381
- import { createChartBridge, prefetchWasm } from 'kline-orderbook-chart'
385
+ import { createChartBridge, prefetchEngine } from 'kline-orderbook-chart'
382
386
 
383
- prefetchWasm()
387
+ prefetchEngine()
384
388
 
385
389
  function Chart({ licenseKey }) {
386
390
  const canvasRef = useRef(null)
@@ -428,9 +432,9 @@ See [full React guide](https://github.com/PhamNhinh/kline-orderbook-chart/blob/m
428
432
 
429
433
  <script setup>
430
434
  import { ref, onMounted, onBeforeUnmount } from 'vue'
431
- import { createChartBridge, prefetchWasm } from 'kline-orderbook-chart'
435
+ import { createChartBridge, prefetchEngine } from 'kline-orderbook-chart'
432
436
 
433
- prefetchWasm()
437
+ prefetchEngine()
434
438
 
435
439
  const el = ref(null)
436
440
  let chart = null
@@ -466,9 +470,9 @@ See [full Vue guide](https://github.com/PhamNhinh/kline-orderbook-chart/blob/mai
466
470
  ```html
467
471
  <canvas id="chart" style="width:100%;height:600px"></canvas>
468
472
  <script type="module">
469
- import { createChartBridge, prefetchWasm } from 'kline-orderbook-chart'
473
+ import { createChartBridge, prefetchEngine } from 'kline-orderbook-chart'
470
474
 
471
- prefetchWasm()
475
+ prefetchEngine()
472
476
 
473
477
  const chart = await createChartBridge(document.getElementById('chart'))
474
478
 
@@ -540,54 +544,54 @@ Requires ES2020.
540
544
 
541
545
  ## Documentation
542
546
 
543
- > **[&rarr; Full Documentation Table of Contents](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/README.md)**
547
+ > **[📖 Read the full docs at mrd-indicators.com/docs/getting-started](https://mrd-indicators.com/docs/getting-started)** — runnable code, framework integrations, and the complete API reference. The Markdown mirrors on GitHub link the same content for offline / IDE browsing.
544
548
 
545
549
  ### Tutorials
546
550
 
547
- | Guide | Description |
548
- |---|---|
549
- | [Getting Started](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/getting-started.md) | Installation, creating your first chart, loading data, starting the render loop |
550
- | [Core Concepts & Architecture](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/architecture.md) | Architecture overview, native engine, command buffer pipeline, responsibility model |
551
- | [Framework Integration](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/examples/framework-integration.md) | Complete examples for React, Vue 3, Svelte, Vanilla JS with SSR handling |
551
+ | Guide | Web docs | GitHub mirror |
552
+ |---|---|---|
553
+ | Getting Started | [mrd-indicators.com/docs/getting-started](https://mrd-indicators.com/docs/getting-started) | [docs/guides/getting-started.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/getting-started.md) |
554
+ | Core Concepts & Architecture | — | [docs/guides/architecture.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/architecture.md) |
555
+ | Framework Integration | [mrd-indicators.com/docs/react-integration](https://mrd-indicators.com/docs/react-integration) | [docs/examples/framework-integration.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/examples/framework-integration.md) |
552
556
 
553
557
  ### Data & Chart Types
554
558
 
555
- | Guide | Description |
556
- |---|---|
557
- | [Candlestick Data](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/data.md) | OHLCV data format, real-time updates, append/prepend, chart types |
558
- | [Orderbook Heatmap](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/orderbook-heatmap.md) | Depth matrix setup, real-time streaming, range configuration, prefetch |
559
- | [Footprint Chart](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/footprint-chart.md) | Trade stream ingestion, display modes, delta histogram, signals |
560
- | [Chart Aggregation](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/chart-aggregation.md) | Renko, Range, and Tick chart construction from OHLCV data |
559
+ | Guide | Web docs | GitHub mirror |
560
+ |---|---|---|
561
+ | Candlestick Data | [mrd-indicators.com/docs/data-loading](https://mrd-indicators.com/docs/data-loading) | [docs/guides/data.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/data.md) |
562
+ | Orderbook Heatmap | [mrd-indicators.com/docs/orderbook-heatmap](https://mrd-indicators.com/docs/orderbook-heatmap) | [docs/guides/orderbook-heatmap.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/orderbook-heatmap.md) |
563
+ | Footprint Chart | [mrd-indicators.com/docs/footprint-chart](https://mrd-indicators.com/docs/footprint-chart) | [docs/guides/footprint-chart.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/footprint-chart.md) |
564
+ | Chart Aggregation | — | [docs/guides/chart-aggregation.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/chart-aggregation.md) |
561
565
 
562
566
  ### Indicators & Analysis
563
567
 
564
- | Guide | Description |
565
- |---|---|
566
- | [Built-in Indicators](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/indicators.md) | All 14+ indicators — RSI, CVD, OI, Funding Rate, VRVP, TPO, VPIN, Smart Ranges, EMA Structure |
567
- | [Custom Indicators](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/custom-indicators.md) | Plugin API with `compute` + `render`, engine-backed drawing primitives |
568
+ | Guide | Web docs | GitHub mirror |
569
+ |---|---|---|
570
+ | Built-in Indicators | [mrd-indicators.com/docs/indicators](https://mrd-indicators.com/docs/indicators) | [docs/guides/indicators.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/indicators.md) |
571
+ | Custom Indicators | — | [docs/guides/custom-indicators.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/custom-indicators.md) |
568
572
 
569
573
  ### Drawing & Interaction
570
574
 
571
- | Guide | Description |
572
- |---|---|
573
- | [Drawing Tools](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/drawings.md) | All 10+ tools, programmatic creation, styling, JSON serialization |
574
- | [Events & Tooltips](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/tooltip.md) | Tooltip callback, drawing events, hover hit tests, crosshair data |
575
- | [Viewport & Interaction](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/viewport-interaction.md) | Pan, zoom, pinch gestures, bar replay, crosshair sync, Y-axis scaling |
575
+ | Guide | Web docs | GitHub mirror |
576
+ |---|---|---|
577
+ | Drawing Tools | [mrd-indicators.com/docs/drawing](https://mrd-indicators.com/docs/drawing) | [docs/guides/drawings.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/drawings.md) |
578
+ | Events & Tooltips | — | [docs/guides/tooltip.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/tooltip.md) |
579
+ | Viewport & Interaction | — | [docs/guides/viewport-interaction.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/viewport-interaction.md) |
576
580
 
577
581
  ### Configuration
578
582
 
579
- | Guide | Description |
580
- |---|---|
581
- | [Theming](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/themes.md) | Dark/light mode, framework theme synchronization |
582
- | [Advanced Topics](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/advanced.md) | Iceberg detection, licensing, performance optimization, memory management |
583
+ | Guide | Web docs | GitHub mirror |
584
+ |---|---|---|
585
+ | Theming | [mrd-indicators.com/docs/chart-instance](https://mrd-indicators.com/docs/chart-instance) | [docs/guides/themes.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/themes.md) |
586
+ | Advanced Topics | — | [docs/guides/advanced.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/guides/advanced.md) |
583
587
 
584
588
  ### Reference
585
589
 
586
- | Guide | Description |
587
- |---|---|
588
- | [API Reference](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/api/README.md) | Complete method & event documentation |
589
- | [React Integration](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/examples/react.md) | Hooks, resize, WebSocket |
590
- | [Vue 3 Integration](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/examples/vue.md) | Composables, theme switching |
590
+ | Guide | Web docs | GitHub mirror |
591
+ |---|---|---|
592
+ | API Reference | [mrd-indicators.com/docs/intro](https://mrd-indicators.com/docs/intro) | [docs/api/README.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/api/README.md) |
593
+ | React Integration | [mrd-indicators.com/docs/react-integration](https://mrd-indicators.com/docs/react-integration) | [docs/examples/react.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/examples/react.md) |
594
+ | Vue 3 Integration | [mrd-indicators.com/docs/react-integration](https://mrd-indicators.com/docs/react-integration) | [docs/examples/vue.md](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/docs/examples/vue.md) |
591
595
 
592
596
  ---
593
597