@orbis1/rgb-lib-linux-arm64 0.3.0-beta.8 → 0.3.0-beta.9

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/wrapper.js +56 -38
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbis1/rgb-lib-linux-arm64",
3
- "version": "0.3.0-beta.8",
3
+ "version": "0.3.0-beta.9",
4
4
  "description": "Node.js bindings for rgb-lib on linux-arm64",
5
5
  "main": "wrapper.js",
6
6
  "os": [
package/wrapper.js CHANGED
@@ -384,6 +384,14 @@ exports.Wallet = class Wallet {
384
384
  );
385
385
  }
386
386
 
387
+ getWalletData(walletId) {
388
+ return lib.rgblib_get_wallet_data(this.wallet, walletId);
389
+ }
390
+
391
+ getWalletDir(walletId) {
392
+ return lib.rgblib_get_wallet_dir(this.wallet, walletId);
393
+ }
394
+
387
395
  getAddress() {
388
396
  return lib.rgblib_get_address(this.wallet);
389
397
  }
@@ -649,13 +657,16 @@ exports.Wallet = class Wallet {
649
657
  );
650
658
  }
651
659
 
652
- sendBegin(online, recipientMap, donation, feeRate, minConfirmations) {
660
+
661
+ sendBegin(online, recipientMap, donation, feeRate, minConfirmations, externalInputs = null, externalOutputs = null) {
653
662
  const params = {
654
663
  online,
655
664
  recipientMap,
656
665
  donation,
657
666
  feeRate,
658
667
  minConfirmations,
668
+ externalInputs,
669
+ externalOutputs,
659
670
  };
660
671
  const expectedTypes = {
661
672
  online: "object",
@@ -665,16 +676,58 @@ exports.Wallet = class Wallet {
665
676
  minConfirmations: "u8",
666
677
  };
667
678
  validateTypes(params, expectedTypes);
679
+
680
+ const externalInputsStr = externalInputs ? JSON.stringify(externalInputs) : null;
681
+ const externalOutputsStr = externalOutputs ? JSON.stringify(externalOutputs) : null;
682
+
668
683
  return lib.rgblib_send_begin(
669
684
  this.wallet,
670
685
  online,
671
686
  JSON.stringify(recipientMap),
672
687
  donation,
673
- feeRate,
674
- minConfirmations,
688
+ feeRate.toString(),
689
+ minConfirmations.toString(),
690
+ externalInputsStr,
691
+ externalOutputsStr
675
692
  );
676
693
  }
677
694
 
695
+ sendEnd(online, signedPsbt, skipSync = false) {
696
+ const params = { online, signedPsbt, skipSync };
697
+ const expectedTypes = {
698
+ online: "object",
699
+ signedPsbt: "string",
700
+ skipSync: "boolean",
701
+ };
702
+ validateTypes(params, expectedTypes);
703
+
704
+ return JSON.parse(
705
+ lib.rgblib_send_end(
706
+ this.wallet,
707
+ online,
708
+ signedPsbt,
709
+ skipSync
710
+ )
711
+ );
712
+ }
713
+
714
+ verifyConsignmentAmount(consignmentPath, recipientId, expectedAmount) {
715
+ const params = { consignmentPath, recipientId, expectedAmount };
716
+ const expectedTypes = {
717
+ consignmentPath: "string",
718
+ recipientId: "string",
719
+ expectedAmount: "u64",
720
+ };
721
+ validateTypes(params, expectedTypes);
722
+
723
+ const result = lib.rgblib_verify_consignment_amount(
724
+ this.wallet,
725
+ consignmentPath,
726
+ recipientId,
727
+ expectedAmount.toString()
728
+ );
729
+ return result === "true";
730
+ }
678
731
  sendBtc(online, address, amount, feeRate, skipSync) {
679
732
  const params = {
680
733
  online,
@@ -701,23 +754,6 @@ exports.Wallet = class Wallet {
701
754
  );
702
755
  }
703
756
 
704
- sendEnd(online, signedPsbt, skipSync) {
705
- const params = {
706
- online,
707
- signedPsbt,
708
- skipSync,
709
- };
710
- const expectedTypes = {
711
- online: "object",
712
- signedPsbt: "string",
713
- skipSync: "boolean",
714
- };
715
- validateTypes(params, expectedTypes);
716
- return JSON.parse(
717
- lib.rgblib_send_end(this.wallet, online, signedPsbt, skipSync),
718
- );
719
- }
720
-
721
757
  signPsbt(psbt) {
722
758
  const params = { psbt };
723
759
  const expectedTypes = {
@@ -736,24 +772,6 @@ exports.Wallet = class Wallet {
736
772
  lib.rgblib_sync(this.wallet, online);
737
773
  }
738
774
 
739
- verifyConsignmentAmount(consignmentPath, recipientId, expectedAmount) {
740
- const params = { consignmentPath, recipientId, expectedAmount };
741
- const expectedTypes = {
742
- consignmentPath: "string",
743
- recipientId: "string",
744
- expectedAmount: "u64",
745
- };
746
- validateTypes(params, expectedTypes);
747
-
748
- const result = lib.rgblib_verify_consignment_amount(
749
- this.wallet,
750
- consignmentPath,
751
- recipientId,
752
- expectedAmount.toString()
753
- );
754
- return result === "true";
755
- }
756
-
757
775
  witnessReceive(
758
776
  assetId,
759
777
  assignment,