@automerge/sedimentree 0.4.0-alpha.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 +14 -0
- package/dist/@automerge/sedimentree.wasm +0 -0
- package/dist/cjs/node.cjs +1 -0
- package/dist/cjs/slim.cjs +1668 -0
- package/dist/cjs/wasm-base64.cjs +1 -0
- package/dist/cjs/web.cjs +1619 -0
- package/dist/esm/bundler.js +1 -0
- package/dist/esm/node.js +1 -0
- package/dist/esm/slim.js +2 -0
- package/dist/esm/wasm-base64.js +1 -0
- package/dist/esm/web.js +5 -0
- package/dist/esm/workerd.js +5 -0
- package/dist/iife/index.js +1603 -0
- package/dist/index.d.ts +445 -0
- package/dist/wasm_bindgen/bundler/sedimentree_wasm.d.ts +445 -0
- package/dist/wasm_bindgen/bundler/sedimentree_wasm.js +9 -0
- package/dist/wasm_bindgen/bundler/sedimentree_wasm_bg.js +1617 -0
- package/dist/wasm_bindgen/bundler/sedimentree_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/bundler/sedimentree_wasm_bg.wasm.d.ts +90 -0
- package/dist/wasm_bindgen/bundler/snippets/sedimentree_wasm-02bbe03284226492/inline0.js +2 -0
- package/dist/wasm_bindgen/bundler/snippets/sedimentree_wasm-02bbe03284226492/inline1.js +2 -0
- package/dist/wasm_bindgen/bundler/snippets/sedimentree_wasm-02bbe03284226492/inline2.js +2 -0
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm.cjs +1635 -0
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm.d.ts +445 -0
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm_bg.wasm.d.ts +90 -0
- package/dist/wasm_bindgen/nodejs/snippets/sedimentree_wasm-02bbe03284226492/inline0.js +2 -0
- package/dist/wasm_bindgen/nodejs/snippets/sedimentree_wasm-02bbe03284226492/inline1.js +2 -0
- package/dist/wasm_bindgen/nodejs/snippets/sedimentree_wasm-02bbe03284226492/inline2.js +2 -0
- package/dist/wasm_bindgen/web/sedimentree_wasm.d.ts +560 -0
- package/dist/wasm_bindgen/web/sedimentree_wasm.js +1716 -0
- package/dist/wasm_bindgen/web/sedimentree_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/web/sedimentree_wasm_bg.wasm.d.ts +90 -0
- package/dist/wasm_bindgen/web/snippets/sedimentree_wasm-02bbe03284226492/inline0.js +2 -0
- package/dist/wasm_bindgen/web/snippets/sedimentree_wasm-02bbe03284226492/inline1.js +2 -0
- package/dist/wasm_bindgen/web/snippets/sedimentree_wasm-02bbe03284226492/inline2.js +2 -0
- package/package.json +78 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export interface SedimentreeStorage {
|
|
5
|
+
saveSedimentreeId(sedimentreeId: SedimentreeId): Promise<void>;
|
|
6
|
+
deleteSedimentreeId(sedimentreeId: SedimentreeId): Promise<void>;
|
|
7
|
+
loadAllSedimentreeIds(): Promise<SedimentreeId[]>;
|
|
8
|
+
|
|
9
|
+
// Compound storage for commits (signed data + blob stored together)
|
|
10
|
+
saveCommit(sedimentreeId: SedimentreeId, digest: Digest, signedCommit: SignedLooseCommit, blob: Uint8Array): Promise<void>;
|
|
11
|
+
loadCommit(sedimentreeId: SedimentreeId, digest: Digest): Promise<CommitWithBlob | null>;
|
|
12
|
+
listCommitDigests(sedimentreeId: SedimentreeId): Promise<Digest[]>;
|
|
13
|
+
loadAllCommits(sedimentreeId: SedimentreeId): Promise<CommitWithBlob[]>;
|
|
14
|
+
deleteCommit(sedimentreeId: SedimentreeId, digest: Digest): Promise<void>;
|
|
15
|
+
deleteAllCommits(sedimentreeId: SedimentreeId): Promise<void>;
|
|
16
|
+
|
|
17
|
+
// Compound storage for fragments (signed data + blob stored together)
|
|
18
|
+
saveFragment(sedimentreeId: SedimentreeId, digest: Digest, signedFragment: SignedFragment, blob: Uint8Array): Promise<void>;
|
|
19
|
+
loadFragment(sedimentreeId: SedimentreeId, digest: Digest): Promise<FragmentWithBlob | null>;
|
|
20
|
+
listFragmentDigests(sedimentreeId: SedimentreeId): Promise<Digest[]>;
|
|
21
|
+
loadAllFragments(sedimentreeId: SedimentreeId): Promise<FragmentWithBlob[]>;
|
|
22
|
+
deleteFragment(sedimentreeId: SedimentreeId, digest: Digest): Promise<void>;
|
|
23
|
+
deleteAllFragments(sedimentreeId: SedimentreeId): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A Wasm wrapper around the [`BlobMeta`] type.
|
|
30
|
+
*/
|
|
31
|
+
export class BlobMeta {
|
|
32
|
+
free(): void;
|
|
33
|
+
[Symbol.dispose](): void;
|
|
34
|
+
/**
|
|
35
|
+
* Get the digest of the blob.
|
|
36
|
+
*/
|
|
37
|
+
digest(): Digest;
|
|
38
|
+
/**
|
|
39
|
+
* Create a `BlobMeta` from a digest and size.
|
|
40
|
+
*
|
|
41
|
+
* This is useful for deserialization when the original blob is not available.
|
|
42
|
+
* Since this is manual, the caller must ensure the digest and size are correct.
|
|
43
|
+
*/
|
|
44
|
+
static fromDigestSize(digest: Digest, size_bytes: bigint): BlobMeta;
|
|
45
|
+
/**
|
|
46
|
+
* Create a new `BlobMeta` from the given blob contents.
|
|
47
|
+
*/
|
|
48
|
+
constructor(blob: Uint8Array);
|
|
49
|
+
/**
|
|
50
|
+
* Get the size of the blob in bytes.
|
|
51
|
+
*/
|
|
52
|
+
readonly sizeBytes: bigint;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A commit stored with its associated blob.
|
|
57
|
+
*/
|
|
58
|
+
export class CommitWithBlob {
|
|
59
|
+
free(): void;
|
|
60
|
+
[Symbol.dispose](): void;
|
|
61
|
+
/**
|
|
62
|
+
* Upcasts; to the JS-import type for [`WasmCommitWithBlob`].
|
|
63
|
+
*/
|
|
64
|
+
__wasm_refgen_toWasmCommitWithBlob(): CommitWithBlob;
|
|
65
|
+
/**
|
|
66
|
+
* Create a new commit with blob.
|
|
67
|
+
*/
|
|
68
|
+
constructor(signed: SignedLooseCommit, blob: Uint8Array);
|
|
69
|
+
/**
|
|
70
|
+
* Get the blob.
|
|
71
|
+
*/
|
|
72
|
+
readonly blob: Uint8Array;
|
|
73
|
+
/**
|
|
74
|
+
* Get the signed commit.
|
|
75
|
+
*/
|
|
76
|
+
readonly signed: SignedLooseCommit;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* A JavaScript wrapper around `Depth`.
|
|
81
|
+
*/
|
|
82
|
+
export class Depth {
|
|
83
|
+
free(): void;
|
|
84
|
+
[Symbol.dispose](): void;
|
|
85
|
+
/**
|
|
86
|
+
* Internal method for a hack crossing the JS boundary.
|
|
87
|
+
*/
|
|
88
|
+
__subduction_castToDepth(): Depth;
|
|
89
|
+
/**
|
|
90
|
+
* Upcasts; to the JS-import type for [`WasmDepth`].
|
|
91
|
+
*/
|
|
92
|
+
__wasm_refgen_toWasmDepth(): Depth;
|
|
93
|
+
/**
|
|
94
|
+
* Creates a new `WasmDepth` from a JavaScript value.
|
|
95
|
+
*
|
|
96
|
+
* # Errors
|
|
97
|
+
*
|
|
98
|
+
* Returns a `NotU32Error` if the JS value is not safely coercible to `u32`.
|
|
99
|
+
*/
|
|
100
|
+
constructor(js_value: any);
|
|
101
|
+
/**
|
|
102
|
+
* The depth value as an integer.
|
|
103
|
+
*/
|
|
104
|
+
readonly value: number;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* A wrapper around digest bytes for use in JavaScript via wasm-bindgen.
|
|
109
|
+
*
|
|
110
|
+
* Since JavaScript doesn't have Rust's type system, this stores raw bytes
|
|
111
|
+
* and converts to/from typed `Digest<T>` at the Rust boundary.
|
|
112
|
+
*/
|
|
113
|
+
export class Digest {
|
|
114
|
+
free(): void;
|
|
115
|
+
[Symbol.dispose](): void;
|
|
116
|
+
/**
|
|
117
|
+
* Upcasts; to the JS-import type for [`WasmDigest`].
|
|
118
|
+
*/
|
|
119
|
+
__wasm_refgen_toWasmDigest(): Digest;
|
|
120
|
+
/**
|
|
121
|
+
* Creates a new digest from its Base58 string representation.
|
|
122
|
+
*
|
|
123
|
+
* # Errors
|
|
124
|
+
*
|
|
125
|
+
* Returns a `WasmInvalidDigest` error if the string cannot be decoded or is not a valid digest.
|
|
126
|
+
*/
|
|
127
|
+
static fromBase58(s: string): Digest;
|
|
128
|
+
/**
|
|
129
|
+
* Creates a new digest from its byte representation.
|
|
130
|
+
*
|
|
131
|
+
* # Errors
|
|
132
|
+
*
|
|
133
|
+
* Returns a `WasmValue` error if the byte slice is not a valid digest.
|
|
134
|
+
*/
|
|
135
|
+
static fromBytes(bytes: Uint8Array): Digest;
|
|
136
|
+
/**
|
|
137
|
+
* Creates a new digest from its hexadecimal string representation.
|
|
138
|
+
*
|
|
139
|
+
* # Errors
|
|
140
|
+
*
|
|
141
|
+
* Returns a [`WasmInvalidDigest`] if the string is not a valid digest.
|
|
142
|
+
*/
|
|
143
|
+
static fromHexString(s: string): Digest;
|
|
144
|
+
/**
|
|
145
|
+
* Creates a new digest from its byte representation.
|
|
146
|
+
*
|
|
147
|
+
* # Errors
|
|
148
|
+
*
|
|
149
|
+
* Returns a `WasmValue` error if the byte slice is not a valid digest.
|
|
150
|
+
*/
|
|
151
|
+
constructor(bytes: Uint8Array);
|
|
152
|
+
/**
|
|
153
|
+
* Returns the byte representation of the digest.
|
|
154
|
+
*/
|
|
155
|
+
toBytes(): Uint8Array;
|
|
156
|
+
/**
|
|
157
|
+
* Returns the hexadecimal string representation of the digest.
|
|
158
|
+
*/
|
|
159
|
+
toHexString(): string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* A data fragment used in the Sedimentree system.
|
|
164
|
+
*/
|
|
165
|
+
export class Fragment {
|
|
166
|
+
free(): void;
|
|
167
|
+
[Symbol.dispose](): void;
|
|
168
|
+
/**
|
|
169
|
+
* Upcasts; to the JS-import type for [`WasmFragment`].
|
|
170
|
+
*/
|
|
171
|
+
__wasm_refgen_toWasmFragment(): Fragment;
|
|
172
|
+
/**
|
|
173
|
+
* Create a new fragment from the given sedimentree ID, head, boundary, checkpoints, and blob metadata.
|
|
174
|
+
*/
|
|
175
|
+
constructor(sedimentree_id: SedimentreeId, head: Digest, boundary: Digest[], checkpoints: Digest[], blob_meta: BlobMeta);
|
|
176
|
+
/**
|
|
177
|
+
* Get the blob metadata of the fragment.
|
|
178
|
+
*/
|
|
179
|
+
readonly blobMeta: BlobMeta;
|
|
180
|
+
/**
|
|
181
|
+
* Get the boundary digests of the fragment.
|
|
182
|
+
*/
|
|
183
|
+
readonly boundary: Digest[];
|
|
184
|
+
/**
|
|
185
|
+
* Get the head digest of the fragment.
|
|
186
|
+
*/
|
|
187
|
+
readonly head: Digest;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* A fragment stored with its associated blob.
|
|
192
|
+
*/
|
|
193
|
+
export class FragmentWithBlob {
|
|
194
|
+
free(): void;
|
|
195
|
+
[Symbol.dispose](): void;
|
|
196
|
+
/**
|
|
197
|
+
* Upcasts; to the JS-import type for [`WasmFragmentWithBlob`].
|
|
198
|
+
*/
|
|
199
|
+
__wasm_refgen_toWasmFragmentWithBlob(): FragmentWithBlob;
|
|
200
|
+
/**
|
|
201
|
+
* Create a new fragment with blob.
|
|
202
|
+
*/
|
|
203
|
+
constructor(signed: SignedFragment, blob: Uint8Array);
|
|
204
|
+
/**
|
|
205
|
+
* Get the blob.
|
|
206
|
+
*/
|
|
207
|
+
readonly blob: Uint8Array;
|
|
208
|
+
/**
|
|
209
|
+
* Get the signed fragment.
|
|
210
|
+
*/
|
|
211
|
+
readonly signed: SignedFragment;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export class FragmentsArray {
|
|
215
|
+
private constructor();
|
|
216
|
+
free(): void;
|
|
217
|
+
[Symbol.dispose](): void;
|
|
218
|
+
/**
|
|
219
|
+
* Upcasts; to the JS-import type for [`WasmFragmentsArray`].
|
|
220
|
+
*/
|
|
221
|
+
__wasm_refgen_toWasmFragmentsArray(): FragmentsArray;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* A Wasm wrapper around the [`LooseCommit`] type.
|
|
226
|
+
*/
|
|
227
|
+
export class LooseCommit {
|
|
228
|
+
free(): void;
|
|
229
|
+
[Symbol.dispose](): void;
|
|
230
|
+
/**
|
|
231
|
+
* Upcasts; to the JS-import type for [`WasmLooseCommit`].
|
|
232
|
+
*/
|
|
233
|
+
__wasm_refgen_toWasmLooseCommit(): LooseCommit;
|
|
234
|
+
/**
|
|
235
|
+
* Create a new `LooseCommit` from the given sedimentree ID, parents, and blob metadata.
|
|
236
|
+
*/
|
|
237
|
+
constructor(sedimentree_id: SedimentreeId, parents: Digest[], blob_meta: BlobMeta);
|
|
238
|
+
/**
|
|
239
|
+
* Get the blob metadata of the commit.
|
|
240
|
+
*/
|
|
241
|
+
readonly blobMeta: BlobMeta;
|
|
242
|
+
/**
|
|
243
|
+
* Get the digest of the commit.
|
|
244
|
+
*/
|
|
245
|
+
readonly digest: Digest;
|
|
246
|
+
/**
|
|
247
|
+
* Get the parent digests of the commit.
|
|
248
|
+
*/
|
|
249
|
+
readonly parents: Digest[];
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* An in-memory storage implementation for use in tests and development.
|
|
254
|
+
*
|
|
255
|
+
* This wraps the core `MemoryStorage` and exposes it via the `SedimentreeStorage` interface.
|
|
256
|
+
*/
|
|
257
|
+
export class MemoryStorage {
|
|
258
|
+
free(): void;
|
|
259
|
+
[Symbol.dispose](): void;
|
|
260
|
+
/**
|
|
261
|
+
* Delete all commits for a sedimentree.
|
|
262
|
+
*/
|
|
263
|
+
deleteAllCommits(sedimentree_id: SedimentreeId): Promise<any>;
|
|
264
|
+
/**
|
|
265
|
+
* Delete all fragments for a sedimentree.
|
|
266
|
+
*/
|
|
267
|
+
deleteAllFragments(sedimentree_id: SedimentreeId): Promise<any>;
|
|
268
|
+
/**
|
|
269
|
+
* Delete a commit by digest.
|
|
270
|
+
*/
|
|
271
|
+
deleteCommit(sedimentree_id: SedimentreeId, digest: Digest): Promise<any>;
|
|
272
|
+
/**
|
|
273
|
+
* Delete a fragment by digest.
|
|
274
|
+
*/
|
|
275
|
+
deleteFragment(sedimentree_id: SedimentreeId, digest: Digest): Promise<any>;
|
|
276
|
+
/**
|
|
277
|
+
* Delete a sedimentree ID.
|
|
278
|
+
*/
|
|
279
|
+
deleteSedimentreeId(sedimentree_id: SedimentreeId): Promise<any>;
|
|
280
|
+
/**
|
|
281
|
+
* List all commit digests for a sedimentree.
|
|
282
|
+
*/
|
|
283
|
+
listCommitDigests(sedimentree_id: SedimentreeId): Promise<any>;
|
|
284
|
+
/**
|
|
285
|
+
* List all fragment digests for a sedimentree.
|
|
286
|
+
*/
|
|
287
|
+
listFragmentDigests(sedimentree_id: SedimentreeId): Promise<any>;
|
|
288
|
+
/**
|
|
289
|
+
* Load all commits for a sedimentree, returning `CommitWithBlob[]`.
|
|
290
|
+
*/
|
|
291
|
+
loadAllCommits(sedimentree_id: SedimentreeId): Promise<any>;
|
|
292
|
+
/**
|
|
293
|
+
* Load all fragments for a sedimentree, returning `FragmentWithBlob[]`.
|
|
294
|
+
*/
|
|
295
|
+
loadAllFragments(sedimentree_id: SedimentreeId): Promise<any>;
|
|
296
|
+
/**
|
|
297
|
+
* Load all sedimentree IDs.
|
|
298
|
+
*/
|
|
299
|
+
loadAllSedimentreeIds(): Promise<any>;
|
|
300
|
+
/**
|
|
301
|
+
* Load a commit by digest, returning `CommitWithBlob` or null.
|
|
302
|
+
*/
|
|
303
|
+
loadCommit(sedimentree_id: SedimentreeId, digest: Digest): Promise<any>;
|
|
304
|
+
/**
|
|
305
|
+
* Load a fragment by digest, returning `FragmentWithBlob` or null.
|
|
306
|
+
*/
|
|
307
|
+
loadFragment(sedimentree_id: SedimentreeId, digest: Digest): Promise<any>;
|
|
308
|
+
/**
|
|
309
|
+
* Create a new in-memory storage instance.
|
|
310
|
+
*/
|
|
311
|
+
constructor();
|
|
312
|
+
/**
|
|
313
|
+
* Save a commit with its blob.
|
|
314
|
+
*/
|
|
315
|
+
saveCommit(sedimentree_id: SedimentreeId, _digest: Digest, signed_commit: SignedLooseCommit, blob: Uint8Array): Promise<any>;
|
|
316
|
+
/**
|
|
317
|
+
* Save a fragment with its blob.
|
|
318
|
+
*/
|
|
319
|
+
saveFragment(sedimentree_id: SedimentreeId, _digest: Digest, signed_fragment: SignedFragment, blob: Uint8Array): Promise<any>;
|
|
320
|
+
/**
|
|
321
|
+
* Save a sedimentree ID.
|
|
322
|
+
*/
|
|
323
|
+
saveSedimentreeId(sedimentree_id: SedimentreeId): Promise<any>;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* The main Sedimentree data structure.
|
|
328
|
+
*/
|
|
329
|
+
export class Sedimentree {
|
|
330
|
+
free(): void;
|
|
331
|
+
[Symbol.dispose](): void;
|
|
332
|
+
/**
|
|
333
|
+
* Create an empty Sedimentree.
|
|
334
|
+
*/
|
|
335
|
+
static empty(): Sedimentree;
|
|
336
|
+
/**
|
|
337
|
+
* Create a new Sedimentree from fragments and loose commits.
|
|
338
|
+
*/
|
|
339
|
+
constructor(fragments: Fragment[], commits: LooseCommit[]);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* A Wasm wrapper around the [`SedimentreeId`] type.
|
|
344
|
+
*/
|
|
345
|
+
export class SedimentreeId {
|
|
346
|
+
private constructor();
|
|
347
|
+
free(): void;
|
|
348
|
+
[Symbol.dispose](): void;
|
|
349
|
+
/**
|
|
350
|
+
* Upcasts; to the JS-import type for [`WasmSedimentreeId`].
|
|
351
|
+
*/
|
|
352
|
+
__wasm_refgen_toWasmSedimentreeId(): SedimentreeId;
|
|
353
|
+
/**
|
|
354
|
+
* Create an ID from a byte array.
|
|
355
|
+
*
|
|
356
|
+
* # Errors
|
|
357
|
+
*
|
|
358
|
+
* Returns `Not32Bytes` if the provided byte array is not exactly 32 bytes long.
|
|
359
|
+
*/
|
|
360
|
+
static fromBytes(bytes: Uint8Array): SedimentreeId;
|
|
361
|
+
/**
|
|
362
|
+
* Returns the raw bytes of this ID.
|
|
363
|
+
*/
|
|
364
|
+
toBytes(): Uint8Array;
|
|
365
|
+
/**
|
|
366
|
+
* Returns the string representation of the ID.
|
|
367
|
+
*/
|
|
368
|
+
toString(): string;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export class SedimentreeIdsArray {
|
|
372
|
+
private constructor();
|
|
373
|
+
free(): void;
|
|
374
|
+
[Symbol.dispose](): void;
|
|
375
|
+
/**
|
|
376
|
+
* Upcasts; to the JS-import type for [`WasmSedimentreeIdsArray`].
|
|
377
|
+
*/
|
|
378
|
+
__wasm_refgen_toWasmSedimentreeIdsArray(): SedimentreeIdsArray;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* A Wasm wrapper around `Signed<Fragment>`.
|
|
383
|
+
*/
|
|
384
|
+
export class SignedFragment {
|
|
385
|
+
private constructor();
|
|
386
|
+
free(): void;
|
|
387
|
+
[Symbol.dispose](): void;
|
|
388
|
+
/**
|
|
389
|
+
* Upcasts; to the JS-import type for [`WasmSignedFragment`].
|
|
390
|
+
*/
|
|
391
|
+
__wasm_refgen_toWasmSignedFragment(): SignedFragment;
|
|
392
|
+
/**
|
|
393
|
+
* Encode this signed fragment to raw bytes.
|
|
394
|
+
*/
|
|
395
|
+
encode(): Uint8Array;
|
|
396
|
+
/**
|
|
397
|
+
* Decode a `SignedFragment` from raw bytes.
|
|
398
|
+
*
|
|
399
|
+
* # Errors
|
|
400
|
+
*
|
|
401
|
+
* Returns an error if the bytes are not a valid signed fragment.
|
|
402
|
+
*/
|
|
403
|
+
static tryDecode(bytes: Uint8Array): SignedFragment;
|
|
404
|
+
/**
|
|
405
|
+
* Get the unsigned payload without re-verifying the signature.
|
|
406
|
+
*
|
|
407
|
+
* # Errors
|
|
408
|
+
*
|
|
409
|
+
* Returns an error if the payload cannot be decoded.
|
|
410
|
+
*/
|
|
411
|
+
readonly payload: Fragment;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* A Wasm wrapper around `Signed<LooseCommit>`.
|
|
416
|
+
*/
|
|
417
|
+
export class SignedLooseCommit {
|
|
418
|
+
private constructor();
|
|
419
|
+
free(): void;
|
|
420
|
+
[Symbol.dispose](): void;
|
|
421
|
+
/**
|
|
422
|
+
* Upcasts; to the JS-import type for [`WasmSignedLooseCommit`].
|
|
423
|
+
*/
|
|
424
|
+
__wasm_refgen_toWasmSignedLooseCommit(): SignedLooseCommit;
|
|
425
|
+
/**
|
|
426
|
+
* Encode this signed loose commit to raw bytes.
|
|
427
|
+
*/
|
|
428
|
+
encode(): Uint8Array;
|
|
429
|
+
/**
|
|
430
|
+
* Decode a `SignedLooseCommit` from raw bytes.
|
|
431
|
+
*
|
|
432
|
+
* # Errors
|
|
433
|
+
*
|
|
434
|
+
* Returns an error if the bytes are not a valid signed loose commit.
|
|
435
|
+
*/
|
|
436
|
+
static tryDecode(bytes: Uint8Array): SignedLooseCommit;
|
|
437
|
+
/**
|
|
438
|
+
* Get the unsigned payload without re-verifying the signature.
|
|
439
|
+
*
|
|
440
|
+
* # Errors
|
|
441
|
+
*
|
|
442
|
+
* Returns an error if the payload cannot be decoded.
|
|
443
|
+
*/
|
|
444
|
+
readonly payload: LooseCommit;
|
|
445
|
+
}
|