react-native-nitro-ark 0.0.31 → 0.0.33
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 +62 -33
- package/cpp/generated/ark_cxx.h +66 -6
- package/lib/module/index.js +10 -10
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +31 -6
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +12 -12
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/shared/c++/ArkoorPaymentResult.hpp +80 -0
- package/nitrogen/generated/shared/c++/BarkVtxo.hpp +81 -0
- package/nitrogen/generated/shared/c++/Bolt11PaymentResult.hpp +73 -0
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +18 -6
- package/nitrogen/generated/shared/c++/LnurlPaymentResult.hpp +77 -0
- package/nitrogen/generated/shared/c++/OnchainPaymentResult.hpp +77 -0
- package/package.json +1 -1
- package/src/NitroArk.nitro.ts +47 -9
- package/src/index.tsx +22 -23
package/cpp/NitroArk.hpp
CHANGED
|
@@ -258,15 +258,20 @@ namespace margelo::nitro::nitroark
|
|
|
258
258
|
|
|
259
259
|
// --- Onchain Operations ---
|
|
260
260
|
|
|
261
|
-
std::shared_ptr<Promise<
|
|
262
|
-
sendOnchain(const std::string &destination, double amountSat
|
|
263
|
-
bool no_sync) override
|
|
261
|
+
std::shared_ptr<Promise<OnchainPaymentResult>>
|
|
262
|
+
sendOnchain(const std::string &destination, double amountSat) override
|
|
264
263
|
{
|
|
265
|
-
return Promise<
|
|
266
|
-
|
|
264
|
+
return Promise<OnchainPaymentResult>::async([destination, amountSat]()
|
|
265
|
+
{
|
|
267
266
|
try {
|
|
268
|
-
|
|
269
|
-
|
|
267
|
+
bark_cxx::OnchainPaymentResult rust_result = bark_cxx::send_onchain(destination, static_cast<uint64_t>(amountSat));
|
|
268
|
+
|
|
269
|
+
OnchainPaymentResult result;
|
|
270
|
+
result.txid = std::string(rust_result.txid.data(), rust_result.txid.length());
|
|
271
|
+
result.amount_sat = static_cast<double>(rust_result.amount_sat);
|
|
272
|
+
result.destination_address = std::string(rust_result.destination_address.data(), rust_result.destination_address.length());
|
|
273
|
+
|
|
274
|
+
return result;
|
|
270
275
|
} catch (const rust::Error &e) {
|
|
271
276
|
throw std::runtime_error(e.what());
|
|
272
277
|
} });
|
|
@@ -334,46 +339,73 @@ namespace margelo::nitro::nitroark
|
|
|
334
339
|
} });
|
|
335
340
|
}
|
|
336
341
|
|
|
337
|
-
std::shared_ptr<Promise<
|
|
342
|
+
std::shared_ptr<Promise<ArkoorPaymentResult>>
|
|
338
343
|
sendArkoorPayment(const std::string &destination, double amountSat) override
|
|
339
344
|
{
|
|
340
|
-
return Promise<
|
|
341
|
-
|
|
345
|
+
return Promise<ArkoorPaymentResult>::async([destination, amountSat]()
|
|
346
|
+
{
|
|
342
347
|
try {
|
|
343
|
-
|
|
344
|
-
|
|
348
|
+
bark_cxx::ArkoorPaymentResult rust_result = bark_cxx::send_arkoor_payment(destination, static_cast<uint64_t>(amountSat));
|
|
349
|
+
|
|
350
|
+
ArkoorPaymentResult result;
|
|
351
|
+
result.amount_sat = static_cast<double>(rust_result.amount_sat);
|
|
352
|
+
result.destination_pubkey = std::string(rust_result.destination_pubkey.data(), rust_result.destination_pubkey.length());
|
|
353
|
+
|
|
354
|
+
std::vector<BarkVtxo> vtxos;
|
|
355
|
+
for (const auto& rust_vtxo : rust_result.vtxos) {
|
|
356
|
+
BarkVtxo vtxo;
|
|
357
|
+
vtxo.amount = static_cast<double>(rust_vtxo.amount);
|
|
358
|
+
vtxo.expiry_height = static_cast<double>(rust_vtxo.expiry_height);
|
|
359
|
+
vtxo.exit_delta = static_cast<double>(rust_vtxo.exit_delta);
|
|
360
|
+
vtxo.anchor_point = std::string(rust_vtxo.anchor_point.data(), rust_vtxo.anchor_point.length());
|
|
361
|
+
vtxos.push_back(vtxo);
|
|
362
|
+
}
|
|
363
|
+
result.vtxos = vtxos;
|
|
364
|
+
|
|
365
|
+
return result;
|
|
345
366
|
} catch (const rust::Error &e) {
|
|
346
367
|
throw std::runtime_error(e.what());
|
|
347
368
|
} });
|
|
348
369
|
}
|
|
349
370
|
|
|
350
|
-
std::shared_ptr<Promise<
|
|
371
|
+
std::shared_ptr<Promise<Bolt11PaymentResult>>
|
|
351
372
|
sendBolt11Payment(const std::string &destination, std::optional<double> amountSat) override
|
|
352
373
|
{
|
|
353
|
-
return Promise<
|
|
354
|
-
|
|
374
|
+
return Promise<Bolt11PaymentResult>::async([destination, amountSat]()
|
|
375
|
+
{
|
|
355
376
|
try {
|
|
356
|
-
|
|
377
|
+
bark_cxx::Bolt11PaymentResult rust_result;
|
|
357
378
|
if (amountSat.has_value()) {
|
|
358
379
|
uint64_t amountSat_val = static_cast<uint64_t>(amountSat.value());
|
|
359
|
-
|
|
380
|
+
rust_result = bark_cxx::send_bolt11_payment(destination, &amountSat_val);
|
|
360
381
|
} else {
|
|
361
|
-
|
|
382
|
+
rust_result = bark_cxx::send_bolt11_payment(destination, nullptr);
|
|
362
383
|
}
|
|
363
|
-
|
|
384
|
+
|
|
385
|
+
Bolt11PaymentResult result;
|
|
386
|
+
result.bolt11_invoice = std::string(rust_result.bolt11_invoice.data(), rust_result.bolt11_invoice.length());
|
|
387
|
+
result.preimage = std::string(rust_result.preimage.data(), rust_result.preimage.length());
|
|
388
|
+
|
|
389
|
+
return result;
|
|
364
390
|
} catch (const rust::Error &e) {
|
|
365
391
|
throw std::runtime_error(e.what());
|
|
366
392
|
} });
|
|
367
393
|
}
|
|
368
394
|
|
|
369
|
-
std::shared_ptr<Promise<
|
|
395
|
+
std::shared_ptr<Promise<LnurlPaymentResult>>
|
|
370
396
|
sendLnaddr(const std::string &addr, double amountSat, const std::string &comment) override
|
|
371
397
|
{
|
|
372
|
-
return Promise<
|
|
373
|
-
|
|
398
|
+
return Promise<LnurlPaymentResult>::async([addr, amountSat, comment]()
|
|
399
|
+
{
|
|
374
400
|
try {
|
|
375
|
-
|
|
376
|
-
|
|
401
|
+
bark_cxx::LnurlPaymentResult rust_result = bark_cxx::send_lnaddr(addr, static_cast<uint64_t>(amountSat), comment);
|
|
402
|
+
|
|
403
|
+
LnurlPaymentResult result;
|
|
404
|
+
result.lnurl = std::string(rust_result.lnurl.data(), rust_result.lnurl.length());
|
|
405
|
+
result.bolt11_invoice = std::string(rust_result.bolt11_invoice.data(), rust_result.bolt11_invoice.length());
|
|
406
|
+
result.preimage = std::string(rust_result.preimage.data(), rust_result.preimage.length());
|
|
407
|
+
|
|
408
|
+
return result;
|
|
377
409
|
} catch (const rust::Error &e) {
|
|
378
410
|
throw std::runtime_error(e.what());
|
|
379
411
|
} });
|
|
@@ -429,11 +461,10 @@ namespace margelo::nitro::nitroark
|
|
|
429
461
|
|
|
430
462
|
std::shared_ptr<Promise<std::string>>
|
|
431
463
|
offboardSpecific(const std::vector<std::string> &vtxoIds,
|
|
432
|
-
const std::string &destinationAddress
|
|
433
|
-
bool no_sync) override
|
|
464
|
+
const std::string &destinationAddress) override
|
|
434
465
|
{
|
|
435
466
|
return Promise<std::string>::async(
|
|
436
|
-
[vtxoIds, destinationAddress
|
|
467
|
+
[vtxoIds, destinationAddress]()
|
|
437
468
|
{
|
|
438
469
|
try
|
|
439
470
|
{
|
|
@@ -442,7 +473,7 @@ namespace margelo::nitro::nitroark
|
|
|
442
473
|
{
|
|
443
474
|
rust_vtxo_ids.push_back(rust::String(id));
|
|
444
475
|
}
|
|
445
|
-
rust::String status_rs = bark_cxx::offboard_specific(std::move(rust_vtxo_ids), destinationAddress
|
|
476
|
+
rust::String status_rs = bark_cxx::offboard_specific(std::move(rust_vtxo_ids), destinationAddress);
|
|
446
477
|
return std::string(status_rs.data(), status_rs.length());
|
|
447
478
|
}
|
|
448
479
|
catch (const rust::Error &e)
|
|
@@ -453,14 +484,12 @@ namespace margelo::nitro::nitroark
|
|
|
453
484
|
}
|
|
454
485
|
|
|
455
486
|
std::shared_ptr<Promise<std::string>>
|
|
456
|
-
offboardAll(const std::string &destinationAddress
|
|
457
|
-
bool no_sync) override
|
|
487
|
+
offboardAll(const std::string &destinationAddress) override
|
|
458
488
|
{
|
|
459
|
-
return Promise<std::string>::async([destinationAddress
|
|
460
|
-
no_sync]()
|
|
489
|
+
return Promise<std::string>::async([destinationAddress]()
|
|
461
490
|
{
|
|
462
491
|
try {
|
|
463
|
-
rust::String status_rs = bark_cxx::offboard_all(destinationAddress
|
|
492
|
+
rust::String status_rs = bark_cxx::offboard_all(destinationAddress);
|
|
464
493
|
return std::string(status_rs.data(), status_rs.length());
|
|
465
494
|
} catch (const rust::Error &e) {
|
|
466
495
|
throw std::runtime_error(e.what());
|
package/cpp/generated/ark_cxx.h
CHANGED
|
@@ -797,6 +797,11 @@ std::size_t align_of() {
|
|
|
797
797
|
#endif
|
|
798
798
|
|
|
799
799
|
namespace bark_cxx {
|
|
800
|
+
struct BarkVtxo;
|
|
801
|
+
struct Bolt11PaymentResult;
|
|
802
|
+
struct LnurlPaymentResult;
|
|
803
|
+
struct ArkoorPaymentResult;
|
|
804
|
+
struct OnchainPaymentResult;
|
|
800
805
|
struct CxxArkInfo;
|
|
801
806
|
struct ConfigOpts;
|
|
802
807
|
struct CreateOpts;
|
|
@@ -805,6 +810,61 @@ namespace bark_cxx {
|
|
|
805
810
|
}
|
|
806
811
|
|
|
807
812
|
namespace bark_cxx {
|
|
813
|
+
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$BarkVtxo
|
|
814
|
+
#define CXXBRIDGE1_STRUCT_bark_cxx$BarkVtxo
|
|
815
|
+
struct BarkVtxo final {
|
|
816
|
+
::std::uint64_t amount CXX_DEFAULT_VALUE(0);
|
|
817
|
+
::std::uint32_t expiry_height CXX_DEFAULT_VALUE(0);
|
|
818
|
+
::std::uint16_t exit_delta CXX_DEFAULT_VALUE(0);
|
|
819
|
+
::rust::String anchor_point;
|
|
820
|
+
|
|
821
|
+
using IsRelocatable = ::std::true_type;
|
|
822
|
+
};
|
|
823
|
+
#endif // CXXBRIDGE1_STRUCT_bark_cxx$BarkVtxo
|
|
824
|
+
|
|
825
|
+
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$Bolt11PaymentResult
|
|
826
|
+
#define CXXBRIDGE1_STRUCT_bark_cxx$Bolt11PaymentResult
|
|
827
|
+
struct Bolt11PaymentResult final {
|
|
828
|
+
::rust::String bolt11_invoice;
|
|
829
|
+
::rust::String preimage;
|
|
830
|
+
|
|
831
|
+
using IsRelocatable = ::std::true_type;
|
|
832
|
+
};
|
|
833
|
+
#endif // CXXBRIDGE1_STRUCT_bark_cxx$Bolt11PaymentResult
|
|
834
|
+
|
|
835
|
+
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$LnurlPaymentResult
|
|
836
|
+
#define CXXBRIDGE1_STRUCT_bark_cxx$LnurlPaymentResult
|
|
837
|
+
struct LnurlPaymentResult final {
|
|
838
|
+
::rust::String lnurl;
|
|
839
|
+
::rust::String bolt11_invoice;
|
|
840
|
+
::rust::String preimage;
|
|
841
|
+
|
|
842
|
+
using IsRelocatable = ::std::true_type;
|
|
843
|
+
};
|
|
844
|
+
#endif // CXXBRIDGE1_STRUCT_bark_cxx$LnurlPaymentResult
|
|
845
|
+
|
|
846
|
+
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$ArkoorPaymentResult
|
|
847
|
+
#define CXXBRIDGE1_STRUCT_bark_cxx$ArkoorPaymentResult
|
|
848
|
+
struct ArkoorPaymentResult final {
|
|
849
|
+
::std::uint64_t amount_sat CXX_DEFAULT_VALUE(0);
|
|
850
|
+
::rust::String destination_pubkey;
|
|
851
|
+
::rust::Vec<::bark_cxx::BarkVtxo> vtxos;
|
|
852
|
+
|
|
853
|
+
using IsRelocatable = ::std::true_type;
|
|
854
|
+
};
|
|
855
|
+
#endif // CXXBRIDGE1_STRUCT_bark_cxx$ArkoorPaymentResult
|
|
856
|
+
|
|
857
|
+
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$OnchainPaymentResult
|
|
858
|
+
#define CXXBRIDGE1_STRUCT_bark_cxx$OnchainPaymentResult
|
|
859
|
+
struct OnchainPaymentResult final {
|
|
860
|
+
::rust::String txid;
|
|
861
|
+
::std::uint64_t amount_sat CXX_DEFAULT_VALUE(0);
|
|
862
|
+
::rust::String destination_address;
|
|
863
|
+
|
|
864
|
+
using IsRelocatable = ::std::true_type;
|
|
865
|
+
};
|
|
866
|
+
#endif // CXXBRIDGE1_STRUCT_bark_cxx$OnchainPaymentResult
|
|
867
|
+
|
|
808
868
|
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$CxxArkInfo
|
|
809
869
|
#define CXXBRIDGE1_STRUCT_bark_cxx$CxxArkInfo
|
|
810
870
|
struct CxxArkInfo final {
|
|
@@ -910,7 +970,7 @@ void sync_rounds();
|
|
|
910
970
|
|
|
911
971
|
void load_wallet(::rust::Str datadir, ::bark_cxx::CreateOpts opts);
|
|
912
972
|
|
|
913
|
-
::
|
|
973
|
+
::bark_cxx::OnchainPaymentResult send_onchain(::rust::Str destination, ::std::uint64_t amount_sat);
|
|
914
974
|
|
|
915
975
|
::rust::String drain_onchain(::rust::Str destination, bool no_sync);
|
|
916
976
|
|
|
@@ -920,17 +980,17 @@ void load_wallet(::rust::Str datadir, ::bark_cxx::CreateOpts opts);
|
|
|
920
980
|
|
|
921
981
|
::rust::String board_all();
|
|
922
982
|
|
|
923
|
-
::
|
|
983
|
+
::bark_cxx::ArkoorPaymentResult send_arkoor_payment(::rust::Str destination, ::std::uint64_t amount_sat);
|
|
924
984
|
|
|
925
|
-
::
|
|
985
|
+
::bark_cxx::Bolt11PaymentResult send_bolt11_payment(::rust::Str destination, ::std::uint64_t const *amount_sat);
|
|
926
986
|
|
|
927
|
-
::
|
|
987
|
+
::bark_cxx::LnurlPaymentResult send_lnaddr(::rust::Str addr, ::std::uint64_t amount_sat, ::rust::Str comment);
|
|
928
988
|
|
|
929
989
|
::rust::String send_round_onchain(::rust::Str destination, ::std::uint64_t amount_sat, bool no_sync);
|
|
930
990
|
|
|
931
|
-
::rust::String offboard_specific(::rust::Vec<::rust::String> vtxo_ids, ::rust::Str destination_address
|
|
991
|
+
::rust::String offboard_specific(::rust::Vec<::rust::String> vtxo_ids, ::rust::Str destination_address);
|
|
932
992
|
|
|
933
|
-
::rust::String offboard_all(::rust::Str destination_address
|
|
993
|
+
::rust::String offboard_all(::rust::Str destination_address);
|
|
934
994
|
|
|
935
995
|
::rust::String start_exit_for_vtxos(::rust::Vec<::rust::String> vtxo_ids);
|
|
936
996
|
|
package/lib/module/index.js
CHANGED
|
@@ -150,10 +150,10 @@ export function getVtxos(no_sync = false) {
|
|
|
150
150
|
* @param destination The destination Bitcoin address.
|
|
151
151
|
* @param amountSat The amount to send in satoshis.
|
|
152
152
|
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
153
|
-
* @returns A promise resolving to the
|
|
153
|
+
* @returns A promise resolving to the OnchainPaymentResult object
|
|
154
154
|
*/
|
|
155
|
-
export function sendOnchain(destination, amountSat
|
|
156
|
-
return NitroArkHybridObject.sendOnchain(destination, amountSat
|
|
155
|
+
export function sendOnchain(destination, amountSat) {
|
|
156
|
+
return NitroArkHybridObject.sendOnchain(destination, amountSat);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
/**
|
|
@@ -219,7 +219,7 @@ export function boardAll() {
|
|
|
219
219
|
* Sends an Arkoor payment.
|
|
220
220
|
* @param destination The destination Arkoor address.
|
|
221
221
|
* @param amountSat The amount in satoshis to send.
|
|
222
|
-
* @returns A promise resolving to
|
|
222
|
+
* @returns A promise resolving to the ArkoorPaymentResult object
|
|
223
223
|
*/
|
|
224
224
|
export function sendArkoorPayment(destination, amountSat) {
|
|
225
225
|
return NitroArkHybridObject.sendArkoorPayment(destination, amountSat);
|
|
@@ -229,7 +229,7 @@ export function sendArkoorPayment(destination, amountSat) {
|
|
|
229
229
|
* Sends a Bolt11 payment.
|
|
230
230
|
* @param destination The Bolt11 invoice.
|
|
231
231
|
* @param amountSat The amount in satoshis to send. Use 0 for invoice amount.
|
|
232
|
-
* @returns A promise resolving to a
|
|
232
|
+
* @returns A promise resolving to a Bolt11PaymentResult object
|
|
233
233
|
*/
|
|
234
234
|
export function sendBolt11Payment(destination, amountSat) {
|
|
235
235
|
return NitroArkHybridObject.sendBolt11Payment(destination, amountSat);
|
|
@@ -240,7 +240,7 @@ export function sendBolt11Payment(destination, amountSat) {
|
|
|
240
240
|
* @param addr The Lightning Address.
|
|
241
241
|
* @param amountSat The amount in satoshis to send.
|
|
242
242
|
* @param comment An optional comment.
|
|
243
|
-
* @returns A promise resolving to a
|
|
243
|
+
* @returns A promise resolving to a LnurlPaymentResult object
|
|
244
244
|
*/
|
|
245
245
|
export function sendLnaddr(addr, amountSat, comment) {
|
|
246
246
|
return NitroArkHybridObject.sendLnaddr(addr, amountSat, comment);
|
|
@@ -266,8 +266,8 @@ export function sendRoundOnchain(destination, amountSat, no_sync = false) {
|
|
|
266
266
|
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
267
267
|
* @returns A promise resolving to a JSON result string.
|
|
268
268
|
*/
|
|
269
|
-
export function offboardSpecific(vtxoIds, destinationAddress
|
|
270
|
-
return NitroArkHybridObject.offboardSpecific(vtxoIds, destinationAddress
|
|
269
|
+
export function offboardSpecific(vtxoIds, destinationAddress) {
|
|
270
|
+
return NitroArkHybridObject.offboardSpecific(vtxoIds, destinationAddress);
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
/**
|
|
@@ -276,8 +276,8 @@ export function offboardSpecific(vtxoIds, destinationAddress, no_sync = false) {
|
|
|
276
276
|
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
277
277
|
* @returns A promise resolving to a JSON result string.
|
|
278
278
|
*/
|
|
279
|
-
export function offboardAll(destinationAddress
|
|
280
|
-
return NitroArkHybridObject.offboardAll(destinationAddress
|
|
279
|
+
export function offboardAll(destinationAddress) {
|
|
280
|
+
return NitroArkHybridObject.offboardAll(destinationAddress);
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
/**
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NitroModules","NitroArkHybridObject","createHybridObject","createMnemonic","loadWallet","datadir","opts","closeWallet","isWalletLoaded","persistConfig","maintenance","sync","syncArk","syncRounds","getArkInfo","onchainBalance","offchainBalance","getOnchainAddress","getOnchainUtxos","no_sync","getVtxoPubkey","index","getVtxos","sendOnchain","destination","amountSat","drainOnchain","sendManyOnchain","outputs","bolt11Invoice","amountMsat","claimBolt11Payment","bolt11","boardAmount","boardAll","sendArkoorPayment","sendBolt11Payment","sendLnaddr","addr","comment","sendRoundOnchain","offboardSpecific","vtxoIds","destinationAddress","offboardAll","startExitForVtxos","exitStartSpecific","startExitForEntireWallet","exitStartAll","exitProgressOnce"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;
|
|
1
|
+
{"version":3,"names":["NitroModules","NitroArkHybridObject","createHybridObject","createMnemonic","loadWallet","datadir","opts","closeWallet","isWalletLoaded","persistConfig","maintenance","sync","syncArk","syncRounds","getArkInfo","onchainBalance","offchainBalance","getOnchainAddress","getOnchainUtxos","no_sync","getVtxoPubkey","index","getVtxos","sendOnchain","destination","amountSat","drainOnchain","sendManyOnchain","outputs","bolt11Invoice","amountMsat","claimBolt11Payment","bolt11","boardAmount","boardAll","sendArkoorPayment","sendBolt11Payment","sendLnaddr","addr","comment","sendRoundOnchain","offboardSpecific","vtxoIds","destinationAddress","offboardAll","startExitForVtxos","exitStartSpecific","startExitForEntireWallet","exitStartAll","exitProgressOnce"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAazD;AACA,OAAO,MAAMC,oBAAoB,GAC/BD,YAAY,CAACE,kBAAkB,CAAW,UAAU,CAAC;;AAEvD;;AAEA;AACA;AACA;AAC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CAAChB,WAAW,EAAEC,SAAS,EAAEN,OAAO,CAAC;AAC/E;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASsB,gBAAgBA,CAC9BC,OAAiB,EACjBC,kBAA0B,EACT;EACjB,OAAO1C,oBAAoB,CAACwC,gBAAgB,CAACC,OAAO,EAAEC,kBAAkB,CAAC;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACD,kBAA0B,EAAmB;EACvE,OAAO1C,oBAAoB,CAAC2C,WAAW,CAACD,kBAAkB,CAAC;AAC7D;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,iBAAiBA,CAACH,OAAiB,EAAmB;EACpE,OAAOzC,oBAAoB,CAAC6C,iBAAiB,CAACJ,OAAO,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASK,wBAAwBA,CAAA,EAAoB;EAC1D,OAAO9C,oBAAoB,CAAC+C,YAAY,CAAC,CAAC;AAC5C;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAA,EAAoB;EAClD,OAAOhD,oBAAoB,CAACgD,gBAAgB,CAAC,CAAC;AAChD;;AAEA","ignoreList":[]}
|
|
@@ -30,6 +30,31 @@ export interface BarkSendManyOutput {
|
|
|
30
30
|
destination: string;
|
|
31
31
|
amountSat: number;
|
|
32
32
|
}
|
|
33
|
+
export interface BarkVtxo {
|
|
34
|
+
amount: number;
|
|
35
|
+
expiry_height: number;
|
|
36
|
+
exit_delta: number;
|
|
37
|
+
anchor_point: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ArkoorPaymentResult {
|
|
40
|
+
amount_sat: number;
|
|
41
|
+
destination_pubkey: string;
|
|
42
|
+
vtxos: BarkVtxo[];
|
|
43
|
+
}
|
|
44
|
+
export interface Bolt11PaymentResult {
|
|
45
|
+
bolt11_invoice: string;
|
|
46
|
+
preimage: string;
|
|
47
|
+
}
|
|
48
|
+
export interface LnurlPaymentResult {
|
|
49
|
+
lnurl: string;
|
|
50
|
+
bolt11_invoice: string;
|
|
51
|
+
preimage: string;
|
|
52
|
+
}
|
|
53
|
+
export interface OnchainPaymentResult {
|
|
54
|
+
txid: string;
|
|
55
|
+
amount_sat: number;
|
|
56
|
+
destination_address: string;
|
|
57
|
+
}
|
|
33
58
|
export interface NitroArk extends HybridObject<{
|
|
34
59
|
ios: 'c++';
|
|
35
60
|
android: 'c++';
|
|
@@ -50,19 +75,19 @@ export interface NitroArk extends HybridObject<{
|
|
|
50
75
|
getOnchainUtxos(no_sync: boolean): Promise<string>;
|
|
51
76
|
getVtxoPubkey(index?: number): Promise<string>;
|
|
52
77
|
getVtxos(no_sync: boolean): Promise<string>;
|
|
53
|
-
sendOnchain(destination: string, amountSat: number
|
|
78
|
+
sendOnchain(destination: string, amountSat: number): Promise<OnchainPaymentResult>;
|
|
54
79
|
drainOnchain(destination: string, no_sync: boolean): Promise<string>;
|
|
55
80
|
sendManyOnchain(outputs: BarkSendManyOutput[], no_sync: boolean): Promise<string>;
|
|
56
81
|
boardAmount(amountSat: number): Promise<string>;
|
|
57
82
|
boardAll(): Promise<string>;
|
|
58
|
-
sendArkoorPayment(destination: string, amountSat: number): Promise<
|
|
59
|
-
sendBolt11Payment(destination: string, amountSat?: number): Promise<
|
|
60
|
-
sendLnaddr(addr: string, amountSat: number, comment: string): Promise<
|
|
83
|
+
sendArkoorPayment(destination: string, amountSat: number): Promise<ArkoorPaymentResult>;
|
|
84
|
+
sendBolt11Payment(destination: string, amountSat?: number): Promise<Bolt11PaymentResult>;
|
|
85
|
+
sendLnaddr(addr: string, amountSat: number, comment: string): Promise<LnurlPaymentResult>;
|
|
61
86
|
sendRoundOnchain(destination: string, amountSat: number, no_sync: boolean): Promise<string>;
|
|
62
87
|
bolt11Invoice(amountMsat: number): Promise<string>;
|
|
63
88
|
claimBolt11Payment(bolt11: string): Promise<void>;
|
|
64
|
-
offboardSpecific(vtxoIds: string[], destinationAddress: string
|
|
65
|
-
offboardAll(destinationAddress: string
|
|
89
|
+
offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<string>;
|
|
90
|
+
offboardAll(destinationAddress: string): Promise<string>;
|
|
66
91
|
exitStartSpecific(vtxoIds: string[]): Promise<string>;
|
|
67
92
|
exitStartAll(): Promise<string>;
|
|
68
93
|
exitProgressOnce(): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NitroArk.nitro.d.ts","sourceRoot":"","sources":["../../../src/NitroArk.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM/D,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;CAC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AAC,IAAI,CAAC,CAAC;IAGlD,gBAAgB,CACd,OAAO,EAAE,MAAM,EAAE,EACjB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB,WAAW,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzD,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACtD,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACrC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput } from './NitroArk.nitro';
|
|
1
|
+
import type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput, ArkoorPaymentResult, Bolt11PaymentResult, LnurlPaymentResult, OnchainPaymentResult } from './NitroArk.nitro';
|
|
2
2
|
export declare const NitroArkHybridObject: NitroArk;
|
|
3
3
|
/**
|
|
4
4
|
* Creates a new BIP39 mnemonic phrase.
|
|
@@ -92,9 +92,9 @@ export declare function getVtxos(no_sync?: boolean): Promise<string>;
|
|
|
92
92
|
* @param destination The destination Bitcoin address.
|
|
93
93
|
* @param amountSat The amount to send in satoshis.
|
|
94
94
|
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
95
|
-
* @returns A promise resolving to the
|
|
95
|
+
* @returns A promise resolving to the OnchainPaymentResult object
|
|
96
96
|
*/
|
|
97
|
-
export declare function sendOnchain(destination: string, amountSat: number
|
|
97
|
+
export declare function sendOnchain(destination: string, amountSat: number): Promise<OnchainPaymentResult>;
|
|
98
98
|
/**
|
|
99
99
|
* Sends all funds from the onchain wallet to a destination address.
|
|
100
100
|
* @param destination The destination Bitcoin address.
|
|
@@ -136,24 +136,24 @@ export declare function boardAll(): Promise<string>;
|
|
|
136
136
|
* Sends an Arkoor payment.
|
|
137
137
|
* @param destination The destination Arkoor address.
|
|
138
138
|
* @param amountSat The amount in satoshis to send.
|
|
139
|
-
* @returns A promise resolving to
|
|
139
|
+
* @returns A promise resolving to the ArkoorPaymentResult object
|
|
140
140
|
*/
|
|
141
|
-
export declare function sendArkoorPayment(destination: string, amountSat: number): Promise<
|
|
141
|
+
export declare function sendArkoorPayment(destination: string, amountSat: number): Promise<ArkoorPaymentResult>;
|
|
142
142
|
/**
|
|
143
143
|
* Sends a Bolt11 payment.
|
|
144
144
|
* @param destination The Bolt11 invoice.
|
|
145
145
|
* @param amountSat The amount in satoshis to send. Use 0 for invoice amount.
|
|
146
|
-
* @returns A promise resolving to a
|
|
146
|
+
* @returns A promise resolving to a Bolt11PaymentResult object
|
|
147
147
|
*/
|
|
148
|
-
export declare function sendBolt11Payment(destination: string, amountSat?: number): Promise<
|
|
148
|
+
export declare function sendBolt11Payment(destination: string, amountSat?: number): Promise<Bolt11PaymentResult>;
|
|
149
149
|
/**
|
|
150
150
|
* Sends a payment to a Lightning Address.
|
|
151
151
|
* @param addr The Lightning Address.
|
|
152
152
|
* @param amountSat The amount in satoshis to send.
|
|
153
153
|
* @param comment An optional comment.
|
|
154
|
-
* @returns A promise resolving to a
|
|
154
|
+
* @returns A promise resolving to a LnurlPaymentResult object
|
|
155
155
|
*/
|
|
156
|
-
export declare function sendLnaddr(addr: string, amountSat: number, comment: string): Promise<
|
|
156
|
+
export declare function sendLnaddr(addr: string, amountSat: number, comment: string): Promise<LnurlPaymentResult>;
|
|
157
157
|
/**
|
|
158
158
|
* Sends an onchain payment via an Ark round.
|
|
159
159
|
* @param destination The destination Bitcoin address.
|
|
@@ -169,14 +169,14 @@ export declare function sendRoundOnchain(destination: string, amountSat: number,
|
|
|
169
169
|
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
170
170
|
* @returns A promise resolving to a JSON result string.
|
|
171
171
|
*/
|
|
172
|
-
export declare function offboardSpecific(vtxoIds: string[], destinationAddress: string
|
|
172
|
+
export declare function offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<string>;
|
|
173
173
|
/**
|
|
174
174
|
* Offboards all VTXOs to a destination address.
|
|
175
175
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
176
176
|
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
177
177
|
* @returns A promise resolving to a JSON result string.
|
|
178
178
|
*/
|
|
179
|
-
export declare function offboardAll(destinationAddress: string
|
|
179
|
+
export declare function offboardAll(destinationAddress: string): Promise<string>;
|
|
180
180
|
/**
|
|
181
181
|
* Starts the exit process for specific VTXOs.
|
|
182
182
|
* @param vtxoIds Array of VtxoId strings to start exiting.
|
|
@@ -193,5 +193,5 @@ export declare function startExitForEntireWallet(): Promise<string>;
|
|
|
193
193
|
* @returns A promise resolving to a JSON status string.
|
|
194
194
|
*/
|
|
195
195
|
export declare function exitProgressOnce(): Promise<string>;
|
|
196
|
-
export type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput, } from './NitroArk.nitro';
|
|
196
|
+
export type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput, ArkoorPaymentResult, Bolt11PaymentResult, LnurlPaymentResult, OnchainPaymentResult, } from './NitroArk.nitro';
|
|
197
197
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,oBAAoB,UACsB,CAAC;AAIxD;;;GAGG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE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WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAE9B;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,CAE7B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,OAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAEjB;AAID;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EAAE,EACjB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAAC,MAAM,CAAC,CAE1D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAElD;AAGD,YAAY,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ArkoorPaymentResult.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
// Forward declaration of `BarkVtxo` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::nitroark { struct BarkVtxo; }
|
|
23
|
+
|
|
24
|
+
#include <string>
|
|
25
|
+
#include <vector>
|
|
26
|
+
#include "BarkVtxo.hpp"
|
|
27
|
+
|
|
28
|
+
namespace margelo::nitro::nitroark {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A struct which can be represented as a JavaScript object (ArkoorPaymentResult).
|
|
32
|
+
*/
|
|
33
|
+
struct ArkoorPaymentResult {
|
|
34
|
+
public:
|
|
35
|
+
double amount_sat SWIFT_PRIVATE;
|
|
36
|
+
std::string destination_pubkey SWIFT_PRIVATE;
|
|
37
|
+
std::vector<BarkVtxo> vtxos SWIFT_PRIVATE;
|
|
38
|
+
|
|
39
|
+
public:
|
|
40
|
+
ArkoorPaymentResult() = default;
|
|
41
|
+
explicit ArkoorPaymentResult(double amount_sat, std::string destination_pubkey, std::vector<BarkVtxo> vtxos): amount_sat(amount_sat), destination_pubkey(destination_pubkey), vtxos(vtxos) {}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
} // namespace margelo::nitro::nitroark
|
|
45
|
+
|
|
46
|
+
namespace margelo::nitro {
|
|
47
|
+
|
|
48
|
+
using namespace margelo::nitro::nitroark;
|
|
49
|
+
|
|
50
|
+
// C++ ArkoorPaymentResult <> JS ArkoorPaymentResult (object)
|
|
51
|
+
template <>
|
|
52
|
+
struct JSIConverter<ArkoorPaymentResult> final {
|
|
53
|
+
static inline ArkoorPaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
54
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
55
|
+
return ArkoorPaymentResult(
|
|
56
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "amount_sat")),
|
|
57
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "destination_pubkey")),
|
|
58
|
+
JSIConverter<std::vector<BarkVtxo>>::fromJSI(runtime, obj.getProperty(runtime, "vtxos"))
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const ArkoorPaymentResult& arg) {
|
|
62
|
+
jsi::Object obj(runtime);
|
|
63
|
+
obj.setProperty(runtime, "amount_sat", JSIConverter<double>::toJSI(runtime, arg.amount_sat));
|
|
64
|
+
obj.setProperty(runtime, "destination_pubkey", JSIConverter<std::string>::toJSI(runtime, arg.destination_pubkey));
|
|
65
|
+
obj.setProperty(runtime, "vtxos", JSIConverter<std::vector<BarkVtxo>>::toJSI(runtime, arg.vtxos));
|
|
66
|
+
return obj;
|
|
67
|
+
}
|
|
68
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
69
|
+
if (!value.isObject()) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
jsi::Object obj = value.getObject(runtime);
|
|
73
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "amount_sat"))) return false;
|
|
74
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "destination_pubkey"))) return false;
|
|
75
|
+
if (!JSIConverter<std::vector<BarkVtxo>>::canConvert(runtime, obj.getProperty(runtime, "vtxos"))) return false;
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// BarkVtxo.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#include <string>
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::nitroark {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A struct which can be represented as a JavaScript object (BarkVtxo).
|
|
29
|
+
*/
|
|
30
|
+
struct BarkVtxo {
|
|
31
|
+
public:
|
|
32
|
+
double amount SWIFT_PRIVATE;
|
|
33
|
+
double expiry_height SWIFT_PRIVATE;
|
|
34
|
+
double exit_delta SWIFT_PRIVATE;
|
|
35
|
+
std::string anchor_point SWIFT_PRIVATE;
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
BarkVtxo() = default;
|
|
39
|
+
explicit BarkVtxo(double amount, double expiry_height, double exit_delta, std::string anchor_point): amount(amount), expiry_height(expiry_height), exit_delta(exit_delta), anchor_point(anchor_point) {}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
} // namespace margelo::nitro::nitroark
|
|
43
|
+
|
|
44
|
+
namespace margelo::nitro {
|
|
45
|
+
|
|
46
|
+
using namespace margelo::nitro::nitroark;
|
|
47
|
+
|
|
48
|
+
// C++ BarkVtxo <> JS BarkVtxo (object)
|
|
49
|
+
template <>
|
|
50
|
+
struct JSIConverter<BarkVtxo> final {
|
|
51
|
+
static inline BarkVtxo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
52
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
53
|
+
return BarkVtxo(
|
|
54
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "amount")),
|
|
55
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "expiry_height")),
|
|
56
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "exit_delta")),
|
|
57
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "anchor_point"))
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const BarkVtxo& arg) {
|
|
61
|
+
jsi::Object obj(runtime);
|
|
62
|
+
obj.setProperty(runtime, "amount", JSIConverter<double>::toJSI(runtime, arg.amount));
|
|
63
|
+
obj.setProperty(runtime, "expiry_height", JSIConverter<double>::toJSI(runtime, arg.expiry_height));
|
|
64
|
+
obj.setProperty(runtime, "exit_delta", JSIConverter<double>::toJSI(runtime, arg.exit_delta));
|
|
65
|
+
obj.setProperty(runtime, "anchor_point", JSIConverter<std::string>::toJSI(runtime, arg.anchor_point));
|
|
66
|
+
return obj;
|
|
67
|
+
}
|
|
68
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
69
|
+
if (!value.isObject()) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
jsi::Object obj = value.getObject(runtime);
|
|
73
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "amount"))) return false;
|
|
74
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "expiry_height"))) return false;
|
|
75
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "exit_delta"))) return false;
|
|
76
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "anchor_point"))) return false;
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Bolt11PaymentResult.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#include <string>
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::nitroark {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A struct which can be represented as a JavaScript object (Bolt11PaymentResult).
|
|
29
|
+
*/
|
|
30
|
+
struct Bolt11PaymentResult {
|
|
31
|
+
public:
|
|
32
|
+
std::string bolt11_invoice SWIFT_PRIVATE;
|
|
33
|
+
std::string preimage SWIFT_PRIVATE;
|
|
34
|
+
|
|
35
|
+
public:
|
|
36
|
+
Bolt11PaymentResult() = default;
|
|
37
|
+
explicit Bolt11PaymentResult(std::string bolt11_invoice, std::string preimage): bolt11_invoice(bolt11_invoice), preimage(preimage) {}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
} // namespace margelo::nitro::nitroark
|
|
41
|
+
|
|
42
|
+
namespace margelo::nitro {
|
|
43
|
+
|
|
44
|
+
using namespace margelo::nitro::nitroark;
|
|
45
|
+
|
|
46
|
+
// C++ Bolt11PaymentResult <> JS Bolt11PaymentResult (object)
|
|
47
|
+
template <>
|
|
48
|
+
struct JSIConverter<Bolt11PaymentResult> final {
|
|
49
|
+
static inline Bolt11PaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
50
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
51
|
+
return Bolt11PaymentResult(
|
|
52
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "bolt11_invoice")),
|
|
53
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "preimage"))
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const Bolt11PaymentResult& arg) {
|
|
57
|
+
jsi::Object obj(runtime);
|
|
58
|
+
obj.setProperty(runtime, "bolt11_invoice", JSIConverter<std::string>::toJSI(runtime, arg.bolt11_invoice));
|
|
59
|
+
obj.setProperty(runtime, "preimage", JSIConverter<std::string>::toJSI(runtime, arg.preimage));
|
|
60
|
+
return obj;
|
|
61
|
+
}
|
|
62
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
63
|
+
if (!value.isObject()) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
jsi::Object obj = value.getObject(runtime);
|
|
67
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "bolt11_invoice"))) return false;
|
|
68
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "preimage"))) return false;
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
} // namespace margelo::nitro
|
|
@@ -19,8 +19,16 @@ namespace margelo::nitro::nitroark { struct BarkCreateOpts; }
|
|
|
19
19
|
namespace margelo::nitro::nitroark { struct BarkConfigOpts; }
|
|
20
20
|
// Forward declaration of `BarkArkInfo` to properly resolve imports.
|
|
21
21
|
namespace margelo::nitro::nitroark { struct BarkArkInfo; }
|
|
22
|
+
// Forward declaration of `OnchainPaymentResult` to properly resolve imports.
|
|
23
|
+
namespace margelo::nitro::nitroark { struct OnchainPaymentResult; }
|
|
22
24
|
// Forward declaration of `BarkSendManyOutput` to properly resolve imports.
|
|
23
25
|
namespace margelo::nitro::nitroark { struct BarkSendManyOutput; }
|
|
26
|
+
// Forward declaration of `ArkoorPaymentResult` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::nitroark { struct ArkoorPaymentResult; }
|
|
28
|
+
// Forward declaration of `Bolt11PaymentResult` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::nitroark { struct Bolt11PaymentResult; }
|
|
30
|
+
// Forward declaration of `LnurlPaymentResult` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::nitroark { struct LnurlPaymentResult; }
|
|
24
32
|
|
|
25
33
|
#include <NitroModules/Promise.hpp>
|
|
26
34
|
#include <string>
|
|
@@ -28,8 +36,12 @@ namespace margelo::nitro::nitroark { struct BarkSendManyOutput; }
|
|
|
28
36
|
#include "BarkConfigOpts.hpp"
|
|
29
37
|
#include "BarkArkInfo.hpp"
|
|
30
38
|
#include <optional>
|
|
39
|
+
#include "OnchainPaymentResult.hpp"
|
|
31
40
|
#include <vector>
|
|
32
41
|
#include "BarkSendManyOutput.hpp"
|
|
42
|
+
#include "ArkoorPaymentResult.hpp"
|
|
43
|
+
#include "Bolt11PaymentResult.hpp"
|
|
44
|
+
#include "LnurlPaymentResult.hpp"
|
|
33
45
|
|
|
34
46
|
namespace margelo::nitro::nitroark {
|
|
35
47
|
|
|
@@ -78,19 +90,19 @@ namespace margelo::nitro::nitroark {
|
|
|
78
90
|
virtual std::shared_ptr<Promise<std::string>> getOnchainUtxos(bool no_sync) = 0;
|
|
79
91
|
virtual std::shared_ptr<Promise<std::string>> getVtxoPubkey(std::optional<double> index) = 0;
|
|
80
92
|
virtual std::shared_ptr<Promise<std::string>> getVtxos(bool no_sync) = 0;
|
|
81
|
-
virtual std::shared_ptr<Promise<
|
|
93
|
+
virtual std::shared_ptr<Promise<OnchainPaymentResult>> sendOnchain(const std::string& destination, double amountSat) = 0;
|
|
82
94
|
virtual std::shared_ptr<Promise<std::string>> drainOnchain(const std::string& destination, bool no_sync) = 0;
|
|
83
95
|
virtual std::shared_ptr<Promise<std::string>> sendManyOnchain(const std::vector<BarkSendManyOutput>& outputs, bool no_sync) = 0;
|
|
84
96
|
virtual std::shared_ptr<Promise<std::string>> boardAmount(double amountSat) = 0;
|
|
85
97
|
virtual std::shared_ptr<Promise<std::string>> boardAll() = 0;
|
|
86
|
-
virtual std::shared_ptr<Promise<
|
|
87
|
-
virtual std::shared_ptr<Promise<
|
|
88
|
-
virtual std::shared_ptr<Promise<
|
|
98
|
+
virtual std::shared_ptr<Promise<ArkoorPaymentResult>> sendArkoorPayment(const std::string& destination, double amountSat) = 0;
|
|
99
|
+
virtual std::shared_ptr<Promise<Bolt11PaymentResult>> sendBolt11Payment(const std::string& destination, std::optional<double> amountSat) = 0;
|
|
100
|
+
virtual std::shared_ptr<Promise<LnurlPaymentResult>> sendLnaddr(const std::string& addr, double amountSat, const std::string& comment) = 0;
|
|
89
101
|
virtual std::shared_ptr<Promise<std::string>> sendRoundOnchain(const std::string& destination, double amountSat, bool no_sync) = 0;
|
|
90
102
|
virtual std::shared_ptr<Promise<std::string>> bolt11Invoice(double amountMsat) = 0;
|
|
91
103
|
virtual std::shared_ptr<Promise<void>> claimBolt11Payment(const std::string& bolt11) = 0;
|
|
92
|
-
virtual std::shared_ptr<Promise<std::string>> offboardSpecific(const std::vector<std::string>& vtxoIds, const std::string& destinationAddress
|
|
93
|
-
virtual std::shared_ptr<Promise<std::string>> offboardAll(const std::string& destinationAddress
|
|
104
|
+
virtual std::shared_ptr<Promise<std::string>> offboardSpecific(const std::vector<std::string>& vtxoIds, const std::string& destinationAddress) = 0;
|
|
105
|
+
virtual std::shared_ptr<Promise<std::string>> offboardAll(const std::string& destinationAddress) = 0;
|
|
94
106
|
virtual std::shared_ptr<Promise<std::string>> exitStartSpecific(const std::vector<std::string>& vtxoIds) = 0;
|
|
95
107
|
virtual std::shared_ptr<Promise<std::string>> exitStartAll() = 0;
|
|
96
108
|
virtual std::shared_ptr<Promise<std::string>> exitProgressOnce() = 0;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// LnurlPaymentResult.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#include <string>
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::nitroark {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A struct which can be represented as a JavaScript object (LnurlPaymentResult).
|
|
29
|
+
*/
|
|
30
|
+
struct LnurlPaymentResult {
|
|
31
|
+
public:
|
|
32
|
+
std::string lnurl SWIFT_PRIVATE;
|
|
33
|
+
std::string bolt11_invoice SWIFT_PRIVATE;
|
|
34
|
+
std::string preimage SWIFT_PRIVATE;
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
LnurlPaymentResult() = default;
|
|
38
|
+
explicit LnurlPaymentResult(std::string lnurl, std::string bolt11_invoice, std::string preimage): lnurl(lnurl), bolt11_invoice(bolt11_invoice), preimage(preimage) {}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace margelo::nitro::nitroark
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro {
|
|
44
|
+
|
|
45
|
+
using namespace margelo::nitro::nitroark;
|
|
46
|
+
|
|
47
|
+
// C++ LnurlPaymentResult <> JS LnurlPaymentResult (object)
|
|
48
|
+
template <>
|
|
49
|
+
struct JSIConverter<LnurlPaymentResult> final {
|
|
50
|
+
static inline LnurlPaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
51
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
52
|
+
return LnurlPaymentResult(
|
|
53
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "lnurl")),
|
|
54
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "bolt11_invoice")),
|
|
55
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "preimage"))
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const LnurlPaymentResult& arg) {
|
|
59
|
+
jsi::Object obj(runtime);
|
|
60
|
+
obj.setProperty(runtime, "lnurl", JSIConverter<std::string>::toJSI(runtime, arg.lnurl));
|
|
61
|
+
obj.setProperty(runtime, "bolt11_invoice", JSIConverter<std::string>::toJSI(runtime, arg.bolt11_invoice));
|
|
62
|
+
obj.setProperty(runtime, "preimage", JSIConverter<std::string>::toJSI(runtime, arg.preimage));
|
|
63
|
+
return obj;
|
|
64
|
+
}
|
|
65
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
66
|
+
if (!value.isObject()) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
jsi::Object obj = value.getObject(runtime);
|
|
70
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "lnurl"))) return false;
|
|
71
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "bolt11_invoice"))) return false;
|
|
72
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "preimage"))) return false;
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// OnchainPaymentResult.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#include <string>
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::nitroark {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A struct which can be represented as a JavaScript object (OnchainPaymentResult).
|
|
29
|
+
*/
|
|
30
|
+
struct OnchainPaymentResult {
|
|
31
|
+
public:
|
|
32
|
+
std::string txid SWIFT_PRIVATE;
|
|
33
|
+
double amount_sat SWIFT_PRIVATE;
|
|
34
|
+
std::string destination_address SWIFT_PRIVATE;
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
OnchainPaymentResult() = default;
|
|
38
|
+
explicit OnchainPaymentResult(std::string txid, double amount_sat, std::string destination_address): txid(txid), amount_sat(amount_sat), destination_address(destination_address) {}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace margelo::nitro::nitroark
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro {
|
|
44
|
+
|
|
45
|
+
using namespace margelo::nitro::nitroark;
|
|
46
|
+
|
|
47
|
+
// C++ OnchainPaymentResult <> JS OnchainPaymentResult (object)
|
|
48
|
+
template <>
|
|
49
|
+
struct JSIConverter<OnchainPaymentResult> final {
|
|
50
|
+
static inline OnchainPaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
51
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
52
|
+
return OnchainPaymentResult(
|
|
53
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "txid")),
|
|
54
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "amount_sat")),
|
|
55
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "destination_address"))
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const OnchainPaymentResult& arg) {
|
|
59
|
+
jsi::Object obj(runtime);
|
|
60
|
+
obj.setProperty(runtime, "txid", JSIConverter<std::string>::toJSI(runtime, arg.txid));
|
|
61
|
+
obj.setProperty(runtime, "amount_sat", JSIConverter<double>::toJSI(runtime, arg.amount_sat));
|
|
62
|
+
obj.setProperty(runtime, "destination_address", JSIConverter<std::string>::toJSI(runtime, arg.destination_address));
|
|
63
|
+
return obj;
|
|
64
|
+
}
|
|
65
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
66
|
+
if (!value.isObject()) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
jsi::Object obj = value.getObject(runtime);
|
|
70
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "txid"))) return false;
|
|
71
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "amount_sat"))) return false;
|
|
72
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "destination_address"))) return false;
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace margelo::nitro
|
package/package.json
CHANGED
package/src/NitroArk.nitro.ts
CHANGED
|
@@ -40,6 +40,36 @@ export interface BarkSendManyOutput {
|
|
|
40
40
|
amountSat: number; // uint64_t -> number
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
export interface BarkVtxo {
|
|
44
|
+
amount: number; // u64
|
|
45
|
+
expiry_height: number; // u32
|
|
46
|
+
exit_delta: number; // u16
|
|
47
|
+
anchor_point: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface ArkoorPaymentResult {
|
|
51
|
+
amount_sat: number; // u64
|
|
52
|
+
destination_pubkey: string;
|
|
53
|
+
vtxos: BarkVtxo[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface Bolt11PaymentResult {
|
|
57
|
+
bolt11_invoice: string;
|
|
58
|
+
preimage: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface LnurlPaymentResult {
|
|
62
|
+
lnurl: string;
|
|
63
|
+
bolt11_invoice: string;
|
|
64
|
+
preimage: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface OnchainPaymentResult {
|
|
68
|
+
txid: string; // Transaction ID
|
|
69
|
+
amount_sat: number; // Amount in satoshis
|
|
70
|
+
destination_address: string; // Destination address
|
|
71
|
+
}
|
|
72
|
+
|
|
43
73
|
// --- Nitro Module Interface ---
|
|
44
74
|
|
|
45
75
|
export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
@@ -66,9 +96,8 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
66
96
|
// --- Onchain Operations ---
|
|
67
97
|
sendOnchain(
|
|
68
98
|
destination: string,
|
|
69
|
-
amountSat: number
|
|
70
|
-
|
|
71
|
-
): Promise<string>; // Returns txid
|
|
99
|
+
amountSat: number
|
|
100
|
+
): Promise<OnchainPaymentResult>; // Returns txid
|
|
72
101
|
drainOnchain(destination: string, no_sync: boolean): Promise<string>; // Returns txid
|
|
73
102
|
sendManyOnchain(
|
|
74
103
|
outputs: BarkSendManyOutput[],
|
|
@@ -78,9 +107,19 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
78
107
|
// --- Ark & Lightning Payments ---
|
|
79
108
|
boardAmount(amountSat: number): Promise<string>; // Returns JSON status
|
|
80
109
|
boardAll(): Promise<string>; // Returns JSON status
|
|
81
|
-
sendArkoorPayment(
|
|
82
|
-
|
|
83
|
-
|
|
110
|
+
sendArkoorPayment(
|
|
111
|
+
destination: string,
|
|
112
|
+
amountSat: number
|
|
113
|
+
): Promise<ArkoorPaymentResult>;
|
|
114
|
+
sendBolt11Payment(
|
|
115
|
+
destination: string,
|
|
116
|
+
amountSat?: number
|
|
117
|
+
): Promise<Bolt11PaymentResult>;
|
|
118
|
+
sendLnaddr(
|
|
119
|
+
addr: string,
|
|
120
|
+
amountSat: number,
|
|
121
|
+
comment: string
|
|
122
|
+
): Promise<LnurlPaymentResult>;
|
|
84
123
|
sendRoundOnchain(
|
|
85
124
|
destination: string,
|
|
86
125
|
amountSat: number,
|
|
@@ -94,10 +133,9 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
94
133
|
// --- Offboarding / Exiting ---
|
|
95
134
|
offboardSpecific(
|
|
96
135
|
vtxoIds: string[],
|
|
97
|
-
destinationAddress: string
|
|
98
|
-
no_sync: boolean
|
|
136
|
+
destinationAddress: string
|
|
99
137
|
): Promise<string>; // Returns JSON result
|
|
100
|
-
offboardAll(destinationAddress: string
|
|
138
|
+
offboardAll(destinationAddress: string): Promise<string>; // Returns JSON result
|
|
101
139
|
exitStartSpecific(vtxoIds: string[]): Promise<string>;
|
|
102
140
|
exitStartAll(): Promise<string>;
|
|
103
141
|
exitProgressOnce(): Promise<string>;
|
package/src/index.tsx
CHANGED
|
@@ -5,6 +5,10 @@ import type {
|
|
|
5
5
|
BarkConfigOpts,
|
|
6
6
|
BarkArkInfo,
|
|
7
7
|
BarkSendManyOutput,
|
|
8
|
+
ArkoorPaymentResult,
|
|
9
|
+
Bolt11PaymentResult,
|
|
10
|
+
LnurlPaymentResult,
|
|
11
|
+
OnchainPaymentResult,
|
|
8
12
|
} from './NitroArk.nitro';
|
|
9
13
|
|
|
10
14
|
// Create the hybrid object instance
|
|
@@ -160,14 +164,13 @@ export function getVtxos(no_sync: boolean = false): Promise<string> {
|
|
|
160
164
|
* @param destination The destination Bitcoin address.
|
|
161
165
|
* @param amountSat The amount to send in satoshis.
|
|
162
166
|
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
163
|
-
* @returns A promise resolving to the
|
|
167
|
+
* @returns A promise resolving to the OnchainPaymentResult object
|
|
164
168
|
*/
|
|
165
169
|
export function sendOnchain(
|
|
166
170
|
destination: string,
|
|
167
|
-
amountSat: number
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return NitroArkHybridObject.sendOnchain(destination, amountSat, no_sync);
|
|
171
|
+
amountSat: number
|
|
172
|
+
): Promise<OnchainPaymentResult> {
|
|
173
|
+
return NitroArkHybridObject.sendOnchain(destination, amountSat);
|
|
171
174
|
}
|
|
172
175
|
|
|
173
176
|
/**
|
|
@@ -239,12 +242,12 @@ export function boardAll(): Promise<string> {
|
|
|
239
242
|
* Sends an Arkoor payment.
|
|
240
243
|
* @param destination The destination Arkoor address.
|
|
241
244
|
* @param amountSat The amount in satoshis to send.
|
|
242
|
-
* @returns A promise resolving to
|
|
245
|
+
* @returns A promise resolving to the ArkoorPaymentResult object
|
|
243
246
|
*/
|
|
244
247
|
export function sendArkoorPayment(
|
|
245
248
|
destination: string,
|
|
246
249
|
amountSat: number
|
|
247
|
-
): Promise<
|
|
250
|
+
): Promise<ArkoorPaymentResult> {
|
|
248
251
|
return NitroArkHybridObject.sendArkoorPayment(destination, amountSat);
|
|
249
252
|
}
|
|
250
253
|
|
|
@@ -252,12 +255,12 @@ export function sendArkoorPayment(
|
|
|
252
255
|
* Sends a Bolt11 payment.
|
|
253
256
|
* @param destination The Bolt11 invoice.
|
|
254
257
|
* @param amountSat The amount in satoshis to send. Use 0 for invoice amount.
|
|
255
|
-
* @returns A promise resolving to a
|
|
258
|
+
* @returns A promise resolving to a Bolt11PaymentResult object
|
|
256
259
|
*/
|
|
257
260
|
export function sendBolt11Payment(
|
|
258
261
|
destination: string,
|
|
259
262
|
amountSat?: number
|
|
260
|
-
): Promise<
|
|
263
|
+
): Promise<Bolt11PaymentResult> {
|
|
261
264
|
return NitroArkHybridObject.sendBolt11Payment(destination, amountSat);
|
|
262
265
|
}
|
|
263
266
|
|
|
@@ -266,13 +269,13 @@ export function sendBolt11Payment(
|
|
|
266
269
|
* @param addr The Lightning Address.
|
|
267
270
|
* @param amountSat The amount in satoshis to send.
|
|
268
271
|
* @param comment An optional comment.
|
|
269
|
-
* @returns A promise resolving to a
|
|
272
|
+
* @returns A promise resolving to a LnurlPaymentResult object
|
|
270
273
|
*/
|
|
271
274
|
export function sendLnaddr(
|
|
272
275
|
addr: string,
|
|
273
276
|
amountSat: number,
|
|
274
277
|
comment: string
|
|
275
|
-
): Promise<
|
|
278
|
+
): Promise<LnurlPaymentResult> {
|
|
276
279
|
return NitroArkHybridObject.sendLnaddr(addr, amountSat, comment);
|
|
277
280
|
}
|
|
278
281
|
|
|
@@ -302,14 +305,9 @@ export function sendRoundOnchain(
|
|
|
302
305
|
*/
|
|
303
306
|
export function offboardSpecific(
|
|
304
307
|
vtxoIds: string[],
|
|
305
|
-
destinationAddress: string
|
|
306
|
-
no_sync: boolean = false
|
|
308
|
+
destinationAddress: string
|
|
307
309
|
): Promise<string> {
|
|
308
|
-
return NitroArkHybridObject.offboardSpecific(
|
|
309
|
-
vtxoIds,
|
|
310
|
-
destinationAddress,
|
|
311
|
-
no_sync
|
|
312
|
-
);
|
|
310
|
+
return NitroArkHybridObject.offboardSpecific(vtxoIds, destinationAddress);
|
|
313
311
|
}
|
|
314
312
|
|
|
315
313
|
/**
|
|
@@ -318,11 +316,8 @@ export function offboardSpecific(
|
|
|
318
316
|
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
319
317
|
* @returns A promise resolving to a JSON result string.
|
|
320
318
|
*/
|
|
321
|
-
export function offboardAll(
|
|
322
|
-
destinationAddress
|
|
323
|
-
no_sync: boolean = false
|
|
324
|
-
): Promise<string> {
|
|
325
|
-
return NitroArkHybridObject.offboardAll(destinationAddress, no_sync);
|
|
319
|
+
export function offboardAll(destinationAddress: string): Promise<string> {
|
|
320
|
+
return NitroArkHybridObject.offboardAll(destinationAddress);
|
|
326
321
|
}
|
|
327
322
|
|
|
328
323
|
/**
|
|
@@ -357,4 +352,8 @@ export type {
|
|
|
357
352
|
BarkConfigOpts,
|
|
358
353
|
BarkArkInfo,
|
|
359
354
|
BarkSendManyOutput,
|
|
355
|
+
ArkoorPaymentResult,
|
|
356
|
+
Bolt11PaymentResult,
|
|
357
|
+
LnurlPaymentResult,
|
|
358
|
+
OnchainPaymentResult,
|
|
360
359
|
} from './NitroArk.nitro';
|