@utexo/rgb-lib-linux-x64 0.3.0-beta.13 → 0.3.0-beta.14.vss
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
|
@@ -91,6 +91,8 @@ CResultString rgblib_get_address(const COpaqueStruct *wallet);
|
|
|
91
91
|
|
|
92
92
|
CResultString rgblib_get_asset_balance(const COpaqueStruct *wallet, const char *asset_id);
|
|
93
93
|
|
|
94
|
+
CResultString rgblib_get_asset_metadata(const COpaqueStruct *wallet, const char *asset_id);
|
|
95
|
+
|
|
94
96
|
CResultString rgblib_get_btc_balance(const COpaqueStruct *wallet,
|
|
95
97
|
const COpaqueStruct *online,
|
|
96
98
|
bool skip_sync);
|
|
@@ -224,6 +226,11 @@ CResultString rgblib_validate_consignment(const char *file_path,
|
|
|
224
226
|
const char *indexer_url,
|
|
225
227
|
const char *bitcoin_network);
|
|
226
228
|
|
|
229
|
+
CResultString rgblib_validate_consignment_offchain(const char *file_path,
|
|
230
|
+
const char *txid,
|
|
231
|
+
const char *indexer_url,
|
|
232
|
+
const char *bitcoin_network);
|
|
233
|
+
|
|
227
234
|
CResultString rgblib_vss_backup(const COpaqueStruct *wallet, const COpaqueStruct *client);
|
|
228
235
|
|
|
229
236
|
CResultString rgblib_vss_backup_client_encryption_enabled(const COpaqueStruct *client);
|
|
Binary file
|
package/swig_wrap.cxx
CHANGED
|
@@ -3080,6 +3080,56 @@ fail:
|
|
|
3080
3080
|
}
|
|
3081
3081
|
|
|
3082
3082
|
|
|
3083
|
+
static SwigV8ReturnValue _wrap_rgblib_get_asset_metadata(const SwigV8Arguments &args) {
|
|
3084
|
+
SWIGV8_HANDLESCOPE();
|
|
3085
|
+
|
|
3086
|
+
SWIGV8_VALUE jsresult;
|
|
3087
|
+
COpaqueStruct *arg1 = (COpaqueStruct *) 0 ;
|
|
3088
|
+
char *arg2 = (char *) 0 ;
|
|
3089
|
+
void *argp1 = 0 ;
|
|
3090
|
+
int res1 = 0 ;
|
|
3091
|
+
int res2 ;
|
|
3092
|
+
char *buf2 = 0 ;
|
|
3093
|
+
int alloc2 = 0 ;
|
|
3094
|
+
CResultString result;
|
|
3095
|
+
|
|
3096
|
+
if (args.Length() < 2 || args.Length() > 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_rgblib_get_asset_metadata.");
|
|
3097
|
+
|
|
3098
|
+
res1 = SWIG_ConvertPtr(args[0], &argp1,SWIGTYPE_p_COpaqueStruct, 0 | 0 );
|
|
3099
|
+
if (!SWIG_IsOK(res1)) {
|
|
3100
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rgblib_get_asset_metadata" "', argument " "1"" of type '" "COpaqueStruct const *""'");
|
|
3101
|
+
}
|
|
3102
|
+
arg1 = reinterpret_cast< COpaqueStruct * >(argp1);res2 = SWIG_AsCharPtrAndSize(args[1], &buf2, NULL, &alloc2);
|
|
3103
|
+
if (!SWIG_IsOK(res2)) {
|
|
3104
|
+
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rgblib_get_asset_metadata" "', argument " "2"" of type '" "char const *""'");
|
|
3105
|
+
}
|
|
3106
|
+
arg2 = reinterpret_cast< char * >(buf2);result = rgblib_get_asset_metadata((COpaqueStruct const *)arg1,(char const *)arg2);
|
|
3107
|
+
|
|
3108
|
+
switch ((&result)->result) {
|
|
3109
|
+
case CResultValue::Ok:
|
|
3110
|
+
if ((&result)->inner == nullptr) {
|
|
3111
|
+
jsresult = v8::Null(v8::Isolate::GetCurrent());
|
|
3112
|
+
} else {
|
|
3113
|
+
jsresult = v8::String::NewFromUtf8(args.GetIsolate(), (const char*) (&result)->inner).ToLocalChecked();
|
|
3114
|
+
delete ((&result)->inner);
|
|
3115
|
+
}
|
|
3116
|
+
break;
|
|
3117
|
+
case CResultValue::Err:
|
|
3118
|
+
SWIG_V8_Raise((const char*) (&result)->inner);
|
|
3119
|
+
break;
|
|
3120
|
+
}
|
|
3121
|
+
|
|
3122
|
+
|
|
3123
|
+
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
|
3124
|
+
|
|
3125
|
+
SWIGV8_RETURN(jsresult);
|
|
3126
|
+
|
|
3127
|
+
goto fail;
|
|
3128
|
+
fail:
|
|
3129
|
+
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
|
3130
|
+
}
|
|
3131
|
+
|
|
3132
|
+
|
|
3083
3133
|
static SwigV8ReturnValue _wrap_rgblib_get_btc_balance(const SwigV8Arguments &args) {
|
|
3084
3134
|
SWIGV8_HANDLESCOPE();
|
|
3085
3135
|
|
|
@@ -5005,6 +5055,75 @@ fail:
|
|
|
5005
5055
|
}
|
|
5006
5056
|
|
|
5007
5057
|
|
|
5058
|
+
static SwigV8ReturnValue _wrap_rgblib_validate_consignment_offchain(const SwigV8Arguments &args) {
|
|
5059
|
+
SWIGV8_HANDLESCOPE();
|
|
5060
|
+
|
|
5061
|
+
SWIGV8_VALUE jsresult;
|
|
5062
|
+
char *arg1 = (char *) 0 ;
|
|
5063
|
+
char *arg2 = (char *) 0 ;
|
|
5064
|
+
char *arg3 = (char *) 0 ;
|
|
5065
|
+
char *arg4 = (char *) 0 ;
|
|
5066
|
+
int res1 ;
|
|
5067
|
+
char *buf1 = 0 ;
|
|
5068
|
+
int alloc1 = 0 ;
|
|
5069
|
+
int res2 ;
|
|
5070
|
+
char *buf2 = 0 ;
|
|
5071
|
+
int alloc2 = 0 ;
|
|
5072
|
+
int res3 ;
|
|
5073
|
+
char *buf3 = 0 ;
|
|
5074
|
+
int alloc3 = 0 ;
|
|
5075
|
+
int res4 ;
|
|
5076
|
+
char *buf4 = 0 ;
|
|
5077
|
+
int alloc4 = 0 ;
|
|
5078
|
+
CResultString result;
|
|
5079
|
+
|
|
5080
|
+
if (args.Length() < 4 || args.Length() > 4) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_rgblib_validate_consignment_offchain.");
|
|
5081
|
+
|
|
5082
|
+
res1 = SWIG_AsCharPtrAndSize(args[0], &buf1, NULL, &alloc1);
|
|
5083
|
+
if (!SWIG_IsOK(res1)) {
|
|
5084
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rgblib_validate_consignment_offchain" "', argument " "1"" of type '" "char const *""'");
|
|
5085
|
+
}
|
|
5086
|
+
arg1 = reinterpret_cast< char * >(buf1);res2 = SWIG_AsCharPtrAndSize(args[1], &buf2, NULL, &alloc2);
|
|
5087
|
+
if (!SWIG_IsOK(res2)) {
|
|
5088
|
+
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rgblib_validate_consignment_offchain" "', argument " "2"" of type '" "char const *""'");
|
|
5089
|
+
}
|
|
5090
|
+
arg2 = reinterpret_cast< char * >(buf2);res3 = SWIG_AsCharPtrAndSize(args[2], &buf3, NULL, &alloc3);
|
|
5091
|
+
if (!SWIG_IsOK(res3)) {
|
|
5092
|
+
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "rgblib_validate_consignment_offchain" "', argument " "3"" of type '" "char const *""'");
|
|
5093
|
+
}
|
|
5094
|
+
arg3 = reinterpret_cast< char * >(buf3);res4 = SWIG_AsCharPtrAndSize(args[3], &buf4, NULL, &alloc4);
|
|
5095
|
+
if (!SWIG_IsOK(res4)) {
|
|
5096
|
+
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "rgblib_validate_consignment_offchain" "', argument " "4"" of type '" "char const *""'");
|
|
5097
|
+
}
|
|
5098
|
+
arg4 = reinterpret_cast< char * >(buf4);result = rgblib_validate_consignment_offchain((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4);
|
|
5099
|
+
|
|
5100
|
+
switch ((&result)->result) {
|
|
5101
|
+
case CResultValue::Ok:
|
|
5102
|
+
if ((&result)->inner == nullptr) {
|
|
5103
|
+
jsresult = v8::Null(v8::Isolate::GetCurrent());
|
|
5104
|
+
} else {
|
|
5105
|
+
jsresult = v8::String::NewFromUtf8(args.GetIsolate(), (const char*) (&result)->inner).ToLocalChecked();
|
|
5106
|
+
delete ((&result)->inner);
|
|
5107
|
+
}
|
|
5108
|
+
break;
|
|
5109
|
+
case CResultValue::Err:
|
|
5110
|
+
SWIG_V8_Raise((const char*) (&result)->inner);
|
|
5111
|
+
break;
|
|
5112
|
+
}
|
|
5113
|
+
|
|
5114
|
+
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
|
5115
|
+
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
|
5116
|
+
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
|
|
5117
|
+
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
|
|
5118
|
+
|
|
5119
|
+
SWIGV8_RETURN(jsresult);
|
|
5120
|
+
|
|
5121
|
+
goto fail;
|
|
5122
|
+
fail:
|
|
5123
|
+
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
|
5124
|
+
}
|
|
5125
|
+
|
|
5126
|
+
|
|
5008
5127
|
static SwigV8ReturnValue _wrap_rgblib_vss_backup(const SwigV8Arguments &args) {
|
|
5009
5128
|
SWIGV8_HANDLESCOPE();
|
|
5010
5129
|
|
|
@@ -5709,6 +5828,7 @@ SWIGV8_AddStaticFunction(exports_obj, "rgblib_finalize_psbt", _wrap_rgblib_final
|
|
|
5709
5828
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_generate_keys", _wrap_rgblib_generate_keys, context);
|
|
5710
5829
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_get_address", _wrap_rgblib_get_address, context);
|
|
5711
5830
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_get_asset_balance", _wrap_rgblib_get_asset_balance, context);
|
|
5831
|
+
SWIGV8_AddStaticFunction(exports_obj, "rgblib_get_asset_metadata", _wrap_rgblib_get_asset_metadata, context);
|
|
5712
5832
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_get_btc_balance", _wrap_rgblib_get_btc_balance, context);
|
|
5713
5833
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_get_fee_estimation", _wrap_rgblib_get_fee_estimation, context);
|
|
5714
5834
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_go_online", _wrap_rgblib_go_online, context);
|
|
@@ -5739,6 +5859,7 @@ SWIGV8_AddStaticFunction(exports_obj, "rgblib_send_end", _wrap_rgblib_send_end,
|
|
|
5739
5859
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_sign_psbt", _wrap_rgblib_sign_psbt, context);
|
|
5740
5860
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_sync", _wrap_rgblib_sync, context);
|
|
5741
5861
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_validate_consignment", _wrap_rgblib_validate_consignment, context);
|
|
5862
|
+
SWIGV8_AddStaticFunction(exports_obj, "rgblib_validate_consignment_offchain", _wrap_rgblib_validate_consignment_offchain, context);
|
|
5742
5863
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_vss_backup", _wrap_rgblib_vss_backup, context);
|
|
5743
5864
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_vss_backup_client_encryption_enabled", _wrap_rgblib_vss_backup_client_encryption_enabled, context);
|
|
5744
5865
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_vss_backup_info", _wrap_rgblib_vss_backup_info, context);
|
package/wrapper.js
CHANGED
|
@@ -898,6 +898,34 @@ exports.validateConsignment = function validateConsignment(filePath, indexerUrl,
|
|
|
898
898
|
);
|
|
899
899
|
};
|
|
900
900
|
|
|
901
|
+
exports.validateConsignmentOffchain = function validateConsignmentOffchain(
|
|
902
|
+
filePath,
|
|
903
|
+
txid,
|
|
904
|
+
indexerUrl,
|
|
905
|
+
bitcoinNetwork,
|
|
906
|
+
) {
|
|
907
|
+
const params = { filePath, txid, indexerUrl, bitcoinNetwork };
|
|
908
|
+
const expectedTypes = {
|
|
909
|
+
filePath: "string",
|
|
910
|
+
txid: "string",
|
|
911
|
+
indexerUrl: "string",
|
|
912
|
+
bitcoinNetwork: "string",
|
|
913
|
+
};
|
|
914
|
+
validateTypes(params, expectedTypes);
|
|
915
|
+
validateEnumValues(
|
|
916
|
+
{ bitcoinNetwork },
|
|
917
|
+
{ bitcoinNetwork: BitcoinNetwork },
|
|
918
|
+
);
|
|
919
|
+
return JSON.parse(
|
|
920
|
+
lib.rgblib_validate_consignment_offchain(
|
|
921
|
+
filePath,
|
|
922
|
+
txid,
|
|
923
|
+
indexerUrl,
|
|
924
|
+
bitcoinNetwork,
|
|
925
|
+
),
|
|
926
|
+
);
|
|
927
|
+
};
|
|
928
|
+
|
|
901
929
|
exports.Invoice = class Invoice {
|
|
902
930
|
constructor(invoiceString) {
|
|
903
931
|
const params = { invoiceString };
|