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

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 +155 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbis1/rgb-lib-linux-arm64",
3
- "version": "0.3.0-beta.6",
3
+ "version": "0.3.0-beta.8",
4
4
  "description": "Node.js bindings for rgb-lib on linux-arm64",
5
5
  "main": "wrapper.js",
6
6
  "os": [
package/wrapper.js CHANGED
@@ -300,6 +300,90 @@ exports.Wallet = class Wallet {
300
300
  );
301
301
  }
302
302
 
303
+ createUtxosBegin(online, upTo, num, size, feeRate, skipSync) {
304
+ const params = { online, upTo, num, size, feeRate, skipSync };
305
+ const expectedTypes = {
306
+ online: "object",
307
+ upTo: "boolean",
308
+ num: "u8?",
309
+ size: "u32?",
310
+ feeRate: "u64",
311
+ skipSync: "boolean",
312
+ };
313
+ validateTypes(params, expectedTypes);
314
+ return lib.rgblib_create_utxos_begin(
315
+ this.wallet,
316
+ online,
317
+ upTo,
318
+ num,
319
+ size,
320
+ feeRate,
321
+ skipSync,
322
+ );
323
+ }
324
+
325
+ createUtxosEnd(online, signedPsbt, skipSync) {
326
+ const params = { online, signedPsbt, skipSync };
327
+ const expectedTypes = {
328
+ online: "object",
329
+ signedPsbt: "string",
330
+ skipSync: "boolean",
331
+ };
332
+ validateTypes(params, expectedTypes);
333
+ return JSON.parse(
334
+ lib.rgblib_create_utxos_end(
335
+ this.wallet,
336
+ online,
337
+ signedPsbt,
338
+ skipSync,
339
+ ),
340
+ );
341
+ }
342
+
343
+ deleteTransfers(batchTransferIdx, noAssetOnly) {
344
+ const params = {
345
+ batchTransferIdx,
346
+ noAssetOnly,
347
+ };
348
+ const expectedTypes = {
349
+ batchTransferIdx: "i32?",
350
+ noAssetOnly: "boolean",
351
+ };
352
+ validateTypes(params, expectedTypes);
353
+ return JSON.parse(
354
+ lib.rgblib_delete_transfers(
355
+ this.wallet,
356
+ batchTransferIdx,
357
+ noAssetOnly,
358
+ ),
359
+ );
360
+ }
361
+
362
+ failTransfers(online, batchTransferIdx, noAssetOnly, skipSync) {
363
+ const params = {
364
+ online,
365
+ batchTransferIdx,
366
+ noAssetOnly,
367
+ skipSync,
368
+ };
369
+ const expectedTypes = {
370
+ online: "object",
371
+ batchTransferIdx: "i32?",
372
+ noAssetOnly: "boolean",
373
+ skipSync: "boolean",
374
+ };
375
+ validateTypes(params, expectedTypes);
376
+ return JSON.parse(
377
+ lib.rgblib_fail_transfers(
378
+ this.wallet,
379
+ online,
380
+ batchTransferIdx,
381
+ noAssetOnly,
382
+ skipSync,
383
+ ),
384
+ );
385
+ }
386
+
303
387
  getAddress() {
304
388
  return lib.rgblib_get_address(this.wallet);
305
389
  }
@@ -313,6 +397,15 @@ exports.Wallet = class Wallet {
313
397
  return JSON.parse(lib.rgblib_get_asset_balance(this.wallet, assetId));
314
398
  }
315
399
 
400
+ getAssetMetadata(assetId) {
401
+ const params = { assetId };
402
+ const expectedTypes = {
403
+ assetId: "string",
404
+ };
405
+ validateTypes(params, expectedTypes);
406
+ return JSON.parse(lib.rgblib_get_asset_metadata(this.wallet, assetId));
407
+ }
408
+
316
409
  getBtcBalance(online, skipSync) {
317
410
  const params = { online, skipSync };
318
411
  const expectedTypes = {
@@ -556,6 +649,32 @@ exports.Wallet = class Wallet {
556
649
  );
557
650
  }
558
651
 
652
+ sendBegin(online, recipientMap, donation, feeRate, minConfirmations) {
653
+ const params = {
654
+ online,
655
+ recipientMap,
656
+ donation,
657
+ feeRate,
658
+ minConfirmations,
659
+ };
660
+ const expectedTypes = {
661
+ online: "object",
662
+ recipientMap: "object",
663
+ donation: "boolean",
664
+ feeRate: "u64",
665
+ minConfirmations: "u8",
666
+ };
667
+ validateTypes(params, expectedTypes);
668
+ return lib.rgblib_send_begin(
669
+ this.wallet,
670
+ online,
671
+ JSON.stringify(recipientMap),
672
+ donation,
673
+ feeRate,
674
+ minConfirmations,
675
+ );
676
+ }
677
+
559
678
  sendBtc(online, address, amount, feeRate, skipSync) {
560
679
  const params = {
561
680
  online,
@@ -582,6 +701,23 @@ exports.Wallet = class Wallet {
582
701
  );
583
702
  }
584
703
 
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
+
585
721
  signPsbt(psbt) {
586
722
  const params = { psbt };
587
723
  const expectedTypes = {
@@ -600,6 +736,24 @@ exports.Wallet = class Wallet {
600
736
  lib.rgblib_sync(this.wallet, online);
601
737
  }
602
738
 
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
+
603
757
  witnessReceive(
604
758
  assetId,
605
759
  assignment,
@@ -633,4 +787,4 @@ exports.Wallet = class Wallet {
633
787
  ),
634
788
  );
635
789
  }
636
- };
790
+ };