@synonymdev/pubky 0.2.1 → 0.4.0-rc.4
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 +543 -525
- package/index.js +630 -604
- package/package.json +3 -3
- package/pubky.d.ts +99 -161
- 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,28 @@ 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
|
-
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
239
|
+
ptr = ptr >>> 0;
|
|
240
|
+
const mem = getDataViewMemory0();
|
|
241
|
+
const result = [];
|
|
242
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
243
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
244
|
+
}
|
|
245
|
+
return result;
|
|
232
246
|
}
|
|
233
247
|
/**
|
|
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
|
-
*/
|
|
248
|
+
* Create a recovery file of the `keypair`, containing the secret key encrypted
|
|
249
|
+
* using the `passphrase`.
|
|
250
|
+
* @param {Keypair} keypair
|
|
251
|
+
* @param {string} passphrase
|
|
252
|
+
* @returns {Uint8Array}
|
|
253
|
+
*/
|
|
240
254
|
module.exports.createRecoveryFile = function(keypair, passphrase) {
|
|
241
255
|
try {
|
|
242
256
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -263,12 +277,12 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
263
277
|
return ptr;
|
|
264
278
|
}
|
|
265
279
|
/**
|
|
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
|
-
*/
|
|
280
|
+
* Create a recovery file of the `keypair`, containing the secret key encrypted
|
|
281
|
+
* using the `passphrase`.
|
|
282
|
+
* @param {Uint8Array} recovery_file
|
|
283
|
+
* @param {string} passphrase
|
|
284
|
+
* @returns {Keypair}
|
|
285
|
+
*/
|
|
272
286
|
module.exports.decryptRecoveryFile = function(recovery_file, passphrase) {
|
|
273
287
|
try {
|
|
274
288
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -289,184 +303,122 @@ module.exports.decryptRecoveryFile = function(recovery_file, passphrase) {
|
|
|
289
303
|
}
|
|
290
304
|
};
|
|
291
305
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
297
|
-
result.push(takeObject(mem.getUint32(i, true)));
|
|
298
|
-
}
|
|
299
|
-
return result;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
function handleError(f, args) {
|
|
306
|
+
/**
|
|
307
|
+
* @param {string} level
|
|
308
|
+
*/
|
|
309
|
+
module.exports.setLogLevel = function(level) {
|
|
303
310
|
try {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
311
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
312
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
313
|
+
const len0 = WASM_VECTOR_LEN;
|
|
314
|
+
wasm.setLogLevel(retptr, ptr0, len0);
|
|
315
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
316
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
317
|
+
if (r1) {
|
|
318
|
+
throw takeObject(r0);
|
|
319
|
+
}
|
|
320
|
+
} finally {
|
|
321
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
307
322
|
}
|
|
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));
|
|
311
|
-
}
|
|
323
|
+
};
|
|
312
324
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
*/
|
|
318
|
-
class Keypair {
|
|
325
|
+
function __wbg_adapter_28(arg0, arg1, arg2) {
|
|
326
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3377896d609abf0a(arg0, arg1, addHeapObject(arg2));
|
|
327
|
+
}
|
|
319
328
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
obj.__wbg_ptr = ptr;
|
|
324
|
-
KeypairFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
325
|
-
return obj;
|
|
326
|
-
}
|
|
329
|
+
function __wbg_adapter_153(arg0, arg1, arg2, arg3) {
|
|
330
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h53c3869863f2beff(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
331
|
+
}
|
|
327
332
|
|
|
328
|
-
|
|
329
|
-
const ptr = this.__wbg_ptr;
|
|
330
|
-
this.__wbg_ptr = 0;
|
|
331
|
-
KeypairFinalization.unregister(this);
|
|
332
|
-
return ptr;
|
|
333
|
-
}
|
|
333
|
+
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
334
334
|
|
|
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;
|
|
335
|
+
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
385
336
|
|
|
386
|
-
const
|
|
337
|
+
const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
387
338
|
? { register: () => {}, unregister: () => {} }
|
|
388
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
339
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
|
|
389
340
|
/**
|
|
390
|
-
|
|
391
|
-
|
|
341
|
+
* A client for Pubky homeserver API, as well as generic HTTP requests to Pubky urls.
|
|
342
|
+
*/
|
|
343
|
+
class Client {
|
|
392
344
|
|
|
393
345
|
static __wrap(ptr) {
|
|
394
346
|
ptr = ptr >>> 0;
|
|
395
|
-
const obj = Object.create(
|
|
347
|
+
const obj = Object.create(Client.prototype);
|
|
396
348
|
obj.__wbg_ptr = ptr;
|
|
397
|
-
|
|
349
|
+
ClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
398
350
|
return obj;
|
|
399
351
|
}
|
|
400
352
|
|
|
401
353
|
__destroy_into_raw() {
|
|
402
354
|
const ptr = this.__wbg_ptr;
|
|
403
355
|
this.__wbg_ptr = 0;
|
|
404
|
-
|
|
356
|
+
ClientFinalization.unregister(this);
|
|
405
357
|
return ptr;
|
|
406
358
|
}
|
|
407
359
|
|
|
408
360
|
free() {
|
|
409
361
|
const ptr = this.__destroy_into_raw();
|
|
410
|
-
wasm.
|
|
362
|
+
wasm.__wbg_client_free(ptr, 0);
|
|
411
363
|
}
|
|
412
364
|
/**
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
365
|
+
* Signup to a homeserver and update Pkarr accordingly.
|
|
366
|
+
*
|
|
367
|
+
* The homeserver is a Pkarr domain name, where the TLD is a Pkarr public key
|
|
368
|
+
* for example "pubky.o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyy"
|
|
369
|
+
* @param {Keypair} keypair
|
|
370
|
+
* @param {PublicKey} homeserver
|
|
371
|
+
* @returns {Promise<Session>}
|
|
372
|
+
*/
|
|
421
373
|
signup(keypair, homeserver) {
|
|
422
374
|
_assertClass(keypair, Keypair);
|
|
423
375
|
_assertClass(homeserver, PublicKey);
|
|
424
|
-
const ret = wasm.
|
|
376
|
+
const ret = wasm.client_signup(this.__wbg_ptr, keypair.__wbg_ptr, homeserver.__wbg_ptr);
|
|
425
377
|
return takeObject(ret);
|
|
426
378
|
}
|
|
427
379
|
/**
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
380
|
+
* Check the current sesison for a given Pubky in its homeserver.
|
|
381
|
+
*
|
|
382
|
+
* Returns [Session] or `None` (if recieved `404 NOT_FOUND`),
|
|
383
|
+
* or throws the recieved error if the response has any other `>=400` status code.
|
|
384
|
+
* @param {PublicKey} pubky
|
|
385
|
+
* @returns {Promise<Session | undefined>}
|
|
386
|
+
*/
|
|
435
387
|
session(pubky) {
|
|
436
388
|
_assertClass(pubky, PublicKey);
|
|
437
|
-
const ret = wasm.
|
|
389
|
+
const ret = wasm.client_session(this.__wbg_ptr, pubky.__wbg_ptr);
|
|
438
390
|
return takeObject(ret);
|
|
439
391
|
}
|
|
440
392
|
/**
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
393
|
+
* Signout from a homeserver.
|
|
394
|
+
* @param {PublicKey} pubky
|
|
395
|
+
* @returns {Promise<void>}
|
|
396
|
+
*/
|
|
445
397
|
signout(pubky) {
|
|
446
398
|
_assertClass(pubky, PublicKey);
|
|
447
|
-
const ret = wasm.
|
|
399
|
+
const ret = wasm.client_signout(this.__wbg_ptr, pubky.__wbg_ptr);
|
|
448
400
|
return takeObject(ret);
|
|
449
401
|
}
|
|
450
402
|
/**
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
403
|
+
* Signin to a homeserver using the root Keypair.
|
|
404
|
+
* @param {Keypair} keypair
|
|
405
|
+
* @returns {Promise<void>}
|
|
406
|
+
*/
|
|
455
407
|
signin(keypair) {
|
|
456
408
|
_assertClass(keypair, Keypair);
|
|
457
|
-
const ret = wasm.
|
|
409
|
+
const ret = wasm.client_signin(this.__wbg_ptr, keypair.__wbg_ptr);
|
|
458
410
|
return takeObject(ret);
|
|
459
411
|
}
|
|
460
412
|
/**
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
413
|
+
* Return `pubkyauth://` url and wait for the incoming [AuthToken]
|
|
414
|
+
* verifying that AuthToken, and if capabilities were requested, signing in to
|
|
415
|
+
* the Pubky's homeserver and returning the [Session] information.
|
|
416
|
+
*
|
|
417
|
+
* Returns a tuple of [pubkyAuthUrl, Promise<Session>]
|
|
418
|
+
* @param {string} relay
|
|
419
|
+
* @param {string} capabilities
|
|
420
|
+
* @returns {Array<any>}
|
|
421
|
+
*/
|
|
470
422
|
authRequest(relay, capabilities) {
|
|
471
423
|
try {
|
|
472
424
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -474,7 +426,7 @@ class PubkyClient {
|
|
|
474
426
|
const len0 = WASM_VECTOR_LEN;
|
|
475
427
|
const ptr1 = passStringToWasm0(capabilities, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
476
428
|
const len1 = WASM_VECTOR_LEN;
|
|
477
|
-
wasm.
|
|
429
|
+
wasm.client_authRequest(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
478
430
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
479
431
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
480
432
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -487,116 +439,153 @@ class PubkyClient {
|
|
|
487
439
|
}
|
|
488
440
|
}
|
|
489
441
|
/**
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
442
|
+
* Sign an [pubky_common::auth::AuthToken], encrypt it and send it to the
|
|
443
|
+
* source of the pubkyauth request url.
|
|
444
|
+
* @param {Keypair} keypair
|
|
445
|
+
* @param {string} pubkyauth_url
|
|
446
|
+
* @returns {Promise<void>}
|
|
447
|
+
*/
|
|
496
448
|
sendAuthToken(keypair, pubkyauth_url) {
|
|
497
449
|
_assertClass(keypair, Keypair);
|
|
498
450
|
const ptr0 = passStringToWasm0(pubkyauth_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
499
451
|
const len0 = WASM_VECTOR_LEN;
|
|
500
|
-
const ret = wasm.
|
|
452
|
+
const ret = wasm.client_sendAuthToken(this.__wbg_ptr, keypair.__wbg_ptr, ptr0, len0);
|
|
501
453
|
return takeObject(ret);
|
|
502
454
|
}
|
|
503
455
|
/**
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
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);
|
|
456
|
+
* Create Client with default Settings including default relays
|
|
457
|
+
*/
|
|
458
|
+
constructor() {
|
|
459
|
+
const ret = wasm.client_new();
|
|
460
|
+
this.__wbg_ptr = ret >>> 0;
|
|
461
|
+
ClientFinalization.register(this, this.__wbg_ptr, this);
|
|
462
|
+
return this;
|
|
516
463
|
}
|
|
517
464
|
/**
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
const ret = wasm.
|
|
526
|
-
return
|
|
465
|
+
* Create a client with with configurations appropriate for local testing:
|
|
466
|
+
* - set Pkarr relays to `["http://localhost:15411"]` instead of default relay.
|
|
467
|
+
* - transform `pubky://<pkarr public key>` to `http://<pkarr public key` instead of `https:`
|
|
468
|
+
* and read the homeserver HTTP port from the [reserved service parameter key](pubky_common::constants::reserved_param_keys::HTTP_PORT)
|
|
469
|
+
* @returns {Client}
|
|
470
|
+
*/
|
|
471
|
+
static testnet() {
|
|
472
|
+
const ret = wasm.client_testnet();
|
|
473
|
+
return Client.__wrap(ret);
|
|
527
474
|
}
|
|
528
475
|
/**
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
476
|
+
* Returns a list of Pubky urls (as strings).
|
|
477
|
+
*
|
|
478
|
+
* - `url`: The Pubky url (string) to the directory you want to list its content.
|
|
479
|
+
* - `cursor`: Either a full `pubky://` Url (from previous list response),
|
|
480
|
+
* or a path (to a file or directory) relative to the `url`
|
|
481
|
+
* - `reverse`: List in reverse order
|
|
482
|
+
* - `limit` Limit the number of urls in the response
|
|
483
|
+
* - `shallow`: List directories and files, instead of flat list of files.
|
|
484
|
+
* @param {string} url
|
|
485
|
+
* @param {string | null} [cursor]
|
|
486
|
+
* @param {boolean | null} [reverse]
|
|
487
|
+
* @param {number | null} [limit]
|
|
488
|
+
* @param {boolean | null} [shallow]
|
|
489
|
+
* @returns {Promise<Array<any>>}
|
|
490
|
+
*/
|
|
491
|
+
list(url, cursor, reverse, limit, shallow) {
|
|
534
492
|
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
535
493
|
const len0 = WASM_VECTOR_LEN;
|
|
536
|
-
|
|
494
|
+
var ptr1 = isLikeNone(cursor) ? 0 : passStringToWasm0(cursor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
495
|
+
var len1 = WASM_VECTOR_LEN;
|
|
496
|
+
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
497
|
return takeObject(ret);
|
|
538
498
|
}
|
|
539
499
|
/**
|
|
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) {
|
|
500
|
+
* @param {string} url
|
|
501
|
+
* @param {any | null} [request_init]
|
|
502
|
+
* @returns {Promise<Promise<any>>}
|
|
503
|
+
*/
|
|
504
|
+
fetch(url, request_init) {
|
|
556
505
|
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
557
506
|
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);
|
|
507
|
+
const ret = wasm.client_fetch(this.__wbg_ptr, ptr0, len0, isLikeNone(request_init) ? 0 : addHeapObject(request_init));
|
|
561
508
|
return takeObject(ret);
|
|
562
509
|
}
|
|
510
|
+
}
|
|
511
|
+
module.exports.Client = Client;
|
|
512
|
+
|
|
513
|
+
const KeypairFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
514
|
+
? { register: () => {}, unregister: () => {} }
|
|
515
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_keypair_free(ptr >>> 0, 1));
|
|
516
|
+
|
|
517
|
+
class Keypair {
|
|
518
|
+
|
|
519
|
+
static __wrap(ptr) {
|
|
520
|
+
ptr = ptr >>> 0;
|
|
521
|
+
const obj = Object.create(Keypair.prototype);
|
|
522
|
+
obj.__wbg_ptr = ptr;
|
|
523
|
+
KeypairFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
524
|
+
return obj;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
__destroy_into_raw() {
|
|
528
|
+
const ptr = this.__wbg_ptr;
|
|
529
|
+
this.__wbg_ptr = 0;
|
|
530
|
+
KeypairFinalization.unregister(this);
|
|
531
|
+
return ptr;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
free() {
|
|
535
|
+
const ptr = this.__destroy_into_raw();
|
|
536
|
+
wasm.__wbg_keypair_free(ptr, 0);
|
|
537
|
+
}
|
|
563
538
|
/**
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
return this;
|
|
539
|
+
* Generate a random [Keypair]
|
|
540
|
+
* @returns {Keypair}
|
|
541
|
+
*/
|
|
542
|
+
static random() {
|
|
543
|
+
const ret = wasm.keypair_random();
|
|
544
|
+
return Keypair.__wrap(ret);
|
|
571
545
|
}
|
|
572
546
|
/**
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
static
|
|
578
|
-
|
|
579
|
-
|
|
547
|
+
* Generate a [Keypair] from a secret key.
|
|
548
|
+
* @param {Uint8Array} secret_key
|
|
549
|
+
* @returns {Keypair}
|
|
550
|
+
*/
|
|
551
|
+
static fromSecretKey(secret_key) {
|
|
552
|
+
try {
|
|
553
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
554
|
+
wasm.keypair_fromSecretKey(retptr, addHeapObject(secret_key));
|
|
555
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
556
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
557
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
558
|
+
if (r2) {
|
|
559
|
+
throw takeObject(r1);
|
|
560
|
+
}
|
|
561
|
+
return Keypair.__wrap(r0);
|
|
562
|
+
} finally {
|
|
563
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
564
|
+
}
|
|
580
565
|
}
|
|
581
566
|
/**
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
588
|
-
const len0 = WASM_VECTOR_LEN;
|
|
589
|
-
const ret = wasm.pubkyclient_fetch(this.__wbg_ptr, ptr0, len0, addHeapObject(init));
|
|
567
|
+
* Returns the secret key of this keypair.
|
|
568
|
+
* @returns {Uint8Array}
|
|
569
|
+
*/
|
|
570
|
+
secretKey() {
|
|
571
|
+
const ret = wasm.keypair_secretKey(this.__wbg_ptr);
|
|
590
572
|
return takeObject(ret);
|
|
591
573
|
}
|
|
574
|
+
/**
|
|
575
|
+
* Returns the [PublicKey] of this keypair.
|
|
576
|
+
* @returns {PublicKey}
|
|
577
|
+
*/
|
|
578
|
+
publicKey() {
|
|
579
|
+
const ret = wasm.keypair_publicKey(this.__wbg_ptr);
|
|
580
|
+
return PublicKey.__wrap(ret);
|
|
581
|
+
}
|
|
592
582
|
}
|
|
593
|
-
module.exports.
|
|
583
|
+
module.exports.Keypair = Keypair;
|
|
594
584
|
|
|
595
585
|
const PublicKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
596
586
|
? { register: () => {}, unregister: () => {} }
|
|
597
587
|
: new FinalizationRegistry(ptr => wasm.__wbg_publickey_free(ptr >>> 0, 1));
|
|
598
|
-
|
|
599
|
-
*/
|
|
588
|
+
|
|
600
589
|
class PublicKey {
|
|
601
590
|
|
|
602
591
|
static __wrap(ptr) {
|
|
@@ -619,17 +608,17 @@ class PublicKey {
|
|
|
619
608
|
wasm.__wbg_publickey_free(ptr, 0);
|
|
620
609
|
}
|
|
621
610
|
/**
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
611
|
+
* Convert the PublicKey to Uint8Array
|
|
612
|
+
* @returns {Uint8Array}
|
|
613
|
+
*/
|
|
625
614
|
to_uint8array() {
|
|
626
615
|
const ret = wasm.publickey_to_uint8array(this.__wbg_ptr);
|
|
627
616
|
return takeObject(ret);
|
|
628
617
|
}
|
|
629
618
|
/**
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
619
|
+
* Returns the z-base32 encoding of this public key
|
|
620
|
+
* @returns {string}
|
|
621
|
+
*/
|
|
633
622
|
z32() {
|
|
634
623
|
let deferred1_0;
|
|
635
624
|
let deferred1_1;
|
|
@@ -647,10 +636,10 @@ class PublicKey {
|
|
|
647
636
|
}
|
|
648
637
|
}
|
|
649
638
|
/**
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
639
|
+
* @throws
|
|
640
|
+
* @param {any} value
|
|
641
|
+
* @returns {PublicKey}
|
|
642
|
+
*/
|
|
654
643
|
static from(value) {
|
|
655
644
|
try {
|
|
656
645
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -672,8 +661,7 @@ module.exports.PublicKey = PublicKey;
|
|
|
672
661
|
const SessionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
673
662
|
? { register: () => {}, unregister: () => {} }
|
|
674
663
|
: new FinalizationRegistry(ptr => wasm.__wbg_session_free(ptr >>> 0, 1));
|
|
675
|
-
|
|
676
|
-
*/
|
|
664
|
+
|
|
677
665
|
class Session {
|
|
678
666
|
|
|
679
667
|
static __wrap(ptr) {
|
|
@@ -696,17 +684,17 @@ class Session {
|
|
|
696
684
|
wasm.__wbg_session_free(ptr, 0);
|
|
697
685
|
}
|
|
698
686
|
/**
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
687
|
+
* Return the [PublicKey] of this session
|
|
688
|
+
* @returns {PublicKey}
|
|
689
|
+
*/
|
|
702
690
|
pubky() {
|
|
703
691
|
const ret = wasm.session_pubky(this.__wbg_ptr);
|
|
704
692
|
return PublicKey.__wrap(ret);
|
|
705
693
|
}
|
|
706
694
|
/**
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
695
|
+
* Return the capabilities that this session has.
|
|
696
|
+
* @returns {string[]}
|
|
697
|
+
*/
|
|
710
698
|
capabilities() {
|
|
711
699
|
try {
|
|
712
700
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -723,131 +711,101 @@ class Session {
|
|
|
723
711
|
}
|
|
724
712
|
module.exports.Session = Session;
|
|
725
713
|
|
|
726
|
-
module.exports.
|
|
727
|
-
|
|
728
|
-
return addHeapObject(ret);
|
|
714
|
+
module.exports.__wbg_abort_775ef1d17fc65868 = function(arg0) {
|
|
715
|
+
getObject(arg0).abort();
|
|
729
716
|
};
|
|
730
717
|
|
|
731
|
-
module.exports.
|
|
732
|
-
|
|
733
|
-
};
|
|
718
|
+
module.exports.__wbg_append_8c7dd8d641a5f01b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
719
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
720
|
+
}, arguments) };
|
|
734
721
|
|
|
735
|
-
module.exports.
|
|
736
|
-
const ret =
|
|
722
|
+
module.exports.__wbg_arrayBuffer_d1b44c4390db422f = function() { return handleError(function (arg0) {
|
|
723
|
+
const ret = getObject(arg0).arrayBuffer();
|
|
737
724
|
return addHeapObject(ret);
|
|
738
|
-
};
|
|
725
|
+
}, arguments) };
|
|
739
726
|
|
|
740
|
-
module.exports.
|
|
741
|
-
const ret =
|
|
727
|
+
module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
728
|
+
const ret = getObject(arg0).buffer;
|
|
742
729
|
return addHeapObject(ret);
|
|
743
730
|
};
|
|
744
731
|
|
|
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);
|
|
732
|
+
module.exports.__wbg_byteLength_e674b853d9c77e1d = function(arg0) {
|
|
733
|
+
const ret = getObject(arg0).byteLength;
|
|
734
|
+
return ret;
|
|
752
735
|
};
|
|
753
736
|
|
|
754
|
-
module.exports.
|
|
755
|
-
const ret =
|
|
737
|
+
module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
738
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
756
739
|
return addHeapObject(ret);
|
|
757
|
-
};
|
|
740
|
+
}, arguments) };
|
|
758
741
|
|
|
759
|
-
module.exports.
|
|
760
|
-
const ret =
|
|
742
|
+
module.exports.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
743
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
761
744
|
return addHeapObject(ret);
|
|
762
|
-
};
|
|
745
|
+
}, arguments) };
|
|
763
746
|
|
|
764
|
-
module.exports.
|
|
765
|
-
const ret = getObject(arg0);
|
|
747
|
+
module.exports.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
|
|
748
|
+
const ret = getObject(arg0).crypto;
|
|
766
749
|
return addHeapObject(ret);
|
|
767
750
|
};
|
|
768
751
|
|
|
769
|
-
module.exports.
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
const ret = false;
|
|
752
|
+
module.exports.__wbg_debug_e17b51583ca6a632 = function(arg0, arg1, arg2, arg3) {
|
|
753
|
+
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
module.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
|
|
757
|
+
const ret = getObject(arg0).done;
|
|
776
758
|
return ret;
|
|
777
759
|
};
|
|
778
760
|
|
|
779
|
-
module.exports.
|
|
780
|
-
|
|
761
|
+
module.exports.__wbg_error_80de38b3f7cc3c3c = function(arg0, arg1, arg2, arg3) {
|
|
762
|
+
console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
781
763
|
};
|
|
782
764
|
|
|
783
|
-
module.exports.
|
|
784
|
-
const ret = getObject(arg0)
|
|
765
|
+
module.exports.__wbg_fetch_408fc9f7fddb9d4e = function(arg0) {
|
|
766
|
+
const ret = fetch(getObject(arg0));
|
|
785
767
|
return addHeapObject(ret);
|
|
786
768
|
};
|
|
787
769
|
|
|
788
|
-
module.exports.
|
|
789
|
-
const ret =
|
|
790
|
-
return ret;
|
|
770
|
+
module.exports.__wbg_fetch_4465c2b10f21a927 = function(arg0) {
|
|
771
|
+
const ret = fetch(getObject(arg0));
|
|
772
|
+
return addHeapObject(ret);
|
|
791
773
|
};
|
|
792
774
|
|
|
793
|
-
module.exports.
|
|
775
|
+
module.exports.__wbg_fetch_509096533071c657 = function(arg0, arg1) {
|
|
794
776
|
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
795
777
|
return addHeapObject(ret);
|
|
796
778
|
};
|
|
797
779
|
|
|
798
|
-
module.exports.
|
|
799
|
-
|
|
800
|
-
return addHeapObject(ret);
|
|
780
|
+
module.exports.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
|
|
781
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
801
782
|
}, arguments) };
|
|
802
783
|
|
|
803
|
-
module.exports.
|
|
804
|
-
getObject(arg0)
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
module.exports.__wbg_setcredentials_2b67800db3f7b621 = function(arg0, arg1) {
|
|
808
|
-
getObject(arg0).credentials = ["omit","same-origin","include",][arg1];
|
|
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);
|
|
817
|
-
};
|
|
818
|
-
|
|
819
|
-
module.exports.__wbg_setmode_a781aae2bd3df202 = function(arg0, arg1) {
|
|
820
|
-
getObject(arg0).mode = ["same-origin","no-cors","cors","navigate",][arg1];
|
|
821
|
-
};
|
|
822
|
-
|
|
823
|
-
module.exports.__wbg_setsignal_91c4e8ebd04eb935 = function(arg0, arg1) {
|
|
824
|
-
getObject(arg0).signal = getObject(arg1);
|
|
825
|
-
};
|
|
784
|
+
module.exports.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
|
|
785
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
786
|
+
return addHeapObject(ret);
|
|
787
|
+
}, arguments) };
|
|
826
788
|
|
|
827
|
-
module.exports.
|
|
828
|
-
const ret = getObject(arg0).
|
|
789
|
+
module.exports.__wbg_getheaders_8326221cf02f205d = function(arg0) {
|
|
790
|
+
const ret = getObject(arg0).headers;
|
|
829
791
|
return addHeapObject(ret);
|
|
830
792
|
};
|
|
831
793
|
|
|
832
|
-
module.exports.
|
|
833
|
-
const ret =
|
|
834
|
-
return
|
|
794
|
+
module.exports.__wbg_has_a5ea9117f258a0ec = function() { return handleError(function (arg0, arg1) {
|
|
795
|
+
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
796
|
+
return ret;
|
|
835
797
|
}, arguments) };
|
|
836
798
|
|
|
837
|
-
module.exports.
|
|
838
|
-
getObject(arg0).
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
module.exports.__wbg_new_e27c93803e1acc42 = function() { return handleError(function () {
|
|
842
|
-
const ret = new Headers();
|
|
799
|
+
module.exports.__wbg_headers_9cb51cfd2ac780a4 = function(arg0) {
|
|
800
|
+
const ret = getObject(arg0).headers;
|
|
843
801
|
return addHeapObject(ret);
|
|
844
|
-
}
|
|
802
|
+
};
|
|
845
803
|
|
|
846
|
-
module.exports.
|
|
847
|
-
getObject(arg0)
|
|
848
|
-
}
|
|
804
|
+
module.exports.__wbg_info_033d8b8a0838f1d3 = function(arg0, arg1, arg2, arg3) {
|
|
805
|
+
console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
806
|
+
};
|
|
849
807
|
|
|
850
|
-
module.exports.
|
|
808
|
+
module.exports.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function(arg0) {
|
|
851
809
|
let result;
|
|
852
810
|
try {
|
|
853
811
|
result = getObject(arg0) instanceof Response;
|
|
@@ -858,289 +816,349 @@ module.exports.__wbg_instanceof_Response_e91b7eb7c611a9ae = function(arg0) {
|
|
|
858
816
|
return ret;
|
|
859
817
|
};
|
|
860
818
|
|
|
861
|
-
module.exports.
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
819
|
+
module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
|
820
|
+
let result;
|
|
821
|
+
try {
|
|
822
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
823
|
+
} catch (_) {
|
|
824
|
+
result = false;
|
|
825
|
+
}
|
|
826
|
+
const ret = result;
|
|
827
|
+
return ret;
|
|
867
828
|
};
|
|
868
829
|
|
|
869
|
-
module.exports.
|
|
870
|
-
const ret =
|
|
830
|
+
module.exports.__wbg_iterator_9a24c88df860dc65 = function() {
|
|
831
|
+
const ret = Symbol.iterator;
|
|
832
|
+
return addHeapObject(ret);
|
|
833
|
+
};
|
|
834
|
+
|
|
835
|
+
module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
836
|
+
const ret = getObject(arg0).length;
|
|
871
837
|
return ret;
|
|
872
838
|
};
|
|
873
839
|
|
|
874
|
-
module.exports.
|
|
875
|
-
|
|
840
|
+
module.exports.__wbg_log_cad59bb680daec67 = function(arg0, arg1, arg2, arg3) {
|
|
841
|
+
console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
module.exports.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
|
|
845
|
+
const ret = getObject(arg0).msCrypto;
|
|
876
846
|
return addHeapObject(ret);
|
|
877
847
|
};
|
|
878
848
|
|
|
879
|
-
module.exports.
|
|
880
|
-
const ret =
|
|
849
|
+
module.exports.__wbg_new_018dcc2d6c8c2f6a = function() { return handleError(function () {
|
|
850
|
+
const ret = new Headers();
|
|
881
851
|
return addHeapObject(ret);
|
|
882
852
|
}, arguments) };
|
|
883
853
|
|
|
884
|
-
module.exports.
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
854
|
+
module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
855
|
+
try {
|
|
856
|
+
var state0 = {a: arg0, b: arg1};
|
|
857
|
+
var cb0 = (arg0, arg1) => {
|
|
858
|
+
const a = state0.a;
|
|
859
|
+
state0.a = 0;
|
|
860
|
+
try {
|
|
861
|
+
return __wbg_adapter_153(a, state0.b, arg0, arg1);
|
|
862
|
+
} finally {
|
|
863
|
+
state0.a = a;
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
const ret = new Promise(cb0);
|
|
867
|
+
return addHeapObject(ret);
|
|
868
|
+
} finally {
|
|
869
|
+
state0.a = state0.b = 0;
|
|
870
|
+
}
|
|
888
871
|
};
|
|
889
872
|
|
|
890
|
-
module.exports.
|
|
891
|
-
const ret =
|
|
873
|
+
module.exports.__wbg_new_405e22f390576ce2 = function() {
|
|
874
|
+
const ret = new Object();
|
|
892
875
|
return addHeapObject(ret);
|
|
893
876
|
};
|
|
894
877
|
|
|
895
|
-
module.exports.
|
|
896
|
-
const ret =
|
|
878
|
+
module.exports.__wbg_new_78feb108b6472713 = function() {
|
|
879
|
+
const ret = new Array();
|
|
897
880
|
return addHeapObject(ret);
|
|
898
881
|
};
|
|
899
882
|
|
|
900
|
-
module.exports.
|
|
901
|
-
const ret = getObject(arg0)
|
|
883
|
+
module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
884
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
902
885
|
return addHeapObject(ret);
|
|
903
886
|
};
|
|
904
887
|
|
|
905
|
-
module.exports.
|
|
906
|
-
const ret =
|
|
888
|
+
module.exports.__wbg_new_e25e5aab09ff45db = function() { return handleError(function () {
|
|
889
|
+
const ret = new AbortController();
|
|
907
890
|
return addHeapObject(ret);
|
|
908
|
-
};
|
|
891
|
+
}, arguments) };
|
|
909
892
|
|
|
910
|
-
module.exports.
|
|
911
|
-
const ret =
|
|
912
|
-
return ret;
|
|
893
|
+
module.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
894
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
895
|
+
return addHeapObject(ret);
|
|
913
896
|
};
|
|
914
897
|
|
|
915
|
-
module.exports.
|
|
916
|
-
const ret =
|
|
898
|
+
module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
|
|
899
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
917
900
|
return addHeapObject(ret);
|
|
918
|
-
}
|
|
901
|
+
};
|
|
919
902
|
|
|
920
|
-
module.exports.
|
|
921
|
-
const ret =
|
|
903
|
+
module.exports.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
|
|
904
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
922
905
|
return addHeapObject(ret);
|
|
923
906
|
};
|
|
924
907
|
|
|
925
|
-
module.exports.
|
|
926
|
-
|
|
908
|
+
module.exports.__wbg_newwithstrandinit_06c535e0a867c635 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
909
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
910
|
+
return addHeapObject(ret);
|
|
927
911
|
}, arguments) };
|
|
928
912
|
|
|
929
|
-
module.exports.
|
|
930
|
-
getObject(arg0).
|
|
913
|
+
module.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
|
|
914
|
+
const ret = getObject(arg0).next;
|
|
915
|
+
return addHeapObject(ret);
|
|
916
|
+
};
|
|
917
|
+
|
|
918
|
+
module.exports.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
|
|
919
|
+
const ret = getObject(arg0).next();
|
|
920
|
+
return addHeapObject(ret);
|
|
931
921
|
}, arguments) };
|
|
932
922
|
|
|
933
|
-
module.exports.
|
|
934
|
-
const ret =
|
|
923
|
+
module.exports.__wbg_node_02999533c4ea02e3 = function(arg0) {
|
|
924
|
+
const ret = getObject(arg0).node;
|
|
935
925
|
return addHeapObject(ret);
|
|
936
926
|
};
|
|
937
927
|
|
|
938
|
-
module.exports.
|
|
939
|
-
const ret =
|
|
940
|
-
return
|
|
928
|
+
module.exports.__wbg_now_807e54c39636c349 = function() {
|
|
929
|
+
const ret = Date.now();
|
|
930
|
+
return ret;
|
|
941
931
|
};
|
|
942
932
|
|
|
943
|
-
module.exports.
|
|
944
|
-
const ret = getObject(arg0).
|
|
933
|
+
module.exports.__wbg_process_5c1d670bc53614b8 = function(arg0) {
|
|
934
|
+
const ret = getObject(arg0).process;
|
|
945
935
|
return addHeapObject(ret);
|
|
946
936
|
};
|
|
947
937
|
|
|
948
|
-
module.exports.
|
|
949
|
-
const ret =
|
|
938
|
+
module.exports.__wbg_publickey_new = function(arg0) {
|
|
939
|
+
const ret = PublicKey.__wrap(arg0);
|
|
950
940
|
return addHeapObject(ret);
|
|
951
941
|
};
|
|
952
942
|
|
|
953
|
-
module.exports.
|
|
954
|
-
const ret =
|
|
955
|
-
return
|
|
943
|
+
module.exports.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
|
|
944
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
945
|
+
return ret;
|
|
956
946
|
};
|
|
957
947
|
|
|
958
|
-
module.exports.
|
|
959
|
-
|
|
960
|
-
return addHeapObject(ret);
|
|
948
|
+
module.exports.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
|
|
949
|
+
queueMicrotask(getObject(arg0));
|
|
961
950
|
};
|
|
962
951
|
|
|
963
|
-
module.exports.
|
|
964
|
-
const ret =
|
|
952
|
+
module.exports.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
|
|
953
|
+
const ret = getObject(arg0).queueMicrotask;
|
|
965
954
|
return addHeapObject(ret);
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
module.exports.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
|
|
958
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
966
959
|
}, arguments) };
|
|
967
960
|
|
|
968
|
-
module.exports.
|
|
969
|
-
const ret =
|
|
961
|
+
module.exports.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
|
|
962
|
+
const ret = module.require;
|
|
970
963
|
return addHeapObject(ret);
|
|
971
964
|
}, arguments) };
|
|
972
965
|
|
|
973
|
-
module.exports.
|
|
974
|
-
const ret =
|
|
966
|
+
module.exports.__wbg_resolve_4851785c9c5f573d = function(arg0) {
|
|
967
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
975
968
|
return addHeapObject(ret);
|
|
976
|
-
}
|
|
969
|
+
};
|
|
977
970
|
|
|
978
|
-
module.exports.
|
|
979
|
-
const ret =
|
|
971
|
+
module.exports.__wbg_session_new = function(arg0) {
|
|
972
|
+
const ret = Session.__wrap(arg0);
|
|
980
973
|
return addHeapObject(ret);
|
|
981
|
-
}
|
|
974
|
+
};
|
|
982
975
|
|
|
983
|
-
module.exports.
|
|
984
|
-
|
|
985
|
-
return ret;
|
|
976
|
+
module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
977
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
986
978
|
};
|
|
987
979
|
|
|
988
|
-
module.exports.
|
|
989
|
-
|
|
990
|
-
return ret;
|
|
980
|
+
module.exports.__wbg_setbody_5923b78a95eedf29 = function(arg0, arg1) {
|
|
981
|
+
getObject(arg0).body = getObject(arg1);
|
|
991
982
|
};
|
|
992
983
|
|
|
993
|
-
module.exports.
|
|
994
|
-
|
|
995
|
-
return addHeapObject(ret);
|
|
984
|
+
module.exports.__wbg_setcredentials_c3a22f1cd105a2c6 = function(arg0, arg1) {
|
|
985
|
+
getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
996
986
|
};
|
|
997
987
|
|
|
998
|
-
module.exports.
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
}, arguments) };
|
|
988
|
+
module.exports.__wbg_setheaders_834c0bdb6a8949ad = function(arg0, arg1) {
|
|
989
|
+
getObject(arg0).headers = getObject(arg1);
|
|
990
|
+
};
|
|
1002
991
|
|
|
1003
|
-
module.exports.
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
}, arguments) };
|
|
992
|
+
module.exports.__wbg_setmethod_3c5280fe5d890842 = function(arg0, arg1, arg2) {
|
|
993
|
+
getObject(arg0).method = getStringFromWasm0(arg1, arg2);
|
|
994
|
+
};
|
|
1007
995
|
|
|
1008
|
-
module.exports.
|
|
1009
|
-
|
|
996
|
+
module.exports.__wbg_setmode_5dc300b865044b65 = function(arg0, arg1) {
|
|
997
|
+
getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
|
|
998
|
+
};
|
|
999
|
+
|
|
1000
|
+
module.exports.__wbg_setsignal_75b21ef3a81de905 = function(arg0, arg1) {
|
|
1001
|
+
getObject(arg0).signal = getObject(arg1);
|
|
1002
|
+
};
|
|
1003
|
+
|
|
1004
|
+
module.exports.__wbg_signal_aaf9ad74119f20a4 = function(arg0) {
|
|
1005
|
+
const ret = getObject(arg0).signal;
|
|
1010
1006
|
return addHeapObject(ret);
|
|
1011
|
-
}
|
|
1007
|
+
};
|
|
1012
1008
|
|
|
1013
|
-
module.exports.
|
|
1014
|
-
const ret =
|
|
1015
|
-
return ret;
|
|
1009
|
+
module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
|
1010
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1011
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1016
1012
|
};
|
|
1017
1013
|
|
|
1018
|
-
module.exports.
|
|
1019
|
-
const ret =
|
|
1020
|
-
return ret;
|
|
1014
|
+
module.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
|
1015
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1016
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1021
1017
|
};
|
|
1022
1018
|
|
|
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
|
-
}
|
|
1019
|
+
module.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
|
1020
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1021
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1040
1022
|
};
|
|
1041
1023
|
|
|
1042
|
-
module.exports.
|
|
1043
|
-
const ret =
|
|
1024
|
+
module.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
|
1025
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1026
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1027
|
+
};
|
|
1028
|
+
|
|
1029
|
+
module.exports.__wbg_status_f6360336ca686bf0 = function(arg0) {
|
|
1030
|
+
const ret = getObject(arg0).status;
|
|
1031
|
+
return ret;
|
|
1032
|
+
};
|
|
1033
|
+
|
|
1034
|
+
module.exports.__wbg_stringify_f7ed6987935b4a24 = function() { return handleError(function (arg0) {
|
|
1035
|
+
const ret = JSON.stringify(getObject(arg0));
|
|
1036
|
+
return addHeapObject(ret);
|
|
1037
|
+
}, arguments) };
|
|
1038
|
+
|
|
1039
|
+
module.exports.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
|
|
1040
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1044
1041
|
return addHeapObject(ret);
|
|
1045
1042
|
};
|
|
1046
1043
|
|
|
1047
|
-
module.exports.
|
|
1044
|
+
module.exports.__wbg_text_7805bea50de2af49 = function() { return handleError(function (arg0) {
|
|
1045
|
+
const ret = getObject(arg0).text();
|
|
1046
|
+
return addHeapObject(ret);
|
|
1047
|
+
}, arguments) };
|
|
1048
|
+
|
|
1049
|
+
module.exports.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
|
|
1048
1050
|
const ret = getObject(arg0).then(getObject(arg1));
|
|
1049
1051
|
return addHeapObject(ret);
|
|
1050
1052
|
};
|
|
1051
1053
|
|
|
1052
|
-
module.exports.
|
|
1054
|
+
module.exports.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
|
|
1053
1055
|
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
1054
1056
|
return addHeapObject(ret);
|
|
1055
1057
|
};
|
|
1056
1058
|
|
|
1057
|
-
module.exports.
|
|
1058
|
-
const ret = getObject(
|
|
1059
|
-
|
|
1059
|
+
module.exports.__wbg_url_ae10c34ca209681d = function(arg0, arg1) {
|
|
1060
|
+
const ret = getObject(arg1).url;
|
|
1061
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1062
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1063
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1064
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1060
1065
|
};
|
|
1061
1066
|
|
|
1062
|
-
module.exports.
|
|
1063
|
-
const ret =
|
|
1067
|
+
module.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
|
1068
|
+
const ret = getObject(arg0).value;
|
|
1064
1069
|
return addHeapObject(ret);
|
|
1065
1070
|
};
|
|
1066
1071
|
|
|
1067
|
-
module.exports.
|
|
1068
|
-
const ret =
|
|
1072
|
+
module.exports.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
|
|
1073
|
+
const ret = getObject(arg0).versions;
|
|
1069
1074
|
return addHeapObject(ret);
|
|
1070
1075
|
};
|
|
1071
1076
|
|
|
1072
|
-
module.exports.
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1077
|
+
module.exports.__wbg_warn_aaf1f4664a035bd6 = function(arg0, arg1, arg2, arg3) {
|
|
1078
|
+
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
1079
|
+
};
|
|
1080
|
+
|
|
1081
|
+
module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
1082
|
+
const obj = takeObject(arg0).original;
|
|
1083
|
+
if (obj.cnt-- == 1) {
|
|
1084
|
+
obj.a = 0;
|
|
1085
|
+
return true;
|
|
1078
1086
|
}
|
|
1079
|
-
const ret =
|
|
1087
|
+
const ret = false;
|
|
1080
1088
|
return ret;
|
|
1081
1089
|
};
|
|
1082
1090
|
|
|
1083
|
-
module.exports.
|
|
1084
|
-
const ret =
|
|
1091
|
+
module.exports.__wbindgen_closure_wrapper2765 = function(arg0, arg1, arg2) {
|
|
1092
|
+
const ret = makeMutClosure(arg0, arg1, 530, __wbg_adapter_28);
|
|
1085
1093
|
return addHeapObject(ret);
|
|
1086
1094
|
};
|
|
1087
1095
|
|
|
1088
|
-
module.exports.
|
|
1089
|
-
const ret = getObject(
|
|
1090
|
-
|
|
1096
|
+
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
1097
|
+
const ret = debugString(getObject(arg1));
|
|
1098
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1099
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1100
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1101
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1091
1102
|
};
|
|
1092
1103
|
|
|
1093
|
-
module.exports.
|
|
1094
|
-
const ret = getObject(arg0)
|
|
1104
|
+
module.exports.__wbindgen_is_function = function(arg0) {
|
|
1105
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
1095
1106
|
return ret;
|
|
1096
1107
|
};
|
|
1097
1108
|
|
|
1098
|
-
module.exports.
|
|
1099
|
-
const ret = getObject(arg0)
|
|
1109
|
+
module.exports.__wbindgen_is_null = function(arg0) {
|
|
1110
|
+
const ret = getObject(arg0) === null;
|
|
1100
1111
|
return ret;
|
|
1101
1112
|
};
|
|
1102
1113
|
|
|
1103
|
-
module.exports.
|
|
1104
|
-
getObject(arg0)
|
|
1114
|
+
module.exports.__wbindgen_is_object = function(arg0) {
|
|
1115
|
+
const val = getObject(arg0);
|
|
1116
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
1117
|
+
return ret;
|
|
1105
1118
|
};
|
|
1106
1119
|
|
|
1107
|
-
module.exports.
|
|
1108
|
-
const ret =
|
|
1109
|
-
return
|
|
1110
|
-
}
|
|
1120
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
1121
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
1122
|
+
return ret;
|
|
1123
|
+
};
|
|
1111
1124
|
|
|
1112
|
-
module.exports.
|
|
1113
|
-
const ret =
|
|
1125
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
1126
|
+
const ret = getObject(arg0) === undefined;
|
|
1114
1127
|
return ret;
|
|
1115
|
-
}
|
|
1128
|
+
};
|
|
1116
1129
|
|
|
1117
|
-
module.exports.
|
|
1118
|
-
const ret =
|
|
1130
|
+
module.exports.__wbindgen_memory = function() {
|
|
1131
|
+
const ret = wasm.memory;
|
|
1119
1132
|
return addHeapObject(ret);
|
|
1120
|
-
}
|
|
1133
|
+
};
|
|
1121
1134
|
|
|
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);
|
|
1135
|
+
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
1136
|
+
const ret = getObject(arg0);
|
|
1137
|
+
return addHeapObject(ret);
|
|
1128
1138
|
};
|
|
1129
1139
|
|
|
1130
|
-
module.exports.
|
|
1131
|
-
|
|
1140
|
+
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
1141
|
+
takeObject(arg0);
|
|
1132
1142
|
};
|
|
1133
1143
|
|
|
1134
|
-
module.exports.
|
|
1135
|
-
const
|
|
1136
|
-
|
|
1144
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
1145
|
+
const obj = getObject(arg1);
|
|
1146
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1147
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1148
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1149
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1150
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1137
1151
|
};
|
|
1138
1152
|
|
|
1139
|
-
module.exports.
|
|
1140
|
-
const ret =
|
|
1153
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
1154
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1141
1155
|
return addHeapObject(ret);
|
|
1142
1156
|
};
|
|
1143
1157
|
|
|
1158
|
+
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
1159
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1160
|
+
};
|
|
1161
|
+
|
|
1144
1162
|
const path = require('path').join(__dirname, 'pubky_bg.wasm');
|
|
1145
1163
|
const bytes = require('fs').readFileSync(path);
|
|
1146
1164
|
|