@pezkuwi/wasm-crypto 7.5.3

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/init.js ADDED
@@ -0,0 +1,17 @@
1
+ import { Bridge } from '@pezkuwi/wasm-bridge';
2
+ import { createWasm } from '@pezkuwi/wasm-crypto-init';
3
+ /**
4
+ * @name bridge
5
+ * @description
6
+ * The JS <-> WASM bridge that is in operation. For the specific package
7
+ * it is a global, i.e. all operations happens on this specific bridge
8
+ */
9
+ export const bridge = new Bridge(createWasm);
10
+ /**
11
+ * @name initBridge
12
+ * @description
13
+ * Creates a new bridge interface with the (optional) initialization function
14
+ */
15
+ export async function initBridge(createWasm) {
16
+ return bridge.init(createWasm);
17
+ }
package/initNone.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @name initWasm
3
+ * @description
4
+ * For historic purposes and for tighter control on init, specifically performing
5
+ * a WASM initialization with no interface whatsoever (no WASM, no ASM.js)
6
+ *
7
+ * Generally should not be used unless you want explicit control over which
8
+ * interfaces are initialized.
9
+ */
10
+ export declare function initWasm(): Promise<void>;
package/initNone.js ADDED
@@ -0,0 +1,17 @@
1
+ import { createWasm } from '@pezkuwi/wasm-crypto-init/none';
2
+ import { initBridge } from './init.js';
3
+ /**
4
+ * @name initWasm
5
+ * @description
6
+ * For historic purposes and for tighter control on init, specifically performing
7
+ * a WASM initialization with no interface whatsoever (no WASM, no ASM.js)
8
+ *
9
+ * Generally should not be used unless you want explicit control over which
10
+ * interfaces are initialized.
11
+ */
12
+ export async function initWasm() {
13
+ await initBridge(createWasm);
14
+ }
15
+ initWasm().catch(() => {
16
+ // cannot happen, initWasm doesn't throw
17
+ });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @name initWasm
3
+ * @description
4
+ * For historic purposes and for tighter control on init, specifically performing
5
+ * a WASM initialization with only ASM.js
6
+ *
7
+ * Generally should not be used unless you want explicit control over which
8
+ * interfaces are initialized.
9
+ */
10
+ export declare function initWasm(): Promise<void>;
package/initOnlyAsm.js ADDED
@@ -0,0 +1,17 @@
1
+ import { createWasm } from '@pezkuwi/wasm-crypto-init/asm';
2
+ import { initBridge } from './init.js';
3
+ /**
4
+ * @name initWasm
5
+ * @description
6
+ * For historic purposes and for tighter control on init, specifically performing
7
+ * a WASM initialization with only ASM.js
8
+ *
9
+ * Generally should not be used unless you want explicit control over which
10
+ * interfaces are initialized.
11
+ */
12
+ export async function initWasm() {
13
+ await initBridge(createWasm);
14
+ }
15
+ initWasm().catch(() => {
16
+ // cannot happen, initWasm doesn't throw
17
+ });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @name initWasm
3
+ * @description
4
+ * For historic purposes and for tighter control on init, specifically performing
5
+ * a WASM initialization with only WASM (generally the default for most platforms)
6
+ *
7
+ * Generally should not be used unless you want explicit control over which
8
+ * interfaces are initialized.
9
+ */
10
+ export declare function initWasm(): Promise<void>;
@@ -0,0 +1,17 @@
1
+ import { createWasm } from '@pezkuwi/wasm-crypto-init/wasm';
2
+ import { initBridge } from './init.js';
3
+ /**
4
+ * @name initWasm
5
+ * @description
6
+ * For historic purposes and for tighter control on init, specifically performing
7
+ * a WASM initialization with only WASM (generally the default for most platforms)
8
+ *
9
+ * Generally should not be used unless you want explicit control over which
10
+ * interfaces are initialized.
11
+ */
12
+ export async function initWasm() {
13
+ await initBridge(createWasm);
14
+ }
15
+ initWasm().catch(() => {
16
+ // cannot happen, initWasm doesn't throw
17
+ });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @name initWasm
3
+ * @description
4
+ * For historic purposes and for tighter control on init, specifically performing
5
+ * a WASM initialization with ASM and an ASM.js fallback
6
+ *
7
+ * Generally should not be used unless you want explicit control over which
8
+ * interfaces are initialized.
9
+ */
10
+ export declare function initWasm(): Promise<void>;
package/initWasmAsm.js ADDED
@@ -0,0 +1,17 @@
1
+ import { createWasm } from '@pezkuwi/wasm-crypto-init/both';
2
+ import { initBridge } from './init.js';
3
+ /**
4
+ * @name initWasm
5
+ * @description
6
+ * For historic purposes and for tighter control on init, specifically performing
7
+ * a WASM initialization with ASM and an ASM.js fallback
8
+ *
9
+ * Generally should not be used unless you want explicit control over which
10
+ * interfaces are initialized.
11
+ */
12
+ export async function initWasm() {
13
+ await initBridge(createWasm);
14
+ }
15
+ initWasm().catch(() => {
16
+ // cannot happen, initWasm doesn't throw
17
+ });
package/package.json ADDED
@@ -0,0 +1,193 @@
1
+ {
2
+ "author": "Jaco Greeff <jacogr@gmail.com>",
3
+ "bugs": "https://github.com/polkadot-js/wasm/issues",
4
+ "description": "A wasm interface layer for use by @polkadot/util-crypto",
5
+ "engines": {
6
+ "node": ">=18"
7
+ },
8
+ "homepage": "https://github.com/polkadot-js/wasm/tree/master/packages/wasm-crypto#readme",
9
+ "license": "Apache-2.0",
10
+ "name": "@pezkuwi/wasm-crypto",
11
+ "repository": {
12
+ "directory": "packages/wasm-crypto",
13
+ "type": "git",
14
+ "url": "https://github.com/polkadot-js/wasm.git"
15
+ },
16
+ "sideEffects": [
17
+ "./initNone.js",
18
+ "./cjs/initNone.js",
19
+ "./initOnlyAsm.js",
20
+ "./cjs/initOnlyAsm.js",
21
+ "./initOnlyWasm.js",
22
+ "./cjs/initOnlyWasm.js",
23
+ "./initWasmAsm.js",
24
+ "./cjs/initWasmAsm.js",
25
+ "./packageDetect.js",
26
+ "./cjs/packageDetect.js"
27
+ ],
28
+ "type": "module",
29
+ "version": "7.5.3",
30
+ "main": "./cjs/index.js",
31
+ "module": "./index.js",
32
+ "types": "./index.d.ts",
33
+ "exports": {
34
+ "./cjs/package.json": "./cjs/package.json",
35
+ "./cjs/*": "./cjs/*.js",
36
+ ".": {
37
+ "module": {
38
+ "types": "./index.d.ts",
39
+ "default": "./index.js"
40
+ },
41
+ "require": {
42
+ "types": "./cjs/index.d.ts",
43
+ "default": "./cjs/index.js"
44
+ },
45
+ "default": {
46
+ "types": "./index.d.ts",
47
+ "default": "./index.js"
48
+ }
49
+ },
50
+ "./bundle": {
51
+ "module": {
52
+ "types": "./bundle.d.ts",
53
+ "default": "./bundle.js"
54
+ },
55
+ "require": {
56
+ "types": "./cjs/bundle.d.ts",
57
+ "default": "./cjs/bundle.js"
58
+ },
59
+ "default": {
60
+ "types": "./bundle.d.ts",
61
+ "default": "./bundle.js"
62
+ }
63
+ },
64
+ "./init": {
65
+ "module": {
66
+ "types": "./init.d.ts",
67
+ "default": "./init.js"
68
+ },
69
+ "require": {
70
+ "types": "./cjs/init.d.ts",
71
+ "default": "./cjs/init.js"
72
+ },
73
+ "default": {
74
+ "types": "./init.d.ts",
75
+ "default": "./init.js"
76
+ }
77
+ },
78
+ "./initNone": {
79
+ "module": {
80
+ "types": "./initNone.d.ts",
81
+ "default": "./initNone.js"
82
+ },
83
+ "require": {
84
+ "types": "./cjs/initNone.d.ts",
85
+ "default": "./cjs/initNone.js"
86
+ },
87
+ "default": {
88
+ "types": "./initNone.d.ts",
89
+ "default": "./initNone.js"
90
+ }
91
+ },
92
+ "./initOnlyAsm": {
93
+ "module": {
94
+ "types": "./initOnlyAsm.d.ts",
95
+ "default": "./initOnlyAsm.js"
96
+ },
97
+ "require": {
98
+ "types": "./cjs/initOnlyAsm.d.ts",
99
+ "default": "./cjs/initOnlyAsm.js"
100
+ },
101
+ "default": {
102
+ "types": "./initOnlyAsm.d.ts",
103
+ "default": "./initOnlyAsm.js"
104
+ }
105
+ },
106
+ "./initOnlyWasm": {
107
+ "module": {
108
+ "types": "./initOnlyWasm.d.ts",
109
+ "default": "./initOnlyWasm.js"
110
+ },
111
+ "require": {
112
+ "types": "./cjs/initOnlyWasm.d.ts",
113
+ "default": "./cjs/initOnlyWasm.js"
114
+ },
115
+ "default": {
116
+ "types": "./initOnlyWasm.d.ts",
117
+ "default": "./initOnlyWasm.js"
118
+ }
119
+ },
120
+ "./initWasmAsm": {
121
+ "module": {
122
+ "types": "./initWasmAsm.d.ts",
123
+ "default": "./initWasmAsm.js"
124
+ },
125
+ "require": {
126
+ "types": "./cjs/initWasmAsm.d.ts",
127
+ "default": "./cjs/initWasmAsm.js"
128
+ },
129
+ "default": {
130
+ "types": "./initWasmAsm.d.ts",
131
+ "default": "./initWasmAsm.js"
132
+ }
133
+ },
134
+ "./package.json": {
135
+ "require": "./cjs/package.json",
136
+ "default": "./package.json"
137
+ },
138
+ "./packageDetect": {
139
+ "module": {
140
+ "types": "./packageDetect.d.ts",
141
+ "default": "./packageDetect.js"
142
+ },
143
+ "require": {
144
+ "types": "./cjs/packageDetect.d.ts",
145
+ "default": "./cjs/packageDetect.js"
146
+ },
147
+ "default": {
148
+ "types": "./packageDetect.d.ts",
149
+ "default": "./packageDetect.js"
150
+ }
151
+ },
152
+ "./packageInfo.js": {
153
+ "module": {
154
+ "types": "./packageInfo.d.ts",
155
+ "default": "./packageInfo.js"
156
+ },
157
+ "require": {
158
+ "types": "./cjs/packageInfo.d.ts",
159
+ "default": "./cjs/packageInfo.js"
160
+ },
161
+ "default": {
162
+ "types": "./packageInfo.d.ts",
163
+ "default": "./packageInfo.js"
164
+ }
165
+ },
166
+ "./packageInfo": {
167
+ "module": {
168
+ "types": "./packageInfo.d.ts",
169
+ "default": "./packageInfo.js"
170
+ },
171
+ "require": {
172
+ "types": "./cjs/packageInfo.d.ts",
173
+ "default": "./cjs/packageInfo.js"
174
+ },
175
+ "default": {
176
+ "types": "./packageInfo.d.ts",
177
+ "default": "./packageInfo.js"
178
+ }
179
+ }
180
+ },
181
+ "dependencies": {
182
+ "@pezkuwi/wasm-bridge": "7.5.3",
183
+ "@pezkuwi/wasm-crypto-asmjs": "7.5.3",
184
+ "@pezkuwi/wasm-crypto-init": "7.5.3",
185
+ "@pezkuwi/wasm-crypto-wasm": "7.5.3",
186
+ "@pezkuwi/wasm-util": "7.5.3",
187
+ "tslib": "^2.7.0"
188
+ },
189
+ "peerDependencies": {
190
+ "@pezkuwi/util": "*",
191
+ "@pezkuwi/x-randomvalues": "*"
192
+ }
193
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { detectPackage } from '@pezkuwi/util';
2
+ import { packageInfo as bridgeInfo } from '@pezkuwi/wasm-bridge/packageInfo';
3
+ import { packageInfo as asmInfo } from '@pezkuwi/wasm-crypto-asmjs/packageInfo';
4
+ import { packageInfo as initInfo } from '@pezkuwi/wasm-crypto-init/packageInfo';
5
+ import { packageInfo as wasmInfo } from '@pezkuwi/wasm-crypto-wasm/packageInfo';
6
+ import { packageInfo as utilInfo } from '@pezkuwi/wasm-util/packageInfo';
7
+ import { packageInfo } from './packageInfo.js';
8
+ detectPackage(packageInfo, null, [asmInfo, bridgeInfo, initInfo, utilInfo, wasmInfo]);
@@ -0,0 +1,6 @@
1
+ export declare const packageInfo: {
2
+ name: string;
3
+ path: string;
4
+ type: string;
5
+ version: string;
6
+ };
package/packageInfo.js ADDED
@@ -0,0 +1 @@
1
+ export const packageInfo = { name: '@pezkuwi/wasm-crypto', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '7.5.3' };