@automerge/subduction 0.4.2-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 +40 -0
- package/dist/@automerge/subduction.wasm +0 -0
- package/dist/cjs/node.cjs +1 -0
- package/dist/cjs/slim.cjs +4297 -0
- package/dist/cjs/wasm-base64.cjs +1 -0
- package/dist/cjs/web.cjs +4248 -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 +4211 -0
- package/dist/index.d.ts +1344 -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/bundler/subduction_wasm.d.ts +1344 -0
- package/dist/wasm_bindgen/bundler/subduction_wasm.js +9 -0
- package/dist/wasm_bindgen/bundler/subduction_wasm_bg.js +4288 -0
- package/dist/wasm_bindgen/bundler/subduction_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/bundler/subduction_wasm_bg.wasm.d.ts +213 -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/nodejs/subduction_wasm.cjs +4326 -0
- package/dist/wasm_bindgen/nodejs/subduction_wasm.d.ts +1344 -0
- package/dist/wasm_bindgen/nodejs/subduction_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/nodejs/subduction_wasm_bg.wasm.d.ts +213 -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/dist/wasm_bindgen/web/subduction_wasm.d.ts +1582 -0
- package/dist/wasm_bindgen/web/subduction_wasm.js +4386 -0
- package/dist/wasm_bindgen/web/subduction_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/web/subduction_wasm_bg.wasm.d.ts +213 -0
- package/package.json +91 -0
|
@@ -0,0 +1,4297 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// subduction_wasm/dist/esm/slim.js
|
|
20
|
+
var slim_exports = {};
|
|
21
|
+
__export(slim_exports, {
|
|
22
|
+
AuthenticatedLongPoll: () => AuthenticatedLongPoll,
|
|
23
|
+
AuthenticatedWebSocket: () => AuthenticatedWebSocket,
|
|
24
|
+
BatchSyncRequest: () => BatchSyncRequest,
|
|
25
|
+
BatchSyncResponse: () => BatchSyncResponse,
|
|
26
|
+
BlobMeta: () => BlobMeta,
|
|
27
|
+
CallError: () => CallError,
|
|
28
|
+
CommitWithBlob: () => CommitWithBlob,
|
|
29
|
+
ConnErrorPair: () => ConnErrorPair,
|
|
30
|
+
ConnectionId: () => ConnectionId,
|
|
31
|
+
Depth: () => Depth,
|
|
32
|
+
Digest: () => Digest,
|
|
33
|
+
Fragment: () => Fragment,
|
|
34
|
+
FragmentRequested: () => FragmentRequested,
|
|
35
|
+
FragmentWithBlob: () => FragmentWithBlob,
|
|
36
|
+
FragmentsArray: () => FragmentsArray,
|
|
37
|
+
HashMetric: () => HashMetric,
|
|
38
|
+
LooseCommit: () => LooseCommit,
|
|
39
|
+
MemoryStorage: () => MemoryStorage,
|
|
40
|
+
Message: () => Message,
|
|
41
|
+
Nonce: () => Nonce,
|
|
42
|
+
PeerBatchSyncResult: () => PeerBatchSyncResult,
|
|
43
|
+
PeerId: () => PeerId,
|
|
44
|
+
PeerResultMap: () => PeerResultMap,
|
|
45
|
+
RequestId: () => RequestId,
|
|
46
|
+
Sedimentree: () => Sedimentree,
|
|
47
|
+
SedimentreeId: () => SedimentreeId,
|
|
48
|
+
SedimentreeIdsArray: () => SedimentreeIdsArray,
|
|
49
|
+
SignedFragment: () => SignedFragment,
|
|
50
|
+
SignedLooseCommit: () => SignedLooseCommit,
|
|
51
|
+
Subduction: () => Subduction,
|
|
52
|
+
SubductionLongPoll: () => SubductionLongPoll,
|
|
53
|
+
SubductionLongPollConnection: () => SubductionLongPollConnection,
|
|
54
|
+
SubductionWebSocket: () => SubductionWebSocket,
|
|
55
|
+
SyncStats: () => SyncStats,
|
|
56
|
+
WebCryptoSigner: () => WebCryptoSigner,
|
|
57
|
+
default: () => __wbg_init,
|
|
58
|
+
initSync: () => initSync
|
|
59
|
+
});
|
|
60
|
+
module.exports = __toCommonJS(slim_exports);
|
|
61
|
+
|
|
62
|
+
// subduction_wasm/dist/wasm_bindgen/web/snippets/sedimentree_wasm-02bbe03284226492/inline2.js
|
|
63
|
+
function tryIntoJsSedimentreeIdsArray(xs) {
|
|
64
|
+
return xs;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// subduction_wasm/dist/wasm_bindgen/web/subduction_wasm.js
|
|
68
|
+
var import_meta = {};
|
|
69
|
+
var AuthenticatedLongPoll = class _AuthenticatedLongPoll {
|
|
70
|
+
static __wrap(ptr) {
|
|
71
|
+
ptr = ptr >>> 0;
|
|
72
|
+
const obj = Object.create(_AuthenticatedLongPoll.prototype);
|
|
73
|
+
obj.__wbg_ptr = ptr;
|
|
74
|
+
AuthenticatedLongPollFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
75
|
+
return obj;
|
|
76
|
+
}
|
|
77
|
+
__destroy_into_raw() {
|
|
78
|
+
const ptr = this.__wbg_ptr;
|
|
79
|
+
this.__wbg_ptr = 0;
|
|
80
|
+
AuthenticatedLongPollFinalization.unregister(this);
|
|
81
|
+
return ptr;
|
|
82
|
+
}
|
|
83
|
+
free() {
|
|
84
|
+
const ptr = this.__destroy_into_raw();
|
|
85
|
+
wasm.__wbg_authenticatedlongpoll_free(ptr, 0);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The verified peer identity.
|
|
89
|
+
* @returns {PeerId}
|
|
90
|
+
*/
|
|
91
|
+
get peerId() {
|
|
92
|
+
const ret = wasm.authenticatedlongpoll_peerId(this.__wbg_ptr);
|
|
93
|
+
return PeerId.__wrap(ret);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The session ID assigned by the server.
|
|
97
|
+
* @returns {string}
|
|
98
|
+
*/
|
|
99
|
+
get sessionId() {
|
|
100
|
+
let deferred1_0;
|
|
101
|
+
let deferred1_1;
|
|
102
|
+
try {
|
|
103
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
104
|
+
wasm.authenticatedlongpoll_sessionId(retptr, this.__wbg_ptr);
|
|
105
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
106
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
107
|
+
deferred1_0 = r0;
|
|
108
|
+
deferred1_1 = r1;
|
|
109
|
+
return getStringFromWasm0(r0, r1);
|
|
110
|
+
} finally {
|
|
111
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
112
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
if (Symbol.dispose) AuthenticatedLongPoll.prototype[Symbol.dispose] = AuthenticatedLongPoll.prototype.free;
|
|
117
|
+
var AuthenticatedWebSocket = class _AuthenticatedWebSocket {
|
|
118
|
+
static __wrap(ptr) {
|
|
119
|
+
ptr = ptr >>> 0;
|
|
120
|
+
const obj = Object.create(_AuthenticatedWebSocket.prototype);
|
|
121
|
+
obj.__wbg_ptr = ptr;
|
|
122
|
+
AuthenticatedWebSocketFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
123
|
+
return obj;
|
|
124
|
+
}
|
|
125
|
+
__destroy_into_raw() {
|
|
126
|
+
const ptr = this.__wbg_ptr;
|
|
127
|
+
this.__wbg_ptr = 0;
|
|
128
|
+
AuthenticatedWebSocketFinalization.unregister(this);
|
|
129
|
+
return ptr;
|
|
130
|
+
}
|
|
131
|
+
free() {
|
|
132
|
+
const ptr = this.__destroy_into_raw();
|
|
133
|
+
wasm.__wbg_authenticatedwebsocket_free(ptr, 0);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The verified peer identity.
|
|
137
|
+
* @returns {PeerId}
|
|
138
|
+
*/
|
|
139
|
+
get peerId() {
|
|
140
|
+
const ret = wasm.authenticatedwebsocket_peerId(this.__wbg_ptr);
|
|
141
|
+
return PeerId.__wrap(ret);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
if (Symbol.dispose) AuthenticatedWebSocket.prototype[Symbol.dispose] = AuthenticatedWebSocket.prototype.free;
|
|
145
|
+
var BatchSyncRequest = class _BatchSyncRequest {
|
|
146
|
+
static __wrap(ptr) {
|
|
147
|
+
ptr = ptr >>> 0;
|
|
148
|
+
const obj = Object.create(_BatchSyncRequest.prototype);
|
|
149
|
+
obj.__wbg_ptr = ptr;
|
|
150
|
+
BatchSyncRequestFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
151
|
+
return obj;
|
|
152
|
+
}
|
|
153
|
+
__destroy_into_raw() {
|
|
154
|
+
const ptr = this.__wbg_ptr;
|
|
155
|
+
this.__wbg_ptr = 0;
|
|
156
|
+
BatchSyncRequestFinalization.unregister(this);
|
|
157
|
+
return ptr;
|
|
158
|
+
}
|
|
159
|
+
free() {
|
|
160
|
+
const ptr = this.__destroy_into_raw();
|
|
161
|
+
wasm.__wbg_batchsyncrequest_free(ptr, 0);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The sedimentree ID this request corresponds to.
|
|
165
|
+
* @returns {SedimentreeId}
|
|
166
|
+
*/
|
|
167
|
+
id() {
|
|
168
|
+
const ret = wasm.batchsyncrequest_id(this.__wbg_ptr);
|
|
169
|
+
return SedimentreeId.__wrap(ret);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The request ID for this request.
|
|
173
|
+
* @returns {RequestId}
|
|
174
|
+
*/
|
|
175
|
+
request_id() {
|
|
176
|
+
const ret = wasm.batchsyncrequest_request_id(this.__wbg_ptr);
|
|
177
|
+
return RequestId.__wrap(ret);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Whether this request subscribes to future updates.
|
|
181
|
+
* @returns {boolean}
|
|
182
|
+
*/
|
|
183
|
+
subscribe() {
|
|
184
|
+
const ret = wasm.batchsyncrequest_subscribe(this.__wbg_ptr);
|
|
185
|
+
return ret !== 0;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
if (Symbol.dispose) BatchSyncRequest.prototype[Symbol.dispose] = BatchSyncRequest.prototype.free;
|
|
189
|
+
var BatchSyncResponse = class _BatchSyncResponse {
|
|
190
|
+
static __wrap(ptr) {
|
|
191
|
+
ptr = ptr >>> 0;
|
|
192
|
+
const obj = Object.create(_BatchSyncResponse.prototype);
|
|
193
|
+
obj.__wbg_ptr = ptr;
|
|
194
|
+
BatchSyncResponseFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
195
|
+
return obj;
|
|
196
|
+
}
|
|
197
|
+
__destroy_into_raw() {
|
|
198
|
+
const ptr = this.__wbg_ptr;
|
|
199
|
+
this.__wbg_ptr = 0;
|
|
200
|
+
BatchSyncResponseFinalization.unregister(this);
|
|
201
|
+
return ptr;
|
|
202
|
+
}
|
|
203
|
+
free() {
|
|
204
|
+
const ptr = this.__destroy_into_raw();
|
|
205
|
+
wasm.__wbg_batchsyncresponse_free(ptr, 0);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Upcasts; to the JS-import type for [`WasmBatchSyncResponse`].
|
|
209
|
+
* @returns {BatchSyncResponse}
|
|
210
|
+
*/
|
|
211
|
+
__wasm_refgen_toWasmBatchSyncResponse() {
|
|
212
|
+
const ret = wasm.batchsyncresponse___wasm_refgen_toWasmBatchSyncResponse(this.__wbg_ptr);
|
|
213
|
+
return _BatchSyncResponse.__wrap(ret);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* The sedimentree ID this response corresponds to.
|
|
217
|
+
* @returns {SedimentreeId}
|
|
218
|
+
*/
|
|
219
|
+
id() {
|
|
220
|
+
const ret = wasm.batchsyncresponse_id(this.__wbg_ptr);
|
|
221
|
+
return SedimentreeId.__wrap(ret);
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* The request ID this response corresponds to.
|
|
225
|
+
* @returns {RequestId}
|
|
226
|
+
*/
|
|
227
|
+
request_id() {
|
|
228
|
+
const ret = wasm.batchsyncresponse_request_id(this.__wbg_ptr);
|
|
229
|
+
return RequestId.__wrap(ret);
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
if (Symbol.dispose) BatchSyncResponse.prototype[Symbol.dispose] = BatchSyncResponse.prototype.free;
|
|
233
|
+
var BlobMeta = class _BlobMeta {
|
|
234
|
+
static __wrap(ptr) {
|
|
235
|
+
ptr = ptr >>> 0;
|
|
236
|
+
const obj = Object.create(_BlobMeta.prototype);
|
|
237
|
+
obj.__wbg_ptr = ptr;
|
|
238
|
+
BlobMetaFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
239
|
+
return obj;
|
|
240
|
+
}
|
|
241
|
+
__destroy_into_raw() {
|
|
242
|
+
const ptr = this.__wbg_ptr;
|
|
243
|
+
this.__wbg_ptr = 0;
|
|
244
|
+
BlobMetaFinalization.unregister(this);
|
|
245
|
+
return ptr;
|
|
246
|
+
}
|
|
247
|
+
free() {
|
|
248
|
+
const ptr = this.__destroy_into_raw();
|
|
249
|
+
wasm.__wbg_blobmeta_free(ptr, 0);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Get the digest of the blob.
|
|
253
|
+
* @returns {Digest}
|
|
254
|
+
*/
|
|
255
|
+
digest() {
|
|
256
|
+
const ret = wasm.blobmeta_digest(this.__wbg_ptr);
|
|
257
|
+
return Digest.__wrap(ret);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Create a `BlobMeta` from a digest and size.
|
|
261
|
+
*
|
|
262
|
+
* This is useful for deserialization when the original blob is not available.
|
|
263
|
+
* Since this is manual, the caller must ensure the digest and size are correct.
|
|
264
|
+
* @param {Digest} digest
|
|
265
|
+
* @param {bigint} size_bytes
|
|
266
|
+
* @returns {BlobMeta}
|
|
267
|
+
*/
|
|
268
|
+
static fromDigestSize(digest, size_bytes) {
|
|
269
|
+
_assertClass(digest, Digest);
|
|
270
|
+
const ret = wasm.blobmeta_fromDigestSize(digest.__wbg_ptr, size_bytes);
|
|
271
|
+
return _BlobMeta.__wrap(ret);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Create a new `BlobMeta` from the given blob contents.
|
|
275
|
+
* @param {Uint8Array} blob
|
|
276
|
+
*/
|
|
277
|
+
constructor(blob) {
|
|
278
|
+
const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_export);
|
|
279
|
+
const len0 = WASM_VECTOR_LEN;
|
|
280
|
+
const ret = wasm.blobmeta_new(ptr0, len0);
|
|
281
|
+
this.__wbg_ptr = ret >>> 0;
|
|
282
|
+
BlobMetaFinalization.register(this, this.__wbg_ptr, this);
|
|
283
|
+
return this;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Get the size of the blob in bytes.
|
|
287
|
+
* @returns {bigint}
|
|
288
|
+
*/
|
|
289
|
+
get sizeBytes() {
|
|
290
|
+
const ret = wasm.blobmeta_sizeBytes(this.__wbg_ptr);
|
|
291
|
+
return BigInt.asUintN(64, ret);
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
if (Symbol.dispose) BlobMeta.prototype[Symbol.dispose] = BlobMeta.prototype.free;
|
|
295
|
+
var CallError = class {
|
|
296
|
+
__destroy_into_raw() {
|
|
297
|
+
const ptr = this.__wbg_ptr;
|
|
298
|
+
this.__wbg_ptr = 0;
|
|
299
|
+
CallErrorFinalization.unregister(this);
|
|
300
|
+
return ptr;
|
|
301
|
+
}
|
|
302
|
+
free() {
|
|
303
|
+
const ptr = this.__destroy_into_raw();
|
|
304
|
+
wasm.__wbg_callerror_free(ptr, 0);
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
if (Symbol.dispose) CallError.prototype[Symbol.dispose] = CallError.prototype.free;
|
|
308
|
+
var CommitWithBlob = class _CommitWithBlob {
|
|
309
|
+
static __wrap(ptr) {
|
|
310
|
+
ptr = ptr >>> 0;
|
|
311
|
+
const obj = Object.create(_CommitWithBlob.prototype);
|
|
312
|
+
obj.__wbg_ptr = ptr;
|
|
313
|
+
CommitWithBlobFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
314
|
+
return obj;
|
|
315
|
+
}
|
|
316
|
+
__destroy_into_raw() {
|
|
317
|
+
const ptr = this.__wbg_ptr;
|
|
318
|
+
this.__wbg_ptr = 0;
|
|
319
|
+
CommitWithBlobFinalization.unregister(this);
|
|
320
|
+
return ptr;
|
|
321
|
+
}
|
|
322
|
+
free() {
|
|
323
|
+
const ptr = this.__destroy_into_raw();
|
|
324
|
+
wasm.__wbg_commitwithblob_free(ptr, 0);
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Upcasts; to the JS-import type for [`WasmCommitWithBlob`].
|
|
328
|
+
* @returns {CommitWithBlob}
|
|
329
|
+
*/
|
|
330
|
+
__wasm_refgen_toWasmCommitWithBlob() {
|
|
331
|
+
const ret = wasm.commitwithblob___wasm_refgen_toWasmCommitWithBlob(this.__wbg_ptr);
|
|
332
|
+
return _CommitWithBlob.__wrap(ret);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Get the blob.
|
|
336
|
+
* @returns {Uint8Array}
|
|
337
|
+
*/
|
|
338
|
+
get blob() {
|
|
339
|
+
const ret = wasm.commitwithblob_blob(this.__wbg_ptr);
|
|
340
|
+
return takeObject(ret);
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Create a new commit with blob.
|
|
344
|
+
* @param {SignedLooseCommit} signed
|
|
345
|
+
* @param {Uint8Array} blob
|
|
346
|
+
*/
|
|
347
|
+
constructor(signed, blob) {
|
|
348
|
+
_assertClass(signed, SignedLooseCommit);
|
|
349
|
+
var ptr0 = signed.__destroy_into_raw();
|
|
350
|
+
const ret = wasm.commitwithblob_new(ptr0, addHeapObject(blob));
|
|
351
|
+
this.__wbg_ptr = ret >>> 0;
|
|
352
|
+
CommitWithBlobFinalization.register(this, this.__wbg_ptr, this);
|
|
353
|
+
return this;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Get the signed commit.
|
|
357
|
+
* @returns {SignedLooseCommit}
|
|
358
|
+
*/
|
|
359
|
+
get signed() {
|
|
360
|
+
const ret = wasm.commitwithblob_signed(this.__wbg_ptr);
|
|
361
|
+
return SignedLooseCommit.__wrap(ret);
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
if (Symbol.dispose) CommitWithBlob.prototype[Symbol.dispose] = CommitWithBlob.prototype.free;
|
|
365
|
+
var ConnErrorPair = class _ConnErrorPair {
|
|
366
|
+
static __wrap(ptr) {
|
|
367
|
+
ptr = ptr >>> 0;
|
|
368
|
+
const obj = Object.create(_ConnErrorPair.prototype);
|
|
369
|
+
obj.__wbg_ptr = ptr;
|
|
370
|
+
ConnErrorPairFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
371
|
+
return obj;
|
|
372
|
+
}
|
|
373
|
+
__destroy_into_raw() {
|
|
374
|
+
const ptr = this.__wbg_ptr;
|
|
375
|
+
this.__wbg_ptr = 0;
|
|
376
|
+
ConnErrorPairFinalization.unregister(this);
|
|
377
|
+
return ptr;
|
|
378
|
+
}
|
|
379
|
+
free() {
|
|
380
|
+
const ptr = this.__destroy_into_raw();
|
|
381
|
+
wasm.__wbg_connerrorpair_free(ptr, 0);
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* The connection that encountered the error.
|
|
385
|
+
* @returns {Connection}
|
|
386
|
+
*/
|
|
387
|
+
get conn() {
|
|
388
|
+
const ret = wasm.connerrorpair_conn(this.__wbg_ptr);
|
|
389
|
+
return takeObject(ret);
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* The error that occurred during the call.
|
|
393
|
+
* @returns {Error}
|
|
394
|
+
*/
|
|
395
|
+
get err() {
|
|
396
|
+
const ret = wasm.connerrorpair_err(this.__wbg_ptr);
|
|
397
|
+
return takeObject(ret);
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
if (Symbol.dispose) ConnErrorPair.prototype[Symbol.dispose] = ConnErrorPair.prototype.free;
|
|
401
|
+
var ConnectionId = class {
|
|
402
|
+
__destroy_into_raw() {
|
|
403
|
+
const ptr = this.__wbg_ptr;
|
|
404
|
+
this.__wbg_ptr = 0;
|
|
405
|
+
ConnectionIdFinalization.unregister(this);
|
|
406
|
+
return ptr;
|
|
407
|
+
}
|
|
408
|
+
free() {
|
|
409
|
+
const ptr = this.__destroy_into_raw();
|
|
410
|
+
wasm.__wbg_connectionid_free(ptr, 0);
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
if (Symbol.dispose) ConnectionId.prototype[Symbol.dispose] = ConnectionId.prototype.free;
|
|
414
|
+
var Depth = class _Depth {
|
|
415
|
+
static __wrap(ptr) {
|
|
416
|
+
ptr = ptr >>> 0;
|
|
417
|
+
const obj = Object.create(_Depth.prototype);
|
|
418
|
+
obj.__wbg_ptr = ptr;
|
|
419
|
+
DepthFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
420
|
+
return obj;
|
|
421
|
+
}
|
|
422
|
+
__destroy_into_raw() {
|
|
423
|
+
const ptr = this.__wbg_ptr;
|
|
424
|
+
this.__wbg_ptr = 0;
|
|
425
|
+
DepthFinalization.unregister(this);
|
|
426
|
+
return ptr;
|
|
427
|
+
}
|
|
428
|
+
free() {
|
|
429
|
+
const ptr = this.__destroy_into_raw();
|
|
430
|
+
wasm.__wbg_depth_free(ptr, 0);
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Internal method for a hack crossing the JS boundary.
|
|
434
|
+
* @returns {Depth}
|
|
435
|
+
*/
|
|
436
|
+
__subduction_castToDepth() {
|
|
437
|
+
const ret = wasm.depth___subduction_castToDepth(this.__wbg_ptr);
|
|
438
|
+
return _Depth.__wrap(ret);
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Upcasts; to the JS-import type for [`WasmDepth`].
|
|
442
|
+
* @returns {Depth}
|
|
443
|
+
*/
|
|
444
|
+
__wasm_refgen_toWasmDepth() {
|
|
445
|
+
const ret = wasm.depth___subduction_castToDepth(this.__wbg_ptr);
|
|
446
|
+
return _Depth.__wrap(ret);
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Creates a new `WasmDepth` from a JavaScript value.
|
|
450
|
+
*
|
|
451
|
+
* # Errors
|
|
452
|
+
*
|
|
453
|
+
* Returns a `NotU32Error` if the JS value is not safely coercible to `u32`.
|
|
454
|
+
* @param {any} js_value
|
|
455
|
+
*/
|
|
456
|
+
constructor(js_value) {
|
|
457
|
+
try {
|
|
458
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
459
|
+
wasm.depth_new(retptr, addBorrowedObject(js_value));
|
|
460
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
461
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
462
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
463
|
+
if (r2) {
|
|
464
|
+
throw takeObject(r1);
|
|
465
|
+
}
|
|
466
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
467
|
+
DepthFinalization.register(this, this.__wbg_ptr, this);
|
|
468
|
+
return this;
|
|
469
|
+
} finally {
|
|
470
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
471
|
+
heap[stack_pointer++] = void 0;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* The depth value as an integer.
|
|
476
|
+
* @returns {number}
|
|
477
|
+
*/
|
|
478
|
+
get value() {
|
|
479
|
+
const ret = wasm.depth_value(this.__wbg_ptr);
|
|
480
|
+
return ret >>> 0;
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
if (Symbol.dispose) Depth.prototype[Symbol.dispose] = Depth.prototype.free;
|
|
484
|
+
var Digest = class _Digest {
|
|
485
|
+
static __wrap(ptr) {
|
|
486
|
+
ptr = ptr >>> 0;
|
|
487
|
+
const obj = Object.create(_Digest.prototype);
|
|
488
|
+
obj.__wbg_ptr = ptr;
|
|
489
|
+
DigestFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
490
|
+
return obj;
|
|
491
|
+
}
|
|
492
|
+
static __unwrap(jsValue) {
|
|
493
|
+
if (!(jsValue instanceof _Digest)) {
|
|
494
|
+
return 0;
|
|
495
|
+
}
|
|
496
|
+
return jsValue.__destroy_into_raw();
|
|
497
|
+
}
|
|
498
|
+
__destroy_into_raw() {
|
|
499
|
+
const ptr = this.__wbg_ptr;
|
|
500
|
+
this.__wbg_ptr = 0;
|
|
501
|
+
DigestFinalization.unregister(this);
|
|
502
|
+
return ptr;
|
|
503
|
+
}
|
|
504
|
+
free() {
|
|
505
|
+
const ptr = this.__destroy_into_raw();
|
|
506
|
+
wasm.__wbg_digest_free(ptr, 0);
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Upcasts; to the JS-import type for [`WasmDigest`].
|
|
510
|
+
* @returns {Digest}
|
|
511
|
+
*/
|
|
512
|
+
__wasm_refgen_toWasmDigest() {
|
|
513
|
+
const ret = wasm.digest___wasm_refgen_toWasmDigest(this.__wbg_ptr);
|
|
514
|
+
return _Digest.__wrap(ret);
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Creates a new digest from its Base58 string representation.
|
|
518
|
+
*
|
|
519
|
+
* # Errors
|
|
520
|
+
*
|
|
521
|
+
* Returns a `WasmInvalidDigest` error if the string cannot be decoded or is not a valid digest.
|
|
522
|
+
* @param {string} s
|
|
523
|
+
* @returns {Digest}
|
|
524
|
+
*/
|
|
525
|
+
static fromBase58(s) {
|
|
526
|
+
try {
|
|
527
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
528
|
+
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
529
|
+
const len0 = WASM_VECTOR_LEN;
|
|
530
|
+
wasm.digest_fromBase58(retptr, ptr0, len0);
|
|
531
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
532
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
533
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
534
|
+
if (r2) {
|
|
535
|
+
throw takeObject(r1);
|
|
536
|
+
}
|
|
537
|
+
return _Digest.__wrap(r0);
|
|
538
|
+
} finally {
|
|
539
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* Creates a new digest from its byte representation.
|
|
544
|
+
*
|
|
545
|
+
* # Errors
|
|
546
|
+
*
|
|
547
|
+
* Returns a `WasmValue` error if the byte slice is not a valid digest.
|
|
548
|
+
* @param {Uint8Array} bytes
|
|
549
|
+
* @returns {Digest}
|
|
550
|
+
*/
|
|
551
|
+
static fromBytes(bytes) {
|
|
552
|
+
try {
|
|
553
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
554
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
555
|
+
const len0 = WASM_VECTOR_LEN;
|
|
556
|
+
wasm.digest_fromBytes(retptr, ptr0, len0);
|
|
557
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
558
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
559
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
560
|
+
if (r2) {
|
|
561
|
+
throw takeObject(r1);
|
|
562
|
+
}
|
|
563
|
+
return _Digest.__wrap(r0);
|
|
564
|
+
} finally {
|
|
565
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Creates a new digest from its hexadecimal string representation.
|
|
570
|
+
*
|
|
571
|
+
* # Errors
|
|
572
|
+
*
|
|
573
|
+
* Returns a [`WasmInvalidDigest`] if the string is not a valid digest.
|
|
574
|
+
* @param {string} s
|
|
575
|
+
* @returns {Digest}
|
|
576
|
+
*/
|
|
577
|
+
static fromHexString(s) {
|
|
578
|
+
try {
|
|
579
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
580
|
+
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
581
|
+
const len0 = WASM_VECTOR_LEN;
|
|
582
|
+
wasm.digest_fromHexString(retptr, ptr0, len0);
|
|
583
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
584
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
585
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
586
|
+
if (r2) {
|
|
587
|
+
throw takeObject(r1);
|
|
588
|
+
}
|
|
589
|
+
return _Digest.__wrap(r0);
|
|
590
|
+
} finally {
|
|
591
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Creates a new digest from its byte representation.
|
|
596
|
+
*
|
|
597
|
+
* # Errors
|
|
598
|
+
*
|
|
599
|
+
* Returns a `WasmValue` error if the byte slice is not a valid digest.
|
|
600
|
+
* @param {Uint8Array} bytes
|
|
601
|
+
*/
|
|
602
|
+
constructor(bytes) {
|
|
603
|
+
try {
|
|
604
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
605
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
606
|
+
const len0 = WASM_VECTOR_LEN;
|
|
607
|
+
wasm.digest_new(retptr, ptr0, len0);
|
|
608
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
609
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
610
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
611
|
+
if (r2) {
|
|
612
|
+
throw takeObject(r1);
|
|
613
|
+
}
|
|
614
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
615
|
+
DigestFinalization.register(this, this.__wbg_ptr, this);
|
|
616
|
+
return this;
|
|
617
|
+
} finally {
|
|
618
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Returns the byte representation of the digest.
|
|
623
|
+
* @returns {Uint8Array}
|
|
624
|
+
*/
|
|
625
|
+
toBytes() {
|
|
626
|
+
try {
|
|
627
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
628
|
+
wasm.digest_toBytes(retptr, this.__wbg_ptr);
|
|
629
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
630
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
631
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
632
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
633
|
+
return v1;
|
|
634
|
+
} finally {
|
|
635
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Returns the hexadecimal string representation of the digest.
|
|
640
|
+
* @returns {string}
|
|
641
|
+
*/
|
|
642
|
+
toHexString() {
|
|
643
|
+
let deferred1_0;
|
|
644
|
+
let deferred1_1;
|
|
645
|
+
try {
|
|
646
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
647
|
+
wasm.digest_toHexString(retptr, this.__wbg_ptr);
|
|
648
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
649
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
650
|
+
deferred1_0 = r0;
|
|
651
|
+
deferred1_1 = r1;
|
|
652
|
+
return getStringFromWasm0(r0, r1);
|
|
653
|
+
} finally {
|
|
654
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
655
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
if (Symbol.dispose) Digest.prototype[Symbol.dispose] = Digest.prototype.free;
|
|
660
|
+
var Fragment = class _Fragment {
|
|
661
|
+
static __wrap(ptr) {
|
|
662
|
+
ptr = ptr >>> 0;
|
|
663
|
+
const obj = Object.create(_Fragment.prototype);
|
|
664
|
+
obj.__wbg_ptr = ptr;
|
|
665
|
+
FragmentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
666
|
+
return obj;
|
|
667
|
+
}
|
|
668
|
+
__destroy_into_raw() {
|
|
669
|
+
const ptr = this.__wbg_ptr;
|
|
670
|
+
this.__wbg_ptr = 0;
|
|
671
|
+
FragmentFinalization.unregister(this);
|
|
672
|
+
return ptr;
|
|
673
|
+
}
|
|
674
|
+
free() {
|
|
675
|
+
const ptr = this.__destroy_into_raw();
|
|
676
|
+
wasm.__wbg_fragment_free(ptr, 0);
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Upcasts; to the JS-import type for [`WasmFragment`].
|
|
680
|
+
* @returns {Fragment}
|
|
681
|
+
*/
|
|
682
|
+
__wasm_refgen_toWasmFragment() {
|
|
683
|
+
const ret = wasm.fragment___wasm_refgen_toWasmFragment(this.__wbg_ptr);
|
|
684
|
+
return _Fragment.__wrap(ret);
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* Get the blob metadata of the fragment.
|
|
688
|
+
* @returns {BlobMeta}
|
|
689
|
+
*/
|
|
690
|
+
get blobMeta() {
|
|
691
|
+
const ret = wasm.fragment_blobMeta(this.__wbg_ptr);
|
|
692
|
+
return BlobMeta.__wrap(ret);
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Get the boundary digests of the fragment.
|
|
696
|
+
* @returns {Digest[]}
|
|
697
|
+
*/
|
|
698
|
+
get boundary() {
|
|
699
|
+
try {
|
|
700
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
701
|
+
wasm.fragment_boundary(retptr, this.__wbg_ptr);
|
|
702
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
703
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
704
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
705
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
706
|
+
return v1;
|
|
707
|
+
} finally {
|
|
708
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Get the head digest of the fragment.
|
|
713
|
+
* @returns {Digest}
|
|
714
|
+
*/
|
|
715
|
+
get head() {
|
|
716
|
+
const ret = wasm.fragment_head(this.__wbg_ptr);
|
|
717
|
+
return Digest.__wrap(ret);
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* Create a new fragment from the given sedimentree ID, head, boundary, checkpoints, and blob metadata.
|
|
721
|
+
* @param {SedimentreeId} sedimentree_id
|
|
722
|
+
* @param {Digest} head
|
|
723
|
+
* @param {Digest[]} boundary
|
|
724
|
+
* @param {Digest[]} checkpoints
|
|
725
|
+
* @param {BlobMeta} blob_meta
|
|
726
|
+
*/
|
|
727
|
+
constructor(sedimentree_id, head, boundary, checkpoints, blob_meta) {
|
|
728
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
729
|
+
var ptr0 = sedimentree_id.__destroy_into_raw();
|
|
730
|
+
_assertClass(head, Digest);
|
|
731
|
+
var ptr1 = head.__destroy_into_raw();
|
|
732
|
+
const ptr2 = passArrayJsValueToWasm0(boundary, wasm.__wbindgen_export);
|
|
733
|
+
const len2 = WASM_VECTOR_LEN;
|
|
734
|
+
const ptr3 = passArrayJsValueToWasm0(checkpoints, wasm.__wbindgen_export);
|
|
735
|
+
const len3 = WASM_VECTOR_LEN;
|
|
736
|
+
_assertClass(blob_meta, BlobMeta);
|
|
737
|
+
var ptr4 = blob_meta.__destroy_into_raw();
|
|
738
|
+
const ret = wasm.fragment_new(ptr0, ptr1, ptr2, len2, ptr3, len3, ptr4);
|
|
739
|
+
this.__wbg_ptr = ret >>> 0;
|
|
740
|
+
FragmentFinalization.register(this, this.__wbg_ptr, this);
|
|
741
|
+
return this;
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
if (Symbol.dispose) Fragment.prototype[Symbol.dispose] = Fragment.prototype.free;
|
|
745
|
+
var FragmentRequested = class _FragmentRequested {
|
|
746
|
+
static __wrap(ptr) {
|
|
747
|
+
ptr = ptr >>> 0;
|
|
748
|
+
const obj = Object.create(_FragmentRequested.prototype);
|
|
749
|
+
obj.__wbg_ptr = ptr;
|
|
750
|
+
FragmentRequestedFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
751
|
+
return obj;
|
|
752
|
+
}
|
|
753
|
+
__destroy_into_raw() {
|
|
754
|
+
const ptr = this.__wbg_ptr;
|
|
755
|
+
this.__wbg_ptr = 0;
|
|
756
|
+
FragmentRequestedFinalization.unregister(this);
|
|
757
|
+
return ptr;
|
|
758
|
+
}
|
|
759
|
+
free() {
|
|
760
|
+
const ptr = this.__destroy_into_raw();
|
|
761
|
+
wasm.__wbg_fragmentrequested_free(ptr, 0);
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Get the depth of the requested fragment.
|
|
765
|
+
* @returns {Depth}
|
|
766
|
+
*/
|
|
767
|
+
get depth() {
|
|
768
|
+
const ret = wasm.fragmentrequested_depth(this.__wbg_ptr);
|
|
769
|
+
return Depth.__wrap(ret);
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Get the digest of the requested fragment.
|
|
773
|
+
* @returns {Digest}
|
|
774
|
+
*/
|
|
775
|
+
get head() {
|
|
776
|
+
const ret = wasm.fragmentrequested_head(this.__wbg_ptr);
|
|
777
|
+
return Digest.__wrap(ret);
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* Create a new fragment request from the given digest.
|
|
781
|
+
* @param {Digest} digest
|
|
782
|
+
* @param {Depth} depth
|
|
783
|
+
*/
|
|
784
|
+
constructor(digest, depth) {
|
|
785
|
+
_assertClass(digest, Digest);
|
|
786
|
+
_assertClass(depth, Depth);
|
|
787
|
+
const ret = wasm.fragmentrequested_new(digest.__wbg_ptr, depth.__wbg_ptr);
|
|
788
|
+
this.__wbg_ptr = ret >>> 0;
|
|
789
|
+
FragmentRequestedFinalization.register(this, this.__wbg_ptr, this);
|
|
790
|
+
return this;
|
|
791
|
+
}
|
|
792
|
+
};
|
|
793
|
+
if (Symbol.dispose) FragmentRequested.prototype[Symbol.dispose] = FragmentRequested.prototype.free;
|
|
794
|
+
var FragmentWithBlob = class _FragmentWithBlob {
|
|
795
|
+
static __wrap(ptr) {
|
|
796
|
+
ptr = ptr >>> 0;
|
|
797
|
+
const obj = Object.create(_FragmentWithBlob.prototype);
|
|
798
|
+
obj.__wbg_ptr = ptr;
|
|
799
|
+
FragmentWithBlobFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
800
|
+
return obj;
|
|
801
|
+
}
|
|
802
|
+
__destroy_into_raw() {
|
|
803
|
+
const ptr = this.__wbg_ptr;
|
|
804
|
+
this.__wbg_ptr = 0;
|
|
805
|
+
FragmentWithBlobFinalization.unregister(this);
|
|
806
|
+
return ptr;
|
|
807
|
+
}
|
|
808
|
+
free() {
|
|
809
|
+
const ptr = this.__destroy_into_raw();
|
|
810
|
+
wasm.__wbg_fragmentwithblob_free(ptr, 0);
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Upcasts; to the JS-import type for [`WasmFragmentWithBlob`].
|
|
814
|
+
* @returns {FragmentWithBlob}
|
|
815
|
+
*/
|
|
816
|
+
__wasm_refgen_toWasmFragmentWithBlob() {
|
|
817
|
+
const ret = wasm.fragmentwithblob___wasm_refgen_toWasmFragmentWithBlob(this.__wbg_ptr);
|
|
818
|
+
return _FragmentWithBlob.__wrap(ret);
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* Get the blob.
|
|
822
|
+
* @returns {Uint8Array}
|
|
823
|
+
*/
|
|
824
|
+
get blob() {
|
|
825
|
+
const ret = wasm.commitwithblob_blob(this.__wbg_ptr);
|
|
826
|
+
return takeObject(ret);
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Create a new fragment with blob.
|
|
830
|
+
* @param {SignedFragment} signed
|
|
831
|
+
* @param {Uint8Array} blob
|
|
832
|
+
*/
|
|
833
|
+
constructor(signed, blob) {
|
|
834
|
+
_assertClass(signed, SignedFragment);
|
|
835
|
+
var ptr0 = signed.__destroy_into_raw();
|
|
836
|
+
const ret = wasm.commitwithblob_new(ptr0, addHeapObject(blob));
|
|
837
|
+
this.__wbg_ptr = ret >>> 0;
|
|
838
|
+
FragmentWithBlobFinalization.register(this, this.__wbg_ptr, this);
|
|
839
|
+
return this;
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* Get the signed fragment.
|
|
843
|
+
* @returns {SignedFragment}
|
|
844
|
+
*/
|
|
845
|
+
get signed() {
|
|
846
|
+
const ret = wasm.fragmentwithblob_signed(this.__wbg_ptr);
|
|
847
|
+
return SignedFragment.__wrap(ret);
|
|
848
|
+
}
|
|
849
|
+
};
|
|
850
|
+
if (Symbol.dispose) FragmentWithBlob.prototype[Symbol.dispose] = FragmentWithBlob.prototype.free;
|
|
851
|
+
var FragmentsArray = class _FragmentsArray {
|
|
852
|
+
static __wrap(ptr) {
|
|
853
|
+
ptr = ptr >>> 0;
|
|
854
|
+
const obj = Object.create(_FragmentsArray.prototype);
|
|
855
|
+
obj.__wbg_ptr = ptr;
|
|
856
|
+
FragmentsArrayFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
857
|
+
return obj;
|
|
858
|
+
}
|
|
859
|
+
__destroy_into_raw() {
|
|
860
|
+
const ptr = this.__wbg_ptr;
|
|
861
|
+
this.__wbg_ptr = 0;
|
|
862
|
+
FragmentsArrayFinalization.unregister(this);
|
|
863
|
+
return ptr;
|
|
864
|
+
}
|
|
865
|
+
free() {
|
|
866
|
+
const ptr = this.__destroy_into_raw();
|
|
867
|
+
wasm.__wbg_fragmentsarray_free(ptr, 0);
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Upcasts; to the JS-import type for [`WasmFragmentsArray`].
|
|
871
|
+
* @returns {FragmentsArray}
|
|
872
|
+
*/
|
|
873
|
+
__wasm_refgen_toWasmFragmentsArray() {
|
|
874
|
+
const ret = wasm.fragmentsarray___wasm_refgen_toWasmFragmentsArray(this.__wbg_ptr);
|
|
875
|
+
return _FragmentsArray.__wrap(ret);
|
|
876
|
+
}
|
|
877
|
+
};
|
|
878
|
+
if (Symbol.dispose) FragmentsArray.prototype[Symbol.dispose] = FragmentsArray.prototype.free;
|
|
879
|
+
var HashMetric = class {
|
|
880
|
+
__destroy_into_raw() {
|
|
881
|
+
const ptr = this.__wbg_ptr;
|
|
882
|
+
this.__wbg_ptr = 0;
|
|
883
|
+
HashMetricFinalization.unregister(this);
|
|
884
|
+
return ptr;
|
|
885
|
+
}
|
|
886
|
+
free() {
|
|
887
|
+
const ptr = this.__destroy_into_raw();
|
|
888
|
+
wasm.__wbg_hashmetric_free(ptr, 0);
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* Create a new `WasmHashMetric` with an optional JavaScript function.
|
|
892
|
+
*
|
|
893
|
+
* Defaults to counting leading zero bytes if no function is provided.
|
|
894
|
+
* @param {Function | null} [func]
|
|
895
|
+
*/
|
|
896
|
+
constructor(func) {
|
|
897
|
+
const ret = wasm.hashmetric_new(isLikeNone(func) ? 0 : addHeapObject(func));
|
|
898
|
+
this.__wbg_ptr = ret >>> 0;
|
|
899
|
+
HashMetricFinalization.register(this, this.__wbg_ptr, this);
|
|
900
|
+
return this;
|
|
901
|
+
}
|
|
902
|
+
};
|
|
903
|
+
if (Symbol.dispose) HashMetric.prototype[Symbol.dispose] = HashMetric.prototype.free;
|
|
904
|
+
var LooseCommit = class _LooseCommit {
|
|
905
|
+
static __wrap(ptr) {
|
|
906
|
+
ptr = ptr >>> 0;
|
|
907
|
+
const obj = Object.create(_LooseCommit.prototype);
|
|
908
|
+
obj.__wbg_ptr = ptr;
|
|
909
|
+
LooseCommitFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
910
|
+
return obj;
|
|
911
|
+
}
|
|
912
|
+
__destroy_into_raw() {
|
|
913
|
+
const ptr = this.__wbg_ptr;
|
|
914
|
+
this.__wbg_ptr = 0;
|
|
915
|
+
LooseCommitFinalization.unregister(this);
|
|
916
|
+
return ptr;
|
|
917
|
+
}
|
|
918
|
+
free() {
|
|
919
|
+
const ptr = this.__destroy_into_raw();
|
|
920
|
+
wasm.__wbg_loosecommit_free(ptr, 0);
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* Upcasts; to the JS-import type for [`WasmLooseCommit`].
|
|
924
|
+
* @returns {LooseCommit}
|
|
925
|
+
*/
|
|
926
|
+
__wasm_refgen_toWasmLooseCommit() {
|
|
927
|
+
const ret = wasm.loosecommit___wasm_refgen_toWasmLooseCommit(this.__wbg_ptr);
|
|
928
|
+
return _LooseCommit.__wrap(ret);
|
|
929
|
+
}
|
|
930
|
+
/**
|
|
931
|
+
* Get the blob metadata of the commit.
|
|
932
|
+
* @returns {BlobMeta}
|
|
933
|
+
*/
|
|
934
|
+
get blobMeta() {
|
|
935
|
+
const ret = wasm.loosecommit_blobMeta(this.__wbg_ptr);
|
|
936
|
+
return BlobMeta.__wrap(ret);
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Get the digest of the commit.
|
|
940
|
+
* @returns {Digest}
|
|
941
|
+
*/
|
|
942
|
+
get digest() {
|
|
943
|
+
const ret = wasm.loosecommit_digest(this.__wbg_ptr);
|
|
944
|
+
return Digest.__wrap(ret);
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Create a new `LooseCommit` from the given sedimentree ID, parents, and blob metadata.
|
|
948
|
+
* @param {SedimentreeId} sedimentree_id
|
|
949
|
+
* @param {Digest[]} parents
|
|
950
|
+
* @param {BlobMeta} blob_meta
|
|
951
|
+
*/
|
|
952
|
+
constructor(sedimentree_id, parents, blob_meta) {
|
|
953
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
954
|
+
var ptr0 = sedimentree_id.__destroy_into_raw();
|
|
955
|
+
const ptr1 = passArrayJsValueToWasm0(parents, wasm.__wbindgen_export);
|
|
956
|
+
const len1 = WASM_VECTOR_LEN;
|
|
957
|
+
_assertClass(blob_meta, BlobMeta);
|
|
958
|
+
const ret = wasm.loosecommit_new(ptr0, ptr1, len1, blob_meta.__wbg_ptr);
|
|
959
|
+
this.__wbg_ptr = ret >>> 0;
|
|
960
|
+
LooseCommitFinalization.register(this, this.__wbg_ptr, this);
|
|
961
|
+
return this;
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* Get the parent digests of the commit.
|
|
965
|
+
* @returns {Digest[]}
|
|
966
|
+
*/
|
|
967
|
+
get parents() {
|
|
968
|
+
try {
|
|
969
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
970
|
+
wasm.loosecommit_parents(retptr, this.__wbg_ptr);
|
|
971
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
972
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
973
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
974
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
975
|
+
return v1;
|
|
976
|
+
} finally {
|
|
977
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
};
|
|
981
|
+
if (Symbol.dispose) LooseCommit.prototype[Symbol.dispose] = LooseCommit.prototype.free;
|
|
982
|
+
var MemoryStorage = class {
|
|
983
|
+
__destroy_into_raw() {
|
|
984
|
+
const ptr = this.__wbg_ptr;
|
|
985
|
+
this.__wbg_ptr = 0;
|
|
986
|
+
MemoryStorageFinalization.unregister(this);
|
|
987
|
+
return ptr;
|
|
988
|
+
}
|
|
989
|
+
free() {
|
|
990
|
+
const ptr = this.__destroy_into_raw();
|
|
991
|
+
wasm.__wbg_memorystorage_free(ptr, 0);
|
|
992
|
+
}
|
|
993
|
+
/**
|
|
994
|
+
* Delete all commits for a sedimentree.
|
|
995
|
+
* @param {SedimentreeId} sedimentree_id
|
|
996
|
+
* @returns {Promise<any>}
|
|
997
|
+
*/
|
|
998
|
+
deleteAllCommits(sedimentree_id) {
|
|
999
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1000
|
+
const ret = wasm.memorystorage_deleteAllCommits(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
1001
|
+
return takeObject(ret);
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Delete all fragments for a sedimentree.
|
|
1005
|
+
* @param {SedimentreeId} sedimentree_id
|
|
1006
|
+
* @returns {Promise<any>}
|
|
1007
|
+
*/
|
|
1008
|
+
deleteAllFragments(sedimentree_id) {
|
|
1009
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1010
|
+
const ret = wasm.memorystorage_deleteAllFragments(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
1011
|
+
return takeObject(ret);
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* Delete a commit by digest.
|
|
1015
|
+
* @param {SedimentreeId} sedimentree_id
|
|
1016
|
+
* @param {Digest} digest
|
|
1017
|
+
* @returns {Promise<any>}
|
|
1018
|
+
*/
|
|
1019
|
+
deleteCommit(sedimentree_id, digest) {
|
|
1020
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1021
|
+
_assertClass(digest, Digest);
|
|
1022
|
+
const ret = wasm.memorystorage_deleteCommit(this.__wbg_ptr, sedimentree_id.__wbg_ptr, digest.__wbg_ptr);
|
|
1023
|
+
return takeObject(ret);
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Delete a fragment by digest.
|
|
1027
|
+
* @param {SedimentreeId} sedimentree_id
|
|
1028
|
+
* @param {Digest} digest
|
|
1029
|
+
* @returns {Promise<any>}
|
|
1030
|
+
*/
|
|
1031
|
+
deleteFragment(sedimentree_id, digest) {
|
|
1032
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1033
|
+
_assertClass(digest, Digest);
|
|
1034
|
+
const ret = wasm.memorystorage_deleteFragment(this.__wbg_ptr, sedimentree_id.__wbg_ptr, digest.__wbg_ptr);
|
|
1035
|
+
return takeObject(ret);
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* Delete a sedimentree ID.
|
|
1039
|
+
* @param {SedimentreeId} sedimentree_id
|
|
1040
|
+
* @returns {Promise<any>}
|
|
1041
|
+
*/
|
|
1042
|
+
deleteSedimentreeId(sedimentree_id) {
|
|
1043
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1044
|
+
const ret = wasm.memorystorage_deleteSedimentreeId(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
1045
|
+
return takeObject(ret);
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* List all commit digests for a sedimentree.
|
|
1049
|
+
* @param {SedimentreeId} sedimentree_id
|
|
1050
|
+
* @returns {Promise<any>}
|
|
1051
|
+
*/
|
|
1052
|
+
listCommitDigests(sedimentree_id) {
|
|
1053
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1054
|
+
const ret = wasm.memorystorage_listCommitDigests(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
1055
|
+
return takeObject(ret);
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* List all fragment digests for a sedimentree.
|
|
1059
|
+
* @param {SedimentreeId} sedimentree_id
|
|
1060
|
+
* @returns {Promise<any>}
|
|
1061
|
+
*/
|
|
1062
|
+
listFragmentDigests(sedimentree_id) {
|
|
1063
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1064
|
+
const ret = wasm.memorystorage_listFragmentDigests(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
1065
|
+
return takeObject(ret);
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Load all commits for a sedimentree, returning `CommitWithBlob[]`.
|
|
1069
|
+
* @param {SedimentreeId} sedimentree_id
|
|
1070
|
+
* @returns {Promise<any>}
|
|
1071
|
+
*/
|
|
1072
|
+
loadAllCommits(sedimentree_id) {
|
|
1073
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1074
|
+
const ret = wasm.memorystorage_loadAllCommits(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
1075
|
+
return takeObject(ret);
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Load all fragments for a sedimentree, returning `FragmentWithBlob[]`.
|
|
1079
|
+
* @param {SedimentreeId} sedimentree_id
|
|
1080
|
+
* @returns {Promise<any>}
|
|
1081
|
+
*/
|
|
1082
|
+
loadAllFragments(sedimentree_id) {
|
|
1083
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1084
|
+
const ret = wasm.memorystorage_loadAllFragments(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
1085
|
+
return takeObject(ret);
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* Load all sedimentree IDs.
|
|
1089
|
+
* @returns {Promise<any>}
|
|
1090
|
+
*/
|
|
1091
|
+
loadAllSedimentreeIds() {
|
|
1092
|
+
const ret = wasm.memorystorage_loadAllSedimentreeIds(this.__wbg_ptr);
|
|
1093
|
+
return takeObject(ret);
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Load a commit by digest, returning `CommitWithBlob` or null.
|
|
1097
|
+
* @param {SedimentreeId} sedimentree_id
|
|
1098
|
+
* @param {Digest} digest
|
|
1099
|
+
* @returns {Promise<any>}
|
|
1100
|
+
*/
|
|
1101
|
+
loadCommit(sedimentree_id, digest) {
|
|
1102
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1103
|
+
_assertClass(digest, Digest);
|
|
1104
|
+
const ret = wasm.memorystorage_loadCommit(this.__wbg_ptr, sedimentree_id.__wbg_ptr, digest.__wbg_ptr);
|
|
1105
|
+
return takeObject(ret);
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* Load a fragment by digest, returning `FragmentWithBlob` or null.
|
|
1109
|
+
* @param {SedimentreeId} sedimentree_id
|
|
1110
|
+
* @param {Digest} digest
|
|
1111
|
+
* @returns {Promise<any>}
|
|
1112
|
+
*/
|
|
1113
|
+
loadFragment(sedimentree_id, digest) {
|
|
1114
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1115
|
+
_assertClass(digest, Digest);
|
|
1116
|
+
const ret = wasm.memorystorage_loadFragment(this.__wbg_ptr, sedimentree_id.__wbg_ptr, digest.__wbg_ptr);
|
|
1117
|
+
return takeObject(ret);
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* Create a new in-memory storage instance.
|
|
1121
|
+
*/
|
|
1122
|
+
constructor() {
|
|
1123
|
+
const ret = wasm.memorystorage_new();
|
|
1124
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1125
|
+
MemoryStorageFinalization.register(this, this.__wbg_ptr, this);
|
|
1126
|
+
return this;
|
|
1127
|
+
}
|
|
1128
|
+
/**
|
|
1129
|
+
* Save a commit with its blob.
|
|
1130
|
+
* @param {SedimentreeId} sedimentree_id
|
|
1131
|
+
* @param {Digest} _digest
|
|
1132
|
+
* @param {SignedLooseCommit} signed_commit
|
|
1133
|
+
* @param {Uint8Array} blob
|
|
1134
|
+
* @returns {Promise<any>}
|
|
1135
|
+
*/
|
|
1136
|
+
saveCommit(sedimentree_id, _digest, signed_commit, blob) {
|
|
1137
|
+
try {
|
|
1138
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1139
|
+
_assertClass(_digest, Digest);
|
|
1140
|
+
_assertClass(signed_commit, SignedLooseCommit);
|
|
1141
|
+
const ret = wasm.memorystorage_saveCommit(this.__wbg_ptr, sedimentree_id.__wbg_ptr, _digest.__wbg_ptr, signed_commit.__wbg_ptr, addBorrowedObject(blob));
|
|
1142
|
+
return takeObject(ret);
|
|
1143
|
+
} finally {
|
|
1144
|
+
heap[stack_pointer++] = void 0;
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* Save a fragment with its blob.
|
|
1149
|
+
* @param {SedimentreeId} sedimentree_id
|
|
1150
|
+
* @param {Digest} _digest
|
|
1151
|
+
* @param {SignedFragment} signed_fragment
|
|
1152
|
+
* @param {Uint8Array} blob
|
|
1153
|
+
* @returns {Promise<any>}
|
|
1154
|
+
*/
|
|
1155
|
+
saveFragment(sedimentree_id, _digest, signed_fragment, blob) {
|
|
1156
|
+
try {
|
|
1157
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1158
|
+
_assertClass(_digest, Digest);
|
|
1159
|
+
_assertClass(signed_fragment, SignedFragment);
|
|
1160
|
+
const ret = wasm.memorystorage_saveFragment(this.__wbg_ptr, sedimentree_id.__wbg_ptr, _digest.__wbg_ptr, signed_fragment.__wbg_ptr, addBorrowedObject(blob));
|
|
1161
|
+
return takeObject(ret);
|
|
1162
|
+
} finally {
|
|
1163
|
+
heap[stack_pointer++] = void 0;
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Save a sedimentree ID.
|
|
1168
|
+
* @param {SedimentreeId} sedimentree_id
|
|
1169
|
+
* @returns {Promise<any>}
|
|
1170
|
+
*/
|
|
1171
|
+
saveSedimentreeId(sedimentree_id) {
|
|
1172
|
+
_assertClass(sedimentree_id, SedimentreeId);
|
|
1173
|
+
const ret = wasm.memorystorage_saveSedimentreeId(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
1174
|
+
return takeObject(ret);
|
|
1175
|
+
}
|
|
1176
|
+
};
|
|
1177
|
+
if (Symbol.dispose) MemoryStorage.prototype[Symbol.dispose] = MemoryStorage.prototype.free;
|
|
1178
|
+
var Message = class _Message {
|
|
1179
|
+
static __wrap(ptr) {
|
|
1180
|
+
ptr = ptr >>> 0;
|
|
1181
|
+
const obj = Object.create(_Message.prototype);
|
|
1182
|
+
obj.__wbg_ptr = ptr;
|
|
1183
|
+
MessageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1184
|
+
return obj;
|
|
1185
|
+
}
|
|
1186
|
+
__destroy_into_raw() {
|
|
1187
|
+
const ptr = this.__wbg_ptr;
|
|
1188
|
+
this.__wbg_ptr = 0;
|
|
1189
|
+
MessageFinalization.unregister(this);
|
|
1190
|
+
return ptr;
|
|
1191
|
+
}
|
|
1192
|
+
free() {
|
|
1193
|
+
const ptr = this.__destroy_into_raw();
|
|
1194
|
+
wasm.__wbg_message_free(ptr, 0);
|
|
1195
|
+
}
|
|
1196
|
+
/**
|
|
1197
|
+
* Upcasts; to the JS-import type for [`WasmMessage`].
|
|
1198
|
+
* @returns {Message}
|
|
1199
|
+
*/
|
|
1200
|
+
__wasm_refgen_toWasmMessage() {
|
|
1201
|
+
const ret = wasm.message___wasm_refgen_toWasmMessage(this.__wbg_ptr);
|
|
1202
|
+
return _Message.__wrap(ret);
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* Create a [`Message::BatchSyncRequest`] message.
|
|
1206
|
+
* @param {BatchSyncRequest} request
|
|
1207
|
+
* @returns {Message}
|
|
1208
|
+
*/
|
|
1209
|
+
static batchSyncRequest(request) {
|
|
1210
|
+
_assertClass(request, BatchSyncRequest);
|
|
1211
|
+
const ret = wasm.message_batchSyncRequest(request.__wbg_ptr);
|
|
1212
|
+
return _Message.__wrap(ret);
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* Create a [`Message::BatchSyncResponse`] message.
|
|
1216
|
+
* @param {BatchSyncResponse} response
|
|
1217
|
+
* @returns {Message}
|
|
1218
|
+
*/
|
|
1219
|
+
static batchSyncResponse(response) {
|
|
1220
|
+
_assertClass(response, BatchSyncResponse);
|
|
1221
|
+
const ret = wasm.message_batchSyncResponse(response.__wbg_ptr);
|
|
1222
|
+
return _Message.__wrap(ret);
|
|
1223
|
+
}
|
|
1224
|
+
/**
|
|
1225
|
+
* The [`Blob`] for commit or fragment messages, if applicable.
|
|
1226
|
+
* @returns {Uint8Array | undefined}
|
|
1227
|
+
*/
|
|
1228
|
+
get blob() {
|
|
1229
|
+
const ret = wasm.message_blob(this.__wbg_ptr);
|
|
1230
|
+
return takeObject(ret);
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* The [`Blob`]s for a [`Message::BlobsResponse`], if applicable.
|
|
1234
|
+
* @returns {Uint8Array[] | undefined}
|
|
1235
|
+
*/
|
|
1236
|
+
get blobs() {
|
|
1237
|
+
try {
|
|
1238
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1239
|
+
wasm.message_blobs(retptr, this.__wbg_ptr);
|
|
1240
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1241
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1242
|
+
let v1;
|
|
1243
|
+
if (r0 !== 0) {
|
|
1244
|
+
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1245
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1246
|
+
}
|
|
1247
|
+
return v1;
|
|
1248
|
+
} finally {
|
|
1249
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* Create a [`Message::BlobsRequest`] message.
|
|
1254
|
+
* @param {SedimentreeId} id
|
|
1255
|
+
* @param {Digest[]} digests
|
|
1256
|
+
* @returns {Message}
|
|
1257
|
+
*/
|
|
1258
|
+
static blobsRequest(id, digests) {
|
|
1259
|
+
_assertClass(id, SedimentreeId);
|
|
1260
|
+
const ptr0 = passArrayJsValueToWasm0(digests, wasm.__wbindgen_export);
|
|
1261
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1262
|
+
const ret = wasm.message_blobsRequest(id.__wbg_ptr, ptr0, len0);
|
|
1263
|
+
return _Message.__wrap(ret);
|
|
1264
|
+
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Create a [`Message::BlobsResponse`] message.
|
|
1267
|
+
* @param {SedimentreeId} id
|
|
1268
|
+
* @param {Uint8Array[]} blobs
|
|
1269
|
+
* @returns {Message}
|
|
1270
|
+
*/
|
|
1271
|
+
static blobsResponse(id, blobs) {
|
|
1272
|
+
_assertClass(id, SedimentreeId);
|
|
1273
|
+
const ptr0 = passArrayJsValueToWasm0(blobs, wasm.__wbindgen_export);
|
|
1274
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1275
|
+
const ret = wasm.message_blobsResponse(id.__wbg_ptr, ptr0, len0);
|
|
1276
|
+
return _Message.__wrap(ret);
|
|
1277
|
+
}
|
|
1278
|
+
/**
|
|
1279
|
+
* The [`LooseCommit`] for a [`Message::LooseCommit`], if applicable.
|
|
1280
|
+
*
|
|
1281
|
+
* Decodes the signed payload to extract the underlying commit.
|
|
1282
|
+
* @returns {LooseCommit | undefined}
|
|
1283
|
+
*/
|
|
1284
|
+
get commit() {
|
|
1285
|
+
const ret = wasm.message_commit(this.__wbg_ptr);
|
|
1286
|
+
return ret === 0 ? void 0 : LooseCommit.__wrap(ret);
|
|
1287
|
+
}
|
|
1288
|
+
/**
|
|
1289
|
+
* The requested [`Digest`]s for a [`Message::BlobsRequest`], if applicable.
|
|
1290
|
+
* @returns {Digest[] | undefined}
|
|
1291
|
+
*/
|
|
1292
|
+
get digests() {
|
|
1293
|
+
try {
|
|
1294
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1295
|
+
wasm.message_digests(retptr, this.__wbg_ptr);
|
|
1296
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1297
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1298
|
+
let v1;
|
|
1299
|
+
if (r0 !== 0) {
|
|
1300
|
+
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1301
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1302
|
+
}
|
|
1303
|
+
return v1;
|
|
1304
|
+
} finally {
|
|
1305
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* The [`Fragment`] for a [`Message::Fragment`], if applicable.
|
|
1310
|
+
*
|
|
1311
|
+
* Decodes the signed payload to extract the underlying fragment.
|
|
1312
|
+
* @returns {Fragment | undefined}
|
|
1313
|
+
*/
|
|
1314
|
+
get fragment() {
|
|
1315
|
+
const ret = wasm.message_fragment(this.__wbg_ptr);
|
|
1316
|
+
return ret === 0 ? void 0 : Fragment.__wrap(ret);
|
|
1317
|
+
}
|
|
1318
|
+
/**
|
|
1319
|
+
* Deserialize a message from bytes.
|
|
1320
|
+
*
|
|
1321
|
+
* # Errors
|
|
1322
|
+
*
|
|
1323
|
+
* Returns a [`JsMessageDeserializationError`] if deserialization fails.
|
|
1324
|
+
* @param {Uint8Array} bytes
|
|
1325
|
+
* @returns {Message}
|
|
1326
|
+
*/
|
|
1327
|
+
static fromBytes(bytes) {
|
|
1328
|
+
try {
|
|
1329
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1330
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
1331
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1332
|
+
wasm.message_fromBytes(retptr, ptr0, len0);
|
|
1333
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1334
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1335
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1336
|
+
if (r2) {
|
|
1337
|
+
throw takeObject(r1);
|
|
1338
|
+
}
|
|
1339
|
+
return _Message.__wrap(r0);
|
|
1340
|
+
} finally {
|
|
1341
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
/**
|
|
1345
|
+
* The [`BatchSyncRequest`] for a [`Message::BatchSyncRequest`], if applicable.
|
|
1346
|
+
* @returns {BatchSyncRequest | undefined}
|
|
1347
|
+
*/
|
|
1348
|
+
get request() {
|
|
1349
|
+
const ret = wasm.message_request(this.__wbg_ptr);
|
|
1350
|
+
return ret === 0 ? void 0 : BatchSyncRequest.__wrap(ret);
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* The [`BatchSyncResponse`] for a [`Message::BatchSyncResponse`], if applicable.
|
|
1354
|
+
* @returns {BatchSyncResponse | undefined}
|
|
1355
|
+
*/
|
|
1356
|
+
get response() {
|
|
1357
|
+
const ret = wasm.message_response(this.__wbg_ptr);
|
|
1358
|
+
return ret === 0 ? void 0 : BatchSyncResponse.__wrap(ret);
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* The [`SedimentreeId`] associated with this message, if any.
|
|
1362
|
+
* @returns {SedimentreeId | undefined}
|
|
1363
|
+
*/
|
|
1364
|
+
get sedimentreeId() {
|
|
1365
|
+
const ret = wasm.message_sedimentreeId(this.__wbg_ptr);
|
|
1366
|
+
return ret === 0 ? void 0 : SedimentreeId.__wrap(ret);
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Serialize the message to bytes.
|
|
1370
|
+
* @returns {Uint8Array}
|
|
1371
|
+
*/
|
|
1372
|
+
toBytes() {
|
|
1373
|
+
try {
|
|
1374
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1375
|
+
wasm.message_toBytes(retptr, this.__wbg_ptr);
|
|
1376
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1377
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1378
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1379
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1380
|
+
return v1;
|
|
1381
|
+
} finally {
|
|
1382
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
/**
|
|
1386
|
+
* The message variant name.
|
|
1387
|
+
* @returns {string}
|
|
1388
|
+
*/
|
|
1389
|
+
get type() {
|
|
1390
|
+
let deferred1_0;
|
|
1391
|
+
let deferred1_1;
|
|
1392
|
+
try {
|
|
1393
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1394
|
+
wasm.message_type(retptr, this.__wbg_ptr);
|
|
1395
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1396
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1397
|
+
deferred1_0 = r0;
|
|
1398
|
+
deferred1_1 = r1;
|
|
1399
|
+
return getStringFromWasm0(r0, r1);
|
|
1400
|
+
} finally {
|
|
1401
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1402
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
};
|
|
1406
|
+
if (Symbol.dispose) Message.prototype[Symbol.dispose] = Message.prototype.free;
|
|
1407
|
+
var Nonce = class _Nonce {
|
|
1408
|
+
static __wrap(ptr) {
|
|
1409
|
+
ptr = ptr >>> 0;
|
|
1410
|
+
const obj = Object.create(_Nonce.prototype);
|
|
1411
|
+
obj.__wbg_ptr = ptr;
|
|
1412
|
+
NonceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1413
|
+
return obj;
|
|
1414
|
+
}
|
|
1415
|
+
__destroy_into_raw() {
|
|
1416
|
+
const ptr = this.__wbg_ptr;
|
|
1417
|
+
this.__wbg_ptr = 0;
|
|
1418
|
+
NonceFinalization.unregister(this);
|
|
1419
|
+
return ptr;
|
|
1420
|
+
}
|
|
1421
|
+
free() {
|
|
1422
|
+
const ptr = this.__destroy_into_raw();
|
|
1423
|
+
wasm.__wbg_nonce_free(ptr, 0);
|
|
1424
|
+
}
|
|
1425
|
+
/**
|
|
1426
|
+
* Get the nonce as big-endian bytes.
|
|
1427
|
+
* @returns {Uint8Array}
|
|
1428
|
+
*/
|
|
1429
|
+
get bytes() {
|
|
1430
|
+
try {
|
|
1431
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1432
|
+
wasm.nonce_bytes(retptr, this.__wbg_ptr);
|
|
1433
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1434
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1435
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1436
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1437
|
+
return v1;
|
|
1438
|
+
} finally {
|
|
1439
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
/**
|
|
1443
|
+
* Create a new [`WasmNonce`] from exactly 8 big-endian bytes.
|
|
1444
|
+
*
|
|
1445
|
+
* # Errors
|
|
1446
|
+
*
|
|
1447
|
+
* Returns [`WasmNonceError`] if the input is not exactly 8 bytes.
|
|
1448
|
+
* @param {Uint8Array} bytes
|
|
1449
|
+
*/
|
|
1450
|
+
constructor(bytes) {
|
|
1451
|
+
try {
|
|
1452
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1453
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
1454
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1455
|
+
wasm.nonce_new(retptr, ptr0, len0);
|
|
1456
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1457
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1458
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1459
|
+
if (r2) {
|
|
1460
|
+
throw takeObject(r1);
|
|
1461
|
+
}
|
|
1462
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1463
|
+
NonceFinalization.register(this, this.__wbg_ptr, this);
|
|
1464
|
+
return this;
|
|
1465
|
+
} finally {
|
|
1466
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
/**
|
|
1470
|
+
* Generate a random nonce.
|
|
1471
|
+
*
|
|
1472
|
+
* # Panics
|
|
1473
|
+
*
|
|
1474
|
+
* Panics if the system random number generator fails.
|
|
1475
|
+
* @returns {Nonce}
|
|
1476
|
+
*/
|
|
1477
|
+
static random() {
|
|
1478
|
+
const ret = wasm.nonce_random();
|
|
1479
|
+
return _Nonce.__wrap(ret);
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1482
|
+
if (Symbol.dispose) Nonce.prototype[Symbol.dispose] = Nonce.prototype.free;
|
|
1483
|
+
var PeerBatchSyncResult = class _PeerBatchSyncResult {
|
|
1484
|
+
static __wrap(ptr) {
|
|
1485
|
+
ptr = ptr >>> 0;
|
|
1486
|
+
const obj = Object.create(_PeerBatchSyncResult.prototype);
|
|
1487
|
+
obj.__wbg_ptr = ptr;
|
|
1488
|
+
PeerBatchSyncResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1489
|
+
return obj;
|
|
1490
|
+
}
|
|
1491
|
+
__destroy_into_raw() {
|
|
1492
|
+
const ptr = this.__wbg_ptr;
|
|
1493
|
+
this.__wbg_ptr = 0;
|
|
1494
|
+
PeerBatchSyncResultFinalization.unregister(this);
|
|
1495
|
+
return ptr;
|
|
1496
|
+
}
|
|
1497
|
+
free() {
|
|
1498
|
+
const ptr = this.__destroy_into_raw();
|
|
1499
|
+
wasm.__wbg_peerbatchsyncresult_free(ptr, 0);
|
|
1500
|
+
}
|
|
1501
|
+
/**
|
|
1502
|
+
* List of connection errors that occurred during the batch sync.
|
|
1503
|
+
* @returns {ConnErrorPair[]}
|
|
1504
|
+
*/
|
|
1505
|
+
get connErrors() {
|
|
1506
|
+
try {
|
|
1507
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1508
|
+
wasm.peerbatchsyncresult_connErrors(retptr, this.__wbg_ptr);
|
|
1509
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1510
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1511
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1512
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1513
|
+
return v1;
|
|
1514
|
+
} finally {
|
|
1515
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
/**
|
|
1519
|
+
* Statistics about the sync operation.
|
|
1520
|
+
* @returns {SyncStats}
|
|
1521
|
+
*/
|
|
1522
|
+
get stats() {
|
|
1523
|
+
const ret = wasm.peerbatchsyncresult_stats(this.__wbg_ptr);
|
|
1524
|
+
return SyncStats.__wrap(ret);
|
|
1525
|
+
}
|
|
1526
|
+
/**
|
|
1527
|
+
* Whether the batch sync was successful with at least one connection.
|
|
1528
|
+
* @returns {boolean}
|
|
1529
|
+
*/
|
|
1530
|
+
get success() {
|
|
1531
|
+
const ret = wasm.peerbatchsyncresult_success(this.__wbg_ptr);
|
|
1532
|
+
return ret !== 0;
|
|
1533
|
+
}
|
|
1534
|
+
};
|
|
1535
|
+
if (Symbol.dispose) PeerBatchSyncResult.prototype[Symbol.dispose] = PeerBatchSyncResult.prototype.free;
|
|
1536
|
+
var PeerId = class _PeerId {
|
|
1537
|
+
static __wrap(ptr) {
|
|
1538
|
+
ptr = ptr >>> 0;
|
|
1539
|
+
const obj = Object.create(_PeerId.prototype);
|
|
1540
|
+
obj.__wbg_ptr = ptr;
|
|
1541
|
+
PeerIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1542
|
+
return obj;
|
|
1543
|
+
}
|
|
1544
|
+
__destroy_into_raw() {
|
|
1545
|
+
const ptr = this.__wbg_ptr;
|
|
1546
|
+
this.__wbg_ptr = 0;
|
|
1547
|
+
PeerIdFinalization.unregister(this);
|
|
1548
|
+
return ptr;
|
|
1549
|
+
}
|
|
1550
|
+
free() {
|
|
1551
|
+
const ptr = this.__destroy_into_raw();
|
|
1552
|
+
wasm.__wbg_peerid_free(ptr, 0);
|
|
1553
|
+
}
|
|
1554
|
+
/**
|
|
1555
|
+
* Creates a new `WasmPeerId` from a `PeerId`.
|
|
1556
|
+
*
|
|
1557
|
+
* # Errors
|
|
1558
|
+
*
|
|
1559
|
+
* Returns a `WasmInvalidPeerId` if the provided byte slice is not exactly 32 bytes long.
|
|
1560
|
+
* @param {Uint8Array} bytes
|
|
1561
|
+
*/
|
|
1562
|
+
constructor(bytes) {
|
|
1563
|
+
try {
|
|
1564
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1565
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
1566
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1567
|
+
wasm.peerid_new(retptr, ptr0, len0);
|
|
1568
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1569
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1570
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1571
|
+
if (r2) {
|
|
1572
|
+
throw takeObject(r1);
|
|
1573
|
+
}
|
|
1574
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1575
|
+
PeerIdFinalization.register(this, this.__wbg_ptr, this);
|
|
1576
|
+
return this;
|
|
1577
|
+
} finally {
|
|
1578
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* Returns the byte representation of the `PeerId`.
|
|
1583
|
+
* @returns {Uint8Array}
|
|
1584
|
+
*/
|
|
1585
|
+
toBytes() {
|
|
1586
|
+
try {
|
|
1587
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1588
|
+
wasm.peerid_toBytes(retptr, this.__wbg_ptr);
|
|
1589
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1590
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1591
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1592
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1593
|
+
return v1;
|
|
1594
|
+
} finally {
|
|
1595
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Returns the string representation of the `PeerId`.
|
|
1600
|
+
* @returns {string}
|
|
1601
|
+
*/
|
|
1602
|
+
toString() {
|
|
1603
|
+
let deferred1_0;
|
|
1604
|
+
let deferred1_1;
|
|
1605
|
+
try {
|
|
1606
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1607
|
+
wasm.peerid_toString(retptr, this.__wbg_ptr);
|
|
1608
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1609
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1610
|
+
deferred1_0 = r0;
|
|
1611
|
+
deferred1_1 = r1;
|
|
1612
|
+
return getStringFromWasm0(r0, r1);
|
|
1613
|
+
} finally {
|
|
1614
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1615
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
};
|
|
1619
|
+
if (Symbol.dispose) PeerId.prototype[Symbol.dispose] = PeerId.prototype.free;
|
|
1620
|
+
var PeerResultMap = class _PeerResultMap {
|
|
1621
|
+
static __wrap(ptr) {
|
|
1622
|
+
ptr = ptr >>> 0;
|
|
1623
|
+
const obj = Object.create(_PeerResultMap.prototype);
|
|
1624
|
+
obj.__wbg_ptr = ptr;
|
|
1625
|
+
PeerResultMapFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1626
|
+
return obj;
|
|
1627
|
+
}
|
|
1628
|
+
__destroy_into_raw() {
|
|
1629
|
+
const ptr = this.__wbg_ptr;
|
|
1630
|
+
this.__wbg_ptr = 0;
|
|
1631
|
+
PeerResultMapFinalization.unregister(this);
|
|
1632
|
+
return ptr;
|
|
1633
|
+
}
|
|
1634
|
+
free() {
|
|
1635
|
+
const ptr = this.__destroy_into_raw();
|
|
1636
|
+
wasm.__wbg_peerresultmap_free(ptr, 0);
|
|
1637
|
+
}
|
|
1638
|
+
/**
|
|
1639
|
+
* Get all entries in the peer result map.
|
|
1640
|
+
* @returns {PeerBatchSyncResult[]}
|
|
1641
|
+
*/
|
|
1642
|
+
entries() {
|
|
1643
|
+
try {
|
|
1644
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1645
|
+
wasm.peerresultmap_entries(retptr, this.__wbg_ptr);
|
|
1646
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1647
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1648
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1649
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1650
|
+
return v1;
|
|
1651
|
+
} finally {
|
|
1652
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Get the result for a specific peer ID.
|
|
1657
|
+
* @param {PeerId} peer_id
|
|
1658
|
+
* @returns {PeerBatchSyncResult | undefined}
|
|
1659
|
+
*/
|
|
1660
|
+
getResult(peer_id) {
|
|
1661
|
+
_assertClass(peer_id, PeerId);
|
|
1662
|
+
const ret = wasm.peerresultmap_getResult(this.__wbg_ptr, peer_id.__wbg_ptr);
|
|
1663
|
+
return ret === 0 ? void 0 : PeerBatchSyncResult.__wrap(ret);
|
|
1664
|
+
}
|
|
1665
|
+
};
|
|
1666
|
+
if (Symbol.dispose) PeerResultMap.prototype[Symbol.dispose] = PeerResultMap.prototype.free;
|
|
1667
|
+
var RequestId = class _RequestId {
|
|
1668
|
+
static __wrap(ptr) {
|
|
1669
|
+
ptr = ptr >>> 0;
|
|
1670
|
+
const obj = Object.create(_RequestId.prototype);
|
|
1671
|
+
obj.__wbg_ptr = ptr;
|
|
1672
|
+
RequestIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1673
|
+
return obj;
|
|
1674
|
+
}
|
|
1675
|
+
__destroy_into_raw() {
|
|
1676
|
+
const ptr = this.__wbg_ptr;
|
|
1677
|
+
this.__wbg_ptr = 0;
|
|
1678
|
+
RequestIdFinalization.unregister(this);
|
|
1679
|
+
return ptr;
|
|
1680
|
+
}
|
|
1681
|
+
free() {
|
|
1682
|
+
const ptr = this.__destroy_into_raw();
|
|
1683
|
+
wasm.__wbg_requestid_free(ptr, 0);
|
|
1684
|
+
}
|
|
1685
|
+
/**
|
|
1686
|
+
* Upcasts; to the JS-import type for [`WasmRequestId`].
|
|
1687
|
+
* @returns {RequestId}
|
|
1688
|
+
*/
|
|
1689
|
+
__wasm_refgen_toWasmRequestId() {
|
|
1690
|
+
const ret = wasm.requestid___wasm_refgen_toWasmRequestId(this.__wbg_ptr);
|
|
1691
|
+
return _RequestId.__wrap(ret);
|
|
1692
|
+
}
|
|
1693
|
+
/**
|
|
1694
|
+
* Create a new [`RequestId`] from a requestor peer ID and nonce.
|
|
1695
|
+
* @param {PeerId} requestor
|
|
1696
|
+
* @param {Nonce} nonce
|
|
1697
|
+
*/
|
|
1698
|
+
constructor(requestor, nonce) {
|
|
1699
|
+
_assertClass(requestor, PeerId);
|
|
1700
|
+
_assertClass(nonce, Nonce);
|
|
1701
|
+
const ret = wasm.requestid_new(requestor.__wbg_ptr, nonce.__wbg_ptr);
|
|
1702
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1703
|
+
RequestIdFinalization.register(this, this.__wbg_ptr, this);
|
|
1704
|
+
return this;
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* The request nonce.
|
|
1708
|
+
* @returns {Nonce}
|
|
1709
|
+
*/
|
|
1710
|
+
get nonce() {
|
|
1711
|
+
const ret = wasm.requestid_nonce(this.__wbg_ptr);
|
|
1712
|
+
return Nonce.__wrap(ret);
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* The peer ID of the requestor.
|
|
1716
|
+
* @returns {PeerId}
|
|
1717
|
+
*/
|
|
1718
|
+
get requestor() {
|
|
1719
|
+
const ret = wasm.requestid_requestor(this.__wbg_ptr);
|
|
1720
|
+
return PeerId.__wrap(ret);
|
|
1721
|
+
}
|
|
1722
|
+
};
|
|
1723
|
+
if (Symbol.dispose) RequestId.prototype[Symbol.dispose] = RequestId.prototype.free;
|
|
1724
|
+
var Sedimentree = class _Sedimentree {
|
|
1725
|
+
static __wrap(ptr) {
|
|
1726
|
+
ptr = ptr >>> 0;
|
|
1727
|
+
const obj = Object.create(_Sedimentree.prototype);
|
|
1728
|
+
obj.__wbg_ptr = ptr;
|
|
1729
|
+
SedimentreeFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1730
|
+
return obj;
|
|
1731
|
+
}
|
|
1732
|
+
__destroy_into_raw() {
|
|
1733
|
+
const ptr = this.__wbg_ptr;
|
|
1734
|
+
this.__wbg_ptr = 0;
|
|
1735
|
+
SedimentreeFinalization.unregister(this);
|
|
1736
|
+
return ptr;
|
|
1737
|
+
}
|
|
1738
|
+
free() {
|
|
1739
|
+
const ptr = this.__destroy_into_raw();
|
|
1740
|
+
wasm.__wbg_sedimentree_free(ptr, 0);
|
|
1741
|
+
}
|
|
1742
|
+
/**
|
|
1743
|
+
* Create an empty Sedimentree.
|
|
1744
|
+
* @returns {Sedimentree}
|
|
1745
|
+
*/
|
|
1746
|
+
static empty() {
|
|
1747
|
+
const ret = wasm.sedimentree_empty();
|
|
1748
|
+
return _Sedimentree.__wrap(ret);
|
|
1749
|
+
}
|
|
1750
|
+
/**
|
|
1751
|
+
* Create a new Sedimentree from fragments and loose commits.
|
|
1752
|
+
* @param {Fragment[]} fragments
|
|
1753
|
+
* @param {LooseCommit[]} commits
|
|
1754
|
+
*/
|
|
1755
|
+
constructor(fragments, commits) {
|
|
1756
|
+
const ptr0 = passArrayJsValueToWasm0(fragments, wasm.__wbindgen_export);
|
|
1757
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1758
|
+
const ptr1 = passArrayJsValueToWasm0(commits, wasm.__wbindgen_export);
|
|
1759
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1760
|
+
const ret = wasm.sedimentree_new(ptr0, len0, ptr1, len1);
|
|
1761
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1762
|
+
SedimentreeFinalization.register(this, this.__wbg_ptr, this);
|
|
1763
|
+
return this;
|
|
1764
|
+
}
|
|
1765
|
+
};
|
|
1766
|
+
if (Symbol.dispose) Sedimentree.prototype[Symbol.dispose] = Sedimentree.prototype.free;
|
|
1767
|
+
var SedimentreeId = class _SedimentreeId {
|
|
1768
|
+
static __wrap(ptr) {
|
|
1769
|
+
ptr = ptr >>> 0;
|
|
1770
|
+
const obj = Object.create(_SedimentreeId.prototype);
|
|
1771
|
+
obj.__wbg_ptr = ptr;
|
|
1772
|
+
SedimentreeIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1773
|
+
return obj;
|
|
1774
|
+
}
|
|
1775
|
+
static __unwrap(jsValue) {
|
|
1776
|
+
if (!(jsValue instanceof _SedimentreeId)) {
|
|
1777
|
+
return 0;
|
|
1778
|
+
}
|
|
1779
|
+
return jsValue.__destroy_into_raw();
|
|
1780
|
+
}
|
|
1781
|
+
__destroy_into_raw() {
|
|
1782
|
+
const ptr = this.__wbg_ptr;
|
|
1783
|
+
this.__wbg_ptr = 0;
|
|
1784
|
+
SedimentreeIdFinalization.unregister(this);
|
|
1785
|
+
return ptr;
|
|
1786
|
+
}
|
|
1787
|
+
free() {
|
|
1788
|
+
const ptr = this.__destroy_into_raw();
|
|
1789
|
+
wasm.__wbg_sedimentreeid_free(ptr, 0);
|
|
1790
|
+
}
|
|
1791
|
+
/**
|
|
1792
|
+
* Upcasts; to the JS-import type for [`WasmSedimentreeId`].
|
|
1793
|
+
* @returns {SedimentreeId}
|
|
1794
|
+
*/
|
|
1795
|
+
__wasm_refgen_toWasmSedimentreeId() {
|
|
1796
|
+
const ret = wasm.digest___wasm_refgen_toWasmDigest(this.__wbg_ptr);
|
|
1797
|
+
return _SedimentreeId.__wrap(ret);
|
|
1798
|
+
}
|
|
1799
|
+
/**
|
|
1800
|
+
* Create an ID from a byte array.
|
|
1801
|
+
*
|
|
1802
|
+
* # Errors
|
|
1803
|
+
*
|
|
1804
|
+
* Returns `Not32Bytes` if the provided byte array is not exactly 32 bytes long.
|
|
1805
|
+
* @param {Uint8Array} bytes
|
|
1806
|
+
* @returns {SedimentreeId}
|
|
1807
|
+
*/
|
|
1808
|
+
static fromBytes(bytes) {
|
|
1809
|
+
try {
|
|
1810
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1811
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
1812
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1813
|
+
wasm.sedimentreeid_fromBytes(retptr, ptr0, len0);
|
|
1814
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1815
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1816
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1817
|
+
if (r2) {
|
|
1818
|
+
throw takeObject(r1);
|
|
1819
|
+
}
|
|
1820
|
+
return _SedimentreeId.__wrap(r0);
|
|
1821
|
+
} finally {
|
|
1822
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
/**
|
|
1826
|
+
* Returns the raw bytes of this ID.
|
|
1827
|
+
* @returns {Uint8Array}
|
|
1828
|
+
*/
|
|
1829
|
+
toBytes() {
|
|
1830
|
+
try {
|
|
1831
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1832
|
+
wasm.digest_toBytes(retptr, this.__wbg_ptr);
|
|
1833
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1834
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1835
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1836
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1837
|
+
return v1;
|
|
1838
|
+
} finally {
|
|
1839
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
/**
|
|
1843
|
+
* Returns the string representation of the ID.
|
|
1844
|
+
* @returns {string}
|
|
1845
|
+
*/
|
|
1846
|
+
toString() {
|
|
1847
|
+
let deferred1_0;
|
|
1848
|
+
let deferred1_1;
|
|
1849
|
+
try {
|
|
1850
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1851
|
+
wasm.sedimentreeid_toString(retptr, this.__wbg_ptr);
|
|
1852
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1853
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1854
|
+
deferred1_0 = r0;
|
|
1855
|
+
deferred1_1 = r1;
|
|
1856
|
+
return getStringFromWasm0(r0, r1);
|
|
1857
|
+
} finally {
|
|
1858
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1859
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
};
|
|
1863
|
+
if (Symbol.dispose) SedimentreeId.prototype[Symbol.dispose] = SedimentreeId.prototype.free;
|
|
1864
|
+
var SedimentreeIdsArray = class _SedimentreeIdsArray {
|
|
1865
|
+
static __wrap(ptr) {
|
|
1866
|
+
ptr = ptr >>> 0;
|
|
1867
|
+
const obj = Object.create(_SedimentreeIdsArray.prototype);
|
|
1868
|
+
obj.__wbg_ptr = ptr;
|
|
1869
|
+
SedimentreeIdsArrayFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1870
|
+
return obj;
|
|
1871
|
+
}
|
|
1872
|
+
__destroy_into_raw() {
|
|
1873
|
+
const ptr = this.__wbg_ptr;
|
|
1874
|
+
this.__wbg_ptr = 0;
|
|
1875
|
+
SedimentreeIdsArrayFinalization.unregister(this);
|
|
1876
|
+
return ptr;
|
|
1877
|
+
}
|
|
1878
|
+
free() {
|
|
1879
|
+
const ptr = this.__destroy_into_raw();
|
|
1880
|
+
wasm.__wbg_sedimentreeidsarray_free(ptr, 0);
|
|
1881
|
+
}
|
|
1882
|
+
/**
|
|
1883
|
+
* Upcasts; to the JS-import type for [`WasmSedimentreeIdsArray`].
|
|
1884
|
+
* @returns {SedimentreeIdsArray}
|
|
1885
|
+
*/
|
|
1886
|
+
__wasm_refgen_toWasmSedimentreeIdsArray() {
|
|
1887
|
+
const ret = wasm.sedimentreeidsarray___wasm_refgen_toWasmSedimentreeIdsArray(this.__wbg_ptr);
|
|
1888
|
+
return _SedimentreeIdsArray.__wrap(ret);
|
|
1889
|
+
}
|
|
1890
|
+
};
|
|
1891
|
+
if (Symbol.dispose) SedimentreeIdsArray.prototype[Symbol.dispose] = SedimentreeIdsArray.prototype.free;
|
|
1892
|
+
var SignedFragment = class _SignedFragment {
|
|
1893
|
+
static __wrap(ptr) {
|
|
1894
|
+
ptr = ptr >>> 0;
|
|
1895
|
+
const obj = Object.create(_SignedFragment.prototype);
|
|
1896
|
+
obj.__wbg_ptr = ptr;
|
|
1897
|
+
SignedFragmentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1898
|
+
return obj;
|
|
1899
|
+
}
|
|
1900
|
+
__destroy_into_raw() {
|
|
1901
|
+
const ptr = this.__wbg_ptr;
|
|
1902
|
+
this.__wbg_ptr = 0;
|
|
1903
|
+
SignedFragmentFinalization.unregister(this);
|
|
1904
|
+
return ptr;
|
|
1905
|
+
}
|
|
1906
|
+
free() {
|
|
1907
|
+
const ptr = this.__destroy_into_raw();
|
|
1908
|
+
wasm.__wbg_signedfragment_free(ptr, 0);
|
|
1909
|
+
}
|
|
1910
|
+
/**
|
|
1911
|
+
* Upcasts; to the JS-import type for [`WasmSignedFragment`].
|
|
1912
|
+
* @returns {SignedFragment}
|
|
1913
|
+
*/
|
|
1914
|
+
__wasm_refgen_toWasmSignedFragment() {
|
|
1915
|
+
const ret = wasm.signedfragment___wasm_refgen_toWasmSignedFragment(this.__wbg_ptr);
|
|
1916
|
+
return _SignedFragment.__wrap(ret);
|
|
1917
|
+
}
|
|
1918
|
+
/**
|
|
1919
|
+
* Encode this signed fragment to raw bytes.
|
|
1920
|
+
* @returns {Uint8Array}
|
|
1921
|
+
*/
|
|
1922
|
+
encode() {
|
|
1923
|
+
const ret = wasm.signedfragment_encode(this.__wbg_ptr);
|
|
1924
|
+
return takeObject(ret);
|
|
1925
|
+
}
|
|
1926
|
+
/**
|
|
1927
|
+
* Get the unsigned payload without re-verifying the signature.
|
|
1928
|
+
*
|
|
1929
|
+
* # Errors
|
|
1930
|
+
*
|
|
1931
|
+
* Returns an error if the payload cannot be decoded.
|
|
1932
|
+
* @returns {Fragment}
|
|
1933
|
+
*/
|
|
1934
|
+
get payload() {
|
|
1935
|
+
try {
|
|
1936
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1937
|
+
wasm.signedfragment_payload(retptr, this.__wbg_ptr);
|
|
1938
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1939
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1940
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1941
|
+
if (r2) {
|
|
1942
|
+
throw takeObject(r1);
|
|
1943
|
+
}
|
|
1944
|
+
return Fragment.__wrap(r0);
|
|
1945
|
+
} finally {
|
|
1946
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
/**
|
|
1950
|
+
* Decode a `SignedFragment` from raw bytes.
|
|
1951
|
+
*
|
|
1952
|
+
* # Errors
|
|
1953
|
+
*
|
|
1954
|
+
* Returns an error if the bytes are not a valid signed fragment.
|
|
1955
|
+
* @param {Uint8Array} bytes
|
|
1956
|
+
* @returns {SignedFragment}
|
|
1957
|
+
*/
|
|
1958
|
+
static tryDecode(bytes) {
|
|
1959
|
+
try {
|
|
1960
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1961
|
+
wasm.signedfragment_tryDecode(retptr, addBorrowedObject(bytes));
|
|
1962
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1963
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1964
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1965
|
+
if (r2) {
|
|
1966
|
+
throw takeObject(r1);
|
|
1967
|
+
}
|
|
1968
|
+
return _SignedFragment.__wrap(r0);
|
|
1969
|
+
} finally {
|
|
1970
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1971
|
+
heap[stack_pointer++] = void 0;
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
};
|
|
1975
|
+
if (Symbol.dispose) SignedFragment.prototype[Symbol.dispose] = SignedFragment.prototype.free;
|
|
1976
|
+
var SignedLooseCommit = class _SignedLooseCommit {
|
|
1977
|
+
static __wrap(ptr) {
|
|
1978
|
+
ptr = ptr >>> 0;
|
|
1979
|
+
const obj = Object.create(_SignedLooseCommit.prototype);
|
|
1980
|
+
obj.__wbg_ptr = ptr;
|
|
1981
|
+
SignedLooseCommitFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1982
|
+
return obj;
|
|
1983
|
+
}
|
|
1984
|
+
__destroy_into_raw() {
|
|
1985
|
+
const ptr = this.__wbg_ptr;
|
|
1986
|
+
this.__wbg_ptr = 0;
|
|
1987
|
+
SignedLooseCommitFinalization.unregister(this);
|
|
1988
|
+
return ptr;
|
|
1989
|
+
}
|
|
1990
|
+
free() {
|
|
1991
|
+
const ptr = this.__destroy_into_raw();
|
|
1992
|
+
wasm.__wbg_signedloosecommit_free(ptr, 0);
|
|
1993
|
+
}
|
|
1994
|
+
/**
|
|
1995
|
+
* Upcasts; to the JS-import type for [`WasmSignedLooseCommit`].
|
|
1996
|
+
* @returns {SignedLooseCommit}
|
|
1997
|
+
*/
|
|
1998
|
+
__wasm_refgen_toWasmSignedLooseCommit() {
|
|
1999
|
+
const ret = wasm.signedloosecommit___wasm_refgen_toWasmSignedLooseCommit(this.__wbg_ptr);
|
|
2000
|
+
return _SignedLooseCommit.__wrap(ret);
|
|
2001
|
+
}
|
|
2002
|
+
/**
|
|
2003
|
+
* Encode this signed loose commit to raw bytes.
|
|
2004
|
+
* @returns {Uint8Array}
|
|
2005
|
+
*/
|
|
2006
|
+
encode() {
|
|
2007
|
+
const ret = wasm.signedloosecommit_encode(this.__wbg_ptr);
|
|
2008
|
+
return takeObject(ret);
|
|
2009
|
+
}
|
|
2010
|
+
/**
|
|
2011
|
+
* Get the unsigned payload without re-verifying the signature.
|
|
2012
|
+
*
|
|
2013
|
+
* # Errors
|
|
2014
|
+
*
|
|
2015
|
+
* Returns an error if the payload cannot be decoded.
|
|
2016
|
+
* @returns {LooseCommit}
|
|
2017
|
+
*/
|
|
2018
|
+
get payload() {
|
|
2019
|
+
try {
|
|
2020
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2021
|
+
wasm.signedloosecommit_payload(retptr, this.__wbg_ptr);
|
|
2022
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2023
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2024
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2025
|
+
if (r2) {
|
|
2026
|
+
throw takeObject(r1);
|
|
2027
|
+
}
|
|
2028
|
+
return LooseCommit.__wrap(r0);
|
|
2029
|
+
} finally {
|
|
2030
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
/**
|
|
2034
|
+
* Decode a `SignedLooseCommit` from raw bytes.
|
|
2035
|
+
*
|
|
2036
|
+
* # Errors
|
|
2037
|
+
*
|
|
2038
|
+
* Returns an error if the bytes are not a valid signed loose commit.
|
|
2039
|
+
* @param {Uint8Array} bytes
|
|
2040
|
+
* @returns {SignedLooseCommit}
|
|
2041
|
+
*/
|
|
2042
|
+
static tryDecode(bytes) {
|
|
2043
|
+
try {
|
|
2044
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2045
|
+
wasm.signedloosecommit_tryDecode(retptr, addBorrowedObject(bytes));
|
|
2046
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2047
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2048
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2049
|
+
if (r2) {
|
|
2050
|
+
throw takeObject(r1);
|
|
2051
|
+
}
|
|
2052
|
+
return _SignedLooseCommit.__wrap(r0);
|
|
2053
|
+
} finally {
|
|
2054
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2055
|
+
heap[stack_pointer++] = void 0;
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
};
|
|
2059
|
+
if (Symbol.dispose) SignedLooseCommit.prototype[Symbol.dispose] = SignedLooseCommit.prototype.free;
|
|
2060
|
+
var Subduction = class _Subduction {
|
|
2061
|
+
static __wrap(ptr) {
|
|
2062
|
+
ptr = ptr >>> 0;
|
|
2063
|
+
const obj = Object.create(_Subduction.prototype);
|
|
2064
|
+
obj.__wbg_ptr = ptr;
|
|
2065
|
+
SubductionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2066
|
+
return obj;
|
|
2067
|
+
}
|
|
2068
|
+
__destroy_into_raw() {
|
|
2069
|
+
const ptr = this.__wbg_ptr;
|
|
2070
|
+
this.__wbg_ptr = 0;
|
|
2071
|
+
SubductionFinalization.unregister(this);
|
|
2072
|
+
return ptr;
|
|
2073
|
+
}
|
|
2074
|
+
free() {
|
|
2075
|
+
const ptr = this.__destroy_into_raw();
|
|
2076
|
+
wasm.__wbg_subduction_free(ptr, 0);
|
|
2077
|
+
}
|
|
2078
|
+
/**
|
|
2079
|
+
* Add a commit with its associated blob to the storage.
|
|
2080
|
+
*
|
|
2081
|
+
* The commit metadata (including `BlobMeta`) is computed internally from
|
|
2082
|
+
* the provided blob, ensuring consistency by construction.
|
|
2083
|
+
*
|
|
2084
|
+
* # Errors
|
|
2085
|
+
*
|
|
2086
|
+
* Returns a [`WasmWriteError`] if storage, networking, or policy fail.
|
|
2087
|
+
* @param {SedimentreeId} id
|
|
2088
|
+
* @param {Digest[]} parents
|
|
2089
|
+
* @param {Uint8Array} blob
|
|
2090
|
+
* @returns {Promise<FragmentRequested | undefined>}
|
|
2091
|
+
*/
|
|
2092
|
+
addCommit(id, parents, blob) {
|
|
2093
|
+
_assertClass(id, SedimentreeId);
|
|
2094
|
+
const ptr0 = passArrayJsValueToWasm0(parents, wasm.__wbindgen_export);
|
|
2095
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2096
|
+
const ret = wasm.subduction_addCommit(this.__wbg_ptr, id.__wbg_ptr, ptr0, len0, addHeapObject(blob));
|
|
2097
|
+
return takeObject(ret);
|
|
2098
|
+
}
|
|
2099
|
+
/**
|
|
2100
|
+
* Add a fragment with its associated blob to the storage.
|
|
2101
|
+
*
|
|
2102
|
+
* The fragment metadata (including `BlobMeta`) is computed internally from
|
|
2103
|
+
* the provided blob, ensuring consistency by construction.
|
|
2104
|
+
*
|
|
2105
|
+
* # Errors
|
|
2106
|
+
*
|
|
2107
|
+
* Returns a [`WasmWriteError`] if storage, networking, or policy fail.
|
|
2108
|
+
* @param {SedimentreeId} id
|
|
2109
|
+
* @param {Digest} head
|
|
2110
|
+
* @param {Digest[]} boundary
|
|
2111
|
+
* @param {Digest[]} checkpoints
|
|
2112
|
+
* @param {Uint8Array} blob
|
|
2113
|
+
* @returns {Promise<void>}
|
|
2114
|
+
*/
|
|
2115
|
+
addFragment(id, head, boundary, checkpoints, blob) {
|
|
2116
|
+
_assertClass(id, SedimentreeId);
|
|
2117
|
+
_assertClass(head, Digest);
|
|
2118
|
+
const ptr0 = passArrayJsValueToWasm0(boundary, wasm.__wbindgen_export);
|
|
2119
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2120
|
+
const ptr1 = passArrayJsValueToWasm0(checkpoints, wasm.__wbindgen_export);
|
|
2121
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2122
|
+
const ret = wasm.subduction_addFragment(this.__wbg_ptr, id.__wbg_ptr, head.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(blob));
|
|
2123
|
+
return takeObject(ret);
|
|
2124
|
+
}
|
|
2125
|
+
/**
|
|
2126
|
+
* Add a Sedimentree.
|
|
2127
|
+
*
|
|
2128
|
+
* # Errors
|
|
2129
|
+
*
|
|
2130
|
+
* Returns [`WasmWriteError`] if there is a problem with storage, networking, or policy.
|
|
2131
|
+
* @param {SedimentreeId} id
|
|
2132
|
+
* @param {Sedimentree} sedimentree
|
|
2133
|
+
* @param {Uint8Array[]} blobs
|
|
2134
|
+
* @returns {Promise<void>}
|
|
2135
|
+
*/
|
|
2136
|
+
addSedimentree(id, sedimentree, blobs) {
|
|
2137
|
+
_assertClass(id, SedimentreeId);
|
|
2138
|
+
_assertClass(sedimentree, Sedimentree);
|
|
2139
|
+
const ptr0 = passArrayJsValueToWasm0(blobs, wasm.__wbindgen_export);
|
|
2140
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2141
|
+
const ret = wasm.subduction_addSedimentree(this.__wbg_ptr, id.__wbg_ptr, sedimentree.__wbg_ptr, ptr0, len0);
|
|
2142
|
+
return takeObject(ret);
|
|
2143
|
+
}
|
|
2144
|
+
/**
|
|
2145
|
+
* Attach an authenticated WebSocket connection and sync all sedimentrees.
|
|
2146
|
+
*
|
|
2147
|
+
* The connection must have been authenticated via [`SubductionWebSocket::setup`],
|
|
2148
|
+
* [`SubductionWebSocket::tryConnect`], or [`SubductionWebSocket::tryDiscover`].
|
|
2149
|
+
*
|
|
2150
|
+
* Returns `true` if this is a new peer, `false` if already connected.
|
|
2151
|
+
*
|
|
2152
|
+
* # Errors
|
|
2153
|
+
*
|
|
2154
|
+
* Returns an error if registration or sync fails.
|
|
2155
|
+
* @param {AuthenticatedWebSocket} conn
|
|
2156
|
+
* @returns {Promise<boolean>}
|
|
2157
|
+
*/
|
|
2158
|
+
attach(conn) {
|
|
2159
|
+
_assertClass(conn, AuthenticatedWebSocket);
|
|
2160
|
+
const ret = wasm.subduction_attach(this.__wbg_ptr, conn.__wbg_ptr);
|
|
2161
|
+
return takeObject(ret);
|
|
2162
|
+
}
|
|
2163
|
+
/**
|
|
2164
|
+
* Connect to a peer via WebSocket and register the connection.
|
|
2165
|
+
*
|
|
2166
|
+
* This performs the cryptographic handshake, verifies the server's identity,
|
|
2167
|
+
* and registers the authenticated connection for syncing.
|
|
2168
|
+
*
|
|
2169
|
+
* Returns the verified peer ID on success.
|
|
2170
|
+
*
|
|
2171
|
+
* # Arguments
|
|
2172
|
+
*
|
|
2173
|
+
* * `address` - The WebSocket URL to connect to
|
|
2174
|
+
* * `signer` - The client's signer for authentication
|
|
2175
|
+
* * `expected_peer_id` - The expected server peer ID (verified during handshake)
|
|
2176
|
+
* * `timeout_milliseconds` - Request timeout in milliseconds
|
|
2177
|
+
*
|
|
2178
|
+
* # Errors
|
|
2179
|
+
*
|
|
2180
|
+
* Returns an error if connection, handshake, or registration fails.
|
|
2181
|
+
* @param {URL} address
|
|
2182
|
+
* @param {any} signer
|
|
2183
|
+
* @param {PeerId} expected_peer_id
|
|
2184
|
+
* @param {number} timeout_milliseconds
|
|
2185
|
+
* @returns {Promise<PeerId>}
|
|
2186
|
+
*/
|
|
2187
|
+
connect(address, signer, expected_peer_id, timeout_milliseconds) {
|
|
2188
|
+
_assertClass(expected_peer_id, PeerId);
|
|
2189
|
+
const ret = wasm.subduction_connect(this.__wbg_ptr, addHeapObject(address), addHeapObject(signer), expected_peer_id.__wbg_ptr, timeout_milliseconds);
|
|
2190
|
+
return takeObject(ret);
|
|
2191
|
+
}
|
|
2192
|
+
/**
|
|
2193
|
+
* Connect to a peer via WebSocket using discovery mode and register the connection.
|
|
2194
|
+
*
|
|
2195
|
+
* Returns the discovered and verified peer ID on success.
|
|
2196
|
+
*
|
|
2197
|
+
* # Arguments
|
|
2198
|
+
*
|
|
2199
|
+
* * `address` - The WebSocket URL to connect to
|
|
2200
|
+
* * `signer` - The client's signer for authentication
|
|
2201
|
+
* * `timeout_milliseconds` - Request timeout in milliseconds (defaults to 30000)
|
|
2202
|
+
* * `service_name` - The service name for discovery (defaults to URL host)
|
|
2203
|
+
*
|
|
2204
|
+
* # Errors
|
|
2205
|
+
*
|
|
2206
|
+
* Returns an error if connection, handshake, or registration fails.
|
|
2207
|
+
* @param {URL} address
|
|
2208
|
+
* @param {any} signer
|
|
2209
|
+
* @param {number | null} [timeout_milliseconds]
|
|
2210
|
+
* @param {string | null} [service_name]
|
|
2211
|
+
* @returns {Promise<PeerId>}
|
|
2212
|
+
*/
|
|
2213
|
+
connectDiscover(address, signer, timeout_milliseconds, service_name) {
|
|
2214
|
+
var ptr0 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2215
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2216
|
+
const ret = wasm.subduction_connectDiscover(this.__wbg_ptr, addHeapObject(address), addHeapObject(signer), isLikeNone(timeout_milliseconds) ? 4294967297 : timeout_milliseconds >>> 0, ptr0, len0);
|
|
2217
|
+
return takeObject(ret);
|
|
2218
|
+
}
|
|
2219
|
+
/**
|
|
2220
|
+
* Connect to a peer via HTTP long-poll using discovery mode.
|
|
2221
|
+
*
|
|
2222
|
+
* Returns the discovered and verified peer ID on success.
|
|
2223
|
+
*
|
|
2224
|
+
* # Arguments
|
|
2225
|
+
*
|
|
2226
|
+
* * `base_url` - The server's HTTP base URL (e.g., `http://localhost:8080`)
|
|
2227
|
+
* * `signer` - The client's signer for authentication
|
|
2228
|
+
* * `timeout_milliseconds` - Request timeout in milliseconds (default: 30000)
|
|
2229
|
+
* * `service_name` - The service name for discovery (defaults to `base_url`)
|
|
2230
|
+
*
|
|
2231
|
+
* # Errors
|
|
2232
|
+
*
|
|
2233
|
+
* Returns an error if connection, handshake, or registration fails.
|
|
2234
|
+
* @param {string} base_url
|
|
2235
|
+
* @param {any} signer
|
|
2236
|
+
* @param {number | null} [timeout_milliseconds]
|
|
2237
|
+
* @param {string | null} [service_name]
|
|
2238
|
+
* @returns {Promise<PeerId>}
|
|
2239
|
+
*/
|
|
2240
|
+
connectDiscoverLongPoll(base_url, signer, timeout_milliseconds, service_name) {
|
|
2241
|
+
const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2242
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2243
|
+
var ptr1 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2244
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2245
|
+
const ret = wasm.subduction_connectDiscoverLongPoll(this.__wbg_ptr, ptr0, len0, addHeapObject(signer), isLikeNone(timeout_milliseconds) ? 4294967297 : timeout_milliseconds >>> 0, ptr1, len1);
|
|
2246
|
+
return takeObject(ret);
|
|
2247
|
+
}
|
|
2248
|
+
/**
|
|
2249
|
+
* Connect to a peer via HTTP long-poll and register the connection.
|
|
2250
|
+
*
|
|
2251
|
+
* Returns the verified peer ID on success.
|
|
2252
|
+
*
|
|
2253
|
+
* # Arguments
|
|
2254
|
+
*
|
|
2255
|
+
* * `base_url` - The server's HTTP base URL (e.g., `http://localhost:8080`)
|
|
2256
|
+
* * `signer` - The client's signer for authentication
|
|
2257
|
+
* * `expected_peer_id` - The expected server peer ID (verified during handshake)
|
|
2258
|
+
* * `timeout_milliseconds` - Request timeout in milliseconds (default: 30000)
|
|
2259
|
+
*
|
|
2260
|
+
* # Errors
|
|
2261
|
+
*
|
|
2262
|
+
* Returns an error if connection, handshake, or registration fails.
|
|
2263
|
+
* @param {string} base_url
|
|
2264
|
+
* @param {any} signer
|
|
2265
|
+
* @param {PeerId} expected_peer_id
|
|
2266
|
+
* @param {number | null} [timeout_milliseconds]
|
|
2267
|
+
* @returns {Promise<PeerId>}
|
|
2268
|
+
*/
|
|
2269
|
+
connectLongPoll(base_url, signer, expected_peer_id, timeout_milliseconds) {
|
|
2270
|
+
const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2271
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2272
|
+
_assertClass(expected_peer_id, PeerId);
|
|
2273
|
+
const ret = wasm.subduction_connectLongPoll(this.__wbg_ptr, ptr0, len0, addHeapObject(signer), expected_peer_id.__wbg_ptr, isLikeNone(timeout_milliseconds) ? 4294967297 : timeout_milliseconds >>> 0);
|
|
2274
|
+
return takeObject(ret);
|
|
2275
|
+
}
|
|
2276
|
+
/**
|
|
2277
|
+
* Disconnect from all peers.
|
|
2278
|
+
*
|
|
2279
|
+
* # Errors
|
|
2280
|
+
*
|
|
2281
|
+
* Returns a [`WasmDisconnectionError`] if disconnection was not graceful.
|
|
2282
|
+
* @returns {Promise<void>}
|
|
2283
|
+
*/
|
|
2284
|
+
disconnectAll() {
|
|
2285
|
+
const ret = wasm.subduction_disconnectAll(this.__wbg_ptr);
|
|
2286
|
+
return takeObject(ret);
|
|
2287
|
+
}
|
|
2288
|
+
/**
|
|
2289
|
+
* Disconnect from a peer by its ID.
|
|
2290
|
+
*
|
|
2291
|
+
* # Errors
|
|
2292
|
+
*
|
|
2293
|
+
* Returns a `WasmDisconnectionError` if disconnection fails.
|
|
2294
|
+
* @param {PeerId} peer_id
|
|
2295
|
+
* @returns {Promise<boolean>}
|
|
2296
|
+
*/
|
|
2297
|
+
disconnectFromPeer(peer_id) {
|
|
2298
|
+
_assertClass(peer_id, PeerId);
|
|
2299
|
+
const ret = wasm.subduction_disconnectFromPeer(this.__wbg_ptr, peer_id.__wbg_ptr);
|
|
2300
|
+
return takeObject(ret);
|
|
2301
|
+
}
|
|
2302
|
+
/**
|
|
2303
|
+
* Fetch blobs by their digests, with an optional timeout in milliseconds.
|
|
2304
|
+
*
|
|
2305
|
+
* # Errors
|
|
2306
|
+
*
|
|
2307
|
+
* Returns a [`WasmIoError`] if storage or networking fail.
|
|
2308
|
+
* @param {SedimentreeId} id
|
|
2309
|
+
* @param {bigint | null} [timeout_milliseconds]
|
|
2310
|
+
* @returns {Promise<Uint8Array[] | undefined>}
|
|
2311
|
+
*/
|
|
2312
|
+
fetchBlobs(id, timeout_milliseconds) {
|
|
2313
|
+
_assertClass(id, SedimentreeId);
|
|
2314
|
+
const ret = wasm.subduction_fetchBlobs(this.__wbg_ptr, id.__wbg_ptr, !isLikeNone(timeout_milliseconds), isLikeNone(timeout_milliseconds) ? BigInt(0) : timeout_milliseconds);
|
|
2315
|
+
return takeObject(ret);
|
|
2316
|
+
}
|
|
2317
|
+
/**
|
|
2318
|
+
* Request batch sync for all known Sedimentree IDs from all connected peers.
|
|
2319
|
+
* @param {bigint | null} [timeout_milliseconds]
|
|
2320
|
+
* @returns {Promise<PeerBatchSyncResult>}
|
|
2321
|
+
*/
|
|
2322
|
+
fullSync(timeout_milliseconds) {
|
|
2323
|
+
const ret = wasm.subduction_fullSync(this.__wbg_ptr, !isLikeNone(timeout_milliseconds), isLikeNone(timeout_milliseconds) ? BigInt(0) : timeout_milliseconds);
|
|
2324
|
+
return takeObject(ret);
|
|
2325
|
+
}
|
|
2326
|
+
/**
|
|
2327
|
+
* Get a local blob by its digest.
|
|
2328
|
+
*
|
|
2329
|
+
* # Errors
|
|
2330
|
+
*
|
|
2331
|
+
* Returns a [`JsStorageError`] if JS storage fails.
|
|
2332
|
+
* @param {SedimentreeId} id
|
|
2333
|
+
* @param {Digest} digest
|
|
2334
|
+
* @returns {Promise<Uint8Array | undefined>}
|
|
2335
|
+
*/
|
|
2336
|
+
getBlob(id, digest) {
|
|
2337
|
+
_assertClass(id, SedimentreeId);
|
|
2338
|
+
_assertClass(digest, Digest);
|
|
2339
|
+
const ret = wasm.subduction_getBlob(this.__wbg_ptr, id.__wbg_ptr, digest.__wbg_ptr);
|
|
2340
|
+
return takeObject(ret);
|
|
2341
|
+
}
|
|
2342
|
+
/**
|
|
2343
|
+
* Get all local blobs for a given Sedimentree ID.
|
|
2344
|
+
*
|
|
2345
|
+
* # Errors
|
|
2346
|
+
*
|
|
2347
|
+
* Returns a [`JsStorageError`] if JS storage fails.
|
|
2348
|
+
* @param {SedimentreeId} id
|
|
2349
|
+
* @returns {Promise<Uint8Array[]>}
|
|
2350
|
+
*/
|
|
2351
|
+
getBlobs(id) {
|
|
2352
|
+
_assertClass(id, SedimentreeId);
|
|
2353
|
+
const ret = wasm.subduction_getBlobs(this.__wbg_ptr, id.__wbg_ptr);
|
|
2354
|
+
return takeObject(ret);
|
|
2355
|
+
}
|
|
2356
|
+
/**
|
|
2357
|
+
* Get all commits for a given Sedimentree ID
|
|
2358
|
+
* @param {SedimentreeId} id
|
|
2359
|
+
* @returns {Promise<LooseCommit[] | undefined>}
|
|
2360
|
+
*/
|
|
2361
|
+
getCommits(id) {
|
|
2362
|
+
_assertClass(id, SedimentreeId);
|
|
2363
|
+
const ret = wasm.subduction_getCommits(this.__wbg_ptr, id.__wbg_ptr);
|
|
2364
|
+
return takeObject(ret);
|
|
2365
|
+
}
|
|
2366
|
+
/**
|
|
2367
|
+
* Get the peer IDs of all connected peers.
|
|
2368
|
+
* @returns {Promise<PeerId[]>}
|
|
2369
|
+
*/
|
|
2370
|
+
getConnectedPeerIds() {
|
|
2371
|
+
const ret = wasm.subduction_getConnectedPeerIds(this.__wbg_ptr);
|
|
2372
|
+
return takeObject(ret);
|
|
2373
|
+
}
|
|
2374
|
+
/**
|
|
2375
|
+
* Get all fragments for a given Sedimentree ID
|
|
2376
|
+
* @param {SedimentreeId} id
|
|
2377
|
+
* @returns {Promise<Fragment[] | undefined>}
|
|
2378
|
+
*/
|
|
2379
|
+
getFragments(id) {
|
|
2380
|
+
_assertClass(id, SedimentreeId);
|
|
2381
|
+
const ret = wasm.subduction_getFragments(this.__wbg_ptr, id.__wbg_ptr);
|
|
2382
|
+
return takeObject(ret);
|
|
2383
|
+
}
|
|
2384
|
+
/**
|
|
2385
|
+
* Hydrate a [`Subduction`] instance from external storage.
|
|
2386
|
+
*
|
|
2387
|
+
* # Arguments
|
|
2388
|
+
*
|
|
2389
|
+
* * `signer` - The cryptographic signer for this node's identity
|
|
2390
|
+
* * `storage` - Storage backend for persisting data
|
|
2391
|
+
* * `service_name` - Optional service identifier for discovery mode (e.g., `sync.example.com`).
|
|
2392
|
+
* When set, clients can connect without knowing the server's peer ID.
|
|
2393
|
+
* * `hash_metric_override` - Optional custom depth metric function
|
|
2394
|
+
* * `max_pending_blob_requests` - Optional maximum number of pending blob requests (default: 10,000)
|
|
2395
|
+
*
|
|
2396
|
+
* # Errors
|
|
2397
|
+
*
|
|
2398
|
+
* Returns [`WasmHydrationError`] if hydration fails.
|
|
2399
|
+
* @param {any} signer
|
|
2400
|
+
* @param {SedimentreeStorage} storage
|
|
2401
|
+
* @param {string | null} [service_name]
|
|
2402
|
+
* @param {(digest: Digest) => Depth | null} [hash_metric_override]
|
|
2403
|
+
* @param {number | null} [max_pending_blob_requests]
|
|
2404
|
+
* @returns {Promise<Subduction>}
|
|
2405
|
+
*/
|
|
2406
|
+
static hydrate(signer, storage, service_name, hash_metric_override, max_pending_blob_requests) {
|
|
2407
|
+
var ptr0 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2408
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2409
|
+
const ret = wasm.subduction_hydrate(addHeapObject(signer), addHeapObject(storage), ptr0, len0, isLikeNone(hash_metric_override) ? 0 : addHeapObject(hash_metric_override), isLikeNone(max_pending_blob_requests) ? 4294967297 : max_pending_blob_requests >>> 0);
|
|
2410
|
+
return takeObject(ret);
|
|
2411
|
+
}
|
|
2412
|
+
/**
|
|
2413
|
+
* Create a new [`Subduction`] instance.
|
|
2414
|
+
*
|
|
2415
|
+
* # Arguments
|
|
2416
|
+
*
|
|
2417
|
+
* * `signer` - The cryptographic signer for this node's identity
|
|
2418
|
+
* * `storage` - Storage backend for persisting data
|
|
2419
|
+
* * `service_name` - Optional service identifier for discovery mode (e.g., `sync.example.com`).
|
|
2420
|
+
* When set, clients can connect without knowing the server's peer ID.
|
|
2421
|
+
* * `hash_metric_override` - Optional custom depth metric function
|
|
2422
|
+
* * `max_pending_blob_requests` - Optional maximum number of pending blob requests (default: 10,000)
|
|
2423
|
+
* @param {any} signer
|
|
2424
|
+
* @param {SedimentreeStorage} storage
|
|
2425
|
+
* @param {string | null} [service_name]
|
|
2426
|
+
* @param {(digest: Digest) => Depth | null} [hash_metric_override]
|
|
2427
|
+
* @param {number | null} [max_pending_blob_requests]
|
|
2428
|
+
*/
|
|
2429
|
+
constructor(signer, storage, service_name, hash_metric_override, max_pending_blob_requests) {
|
|
2430
|
+
var ptr0 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2431
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2432
|
+
const ret = wasm.subduction_new(addHeapObject(signer), addHeapObject(storage), ptr0, len0, isLikeNone(hash_metric_override) ? 0 : addHeapObject(hash_metric_override), isLikeNone(max_pending_blob_requests) ? 4294967297 : max_pending_blob_requests >>> 0);
|
|
2433
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2434
|
+
SubductionFinalization.register(this, this.__wbg_ptr, this);
|
|
2435
|
+
return this;
|
|
2436
|
+
}
|
|
2437
|
+
/**
|
|
2438
|
+
* Remove a Sedimentree and all associated data.
|
|
2439
|
+
*
|
|
2440
|
+
* # Errors
|
|
2441
|
+
*
|
|
2442
|
+
* Returns a [`WasmIoError`] if storage or networking fail.
|
|
2443
|
+
* @param {SedimentreeId} id
|
|
2444
|
+
* @returns {Promise<void>}
|
|
2445
|
+
*/
|
|
2446
|
+
removeSedimentree(id) {
|
|
2447
|
+
_assertClass(id, SedimentreeId);
|
|
2448
|
+
const ret = wasm.subduction_removeSedimentree(this.__wbg_ptr, id.__wbg_ptr);
|
|
2449
|
+
return takeObject(ret);
|
|
2450
|
+
}
|
|
2451
|
+
/**
|
|
2452
|
+
* Request blobs by their digests from connected peers for a specific sedimentree.
|
|
2453
|
+
* @param {SedimentreeId} id
|
|
2454
|
+
* @param {Digest[]} digests
|
|
2455
|
+
* @returns {Promise<void>}
|
|
2456
|
+
*/
|
|
2457
|
+
requestBlobs(id, digests) {
|
|
2458
|
+
_assertClass(id, SedimentreeId);
|
|
2459
|
+
const ptr0 = passArrayJsValueToWasm0(digests, wasm.__wbindgen_export);
|
|
2460
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2461
|
+
const ret = wasm.subduction_requestBlobs(this.__wbg_ptr, id.__wbg_ptr, ptr0, len0);
|
|
2462
|
+
return takeObject(ret);
|
|
2463
|
+
}
|
|
2464
|
+
/**
|
|
2465
|
+
* Get all known Sedimentree IDs
|
|
2466
|
+
* @returns {Promise<SedimentreeId[]>}
|
|
2467
|
+
*/
|
|
2468
|
+
sedimentreeIds() {
|
|
2469
|
+
const ret = wasm.subduction_sedimentreeIds(this.__wbg_ptr);
|
|
2470
|
+
return takeObject(ret);
|
|
2471
|
+
}
|
|
2472
|
+
/**
|
|
2473
|
+
* Get the backing storage.
|
|
2474
|
+
* @returns {any}
|
|
2475
|
+
*/
|
|
2476
|
+
get storage() {
|
|
2477
|
+
const ret = wasm.subduction_storage(this.__wbg_ptr);
|
|
2478
|
+
return takeObject(ret);
|
|
2479
|
+
}
|
|
2480
|
+
/**
|
|
2481
|
+
* Request batch sync for a given Sedimentree ID from all connected peers.
|
|
2482
|
+
*
|
|
2483
|
+
* # Arguments
|
|
2484
|
+
*
|
|
2485
|
+
* * `id` - The sedimentree ID to sync
|
|
2486
|
+
* * `subscribe` - Whether to subscribe for incremental updates
|
|
2487
|
+
* * `timeout_milliseconds` - Optional timeout in milliseconds
|
|
2488
|
+
*
|
|
2489
|
+
* # Errors
|
|
2490
|
+
*
|
|
2491
|
+
* Returns a [`WasmIoError`] if storage or networking fail.
|
|
2492
|
+
* @param {SedimentreeId} id
|
|
2493
|
+
* @param {boolean} subscribe
|
|
2494
|
+
* @param {bigint | null} [timeout_milliseconds]
|
|
2495
|
+
* @returns {Promise<PeerResultMap>}
|
|
2496
|
+
*/
|
|
2497
|
+
syncAll(id, subscribe, timeout_milliseconds) {
|
|
2498
|
+
_assertClass(id, SedimentreeId);
|
|
2499
|
+
const ret = wasm.subduction_syncAll(this.__wbg_ptr, id.__wbg_ptr, subscribe, !isLikeNone(timeout_milliseconds), isLikeNone(timeout_milliseconds) ? BigInt(0) : timeout_milliseconds);
|
|
2500
|
+
return takeObject(ret);
|
|
2501
|
+
}
|
|
2502
|
+
/**
|
|
2503
|
+
* Request batch sync for a given Sedimentree ID from a specific peer.
|
|
2504
|
+
*
|
|
2505
|
+
* # Arguments
|
|
2506
|
+
*
|
|
2507
|
+
* * `to_ask` - The peer ID to sync with
|
|
2508
|
+
* * `id` - The sedimentree ID to sync
|
|
2509
|
+
* * `subscribe` - Whether to subscribe for incremental updates
|
|
2510
|
+
* * `timeout_milliseconds` - Optional timeout in milliseconds
|
|
2511
|
+
*
|
|
2512
|
+
* # Errors
|
|
2513
|
+
*
|
|
2514
|
+
* Returns a [`WasmIoError`] if storage or networking fail.
|
|
2515
|
+
* @param {PeerId} to_ask
|
|
2516
|
+
* @param {SedimentreeId} id
|
|
2517
|
+
* @param {boolean} subscribe
|
|
2518
|
+
* @param {bigint | null} [timeout_milliseconds]
|
|
2519
|
+
* @returns {Promise<PeerBatchSyncResult>}
|
|
2520
|
+
*/
|
|
2521
|
+
syncWithPeer(to_ask, id, subscribe, timeout_milliseconds) {
|
|
2522
|
+
_assertClass(to_ask, PeerId);
|
|
2523
|
+
_assertClass(id, SedimentreeId);
|
|
2524
|
+
const ret = wasm.subduction_syncWithPeer(this.__wbg_ptr, to_ask.__wbg_ptr, id.__wbg_ptr, subscribe, !isLikeNone(timeout_milliseconds), isLikeNone(timeout_milliseconds) ? BigInt(0) : timeout_milliseconds);
|
|
2525
|
+
return takeObject(ret);
|
|
2526
|
+
}
|
|
2527
|
+
};
|
|
2528
|
+
if (Symbol.dispose) Subduction.prototype[Symbol.dispose] = Subduction.prototype.free;
|
|
2529
|
+
var SubductionLongPoll = class {
|
|
2530
|
+
__destroy_into_raw() {
|
|
2531
|
+
const ptr = this.__wbg_ptr;
|
|
2532
|
+
this.__wbg_ptr = 0;
|
|
2533
|
+
SubductionLongPollFinalization.unregister(this);
|
|
2534
|
+
return ptr;
|
|
2535
|
+
}
|
|
2536
|
+
free() {
|
|
2537
|
+
const ptr = this.__destroy_into_raw();
|
|
2538
|
+
wasm.__wbg_subductionlongpoll_free(ptr, 0);
|
|
2539
|
+
}
|
|
2540
|
+
/**
|
|
2541
|
+
* Connect to a server with a known peer ID.
|
|
2542
|
+
*
|
|
2543
|
+
* # Arguments
|
|
2544
|
+
*
|
|
2545
|
+
* * `base_url` - The server's HTTP base URL (e.g., `http://localhost:8080`)
|
|
2546
|
+
* * `signer` - The client's signer for authentication
|
|
2547
|
+
* * `expected_peer_id` - The expected server peer ID (verified during handshake)
|
|
2548
|
+
* * `timeout_milliseconds` - Request timeout in milliseconds (default: 30000)
|
|
2549
|
+
*
|
|
2550
|
+
* # Errors
|
|
2551
|
+
*
|
|
2552
|
+
* Returns [`LongPollConnectionError`] if connection or handshake fails.
|
|
2553
|
+
* @param {string} base_url
|
|
2554
|
+
* @param {any} signer
|
|
2555
|
+
* @param {PeerId} expected_peer_id
|
|
2556
|
+
* @param {number | null} [timeout_milliseconds]
|
|
2557
|
+
* @returns {Promise<AuthenticatedLongPoll>}
|
|
2558
|
+
*/
|
|
2559
|
+
static tryConnect(base_url, signer, expected_peer_id, timeout_milliseconds) {
|
|
2560
|
+
const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2561
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2562
|
+
_assertClass(expected_peer_id, PeerId);
|
|
2563
|
+
const ret = wasm.subductionlongpoll_tryConnect(ptr0, len0, addHeapObject(signer), expected_peer_id.__wbg_ptr, isLikeNone(timeout_milliseconds) ? 4294967297 : timeout_milliseconds >>> 0);
|
|
2564
|
+
return takeObject(ret);
|
|
2565
|
+
}
|
|
2566
|
+
/**
|
|
2567
|
+
* Connect to a server using discovery mode.
|
|
2568
|
+
*
|
|
2569
|
+
* # Arguments
|
|
2570
|
+
*
|
|
2571
|
+
* * `base_url` - The server's HTTP base URL (e.g., `http://localhost:8080`)
|
|
2572
|
+
* * `signer` - The client's signer for authentication
|
|
2573
|
+
* * `timeout_milliseconds` - Request timeout in milliseconds (default: 30000)
|
|
2574
|
+
* * `service_name` - The service name for discovery. If omitted, the base URL is used.
|
|
2575
|
+
*
|
|
2576
|
+
* # Errors
|
|
2577
|
+
*
|
|
2578
|
+
* Returns [`LongPollConnectionError`] if connection or handshake fails.
|
|
2579
|
+
* @param {string} base_url
|
|
2580
|
+
* @param {any} signer
|
|
2581
|
+
* @param {number | null} [timeout_milliseconds]
|
|
2582
|
+
* @param {string | null} [service_name]
|
|
2583
|
+
* @returns {Promise<AuthenticatedLongPoll>}
|
|
2584
|
+
*/
|
|
2585
|
+
static tryDiscover(base_url, signer, timeout_milliseconds, service_name) {
|
|
2586
|
+
const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2587
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2588
|
+
var ptr1 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2589
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2590
|
+
const ret = wasm.subductionlongpoll_tryDiscover(ptr0, len0, addHeapObject(signer), isLikeNone(timeout_milliseconds) ? 4294967297 : timeout_milliseconds >>> 0, ptr1, len1);
|
|
2591
|
+
return takeObject(ret);
|
|
2592
|
+
}
|
|
2593
|
+
};
|
|
2594
|
+
if (Symbol.dispose) SubductionLongPoll.prototype[Symbol.dispose] = SubductionLongPoll.prototype.free;
|
|
2595
|
+
var SubductionLongPollConnection = class _SubductionLongPollConnection {
|
|
2596
|
+
static __wrap(ptr) {
|
|
2597
|
+
ptr = ptr >>> 0;
|
|
2598
|
+
const obj = Object.create(_SubductionLongPollConnection.prototype);
|
|
2599
|
+
obj.__wbg_ptr = ptr;
|
|
2600
|
+
SubductionLongPollConnectionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2601
|
+
return obj;
|
|
2602
|
+
}
|
|
2603
|
+
__destroy_into_raw() {
|
|
2604
|
+
const ptr = this.__wbg_ptr;
|
|
2605
|
+
this.__wbg_ptr = 0;
|
|
2606
|
+
SubductionLongPollConnectionFinalization.unregister(this);
|
|
2607
|
+
return ptr;
|
|
2608
|
+
}
|
|
2609
|
+
free() {
|
|
2610
|
+
const ptr = this.__destroy_into_raw();
|
|
2611
|
+
wasm.__wbg_subductionlongpollconnection_free(ptr, 0);
|
|
2612
|
+
}
|
|
2613
|
+
/**
|
|
2614
|
+
* Make a synchronous call to the peer.
|
|
2615
|
+
*
|
|
2616
|
+
* # Errors
|
|
2617
|
+
*
|
|
2618
|
+
* Returns an error if the call fails or times out.
|
|
2619
|
+
* @param {BatchSyncRequest} request
|
|
2620
|
+
* @param {number | null} [timeout_ms]
|
|
2621
|
+
* @returns {Promise<BatchSyncResponse>}
|
|
2622
|
+
*/
|
|
2623
|
+
call(request, timeout_ms) {
|
|
2624
|
+
_assertClass(request, BatchSyncRequest);
|
|
2625
|
+
var ptr0 = request.__destroy_into_raw();
|
|
2626
|
+
const ret = wasm.subductionlongpollconnection_call(this.__wbg_ptr, ptr0, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms);
|
|
2627
|
+
return takeObject(ret);
|
|
2628
|
+
}
|
|
2629
|
+
/**
|
|
2630
|
+
* Disconnect from the peer gracefully.
|
|
2631
|
+
*
|
|
2632
|
+
* # Errors
|
|
2633
|
+
*
|
|
2634
|
+
* Returns [`WasmLongPollConnError`] if the disconnect fails.
|
|
2635
|
+
* @returns {Promise<void>}
|
|
2636
|
+
*/
|
|
2637
|
+
disconnect() {
|
|
2638
|
+
const ret = wasm.subductionlongpollconnection_disconnect(this.__wbg_ptr);
|
|
2639
|
+
return takeObject(ret);
|
|
2640
|
+
}
|
|
2641
|
+
/**
|
|
2642
|
+
* Get the next request ID.
|
|
2643
|
+
* @returns {Promise<RequestId>}
|
|
2644
|
+
*/
|
|
2645
|
+
nextRequestId() {
|
|
2646
|
+
const ret = wasm.subductionlongpollconnection_nextRequestId(this.__wbg_ptr);
|
|
2647
|
+
return takeObject(ret);
|
|
2648
|
+
}
|
|
2649
|
+
/**
|
|
2650
|
+
* Get the peer ID of the remote peer.
|
|
2651
|
+
* @returns {PeerId}
|
|
2652
|
+
*/
|
|
2653
|
+
peerId() {
|
|
2654
|
+
const ret = wasm.subductionlongpollconnection_peerId(this.__wbg_ptr);
|
|
2655
|
+
return PeerId.__wrap(ret);
|
|
2656
|
+
}
|
|
2657
|
+
/**
|
|
2658
|
+
* Receive a message.
|
|
2659
|
+
*
|
|
2660
|
+
* # Errors
|
|
2661
|
+
*
|
|
2662
|
+
* Returns an error if the inbound channel is closed.
|
|
2663
|
+
* @returns {Promise<Message>}
|
|
2664
|
+
*/
|
|
2665
|
+
recv() {
|
|
2666
|
+
const ret = wasm.subductionlongpollconnection_recv(this.__wbg_ptr);
|
|
2667
|
+
return takeObject(ret);
|
|
2668
|
+
}
|
|
2669
|
+
/**
|
|
2670
|
+
* Send a message.
|
|
2671
|
+
*
|
|
2672
|
+
* # Errors
|
|
2673
|
+
*
|
|
2674
|
+
* Returns an error if the outbound channel is closed.
|
|
2675
|
+
* @param {Message} message
|
|
2676
|
+
* @returns {Promise<void>}
|
|
2677
|
+
*/
|
|
2678
|
+
send(message) {
|
|
2679
|
+
_assertClass(message, Message);
|
|
2680
|
+
var ptr0 = message.__destroy_into_raw();
|
|
2681
|
+
const ret = wasm.subductionlongpollconnection_send(this.__wbg_ptr, ptr0);
|
|
2682
|
+
return takeObject(ret);
|
|
2683
|
+
}
|
|
2684
|
+
};
|
|
2685
|
+
if (Symbol.dispose) SubductionLongPollConnection.prototype[Symbol.dispose] = SubductionLongPollConnection.prototype.free;
|
|
2686
|
+
var SubductionWebSocket = class _SubductionWebSocket {
|
|
2687
|
+
static __wrap(ptr) {
|
|
2688
|
+
ptr = ptr >>> 0;
|
|
2689
|
+
const obj = Object.create(_SubductionWebSocket.prototype);
|
|
2690
|
+
obj.__wbg_ptr = ptr;
|
|
2691
|
+
SubductionWebSocketFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2692
|
+
return obj;
|
|
2693
|
+
}
|
|
2694
|
+
__destroy_into_raw() {
|
|
2695
|
+
const ptr = this.__wbg_ptr;
|
|
2696
|
+
this.__wbg_ptr = 0;
|
|
2697
|
+
SubductionWebSocketFinalization.unregister(this);
|
|
2698
|
+
return ptr;
|
|
2699
|
+
}
|
|
2700
|
+
free() {
|
|
2701
|
+
const ptr = this.__destroy_into_raw();
|
|
2702
|
+
wasm.__wbg_subductionwebsocket_free(ptr, 0);
|
|
2703
|
+
}
|
|
2704
|
+
/**
|
|
2705
|
+
* Make a synchronous call to the peer.
|
|
2706
|
+
*
|
|
2707
|
+
* # Errors
|
|
2708
|
+
*
|
|
2709
|
+
* Returns [`WasmCallError`] if the call fails or times out.
|
|
2710
|
+
* @param {BatchSyncRequest} request
|
|
2711
|
+
* @param {number | null} [timeout_ms]
|
|
2712
|
+
* @returns {Promise<BatchSyncResponse>}
|
|
2713
|
+
*/
|
|
2714
|
+
call(request, timeout_ms) {
|
|
2715
|
+
_assertClass(request, BatchSyncRequest);
|
|
2716
|
+
var ptr0 = request.__destroy_into_raw();
|
|
2717
|
+
const ret = wasm.subductionwebsocket_call(this.__wbg_ptr, ptr0, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms);
|
|
2718
|
+
return takeObject(ret);
|
|
2719
|
+
}
|
|
2720
|
+
/**
|
|
2721
|
+
* Disconnect from the peer gracefully.
|
|
2722
|
+
* @returns {Promise<void>}
|
|
2723
|
+
*/
|
|
2724
|
+
disconnect() {
|
|
2725
|
+
const ret = wasm.subductionwebsocket_disconnect(this.__wbg_ptr);
|
|
2726
|
+
return takeObject(ret);
|
|
2727
|
+
}
|
|
2728
|
+
/**
|
|
2729
|
+
* Get the next request ID.
|
|
2730
|
+
* @returns {Promise<RequestId>}
|
|
2731
|
+
*/
|
|
2732
|
+
nextRequestId() {
|
|
2733
|
+
const ret = wasm.subductionwebsocket_nextRequestId(this.__wbg_ptr);
|
|
2734
|
+
return takeObject(ret);
|
|
2735
|
+
}
|
|
2736
|
+
/**
|
|
2737
|
+
* Get the peer ID of the remote peer.
|
|
2738
|
+
* @returns {PeerId}
|
|
2739
|
+
*/
|
|
2740
|
+
peerId() {
|
|
2741
|
+
const ret = wasm.authenticatedwebsocket_peerId(this.__wbg_ptr);
|
|
2742
|
+
return PeerId.__wrap(ret);
|
|
2743
|
+
}
|
|
2744
|
+
/**
|
|
2745
|
+
* Receive a message.
|
|
2746
|
+
*
|
|
2747
|
+
* # Errors
|
|
2748
|
+
*
|
|
2749
|
+
* Returns [`ReadFromClosedChannel`] if the channel has been closed.
|
|
2750
|
+
* @returns {Promise<Message>}
|
|
2751
|
+
*/
|
|
2752
|
+
recv() {
|
|
2753
|
+
const ret = wasm.subductionwebsocket_recv(this.__wbg_ptr);
|
|
2754
|
+
return takeObject(ret);
|
|
2755
|
+
}
|
|
2756
|
+
/**
|
|
2757
|
+
* Send a message.
|
|
2758
|
+
*
|
|
2759
|
+
* # Errors
|
|
2760
|
+
*
|
|
2761
|
+
* Returns [`WasmSendError`] if the message could not be sent over the WebSocket.
|
|
2762
|
+
* @param {Message} wasm_message
|
|
2763
|
+
* @returns {Promise<void>}
|
|
2764
|
+
*/
|
|
2765
|
+
send(wasm_message) {
|
|
2766
|
+
_assertClass(wasm_message, Message);
|
|
2767
|
+
var ptr0 = wasm_message.__destroy_into_raw();
|
|
2768
|
+
const ret = wasm.subductionwebsocket_send(this.__wbg_ptr, ptr0);
|
|
2769
|
+
return takeObject(ret);
|
|
2770
|
+
}
|
|
2771
|
+
/**
|
|
2772
|
+
* Authenticate an existing WebSocket via handshake.
|
|
2773
|
+
*
|
|
2774
|
+
* This performs the Subduction handshake protocol over the provided WebSocket
|
|
2775
|
+
* to establish mutual identity. The WebSocket can be in CONNECTING or OPEN state.
|
|
2776
|
+
*
|
|
2777
|
+
* # Arguments
|
|
2778
|
+
*
|
|
2779
|
+
* * `ws` - An existing WebSocket (CONNECTING or OPEN)
|
|
2780
|
+
* * `signer` - The client's signer for authentication
|
|
2781
|
+
* * `expected_peer_id` - The expected server peer ID (verified during handshake)
|
|
2782
|
+
* * `timeout_milliseconds` - Request timeout in milliseconds
|
|
2783
|
+
*
|
|
2784
|
+
* # Errors
|
|
2785
|
+
*
|
|
2786
|
+
* Returns an error if the handshake fails (signature invalid, wrong peer, etc.)
|
|
2787
|
+
* @param {WebSocket} ws
|
|
2788
|
+
* @param {any} signer
|
|
2789
|
+
* @param {PeerId} expected_peer_id
|
|
2790
|
+
* @param {number} timeout_milliseconds
|
|
2791
|
+
* @returns {Promise<AuthenticatedWebSocket>}
|
|
2792
|
+
*/
|
|
2793
|
+
static setup(ws, signer, expected_peer_id, timeout_milliseconds) {
|
|
2794
|
+
_assertClass(expected_peer_id, PeerId);
|
|
2795
|
+
const ret = wasm.subductionwebsocket_setup(addHeapObject(ws), addHeapObject(signer), expected_peer_id.__wbg_ptr, timeout_milliseconds);
|
|
2796
|
+
return takeObject(ret);
|
|
2797
|
+
}
|
|
2798
|
+
/**
|
|
2799
|
+
* Connect to a WebSocket server with mutual authentication via handshake.
|
|
2800
|
+
*
|
|
2801
|
+
* # Arguments
|
|
2802
|
+
*
|
|
2803
|
+
* * `address` - The WebSocket URL to connect to
|
|
2804
|
+
* * `signer` - The client's signer for authentication
|
|
2805
|
+
* * `expected_peer_id` - The expected server peer ID (verified during handshake)
|
|
2806
|
+
* * `timeout_milliseconds` - Request timeout in milliseconds
|
|
2807
|
+
*
|
|
2808
|
+
* # Errors
|
|
2809
|
+
*
|
|
2810
|
+
* Returns an error if:
|
|
2811
|
+
* - The WebSocket connection could not be established
|
|
2812
|
+
* - The handshake fails (signature invalid, wrong server, clock drift, etc.)
|
|
2813
|
+
* @param {URL} address
|
|
2814
|
+
* @param {any} signer
|
|
2815
|
+
* @param {PeerId} expected_peer_id
|
|
2816
|
+
* @param {number} timeout_milliseconds
|
|
2817
|
+
* @returns {Promise<AuthenticatedWebSocket>}
|
|
2818
|
+
*/
|
|
2819
|
+
static tryConnect(address, signer, expected_peer_id, timeout_milliseconds) {
|
|
2820
|
+
_assertClass(expected_peer_id, PeerId);
|
|
2821
|
+
const ret = wasm.subductionwebsocket_tryConnect(addHeapObject(address), addHeapObject(signer), expected_peer_id.__wbg_ptr, timeout_milliseconds);
|
|
2822
|
+
return takeObject(ret);
|
|
2823
|
+
}
|
|
2824
|
+
/**
|
|
2825
|
+
* Connect to a WebSocket server using discovery mode.
|
|
2826
|
+
*
|
|
2827
|
+
* This method performs a cryptographic handshake using a service name
|
|
2828
|
+
* instead of a known peer ID. The server's peer ID is discovered during
|
|
2829
|
+
* the handshake and returned.
|
|
2830
|
+
*
|
|
2831
|
+
* # Arguments
|
|
2832
|
+
*
|
|
2833
|
+
* * `address` - The WebSocket URL to connect to
|
|
2834
|
+
* * `signer` - The client's signer for authentication
|
|
2835
|
+
* * `timeout_milliseconds` - Request timeout in milliseconds. Defaults to 30000 (30s).
|
|
2836
|
+
* * `service_name` - The service name for discovery (e.g., `localhost:8080`).
|
|
2837
|
+
* If omitted, the host is extracted from the URL.
|
|
2838
|
+
*
|
|
2839
|
+
* # Errors
|
|
2840
|
+
*
|
|
2841
|
+
* Returns an error if:
|
|
2842
|
+
* - The WebSocket connection could not be established
|
|
2843
|
+
* - The handshake fails (signature invalid, clock drift, etc.)
|
|
2844
|
+
* @param {URL} address
|
|
2845
|
+
* @param {any} signer
|
|
2846
|
+
* @param {number | null} [timeout_milliseconds]
|
|
2847
|
+
* @param {string | null} [service_name]
|
|
2848
|
+
* @returns {Promise<AuthenticatedWebSocket>}
|
|
2849
|
+
*/
|
|
2850
|
+
static tryDiscover(address, signer, timeout_milliseconds, service_name) {
|
|
2851
|
+
var ptr0 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2852
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2853
|
+
const ret = wasm.subductionwebsocket_tryDiscover(addHeapObject(address), addHeapObject(signer), isLikeNone(timeout_milliseconds) ? 4294967297 : timeout_milliseconds >>> 0, ptr0, len0);
|
|
2854
|
+
return takeObject(ret);
|
|
2855
|
+
}
|
|
2856
|
+
};
|
|
2857
|
+
if (Symbol.dispose) SubductionWebSocket.prototype[Symbol.dispose] = SubductionWebSocket.prototype.free;
|
|
2858
|
+
var SyncStats = class _SyncStats {
|
|
2859
|
+
static __wrap(ptr) {
|
|
2860
|
+
ptr = ptr >>> 0;
|
|
2861
|
+
const obj = Object.create(_SyncStats.prototype);
|
|
2862
|
+
obj.__wbg_ptr = ptr;
|
|
2863
|
+
SyncStatsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2864
|
+
return obj;
|
|
2865
|
+
}
|
|
2866
|
+
__destroy_into_raw() {
|
|
2867
|
+
const ptr = this.__wbg_ptr;
|
|
2868
|
+
this.__wbg_ptr = 0;
|
|
2869
|
+
SyncStatsFinalization.unregister(this);
|
|
2870
|
+
return ptr;
|
|
2871
|
+
}
|
|
2872
|
+
free() {
|
|
2873
|
+
const ptr = this.__destroy_into_raw();
|
|
2874
|
+
wasm.__wbg_syncstats_free(ptr, 0);
|
|
2875
|
+
}
|
|
2876
|
+
/**
|
|
2877
|
+
* Number of commits received from the peer.
|
|
2878
|
+
* @returns {number}
|
|
2879
|
+
*/
|
|
2880
|
+
get commitsReceived() {
|
|
2881
|
+
const ret = wasm.syncstats_commitsReceived(this.__wbg_ptr);
|
|
2882
|
+
return ret >>> 0;
|
|
2883
|
+
}
|
|
2884
|
+
/**
|
|
2885
|
+
* Number of commits successfully sent to the peer.
|
|
2886
|
+
* @returns {number}
|
|
2887
|
+
*/
|
|
2888
|
+
get commitsSent() {
|
|
2889
|
+
const ret = wasm.syncstats_commitsSent(this.__wbg_ptr);
|
|
2890
|
+
return ret >>> 0;
|
|
2891
|
+
}
|
|
2892
|
+
/**
|
|
2893
|
+
* Number of fragments received from the peer.
|
|
2894
|
+
* @returns {number}
|
|
2895
|
+
*/
|
|
2896
|
+
get fragmentsReceived() {
|
|
2897
|
+
const ret = wasm.syncstats_fragmentsReceived(this.__wbg_ptr);
|
|
2898
|
+
return ret >>> 0;
|
|
2899
|
+
}
|
|
2900
|
+
/**
|
|
2901
|
+
* Number of fragments successfully sent to the peer.
|
|
2902
|
+
* @returns {number}
|
|
2903
|
+
*/
|
|
2904
|
+
get fragmentsSent() {
|
|
2905
|
+
const ret = wasm.syncstats_fragmentsSent(this.__wbg_ptr);
|
|
2906
|
+
return ret >>> 0;
|
|
2907
|
+
}
|
|
2908
|
+
/**
|
|
2909
|
+
* Returns true if no data was exchanged.
|
|
2910
|
+
* @returns {boolean}
|
|
2911
|
+
*/
|
|
2912
|
+
get isEmpty() {
|
|
2913
|
+
const ret = wasm.syncstats_isEmpty(this.__wbg_ptr);
|
|
2914
|
+
return ret !== 0;
|
|
2915
|
+
}
|
|
2916
|
+
/**
|
|
2917
|
+
* Total items received (commits + fragments).
|
|
2918
|
+
* @returns {number}
|
|
2919
|
+
*/
|
|
2920
|
+
get totalReceived() {
|
|
2921
|
+
const ret = wasm.syncstats_totalReceived(this.__wbg_ptr);
|
|
2922
|
+
return ret >>> 0;
|
|
2923
|
+
}
|
|
2924
|
+
/**
|
|
2925
|
+
* Total items sent (commits + fragments).
|
|
2926
|
+
* @returns {number}
|
|
2927
|
+
*/
|
|
2928
|
+
get totalSent() {
|
|
2929
|
+
const ret = wasm.syncstats_totalSent(this.__wbg_ptr);
|
|
2930
|
+
return ret >>> 0;
|
|
2931
|
+
}
|
|
2932
|
+
};
|
|
2933
|
+
if (Symbol.dispose) SyncStats.prototype[Symbol.dispose] = SyncStats.prototype.free;
|
|
2934
|
+
var WebCryptoSigner = class _WebCryptoSigner {
|
|
2935
|
+
static __wrap(ptr) {
|
|
2936
|
+
ptr = ptr >>> 0;
|
|
2937
|
+
const obj = Object.create(_WebCryptoSigner.prototype);
|
|
2938
|
+
obj.__wbg_ptr = ptr;
|
|
2939
|
+
WebCryptoSignerFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2940
|
+
return obj;
|
|
2941
|
+
}
|
|
2942
|
+
__destroy_into_raw() {
|
|
2943
|
+
const ptr = this.__wbg_ptr;
|
|
2944
|
+
this.__wbg_ptr = 0;
|
|
2945
|
+
WebCryptoSignerFinalization.unregister(this);
|
|
2946
|
+
return ptr;
|
|
2947
|
+
}
|
|
2948
|
+
free() {
|
|
2949
|
+
const ptr = this.__destroy_into_raw();
|
|
2950
|
+
wasm.__wbg_webcryptosigner_free(ptr, 0);
|
|
2951
|
+
}
|
|
2952
|
+
/**
|
|
2953
|
+
* Get the peer ID derived from this signer's verifying key.
|
|
2954
|
+
*
|
|
2955
|
+
* # Panics
|
|
2956
|
+
*
|
|
2957
|
+
* Panics if the stored public key bytes are invalid (should never happen).
|
|
2958
|
+
* @returns {PeerId}
|
|
2959
|
+
*/
|
|
2960
|
+
peerId() {
|
|
2961
|
+
const ret = wasm.webcryptosigner_peerId(this.__wbg_ptr);
|
|
2962
|
+
return PeerId.__wrap(ret);
|
|
2963
|
+
}
|
|
2964
|
+
/**
|
|
2965
|
+
* Set up the signer, loading an existing key from `IndexedDB` or generating a new one.
|
|
2966
|
+
*
|
|
2967
|
+
* # Errors
|
|
2968
|
+
*
|
|
2969
|
+
* Returns an error if `WebCrypto` or `IndexedDB` operations fail.
|
|
2970
|
+
* @returns {Promise<WebCryptoSigner>}
|
|
2971
|
+
*/
|
|
2972
|
+
static setup() {
|
|
2973
|
+
const ret = wasm.webcryptosigner_setup();
|
|
2974
|
+
return takeObject(ret);
|
|
2975
|
+
}
|
|
2976
|
+
/**
|
|
2977
|
+
* Sign a message and return the 64-byte Ed25519 signature.
|
|
2978
|
+
*
|
|
2979
|
+
* # Errors
|
|
2980
|
+
*
|
|
2981
|
+
* Returns an error if `WebCrypto` signing fails.
|
|
2982
|
+
* @param {Uint8Array} message
|
|
2983
|
+
* @returns {Promise<Uint8Array>}
|
|
2984
|
+
*/
|
|
2985
|
+
sign(message) {
|
|
2986
|
+
const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_export);
|
|
2987
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2988
|
+
const ret = wasm.webcryptosigner_sign(this.__wbg_ptr, ptr0, len0);
|
|
2989
|
+
return takeObject(ret);
|
|
2990
|
+
}
|
|
2991
|
+
/**
|
|
2992
|
+
* Get the 32-byte Ed25519 verifying (public) key.
|
|
2993
|
+
* @returns {Uint8Array}
|
|
2994
|
+
*/
|
|
2995
|
+
verifyingKey() {
|
|
2996
|
+
const ret = wasm.webcryptosigner_verifyingKey(this.__wbg_ptr);
|
|
2997
|
+
return takeObject(ret);
|
|
2998
|
+
}
|
|
2999
|
+
};
|
|
3000
|
+
if (Symbol.dispose) WebCryptoSigner.prototype[Symbol.dispose] = WebCryptoSigner.prototype.free;
|
|
3001
|
+
function __wbg_get_imports() {
|
|
3002
|
+
const import0 = {
|
|
3003
|
+
__proto__: null,
|
|
3004
|
+
__wbg___wasm_refgen_toWasmCommitWithBlob_da516f4613a39b57: function(arg0) {
|
|
3005
|
+
const ret = getObject(arg0).__wasm_refgen_toWasmCommitWithBlob();
|
|
3006
|
+
_assertClass(ret, CommitWithBlob);
|
|
3007
|
+
var ptr1 = ret.__destroy_into_raw();
|
|
3008
|
+
return ptr1;
|
|
3009
|
+
},
|
|
3010
|
+
__wbg___wasm_refgen_toWasmDepth_ee4cad395c825171: function(arg0) {
|
|
3011
|
+
const ret = getObject(arg0).__wasm_refgen_toWasmDepth();
|
|
3012
|
+
_assertClass(ret, Depth);
|
|
3013
|
+
var ptr1 = ret.__destroy_into_raw();
|
|
3014
|
+
return ptr1;
|
|
3015
|
+
},
|
|
3016
|
+
__wbg___wasm_refgen_toWasmDigest_66d1df4db7cdd9a2: function(arg0) {
|
|
3017
|
+
const ret = getObject(arg0).__wasm_refgen_toWasmDigest();
|
|
3018
|
+
_assertClass(ret, Digest);
|
|
3019
|
+
var ptr1 = ret.__destroy_into_raw();
|
|
3020
|
+
return ptr1;
|
|
3021
|
+
},
|
|
3022
|
+
__wbg___wasm_refgen_toWasmFragmentWithBlob_5563b8007297efa7: function(arg0) {
|
|
3023
|
+
const ret = getObject(arg0).__wasm_refgen_toWasmFragmentWithBlob();
|
|
3024
|
+
_assertClass(ret, FragmentWithBlob);
|
|
3025
|
+
var ptr1 = ret.__destroy_into_raw();
|
|
3026
|
+
return ptr1;
|
|
3027
|
+
},
|
|
3028
|
+
__wbg___wasm_refgen_toWasmFragment_02267ee4c333bd43: function(arg0) {
|
|
3029
|
+
const ret = getObject(arg0).__wasm_refgen_toWasmFragment();
|
|
3030
|
+
_assertClass(ret, Fragment);
|
|
3031
|
+
var ptr1 = ret.__destroy_into_raw();
|
|
3032
|
+
return ptr1;
|
|
3033
|
+
},
|
|
3034
|
+
__wbg___wasm_refgen_toWasmLooseCommit_899ec4675da39a86: function(arg0) {
|
|
3035
|
+
const ret = getObject(arg0).__wasm_refgen_toWasmLooseCommit();
|
|
3036
|
+
_assertClass(ret, LooseCommit);
|
|
3037
|
+
var ptr1 = ret.__destroy_into_raw();
|
|
3038
|
+
return ptr1;
|
|
3039
|
+
},
|
|
3040
|
+
__wbg___wbindgen_debug_string_ddde1867f49c2442: function(arg0, arg1) {
|
|
3041
|
+
const ret = debugString(getObject(arg1));
|
|
3042
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3043
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3044
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3045
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3046
|
+
},
|
|
3047
|
+
__wbg___wbindgen_is_function_d633e708baf0d146: function(arg0) {
|
|
3048
|
+
const ret = typeof getObject(arg0) === "function";
|
|
3049
|
+
return ret;
|
|
3050
|
+
},
|
|
3051
|
+
__wbg___wbindgen_is_null_a2a19127c13e7126: function(arg0) {
|
|
3052
|
+
const ret = getObject(arg0) === null;
|
|
3053
|
+
return ret;
|
|
3054
|
+
},
|
|
3055
|
+
__wbg___wbindgen_is_object_4b3de556756ee8a8: function(arg0) {
|
|
3056
|
+
const val = getObject(arg0);
|
|
3057
|
+
const ret = typeof val === "object" && val !== null;
|
|
3058
|
+
return ret;
|
|
3059
|
+
},
|
|
3060
|
+
__wbg___wbindgen_is_string_7debe47dc1e045c2: function(arg0) {
|
|
3061
|
+
const ret = typeof getObject(arg0) === "string";
|
|
3062
|
+
return ret;
|
|
3063
|
+
},
|
|
3064
|
+
__wbg___wbindgen_is_undefined_c18285b9fc34cb7d: function(arg0) {
|
|
3065
|
+
const ret = getObject(arg0) === void 0;
|
|
3066
|
+
return ret;
|
|
3067
|
+
},
|
|
3068
|
+
__wbg___wbindgen_number_get_5854912275df1894: function(arg0, arg1) {
|
|
3069
|
+
const obj = getObject(arg1);
|
|
3070
|
+
const ret = typeof obj === "number" ? obj : void 0;
|
|
3071
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
3072
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
3073
|
+
},
|
|
3074
|
+
__wbg___wbindgen_throw_39bc967c0e5a9b58: function(arg0, arg1) {
|
|
3075
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
3076
|
+
},
|
|
3077
|
+
__wbg__wbg_cb_unref_b6d832240a919168: function(arg0) {
|
|
3078
|
+
getObject(arg0)._wbg_cb_unref();
|
|
3079
|
+
},
|
|
3080
|
+
__wbg_arrayBuffer_8fd4b7df096647f9: function() {
|
|
3081
|
+
return handleError(function(arg0) {
|
|
3082
|
+
const ret = getObject(arg0).arrayBuffer();
|
|
3083
|
+
return addHeapObject(ret);
|
|
3084
|
+
}, arguments);
|
|
3085
|
+
},
|
|
3086
|
+
__wbg_authenticatedlongpoll_new: function(arg0) {
|
|
3087
|
+
const ret = AuthenticatedLongPoll.__wrap(arg0);
|
|
3088
|
+
return addHeapObject(ret);
|
|
3089
|
+
},
|
|
3090
|
+
__wbg_authenticatedwebsocket_new: function(arg0) {
|
|
3091
|
+
const ret = AuthenticatedWebSocket.__wrap(arg0);
|
|
3092
|
+
return addHeapObject(ret);
|
|
3093
|
+
},
|
|
3094
|
+
__wbg_batchsyncresponse_new: function(arg0) {
|
|
3095
|
+
const ret = BatchSyncResponse.__wrap(arg0);
|
|
3096
|
+
return addHeapObject(ret);
|
|
3097
|
+
},
|
|
3098
|
+
__wbg_call_08ad0d89caa7cb79: function() {
|
|
3099
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
3100
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
3101
|
+
return addHeapObject(ret);
|
|
3102
|
+
}, arguments);
|
|
3103
|
+
},
|
|
3104
|
+
__wbg_call_73af281463ec8b58: function() {
|
|
3105
|
+
return handleError(function(arg0, arg1) {
|
|
3106
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
3107
|
+
return addHeapObject(ret);
|
|
3108
|
+
}, arguments);
|
|
3109
|
+
},
|
|
3110
|
+
__wbg_call_c974f0bf2231552e: function() {
|
|
3111
|
+
return handleError(function(arg0, arg1, arg2, arg3) {
|
|
3112
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
3113
|
+
return addHeapObject(ret);
|
|
3114
|
+
}, arguments);
|
|
3115
|
+
},
|
|
3116
|
+
__wbg_close_88d72cf512fed8bc: function(arg0) {
|
|
3117
|
+
getObject(arg0).close();
|
|
3118
|
+
},
|
|
3119
|
+
__wbg_commitwithblob_new: function(arg0) {
|
|
3120
|
+
const ret = CommitWithBlob.__wrap(arg0);
|
|
3121
|
+
return addHeapObject(ret);
|
|
3122
|
+
},
|
|
3123
|
+
__wbg_connerrorpair_new: function(arg0) {
|
|
3124
|
+
const ret = ConnErrorPair.__wrap(arg0);
|
|
3125
|
+
return addHeapObject(ret);
|
|
3126
|
+
},
|
|
3127
|
+
__wbg_contains_412524090060514f: function(arg0, arg1, arg2) {
|
|
3128
|
+
const ret = getObject(arg0).contains(getStringFromWasm0(arg1, arg2));
|
|
3129
|
+
return ret;
|
|
3130
|
+
},
|
|
3131
|
+
__wbg_createObjectStore_bfd875621f13f126: function() {
|
|
3132
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
3133
|
+
const ret = getObject(arg0).createObjectStore(getStringFromWasm0(arg1, arg2));
|
|
3134
|
+
return addHeapObject(ret);
|
|
3135
|
+
}, arguments);
|
|
3136
|
+
},
|
|
3137
|
+
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
3138
|
+
const ret = getObject(arg0).crypto;
|
|
3139
|
+
return addHeapObject(ret);
|
|
3140
|
+
},
|
|
3141
|
+
__wbg_data_826b7d645a40043f: function(arg0) {
|
|
3142
|
+
const ret = getObject(arg0).data;
|
|
3143
|
+
return addHeapObject(ret);
|
|
3144
|
+
},
|
|
3145
|
+
__wbg_deleteAllCommits_08122bac302f379f: function(arg0, arg1) {
|
|
3146
|
+
const ret = getObject(arg0).deleteAllCommits(getObject(arg1));
|
|
3147
|
+
return addHeapObject(ret);
|
|
3148
|
+
},
|
|
3149
|
+
__wbg_deleteAllFragments_442f1f1ee9cff06a: function(arg0, arg1) {
|
|
3150
|
+
const ret = getObject(arg0).deleteAllFragments(getObject(arg1));
|
|
3151
|
+
return addHeapObject(ret);
|
|
3152
|
+
},
|
|
3153
|
+
__wbg_digest_new: function(arg0) {
|
|
3154
|
+
const ret = Digest.__wrap(arg0);
|
|
3155
|
+
return addHeapObject(ret);
|
|
3156
|
+
},
|
|
3157
|
+
__wbg_digest_unwrap: function(arg0) {
|
|
3158
|
+
const ret = Digest.__unwrap(getObject(arg0));
|
|
3159
|
+
return ret;
|
|
3160
|
+
},
|
|
3161
|
+
__wbg_exportKey_d8f8486549147648: function() {
|
|
3162
|
+
return handleError(function(arg0, arg1, arg2, arg3) {
|
|
3163
|
+
const ret = getObject(arg0).exportKey(getStringFromWasm0(arg1, arg2), getObject(arg3));
|
|
3164
|
+
return addHeapObject(ret);
|
|
3165
|
+
}, arguments);
|
|
3166
|
+
},
|
|
3167
|
+
__wbg_fetch_3c1f541fa62e562d: function(arg0, arg1) {
|
|
3168
|
+
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
3169
|
+
return addHeapObject(ret);
|
|
3170
|
+
},
|
|
3171
|
+
__wbg_fetch_59df3bdc0a4c0e4b: function(arg0, arg1) {
|
|
3172
|
+
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
3173
|
+
return addHeapObject(ret);
|
|
3174
|
+
},
|
|
3175
|
+
__wbg_fragment_new: function(arg0) {
|
|
3176
|
+
const ret = Fragment.__wrap(arg0);
|
|
3177
|
+
return addHeapObject(ret);
|
|
3178
|
+
},
|
|
3179
|
+
__wbg_fragmentrequested_new: function(arg0) {
|
|
3180
|
+
const ret = FragmentRequested.__wrap(arg0);
|
|
3181
|
+
return addHeapObject(ret);
|
|
3182
|
+
},
|
|
3183
|
+
__wbg_fragmentwithblob_new: function(arg0) {
|
|
3184
|
+
const ret = FragmentWithBlob.__wrap(arg0);
|
|
3185
|
+
return addHeapObject(ret);
|
|
3186
|
+
},
|
|
3187
|
+
__wbg_from_d7e888a2e9063b32: function(arg0) {
|
|
3188
|
+
const ret = Array.from(getObject(arg0));
|
|
3189
|
+
return addHeapObject(ret);
|
|
3190
|
+
},
|
|
3191
|
+
__wbg_generateKey_3ad334ccb45181f1: function() {
|
|
3192
|
+
return handleError(function(arg0, arg1, arg2, arg3) {
|
|
3193
|
+
const ret = getObject(arg0).generateKey(getObject(arg1), arg2 !== 0, getObject(arg3));
|
|
3194
|
+
return addHeapObject(ret);
|
|
3195
|
+
}, arguments);
|
|
3196
|
+
},
|
|
3197
|
+
__wbg_getRandomValues_c44a50d8cfdaebeb: function() {
|
|
3198
|
+
return handleError(function(arg0, arg1) {
|
|
3199
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
3200
|
+
}, arguments);
|
|
3201
|
+
},
|
|
3202
|
+
__wbg_get_18349afdb36339a9: function() {
|
|
3203
|
+
return handleError(function(arg0, arg1) {
|
|
3204
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
3205
|
+
return addHeapObject(ret);
|
|
3206
|
+
}, arguments);
|
|
3207
|
+
},
|
|
3208
|
+
__wbg_get_791b26b41a7de3d5: function() {
|
|
3209
|
+
return handleError(function(arg0, arg1) {
|
|
3210
|
+
const ret = getObject(arg0).get(getObject(arg1));
|
|
3211
|
+
return addHeapObject(ret);
|
|
3212
|
+
}, arguments);
|
|
3213
|
+
},
|
|
3214
|
+
__wbg_get_f09c3a16f8848381: function(arg0, arg1) {
|
|
3215
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
3216
|
+
return addHeapObject(ret);
|
|
3217
|
+
},
|
|
3218
|
+
__wbg_get_fc68a746a75a3e9d: function() {
|
|
3219
|
+
return handleError(function(arg0, arg1, arg2, arg3) {
|
|
3220
|
+
const ret = getObject(arg1).get(getStringFromWasm0(arg2, arg3));
|
|
3221
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3222
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3223
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3224
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3225
|
+
}, arguments);
|
|
3226
|
+
},
|
|
3227
|
+
__wbg_headers_028b9b1c907f9362: function(arg0) {
|
|
3228
|
+
const ret = getObject(arg0).headers;
|
|
3229
|
+
return addHeapObject(ret);
|
|
3230
|
+
},
|
|
3231
|
+
__wbg_host_f6433f5f5f3a3eb4: function(arg0, arg1) {
|
|
3232
|
+
const ret = getObject(arg1).host;
|
|
3233
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3234
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3235
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3236
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3237
|
+
},
|
|
3238
|
+
__wbg_href_72623bc1de5c4cb5: function(arg0, arg1) {
|
|
3239
|
+
const ret = getObject(arg1).href;
|
|
3240
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3241
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3242
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3243
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3244
|
+
},
|
|
3245
|
+
__wbg_importKey_ac1d2e02c862b89b: function() {
|
|
3246
|
+
return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
3247
|
+
const ret = getObject(arg0).importKey(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4), arg5 !== 0, getObject(arg6));
|
|
3248
|
+
return addHeapObject(ret);
|
|
3249
|
+
}, arguments);
|
|
3250
|
+
},
|
|
3251
|
+
__wbg_instanceof_ArrayBuffer_15859862b80b732d: function(arg0) {
|
|
3252
|
+
let result;
|
|
3253
|
+
try {
|
|
3254
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
3255
|
+
} catch (_) {
|
|
3256
|
+
result = false;
|
|
3257
|
+
}
|
|
3258
|
+
const ret = result;
|
|
3259
|
+
return ret;
|
|
3260
|
+
},
|
|
3261
|
+
__wbg_instanceof_Crypto_31bafd3455a3b508: function(arg0) {
|
|
3262
|
+
let result;
|
|
3263
|
+
try {
|
|
3264
|
+
result = getObject(arg0) instanceof Crypto;
|
|
3265
|
+
} catch (_) {
|
|
3266
|
+
result = false;
|
|
3267
|
+
}
|
|
3268
|
+
const ret = result;
|
|
3269
|
+
return ret;
|
|
3270
|
+
},
|
|
3271
|
+
__wbg_instanceof_IdbDatabase_9f1f490b74b465ba: function(arg0) {
|
|
3272
|
+
let result;
|
|
3273
|
+
try {
|
|
3274
|
+
result = getObject(arg0) instanceof IDBDatabase;
|
|
3275
|
+
} catch (_) {
|
|
3276
|
+
result = false;
|
|
3277
|
+
}
|
|
3278
|
+
const ret = result;
|
|
3279
|
+
return ret;
|
|
3280
|
+
},
|
|
3281
|
+
__wbg_instanceof_IdbFactory_f448efd6949878d4: function(arg0) {
|
|
3282
|
+
let result;
|
|
3283
|
+
try {
|
|
3284
|
+
result = getObject(arg0) instanceof IDBFactory;
|
|
3285
|
+
} catch (_) {
|
|
3286
|
+
result = false;
|
|
3287
|
+
}
|
|
3288
|
+
const ret = result;
|
|
3289
|
+
return ret;
|
|
3290
|
+
},
|
|
3291
|
+
__wbg_instanceof_IdbOpenDbRequest_bc707ea112c6f917: function(arg0) {
|
|
3292
|
+
let result;
|
|
3293
|
+
try {
|
|
3294
|
+
result = getObject(arg0) instanceof IDBOpenDBRequest;
|
|
3295
|
+
} catch (_) {
|
|
3296
|
+
result = false;
|
|
3297
|
+
}
|
|
3298
|
+
const ret = result;
|
|
3299
|
+
return ret;
|
|
3300
|
+
},
|
|
3301
|
+
__wbg_instanceof_JsDepth_4051ca2508d01961: function(arg0) {
|
|
3302
|
+
let result;
|
|
3303
|
+
try {
|
|
3304
|
+
result = getObject(arg0) instanceof JsDepth;
|
|
3305
|
+
} catch (_) {
|
|
3306
|
+
result = false;
|
|
3307
|
+
}
|
|
3308
|
+
const ret = result;
|
|
3309
|
+
return ret;
|
|
3310
|
+
},
|
|
3311
|
+
__wbg_instanceof_Promise_44e4f673e91c710d: function(arg0) {
|
|
3312
|
+
let result;
|
|
3313
|
+
try {
|
|
3314
|
+
result = getObject(arg0) instanceof Promise;
|
|
3315
|
+
} catch (_) {
|
|
3316
|
+
result = false;
|
|
3317
|
+
}
|
|
3318
|
+
const ret = result;
|
|
3319
|
+
return ret;
|
|
3320
|
+
},
|
|
3321
|
+
__wbg_instanceof_Response_8ec0057b1e5c71bf: function(arg0) {
|
|
3322
|
+
let result;
|
|
3323
|
+
try {
|
|
3324
|
+
result = getObject(arg0) instanceof Response;
|
|
3325
|
+
} catch (_) {
|
|
3326
|
+
result = false;
|
|
3327
|
+
}
|
|
3328
|
+
const ret = result;
|
|
3329
|
+
return ret;
|
|
3330
|
+
},
|
|
3331
|
+
__wbg_instanceof_Window_4aba49e4d1a12365: function(arg0) {
|
|
3332
|
+
let result;
|
|
3333
|
+
try {
|
|
3334
|
+
result = getObject(arg0) instanceof Window;
|
|
3335
|
+
} catch (_) {
|
|
3336
|
+
result = false;
|
|
3337
|
+
}
|
|
3338
|
+
const ret = result;
|
|
3339
|
+
return ret;
|
|
3340
|
+
},
|
|
3341
|
+
__wbg_instanceof_WorkerGlobalScope_12b79fbd44254705: function(arg0) {
|
|
3342
|
+
let result;
|
|
3343
|
+
try {
|
|
3344
|
+
result = getObject(arg0) instanceof WorkerGlobalScope;
|
|
3345
|
+
} catch (_) {
|
|
3346
|
+
result = false;
|
|
3347
|
+
}
|
|
3348
|
+
const ret = result;
|
|
3349
|
+
return ret;
|
|
3350
|
+
},
|
|
3351
|
+
__wbg_isSafeInteger_10e4151eb694e42a: function(arg0) {
|
|
3352
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
3353
|
+
return ret;
|
|
3354
|
+
},
|
|
3355
|
+
__wbg_is_1ad0660d6042ae31: function(arg0, arg1) {
|
|
3356
|
+
const ret = Object.is(getObject(arg0), getObject(arg1));
|
|
3357
|
+
return ret;
|
|
3358
|
+
},
|
|
3359
|
+
__wbg_length_5855c1f289dfffc1: function(arg0) {
|
|
3360
|
+
const ret = getObject(arg0).length;
|
|
3361
|
+
return ret;
|
|
3362
|
+
},
|
|
3363
|
+
__wbg_length_a31e05262e09b7f8: function(arg0) {
|
|
3364
|
+
const ret = getObject(arg0).length;
|
|
3365
|
+
return ret;
|
|
3366
|
+
},
|
|
3367
|
+
__wbg_loadAllCommits_dfccdd45918469a3: function(arg0, arg1) {
|
|
3368
|
+
const ret = getObject(arg0).loadAllCommits(getObject(arg1));
|
|
3369
|
+
return addHeapObject(ret);
|
|
3370
|
+
},
|
|
3371
|
+
__wbg_loadAllFragments_d70484307b61371a: function(arg0, arg1) {
|
|
3372
|
+
const ret = getObject(arg0).loadAllFragments(getObject(arg1));
|
|
3373
|
+
return addHeapObject(ret);
|
|
3374
|
+
},
|
|
3375
|
+
__wbg_loadAllSedimentreeIds_38e22f908df2c6d1: function(arg0) {
|
|
3376
|
+
const ret = getObject(arg0).loadAllSedimentreeIds();
|
|
3377
|
+
return addHeapObject(ret);
|
|
3378
|
+
},
|
|
3379
|
+
__wbg_loosecommit_new: function(arg0) {
|
|
3380
|
+
const ret = LooseCommit.__wrap(arg0);
|
|
3381
|
+
return addHeapObject(ret);
|
|
3382
|
+
},
|
|
3383
|
+
__wbg_message_new: function(arg0) {
|
|
3384
|
+
const ret = Message.__wrap(arg0);
|
|
3385
|
+
return addHeapObject(ret);
|
|
3386
|
+
},
|
|
3387
|
+
__wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
|
|
3388
|
+
const ret = getObject(arg0).msCrypto;
|
|
3389
|
+
return addHeapObject(ret);
|
|
3390
|
+
},
|
|
3391
|
+
__wbg_new_0765f05b3e3b4625: function() {
|
|
3392
|
+
return handleError(function() {
|
|
3393
|
+
const ret = new Headers();
|
|
3394
|
+
return addHeapObject(ret);
|
|
3395
|
+
}, arguments);
|
|
3396
|
+
},
|
|
3397
|
+
__wbg_new_09959f7b4c92c246: function(arg0) {
|
|
3398
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
3399
|
+
return addHeapObject(ret);
|
|
3400
|
+
},
|
|
3401
|
+
__wbg_new_1213b57bccbdbb66: function(arg0, arg1) {
|
|
3402
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
3403
|
+
return addHeapObject(ret);
|
|
3404
|
+
},
|
|
3405
|
+
__wbg_new_79ce7968119cfd96: function(arg0, arg1) {
|
|
3406
|
+
try {
|
|
3407
|
+
var state0 = { a: arg0, b: arg1 };
|
|
3408
|
+
var cb0 = (arg02, arg12) => {
|
|
3409
|
+
const a = state0.a;
|
|
3410
|
+
state0.a = 0;
|
|
3411
|
+
try {
|
|
3412
|
+
return __wasm_bindgen_func_elem_5956(a, state0.b, arg02, arg12);
|
|
3413
|
+
} finally {
|
|
3414
|
+
state0.a = a;
|
|
3415
|
+
}
|
|
3416
|
+
};
|
|
3417
|
+
const ret = new Promise(cb0);
|
|
3418
|
+
return addHeapObject(ret);
|
|
3419
|
+
} finally {
|
|
3420
|
+
state0.a = state0.b = 0;
|
|
3421
|
+
}
|
|
3422
|
+
},
|
|
3423
|
+
__wbg_new_cbee8c0d5c479eac: function() {
|
|
3424
|
+
const ret = new Array();
|
|
3425
|
+
return addHeapObject(ret);
|
|
3426
|
+
},
|
|
3427
|
+
__wbg_new_ed69e637b553a997: function() {
|
|
3428
|
+
const ret = new Object();
|
|
3429
|
+
return addHeapObject(ret);
|
|
3430
|
+
},
|
|
3431
|
+
__wbg_new_fc4d5b17b0f1a4cb: function() {
|
|
3432
|
+
return handleError(function(arg0, arg1) {
|
|
3433
|
+
const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
|
|
3434
|
+
return addHeapObject(ret);
|
|
3435
|
+
}, arguments);
|
|
3436
|
+
},
|
|
3437
|
+
__wbg_new_from_slice_d7e202fdbee3c396: function(arg0, arg1) {
|
|
3438
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
3439
|
+
return addHeapObject(ret);
|
|
3440
|
+
},
|
|
3441
|
+
__wbg_new_typed_8258a0d8488ef2a2: function(arg0, arg1) {
|
|
3442
|
+
try {
|
|
3443
|
+
var state0 = { a: arg0, b: arg1 };
|
|
3444
|
+
var cb0 = (arg02, arg12) => {
|
|
3445
|
+
const a = state0.a;
|
|
3446
|
+
state0.a = 0;
|
|
3447
|
+
try {
|
|
3448
|
+
return __wasm_bindgen_func_elem_5956(a, state0.b, arg02, arg12);
|
|
3449
|
+
} finally {
|
|
3450
|
+
state0.a = a;
|
|
3451
|
+
}
|
|
3452
|
+
};
|
|
3453
|
+
const ret = new Promise(cb0);
|
|
3454
|
+
return addHeapObject(ret);
|
|
3455
|
+
} finally {
|
|
3456
|
+
state0.a = state0.b = 0;
|
|
3457
|
+
}
|
|
3458
|
+
},
|
|
3459
|
+
__wbg_new_with_length_c8449d782396d344: function(arg0) {
|
|
3460
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
3461
|
+
return addHeapObject(ret);
|
|
3462
|
+
},
|
|
3463
|
+
__wbg_new_with_str_and_init_5fdb105df3907de1: function() {
|
|
3464
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
3465
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
3466
|
+
return addHeapObject(ret);
|
|
3467
|
+
}, arguments);
|
|
3468
|
+
},
|
|
3469
|
+
__wbg_node_84ea875411254db1: function(arg0) {
|
|
3470
|
+
const ret = getObject(arg0).node;
|
|
3471
|
+
return addHeapObject(ret);
|
|
3472
|
+
},
|
|
3473
|
+
__wbg_now_edd718b3004d8631: function() {
|
|
3474
|
+
const ret = Date.now();
|
|
3475
|
+
return ret;
|
|
3476
|
+
},
|
|
3477
|
+
__wbg_objectStoreNames_3645b6da2d1f3852: function(arg0) {
|
|
3478
|
+
const ret = getObject(arg0).objectStoreNames;
|
|
3479
|
+
return addHeapObject(ret);
|
|
3480
|
+
},
|
|
3481
|
+
__wbg_objectStore_3a6b969b917c6262: function() {
|
|
3482
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
3483
|
+
const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
|
|
3484
|
+
return addHeapObject(ret);
|
|
3485
|
+
}, arguments);
|
|
3486
|
+
},
|
|
3487
|
+
__wbg_of_25a3bcb86f9d51ab: function(arg0) {
|
|
3488
|
+
const ret = Array.of(getObject(arg0));
|
|
3489
|
+
return addHeapObject(ret);
|
|
3490
|
+
},
|
|
3491
|
+
__wbg_of_d3b315af6d5ecc2a: function(arg0, arg1) {
|
|
3492
|
+
const ret = Array.of(getObject(arg0), getObject(arg1));
|
|
3493
|
+
return addHeapObject(ret);
|
|
3494
|
+
},
|
|
3495
|
+
__wbg_onmessage_d350391ecfb5652a: function(arg0) {
|
|
3496
|
+
const ret = getObject(arg0).onmessage;
|
|
3497
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
3498
|
+
},
|
|
3499
|
+
__wbg_open_9badd3c8846fbf11: function() {
|
|
3500
|
+
return handleError(function(arg0, arg1, arg2, arg3) {
|
|
3501
|
+
const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
|
|
3502
|
+
return addHeapObject(ret);
|
|
3503
|
+
}, arguments);
|
|
3504
|
+
},
|
|
3505
|
+
__wbg_peerbatchsyncresult_new: function(arg0) {
|
|
3506
|
+
const ret = PeerBatchSyncResult.__wrap(arg0);
|
|
3507
|
+
return addHeapObject(ret);
|
|
3508
|
+
},
|
|
3509
|
+
__wbg_peerid_new: function(arg0) {
|
|
3510
|
+
const ret = PeerId.__wrap(arg0);
|
|
3511
|
+
return addHeapObject(ret);
|
|
3512
|
+
},
|
|
3513
|
+
__wbg_peerresultmap_new: function(arg0) {
|
|
3514
|
+
const ret = PeerResultMap.__wrap(arg0);
|
|
3515
|
+
return addHeapObject(ret);
|
|
3516
|
+
},
|
|
3517
|
+
__wbg_process_44c7a14e11e9f69e: function(arg0) {
|
|
3518
|
+
const ret = getObject(arg0).process;
|
|
3519
|
+
return addHeapObject(ret);
|
|
3520
|
+
},
|
|
3521
|
+
__wbg_prototypesetcall_f034d444741426c3: function(arg0, arg1, arg2) {
|
|
3522
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
3523
|
+
},
|
|
3524
|
+
__wbg_push_a6f9488ffd3fae3b: function(arg0, arg1) {
|
|
3525
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
3526
|
+
return ret;
|
|
3527
|
+
},
|
|
3528
|
+
__wbg_put_d86a6833e14a4c3b: function() {
|
|
3529
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
3530
|
+
const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
|
|
3531
|
+
return addHeapObject(ret);
|
|
3532
|
+
}, arguments);
|
|
3533
|
+
},
|
|
3534
|
+
__wbg_queueMicrotask_2c8dfd1056f24fdc: function(arg0) {
|
|
3535
|
+
const ret = getObject(arg0).queueMicrotask;
|
|
3536
|
+
return addHeapObject(ret);
|
|
3537
|
+
},
|
|
3538
|
+
__wbg_queueMicrotask_8985ad63815852e7: function(arg0) {
|
|
3539
|
+
queueMicrotask(getObject(arg0));
|
|
3540
|
+
},
|
|
3541
|
+
__wbg_randomFillSync_6c25eac9869eb53c: function() {
|
|
3542
|
+
return handleError(function(arg0, arg1) {
|
|
3543
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
3544
|
+
}, arguments);
|
|
3545
|
+
},
|
|
3546
|
+
__wbg_readyState_66d6203f2fbfd533: function(arg0) {
|
|
3547
|
+
const ret = getObject(arg0).readyState;
|
|
3548
|
+
return ret;
|
|
3549
|
+
},
|
|
3550
|
+
__wbg_requestid_new: function(arg0) {
|
|
3551
|
+
const ret = RequestId.__wrap(arg0);
|
|
3552
|
+
return addHeapObject(ret);
|
|
3553
|
+
},
|
|
3554
|
+
__wbg_require_b4edbdcf3e2a1ef0: function() {
|
|
3555
|
+
return handleError(function() {
|
|
3556
|
+
const ret = module.require;
|
|
3557
|
+
return addHeapObject(ret);
|
|
3558
|
+
}, arguments);
|
|
3559
|
+
},
|
|
3560
|
+
__wbg_resolve_5d61e0d10c14730a: function(arg0) {
|
|
3561
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
3562
|
+
return addHeapObject(ret);
|
|
3563
|
+
},
|
|
3564
|
+
__wbg_result_aaba1e6bbc5d42c8: function() {
|
|
3565
|
+
return handleError(function(arg0) {
|
|
3566
|
+
const ret = getObject(arg0).result;
|
|
3567
|
+
return addHeapObject(ret);
|
|
3568
|
+
}, arguments);
|
|
3569
|
+
},
|
|
3570
|
+
__wbg_saveCommit_d7a8daf852b67448: function(arg0, arg1, arg2, arg3, arg4) {
|
|
3571
|
+
const ret = getObject(arg0).saveCommit(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
|
|
3572
|
+
return addHeapObject(ret);
|
|
3573
|
+
},
|
|
3574
|
+
__wbg_saveFragment_386a96a2400bfc01: function(arg0, arg1, arg2, arg3, arg4) {
|
|
3575
|
+
const ret = getObject(arg0).saveFragment(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
|
|
3576
|
+
return addHeapObject(ret);
|
|
3577
|
+
},
|
|
3578
|
+
__wbg_saveSedimentreeId_e9bc6683117677fb: function(arg0, arg1) {
|
|
3579
|
+
const ret = getObject(arg0).saveSedimentreeId(getObject(arg1));
|
|
3580
|
+
return addHeapObject(ret);
|
|
3581
|
+
},
|
|
3582
|
+
__wbg_sedimentreeid_new: function(arg0) {
|
|
3583
|
+
const ret = SedimentreeId.__wrap(arg0);
|
|
3584
|
+
return addHeapObject(ret);
|
|
3585
|
+
},
|
|
3586
|
+
__wbg_sedimentreeid_unwrap: function(arg0) {
|
|
3587
|
+
const ret = SedimentreeId.__unwrap(getObject(arg0));
|
|
3588
|
+
return ret;
|
|
3589
|
+
},
|
|
3590
|
+
__wbg_send_b7d2dc9c231d3eb3: function() {
|
|
3591
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
3592
|
+
getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2));
|
|
3593
|
+
}, arguments);
|
|
3594
|
+
},
|
|
3595
|
+
__wbg_set_77cf5fbc40154bdb: function() {
|
|
3596
|
+
return handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
|
3597
|
+
getObject(arg0).set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
3598
|
+
}, arguments);
|
|
3599
|
+
},
|
|
3600
|
+
__wbg_set_bad5c505cc70b5f8: function() {
|
|
3601
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
3602
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
3603
|
+
return ret;
|
|
3604
|
+
}, arguments);
|
|
3605
|
+
},
|
|
3606
|
+
__wbg_set_binaryType_ee9186e9e9c98376: function(arg0, arg1) {
|
|
3607
|
+
getObject(arg0).binaryType = __wbindgen_enum_BinaryType[arg1];
|
|
3608
|
+
},
|
|
3609
|
+
__wbg_set_body_cced363f7703790d: function(arg0, arg1) {
|
|
3610
|
+
getObject(arg0).body = getObject(arg1);
|
|
3611
|
+
},
|
|
3612
|
+
__wbg_set_headers_9144e2163352af57: function(arg0, arg1) {
|
|
3613
|
+
getObject(arg0).headers = getObject(arg1);
|
|
3614
|
+
},
|
|
3615
|
+
__wbg_set_method_c1be4686b152fe29: function(arg0, arg1, arg2) {
|
|
3616
|
+
getObject(arg0).method = getStringFromWasm0(arg1, arg2);
|
|
3617
|
+
},
|
|
3618
|
+
__wbg_set_mode_13fad253f291265c: function(arg0, arg1) {
|
|
3619
|
+
getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
|
|
3620
|
+
},
|
|
3621
|
+
__wbg_set_name_1965d19c3010e94a: function(arg0, arg1, arg2) {
|
|
3622
|
+
getObject(arg0).name = getStringFromWasm0(arg1, arg2);
|
|
3623
|
+
},
|
|
3624
|
+
__wbg_set_onclose_9e7a850dd4c00263: function(arg0, arg1) {
|
|
3625
|
+
getObject(arg0).onclose = getObject(arg1);
|
|
3626
|
+
},
|
|
3627
|
+
__wbg_set_onerror_00bcdee7bf806a30: function(arg0, arg1) {
|
|
3628
|
+
getObject(arg0).onerror = getObject(arg1);
|
|
3629
|
+
},
|
|
3630
|
+
__wbg_set_onerror_8b43a0b08de76f6d: function(arg0, arg1) {
|
|
3631
|
+
getObject(arg0).onerror = getObject(arg1);
|
|
3632
|
+
},
|
|
3633
|
+
__wbg_set_onmessage_3579a04e3b06c86a: function(arg0, arg1) {
|
|
3634
|
+
getObject(arg0).onmessage = getObject(arg1);
|
|
3635
|
+
},
|
|
3636
|
+
__wbg_set_onopen_60d5c65fa1d328c9: function(arg0, arg1) {
|
|
3637
|
+
getObject(arg0).onopen = getObject(arg1);
|
|
3638
|
+
},
|
|
3639
|
+
__wbg_set_onsuccess_76214f5146684855: function(arg0, arg1) {
|
|
3640
|
+
getObject(arg0).onsuccess = getObject(arg1);
|
|
3641
|
+
},
|
|
3642
|
+
__wbg_set_onupgradeneeded_74f1c8e9dbd2b70c: function(arg0, arg1) {
|
|
3643
|
+
getObject(arg0).onupgradeneeded = getObject(arg1);
|
|
3644
|
+
},
|
|
3645
|
+
__wbg_sign_39441a404dcdb16a: function() {
|
|
3646
|
+
return handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
|
3647
|
+
const ret = getObject(arg0).sign(getObject(arg1), getObject(arg2), getArrayU8FromWasm0(arg3, arg4));
|
|
3648
|
+
return addHeapObject(ret);
|
|
3649
|
+
}, arguments);
|
|
3650
|
+
},
|
|
3651
|
+
__wbg_sign_af285df6f98c87a6: function(arg0, arg1) {
|
|
3652
|
+
const ret = getObject(arg0).sign(takeObject(arg1));
|
|
3653
|
+
return addHeapObject(ret);
|
|
3654
|
+
},
|
|
3655
|
+
__wbg_signedfragment_new: function(arg0) {
|
|
3656
|
+
const ret = SignedFragment.__wrap(arg0);
|
|
3657
|
+
return addHeapObject(ret);
|
|
3658
|
+
},
|
|
3659
|
+
__wbg_signedloosecommit_new: function(arg0) {
|
|
3660
|
+
const ret = SignedLooseCommit.__wrap(arg0);
|
|
3661
|
+
return addHeapObject(ret);
|
|
3662
|
+
},
|
|
3663
|
+
__wbg_static_accessor_GLOBAL_THIS_14325d8cca34bb77: function() {
|
|
3664
|
+
const ret = typeof globalThis === "undefined" ? null : globalThis;
|
|
3665
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
3666
|
+
},
|
|
3667
|
+
__wbg_static_accessor_GLOBAL_f3a1e69f9c5a7e8e: function() {
|
|
3668
|
+
const ret = typeof global === "undefined" ? null : global;
|
|
3669
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
3670
|
+
},
|
|
3671
|
+
__wbg_static_accessor_SELF_50cdb5b517789aca: function() {
|
|
3672
|
+
const ret = typeof self === "undefined" ? null : self;
|
|
3673
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
3674
|
+
},
|
|
3675
|
+
__wbg_static_accessor_WINDOW_d6c4126e4c244380: function() {
|
|
3676
|
+
const ret = typeof window === "undefined" ? null : window;
|
|
3677
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
3678
|
+
},
|
|
3679
|
+
__wbg_status_acf2080bc55aa324: function(arg0) {
|
|
3680
|
+
const ret = getObject(arg0).status;
|
|
3681
|
+
return ret;
|
|
3682
|
+
},
|
|
3683
|
+
__wbg_subarray_7ad5f01d4a9c1c4d: function(arg0, arg1, arg2) {
|
|
3684
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
3685
|
+
return addHeapObject(ret);
|
|
3686
|
+
},
|
|
3687
|
+
__wbg_subduction_new: function(arg0) {
|
|
3688
|
+
const ret = Subduction.__wrap(arg0);
|
|
3689
|
+
return addHeapObject(ret);
|
|
3690
|
+
},
|
|
3691
|
+
__wbg_subductionlongpollconnection_new: function(arg0) {
|
|
3692
|
+
const ret = SubductionLongPollConnection.__wrap(arg0);
|
|
3693
|
+
return addHeapObject(ret);
|
|
3694
|
+
},
|
|
3695
|
+
__wbg_subductionwebsocket_new: function(arg0) {
|
|
3696
|
+
const ret = SubductionWebSocket.__wrap(arg0);
|
|
3697
|
+
return addHeapObject(ret);
|
|
3698
|
+
},
|
|
3699
|
+
__wbg_subtle_27cb8bee5d13f00f: function(arg0) {
|
|
3700
|
+
const ret = getObject(arg0).subtle;
|
|
3701
|
+
return addHeapObject(ret);
|
|
3702
|
+
},
|
|
3703
|
+
__wbg_target_adcfd1353c3de078: function(arg0) {
|
|
3704
|
+
const ret = getObject(arg0).target;
|
|
3705
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
3706
|
+
},
|
|
3707
|
+
__wbg_then_d4163530723f56f4: function(arg0, arg1, arg2) {
|
|
3708
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
3709
|
+
return addHeapObject(ret);
|
|
3710
|
+
},
|
|
3711
|
+
__wbg_then_f1c954fe00733701: function(arg0, arg1) {
|
|
3712
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
3713
|
+
return addHeapObject(ret);
|
|
3714
|
+
},
|
|
3715
|
+
__wbg_transaction_8555c5d00a94c767: function() {
|
|
3716
|
+
return handleError(function(arg0, arg1, arg2, arg3) {
|
|
3717
|
+
const ret = getObject(arg0).transaction(getStringFromWasm0(arg1, arg2), __wbindgen_enum_IdbTransactionMode[arg3]);
|
|
3718
|
+
return addHeapObject(ret);
|
|
3719
|
+
}, arguments);
|
|
3720
|
+
},
|
|
3721
|
+
__wbg_transaction_f90e157c0cdb0001: function() {
|
|
3722
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
3723
|
+
const ret = getObject(arg0).transaction(getStringFromWasm0(arg1, arg2));
|
|
3724
|
+
return addHeapObject(ret);
|
|
3725
|
+
}, arguments);
|
|
3726
|
+
},
|
|
3727
|
+
__wbg_tryIntoJsSedimentreeIdsArray_f012c6bad5612aef: function() {
|
|
3728
|
+
return handleError(function(arg0, arg1) {
|
|
3729
|
+
const ret = tryIntoJsSedimentreeIdsArray(getObject(arg1));
|
|
3730
|
+
const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_export);
|
|
3731
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3732
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3733
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3734
|
+
}, arguments);
|
|
3735
|
+
},
|
|
3736
|
+
__wbg_verifyingKey_aab82f75b82f977c: function(arg0) {
|
|
3737
|
+
const ret = getObject(arg0).verifyingKey();
|
|
3738
|
+
return addHeapObject(ret);
|
|
3739
|
+
},
|
|
3740
|
+
__wbg_versions_276b2795b1c6a219: function(arg0) {
|
|
3741
|
+
const ret = getObject(arg0).versions;
|
|
3742
|
+
return addHeapObject(ret);
|
|
3743
|
+
},
|
|
3744
|
+
__wbg_webcryptosigner_new: function(arg0) {
|
|
3745
|
+
const ret = WebCryptoSigner.__wrap(arg0);
|
|
3746
|
+
return addHeapObject(ret);
|
|
3747
|
+
},
|
|
3748
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
3749
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_187, __wasm_bindgen_func_elem_898);
|
|
3750
|
+
return addHeapObject(ret);
|
|
3751
|
+
},
|
|
3752
|
+
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
3753
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_187, __wasm_bindgen_func_elem_898);
|
|
3754
|
+
return addHeapObject(ret);
|
|
3755
|
+
},
|
|
3756
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
3757
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_187, __wasm_bindgen_func_elem_898);
|
|
3758
|
+
return addHeapObject(ret);
|
|
3759
|
+
},
|
|
3760
|
+
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
3761
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_187, __wasm_bindgen_func_elem_897);
|
|
3762
|
+
return addHeapObject(ret);
|
|
3763
|
+
},
|
|
3764
|
+
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
3765
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_3965, __wasm_bindgen_func_elem_5951);
|
|
3766
|
+
return addHeapObject(ret);
|
|
3767
|
+
},
|
|
3768
|
+
__wbindgen_cast_0000000000000006: function(arg0) {
|
|
3769
|
+
const ret = arg0;
|
|
3770
|
+
return addHeapObject(ret);
|
|
3771
|
+
},
|
|
3772
|
+
__wbindgen_cast_0000000000000007: function(arg0, arg1) {
|
|
3773
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
3774
|
+
return addHeapObject(ret);
|
|
3775
|
+
},
|
|
3776
|
+
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
3777
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
3778
|
+
return addHeapObject(ret);
|
|
3779
|
+
},
|
|
3780
|
+
__wbindgen_cast_0000000000000009: function(arg0, arg1) {
|
|
3781
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
3782
|
+
wasm.__wbindgen_export4(arg0, arg1 * 4, 4);
|
|
3783
|
+
const ret = v0;
|
|
3784
|
+
return addHeapObject(ret);
|
|
3785
|
+
},
|
|
3786
|
+
__wbindgen_cast_000000000000000a: function(arg0, arg1) {
|
|
3787
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
3788
|
+
wasm.__wbindgen_export4(arg0, arg1 * 4, 4);
|
|
3789
|
+
const ret = v0;
|
|
3790
|
+
return addHeapObject(ret);
|
|
3791
|
+
},
|
|
3792
|
+
__wbindgen_cast_000000000000000b: function(arg0, arg1) {
|
|
3793
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
3794
|
+
wasm.__wbindgen_export4(arg0, arg1 * 4, 4);
|
|
3795
|
+
const ret = v0;
|
|
3796
|
+
return addHeapObject(ret);
|
|
3797
|
+
},
|
|
3798
|
+
__wbindgen_cast_000000000000000c: function(arg0, arg1) {
|
|
3799
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
3800
|
+
wasm.__wbindgen_export4(arg0, arg1 * 4, 4);
|
|
3801
|
+
const ret = v0;
|
|
3802
|
+
return addHeapObject(ret);
|
|
3803
|
+
},
|
|
3804
|
+
__wbindgen_cast_000000000000000d: function(arg0, arg1) {
|
|
3805
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
3806
|
+
wasm.__wbindgen_export4(arg0, arg1 * 4, 4);
|
|
3807
|
+
const ret = v0;
|
|
3808
|
+
return addHeapObject(ret);
|
|
3809
|
+
},
|
|
3810
|
+
__wbindgen_object_clone_ref: function(arg0) {
|
|
3811
|
+
const ret = getObject(arg0);
|
|
3812
|
+
return addHeapObject(ret);
|
|
3813
|
+
},
|
|
3814
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
3815
|
+
takeObject(arg0);
|
|
3816
|
+
}
|
|
3817
|
+
};
|
|
3818
|
+
return {
|
|
3819
|
+
__proto__: null,
|
|
3820
|
+
"./subduction_wasm_bg.js": import0
|
|
3821
|
+
};
|
|
3822
|
+
}
|
|
3823
|
+
function __wasm_bindgen_func_elem_897(arg0, arg1) {
|
|
3824
|
+
wasm.__wasm_bindgen_func_elem_897(arg0, arg1);
|
|
3825
|
+
}
|
|
3826
|
+
function __wasm_bindgen_func_elem_898(arg0, arg1, arg2) {
|
|
3827
|
+
wasm.__wasm_bindgen_func_elem_898(arg0, arg1, addHeapObject(arg2));
|
|
3828
|
+
}
|
|
3829
|
+
function __wasm_bindgen_func_elem_5951(arg0, arg1, arg2) {
|
|
3830
|
+
try {
|
|
3831
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3832
|
+
wasm.__wasm_bindgen_func_elem_5951(retptr, arg0, arg1, addHeapObject(arg2));
|
|
3833
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3834
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3835
|
+
if (r1) {
|
|
3836
|
+
throw takeObject(r0);
|
|
3837
|
+
}
|
|
3838
|
+
} finally {
|
|
3839
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3840
|
+
}
|
|
3841
|
+
}
|
|
3842
|
+
function __wasm_bindgen_func_elem_5956(arg0, arg1, arg2, arg3) {
|
|
3843
|
+
wasm.__wasm_bindgen_func_elem_5956(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
3844
|
+
}
|
|
3845
|
+
var __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
3846
|
+
var __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"];
|
|
3847
|
+
var __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
3848
|
+
var AuthenticatedLongPollFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3849
|
+
}, unregister: () => {
|
|
3850
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_authenticatedlongpoll_free(ptr >>> 0, 1));
|
|
3851
|
+
var AuthenticatedWebSocketFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3852
|
+
}, unregister: () => {
|
|
3853
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_authenticatedwebsocket_free(ptr >>> 0, 1));
|
|
3854
|
+
var BatchSyncRequestFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3855
|
+
}, unregister: () => {
|
|
3856
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_batchsyncrequest_free(ptr >>> 0, 1));
|
|
3857
|
+
var BatchSyncResponseFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3858
|
+
}, unregister: () => {
|
|
3859
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_batchsyncresponse_free(ptr >>> 0, 1));
|
|
3860
|
+
var BlobMetaFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3861
|
+
}, unregister: () => {
|
|
3862
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_blobmeta_free(ptr >>> 0, 1));
|
|
3863
|
+
var CallErrorFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3864
|
+
}, unregister: () => {
|
|
3865
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_callerror_free(ptr >>> 0, 1));
|
|
3866
|
+
var CommitWithBlobFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3867
|
+
}, unregister: () => {
|
|
3868
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_commitwithblob_free(ptr >>> 0, 1));
|
|
3869
|
+
var ConnErrorPairFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3870
|
+
}, unregister: () => {
|
|
3871
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_connerrorpair_free(ptr >>> 0, 1));
|
|
3872
|
+
var ConnectionIdFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3873
|
+
}, unregister: () => {
|
|
3874
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_connectionid_free(ptr >>> 0, 1));
|
|
3875
|
+
var DepthFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3876
|
+
}, unregister: () => {
|
|
3877
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_depth_free(ptr >>> 0, 1));
|
|
3878
|
+
var DigestFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3879
|
+
}, unregister: () => {
|
|
3880
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_digest_free(ptr >>> 0, 1));
|
|
3881
|
+
var FragmentFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3882
|
+
}, unregister: () => {
|
|
3883
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_fragment_free(ptr >>> 0, 1));
|
|
3884
|
+
var FragmentRequestedFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3885
|
+
}, unregister: () => {
|
|
3886
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_fragmentrequested_free(ptr >>> 0, 1));
|
|
3887
|
+
var FragmentWithBlobFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3888
|
+
}, unregister: () => {
|
|
3889
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_fragmentwithblob_free(ptr >>> 0, 1));
|
|
3890
|
+
var FragmentsArrayFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3891
|
+
}, unregister: () => {
|
|
3892
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_fragmentsarray_free(ptr >>> 0, 1));
|
|
3893
|
+
var HashMetricFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3894
|
+
}, unregister: () => {
|
|
3895
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_hashmetric_free(ptr >>> 0, 1));
|
|
3896
|
+
var LooseCommitFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3897
|
+
}, unregister: () => {
|
|
3898
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_loosecommit_free(ptr >>> 0, 1));
|
|
3899
|
+
var MemoryStorageFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3900
|
+
}, unregister: () => {
|
|
3901
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_memorystorage_free(ptr >>> 0, 1));
|
|
3902
|
+
var MessageFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3903
|
+
}, unregister: () => {
|
|
3904
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_message_free(ptr >>> 0, 1));
|
|
3905
|
+
var NonceFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3906
|
+
}, unregister: () => {
|
|
3907
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_nonce_free(ptr >>> 0, 1));
|
|
3908
|
+
var PeerBatchSyncResultFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3909
|
+
}, unregister: () => {
|
|
3910
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_peerbatchsyncresult_free(ptr >>> 0, 1));
|
|
3911
|
+
var PeerIdFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3912
|
+
}, unregister: () => {
|
|
3913
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_peerid_free(ptr >>> 0, 1));
|
|
3914
|
+
var PeerResultMapFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3915
|
+
}, unregister: () => {
|
|
3916
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_peerresultmap_free(ptr >>> 0, 1));
|
|
3917
|
+
var RequestIdFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3918
|
+
}, unregister: () => {
|
|
3919
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_requestid_free(ptr >>> 0, 1));
|
|
3920
|
+
var SedimentreeFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3921
|
+
}, unregister: () => {
|
|
3922
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_sedimentree_free(ptr >>> 0, 1));
|
|
3923
|
+
var SedimentreeIdFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3924
|
+
}, unregister: () => {
|
|
3925
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_sedimentreeid_free(ptr >>> 0, 1));
|
|
3926
|
+
var SedimentreeIdsArrayFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3927
|
+
}, unregister: () => {
|
|
3928
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_sedimentreeidsarray_free(ptr >>> 0, 1));
|
|
3929
|
+
var SignedFragmentFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3930
|
+
}, unregister: () => {
|
|
3931
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_signedfragment_free(ptr >>> 0, 1));
|
|
3932
|
+
var SignedLooseCommitFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3933
|
+
}, unregister: () => {
|
|
3934
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_signedloosecommit_free(ptr >>> 0, 1));
|
|
3935
|
+
var SubductionFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3936
|
+
}, unregister: () => {
|
|
3937
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_subduction_free(ptr >>> 0, 1));
|
|
3938
|
+
var SubductionLongPollFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3939
|
+
}, unregister: () => {
|
|
3940
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_subductionlongpoll_free(ptr >>> 0, 1));
|
|
3941
|
+
var SubductionLongPollConnectionFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3942
|
+
}, unregister: () => {
|
|
3943
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_subductionlongpollconnection_free(ptr >>> 0, 1));
|
|
3944
|
+
var SubductionWebSocketFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3945
|
+
}, unregister: () => {
|
|
3946
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_subductionwebsocket_free(ptr >>> 0, 1));
|
|
3947
|
+
var SyncStatsFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3948
|
+
}, unregister: () => {
|
|
3949
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_syncstats_free(ptr >>> 0, 1));
|
|
3950
|
+
var WebCryptoSignerFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3951
|
+
}, unregister: () => {
|
|
3952
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_webcryptosigner_free(ptr >>> 0, 1));
|
|
3953
|
+
function addHeapObject(obj) {
|
|
3954
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
3955
|
+
const idx = heap_next;
|
|
3956
|
+
heap_next = heap[idx];
|
|
3957
|
+
heap[idx] = obj;
|
|
3958
|
+
return idx;
|
|
3959
|
+
}
|
|
3960
|
+
function _assertClass(instance, klass) {
|
|
3961
|
+
if (!(instance instanceof klass)) {
|
|
3962
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
3963
|
+
}
|
|
3964
|
+
}
|
|
3965
|
+
function addBorrowedObject(obj) {
|
|
3966
|
+
if (stack_pointer == 1) throw new Error("out of js stack");
|
|
3967
|
+
heap[--stack_pointer] = obj;
|
|
3968
|
+
return stack_pointer;
|
|
3969
|
+
}
|
|
3970
|
+
var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
3971
|
+
}, unregister: () => {
|
|
3972
|
+
} } : new FinalizationRegistry((state) => state.dtor(state.a, state.b));
|
|
3973
|
+
function debugString(val) {
|
|
3974
|
+
const type = typeof val;
|
|
3975
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
3976
|
+
return `${val}`;
|
|
3977
|
+
}
|
|
3978
|
+
if (type == "string") {
|
|
3979
|
+
return `"${val}"`;
|
|
3980
|
+
}
|
|
3981
|
+
if (type == "symbol") {
|
|
3982
|
+
const description = val.description;
|
|
3983
|
+
if (description == null) {
|
|
3984
|
+
return "Symbol";
|
|
3985
|
+
} else {
|
|
3986
|
+
return `Symbol(${description})`;
|
|
3987
|
+
}
|
|
3988
|
+
}
|
|
3989
|
+
if (type == "function") {
|
|
3990
|
+
const name = val.name;
|
|
3991
|
+
if (typeof name == "string" && name.length > 0) {
|
|
3992
|
+
return `Function(${name})`;
|
|
3993
|
+
} else {
|
|
3994
|
+
return "Function";
|
|
3995
|
+
}
|
|
3996
|
+
}
|
|
3997
|
+
if (Array.isArray(val)) {
|
|
3998
|
+
const length = val.length;
|
|
3999
|
+
let debug = "[";
|
|
4000
|
+
if (length > 0) {
|
|
4001
|
+
debug += debugString(val[0]);
|
|
4002
|
+
}
|
|
4003
|
+
for (let i = 1; i < length; i++) {
|
|
4004
|
+
debug += ", " + debugString(val[i]);
|
|
4005
|
+
}
|
|
4006
|
+
debug += "]";
|
|
4007
|
+
return debug;
|
|
4008
|
+
}
|
|
4009
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
4010
|
+
let className;
|
|
4011
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
4012
|
+
className = builtInMatches[1];
|
|
4013
|
+
} else {
|
|
4014
|
+
return toString.call(val);
|
|
4015
|
+
}
|
|
4016
|
+
if (className == "Object") {
|
|
4017
|
+
try {
|
|
4018
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
4019
|
+
} catch (_) {
|
|
4020
|
+
return "Object";
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
4023
|
+
if (val instanceof Error) {
|
|
4024
|
+
return `${val.name}: ${val.message}
|
|
4025
|
+
${val.stack}`;
|
|
4026
|
+
}
|
|
4027
|
+
return className;
|
|
4028
|
+
}
|
|
4029
|
+
function dropObject(idx) {
|
|
4030
|
+
if (idx < 132) return;
|
|
4031
|
+
heap[idx] = heap_next;
|
|
4032
|
+
heap_next = idx;
|
|
4033
|
+
}
|
|
4034
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
4035
|
+
ptr = ptr >>> 0;
|
|
4036
|
+
const mem = getDataViewMemory0();
|
|
4037
|
+
const result = [];
|
|
4038
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
4039
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
4040
|
+
}
|
|
4041
|
+
return result;
|
|
4042
|
+
}
|
|
4043
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
4044
|
+
ptr = ptr >>> 0;
|
|
4045
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
4046
|
+
}
|
|
4047
|
+
var cachedDataViewMemory0 = null;
|
|
4048
|
+
function getDataViewMemory0() {
|
|
4049
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
4050
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
4051
|
+
}
|
|
4052
|
+
return cachedDataViewMemory0;
|
|
4053
|
+
}
|
|
4054
|
+
function getStringFromWasm0(ptr, len) {
|
|
4055
|
+
ptr = ptr >>> 0;
|
|
4056
|
+
return decodeText(ptr, len);
|
|
4057
|
+
}
|
|
4058
|
+
var cachedUint8ArrayMemory0 = null;
|
|
4059
|
+
function getUint8ArrayMemory0() {
|
|
4060
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
4061
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
4062
|
+
}
|
|
4063
|
+
return cachedUint8ArrayMemory0;
|
|
4064
|
+
}
|
|
4065
|
+
function getObject(idx) {
|
|
4066
|
+
return heap[idx];
|
|
4067
|
+
}
|
|
4068
|
+
function handleError(f, args) {
|
|
4069
|
+
try {
|
|
4070
|
+
return f.apply(this, args);
|
|
4071
|
+
} catch (e) {
|
|
4072
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
4073
|
+
}
|
|
4074
|
+
}
|
|
4075
|
+
var heap = new Array(128).fill(void 0);
|
|
4076
|
+
heap.push(void 0, null, true, false);
|
|
4077
|
+
var heap_next = heap.length;
|
|
4078
|
+
function isLikeNone(x) {
|
|
4079
|
+
return x === void 0 || x === null;
|
|
4080
|
+
}
|
|
4081
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
4082
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
4083
|
+
const real = (...args) => {
|
|
4084
|
+
state.cnt++;
|
|
4085
|
+
const a = state.a;
|
|
4086
|
+
state.a = 0;
|
|
4087
|
+
try {
|
|
4088
|
+
return f(a, state.b, ...args);
|
|
4089
|
+
} finally {
|
|
4090
|
+
state.a = a;
|
|
4091
|
+
real._wbg_cb_unref();
|
|
4092
|
+
}
|
|
4093
|
+
};
|
|
4094
|
+
real._wbg_cb_unref = () => {
|
|
4095
|
+
if (--state.cnt === 0) {
|
|
4096
|
+
state.dtor(state.a, state.b);
|
|
4097
|
+
state.a = 0;
|
|
4098
|
+
CLOSURE_DTORS.unregister(state);
|
|
4099
|
+
}
|
|
4100
|
+
};
|
|
4101
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
4102
|
+
return real;
|
|
4103
|
+
}
|
|
4104
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
4105
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
4106
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
4107
|
+
WASM_VECTOR_LEN = arg.length;
|
|
4108
|
+
return ptr;
|
|
4109
|
+
}
|
|
4110
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
4111
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
4112
|
+
const mem = getDataViewMemory0();
|
|
4113
|
+
for (let i = 0; i < array.length; i++) {
|
|
4114
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
4115
|
+
}
|
|
4116
|
+
WASM_VECTOR_LEN = array.length;
|
|
4117
|
+
return ptr;
|
|
4118
|
+
}
|
|
4119
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
4120
|
+
if (realloc === void 0) {
|
|
4121
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
4122
|
+
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
4123
|
+
getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
4124
|
+
WASM_VECTOR_LEN = buf.length;
|
|
4125
|
+
return ptr2;
|
|
4126
|
+
}
|
|
4127
|
+
let len = arg.length;
|
|
4128
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
4129
|
+
const mem = getUint8ArrayMemory0();
|
|
4130
|
+
let offset = 0;
|
|
4131
|
+
for (; offset < len; offset++) {
|
|
4132
|
+
const code = arg.charCodeAt(offset);
|
|
4133
|
+
if (code > 127) break;
|
|
4134
|
+
mem[ptr + offset] = code;
|
|
4135
|
+
}
|
|
4136
|
+
if (offset !== len) {
|
|
4137
|
+
if (offset !== 0) {
|
|
4138
|
+
arg = arg.slice(offset);
|
|
4139
|
+
}
|
|
4140
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
4141
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
4142
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
4143
|
+
offset += ret.written;
|
|
4144
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
4145
|
+
}
|
|
4146
|
+
WASM_VECTOR_LEN = offset;
|
|
4147
|
+
return ptr;
|
|
4148
|
+
}
|
|
4149
|
+
var stack_pointer = 128;
|
|
4150
|
+
function takeObject(idx) {
|
|
4151
|
+
const ret = getObject(idx);
|
|
4152
|
+
dropObject(idx);
|
|
4153
|
+
return ret;
|
|
4154
|
+
}
|
|
4155
|
+
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
4156
|
+
cachedTextDecoder.decode();
|
|
4157
|
+
var MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
4158
|
+
var numBytesDecoded = 0;
|
|
4159
|
+
function decodeText(ptr, len) {
|
|
4160
|
+
numBytesDecoded += len;
|
|
4161
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
4162
|
+
cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
4163
|
+
cachedTextDecoder.decode();
|
|
4164
|
+
numBytesDecoded = len;
|
|
4165
|
+
}
|
|
4166
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
4167
|
+
}
|
|
4168
|
+
var cachedTextEncoder = new TextEncoder();
|
|
4169
|
+
if (!("encodeInto" in cachedTextEncoder)) {
|
|
4170
|
+
cachedTextEncoder.encodeInto = function(arg, view) {
|
|
4171
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
4172
|
+
view.set(buf);
|
|
4173
|
+
return {
|
|
4174
|
+
read: arg.length,
|
|
4175
|
+
written: buf.length
|
|
4176
|
+
};
|
|
4177
|
+
};
|
|
4178
|
+
}
|
|
4179
|
+
var WASM_VECTOR_LEN = 0;
|
|
4180
|
+
var wasmModule;
|
|
4181
|
+
var wasm;
|
|
4182
|
+
function __wbg_finalize_init(instance, module2) {
|
|
4183
|
+
wasm = instance.exports;
|
|
4184
|
+
wasmModule = module2;
|
|
4185
|
+
cachedDataViewMemory0 = null;
|
|
4186
|
+
cachedUint8ArrayMemory0 = null;
|
|
4187
|
+
return wasm;
|
|
4188
|
+
}
|
|
4189
|
+
async function __wbg_load(module2, imports) {
|
|
4190
|
+
if (typeof Response === "function" && module2 instanceof Response) {
|
|
4191
|
+
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
4192
|
+
try {
|
|
4193
|
+
return await WebAssembly.instantiateStreaming(module2, imports);
|
|
4194
|
+
} catch (e) {
|
|
4195
|
+
const validResponse = module2.ok && expectedResponseType(module2.type);
|
|
4196
|
+
if (validResponse && module2.headers.get("Content-Type") !== "application/wasm") {
|
|
4197
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
4198
|
+
} else {
|
|
4199
|
+
throw e;
|
|
4200
|
+
}
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
const bytes = await module2.arrayBuffer();
|
|
4204
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
4205
|
+
} else {
|
|
4206
|
+
const instance = await WebAssembly.instantiate(module2, imports);
|
|
4207
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
4208
|
+
return { instance, module: module2 };
|
|
4209
|
+
} else {
|
|
4210
|
+
return instance;
|
|
4211
|
+
}
|
|
4212
|
+
}
|
|
4213
|
+
function expectedResponseType(type) {
|
|
4214
|
+
switch (type) {
|
|
4215
|
+
case "basic":
|
|
4216
|
+
case "cors":
|
|
4217
|
+
case "default":
|
|
4218
|
+
return true;
|
|
4219
|
+
}
|
|
4220
|
+
return false;
|
|
4221
|
+
}
|
|
4222
|
+
}
|
|
4223
|
+
function initSync(module2) {
|
|
4224
|
+
if (wasm !== void 0) return wasm;
|
|
4225
|
+
if (module2 !== void 0) {
|
|
4226
|
+
if (Object.getPrototypeOf(module2) === Object.prototype) {
|
|
4227
|
+
({ module: module2 } = module2);
|
|
4228
|
+
} else {
|
|
4229
|
+
console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
4230
|
+
}
|
|
4231
|
+
}
|
|
4232
|
+
const imports = __wbg_get_imports();
|
|
4233
|
+
if (!(module2 instanceof WebAssembly.Module)) {
|
|
4234
|
+
module2 = new WebAssembly.Module(module2);
|
|
4235
|
+
}
|
|
4236
|
+
const instance = new WebAssembly.Instance(module2, imports);
|
|
4237
|
+
return __wbg_finalize_init(instance, module2);
|
|
4238
|
+
}
|
|
4239
|
+
async function __wbg_init(module_or_path) {
|
|
4240
|
+
if (wasm !== void 0) return wasm;
|
|
4241
|
+
if (module_or_path !== void 0) {
|
|
4242
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
4243
|
+
({ module_or_path } = module_or_path);
|
|
4244
|
+
} else {
|
|
4245
|
+
console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
4246
|
+
}
|
|
4247
|
+
}
|
|
4248
|
+
if (module_or_path === void 0) {
|
|
4249
|
+
module_or_path = new /* @vite-ignore */
|
|
4250
|
+
URL("subduction_wasm_bg.wasm", import_meta.url);
|
|
4251
|
+
}
|
|
4252
|
+
const imports = __wbg_get_imports();
|
|
4253
|
+
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
|
|
4254
|
+
module_or_path = fetch(module_or_path);
|
|
4255
|
+
}
|
|
4256
|
+
const { instance, module: module2 } = await __wbg_load(await module_or_path, imports);
|
|
4257
|
+
return __wbg_finalize_init(instance, module2);
|
|
4258
|
+
}
|
|
4259
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
4260
|
+
0 && (module.exports = {
|
|
4261
|
+
AuthenticatedLongPoll,
|
|
4262
|
+
AuthenticatedWebSocket,
|
|
4263
|
+
BatchSyncRequest,
|
|
4264
|
+
BatchSyncResponse,
|
|
4265
|
+
BlobMeta,
|
|
4266
|
+
CallError,
|
|
4267
|
+
CommitWithBlob,
|
|
4268
|
+
ConnErrorPair,
|
|
4269
|
+
ConnectionId,
|
|
4270
|
+
Depth,
|
|
4271
|
+
Digest,
|
|
4272
|
+
Fragment,
|
|
4273
|
+
FragmentRequested,
|
|
4274
|
+
FragmentWithBlob,
|
|
4275
|
+
FragmentsArray,
|
|
4276
|
+
HashMetric,
|
|
4277
|
+
LooseCommit,
|
|
4278
|
+
MemoryStorage,
|
|
4279
|
+
Message,
|
|
4280
|
+
Nonce,
|
|
4281
|
+
PeerBatchSyncResult,
|
|
4282
|
+
PeerId,
|
|
4283
|
+
PeerResultMap,
|
|
4284
|
+
RequestId,
|
|
4285
|
+
Sedimentree,
|
|
4286
|
+
SedimentreeId,
|
|
4287
|
+
SedimentreeIdsArray,
|
|
4288
|
+
SignedFragment,
|
|
4289
|
+
SignedLooseCommit,
|
|
4290
|
+
Subduction,
|
|
4291
|
+
SubductionLongPoll,
|
|
4292
|
+
SubductionLongPollConnection,
|
|
4293
|
+
SubductionWebSocket,
|
|
4294
|
+
SyncStats,
|
|
4295
|
+
WebCryptoSigner,
|
|
4296
|
+
initSync
|
|
4297
|
+
});
|