@onekeyfe/react-native-perp-depth-bar 3.0.162 → 3.0.163
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 +29 -4
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
PerpDepthBar view for React Native
|
|
4
4
|
|
|
5
|
+
Native iOS and Android views for an order-book depth column and a bid/ask ratio
|
|
6
|
+
track. Each view owns native drawing and animation; the application provides
|
|
7
|
+
formatted prices, sizes and percentages.
|
|
8
|
+
|
|
5
9
|
## Installation
|
|
6
10
|
|
|
7
11
|
```sh
|
|
8
|
-
yarn add @onekeyfe/react-native-perp-depth-bar
|
|
12
|
+
yarn add @onekeyfe/react-native-perp-depth-bar react-native-nitro-modules
|
|
9
13
|
```
|
|
10
14
|
|
|
11
15
|
## Usage
|
|
@@ -34,7 +38,7 @@ import { PerpDepthBarsView, PerpSideRatioView } from '@onekeyfe/react-native-per
|
|
|
34
38
|
textInset={8}
|
|
35
39
|
placeholderText="--"
|
|
36
40
|
placeholderRows={3}
|
|
37
|
-
|
|
41
|
+
/>;
|
|
38
42
|
|
|
39
43
|
<PerpSideRatioView
|
|
40
44
|
style={{ width: 220, height: 4 }}
|
|
@@ -46,12 +50,33 @@ import { PerpDepthBarsView, PerpSideRatioView } from '@onekeyfe/react-native-per
|
|
|
46
50
|
cornerRadius={2}
|
|
47
51
|
gap={2}
|
|
48
52
|
reducedMotion={false}
|
|
49
|
-
|
|
53
|
+
/>;
|
|
50
54
|
```
|
|
51
55
|
|
|
56
|
+
## Updates and interaction
|
|
57
|
+
|
|
58
|
+
Install the application's iOS pods and rebuild the native application after
|
|
59
|
+
adding these Nitro views. Keep price/size arrays aligned with the depth rows,
|
|
60
|
+
and provide enough height for `rowHeight` and `rowMarginTop`.
|
|
61
|
+
|
|
62
|
+
For frequent updates, use `setDepth(ArrayBuffer)` with packed Float32 percentages
|
|
63
|
+
and `setText(prices, sizes)` on the depth view's Nitro reference. The first
|
|
64
|
+
imperative call switches that data channel into imperative mode; subsequent
|
|
65
|
+
updates to its initial props are ignored. Likewise, the ratio view exposes
|
|
66
|
+
`setRatio(bidPercentage, askPercentage)` instead of high-frequency ratio props.
|
|
67
|
+
|
|
68
|
+
`onRowPress` returns the zero-based depth row index. `epoch` lets callers snap
|
|
69
|
+
to a new depth dataset rather than animate across a coin or tick-size change.
|
|
70
|
+
`reducedMotion` disables animation. Empty depth/text data can use the configured
|
|
71
|
+
placeholder text and row count.
|
|
72
|
+
|
|
73
|
+
The interfaces are defined in [src/PerpDepthBars.nitro.ts](src/PerpDepthBars.nitro.ts)
|
|
74
|
+
and [src/PerpSideRatio.nitro.ts](src/PerpSideRatio.nitro.ts).
|
|
75
|
+
|
|
52
76
|
## Contributing
|
|
53
77
|
|
|
54
|
-
|
|
78
|
+
Follow the repository's
|
|
79
|
+
[native development workflow](https://github.com/OneKeyHQ/app-modules/blob/main/docs/NATIVE_MODULE_DEVELOPMENT.md).
|
|
55
80
|
|
|
56
81
|
## License
|
|
57
82
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-perp-depth-bar",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.0.163",
|
|
4
|
+
"description": "Native order-book depth bars and bid/ask ratio views for OneKey",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -49,14 +49,15 @@
|
|
|
49
49
|
],
|
|
50
50
|
"repository": {
|
|
51
51
|
"type": "git",
|
|
52
|
-
"url": "git+https://github.com/OneKeyHQ/
|
|
52
|
+
"url": "git+https://github.com/OneKeyHQ/app-modules.git",
|
|
53
|
+
"directory": "native-views/react-native-perp-depth-bar"
|
|
53
54
|
},
|
|
54
55
|
"author": "@onekeyfe <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
|
|
55
56
|
"license": "MIT",
|
|
56
57
|
"bugs": {
|
|
57
|
-
"url": "https://github.com/OneKeyHQ/
|
|
58
|
+
"url": "https://github.com/OneKeyHQ/app-modules/issues"
|
|
58
59
|
},
|
|
59
|
-
"homepage": "https://github.com/OneKeyHQ/native-views/react-native-perp-depth-bar#readme",
|
|
60
|
+
"homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-views/react-native-perp-depth-bar#readme",
|
|
60
61
|
"publishConfig": {
|
|
61
62
|
"registry": "https://registry.npmjs.org/"
|
|
62
63
|
},
|