bitmask-core 1.0.7-beta.12 → 1.0.7-beta.13
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/bitmask_core.d.ts +93 -93
- package/bitmask_core.js +649 -649
- package/bitmask_core_bg.wasm +0 -0
- package/bitmask_core_bg.wasm.d.ts +49 -49
- package/package.json +1 -1
package/bitmask_core.js
CHANGED
|
@@ -214,66 +214,16 @@ function debugString(val) {
|
|
|
214
214
|
return className;
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
217
|
-
* @param {string}
|
|
218
|
-
* @param {number} precision
|
|
219
|
-
* @returns {string}
|
|
220
|
-
*/
|
|
221
|
-
export function convert_contract_amount_raw(decimal, precision) {
|
|
222
|
-
let deferred2_0;
|
|
223
|
-
let deferred2_1;
|
|
224
|
-
try {
|
|
225
|
-
const ptr0 = passStringToWasm0(decimal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
226
|
-
const len0 = WASM_VECTOR_LEN;
|
|
227
|
-
const ret = wasm.convert_contract_amount_raw(ptr0, len0, precision);
|
|
228
|
-
deferred2_0 = ret[0];
|
|
229
|
-
deferred2_1 = ret[1];
|
|
230
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
231
|
-
} finally {
|
|
232
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* @param {bigint} amount
|
|
238
|
-
* @param {number} precision
|
|
239
|
-
* @returns {string}
|
|
240
|
-
*/
|
|
241
|
-
export function convert_contract_amount_string(amount, precision) {
|
|
242
|
-
let deferred1_0;
|
|
243
|
-
let deferred1_1;
|
|
244
|
-
try {
|
|
245
|
-
const ret = wasm.convert_contract_amount_string(amount, precision);
|
|
246
|
-
deferred1_0 = ret[0];
|
|
247
|
-
deferred1_1 = ret[1];
|
|
248
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
249
|
-
} finally {
|
|
250
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* @param {string} amount
|
|
256
|
-
* @returns {any}
|
|
257
|
-
*/
|
|
258
|
-
export function parse_contract_amount(amount) {
|
|
259
|
-
const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
260
|
-
const len0 = WASM_VECTOR_LEN;
|
|
261
|
-
const ret = wasm.parse_contract_amount(ptr0, len0);
|
|
262
|
-
return ret;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* @param {string} amount
|
|
267
|
-
* @param {number} precision
|
|
217
|
+
* @param {string} password
|
|
268
218
|
* @returns {string}
|
|
269
219
|
*/
|
|
270
|
-
export function
|
|
220
|
+
export function hash_password(password) {
|
|
271
221
|
let deferred2_0;
|
|
272
222
|
let deferred2_1;
|
|
273
223
|
try {
|
|
274
|
-
const ptr0 = passStringToWasm0(
|
|
224
|
+
const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
275
225
|
const len0 = WASM_VECTOR_LEN;
|
|
276
|
-
const ret = wasm.
|
|
226
|
+
const ret = wasm.hash_password(ptr0, len0);
|
|
277
227
|
deferred2_0 = ret[0];
|
|
278
228
|
deferred2_1 = ret[1];
|
|
279
229
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -283,651 +233,625 @@ export function parse_contract_amount_precision(amount, precision) {
|
|
|
283
233
|
}
|
|
284
234
|
|
|
285
235
|
/**
|
|
286
|
-
* @
|
|
287
|
-
*/
|
|
288
|
-
export function version() {
|
|
289
|
-
const ret = wasm.version();
|
|
290
|
-
return ret;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
294
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
295
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
296
|
-
WASM_VECTOR_LEN = arg.length;
|
|
297
|
-
return ptr;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* @param {string} secret_key
|
|
301
|
-
* @param {string} name
|
|
302
|
-
* @param {Uint8Array} data
|
|
303
|
-
* @param {boolean} force
|
|
304
|
-
* @param {Uint8Array | null} [metadata]
|
|
236
|
+
* @param {string} password
|
|
305
237
|
* @returns {Promise<any>}
|
|
306
238
|
*/
|
|
307
|
-
export function
|
|
308
|
-
const ptr0 = passStringToWasm0(
|
|
239
|
+
export function new_mnemonic(password) {
|
|
240
|
+
const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
309
241
|
const len0 = WASM_VECTOR_LEN;
|
|
310
|
-
const
|
|
311
|
-
const len1 = WASM_VECTOR_LEN;
|
|
312
|
-
const ptr2 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
313
|
-
const len2 = WASM_VECTOR_LEN;
|
|
314
|
-
var ptr3 = isLikeNone(metadata) ? 0 : passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
|
|
315
|
-
var len3 = WASM_VECTOR_LEN;
|
|
316
|
-
const ret = wasm.store(ptr0, len0, ptr1, len1, ptr2, len2, force, ptr3, len3);
|
|
242
|
+
const ret = wasm.new_mnemonic(ptr0, len0);
|
|
317
243
|
return ret;
|
|
318
244
|
}
|
|
319
245
|
|
|
320
246
|
/**
|
|
321
|
-
* @param {string}
|
|
322
|
-
* @param {string}
|
|
247
|
+
* @param {string} seed
|
|
248
|
+
* @param {string} password
|
|
323
249
|
* @returns {Promise<any>}
|
|
324
250
|
*/
|
|
325
|
-
export function
|
|
326
|
-
const ptr0 = passStringToWasm0(
|
|
251
|
+
export function save_mnemonic(seed, password) {
|
|
252
|
+
const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
327
253
|
const len0 = WASM_VECTOR_LEN;
|
|
328
|
-
const ptr1 = passStringToWasm0(
|
|
254
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
329
255
|
const len1 = WASM_VECTOR_LEN;
|
|
330
|
-
const ret = wasm.
|
|
256
|
+
const ret = wasm.save_mnemonic(ptr0, len0, ptr1, len1);
|
|
331
257
|
return ret;
|
|
332
258
|
}
|
|
333
259
|
|
|
334
260
|
/**
|
|
335
|
-
* @param {string}
|
|
336
|
-
* @param {string}
|
|
261
|
+
* @param {string} hash
|
|
262
|
+
* @param {string} encrypted_descriptors
|
|
263
|
+
* @param {string} seed_password
|
|
337
264
|
* @returns {Promise<any>}
|
|
338
265
|
*/
|
|
339
|
-
export function
|
|
340
|
-
const ptr0 = passStringToWasm0(
|
|
266
|
+
export function decrypt_wallet(hash, encrypted_descriptors, seed_password) {
|
|
267
|
+
const ptr0 = passStringToWasm0(hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
341
268
|
const len0 = WASM_VECTOR_LEN;
|
|
342
|
-
const ptr1 = passStringToWasm0(
|
|
269
|
+
const ptr1 = passStringToWasm0(encrypted_descriptors, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
343
270
|
const len1 = WASM_VECTOR_LEN;
|
|
344
|
-
const
|
|
271
|
+
const ptr2 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
272
|
+
const len2 = WASM_VECTOR_LEN;
|
|
273
|
+
const ret = wasm.decrypt_wallet(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
345
274
|
return ret;
|
|
346
275
|
}
|
|
347
276
|
|
|
348
277
|
/**
|
|
349
|
-
* @param {
|
|
350
|
-
* @
|
|
351
|
-
|
|
352
|
-
export function encode_hex(bytes) {
|
|
353
|
-
let deferred2_0;
|
|
354
|
-
let deferred2_1;
|
|
355
|
-
try {
|
|
356
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
357
|
-
const len0 = WASM_VECTOR_LEN;
|
|
358
|
-
const ret = wasm.encode_hex(ptr0, len0);
|
|
359
|
-
deferred2_0 = ret[0];
|
|
360
|
-
deferred2_1 = ret[1];
|
|
361
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
362
|
-
} finally {
|
|
363
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* @param {Uint8Array} bytes
|
|
369
|
-
* @returns {string}
|
|
370
|
-
*/
|
|
371
|
-
export function encode_base64(bytes) {
|
|
372
|
-
let deferred2_0;
|
|
373
|
-
let deferred2_1;
|
|
374
|
-
try {
|
|
375
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
376
|
-
const len0 = WASM_VECTOR_LEN;
|
|
377
|
-
const ret = wasm.encode_base64(ptr0, len0);
|
|
378
|
-
deferred2_0 = ret[0];
|
|
379
|
-
deferred2_1 = ret[1];
|
|
380
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
381
|
-
} finally {
|
|
382
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
function takeFromExternrefTable0(idx) {
|
|
387
|
-
const value = wasm.__wbindgen_export_4.get(idx);
|
|
388
|
-
wasm.__externref_table_dealloc(idx);
|
|
389
|
-
return value;
|
|
390
|
-
}
|
|
391
|
-
/**
|
|
392
|
-
* @param {string} string
|
|
393
|
-
* @returns {Uint8Array}
|
|
394
|
-
*/
|
|
395
|
-
export function decode_hex(string) {
|
|
396
|
-
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
397
|
-
const len0 = WASM_VECTOR_LEN;
|
|
398
|
-
const ret = wasm.decode_hex(ptr0, len0);
|
|
399
|
-
if (ret[3]) {
|
|
400
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
401
|
-
}
|
|
402
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
403
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
404
|
-
return v2;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* @param {string} string
|
|
409
|
-
* @returns {Uint8Array}
|
|
410
|
-
*/
|
|
411
|
-
export function decode_base64(string) {
|
|
412
|
-
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
413
|
-
const len0 = WASM_VECTOR_LEN;
|
|
414
|
-
const ret = wasm.decode_base64(ptr0, len0);
|
|
415
|
-
if (ret[3]) {
|
|
416
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
417
|
-
}
|
|
418
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
419
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
420
|
-
return v2;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* @param {string} nostr_hex_sk
|
|
425
|
-
* @param {any} request
|
|
278
|
+
* @param {string} hash
|
|
279
|
+
* @param {string} encrypted_descriptors
|
|
280
|
+
* @param {string} seed_password
|
|
426
281
|
* @returns {Promise<any>}
|
|
427
282
|
*/
|
|
428
|
-
export function
|
|
429
|
-
const ptr0 = passStringToWasm0(
|
|
283
|
+
export function upgrade_wallet(hash, encrypted_descriptors, seed_password) {
|
|
284
|
+
const ptr0 = passStringToWasm0(hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
430
285
|
const len0 = WASM_VECTOR_LEN;
|
|
431
|
-
const
|
|
286
|
+
const ptr1 = passStringToWasm0(encrypted_descriptors, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
287
|
+
const len1 = WASM_VECTOR_LEN;
|
|
288
|
+
const ptr2 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
289
|
+
const len2 = WASM_VECTOR_LEN;
|
|
290
|
+
const ret = wasm.upgrade_wallet(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
432
291
|
return ret;
|
|
433
292
|
}
|
|
434
293
|
|
|
435
294
|
/**
|
|
436
|
-
* @param {string}
|
|
437
|
-
* @param {
|
|
295
|
+
* @param {string} hash
|
|
296
|
+
* @param {string} seed_password
|
|
438
297
|
* @returns {Promise<any>}
|
|
439
298
|
*/
|
|
440
|
-
export function
|
|
441
|
-
const ptr0 = passStringToWasm0(
|
|
299
|
+
export function new_wallet(hash, seed_password) {
|
|
300
|
+
const ptr0 = passStringToWasm0(hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
442
301
|
const len0 = WASM_VECTOR_LEN;
|
|
443
|
-
const
|
|
302
|
+
const ptr1 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
303
|
+
const len1 = WASM_VECTOR_LEN;
|
|
304
|
+
const ret = wasm.new_wallet(ptr0, len0, ptr1, len1);
|
|
444
305
|
return ret;
|
|
445
306
|
}
|
|
446
307
|
|
|
447
308
|
/**
|
|
448
|
-
* @param {string}
|
|
309
|
+
* @param {string} mnemonic
|
|
310
|
+
* @param {string} hash
|
|
311
|
+
* @param {string} seed_password
|
|
449
312
|
* @returns {Promise<any>}
|
|
450
313
|
*/
|
|
451
|
-
export function
|
|
452
|
-
const ptr0 = passStringToWasm0(
|
|
314
|
+
export function encrypt_wallet(mnemonic, hash, seed_password) {
|
|
315
|
+
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
453
316
|
const len0 = WASM_VECTOR_LEN;
|
|
454
|
-
const
|
|
317
|
+
const ptr1 = passStringToWasm0(hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
318
|
+
const len1 = WASM_VECTOR_LEN;
|
|
319
|
+
const ptr2 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
320
|
+
const len2 = WASM_VECTOR_LEN;
|
|
321
|
+
const ret = wasm.encrypt_wallet(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
455
322
|
return ret;
|
|
456
323
|
}
|
|
457
324
|
|
|
458
325
|
/**
|
|
459
|
-
* @param {string}
|
|
326
|
+
* @param {string} descriptor
|
|
327
|
+
* @param {string | null} [change_descriptor]
|
|
460
328
|
* @returns {Promise<any>}
|
|
461
329
|
*/
|
|
462
|
-
export function
|
|
463
|
-
const ptr0 = passStringToWasm0(
|
|
330
|
+
export function get_wallet_data(descriptor, change_descriptor) {
|
|
331
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
464
332
|
const len0 = WASM_VECTOR_LEN;
|
|
465
|
-
|
|
333
|
+
var ptr1 = isLikeNone(change_descriptor) ? 0 : passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
334
|
+
var len1 = WASM_VECTOR_LEN;
|
|
335
|
+
const ret = wasm.get_wallet_data(ptr0, len0, ptr1, len1);
|
|
466
336
|
return ret;
|
|
467
337
|
}
|
|
468
338
|
|
|
469
339
|
/**
|
|
470
|
-
* @param {string} nostr_hex_sk
|
|
471
340
|
* @returns {Promise<any>}
|
|
472
341
|
*/
|
|
473
|
-
export function
|
|
474
|
-
const
|
|
475
|
-
const len0 = WASM_VECTOR_LEN;
|
|
476
|
-
const ret = wasm.check_watcher(ptr0, len0);
|
|
342
|
+
export function sync_wallets() {
|
|
343
|
+
const ret = wasm.sync_wallets();
|
|
477
344
|
return ret;
|
|
478
345
|
}
|
|
479
346
|
|
|
480
347
|
/**
|
|
481
|
-
* @param {string}
|
|
482
|
-
* @param {string}
|
|
348
|
+
* @param {string} descriptor
|
|
349
|
+
* @param {string | null} [change_descriptor]
|
|
483
350
|
* @returns {Promise<any>}
|
|
484
351
|
*/
|
|
485
|
-
export function
|
|
486
|
-
const ptr0 = passStringToWasm0(
|
|
352
|
+
export function get_new_address(descriptor, change_descriptor) {
|
|
353
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
487
354
|
const len0 = WASM_VECTOR_LEN;
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
const ret = wasm.
|
|
355
|
+
var ptr1 = isLikeNone(change_descriptor) ? 0 : passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
356
|
+
var len1 = WASM_VECTOR_LEN;
|
|
357
|
+
const ret = wasm.get_new_address(ptr0, len0, ptr1, len1);
|
|
491
358
|
return ret;
|
|
492
359
|
}
|
|
493
360
|
|
|
494
361
|
/**
|
|
495
|
-
* @param {string}
|
|
496
|
-
* @param {string}
|
|
362
|
+
* @param {string} descriptor
|
|
363
|
+
* @param {string} change_descriptor
|
|
364
|
+
* @param {string} destination
|
|
365
|
+
* @param {bigint} amount
|
|
366
|
+
* @param {boolean} broadcast
|
|
367
|
+
* @param {number | null} [fee_rate]
|
|
497
368
|
* @returns {Promise<any>}
|
|
498
369
|
*/
|
|
499
|
-
export function
|
|
500
|
-
const ptr0 = passStringToWasm0(
|
|
370
|
+
export function send_sats(descriptor, change_descriptor, destination, amount, broadcast, fee_rate) {
|
|
371
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
501
372
|
const len0 = WASM_VECTOR_LEN;
|
|
502
|
-
const ptr1 = passStringToWasm0(
|
|
373
|
+
const ptr1 = passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
503
374
|
const len1 = WASM_VECTOR_LEN;
|
|
504
|
-
const
|
|
375
|
+
const ptr2 = passStringToWasm0(destination, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
376
|
+
const len2 = WASM_VECTOR_LEN;
|
|
377
|
+
const ret = wasm.send_sats(ptr0, len0, ptr1, len1, ptr2, len2, amount, broadcast, isLikeNone(fee_rate) ? 0x100000001 : Math.fround(fee_rate));
|
|
505
378
|
return ret;
|
|
506
379
|
}
|
|
507
380
|
|
|
508
381
|
/**
|
|
509
|
-
* @param {string}
|
|
510
|
-
* @param {string}
|
|
382
|
+
* @param {string} descriptor
|
|
383
|
+
* @param {string} change_descriptor
|
|
384
|
+
* @param {string} rgb_address
|
|
385
|
+
* @param {boolean} broadcast
|
|
386
|
+
* @param {number | null} [fee_rate]
|
|
511
387
|
* @returns {Promise<any>}
|
|
512
388
|
*/
|
|
513
|
-
export function
|
|
514
|
-
const ptr0 = passStringToWasm0(
|
|
389
|
+
export function fund_vault(descriptor, change_descriptor, rgb_address, broadcast, fee_rate) {
|
|
390
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
515
391
|
const len0 = WASM_VECTOR_LEN;
|
|
516
|
-
const ptr1 = passStringToWasm0(
|
|
392
|
+
const ptr1 = passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
517
393
|
const len1 = WASM_VECTOR_LEN;
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
/**
|
|
523
|
-
* @returns {string}
|
|
524
|
-
*/
|
|
525
|
-
export function get_rgb_version() {
|
|
526
|
-
let deferred1_0;
|
|
527
|
-
let deferred1_1;
|
|
528
|
-
try {
|
|
529
|
-
const ret = wasm.get_rgb_version();
|
|
530
|
-
deferred1_0 = ret[0];
|
|
531
|
-
deferred1_1 = ret[1];
|
|
532
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
533
|
-
} finally {
|
|
534
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
* @param {string} nostr_hex_sk
|
|
540
|
-
* @returns {Promise<any>}
|
|
541
|
-
*/
|
|
542
|
-
export function get_rgb_wallet(nostr_hex_sk) {
|
|
543
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
544
|
-
const len0 = WASM_VECTOR_LEN;
|
|
545
|
-
const ret = wasm.get_rgb_wallet(ptr0, len0);
|
|
394
|
+
const ptr2 = passStringToWasm0(rgb_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
395
|
+
const len2 = WASM_VECTOR_LEN;
|
|
396
|
+
const ret = wasm.fund_vault(ptr0, len0, ptr1, len1, ptr2, len2, broadcast, isLikeNone(fee_rate) ? 0x100000001 : Math.fround(fee_rate));
|
|
546
397
|
return ret;
|
|
547
398
|
}
|
|
548
399
|
|
|
549
400
|
/**
|
|
550
|
-
* @param {string}
|
|
401
|
+
* @param {string} rgb_descriptor_xpub
|
|
551
402
|
* @returns {Promise<any>}
|
|
552
403
|
*/
|
|
553
|
-
export function
|
|
554
|
-
const ptr0 = passStringToWasm0(
|
|
404
|
+
export function get_assets_vault(rgb_descriptor_xpub) {
|
|
405
|
+
const ptr0 = passStringToWasm0(rgb_descriptor_xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
555
406
|
const len0 = WASM_VECTOR_LEN;
|
|
556
|
-
const ret = wasm.
|
|
407
|
+
const ret = wasm.get_assets_vault(ptr0, len0);
|
|
557
408
|
return ret;
|
|
558
409
|
}
|
|
559
410
|
|
|
560
411
|
/**
|
|
561
|
-
* @param {string}
|
|
562
|
-
* @param {string}
|
|
412
|
+
* @param {string} destination
|
|
413
|
+
* @param {string} descriptor
|
|
414
|
+
* @param {string | null} [change_descriptor]
|
|
415
|
+
* @param {number | null} [fee_rate]
|
|
563
416
|
* @returns {Promise<any>}
|
|
564
417
|
*/
|
|
565
|
-
export function
|
|
566
|
-
const ptr0 = passStringToWasm0(
|
|
418
|
+
export function drain_wallet(destination, descriptor, change_descriptor, fee_rate) {
|
|
419
|
+
const ptr0 = passStringToWasm0(destination, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
567
420
|
const len0 = WASM_VECTOR_LEN;
|
|
568
|
-
const ptr1 = passStringToWasm0(
|
|
421
|
+
const ptr1 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
569
422
|
const len1 = WASM_VECTOR_LEN;
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* @param {string} nostr_hex_sk
|
|
576
|
-
* @param {boolean} arg1
|
|
577
|
-
* @returns {Promise<any>}
|
|
578
|
-
*/
|
|
579
|
-
export function list_contracts(nostr_hex_sk, arg1) {
|
|
580
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
581
|
-
const len0 = WASM_VECTOR_LEN;
|
|
582
|
-
const ret = wasm.list_contracts(ptr0, len0, arg1);
|
|
423
|
+
var ptr2 = isLikeNone(change_descriptor) ? 0 : passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
424
|
+
var len2 = WASM_VECTOR_LEN;
|
|
425
|
+
const ret = wasm.drain_wallet(ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(fee_rate) ? 0x100000001 : Math.fround(fee_rate));
|
|
583
426
|
return ret;
|
|
584
427
|
}
|
|
585
428
|
|
|
586
429
|
/**
|
|
587
|
-
* @param {string}
|
|
588
|
-
* @param {
|
|
430
|
+
* @param {string} txid
|
|
431
|
+
* @param {number} fee_rate
|
|
432
|
+
* @param {string} descriptor
|
|
433
|
+
* @param {string | null | undefined} change_descriptor
|
|
434
|
+
* @param {boolean} broadcast
|
|
589
435
|
* @returns {Promise<any>}
|
|
590
436
|
*/
|
|
591
|
-
export function
|
|
592
|
-
const ptr0 = passStringToWasm0(
|
|
437
|
+
export function bump_fee(txid, fee_rate, descriptor, change_descriptor, broadcast) {
|
|
438
|
+
const ptr0 = passStringToWasm0(txid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
593
439
|
const len0 = WASM_VECTOR_LEN;
|
|
594
|
-
const ptr1 = passStringToWasm0(
|
|
440
|
+
const ptr1 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
595
441
|
const len1 = WASM_VECTOR_LEN;
|
|
596
|
-
|
|
442
|
+
var ptr2 = isLikeNone(change_descriptor) ? 0 : passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
443
|
+
var len2 = WASM_VECTOR_LEN;
|
|
444
|
+
const ret = wasm.bump_fee(ptr0, len0, fee_rate, ptr1, len1, ptr2, len2, broadcast);
|
|
597
445
|
return ret;
|
|
598
446
|
}
|
|
599
447
|
|
|
600
448
|
/**
|
|
601
|
-
* @param {string} nostr_hex_sk
|
|
602
449
|
* @param {any} request
|
|
603
450
|
* @returns {Promise<any>}
|
|
604
451
|
*/
|
|
605
|
-
export function
|
|
606
|
-
const
|
|
607
|
-
const len0 = WASM_VECTOR_LEN;
|
|
608
|
-
const ret = wasm.issue_contract(ptr0, len0, request);
|
|
452
|
+
export function psbt_sign_and_publish_file(request) {
|
|
453
|
+
const ret = wasm.psbt_sign_and_publish_file(request);
|
|
609
454
|
return ret;
|
|
610
455
|
}
|
|
611
456
|
|
|
612
457
|
/**
|
|
613
|
-
* @param {string} nostr_hex_sk
|
|
614
458
|
* @param {any} request
|
|
615
459
|
* @returns {Promise<any>}
|
|
616
460
|
*/
|
|
617
|
-
export function
|
|
618
|
-
const
|
|
619
|
-
const len0 = WASM_VECTOR_LEN;
|
|
620
|
-
const ret = wasm.issue_contract_proxy(ptr0, len0, request);
|
|
461
|
+
export function psbt_publish_file(request) {
|
|
462
|
+
const ret = wasm.psbt_publish_file(request);
|
|
621
463
|
return ret;
|
|
622
464
|
}
|
|
623
465
|
|
|
624
466
|
/**
|
|
625
|
-
* @param {string}
|
|
626
|
-
* @param {
|
|
467
|
+
* @param {string} username
|
|
468
|
+
* @param {string} password
|
|
627
469
|
* @returns {Promise<any>}
|
|
628
470
|
*/
|
|
629
|
-
export function
|
|
630
|
-
const ptr0 = passStringToWasm0(
|
|
471
|
+
export function create_wallet(username, password) {
|
|
472
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
631
473
|
const len0 = WASM_VECTOR_LEN;
|
|
632
|
-
const
|
|
474
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
475
|
+
const len1 = WASM_VECTOR_LEN;
|
|
476
|
+
const ret = wasm.create_wallet(ptr0, len0, ptr1, len1);
|
|
633
477
|
return ret;
|
|
634
478
|
}
|
|
635
479
|
|
|
636
480
|
/**
|
|
637
|
-
* @param {string}
|
|
638
|
-
* @param {string}
|
|
481
|
+
* @param {string} username
|
|
482
|
+
* @param {string} password
|
|
639
483
|
* @returns {Promise<any>}
|
|
640
484
|
*/
|
|
641
|
-
export function
|
|
642
|
-
const ptr0 = passStringToWasm0(
|
|
485
|
+
export function auth(username, password) {
|
|
486
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
643
487
|
const len0 = WASM_VECTOR_LEN;
|
|
644
|
-
const ptr1 = passStringToWasm0(
|
|
488
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
645
489
|
const len1 = WASM_VECTOR_LEN;
|
|
646
|
-
const ret = wasm.
|
|
490
|
+
const ret = wasm.auth(ptr0, len0, ptr1, len1);
|
|
647
491
|
return ret;
|
|
648
492
|
}
|
|
649
493
|
|
|
650
494
|
/**
|
|
651
|
-
* @param {string}
|
|
495
|
+
* @param {string} description
|
|
496
|
+
* @param {number} amount
|
|
497
|
+
* @param {string} token
|
|
652
498
|
* @returns {Promise<any>}
|
|
653
499
|
*/
|
|
654
|
-
export function
|
|
655
|
-
const ptr0 = passStringToWasm0(
|
|
500
|
+
export function ln_create_invoice(description, amount, token) {
|
|
501
|
+
const ptr0 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
656
502
|
const len0 = WASM_VECTOR_LEN;
|
|
657
|
-
const
|
|
503
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
504
|
+
const len1 = WASM_VECTOR_LEN;
|
|
505
|
+
const ret = wasm.ln_create_invoice(ptr0, len0, amount, ptr1, len1);
|
|
658
506
|
return ret;
|
|
659
507
|
}
|
|
660
508
|
|
|
661
509
|
/**
|
|
662
|
-
* @param {string}
|
|
510
|
+
* @param {string} token
|
|
663
511
|
* @returns {Promise<any>}
|
|
664
512
|
*/
|
|
665
|
-
export function
|
|
666
|
-
const ptr0 = passStringToWasm0(
|
|
513
|
+
export function get_balance(token) {
|
|
514
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
667
515
|
const len0 = WASM_VECTOR_LEN;
|
|
668
|
-
const ret = wasm.
|
|
516
|
+
const ret = wasm.get_balance(ptr0, len0);
|
|
669
517
|
return ret;
|
|
670
518
|
}
|
|
671
519
|
|
|
672
520
|
/**
|
|
673
|
-
* @param {string}
|
|
674
|
-
* @param {any} request
|
|
521
|
+
* @param {string} token
|
|
675
522
|
* @returns {Promise<any>}
|
|
676
523
|
*/
|
|
677
|
-
export function
|
|
678
|
-
const ptr0 = passStringToWasm0(
|
|
524
|
+
export function get_txs(token) {
|
|
525
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
679
526
|
const len0 = WASM_VECTOR_LEN;
|
|
680
|
-
const ret = wasm.
|
|
527
|
+
const ret = wasm.get_txs(ptr0, len0);
|
|
681
528
|
return ret;
|
|
682
529
|
}
|
|
683
530
|
|
|
684
531
|
/**
|
|
685
|
-
* @param {string}
|
|
686
|
-
* @param {
|
|
532
|
+
* @param {string} payment_request
|
|
533
|
+
* @param {string} token
|
|
687
534
|
* @returns {Promise<any>}
|
|
688
535
|
*/
|
|
689
|
-
export function
|
|
690
|
-
const ptr0 = passStringToWasm0(
|
|
536
|
+
export function pay_invoice(payment_request, token) {
|
|
537
|
+
const ptr0 = passStringToWasm0(payment_request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
691
538
|
const len0 = WASM_VECTOR_LEN;
|
|
692
|
-
const
|
|
539
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
540
|
+
const len1 = WASM_VECTOR_LEN;
|
|
541
|
+
const ret = wasm.pay_invoice(ptr0, len0, ptr1, len1);
|
|
693
542
|
return ret;
|
|
694
543
|
}
|
|
695
544
|
|
|
696
545
|
/**
|
|
697
|
-
* @param {string}
|
|
698
|
-
* @param {any} request
|
|
699
|
-
* @param {any} secrets
|
|
546
|
+
* @param {string} payment_hash
|
|
700
547
|
* @returns {Promise<any>}
|
|
701
548
|
*/
|
|
702
|
-
export function
|
|
703
|
-
const ptr0 = passStringToWasm0(
|
|
549
|
+
export function check_payment(payment_hash) {
|
|
550
|
+
const ptr0 = passStringToWasm0(payment_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
704
551
|
const len0 = WASM_VECTOR_LEN;
|
|
705
|
-
const ret = wasm.
|
|
552
|
+
const ret = wasm.check_payment(ptr0, len0);
|
|
706
553
|
return ret;
|
|
707
554
|
}
|
|
708
555
|
|
|
709
556
|
/**
|
|
710
|
-
* @param {string}
|
|
711
|
-
* @param {
|
|
557
|
+
* @param {string} token
|
|
558
|
+
* @param {string | null} [ln_address]
|
|
712
559
|
* @returns {Promise<any>}
|
|
713
560
|
*/
|
|
714
|
-
export function
|
|
715
|
-
const ptr0 = passStringToWasm0(
|
|
561
|
+
export function swap_btc_ln(token, ln_address) {
|
|
562
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
716
563
|
const len0 = WASM_VECTOR_LEN;
|
|
717
|
-
|
|
564
|
+
var ptr1 = isLikeNone(ln_address) ? 0 : passStringToWasm0(ln_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
565
|
+
var len1 = WASM_VECTOR_LEN;
|
|
566
|
+
const ret = wasm.swap_btc_ln(ptr0, len0, ptr1, len1);
|
|
718
567
|
return ret;
|
|
719
568
|
}
|
|
720
569
|
|
|
721
570
|
/**
|
|
722
|
-
* @param {string}
|
|
723
|
-
* @param {
|
|
571
|
+
* @param {string} address
|
|
572
|
+
* @param {bigint} amount
|
|
573
|
+
* @param {string} token
|
|
724
574
|
* @returns {Promise<any>}
|
|
725
575
|
*/
|
|
726
|
-
export function
|
|
727
|
-
const ptr0 = passStringToWasm0(
|
|
576
|
+
export function swap_ln_btc(address, amount, token) {
|
|
577
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
728
578
|
const len0 = WASM_VECTOR_LEN;
|
|
729
|
-
const
|
|
579
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
580
|
+
const len1 = WASM_VECTOR_LEN;
|
|
581
|
+
const ret = wasm.swap_ln_btc(ptr0, len0, amount, ptr1, len1);
|
|
730
582
|
return ret;
|
|
731
583
|
}
|
|
732
584
|
|
|
733
585
|
/**
|
|
734
|
-
* @param {string} nostr_hex_sk
|
|
735
|
-
* @param {any} request
|
|
736
586
|
* @returns {Promise<any>}
|
|
737
587
|
*/
|
|
738
|
-
export function
|
|
739
|
-
const
|
|
740
|
-
const len0 = WASM_VECTOR_LEN;
|
|
741
|
-
const ret = wasm.save_transfer(ptr0, len0, request);
|
|
588
|
+
export function get_network() {
|
|
589
|
+
const ret = wasm.get_network();
|
|
742
590
|
return ret;
|
|
743
591
|
}
|
|
744
592
|
|
|
745
593
|
/**
|
|
746
|
-
* @param {string}
|
|
594
|
+
* @param {string} network_str
|
|
747
595
|
* @returns {Promise<any>}
|
|
748
596
|
*/
|
|
749
|
-
export function
|
|
750
|
-
const ptr0 = passStringToWasm0(
|
|
597
|
+
export function switch_network(network_str) {
|
|
598
|
+
const ptr0 = passStringToWasm0(network_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
751
599
|
const len0 = WASM_VECTOR_LEN;
|
|
752
|
-
const ret = wasm.
|
|
600
|
+
const ret = wasm.switch_network(ptr0, len0);
|
|
753
601
|
return ret;
|
|
754
602
|
}
|
|
755
603
|
|
|
756
604
|
/**
|
|
757
|
-
* @param {string}
|
|
605
|
+
* @param {string} key
|
|
758
606
|
* @returns {Promise<any>}
|
|
759
607
|
*/
|
|
760
|
-
export function
|
|
761
|
-
const ptr0 = passStringToWasm0(
|
|
608
|
+
export function get_env(key) {
|
|
609
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
762
610
|
const len0 = WASM_VECTOR_LEN;
|
|
763
|
-
const ret = wasm.
|
|
611
|
+
const ret = wasm.get_env(ptr0, len0);
|
|
764
612
|
return ret;
|
|
765
613
|
}
|
|
766
614
|
|
|
767
615
|
/**
|
|
768
|
-
* @param {string}
|
|
616
|
+
* @param {string} key
|
|
617
|
+
* @param {string} value
|
|
769
618
|
* @returns {Promise<any>}
|
|
770
619
|
*/
|
|
771
|
-
export function
|
|
772
|
-
const ptr0 = passStringToWasm0(
|
|
620
|
+
export function set_env(key, value) {
|
|
621
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
773
622
|
const len0 = WASM_VECTOR_LEN;
|
|
774
|
-
const
|
|
623
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
624
|
+
const len1 = WASM_VECTOR_LEN;
|
|
625
|
+
const ret = wasm.set_env(ptr0, len0, ptr1, len1);
|
|
775
626
|
return ret;
|
|
776
627
|
}
|
|
777
628
|
|
|
778
629
|
/**
|
|
779
|
-
*
|
|
780
|
-
* directly from the server, skipping the 5-minute IDB TTL cache.
|
|
781
|
-
* @param {string} nostr_hex_sk
|
|
630
|
+
* @param {number} ms
|
|
782
631
|
* @returns {Promise<any>}
|
|
783
632
|
*/
|
|
784
|
-
export function
|
|
785
|
-
const
|
|
786
|
-
const len0 = WASM_VECTOR_LEN;
|
|
787
|
-
const ret = wasm.list_offers_fresh(ptr0, len0);
|
|
633
|
+
export function sleep(ms) {
|
|
634
|
+
const ret = wasm.sleep(ms);
|
|
788
635
|
return ret;
|
|
789
636
|
}
|
|
790
637
|
|
|
638
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
639
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
640
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
641
|
+
WASM_VECTOR_LEN = arg.length;
|
|
642
|
+
return ptr;
|
|
643
|
+
}
|
|
791
644
|
/**
|
|
792
|
-
* @param {string}
|
|
645
|
+
* @param {string} secret_key
|
|
646
|
+
* @param {string} name
|
|
647
|
+
* @param {Uint8Array} data
|
|
648
|
+
* @param {boolean} force
|
|
649
|
+
* @param {Uint8Array | null} [metadata]
|
|
793
650
|
* @returns {Promise<any>}
|
|
794
651
|
*/
|
|
795
|
-
export function
|
|
796
|
-
const ptr0 = passStringToWasm0(
|
|
652
|
+
export function store(secret_key, name, data, force, metadata) {
|
|
653
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
797
654
|
const len0 = WASM_VECTOR_LEN;
|
|
798
|
-
const
|
|
655
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
656
|
+
const len1 = WASM_VECTOR_LEN;
|
|
657
|
+
const ptr2 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
658
|
+
const len2 = WASM_VECTOR_LEN;
|
|
659
|
+
var ptr3 = isLikeNone(metadata) ? 0 : passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
|
|
660
|
+
var len3 = WASM_VECTOR_LEN;
|
|
661
|
+
const ret = wasm.store(ptr0, len0, ptr1, len1, ptr2, len2, force, ptr3, len3);
|
|
799
662
|
return ret;
|
|
800
663
|
}
|
|
801
664
|
|
|
802
665
|
/**
|
|
803
|
-
* @param {string}
|
|
666
|
+
* @param {string} secret_key
|
|
667
|
+
* @param {string} name
|
|
804
668
|
* @returns {Promise<any>}
|
|
805
669
|
*/
|
|
806
|
-
export function
|
|
807
|
-
const ptr0 = passStringToWasm0(
|
|
670
|
+
export function retrieve(secret_key, name) {
|
|
671
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
808
672
|
const len0 = WASM_VECTOR_LEN;
|
|
809
|
-
const
|
|
673
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
674
|
+
const len1 = WASM_VECTOR_LEN;
|
|
675
|
+
const ret = wasm.retrieve(ptr0, len0, ptr1, len1);
|
|
810
676
|
return ret;
|
|
811
677
|
}
|
|
812
678
|
|
|
813
679
|
/**
|
|
814
|
-
* @param {string}
|
|
815
|
-
* @param {string}
|
|
680
|
+
* @param {string} secret_key
|
|
681
|
+
* @param {string} name
|
|
816
682
|
* @returns {Promise<any>}
|
|
817
683
|
*/
|
|
818
|
-
export function
|
|
819
|
-
const ptr0 = passStringToWasm0(
|
|
684
|
+
export function retrieve_metadata(secret_key, name) {
|
|
685
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
820
686
|
const len0 = WASM_VECTOR_LEN;
|
|
821
|
-
const ptr1 = passStringToWasm0(
|
|
687
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
822
688
|
const len1 = WASM_VECTOR_LEN;
|
|
823
|
-
const ret = wasm.
|
|
689
|
+
const ret = wasm.retrieve_metadata(ptr0, len0, ptr1, len1);
|
|
824
690
|
return ret;
|
|
825
691
|
}
|
|
826
692
|
|
|
827
693
|
/**
|
|
828
|
-
* @param {
|
|
829
|
-
* @
|
|
830
|
-
* @returns {Promise<any>}
|
|
694
|
+
* @param {Uint8Array} bytes
|
|
695
|
+
* @returns {string}
|
|
831
696
|
*/
|
|
832
|
-
export function
|
|
833
|
-
|
|
697
|
+
export function encode_hex(bytes) {
|
|
698
|
+
let deferred2_0;
|
|
699
|
+
let deferred2_1;
|
|
700
|
+
try {
|
|
701
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
702
|
+
const len0 = WASM_VECTOR_LEN;
|
|
703
|
+
const ret = wasm.encode_hex(ptr0, len0);
|
|
704
|
+
deferred2_0 = ret[0];
|
|
705
|
+
deferred2_1 = ret[1];
|
|
706
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
707
|
+
} finally {
|
|
708
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* @param {Uint8Array} bytes
|
|
714
|
+
* @returns {string}
|
|
715
|
+
*/
|
|
716
|
+
export function encode_base64(bytes) {
|
|
717
|
+
let deferred2_0;
|
|
718
|
+
let deferred2_1;
|
|
719
|
+
try {
|
|
720
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
721
|
+
const len0 = WASM_VECTOR_LEN;
|
|
722
|
+
const ret = wasm.encode_base64(ptr0, len0);
|
|
723
|
+
deferred2_0 = ret[0];
|
|
724
|
+
deferred2_1 = ret[1];
|
|
725
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
726
|
+
} finally {
|
|
727
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
function takeFromExternrefTable0(idx) {
|
|
732
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
733
|
+
wasm.__externref_table_dealloc(idx);
|
|
734
|
+
return value;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* @param {string} string
|
|
738
|
+
* @returns {Uint8Array}
|
|
739
|
+
*/
|
|
740
|
+
export function decode_hex(string) {
|
|
741
|
+
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
834
742
|
const len0 = WASM_VECTOR_LEN;
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
743
|
+
const ret = wasm.decode_hex(ptr0, len0);
|
|
744
|
+
if (ret[3]) {
|
|
745
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
746
|
+
}
|
|
747
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
748
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
749
|
+
return v2;
|
|
839
750
|
}
|
|
840
751
|
|
|
841
752
|
/**
|
|
842
|
-
* @param {string}
|
|
843
|
-
* @
|
|
844
|
-
* @param {any} secrets
|
|
845
|
-
* @returns {Promise<any>}
|
|
753
|
+
* @param {string} string
|
|
754
|
+
* @returns {Uint8Array}
|
|
846
755
|
*/
|
|
847
|
-
export function
|
|
848
|
-
const ptr0 = passStringToWasm0(
|
|
756
|
+
export function decode_base64(string) {
|
|
757
|
+
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
849
758
|
const len0 = WASM_VECTOR_LEN;
|
|
850
|
-
const ret = wasm.
|
|
851
|
-
|
|
759
|
+
const ret = wasm.decode_base64(ptr0, len0);
|
|
760
|
+
if (ret[3]) {
|
|
761
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
762
|
+
}
|
|
763
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
764
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
765
|
+
return v2;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* @returns {string}
|
|
770
|
+
*/
|
|
771
|
+
export function get_rgb_version() {
|
|
772
|
+
let deferred1_0;
|
|
773
|
+
let deferred1_1;
|
|
774
|
+
try {
|
|
775
|
+
const ret = wasm.get_rgb_version();
|
|
776
|
+
deferred1_0 = ret[0];
|
|
777
|
+
deferred1_1 = ret[1];
|
|
778
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
779
|
+
} finally {
|
|
780
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
781
|
+
}
|
|
852
782
|
}
|
|
853
783
|
|
|
854
784
|
/**
|
|
855
785
|
* @param {string} nostr_hex_sk
|
|
856
|
-
* @param {any} request
|
|
857
|
-
* @param {any} secrets
|
|
858
786
|
* @returns {Promise<any>}
|
|
859
787
|
*/
|
|
860
|
-
export function
|
|
788
|
+
export function get_rgb_wallet(nostr_hex_sk) {
|
|
861
789
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
862
790
|
const len0 = WASM_VECTOR_LEN;
|
|
863
|
-
const ret = wasm.
|
|
791
|
+
const ret = wasm.get_rgb_wallet(ptr0, len0);
|
|
864
792
|
return ret;
|
|
865
793
|
}
|
|
866
794
|
|
|
867
795
|
/**
|
|
868
796
|
* @param {string} nostr_hex_sk
|
|
869
|
-
* @param {any} request
|
|
870
797
|
* @returns {Promise<any>}
|
|
871
798
|
*/
|
|
872
|
-
export function
|
|
799
|
+
export function get_btc_wallet_data(nostr_hex_sk) {
|
|
873
800
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
874
801
|
const len0 = WASM_VECTOR_LEN;
|
|
875
|
-
const ret = wasm.
|
|
802
|
+
const ret = wasm.get_btc_wallet_data(ptr0, len0);
|
|
876
803
|
return ret;
|
|
877
804
|
}
|
|
878
805
|
|
|
879
806
|
/**
|
|
880
807
|
* @param {string} nostr_hex_sk
|
|
881
|
-
* @param {
|
|
882
|
-
* @param {any} secrets
|
|
808
|
+
* @param {string} request
|
|
883
809
|
* @returns {Promise<any>}
|
|
884
810
|
*/
|
|
885
|
-
export function
|
|
811
|
+
export function get_contract(nostr_hex_sk, request) {
|
|
886
812
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
887
813
|
const len0 = WASM_VECTOR_LEN;
|
|
888
|
-
const
|
|
814
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
815
|
+
const len1 = WASM_VECTOR_LEN;
|
|
816
|
+
const ret = wasm.get_contract(ptr0, len0, ptr1, len1);
|
|
889
817
|
return ret;
|
|
890
818
|
}
|
|
891
819
|
|
|
892
820
|
/**
|
|
893
821
|
* @param {string} nostr_hex_sk
|
|
894
|
-
* @param {
|
|
895
|
-
* @param {any} secrets
|
|
822
|
+
* @param {boolean} arg1
|
|
896
823
|
* @returns {Promise<any>}
|
|
897
824
|
*/
|
|
898
|
-
export function
|
|
825
|
+
export function list_contracts(nostr_hex_sk, arg1) {
|
|
899
826
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
900
827
|
const len0 = WASM_VECTOR_LEN;
|
|
901
|
-
const ret = wasm.
|
|
828
|
+
const ret = wasm.list_contracts(ptr0, len0, arg1);
|
|
902
829
|
return ret;
|
|
903
830
|
}
|
|
904
831
|
|
|
905
832
|
/**
|
|
906
833
|
* @param {string} nostr_hex_sk
|
|
907
|
-
* @param {
|
|
834
|
+
* @param {string} request
|
|
908
835
|
* @returns {Promise<any>}
|
|
909
836
|
*/
|
|
910
|
-
export function
|
|
837
|
+
export function import_contract(nostr_hex_sk, request) {
|
|
911
838
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
912
839
|
const len0 = WASM_VECTOR_LEN;
|
|
913
|
-
const
|
|
840
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
841
|
+
const len1 = WASM_VECTOR_LEN;
|
|
842
|
+
const ret = wasm.import_contract(ptr0, len0, ptr1, len1);
|
|
914
843
|
return ret;
|
|
915
844
|
}
|
|
916
845
|
|
|
917
846
|
/**
|
|
918
847
|
* @param {string} nostr_hex_sk
|
|
919
848
|
* @param {any} request
|
|
920
|
-
* @param {any} secrets
|
|
921
|
-
* @param {bigint} fee
|
|
922
|
-
* @param {string} max_claim
|
|
923
849
|
* @returns {Promise<any>}
|
|
924
850
|
*/
|
|
925
|
-
export function
|
|
851
|
+
export function issue_contract(nostr_hex_sk, request) {
|
|
926
852
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
927
853
|
const len0 = WASM_VECTOR_LEN;
|
|
928
|
-
const
|
|
929
|
-
const len1 = WASM_VECTOR_LEN;
|
|
930
|
-
const ret = wasm.create_airdrop(ptr0, len0, request, secrets, fee, ptr1, len1);
|
|
854
|
+
const ret = wasm.issue_contract(ptr0, len0, request);
|
|
931
855
|
return ret;
|
|
932
856
|
}
|
|
933
857
|
|
|
@@ -936,10 +860,10 @@ export function create_airdrop(nostr_hex_sk, request, secrets, fee, max_claim) {
|
|
|
936
860
|
* @param {any} request
|
|
937
861
|
* @returns {Promise<any>}
|
|
938
862
|
*/
|
|
939
|
-
export function
|
|
863
|
+
export function issue_contract_proxy(nostr_hex_sk, request) {
|
|
940
864
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
941
865
|
const len0 = WASM_VECTOR_LEN;
|
|
942
|
-
const ret = wasm.
|
|
866
|
+
const ret = wasm.issue_contract_proxy(ptr0, len0, request);
|
|
943
867
|
return ret;
|
|
944
868
|
}
|
|
945
869
|
|
|
@@ -948,21 +872,24 @@ export function create_airdrop_claim(nostr_hex_sk, request) {
|
|
|
948
872
|
* @param {any} request
|
|
949
873
|
* @returns {Promise<any>}
|
|
950
874
|
*/
|
|
951
|
-
export function
|
|
875
|
+
export function create_rgb_invoice(nostr_hex_sk, request) {
|
|
952
876
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
953
877
|
const len0 = WASM_VECTOR_LEN;
|
|
954
|
-
const ret = wasm.
|
|
878
|
+
const ret = wasm.create_rgb_invoice(ptr0, len0, request);
|
|
955
879
|
return ret;
|
|
956
880
|
}
|
|
957
881
|
|
|
958
882
|
/**
|
|
959
883
|
* @param {string} nostr_hex_sk
|
|
884
|
+
* @param {string} request
|
|
960
885
|
* @returns {Promise<any>}
|
|
961
886
|
*/
|
|
962
|
-
export function
|
|
887
|
+
export function remove_rgb_invoice(nostr_hex_sk, request) {
|
|
963
888
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
964
889
|
const len0 = WASM_VECTOR_LEN;
|
|
965
|
-
const
|
|
890
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
891
|
+
const len1 = WASM_VECTOR_LEN;
|
|
892
|
+
const ret = wasm.remove_rgb_invoice(ptr0, len0, ptr1, len1);
|
|
966
893
|
return ret;
|
|
967
894
|
}
|
|
968
895
|
|
|
@@ -970,407 +897,357 @@ export function backup_rgb_data(nostr_hex_sk) {
|
|
|
970
897
|
* @param {string} nostr_hex_sk
|
|
971
898
|
* @returns {Promise<any>}
|
|
972
899
|
*/
|
|
973
|
-
export function
|
|
900
|
+
export function list_rgb_invoices(nostr_hex_sk) {
|
|
974
901
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
975
902
|
const len0 = WASM_VECTOR_LEN;
|
|
976
|
-
const ret = wasm.
|
|
903
|
+
const ret = wasm.list_rgb_invoices(ptr0, len0);
|
|
977
904
|
return ret;
|
|
978
905
|
}
|
|
979
906
|
|
|
980
907
|
/**
|
|
981
|
-
* @param {string}
|
|
982
|
-
* @param {string} password
|
|
908
|
+
* @param {string} invoice
|
|
983
909
|
* @returns {Promise<any>}
|
|
984
910
|
*/
|
|
985
|
-
export function
|
|
986
|
-
const ptr0 = passStringToWasm0(
|
|
987
|
-
const len0 = WASM_VECTOR_LEN;
|
|
988
|
-
const
|
|
989
|
-
const len1 = WASM_VECTOR_LEN;
|
|
990
|
-
const ret = wasm.create_wallet(ptr0, len0, ptr1, len1);
|
|
911
|
+
export function decode_rgb_invoice(invoice) {
|
|
912
|
+
const ptr0 = passStringToWasm0(invoice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
913
|
+
const len0 = WASM_VECTOR_LEN;
|
|
914
|
+
const ret = wasm.decode_rgb_invoice(ptr0, len0);
|
|
991
915
|
return ret;
|
|
992
916
|
}
|
|
993
917
|
|
|
994
918
|
/**
|
|
995
|
-
* @param {string}
|
|
996
|
-
* @param {
|
|
919
|
+
* @param {string} nostr_hex_sk
|
|
920
|
+
* @param {any} request
|
|
997
921
|
* @returns {Promise<any>}
|
|
998
922
|
*/
|
|
999
|
-
export function
|
|
1000
|
-
const ptr0 = passStringToWasm0(
|
|
923
|
+
export function can_create_transfer_contract(nostr_hex_sk, request) {
|
|
924
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1001
925
|
const len0 = WASM_VECTOR_LEN;
|
|
1002
|
-
const
|
|
1003
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1004
|
-
const ret = wasm.auth(ptr0, len0, ptr1, len1);
|
|
926
|
+
const ret = wasm.can_create_transfer_contract(ptr0, len0, request);
|
|
1005
927
|
return ret;
|
|
1006
928
|
}
|
|
1007
929
|
|
|
1008
930
|
/**
|
|
1009
|
-
* @param {string}
|
|
1010
|
-
* @param {
|
|
1011
|
-
* @param {string} token
|
|
931
|
+
* @param {string} nostr_hex_sk
|
|
932
|
+
* @param {any} request
|
|
1012
933
|
* @returns {Promise<any>}
|
|
1013
934
|
*/
|
|
1014
|
-
export function
|
|
1015
|
-
const ptr0 = passStringToWasm0(
|
|
935
|
+
export function create_rgb_transfer(nostr_hex_sk, request) {
|
|
936
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1016
937
|
const len0 = WASM_VECTOR_LEN;
|
|
1017
|
-
const
|
|
1018
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1019
|
-
const ret = wasm.ln_create_invoice(ptr0, len0, amount, ptr1, len1);
|
|
938
|
+
const ret = wasm.create_rgb_transfer(ptr0, len0, request);
|
|
1020
939
|
return ret;
|
|
1021
940
|
}
|
|
1022
941
|
|
|
1023
942
|
/**
|
|
1024
|
-
* @param {string}
|
|
943
|
+
* @param {string} nostr_hex_sk
|
|
944
|
+
* @param {any} request
|
|
945
|
+
* @param {any} secrets
|
|
1025
946
|
* @returns {Promise<any>}
|
|
1026
947
|
*/
|
|
1027
|
-
export function
|
|
1028
|
-
const ptr0 = passStringToWasm0(
|
|
948
|
+
export function create_and_publish_rgb_transfer(nostr_hex_sk, request, secrets) {
|
|
949
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1029
950
|
const len0 = WASM_VECTOR_LEN;
|
|
1030
|
-
const ret = wasm.
|
|
951
|
+
const ret = wasm.create_and_publish_rgb_transfer(ptr0, len0, request, secrets);
|
|
1031
952
|
return ret;
|
|
1032
953
|
}
|
|
1033
954
|
|
|
1034
955
|
/**
|
|
1035
|
-
* @param {string}
|
|
956
|
+
* @param {string} _nostr_hex_sk
|
|
957
|
+
* @param {any} request
|
|
1036
958
|
* @returns {Promise<any>}
|
|
1037
959
|
*/
|
|
1038
|
-
export function
|
|
1039
|
-
const ptr0 = passStringToWasm0(
|
|
960
|
+
export function psbt_sign_file(_nostr_hex_sk, request) {
|
|
961
|
+
const ptr0 = passStringToWasm0(_nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1040
962
|
const len0 = WASM_VECTOR_LEN;
|
|
1041
|
-
const ret = wasm.
|
|
963
|
+
const ret = wasm.psbt_sign_file(ptr0, len0, request);
|
|
1042
964
|
return ret;
|
|
1043
965
|
}
|
|
1044
966
|
|
|
1045
967
|
/**
|
|
1046
|
-
* @param {string}
|
|
1047
|
-
* @param {
|
|
968
|
+
* @param {string} nostr_hex_sk
|
|
969
|
+
* @param {any} request
|
|
1048
970
|
* @returns {Promise<any>}
|
|
1049
971
|
*/
|
|
1050
|
-
export function
|
|
1051
|
-
const ptr0 = passStringToWasm0(
|
|
972
|
+
export function accept_transfer(nostr_hex_sk, request) {
|
|
973
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1052
974
|
const len0 = WASM_VECTOR_LEN;
|
|
1053
|
-
const
|
|
1054
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1055
|
-
const ret = wasm.pay_invoice(ptr0, len0, ptr1, len1);
|
|
975
|
+
const ret = wasm.accept_transfer(ptr0, len0, request);
|
|
1056
976
|
return ret;
|
|
1057
977
|
}
|
|
1058
978
|
|
|
1059
979
|
/**
|
|
1060
|
-
* @param {string}
|
|
980
|
+
* @param {string} nostr_hex_sk
|
|
981
|
+
* @param {any} request
|
|
1061
982
|
* @returns {Promise<any>}
|
|
1062
983
|
*/
|
|
1063
|
-
export function
|
|
1064
|
-
const ptr0 = passStringToWasm0(
|
|
984
|
+
export function save_transfer(nostr_hex_sk, request) {
|
|
985
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1065
986
|
const len0 = WASM_VECTOR_LEN;
|
|
1066
|
-
const ret = wasm.
|
|
987
|
+
const ret = wasm.save_transfer(ptr0, len0, request);
|
|
1067
988
|
return ret;
|
|
1068
989
|
}
|
|
1069
990
|
|
|
1070
991
|
/**
|
|
1071
|
-
* @param {string}
|
|
1072
|
-
* @param {string | null} [ln_address]
|
|
992
|
+
* @param {string} nostr_hex_sk
|
|
1073
993
|
* @returns {Promise<any>}
|
|
1074
994
|
*/
|
|
1075
|
-
export function
|
|
1076
|
-
const ptr0 = passStringToWasm0(
|
|
995
|
+
export function list_transfers(nostr_hex_sk) {
|
|
996
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1077
997
|
const len0 = WASM_VECTOR_LEN;
|
|
1078
|
-
|
|
1079
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1080
|
-
const ret = wasm.swap_btc_ln(ptr0, len0, ptr1, len1);
|
|
998
|
+
const ret = wasm.list_transfers(ptr0, len0);
|
|
1081
999
|
return ret;
|
|
1082
1000
|
}
|
|
1083
1001
|
|
|
1084
1002
|
/**
|
|
1085
|
-
* @param {string}
|
|
1086
|
-
* @param {bigint} amount
|
|
1087
|
-
* @param {string} token
|
|
1003
|
+
* @param {string} nostr_hex_sk
|
|
1088
1004
|
* @returns {Promise<any>}
|
|
1089
1005
|
*/
|
|
1090
|
-
export function
|
|
1091
|
-
const ptr0 = passStringToWasm0(
|
|
1006
|
+
export function verify_transfers(nostr_hex_sk) {
|
|
1007
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1092
1008
|
const len0 = WASM_VECTOR_LEN;
|
|
1093
|
-
const
|
|
1094
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1095
|
-
const ret = wasm.swap_ln_btc(ptr0, len0, amount, ptr1, len1);
|
|
1009
|
+
const ret = wasm.verify_transfers(ptr0, len0);
|
|
1096
1010
|
return ret;
|
|
1097
1011
|
}
|
|
1098
1012
|
|
|
1099
1013
|
/**
|
|
1100
|
-
* @param {string}
|
|
1101
|
-
* @param {string} token
|
|
1014
|
+
* @param {string} nostr_hex_sk
|
|
1102
1015
|
* @returns {Promise<any>}
|
|
1103
1016
|
*/
|
|
1104
|
-
export function
|
|
1105
|
-
const ptr0 = passStringToWasm0(
|
|
1017
|
+
export function list_offers(nostr_hex_sk) {
|
|
1018
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1106
1019
|
const len0 = WASM_VECTOR_LEN;
|
|
1107
|
-
const
|
|
1108
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1109
|
-
const ret = wasm.new_nostr_pubkey(ptr0, len0, ptr1, len1);
|
|
1020
|
+
const ret = wasm.list_offers(ptr0, len0);
|
|
1110
1021
|
return ret;
|
|
1111
1022
|
}
|
|
1112
1023
|
|
|
1113
1024
|
/**
|
|
1114
|
-
*
|
|
1115
|
-
*
|
|
1025
|
+
* Cache-bypassing variant of `list_offers`. Fetches marketplace data
|
|
1026
|
+
* directly from the server, skipping the 5-minute IDB TTL cache.
|
|
1027
|
+
* @param {string} nostr_hex_sk
|
|
1116
1028
|
* @returns {Promise<any>}
|
|
1117
1029
|
*/
|
|
1118
|
-
export function
|
|
1119
|
-
const ptr0 = passStringToWasm0(
|
|
1030
|
+
export function list_offers_fresh(nostr_hex_sk) {
|
|
1031
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1120
1032
|
const len0 = WASM_VECTOR_LEN;
|
|
1121
|
-
const
|
|
1122
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1123
|
-
const ret = wasm.update_nostr_pubkey(ptr0, len0, ptr1, len1);
|
|
1033
|
+
const ret = wasm.list_offers_fresh(ptr0, len0);
|
|
1124
1034
|
return ret;
|
|
1125
1035
|
}
|
|
1126
1036
|
|
|
1127
1037
|
/**
|
|
1128
|
-
* @param {string}
|
|
1129
|
-
* @returns {
|
|
1038
|
+
* @param {string} nostr_hex_sk
|
|
1039
|
+
* @returns {Promise<any>}
|
|
1130
1040
|
*/
|
|
1131
|
-
export function
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1137
|
-
const ret = wasm.hash_password(ptr0, len0);
|
|
1138
|
-
deferred2_0 = ret[0];
|
|
1139
|
-
deferred2_1 = ret[1];
|
|
1140
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1141
|
-
} finally {
|
|
1142
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1143
|
-
}
|
|
1041
|
+
export function offers(nostr_hex_sk) {
|
|
1042
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1043
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1044
|
+
const ret = wasm.offers(ptr0, len0);
|
|
1045
|
+
return ret;
|
|
1144
1046
|
}
|
|
1145
1047
|
|
|
1146
1048
|
/**
|
|
1147
|
-
* @param {string}
|
|
1049
|
+
* @param {string} nostr_hex_sk
|
|
1148
1050
|
* @returns {Promise<any>}
|
|
1149
1051
|
*/
|
|
1150
|
-
export function
|
|
1151
|
-
const ptr0 = passStringToWasm0(
|
|
1052
|
+
export function bids(nostr_hex_sk) {
|
|
1053
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1152
1054
|
const len0 = WASM_VECTOR_LEN;
|
|
1153
|
-
const ret = wasm.
|
|
1055
|
+
const ret = wasm.bids(ptr0, len0);
|
|
1154
1056
|
return ret;
|
|
1155
1057
|
}
|
|
1156
1058
|
|
|
1157
1059
|
/**
|
|
1158
|
-
* @param {string}
|
|
1159
|
-
* @param {string}
|
|
1060
|
+
* @param {string} nostr_hex_sk
|
|
1061
|
+
* @param {string} offer_id
|
|
1160
1062
|
* @returns {Promise<any>}
|
|
1161
1063
|
*/
|
|
1162
|
-
export function
|
|
1163
|
-
const ptr0 = passStringToWasm0(
|
|
1064
|
+
export function offer_swap_suppl(nostr_hex_sk, offer_id) {
|
|
1065
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1164
1066
|
const len0 = WASM_VECTOR_LEN;
|
|
1165
|
-
const ptr1 = passStringToWasm0(
|
|
1067
|
+
const ptr1 = passStringToWasm0(offer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1166
1068
|
const len1 = WASM_VECTOR_LEN;
|
|
1167
|
-
const ret = wasm.
|
|
1069
|
+
const ret = wasm.offer_swap_suppl(ptr0, len0, ptr1, len1);
|
|
1168
1070
|
return ret;
|
|
1169
1071
|
}
|
|
1170
1072
|
|
|
1171
1073
|
/**
|
|
1172
|
-
* @param {string}
|
|
1173
|
-
* @param {string}
|
|
1174
|
-
* @param {string} seed_password
|
|
1074
|
+
* @param {string} nostr_hex_sk
|
|
1075
|
+
* @param {string} bid_id
|
|
1175
1076
|
* @returns {Promise<any>}
|
|
1176
1077
|
*/
|
|
1177
|
-
export function
|
|
1178
|
-
const ptr0 = passStringToWasm0(
|
|
1078
|
+
export function bid_swap_suppl(nostr_hex_sk, bid_id) {
|
|
1079
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1179
1080
|
const len0 = WASM_VECTOR_LEN;
|
|
1180
|
-
const ptr1 = passStringToWasm0(
|
|
1081
|
+
const ptr1 = passStringToWasm0(bid_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1181
1082
|
const len1 = WASM_VECTOR_LEN;
|
|
1182
|
-
const
|
|
1183
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1184
|
-
const ret = wasm.decrypt_wallet(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1083
|
+
const ret = wasm.bid_swap_suppl(ptr0, len0, ptr1, len1);
|
|
1185
1084
|
return ret;
|
|
1186
1085
|
}
|
|
1187
1086
|
|
|
1188
1087
|
/**
|
|
1189
|
-
* @param {string}
|
|
1190
|
-
* @param {
|
|
1191
|
-
* @param {
|
|
1088
|
+
* @param {string} nostr_hex_sk
|
|
1089
|
+
* @param {any} request
|
|
1090
|
+
* @param {any} secrets
|
|
1192
1091
|
* @returns {Promise<any>}
|
|
1193
1092
|
*/
|
|
1194
|
-
export function
|
|
1195
|
-
const ptr0 = passStringToWasm0(
|
|
1093
|
+
export function can_create_offer(nostr_hex_sk, request, secrets) {
|
|
1094
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1196
1095
|
const len0 = WASM_VECTOR_LEN;
|
|
1197
|
-
const
|
|
1198
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1199
|
-
const ptr2 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1200
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1201
|
-
const ret = wasm.upgrade_wallet(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1096
|
+
const ret = wasm.can_create_offer(ptr0, len0, request, secrets);
|
|
1202
1097
|
return ret;
|
|
1203
1098
|
}
|
|
1204
1099
|
|
|
1205
1100
|
/**
|
|
1206
|
-
* @param {string}
|
|
1207
|
-
* @param {
|
|
1101
|
+
* @param {string} nostr_hex_sk
|
|
1102
|
+
* @param {any} request
|
|
1103
|
+
* @param {any} secrets
|
|
1208
1104
|
* @returns {Promise<any>}
|
|
1209
1105
|
*/
|
|
1210
|
-
export function
|
|
1211
|
-
const ptr0 = passStringToWasm0(
|
|
1106
|
+
export function create_offer(nostr_hex_sk, request, secrets) {
|
|
1107
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1212
1108
|
const len0 = WASM_VECTOR_LEN;
|
|
1213
|
-
const
|
|
1214
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1215
|
-
const ret = wasm.new_wallet(ptr0, len0, ptr1, len1);
|
|
1109
|
+
const ret = wasm.create_offer(ptr0, len0, request, secrets);
|
|
1216
1110
|
return ret;
|
|
1217
1111
|
}
|
|
1218
1112
|
|
|
1219
1113
|
/**
|
|
1220
|
-
* @param {string}
|
|
1221
|
-
* @param {
|
|
1222
|
-
* @param {string} seed_password
|
|
1114
|
+
* @param {string} nostr_hex_sk
|
|
1115
|
+
* @param {any} request
|
|
1223
1116
|
* @returns {Promise<any>}
|
|
1224
1117
|
*/
|
|
1225
|
-
export function
|
|
1226
|
-
const ptr0 = passStringToWasm0(
|
|
1118
|
+
export function cancel_offer(nostr_hex_sk, request) {
|
|
1119
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1227
1120
|
const len0 = WASM_VECTOR_LEN;
|
|
1228
|
-
const
|
|
1229
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1230
|
-
const ptr2 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1231
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1232
|
-
const ret = wasm.encrypt_wallet(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1121
|
+
const ret = wasm.cancel_offer(ptr0, len0, request);
|
|
1233
1122
|
return ret;
|
|
1234
1123
|
}
|
|
1235
1124
|
|
|
1236
1125
|
/**
|
|
1237
|
-
* @param {string}
|
|
1238
|
-
* @param {
|
|
1126
|
+
* @param {string} nostr_hex_sk
|
|
1127
|
+
* @param {any} request
|
|
1128
|
+
* @param {any} secrets
|
|
1239
1129
|
* @returns {Promise<any>}
|
|
1240
1130
|
*/
|
|
1241
|
-
export function
|
|
1242
|
-
const ptr0 = passStringToWasm0(
|
|
1131
|
+
export function can_create_bid(nostr_hex_sk, request, secrets) {
|
|
1132
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1243
1133
|
const len0 = WASM_VECTOR_LEN;
|
|
1244
|
-
|
|
1245
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1246
|
-
const ret = wasm.get_wallet_data(ptr0, len0, ptr1, len1);
|
|
1134
|
+
const ret = wasm.can_create_bid(ptr0, len0, request, secrets);
|
|
1247
1135
|
return ret;
|
|
1248
1136
|
}
|
|
1249
1137
|
|
|
1250
1138
|
/**
|
|
1139
|
+
* @param {string} nostr_hex_sk
|
|
1140
|
+
* @param {any} request
|
|
1141
|
+
* @param {any} secrets
|
|
1251
1142
|
* @returns {Promise<any>}
|
|
1252
1143
|
*/
|
|
1253
|
-
export function
|
|
1254
|
-
const
|
|
1144
|
+
export function create_bid(nostr_hex_sk, request, secrets) {
|
|
1145
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1146
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1147
|
+
const ret = wasm.create_bid(ptr0, len0, request, secrets);
|
|
1255
1148
|
return ret;
|
|
1256
1149
|
}
|
|
1257
1150
|
|
|
1258
1151
|
/**
|
|
1259
|
-
* @param {string}
|
|
1260
|
-
* @param {
|
|
1152
|
+
* @param {string} nostr_hex_sk
|
|
1153
|
+
* @param {any} request
|
|
1261
1154
|
* @returns {Promise<any>}
|
|
1262
1155
|
*/
|
|
1263
|
-
export function
|
|
1264
|
-
const ptr0 = passStringToWasm0(
|
|
1156
|
+
export function cancel_bid(nostr_hex_sk, request) {
|
|
1157
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1265
1158
|
const len0 = WASM_VECTOR_LEN;
|
|
1266
|
-
|
|
1267
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1268
|
-
const ret = wasm.get_new_address(ptr0, len0, ptr1, len1);
|
|
1159
|
+
const ret = wasm.cancel_bid(ptr0, len0, request);
|
|
1269
1160
|
return ret;
|
|
1270
1161
|
}
|
|
1271
1162
|
|
|
1272
1163
|
/**
|
|
1273
|
-
* @param {string}
|
|
1274
|
-
* @param {
|
|
1275
|
-
* @param {
|
|
1276
|
-
* @param {bigint}
|
|
1277
|
-
* @param {
|
|
1278
|
-
* @param {number | null} [fee_rate]
|
|
1164
|
+
* @param {string} nostr_hex_sk
|
|
1165
|
+
* @param {any} request
|
|
1166
|
+
* @param {any} secrets
|
|
1167
|
+
* @param {bigint} fee
|
|
1168
|
+
* @param {string} max_claim
|
|
1279
1169
|
* @returns {Promise<any>}
|
|
1280
1170
|
*/
|
|
1281
|
-
export function
|
|
1282
|
-
const ptr0 = passStringToWasm0(
|
|
1171
|
+
export function create_airdrop(nostr_hex_sk, request, secrets, fee, max_claim) {
|
|
1172
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1283
1173
|
const len0 = WASM_VECTOR_LEN;
|
|
1284
|
-
const ptr1 = passStringToWasm0(
|
|
1174
|
+
const ptr1 = passStringToWasm0(max_claim, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1285
1175
|
const len1 = WASM_VECTOR_LEN;
|
|
1286
|
-
const
|
|
1287
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1288
|
-
const ret = wasm.send_sats(ptr0, len0, ptr1, len1, ptr2, len2, amount, broadcast, isLikeNone(fee_rate) ? 0x100000001 : Math.fround(fee_rate));
|
|
1176
|
+
const ret = wasm.create_airdrop(ptr0, len0, request, secrets, fee, ptr1, len1);
|
|
1289
1177
|
return ret;
|
|
1290
1178
|
}
|
|
1291
1179
|
|
|
1292
1180
|
/**
|
|
1293
|
-
* @param {string}
|
|
1294
|
-
* @param {
|
|
1295
|
-
* @param {string} rgb_address
|
|
1296
|
-
* @param {boolean} broadcast
|
|
1297
|
-
* @param {number | null} [fee_rate]
|
|
1181
|
+
* @param {string} nostr_hex_sk
|
|
1182
|
+
* @param {any} request
|
|
1298
1183
|
* @returns {Promise<any>}
|
|
1299
1184
|
*/
|
|
1300
|
-
export function
|
|
1301
|
-
const ptr0 = passStringToWasm0(
|
|
1185
|
+
export function create_airdrop_claim(nostr_hex_sk, request) {
|
|
1186
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1302
1187
|
const len0 = WASM_VECTOR_LEN;
|
|
1303
|
-
const
|
|
1304
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1305
|
-
const ptr2 = passStringToWasm0(rgb_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1306
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1307
|
-
const ret = wasm.fund_vault(ptr0, len0, ptr1, len1, ptr2, len2, broadcast, isLikeNone(fee_rate) ? 0x100000001 : Math.fround(fee_rate));
|
|
1188
|
+
const ret = wasm.create_airdrop_claim(ptr0, len0, request);
|
|
1308
1189
|
return ret;
|
|
1309
1190
|
}
|
|
1310
1191
|
|
|
1311
1192
|
/**
|
|
1312
|
-
* @param {string}
|
|
1193
|
+
* @param {string} nostr_hex_sk
|
|
1194
|
+
* @param {any} request
|
|
1313
1195
|
* @returns {Promise<any>}
|
|
1314
1196
|
*/
|
|
1315
|
-
export function
|
|
1316
|
-
const ptr0 = passStringToWasm0(
|
|
1197
|
+
export function close_airdrop(nostr_hex_sk, request) {
|
|
1198
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1317
1199
|
const len0 = WASM_VECTOR_LEN;
|
|
1318
|
-
const ret = wasm.
|
|
1200
|
+
const ret = wasm.close_airdrop(ptr0, len0, request);
|
|
1319
1201
|
return ret;
|
|
1320
1202
|
}
|
|
1321
1203
|
|
|
1322
1204
|
/**
|
|
1323
|
-
* @param {string}
|
|
1324
|
-
* @param {string} descriptor
|
|
1325
|
-
* @param {string | null} [change_descriptor]
|
|
1326
|
-
* @param {number | null} [fee_rate]
|
|
1205
|
+
* @param {string} nostr_hex_sk
|
|
1327
1206
|
* @returns {Promise<any>}
|
|
1328
1207
|
*/
|
|
1329
|
-
export function
|
|
1330
|
-
const ptr0 = passStringToWasm0(
|
|
1208
|
+
export function backup_rgb_data(nostr_hex_sk) {
|
|
1209
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1331
1210
|
const len0 = WASM_VECTOR_LEN;
|
|
1332
|
-
const
|
|
1333
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1334
|
-
var ptr2 = isLikeNone(change_descriptor) ? 0 : passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1335
|
-
var len2 = WASM_VECTOR_LEN;
|
|
1336
|
-
const ret = wasm.drain_wallet(ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(fee_rate) ? 0x100000001 : Math.fround(fee_rate));
|
|
1211
|
+
const ret = wasm.backup_rgb_data(ptr0, len0);
|
|
1337
1212
|
return ret;
|
|
1338
1213
|
}
|
|
1339
1214
|
|
|
1340
1215
|
/**
|
|
1341
|
-
* @param {string}
|
|
1342
|
-
* @param {number} fee_rate
|
|
1343
|
-
* @param {string} descriptor
|
|
1344
|
-
* @param {string | null | undefined} change_descriptor
|
|
1345
|
-
* @param {boolean} broadcast
|
|
1216
|
+
* @param {string} nostr_hex_sk
|
|
1346
1217
|
* @returns {Promise<any>}
|
|
1347
1218
|
*/
|
|
1348
|
-
export function
|
|
1349
|
-
const ptr0 = passStringToWasm0(
|
|
1219
|
+
export function restore_rgb_data(nostr_hex_sk) {
|
|
1220
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1350
1221
|
const len0 = WASM_VECTOR_LEN;
|
|
1351
|
-
const
|
|
1352
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1353
|
-
var ptr2 = isLikeNone(change_descriptor) ? 0 : passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1354
|
-
var len2 = WASM_VECTOR_LEN;
|
|
1355
|
-
const ret = wasm.bump_fee(ptr0, len0, fee_rate, ptr1, len1, ptr2, len2, broadcast);
|
|
1222
|
+
const ret = wasm.restore_rgb_data(ptr0, len0);
|
|
1356
1223
|
return ret;
|
|
1357
1224
|
}
|
|
1358
1225
|
|
|
1359
1226
|
/**
|
|
1360
|
-
* @param {
|
|
1227
|
+
* @param {string} pubkey
|
|
1228
|
+
* @param {string} token
|
|
1361
1229
|
* @returns {Promise<any>}
|
|
1362
1230
|
*/
|
|
1363
|
-
export function
|
|
1364
|
-
const
|
|
1231
|
+
export function new_nostr_pubkey(pubkey, token) {
|
|
1232
|
+
const ptr0 = passStringToWasm0(pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1233
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1234
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1235
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1236
|
+
const ret = wasm.new_nostr_pubkey(ptr0, len0, ptr1, len1);
|
|
1365
1237
|
return ret;
|
|
1366
1238
|
}
|
|
1367
1239
|
|
|
1368
1240
|
/**
|
|
1369
|
-
* @param {
|
|
1241
|
+
* @param {string} pubkey
|
|
1242
|
+
* @param {string} token
|
|
1370
1243
|
* @returns {Promise<any>}
|
|
1371
1244
|
*/
|
|
1372
|
-
export function
|
|
1373
|
-
const
|
|
1245
|
+
export function update_nostr_pubkey(pubkey, token) {
|
|
1246
|
+
const ptr0 = passStringToWasm0(pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1247
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1248
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1249
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1250
|
+
const ret = wasm.update_nostr_pubkey(ptr0, len0, ptr1, len1);
|
|
1374
1251
|
return ret;
|
|
1375
1252
|
}
|
|
1376
1253
|
|
|
@@ -1458,68 +1335,191 @@ export function restore_btc_data(nostr_hex_sk) {
|
|
|
1458
1335
|
}
|
|
1459
1336
|
|
|
1460
1337
|
/**
|
|
1338
|
+
* @param {string} nostr_hex_sk
|
|
1339
|
+
* @param {any} request
|
|
1461
1340
|
* @returns {Promise<any>}
|
|
1462
1341
|
*/
|
|
1463
|
-
export function
|
|
1464
|
-
const
|
|
1342
|
+
export function create_watcher(nostr_hex_sk, request) {
|
|
1343
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1344
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1345
|
+
const ret = wasm.create_watcher(ptr0, len0, request);
|
|
1465
1346
|
return ret;
|
|
1466
1347
|
}
|
|
1467
1348
|
|
|
1468
1349
|
/**
|
|
1469
|
-
* @param {string}
|
|
1350
|
+
* @param {string} nostr_hex_sk
|
|
1351
|
+
* @param {any} request
|
|
1470
1352
|
* @returns {Promise<any>}
|
|
1471
1353
|
*/
|
|
1472
|
-
export function
|
|
1473
|
-
const ptr0 = passStringToWasm0(
|
|
1354
|
+
export function recover_watcher(nostr_hex_sk, request) {
|
|
1355
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1474
1356
|
const len0 = WASM_VECTOR_LEN;
|
|
1475
|
-
const ret = wasm.
|
|
1357
|
+
const ret = wasm.recover_watcher(ptr0, len0, request);
|
|
1476
1358
|
return ret;
|
|
1477
1359
|
}
|
|
1478
1360
|
|
|
1479
1361
|
/**
|
|
1480
|
-
* @param {string}
|
|
1362
|
+
* @param {string} nostr_hex_sk
|
|
1481
1363
|
* @returns {Promise<any>}
|
|
1482
1364
|
*/
|
|
1483
|
-
export function
|
|
1484
|
-
const ptr0 = passStringToWasm0(
|
|
1365
|
+
export function destroy_watcher(nostr_hex_sk) {
|
|
1366
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1485
1367
|
const len0 = WASM_VECTOR_LEN;
|
|
1486
|
-
const ret = wasm.
|
|
1368
|
+
const ret = wasm.destroy_watcher(ptr0, len0);
|
|
1487
1369
|
return ret;
|
|
1488
1370
|
}
|
|
1489
1371
|
|
|
1490
1372
|
/**
|
|
1491
|
-
* @param {string}
|
|
1492
|
-
* @param {string} value
|
|
1373
|
+
* @param {string} nostr_hex_sk
|
|
1493
1374
|
* @returns {Promise<any>}
|
|
1494
1375
|
*/
|
|
1495
|
-
export function
|
|
1496
|
-
const ptr0 = passStringToWasm0(
|
|
1376
|
+
export function destroy_recover_watcher(nostr_hex_sk) {
|
|
1377
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1497
1378
|
const len0 = WASM_VECTOR_LEN;
|
|
1498
|
-
const
|
|
1379
|
+
const ret = wasm.destroy_recover_watcher(ptr0, len0);
|
|
1380
|
+
return ret;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* @param {string} nostr_hex_sk
|
|
1385
|
+
* @returns {Promise<any>}
|
|
1386
|
+
*/
|
|
1387
|
+
export function check_watcher(nostr_hex_sk) {
|
|
1388
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1389
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1390
|
+
const ret = wasm.check_watcher(ptr0, len0);
|
|
1391
|
+
return ret;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
/**
|
|
1395
|
+
* @param {string} nostr_hex_sk
|
|
1396
|
+
* @param {string} request
|
|
1397
|
+
* @returns {Promise<any>}
|
|
1398
|
+
*/
|
|
1399
|
+
export function watcher_next_address(nostr_hex_sk, request) {
|
|
1400
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1401
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1402
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1499
1403
|
const len1 = WASM_VECTOR_LEN;
|
|
1500
|
-
const ret = wasm.
|
|
1404
|
+
const ret = wasm.watcher_next_address(ptr0, len0, ptr1, len1);
|
|
1501
1405
|
return ret;
|
|
1502
1406
|
}
|
|
1503
1407
|
|
|
1504
1408
|
/**
|
|
1505
|
-
* @param {
|
|
1409
|
+
* @param {string} nostr_hex_sk
|
|
1410
|
+
* @param {string} request
|
|
1506
1411
|
* @returns {Promise<any>}
|
|
1507
1412
|
*/
|
|
1508
|
-
export function
|
|
1509
|
-
const
|
|
1413
|
+
export function watcher_next_utxo(nostr_hex_sk, request) {
|
|
1414
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1415
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1416
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1417
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1418
|
+
const ret = wasm.watcher_next_utxo(ptr0, len0, ptr1, len1);
|
|
1419
|
+
return ret;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
/**
|
|
1423
|
+
* @param {string} nostr_hex_sk
|
|
1424
|
+
* @param {string} request
|
|
1425
|
+
* @returns {Promise<any>}
|
|
1426
|
+
*/
|
|
1427
|
+
export function watcher_unspent_utxos(nostr_hex_sk, request) {
|
|
1428
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1429
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1430
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1431
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1432
|
+
const ret = wasm.watcher_unspent_utxos(ptr0, len0, ptr1, len1);
|
|
1433
|
+
return ret;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
/**
|
|
1437
|
+
* @param {string} decimal
|
|
1438
|
+
* @param {number} precision
|
|
1439
|
+
* @returns {string}
|
|
1440
|
+
*/
|
|
1441
|
+
export function convert_contract_amount_raw(decimal, precision) {
|
|
1442
|
+
let deferred2_0;
|
|
1443
|
+
let deferred2_1;
|
|
1444
|
+
try {
|
|
1445
|
+
const ptr0 = passStringToWasm0(decimal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1446
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1447
|
+
const ret = wasm.convert_contract_amount_raw(ptr0, len0, precision);
|
|
1448
|
+
deferred2_0 = ret[0];
|
|
1449
|
+
deferred2_1 = ret[1];
|
|
1450
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1451
|
+
} finally {
|
|
1452
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
/**
|
|
1457
|
+
* @param {bigint} amount
|
|
1458
|
+
* @param {number} precision
|
|
1459
|
+
* @returns {string}
|
|
1460
|
+
*/
|
|
1461
|
+
export function convert_contract_amount_string(amount, precision) {
|
|
1462
|
+
let deferred1_0;
|
|
1463
|
+
let deferred1_1;
|
|
1464
|
+
try {
|
|
1465
|
+
const ret = wasm.convert_contract_amount_string(amount, precision);
|
|
1466
|
+
deferred1_0 = ret[0];
|
|
1467
|
+
deferred1_1 = ret[1];
|
|
1468
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1469
|
+
} finally {
|
|
1470
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
/**
|
|
1475
|
+
* @param {string} amount
|
|
1476
|
+
* @returns {any}
|
|
1477
|
+
*/
|
|
1478
|
+
export function parse_contract_amount(amount) {
|
|
1479
|
+
const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1480
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1481
|
+
const ret = wasm.parse_contract_amount(ptr0, len0);
|
|
1482
|
+
return ret;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
* @param {string} amount
|
|
1487
|
+
* @param {number} precision
|
|
1488
|
+
* @returns {string}
|
|
1489
|
+
*/
|
|
1490
|
+
export function parse_contract_amount_precision(amount, precision) {
|
|
1491
|
+
let deferred2_0;
|
|
1492
|
+
let deferred2_1;
|
|
1493
|
+
try {
|
|
1494
|
+
const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1495
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1496
|
+
const ret = wasm.parse_contract_amount_precision(ptr0, len0, precision);
|
|
1497
|
+
deferred2_0 = ret[0];
|
|
1498
|
+
deferred2_1 = ret[1];
|
|
1499
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1500
|
+
} finally {
|
|
1501
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
/**
|
|
1506
|
+
* @returns {any}
|
|
1507
|
+
*/
|
|
1508
|
+
export function version() {
|
|
1509
|
+
const ret = wasm.version();
|
|
1510
1510
|
return ret;
|
|
1511
1511
|
}
|
|
1512
1512
|
|
|
1513
1513
|
function __wbg_adapter_54(arg0, arg1, arg2) {
|
|
1514
|
-
wasm.
|
|
1514
|
+
wasm.closure1782_externref_shim(arg0, arg1, arg2);
|
|
1515
1515
|
}
|
|
1516
1516
|
|
|
1517
1517
|
function __wbg_adapter_57(arg0, arg1, arg2) {
|
|
1518
|
-
wasm.
|
|
1518
|
+
wasm.closure2713_externref_shim(arg0, arg1, arg2);
|
|
1519
1519
|
}
|
|
1520
1520
|
|
|
1521
1521
|
function __wbg_adapter_60(arg0, arg1, arg2) {
|
|
1522
|
-
wasm.
|
|
1522
|
+
wasm.closure2744_externref_shim(arg0, arg1, arg2);
|
|
1523
1523
|
}
|
|
1524
1524
|
|
|
1525
1525
|
function __wbg_adapter_63(arg0, arg1) {
|
|
@@ -1527,11 +1527,11 @@ function __wbg_adapter_63(arg0, arg1) {
|
|
|
1527
1527
|
}
|
|
1528
1528
|
|
|
1529
1529
|
function __wbg_adapter_66(arg0, arg1, arg2) {
|
|
1530
|
-
wasm.
|
|
1530
|
+
wasm.closure3924_externref_shim(arg0, arg1, arg2);
|
|
1531
1531
|
}
|
|
1532
1532
|
|
|
1533
1533
|
function __wbg_adapter_429(arg0, arg1, arg2, arg3) {
|
|
1534
|
-
wasm.
|
|
1534
|
+
wasm.closure4216_externref_shim(arg0, arg1, arg2, arg3);
|
|
1535
1535
|
}
|
|
1536
1536
|
|
|
1537
1537
|
const __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"];
|
|
@@ -2298,24 +2298,24 @@ function __wbg_get_imports() {
|
|
|
2298
2298
|
const ret = false;
|
|
2299
2299
|
return ret;
|
|
2300
2300
|
};
|
|
2301
|
-
imports.wbg.
|
|
2302
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2301
|
+
imports.wbg.__wbindgen_closure_wrapper11903 = function(arg0, arg1, arg2) {
|
|
2302
|
+
const ret = makeMutClosure(arg0, arg1, 2714, __wbg_adapter_57);
|
|
2303
2303
|
return ret;
|
|
2304
2304
|
};
|
|
2305
|
-
imports.wbg.
|
|
2306
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2305
|
+
imports.wbg.__wbindgen_closure_wrapper11985 = function(arg0, arg1, arg2) {
|
|
2306
|
+
const ret = makeMutClosure(arg0, arg1, 2745, __wbg_adapter_60);
|
|
2307
2307
|
return ret;
|
|
2308
2308
|
};
|
|
2309
|
-
imports.wbg.
|
|
2310
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2309
|
+
imports.wbg.__wbindgen_closure_wrapper12165 = function(arg0, arg1, arg2) {
|
|
2310
|
+
const ret = makeMutClosure(arg0, arg1, 2836, __wbg_adapter_63);
|
|
2311
2311
|
return ret;
|
|
2312
2312
|
};
|
|
2313
|
-
imports.wbg.
|
|
2314
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2313
|
+
imports.wbg.__wbindgen_closure_wrapper16555 = function(arg0, arg1, arg2) {
|
|
2314
|
+
const ret = makeMutClosure(arg0, arg1, 3925, __wbg_adapter_66);
|
|
2315
2315
|
return ret;
|
|
2316
2316
|
};
|
|
2317
|
-
imports.wbg.
|
|
2318
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2317
|
+
imports.wbg.__wbindgen_closure_wrapper7266 = function(arg0, arg1, arg2) {
|
|
2318
|
+
const ret = makeMutClosure(arg0, arg1, 1783, __wbg_adapter_54);
|
|
2319
2319
|
return ret;
|
|
2320
2320
|
};
|
|
2321
2321
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|