@utexo/rgb-lib-linux-x64 0.3.0-beta.11.vss → 0.3.0-beta.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utexo/rgb-lib-linux-x64",
3
- "version": "0.3.0-beta.11.vss",
3
+ "version": "0.3.0-beta.12",
4
4
  "description": "Node.js bindings for rgb-lib on linux-x64",
5
5
  "main": "wrapper.js",
6
6
  "os": [
@@ -220,6 +220,10 @@ CResultString rgblib_sign_psbt(const COpaqueStruct *wallet, const char *unsigned
220
220
 
221
221
  CResultString rgblib_sync(const COpaqueStruct *wallet, const COpaqueStruct *online);
222
222
 
223
+ CResultString rgblib_validate_consignment(const char *file_path,
224
+ const char *indexer_url,
225
+ const char *bitcoin_network);
226
+
223
227
  CResultString rgblib_vss_backup(const COpaqueStruct *wallet, const COpaqueStruct *client);
224
228
 
225
229
  CResultString rgblib_vss_backup_client_encryption_enabled(const COpaqueStruct *client);
package/swig_wrap.cxx CHANGED
@@ -4945,6 +4945,66 @@ fail:
4945
4945
  }
4946
4946
 
4947
4947
 
4948
+ static SwigV8ReturnValue _wrap_rgblib_validate_consignment(const SwigV8Arguments &args) {
4949
+ SWIGV8_HANDLESCOPE();
4950
+
4951
+ SWIGV8_VALUE jsresult;
4952
+ char *arg1 = (char *) 0 ;
4953
+ char *arg2 = (char *) 0 ;
4954
+ char *arg3 = (char *) 0 ;
4955
+ int res1 ;
4956
+ char *buf1 = 0 ;
4957
+ int alloc1 = 0 ;
4958
+ int res2 ;
4959
+ char *buf2 = 0 ;
4960
+ int alloc2 = 0 ;
4961
+ int res3 ;
4962
+ char *buf3 = 0 ;
4963
+ int alloc3 = 0 ;
4964
+ CResultString result;
4965
+
4966
+ if (args.Length() < 3 || args.Length() > 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_rgblib_validate_consignment.");
4967
+
4968
+ res1 = SWIG_AsCharPtrAndSize(args[0], &buf1, NULL, &alloc1);
4969
+ if (!SWIG_IsOK(res1)) {
4970
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rgblib_validate_consignment" "', argument " "1"" of type '" "char const *""'");
4971
+ }
4972
+ arg1 = reinterpret_cast< char * >(buf1);res2 = SWIG_AsCharPtrAndSize(args[1], &buf2, NULL, &alloc2);
4973
+ if (!SWIG_IsOK(res2)) {
4974
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rgblib_validate_consignment" "', argument " "2"" of type '" "char const *""'");
4975
+ }
4976
+ arg2 = reinterpret_cast< char * >(buf2);res3 = SWIG_AsCharPtrAndSize(args[2], &buf3, NULL, &alloc3);
4977
+ if (!SWIG_IsOK(res3)) {
4978
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "rgblib_validate_consignment" "', argument " "3"" of type '" "char const *""'");
4979
+ }
4980
+ arg3 = reinterpret_cast< char * >(buf3);result = rgblib_validate_consignment((char const *)arg1,(char const *)arg2,(char const *)arg3);
4981
+
4982
+ switch ((&result)->result) {
4983
+ case CResultValue::Ok:
4984
+ if ((&result)->inner == nullptr) {
4985
+ jsresult = v8::Null(v8::Isolate::GetCurrent());
4986
+ } else {
4987
+ jsresult = v8::String::NewFromUtf8(args.GetIsolate(), (const char*) (&result)->inner).ToLocalChecked();
4988
+ delete ((&result)->inner);
4989
+ }
4990
+ break;
4991
+ case CResultValue::Err:
4992
+ SWIG_V8_Raise((const char*) (&result)->inner);
4993
+ break;
4994
+ }
4995
+
4996
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
4997
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
4998
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
4999
+
5000
+ SWIGV8_RETURN(jsresult);
5001
+
5002
+ goto fail;
5003
+ fail:
5004
+ SWIGV8_RETURN(SWIGV8_UNDEFINED());
5005
+ }
5006
+
5007
+
4948
5008
  static SwigV8ReturnValue _wrap_rgblib_vss_backup(const SwigV8Arguments &args) {
4949
5009
  SWIGV8_HANDLESCOPE();
4950
5010
 
@@ -5678,6 +5738,7 @@ SWIGV8_AddStaticFunction(exports_obj, "rgblib_send_btc_end", _wrap_rgblib_send_b
5678
5738
  SWIGV8_AddStaticFunction(exports_obj, "rgblib_send_end", _wrap_rgblib_send_end, context);
5679
5739
  SWIGV8_AddStaticFunction(exports_obj, "rgblib_sign_psbt", _wrap_rgblib_sign_psbt, context);
5680
5740
  SWIGV8_AddStaticFunction(exports_obj, "rgblib_sync", _wrap_rgblib_sync, context);
5741
+ SWIGV8_AddStaticFunction(exports_obj, "rgblib_validate_consignment", _wrap_rgblib_validate_consignment, context);
5681
5742
  SWIGV8_AddStaticFunction(exports_obj, "rgblib_vss_backup", _wrap_rgblib_vss_backup, context);
5682
5743
  SWIGV8_AddStaticFunction(exports_obj, "rgblib_vss_backup_client_encryption_enabled", _wrap_rgblib_vss_backup_client_encryption_enabled, context);
5683
5744
  SWIGV8_AddStaticFunction(exports_obj, "rgblib_vss_backup_info", _wrap_rgblib_vss_backup_info, context);
package/wrapper.js CHANGED
@@ -881,6 +881,23 @@ exports.Wallet = class Wallet {
881
881
  }
882
882
  };
883
883
 
884
+ exports.validateConsignment = function validateConsignment(filePath, indexerUrl, bitcoinNetwork) {
885
+ const params = { filePath, indexerUrl, bitcoinNetwork };
886
+ const expectedTypes = {
887
+ filePath: "string",
888
+ indexerUrl: "string",
889
+ bitcoinNetwork: "string",
890
+ };
891
+ validateTypes(params, expectedTypes);
892
+ validateEnumValues(
893
+ { bitcoinNetwork },
894
+ { bitcoinNetwork: BitcoinNetwork },
895
+ );
896
+ return JSON.parse(
897
+ lib.rgblib_validate_consignment(filePath, indexerUrl, bitcoinNetwork),
898
+ );
899
+ };
900
+
884
901
  exports.Invoice = class Invoice {
885
902
  constructor(invoiceString) {
886
903
  const params = { invoiceString };