@utexo/rgb-lib-linux-x64 0.3.0-beta.10 → 0.3.0-beta.11.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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utexo/rgb-lib-linux-x64",
|
|
3
|
-
"version": "0.3.0-beta.
|
|
3
|
+
"version": "0.3.0-beta.11.vss",
|
|
4
4
|
"description": "Node.js bindings for rgb-lib on linux-x64",
|
|
5
5
|
"main": "wrapper.js",
|
|
6
6
|
"os": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"prepack": "touch rgb-lib/.npmignore",
|
|
25
25
|
"postpack": "rm rgb-lib/.npmignore",
|
|
26
26
|
"build": "npm run rust-build && npm run swig-build",
|
|
27
|
-
"rust-build": "cross build -r -F camel_case --manifest-path ./rgb-lib/bindings/c-ffi/Cargo.toml --target x86_64-unknown-linux-gnu",
|
|
27
|
+
"rust-build": "cross build -r -F camel_case,vss --manifest-path ./rgb-lib/bindings/c-ffi/Cargo.toml --target x86_64-unknown-linux-gnu",
|
|
28
28
|
"swig-build": "swig -javascript -node -c++ swig.i"
|
|
29
29
|
},
|
|
30
30
|
"author": "Zoe Faltibà <zoefaltiba@gmail.com>",
|
|
@@ -33,6 +33,8 @@ void free_invoice(COpaqueStruct obj);
|
|
|
33
33
|
|
|
34
34
|
void free_online(COpaqueStruct obj);
|
|
35
35
|
|
|
36
|
+
void free_vss_backup_client(COpaqueStruct obj);
|
|
37
|
+
|
|
36
38
|
void free_wallet(COpaqueStruct obj);
|
|
37
39
|
|
|
38
40
|
CResult rgblib_backup(const COpaqueStruct *wallet, const char *backup_path, const char *password);
|
|
@@ -46,6 +48,8 @@ CResultString rgblib_blind_receive(const COpaqueStruct *wallet,
|
|
|
46
48
|
const char *transport_endpoints,
|
|
47
49
|
const char *min_confirmations);
|
|
48
50
|
|
|
51
|
+
CResultString rgblib_configure_vss_backup(const COpaqueStruct *wallet, const char *config_json);
|
|
52
|
+
|
|
49
53
|
CResultString rgblib_create_utxos(const COpaqueStruct *wallet,
|
|
50
54
|
const COpaqueStruct *online,
|
|
51
55
|
bool up_to,
|
|
@@ -71,6 +75,8 @@ CResultString rgblib_delete_transfers(const COpaqueStruct *wallet,
|
|
|
71
75
|
const char *batch_transfer_idx_opt,
|
|
72
76
|
bool no_asset_only);
|
|
73
77
|
|
|
78
|
+
CResultString rgblib_disable_vss_auto_backup(const COpaqueStruct *wallet);
|
|
79
|
+
|
|
74
80
|
CResultString rgblib_fail_transfers(const COpaqueStruct *wallet,
|
|
75
81
|
const COpaqueStruct *online,
|
|
76
82
|
const char *batch_transfer_idx_opt,
|
|
@@ -153,6 +159,8 @@ CResultString rgblib_list_unspents(const COpaqueStruct *wallet,
|
|
|
153
159
|
bool settled_only,
|
|
154
160
|
bool skip_sync);
|
|
155
161
|
|
|
162
|
+
CResult rgblib_new_vss_backup_client(const char *config_json);
|
|
163
|
+
|
|
156
164
|
CResult rgblib_new_wallet(const char *wallet_data);
|
|
157
165
|
|
|
158
166
|
CResultString rgblib_refresh(const COpaqueStruct *wallet,
|
|
@@ -165,6 +173,8 @@ CResult rgblib_restore_backup(const char *backup_path,
|
|
|
165
173
|
const char *password,
|
|
166
174
|
const char *target_dir);
|
|
167
175
|
|
|
176
|
+
CResultString rgblib_restore_from_vss(const char *config_json, const char *target_dir);
|
|
177
|
+
|
|
168
178
|
CResultString rgblib_restore_keys(const char *bitcoin_network, const char *mnemonic);
|
|
169
179
|
|
|
170
180
|
CResultString rgblib_send(const COpaqueStruct *wallet,
|
|
@@ -210,6 +220,14 @@ CResultString rgblib_sign_psbt(const COpaqueStruct *wallet, const char *unsigned
|
|
|
210
220
|
|
|
211
221
|
CResultString rgblib_sync(const COpaqueStruct *wallet, const COpaqueStruct *online);
|
|
212
222
|
|
|
223
|
+
CResultString rgblib_vss_backup(const COpaqueStruct *wallet, const COpaqueStruct *client);
|
|
224
|
+
|
|
225
|
+
CResultString rgblib_vss_backup_client_encryption_enabled(const COpaqueStruct *client);
|
|
226
|
+
|
|
227
|
+
CResultString rgblib_vss_backup_info(const COpaqueStruct *wallet, const COpaqueStruct *client);
|
|
228
|
+
|
|
229
|
+
CResultString rgblib_vss_delete_backup(const COpaqueStruct *client);
|
|
230
|
+
|
|
213
231
|
CResultString rgblib_witness_receive(const COpaqueStruct *wallet,
|
|
214
232
|
const char *asset_id_opt,
|
|
215
233
|
const char *assignment,
|
|
Binary file
|
package/swig_wrap.cxx
CHANGED
|
@@ -2151,6 +2151,40 @@ fail:
|
|
|
2151
2151
|
}
|
|
2152
2152
|
|
|
2153
2153
|
|
|
2154
|
+
static SwigV8ReturnValue _wrap_free_vss_backup_client(const SwigV8Arguments &args) {
|
|
2155
|
+
SWIGV8_HANDLESCOPE();
|
|
2156
|
+
|
|
2157
|
+
SWIGV8_VALUE jsresult;
|
|
2158
|
+
COpaqueStruct arg1 ;
|
|
2159
|
+
void *argp1 ;
|
|
2160
|
+
int res1 = 0 ;
|
|
2161
|
+
|
|
2162
|
+
if (args.Length() < 1 || args.Length() > 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_free_vss_backup_client.");
|
|
2163
|
+
|
|
2164
|
+
{
|
|
2165
|
+
{
|
|
2166
|
+
res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_COpaqueStruct, 0 );
|
|
2167
|
+
if (!SWIG_IsOK(res1)) {
|
|
2168
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "free_vss_backup_client" "', argument " "1"" of type '" "COpaqueStruct""'");
|
|
2169
|
+
}
|
|
2170
|
+
if (!argp1) {
|
|
2171
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "free_vss_backup_client" "', argument " "1"" of type '" "COpaqueStruct""'");
|
|
2172
|
+
} else {
|
|
2173
|
+
arg1 = *(reinterpret_cast< COpaqueStruct * >(argp1));
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
free_vss_backup_client(SWIG_STD_MOVE(arg1));
|
|
2178
|
+
jsresult = SWIGV8_UNDEFINED();
|
|
2179
|
+
|
|
2180
|
+
SWIGV8_RETURN(jsresult);
|
|
2181
|
+
|
|
2182
|
+
goto fail;
|
|
2183
|
+
fail:
|
|
2184
|
+
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
|
|
2154
2188
|
static SwigV8ReturnValue _wrap_free_wallet(const SwigV8Arguments &args) {
|
|
2155
2189
|
SWIGV8_HANDLESCOPE();
|
|
2156
2190
|
|
|
@@ -2374,6 +2408,56 @@ fail:
|
|
|
2374
2408
|
}
|
|
2375
2409
|
|
|
2376
2410
|
|
|
2411
|
+
static SwigV8ReturnValue _wrap_rgblib_configure_vss_backup(const SwigV8Arguments &args) {
|
|
2412
|
+
SWIGV8_HANDLESCOPE();
|
|
2413
|
+
|
|
2414
|
+
SWIGV8_VALUE jsresult;
|
|
2415
|
+
COpaqueStruct *arg1 = (COpaqueStruct *) 0 ;
|
|
2416
|
+
char *arg2 = (char *) 0 ;
|
|
2417
|
+
void *argp1 = 0 ;
|
|
2418
|
+
int res1 = 0 ;
|
|
2419
|
+
int res2 ;
|
|
2420
|
+
char *buf2 = 0 ;
|
|
2421
|
+
int alloc2 = 0 ;
|
|
2422
|
+
CResultString result;
|
|
2423
|
+
|
|
2424
|
+
if (args.Length() < 2 || args.Length() > 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_rgblib_configure_vss_backup.");
|
|
2425
|
+
|
|
2426
|
+
res1 = SWIG_ConvertPtr(args[0], &argp1,SWIGTYPE_p_COpaqueStruct, 0 | 0 );
|
|
2427
|
+
if (!SWIG_IsOK(res1)) {
|
|
2428
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rgblib_configure_vss_backup" "', argument " "1"" of type '" "COpaqueStruct const *""'");
|
|
2429
|
+
}
|
|
2430
|
+
arg1 = reinterpret_cast< COpaqueStruct * >(argp1);res2 = SWIG_AsCharPtrAndSize(args[1], &buf2, NULL, &alloc2);
|
|
2431
|
+
if (!SWIG_IsOK(res2)) {
|
|
2432
|
+
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rgblib_configure_vss_backup" "', argument " "2"" of type '" "char const *""'");
|
|
2433
|
+
}
|
|
2434
|
+
arg2 = reinterpret_cast< char * >(buf2);result = rgblib_configure_vss_backup((COpaqueStruct const *)arg1,(char const *)arg2);
|
|
2435
|
+
|
|
2436
|
+
switch ((&result)->result) {
|
|
2437
|
+
case CResultValue::Ok:
|
|
2438
|
+
if ((&result)->inner == nullptr) {
|
|
2439
|
+
jsresult = v8::Null(v8::Isolate::GetCurrent());
|
|
2440
|
+
} else {
|
|
2441
|
+
jsresult = v8::String::NewFromUtf8(args.GetIsolate(), (const char*) (&result)->inner).ToLocalChecked();
|
|
2442
|
+
delete ((&result)->inner);
|
|
2443
|
+
}
|
|
2444
|
+
break;
|
|
2445
|
+
case CResultValue::Err:
|
|
2446
|
+
SWIG_V8_Raise((const char*) (&result)->inner);
|
|
2447
|
+
break;
|
|
2448
|
+
}
|
|
2449
|
+
|
|
2450
|
+
|
|
2451
|
+
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
|
2452
|
+
|
|
2453
|
+
SWIGV8_RETURN(jsresult);
|
|
2454
|
+
|
|
2455
|
+
goto fail;
|
|
2456
|
+
fail:
|
|
2457
|
+
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2460
|
+
|
|
2377
2461
|
static SwigV8ReturnValue _wrap_rgblib_create_utxos(const SwigV8Arguments &args) {
|
|
2378
2462
|
SWIGV8_HANDLESCOPE();
|
|
2379
2463
|
|
|
@@ -2698,6 +2782,47 @@ fail:
|
|
|
2698
2782
|
}
|
|
2699
2783
|
|
|
2700
2784
|
|
|
2785
|
+
static SwigV8ReturnValue _wrap_rgblib_disable_vss_auto_backup(const SwigV8Arguments &args) {
|
|
2786
|
+
SWIGV8_HANDLESCOPE();
|
|
2787
|
+
|
|
2788
|
+
SWIGV8_VALUE jsresult;
|
|
2789
|
+
COpaqueStruct *arg1 = (COpaqueStruct *) 0 ;
|
|
2790
|
+
void *argp1 = 0 ;
|
|
2791
|
+
int res1 = 0 ;
|
|
2792
|
+
CResultString result;
|
|
2793
|
+
|
|
2794
|
+
if (args.Length() < 1 || args.Length() > 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_rgblib_disable_vss_auto_backup.");
|
|
2795
|
+
|
|
2796
|
+
res1 = SWIG_ConvertPtr(args[0], &argp1,SWIGTYPE_p_COpaqueStruct, 0 | 0 );
|
|
2797
|
+
if (!SWIG_IsOK(res1)) {
|
|
2798
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rgblib_disable_vss_auto_backup" "', argument " "1"" of type '" "COpaqueStruct const *""'");
|
|
2799
|
+
}
|
|
2800
|
+
arg1 = reinterpret_cast< COpaqueStruct * >(argp1);result = rgblib_disable_vss_auto_backup((COpaqueStruct const *)arg1);
|
|
2801
|
+
|
|
2802
|
+
switch ((&result)->result) {
|
|
2803
|
+
case CResultValue::Ok:
|
|
2804
|
+
if ((&result)->inner == nullptr) {
|
|
2805
|
+
jsresult = v8::Null(v8::Isolate::GetCurrent());
|
|
2806
|
+
} else {
|
|
2807
|
+
jsresult = v8::String::NewFromUtf8(args.GetIsolate(), (const char*) (&result)->inner).ToLocalChecked();
|
|
2808
|
+
delete ((&result)->inner);
|
|
2809
|
+
}
|
|
2810
|
+
break;
|
|
2811
|
+
case CResultValue::Err:
|
|
2812
|
+
SWIG_V8_Raise((const char*) (&result)->inner);
|
|
2813
|
+
break;
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
|
|
2817
|
+
|
|
2818
|
+
SWIGV8_RETURN(jsresult);
|
|
2819
|
+
|
|
2820
|
+
goto fail;
|
|
2821
|
+
fail:
|
|
2822
|
+
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
|
2823
|
+
}
|
|
2824
|
+
|
|
2825
|
+
|
|
2701
2826
|
static SwigV8ReturnValue _wrap_rgblib_fail_transfers(const SwigV8Arguments &args) {
|
|
2702
2827
|
SWIGV8_HANDLESCOPE();
|
|
2703
2828
|
|
|
@@ -3927,6 +4052,43 @@ static SwigV8ReturnValue _wrap_rgblib_list_unspents(const SwigV8Arguments &args)
|
|
|
3927
4052
|
|
|
3928
4053
|
|
|
3929
4054
|
|
|
4055
|
+
SWIGV8_RETURN(jsresult);
|
|
4056
|
+
|
|
4057
|
+
goto fail;
|
|
4058
|
+
fail:
|
|
4059
|
+
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
|
4060
|
+
}
|
|
4061
|
+
|
|
4062
|
+
|
|
4063
|
+
static SwigV8ReturnValue _wrap_rgblib_new_vss_backup_client(const SwigV8Arguments &args) {
|
|
4064
|
+
SWIGV8_HANDLESCOPE();
|
|
4065
|
+
|
|
4066
|
+
SWIGV8_VALUE jsresult;
|
|
4067
|
+
char *arg1 = (char *) 0 ;
|
|
4068
|
+
int res1 ;
|
|
4069
|
+
char *buf1 = 0 ;
|
|
4070
|
+
int alloc1 = 0 ;
|
|
4071
|
+
CResult result;
|
|
4072
|
+
|
|
4073
|
+
if (args.Length() < 1 || args.Length() > 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_rgblib_new_vss_backup_client.");
|
|
4074
|
+
|
|
4075
|
+
res1 = SWIG_AsCharPtrAndSize(args[0], &buf1, NULL, &alloc1);
|
|
4076
|
+
if (!SWIG_IsOK(res1)) {
|
|
4077
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rgblib_new_vss_backup_client" "', argument " "1"" of type '" "char const *""'");
|
|
4078
|
+
}
|
|
4079
|
+
arg1 = reinterpret_cast< char * >(buf1);result = rgblib_new_vss_backup_client((char const *)arg1);
|
|
4080
|
+
|
|
4081
|
+
switch ((&result)->result) {
|
|
4082
|
+
case CResultValue::Ok:
|
|
4083
|
+
jsresult = SWIG_NewPointerObj((new COpaqueStruct(static_cast< const COpaqueStruct& >((&result)->inner))), SWIGTYPE_p_COpaqueStruct, SWIG_POINTER_OWN | 0 );
|
|
4084
|
+
break;
|
|
4085
|
+
case CResultValue::Err:
|
|
4086
|
+
SWIG_V8_Raise((const char*) (&result)->inner.ptr);
|
|
4087
|
+
break;
|
|
4088
|
+
}
|
|
4089
|
+
|
|
4090
|
+
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
|
4091
|
+
|
|
3930
4092
|
SWIGV8_RETURN(jsresult);
|
|
3931
4093
|
|
|
3932
4094
|
goto fail;
|
|
@@ -4106,6 +4268,57 @@ fail:
|
|
|
4106
4268
|
}
|
|
4107
4269
|
|
|
4108
4270
|
|
|
4271
|
+
static SwigV8ReturnValue _wrap_rgblib_restore_from_vss(const SwigV8Arguments &args) {
|
|
4272
|
+
SWIGV8_HANDLESCOPE();
|
|
4273
|
+
|
|
4274
|
+
SWIGV8_VALUE jsresult;
|
|
4275
|
+
char *arg1 = (char *) 0 ;
|
|
4276
|
+
char *arg2 = (char *) 0 ;
|
|
4277
|
+
int res1 ;
|
|
4278
|
+
char *buf1 = 0 ;
|
|
4279
|
+
int alloc1 = 0 ;
|
|
4280
|
+
int res2 ;
|
|
4281
|
+
char *buf2 = 0 ;
|
|
4282
|
+
int alloc2 = 0 ;
|
|
4283
|
+
CResultString result;
|
|
4284
|
+
|
|
4285
|
+
if (args.Length() < 2 || args.Length() > 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_rgblib_restore_from_vss.");
|
|
4286
|
+
|
|
4287
|
+
res1 = SWIG_AsCharPtrAndSize(args[0], &buf1, NULL, &alloc1);
|
|
4288
|
+
if (!SWIG_IsOK(res1)) {
|
|
4289
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rgblib_restore_from_vss" "', argument " "1"" of type '" "char const *""'");
|
|
4290
|
+
}
|
|
4291
|
+
arg1 = reinterpret_cast< char * >(buf1);res2 = SWIG_AsCharPtrAndSize(args[1], &buf2, NULL, &alloc2);
|
|
4292
|
+
if (!SWIG_IsOK(res2)) {
|
|
4293
|
+
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rgblib_restore_from_vss" "', argument " "2"" of type '" "char const *""'");
|
|
4294
|
+
}
|
|
4295
|
+
arg2 = reinterpret_cast< char * >(buf2);result = rgblib_restore_from_vss((char const *)arg1,(char const *)arg2);
|
|
4296
|
+
|
|
4297
|
+
switch ((&result)->result) {
|
|
4298
|
+
case CResultValue::Ok:
|
|
4299
|
+
if ((&result)->inner == nullptr) {
|
|
4300
|
+
jsresult = v8::Null(v8::Isolate::GetCurrent());
|
|
4301
|
+
} else {
|
|
4302
|
+
jsresult = v8::String::NewFromUtf8(args.GetIsolate(), (const char*) (&result)->inner).ToLocalChecked();
|
|
4303
|
+
delete ((&result)->inner);
|
|
4304
|
+
}
|
|
4305
|
+
break;
|
|
4306
|
+
case CResultValue::Err:
|
|
4307
|
+
SWIG_V8_Raise((const char*) (&result)->inner);
|
|
4308
|
+
break;
|
|
4309
|
+
}
|
|
4310
|
+
|
|
4311
|
+
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
|
4312
|
+
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
|
|
4313
|
+
|
|
4314
|
+
SWIGV8_RETURN(jsresult);
|
|
4315
|
+
|
|
4316
|
+
goto fail;
|
|
4317
|
+
fail:
|
|
4318
|
+
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
|
4319
|
+
}
|
|
4320
|
+
|
|
4321
|
+
|
|
4109
4322
|
static SwigV8ReturnValue _wrap_rgblib_restore_keys(const SwigV8Arguments &args) {
|
|
4110
4323
|
SWIGV8_HANDLESCOPE();
|
|
4111
4324
|
|
|
@@ -4724,6 +4937,186 @@ static SwigV8ReturnValue _wrap_rgblib_sync(const SwigV8Arguments &args) {
|
|
|
4724
4937
|
|
|
4725
4938
|
|
|
4726
4939
|
|
|
4940
|
+
SWIGV8_RETURN(jsresult);
|
|
4941
|
+
|
|
4942
|
+
goto fail;
|
|
4943
|
+
fail:
|
|
4944
|
+
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
|
4945
|
+
}
|
|
4946
|
+
|
|
4947
|
+
|
|
4948
|
+
static SwigV8ReturnValue _wrap_rgblib_vss_backup(const SwigV8Arguments &args) {
|
|
4949
|
+
SWIGV8_HANDLESCOPE();
|
|
4950
|
+
|
|
4951
|
+
SWIGV8_VALUE jsresult;
|
|
4952
|
+
COpaqueStruct *arg1 = (COpaqueStruct *) 0 ;
|
|
4953
|
+
COpaqueStruct *arg2 = (COpaqueStruct *) 0 ;
|
|
4954
|
+
void *argp1 = 0 ;
|
|
4955
|
+
int res1 = 0 ;
|
|
4956
|
+
void *argp2 = 0 ;
|
|
4957
|
+
int res2 = 0 ;
|
|
4958
|
+
CResultString result;
|
|
4959
|
+
|
|
4960
|
+
if (args.Length() < 2 || args.Length() > 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_rgblib_vss_backup.");
|
|
4961
|
+
|
|
4962
|
+
res1 = SWIG_ConvertPtr(args[0], &argp1,SWIGTYPE_p_COpaqueStruct, 0 | 0 );
|
|
4963
|
+
if (!SWIG_IsOK(res1)) {
|
|
4964
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rgblib_vss_backup" "', argument " "1"" of type '" "COpaqueStruct const *""'");
|
|
4965
|
+
}
|
|
4966
|
+
arg1 = reinterpret_cast< COpaqueStruct * >(argp1);res2 = SWIG_ConvertPtr(args[1], &argp2,SWIGTYPE_p_COpaqueStruct, 0 | 0 );
|
|
4967
|
+
if (!SWIG_IsOK(res2)) {
|
|
4968
|
+
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rgblib_vss_backup" "', argument " "2"" of type '" "COpaqueStruct const *""'");
|
|
4969
|
+
}
|
|
4970
|
+
arg2 = reinterpret_cast< COpaqueStruct * >(argp2);result = rgblib_vss_backup((COpaqueStruct const *)arg1,(COpaqueStruct const *)arg2);
|
|
4971
|
+
|
|
4972
|
+
switch ((&result)->result) {
|
|
4973
|
+
case CResultValue::Ok:
|
|
4974
|
+
if ((&result)->inner == nullptr) {
|
|
4975
|
+
jsresult = v8::Null(v8::Isolate::GetCurrent());
|
|
4976
|
+
} else {
|
|
4977
|
+
jsresult = v8::String::NewFromUtf8(args.GetIsolate(), (const char*) (&result)->inner).ToLocalChecked();
|
|
4978
|
+
delete ((&result)->inner);
|
|
4979
|
+
}
|
|
4980
|
+
break;
|
|
4981
|
+
case CResultValue::Err:
|
|
4982
|
+
SWIG_V8_Raise((const char*) (&result)->inner);
|
|
4983
|
+
break;
|
|
4984
|
+
}
|
|
4985
|
+
|
|
4986
|
+
|
|
4987
|
+
|
|
4988
|
+
|
|
4989
|
+
SWIGV8_RETURN(jsresult);
|
|
4990
|
+
|
|
4991
|
+
goto fail;
|
|
4992
|
+
fail:
|
|
4993
|
+
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
|
4994
|
+
}
|
|
4995
|
+
|
|
4996
|
+
|
|
4997
|
+
static SwigV8ReturnValue _wrap_rgblib_vss_backup_client_encryption_enabled(const SwigV8Arguments &args) {
|
|
4998
|
+
SWIGV8_HANDLESCOPE();
|
|
4999
|
+
|
|
5000
|
+
SWIGV8_VALUE jsresult;
|
|
5001
|
+
COpaqueStruct *arg1 = (COpaqueStruct *) 0 ;
|
|
5002
|
+
void *argp1 = 0 ;
|
|
5003
|
+
int res1 = 0 ;
|
|
5004
|
+
CResultString result;
|
|
5005
|
+
|
|
5006
|
+
if (args.Length() < 1 || args.Length() > 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_rgblib_vss_backup_client_encryption_enabled.");
|
|
5007
|
+
|
|
5008
|
+
res1 = SWIG_ConvertPtr(args[0], &argp1,SWIGTYPE_p_COpaqueStruct, 0 | 0 );
|
|
5009
|
+
if (!SWIG_IsOK(res1)) {
|
|
5010
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rgblib_vss_backup_client_encryption_enabled" "', argument " "1"" of type '" "COpaqueStruct const *""'");
|
|
5011
|
+
}
|
|
5012
|
+
arg1 = reinterpret_cast< COpaqueStruct * >(argp1);result = rgblib_vss_backup_client_encryption_enabled((COpaqueStruct const *)arg1);
|
|
5013
|
+
|
|
5014
|
+
switch ((&result)->result) {
|
|
5015
|
+
case CResultValue::Ok:
|
|
5016
|
+
if ((&result)->inner == nullptr) {
|
|
5017
|
+
jsresult = v8::Null(v8::Isolate::GetCurrent());
|
|
5018
|
+
} else {
|
|
5019
|
+
jsresult = v8::String::NewFromUtf8(args.GetIsolate(), (const char*) (&result)->inner).ToLocalChecked();
|
|
5020
|
+
delete ((&result)->inner);
|
|
5021
|
+
}
|
|
5022
|
+
break;
|
|
5023
|
+
case CResultValue::Err:
|
|
5024
|
+
SWIG_V8_Raise((const char*) (&result)->inner);
|
|
5025
|
+
break;
|
|
5026
|
+
}
|
|
5027
|
+
|
|
5028
|
+
|
|
5029
|
+
|
|
5030
|
+
SWIGV8_RETURN(jsresult);
|
|
5031
|
+
|
|
5032
|
+
goto fail;
|
|
5033
|
+
fail:
|
|
5034
|
+
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
|
5035
|
+
}
|
|
5036
|
+
|
|
5037
|
+
|
|
5038
|
+
static SwigV8ReturnValue _wrap_rgblib_vss_backup_info(const SwigV8Arguments &args) {
|
|
5039
|
+
SWIGV8_HANDLESCOPE();
|
|
5040
|
+
|
|
5041
|
+
SWIGV8_VALUE jsresult;
|
|
5042
|
+
COpaqueStruct *arg1 = (COpaqueStruct *) 0 ;
|
|
5043
|
+
COpaqueStruct *arg2 = (COpaqueStruct *) 0 ;
|
|
5044
|
+
void *argp1 = 0 ;
|
|
5045
|
+
int res1 = 0 ;
|
|
5046
|
+
void *argp2 = 0 ;
|
|
5047
|
+
int res2 = 0 ;
|
|
5048
|
+
CResultString result;
|
|
5049
|
+
|
|
5050
|
+
if (args.Length() < 2 || args.Length() > 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_rgblib_vss_backup_info.");
|
|
5051
|
+
|
|
5052
|
+
res1 = SWIG_ConvertPtr(args[0], &argp1,SWIGTYPE_p_COpaqueStruct, 0 | 0 );
|
|
5053
|
+
if (!SWIG_IsOK(res1)) {
|
|
5054
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rgblib_vss_backup_info" "', argument " "1"" of type '" "COpaqueStruct const *""'");
|
|
5055
|
+
}
|
|
5056
|
+
arg1 = reinterpret_cast< COpaqueStruct * >(argp1);res2 = SWIG_ConvertPtr(args[1], &argp2,SWIGTYPE_p_COpaqueStruct, 0 | 0 );
|
|
5057
|
+
if (!SWIG_IsOK(res2)) {
|
|
5058
|
+
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rgblib_vss_backup_info" "', argument " "2"" of type '" "COpaqueStruct const *""'");
|
|
5059
|
+
}
|
|
5060
|
+
arg2 = reinterpret_cast< COpaqueStruct * >(argp2);result = rgblib_vss_backup_info((COpaqueStruct const *)arg1,(COpaqueStruct const *)arg2);
|
|
5061
|
+
|
|
5062
|
+
switch ((&result)->result) {
|
|
5063
|
+
case CResultValue::Ok:
|
|
5064
|
+
if ((&result)->inner == nullptr) {
|
|
5065
|
+
jsresult = v8::Null(v8::Isolate::GetCurrent());
|
|
5066
|
+
} else {
|
|
5067
|
+
jsresult = v8::String::NewFromUtf8(args.GetIsolate(), (const char*) (&result)->inner).ToLocalChecked();
|
|
5068
|
+
delete ((&result)->inner);
|
|
5069
|
+
}
|
|
5070
|
+
break;
|
|
5071
|
+
case CResultValue::Err:
|
|
5072
|
+
SWIG_V8_Raise((const char*) (&result)->inner);
|
|
5073
|
+
break;
|
|
5074
|
+
}
|
|
5075
|
+
|
|
5076
|
+
|
|
5077
|
+
|
|
5078
|
+
|
|
5079
|
+
SWIGV8_RETURN(jsresult);
|
|
5080
|
+
|
|
5081
|
+
goto fail;
|
|
5082
|
+
fail:
|
|
5083
|
+
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
|
5084
|
+
}
|
|
5085
|
+
|
|
5086
|
+
|
|
5087
|
+
static SwigV8ReturnValue _wrap_rgblib_vss_delete_backup(const SwigV8Arguments &args) {
|
|
5088
|
+
SWIGV8_HANDLESCOPE();
|
|
5089
|
+
|
|
5090
|
+
SWIGV8_VALUE jsresult;
|
|
5091
|
+
COpaqueStruct *arg1 = (COpaqueStruct *) 0 ;
|
|
5092
|
+
void *argp1 = 0 ;
|
|
5093
|
+
int res1 = 0 ;
|
|
5094
|
+
CResultString result;
|
|
5095
|
+
|
|
5096
|
+
if (args.Length() < 1 || args.Length() > 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_rgblib_vss_delete_backup.");
|
|
5097
|
+
|
|
5098
|
+
res1 = SWIG_ConvertPtr(args[0], &argp1,SWIGTYPE_p_COpaqueStruct, 0 | 0 );
|
|
5099
|
+
if (!SWIG_IsOK(res1)) {
|
|
5100
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rgblib_vss_delete_backup" "', argument " "1"" of type '" "COpaqueStruct const *""'");
|
|
5101
|
+
}
|
|
5102
|
+
arg1 = reinterpret_cast< COpaqueStruct * >(argp1);result = rgblib_vss_delete_backup((COpaqueStruct const *)arg1);
|
|
5103
|
+
|
|
5104
|
+
switch ((&result)->result) {
|
|
5105
|
+
case CResultValue::Ok:
|
|
5106
|
+
if ((&result)->inner == nullptr) {
|
|
5107
|
+
jsresult = v8::Null(v8::Isolate::GetCurrent());
|
|
5108
|
+
} else {
|
|
5109
|
+
jsresult = v8::String::NewFromUtf8(args.GetIsolate(), (const char*) (&result)->inner).ToLocalChecked();
|
|
5110
|
+
delete ((&result)->inner);
|
|
5111
|
+
}
|
|
5112
|
+
break;
|
|
5113
|
+
case CResultValue::Err:
|
|
5114
|
+
SWIG_V8_Raise((const char*) (&result)->inner);
|
|
5115
|
+
break;
|
|
5116
|
+
}
|
|
5117
|
+
|
|
5118
|
+
|
|
5119
|
+
|
|
4727
5120
|
SWIGV8_RETURN(jsresult);
|
|
4728
5121
|
|
|
4729
5122
|
goto fail;
|
|
@@ -5240,14 +5633,17 @@ v8::Local<v8::Object> _exports_CResultString_obj = _exports_CResultString_class_
|
|
|
5240
5633
|
/* add static class functions and variables */
|
|
5241
5634
|
SWIGV8_AddStaticFunction(exports_obj, "free_invoice", _wrap_free_invoice, context);
|
|
5242
5635
|
SWIGV8_AddStaticFunction(exports_obj, "free_online", _wrap_free_online, context);
|
|
5636
|
+
SWIGV8_AddStaticFunction(exports_obj, "free_vss_backup_client", _wrap_free_vss_backup_client, context);
|
|
5243
5637
|
SWIGV8_AddStaticFunction(exports_obj, "free_wallet", _wrap_free_wallet, context);
|
|
5244
5638
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_backup", _wrap_rgblib_backup, context);
|
|
5245
5639
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_backup_info", _wrap_rgblib_backup_info, context);
|
|
5246
5640
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_blind_receive", _wrap_rgblib_blind_receive, context);
|
|
5641
|
+
SWIGV8_AddStaticFunction(exports_obj, "rgblib_configure_vss_backup", _wrap_rgblib_configure_vss_backup, context);
|
|
5247
5642
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_create_utxos", _wrap_rgblib_create_utxos, context);
|
|
5248
5643
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_create_utxos_begin", _wrap_rgblib_create_utxos_begin, context);
|
|
5249
5644
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_create_utxos_end", _wrap_rgblib_create_utxos_end, context);
|
|
5250
5645
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_delete_transfers", _wrap_rgblib_delete_transfers, context);
|
|
5646
|
+
SWIGV8_AddStaticFunction(exports_obj, "rgblib_disable_vss_auto_backup", _wrap_rgblib_disable_vss_auto_backup, context);
|
|
5251
5647
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_fail_transfers", _wrap_rgblib_fail_transfers, context);
|
|
5252
5648
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_finalize_psbt", _wrap_rgblib_finalize_psbt, context);
|
|
5253
5649
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_generate_keys", _wrap_rgblib_generate_keys, context);
|
|
@@ -5268,9 +5664,11 @@ SWIGV8_AddStaticFunction(exports_obj, "rgblib_list_assets", _wrap_rgblib_list_as
|
|
|
5268
5664
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_list_transactions", _wrap_rgblib_list_transactions, context);
|
|
5269
5665
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_list_transfers", _wrap_rgblib_list_transfers, context);
|
|
5270
5666
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_list_unspents", _wrap_rgblib_list_unspents, context);
|
|
5667
|
+
SWIGV8_AddStaticFunction(exports_obj, "rgblib_new_vss_backup_client", _wrap_rgblib_new_vss_backup_client, context);
|
|
5271
5668
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_new_wallet", _wrap_rgblib_new_wallet, context);
|
|
5272
5669
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_refresh", _wrap_rgblib_refresh, context);
|
|
5273
5670
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_restore_backup", _wrap_rgblib_restore_backup, context);
|
|
5671
|
+
SWIGV8_AddStaticFunction(exports_obj, "rgblib_restore_from_vss", _wrap_rgblib_restore_from_vss, context);
|
|
5274
5672
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_restore_keys", _wrap_rgblib_restore_keys, context);
|
|
5275
5673
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_send", _wrap_rgblib_send, context);
|
|
5276
5674
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_send_begin", _wrap_rgblib_send_begin, context);
|
|
@@ -5280,6 +5678,10 @@ SWIGV8_AddStaticFunction(exports_obj, "rgblib_send_btc_end", _wrap_rgblib_send_b
|
|
|
5280
5678
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_send_end", _wrap_rgblib_send_end, context);
|
|
5281
5679
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_sign_psbt", _wrap_rgblib_sign_psbt, context);
|
|
5282
5680
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_sync", _wrap_rgblib_sync, context);
|
|
5681
|
+
SWIGV8_AddStaticFunction(exports_obj, "rgblib_vss_backup", _wrap_rgblib_vss_backup, context);
|
|
5682
|
+
SWIGV8_AddStaticFunction(exports_obj, "rgblib_vss_backup_client_encryption_enabled", _wrap_rgblib_vss_backup_client_encryption_enabled, context);
|
|
5683
|
+
SWIGV8_AddStaticFunction(exports_obj, "rgblib_vss_backup_info", _wrap_rgblib_vss_backup_info, context);
|
|
5684
|
+
SWIGV8_AddStaticFunction(exports_obj, "rgblib_vss_delete_backup", _wrap_rgblib_vss_delete_backup, context);
|
|
5283
5685
|
SWIGV8_AddStaticFunction(exports_obj, "rgblib_witness_receive", _wrap_rgblib_witness_receive, context);
|
|
5284
5686
|
|
|
5285
5687
|
|
package/wrapper.js
CHANGED
|
@@ -200,6 +200,42 @@ exports.restoreKeys = function (bitcoinNetwork, mnemonic) {
|
|
|
200
200
|
return JSON.parse(lib.rgblib_restore_keys(bitcoinNetwork, mnemonic));
|
|
201
201
|
};
|
|
202
202
|
|
|
203
|
+
exports.restoreFromVss = function (config, targetDir) {
|
|
204
|
+
const expectedTypes = {
|
|
205
|
+
server_url: "string",
|
|
206
|
+
store_id: "string",
|
|
207
|
+
signing_key: "string",
|
|
208
|
+
};
|
|
209
|
+
validateTypes(config, expectedTypes);
|
|
210
|
+
validateTypes({ targetDir }, { targetDir: "string" });
|
|
211
|
+
return lib.rgblib_restore_from_vss(JSON.stringify(config), targetDir);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
exports.VssBackupClient = class VssBackupClient {
|
|
215
|
+
constructor(config) {
|
|
216
|
+
const expectedTypes = {
|
|
217
|
+
server_url: "string",
|
|
218
|
+
store_id: "string",
|
|
219
|
+
signing_key: "string",
|
|
220
|
+
};
|
|
221
|
+
validateTypes(config, expectedTypes);
|
|
222
|
+
this.client = lib.rgblib_new_vss_backup_client(JSON.stringify(config));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
drop() {
|
|
226
|
+
lib.free_vss_backup_client(this.client);
|
|
227
|
+
this.client = null;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
encryptionEnabled() {
|
|
231
|
+
return lib.rgblib_vss_backup_client_encryption_enabled(this.client);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
deleteBackup() {
|
|
235
|
+
lib.rgblib_vss_delete_backup(this.client);
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
203
239
|
exports.WalletData = class WalletData {
|
|
204
240
|
constructor(walletData) {
|
|
205
241
|
const expectedTypes = {
|
|
@@ -244,6 +280,38 @@ exports.Wallet = class Wallet {
|
|
|
244
280
|
return JSON.parse(lib.rgblib_backup_info(this.wallet));
|
|
245
281
|
}
|
|
246
282
|
|
|
283
|
+
configureVssBackup(config) {
|
|
284
|
+
const expectedTypes = {
|
|
285
|
+
server_url: "string",
|
|
286
|
+
store_id: "string",
|
|
287
|
+
signing_key: "string",
|
|
288
|
+
};
|
|
289
|
+
validateTypes(config, expectedTypes);
|
|
290
|
+
lib.rgblib_configure_vss_backup(this.wallet, JSON.stringify(config));
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
disableVssAutoBackup() {
|
|
294
|
+
lib.rgblib_disable_vss_auto_backup(this.wallet);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
vssBackup(vssBackupClient) {
|
|
298
|
+
if (!vssBackupClient || !vssBackupClient.client) {
|
|
299
|
+
throw new Error("vssBackupClient must be a VssBackupClient instance");
|
|
300
|
+
}
|
|
301
|
+
return JSON.parse(
|
|
302
|
+
lib.rgblib_vss_backup(this.wallet, vssBackupClient.client),
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
vssBackupInfo(vssBackupClient) {
|
|
307
|
+
if (!vssBackupClient || !vssBackupClient.client) {
|
|
308
|
+
throw new Error("vssBackupClient must be a VssBackupClient instance");
|
|
309
|
+
}
|
|
310
|
+
return JSON.parse(
|
|
311
|
+
lib.rgblib_vss_backup_info(this.wallet, vssBackupClient.client),
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
|
|
247
315
|
blindReceive(
|
|
248
316
|
assetId,
|
|
249
317
|
assignment,
|