react-native-nitro-ark 0.0.16 → 0.0.17
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/cpp/NitroArk.hpp +76 -110
- package/cpp/bark-cpp.h +26 -251
- package/lib/module/index.js +74 -119
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +22 -21
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +50 -93
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +2 -1
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +23 -22
- package/package.json +1 -1
- package/src/NitroArk.nitro.ts +16 -75
- package/src/index.tsx +64 -220
package/cpp/NitroArk.hpp
CHANGED
|
@@ -53,8 +53,8 @@ namespace margelo::nitro::nitroark
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
std::shared_ptr<Promise<void>>
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
loadWallet(const std::string &datadir,
|
|
57
|
+
const BarkCreateOpts &opts) override
|
|
58
58
|
{
|
|
59
59
|
return Promise<void>::async([datadir, opts]()
|
|
60
60
|
{
|
|
@@ -105,21 +105,27 @@ namespace margelo::nitro::nitroark
|
|
|
105
105
|
config};
|
|
106
106
|
|
|
107
107
|
bark::bark_BarkError *error =
|
|
108
|
-
bark::
|
|
108
|
+
bark::bark_load_wallet(datadir.c_str(), barkOpts);
|
|
109
|
+
check_bark_error(error); });
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
std::shared_ptr<Promise<void>> closeWallet() override
|
|
113
|
+
{
|
|
114
|
+
return Promise<void>::async([]()
|
|
115
|
+
{
|
|
116
|
+
bark::bark_BarkError *error = bark::bark_close_wallet();
|
|
109
117
|
check_bark_error(error); });
|
|
110
118
|
}
|
|
111
119
|
|
|
112
120
|
// --- Wallet Info ---
|
|
113
121
|
|
|
114
122
|
std::shared_ptr<Promise<BarkBalance>>
|
|
115
|
-
getBalance(
|
|
116
|
-
const std::string &mnemonic) override
|
|
123
|
+
getBalance(bool no_sync) override
|
|
117
124
|
{
|
|
118
|
-
return Promise<BarkBalance>::async([
|
|
125
|
+
return Promise<BarkBalance>::async([no_sync]()
|
|
119
126
|
{
|
|
120
127
|
bark::bark_BarkBalance c_balance;
|
|
121
|
-
bark::bark_BarkError *error = bark::bark_get_balance(
|
|
122
|
-
datadir.c_str(), no_sync, mnemonic.c_str(), &c_balance);
|
|
128
|
+
bark::bark_BarkError *error = bark::bark_get_balance(no_sync, &c_balance);
|
|
123
129
|
check_bark_error(error);
|
|
124
130
|
|
|
125
131
|
return BarkBalance(static_cast<double>(c_balance.onchain),
|
|
@@ -128,14 +134,12 @@ namespace margelo::nitro::nitroark
|
|
|
128
134
|
}
|
|
129
135
|
|
|
130
136
|
std::shared_ptr<Promise<std::string>>
|
|
131
|
-
getOnchainAddress(
|
|
132
|
-
const std::string &mnemonic) override
|
|
137
|
+
getOnchainAddress() override
|
|
133
138
|
{
|
|
134
|
-
return Promise<std::string>::async([
|
|
139
|
+
return Promise<std::string>::async([]()
|
|
135
140
|
{
|
|
136
141
|
char *address_c = nullptr;
|
|
137
|
-
bark::bark_BarkError *error = bark::bark_get_onchain_address(
|
|
138
|
-
datadir.c_str(), mnemonic.c_str(), &address_c);
|
|
142
|
+
bark::bark_BarkError *error = bark::bark_get_onchain_address(&address_c);
|
|
139
143
|
check_bark_error(error);
|
|
140
144
|
if (address_c == nullptr) {
|
|
141
145
|
throw std::runtime_error("Bark-cpp error: getOnchainAddress returned "
|
|
@@ -147,14 +151,12 @@ namespace margelo::nitro::nitroark
|
|
|
147
151
|
}
|
|
148
152
|
|
|
149
153
|
std::shared_ptr<Promise<std::string>>
|
|
150
|
-
getOnchainUtxos(
|
|
151
|
-
bool no_sync) override
|
|
154
|
+
getOnchainUtxos(bool no_sync) override
|
|
152
155
|
{
|
|
153
|
-
return Promise<std::string>::async([
|
|
156
|
+
return Promise<std::string>::async([no_sync]()
|
|
154
157
|
{
|
|
155
158
|
char *json_c = nullptr;
|
|
156
|
-
bark::bark_BarkError *error = bark::bark_get_onchain_utxos(
|
|
157
|
-
datadir.c_str(), mnemonic.c_str(), no_sync, &json_c);
|
|
159
|
+
bark::bark_BarkError *error = bark::bark_get_onchain_utxos(no_sync, &json_c);
|
|
158
160
|
check_bark_error(error);
|
|
159
161
|
if (json_c == nullptr) {
|
|
160
162
|
throw std::runtime_error("Bark-cpp error: getOnchainUtxos returned "
|
|
@@ -166,14 +168,18 @@ namespace margelo::nitro::nitroark
|
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
std::shared_ptr<Promise<std::string>>
|
|
169
|
-
getVtxoPubkey(
|
|
170
|
-
const std::string &mnemonic) override
|
|
171
|
+
getVtxoPubkey(std::optional<double> index) override
|
|
171
172
|
{
|
|
172
|
-
return Promise<std::string>::async([
|
|
173
|
+
return Promise<std::string>::async([index]()
|
|
173
174
|
{
|
|
174
175
|
char *pubkey_c = nullptr;
|
|
176
|
+
std::optional<uint32_t> index_val;
|
|
177
|
+
if (index.has_value()) {
|
|
178
|
+
index_val = static_cast<uint32_t>(index.value());
|
|
179
|
+
}
|
|
180
|
+
|
|
175
181
|
bark::bark_BarkError *error = bark::bark_get_vtxo_pubkey(
|
|
176
|
-
|
|
182
|
+
index_val.has_value() ? &index_val.value() : nullptr, &pubkey_c);
|
|
177
183
|
check_bark_error(error);
|
|
178
184
|
if (pubkey_c == nullptr) {
|
|
179
185
|
throw std::runtime_error("Bark-cpp error: getVtxoPubkey returned "
|
|
@@ -184,15 +190,12 @@ namespace margelo::nitro::nitroark
|
|
|
184
190
|
return pubkey_str; });
|
|
185
191
|
}
|
|
186
192
|
|
|
187
|
-
std::shared_ptr<Promise<std::string>> getVtxos(
|
|
188
|
-
const std::string &mnemonic,
|
|
189
|
-
bool no_sync) override
|
|
193
|
+
std::shared_ptr<Promise<std::string>> getVtxos(bool no_sync) override
|
|
190
194
|
{
|
|
191
|
-
return Promise<std::string>::async([
|
|
195
|
+
return Promise<std::string>::async([no_sync]()
|
|
192
196
|
{
|
|
193
197
|
char *json_c = nullptr;
|
|
194
|
-
bark::bark_BarkError *error = bark::bark_get_vtxos(
|
|
195
|
-
datadir.c_str(), mnemonic.c_str(), no_sync, &json_c);
|
|
198
|
+
bark::bark_BarkError *error = bark::bark_get_vtxos(no_sync, &json_c);
|
|
196
199
|
check_bark_error(error);
|
|
197
200
|
if (json_c == nullptr) {
|
|
198
201
|
throw std::runtime_error(
|
|
@@ -206,17 +209,14 @@ namespace margelo::nitro::nitroark
|
|
|
206
209
|
// --- Onchain Operations ---
|
|
207
210
|
|
|
208
211
|
std::shared_ptr<Promise<std::string>>
|
|
209
|
-
sendOnchain(const std::string &
|
|
210
|
-
const std::string &destination, double amountSat,
|
|
212
|
+
sendOnchain(const std::string &destination, double amountSat,
|
|
211
213
|
bool no_sync) override
|
|
212
214
|
{
|
|
213
|
-
return Promise<std::string>::async([
|
|
214
|
-
amountSat, no_sync]()
|
|
215
|
+
return Promise<std::string>::async([destination, amountSat, no_sync]()
|
|
215
216
|
{
|
|
216
217
|
char *txid_c = nullptr;
|
|
217
218
|
bark::bark_BarkError *error = bark::bark_send_onchain(
|
|
218
|
-
|
|
219
|
-
static_cast<uint64_t>(amountSat), no_sync, &txid_c);
|
|
219
|
+
destination.c_str(), static_cast<uint64_t>(amountSat), no_sync, &txid_c);
|
|
220
220
|
check_bark_error(error);
|
|
221
221
|
if (txid_c == nullptr) {
|
|
222
222
|
throw std::runtime_error(
|
|
@@ -228,16 +228,14 @@ namespace margelo::nitro::nitroark
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
std::shared_ptr<Promise<std::string>>
|
|
231
|
-
drainOnchain(const std::string &
|
|
232
|
-
const std::string &destination, bool no_sync) override
|
|
231
|
+
drainOnchain(const std::string &destination, bool no_sync) override
|
|
233
232
|
{
|
|
234
233
|
return Promise<std::string>::async(
|
|
235
|
-
[
|
|
234
|
+
[destination, no_sync]()
|
|
236
235
|
{
|
|
237
236
|
char *txid_c = nullptr;
|
|
238
237
|
bark::bark_BarkError *error =
|
|
239
|
-
bark::bark_drain_onchain(
|
|
240
|
-
destination.c_str(), no_sync, &txid_c);
|
|
238
|
+
bark::bark_drain_onchain(destination.c_str(), no_sync, &txid_c);
|
|
241
239
|
check_bark_error(error);
|
|
242
240
|
if (txid_c == nullptr)
|
|
243
241
|
{
|
|
@@ -251,11 +249,10 @@ namespace margelo::nitro::nitroark
|
|
|
251
249
|
}
|
|
252
250
|
|
|
253
251
|
std::shared_ptr<Promise<std::string>>
|
|
254
|
-
sendManyOnchain(const std::
|
|
255
|
-
const std::vector<BarkSendManyOutput> &outputs,
|
|
252
|
+
sendManyOnchain(const std::vector<BarkSendManyOutput> &outputs,
|
|
256
253
|
bool no_sync) override
|
|
257
254
|
{
|
|
258
|
-
return Promise<std::string>::async([
|
|
255
|
+
return Promise<std::string>::async([outputs, no_sync]()
|
|
259
256
|
{
|
|
260
257
|
size_t num_outputs = outputs.size();
|
|
261
258
|
if (num_outputs == 0) {
|
|
@@ -269,16 +266,13 @@ namespace margelo::nitro::nitroark
|
|
|
269
266
|
amounts_c.reserve(num_outputs);
|
|
270
267
|
|
|
271
268
|
for (const auto &output : outputs) {
|
|
272
|
-
// --- FIX: Access directly, no .value() ---
|
|
273
269
|
destinations_c.push_back(output.destination.c_str());
|
|
274
270
|
amounts_c.push_back(static_cast<uint64_t>(output.amountSat));
|
|
275
|
-
// --- End FIX ---
|
|
276
271
|
}
|
|
277
272
|
|
|
278
273
|
char *txid_c = nullptr;
|
|
279
274
|
bark::bark_BarkError *error = bark::bark_send_many_onchain(
|
|
280
|
-
|
|
281
|
-
amounts_c.data(), num_outputs, no_sync, &txid_c);
|
|
275
|
+
destinations_c.data(), amounts_c.data(), num_outputs, no_sync, &txid_c);
|
|
282
276
|
check_bark_error(error);
|
|
283
277
|
if (txid_c == nullptr) {
|
|
284
278
|
throw std::runtime_error("Bark-cpp error: sendManyOnchain returned "
|
|
@@ -292,10 +286,9 @@ namespace margelo::nitro::nitroark
|
|
|
292
286
|
// --- Ark Operations ---
|
|
293
287
|
|
|
294
288
|
std::shared_ptr<Promise<std::string>>
|
|
295
|
-
refreshVtxos(const
|
|
296
|
-
const BarkRefreshOpts &refreshOpts, bool no_sync) override
|
|
289
|
+
refreshVtxos(const BarkRefreshOpts &refreshOpts, bool no_sync) override
|
|
297
290
|
{
|
|
298
|
-
return Promise<std::string>::async([
|
|
291
|
+
return Promise<std::string>::async([refreshOpts,
|
|
299
292
|
no_sync]()
|
|
300
293
|
{
|
|
301
294
|
bark::bark_BarkRefreshOpts c_opts;
|
|
@@ -356,8 +349,7 @@ namespace margelo::nitro::nitroark
|
|
|
356
349
|
|
|
357
350
|
// Make the C FFI call
|
|
358
351
|
char *status_c = nullptr;
|
|
359
|
-
bark::bark_BarkError *error = bark::bark_refresh_vtxos(
|
|
360
|
-
datadir.c_str(), mnemonic.c_str(), c_opts, no_sync, &status_c);
|
|
352
|
+
bark::bark_BarkError *error = bark::bark_refresh_vtxos(c_opts, no_sync, &status_c);
|
|
361
353
|
|
|
362
354
|
check_bark_error(error);
|
|
363
355
|
if (status_c == nullptr) {
|
|
@@ -371,17 +363,15 @@ namespace margelo::nitro::nitroark
|
|
|
371
363
|
return status_str; });
|
|
372
364
|
}
|
|
373
365
|
|
|
374
|
-
std::shared_ptr<Promise<std::string>> boardAmount(
|
|
375
|
-
const std::string &mnemonic,
|
|
376
|
-
double amountSat,
|
|
366
|
+
std::shared_ptr<Promise<std::string>> boardAmount(double amountSat,
|
|
377
367
|
bool no_sync) override
|
|
378
368
|
{
|
|
379
|
-
return Promise<std::string>::async([
|
|
369
|
+
return Promise<std::string>::async([amountSat,
|
|
380
370
|
no_sync]()
|
|
381
371
|
{
|
|
382
372
|
char *status_c = nullptr;
|
|
383
373
|
bark::bark_BarkError *error = bark::bark_board_amount(
|
|
384
|
-
|
|
374
|
+
static_cast<uint64_t>(amountSat),
|
|
385
375
|
no_sync, &status_c);
|
|
386
376
|
check_bark_error(error);
|
|
387
377
|
if (status_c == nullptr) {
|
|
@@ -393,15 +383,12 @@ namespace margelo::nitro::nitroark
|
|
|
393
383
|
return status_str; });
|
|
394
384
|
}
|
|
395
385
|
|
|
396
|
-
std::shared_ptr<Promise<std::string>> boardAll(
|
|
397
|
-
const std::string &mnemonic,
|
|
398
|
-
bool no_sync) override
|
|
386
|
+
std::shared_ptr<Promise<std::string>> boardAll(bool no_sync) override
|
|
399
387
|
{
|
|
400
|
-
return Promise<std::string>::async([
|
|
388
|
+
return Promise<std::string>::async([no_sync]()
|
|
401
389
|
{
|
|
402
390
|
char *status_c = nullptr;
|
|
403
|
-
bark::bark_BarkError *error = bark::bark_board_all(
|
|
404
|
-
datadir.c_str(), mnemonic.c_str(), no_sync, &status_c);
|
|
391
|
+
bark::bark_BarkError *error = bark::bark_board_all(no_sync, &status_c);
|
|
405
392
|
check_bark_error(error);
|
|
406
393
|
if (status_c == nullptr) {
|
|
407
394
|
throw std::runtime_error(
|
|
@@ -413,22 +400,16 @@ namespace margelo::nitro::nitroark
|
|
|
413
400
|
}
|
|
414
401
|
|
|
415
402
|
std::shared_ptr<Promise<std::string>>
|
|
416
|
-
send(const std::string &
|
|
417
|
-
const std::string &destination, double amountSat,
|
|
403
|
+
send(const std::string &destination, double amountSat,
|
|
418
404
|
const std::optional<std::string> &comment, bool no_sync) override
|
|
419
405
|
{
|
|
420
|
-
return Promise<std::string>::async([
|
|
406
|
+
return Promise<std::string>::async([destination,
|
|
421
407
|
amountSat, comment, no_sync]()
|
|
422
408
|
{
|
|
423
409
|
char *status_c = nullptr;
|
|
424
410
|
const char *comment_c = comment.has_value() ? comment->c_str() : nullptr;
|
|
425
|
-
// NOTE: bark_send in ffi.rs expects u64::MAX if amount is not provided.
|
|
426
|
-
// Here, amountSat (double) is always passed from TS. If you want to
|
|
427
|
-
// support sending MAX, the TS/Nitro interface needs adjustment (e.g.,
|
|
428
|
-
// optional amount). Assuming amountSat passed from TS is always the
|
|
429
|
-
// intended amount.
|
|
430
411
|
bark::bark_BarkError *error = bark::bark_send(
|
|
431
|
-
|
|
412
|
+
destination.c_str(),
|
|
432
413
|
static_cast<uint64_t>(amountSat), comment_c, no_sync, &status_c);
|
|
433
414
|
check_bark_error(error);
|
|
434
415
|
if (status_c == nullptr) {
|
|
@@ -441,16 +422,15 @@ namespace margelo::nitro::nitroark
|
|
|
441
422
|
}
|
|
442
423
|
|
|
443
424
|
std::shared_ptr<Promise<std::string>>
|
|
444
|
-
sendRoundOnchain(const std::string &
|
|
445
|
-
const std::string &destination, double amountSat,
|
|
425
|
+
sendRoundOnchain(const std::string &destination, double amountSat,
|
|
446
426
|
bool no_sync) override
|
|
447
427
|
{
|
|
448
428
|
return Promise<std::string>::async(
|
|
449
|
-
[
|
|
429
|
+
[destination, amountSat, no_sync]()
|
|
450
430
|
{
|
|
451
431
|
char *status_c = nullptr;
|
|
452
432
|
bark::bark_BarkError *error = bark::bark_send_round_onchain(
|
|
453
|
-
|
|
433
|
+
destination.c_str(),
|
|
454
434
|
static_cast<uint64_t>(amountSat), no_sync, &status_c);
|
|
455
435
|
check_bark_error(error);
|
|
456
436
|
if (status_c == nullptr)
|
|
@@ -467,14 +447,13 @@ namespace margelo::nitro::nitroark
|
|
|
467
447
|
// --- Lightning Operations ---
|
|
468
448
|
|
|
469
449
|
std::shared_ptr<Promise<std::string>>
|
|
470
|
-
bolt11Invoice(
|
|
471
|
-
double amountSat) override
|
|
450
|
+
bolt11Invoice(double amountMsat) override
|
|
472
451
|
{
|
|
473
|
-
return Promise<std::string>::async([
|
|
452
|
+
return Promise<std::string>::async([amountMsat]()
|
|
474
453
|
{
|
|
475
454
|
char *invoice_c = nullptr;
|
|
476
455
|
bark::bark_BarkError *error = bark::bark_bolt11_invoice(
|
|
477
|
-
|
|
456
|
+
static_cast<uint64_t>(amountMsat),
|
|
478
457
|
&invoice_c);
|
|
479
458
|
check_bark_error(error);
|
|
480
459
|
if (invoice_c == nullptr) {
|
|
@@ -487,26 +466,23 @@ namespace margelo::nitro::nitroark
|
|
|
487
466
|
}
|
|
488
467
|
|
|
489
468
|
std::shared_ptr<Promise<void>>
|
|
490
|
-
claimBolt11Payment(const std::string &
|
|
491
|
-
const std::string &bolt11) override
|
|
469
|
+
claimBolt11Payment(const std::string &bolt11) override
|
|
492
470
|
{
|
|
493
|
-
return Promise<void>::async([
|
|
471
|
+
return Promise<void>::async([bolt11]()
|
|
494
472
|
{
|
|
495
|
-
bark::bark_BarkError *error = bark::bark_claim_bolt11_payment(
|
|
496
|
-
datadir.c_str(), mnemonic.c_str(), bolt11.c_str());
|
|
473
|
+
bark::bark_BarkError *error = bark::bark_claim_bolt11_payment(bolt11.c_str());
|
|
497
474
|
check_bark_error(error); });
|
|
498
475
|
}
|
|
499
476
|
|
|
500
477
|
// --- Offboarding / Exiting ---
|
|
501
478
|
|
|
502
479
|
std::shared_ptr<Promise<std::string>>
|
|
503
|
-
offboardSpecific(const std::
|
|
504
|
-
const std::vector<std::string> &vtxoIds,
|
|
480
|
+
offboardSpecific(const std::vector<std::string> &vtxoIds,
|
|
505
481
|
const std::optional<std::string> &optionalAddress,
|
|
506
482
|
bool no_sync) override
|
|
507
483
|
{
|
|
508
484
|
return Promise<std::string>::async(
|
|
509
|
-
[
|
|
485
|
+
[vtxoIds, optionalAddress, no_sync]()
|
|
510
486
|
{
|
|
511
487
|
if (vtxoIds.empty())
|
|
512
488
|
{
|
|
@@ -524,7 +500,7 @@ namespace margelo::nitro::nitroark
|
|
|
524
500
|
char *status_c = nullptr;
|
|
525
501
|
|
|
526
502
|
bark::bark_BarkError *error = bark::bark_offboard_specific(
|
|
527
|
-
|
|
503
|
+
ids_c.data(), ids_c.size(),
|
|
528
504
|
addr_c, no_sync, &status_c);
|
|
529
505
|
check_bark_error(error);
|
|
530
506
|
if (status_c == nullptr)
|
|
@@ -539,18 +515,17 @@ namespace margelo::nitro::nitroark
|
|
|
539
515
|
}
|
|
540
516
|
|
|
541
517
|
std::shared_ptr<Promise<std::string>>
|
|
542
|
-
offboardAll(const std::
|
|
543
|
-
const std::optional<std::string> &optionalAddress,
|
|
518
|
+
offboardAll(const std::optional<std::string> &optionalAddress,
|
|
544
519
|
bool no_sync) override
|
|
545
520
|
{
|
|
546
|
-
return Promise<std::string>::async([
|
|
521
|
+
return Promise<std::string>::async([optionalAddress,
|
|
547
522
|
no_sync]()
|
|
548
523
|
{
|
|
549
524
|
const char *addr_c =
|
|
550
525
|
optionalAddress.has_value() ? optionalAddress->c_str() : nullptr;
|
|
551
526
|
char *status_c = nullptr;
|
|
552
527
|
bark::bark_BarkError *error = bark::bark_offboard_all(
|
|
553
|
-
|
|
528
|
+
addr_c, no_sync, &status_c);
|
|
554
529
|
check_bark_error(error);
|
|
555
530
|
if (status_c == nullptr) {
|
|
556
531
|
throw std::runtime_error(
|
|
@@ -562,11 +537,9 @@ namespace margelo::nitro::nitroark
|
|
|
562
537
|
}
|
|
563
538
|
|
|
564
539
|
std::shared_ptr<Promise<std::string>> exitStartSpecific(
|
|
565
|
-
const std::
|
|
566
|
-
const std::vector<std::string> &vtxoIds,
|
|
567
|
-
bool no_sync /* Potential C header mismatch noted */) override
|
|
540
|
+
const std::vector<std::string> &vtxoIds) override
|
|
568
541
|
{
|
|
569
|
-
return Promise<std::string>::async([
|
|
542
|
+
return Promise<std::string>::async([vtxoIds]()
|
|
570
543
|
{
|
|
571
544
|
if (vtxoIds.empty()) {
|
|
572
545
|
throw std::runtime_error(
|
|
@@ -579,10 +552,8 @@ namespace margelo::nitro::nitroark
|
|
|
579
552
|
}
|
|
580
553
|
char *status_c = nullptr;
|
|
581
554
|
|
|
582
|
-
// Call reflects C header (which might be missing no_sync)
|
|
583
555
|
bark::bark_BarkError *error =
|
|
584
|
-
bark::bark_exit_start_specific(
|
|
585
|
-
ids_c.data(), ids_c.size(), &status_c);
|
|
556
|
+
bark::bark_exit_start_specific(ids_c.data(), ids_c.size(), &status_c);
|
|
586
557
|
check_bark_error(error);
|
|
587
558
|
if (status_c == nullptr) {
|
|
588
559
|
throw std::runtime_error("Bark-cpp error: exitStartSpecific returned "
|
|
@@ -594,15 +565,12 @@ namespace margelo::nitro::nitroark
|
|
|
594
565
|
}
|
|
595
566
|
|
|
596
567
|
std::shared_ptr<Promise<std::string>>
|
|
597
|
-
exitStartAll(
|
|
598
|
-
bool no_sync /* Potential C header mismatch noted */) override
|
|
568
|
+
exitStartAll() override
|
|
599
569
|
{
|
|
600
|
-
return Promise<std::string>::async([
|
|
570
|
+
return Promise<std::string>::async([]()
|
|
601
571
|
{
|
|
602
572
|
char *status_c = nullptr;
|
|
603
|
-
|
|
604
|
-
bark::bark_BarkError *error = bark::bark_exit_start_all(
|
|
605
|
-
datadir.c_str(), mnemonic.c_str(), &status_c);
|
|
573
|
+
bark::bark_BarkError *error = bark::bark_exit_start_all(&status_c);
|
|
606
574
|
check_bark_error(error);
|
|
607
575
|
if (status_c == nullptr) {
|
|
608
576
|
throw std::runtime_error(
|
|
@@ -614,14 +582,12 @@ namespace margelo::nitro::nitroark
|
|
|
614
582
|
}
|
|
615
583
|
|
|
616
584
|
std::shared_ptr<Promise<std::string>>
|
|
617
|
-
exitProgressOnce(
|
|
618
|
-
const std::string &mnemonic) override
|
|
585
|
+
exitProgressOnce() override
|
|
619
586
|
{
|
|
620
|
-
return Promise<std::string>::async([
|
|
587
|
+
return Promise<std::string>::async([]()
|
|
621
588
|
{
|
|
622
589
|
char *status_c = nullptr;
|
|
623
|
-
bark::bark_BarkError *error = bark::bark_exit_progress_once(
|
|
624
|
-
datadir.c_str(), mnemonic.c_str(), &status_c);
|
|
590
|
+
bark::bark_BarkError *error = bark::bark_exit_progress_once(&status_c);
|
|
625
591
|
check_bark_error(error);
|
|
626
592
|
if (status_c == nullptr) {
|
|
627
593
|
throw std::runtime_error("Bark-cpp error: exitProgressOnce returned "
|