@contentauth/c2pa-wasm 0.2.1 → 0.3.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/README.md +9 -12
- package/package.json +1 -1
- package/pkg/c2pa.d.ts +78 -5
- package/pkg/c2pa.js +416 -176
- package/pkg/c2pa_bg.wasm +0 -0
- package/pkg/c2pa_bg.wasm.d.ts +16 -5
package/README.md
CHANGED
|
@@ -10,9 +10,9 @@ npm install @contentauth/c2pa-wasm
|
|
|
10
10
|
|
|
11
11
|
## Development
|
|
12
12
|
|
|
13
|
-
### Prerequsities
|
|
13
|
+
### Prerequsities
|
|
14
14
|
|
|
15
|
-
Ensure the repo-wide prerequisites [NX](https://nx.dev/getting-started/intro) and [pnpm](https://pnpm.io/) are installed.
|
|
15
|
+
Ensure the repo-wide prerequisites [NX](https://nx.dev/getting-started/intro) and [pnpm](https://pnpm.io/) are installed.
|
|
16
16
|
|
|
17
17
|
Then, all of the following prerequisites must be installed before `c2pa-wasm` can be built:
|
|
18
18
|
|
|
@@ -20,31 +20,26 @@ Then, all of the following prerequisites must be installed before `c2pa-wasm` ca
|
|
|
20
20
|
|
|
21
21
|
[Installation instructions](https://www.rust-lang.org/tools/install)
|
|
22
22
|
|
|
23
|
-
Minimum supported Rust version:
|
|
23
|
+
Minimum supported Rust version: **1.86.0**.
|
|
24
24
|
|
|
25
25
|
Additionally, the `wasm32-unknown-unknown` target must be installed:
|
|
26
|
+
|
|
26
27
|
```sh
|
|
27
28
|
rustup target add wasm32-unknown-unknown
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
|
|
31
31
|
#### wasm-bindgen-cli
|
|
32
32
|
|
|
33
33
|
[Documentation](https://wasm-bindgen.github.io/wasm-bindgen/reference/cli)
|
|
34
|
-
```sh
|
|
35
|
-
cargo install wasm-bindgen-cli@0.2.101
|
|
36
|
-
```
|
|
37
34
|
|
|
38
|
-
#### wasm-opt
|
|
39
|
-
|
|
40
|
-
[Documentation](https://github.com/WebAssembly/binaryen)
|
|
41
35
|
```sh
|
|
42
|
-
cargo install wasm-
|
|
36
|
+
cargo install wasm-bindgen-cli@0.2.103
|
|
43
37
|
```
|
|
44
38
|
|
|
45
39
|
#### wasm-pack
|
|
46
40
|
|
|
47
41
|
[Documentation](https://rustwasm.github.io/docs/wasm-pack/)
|
|
42
|
+
|
|
48
43
|
```sh
|
|
49
44
|
cargo install wasm-pack@0.13.1
|
|
50
45
|
```
|
|
@@ -52,6 +47,7 @@ cargo install wasm-pack@0.13.1
|
|
|
52
47
|
### Building
|
|
53
48
|
|
|
54
49
|
To build the library:
|
|
50
|
+
|
|
55
51
|
```sh
|
|
56
52
|
nx build c2pa-wasm
|
|
57
53
|
```
|
|
@@ -60,9 +56,10 @@ This will execute the commands defined in the [nx-wasm-bindgen executor](https:/
|
|
|
60
56
|
|
|
61
57
|
### Testing
|
|
62
58
|
|
|
63
|
-
The library relies on [`wasm-pack`](
|
|
59
|
+
The library relies on [`wasm-pack`](https://rustwasm.github.io/docs/wasm-pack/) to run its tests. As a general principle, the majority of test coverage will come from `c2pa-web`'s test suite.
|
|
64
60
|
|
|
65
61
|
To run the tests:
|
|
62
|
+
|
|
66
63
|
```
|
|
67
64
|
nx test c2pa-wasm
|
|
68
65
|
```
|
package/package.json
CHANGED
package/pkg/c2pa.d.ts
CHANGED
|
@@ -8,6 +8,60 @@ export function loadSettings(settings: string): void;
|
|
|
8
8
|
* Called when the WASM binary is initialized.
|
|
9
9
|
*/
|
|
10
10
|
export function run(): void;
|
|
11
|
+
|
|
12
|
+
interface SignerDefinition {
|
|
13
|
+
sign: (bytes: Uint8Array) => Promise<Uint8Array>;
|
|
14
|
+
reserveSize: number;
|
|
15
|
+
alg: string;
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Wraps a `c2pa::Builder`.
|
|
20
|
+
*/
|
|
21
|
+
export class WasmBuilder {
|
|
22
|
+
private constructor();
|
|
23
|
+
free(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Attempts to create a new `WasmBuilder` from a JSON ManifestDefinition string.
|
|
26
|
+
*/
|
|
27
|
+
static fromJson(json: string): WasmBuilder;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the remote_url for a remote manifest.
|
|
30
|
+
*
|
|
31
|
+
* The URL must return the manifest data and is injected into the destination asset when signing.
|
|
32
|
+
* For remote-only manifests, set the `no_embed` flag to `true`.
|
|
33
|
+
*/
|
|
34
|
+
setRemoteUrl(format: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the state of the no_embed flag.
|
|
37
|
+
*/
|
|
38
|
+
setNoEmbed(no_embed: boolean): void;
|
|
39
|
+
/**
|
|
40
|
+
* Sets a thumbnail from a [`Blob`] to be included in the manifest. The thumbnail should represent the asset being signed.
|
|
41
|
+
*/
|
|
42
|
+
setThumbnailFromBlob(format: string, blob: Blob): void;
|
|
43
|
+
/**
|
|
44
|
+
* Add an ingredient to the manifest from a JSON ingredient definition and a [`Blob`].
|
|
45
|
+
*
|
|
46
|
+
* # Arguments
|
|
47
|
+
* * `ingredient_json` - A JSON string representing the ingredient. This ingredient is merged with the ingredient specified in the `stream` argument, and these values take precedence.
|
|
48
|
+
* * `format` - The format of the ingredient.
|
|
49
|
+
* * `blob` - A [`Blob`] representing an asset which should be included as an ingredient.
|
|
50
|
+
*/
|
|
51
|
+
addIngredientFromBlob(json: string, format: string, blob: Blob): void;
|
|
52
|
+
/**
|
|
53
|
+
* Add a [`Blob`] to the manifest as a resource. The ID must match an identifier in the manifest.
|
|
54
|
+
*/
|
|
55
|
+
addResourceFromBlob(id: string, blob: Blob): void;
|
|
56
|
+
/**
|
|
57
|
+
* Get the current manifest definition.
|
|
58
|
+
*/
|
|
59
|
+
getDefinition(): string;
|
|
60
|
+
/**
|
|
61
|
+
* Sign an asset using the provided SignerDefinition, format, and source Blob.
|
|
62
|
+
*/
|
|
63
|
+
sign(signer_definition: SignerDefinition, format: string, source: Blob): Promise<Uint8Array>;
|
|
64
|
+
}
|
|
11
65
|
/**
|
|
12
66
|
* Wraps a `c2pa::Reader`.
|
|
13
67
|
*/
|
|
@@ -45,11 +99,32 @@ export class WasmReader {
|
|
|
45
99
|
*/
|
|
46
100
|
resourceToBuffer(uri: string): ArrayBuffer;
|
|
47
101
|
}
|
|
102
|
+
export class WasmSigner {
|
|
103
|
+
private constructor();
|
|
104
|
+
free(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Attempt to create a new [`WasmSigner`] from a SignerDefinition.
|
|
107
|
+
*/
|
|
108
|
+
static fromDefinition(def: SignerDefinition): WasmSigner;
|
|
109
|
+
}
|
|
48
110
|
|
|
49
111
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
50
112
|
|
|
51
113
|
export interface InitOutput {
|
|
52
114
|
readonly memory: WebAssembly.Memory;
|
|
115
|
+
readonly __wbg_wasmbuilder_free: (a: number, b: number) => void;
|
|
116
|
+
readonly wasmbuilder_fromJson: (a: number, b: number) => [number, number, number];
|
|
117
|
+
readonly wasmbuilder_setRemoteUrl: (a: number, b: number, c: number) => void;
|
|
118
|
+
readonly wasmbuilder_setNoEmbed: (a: number, b: number) => void;
|
|
119
|
+
readonly wasmbuilder_setThumbnailFromBlob: (a: number, b: number, c: number, d: any) => [number, number];
|
|
120
|
+
readonly wasmbuilder_addIngredientFromBlob: (a: number, b: number, c: number, d: number, e: number, f: any) => [number, number];
|
|
121
|
+
readonly wasmbuilder_addResourceFromBlob: (a: number, b: number, c: number, d: any) => [number, number];
|
|
122
|
+
readonly wasmbuilder_getDefinition: (a: number) => [number, number, number];
|
|
123
|
+
readonly wasmbuilder_sign: (a: number, b: any, c: number, d: number, e: any) => any;
|
|
124
|
+
readonly loadSettings: (a: number, b: number) => [number, number];
|
|
125
|
+
readonly __wbg_wasmsigner_free: (a: number, b: number) => void;
|
|
126
|
+
readonly wasmsigner_fromDefinition: (a: any) => [number, number, number];
|
|
127
|
+
readonly run: () => void;
|
|
53
128
|
readonly __wbg_wasmreader_free: (a: number, b: number) => void;
|
|
54
129
|
readonly wasmreader_fromBlob: (a: number, b: number, c: any) => any;
|
|
55
130
|
readonly wasmreader_fromBlobFragment: (a: number, b: number, c: any, d: any) => any;
|
|
@@ -58,8 +133,6 @@ export interface InitOutput {
|
|
|
58
133
|
readonly wasmreader_activeManifest: (a: number) => [number, number, number];
|
|
59
134
|
readonly wasmreader_json: (a: number) => [number, number];
|
|
60
135
|
readonly wasmreader_resourceToBuffer: (a: number, b: number, c: number) => [number, number, number];
|
|
61
|
-
readonly loadSettings: (a: number, b: number) => [number, number];
|
|
62
|
-
readonly run: () => void;
|
|
63
136
|
readonly ring_core_0_17_14__bn_mul_mont: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
64
137
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
65
138
|
readonly __externref_table_alloc: () => number;
|
|
@@ -69,9 +142,9 @@ export interface InitOutput {
|
|
|
69
142
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
70
143
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
71
144
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
72
|
-
readonly
|
|
73
|
-
readonly
|
|
74
|
-
readonly
|
|
145
|
+
readonly closure1669_externref_shim: (a: number, b: number, c: any) => void;
|
|
146
|
+
readonly wasm_bindgen__convert__closures_____invoke__h09e04d5375df482d: (a: number, b: number) => void;
|
|
147
|
+
readonly closure2615_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
75
148
|
readonly __wbindgen_start: () => void;
|
|
76
149
|
}
|
|
77
150
|
|
package/pkg/c2pa.js
CHANGED
|
@@ -119,37 +119,6 @@ function isLikeNone(x) {
|
|
|
119
119
|
return x === undefined || x === null;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
123
|
-
? { register: () => {}, unregister: () => {} }
|
|
124
|
-
: new FinalizationRegistry(state => {
|
|
125
|
-
wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b)
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
129
|
-
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
130
|
-
const real = (...args) => {
|
|
131
|
-
// First up with a closure we increment the internal reference
|
|
132
|
-
// count. This ensures that the Rust closure environment won't
|
|
133
|
-
// be deallocated while we're invoking it.
|
|
134
|
-
state.cnt++;
|
|
135
|
-
const a = state.a;
|
|
136
|
-
state.a = 0;
|
|
137
|
-
try {
|
|
138
|
-
return f(a, state.b, ...args);
|
|
139
|
-
} finally {
|
|
140
|
-
if (--state.cnt === 0) {
|
|
141
|
-
wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
|
|
142
|
-
CLOSURE_DTORS.unregister(state);
|
|
143
|
-
} else {
|
|
144
|
-
state.a = a;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
real.original = state;
|
|
149
|
-
CLOSURE_DTORS.register(real, state, state);
|
|
150
|
-
return real;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
122
|
function debugString(val) {
|
|
154
123
|
// primitive types
|
|
155
124
|
const type = typeof val;
|
|
@@ -215,6 +184,40 @@ function debugString(val) {
|
|
|
215
184
|
return className;
|
|
216
185
|
}
|
|
217
186
|
|
|
187
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
188
|
+
? { register: () => {}, unregister: () => {} }
|
|
189
|
+
: new FinalizationRegistry(
|
|
190
|
+
state => {
|
|
191
|
+
wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b);
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
196
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
197
|
+
const real = (...args) => {
|
|
198
|
+
|
|
199
|
+
// First up with a closure we increment the internal reference
|
|
200
|
+
// count. This ensures that the Rust closure environment won't
|
|
201
|
+
// be deallocated while we're invoking it.
|
|
202
|
+
state.cnt++;
|
|
203
|
+
const a = state.a;
|
|
204
|
+
state.a = 0;
|
|
205
|
+
try {
|
|
206
|
+
return f(a, state.b, ...args);
|
|
207
|
+
} finally {
|
|
208
|
+
if (--state.cnt === 0) {
|
|
209
|
+
wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
|
|
210
|
+
CLOSURE_DTORS.unregister(state);
|
|
211
|
+
} else {
|
|
212
|
+
state.a = a;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
real.original = state;
|
|
217
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
218
|
+
return real;
|
|
219
|
+
}
|
|
220
|
+
|
|
218
221
|
function takeFromExternrefTable0(idx) {
|
|
219
222
|
const value = wasm.__wbindgen_export_2.get(idx);
|
|
220
223
|
wasm.__externref_table_dealloc(idx);
|
|
@@ -240,22 +243,155 @@ export function run() {
|
|
|
240
243
|
wasm.run();
|
|
241
244
|
}
|
|
242
245
|
|
|
243
|
-
function
|
|
244
|
-
wasm.
|
|
246
|
+
function __wbg_adapter_6(arg0, arg1, arg2) {
|
|
247
|
+
wasm.closure1669_externref_shim(arg0, arg1, arg2);
|
|
245
248
|
}
|
|
246
249
|
|
|
247
|
-
function
|
|
248
|
-
wasm.
|
|
250
|
+
function __wbg_adapter_11(arg0, arg1) {
|
|
251
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h09e04d5375df482d(arg0, arg1);
|
|
249
252
|
}
|
|
250
253
|
|
|
251
|
-
function
|
|
252
|
-
wasm.
|
|
254
|
+
function __wbg_adapter_168(arg0, arg1, arg2, arg3) {
|
|
255
|
+
wasm.closure2615_externref_shim(arg0, arg1, arg2, arg3);
|
|
253
256
|
}
|
|
254
257
|
|
|
255
258
|
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
256
259
|
|
|
257
260
|
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
258
261
|
|
|
262
|
+
const WasmBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
263
|
+
? { register: () => {}, unregister: () => {} }
|
|
264
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmbuilder_free(ptr >>> 0, 1));
|
|
265
|
+
/**
|
|
266
|
+
* Wraps a `c2pa::Builder`.
|
|
267
|
+
*/
|
|
268
|
+
export class WasmBuilder {
|
|
269
|
+
|
|
270
|
+
static __wrap(ptr) {
|
|
271
|
+
ptr = ptr >>> 0;
|
|
272
|
+
const obj = Object.create(WasmBuilder.prototype);
|
|
273
|
+
obj.__wbg_ptr = ptr;
|
|
274
|
+
WasmBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
275
|
+
return obj;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
__destroy_into_raw() {
|
|
279
|
+
const ptr = this.__wbg_ptr;
|
|
280
|
+
this.__wbg_ptr = 0;
|
|
281
|
+
WasmBuilderFinalization.unregister(this);
|
|
282
|
+
return ptr;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
free() {
|
|
286
|
+
const ptr = this.__destroy_into_raw();
|
|
287
|
+
wasm.__wbg_wasmbuilder_free(ptr, 0);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Attempts to create a new `WasmBuilder` from a JSON ManifestDefinition string.
|
|
291
|
+
* @param {string} json
|
|
292
|
+
* @returns {WasmBuilder}
|
|
293
|
+
*/
|
|
294
|
+
static fromJson(json) {
|
|
295
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
296
|
+
const len0 = WASM_VECTOR_LEN;
|
|
297
|
+
const ret = wasm.wasmbuilder_fromJson(ptr0, len0);
|
|
298
|
+
if (ret[2]) {
|
|
299
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
300
|
+
}
|
|
301
|
+
return WasmBuilder.__wrap(ret[0]);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Sets the remote_url for a remote manifest.
|
|
305
|
+
*
|
|
306
|
+
* The URL must return the manifest data and is injected into the destination asset when signing.
|
|
307
|
+
* For remote-only manifests, set the `no_embed` flag to `true`.
|
|
308
|
+
* @param {string} format
|
|
309
|
+
*/
|
|
310
|
+
setRemoteUrl(format) {
|
|
311
|
+
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
312
|
+
const len0 = WASM_VECTOR_LEN;
|
|
313
|
+
wasm.wasmbuilder_setRemoteUrl(this.__wbg_ptr, ptr0, len0);
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Sets the state of the no_embed flag.
|
|
317
|
+
* @param {boolean} no_embed
|
|
318
|
+
*/
|
|
319
|
+
setNoEmbed(no_embed) {
|
|
320
|
+
wasm.wasmbuilder_setNoEmbed(this.__wbg_ptr, no_embed);
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Sets a thumbnail from a [`Blob`] to be included in the manifest. The thumbnail should represent the asset being signed.
|
|
324
|
+
* @param {string} format
|
|
325
|
+
* @param {Blob} blob
|
|
326
|
+
*/
|
|
327
|
+
setThumbnailFromBlob(format, blob) {
|
|
328
|
+
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
329
|
+
const len0 = WASM_VECTOR_LEN;
|
|
330
|
+
const ret = wasm.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr, ptr0, len0, blob);
|
|
331
|
+
if (ret[1]) {
|
|
332
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Add an ingredient to the manifest from a JSON ingredient definition and a [`Blob`].
|
|
337
|
+
*
|
|
338
|
+
* # Arguments
|
|
339
|
+
* * `ingredient_json` - A JSON string representing the ingredient. This ingredient is merged with the ingredient specified in the `stream` argument, and these values take precedence.
|
|
340
|
+
* * `format` - The format of the ingredient.
|
|
341
|
+
* * `blob` - A [`Blob`] representing an asset which should be included as an ingredient.
|
|
342
|
+
* @param {string} json
|
|
343
|
+
* @param {string} format
|
|
344
|
+
* @param {Blob} blob
|
|
345
|
+
*/
|
|
346
|
+
addIngredientFromBlob(json, format, blob) {
|
|
347
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
348
|
+
const len0 = WASM_VECTOR_LEN;
|
|
349
|
+
const ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
350
|
+
const len1 = WASM_VECTOR_LEN;
|
|
351
|
+
const ret = wasm.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr, ptr0, len0, ptr1, len1, blob);
|
|
352
|
+
if (ret[1]) {
|
|
353
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Add a [`Blob`] to the manifest as a resource. The ID must match an identifier in the manifest.
|
|
358
|
+
* @param {string} id
|
|
359
|
+
* @param {Blob} blob
|
|
360
|
+
*/
|
|
361
|
+
addResourceFromBlob(id, blob) {
|
|
362
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
363
|
+
const len0 = WASM_VECTOR_LEN;
|
|
364
|
+
const ret = wasm.wasmbuilder_addResourceFromBlob(this.__wbg_ptr, ptr0, len0, blob);
|
|
365
|
+
if (ret[1]) {
|
|
366
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Get the current manifest definition.
|
|
371
|
+
* @returns {string}
|
|
372
|
+
*/
|
|
373
|
+
getDefinition() {
|
|
374
|
+
const ret = wasm.wasmbuilder_getDefinition(this.__wbg_ptr);
|
|
375
|
+
if (ret[2]) {
|
|
376
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
377
|
+
}
|
|
378
|
+
return takeFromExternrefTable0(ret[0]);
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Sign an asset using the provided SignerDefinition, format, and source Blob.
|
|
382
|
+
* @param {SignerDefinition} signer_definition
|
|
383
|
+
* @param {string} format
|
|
384
|
+
* @param {Blob} source
|
|
385
|
+
* @returns {Promise<Uint8Array>}
|
|
386
|
+
*/
|
|
387
|
+
sign(signer_definition, format, source) {
|
|
388
|
+
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
389
|
+
const len0 = WASM_VECTOR_LEN;
|
|
390
|
+
const ret = wasm.wasmbuilder_sign(this.__wbg_ptr, signer_definition, ptr0, len0, source);
|
|
391
|
+
return ret;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
259
395
|
const WasmReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
260
396
|
? { register: () => {}, unregister: () => {} }
|
|
261
397
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmreader_free(ptr >>> 0, 1));
|
|
@@ -377,6 +513,45 @@ export class WasmReader {
|
|
|
377
513
|
}
|
|
378
514
|
}
|
|
379
515
|
|
|
516
|
+
const WasmSignerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
517
|
+
? { register: () => {}, unregister: () => {} }
|
|
518
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsigner_free(ptr >>> 0, 1));
|
|
519
|
+
|
|
520
|
+
export class WasmSigner {
|
|
521
|
+
|
|
522
|
+
static __wrap(ptr) {
|
|
523
|
+
ptr = ptr >>> 0;
|
|
524
|
+
const obj = Object.create(WasmSigner.prototype);
|
|
525
|
+
obj.__wbg_ptr = ptr;
|
|
526
|
+
WasmSignerFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
527
|
+
return obj;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
__destroy_into_raw() {
|
|
531
|
+
const ptr = this.__wbg_ptr;
|
|
532
|
+
this.__wbg_ptr = 0;
|
|
533
|
+
WasmSignerFinalization.unregister(this);
|
|
534
|
+
return ptr;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
free() {
|
|
538
|
+
const ptr = this.__destroy_into_raw();
|
|
539
|
+
wasm.__wbg_wasmsigner_free(ptr, 0);
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Attempt to create a new [`WasmSigner`] from a SignerDefinition.
|
|
543
|
+
* @param {SignerDefinition} def
|
|
544
|
+
* @returns {WasmSigner}
|
|
545
|
+
*/
|
|
546
|
+
static fromDefinition(def) {
|
|
547
|
+
const ret = wasm.wasmsigner_fromDefinition(def);
|
|
548
|
+
if (ret[2]) {
|
|
549
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
550
|
+
}
|
|
551
|
+
return WasmSigner.__wrap(ret[0]);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
|
|
380
555
|
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
381
556
|
|
|
382
557
|
async function __wbg_load(module, imports) {
|
|
@@ -415,48 +590,52 @@ async function __wbg_load(module, imports) {
|
|
|
415
590
|
function __wbg_get_imports() {
|
|
416
591
|
const imports = {};
|
|
417
592
|
imports.wbg = {};
|
|
418
|
-
imports.wbg.
|
|
593
|
+
imports.wbg.__wbg_Error_1f3748b298f99708 = function(arg0, arg1) {
|
|
419
594
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
420
595
|
return ret;
|
|
421
596
|
};
|
|
422
|
-
imports.wbg.
|
|
597
|
+
imports.wbg.__wbg_Number_577a493fc95ea223 = function(arg0) {
|
|
598
|
+
const ret = Number(arg0);
|
|
599
|
+
return ret;
|
|
600
|
+
};
|
|
601
|
+
imports.wbg.__wbg_abort_6665281623826052 = function(arg0) {
|
|
423
602
|
arg0.abort();
|
|
424
603
|
};
|
|
425
|
-
imports.wbg.
|
|
604
|
+
imports.wbg.__wbg_abort_c11a5d245a242912 = function(arg0, arg1) {
|
|
426
605
|
arg0.abort(arg1);
|
|
427
606
|
};
|
|
428
|
-
imports.wbg.
|
|
607
|
+
imports.wbg.__wbg_append_3e86b0cd6215edd8 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
429
608
|
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
430
609
|
}, arguments) };
|
|
431
|
-
imports.wbg.
|
|
610
|
+
imports.wbg.__wbg_arrayBuffer_55e4a430671abfd8 = function() { return handleError(function (arg0) {
|
|
432
611
|
const ret = arg0.arrayBuffer();
|
|
433
612
|
return ret;
|
|
434
613
|
}, arguments) };
|
|
435
|
-
imports.wbg.
|
|
436
|
-
const ret = arg0.buffer;
|
|
437
|
-
return ret;
|
|
438
|
-
};
|
|
439
|
-
imports.wbg.__wbg_buffer_e495ba54cee589cc = function(arg0) {
|
|
614
|
+
imports.wbg.__wbg_buffer_1f897e9f3ed6b41d = function(arg0) {
|
|
440
615
|
const ret = arg0.buffer;
|
|
441
616
|
return ret;
|
|
442
617
|
};
|
|
443
|
-
imports.wbg.
|
|
618
|
+
imports.wbg.__wbg_byteLength_7029fecd0c136e6d = function(arg0) {
|
|
444
619
|
const ret = arg0.byteLength;
|
|
445
620
|
return ret;
|
|
446
621
|
};
|
|
447
|
-
imports.wbg.
|
|
448
|
-
const ret = arg0.call(arg1
|
|
622
|
+
imports.wbg.__wbg_call_2f8d426a20a307fe = function() { return handleError(function (arg0, arg1) {
|
|
623
|
+
const ret = arg0.call(arg1);
|
|
449
624
|
return ret;
|
|
450
625
|
}, arguments) };
|
|
451
|
-
imports.wbg.
|
|
452
|
-
const ret = arg0.call(arg1);
|
|
626
|
+
imports.wbg.__wbg_call_f53f0647ceb9c567 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
627
|
+
const ret = arg0.call(arg1, arg2);
|
|
453
628
|
return ret;
|
|
454
629
|
}, arguments) };
|
|
455
630
|
imports.wbg.__wbg_clearTimeout_0b53d391c1b94dda = function(arg0) {
|
|
456
631
|
const ret = clearTimeout(arg0);
|
|
457
632
|
return ret;
|
|
458
633
|
};
|
|
459
|
-
imports.wbg.
|
|
634
|
+
imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
|
|
635
|
+
const ret = arg0.crypto;
|
|
636
|
+
return ret;
|
|
637
|
+
};
|
|
638
|
+
imports.wbg.__wbg_done_4a7743b6f942c9f3 = function(arg0) {
|
|
460
639
|
const ret = arg0.done;
|
|
461
640
|
return ret;
|
|
462
641
|
};
|
|
@@ -475,31 +654,47 @@ function __wbg_get_imports() {
|
|
|
475
654
|
const ret = fetch(arg0);
|
|
476
655
|
return ret;
|
|
477
656
|
};
|
|
478
|
-
imports.wbg.
|
|
657
|
+
imports.wbg.__wbg_fetch_9885d2e26ad251bb = function(arg0, arg1) {
|
|
479
658
|
const ret = arg0.fetch(arg1);
|
|
480
659
|
return ret;
|
|
481
660
|
};
|
|
482
|
-
imports.wbg.
|
|
661
|
+
imports.wbg.__wbg_from_237b1ad767238d8b = function(arg0) {
|
|
483
662
|
const ret = Array.from(arg0);
|
|
484
663
|
return ret;
|
|
485
664
|
};
|
|
486
|
-
imports.wbg.
|
|
665
|
+
imports.wbg.__wbg_getRandomValues_38a1ff1ea09f6cc7 = function() { return handleError(function (arg0, arg1) {
|
|
666
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
667
|
+
}, arguments) };
|
|
668
|
+
imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
|
|
669
|
+
arg0.getRandomValues(arg1);
|
|
670
|
+
}, arguments) };
|
|
671
|
+
imports.wbg.__wbg_getTime_5b1dd03bb6d4b784 = function(arg0) {
|
|
487
672
|
const ret = arg0.getTime();
|
|
488
673
|
return ret;
|
|
489
674
|
};
|
|
490
|
-
imports.wbg.
|
|
675
|
+
imports.wbg.__wbg_get_27b4bcbec57323ca = function() { return handleError(function (arg0, arg1) {
|
|
491
676
|
const ret = Reflect.get(arg0, arg1);
|
|
492
677
|
return ret;
|
|
493
678
|
}, arguments) };
|
|
494
|
-
imports.wbg.
|
|
679
|
+
imports.wbg.__wbg_has_85abdd8aeb8edebf = function() { return handleError(function (arg0, arg1) {
|
|
495
680
|
const ret = Reflect.has(arg0, arg1);
|
|
496
681
|
return ret;
|
|
497
682
|
}, arguments) };
|
|
498
|
-
imports.wbg.
|
|
683
|
+
imports.wbg.__wbg_headers_177bc880a5823968 = function(arg0) {
|
|
499
684
|
const ret = arg0.headers;
|
|
500
685
|
return ret;
|
|
501
686
|
};
|
|
502
|
-
imports.wbg.
|
|
687
|
+
imports.wbg.__wbg_instanceof_Promise_1147df2e75727145 = function(arg0) {
|
|
688
|
+
let result;
|
|
689
|
+
try {
|
|
690
|
+
result = arg0 instanceof Promise;
|
|
691
|
+
} catch (_) {
|
|
692
|
+
result = false;
|
|
693
|
+
}
|
|
694
|
+
const ret = result;
|
|
695
|
+
return ret;
|
|
696
|
+
};
|
|
697
|
+
imports.wbg.__wbg_instanceof_Response_0ab386c6818f788a = function(arg0) {
|
|
503
698
|
let result;
|
|
504
699
|
try {
|
|
505
700
|
result = arg0 instanceof Response;
|
|
@@ -509,39 +704,39 @@ function __wbg_get_imports() {
|
|
|
509
704
|
const ret = result;
|
|
510
705
|
return ret;
|
|
511
706
|
};
|
|
512
|
-
imports.wbg.
|
|
707
|
+
imports.wbg.__wbg_iterator_96378c3c9a17347c = function() {
|
|
513
708
|
const ret = Symbol.iterator;
|
|
514
709
|
return ret;
|
|
515
710
|
};
|
|
516
|
-
imports.wbg.
|
|
711
|
+
imports.wbg.__wbg_length_904c0910ed998bf3 = function(arg0) {
|
|
517
712
|
const ret = arg0.length;
|
|
518
713
|
return ret;
|
|
519
714
|
};
|
|
520
|
-
imports.wbg.
|
|
521
|
-
const ret =
|
|
715
|
+
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
716
|
+
const ret = arg0.msCrypto;
|
|
522
717
|
return ret;
|
|
523
718
|
};
|
|
524
|
-
imports.wbg.
|
|
525
|
-
const ret = new
|
|
719
|
+
imports.wbg.__wbg_new0_85cc856927102294 = function() {
|
|
720
|
+
const ret = new Date();
|
|
526
721
|
return ret;
|
|
527
722
|
};
|
|
528
|
-
imports.wbg.
|
|
529
|
-
const ret = new
|
|
723
|
+
imports.wbg.__wbg_new_12588505388d0897 = function() { return handleError(function () {
|
|
724
|
+
const ret = new Headers();
|
|
530
725
|
return ret;
|
|
531
726
|
}, arguments) };
|
|
532
|
-
imports.wbg.
|
|
533
|
-
const ret = new
|
|
727
|
+
imports.wbg.__wbg_new_1930cbb8d9ffc31b = function() {
|
|
728
|
+
const ret = new Object();
|
|
534
729
|
return ret;
|
|
535
730
|
};
|
|
536
|
-
imports.wbg.
|
|
537
|
-
const ret = new
|
|
538
|
-
return ret;
|
|
539
|
-
}, arguments) };
|
|
540
|
-
imports.wbg.__wbg_new_58353953ad2097cc = function() {
|
|
541
|
-
const ret = new Array();
|
|
731
|
+
imports.wbg.__wbg_new_56407f99198feff7 = function() {
|
|
732
|
+
const ret = new Map();
|
|
542
733
|
return ret;
|
|
543
734
|
};
|
|
544
|
-
imports.wbg.
|
|
735
|
+
imports.wbg.__wbg_new_6a8b180049d9484e = function() { return handleError(function () {
|
|
736
|
+
const ret = new AbortController();
|
|
737
|
+
return ret;
|
|
738
|
+
}, arguments) };
|
|
739
|
+
imports.wbg.__wbg_new_7e574c906ccc59b1 = function() { return handleError(function () {
|
|
545
740
|
const ret = new FileReaderSync();
|
|
546
741
|
return ret;
|
|
547
742
|
}, arguments) };
|
|
@@ -549,18 +744,22 @@ function __wbg_get_imports() {
|
|
|
549
744
|
const ret = new Error();
|
|
550
745
|
return ret;
|
|
551
746
|
};
|
|
552
|
-
imports.wbg.
|
|
553
|
-
const ret = new
|
|
747
|
+
imports.wbg.__wbg_new_9190433fb67ed635 = function(arg0) {
|
|
748
|
+
const ret = new Uint8Array(arg0);
|
|
749
|
+
return ret;
|
|
750
|
+
};
|
|
751
|
+
imports.wbg.__wbg_new_97ddeb994a38bb69 = function(arg0, arg1) {
|
|
752
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
554
753
|
return ret;
|
|
555
754
|
};
|
|
556
|
-
imports.wbg.
|
|
755
|
+
imports.wbg.__wbg_new_d5e3800b120e37e1 = function(arg0, arg1) {
|
|
557
756
|
try {
|
|
558
757
|
var state0 = {a: arg0, b: arg1};
|
|
559
758
|
var cb0 = (arg0, arg1) => {
|
|
560
759
|
const a = state0.a;
|
|
561
760
|
state0.a = 0;
|
|
562
761
|
try {
|
|
563
|
-
return
|
|
762
|
+
return __wbg_adapter_168(a, state0.b, arg0, arg1);
|
|
564
763
|
} finally {
|
|
565
764
|
state0.a = a;
|
|
566
765
|
}
|
|
@@ -571,54 +770,68 @@ function __wbg_get_imports() {
|
|
|
571
770
|
state0.a = state0.b = 0;
|
|
572
771
|
}
|
|
573
772
|
};
|
|
574
|
-
imports.wbg.
|
|
575
|
-
const ret = new
|
|
773
|
+
imports.wbg.__wbg_new_e969dc3f68d25093 = function() {
|
|
774
|
+
const ret = new Array();
|
|
576
775
|
return ret;
|
|
577
776
|
};
|
|
578
|
-
imports.wbg.
|
|
777
|
+
imports.wbg.__wbg_newfromslice_d0d56929c6d9c842 = function(arg0, arg1) {
|
|
579
778
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
580
779
|
return ret;
|
|
581
780
|
};
|
|
582
|
-
imports.wbg.
|
|
781
|
+
imports.wbg.__wbg_newnoargs_a81330f6e05d8aca = function(arg0, arg1) {
|
|
583
782
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
584
783
|
return ret;
|
|
585
784
|
};
|
|
586
|
-
imports.wbg.
|
|
587
|
-
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
588
|
-
return ret;
|
|
589
|
-
};
|
|
590
|
-
imports.wbg.__wbg_newwithlength_08f872dc1e3ada2e = function(arg0) {
|
|
785
|
+
imports.wbg.__wbg_newwithlength_ed0ee6c1edca86fc = function(arg0) {
|
|
591
786
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
592
787
|
return ret;
|
|
593
788
|
};
|
|
594
|
-
imports.wbg.
|
|
789
|
+
imports.wbg.__wbg_newwithstrandinit_e8e22e9851f3c2fe = function() { return handleError(function (arg0, arg1, arg2) {
|
|
595
790
|
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
596
791
|
return ret;
|
|
597
792
|
}, arguments) };
|
|
598
|
-
imports.wbg.
|
|
793
|
+
imports.wbg.__wbg_next_2e6b37020ac5fe58 = function() { return handleError(function (arg0) {
|
|
794
|
+
const ret = arg0.next();
|
|
795
|
+
return ret;
|
|
796
|
+
}, arguments) };
|
|
797
|
+
imports.wbg.__wbg_next_3de8f2669431a3ff = function(arg0) {
|
|
599
798
|
const ret = arg0.next;
|
|
600
799
|
return ret;
|
|
601
800
|
};
|
|
602
|
-
imports.wbg.
|
|
603
|
-
const ret = arg0.
|
|
801
|
+
imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
|
|
802
|
+
const ret = arg0.node;
|
|
604
803
|
return ret;
|
|
605
|
-
}
|
|
606
|
-
imports.wbg.
|
|
804
|
+
};
|
|
805
|
+
imports.wbg.__wbg_now_e3057dd824ca0191 = function() {
|
|
607
806
|
const ret = Date.now();
|
|
608
807
|
return ret;
|
|
609
808
|
};
|
|
610
|
-
imports.wbg.
|
|
611
|
-
|
|
809
|
+
imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
|
|
810
|
+
const ret = arg0.process;
|
|
811
|
+
return ret;
|
|
612
812
|
};
|
|
613
|
-
imports.wbg.
|
|
813
|
+
imports.wbg.__wbg_prototypesetcall_c5f74efd31aea86b = function(arg0, arg1, arg2) {
|
|
814
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
815
|
+
};
|
|
816
|
+
imports.wbg.__wbg_queueMicrotask_bcc6e26d899696db = function(arg0) {
|
|
614
817
|
const ret = arg0.queueMicrotask;
|
|
615
818
|
return ret;
|
|
616
819
|
};
|
|
617
|
-
imports.wbg.
|
|
820
|
+
imports.wbg.__wbg_queueMicrotask_f24a794d09c42640 = function(arg0) {
|
|
821
|
+
queueMicrotask(arg0);
|
|
822
|
+
};
|
|
823
|
+
imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
|
|
824
|
+
arg0.randomFillSync(arg1);
|
|
825
|
+
}, arguments) };
|
|
826
|
+
imports.wbg.__wbg_readAsArrayBuffer_b45cdda102d3c0b2 = function() { return handleError(function (arg0, arg1) {
|
|
618
827
|
const ret = arg0.readAsArrayBuffer(arg1);
|
|
619
828
|
return ret;
|
|
620
829
|
}, arguments) };
|
|
621
|
-
imports.wbg.
|
|
830
|
+
imports.wbg.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
|
|
831
|
+
const ret = module.require;
|
|
832
|
+
return ret;
|
|
833
|
+
}, arguments) };
|
|
834
|
+
imports.wbg.__wbg_resolve_5775c0ef9222f556 = function(arg0) {
|
|
622
835
|
const ret = Promise.resolve(arg0);
|
|
623
836
|
return ret;
|
|
624
837
|
};
|
|
@@ -626,46 +839,46 @@ function __wbg_get_imports() {
|
|
|
626
839
|
const ret = setTimeout(arg0, arg1);
|
|
627
840
|
return ret;
|
|
628
841
|
};
|
|
629
|
-
imports.wbg.
|
|
630
|
-
arg0
|
|
842
|
+
imports.wbg.__wbg_set_1d5fe1e3f51a48d8 = function(arg0, arg1, arg2) {
|
|
843
|
+
arg0.set(getArrayU8FromWasm0(arg1, arg2));
|
|
631
844
|
};
|
|
632
|
-
imports.wbg.
|
|
633
|
-
arg0[arg1 >>> 0] = arg2;
|
|
634
|
-
};
|
|
635
|
-
imports.wbg.__wbg_set_d6bdfd275fb8a4ce = function(arg0, arg1, arg2) {
|
|
845
|
+
imports.wbg.__wbg_set_31197016f65a6a19 = function(arg0, arg1, arg2) {
|
|
636
846
|
const ret = arg0.set(arg1, arg2);
|
|
637
847
|
return ret;
|
|
638
848
|
};
|
|
639
|
-
imports.wbg.
|
|
640
|
-
arg0
|
|
849
|
+
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
850
|
+
arg0[arg1] = arg2;
|
|
851
|
+
};
|
|
852
|
+
imports.wbg.__wbg_set_d636a0463acf1dbc = function(arg0, arg1, arg2) {
|
|
853
|
+
arg0[arg1 >>> 0] = arg2;
|
|
641
854
|
};
|
|
642
|
-
imports.wbg.
|
|
855
|
+
imports.wbg.__wbg_setbody_e324371c31597f2a = function(arg0, arg1) {
|
|
643
856
|
arg0.body = arg1;
|
|
644
857
|
};
|
|
645
|
-
imports.wbg.
|
|
858
|
+
imports.wbg.__wbg_setcredentials_55a9317ed2777533 = function(arg0, arg1) {
|
|
646
859
|
arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
647
860
|
};
|
|
648
|
-
imports.wbg.
|
|
861
|
+
imports.wbg.__wbg_setheaders_ac0b1e4890a949cd = function(arg0, arg1) {
|
|
649
862
|
arg0.headers = arg1;
|
|
650
863
|
};
|
|
651
|
-
imports.wbg.
|
|
864
|
+
imports.wbg.__wbg_setmethod_9ce6e95af1ae0eaf = function(arg0, arg1, arg2) {
|
|
652
865
|
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
653
866
|
};
|
|
654
|
-
imports.wbg.
|
|
867
|
+
imports.wbg.__wbg_setmode_b89d1784e7e7f118 = function(arg0, arg1) {
|
|
655
868
|
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
656
869
|
};
|
|
657
|
-
imports.wbg.
|
|
870
|
+
imports.wbg.__wbg_setsignal_e663c6d962763cd5 = function(arg0, arg1) {
|
|
658
871
|
arg0.signal = arg1;
|
|
659
872
|
};
|
|
660
|
-
imports.wbg.
|
|
873
|
+
imports.wbg.__wbg_signal_bdb003fe19e53a13 = function(arg0) {
|
|
661
874
|
const ret = arg0.signal;
|
|
662
875
|
return ret;
|
|
663
876
|
};
|
|
664
|
-
imports.wbg.
|
|
877
|
+
imports.wbg.__wbg_size_4181b899cbfa6483 = function(arg0) {
|
|
665
878
|
const ret = arg0.size;
|
|
666
879
|
return ret;
|
|
667
880
|
};
|
|
668
|
-
imports.wbg.
|
|
881
|
+
imports.wbg.__wbg_slice_dc41c7f2c4886814 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
669
882
|
const ret = arg0.slice(arg1, arg2);
|
|
670
883
|
return ret;
|
|
671
884
|
}, arguments) };
|
|
@@ -676,66 +889,66 @@ function __wbg_get_imports() {
|
|
|
676
889
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
677
890
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
678
891
|
};
|
|
679
|
-
imports.wbg.
|
|
892
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_1f13249cc3acc96d = function() {
|
|
680
893
|
const ret = typeof global === 'undefined' ? null : global;
|
|
681
894
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
682
895
|
};
|
|
683
|
-
imports.wbg.
|
|
896
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_df7ae94b1e0ed6a3 = function() {
|
|
684
897
|
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
685
898
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
686
899
|
};
|
|
687
|
-
imports.wbg.
|
|
900
|
+
imports.wbg.__wbg_static_accessor_SELF_6265471db3b3c228 = function() {
|
|
688
901
|
const ret = typeof self === 'undefined' ? null : self;
|
|
689
902
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
690
903
|
};
|
|
691
|
-
imports.wbg.
|
|
904
|
+
imports.wbg.__wbg_static_accessor_WINDOW_16fb482f8ec52863 = function() {
|
|
692
905
|
const ret = typeof window === 'undefined' ? null : window;
|
|
693
906
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
694
907
|
};
|
|
695
|
-
imports.wbg.
|
|
908
|
+
imports.wbg.__wbg_status_31874648c8651949 = function(arg0) {
|
|
696
909
|
const ret = arg0.status;
|
|
697
910
|
return ret;
|
|
698
911
|
};
|
|
699
|
-
imports.wbg.
|
|
912
|
+
imports.wbg.__wbg_stringify_1f41b6198e0932e0 = function() { return handleError(function (arg0) {
|
|
700
913
|
const ret = JSON.stringify(arg0);
|
|
701
914
|
return ret;
|
|
702
915
|
}, arguments) };
|
|
703
|
-
imports.wbg.
|
|
916
|
+
imports.wbg.__wbg_subarray_a219824899e59712 = function(arg0, arg1, arg2) {
|
|
917
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
918
|
+
return ret;
|
|
919
|
+
};
|
|
920
|
+
imports.wbg.__wbg_then_8d2fcccde5380a03 = function(arg0, arg1, arg2) {
|
|
704
921
|
const ret = arg0.then(arg1, arg2);
|
|
705
922
|
return ret;
|
|
706
923
|
};
|
|
707
|
-
imports.wbg.
|
|
924
|
+
imports.wbg.__wbg_then_9cc266be2bf537b6 = function(arg0, arg1) {
|
|
708
925
|
const ret = arg0.then(arg1);
|
|
709
926
|
return ret;
|
|
710
927
|
};
|
|
711
|
-
imports.wbg.
|
|
928
|
+
imports.wbg.__wbg_url_d5273b9e10503471 = function(arg0, arg1) {
|
|
712
929
|
const ret = arg1.url;
|
|
713
930
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
714
931
|
const len1 = WASM_VECTOR_LEN;
|
|
715
932
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
716
933
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
717
934
|
};
|
|
718
|
-
imports.wbg.
|
|
719
|
-
const ret = arg0.
|
|
935
|
+
imports.wbg.__wbg_valueOf_94f1c9efbe2ba399 = function(arg0) {
|
|
936
|
+
const ret = arg0.valueOf();
|
|
720
937
|
return ret;
|
|
721
938
|
};
|
|
722
|
-
imports.wbg.
|
|
723
|
-
const ret =
|
|
724
|
-
return ret;
|
|
725
|
-
};
|
|
726
|
-
imports.wbg.__wbindgen_as_number = function(arg0) {
|
|
727
|
-
const ret = +arg0;
|
|
939
|
+
imports.wbg.__wbg_value_09d0b4eaab48b91d = function(arg0) {
|
|
940
|
+
const ret = arg0.value;
|
|
728
941
|
return ret;
|
|
729
942
|
};
|
|
730
|
-
imports.wbg.
|
|
731
|
-
const ret = arg0;
|
|
943
|
+
imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
|
|
944
|
+
const ret = arg0.versions;
|
|
732
945
|
return ret;
|
|
733
946
|
};
|
|
734
|
-
imports.wbg.
|
|
735
|
-
const ret =
|
|
947
|
+
imports.wbg.__wbg_wasmreader_new = function(arg0) {
|
|
948
|
+
const ret = WasmReader.__wrap(arg0);
|
|
736
949
|
return ret;
|
|
737
950
|
};
|
|
738
|
-
imports.wbg.
|
|
951
|
+
imports.wbg.__wbg_wbindgencbdrop_a85ed476c6a370b9 = function(arg0) {
|
|
739
952
|
const obj = arg0.original;
|
|
740
953
|
if (obj.cnt-- == 1) {
|
|
741
954
|
obj.a = 0;
|
|
@@ -744,57 +957,31 @@ function __wbg_get_imports() {
|
|
|
744
957
|
const ret = false;
|
|
745
958
|
return ret;
|
|
746
959
|
};
|
|
747
|
-
imports.wbg.
|
|
748
|
-
const ret = makeMutClosure(arg0, arg1, 1447, __wbg_adapter_36);
|
|
749
|
-
return ret;
|
|
750
|
-
};
|
|
751
|
-
imports.wbg.__wbindgen_closure_wrapper10883 = function(arg0, arg1, arg2) {
|
|
752
|
-
const ret = makeMutClosure(arg0, arg1, 1450, __wbg_adapter_39);
|
|
753
|
-
return ret;
|
|
754
|
-
};
|
|
755
|
-
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
960
|
+
imports.wbg.__wbg_wbindgendebugstring_bb652b1bc2061b6d = function(arg0, arg1) {
|
|
756
961
|
const ret = debugString(arg1);
|
|
757
962
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
758
963
|
const len1 = WASM_VECTOR_LEN;
|
|
759
964
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
760
965
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
761
966
|
};
|
|
762
|
-
imports.wbg.
|
|
763
|
-
const table = wasm.__wbindgen_export_2;
|
|
764
|
-
const offset = table.grow(4);
|
|
765
|
-
table.set(0, undefined);
|
|
766
|
-
table.set(offset + 0, undefined);
|
|
767
|
-
table.set(offset + 1, null);
|
|
768
|
-
table.set(offset + 2, true);
|
|
769
|
-
table.set(offset + 3, false);
|
|
770
|
-
;
|
|
771
|
-
};
|
|
772
|
-
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
967
|
+
imports.wbg.__wbg_wbindgenisfunction_ea72b9d66a0e1705 = function(arg0) {
|
|
773
968
|
const ret = typeof(arg0) === 'function';
|
|
774
969
|
return ret;
|
|
775
970
|
};
|
|
776
|
-
imports.wbg.
|
|
971
|
+
imports.wbg.__wbg_wbindgenisobject_dfe064a121d87553 = function(arg0) {
|
|
777
972
|
const val = arg0;
|
|
778
973
|
const ret = typeof(val) === 'object' && val !== null;
|
|
779
974
|
return ret;
|
|
780
975
|
};
|
|
781
|
-
imports.wbg.
|
|
976
|
+
imports.wbg.__wbg_wbindgenisstring_4b74e4111ba029e6 = function(arg0) {
|
|
782
977
|
const ret = typeof(arg0) === 'string';
|
|
783
978
|
return ret;
|
|
784
979
|
};
|
|
785
|
-
imports.wbg.
|
|
980
|
+
imports.wbg.__wbg_wbindgenisundefined_71f08a6ade4354e7 = function(arg0) {
|
|
786
981
|
const ret = arg0 === undefined;
|
|
787
982
|
return ret;
|
|
788
983
|
};
|
|
789
|
-
imports.wbg.
|
|
790
|
-
const ret = wasm.memory;
|
|
791
|
-
return ret;
|
|
792
|
-
};
|
|
793
|
-
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
794
|
-
const ret = arg0;
|
|
795
|
-
return ret;
|
|
796
|
-
};
|
|
797
|
-
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
984
|
+
imports.wbg.__wbg_wbindgenstringget_43fe05afe34b0cb1 = function(arg0, arg1) {
|
|
798
985
|
const obj = arg1;
|
|
799
986
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
800
987
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -802,12 +989,65 @@ function __wbg_get_imports() {
|
|
|
802
989
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
803
990
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
804
991
|
};
|
|
805
|
-
imports.wbg.
|
|
992
|
+
imports.wbg.__wbg_wbindgenthrow_4c11a24fca429ccf = function(arg0, arg1) {
|
|
993
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
994
|
+
};
|
|
995
|
+
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
996
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
806
997
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
807
998
|
return ret;
|
|
808
999
|
};
|
|
809
|
-
imports.wbg.
|
|
810
|
-
|
|
1000
|
+
imports.wbg.__wbindgen_cast_2ddd8a25ff58642a = function(arg0, arg1) {
|
|
1001
|
+
// Cast intrinsic for `I128 -> Externref`.
|
|
1002
|
+
const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
|
|
1003
|
+
return ret;
|
|
1004
|
+
};
|
|
1005
|
+
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
1006
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
1007
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1008
|
+
return ret;
|
|
1009
|
+
};
|
|
1010
|
+
imports.wbg.__wbindgen_cast_77bc3e92745e9a35 = function(arg0, arg1) {
|
|
1011
|
+
var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
|
|
1012
|
+
wasm.__wbindgen_free(arg0, arg1 * 1, 1);
|
|
1013
|
+
// Cast intrinsic for `Vector(U8) -> Externref`.
|
|
1014
|
+
const ret = v0;
|
|
1015
|
+
return ret;
|
|
1016
|
+
};
|
|
1017
|
+
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
1018
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
1019
|
+
const ret = arg0;
|
|
1020
|
+
return ret;
|
|
1021
|
+
};
|
|
1022
|
+
imports.wbg.__wbindgen_cast_cb60167f8bf6c33f = function(arg0, arg1) {
|
|
1023
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1658, function: Function { arguments: [Externref], shim_idx: 1669, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1024
|
+
const ret = makeMutClosure(arg0, arg1, 1658, __wbg_adapter_6);
|
|
1025
|
+
return ret;
|
|
1026
|
+
};
|
|
1027
|
+
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|
|
1028
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
1029
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
1030
|
+
return ret;
|
|
1031
|
+
};
|
|
1032
|
+
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
1033
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
1034
|
+
const ret = arg0;
|
|
1035
|
+
return ret;
|
|
1036
|
+
};
|
|
1037
|
+
imports.wbg.__wbindgen_cast_e943630f8c22ccf7 = function(arg0, arg1) {
|
|
1038
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1651, function: Function { arguments: [], shim_idx: 1652, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1039
|
+
const ret = makeMutClosure(arg0, arg1, 1651, __wbg_adapter_11);
|
|
1040
|
+
return ret;
|
|
1041
|
+
};
|
|
1042
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
1043
|
+
const table = wasm.__wbindgen_export_2;
|
|
1044
|
+
const offset = table.grow(4);
|
|
1045
|
+
table.set(0, undefined);
|
|
1046
|
+
table.set(offset + 0, undefined);
|
|
1047
|
+
table.set(offset + 1, null);
|
|
1048
|
+
table.set(offset + 2, true);
|
|
1049
|
+
table.set(offset + 3, false);
|
|
1050
|
+
;
|
|
811
1051
|
};
|
|
812
1052
|
|
|
813
1053
|
return imports;
|
|
@@ -881,4 +1121,4 @@ async function __wbg_init(module_or_path) {
|
|
|
881
1121
|
|
|
882
1122
|
export { initSync };
|
|
883
1123
|
export default __wbg_init;
|
|
884
|
-
export const WASM_SRI = "sha512-
|
|
1124
|
+
export const WASM_SRI = "sha512-HdKAUgRgZE3U8ifKMx2wLpjRjuv/9EoZGIbO3E+N3F/O3JDS3qIz243yU+v5pJXfNyxvi4rzQ0dD509pA2KaUw==";
|
package/pkg/c2pa_bg.wasm
CHANGED
|
Binary file
|
package/pkg/c2pa_bg.wasm.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_wasmbuilder_free: (a: number, b: number) => void;
|
|
5
|
+
export const wasmbuilder_fromJson: (a: number, b: number) => [number, number, number];
|
|
6
|
+
export const wasmbuilder_setRemoteUrl: (a: number, b: number, c: number) => void;
|
|
7
|
+
export const wasmbuilder_setNoEmbed: (a: number, b: number) => void;
|
|
8
|
+
export const wasmbuilder_setThumbnailFromBlob: (a: number, b: number, c: number, d: any) => [number, number];
|
|
9
|
+
export const wasmbuilder_addIngredientFromBlob: (a: number, b: number, c: number, d: number, e: number, f: any) => [number, number];
|
|
10
|
+
export const wasmbuilder_addResourceFromBlob: (a: number, b: number, c: number, d: any) => [number, number];
|
|
11
|
+
export const wasmbuilder_getDefinition: (a: number) => [number, number, number];
|
|
12
|
+
export const wasmbuilder_sign: (a: number, b: any, c: number, d: number, e: any) => any;
|
|
13
|
+
export const loadSettings: (a: number, b: number) => [number, number];
|
|
14
|
+
export const __wbg_wasmsigner_free: (a: number, b: number) => void;
|
|
15
|
+
export const wasmsigner_fromDefinition: (a: any) => [number, number, number];
|
|
16
|
+
export const run: () => void;
|
|
4
17
|
export const __wbg_wasmreader_free: (a: number, b: number) => void;
|
|
5
18
|
export const wasmreader_fromBlob: (a: number, b: number, c: any) => any;
|
|
6
19
|
export const wasmreader_fromBlobFragment: (a: number, b: number, c: any, d: any) => any;
|
|
@@ -9,8 +22,6 @@ export const wasmreader_manifestStore: (a: number) => [number, number, number];
|
|
|
9
22
|
export const wasmreader_activeManifest: (a: number) => [number, number, number];
|
|
10
23
|
export const wasmreader_json: (a: number) => [number, number];
|
|
11
24
|
export const wasmreader_resourceToBuffer: (a: number, b: number, c: number) => [number, number, number];
|
|
12
|
-
export const loadSettings: (a: number, b: number) => [number, number];
|
|
13
|
-
export const run: () => void;
|
|
14
25
|
export const ring_core_0_17_14__bn_mul_mont: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
15
26
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
16
27
|
export const __externref_table_alloc: () => number;
|
|
@@ -20,7 +31,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
20
31
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
21
32
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
22
33
|
export const __externref_table_dealloc: (a: number) => void;
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
34
|
+
export const closure1669_externref_shim: (a: number, b: number, c: any) => void;
|
|
35
|
+
export const wasm_bindgen__convert__closures_____invoke__h09e04d5375df482d: (a: number, b: number) => void;
|
|
36
|
+
export const closure2615_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
26
37
|
export const __wbindgen_start: () => void;
|