bitmask-core 1.0.7-beta.11 → 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 +53 -51
- package/bitmask_core.js +514 -503
- package/bitmask_core_bg.wasm +0 -0
- package/bitmask_core_bg.wasm.d.ts +29 -28
- package/package.json +1 -1
package/bitmask_core.js
CHANGED
|
@@ -464,374 +464,406 @@ export function psbt_publish_file(request) {
|
|
|
464
464
|
}
|
|
465
465
|
|
|
466
466
|
/**
|
|
467
|
-
* @
|
|
468
|
-
|
|
469
|
-
export function get_rgb_version() {
|
|
470
|
-
let deferred1_0;
|
|
471
|
-
let deferred1_1;
|
|
472
|
-
try {
|
|
473
|
-
const ret = wasm.get_rgb_version();
|
|
474
|
-
deferred1_0 = ret[0];
|
|
475
|
-
deferred1_1 = ret[1];
|
|
476
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
477
|
-
} finally {
|
|
478
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* @param {string} nostr_hex_sk
|
|
484
|
-
* @returns {Promise<any>}
|
|
485
|
-
*/
|
|
486
|
-
export function get_rgb_wallet(nostr_hex_sk) {
|
|
487
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
488
|
-
const len0 = WASM_VECTOR_LEN;
|
|
489
|
-
const ret = wasm.get_rgb_wallet(ptr0, len0);
|
|
490
|
-
return ret;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* @param {string} nostr_hex_sk
|
|
495
|
-
* @param {string} request
|
|
467
|
+
* @param {string} username
|
|
468
|
+
* @param {string} password
|
|
496
469
|
* @returns {Promise<any>}
|
|
497
470
|
*/
|
|
498
|
-
export function
|
|
499
|
-
const ptr0 = passStringToWasm0(
|
|
471
|
+
export function create_wallet(username, password) {
|
|
472
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
500
473
|
const len0 = WASM_VECTOR_LEN;
|
|
501
|
-
const ptr1 = passStringToWasm0(
|
|
474
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
502
475
|
const len1 = WASM_VECTOR_LEN;
|
|
503
|
-
const ret = wasm.
|
|
504
|
-
return ret;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* @param {string} nostr_hex_sk
|
|
509
|
-
* @param {boolean} arg1
|
|
510
|
-
* @returns {Promise<any>}
|
|
511
|
-
*/
|
|
512
|
-
export function list_contracts(nostr_hex_sk, arg1) {
|
|
513
|
-
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
514
|
-
const len0 = WASM_VECTOR_LEN;
|
|
515
|
-
const ret = wasm.list_contracts(ptr0, len0, arg1);
|
|
476
|
+
const ret = wasm.create_wallet(ptr0, len0, ptr1, len1);
|
|
516
477
|
return ret;
|
|
517
478
|
}
|
|
518
479
|
|
|
519
480
|
/**
|
|
520
|
-
* @param {string}
|
|
521
|
-
* @param {string}
|
|
481
|
+
* @param {string} username
|
|
482
|
+
* @param {string} password
|
|
522
483
|
* @returns {Promise<any>}
|
|
523
484
|
*/
|
|
524
|
-
export function
|
|
525
|
-
const ptr0 = passStringToWasm0(
|
|
485
|
+
export function auth(username, password) {
|
|
486
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
526
487
|
const len0 = WASM_VECTOR_LEN;
|
|
527
|
-
const ptr1 = passStringToWasm0(
|
|
488
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
528
489
|
const len1 = WASM_VECTOR_LEN;
|
|
529
|
-
const ret = wasm.
|
|
490
|
+
const ret = wasm.auth(ptr0, len0, ptr1, len1);
|
|
530
491
|
return ret;
|
|
531
492
|
}
|
|
532
493
|
|
|
533
494
|
/**
|
|
534
|
-
* @param {string}
|
|
535
|
-
* @param {
|
|
495
|
+
* @param {string} description
|
|
496
|
+
* @param {number} amount
|
|
497
|
+
* @param {string} token
|
|
536
498
|
* @returns {Promise<any>}
|
|
537
499
|
*/
|
|
538
|
-
export function
|
|
539
|
-
const ptr0 = passStringToWasm0(
|
|
500
|
+
export function ln_create_invoice(description, amount, token) {
|
|
501
|
+
const ptr0 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
540
502
|
const len0 = WASM_VECTOR_LEN;
|
|
541
|
-
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);
|
|
542
506
|
return ret;
|
|
543
507
|
}
|
|
544
508
|
|
|
545
509
|
/**
|
|
546
|
-
* @param {string}
|
|
547
|
-
* @param {any} request
|
|
510
|
+
* @param {string} token
|
|
548
511
|
* @returns {Promise<any>}
|
|
549
512
|
*/
|
|
550
|
-
export function
|
|
551
|
-
const ptr0 = passStringToWasm0(
|
|
513
|
+
export function get_balance(token) {
|
|
514
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
552
515
|
const len0 = WASM_VECTOR_LEN;
|
|
553
|
-
const ret = wasm.
|
|
516
|
+
const ret = wasm.get_balance(ptr0, len0);
|
|
554
517
|
return ret;
|
|
555
518
|
}
|
|
556
519
|
|
|
557
520
|
/**
|
|
558
|
-
* @param {string}
|
|
559
|
-
* @param {any} request
|
|
521
|
+
* @param {string} token
|
|
560
522
|
* @returns {Promise<any>}
|
|
561
523
|
*/
|
|
562
|
-
export function
|
|
563
|
-
const ptr0 = passStringToWasm0(
|
|
524
|
+
export function get_txs(token) {
|
|
525
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
564
526
|
const len0 = WASM_VECTOR_LEN;
|
|
565
|
-
const ret = wasm.
|
|
527
|
+
const ret = wasm.get_txs(ptr0, len0);
|
|
566
528
|
return ret;
|
|
567
529
|
}
|
|
568
530
|
|
|
569
531
|
/**
|
|
570
|
-
* @param {string}
|
|
571
|
-
* @param {string}
|
|
532
|
+
* @param {string} payment_request
|
|
533
|
+
* @param {string} token
|
|
572
534
|
* @returns {Promise<any>}
|
|
573
535
|
*/
|
|
574
|
-
export function
|
|
575
|
-
const ptr0 = passStringToWasm0(
|
|
536
|
+
export function pay_invoice(payment_request, token) {
|
|
537
|
+
const ptr0 = passStringToWasm0(payment_request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
576
538
|
const len0 = WASM_VECTOR_LEN;
|
|
577
|
-
const ptr1 = passStringToWasm0(
|
|
539
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
578
540
|
const len1 = WASM_VECTOR_LEN;
|
|
579
|
-
const ret = wasm.
|
|
541
|
+
const ret = wasm.pay_invoice(ptr0, len0, ptr1, len1);
|
|
580
542
|
return ret;
|
|
581
543
|
}
|
|
582
544
|
|
|
583
545
|
/**
|
|
584
|
-
* @param {string}
|
|
546
|
+
* @param {string} payment_hash
|
|
585
547
|
* @returns {Promise<any>}
|
|
586
548
|
*/
|
|
587
|
-
export function
|
|
588
|
-
const ptr0 = passStringToWasm0(
|
|
549
|
+
export function check_payment(payment_hash) {
|
|
550
|
+
const ptr0 = passStringToWasm0(payment_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
589
551
|
const len0 = WASM_VECTOR_LEN;
|
|
590
|
-
const ret = wasm.
|
|
552
|
+
const ret = wasm.check_payment(ptr0, len0);
|
|
591
553
|
return ret;
|
|
592
554
|
}
|
|
593
555
|
|
|
594
556
|
/**
|
|
595
|
-
* @param {string}
|
|
557
|
+
* @param {string} token
|
|
558
|
+
* @param {string | null} [ln_address]
|
|
596
559
|
* @returns {Promise<any>}
|
|
597
560
|
*/
|
|
598
|
-
export function
|
|
599
|
-
const ptr0 = passStringToWasm0(
|
|
561
|
+
export function swap_btc_ln(token, ln_address) {
|
|
562
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
600
563
|
const len0 = WASM_VECTOR_LEN;
|
|
601
|
-
|
|
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);
|
|
602
567
|
return ret;
|
|
603
568
|
}
|
|
604
569
|
|
|
605
570
|
/**
|
|
606
|
-
* @param {string}
|
|
607
|
-
* @param {
|
|
571
|
+
* @param {string} address
|
|
572
|
+
* @param {bigint} amount
|
|
573
|
+
* @param {string} token
|
|
608
574
|
* @returns {Promise<any>}
|
|
609
575
|
*/
|
|
610
|
-
export function
|
|
611
|
-
const ptr0 = passStringToWasm0(
|
|
576
|
+
export function swap_ln_btc(address, amount, token) {
|
|
577
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
612
578
|
const len0 = WASM_VECTOR_LEN;
|
|
613
|
-
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);
|
|
614
582
|
return ret;
|
|
615
583
|
}
|
|
616
584
|
|
|
617
585
|
/**
|
|
618
|
-
* @param {string} nostr_hex_sk
|
|
619
|
-
* @param {any} request
|
|
620
586
|
* @returns {Promise<any>}
|
|
621
587
|
*/
|
|
622
|
-
export function
|
|
623
|
-
const
|
|
624
|
-
const len0 = WASM_VECTOR_LEN;
|
|
625
|
-
const ret = wasm.create_rgb_transfer(ptr0, len0, request);
|
|
588
|
+
export function get_network() {
|
|
589
|
+
const ret = wasm.get_network();
|
|
626
590
|
return ret;
|
|
627
591
|
}
|
|
628
592
|
|
|
629
593
|
/**
|
|
630
|
-
* @param {string}
|
|
631
|
-
* @param {any} request
|
|
632
|
-
* @param {any} secrets
|
|
594
|
+
* @param {string} network_str
|
|
633
595
|
* @returns {Promise<any>}
|
|
634
596
|
*/
|
|
635
|
-
export function
|
|
636
|
-
const ptr0 = passStringToWasm0(
|
|
597
|
+
export function switch_network(network_str) {
|
|
598
|
+
const ptr0 = passStringToWasm0(network_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
637
599
|
const len0 = WASM_VECTOR_LEN;
|
|
638
|
-
const ret = wasm.
|
|
600
|
+
const ret = wasm.switch_network(ptr0, len0);
|
|
639
601
|
return ret;
|
|
640
602
|
}
|
|
641
603
|
|
|
642
604
|
/**
|
|
643
|
-
* @param {string}
|
|
644
|
-
* @param {any} request
|
|
605
|
+
* @param {string} key
|
|
645
606
|
* @returns {Promise<any>}
|
|
646
607
|
*/
|
|
647
|
-
export function
|
|
648
|
-
const ptr0 = passStringToWasm0(
|
|
608
|
+
export function get_env(key) {
|
|
609
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
649
610
|
const len0 = WASM_VECTOR_LEN;
|
|
650
|
-
const ret = wasm.
|
|
611
|
+
const ret = wasm.get_env(ptr0, len0);
|
|
651
612
|
return ret;
|
|
652
613
|
}
|
|
653
614
|
|
|
654
615
|
/**
|
|
655
|
-
* @param {string}
|
|
656
|
-
* @param {
|
|
616
|
+
* @param {string} key
|
|
617
|
+
* @param {string} value
|
|
657
618
|
* @returns {Promise<any>}
|
|
658
619
|
*/
|
|
659
|
-
export function
|
|
660
|
-
const ptr0 = passStringToWasm0(
|
|
620
|
+
export function set_env(key, value) {
|
|
621
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
661
622
|
const len0 = WASM_VECTOR_LEN;
|
|
662
|
-
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);
|
|
663
626
|
return ret;
|
|
664
627
|
}
|
|
665
628
|
|
|
666
629
|
/**
|
|
667
|
-
* @param {
|
|
668
|
-
* @param {any} request
|
|
630
|
+
* @param {number} ms
|
|
669
631
|
* @returns {Promise<any>}
|
|
670
632
|
*/
|
|
671
|
-
export function
|
|
672
|
-
const
|
|
673
|
-
const len0 = WASM_VECTOR_LEN;
|
|
674
|
-
const ret = wasm.save_transfer(ptr0, len0, request);
|
|
633
|
+
export function sleep(ms) {
|
|
634
|
+
const ret = wasm.sleep(ms);
|
|
675
635
|
return ret;
|
|
676
636
|
}
|
|
677
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
|
+
}
|
|
678
644
|
/**
|
|
679
|
-
* @param {string}
|
|
645
|
+
* @param {string} secret_key
|
|
646
|
+
* @param {string} name
|
|
647
|
+
* @param {Uint8Array} data
|
|
648
|
+
* @param {boolean} force
|
|
649
|
+
* @param {Uint8Array | null} [metadata]
|
|
680
650
|
* @returns {Promise<any>}
|
|
681
651
|
*/
|
|
682
|
-
export function
|
|
683
|
-
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);
|
|
684
654
|
const len0 = WASM_VECTOR_LEN;
|
|
685
|
-
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);
|
|
686
662
|
return ret;
|
|
687
663
|
}
|
|
688
664
|
|
|
689
665
|
/**
|
|
690
|
-
* @param {string}
|
|
666
|
+
* @param {string} secret_key
|
|
667
|
+
* @param {string} name
|
|
691
668
|
* @returns {Promise<any>}
|
|
692
669
|
*/
|
|
693
|
-
export function
|
|
694
|
-
const ptr0 = passStringToWasm0(
|
|
670
|
+
export function retrieve(secret_key, name) {
|
|
671
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
695
672
|
const len0 = WASM_VECTOR_LEN;
|
|
696
|
-
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);
|
|
697
676
|
return ret;
|
|
698
677
|
}
|
|
699
678
|
|
|
700
679
|
/**
|
|
701
|
-
* @param {string}
|
|
680
|
+
* @param {string} secret_key
|
|
681
|
+
* @param {string} name
|
|
702
682
|
* @returns {Promise<any>}
|
|
703
683
|
*/
|
|
704
|
-
export function
|
|
705
|
-
const ptr0 = passStringToWasm0(
|
|
684
|
+
export function retrieve_metadata(secret_key, name) {
|
|
685
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
706
686
|
const len0 = WASM_VECTOR_LEN;
|
|
707
|
-
const
|
|
687
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
688
|
+
const len1 = WASM_VECTOR_LEN;
|
|
689
|
+
const ret = wasm.retrieve_metadata(ptr0, len0, ptr1, len1);
|
|
708
690
|
return ret;
|
|
709
691
|
}
|
|
710
692
|
|
|
711
693
|
/**
|
|
712
|
-
*
|
|
713
|
-
*
|
|
714
|
-
* @param {string} nostr_hex_sk
|
|
715
|
-
* @returns {Promise<any>}
|
|
694
|
+
* @param {Uint8Array} bytes
|
|
695
|
+
* @returns {string}
|
|
716
696
|
*/
|
|
717
|
-
export function
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
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
|
+
}
|
|
722
710
|
}
|
|
723
711
|
|
|
724
712
|
/**
|
|
725
|
-
* @param {
|
|
726
|
-
* @returns {
|
|
713
|
+
* @param {Uint8Array} bytes
|
|
714
|
+
* @returns {string}
|
|
727
715
|
*/
|
|
728
|
-
export function
|
|
729
|
-
|
|
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);
|
|
730
742
|
const len0 = WASM_VECTOR_LEN;
|
|
731
|
-
const ret = wasm.
|
|
732
|
-
|
|
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;
|
|
733
750
|
}
|
|
734
751
|
|
|
735
752
|
/**
|
|
736
|
-
* @param {string}
|
|
737
|
-
* @returns {
|
|
753
|
+
* @param {string} string
|
|
754
|
+
* @returns {Uint8Array}
|
|
738
755
|
*/
|
|
739
|
-
export function
|
|
740
|
-
const ptr0 = passStringToWasm0(
|
|
756
|
+
export function decode_base64(string) {
|
|
757
|
+
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
741
758
|
const len0 = WASM_VECTOR_LEN;
|
|
742
|
-
const ret = wasm.
|
|
743
|
-
|
|
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
|
+
}
|
|
744
782
|
}
|
|
745
783
|
|
|
746
784
|
/**
|
|
747
785
|
* @param {string} nostr_hex_sk
|
|
748
|
-
* @param {string} offer_id
|
|
749
786
|
* @returns {Promise<any>}
|
|
750
787
|
*/
|
|
751
|
-
export function
|
|
788
|
+
export function get_rgb_wallet(nostr_hex_sk) {
|
|
752
789
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
753
790
|
const len0 = WASM_VECTOR_LEN;
|
|
754
|
-
const
|
|
755
|
-
const len1 = WASM_VECTOR_LEN;
|
|
756
|
-
const ret = wasm.offer_swap_suppl(ptr0, len0, ptr1, len1);
|
|
791
|
+
const ret = wasm.get_rgb_wallet(ptr0, len0);
|
|
757
792
|
return ret;
|
|
758
793
|
}
|
|
759
794
|
|
|
760
795
|
/**
|
|
761
796
|
* @param {string} nostr_hex_sk
|
|
762
|
-
* @param {string} bid_id
|
|
763
797
|
* @returns {Promise<any>}
|
|
764
798
|
*/
|
|
765
|
-
export function
|
|
799
|
+
export function get_btc_wallet_data(nostr_hex_sk) {
|
|
766
800
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
767
801
|
const len0 = WASM_VECTOR_LEN;
|
|
768
|
-
const
|
|
769
|
-
const len1 = WASM_VECTOR_LEN;
|
|
770
|
-
const ret = wasm.bid_swap_suppl(ptr0, len0, ptr1, len1);
|
|
802
|
+
const ret = wasm.get_btc_wallet_data(ptr0, len0);
|
|
771
803
|
return ret;
|
|
772
804
|
}
|
|
773
805
|
|
|
774
806
|
/**
|
|
775
807
|
* @param {string} nostr_hex_sk
|
|
776
|
-
* @param {
|
|
777
|
-
* @param {any} secrets
|
|
808
|
+
* @param {string} request
|
|
778
809
|
* @returns {Promise<any>}
|
|
779
810
|
*/
|
|
780
|
-
export function
|
|
811
|
+
export function get_contract(nostr_hex_sk, request) {
|
|
781
812
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
782
813
|
const len0 = WASM_VECTOR_LEN;
|
|
783
|
-
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);
|
|
784
817
|
return ret;
|
|
785
818
|
}
|
|
786
819
|
|
|
787
820
|
/**
|
|
788
821
|
* @param {string} nostr_hex_sk
|
|
789
|
-
* @param {
|
|
790
|
-
* @param {any} secrets
|
|
822
|
+
* @param {boolean} arg1
|
|
791
823
|
* @returns {Promise<any>}
|
|
792
824
|
*/
|
|
793
|
-
export function
|
|
825
|
+
export function list_contracts(nostr_hex_sk, arg1) {
|
|
794
826
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
795
827
|
const len0 = WASM_VECTOR_LEN;
|
|
796
|
-
const ret = wasm.
|
|
828
|
+
const ret = wasm.list_contracts(ptr0, len0, arg1);
|
|
797
829
|
return ret;
|
|
798
830
|
}
|
|
799
831
|
|
|
800
832
|
/**
|
|
801
833
|
* @param {string} nostr_hex_sk
|
|
802
|
-
* @param {
|
|
834
|
+
* @param {string} request
|
|
803
835
|
* @returns {Promise<any>}
|
|
804
836
|
*/
|
|
805
|
-
export function
|
|
837
|
+
export function import_contract(nostr_hex_sk, request) {
|
|
806
838
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
807
839
|
const len0 = WASM_VECTOR_LEN;
|
|
808
|
-
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);
|
|
809
843
|
return ret;
|
|
810
844
|
}
|
|
811
845
|
|
|
812
846
|
/**
|
|
813
847
|
* @param {string} nostr_hex_sk
|
|
814
848
|
* @param {any} request
|
|
815
|
-
* @param {any} secrets
|
|
816
849
|
* @returns {Promise<any>}
|
|
817
850
|
*/
|
|
818
|
-
export function
|
|
851
|
+
export function issue_contract(nostr_hex_sk, request) {
|
|
819
852
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
820
853
|
const len0 = WASM_VECTOR_LEN;
|
|
821
|
-
const ret = wasm.
|
|
854
|
+
const ret = wasm.issue_contract(ptr0, len0, request);
|
|
822
855
|
return ret;
|
|
823
856
|
}
|
|
824
857
|
|
|
825
858
|
/**
|
|
826
859
|
* @param {string} nostr_hex_sk
|
|
827
860
|
* @param {any} request
|
|
828
|
-
* @param {any} secrets
|
|
829
861
|
* @returns {Promise<any>}
|
|
830
862
|
*/
|
|
831
|
-
export function
|
|
863
|
+
export function issue_contract_proxy(nostr_hex_sk, request) {
|
|
832
864
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
833
865
|
const len0 = WASM_VECTOR_LEN;
|
|
834
|
-
const ret = wasm.
|
|
866
|
+
const ret = wasm.issue_contract_proxy(ptr0, len0, request);
|
|
835
867
|
return ret;
|
|
836
868
|
}
|
|
837
869
|
|
|
@@ -840,145 +872,130 @@ export function create_bid(nostr_hex_sk, request, secrets) {
|
|
|
840
872
|
* @param {any} request
|
|
841
873
|
* @returns {Promise<any>}
|
|
842
874
|
*/
|
|
843
|
-
export function
|
|
875
|
+
export function create_rgb_invoice(nostr_hex_sk, request) {
|
|
844
876
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
845
877
|
const len0 = WASM_VECTOR_LEN;
|
|
846
|
-
const ret = wasm.
|
|
878
|
+
const ret = wasm.create_rgb_invoice(ptr0, len0, request);
|
|
847
879
|
return ret;
|
|
848
880
|
}
|
|
849
881
|
|
|
850
882
|
/**
|
|
851
883
|
* @param {string} nostr_hex_sk
|
|
852
|
-
* @param {
|
|
853
|
-
* @param {any} secrets
|
|
854
|
-
* @param {bigint} fee
|
|
855
|
-
* @param {string} max_claim
|
|
884
|
+
* @param {string} request
|
|
856
885
|
* @returns {Promise<any>}
|
|
857
886
|
*/
|
|
858
|
-
export function
|
|
887
|
+
export function remove_rgb_invoice(nostr_hex_sk, request) {
|
|
859
888
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
860
889
|
const len0 = WASM_VECTOR_LEN;
|
|
861
|
-
const ptr1 = passStringToWasm0(
|
|
890
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
862
891
|
const len1 = WASM_VECTOR_LEN;
|
|
863
|
-
const ret = wasm.
|
|
892
|
+
const ret = wasm.remove_rgb_invoice(ptr0, len0, ptr1, len1);
|
|
864
893
|
return ret;
|
|
865
894
|
}
|
|
866
895
|
|
|
867
896
|
/**
|
|
868
897
|
* @param {string} nostr_hex_sk
|
|
869
|
-
* @param {any} request
|
|
870
898
|
* @returns {Promise<any>}
|
|
871
899
|
*/
|
|
872
|
-
export function
|
|
900
|
+
export function list_rgb_invoices(nostr_hex_sk) {
|
|
873
901
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
874
902
|
const len0 = WASM_VECTOR_LEN;
|
|
875
|
-
const ret = wasm.
|
|
903
|
+
const ret = wasm.list_rgb_invoices(ptr0, len0);
|
|
876
904
|
return ret;
|
|
877
905
|
}
|
|
878
906
|
|
|
879
907
|
/**
|
|
880
|
-
* @param {string}
|
|
881
|
-
* @param {any} request
|
|
908
|
+
* @param {string} invoice
|
|
882
909
|
* @returns {Promise<any>}
|
|
883
910
|
*/
|
|
884
|
-
export function
|
|
885
|
-
const ptr0 = passStringToWasm0(
|
|
911
|
+
export function decode_rgb_invoice(invoice) {
|
|
912
|
+
const ptr0 = passStringToWasm0(invoice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
886
913
|
const len0 = WASM_VECTOR_LEN;
|
|
887
|
-
const ret = wasm.
|
|
914
|
+
const ret = wasm.decode_rgb_invoice(ptr0, len0);
|
|
888
915
|
return ret;
|
|
889
916
|
}
|
|
890
917
|
|
|
891
918
|
/**
|
|
892
919
|
* @param {string} nostr_hex_sk
|
|
920
|
+
* @param {any} request
|
|
893
921
|
* @returns {Promise<any>}
|
|
894
922
|
*/
|
|
895
|
-
export function
|
|
923
|
+
export function can_create_transfer_contract(nostr_hex_sk, request) {
|
|
896
924
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
897
925
|
const len0 = WASM_VECTOR_LEN;
|
|
898
|
-
const ret = wasm.
|
|
926
|
+
const ret = wasm.can_create_transfer_contract(ptr0, len0, request);
|
|
899
927
|
return ret;
|
|
900
928
|
}
|
|
901
929
|
|
|
902
930
|
/**
|
|
903
931
|
* @param {string} nostr_hex_sk
|
|
932
|
+
* @param {any} request
|
|
904
933
|
* @returns {Promise<any>}
|
|
905
934
|
*/
|
|
906
|
-
export function
|
|
935
|
+
export function create_rgb_transfer(nostr_hex_sk, request) {
|
|
907
936
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
908
937
|
const len0 = WASM_VECTOR_LEN;
|
|
909
|
-
const ret = wasm.
|
|
938
|
+
const ret = wasm.create_rgb_transfer(ptr0, len0, request);
|
|
910
939
|
return ret;
|
|
911
940
|
}
|
|
912
941
|
|
|
913
942
|
/**
|
|
914
|
-
* @param {string}
|
|
915
|
-
* @param {
|
|
943
|
+
* @param {string} nostr_hex_sk
|
|
944
|
+
* @param {any} request
|
|
916
945
|
* @param {any} secrets
|
|
917
|
-
* @param {boolean} broadcast
|
|
918
|
-
* @param {bigint | null | undefined} fund_value
|
|
919
|
-
* @param {boolean} coordinator_fee
|
|
920
946
|
* @returns {Promise<any>}
|
|
921
947
|
*/
|
|
922
|
-
export function
|
|
923
|
-
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);
|
|
924
950
|
const len0 = WASM_VECTOR_LEN;
|
|
925
|
-
const ret = wasm.
|
|
951
|
+
const ret = wasm.create_and_publish_rgb_transfer(ptr0, len0, request, secrets);
|
|
926
952
|
return ret;
|
|
927
953
|
}
|
|
928
954
|
|
|
929
955
|
/**
|
|
930
|
-
* @param {string}
|
|
931
|
-
* @param {
|
|
932
|
-
* @param {bigint} sats
|
|
933
|
-
* @param {number} fee_rate
|
|
934
|
-
* @param {any} secrets
|
|
956
|
+
* @param {string} _nostr_hex_sk
|
|
957
|
+
* @param {any} request
|
|
935
958
|
* @returns {Promise<any>}
|
|
936
959
|
*/
|
|
937
|
-
export function
|
|
938
|
-
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);
|
|
939
962
|
const len0 = WASM_VECTOR_LEN;
|
|
940
|
-
const
|
|
941
|
-
const len1 = WASM_VECTOR_LEN;
|
|
942
|
-
const ret = wasm.transfer_sats(ptr0, len0, ptr1, len1, sats, fee_rate, secrets);
|
|
963
|
+
const ret = wasm.psbt_sign_file(ptr0, len0, request);
|
|
943
964
|
return ret;
|
|
944
965
|
}
|
|
945
966
|
|
|
946
967
|
/**
|
|
947
|
-
* @param {string}
|
|
968
|
+
* @param {string} nostr_hex_sk
|
|
969
|
+
* @param {any} request
|
|
948
970
|
* @returns {Promise<any>}
|
|
949
971
|
*/
|
|
950
|
-
export function
|
|
951
|
-
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);
|
|
952
974
|
const len0 = WASM_VECTOR_LEN;
|
|
953
|
-
const ret = wasm.
|
|
975
|
+
const ret = wasm.accept_transfer(ptr0, len0, request);
|
|
954
976
|
return ret;
|
|
955
977
|
}
|
|
956
978
|
|
|
957
979
|
/**
|
|
958
980
|
* @param {string} nostr_hex_sk
|
|
981
|
+
* @param {any} request
|
|
959
982
|
* @returns {Promise<any>}
|
|
960
983
|
*/
|
|
961
|
-
export function
|
|
984
|
+
export function save_transfer(nostr_hex_sk, request) {
|
|
962
985
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
963
986
|
const len0 = WASM_VECTOR_LEN;
|
|
964
|
-
const ret = wasm.
|
|
987
|
+
const ret = wasm.save_transfer(ptr0, len0, request);
|
|
965
988
|
return ret;
|
|
966
989
|
}
|
|
967
990
|
|
|
968
991
|
/**
|
|
969
|
-
* @param {string}
|
|
970
|
-
* @param {string} pass_phrase
|
|
971
|
-
* @param {string} recover_address
|
|
992
|
+
* @param {string} nostr_hex_sk
|
|
972
993
|
* @returns {Promise<any>}
|
|
973
994
|
*/
|
|
974
|
-
export function
|
|
975
|
-
const ptr0 = passStringToWasm0(
|
|
995
|
+
export function list_transfers(nostr_hex_sk) {
|
|
996
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
976
997
|
const len0 = WASM_VECTOR_LEN;
|
|
977
|
-
const
|
|
978
|
-
const len1 = WASM_VECTOR_LEN;
|
|
979
|
-
const ptr2 = passStringToWasm0(recover_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
980
|
-
const len2 = WASM_VECTOR_LEN;
|
|
981
|
-
const ret = wasm.recover_funds_from_bad_wallets(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
998
|
+
const ret = wasm.list_transfers(ptr0, len0);
|
|
982
999
|
return ret;
|
|
983
1000
|
}
|
|
984
1001
|
|
|
@@ -986,34 +1003,34 @@ export function recover_funds_from_bad_wallets(seed, pass_phrase, recover_addres
|
|
|
986
1003
|
* @param {string} nostr_hex_sk
|
|
987
1004
|
* @returns {Promise<any>}
|
|
988
1005
|
*/
|
|
989
|
-
export function
|
|
1006
|
+
export function verify_transfers(nostr_hex_sk) {
|
|
990
1007
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
991
1008
|
const len0 = WASM_VECTOR_LEN;
|
|
992
|
-
const ret = wasm.
|
|
1009
|
+
const ret = wasm.verify_transfers(ptr0, len0);
|
|
993
1010
|
return ret;
|
|
994
1011
|
}
|
|
995
1012
|
|
|
996
1013
|
/**
|
|
997
1014
|
* @param {string} nostr_hex_sk
|
|
998
|
-
* @param {any} request
|
|
999
1015
|
* @returns {Promise<any>}
|
|
1000
1016
|
*/
|
|
1001
|
-
export function
|
|
1017
|
+
export function list_offers(nostr_hex_sk) {
|
|
1002
1018
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1003
1019
|
const len0 = WASM_VECTOR_LEN;
|
|
1004
|
-
const ret = wasm.
|
|
1020
|
+
const ret = wasm.list_offers(ptr0, len0);
|
|
1005
1021
|
return ret;
|
|
1006
1022
|
}
|
|
1007
1023
|
|
|
1008
1024
|
/**
|
|
1025
|
+
* Cache-bypassing variant of `list_offers`. Fetches marketplace data
|
|
1026
|
+
* directly from the server, skipping the 5-minute IDB TTL cache.
|
|
1009
1027
|
* @param {string} nostr_hex_sk
|
|
1010
|
-
* @param {any} request
|
|
1011
1028
|
* @returns {Promise<any>}
|
|
1012
1029
|
*/
|
|
1013
|
-
export function
|
|
1030
|
+
export function list_offers_fresh(nostr_hex_sk) {
|
|
1014
1031
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1015
1032
|
const len0 = WASM_VECTOR_LEN;
|
|
1016
|
-
const ret = wasm.
|
|
1033
|
+
const ret = wasm.list_offers_fresh(ptr0, len0);
|
|
1017
1034
|
return ret;
|
|
1018
1035
|
}
|
|
1019
1036
|
|
|
@@ -1021,10 +1038,10 @@ export function recover_watcher(nostr_hex_sk, request) {
|
|
|
1021
1038
|
* @param {string} nostr_hex_sk
|
|
1022
1039
|
* @returns {Promise<any>}
|
|
1023
1040
|
*/
|
|
1024
|
-
export function
|
|
1041
|
+
export function offers(nostr_hex_sk) {
|
|
1025
1042
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1026
1043
|
const len0 = WASM_VECTOR_LEN;
|
|
1027
|
-
const ret = wasm.
|
|
1044
|
+
const ret = wasm.offers(ptr0, len0);
|
|
1028
1045
|
return ret;
|
|
1029
1046
|
}
|
|
1030
1047
|
|
|
@@ -1032,194 +1049,178 @@ export function destroy_watcher(nostr_hex_sk) {
|
|
|
1032
1049
|
* @param {string} nostr_hex_sk
|
|
1033
1050
|
* @returns {Promise<any>}
|
|
1034
1051
|
*/
|
|
1035
|
-
export function
|
|
1052
|
+
export function bids(nostr_hex_sk) {
|
|
1036
1053
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1037
1054
|
const len0 = WASM_VECTOR_LEN;
|
|
1038
|
-
const ret = wasm.
|
|
1055
|
+
const ret = wasm.bids(ptr0, len0);
|
|
1039
1056
|
return ret;
|
|
1040
1057
|
}
|
|
1041
1058
|
|
|
1042
1059
|
/**
|
|
1043
1060
|
* @param {string} nostr_hex_sk
|
|
1061
|
+
* @param {string} offer_id
|
|
1044
1062
|
* @returns {Promise<any>}
|
|
1045
1063
|
*/
|
|
1046
|
-
export function
|
|
1064
|
+
export function offer_swap_suppl(nostr_hex_sk, offer_id) {
|
|
1047
1065
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1048
1066
|
const len0 = WASM_VECTOR_LEN;
|
|
1049
|
-
const
|
|
1067
|
+
const ptr1 = passStringToWasm0(offer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1068
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1069
|
+
const ret = wasm.offer_swap_suppl(ptr0, len0, ptr1, len1);
|
|
1050
1070
|
return ret;
|
|
1051
1071
|
}
|
|
1052
1072
|
|
|
1053
1073
|
/**
|
|
1054
1074
|
* @param {string} nostr_hex_sk
|
|
1055
|
-
* @param {string}
|
|
1075
|
+
* @param {string} bid_id
|
|
1056
1076
|
* @returns {Promise<any>}
|
|
1057
1077
|
*/
|
|
1058
|
-
export function
|
|
1078
|
+
export function bid_swap_suppl(nostr_hex_sk, bid_id) {
|
|
1059
1079
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1060
1080
|
const len0 = WASM_VECTOR_LEN;
|
|
1061
|
-
const ptr1 = passStringToWasm0(
|
|
1081
|
+
const ptr1 = passStringToWasm0(bid_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1062
1082
|
const len1 = WASM_VECTOR_LEN;
|
|
1063
|
-
const ret = wasm.
|
|
1083
|
+
const ret = wasm.bid_swap_suppl(ptr0, len0, ptr1, len1);
|
|
1064
1084
|
return ret;
|
|
1065
1085
|
}
|
|
1066
1086
|
|
|
1067
1087
|
/**
|
|
1068
1088
|
* @param {string} nostr_hex_sk
|
|
1069
|
-
* @param {
|
|
1070
|
-
* @
|
|
1089
|
+
* @param {any} request
|
|
1090
|
+
* @param {any} secrets
|
|
1091
|
+
* @returns {Promise<any>}
|
|
1071
1092
|
*/
|
|
1072
|
-
export function
|
|
1093
|
+
export function can_create_offer(nostr_hex_sk, request, secrets) {
|
|
1073
1094
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1074
1095
|
const len0 = WASM_VECTOR_LEN;
|
|
1075
|
-
const
|
|
1076
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1077
|
-
const ret = wasm.watcher_next_utxo(ptr0, len0, ptr1, len1);
|
|
1096
|
+
const ret = wasm.can_create_offer(ptr0, len0, request, secrets);
|
|
1078
1097
|
return ret;
|
|
1079
1098
|
}
|
|
1080
1099
|
|
|
1081
1100
|
/**
|
|
1082
1101
|
* @param {string} nostr_hex_sk
|
|
1083
|
-
* @param {
|
|
1102
|
+
* @param {any} request
|
|
1103
|
+
* @param {any} secrets
|
|
1084
1104
|
* @returns {Promise<any>}
|
|
1085
1105
|
*/
|
|
1086
|
-
export function
|
|
1106
|
+
export function create_offer(nostr_hex_sk, request, secrets) {
|
|
1087
1107
|
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1088
1108
|
const len0 = WASM_VECTOR_LEN;
|
|
1089
|
-
const
|
|
1090
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1091
|
-
const ret = wasm.watcher_unspent_utxos(ptr0, len0, ptr1, len1);
|
|
1109
|
+
const ret = wasm.create_offer(ptr0, len0, request, secrets);
|
|
1092
1110
|
return ret;
|
|
1093
1111
|
}
|
|
1094
1112
|
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1113
|
+
/**
|
|
1114
|
+
* @param {string} nostr_hex_sk
|
|
1115
|
+
* @param {any} request
|
|
1116
|
+
* @returns {Promise<any>}
|
|
1117
|
+
*/
|
|
1118
|
+
export function cancel_offer(nostr_hex_sk, request) {
|
|
1119
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1120
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1121
|
+
const ret = wasm.cancel_offer(ptr0, len0, request);
|
|
1122
|
+
return ret;
|
|
1100
1123
|
}
|
|
1124
|
+
|
|
1101
1125
|
/**
|
|
1102
|
-
* @param {string}
|
|
1103
|
-
* @param {
|
|
1104
|
-
* @param {
|
|
1105
|
-
* @param {boolean} force
|
|
1106
|
-
* @param {Uint8Array | null} [metadata]
|
|
1126
|
+
* @param {string} nostr_hex_sk
|
|
1127
|
+
* @param {any} request
|
|
1128
|
+
* @param {any} secrets
|
|
1107
1129
|
* @returns {Promise<any>}
|
|
1108
1130
|
*/
|
|
1109
|
-
export function
|
|
1110
|
-
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);
|
|
1111
1133
|
const len0 = WASM_VECTOR_LEN;
|
|
1112
|
-
const
|
|
1113
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1114
|
-
const ptr2 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1115
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1116
|
-
var ptr3 = isLikeNone(metadata) ? 0 : passArray8ToWasm0(metadata, wasm.__wbindgen_malloc);
|
|
1117
|
-
var len3 = WASM_VECTOR_LEN;
|
|
1118
|
-
const ret = wasm.store(ptr0, len0, ptr1, len1, ptr2, len2, force, ptr3, len3);
|
|
1134
|
+
const ret = wasm.can_create_bid(ptr0, len0, request, secrets);
|
|
1119
1135
|
return ret;
|
|
1120
1136
|
}
|
|
1121
1137
|
|
|
1122
1138
|
/**
|
|
1123
|
-
* @param {string}
|
|
1124
|
-
* @param {
|
|
1139
|
+
* @param {string} nostr_hex_sk
|
|
1140
|
+
* @param {any} request
|
|
1141
|
+
* @param {any} secrets
|
|
1125
1142
|
* @returns {Promise<any>}
|
|
1126
1143
|
*/
|
|
1127
|
-
export function
|
|
1128
|
-
const ptr0 = passStringToWasm0(
|
|
1144
|
+
export function create_bid(nostr_hex_sk, request, secrets) {
|
|
1145
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1129
1146
|
const len0 = WASM_VECTOR_LEN;
|
|
1130
|
-
const
|
|
1131
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1132
|
-
const ret = wasm.retrieve(ptr0, len0, ptr1, len1);
|
|
1147
|
+
const ret = wasm.create_bid(ptr0, len0, request, secrets);
|
|
1133
1148
|
return ret;
|
|
1134
1149
|
}
|
|
1135
1150
|
|
|
1136
1151
|
/**
|
|
1137
|
-
* @param {string}
|
|
1138
|
-
* @param {
|
|
1152
|
+
* @param {string} nostr_hex_sk
|
|
1153
|
+
* @param {any} request
|
|
1139
1154
|
* @returns {Promise<any>}
|
|
1140
1155
|
*/
|
|
1141
|
-
export function
|
|
1142
|
-
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);
|
|
1143
1158
|
const len0 = WASM_VECTOR_LEN;
|
|
1144
|
-
const
|
|
1145
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1146
|
-
const ret = wasm.retrieve_metadata(ptr0, len0, ptr1, len1);
|
|
1159
|
+
const ret = wasm.cancel_bid(ptr0, len0, request);
|
|
1147
1160
|
return ret;
|
|
1148
1161
|
}
|
|
1149
1162
|
|
|
1150
1163
|
/**
|
|
1151
|
-
* @param {
|
|
1152
|
-
* @
|
|
1164
|
+
* @param {string} nostr_hex_sk
|
|
1165
|
+
* @param {any} request
|
|
1166
|
+
* @param {any} secrets
|
|
1167
|
+
* @param {bigint} fee
|
|
1168
|
+
* @param {string} max_claim
|
|
1169
|
+
* @returns {Promise<any>}
|
|
1153
1170
|
*/
|
|
1154
|
-
export function
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
deferred2_0 = ret[0];
|
|
1162
|
-
deferred2_1 = ret[1];
|
|
1163
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1164
|
-
} finally {
|
|
1165
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1166
|
-
}
|
|
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);
|
|
1173
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1174
|
+
const ptr1 = passStringToWasm0(max_claim, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1175
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1176
|
+
const ret = wasm.create_airdrop(ptr0, len0, request, secrets, fee, ptr1, len1);
|
|
1177
|
+
return ret;
|
|
1167
1178
|
}
|
|
1168
1179
|
|
|
1169
1180
|
/**
|
|
1170
|
-
* @param {
|
|
1171
|
-
* @
|
|
1181
|
+
* @param {string} nostr_hex_sk
|
|
1182
|
+
* @param {any} request
|
|
1183
|
+
* @returns {Promise<any>}
|
|
1172
1184
|
*/
|
|
1173
|
-
export function
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1179
|
-
const ret = wasm.encode_base64(ptr0, len0);
|
|
1180
|
-
deferred2_0 = ret[0];
|
|
1181
|
-
deferred2_1 = ret[1];
|
|
1182
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1183
|
-
} finally {
|
|
1184
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1185
|
-
}
|
|
1185
|
+
export function create_airdrop_claim(nostr_hex_sk, request) {
|
|
1186
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1187
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1188
|
+
const ret = wasm.create_airdrop_claim(ptr0, len0, request);
|
|
1189
|
+
return ret;
|
|
1186
1190
|
}
|
|
1187
1191
|
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
+
/**
|
|
1193
|
+
* @param {string} nostr_hex_sk
|
|
1194
|
+
* @param {any} request
|
|
1195
|
+
* @returns {Promise<any>}
|
|
1196
|
+
*/
|
|
1197
|
+
export function close_airdrop(nostr_hex_sk, request) {
|
|
1198
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1199
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1200
|
+
const ret = wasm.close_airdrop(ptr0, len0, request);
|
|
1201
|
+
return ret;
|
|
1192
1202
|
}
|
|
1203
|
+
|
|
1193
1204
|
/**
|
|
1194
|
-
* @param {string}
|
|
1195
|
-
* @returns {
|
|
1205
|
+
* @param {string} nostr_hex_sk
|
|
1206
|
+
* @returns {Promise<any>}
|
|
1196
1207
|
*/
|
|
1197
|
-
export function
|
|
1198
|
-
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);
|
|
1199
1210
|
const len0 = WASM_VECTOR_LEN;
|
|
1200
|
-
const ret = wasm.
|
|
1201
|
-
|
|
1202
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
1203
|
-
}
|
|
1204
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1205
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1206
|
-
return v2;
|
|
1211
|
+
const ret = wasm.backup_rgb_data(ptr0, len0);
|
|
1212
|
+
return ret;
|
|
1207
1213
|
}
|
|
1208
1214
|
|
|
1209
1215
|
/**
|
|
1210
|
-
* @param {string}
|
|
1211
|
-
* @returns {
|
|
1216
|
+
* @param {string} nostr_hex_sk
|
|
1217
|
+
* @returns {Promise<any>}
|
|
1212
1218
|
*/
|
|
1213
|
-
export function
|
|
1214
|
-
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);
|
|
1215
1221
|
const len0 = WASM_VECTOR_LEN;
|
|
1216
|
-
const ret = wasm.
|
|
1217
|
-
|
|
1218
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
1219
|
-
}
|
|
1220
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1221
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1222
|
-
return v2;
|
|
1222
|
+
const ret = wasm.restore_rgb_data(ptr0, len0);
|
|
1223
|
+
return ret;
|
|
1223
1224
|
}
|
|
1224
1225
|
|
|
1225
1226
|
/**
|
|
@@ -1251,264 +1252,274 @@ export function update_nostr_pubkey(pubkey, token) {
|
|
|
1251
1252
|
}
|
|
1252
1253
|
|
|
1253
1254
|
/**
|
|
1254
|
-
* @param {string}
|
|
1255
|
-
* @param {number}
|
|
1256
|
-
* @
|
|
1255
|
+
* @param {string} sk
|
|
1256
|
+
* @param {number} fee_rate
|
|
1257
|
+
* @param {any} secrets
|
|
1258
|
+
* @param {boolean} broadcast
|
|
1259
|
+
* @param {bigint | null | undefined} fund_value
|
|
1260
|
+
* @param {boolean} coordinator_fee
|
|
1261
|
+
* @returns {Promise<any>}
|
|
1257
1262
|
*/
|
|
1258
|
-
export function
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1264
|
-
const ret = wasm.convert_contract_amount_raw(ptr0, len0, precision);
|
|
1265
|
-
deferred2_0 = ret[0];
|
|
1266
|
-
deferred2_1 = ret[1];
|
|
1267
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1268
|
-
} finally {
|
|
1269
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1270
|
-
}
|
|
1263
|
+
export function fund_rgb_vault(sk, fee_rate, secrets, broadcast, fund_value, coordinator_fee) {
|
|
1264
|
+
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1265
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1266
|
+
const ret = wasm.fund_rgb_vault(ptr0, len0, fee_rate, secrets, broadcast, !isLikeNone(fund_value), isLikeNone(fund_value) ? BigInt(0) : fund_value, coordinator_fee);
|
|
1267
|
+
return ret;
|
|
1271
1268
|
}
|
|
1272
1269
|
|
|
1273
1270
|
/**
|
|
1274
|
-
* @param {
|
|
1275
|
-
* @param {
|
|
1276
|
-
* @
|
|
1271
|
+
* @param {string} sk
|
|
1272
|
+
* @param {string} address
|
|
1273
|
+
* @param {bigint} sats
|
|
1274
|
+
* @param {number} fee_rate
|
|
1275
|
+
* @param {any} secrets
|
|
1276
|
+
* @returns {Promise<any>}
|
|
1277
1277
|
*/
|
|
1278
|
-
export function
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1286
|
-
} finally {
|
|
1287
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1288
|
-
}
|
|
1278
|
+
export function transfer_sats(sk, address, sats, fee_rate, secrets) {
|
|
1279
|
+
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1280
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1281
|
+
const ptr1 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1282
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1283
|
+
const ret = wasm.transfer_sats(ptr0, len0, ptr1, len1, sats, fee_rate, secrets);
|
|
1284
|
+
return ret;
|
|
1289
1285
|
}
|
|
1290
1286
|
|
|
1291
1287
|
/**
|
|
1292
|
-
* @param {string}
|
|
1293
|
-
* @returns {any}
|
|
1288
|
+
* @param {string} sk
|
|
1289
|
+
* @returns {Promise<any>}
|
|
1294
1290
|
*/
|
|
1295
|
-
export function
|
|
1296
|
-
const ptr0 = passStringToWasm0(
|
|
1291
|
+
export function get_btc_wallet(sk) {
|
|
1292
|
+
const ptr0 = passStringToWasm0(sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1297
1293
|
const len0 = WASM_VECTOR_LEN;
|
|
1298
|
-
const ret = wasm.
|
|
1294
|
+
const ret = wasm.get_btc_wallet(ptr0, len0);
|
|
1299
1295
|
return ret;
|
|
1300
1296
|
}
|
|
1301
1297
|
|
|
1302
1298
|
/**
|
|
1303
|
-
* @param {string}
|
|
1304
|
-
* @
|
|
1305
|
-
* @returns {string}
|
|
1299
|
+
* @param {string} nostr_hex_sk
|
|
1300
|
+
* @returns {Promise<any>}
|
|
1306
1301
|
*/
|
|
1307
|
-
export function
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1313
|
-
const ret = wasm.parse_contract_amount_precision(ptr0, len0, precision);
|
|
1314
|
-
deferred2_0 = ret[0];
|
|
1315
|
-
deferred2_1 = ret[1];
|
|
1316
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1317
|
-
} finally {
|
|
1318
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1319
|
-
}
|
|
1302
|
+
export function backup_btc_data(nostr_hex_sk) {
|
|
1303
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1304
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1305
|
+
const ret = wasm.backup_btc_data(ptr0, len0);
|
|
1306
|
+
return ret;
|
|
1320
1307
|
}
|
|
1321
1308
|
|
|
1322
1309
|
/**
|
|
1323
|
-
* @
|
|
1310
|
+
* @param {string} seed
|
|
1311
|
+
* @param {string} pass_phrase
|
|
1312
|
+
* @param {string} recover_address
|
|
1313
|
+
* @returns {Promise<any>}
|
|
1324
1314
|
*/
|
|
1325
|
-
export function
|
|
1326
|
-
const
|
|
1315
|
+
export function recover_funds_from_bad_wallets(seed, pass_phrase, recover_address) {
|
|
1316
|
+
const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1317
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1318
|
+
const ptr1 = passStringToWasm0(pass_phrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1319
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1320
|
+
const ptr2 = passStringToWasm0(recover_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1321
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1322
|
+
const ret = wasm.recover_funds_from_bad_wallets(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1327
1323
|
return ret;
|
|
1328
1324
|
}
|
|
1329
1325
|
|
|
1330
1326
|
/**
|
|
1327
|
+
* @param {string} nostr_hex_sk
|
|
1331
1328
|
* @returns {Promise<any>}
|
|
1332
1329
|
*/
|
|
1333
|
-
export function
|
|
1334
|
-
const
|
|
1330
|
+
export function restore_btc_data(nostr_hex_sk) {
|
|
1331
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1332
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1333
|
+
const ret = wasm.restore_btc_data(ptr0, len0);
|
|
1335
1334
|
return ret;
|
|
1336
1335
|
}
|
|
1337
1336
|
|
|
1338
1337
|
/**
|
|
1339
|
-
* @param {string}
|
|
1338
|
+
* @param {string} nostr_hex_sk
|
|
1339
|
+
* @param {any} request
|
|
1340
1340
|
* @returns {Promise<any>}
|
|
1341
1341
|
*/
|
|
1342
|
-
export function
|
|
1343
|
-
const ptr0 = passStringToWasm0(
|
|
1342
|
+
export function create_watcher(nostr_hex_sk, request) {
|
|
1343
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1344
1344
|
const len0 = WASM_VECTOR_LEN;
|
|
1345
|
-
const ret = wasm.
|
|
1345
|
+
const ret = wasm.create_watcher(ptr0, len0, request);
|
|
1346
1346
|
return ret;
|
|
1347
1347
|
}
|
|
1348
1348
|
|
|
1349
1349
|
/**
|
|
1350
|
-
* @param {string}
|
|
1350
|
+
* @param {string} nostr_hex_sk
|
|
1351
|
+
* @param {any} request
|
|
1351
1352
|
* @returns {Promise<any>}
|
|
1352
1353
|
*/
|
|
1353
|
-
export function
|
|
1354
|
-
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);
|
|
1355
1356
|
const len0 = WASM_VECTOR_LEN;
|
|
1356
|
-
const ret = wasm.
|
|
1357
|
+
const ret = wasm.recover_watcher(ptr0, len0, request);
|
|
1357
1358
|
return ret;
|
|
1358
1359
|
}
|
|
1359
1360
|
|
|
1360
1361
|
/**
|
|
1361
|
-
* @param {string}
|
|
1362
|
-
* @param {string} value
|
|
1362
|
+
* @param {string} nostr_hex_sk
|
|
1363
1363
|
* @returns {Promise<any>}
|
|
1364
1364
|
*/
|
|
1365
|
-
export function
|
|
1366
|
-
const ptr0 = passStringToWasm0(
|
|
1365
|
+
export function destroy_watcher(nostr_hex_sk) {
|
|
1366
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1367
1367
|
const len0 = WASM_VECTOR_LEN;
|
|
1368
|
-
const
|
|
1369
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1370
|
-
const ret = wasm.set_env(ptr0, len0, ptr1, len1);
|
|
1368
|
+
const ret = wasm.destroy_watcher(ptr0, len0);
|
|
1371
1369
|
return ret;
|
|
1372
1370
|
}
|
|
1373
1371
|
|
|
1374
1372
|
/**
|
|
1375
|
-
* @param {
|
|
1373
|
+
* @param {string} nostr_hex_sk
|
|
1376
1374
|
* @returns {Promise<any>}
|
|
1377
1375
|
*/
|
|
1378
|
-
export function
|
|
1379
|
-
const
|
|
1376
|
+
export function destroy_recover_watcher(nostr_hex_sk) {
|
|
1377
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1378
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1379
|
+
const ret = wasm.destroy_recover_watcher(ptr0, len0);
|
|
1380
1380
|
return ret;
|
|
1381
1381
|
}
|
|
1382
1382
|
|
|
1383
1383
|
/**
|
|
1384
|
-
* @param {string}
|
|
1385
|
-
* @param {string} password
|
|
1384
|
+
* @param {string} nostr_hex_sk
|
|
1386
1385
|
* @returns {Promise<any>}
|
|
1387
1386
|
*/
|
|
1388
|
-
export function
|
|
1389
|
-
const ptr0 = passStringToWasm0(
|
|
1387
|
+
export function check_watcher(nostr_hex_sk) {
|
|
1388
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1390
1389
|
const len0 = WASM_VECTOR_LEN;
|
|
1391
|
-
const
|
|
1392
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1393
|
-
const ret = wasm.create_wallet(ptr0, len0, ptr1, len1);
|
|
1390
|
+
const ret = wasm.check_watcher(ptr0, len0);
|
|
1394
1391
|
return ret;
|
|
1395
1392
|
}
|
|
1396
1393
|
|
|
1397
1394
|
/**
|
|
1398
|
-
* @param {string}
|
|
1399
|
-
* @param {string}
|
|
1395
|
+
* @param {string} nostr_hex_sk
|
|
1396
|
+
* @param {string} request
|
|
1400
1397
|
* @returns {Promise<any>}
|
|
1401
1398
|
*/
|
|
1402
|
-
export function
|
|
1403
|
-
const ptr0 = passStringToWasm0(
|
|
1399
|
+
export function watcher_next_address(nostr_hex_sk, request) {
|
|
1400
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1404
1401
|
const len0 = WASM_VECTOR_LEN;
|
|
1405
|
-
const ptr1 = passStringToWasm0(
|
|
1402
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1406
1403
|
const len1 = WASM_VECTOR_LEN;
|
|
1407
|
-
const ret = wasm.
|
|
1404
|
+
const ret = wasm.watcher_next_address(ptr0, len0, ptr1, len1);
|
|
1408
1405
|
return ret;
|
|
1409
1406
|
}
|
|
1410
1407
|
|
|
1411
1408
|
/**
|
|
1412
|
-
* @param {string}
|
|
1413
|
-
* @param {
|
|
1414
|
-
* @param {string} token
|
|
1409
|
+
* @param {string} nostr_hex_sk
|
|
1410
|
+
* @param {string} request
|
|
1415
1411
|
* @returns {Promise<any>}
|
|
1416
1412
|
*/
|
|
1417
|
-
export function
|
|
1418
|
-
const ptr0 = passStringToWasm0(
|
|
1413
|
+
export function watcher_next_utxo(nostr_hex_sk, request) {
|
|
1414
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1419
1415
|
const len0 = WASM_VECTOR_LEN;
|
|
1420
|
-
const ptr1 = passStringToWasm0(
|
|
1416
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1421
1417
|
const len1 = WASM_VECTOR_LEN;
|
|
1422
|
-
const ret = wasm.
|
|
1418
|
+
const ret = wasm.watcher_next_utxo(ptr0, len0, ptr1, len1);
|
|
1423
1419
|
return ret;
|
|
1424
1420
|
}
|
|
1425
1421
|
|
|
1426
1422
|
/**
|
|
1427
|
-
* @param {string}
|
|
1423
|
+
* @param {string} nostr_hex_sk
|
|
1424
|
+
* @param {string} request
|
|
1428
1425
|
* @returns {Promise<any>}
|
|
1429
1426
|
*/
|
|
1430
|
-
export function
|
|
1431
|
-
const ptr0 = passStringToWasm0(
|
|
1427
|
+
export function watcher_unspent_utxos(nostr_hex_sk, request) {
|
|
1428
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1432
1429
|
const len0 = WASM_VECTOR_LEN;
|
|
1433
|
-
const
|
|
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);
|
|
1434
1433
|
return ret;
|
|
1435
1434
|
}
|
|
1436
1435
|
|
|
1437
1436
|
/**
|
|
1438
|
-
* @param {string}
|
|
1439
|
-
* @
|
|
1437
|
+
* @param {string} decimal
|
|
1438
|
+
* @param {number} precision
|
|
1439
|
+
* @returns {string}
|
|
1440
1440
|
*/
|
|
1441
|
-
export function
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
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
|
+
}
|
|
1446
1454
|
}
|
|
1447
1455
|
|
|
1448
1456
|
/**
|
|
1449
|
-
* @param {
|
|
1450
|
-
* @param {
|
|
1451
|
-
* @returns {
|
|
1457
|
+
* @param {bigint} amount
|
|
1458
|
+
* @param {number} precision
|
|
1459
|
+
* @returns {string}
|
|
1452
1460
|
*/
|
|
1453
|
-
export function
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
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
|
+
}
|
|
1460
1472
|
}
|
|
1461
1473
|
|
|
1462
1474
|
/**
|
|
1463
|
-
* @param {string}
|
|
1464
|
-
* @returns {
|
|
1475
|
+
* @param {string} amount
|
|
1476
|
+
* @returns {any}
|
|
1465
1477
|
*/
|
|
1466
|
-
export function
|
|
1467
|
-
const ptr0 = passStringToWasm0(
|
|
1478
|
+
export function parse_contract_amount(amount) {
|
|
1479
|
+
const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1468
1480
|
const len0 = WASM_VECTOR_LEN;
|
|
1469
|
-
const ret = wasm.
|
|
1481
|
+
const ret = wasm.parse_contract_amount(ptr0, len0);
|
|
1470
1482
|
return ret;
|
|
1471
1483
|
}
|
|
1472
1484
|
|
|
1473
1485
|
/**
|
|
1474
|
-
* @param {string}
|
|
1475
|
-
* @param {
|
|
1476
|
-
* @returns {
|
|
1486
|
+
* @param {string} amount
|
|
1487
|
+
* @param {number} precision
|
|
1488
|
+
* @returns {string}
|
|
1477
1489
|
*/
|
|
1478
|
-
export function
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
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
|
+
}
|
|
1485
1503
|
}
|
|
1486
1504
|
|
|
1487
1505
|
/**
|
|
1488
|
-
* @
|
|
1489
|
-
* @param {bigint} amount
|
|
1490
|
-
* @param {string} token
|
|
1491
|
-
* @returns {Promise<any>}
|
|
1506
|
+
* @returns {any}
|
|
1492
1507
|
*/
|
|
1493
|
-
export function
|
|
1494
|
-
const
|
|
1495
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1496
|
-
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1497
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1498
|
-
const ret = wasm.swap_ln_btc(ptr0, len0, amount, ptr1, len1);
|
|
1508
|
+
export function version() {
|
|
1509
|
+
const ret = wasm.version();
|
|
1499
1510
|
return ret;
|
|
1500
1511
|
}
|
|
1501
1512
|
|
|
1502
1513
|
function __wbg_adapter_54(arg0, arg1, arg2) {
|
|
1503
|
-
wasm.
|
|
1514
|
+
wasm.closure1782_externref_shim(arg0, arg1, arg2);
|
|
1504
1515
|
}
|
|
1505
1516
|
|
|
1506
1517
|
function __wbg_adapter_57(arg0, arg1, arg2) {
|
|
1507
|
-
wasm.
|
|
1518
|
+
wasm.closure2713_externref_shim(arg0, arg1, arg2);
|
|
1508
1519
|
}
|
|
1509
1520
|
|
|
1510
1521
|
function __wbg_adapter_60(arg0, arg1, arg2) {
|
|
1511
|
-
wasm.
|
|
1522
|
+
wasm.closure2744_externref_shim(arg0, arg1, arg2);
|
|
1512
1523
|
}
|
|
1513
1524
|
|
|
1514
1525
|
function __wbg_adapter_63(arg0, arg1) {
|
|
@@ -1516,11 +1527,11 @@ function __wbg_adapter_63(arg0, arg1) {
|
|
|
1516
1527
|
}
|
|
1517
1528
|
|
|
1518
1529
|
function __wbg_adapter_66(arg0, arg1, arg2) {
|
|
1519
|
-
wasm.
|
|
1530
|
+
wasm.closure3924_externref_shim(arg0, arg1, arg2);
|
|
1520
1531
|
}
|
|
1521
1532
|
|
|
1522
|
-
function
|
|
1523
|
-
wasm.
|
|
1533
|
+
function __wbg_adapter_429(arg0, arg1, arg2, arg3) {
|
|
1534
|
+
wasm.closure4216_externref_shim(arg0, arg1, arg2, arg3);
|
|
1524
1535
|
}
|
|
1525
1536
|
|
|
1526
1537
|
const __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"];
|
|
@@ -1929,7 +1940,7 @@ function __wbg_get_imports() {
|
|
|
1929
1940
|
const a = state0.a;
|
|
1930
1941
|
state0.a = 0;
|
|
1931
1942
|
try {
|
|
1932
|
-
return
|
|
1943
|
+
return __wbg_adapter_429(a, state0.b, arg0, arg1);
|
|
1933
1944
|
} finally {
|
|
1934
1945
|
state0.a = a;
|
|
1935
1946
|
}
|
|
@@ -2287,24 +2298,24 @@ function __wbg_get_imports() {
|
|
|
2287
2298
|
const ret = false;
|
|
2288
2299
|
return ret;
|
|
2289
2300
|
};
|
|
2290
|
-
imports.wbg.
|
|
2291
|
-
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);
|
|
2292
2303
|
return ret;
|
|
2293
2304
|
};
|
|
2294
|
-
imports.wbg.
|
|
2295
|
-
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);
|
|
2296
2307
|
return ret;
|
|
2297
2308
|
};
|
|
2298
|
-
imports.wbg.
|
|
2299
|
-
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);
|
|
2300
2311
|
return ret;
|
|
2301
2312
|
};
|
|
2302
|
-
imports.wbg.
|
|
2303
|
-
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);
|
|
2304
2315
|
return ret;
|
|
2305
2316
|
};
|
|
2306
|
-
imports.wbg.
|
|
2307
|
-
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);
|
|
2308
2319
|
return ret;
|
|
2309
2320
|
};
|
|
2310
2321
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|