@synonymdev/pubky 0.2.1 → 0.4.0-rc1
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 +24 -36
- package/index.cjs +534 -519
- package/index.js +620 -597
- package/package.json +3 -3
- package/pubky.d.ts +95 -159
- package/pubky_bg.wasm +0 -0
package/index.cjs
CHANGED
|
@@ -9,6 +9,12 @@ imports['__wbindgen_placeholder__'] = module.exports;
|
|
|
9
9
|
let wasm;
|
|
10
10
|
const { TextDecoder, TextEncoder } = require(`util`);
|
|
11
11
|
|
|
12
|
+
const heap = new Array(128).fill(undefined);
|
|
13
|
+
|
|
14
|
+
heap.push(undefined, null, true, false);
|
|
15
|
+
|
|
16
|
+
function getObject(idx) { return heap[idx]; }
|
|
17
|
+
|
|
12
18
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
13
19
|
|
|
14
20
|
cachedTextDecoder.decode();
|
|
@@ -27,10 +33,6 @@ function getStringFromWasm0(ptr, len) {
|
|
|
27
33
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
28
34
|
}
|
|
29
35
|
|
|
30
|
-
const heap = new Array(128).fill(undefined);
|
|
31
|
-
|
|
32
|
-
heap.push(undefined, null, true, false);
|
|
33
|
-
|
|
34
36
|
let heap_next = heap.length;
|
|
35
37
|
|
|
36
38
|
function addHeapObject(obj) {
|
|
@@ -42,7 +44,13 @@ function addHeapObject(obj) {
|
|
|
42
44
|
return idx;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
function
|
|
47
|
+
function handleError(f, args) {
|
|
48
|
+
try {
|
|
49
|
+
return f.apply(this, args);
|
|
50
|
+
} catch (e) {
|
|
51
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
46
54
|
|
|
47
55
|
function dropObject(idx) {
|
|
48
56
|
if (idx < 132) return;
|
|
@@ -56,6 +64,10 @@ function takeObject(idx) {
|
|
|
56
64
|
return ret;
|
|
57
65
|
}
|
|
58
66
|
|
|
67
|
+
function isLikeNone(x) {
|
|
68
|
+
return x === undefined || x === null;
|
|
69
|
+
}
|
|
70
|
+
|
|
59
71
|
let WASM_VECTOR_LEN = 0;
|
|
60
72
|
|
|
61
73
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
@@ -112,10 +124,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
112
124
|
return ptr;
|
|
113
125
|
}
|
|
114
126
|
|
|
115
|
-
function isLikeNone(x) {
|
|
116
|
-
return x === undefined || x === null;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
127
|
let cachedDataViewMemory0 = null;
|
|
120
128
|
|
|
121
129
|
function getDataViewMemory0() {
|
|
@@ -125,6 +133,37 @@ function getDataViewMemory0() {
|
|
|
125
133
|
return cachedDataViewMemory0;
|
|
126
134
|
}
|
|
127
135
|
|
|
136
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
137
|
+
? { register: () => {}, unregister: () => {} }
|
|
138
|
+
: new FinalizationRegistry(state => {
|
|
139
|
+
wasm.__wbindgen_export_3.get(state.dtor)(state.a, state.b)
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
143
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
144
|
+
const real = (...args) => {
|
|
145
|
+
// First up with a closure we increment the internal reference
|
|
146
|
+
// count. This ensures that the Rust closure environment won't
|
|
147
|
+
// be deallocated while we're invoking it.
|
|
148
|
+
state.cnt++;
|
|
149
|
+
const a = state.a;
|
|
150
|
+
state.a = 0;
|
|
151
|
+
try {
|
|
152
|
+
return f(a, state.b, ...args);
|
|
153
|
+
} finally {
|
|
154
|
+
if (--state.cnt === 0) {
|
|
155
|
+
wasm.__wbindgen_export_3.get(state.dtor)(a, state.b);
|
|
156
|
+
CLOSURE_DTORS.unregister(state);
|
|
157
|
+
} else {
|
|
158
|
+
state.a = a;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
real.original = state;
|
|
163
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
164
|
+
return real;
|
|
165
|
+
}
|
|
166
|
+
|
|
128
167
|
function debugString(val) {
|
|
129
168
|
// primitive types
|
|
130
169
|
const type = typeof val;
|
|
@@ -166,7 +205,7 @@ function debugString(val) {
|
|
|
166
205
|
// Test for built-in
|
|
167
206
|
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
168
207
|
let className;
|
|
169
|
-
if (builtInMatches.length > 1) {
|
|
208
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
170
209
|
className = builtInMatches[1];
|
|
171
210
|
} else {
|
|
172
211
|
// Failed to match the standard '[object ClassName]'
|
|
@@ -190,53 +229,18 @@ function debugString(val) {
|
|
|
190
229
|
return className;
|
|
191
230
|
}
|
|
192
231
|
|
|
193
|
-
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
194
|
-
? { register: () => {}, unregister: () => {} }
|
|
195
|
-
: new FinalizationRegistry(state => {
|
|
196
|
-
wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b)
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
200
|
-
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
201
|
-
const real = (...args) => {
|
|
202
|
-
// First up with a closure we increment the internal reference
|
|
203
|
-
// count. This ensures that the Rust closure environment won't
|
|
204
|
-
// be deallocated while we're invoking it.
|
|
205
|
-
state.cnt++;
|
|
206
|
-
const a = state.a;
|
|
207
|
-
state.a = 0;
|
|
208
|
-
try {
|
|
209
|
-
return f(a, state.b, ...args);
|
|
210
|
-
} finally {
|
|
211
|
-
if (--state.cnt === 0) {
|
|
212
|
-
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
|
213
|
-
CLOSURE_DTORS.unregister(state);
|
|
214
|
-
} else {
|
|
215
|
-
state.a = a;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
real.original = state;
|
|
220
|
-
CLOSURE_DTORS.register(real, state, state);
|
|
221
|
-
return real;
|
|
222
|
-
}
|
|
223
|
-
function __wbg_adapter_26(arg0, arg1, arg2) {
|
|
224
|
-
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf3abd8d2e3570b7c(arg0, arg1, addHeapObject(arg2));
|
|
225
|
-
}
|
|
226
|
-
|
|
227
232
|
function _assertClass(instance, klass) {
|
|
228
233
|
if (!(instance instanceof klass)) {
|
|
229
234
|
throw new Error(`expected instance of ${klass.name}`);
|
|
230
235
|
}
|
|
231
|
-
return instance.ptr;
|
|
232
236
|
}
|
|
233
237
|
/**
|
|
234
|
-
* Create a recovery file of the `keypair`, containing the secret key encrypted
|
|
235
|
-
* using the `passphrase`.
|
|
236
|
-
* @param {Keypair} keypair
|
|
237
|
-
* @param {string} passphrase
|
|
238
|
-
* @returns {Uint8Array}
|
|
239
|
-
*/
|
|
238
|
+
* Create a recovery file of the `keypair`, containing the secret key encrypted
|
|
239
|
+
* using the `passphrase`.
|
|
240
|
+
* @param {Keypair} keypair
|
|
241
|
+
* @param {string} passphrase
|
|
242
|
+
* @returns {Uint8Array}
|
|
243
|
+
*/
|
|
240
244
|
module.exports.createRecoveryFile = function(keypair, passphrase) {
|
|
241
245
|
try {
|
|
242
246
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -263,12 +267,12 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
263
267
|
return ptr;
|
|
264
268
|
}
|
|
265
269
|
/**
|
|
266
|
-
* Create a recovery file of the `keypair`, containing the secret key encrypted
|
|
267
|
-
* using the `passphrase`.
|
|
268
|
-
* @param {Uint8Array} recovery_file
|
|
269
|
-
* @param {string} passphrase
|
|
270
|
-
* @returns {Keypair}
|
|
271
|
-
*/
|
|
270
|
+
* Create a recovery file of the `keypair`, containing the secret key encrypted
|
|
271
|
+
* using the `passphrase`.
|
|
272
|
+
* @param {Uint8Array} recovery_file
|
|
273
|
+
* @param {string} passphrase
|
|
274
|
+
* @returns {Keypair}
|
|
275
|
+
*/
|
|
272
276
|
module.exports.decryptRecoveryFile = function(recovery_file, passphrase) {
|
|
273
277
|
try {
|
|
274
278
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -289,6 +293,25 @@ module.exports.decryptRecoveryFile = function(recovery_file, passphrase) {
|
|
|
289
293
|
}
|
|
290
294
|
};
|
|
291
295
|
|
|
296
|
+
/**
|
|
297
|
+
* @param {string} level
|
|
298
|
+
*/
|
|
299
|
+
module.exports.setLogLevel = function(level) {
|
|
300
|
+
try {
|
|
301
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
302
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
303
|
+
const len0 = WASM_VECTOR_LEN;
|
|
304
|
+
wasm.setLogLevel(retptr, ptr0, len0);
|
|
305
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
306
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
307
|
+
if (r1) {
|
|
308
|
+
throw takeObject(r0);
|
|
309
|
+
}
|
|
310
|
+
} finally {
|
|
311
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
|
|
292
315
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
293
316
|
ptr = ptr >>> 0;
|
|
294
317
|
const mem = getDataViewMemory0();
|
|
@@ -298,175 +321,103 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
298
321
|
}
|
|
299
322
|
return result;
|
|
300
323
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
try {
|
|
304
|
-
return f.apply(this, args);
|
|
305
|
-
} catch (e) {
|
|
306
|
-
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
function __wbg_adapter_141(arg0, arg1, arg2, arg3) {
|
|
310
|
-
wasm.wasm_bindgen__convert__closures__invoke2_mut__h6757e2d3bad4487e(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
324
|
+
function __wbg_adapter_28(arg0, arg1, arg2) {
|
|
325
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6aa613d03ec1284e(arg0, arg1, addHeapObject(arg2));
|
|
311
326
|
}
|
|
312
327
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
*/
|
|
318
|
-
class Keypair {
|
|
319
|
-
|
|
320
|
-
static __wrap(ptr) {
|
|
321
|
-
ptr = ptr >>> 0;
|
|
322
|
-
const obj = Object.create(Keypair.prototype);
|
|
323
|
-
obj.__wbg_ptr = ptr;
|
|
324
|
-
KeypairFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
325
|
-
return obj;
|
|
326
|
-
}
|
|
328
|
+
function __wbg_adapter_153(arg0, arg1, arg2, arg3) {
|
|
329
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h2095b693172537bf(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
330
|
+
}
|
|
327
331
|
|
|
328
|
-
|
|
329
|
-
const ptr = this.__wbg_ptr;
|
|
330
|
-
this.__wbg_ptr = 0;
|
|
331
|
-
KeypairFinalization.unregister(this);
|
|
332
|
-
return ptr;
|
|
333
|
-
}
|
|
332
|
+
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
334
333
|
|
|
335
|
-
|
|
336
|
-
const ptr = this.__destroy_into_raw();
|
|
337
|
-
wasm.__wbg_keypair_free(ptr, 0);
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* Generate a random [Keypair]
|
|
341
|
-
* @returns {Keypair}
|
|
342
|
-
*/
|
|
343
|
-
static random() {
|
|
344
|
-
const ret = wasm.keypair_random();
|
|
345
|
-
return Keypair.__wrap(ret);
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Generate a [Keypair] from a secret key.
|
|
349
|
-
* @param {Uint8Array} secret_key
|
|
350
|
-
* @returns {Keypair}
|
|
351
|
-
*/
|
|
352
|
-
static fromSecretKey(secret_key) {
|
|
353
|
-
try {
|
|
354
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
355
|
-
wasm.keypair_fromSecretKey(retptr, addHeapObject(secret_key));
|
|
356
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
357
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
358
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
359
|
-
if (r2) {
|
|
360
|
-
throw takeObject(r1);
|
|
361
|
-
}
|
|
362
|
-
return Keypair.__wrap(r0);
|
|
363
|
-
} finally {
|
|
364
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* Returns the secret key of this keypair.
|
|
369
|
-
* @returns {Uint8Array}
|
|
370
|
-
*/
|
|
371
|
-
secretKey() {
|
|
372
|
-
const ret = wasm.keypair_secretKey(this.__wbg_ptr);
|
|
373
|
-
return takeObject(ret);
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
|
-
* Returns the [PublicKey] of this keypair.
|
|
377
|
-
* @returns {PublicKey}
|
|
378
|
-
*/
|
|
379
|
-
publicKey() {
|
|
380
|
-
const ret = wasm.keypair_publicKey(this.__wbg_ptr);
|
|
381
|
-
return PublicKey.__wrap(ret);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
module.exports.Keypair = Keypair;
|
|
334
|
+
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
385
335
|
|
|
386
|
-
const
|
|
336
|
+
const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
387
337
|
? { register: () => {}, unregister: () => {} }
|
|
388
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
338
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
|
|
389
339
|
/**
|
|
390
|
-
|
|
391
|
-
|
|
340
|
+
* A client for Pubky homeserver API, as well as generic HTTP requests to Pubky urls.
|
|
341
|
+
*/
|
|
342
|
+
class Client {
|
|
392
343
|
|
|
393
344
|
static __wrap(ptr) {
|
|
394
345
|
ptr = ptr >>> 0;
|
|
395
|
-
const obj = Object.create(
|
|
346
|
+
const obj = Object.create(Client.prototype);
|
|
396
347
|
obj.__wbg_ptr = ptr;
|
|
397
|
-
|
|
348
|
+
ClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
398
349
|
return obj;
|
|
399
350
|
}
|
|
400
351
|
|
|
401
352
|
__destroy_into_raw() {
|
|
402
353
|
const ptr = this.__wbg_ptr;
|
|
403
354
|
this.__wbg_ptr = 0;
|
|
404
|
-
|
|
355
|
+
ClientFinalization.unregister(this);
|
|
405
356
|
return ptr;
|
|
406
357
|
}
|
|
407
358
|
|
|
408
359
|
free() {
|
|
409
360
|
const ptr = this.__destroy_into_raw();
|
|
410
|
-
wasm.
|
|
361
|
+
wasm.__wbg_client_free(ptr, 0);
|
|
411
362
|
}
|
|
412
363
|
/**
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
364
|
+
* Signup to a homeserver and update Pkarr accordingly.
|
|
365
|
+
*
|
|
366
|
+
* The homeserver is a Pkarr domain name, where the TLD is a Pkarr public key
|
|
367
|
+
* for example "pubky.o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyy"
|
|
368
|
+
* @param {Keypair} keypair
|
|
369
|
+
* @param {PublicKey} homeserver
|
|
370
|
+
* @returns {Promise<Session>}
|
|
371
|
+
*/
|
|
421
372
|
signup(keypair, homeserver) {
|
|
422
373
|
_assertClass(keypair, Keypair);
|
|
423
374
|
_assertClass(homeserver, PublicKey);
|
|
424
|
-
const ret = wasm.
|
|
375
|
+
const ret = wasm.client_signup(this.__wbg_ptr, keypair.__wbg_ptr, homeserver.__wbg_ptr);
|
|
425
376
|
return takeObject(ret);
|
|
426
377
|
}
|
|
427
378
|
/**
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
379
|
+
* Check the current sesison for a given Pubky in its homeserver.
|
|
380
|
+
*
|
|
381
|
+
* Returns [Session] or `None` (if recieved `404 NOT_FOUND`),
|
|
382
|
+
* or throws the recieved error if the response has any other `>=400` status code.
|
|
383
|
+
* @param {PublicKey} pubky
|
|
384
|
+
* @returns {Promise<Session | undefined>}
|
|
385
|
+
*/
|
|
435
386
|
session(pubky) {
|
|
436
387
|
_assertClass(pubky, PublicKey);
|
|
437
|
-
const ret = wasm.
|
|
388
|
+
const ret = wasm.client_session(this.__wbg_ptr, pubky.__wbg_ptr);
|
|
438
389
|
return takeObject(ret);
|
|
439
390
|
}
|
|
440
391
|
/**
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
392
|
+
* Signout from a homeserver.
|
|
393
|
+
* @param {PublicKey} pubky
|
|
394
|
+
* @returns {Promise<void>}
|
|
395
|
+
*/
|
|
445
396
|
signout(pubky) {
|
|
446
397
|
_assertClass(pubky, PublicKey);
|
|
447
|
-
const ret = wasm.
|
|
398
|
+
const ret = wasm.client_signout(this.__wbg_ptr, pubky.__wbg_ptr);
|
|
448
399
|
return takeObject(ret);
|
|
449
400
|
}
|
|
450
401
|
/**
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
402
|
+
* Signin to a homeserver using the root Keypair.
|
|
403
|
+
* @param {Keypair} keypair
|
|
404
|
+
* @returns {Promise<void>}
|
|
405
|
+
*/
|
|
455
406
|
signin(keypair) {
|
|
456
407
|
_assertClass(keypair, Keypair);
|
|
457
|
-
const ret = wasm.
|
|
408
|
+
const ret = wasm.client_signin(this.__wbg_ptr, keypair.__wbg_ptr);
|
|
458
409
|
return takeObject(ret);
|
|
459
410
|
}
|
|
460
411
|
/**
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
412
|
+
* Return `pubkyauth://` url and wait for the incoming [AuthToken]
|
|
413
|
+
* verifying that AuthToken, and if capabilities were requested, signing in to
|
|
414
|
+
* the Pubky's homeserver and returning the [Session] information.
|
|
415
|
+
*
|
|
416
|
+
* Returns a tuple of [pubkyAuthUrl, Promise<Session>]
|
|
417
|
+
* @param {string} relay
|
|
418
|
+
* @param {string} capabilities
|
|
419
|
+
* @returns {Array<any>}
|
|
420
|
+
*/
|
|
470
421
|
authRequest(relay, capabilities) {
|
|
471
422
|
try {
|
|
472
423
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -474,7 +425,7 @@ class PubkyClient {
|
|
|
474
425
|
const len0 = WASM_VECTOR_LEN;
|
|
475
426
|
const ptr1 = passStringToWasm0(capabilities, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
476
427
|
const len1 = WASM_VECTOR_LEN;
|
|
477
|
-
wasm.
|
|
428
|
+
wasm.client_authRequest(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
478
429
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
479
430
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
480
431
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -487,116 +438,151 @@ class PubkyClient {
|
|
|
487
438
|
}
|
|
488
439
|
}
|
|
489
440
|
/**
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
441
|
+
* Sign an [pubky_common::auth::AuthToken], encrypt it and send it to the
|
|
442
|
+
* source of the pubkyauth request url.
|
|
443
|
+
* @param {Keypair} keypair
|
|
444
|
+
* @param {string} pubkyauth_url
|
|
445
|
+
* @returns {Promise<void>}
|
|
446
|
+
*/
|
|
496
447
|
sendAuthToken(keypair, pubkyauth_url) {
|
|
497
448
|
_assertClass(keypair, Keypair);
|
|
498
449
|
const ptr0 = passStringToWasm0(pubkyauth_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
499
450
|
const len0 = WASM_VECTOR_LEN;
|
|
500
|
-
const ret = wasm.
|
|
501
|
-
return takeObject(ret);
|
|
502
|
-
}
|
|
503
|
-
/**
|
|
504
|
-
* Upload a small payload to a given path.
|
|
505
|
-
* @param {string} url
|
|
506
|
-
* @param {Uint8Array} content
|
|
507
|
-
* @returns {Promise<void>}
|
|
508
|
-
*/
|
|
509
|
-
put(url, content) {
|
|
510
|
-
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
511
|
-
const len0 = WASM_VECTOR_LEN;
|
|
512
|
-
const ptr1 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
|
|
513
|
-
const len1 = WASM_VECTOR_LEN;
|
|
514
|
-
const ret = wasm.pubkyclient_put(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
515
|
-
return takeObject(ret);
|
|
516
|
-
}
|
|
517
|
-
/**
|
|
518
|
-
* Download a small payload from a given path relative to a pubky author.
|
|
519
|
-
* @param {string} url
|
|
520
|
-
* @returns {Promise<Uint8Array | undefined>}
|
|
521
|
-
*/
|
|
522
|
-
get(url) {
|
|
523
|
-
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
524
|
-
const len0 = WASM_VECTOR_LEN;
|
|
525
|
-
const ret = wasm.pubkyclient_get(this.__wbg_ptr, ptr0, len0);
|
|
451
|
+
const ret = wasm.client_sendAuthToken(this.__wbg_ptr, keypair.__wbg_ptr, ptr0, len0);
|
|
526
452
|
return takeObject(ret);
|
|
527
453
|
}
|
|
528
454
|
/**
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
455
|
+
* Returns a list of Pubky urls (as strings).
|
|
456
|
+
*
|
|
457
|
+
* - `url`: The Pubky url (string) to the directory you want to list its content.
|
|
458
|
+
* - `cursor`: Either a full `pubky://` Url (from previous list response),
|
|
459
|
+
* or a path (to a file or directory) relative to the `url`
|
|
460
|
+
* - `reverse`: List in reverse order
|
|
461
|
+
* - `limit` Limit the number of urls in the response
|
|
462
|
+
* - `shallow`: List directories and files, instead of flat list of files.
|
|
463
|
+
* @param {string} url
|
|
464
|
+
* @param {string | undefined} [cursor]
|
|
465
|
+
* @param {boolean | undefined} [reverse]
|
|
466
|
+
* @param {number | undefined} [limit]
|
|
467
|
+
* @param {boolean | undefined} [shallow]
|
|
468
|
+
* @returns {Promise<Array<any>>}
|
|
469
|
+
*/
|
|
470
|
+
list(url, cursor, reverse, limit, shallow) {
|
|
534
471
|
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
535
472
|
const len0 = WASM_VECTOR_LEN;
|
|
536
|
-
|
|
473
|
+
var ptr1 = isLikeNone(cursor) ? 0 : passStringToWasm0(cursor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
474
|
+
var len1 = WASM_VECTOR_LEN;
|
|
475
|
+
const ret = wasm.client_list(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(reverse) ? 0xFFFFFF : reverse ? 1 : 0, isLikeNone(limit) ? 0xFFFFFF : limit, isLikeNone(shallow) ? 0xFFFFFF : shallow ? 1 : 0);
|
|
537
476
|
return takeObject(ret);
|
|
538
477
|
}
|
|
539
478
|
/**
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
* - `reverse`: List in reverse order
|
|
546
|
-
* - `limit` Limit the number of urls in the response
|
|
547
|
-
* - `shallow`: List directories and files, instead of flat list of files.
|
|
548
|
-
* @param {string} url
|
|
549
|
-
* @param {string | undefined} [cursor]
|
|
550
|
-
* @param {boolean | undefined} [reverse]
|
|
551
|
-
* @param {number | undefined} [limit]
|
|
552
|
-
* @param {boolean | undefined} [shallow]
|
|
553
|
-
* @returns {Promise<Array<any>>}
|
|
554
|
-
*/
|
|
555
|
-
list(url, cursor, reverse, limit, shallow) {
|
|
479
|
+
* @param {string} url
|
|
480
|
+
* @param {any | undefined} [request_init]
|
|
481
|
+
* @returns {Promise<Promise<any>>}
|
|
482
|
+
*/
|
|
483
|
+
fetch(url, request_init) {
|
|
556
484
|
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
557
485
|
const len0 = WASM_VECTOR_LEN;
|
|
558
|
-
|
|
559
|
-
var len1 = WASM_VECTOR_LEN;
|
|
560
|
-
const ret = wasm.pubkyclient_list(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(reverse) ? 0xFFFFFF : reverse ? 1 : 0, isLikeNone(limit) ? 0xFFFFFF : limit, isLikeNone(shallow) ? 0xFFFFFF : shallow ? 1 : 0);
|
|
486
|
+
const ret = wasm.client_fetch(this.__wbg_ptr, ptr0, len0, isLikeNone(request_init) ? 0 : addHeapObject(request_init));
|
|
561
487
|
return takeObject(ret);
|
|
562
488
|
}
|
|
563
489
|
/**
|
|
564
|
-
|
|
565
|
-
|
|
490
|
+
* Create Client with default Settings including default relays
|
|
491
|
+
*/
|
|
566
492
|
constructor() {
|
|
567
|
-
const ret = wasm.
|
|
493
|
+
const ret = wasm.client_new();
|
|
568
494
|
this.__wbg_ptr = ret >>> 0;
|
|
569
|
-
|
|
495
|
+
ClientFinalization.register(this, this.__wbg_ptr, this);
|
|
570
496
|
return this;
|
|
571
497
|
}
|
|
572
498
|
/**
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
499
|
+
* Create a client with with configurations appropriate for local testing:
|
|
500
|
+
* - set Pkarr relays to `["http://localhost:15411"]` instead of default relay.
|
|
501
|
+
* @returns {Client}
|
|
502
|
+
*/
|
|
577
503
|
static testnet() {
|
|
578
|
-
const ret = wasm.
|
|
579
|
-
return
|
|
504
|
+
const ret = wasm.client_testnet();
|
|
505
|
+
return Client.__wrap(ret);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
module.exports.Client = Client;
|
|
509
|
+
|
|
510
|
+
const KeypairFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
511
|
+
? { register: () => {}, unregister: () => {} }
|
|
512
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_keypair_free(ptr >>> 0, 1));
|
|
513
|
+
|
|
514
|
+
class Keypair {
|
|
515
|
+
|
|
516
|
+
static __wrap(ptr) {
|
|
517
|
+
ptr = ptr >>> 0;
|
|
518
|
+
const obj = Object.create(Keypair.prototype);
|
|
519
|
+
obj.__wbg_ptr = ptr;
|
|
520
|
+
KeypairFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
521
|
+
return obj;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
__destroy_into_raw() {
|
|
525
|
+
const ptr = this.__wbg_ptr;
|
|
526
|
+
this.__wbg_ptr = 0;
|
|
527
|
+
KeypairFinalization.unregister(this);
|
|
528
|
+
return ptr;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
free() {
|
|
532
|
+
const ptr = this.__destroy_into_raw();
|
|
533
|
+
wasm.__wbg_keypair_free(ptr, 0);
|
|
580
534
|
}
|
|
581
535
|
/**
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
536
|
+
* Generate a random [Keypair]
|
|
537
|
+
* @returns {Keypair}
|
|
538
|
+
*/
|
|
539
|
+
static random() {
|
|
540
|
+
const ret = wasm.keypair_random();
|
|
541
|
+
return Keypair.__wrap(ret);
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Generate a [Keypair] from a secret key.
|
|
545
|
+
* @param {Uint8Array} secret_key
|
|
546
|
+
* @returns {Keypair}
|
|
547
|
+
*/
|
|
548
|
+
static fromSecretKey(secret_key) {
|
|
549
|
+
try {
|
|
550
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
551
|
+
wasm.keypair_fromSecretKey(retptr, addHeapObject(secret_key));
|
|
552
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
553
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
554
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
555
|
+
if (r2) {
|
|
556
|
+
throw takeObject(r1);
|
|
557
|
+
}
|
|
558
|
+
return Keypair.__wrap(r0);
|
|
559
|
+
} finally {
|
|
560
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Returns the secret key of this keypair.
|
|
565
|
+
* @returns {Uint8Array}
|
|
566
|
+
*/
|
|
567
|
+
secretKey() {
|
|
568
|
+
const ret = wasm.keypair_secretKey(this.__wbg_ptr);
|
|
590
569
|
return takeObject(ret);
|
|
591
570
|
}
|
|
571
|
+
/**
|
|
572
|
+
* Returns the [PublicKey] of this keypair.
|
|
573
|
+
* @returns {PublicKey}
|
|
574
|
+
*/
|
|
575
|
+
publicKey() {
|
|
576
|
+
const ret = wasm.keypair_publicKey(this.__wbg_ptr);
|
|
577
|
+
return PublicKey.__wrap(ret);
|
|
578
|
+
}
|
|
592
579
|
}
|
|
593
|
-
module.exports.
|
|
580
|
+
module.exports.Keypair = Keypair;
|
|
594
581
|
|
|
595
582
|
const PublicKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
596
583
|
? { register: () => {}, unregister: () => {} }
|
|
597
584
|
: new FinalizationRegistry(ptr => wasm.__wbg_publickey_free(ptr >>> 0, 1));
|
|
598
|
-
|
|
599
|
-
*/
|
|
585
|
+
|
|
600
586
|
class PublicKey {
|
|
601
587
|
|
|
602
588
|
static __wrap(ptr) {
|
|
@@ -619,17 +605,17 @@ class PublicKey {
|
|
|
619
605
|
wasm.__wbg_publickey_free(ptr, 0);
|
|
620
606
|
}
|
|
621
607
|
/**
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
608
|
+
* Convert the PublicKey to Uint8Array
|
|
609
|
+
* @returns {Uint8Array}
|
|
610
|
+
*/
|
|
625
611
|
to_uint8array() {
|
|
626
612
|
const ret = wasm.publickey_to_uint8array(this.__wbg_ptr);
|
|
627
613
|
return takeObject(ret);
|
|
628
614
|
}
|
|
629
615
|
/**
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
616
|
+
* Returns the z-base32 encoding of this public key
|
|
617
|
+
* @returns {string}
|
|
618
|
+
*/
|
|
633
619
|
z32() {
|
|
634
620
|
let deferred1_0;
|
|
635
621
|
let deferred1_1;
|
|
@@ -647,10 +633,10 @@ class PublicKey {
|
|
|
647
633
|
}
|
|
648
634
|
}
|
|
649
635
|
/**
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
636
|
+
* @throws
|
|
637
|
+
* @param {any} value
|
|
638
|
+
* @returns {PublicKey}
|
|
639
|
+
*/
|
|
654
640
|
static from(value) {
|
|
655
641
|
try {
|
|
656
642
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -672,8 +658,7 @@ module.exports.PublicKey = PublicKey;
|
|
|
672
658
|
const SessionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
673
659
|
? { register: () => {}, unregister: () => {} }
|
|
674
660
|
: new FinalizationRegistry(ptr => wasm.__wbg_session_free(ptr >>> 0, 1));
|
|
675
|
-
|
|
676
|
-
*/
|
|
661
|
+
|
|
677
662
|
class Session {
|
|
678
663
|
|
|
679
664
|
static __wrap(ptr) {
|
|
@@ -696,17 +681,17 @@ class Session {
|
|
|
696
681
|
wasm.__wbg_session_free(ptr, 0);
|
|
697
682
|
}
|
|
698
683
|
/**
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
684
|
+
* Return the [PublicKey] of this session
|
|
685
|
+
* @returns {PublicKey}
|
|
686
|
+
*/
|
|
702
687
|
pubky() {
|
|
703
688
|
const ret = wasm.session_pubky(this.__wbg_ptr);
|
|
704
689
|
return PublicKey.__wrap(ret);
|
|
705
690
|
}
|
|
706
691
|
/**
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
692
|
+
* Return the capabilities that this session has.
|
|
693
|
+
* @returns {(string)[]}
|
|
694
|
+
*/
|
|
710
695
|
capabilities() {
|
|
711
696
|
try {
|
|
712
697
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -723,131 +708,101 @@ class Session {
|
|
|
723
708
|
}
|
|
724
709
|
module.exports.Session = Session;
|
|
725
710
|
|
|
726
|
-
module.exports.
|
|
727
|
-
|
|
728
|
-
return addHeapObject(ret);
|
|
711
|
+
module.exports.__wbg_abort_05026c983d86824c = function(arg0) {
|
|
712
|
+
getObject(arg0).abort();
|
|
729
713
|
};
|
|
730
714
|
|
|
731
|
-
module.exports.
|
|
732
|
-
|
|
733
|
-
};
|
|
715
|
+
module.exports.__wbg_append_72d1635ad8643998 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
716
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
717
|
+
}, arguments) };
|
|
734
718
|
|
|
735
|
-
module.exports.
|
|
736
|
-
const ret =
|
|
719
|
+
module.exports.__wbg_arrayBuffer_d0ca2ad8bda0039b = function() { return handleError(function (arg0) {
|
|
720
|
+
const ret = getObject(arg0).arrayBuffer();
|
|
737
721
|
return addHeapObject(ret);
|
|
738
|
-
};
|
|
722
|
+
}, arguments) };
|
|
739
723
|
|
|
740
|
-
module.exports.
|
|
741
|
-
const ret =
|
|
724
|
+
module.exports.__wbg_buffer_61b7ce01341d7f88 = function(arg0) {
|
|
725
|
+
const ret = getObject(arg0).buffer;
|
|
742
726
|
return addHeapObject(ret);
|
|
743
727
|
};
|
|
744
728
|
|
|
745
|
-
module.exports.
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
749
|
-
var len1 = WASM_VECTOR_LEN;
|
|
750
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
751
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
729
|
+
module.exports.__wbg_byteLength_1b2d953758afc500 = function(arg0) {
|
|
730
|
+
const ret = getObject(arg0).byteLength;
|
|
731
|
+
return ret;
|
|
752
732
|
};
|
|
753
733
|
|
|
754
|
-
module.exports.
|
|
755
|
-
const ret =
|
|
734
|
+
module.exports.__wbg_call_500db948e69c7330 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
735
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
756
736
|
return addHeapObject(ret);
|
|
757
|
-
};
|
|
737
|
+
}, arguments) };
|
|
758
738
|
|
|
759
|
-
module.exports.
|
|
760
|
-
const ret =
|
|
739
|
+
module.exports.__wbg_call_b0d8e36992d9900d = function() { return handleError(function (arg0, arg1) {
|
|
740
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
761
741
|
return addHeapObject(ret);
|
|
762
|
-
};
|
|
742
|
+
}, arguments) };
|
|
763
743
|
|
|
764
|
-
module.exports.
|
|
765
|
-
const ret = getObject(arg0);
|
|
744
|
+
module.exports.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
|
|
745
|
+
const ret = getObject(arg0).crypto;
|
|
766
746
|
return addHeapObject(ret);
|
|
767
747
|
};
|
|
768
748
|
|
|
769
|
-
module.exports.
|
|
770
|
-
|
|
771
|
-
if (obj.cnt-- == 1) {
|
|
772
|
-
obj.a = 0;
|
|
773
|
-
return true;
|
|
774
|
-
}
|
|
775
|
-
const ret = false;
|
|
776
|
-
return ret;
|
|
749
|
+
module.exports.__wbg_debug_19114f11037e4658 = function(arg0, arg1, arg2, arg3) {
|
|
750
|
+
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
777
751
|
};
|
|
778
752
|
|
|
779
|
-
module.exports.
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
module.exports.__wbg_queueMicrotask_48421b3cc9052b68 = function(arg0) {
|
|
784
|
-
const ret = getObject(arg0).queueMicrotask;
|
|
785
|
-
return addHeapObject(ret);
|
|
753
|
+
module.exports.__wbg_done_f22c1561fa919baa = function(arg0) {
|
|
754
|
+
const ret = getObject(arg0).done;
|
|
755
|
+
return ret;
|
|
786
756
|
};
|
|
787
757
|
|
|
788
|
-
module.exports.
|
|
789
|
-
|
|
790
|
-
return ret;
|
|
758
|
+
module.exports.__wbg_error_483d659117b6f3f6 = function(arg0, arg1, arg2, arg3) {
|
|
759
|
+
console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
791
760
|
};
|
|
792
761
|
|
|
793
|
-
module.exports.
|
|
762
|
+
module.exports.__wbg_fetch_229368eecee9d217 = function(arg0, arg1) {
|
|
794
763
|
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
795
764
|
return addHeapObject(ret);
|
|
796
765
|
};
|
|
797
766
|
|
|
798
|
-
module.exports.
|
|
799
|
-
const ret =
|
|
767
|
+
module.exports.__wbg_fetch_408fc9f7fddb9d4e = function(arg0) {
|
|
768
|
+
const ret = fetch(getObject(arg0));
|
|
800
769
|
return addHeapObject(ret);
|
|
801
|
-
}, arguments) };
|
|
802
|
-
|
|
803
|
-
module.exports.__wbg_setbody_734cb3d7ee8e6e96 = function(arg0, arg1) {
|
|
804
|
-
getObject(arg0).body = getObject(arg1);
|
|
805
770
|
};
|
|
806
771
|
|
|
807
|
-
module.exports.
|
|
808
|
-
getObject(arg0)
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
module.exports.__wbg_setheaders_be10a5ab566fd06f = function(arg0, arg1) {
|
|
812
|
-
getObject(arg0).headers = getObject(arg1);
|
|
813
|
-
};
|
|
814
|
-
|
|
815
|
-
module.exports.__wbg_setmethod_dc68a742c2db5c6a = function(arg0, arg1, arg2) {
|
|
816
|
-
getObject(arg0).method = getStringFromWasm0(arg1, arg2);
|
|
772
|
+
module.exports.__wbg_fetch_4465c2b10f21a927 = function(arg0) {
|
|
773
|
+
const ret = fetch(getObject(arg0));
|
|
774
|
+
return addHeapObject(ret);
|
|
817
775
|
};
|
|
818
776
|
|
|
819
|
-
module.exports.
|
|
820
|
-
getObject(arg0).
|
|
821
|
-
};
|
|
777
|
+
module.exports.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
|
|
778
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
779
|
+
}, arguments) };
|
|
822
780
|
|
|
823
|
-
module.exports.
|
|
824
|
-
getObject(arg0)
|
|
825
|
-
|
|
781
|
+
module.exports.__wbg_get_bbccf8970793c087 = function() { return handleError(function (arg0, arg1) {
|
|
782
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
783
|
+
return addHeapObject(ret);
|
|
784
|
+
}, arguments) };
|
|
826
785
|
|
|
827
|
-
module.exports.
|
|
828
|
-
const ret = getObject(arg0).
|
|
786
|
+
module.exports.__wbg_getheaders_82a20f9b60524a86 = function(arg0) {
|
|
787
|
+
const ret = getObject(arg0).headers;
|
|
829
788
|
return addHeapObject(ret);
|
|
830
789
|
};
|
|
831
790
|
|
|
832
|
-
module.exports.
|
|
833
|
-
const ret =
|
|
834
|
-
return
|
|
791
|
+
module.exports.__wbg_has_94c2fc1d261bbfe9 = function() { return handleError(function (arg0, arg1) {
|
|
792
|
+
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
793
|
+
return ret;
|
|
835
794
|
}, arguments) };
|
|
836
795
|
|
|
837
|
-
module.exports.
|
|
838
|
-
getObject(arg0).
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
module.exports.__wbg_new_e27c93803e1acc42 = function() { return handleError(function () {
|
|
842
|
-
const ret = new Headers();
|
|
796
|
+
module.exports.__wbg_headers_24e3e19fe3f187c0 = function(arg0) {
|
|
797
|
+
const ret = getObject(arg0).headers;
|
|
843
798
|
return addHeapObject(ret);
|
|
844
|
-
}
|
|
799
|
+
};
|
|
845
800
|
|
|
846
|
-
module.exports.
|
|
847
|
-
getObject(arg0)
|
|
848
|
-
}
|
|
801
|
+
module.exports.__wbg_info_18e75e6ce8a36a90 = function(arg0, arg1, arg2, arg3) {
|
|
802
|
+
console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
803
|
+
};
|
|
849
804
|
|
|
850
|
-
module.exports.
|
|
805
|
+
module.exports.__wbg_instanceof_Response_d3453657e10c4300 = function(arg0) {
|
|
851
806
|
let result;
|
|
852
807
|
try {
|
|
853
808
|
result = getObject(arg0) instanceof Response;
|
|
@@ -858,289 +813,349 @@ module.exports.__wbg_instanceof_Response_e91b7eb7c611a9ae = function(arg0) {
|
|
|
858
813
|
return ret;
|
|
859
814
|
};
|
|
860
815
|
|
|
861
|
-
module.exports.
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
816
|
+
module.exports.__wbg_instanceof_Uint8Array_28af5bc19d6acad8 = function(arg0) {
|
|
817
|
+
let result;
|
|
818
|
+
try {
|
|
819
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
820
|
+
} catch (_) {
|
|
821
|
+
result = false;
|
|
822
|
+
}
|
|
823
|
+
const ret = result;
|
|
824
|
+
return ret;
|
|
867
825
|
};
|
|
868
826
|
|
|
869
|
-
module.exports.
|
|
870
|
-
const ret =
|
|
827
|
+
module.exports.__wbg_iterator_23604bb983791576 = function() {
|
|
828
|
+
const ret = Symbol.iterator;
|
|
829
|
+
return addHeapObject(ret);
|
|
830
|
+
};
|
|
831
|
+
|
|
832
|
+
module.exports.__wbg_length_65d1cd11729ced11 = function(arg0) {
|
|
833
|
+
const ret = getObject(arg0).length;
|
|
871
834
|
return ret;
|
|
872
835
|
};
|
|
873
836
|
|
|
874
|
-
module.exports.
|
|
875
|
-
|
|
876
|
-
return addHeapObject(ret);
|
|
837
|
+
module.exports.__wbg_log_bc77772961bf21bb = function(arg0, arg1, arg2, arg3) {
|
|
838
|
+
console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
877
839
|
};
|
|
878
840
|
|
|
879
|
-
module.exports.
|
|
880
|
-
const ret = getObject(arg0).
|
|
841
|
+
module.exports.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
|
|
842
|
+
const ret = getObject(arg0).msCrypto;
|
|
881
843
|
return addHeapObject(ret);
|
|
882
|
-
}, arguments) };
|
|
883
|
-
|
|
884
|
-
module.exports.__wbindgen_is_object = function(arg0) {
|
|
885
|
-
const val = getObject(arg0);
|
|
886
|
-
const ret = typeof(val) === 'object' && val !== null;
|
|
887
|
-
return ret;
|
|
888
844
|
};
|
|
889
845
|
|
|
890
|
-
module.exports.
|
|
891
|
-
const ret =
|
|
846
|
+
module.exports.__wbg_new_254fa9eac11932ae = function() {
|
|
847
|
+
const ret = new Array();
|
|
892
848
|
return addHeapObject(ret);
|
|
893
849
|
};
|
|
894
850
|
|
|
895
|
-
module.exports.
|
|
896
|
-
const ret =
|
|
851
|
+
module.exports.__wbg_new_35d748855c4620b9 = function() { return handleError(function () {
|
|
852
|
+
const ret = new Headers();
|
|
897
853
|
return addHeapObject(ret);
|
|
854
|
+
}, arguments) };
|
|
855
|
+
|
|
856
|
+
module.exports.__wbg_new_3d446df9155128ef = function(arg0, arg1) {
|
|
857
|
+
try {
|
|
858
|
+
var state0 = {a: arg0, b: arg1};
|
|
859
|
+
var cb0 = (arg0, arg1) => {
|
|
860
|
+
const a = state0.a;
|
|
861
|
+
state0.a = 0;
|
|
862
|
+
try {
|
|
863
|
+
return __wbg_adapter_153(a, state0.b, arg0, arg1);
|
|
864
|
+
} finally {
|
|
865
|
+
state0.a = a;
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
const ret = new Promise(cb0);
|
|
869
|
+
return addHeapObject(ret);
|
|
870
|
+
} finally {
|
|
871
|
+
state0.a = state0.b = 0;
|
|
872
|
+
}
|
|
898
873
|
};
|
|
899
874
|
|
|
900
|
-
module.exports.
|
|
901
|
-
const ret = getObject(arg0)
|
|
875
|
+
module.exports.__wbg_new_3ff5b33b1ce712df = function(arg0) {
|
|
876
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
902
877
|
return addHeapObject(ret);
|
|
903
878
|
};
|
|
904
879
|
|
|
905
|
-
module.exports.
|
|
906
|
-
const ret =
|
|
880
|
+
module.exports.__wbg_new_5f48f21d4be11586 = function() { return handleError(function () {
|
|
881
|
+
const ret = new AbortController();
|
|
882
|
+
return addHeapObject(ret);
|
|
883
|
+
}, arguments) };
|
|
884
|
+
|
|
885
|
+
module.exports.__wbg_new_688846f374351c92 = function() {
|
|
886
|
+
const ret = new Object();
|
|
907
887
|
return addHeapObject(ret);
|
|
908
888
|
};
|
|
909
889
|
|
|
910
|
-
module.exports.
|
|
911
|
-
const ret =
|
|
912
|
-
return ret;
|
|
890
|
+
module.exports.__wbg_newnoargs_fd9e4bf8be2bc16d = function(arg0, arg1) {
|
|
891
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
892
|
+
return addHeapObject(ret);
|
|
913
893
|
};
|
|
914
894
|
|
|
915
|
-
module.exports.
|
|
916
|
-
const ret =
|
|
895
|
+
module.exports.__wbg_newwithbyteoffsetandlength_ba35896968751d91 = function(arg0, arg1, arg2) {
|
|
896
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
917
897
|
return addHeapObject(ret);
|
|
918
|
-
}
|
|
898
|
+
};
|
|
919
899
|
|
|
920
|
-
module.exports.
|
|
921
|
-
const ret =
|
|
900
|
+
module.exports.__wbg_newwithlength_34ce8f1051e74449 = function(arg0) {
|
|
901
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
922
902
|
return addHeapObject(ret);
|
|
923
903
|
};
|
|
924
904
|
|
|
925
|
-
module.exports.
|
|
926
|
-
|
|
905
|
+
module.exports.__wbg_newwithstrandinit_a1f6583f20e4faff = function() { return handleError(function (arg0, arg1, arg2) {
|
|
906
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
907
|
+
return addHeapObject(ret);
|
|
927
908
|
}, arguments) };
|
|
928
909
|
|
|
929
|
-
module.exports.
|
|
930
|
-
getObject(arg0).
|
|
910
|
+
module.exports.__wbg_next_01dd9234a5bf6d05 = function() { return handleError(function (arg0) {
|
|
911
|
+
const ret = getObject(arg0).next();
|
|
912
|
+
return addHeapObject(ret);
|
|
931
913
|
}, arguments) };
|
|
932
914
|
|
|
933
|
-
module.exports.
|
|
934
|
-
const ret =
|
|
915
|
+
module.exports.__wbg_next_137428deb98342b0 = function(arg0) {
|
|
916
|
+
const ret = getObject(arg0).next;
|
|
935
917
|
return addHeapObject(ret);
|
|
936
918
|
};
|
|
937
919
|
|
|
938
|
-
module.exports.
|
|
939
|
-
const ret =
|
|
920
|
+
module.exports.__wbg_node_02999533c4ea02e3 = function(arg0) {
|
|
921
|
+
const ret = getObject(arg0).node;
|
|
940
922
|
return addHeapObject(ret);
|
|
941
923
|
};
|
|
942
924
|
|
|
943
|
-
module.exports.
|
|
944
|
-
const ret =
|
|
945
|
-
return
|
|
925
|
+
module.exports.__wbg_now_64d0bb151e5d3889 = function() {
|
|
926
|
+
const ret = Date.now();
|
|
927
|
+
return ret;
|
|
946
928
|
};
|
|
947
929
|
|
|
948
|
-
module.exports.
|
|
949
|
-
const ret = getObject(arg0).
|
|
930
|
+
module.exports.__wbg_process_5c1d670bc53614b8 = function(arg0) {
|
|
931
|
+
const ret = getObject(arg0).process;
|
|
950
932
|
return addHeapObject(ret);
|
|
951
933
|
};
|
|
952
934
|
|
|
953
|
-
module.exports.
|
|
954
|
-
const ret =
|
|
935
|
+
module.exports.__wbg_publickey_new = function(arg0) {
|
|
936
|
+
const ret = PublicKey.__wrap(arg0);
|
|
955
937
|
return addHeapObject(ret);
|
|
956
938
|
};
|
|
957
939
|
|
|
958
|
-
module.exports.
|
|
959
|
-
const ret =
|
|
960
|
-
return
|
|
940
|
+
module.exports.__wbg_push_6edad0df4b546b2c = function(arg0, arg1) {
|
|
941
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
942
|
+
return ret;
|
|
943
|
+
};
|
|
944
|
+
|
|
945
|
+
module.exports.__wbg_queueMicrotask_2181040e064c0dc8 = function(arg0) {
|
|
946
|
+
queueMicrotask(getObject(arg0));
|
|
961
947
|
};
|
|
962
948
|
|
|
963
|
-
module.exports.
|
|
964
|
-
const ret =
|
|
949
|
+
module.exports.__wbg_queueMicrotask_ef9ac43769cbcc4f = function(arg0) {
|
|
950
|
+
const ret = getObject(arg0).queueMicrotask;
|
|
965
951
|
return addHeapObject(ret);
|
|
952
|
+
};
|
|
953
|
+
|
|
954
|
+
module.exports.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
|
|
955
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
966
956
|
}, arguments) };
|
|
967
957
|
|
|
968
|
-
module.exports.
|
|
969
|
-
const ret =
|
|
958
|
+
module.exports.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
|
|
959
|
+
const ret = module.require;
|
|
970
960
|
return addHeapObject(ret);
|
|
971
961
|
}, arguments) };
|
|
972
962
|
|
|
973
|
-
module.exports.
|
|
974
|
-
const ret =
|
|
963
|
+
module.exports.__wbg_resolve_0bf7c44d641804f9 = function(arg0) {
|
|
964
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
975
965
|
return addHeapObject(ret);
|
|
976
|
-
}
|
|
966
|
+
};
|
|
977
967
|
|
|
978
|
-
module.exports.
|
|
979
|
-
const ret =
|
|
968
|
+
module.exports.__wbg_session_new = function(arg0) {
|
|
969
|
+
const ret = Session.__wrap(arg0);
|
|
980
970
|
return addHeapObject(ret);
|
|
981
|
-
}
|
|
971
|
+
};
|
|
982
972
|
|
|
983
|
-
module.exports.
|
|
984
|
-
|
|
985
|
-
return ret;
|
|
973
|
+
module.exports.__wbg_set_23d69db4e5c66a6e = function(arg0, arg1, arg2) {
|
|
974
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
986
975
|
};
|
|
987
976
|
|
|
988
|
-
module.exports.
|
|
989
|
-
|
|
990
|
-
return ret;
|
|
977
|
+
module.exports.__wbg_setbody_64920df008e48adc = function(arg0, arg1) {
|
|
978
|
+
getObject(arg0).body = getObject(arg1);
|
|
991
979
|
};
|
|
992
980
|
|
|
993
|
-
module.exports.
|
|
994
|
-
|
|
995
|
-
return addHeapObject(ret);
|
|
981
|
+
module.exports.__wbg_setcredentials_cfc15e48e3a3a535 = function(arg0, arg1) {
|
|
982
|
+
getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
996
983
|
};
|
|
997
984
|
|
|
998
|
-
module.exports.
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
}, arguments) };
|
|
985
|
+
module.exports.__wbg_setheaders_4c921e8e226bdfa7 = function(arg0, arg1) {
|
|
986
|
+
getObject(arg0).headers = getObject(arg1);
|
|
987
|
+
};
|
|
1002
988
|
|
|
1003
|
-
module.exports.
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
}, arguments) };
|
|
989
|
+
module.exports.__wbg_setmethod_cfc7f688ba46a6be = function(arg0, arg1, arg2) {
|
|
990
|
+
getObject(arg0).method = getStringFromWasm0(arg1, arg2);
|
|
991
|
+
};
|
|
1007
992
|
|
|
1008
|
-
module.exports.
|
|
1009
|
-
|
|
993
|
+
module.exports.__wbg_setmode_cd03637eb7da01e0 = function(arg0, arg1) {
|
|
994
|
+
getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
|
|
995
|
+
};
|
|
996
|
+
|
|
997
|
+
module.exports.__wbg_setsignal_f766190d206f09e5 = function(arg0, arg1) {
|
|
998
|
+
getObject(arg0).signal = getObject(arg1);
|
|
999
|
+
};
|
|
1000
|
+
|
|
1001
|
+
module.exports.__wbg_signal_1fdadeba2d04660e = function(arg0) {
|
|
1002
|
+
const ret = getObject(arg0).signal;
|
|
1010
1003
|
return addHeapObject(ret);
|
|
1011
|
-
}
|
|
1004
|
+
};
|
|
1012
1005
|
|
|
1013
|
-
module.exports.
|
|
1014
|
-
const ret =
|
|
1015
|
-
return ret;
|
|
1006
|
+
module.exports.__wbg_static_accessor_GLOBAL_0be7472e492ad3e3 = function() {
|
|
1007
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1008
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1016
1009
|
};
|
|
1017
1010
|
|
|
1018
|
-
module.exports.
|
|
1019
|
-
const ret =
|
|
1020
|
-
return ret;
|
|
1011
|
+
module.exports.__wbg_static_accessor_GLOBAL_THIS_1a6eb482d12c9bfb = function() {
|
|
1012
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1013
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1021
1014
|
};
|
|
1022
1015
|
|
|
1023
|
-
module.exports.
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
var cb0 = (arg0, arg1) => {
|
|
1027
|
-
const a = state0.a;
|
|
1028
|
-
state0.a = 0;
|
|
1029
|
-
try {
|
|
1030
|
-
return __wbg_adapter_141(a, state0.b, arg0, arg1);
|
|
1031
|
-
} finally {
|
|
1032
|
-
state0.a = a;
|
|
1033
|
-
}
|
|
1034
|
-
};
|
|
1035
|
-
const ret = new Promise(cb0);
|
|
1036
|
-
return addHeapObject(ret);
|
|
1037
|
-
} finally {
|
|
1038
|
-
state0.a = state0.b = 0;
|
|
1039
|
-
}
|
|
1016
|
+
module.exports.__wbg_static_accessor_SELF_1dc398a895c82351 = function() {
|
|
1017
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1018
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1040
1019
|
};
|
|
1041
1020
|
|
|
1042
|
-
module.exports.
|
|
1043
|
-
const ret =
|
|
1021
|
+
module.exports.__wbg_static_accessor_WINDOW_ae1c80c7eea8d64a = function() {
|
|
1022
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1023
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1024
|
+
};
|
|
1025
|
+
|
|
1026
|
+
module.exports.__wbg_status_317f53bc4c7638df = function(arg0) {
|
|
1027
|
+
const ret = getObject(arg0).status;
|
|
1028
|
+
return ret;
|
|
1029
|
+
};
|
|
1030
|
+
|
|
1031
|
+
module.exports.__wbg_stringify_f4f701bc34ceda61 = function() { return handleError(function (arg0) {
|
|
1032
|
+
const ret = JSON.stringify(getObject(arg0));
|
|
1033
|
+
return addHeapObject(ret);
|
|
1034
|
+
}, arguments) };
|
|
1035
|
+
|
|
1036
|
+
module.exports.__wbg_subarray_46adeb9b86949d12 = function(arg0, arg1, arg2) {
|
|
1037
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1044
1038
|
return addHeapObject(ret);
|
|
1045
1039
|
};
|
|
1046
1040
|
|
|
1047
|
-
module.exports.
|
|
1041
|
+
module.exports.__wbg_text_dfc4cb7631d2eb34 = function() { return handleError(function (arg0) {
|
|
1042
|
+
const ret = getObject(arg0).text();
|
|
1043
|
+
return addHeapObject(ret);
|
|
1044
|
+
}, arguments) };
|
|
1045
|
+
|
|
1046
|
+
module.exports.__wbg_then_0438fad860fe38e1 = function(arg0, arg1) {
|
|
1048
1047
|
const ret = getObject(arg0).then(getObject(arg1));
|
|
1049
1048
|
return addHeapObject(ret);
|
|
1050
1049
|
};
|
|
1051
1050
|
|
|
1052
|
-
module.exports.
|
|
1051
|
+
module.exports.__wbg_then_0ffafeddf0e182a4 = function(arg0, arg1, arg2) {
|
|
1053
1052
|
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
1054
1053
|
return addHeapObject(ret);
|
|
1055
1054
|
};
|
|
1056
1055
|
|
|
1057
|
-
module.exports.
|
|
1058
|
-
const ret = getObject(
|
|
1059
|
-
|
|
1056
|
+
module.exports.__wbg_url_5327bc0a41a9b085 = function(arg0, arg1) {
|
|
1057
|
+
const ret = getObject(arg1).url;
|
|
1058
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1059
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1060
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1061
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1060
1062
|
};
|
|
1061
1063
|
|
|
1062
|
-
module.exports.
|
|
1063
|
-
const ret =
|
|
1064
|
+
module.exports.__wbg_value_4c32fd138a88eee2 = function(arg0) {
|
|
1065
|
+
const ret = getObject(arg0).value;
|
|
1064
1066
|
return addHeapObject(ret);
|
|
1065
1067
|
};
|
|
1066
1068
|
|
|
1067
|
-
module.exports.
|
|
1068
|
-
const ret =
|
|
1069
|
+
module.exports.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
|
|
1070
|
+
const ret = getObject(arg0).versions;
|
|
1069
1071
|
return addHeapObject(ret);
|
|
1070
1072
|
};
|
|
1071
1073
|
|
|
1072
|
-
module.exports.
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1074
|
+
module.exports.__wbg_warn_cb8be8bbf790a5d6 = function(arg0, arg1, arg2, arg3) {
|
|
1075
|
+
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
1076
|
+
};
|
|
1077
|
+
|
|
1078
|
+
module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
1079
|
+
const obj = takeObject(arg0).original;
|
|
1080
|
+
if (obj.cnt-- == 1) {
|
|
1081
|
+
obj.a = 0;
|
|
1082
|
+
return true;
|
|
1078
1083
|
}
|
|
1079
|
-
const ret =
|
|
1084
|
+
const ret = false;
|
|
1080
1085
|
return ret;
|
|
1081
1086
|
};
|
|
1082
1087
|
|
|
1083
|
-
module.exports.
|
|
1084
|
-
const ret =
|
|
1088
|
+
module.exports.__wbindgen_closure_wrapper2630 = function(arg0, arg1, arg2) {
|
|
1089
|
+
const ret = makeMutClosure(arg0, arg1, 540, __wbg_adapter_28);
|
|
1085
1090
|
return addHeapObject(ret);
|
|
1086
1091
|
};
|
|
1087
1092
|
|
|
1088
|
-
module.exports.
|
|
1089
|
-
const ret = getObject(
|
|
1090
|
-
|
|
1093
|
+
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
1094
|
+
const ret = debugString(getObject(arg1));
|
|
1095
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1096
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1097
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1098
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1091
1099
|
};
|
|
1092
1100
|
|
|
1093
|
-
module.exports.
|
|
1094
|
-
const ret = getObject(arg0)
|
|
1101
|
+
module.exports.__wbindgen_is_function = function(arg0) {
|
|
1102
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
1095
1103
|
return ret;
|
|
1096
1104
|
};
|
|
1097
1105
|
|
|
1098
|
-
module.exports.
|
|
1099
|
-
const ret = getObject(arg0)
|
|
1106
|
+
module.exports.__wbindgen_is_null = function(arg0) {
|
|
1107
|
+
const ret = getObject(arg0) === null;
|
|
1100
1108
|
return ret;
|
|
1101
1109
|
};
|
|
1102
1110
|
|
|
1103
|
-
module.exports.
|
|
1104
|
-
getObject(arg0)
|
|
1111
|
+
module.exports.__wbindgen_is_object = function(arg0) {
|
|
1112
|
+
const val = getObject(arg0);
|
|
1113
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
1114
|
+
return ret;
|
|
1105
1115
|
};
|
|
1106
1116
|
|
|
1107
|
-
module.exports.
|
|
1108
|
-
const ret =
|
|
1109
|
-
return
|
|
1110
|
-
}
|
|
1117
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
1118
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
1119
|
+
return ret;
|
|
1120
|
+
};
|
|
1111
1121
|
|
|
1112
|
-
module.exports.
|
|
1113
|
-
const ret =
|
|
1122
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
1123
|
+
const ret = getObject(arg0) === undefined;
|
|
1114
1124
|
return ret;
|
|
1115
|
-
}
|
|
1125
|
+
};
|
|
1116
1126
|
|
|
1117
|
-
module.exports.
|
|
1118
|
-
const ret =
|
|
1127
|
+
module.exports.__wbindgen_memory = function() {
|
|
1128
|
+
const ret = wasm.memory;
|
|
1119
1129
|
return addHeapObject(ret);
|
|
1120
|
-
}
|
|
1130
|
+
};
|
|
1121
1131
|
|
|
1122
|
-
module.exports.
|
|
1123
|
-
const ret =
|
|
1124
|
-
|
|
1125
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1126
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1127
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1132
|
+
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
1133
|
+
const ret = getObject(arg0);
|
|
1134
|
+
return addHeapObject(ret);
|
|
1128
1135
|
};
|
|
1129
1136
|
|
|
1130
|
-
module.exports.
|
|
1131
|
-
|
|
1137
|
+
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
1138
|
+
takeObject(arg0);
|
|
1132
1139
|
};
|
|
1133
1140
|
|
|
1134
|
-
module.exports.
|
|
1135
|
-
const
|
|
1136
|
-
|
|
1141
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
1142
|
+
const obj = getObject(arg1);
|
|
1143
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1144
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1145
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1146
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1147
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1137
1148
|
};
|
|
1138
1149
|
|
|
1139
|
-
module.exports.
|
|
1140
|
-
const ret =
|
|
1150
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
1151
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1141
1152
|
return addHeapObject(ret);
|
|
1142
1153
|
};
|
|
1143
1154
|
|
|
1155
|
+
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
1156
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1144
1159
|
const path = require('path').join(__dirname, 'pubky_bg.wasm');
|
|
1145
1160
|
const bytes = require('fs').readFileSync(path);
|
|
1146
1161
|
|