@xyo-network/wasm 5.3.25 → 5.3.27

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.
Files changed (2) hide show
  1. package/README.md +571 -10
  2. package/package.json +6 -7
package/README.md CHANGED
@@ -1,23 +1,584 @@
1
+ [![logo][]](https://xyo.network)
2
+
1
3
  # @xyo-network/wasm
2
4
 
3
- [![logo][]](https://xyo.network)
5
+ [![npm][npm-badge]][npm-link]
6
+ [![license][license-badge]][license-link]
7
+
8
+ > Primary SDK for using XYO Protocol 2.0
9
+
10
+ ## Install
11
+
12
+ Using npm:
13
+
14
+ ```sh
15
+ npm install {{name}}
16
+ ```
4
17
 
5
- Version: 5.0.2
18
+ Using yarn:
6
19
 
7
- Primary SDK for using XYO Protocol 2.0
20
+ ```sh
21
+ yarn add {{name}}
22
+ ```
8
23
 
9
- ## Documentation
24
+ Using pnpm:
10
25
 
11
- [TypeDoc Generated Documentation](https://gitbook.xyo.network/xyo-data-lab/xyo-reference/package-documentation/xyo-network__wasm)
26
+ ```sh
27
+ pnpm add {{name}}
28
+ ```
29
+
30
+ Using bun:
31
+
32
+ ```sh
33
+ bun add {{name}}
34
+ ```
12
35
 
13
- Part of [sdk-xyo-client-js](https://www.npmjs.com/package/@xyo-network/sdk-xyo-client-js)
14
36
 
15
37
  ## License
16
38
 
17
- > See the [LICENSE](LICENSE) file for license details
39
+ See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
40
+
41
+ ## Reference
42
+
43
+ ### packages
44
+
45
+ ### protocol
46
+
47
+ ### packages
48
+
49
+ ### core
50
+
51
+ ### packages
52
+
53
+ ### wasm
54
+
55
+ ### .temp-typedoc
56
+
57
+ ### classes
58
+
59
+ ### <a id="WasmSupport"></a>WasmSupport
60
+
61
+ [**@xyo-network/wasm**](#../README)
62
+
63
+ ***
64
+
65
+ ## Constructors
66
+
67
+ ### Constructor
68
+
69
+ ```ts
70
+ new WasmSupport(desiredFeatures): WasmSupport;
71
+ ```
72
+
73
+ Instance constructor for use where async instantiation
74
+ is not possible. Where possible, prefer the static
75
+ create method over use of this constructor directly
76
+ as no initialization (feature detection) is able to
77
+ be done here
78
+
79
+ ### Parameters
80
+
81
+ #### desiredFeatures
82
+
83
+ (
84
+ \| `"bigInt"`
85
+ \| `"bulkMemory"`
86
+ \| `"exceptions"`
87
+ \| `"extendedConst"`
88
+ \| `"gc"`
89
+ \| `"memory64"`
90
+ \| `"multiValue"`
91
+ \| `"mutableGlobals"`
92
+ \| `"referenceTypes"`
93
+ \| `"relaxedSimd"`
94
+ \| `"saturatedFloatToInt"`
95
+ \| `"signExtensions"`
96
+ \| `"simd"`
97
+ \| `"streamingCompilation"`
98
+ \| `"tailCall"`
99
+ \| `"threads"`)[]
100
+
101
+ The desired feature set
102
+
103
+ ### Returns
104
+
105
+ `WasmSupport`
106
+
107
+ ## Properties
108
+
109
+ ### desiredFeatures
110
+
111
+ ```ts
112
+ protected desiredFeatures: (
113
+ | "bigInt"
114
+ | "bulkMemory"
115
+ | "exceptions"
116
+ | "extendedConst"
117
+ | "gc"
118
+ | "memory64"
119
+ | "multiValue"
120
+ | "mutableGlobals"
121
+ | "referenceTypes"
122
+ | "relaxedSimd"
123
+ | "saturatedFloatToInt"
124
+ | "signExtensions"
125
+ | "simd"
126
+ | "streamingCompilation"
127
+ | "tailCall"
128
+ | "threads")[];
129
+ ```
130
+
131
+ ## Accessors
132
+
133
+ ### allowWasm
134
+
135
+ ### Get Signature
136
+
137
+ ```ts
138
+ get allowWasm(): boolean;
139
+ ```
140
+
141
+ Is Wasm allowed
142
+
143
+ #### Returns
144
+
145
+ `boolean`
146
+
147
+ ### Set Signature
148
+
149
+ ```ts
150
+ set allowWasm(v): void;
151
+ ```
152
+
153
+ Whether or not to allow WASM usage
154
+
155
+ #### Parameters
156
+
157
+ ##### v
158
+
159
+ `boolean`
160
+
161
+ #### Returns
162
+
163
+ `void`
164
+
165
+ ***
166
+
167
+ ### canUseWasm
168
+
169
+ ### Get Signature
170
+
171
+ ```ts
172
+ get canUseWasm(): boolean;
173
+ ```
174
+
175
+ Whether or not Wasm should be used based on the desired
176
+ feature set, initialization state, or force-use settings
177
+
178
+ #### Returns
179
+
180
+ `boolean`
181
+
182
+ ***
183
+
184
+ ### featureSupport
185
+
186
+ ### Get Signature
187
+
188
+ ```ts
189
+ get featureSupport(): Readonly<Partial<Record<WasmFeature, boolean>>>;
190
+ ```
191
+
192
+ Returns a object containing a property for each desired wasm feature
193
+ with a boolean value indicating whether or not the feature is supported
194
+
195
+ #### Returns
196
+
197
+ `Readonly`\<`Partial`\<`Record`\<[`WasmFeature`](#../type-aliases/WasmFeature), `boolean`\>\>\>
198
+
199
+ ***
200
+
201
+ ### forceWasm
202
+
203
+ ### Get Signature
204
+
205
+ ```ts
206
+ get forceWasm(): boolean;
207
+ ```
208
+
209
+ Force use of Wasm
210
+
211
+ #### Returns
212
+
213
+ `boolean`
214
+
215
+ ### Set Signature
216
+
217
+ ```ts
218
+ set forceWasm(v): void;
219
+ ```
220
+
221
+ Whether or not to force Wasm usage
222
+
223
+ #### Parameters
224
+
225
+ ##### v
226
+
227
+ `boolean`
228
+
229
+ #### Returns
230
+
231
+ `void`
232
+
233
+ ***
234
+
235
+ ### isDesiredFeatureSetSupported
236
+
237
+ ### Get Signature
238
+
239
+ ```ts
240
+ get isDesiredFeatureSetSupported(): boolean;
241
+ ```
242
+
243
+ Whether or not Wasm is supported based
244
+ on the desired feature set
245
+
246
+ #### Returns
247
+
248
+ `boolean`
249
+
250
+ ***
251
+
252
+ ### isInitialized
253
+
254
+ ### Get Signature
255
+
256
+ ```ts
257
+ get isInitialized(): boolean;
258
+ ```
259
+
260
+ Whether or not Wasm detection has been run
261
+ for the desired feature set
262
+
263
+ #### Returns
264
+
265
+ `boolean`
266
+
267
+ ## Methods
268
+
269
+ ### create()
270
+
271
+ ```ts
272
+ static create(desiredFeatures): Promise<WasmSupport>;
273
+ ```
274
+
275
+ Static creation & async initialization for use where
276
+ async instantiation is possible
277
+
278
+ ### Parameters
279
+
280
+ #### desiredFeatures
281
+
282
+ (
283
+ \| `"bigInt"`
284
+ \| `"bulkMemory"`
285
+ \| `"exceptions"`
286
+ \| `"extendedConst"`
287
+ \| `"gc"`
288
+ \| `"memory64"`
289
+ \| `"multiValue"`
290
+ \| `"mutableGlobals"`
291
+ \| `"referenceTypes"`
292
+ \| `"relaxedSimd"`
293
+ \| `"saturatedFloatToInt"`
294
+ \| `"signExtensions"`
295
+ \| `"simd"`
296
+ \| `"streamingCompilation"`
297
+ \| `"tailCall"`
298
+ \| `"threads"`)[]
299
+
300
+ The desired feature set
301
+
302
+ ### Returns
303
+
304
+ `Promise`\<`WasmSupport`\>
305
+
306
+ An initialized instance of the class with detection
307
+ for the desired feature set
308
+
309
+ ***
310
+
311
+ ### featureCheck()
312
+
313
+ ```ts
314
+ featureCheck(features): Promise<boolean>;
315
+ ```
316
+
317
+ Checks for specific wasm features
318
+
319
+ ### Parameters
320
+
321
+ #### features
322
+
323
+ (
324
+ \| `"bigInt"`
325
+ \| `"bulkMemory"`
326
+ \| `"exceptions"`
327
+ \| `"extendedConst"`
328
+ \| `"gc"`
329
+ \| `"memory64"`
330
+ \| `"multiValue"`
331
+ \| `"mutableGlobals"`
332
+ \| `"referenceTypes"`
333
+ \| `"relaxedSimd"`
334
+ \| `"saturatedFloatToInt"`
335
+ \| `"signExtensions"`
336
+ \| `"simd"`
337
+ \| `"streamingCompilation"`
338
+ \| `"tailCall"`
339
+ \| `"threads"`)[]
340
+
341
+ The list of features to check for
342
+
343
+ ### Returns
344
+
345
+ `Promise`\<`boolean`\>
346
+
347
+ True if all the features are supported, false otherwise
348
+
349
+ ***
350
+
351
+ ### initialize()
352
+
353
+ ```ts
354
+ initialize(): Promise<void>;
355
+ ```
356
+
357
+ Does feature detection for the desired feature set
358
+
359
+ ### Returns
360
+
361
+ `Promise`\<`void`\>
362
+
363
+ ***
364
+
365
+ ### detectDesiredFeatures()
366
+
367
+ ```ts
368
+ protected detectDesiredFeatures(): Promise<void>;
369
+ ```
370
+
371
+ ### Returns
372
+
373
+ `Promise`\<`void`\>
374
+
375
+ ### type-aliases
376
+
377
+ ### <a id="WasmFeature"></a>WasmFeature
378
+
379
+ [**@xyo-network/wasm**](#../README)
380
+
381
+ ***
382
+
383
+ ```ts
384
+ type WasmFeature = keyof typeof WasmFeatureDetectors;
385
+ ```
386
+
387
+ ### variables
388
+
389
+ ### <a id="WasmFeatureDetectors"></a>WasmFeatureDetectors
390
+
391
+ [**@xyo-network/wasm**](#../README)
392
+
393
+ ***
394
+
395
+ ```ts
396
+ const WasmFeatureDetectors: object;
397
+ ```
398
+
399
+ ## Type Declaration
400
+
401
+ ### bigInt
402
+
403
+ ```ts
404
+ readonly bigInt: () => Promise<boolean>;
405
+ ```
406
+
407
+ ### Returns
408
+
409
+ `Promise`\<`boolean`\>
410
+
411
+ ### bulkMemory
412
+
413
+ ```ts
414
+ readonly bulkMemory: () => Promise<boolean>;
415
+ ```
416
+
417
+ ### Returns
418
+
419
+ `Promise`\<`boolean`\>
420
+
421
+ ### exceptions
422
+
423
+ ```ts
424
+ readonly exceptions: () => Promise<boolean>;
425
+ ```
426
+
427
+ ### Returns
428
+
429
+ `Promise`\<`boolean`\>
430
+
431
+ ### extendedConst
432
+
433
+ ```ts
434
+ readonly extendedConst: () => Promise<boolean>;
435
+ ```
436
+
437
+ ### Returns
438
+
439
+ `Promise`\<`boolean`\>
440
+
441
+ ### gc
442
+
443
+ ```ts
444
+ readonly gc: () => Promise<boolean>;
445
+ ```
446
+
447
+ ### Returns
448
+
449
+ `Promise`\<`boolean`\>
450
+
451
+ ### memory64
452
+
453
+ ```ts
454
+ readonly memory64: () => Promise<boolean>;
455
+ ```
456
+
457
+ ### Returns
458
+
459
+ `Promise`\<`boolean`\>
460
+
461
+ ### multiValue
462
+
463
+ ```ts
464
+ readonly multiValue: () => Promise<boolean>;
465
+ ```
466
+
467
+ ### Returns
468
+
469
+ `Promise`\<`boolean`\>
470
+
471
+ ### mutableGlobals
472
+
473
+ ```ts
474
+ readonly mutableGlobals: () => Promise<boolean>;
475
+ ```
476
+
477
+ ### Returns
478
+
479
+ `Promise`\<`boolean`\>
480
+
481
+ ### referenceTypes
482
+
483
+ ```ts
484
+ readonly referenceTypes: () => (executor) => Promise<boolean>;
485
+ ```
486
+
487
+ ### Returns
488
+
489
+ ```ts
490
+ (executor): Promise<boolean>;
491
+ ```
492
+
493
+ Creates a new Promise.
494
+
495
+ #### Parameters
496
+
497
+ ##### executor
498
+
499
+ (`resolve`, `reject`) => `void`
500
+
501
+ A callback used to initialize the promise. This callback is passed two arguments:
502
+ a resolve callback used to resolve the promise with a value or the result of another promise,
503
+ and a reject callback used to reject the promise with a provided reason or error.
504
+
505
+ #### Returns
506
+
507
+ `Promise`\<`boolean`\>
508
+
509
+ ### relaxedSimd
510
+
511
+ ```ts
512
+ readonly relaxedSimd: () => Promise<boolean>;
513
+ ```
514
+
515
+ ### Returns
516
+
517
+ `Promise`\<`boolean`\>
518
+
519
+ ### saturatedFloatToInt
520
+
521
+ ```ts
522
+ readonly saturatedFloatToInt: () => Promise<boolean>;
523
+ ```
524
+
525
+ ### Returns
526
+
527
+ `Promise`\<`boolean`\>
528
+
529
+ ### signExtensions
530
+
531
+ ```ts
532
+ readonly signExtensions: () => Promise<boolean>;
533
+ ```
534
+
535
+ ### Returns
536
+
537
+ `Promise`\<`boolean`\>
538
+
539
+ ### simd
540
+
541
+ ```ts
542
+ readonly simd: () => Promise<boolean>;
543
+ ```
544
+
545
+ ### Returns
546
+
547
+ `Promise`\<`boolean`\>
548
+
549
+ ### streamingCompilation
550
+
551
+ ```ts
552
+ readonly streamingCompilation: () => Promise<boolean>;
553
+ ```
554
+
555
+ ### Returns
556
+
557
+ `Promise`\<`boolean`\>
558
+
559
+ ### tailCall
560
+
561
+ ```ts
562
+ readonly tailCall: () => Promise<boolean>;
563
+ ```
564
+
565
+ ### Returns
566
+
567
+ `Promise`\<`boolean`\>
568
+
569
+ ### threads
570
+
571
+ ```ts
572
+ readonly threads: () => Promise<boolean>;
573
+ ```
574
+
575
+ ### Returns
18
576
 
19
- ## Credits
577
+ `Promise`\<`boolean`\>
20
578
 
21
- [Made with 🔥 and ❄️ by XYO](https://xyo.network)
22
579
 
23
- [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
580
+ [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
581
+ [npm-badge]: https://img.shields.io/npm/v/@xyo-network/wasm.svg
582
+ [npm-link]: https://www.npmjs.com/package/@xyo-network/wasm
583
+ [license-badge]: https://img.shields.io/npm/l/@xyo-network/wasm.svg
584
+ [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/wasm",
3
- "version": "5.3.25",
3
+ "version": "5.3.27",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -22,11 +22,11 @@
22
22
  "exports": {
23
23
  ".": {
24
24
  "types": "./dist/neutral/index.d.ts",
25
+ "import": "./dist/neutral/index.mjs",
25
26
  "default": "./dist/neutral/index.mjs"
26
27
  },
27
28
  "./package.json": "./package.json"
28
29
  },
29
- "module": "dist/neutral/index.mjs",
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "files": [
32
32
  "dist",
@@ -40,9 +40,9 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@opentelemetry/api": "^1.9.1",
43
- "@xylabs/sdk-js": "^5.0.93",
44
- "@xylabs/tsconfig": "~7.6.16",
45
- "@xylabs/vitest-extended": "~5.0.93",
43
+ "@xylabs/sdk-js": "^5.0.94",
44
+ "@xylabs/tsconfig": "~7.7.15",
45
+ "@xylabs/vitest-extended": "~5.0.94",
46
46
  "axios": "^1.14.0",
47
47
  "typescript": "~5.9.3",
48
48
  "vite": "^8.0.3",
@@ -51,8 +51,7 @@
51
51
  "zod": "^4.3.6"
52
52
  },
53
53
  "peerDependencies": {
54
- "@xylabs/sdk-js": "^5",
55
- "zod": "^4"
54
+ "@xylabs/sdk-js": "^5"
56
55
  },
57
56
  "publishConfig": {
58
57
  "access": "public"