react-native-nitro-ark 0.0.63 → 0.0.65
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 +24 -54
- package/cpp/generated/ark_cxx.h +23 -10
- package/lib/module/index.js +14 -25
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +16 -9
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +14 -22
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/shared/c++/BarkArkInfo.hpp +25 -13
- package/nitrogen/generated/shared/c++/Bolt11Invoice.hpp +75 -0
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +3 -4
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +8 -6
- package/package.json +1 -1
- package/src/NitroArk.nitro.ts +17 -12
- package/src/index.tsx +21 -41
package/cpp/NitroArk.hpp
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
#include <memory>
|
|
7
7
|
#include <stdexcept>
|
|
8
8
|
#include <string>
|
|
9
|
+
#include <sys/wait.h>
|
|
9
10
|
#include <vector>
|
|
10
11
|
|
|
11
12
|
namespace margelo::nitro::nitroark {
|
|
@@ -154,10 +155,10 @@ public:
|
|
|
154
155
|
return Promise<bool>::async([]() { return bark_cxx::is_wallet_loaded(); });
|
|
155
156
|
}
|
|
156
157
|
|
|
157
|
-
std::shared_ptr<Promise<void>>
|
|
158
|
+
std::shared_ptr<Promise<void>> syncPendingBoards() override {
|
|
158
159
|
return Promise<void>::async([]() {
|
|
159
160
|
try {
|
|
160
|
-
bark_cxx::
|
|
161
|
+
bark_cxx::sync_pending_boards();
|
|
161
162
|
} catch (const rust::Error& e) {
|
|
162
163
|
throw std::runtime_error(e.what());
|
|
163
164
|
}
|
|
@@ -233,11 +234,14 @@ public:
|
|
|
233
234
|
BarkArkInfo info;
|
|
234
235
|
info.network = std::string(rust_info.network.data(), rust_info.network.length());
|
|
235
236
|
info.server_pubkey = std::string(rust_info.server_pubkey.data(), rust_info.server_pubkey.length());
|
|
236
|
-
info.
|
|
237
|
+
info.round_interval = static_cast<double>(rust_info.round_interval);
|
|
238
|
+
info.nb_round_nonces = static_cast<double>(rust_info.nb_round_nonces);
|
|
237
239
|
info.vtxo_exit_delta = static_cast<double>(rust_info.vtxo_exit_delta);
|
|
238
240
|
info.vtxo_expiry_delta = static_cast<double>(rust_info.vtxo_expiry_delta);
|
|
239
|
-
info.
|
|
240
|
-
info.
|
|
241
|
+
info.htlc_send_expiry_delta = static_cast<double>(rust_info.htlc_send_expiry_delta);
|
|
242
|
+
info.max_vtxo_amount = static_cast<double>(rust_info.max_vtxo_amount);
|
|
243
|
+
info.max_arkoor_depth = static_cast<double>(rust_info.max_arkoor_depth);
|
|
244
|
+
info.required_board_confirmations = static_cast<double>(rust_info.required_board_confirmations);
|
|
241
245
|
return info;
|
|
242
246
|
} catch (const rust::Error& e) {
|
|
243
247
|
throw std::runtime_error(e.what());
|
|
@@ -361,11 +365,10 @@ public:
|
|
|
361
365
|
});
|
|
362
366
|
}
|
|
363
367
|
|
|
364
|
-
std::shared_ptr<Promise<std::vector<BarkMovement>>> movements(
|
|
365
|
-
return Promise<std::vector<BarkMovement>>::async([
|
|
368
|
+
std::shared_ptr<Promise<std::vector<BarkMovement>>> movements() override {
|
|
369
|
+
return Promise<std::vector<BarkMovement>>::async([]() {
|
|
366
370
|
try {
|
|
367
|
-
rust::Vec<bark_cxx::BarkMovement> movements_rs =
|
|
368
|
-
bark_cxx::movements(static_cast<uint16_t>(pageIndex), static_cast<uint16_t>(pageSize));
|
|
371
|
+
rust::Vec<bark_cxx::BarkMovement> movements_rs = bark_cxx::movements();
|
|
369
372
|
|
|
370
373
|
std::vector<BarkMovement> movements;
|
|
371
374
|
movements.reserve(movements_rs.size());
|
|
@@ -656,31 +659,33 @@ public:
|
|
|
656
659
|
});
|
|
657
660
|
}
|
|
658
661
|
|
|
659
|
-
std::shared_ptr<Promise<
|
|
660
|
-
return Promise<
|
|
662
|
+
std::shared_ptr<Promise<Bolt11Invoice>> bolt11Invoice(double amountMsat) override {
|
|
663
|
+
return Promise<Bolt11Invoice>::async([amountMsat]() {
|
|
661
664
|
try {
|
|
662
|
-
|
|
663
|
-
return std::string(invoice_rs.data(), invoice_rs.length())
|
|
665
|
+
bark_cxx::Bolt11Invoice invoice_rs = bark_cxx::bolt11_invoice(static_cast<uint64_t>(amountMsat));
|
|
666
|
+
return Bolt11Invoice(std::string(invoice_rs.bolt11_invoice.data(), invoice_rs.bolt11_invoice.length()),
|
|
667
|
+
std::string(invoice_rs.payment_secret.data(), invoice_rs.payment_secret.length()),
|
|
668
|
+
std::string(invoice_rs.payment_hash.data(), invoice_rs.payment_hash.length()));
|
|
664
669
|
} catch (const rust::Error& e) {
|
|
665
670
|
throw std::runtime_error(e.what());
|
|
666
671
|
}
|
|
667
672
|
});
|
|
668
673
|
}
|
|
669
674
|
|
|
670
|
-
std::shared_ptr<Promise<void>>
|
|
671
|
-
return Promise<void>::async([
|
|
675
|
+
std::shared_ptr<Promise<void>> checkAndClaimLnReceive(const std::string& paymentHash, bool wait) override {
|
|
676
|
+
return Promise<void>::async([paymentHash, wait]() {
|
|
672
677
|
try {
|
|
673
|
-
bark_cxx::
|
|
678
|
+
bark_cxx::check_and_claim_ln_receive(paymentHash, wait);
|
|
674
679
|
} catch (const rust::Error& e) {
|
|
675
680
|
throw std::runtime_error(e.what());
|
|
676
681
|
}
|
|
677
682
|
});
|
|
678
683
|
}
|
|
679
684
|
|
|
680
|
-
std::shared_ptr<Promise<void>>
|
|
681
|
-
return Promise<void>::async([]() {
|
|
685
|
+
std::shared_ptr<Promise<void>> checkAndClaimAllOpenLnReceives(bool wait) override {
|
|
686
|
+
return Promise<void>::async([wait]() {
|
|
682
687
|
try {
|
|
683
|
-
bark_cxx::
|
|
688
|
+
bark_cxx::check_and_claim_all_open_ln_receives(wait);
|
|
684
689
|
} catch (const rust::Error& e) {
|
|
685
690
|
throw std::runtime_error(e.what());
|
|
686
691
|
}
|
|
@@ -718,42 +723,7 @@ public:
|
|
|
718
723
|
});
|
|
719
724
|
}
|
|
720
725
|
|
|
721
|
-
std::shared_ptr<Promise<std::vector<LightningReceive>>> lightningReceives(double pageSize,
|
|
722
|
-
double pageIndex) override {
|
|
723
|
-
return Promise<std::vector<LightningReceive>>::async([pageSize, pageIndex]() {
|
|
724
|
-
try {
|
|
725
|
-
rust::Vec<bark_cxx::LightningReceive> receives_rs =
|
|
726
|
-
bark_cxx::lightning_receives(static_cast<uint16_t>(pageIndex), static_cast<uint16_t>(pageSize));
|
|
727
|
-
|
|
728
|
-
std::vector<LightningReceive> receives;
|
|
729
|
-
receives.reserve(receives_rs.size());
|
|
730
|
-
|
|
731
|
-
for (const auto& receive_rs : receives_rs) {
|
|
732
|
-
LightningReceive receive;
|
|
733
|
-
receive.payment_hash = std::string(receive_rs.payment_hash.data(), receive_rs.payment_hash.length());
|
|
734
|
-
receive.payment_preimage =
|
|
735
|
-
std::string(receive_rs.payment_preimage.data(), receive_rs.payment_preimage.length());
|
|
736
|
-
receive.invoice = std::string(receive_rs.invoice.data(), receive_rs.invoice.length());
|
|
737
|
-
|
|
738
|
-
if (receive_rs.preimage_revealed_at != nullptr) {
|
|
739
|
-
receive.preimage_revealed_at = static_cast<double>(*receive_rs.preimage_revealed_at);
|
|
740
|
-
delete receive_rs.preimage_revealed_at;
|
|
741
|
-
} else {
|
|
742
|
-
receive.preimage_revealed_at = std::nullopt;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
receives.push_back(std::move(receive));
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
return receives;
|
|
749
|
-
} catch (const rust::Error& e) {
|
|
750
|
-
throw std::runtime_error(e.what());
|
|
751
|
-
}
|
|
752
|
-
});
|
|
753
|
-
}
|
|
754
|
-
|
|
755
726
|
// --- Ark Operations ---
|
|
756
|
-
|
|
757
727
|
std::shared_ptr<Promise<std::string>> boardAmount(double amountSat) override {
|
|
758
728
|
return Promise<std::string>::async([amountSat]() {
|
|
759
729
|
try {
|
package/cpp/generated/ark_cxx.h
CHANGED
|
@@ -805,6 +805,7 @@ namespace bark_cxx {
|
|
|
805
805
|
struct BarkVtxo;
|
|
806
806
|
enum class PaymentTypes : ::std::uint8_t;
|
|
807
807
|
struct NewAddressResult;
|
|
808
|
+
struct Bolt11Invoice;
|
|
808
809
|
struct Bolt11PaymentResult;
|
|
809
810
|
struct Bolt12PaymentResult;
|
|
810
811
|
struct LnurlPaymentResult;
|
|
@@ -861,6 +862,17 @@ struct NewAddressResult final {
|
|
|
861
862
|
};
|
|
862
863
|
#endif // CXXBRIDGE1_STRUCT_bark_cxx$NewAddressResult
|
|
863
864
|
|
|
865
|
+
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$Bolt11Invoice
|
|
866
|
+
#define CXXBRIDGE1_STRUCT_bark_cxx$Bolt11Invoice
|
|
867
|
+
struct Bolt11Invoice final {
|
|
868
|
+
::rust::String bolt11_invoice;
|
|
869
|
+
::rust::String payment_secret;
|
|
870
|
+
::rust::String payment_hash;
|
|
871
|
+
|
|
872
|
+
using IsRelocatable = ::std::true_type;
|
|
873
|
+
};
|
|
874
|
+
#endif // CXXBRIDGE1_STRUCT_bark_cxx$Bolt11Invoice
|
|
875
|
+
|
|
864
876
|
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$Bolt11PaymentResult
|
|
865
877
|
#define CXXBRIDGE1_STRUCT_bark_cxx$Bolt11PaymentResult
|
|
866
878
|
struct Bolt11PaymentResult final {
|
|
@@ -924,11 +936,14 @@ struct OnchainPaymentResult final {
|
|
|
924
936
|
struct CxxArkInfo final {
|
|
925
937
|
::rust::String network;
|
|
926
938
|
::rust::String server_pubkey;
|
|
927
|
-
::std::uint64_t
|
|
939
|
+
::std::uint64_t round_interval CXX_DEFAULT_VALUE(0);
|
|
940
|
+
::std::uint16_t nb_round_nonces CXX_DEFAULT_VALUE(0);
|
|
928
941
|
::std::uint16_t vtxo_exit_delta CXX_DEFAULT_VALUE(0);
|
|
929
942
|
::std::uint16_t vtxo_expiry_delta CXX_DEFAULT_VALUE(0);
|
|
930
|
-
::std::uint16_t
|
|
931
|
-
::std::uint64_t
|
|
943
|
+
::std::uint16_t htlc_send_expiry_delta CXX_DEFAULT_VALUE(0);
|
|
944
|
+
::std::uint64_t max_vtxo_amount CXX_DEFAULT_VALUE(0);
|
|
945
|
+
::std::uint16_t max_arkoor_depth CXX_DEFAULT_VALUE(0);
|
|
946
|
+
::std::uint8_t required_board_confirmations CXX_DEFAULT_VALUE(0);
|
|
932
947
|
|
|
933
948
|
using IsRelocatable = ::std::true_type;
|
|
934
949
|
};
|
|
@@ -1093,7 +1108,7 @@ void close_wallet();
|
|
|
1093
1108
|
|
|
1094
1109
|
bool verify_message(::rust::Str message, ::rust::Str signature, ::rust::Str public_key);
|
|
1095
1110
|
|
|
1096
|
-
::rust::Vec<::bark_cxx::BarkMovement> movements(
|
|
1111
|
+
::rust::Vec<::bark_cxx::BarkMovement> movements();
|
|
1097
1112
|
|
|
1098
1113
|
::rust::Vec<::bark_cxx::BarkVtxo> vtxos();
|
|
1099
1114
|
|
|
@@ -1103,13 +1118,11 @@ bool verify_message(::rust::Str message, ::rust::Str signature, ::rust::Str publ
|
|
|
1103
1118
|
|
|
1104
1119
|
::std::uint32_t const *get_next_required_refresh_blockheight();
|
|
1105
1120
|
|
|
1106
|
-
::
|
|
1121
|
+
::bark_cxx::Bolt11Invoice bolt11_invoice(::std::uint64_t amount_msat);
|
|
1107
1122
|
|
|
1108
1123
|
::bark_cxx::LightningReceive const *lightning_receive_status(::rust::String payment_hash);
|
|
1109
1124
|
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
void register_all_confirmed_boards();
|
|
1125
|
+
void sync_pending_boards();
|
|
1113
1126
|
|
|
1114
1127
|
void maintenance();
|
|
1115
1128
|
|
|
@@ -1145,9 +1158,9 @@ void validate_arkoor_address(::rust::Str address);
|
|
|
1145
1158
|
|
|
1146
1159
|
::rust::String offboard_all(::rust::Str destination_address);
|
|
1147
1160
|
|
|
1148
|
-
void
|
|
1161
|
+
void check_and_claim_ln_receive(::rust::String payment_hash, bool wait);
|
|
1149
1162
|
|
|
1150
|
-
void
|
|
1163
|
+
void check_and_claim_all_open_ln_receives(bool wait);
|
|
1151
1164
|
|
|
1152
1165
|
void sync_exits();
|
|
1153
1166
|
|
package/lib/module/index.js
CHANGED
|
@@ -52,11 +52,11 @@ export function isWalletLoaded() {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* Registers all confirmed boards.
|
|
55
|
+
* Registers all confirmed boards with the server.
|
|
56
56
|
* @returns A promise that resolves on success.
|
|
57
57
|
*/
|
|
58
|
-
export function
|
|
59
|
-
return NitroArkHybridObject.
|
|
58
|
+
export function syncPendingBoards() {
|
|
59
|
+
return NitroArkHybridObject.syncPendingBoards();
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -199,12 +199,10 @@ export function verifyMessage(message, signature, publicKey) {
|
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
201
|
* Gets a paginated list of wallet movements (balance changes).
|
|
202
|
-
* @param pageIndex The index of the page to retrieve (0-based).
|
|
203
|
-
* @param pageSize The number of movements per page.
|
|
204
202
|
* @returns A promise resolving to an array of BarkMovement objects.
|
|
205
203
|
*/
|
|
206
|
-
export function movements(
|
|
207
|
-
return NitroArkHybridObject.movements(
|
|
204
|
+
export function movements() {
|
|
205
|
+
return NitroArkHybridObject.movements();
|
|
208
206
|
}
|
|
209
207
|
|
|
210
208
|
/**
|
|
@@ -317,7 +315,7 @@ export function onchainSendMany(outputs) {
|
|
|
317
315
|
/**
|
|
318
316
|
* Creates a Bolt 11 invoice.
|
|
319
317
|
* @param amountMsat The amount in millisatoshis for the invoice.
|
|
320
|
-
* @returns A promise resolving to
|
|
318
|
+
* @returns A promise resolving to Bolt11Invoice object.
|
|
321
319
|
*/
|
|
322
320
|
export function bolt11Invoice(amountMsat) {
|
|
323
321
|
return NitroArkHybridObject.bolt11Invoice(amountMsat);
|
|
@@ -333,30 +331,21 @@ export function lightningReceiveStatus(paymentHash) {
|
|
|
333
331
|
}
|
|
334
332
|
|
|
335
333
|
/**
|
|
336
|
-
*
|
|
337
|
-
* @param
|
|
338
|
-
* @param pageIndex The index of the page to retrieve.
|
|
339
|
-
* @returns A promise resolving to an array of Lightning receives.
|
|
340
|
-
*/
|
|
341
|
-
export function lightningReceives(pageSize, pageIndex) {
|
|
342
|
-
return NitroArkHybridObject.lightningReceives(pageSize, pageIndex);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Claims a Lightning payment.
|
|
347
|
-
* @param bolt11 The Lightning invoice string to claim.
|
|
334
|
+
* Checks and claims a Lightning payment.
|
|
335
|
+
* @param paymentHash The payment hash of the Lightning payment.
|
|
348
336
|
* @returns A promise that resolves on success or rejects on error.
|
|
349
337
|
*/
|
|
350
|
-
export function
|
|
351
|
-
return NitroArkHybridObject.
|
|
338
|
+
export function checkAndClaimLnReceive(paymentHash, wait) {
|
|
339
|
+
return NitroArkHybridObject.checkAndClaimLnReceive(paymentHash, wait);
|
|
352
340
|
}
|
|
353
341
|
|
|
354
342
|
/**
|
|
355
|
-
*
|
|
343
|
+
* Checks and claims all open Lightning receives.
|
|
344
|
+
* @param wait Whether to wait for the claim to complete.
|
|
356
345
|
* @returns A promise that resolves on success or rejects on error.
|
|
357
346
|
*/
|
|
358
|
-
export function
|
|
359
|
-
return NitroArkHybridObject.
|
|
347
|
+
export function checkAndClaimAllOpenLnReceives(wait) {
|
|
348
|
+
return NitroArkHybridObject.checkAndClaimAllOpenLnReceives(wait);
|
|
360
349
|
}
|
|
361
350
|
|
|
362
351
|
/**
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NitroModules","NitroArkHybridObject","createHybridObject","createMnemonic","createWallet","datadir","opts","loadWallet","config","closeWallet","isWalletLoaded","
|
|
1
|
+
{"version":3,"names":["NitroModules","NitroArkHybridObject","createHybridObject","createMnemonic","createWallet","datadir","opts","loadWallet","config","closeWallet","isWalletLoaded","syncPendingBoards","maintenance","maintenanceWithOnchain","maintenanceRefresh","sync","syncExits","syncPastRounds","getArkInfo","offchainBalance","deriveStoreNextKeypair","peakKeyPair","index","newAddress","signMessage","message","signMesssageWithMnemonic","mnemonic","network","deriveKeypairFromMnemonic","verifyMessage","signature","publicKey","movements","vtxos","getFirstExpiringVtxoBlockheight","getNextRequiredRefreshBlockheight","getExpiringVtxos","threshold","onchainBalance","onchainSync","onchainListUnspent","onchainUtxos","onchainAddress","onchainSend","destination","amountSat","onchainDrain","onchainSendMany","outputs","bolt11Invoice","amountMsat","lightningReceiveStatus","paymentHash","checkAndClaimLnReceive","wait","checkAndClaimAllOpenLnReceives","sendLightningPayment","payOffer","offer","sendLnaddr","addr","comment","boardAmount","boardAll","validateArkoorAddress","address","sendArkoorPayment","sendRoundOnchainPayment","offboardSpecific","vtxoIds","destinationAddress","offboardAll"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAqDzD;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,OAAO,SAASC,YAAYA,CAC1BC,OAAe,EACfC,IAAoB,EACL;EACf,OAAOL,oBAAoB,CAACG,YAAY,CAACC,OAAO,EAAEC,IAAI,CAAC;AACzD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CACxBF,OAAe,EACfG,MAAsB,EACP;EACf,OAAO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,OAAO,SAASC,WAAWA,CAACD,kBAA0B,EAAmB;EACvE,OAAOtE,oBAAoB,CAACuE,WAAW,CAACD,kBAAkB,CAAC;AAC7D;;AAEA","ignoreList":[]}
|
|
@@ -20,11 +20,14 @@ export interface BarkCreateOpts {
|
|
|
20
20
|
export interface BarkArkInfo {
|
|
21
21
|
network: string;
|
|
22
22
|
server_pubkey: string;
|
|
23
|
-
|
|
23
|
+
round_interval: number;
|
|
24
|
+
nb_round_nonces: number;
|
|
24
25
|
vtxo_exit_delta: number;
|
|
25
26
|
vtxo_expiry_delta: number;
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
htlc_send_expiry_delta: number;
|
|
28
|
+
max_vtxo_amount: number;
|
|
29
|
+
max_arkoor_depth: number;
|
|
30
|
+
required_board_confirmations: number;
|
|
28
31
|
}
|
|
29
32
|
export interface BarkSendManyOutput {
|
|
30
33
|
destination: string;
|
|
@@ -39,6 +42,11 @@ interface BarkVtxo {
|
|
|
39
42
|
point: string;
|
|
40
43
|
state: string;
|
|
41
44
|
}
|
|
45
|
+
export interface Bolt11Invoice {
|
|
46
|
+
payment_request: string;
|
|
47
|
+
payment_secret: string;
|
|
48
|
+
payment_hash: string;
|
|
49
|
+
}
|
|
42
50
|
export type PaymentTypes = 'Bolt11' | 'Bolt12' | 'Lnurl' | 'Arkoor' | 'Onchain';
|
|
43
51
|
export interface ArkoorPaymentResult {
|
|
44
52
|
amount_sat: number;
|
|
@@ -118,7 +126,7 @@ export interface NitroArk extends HybridObject<{
|
|
|
118
126
|
loadWallet(datadir: string, config: BarkCreateOpts): Promise<void>;
|
|
119
127
|
isWalletLoaded(): Promise<boolean>;
|
|
120
128
|
closeWallet(): Promise<void>;
|
|
121
|
-
|
|
129
|
+
syncPendingBoards(): Promise<void>;
|
|
122
130
|
maintenance(): Promise<void>;
|
|
123
131
|
maintenanceWithOnchain(): Promise<void>;
|
|
124
132
|
maintenanceRefresh(): Promise<void>;
|
|
@@ -134,7 +142,7 @@ export interface NitroArk extends HybridObject<{
|
|
|
134
142
|
signMesssageWithMnemonic(message: string, mnemonic: string, network: string, index: number): Promise<string>;
|
|
135
143
|
deriveKeypairFromMnemonic(mnemonic: string, network: string, index: number): Promise<KeyPairResult>;
|
|
136
144
|
verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
137
|
-
movements(
|
|
145
|
+
movements(): Promise<BarkMovement[]>;
|
|
138
146
|
vtxos(): Promise<BarkVtxo[]>;
|
|
139
147
|
getFirstExpiringVtxoBlockheight(): Promise<number | undefined>;
|
|
140
148
|
getNextRequiredRefreshBlockheight(): Promise<number | undefined>;
|
|
@@ -155,11 +163,10 @@ export interface NitroArk extends HybridObject<{
|
|
|
155
163
|
payOffer(offer: string, amountSat?: number): Promise<Bolt12PaymentResult>;
|
|
156
164
|
sendLnaddr(addr: string, amountSat: number, comment: string): Promise<LnurlPaymentResult>;
|
|
157
165
|
sendRoundOnchainPayment(destination: string, amountSat: number): Promise<string>;
|
|
158
|
-
bolt11Invoice(amountMsat: number): Promise<
|
|
166
|
+
bolt11Invoice(amountMsat: number): Promise<Bolt11Invoice>;
|
|
159
167
|
lightningReceiveStatus(paymentHash: string): Promise<LightningReceive | undefined>;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
claimAllOpenInvoices(): Promise<void>;
|
|
168
|
+
checkAndClaimLnReceive(paymentHash: string, wait: boolean): Promise<void>;
|
|
169
|
+
checkAndClaimAllOpenLnReceives(wait: boolean): Promise<void>;
|
|
163
170
|
offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<string>;
|
|
164
171
|
offboardAll(destinationAddress: string): Promise<string>;
|
|
165
172
|
}
|
|
@@ -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,GA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B,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,8BAA8B,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAG7D,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;CAC1D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NitroArk, BarkCreateOpts, BarkArkInfo, BarkSendManyOutput, ArkoorPaymentResult, Bolt11PaymentResult, Bolt12PaymentResult, LnurlPaymentResult, OnchainPaymentResult, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive } from './NitroArk.nitro';
|
|
1
|
+
import type { NitroArk, BarkCreateOpts, BarkArkInfo, Bolt11Invoice, BarkSendManyOutput, ArkoorPaymentResult, Bolt11PaymentResult, Bolt12PaymentResult, LnurlPaymentResult, OnchainPaymentResult, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive } from './NitroArk.nitro';
|
|
2
2
|
export type BarkVtxo = {
|
|
3
3
|
amount: number;
|
|
4
4
|
expiry_height: number;
|
|
@@ -6,7 +6,7 @@ export type BarkVtxo = {
|
|
|
6
6
|
exit_delta: number;
|
|
7
7
|
anchor_point: string;
|
|
8
8
|
point: string;
|
|
9
|
-
state: 'Spendable' | 'Spent' | '
|
|
9
|
+
state: 'Spendable' | 'Spent' | 'Locked' | 'unknown';
|
|
10
10
|
};
|
|
11
11
|
export interface BarkMovementRecipient {
|
|
12
12
|
recipient: string;
|
|
@@ -53,10 +53,10 @@ export declare function closeWallet(): Promise<void>;
|
|
|
53
53
|
*/
|
|
54
54
|
export declare function isWalletLoaded(): Promise<boolean>;
|
|
55
55
|
/**
|
|
56
|
-
* Registers all confirmed boards.
|
|
56
|
+
* Registers all confirmed boards with the server.
|
|
57
57
|
* @returns A promise that resolves on success.
|
|
58
58
|
*/
|
|
59
|
-
export declare function
|
|
59
|
+
export declare function syncPendingBoards(): Promise<void>;
|
|
60
60
|
/**
|
|
61
61
|
* Runs wallet maintenance tasks for offchain.
|
|
62
62
|
* This includes refreshing vtxos that need to be refreshed.
|
|
@@ -149,11 +149,9 @@ export declare function deriveKeypairFromMnemonic(mnemonic: string, network: str
|
|
|
149
149
|
export declare function verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
150
150
|
/**
|
|
151
151
|
* Gets a paginated list of wallet movements (balance changes).
|
|
152
|
-
* @param pageIndex The index of the page to retrieve (0-based).
|
|
153
|
-
* @param pageSize The number of movements per page.
|
|
154
152
|
* @returns A promise resolving to an array of BarkMovement objects.
|
|
155
153
|
*/
|
|
156
|
-
export declare function movements(
|
|
154
|
+
export declare function movements(): Promise<BarkMovement[]>;
|
|
157
155
|
/**
|
|
158
156
|
* Gets the list of VTXOs as a JSON string for the loaded wallet.
|
|
159
157
|
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
@@ -223,9 +221,9 @@ export declare function onchainSendMany(outputs: BarkSendManyOutput[]): Promise<
|
|
|
223
221
|
/**
|
|
224
222
|
* Creates a Bolt 11 invoice.
|
|
225
223
|
* @param amountMsat The amount in millisatoshis for the invoice.
|
|
226
|
-
* @returns A promise resolving to
|
|
224
|
+
* @returns A promise resolving to Bolt11Invoice object.
|
|
227
225
|
*/
|
|
228
|
-
export declare function bolt11Invoice(amountMsat: number): Promise<
|
|
226
|
+
export declare function bolt11Invoice(amountMsat: number): Promise<Bolt11Invoice>;
|
|
229
227
|
/**
|
|
230
228
|
* Gets the status of a Lightning receive.
|
|
231
229
|
* @param paymentHash The payment hash of the Lightning receive.
|
|
@@ -233,23 +231,17 @@ export declare function bolt11Invoice(amountMsat: number): Promise<string>;
|
|
|
233
231
|
*/
|
|
234
232
|
export declare function lightningReceiveStatus(paymentHash: string): Promise<LightningReceive | undefined>;
|
|
235
233
|
/**
|
|
236
|
-
*
|
|
237
|
-
* @param
|
|
238
|
-
* @param pageIndex The index of the page to retrieve.
|
|
239
|
-
* @returns A promise resolving to an array of Lightning receives.
|
|
240
|
-
*/
|
|
241
|
-
export declare function lightningReceives(pageSize: number, pageIndex: number): Promise<LightningReceive[]>;
|
|
242
|
-
/**
|
|
243
|
-
* Claims a Lightning payment.
|
|
244
|
-
* @param bolt11 The Lightning invoice string to claim.
|
|
234
|
+
* Checks and claims a Lightning payment.
|
|
235
|
+
* @param paymentHash The payment hash of the Lightning payment.
|
|
245
236
|
* @returns A promise that resolves on success or rejects on error.
|
|
246
237
|
*/
|
|
247
|
-
export declare function
|
|
238
|
+
export declare function checkAndClaimLnReceive(paymentHash: string, wait: boolean): Promise<void>;
|
|
248
239
|
/**
|
|
249
|
-
*
|
|
240
|
+
* Checks and claims all open Lightning receives.
|
|
241
|
+
* @param wait Whether to wait for the claim to complete.
|
|
250
242
|
* @returns A promise that resolves on success or rejects on error.
|
|
251
243
|
*/
|
|
252
|
-
export declare function
|
|
244
|
+
export declare function checkAndClaimAllOpenLnReceives(wait: boolean): Promise<void>;
|
|
253
245
|
/**
|
|
254
246
|
* Sends a Lightning payment.
|
|
255
247
|
* @param destination The Lightning invoice.
|
|
@@ -318,5 +310,5 @@ export declare function offboardSpecific(vtxoIds: string[], destinationAddress:
|
|
|
318
310
|
* @returns A promise resolving to a JSON result string.
|
|
319
311
|
*/
|
|
320
312
|
export declare function offboardAll(destinationAddress: string): Promise<string>;
|
|
321
|
-
export type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput, ArkoorPaymentResult, Bolt11PaymentResult, LnurlPaymentResult, OnchainPaymentResult, PaymentTypes, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive, } from './NitroArk.nitro';
|
|
313
|
+
export type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, Bolt11Invoice, BarkSendManyOutput, ArkoorPaymentResult, Bolt11PaymentResult, LnurlPaymentResult, OnchainPaymentResult, PaymentTypes, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive, } from './NitroArk.nitro';
|
|
322
314
|
//# 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,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,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,uBAAuB,CACrC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,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;AAGD,YAAY,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,kBAAkB,CAAC"}
|
|
@@ -31,15 +31,18 @@ namespace margelo::nitro::nitroark {
|
|
|
31
31
|
public:
|
|
32
32
|
std::string network SWIFT_PRIVATE;
|
|
33
33
|
std::string server_pubkey SWIFT_PRIVATE;
|
|
34
|
-
double
|
|
34
|
+
double round_interval SWIFT_PRIVATE;
|
|
35
|
+
double nb_round_nonces SWIFT_PRIVATE;
|
|
35
36
|
double vtxo_exit_delta SWIFT_PRIVATE;
|
|
36
37
|
double vtxo_expiry_delta SWIFT_PRIVATE;
|
|
37
|
-
double
|
|
38
|
-
double
|
|
38
|
+
double htlc_send_expiry_delta SWIFT_PRIVATE;
|
|
39
|
+
double max_vtxo_amount SWIFT_PRIVATE;
|
|
40
|
+
double max_arkoor_depth SWIFT_PRIVATE;
|
|
41
|
+
double required_board_confirmations SWIFT_PRIVATE;
|
|
39
42
|
|
|
40
43
|
public:
|
|
41
44
|
BarkArkInfo() = default;
|
|
42
|
-
explicit BarkArkInfo(std::string network, std::string server_pubkey, double
|
|
45
|
+
explicit BarkArkInfo(std::string network, std::string server_pubkey, double round_interval, double nb_round_nonces, double vtxo_exit_delta, double vtxo_expiry_delta, double htlc_send_expiry_delta, double max_vtxo_amount, double max_arkoor_depth, double required_board_confirmations): network(network), server_pubkey(server_pubkey), round_interval(round_interval), nb_round_nonces(nb_round_nonces), vtxo_exit_delta(vtxo_exit_delta), vtxo_expiry_delta(vtxo_expiry_delta), htlc_send_expiry_delta(htlc_send_expiry_delta), max_vtxo_amount(max_vtxo_amount), max_arkoor_depth(max_arkoor_depth), required_board_confirmations(required_board_confirmations) {}
|
|
43
46
|
};
|
|
44
47
|
|
|
45
48
|
} // namespace margelo::nitro::nitroark
|
|
@@ -54,22 +57,28 @@ namespace margelo::nitro {
|
|
|
54
57
|
return margelo::nitro::nitroark::BarkArkInfo(
|
|
55
58
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "network")),
|
|
56
59
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "server_pubkey")),
|
|
57
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
60
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "round_interval")),
|
|
61
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "nb_round_nonces")),
|
|
58
62
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "vtxo_exit_delta")),
|
|
59
63
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "vtxo_expiry_delta")),
|
|
60
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
61
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
64
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "htlc_send_expiry_delta")),
|
|
65
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "max_vtxo_amount")),
|
|
66
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "max_arkoor_depth")),
|
|
67
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "required_board_confirmations"))
|
|
62
68
|
);
|
|
63
69
|
}
|
|
64
70
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkArkInfo& arg) {
|
|
65
71
|
jsi::Object obj(runtime);
|
|
66
72
|
obj.setProperty(runtime, "network", JSIConverter<std::string>::toJSI(runtime, arg.network));
|
|
67
73
|
obj.setProperty(runtime, "server_pubkey", JSIConverter<std::string>::toJSI(runtime, arg.server_pubkey));
|
|
68
|
-
obj.setProperty(runtime, "
|
|
74
|
+
obj.setProperty(runtime, "round_interval", JSIConverter<double>::toJSI(runtime, arg.round_interval));
|
|
75
|
+
obj.setProperty(runtime, "nb_round_nonces", JSIConverter<double>::toJSI(runtime, arg.nb_round_nonces));
|
|
69
76
|
obj.setProperty(runtime, "vtxo_exit_delta", JSIConverter<double>::toJSI(runtime, arg.vtxo_exit_delta));
|
|
70
77
|
obj.setProperty(runtime, "vtxo_expiry_delta", JSIConverter<double>::toJSI(runtime, arg.vtxo_expiry_delta));
|
|
71
|
-
obj.setProperty(runtime, "
|
|
72
|
-
obj.setProperty(runtime, "
|
|
78
|
+
obj.setProperty(runtime, "htlc_send_expiry_delta", JSIConverter<double>::toJSI(runtime, arg.htlc_send_expiry_delta));
|
|
79
|
+
obj.setProperty(runtime, "max_vtxo_amount", JSIConverter<double>::toJSI(runtime, arg.max_vtxo_amount));
|
|
80
|
+
obj.setProperty(runtime, "max_arkoor_depth", JSIConverter<double>::toJSI(runtime, arg.max_arkoor_depth));
|
|
81
|
+
obj.setProperty(runtime, "required_board_confirmations", JSIConverter<double>::toJSI(runtime, arg.required_board_confirmations));
|
|
73
82
|
return obj;
|
|
74
83
|
}
|
|
75
84
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -79,11 +88,14 @@ namespace margelo::nitro {
|
|
|
79
88
|
jsi::Object obj = value.getObject(runtime);
|
|
80
89
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "network"))) return false;
|
|
81
90
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "server_pubkey"))) return false;
|
|
82
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "
|
|
91
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "round_interval"))) return false;
|
|
92
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "nb_round_nonces"))) return false;
|
|
83
93
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "vtxo_exit_delta"))) return false;
|
|
84
94
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "vtxo_expiry_delta"))) return false;
|
|
85
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "
|
|
86
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "
|
|
95
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "htlc_send_expiry_delta"))) return false;
|
|
96
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "max_vtxo_amount"))) return false;
|
|
97
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "max_arkoor_depth"))) return false;
|
|
98
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "required_board_confirmations"))) return false;
|
|
87
99
|
return true;
|
|
88
100
|
}
|
|
89
101
|
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Bolt11Invoice.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 (Bolt11Invoice).
|
|
29
|
+
*/
|
|
30
|
+
struct Bolt11Invoice {
|
|
31
|
+
public:
|
|
32
|
+
std::string payment_request SWIFT_PRIVATE;
|
|
33
|
+
std::string payment_secret SWIFT_PRIVATE;
|
|
34
|
+
std::string payment_hash SWIFT_PRIVATE;
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
Bolt11Invoice() = default;
|
|
38
|
+
explicit Bolt11Invoice(std::string payment_request, std::string payment_secret, std::string payment_hash): payment_request(payment_request), payment_secret(payment_secret), payment_hash(payment_hash) {}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace margelo::nitro::nitroark
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro {
|
|
44
|
+
|
|
45
|
+
// C++ Bolt11Invoice <> JS Bolt11Invoice (object)
|
|
46
|
+
template <>
|
|
47
|
+
struct JSIConverter<margelo::nitro::nitroark::Bolt11Invoice> final {
|
|
48
|
+
static inline margelo::nitro::nitroark::Bolt11Invoice fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
49
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
50
|
+
return margelo::nitro::nitroark::Bolt11Invoice(
|
|
51
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "payment_request")),
|
|
52
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "payment_secret")),
|
|
53
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "payment_hash"))
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::Bolt11Invoice& arg) {
|
|
57
|
+
jsi::Object obj(runtime);
|
|
58
|
+
obj.setProperty(runtime, "payment_request", JSIConverter<std::string>::toJSI(runtime, arg.payment_request));
|
|
59
|
+
obj.setProperty(runtime, "payment_secret", JSIConverter<std::string>::toJSI(runtime, arg.payment_secret));
|
|
60
|
+
obj.setProperty(runtime, "payment_hash", JSIConverter<std::string>::toJSI(runtime, arg.payment_hash));
|
|
61
|
+
return obj;
|
|
62
|
+
}
|
|
63
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
64
|
+
if (!value.isObject()) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
jsi::Object obj = value.getObject(runtime);
|
|
68
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "payment_request"))) return false;
|
|
69
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "payment_secret"))) return false;
|
|
70
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "payment_hash"))) return false;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
} // namespace margelo::nitro
|
|
@@ -19,7 +19,7 @@ namespace margelo::nitro::nitroark {
|
|
|
19
19
|
prototype.registerHybridMethod("loadWallet", &HybridNitroArkSpec::loadWallet);
|
|
20
20
|
prototype.registerHybridMethod("isWalletLoaded", &HybridNitroArkSpec::isWalletLoaded);
|
|
21
21
|
prototype.registerHybridMethod("closeWallet", &HybridNitroArkSpec::closeWallet);
|
|
22
|
-
prototype.registerHybridMethod("
|
|
22
|
+
prototype.registerHybridMethod("syncPendingBoards", &HybridNitroArkSpec::syncPendingBoards);
|
|
23
23
|
prototype.registerHybridMethod("maintenance", &HybridNitroArkSpec::maintenance);
|
|
24
24
|
prototype.registerHybridMethod("maintenanceWithOnchain", &HybridNitroArkSpec::maintenanceWithOnchain);
|
|
25
25
|
prototype.registerHybridMethod("maintenanceRefresh", &HybridNitroArkSpec::maintenanceRefresh);
|
|
@@ -58,9 +58,8 @@ namespace margelo::nitro::nitroark {
|
|
|
58
58
|
prototype.registerHybridMethod("sendRoundOnchainPayment", &HybridNitroArkSpec::sendRoundOnchainPayment);
|
|
59
59
|
prototype.registerHybridMethod("bolt11Invoice", &HybridNitroArkSpec::bolt11Invoice);
|
|
60
60
|
prototype.registerHybridMethod("lightningReceiveStatus", &HybridNitroArkSpec::lightningReceiveStatus);
|
|
61
|
-
prototype.registerHybridMethod("
|
|
62
|
-
prototype.registerHybridMethod("
|
|
63
|
-
prototype.registerHybridMethod("claimAllOpenInvoices", &HybridNitroArkSpec::claimAllOpenInvoices);
|
|
61
|
+
prototype.registerHybridMethod("checkAndClaimLnReceive", &HybridNitroArkSpec::checkAndClaimLnReceive);
|
|
62
|
+
prototype.registerHybridMethod("checkAndClaimAllOpenLnReceives", &HybridNitroArkSpec::checkAndClaimAllOpenLnReceives);
|
|
64
63
|
prototype.registerHybridMethod("offboardSpecific", &HybridNitroArkSpec::offboardSpecific);
|
|
65
64
|
prototype.registerHybridMethod("offboardAll", &HybridNitroArkSpec::offboardAll);
|
|
66
65
|
});
|
|
@@ -41,6 +41,8 @@ namespace margelo::nitro::nitroark { struct Bolt11PaymentResult; }
|
|
|
41
41
|
namespace margelo::nitro::nitroark { struct Bolt12PaymentResult; }
|
|
42
42
|
// Forward declaration of `LnurlPaymentResult` to properly resolve imports.
|
|
43
43
|
namespace margelo::nitro::nitroark { struct LnurlPaymentResult; }
|
|
44
|
+
// Forward declaration of `Bolt11Invoice` to properly resolve imports.
|
|
45
|
+
namespace margelo::nitro::nitroark { struct Bolt11Invoice; }
|
|
44
46
|
// Forward declaration of `LightningReceive` to properly resolve imports.
|
|
45
47
|
namespace margelo::nitro::nitroark { struct LightningReceive; }
|
|
46
48
|
|
|
@@ -62,6 +64,7 @@ namespace margelo::nitro::nitroark { struct LightningReceive; }
|
|
|
62
64
|
#include "Bolt11PaymentResult.hpp"
|
|
63
65
|
#include "Bolt12PaymentResult.hpp"
|
|
64
66
|
#include "LnurlPaymentResult.hpp"
|
|
67
|
+
#include "Bolt11Invoice.hpp"
|
|
65
68
|
#include "LightningReceive.hpp"
|
|
66
69
|
|
|
67
70
|
namespace margelo::nitro::nitroark {
|
|
@@ -100,7 +103,7 @@ namespace margelo::nitro::nitroark {
|
|
|
100
103
|
virtual std::shared_ptr<Promise<void>> loadWallet(const std::string& datadir, const BarkCreateOpts& config) = 0;
|
|
101
104
|
virtual std::shared_ptr<Promise<bool>> isWalletLoaded() = 0;
|
|
102
105
|
virtual std::shared_ptr<Promise<void>> closeWallet() = 0;
|
|
103
|
-
virtual std::shared_ptr<Promise<void>>
|
|
106
|
+
virtual std::shared_ptr<Promise<void>> syncPendingBoards() = 0;
|
|
104
107
|
virtual std::shared_ptr<Promise<void>> maintenance() = 0;
|
|
105
108
|
virtual std::shared_ptr<Promise<void>> maintenanceWithOnchain() = 0;
|
|
106
109
|
virtual std::shared_ptr<Promise<void>> maintenanceRefresh() = 0;
|
|
@@ -116,7 +119,7 @@ namespace margelo::nitro::nitroark {
|
|
|
116
119
|
virtual std::shared_ptr<Promise<std::string>> signMesssageWithMnemonic(const std::string& message, const std::string& mnemonic, const std::string& network, double index) = 0;
|
|
117
120
|
virtual std::shared_ptr<Promise<KeyPairResult>> deriveKeypairFromMnemonic(const std::string& mnemonic, const std::string& network, double index) = 0;
|
|
118
121
|
virtual std::shared_ptr<Promise<bool>> verifyMessage(const std::string& message, const std::string& signature, const std::string& publicKey) = 0;
|
|
119
|
-
virtual std::shared_ptr<Promise<std::vector<BarkMovement>>> movements(
|
|
122
|
+
virtual std::shared_ptr<Promise<std::vector<BarkMovement>>> movements() = 0;
|
|
120
123
|
virtual std::shared_ptr<Promise<std::vector<BarkVtxo>>> vtxos() = 0;
|
|
121
124
|
virtual std::shared_ptr<Promise<std::optional<double>>> getFirstExpiringVtxoBlockheight() = 0;
|
|
122
125
|
virtual std::shared_ptr<Promise<std::optional<double>>> getNextRequiredRefreshBlockheight() = 0;
|
|
@@ -137,11 +140,10 @@ namespace margelo::nitro::nitroark {
|
|
|
137
140
|
virtual std::shared_ptr<Promise<Bolt12PaymentResult>> payOffer(const std::string& offer, std::optional<double> amountSat) = 0;
|
|
138
141
|
virtual std::shared_ptr<Promise<LnurlPaymentResult>> sendLnaddr(const std::string& addr, double amountSat, const std::string& comment) = 0;
|
|
139
142
|
virtual std::shared_ptr<Promise<std::string>> sendRoundOnchainPayment(const std::string& destination, double amountSat) = 0;
|
|
140
|
-
virtual std::shared_ptr<Promise<
|
|
143
|
+
virtual std::shared_ptr<Promise<Bolt11Invoice>> bolt11Invoice(double amountMsat) = 0;
|
|
141
144
|
virtual std::shared_ptr<Promise<std::optional<LightningReceive>>> lightningReceiveStatus(const std::string& paymentHash) = 0;
|
|
142
|
-
virtual std::shared_ptr<Promise<std::
|
|
143
|
-
virtual std::shared_ptr<Promise<void>>
|
|
144
|
-
virtual std::shared_ptr<Promise<void>> claimAllOpenInvoices() = 0;
|
|
145
|
+
virtual std::shared_ptr<Promise<void>> checkAndClaimLnReceive(const std::string& paymentHash, bool wait) = 0;
|
|
146
|
+
virtual std::shared_ptr<Promise<void>> checkAndClaimAllOpenLnReceives(bool wait) = 0;
|
|
145
147
|
virtual std::shared_ptr<Promise<std::string>> offboardSpecific(const std::vector<std::string>& vtxoIds, const std::string& destinationAddress) = 0;
|
|
146
148
|
virtual std::shared_ptr<Promise<std::string>> offboardAll(const std::string& destinationAddress) = 0;
|
|
147
149
|
|
package/package.json
CHANGED
package/src/NitroArk.nitro.ts
CHANGED
|
@@ -27,11 +27,14 @@ export interface BarkCreateOpts {
|
|
|
27
27
|
export interface BarkArkInfo {
|
|
28
28
|
network: string;
|
|
29
29
|
server_pubkey: string;
|
|
30
|
-
|
|
30
|
+
round_interval: number; // u64
|
|
31
|
+
nb_round_nonces: number; // u16
|
|
31
32
|
vtxo_exit_delta: number; // u16
|
|
32
33
|
vtxo_expiry_delta: number; // u16
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
htlc_send_expiry_delta: number; // u16
|
|
35
|
+
max_vtxo_amount: number; // u64
|
|
36
|
+
max_arkoor_depth: number; // u16
|
|
37
|
+
required_board_confirmations: number; // u8
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
// Helper interface for sendManyOnchain
|
|
@@ -50,6 +53,12 @@ interface BarkVtxo {
|
|
|
50
53
|
state: string;
|
|
51
54
|
}
|
|
52
55
|
|
|
56
|
+
export interface Bolt11Invoice {
|
|
57
|
+
payment_request: string;
|
|
58
|
+
payment_secret: string;
|
|
59
|
+
payment_hash: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
53
62
|
export type PaymentTypes = 'Bolt11' | 'Bolt12' | 'Lnurl' | 'Arkoor' | 'Onchain';
|
|
54
63
|
|
|
55
64
|
export interface ArkoorPaymentResult {
|
|
@@ -146,7 +155,7 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
146
155
|
loadWallet(datadir: string, config: BarkCreateOpts): Promise<void>;
|
|
147
156
|
isWalletLoaded(): Promise<boolean>;
|
|
148
157
|
closeWallet(): Promise<void>;
|
|
149
|
-
|
|
158
|
+
syncPendingBoards(): Promise<void>;
|
|
150
159
|
maintenance(): Promise<void>;
|
|
151
160
|
maintenanceWithOnchain(): Promise<void>;
|
|
152
161
|
maintenanceRefresh(): Promise<void>;
|
|
@@ -177,7 +186,7 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
177
186
|
signature: string,
|
|
178
187
|
publicKey: string
|
|
179
188
|
): Promise<boolean>;
|
|
180
|
-
movements(
|
|
189
|
+
movements(): Promise<BarkMovement[]>;
|
|
181
190
|
vtxos(): Promise<BarkVtxo[]>;
|
|
182
191
|
getFirstExpiringVtxoBlockheight(): Promise<number | undefined>;
|
|
183
192
|
getNextRequiredRefreshBlockheight(): Promise<number | undefined>;
|
|
@@ -230,16 +239,12 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
230
239
|
): Promise<string>; // Returns JSON status
|
|
231
240
|
|
|
232
241
|
// --- Lightning Invoicing ---
|
|
233
|
-
bolt11Invoice(amountMsat: number): Promise<
|
|
242
|
+
bolt11Invoice(amountMsat: number): Promise<Bolt11Invoice>;
|
|
234
243
|
lightningReceiveStatus(
|
|
235
244
|
paymentHash: string
|
|
236
245
|
): Promise<LightningReceive | undefined>;
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
pageIndex: number
|
|
240
|
-
): Promise<LightningReceive[]>;
|
|
241
|
-
finishLightningReceive(bolt11: string): Promise<void>; // Throws on error
|
|
242
|
-
claimAllOpenInvoices(): Promise<void>; // Throws on error
|
|
246
|
+
checkAndClaimLnReceive(paymentHash: string, wait: boolean): Promise<void>; // Throws on error
|
|
247
|
+
checkAndClaimAllOpenLnReceives(wait: boolean): Promise<void>; // Throws on error
|
|
243
248
|
|
|
244
249
|
// --- Offboarding / Exiting ---
|
|
245
250
|
offboardSpecific(
|
package/src/index.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
NitroArk,
|
|
4
4
|
BarkCreateOpts,
|
|
5
5
|
BarkArkInfo,
|
|
6
|
+
Bolt11Invoice,
|
|
6
7
|
BarkSendManyOutput,
|
|
7
8
|
ArkoorPaymentResult,
|
|
8
9
|
Bolt11PaymentResult,
|
|
@@ -23,13 +24,7 @@ export type BarkVtxo = {
|
|
|
23
24
|
exit_delta: number; // u16
|
|
24
25
|
anchor_point: string;
|
|
25
26
|
point: string;
|
|
26
|
-
state:
|
|
27
|
-
| 'Spendable'
|
|
28
|
-
| 'Spent'
|
|
29
|
-
| 'UnregisteredBoard'
|
|
30
|
-
| 'PendingLightningSend'
|
|
31
|
-
| 'PendingLightningRecv'
|
|
32
|
-
| 'Unknown';
|
|
27
|
+
state: 'Spendable' | 'Spent' | 'Locked' | 'unknown';
|
|
33
28
|
};
|
|
34
29
|
|
|
35
30
|
export interface BarkMovementRecipient {
|
|
@@ -114,11 +109,11 @@ export function isWalletLoaded(): Promise<boolean> {
|
|
|
114
109
|
}
|
|
115
110
|
|
|
116
111
|
/**
|
|
117
|
-
* Registers all confirmed boards.
|
|
112
|
+
* Registers all confirmed boards with the server.
|
|
118
113
|
* @returns A promise that resolves on success.
|
|
119
114
|
*/
|
|
120
|
-
export function
|
|
121
|
-
return NitroArkHybridObject.
|
|
115
|
+
export function syncPendingBoards(): Promise<void> {
|
|
116
|
+
return NitroArkHybridObject.syncPendingBoards();
|
|
122
117
|
}
|
|
123
118
|
|
|
124
119
|
/**
|
|
@@ -283,17 +278,10 @@ export function verifyMessage(
|
|
|
283
278
|
|
|
284
279
|
/**
|
|
285
280
|
* Gets a paginated list of wallet movements (balance changes).
|
|
286
|
-
* @param pageIndex The index of the page to retrieve (0-based).
|
|
287
|
-
* @param pageSize The number of movements per page.
|
|
288
281
|
* @returns A promise resolving to an array of BarkMovement objects.
|
|
289
282
|
*/
|
|
290
|
-
export function movements(
|
|
291
|
-
|
|
292
|
-
pageSize: number
|
|
293
|
-
): Promise<BarkMovement[]> {
|
|
294
|
-
return NitroArkHybridObject.movements(pageIndex, pageSize) as Promise<
|
|
295
|
-
BarkMovement[]
|
|
296
|
-
>;
|
|
283
|
+
export function movements(): Promise<BarkMovement[]> {
|
|
284
|
+
return NitroArkHybridObject.movements() as Promise<BarkMovement[]>;
|
|
297
285
|
}
|
|
298
286
|
|
|
299
287
|
/**
|
|
@@ -415,9 +403,9 @@ export function onchainSendMany(
|
|
|
415
403
|
/**
|
|
416
404
|
* Creates a Bolt 11 invoice.
|
|
417
405
|
* @param amountMsat The amount in millisatoshis for the invoice.
|
|
418
|
-
* @returns A promise resolving to
|
|
406
|
+
* @returns A promise resolving to Bolt11Invoice object.
|
|
419
407
|
*/
|
|
420
|
-
export function bolt11Invoice(amountMsat: number): Promise<
|
|
408
|
+
export function bolt11Invoice(amountMsat: number): Promise<Bolt11Invoice> {
|
|
421
409
|
return NitroArkHybridObject.bolt11Invoice(amountMsat);
|
|
422
410
|
}
|
|
423
411
|
|
|
@@ -433,33 +421,24 @@ export function lightningReceiveStatus(
|
|
|
433
421
|
}
|
|
434
422
|
|
|
435
423
|
/**
|
|
436
|
-
*
|
|
437
|
-
* @param
|
|
438
|
-
* @param pageIndex The index of the page to retrieve.
|
|
439
|
-
* @returns A promise resolving to an array of Lightning receives.
|
|
440
|
-
*/
|
|
441
|
-
export function lightningReceives(
|
|
442
|
-
pageSize: number,
|
|
443
|
-
pageIndex: number
|
|
444
|
-
): Promise<LightningReceive[]> {
|
|
445
|
-
return NitroArkHybridObject.lightningReceives(pageSize, pageIndex);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* Claims a Lightning payment.
|
|
450
|
-
* @param bolt11 The Lightning invoice string to claim.
|
|
424
|
+
* Checks and claims a Lightning payment.
|
|
425
|
+
* @param paymentHash The payment hash of the Lightning payment.
|
|
451
426
|
* @returns A promise that resolves on success or rejects on error.
|
|
452
427
|
*/
|
|
453
|
-
export function
|
|
454
|
-
|
|
428
|
+
export function checkAndClaimLnReceive(
|
|
429
|
+
paymentHash: string,
|
|
430
|
+
wait: boolean
|
|
431
|
+
): Promise<void> {
|
|
432
|
+
return NitroArkHybridObject.checkAndClaimLnReceive(paymentHash, wait);
|
|
455
433
|
}
|
|
456
434
|
|
|
457
435
|
/**
|
|
458
|
-
*
|
|
436
|
+
* Checks and claims all open Lightning receives.
|
|
437
|
+
* @param wait Whether to wait for the claim to complete.
|
|
459
438
|
* @returns A promise that resolves on success or rejects on error.
|
|
460
439
|
*/
|
|
461
|
-
export function
|
|
462
|
-
return NitroArkHybridObject.
|
|
440
|
+
export function checkAndClaimAllOpenLnReceives(wait: boolean): Promise<void> {
|
|
441
|
+
return NitroArkHybridObject.checkAndClaimAllOpenLnReceives(wait);
|
|
463
442
|
}
|
|
464
443
|
|
|
465
444
|
/**
|
|
@@ -589,6 +568,7 @@ export type {
|
|
|
589
568
|
BarkCreateOpts,
|
|
590
569
|
BarkConfigOpts,
|
|
591
570
|
BarkArkInfo,
|
|
571
|
+
Bolt11Invoice,
|
|
592
572
|
BarkSendManyOutput,
|
|
593
573
|
ArkoorPaymentResult,
|
|
594
574
|
Bolt11PaymentResult,
|