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