@derec-alliance/react-native 0.0.3 → 0.0.5
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 +18 -0
- package/android/src/main/jniLibs/arm64-v8a/libderec_library.a +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libderec_library.a +0 -0
- package/android/src/main/jniLibs/x86_64/libderec_library.a +0 -0
- package/ios/DeRecFFI.xcframework/Info.plist +5 -5
- package/ios/DeRecFFI.xcframework/ios-arm64/libderec_library.a +0 -0
- package/ios/DeRecFFI.xcframework/ios-arm64_x86_64-simulator/libderec_library.a +2 -2
- package/lib/types.d.ts +11 -0
- package/package.json +17 -3
- package/src/types.ts +11 -0
package/README.md
CHANGED
|
@@ -58,6 +58,24 @@ release build already includes whatever native modules are linked in.
|
|
|
58
58
|
|
|
59
59
|
---
|
|
60
60
|
|
|
61
|
+
## Protocol schema
|
|
62
|
+
|
|
63
|
+
The package ships the DeRec `.proto` schema under `schema/` so you can
|
|
64
|
+
generate code for any language without a `lib-derec` checkout:
|
|
65
|
+
|
|
66
|
+
- `schema/proto/` — the 18 schema files, flat. Every import is a bare
|
|
67
|
+
filename, so a single include root resolves the whole closure:
|
|
68
|
+
`protoc --proto_path=node_modules/@derec-alliance/react-native/schema/proto node_modules/@derec-alliance/react-native/schema/proto/*.proto`
|
|
69
|
+
- `schema/derec_descriptor.bin` — the same closure precompiled, well-known
|
|
70
|
+
types included. Needs no include path at all. Compiled with
|
|
71
|
+
`--include_source_info`, so code generated from it keeps the protocol's doc
|
|
72
|
+
comments instead of emitting bare type declarations.
|
|
73
|
+
|
|
74
|
+
The schema is versioned with the package: `vX.Y.Z` carries exactly the schema
|
|
75
|
+
`vX.Y.Z` was built from.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
61
79
|
## Quickstart: pairing two devices
|
|
62
80
|
|
|
63
81
|
`DeRecProtocol` is the orchestrator: it owns protocol state, drives flows to
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -10,18 +10,15 @@
|
|
|
10
10
|
<key>HeadersPath</key>
|
|
11
11
|
<string>Headers</string>
|
|
12
12
|
<key>LibraryIdentifier</key>
|
|
13
|
-
<string>ios-
|
|
13
|
+
<string>ios-arm64</string>
|
|
14
14
|
<key>LibraryPath</key>
|
|
15
15
|
<string>libderec_library.a</string>
|
|
16
16
|
<key>SupportedArchitectures</key>
|
|
17
17
|
<array>
|
|
18
18
|
<string>arm64</string>
|
|
19
|
-
<string>x86_64</string>
|
|
20
19
|
</array>
|
|
21
20
|
<key>SupportedPlatform</key>
|
|
22
21
|
<string>ios</string>
|
|
23
|
-
<key>SupportedPlatformVariant</key>
|
|
24
|
-
<string>simulator</string>
|
|
25
22
|
</dict>
|
|
26
23
|
<dict>
|
|
27
24
|
<key>BinaryPath</key>
|
|
@@ -29,15 +26,18 @@
|
|
|
29
26
|
<key>HeadersPath</key>
|
|
30
27
|
<string>Headers</string>
|
|
31
28
|
<key>LibraryIdentifier</key>
|
|
32
|
-
<string>ios-
|
|
29
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
33
30
|
<key>LibraryPath</key>
|
|
34
31
|
<string>libderec_library.a</string>
|
|
35
32
|
<key>SupportedArchitectures</key>
|
|
36
33
|
<array>
|
|
37
34
|
<string>arm64</string>
|
|
35
|
+
<string>x86_64</string>
|
|
38
36
|
</array>
|
|
39
37
|
<key>SupportedPlatform</key>
|
|
40
38
|
<string>ios</string>
|
|
39
|
+
<key>SupportedPlatformVariant</key>
|
|
40
|
+
<string>simulator</string>
|
|
41
41
|
</dict>
|
|
42
42
|
</array>
|
|
43
43
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/ios/DeRecFFI.xcframework/ios-arm64_x86_64-simulator/libderec_library.a
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 38506456 bytes
|
|
4
|
+
sha256: 33e518ee499aa5108c6383387d8b15859e5e0e2109ee2a6470a22592de660a9e
|
package/lib/types.d.ts
CHANGED
|
@@ -180,6 +180,17 @@ export interface Share {
|
|
|
180
180
|
version: number;
|
|
181
181
|
bytes: Uint8Array;
|
|
182
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Share-record persistence.
|
|
185
|
+
*
|
|
186
|
+
* Rows are keyed by `(secretId, channelId, version)` where `secretId` is
|
|
187
|
+
* the partition passed to every method. `Share.secretId` is a different
|
|
188
|
+
* value: it names the secret the bytes belong to, which on a helper is
|
|
189
|
+
* the owner's id and routinely differs from the partition this device
|
|
190
|
+
* stores under. Key on the argument and carry `share.secretId` alongside
|
|
191
|
+
* as data — keying on it instead puts rows where no `load` looks, since
|
|
192
|
+
* every read filters on the partition.
|
|
193
|
+
*/
|
|
183
194
|
export interface ShareStore {
|
|
184
195
|
load(secretId: string, channelId: string, versions: number[]): Promise<Share[]>;
|
|
185
196
|
loadMany(secretId: string, channelIds: string[], versions: number[]): Promise<Share[]>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@derec-alliance/react-native",
|
|
3
|
+
"version": "0.0.5",
|
|
3
4
|
"description": "React Native bindings for derec-library, the Rust SDK for the DeRec protocol.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
4
6
|
"repository": {
|
|
5
7
|
"type": "git",
|
|
6
8
|
"url": "git+https://github.com/derecalliance/lib-derec"
|
|
7
9
|
},
|
|
10
|
+
"homepage": "https://derec.org",
|
|
8
11
|
"main": "lib/index.js",
|
|
9
12
|
"types": "lib/index.d.ts",
|
|
10
13
|
"files": [
|
|
@@ -21,10 +24,23 @@
|
|
|
21
24
|
"README.md",
|
|
22
25
|
"LICENSE"
|
|
23
26
|
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc --project tsconfig.build.json",
|
|
29
|
+
"test": "jest",
|
|
30
|
+
"typecheck": "tsc --noEmit"
|
|
31
|
+
},
|
|
24
32
|
"peerDependencies": {
|
|
25
33
|
"react": ">=18.2.0",
|
|
26
34
|
"react-native": ">=0.76.0"
|
|
27
35
|
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/jest": "^30.0.0",
|
|
38
|
+
"@types/node": "^26.3.0",
|
|
39
|
+
"jest": "^30.4.2",
|
|
40
|
+
"react-native": "^0.87.0",
|
|
41
|
+
"ts-jest": "^29.4.12",
|
|
42
|
+
"typescript": "^5.9.3"
|
|
43
|
+
},
|
|
28
44
|
"keywords": [
|
|
29
45
|
"derec",
|
|
30
46
|
"decentralized",
|
|
@@ -36,7 +52,5 @@
|
|
|
36
52
|
"android",
|
|
37
53
|
"typescript",
|
|
38
54
|
"jsi"
|
|
39
|
-
]
|
|
40
|
-
"version": "0.0.3",
|
|
41
|
-
"license": "Apache-2.0"
|
|
55
|
+
]
|
|
42
56
|
}
|
package/src/types.ts
CHANGED
|
@@ -256,6 +256,17 @@ export interface Share {
|
|
|
256
256
|
bytes: Uint8Array;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
+
/**
|
|
260
|
+
* Share-record persistence.
|
|
261
|
+
*
|
|
262
|
+
* Rows are keyed by `(secretId, channelId, version)` where `secretId` is
|
|
263
|
+
* the partition passed to every method. `Share.secretId` is a different
|
|
264
|
+
* value: it names the secret the bytes belong to, which on a helper is
|
|
265
|
+
* the owner's id and routinely differs from the partition this device
|
|
266
|
+
* stores under. Key on the argument and carry `share.secretId` alongside
|
|
267
|
+
* as data — keying on it instead puts rows where no `load` looks, since
|
|
268
|
+
* every read filters on the partition.
|
|
269
|
+
*/
|
|
259
270
|
export interface ShareStore {
|
|
260
271
|
load(secretId: string, channelId: string, versions: number[]): Promise<Share[]>;
|
|
261
272
|
loadMany(
|