@learncard/core 1.1.5 → 1.4.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/dist/core.cjs.development.js +1467 -1360
- package/dist/core.cjs.development.js.map +3 -3
- package/dist/core.cjs.production.min.js +47 -46
- package/dist/core.cjs.production.min.js.map +3 -3
- package/dist/core.d.ts +1715 -13
- package/dist/core.esm.js +1467 -1360
- package/dist/core.esm.js.map +3 -3
- package/dist/didkit/didkit_wasm.d.ts +11 -0
- package/dist/didkit/didkit_wasm.js +57 -4
- package/dist/didkit/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit/didkit_wasm_bg.wasm.d.ts +2 -0
- package/dist/didkit_wasm.d.ts +11 -0
- package/dist/didkit_wasm.js +57 -4
- package/dist/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit_wasm_bg.wasm.d.ts +2 -0
- package/package.json +8 -6
- package/dist/README.md +0 -89
- package/dist/didkit/README.md +0 -89
- package/dist/didkit/package.json +0 -15
- package/dist/package.json +0 -15
@@ -20,6 +20,15 @@ export function generateEd25519Key(): string;
|
|
20
20
|
*/
|
21
21
|
export function generateEd25519KeyFromBytes(bytes: Uint8Array): string;
|
22
22
|
/**
|
23
|
+
* @returns {string}
|
24
|
+
*/
|
25
|
+
export function generateSecp256k1Key(): string;
|
26
|
+
/**
|
27
|
+
* @param {Uint8Array} bytes
|
28
|
+
* @returns {string}
|
29
|
+
*/
|
30
|
+
export function generateSecp256k1KeyFromBytes(bytes: Uint8Array): string;
|
31
|
+
/**
|
23
32
|
* @param {string} method_pattern
|
24
33
|
* @param {string} jwk
|
25
34
|
* @returns {string}
|
@@ -168,6 +177,8 @@ export interface InitOutput {
|
|
168
177
|
readonly resolveDID: (a: number, b: number, c: number, d: number) => number;
|
169
178
|
readonly generateEd25519Key: (a: number) => void;
|
170
179
|
readonly generateEd25519KeyFromBytes: (a: number, b: number, c: number) => void;
|
180
|
+
readonly generateSecp256k1Key: (a: number) => void;
|
181
|
+
readonly generateSecp256k1KeyFromBytes: (a: number, b: number, c: number) => void;
|
171
182
|
readonly keyToDID: (a: number, b: number, c: number, d: number, e: number) => void;
|
172
183
|
readonly keyToVerificationMethod: (a: number, b: number, c: number, d: number) => number;
|
173
184
|
readonly issueCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
@@ -301,6 +301,59 @@ export function generateEd25519KeyFromBytes(bytes) {
|
|
301
301
|
}
|
302
302
|
}
|
303
303
|
|
304
|
+
/**
|
305
|
+
* @returns {string}
|
306
|
+
*/
|
307
|
+
export function generateSecp256k1Key() {
|
308
|
+
try {
|
309
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
310
|
+
wasm.generateSecp256k1Key(retptr);
|
311
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
312
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
313
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
314
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
315
|
+
var ptr0 = r0;
|
316
|
+
var len0 = r1;
|
317
|
+
if (r3) {
|
318
|
+
ptr0 = 0;
|
319
|
+
len0 = 0;
|
320
|
+
throw takeObject(r2);
|
321
|
+
}
|
322
|
+
return getStringFromWasm0(ptr0, len0);
|
323
|
+
} finally {
|
324
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
325
|
+
wasm.__wbindgen_free(ptr0, len0);
|
326
|
+
}
|
327
|
+
}
|
328
|
+
|
329
|
+
/**
|
330
|
+
* @param {Uint8Array} bytes
|
331
|
+
* @returns {string}
|
332
|
+
*/
|
333
|
+
export function generateSecp256k1KeyFromBytes(bytes) {
|
334
|
+
try {
|
335
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
336
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
337
|
+
const len0 = WASM_VECTOR_LEN;
|
338
|
+
wasm.generateSecp256k1KeyFromBytes(retptr, ptr0, len0);
|
339
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
340
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
341
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
342
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
343
|
+
var ptr1 = r0;
|
344
|
+
var len1 = r1;
|
345
|
+
if (r3) {
|
346
|
+
ptr1 = 0;
|
347
|
+
len1 = 0;
|
348
|
+
throw takeObject(r2);
|
349
|
+
}
|
350
|
+
return getStringFromWasm0(ptr1, len1);
|
351
|
+
} finally {
|
352
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
353
|
+
wasm.__wbindgen_free(ptr1, len1);
|
354
|
+
}
|
355
|
+
}
|
356
|
+
|
304
357
|
/**
|
305
358
|
* @param {string} method_pattern
|
306
359
|
* @param {string} jwk
|
@@ -707,7 +760,7 @@ function handleError(f, args) {
|
|
707
760
|
function getArrayU8FromWasm0(ptr, len) {
|
708
761
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
709
762
|
}
|
710
|
-
function
|
763
|
+
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
711
764
|
wasm.wasm_bindgen__convert__closures__invoke2_mut__h3ecfeb7a01c1be81(
|
712
765
|
arg0,
|
713
766
|
arg1,
|
@@ -940,7 +993,7 @@ async function init(input) {
|
|
940
993
|
const a = state0.a;
|
941
994
|
state0.a = 0;
|
942
995
|
try {
|
943
|
-
return
|
996
|
+
return __wbg_adapter_110(a, state0.b, arg0, arg1);
|
944
997
|
} finally {
|
945
998
|
state0.a = a;
|
946
999
|
}
|
@@ -1046,8 +1099,8 @@ async function init(input) {
|
|
1046
1099
|
const ret = wasm.memory;
|
1047
1100
|
return addHeapObject(ret);
|
1048
1101
|
};
|
1049
|
-
imports.wbg.
|
1050
|
-
const ret = makeMutClosure(arg0, arg1,
|
1102
|
+
imports.wbg.__wbindgen_closure_wrapper10913 = function (arg0, arg1, arg2) {
|
1103
|
+
const ret = makeMutClosure(arg0, arg1, 3725, __wbg_adapter_24);
|
1051
1104
|
return addHeapObject(ret);
|
1052
1105
|
};
|
1053
1106
|
|
Binary file
|
@@ -5,6 +5,8 @@ export function getVersion(a: number): void;
|
|
5
5
|
export function resolveDID(a: number, b: number, c: number, d: number): number;
|
6
6
|
export function generateEd25519Key(a: number): void;
|
7
7
|
export function generateEd25519KeyFromBytes(a: number, b: number, c: number): void;
|
8
|
+
export function generateSecp256k1Key(a: number): void;
|
9
|
+
export function generateSecp256k1KeyFromBytes(a: number, b: number, c: number): void;
|
8
10
|
export function keyToDID(a: number, b: number, c: number, d: number, e: number): void;
|
9
11
|
export function keyToVerificationMethod(a: number, b: number, c: number, d: number): number;
|
10
12
|
export function issueCredential(a: number, b: number, c: number, d: number, e: number, f: number): number;
|
package/dist/didkit_wasm.d.ts
CHANGED
@@ -20,6 +20,15 @@ export function generateEd25519Key(): string;
|
|
20
20
|
*/
|
21
21
|
export function generateEd25519KeyFromBytes(bytes: Uint8Array): string;
|
22
22
|
/**
|
23
|
+
* @returns {string}
|
24
|
+
*/
|
25
|
+
export function generateSecp256k1Key(): string;
|
26
|
+
/**
|
27
|
+
* @param {Uint8Array} bytes
|
28
|
+
* @returns {string}
|
29
|
+
*/
|
30
|
+
export function generateSecp256k1KeyFromBytes(bytes: Uint8Array): string;
|
31
|
+
/**
|
23
32
|
* @param {string} method_pattern
|
24
33
|
* @param {string} jwk
|
25
34
|
* @returns {string}
|
@@ -168,6 +177,8 @@ export interface InitOutput {
|
|
168
177
|
readonly resolveDID: (a: number, b: number, c: number, d: number) => number;
|
169
178
|
readonly generateEd25519Key: (a: number) => void;
|
170
179
|
readonly generateEd25519KeyFromBytes: (a: number, b: number, c: number) => void;
|
180
|
+
readonly generateSecp256k1Key: (a: number) => void;
|
181
|
+
readonly generateSecp256k1KeyFromBytes: (a: number, b: number, c: number) => void;
|
171
182
|
readonly keyToDID: (a: number, b: number, c: number, d: number, e: number) => void;
|
172
183
|
readonly keyToVerificationMethod: (a: number, b: number, c: number, d: number) => number;
|
173
184
|
readonly issueCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
package/dist/didkit_wasm.js
CHANGED
@@ -301,6 +301,59 @@ export function generateEd25519KeyFromBytes(bytes) {
|
|
301
301
|
}
|
302
302
|
}
|
303
303
|
|
304
|
+
/**
|
305
|
+
* @returns {string}
|
306
|
+
*/
|
307
|
+
export function generateSecp256k1Key() {
|
308
|
+
try {
|
309
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
310
|
+
wasm.generateSecp256k1Key(retptr);
|
311
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
312
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
313
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
314
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
315
|
+
var ptr0 = r0;
|
316
|
+
var len0 = r1;
|
317
|
+
if (r3) {
|
318
|
+
ptr0 = 0;
|
319
|
+
len0 = 0;
|
320
|
+
throw takeObject(r2);
|
321
|
+
}
|
322
|
+
return getStringFromWasm0(ptr0, len0);
|
323
|
+
} finally {
|
324
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
325
|
+
wasm.__wbindgen_free(ptr0, len0);
|
326
|
+
}
|
327
|
+
}
|
328
|
+
|
329
|
+
/**
|
330
|
+
* @param {Uint8Array} bytes
|
331
|
+
* @returns {string}
|
332
|
+
*/
|
333
|
+
export function generateSecp256k1KeyFromBytes(bytes) {
|
334
|
+
try {
|
335
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
336
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
337
|
+
const len0 = WASM_VECTOR_LEN;
|
338
|
+
wasm.generateSecp256k1KeyFromBytes(retptr, ptr0, len0);
|
339
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
340
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
341
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
342
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
343
|
+
var ptr1 = r0;
|
344
|
+
var len1 = r1;
|
345
|
+
if (r3) {
|
346
|
+
ptr1 = 0;
|
347
|
+
len1 = 0;
|
348
|
+
throw takeObject(r2);
|
349
|
+
}
|
350
|
+
return getStringFromWasm0(ptr1, len1);
|
351
|
+
} finally {
|
352
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
353
|
+
wasm.__wbindgen_free(ptr1, len1);
|
354
|
+
}
|
355
|
+
}
|
356
|
+
|
304
357
|
/**
|
305
358
|
* @param {string} method_pattern
|
306
359
|
* @param {string} jwk
|
@@ -707,7 +760,7 @@ function handleError(f, args) {
|
|
707
760
|
function getArrayU8FromWasm0(ptr, len) {
|
708
761
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
709
762
|
}
|
710
|
-
function
|
763
|
+
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
711
764
|
wasm.wasm_bindgen__convert__closures__invoke2_mut__h3ecfeb7a01c1be81(
|
712
765
|
arg0,
|
713
766
|
arg1,
|
@@ -940,7 +993,7 @@ async function init(input) {
|
|
940
993
|
const a = state0.a;
|
941
994
|
state0.a = 0;
|
942
995
|
try {
|
943
|
-
return
|
996
|
+
return __wbg_adapter_110(a, state0.b, arg0, arg1);
|
944
997
|
} finally {
|
945
998
|
state0.a = a;
|
946
999
|
}
|
@@ -1046,8 +1099,8 @@ async function init(input) {
|
|
1046
1099
|
const ret = wasm.memory;
|
1047
1100
|
return addHeapObject(ret);
|
1048
1101
|
};
|
1049
|
-
imports.wbg.
|
1050
|
-
const ret = makeMutClosure(arg0, arg1,
|
1102
|
+
imports.wbg.__wbindgen_closure_wrapper10913 = function (arg0, arg1, arg2) {
|
1103
|
+
const ret = makeMutClosure(arg0, arg1, 3725, __wbg_adapter_24);
|
1051
1104
|
return addHeapObject(ret);
|
1052
1105
|
};
|
1053
1106
|
|
package/dist/didkit_wasm_bg.wasm
CHANGED
Binary file
|
@@ -5,6 +5,8 @@ export function getVersion(a: number): void;
|
|
5
5
|
export function resolveDID(a: number, b: number, c: number, d: number): number;
|
6
6
|
export function generateEd25519Key(a: number): void;
|
7
7
|
export function generateEd25519KeyFromBytes(a: number, b: number, c: number): void;
|
8
|
+
export function generateSecp256k1Key(a: number): void;
|
9
|
+
export function generateSecp256k1KeyFromBytes(a: number, b: number, c: number): void;
|
8
10
|
export function keyToDID(a: number, b: number, c: number, d: number, e: number): void;
|
9
11
|
export function keyToVerificationMethod(a: number, b: number, c: number, d: number): number;
|
10
12
|
export function issueCredential(a: number, b: number, c: number, d: number, e: number, f: number): number;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@learncard/core",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.4.0",
|
4
4
|
"description": "",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"module": "./dist/core.esm.js",
|
@@ -19,12 +19,15 @@
|
|
19
19
|
},
|
20
20
|
"devDependencies": {
|
21
21
|
"@glazed/types": "^0.2.0",
|
22
|
-
"@learncard/types": "2.1.
|
22
|
+
"@learncard/types": "2.1.2",
|
23
23
|
"@types/jest": "^27.5.0",
|
24
24
|
"@types/node": "^17.0.31",
|
25
25
|
"aqu": "0.3.2",
|
26
26
|
"esbuild": "^0.14.38",
|
27
|
+
"esbuild-jest": "^0.5.0",
|
27
28
|
"esbuild-plugin-copy": "^1.3.0",
|
29
|
+
"jest": "27",
|
30
|
+
"ts-jest": "^28.0.5",
|
28
31
|
"tsc-alias": "^1.6.9",
|
29
32
|
"typescript": "^4.6.4"
|
30
33
|
},
|
@@ -50,9 +53,8 @@
|
|
50
53
|
"start": "aqu watch",
|
51
54
|
"lint": "aqu lint",
|
52
55
|
"lint:fix": "aqu lint --fix",
|
53
|
-
"test": "
|
54
|
-
"test:watch": "
|
55
|
-
"test:coverage": "
|
56
|
-
"release": "np"
|
56
|
+
"test": "jest",
|
57
|
+
"test:watch": "jest --watch",
|
58
|
+
"test:coverage": "jest --silent --ci --coverage --coverageReporters=\"text\" --coverageReporters=\"text-summary\""
|
57
59
|
}
|
58
60
|
}
|
package/dist/README.md
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
[](https://www.npmjs.com/package/@spruceid/didkit-wasm) [](https://www.npmjs.com/package/@spruceid/didkit-wasm-node)
|
2
|
-
<!-- Might want those badge in the main README. -->
|
3
|
-
|
4
|
-
# DIDKit WASM
|
5
|
-
|
6
|
-
## Prerequisites to Build from Source
|
7
|
-
|
8
|
-
NPM packages are available but if you would like to compile DIDKit yourself
|
9
|
-
(e.g. to enable different cryptographic backends) you will need the WASM
|
10
|
-
compiler toolchain as well as a specific build tool:
|
11
|
-
|
12
|
-
```bash
|
13
|
-
$ rustup target add wasm32-unknown-unknown
|
14
|
-
$ cargo install wasm-pack
|
15
|
-
# OR
|
16
|
-
# $ curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
17
|
-
```
|
18
|
-
|
19
|
-
## Installation and Usage
|
20
|
-
|
21
|
-
### Node
|
22
|
-
|
23
|
-
WASM can be used in Node.js (any recent version):
|
24
|
-
```bash
|
25
|
-
$ npm i @spruceid/didkit-wasm-node
|
26
|
-
```
|
27
|
-
|
28
|
-
Or build it from source:
|
29
|
-
```bash
|
30
|
-
$ wasm-pack build --target nodejs
|
31
|
-
```
|
32
|
-
|
33
|
-
### Web Frameworks (Bundled)
|
34
|
-
|
35
|
-
WASM can be used with web frameworks and bundlers like Webpack:
|
36
|
-
```bash
|
37
|
-
$ npm i @spruceid/didkit-wasm
|
38
|
-
```
|
39
|
-
|
40
|
-
Or build it from source:
|
41
|
-
```bash
|
42
|
-
$ wasm-pack build
|
43
|
-
```
|
44
|
-
|
45
|
-
> If Webpack doesn't work with the default configuration, you can have a look at
|
46
|
-
> our configuration for
|
47
|
-
> [tzprofiles](https://github.com/spruceid/tzprofiles/blob/main/dapp/webpack.config.js).
|
48
|
-
|
49
|
-
### Vanilla Javascript
|
50
|
-
|
51
|
-
WASM can be used with plain Javascript with newer browsers. As it cannot be used
|
52
|
-
as a NPM package you have to build it manually:
|
53
|
-
```bash
|
54
|
-
$ wasm-pack build --target web
|
55
|
-
```
|
56
|
-
|
57
|
-
The manual tests in `test/` serve as an example on how to import DIDKit.
|
58
|
-
|
59
|
-
## Tests
|
60
|
-
|
61
|
-
The `test/` directory contains manual tests to run in the browser. Instructions
|
62
|
-
are in the README of the directory.
|
63
|
-
|
64
|
-
## Non-Default Compilation
|
65
|
-
|
66
|
-
_**The current version of the `ring` crate does not provide all the symbols
|
67
|
-
needed to run on the browser, see DEPS.md**_
|
68
|
-
|
69
|
-
To compile all features plus `wasm32_c` on `ring`, a C compiler is needed, see
|
70
|
-
[spruceid/ssi](https://github.com/spruceid/didkit/tree/wasm):
|
71
|
-
|
72
|
-
On Ubuntu this one option is to install `clang` and `llvm`:
|
73
|
-
```bash
|
74
|
-
sudo apt install clang-10 llvm-10
|
75
|
-
```
|
76
|
-
|
77
|
-
Then to compile with all features:
|
78
|
-
```bash
|
79
|
-
TARGET_CC=clang-10 TARGET_AR=llvm-ar-10 wasm-pack build --out-dir pkg
|
80
|
-
```
|
81
|
-
|
82
|
-
To use a custom subset of features:
|
83
|
-
```bash
|
84
|
-
wasm-pack build --out-dir pkg -- --no-default-features --features=issue # issue credential/presentation
|
85
|
-
wasm-pack build --out-dir pkg -- --no-default-features --features=verify # verify credential/presentation
|
86
|
-
wasm-pack build --out-dir pkg -- --no-default-features --features=credential # issue/verify credential
|
87
|
-
wasm-pack build --out-dir pkg -- --no-default-features --features=presentation # issue/verify presentation
|
88
|
-
```
|
89
|
-
*don't forget to add `TARGET_CC` and `TARGET_AR` if using `ring` with `wasm32_c`*
|
package/dist/didkit/README.md
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
[](https://www.npmjs.com/package/@spruceid/didkit-wasm) [](https://www.npmjs.com/package/@spruceid/didkit-wasm-node)
|
2
|
-
<!-- Might want those badge in the main README. -->
|
3
|
-
|
4
|
-
# DIDKit WASM
|
5
|
-
|
6
|
-
## Prerequisites to Build from Source
|
7
|
-
|
8
|
-
NPM packages are available but if you would like to compile DIDKit yourself
|
9
|
-
(e.g. to enable different cryptographic backends) you will need the WASM
|
10
|
-
compiler toolchain as well as a specific build tool:
|
11
|
-
|
12
|
-
```bash
|
13
|
-
$ rustup target add wasm32-unknown-unknown
|
14
|
-
$ cargo install wasm-pack
|
15
|
-
# OR
|
16
|
-
# $ curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
17
|
-
```
|
18
|
-
|
19
|
-
## Installation and Usage
|
20
|
-
|
21
|
-
### Node
|
22
|
-
|
23
|
-
WASM can be used in Node.js (any recent version):
|
24
|
-
```bash
|
25
|
-
$ npm i @spruceid/didkit-wasm-node
|
26
|
-
```
|
27
|
-
|
28
|
-
Or build it from source:
|
29
|
-
```bash
|
30
|
-
$ wasm-pack build --target nodejs
|
31
|
-
```
|
32
|
-
|
33
|
-
### Web Frameworks (Bundled)
|
34
|
-
|
35
|
-
WASM can be used with web frameworks and bundlers like Webpack:
|
36
|
-
```bash
|
37
|
-
$ npm i @spruceid/didkit-wasm
|
38
|
-
```
|
39
|
-
|
40
|
-
Or build it from source:
|
41
|
-
```bash
|
42
|
-
$ wasm-pack build
|
43
|
-
```
|
44
|
-
|
45
|
-
> If Webpack doesn't work with the default configuration, you can have a look at
|
46
|
-
> our configuration for
|
47
|
-
> [tzprofiles](https://github.com/spruceid/tzprofiles/blob/main/dapp/webpack.config.js).
|
48
|
-
|
49
|
-
### Vanilla Javascript
|
50
|
-
|
51
|
-
WASM can be used with plain Javascript with newer browsers. As it cannot be used
|
52
|
-
as a NPM package you have to build it manually:
|
53
|
-
```bash
|
54
|
-
$ wasm-pack build --target web
|
55
|
-
```
|
56
|
-
|
57
|
-
The manual tests in `test/` serve as an example on how to import DIDKit.
|
58
|
-
|
59
|
-
## Tests
|
60
|
-
|
61
|
-
The `test/` directory contains manual tests to run in the browser. Instructions
|
62
|
-
are in the README of the directory.
|
63
|
-
|
64
|
-
## Non-Default Compilation
|
65
|
-
|
66
|
-
_**The current version of the `ring` crate does not provide all the symbols
|
67
|
-
needed to run on the browser, see DEPS.md**_
|
68
|
-
|
69
|
-
To compile all features plus `wasm32_c` on `ring`, a C compiler is needed, see
|
70
|
-
[spruceid/ssi](https://github.com/spruceid/didkit/tree/wasm):
|
71
|
-
|
72
|
-
On Ubuntu this one option is to install `clang` and `llvm`:
|
73
|
-
```bash
|
74
|
-
sudo apt install clang-10 llvm-10
|
75
|
-
```
|
76
|
-
|
77
|
-
Then to compile with all features:
|
78
|
-
```bash
|
79
|
-
TARGET_CC=clang-10 TARGET_AR=llvm-ar-10 wasm-pack build --out-dir pkg
|
80
|
-
```
|
81
|
-
|
82
|
-
To use a custom subset of features:
|
83
|
-
```bash
|
84
|
-
wasm-pack build --out-dir pkg -- --no-default-features --features=issue # issue credential/presentation
|
85
|
-
wasm-pack build --out-dir pkg -- --no-default-features --features=verify # verify credential/presentation
|
86
|
-
wasm-pack build --out-dir pkg -- --no-default-features --features=credential # issue/verify credential
|
87
|
-
wasm-pack build --out-dir pkg -- --no-default-features --features=presentation # issue/verify presentation
|
88
|
-
```
|
89
|
-
*don't forget to add `TARGET_CC` and `TARGET_AR` if using `ring` with `wasm32_c`*
|
package/dist/didkit/package.json
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "didkit-wasm",
|
3
|
-
"collaborators": [
|
4
|
-
"Spruce Systems, Inc."
|
5
|
-
],
|
6
|
-
"version": "0.4.0",
|
7
|
-
"files": [
|
8
|
-
"didkit_wasm_bg.wasm",
|
9
|
-
"didkit_wasm.js",
|
10
|
-
"didkit_wasm.d.ts"
|
11
|
-
],
|
12
|
-
"module": "didkit_wasm.js",
|
13
|
-
"types": "didkit_wasm.d.ts",
|
14
|
-
"sideEffects": false
|
15
|
-
}
|
package/dist/package.json
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "didkit-wasm",
|
3
|
-
"collaborators": [
|
4
|
-
"Spruce Systems, Inc."
|
5
|
-
],
|
6
|
-
"version": "0.4.0",
|
7
|
-
"files": [
|
8
|
-
"didkit_wasm_bg.wasm",
|
9
|
-
"didkit_wasm.js",
|
10
|
-
"didkit_wasm.d.ts"
|
11
|
-
],
|
12
|
-
"module": "didkit_wasm.js",
|
13
|
-
"types": "didkit_wasm.d.ts",
|
14
|
-
"sideEffects": false
|
15
|
-
}
|