react-native-nitro-ark 0.0.31 → 0.0.32
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 +50 -26
- package/cpp/generated/ark_cxx.h +53 -5
- package/lib/module/index.js +4 -4
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +25 -5
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +7 -7
- 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 +14 -5
- package/nitrogen/generated/shared/c++/LnurlPaymentResult.hpp +77 -0
- package/package.json +1 -1
- package/src/NitroArk.nitro.ts +39 -6
- package/src/index.tsx +13 -15
package/cpp/NitroArk.hpp
CHANGED
|
@@ -334,46 +334,73 @@ namespace margelo::nitro::nitroark
|
|
|
334
334
|
} });
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
std::shared_ptr<Promise<
|
|
337
|
+
std::shared_ptr<Promise<ArkoorPaymentResult>>
|
|
338
338
|
sendArkoorPayment(const std::string &destination, double amountSat) override
|
|
339
339
|
{
|
|
340
|
-
return Promise<
|
|
341
|
-
|
|
340
|
+
return Promise<ArkoorPaymentResult>::async([destination, amountSat]()
|
|
341
|
+
{
|
|
342
342
|
try {
|
|
343
|
-
|
|
344
|
-
|
|
343
|
+
bark_cxx::ArkoorPaymentResult rust_result = bark_cxx::send_arkoor_payment(destination, static_cast<uint64_t>(amountSat));
|
|
344
|
+
|
|
345
|
+
ArkoorPaymentResult result;
|
|
346
|
+
result.amount_sat = static_cast<double>(rust_result.amount_sat);
|
|
347
|
+
result.destination_pubkey = std::string(rust_result.destination_pubkey.data(), rust_result.destination_pubkey.length());
|
|
348
|
+
|
|
349
|
+
std::vector<BarkVtxo> vtxos;
|
|
350
|
+
for (const auto& rust_vtxo : rust_result.vtxos) {
|
|
351
|
+
BarkVtxo vtxo;
|
|
352
|
+
vtxo.amount = static_cast<double>(rust_vtxo.amount);
|
|
353
|
+
vtxo.expiry_height = static_cast<double>(rust_vtxo.expiry_height);
|
|
354
|
+
vtxo.exit_delta = static_cast<double>(rust_vtxo.exit_delta);
|
|
355
|
+
vtxo.anchor_point = std::string(rust_vtxo.anchor_point.data(), rust_vtxo.anchor_point.length());
|
|
356
|
+
vtxos.push_back(vtxo);
|
|
357
|
+
}
|
|
358
|
+
result.vtxos = vtxos;
|
|
359
|
+
|
|
360
|
+
return result;
|
|
345
361
|
} catch (const rust::Error &e) {
|
|
346
362
|
throw std::runtime_error(e.what());
|
|
347
363
|
} });
|
|
348
364
|
}
|
|
349
365
|
|
|
350
|
-
std::shared_ptr<Promise<
|
|
366
|
+
std::shared_ptr<Promise<Bolt11PaymentResult>>
|
|
351
367
|
sendBolt11Payment(const std::string &destination, std::optional<double> amountSat) override
|
|
352
368
|
{
|
|
353
|
-
return Promise<
|
|
354
|
-
|
|
369
|
+
return Promise<Bolt11PaymentResult>::async([destination, amountSat]()
|
|
370
|
+
{
|
|
355
371
|
try {
|
|
356
|
-
|
|
372
|
+
bark_cxx::Bolt11PaymentResult rust_result;
|
|
357
373
|
if (amountSat.has_value()) {
|
|
358
374
|
uint64_t amountSat_val = static_cast<uint64_t>(amountSat.value());
|
|
359
|
-
|
|
375
|
+
rust_result = bark_cxx::send_bolt11_payment(destination, &amountSat_val);
|
|
360
376
|
} else {
|
|
361
|
-
|
|
377
|
+
rust_result = bark_cxx::send_bolt11_payment(destination, nullptr);
|
|
362
378
|
}
|
|
363
|
-
|
|
379
|
+
|
|
380
|
+
Bolt11PaymentResult result;
|
|
381
|
+
result.bolt11_invoice = std::string(rust_result.bolt11_invoice.data(), rust_result.bolt11_invoice.length());
|
|
382
|
+
result.preimage = std::string(rust_result.preimage.data(), rust_result.preimage.length());
|
|
383
|
+
|
|
384
|
+
return result;
|
|
364
385
|
} catch (const rust::Error &e) {
|
|
365
386
|
throw std::runtime_error(e.what());
|
|
366
387
|
} });
|
|
367
388
|
}
|
|
368
389
|
|
|
369
|
-
std::shared_ptr<Promise<
|
|
390
|
+
std::shared_ptr<Promise<LnurlPaymentResult>>
|
|
370
391
|
sendLnaddr(const std::string &addr, double amountSat, const std::string &comment) override
|
|
371
392
|
{
|
|
372
|
-
return Promise<
|
|
373
|
-
|
|
393
|
+
return Promise<LnurlPaymentResult>::async([addr, amountSat, comment]()
|
|
394
|
+
{
|
|
374
395
|
try {
|
|
375
|
-
|
|
376
|
-
|
|
396
|
+
bark_cxx::LnurlPaymentResult rust_result = bark_cxx::send_lnaddr(addr, static_cast<uint64_t>(amountSat), comment);
|
|
397
|
+
|
|
398
|
+
LnurlPaymentResult result;
|
|
399
|
+
result.lnurl = std::string(rust_result.lnurl.data(), rust_result.lnurl.length());
|
|
400
|
+
result.bolt11_invoice = std::string(rust_result.bolt11_invoice.data(), rust_result.bolt11_invoice.length());
|
|
401
|
+
result.preimage = std::string(rust_result.preimage.data(), rust_result.preimage.length());
|
|
402
|
+
|
|
403
|
+
return result;
|
|
377
404
|
} catch (const rust::Error &e) {
|
|
378
405
|
throw std::runtime_error(e.what());
|
|
379
406
|
} });
|
|
@@ -429,11 +456,10 @@ namespace margelo::nitro::nitroark
|
|
|
429
456
|
|
|
430
457
|
std::shared_ptr<Promise<std::string>>
|
|
431
458
|
offboardSpecific(const std::vector<std::string> &vtxoIds,
|
|
432
|
-
const std::string &destinationAddress
|
|
433
|
-
bool no_sync) override
|
|
459
|
+
const std::string &destinationAddress) override
|
|
434
460
|
{
|
|
435
461
|
return Promise<std::string>::async(
|
|
436
|
-
[vtxoIds, destinationAddress
|
|
462
|
+
[vtxoIds, destinationAddress]()
|
|
437
463
|
{
|
|
438
464
|
try
|
|
439
465
|
{
|
|
@@ -442,7 +468,7 @@ namespace margelo::nitro::nitroark
|
|
|
442
468
|
{
|
|
443
469
|
rust_vtxo_ids.push_back(rust::String(id));
|
|
444
470
|
}
|
|
445
|
-
rust::String status_rs = bark_cxx::offboard_specific(std::move(rust_vtxo_ids), destinationAddress
|
|
471
|
+
rust::String status_rs = bark_cxx::offboard_specific(std::move(rust_vtxo_ids), destinationAddress);
|
|
446
472
|
return std::string(status_rs.data(), status_rs.length());
|
|
447
473
|
}
|
|
448
474
|
catch (const rust::Error &e)
|
|
@@ -453,14 +479,12 @@ namespace margelo::nitro::nitroark
|
|
|
453
479
|
}
|
|
454
480
|
|
|
455
481
|
std::shared_ptr<Promise<std::string>>
|
|
456
|
-
offboardAll(const std::string &destinationAddress
|
|
457
|
-
bool no_sync) override
|
|
482
|
+
offboardAll(const std::string &destinationAddress) override
|
|
458
483
|
{
|
|
459
|
-
return Promise<std::string>::async([destinationAddress
|
|
460
|
-
no_sync]()
|
|
484
|
+
return Promise<std::string>::async([destinationAddress]()
|
|
461
485
|
{
|
|
462
486
|
try {
|
|
463
|
-
rust::String status_rs = bark_cxx::offboard_all(destinationAddress
|
|
487
|
+
rust::String status_rs = bark_cxx::offboard_all(destinationAddress);
|
|
464
488
|
return std::string(status_rs.data(), status_rs.length());
|
|
465
489
|
} catch (const rust::Error &e) {
|
|
466
490
|
throw std::runtime_error(e.what());
|
package/cpp/generated/ark_cxx.h
CHANGED
|
@@ -797,6 +797,10 @@ 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;
|
|
800
804
|
struct CxxArkInfo;
|
|
801
805
|
struct ConfigOpts;
|
|
802
806
|
struct CreateOpts;
|
|
@@ -805,6 +809,50 @@ namespace bark_cxx {
|
|
|
805
809
|
}
|
|
806
810
|
|
|
807
811
|
namespace bark_cxx {
|
|
812
|
+
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$BarkVtxo
|
|
813
|
+
#define CXXBRIDGE1_STRUCT_bark_cxx$BarkVtxo
|
|
814
|
+
struct BarkVtxo final {
|
|
815
|
+
::std::uint64_t amount CXX_DEFAULT_VALUE(0);
|
|
816
|
+
::std::uint32_t expiry_height CXX_DEFAULT_VALUE(0);
|
|
817
|
+
::std::uint16_t exit_delta CXX_DEFAULT_VALUE(0);
|
|
818
|
+
::rust::String anchor_point;
|
|
819
|
+
|
|
820
|
+
using IsRelocatable = ::std::true_type;
|
|
821
|
+
};
|
|
822
|
+
#endif // CXXBRIDGE1_STRUCT_bark_cxx$BarkVtxo
|
|
823
|
+
|
|
824
|
+
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$Bolt11PaymentResult
|
|
825
|
+
#define CXXBRIDGE1_STRUCT_bark_cxx$Bolt11PaymentResult
|
|
826
|
+
struct Bolt11PaymentResult final {
|
|
827
|
+
::rust::String bolt11_invoice;
|
|
828
|
+
::rust::String preimage;
|
|
829
|
+
|
|
830
|
+
using IsRelocatable = ::std::true_type;
|
|
831
|
+
};
|
|
832
|
+
#endif // CXXBRIDGE1_STRUCT_bark_cxx$Bolt11PaymentResult
|
|
833
|
+
|
|
834
|
+
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$LnurlPaymentResult
|
|
835
|
+
#define CXXBRIDGE1_STRUCT_bark_cxx$LnurlPaymentResult
|
|
836
|
+
struct LnurlPaymentResult final {
|
|
837
|
+
::rust::String lnurl;
|
|
838
|
+
::rust::String bolt11_invoice;
|
|
839
|
+
::rust::String preimage;
|
|
840
|
+
|
|
841
|
+
using IsRelocatable = ::std::true_type;
|
|
842
|
+
};
|
|
843
|
+
#endif // CXXBRIDGE1_STRUCT_bark_cxx$LnurlPaymentResult
|
|
844
|
+
|
|
845
|
+
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$ArkoorPaymentResult
|
|
846
|
+
#define CXXBRIDGE1_STRUCT_bark_cxx$ArkoorPaymentResult
|
|
847
|
+
struct ArkoorPaymentResult final {
|
|
848
|
+
::std::uint64_t amount_sat CXX_DEFAULT_VALUE(0);
|
|
849
|
+
::rust::String destination_pubkey;
|
|
850
|
+
::rust::Vec<::bark_cxx::BarkVtxo> vtxos;
|
|
851
|
+
|
|
852
|
+
using IsRelocatable = ::std::true_type;
|
|
853
|
+
};
|
|
854
|
+
#endif // CXXBRIDGE1_STRUCT_bark_cxx$ArkoorPaymentResult
|
|
855
|
+
|
|
808
856
|
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$CxxArkInfo
|
|
809
857
|
#define CXXBRIDGE1_STRUCT_bark_cxx$CxxArkInfo
|
|
810
858
|
struct CxxArkInfo final {
|
|
@@ -920,17 +968,17 @@ void load_wallet(::rust::Str datadir, ::bark_cxx::CreateOpts opts);
|
|
|
920
968
|
|
|
921
969
|
::rust::String board_all();
|
|
922
970
|
|
|
923
|
-
::
|
|
971
|
+
::bark_cxx::ArkoorPaymentResult send_arkoor_payment(::rust::Str destination, ::std::uint64_t amount_sat);
|
|
924
972
|
|
|
925
|
-
::
|
|
973
|
+
::bark_cxx::Bolt11PaymentResult send_bolt11_payment(::rust::Str destination, ::std::uint64_t const *amount_sat);
|
|
926
974
|
|
|
927
|
-
::
|
|
975
|
+
::bark_cxx::LnurlPaymentResult send_lnaddr(::rust::Str addr, ::std::uint64_t amount_sat, ::rust::Str comment);
|
|
928
976
|
|
|
929
977
|
::rust::String send_round_onchain(::rust::Str destination, ::std::uint64_t amount_sat, bool no_sync);
|
|
930
978
|
|
|
931
|
-
::rust::String offboard_specific(::rust::Vec<::rust::String> vtxo_ids, ::rust::Str destination_address
|
|
979
|
+
::rust::String offboard_specific(::rust::Vec<::rust::String> vtxo_ids, ::rust::Str destination_address);
|
|
932
980
|
|
|
933
|
-
::rust::String offboard_all(::rust::Str destination_address
|
|
981
|
+
::rust::String offboard_all(::rust::Str destination_address);
|
|
934
982
|
|
|
935
983
|
::rust::String start_exit_for_vtxos(::rust::Vec<::rust::String> vtxo_ids);
|
|
936
984
|
|
package/lib/module/index.js
CHANGED
|
@@ -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;AAYzD;AACA,OAAO,MAAMC,oBAAoB,GAC/BD,YAAY,CAACE,kBAAkB,CAAW,UAAU,CAAC;;AAEvD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAoB;EAChD,OAAOF,oBAAoB,CAACE,cAAc,CAAC,CAAC;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CACxBC,OAAe,EACfC,IAAoB,EACL;EACf,OAAOL,oBAAoB,CAACG,UAAU,CAACC,OAAO,EAAEC,IAAI,CAAC;AACvD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAA,EAAkB;EAC3C,OAAON,oBAAoB,CAACM,WAAW,CAAC,CAAC;AAC3C;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAqB;EACjD,OAAOP,oBAAoB,CAACO,cAAc,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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,26 @@ 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
|
+
}
|
|
33
53
|
export interface NitroArk extends HybridObject<{
|
|
34
54
|
ios: 'c++';
|
|
35
55
|
android: 'c++';
|
|
@@ -55,14 +75,14 @@ export interface NitroArk extends HybridObject<{
|
|
|
55
75
|
sendManyOnchain(outputs: BarkSendManyOutput[], no_sync: boolean): Promise<string>;
|
|
56
76
|
boardAmount(amountSat: number): Promise<string>;
|
|
57
77
|
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<
|
|
78
|
+
sendArkoorPayment(destination: string, amountSat: number): Promise<ArkoorPaymentResult>;
|
|
79
|
+
sendBolt11Payment(destination: string, amountSat?: number): Promise<Bolt11PaymentResult>;
|
|
80
|
+
sendLnaddr(addr: string, amountSat: number, comment: string): Promise<LnurlPaymentResult>;
|
|
61
81
|
sendRoundOnchain(destination: string, amountSat: number, no_sync: boolean): Promise<string>;
|
|
62
82
|
bolt11Invoice(amountMsat: number): Promise<string>;
|
|
63
83
|
claimBolt11Payment(bolt11: string): Promise<void>;
|
|
64
|
-
offboardSpecific(vtxoIds: string[], destinationAddress: string
|
|
65
|
-
offboardAll(destinationAddress: string
|
|
84
|
+
offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<string>;
|
|
85
|
+
offboardAll(destinationAddress: string): Promise<string>;
|
|
66
86
|
exitStartSpecific(vtxoIds: string[]): Promise<string>;
|
|
67
87
|
exitStartAll(): Promise<string>;
|
|
68
88
|
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,O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roArk.nitro';
|
|
1
|
+
import type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput, ArkoorPaymentResult, Bolt11PaymentResult, LnurlPaymentResult } from './NitroArk.nitro';
|
|
2
2
|
export declare const NitroArkHybridObject: NitroArk;
|
|
3
3
|
/**
|
|
4
4
|
* Creates a new BIP39 mnemonic phrase.
|
|
@@ -138,14 +138,14 @@ export declare function boardAll(): Promise<string>;
|
|
|
138
138
|
* @param amountSat The amount in satoshis to send.
|
|
139
139
|
* @returns A promise resolving to a result string.
|
|
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
146
|
* @returns A promise resolving to a result string.
|
|
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.
|
|
@@ -153,7 +153,7 @@ export declare function sendBolt11Payment(destination: string, amountSat?: numbe
|
|
|
153
153
|
* @param comment An optional comment.
|
|
154
154
|
* @returns A promise resolving to a result string.
|
|
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, } 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;;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AO,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,GACnB,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
|
|
@@ -21,6 +21,12 @@ namespace margelo::nitro::nitroark { struct BarkConfigOpts; }
|
|
|
21
21
|
namespace margelo::nitro::nitroark { struct BarkArkInfo; }
|
|
22
22
|
// Forward declaration of `BarkSendManyOutput` to properly resolve imports.
|
|
23
23
|
namespace margelo::nitro::nitroark { struct BarkSendManyOutput; }
|
|
24
|
+
// Forward declaration of `ArkoorPaymentResult` to properly resolve imports.
|
|
25
|
+
namespace margelo::nitro::nitroark { struct ArkoorPaymentResult; }
|
|
26
|
+
// Forward declaration of `Bolt11PaymentResult` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::nitroark { struct Bolt11PaymentResult; }
|
|
28
|
+
// Forward declaration of `LnurlPaymentResult` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::nitroark { struct LnurlPaymentResult; }
|
|
24
30
|
|
|
25
31
|
#include <NitroModules/Promise.hpp>
|
|
26
32
|
#include <string>
|
|
@@ -30,6 +36,9 @@ namespace margelo::nitro::nitroark { struct BarkSendManyOutput; }
|
|
|
30
36
|
#include <optional>
|
|
31
37
|
#include <vector>
|
|
32
38
|
#include "BarkSendManyOutput.hpp"
|
|
39
|
+
#include "ArkoorPaymentResult.hpp"
|
|
40
|
+
#include "Bolt11PaymentResult.hpp"
|
|
41
|
+
#include "LnurlPaymentResult.hpp"
|
|
33
42
|
|
|
34
43
|
namespace margelo::nitro::nitroark {
|
|
35
44
|
|
|
@@ -83,14 +92,14 @@ namespace margelo::nitro::nitroark {
|
|
|
83
92
|
virtual std::shared_ptr<Promise<std::string>> sendManyOnchain(const std::vector<BarkSendManyOutput>& outputs, bool no_sync) = 0;
|
|
84
93
|
virtual std::shared_ptr<Promise<std::string>> boardAmount(double amountSat) = 0;
|
|
85
94
|
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<
|
|
95
|
+
virtual std::shared_ptr<Promise<ArkoorPaymentResult>> sendArkoorPayment(const std::string& destination, double amountSat) = 0;
|
|
96
|
+
virtual std::shared_ptr<Promise<Bolt11PaymentResult>> sendBolt11Payment(const std::string& destination, std::optional<double> amountSat) = 0;
|
|
97
|
+
virtual std::shared_ptr<Promise<LnurlPaymentResult>> sendLnaddr(const std::string& addr, double amountSat, const std::string& comment) = 0;
|
|
89
98
|
virtual std::shared_ptr<Promise<std::string>> sendRoundOnchain(const std::string& destination, double amountSat, bool no_sync) = 0;
|
|
90
99
|
virtual std::shared_ptr<Promise<std::string>> bolt11Invoice(double amountMsat) = 0;
|
|
91
100
|
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
|
|
101
|
+
virtual std::shared_ptr<Promise<std::string>> offboardSpecific(const std::vector<std::string>& vtxoIds, const std::string& destinationAddress) = 0;
|
|
102
|
+
virtual std::shared_ptr<Promise<std::string>> offboardAll(const std::string& destinationAddress) = 0;
|
|
94
103
|
virtual std::shared_ptr<Promise<std::string>> exitStartSpecific(const std::vector<std::string>& vtxoIds) = 0;
|
|
95
104
|
virtual std::shared_ptr<Promise<std::string>> exitStartAll() = 0;
|
|
96
105
|
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
|
package/package.json
CHANGED
package/src/NitroArk.nitro.ts
CHANGED
|
@@ -40,6 +40,30 @@ 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
|
+
|
|
43
67
|
// --- Nitro Module Interface ---
|
|
44
68
|
|
|
45
69
|
export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
@@ -78,9 +102,19 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
78
102
|
// --- Ark & Lightning Payments ---
|
|
79
103
|
boardAmount(amountSat: number): Promise<string>; // Returns JSON status
|
|
80
104
|
boardAll(): Promise<string>; // Returns JSON status
|
|
81
|
-
sendArkoorPayment(
|
|
82
|
-
|
|
83
|
-
|
|
105
|
+
sendArkoorPayment(
|
|
106
|
+
destination: string,
|
|
107
|
+
amountSat: number
|
|
108
|
+
): Promise<ArkoorPaymentResult>;
|
|
109
|
+
sendBolt11Payment(
|
|
110
|
+
destination: string,
|
|
111
|
+
amountSat?: number
|
|
112
|
+
): Promise<Bolt11PaymentResult>;
|
|
113
|
+
sendLnaddr(
|
|
114
|
+
addr: string,
|
|
115
|
+
amountSat: number,
|
|
116
|
+
comment: string
|
|
117
|
+
): Promise<LnurlPaymentResult>;
|
|
84
118
|
sendRoundOnchain(
|
|
85
119
|
destination: string,
|
|
86
120
|
amountSat: number,
|
|
@@ -94,10 +128,9 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
94
128
|
// --- Offboarding / Exiting ---
|
|
95
129
|
offboardSpecific(
|
|
96
130
|
vtxoIds: string[],
|
|
97
|
-
destinationAddress: string
|
|
98
|
-
no_sync: boolean
|
|
131
|
+
destinationAddress: string
|
|
99
132
|
): Promise<string>; // Returns JSON result
|
|
100
|
-
offboardAll(destinationAddress: string
|
|
133
|
+
offboardAll(destinationAddress: string): Promise<string>; // Returns JSON result
|
|
101
134
|
exitStartSpecific(vtxoIds: string[]): Promise<string>;
|
|
102
135
|
exitStartAll(): Promise<string>;
|
|
103
136
|
exitProgressOnce(): Promise<string>;
|
package/src/index.tsx
CHANGED
|
@@ -5,6 +5,9 @@ import type {
|
|
|
5
5
|
BarkConfigOpts,
|
|
6
6
|
BarkArkInfo,
|
|
7
7
|
BarkSendManyOutput,
|
|
8
|
+
ArkoorPaymentResult,
|
|
9
|
+
Bolt11PaymentResult,
|
|
10
|
+
LnurlPaymentResult,
|
|
8
11
|
} from './NitroArk.nitro';
|
|
9
12
|
|
|
10
13
|
// Create the hybrid object instance
|
|
@@ -244,7 +247,7 @@ export function boardAll(): Promise<string> {
|
|
|
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
|
|
|
@@ -257,7 +260,7 @@ export function sendArkoorPayment(
|
|
|
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
|
|
|
@@ -272,7 +275,7 @@ 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,7 @@ export type {
|
|
|
357
352
|
BarkConfigOpts,
|
|
358
353
|
BarkArkInfo,
|
|
359
354
|
BarkSendManyOutput,
|
|
355
|
+
ArkoorPaymentResult,
|
|
356
|
+
Bolt11PaymentResult,
|
|
357
|
+
LnurlPaymentResult,
|
|
360
358
|
} from './NitroArk.nitro';
|