@openwallet-foundation/askar-shared 0.3.1 → 0.3.2-alpha-20250205012009
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 +8 -15
- package/build/askar/Askar.d.ts +1 -1
- package/package.json +9 -11
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Askar Shared
|
|
2
2
|
|
|
3
|
-
This package does not contain any functionality, just the classes and types that wrap around the native NodeJS / React Native functionality
|
|
3
|
+
This package does not contain any functionality, just the classes and types that wrap around the native NodeJS / React Native functionality.
|
|
4
|
+
|
|
5
|
+
See the [project README](https://github.com/openwallet-foundation/askar-wrapper-javascript) for version compatability between Askar and this JavaScript Wrapper.
|
|
4
6
|
|
|
5
7
|
## Platform independent setup
|
|
6
8
|
|
|
@@ -10,35 +12,26 @@ Before calling any methods you then need to make sure you register the platform
|
|
|
10
12
|
|
|
11
13
|
```typescript
|
|
12
14
|
// register.ts
|
|
13
|
-
import
|
|
15
|
+
import "@openwallet-foundation/askar-nodejs";
|
|
14
16
|
```
|
|
15
17
|
|
|
16
18
|
```typescript
|
|
17
19
|
// register.native.ts
|
|
18
|
-
import
|
|
20
|
+
import "@openwallet-foundation/askar-react-native";
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
An alterative approach is to first try to require the Node.JS package, and otherwise require the React Native package:
|
|
22
24
|
|
|
23
25
|
```typescript
|
|
24
26
|
try {
|
|
25
|
-
require(
|
|
27
|
+
require("@openwallet-foundation/askar-nodejs");
|
|
26
28
|
} catch (error) {
|
|
27
29
|
try {
|
|
28
|
-
require(
|
|
30
|
+
require("@openwallet-foundation/askar-react-native");
|
|
29
31
|
} catch (error) {
|
|
30
|
-
throw new Error(
|
|
32
|
+
throw new Error("Could not load Askar bindings");
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
```
|
|
34
36
|
|
|
35
37
|
How you approach it is up to you, as long as the native binding are called before any actions are performed on the Askar library.
|
|
36
|
-
|
|
37
|
-
## Version Compatibility
|
|
38
|
-
|
|
39
|
-
The JavaScript wrapper is versioned independently from the native bindings. The following table shows the compatibility between the different versions:
|
|
40
|
-
|
|
41
|
-
| Askar | JavaScript Wrapper |
|
|
42
|
-
| ----------- | ------------------ |
|
|
43
|
-
| v0.2.9 | v0.1.0, v0.1.1 |
|
|
44
|
-
| v0.3.1 | v0.2.0 |
|
package/build/askar/Askar.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openwallet-foundation/askar-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2-alpha-20250205012009",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Shared library for using Askar with NodeJS and React Native",
|
|
6
6
|
"main": "build/index",
|
|
@@ -17,20 +17,18 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
|
-
"build"
|
|
21
|
-
"../../LICENSE"
|
|
20
|
+
"build"
|
|
22
21
|
],
|
|
23
|
-
"scripts": {
|
|
24
|
-
"types:check": "pnpm compile --noEmit",
|
|
25
|
-
"build": "pnpm clean && pnpm compile",
|
|
26
|
-
"clean": "rimraf -rf ./build",
|
|
27
|
-
"compile": "tsc -p ./tsconfig.build.json"
|
|
28
|
-
},
|
|
29
22
|
"dependencies": {
|
|
30
23
|
"buffer": "^6.0.3"
|
|
31
24
|
},
|
|
32
25
|
"devDependencies": {
|
|
33
26
|
"typescript": "~5.4.5"
|
|
34
27
|
},
|
|
35
|
-
"
|
|
36
|
-
|
|
28
|
+
"scripts": {
|
|
29
|
+
"types:check": "pnpm compile --noEmit",
|
|
30
|
+
"build": "pnpm clean && pnpm compile",
|
|
31
|
+
"clean": "rimraf -rf ./build",
|
|
32
|
+
"compile": "tsc -p ./tsconfig.build.json"
|
|
33
|
+
}
|
|
34
|
+
}
|