react-native-nitro-ark 0.0.71 → 0.0.72

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.
@@ -19,17 +19,18 @@ 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("checkConnection", &HybridNitroArkSpec::checkConnection);
22
23
  prototype.registerHybridMethod("syncPendingBoards", &HybridNitroArkSpec::syncPendingBoards);
23
24
  prototype.registerHybridMethod("maintenance", &HybridNitroArkSpec::maintenance);
24
25
  prototype.registerHybridMethod("maintenanceWithOnchain", &HybridNitroArkSpec::maintenanceWithOnchain);
25
26
  prototype.registerHybridMethod("maintenanceRefresh", &HybridNitroArkSpec::maintenanceRefresh);
26
27
  prototype.registerHybridMethod("sync", &HybridNitroArkSpec::sync);
27
28
  prototype.registerHybridMethod("syncExits", &HybridNitroArkSpec::syncExits);
28
- prototype.registerHybridMethod("syncPastRounds", &HybridNitroArkSpec::syncPastRounds);
29
29
  prototype.registerHybridMethod("getArkInfo", &HybridNitroArkSpec::getArkInfo);
30
30
  prototype.registerHybridMethod("offchainBalance", &HybridNitroArkSpec::offchainBalance);
31
31
  prototype.registerHybridMethod("deriveStoreNextKeypair", &HybridNitroArkSpec::deriveStoreNextKeypair);
32
32
  prototype.registerHybridMethod("peakKeyPair", &HybridNitroArkSpec::peakKeyPair);
33
+ prototype.registerHybridMethod("peakAddress", &HybridNitroArkSpec::peakAddress);
33
34
  prototype.registerHybridMethod("newAddress", &HybridNitroArkSpec::newAddress);
34
35
  prototype.registerHybridMethod("signMessage", &HybridNitroArkSpec::signMessage);
35
36
  prototype.registerHybridMethod("signMesssageWithMnemonic", &HybridNitroArkSpec::signMesssageWithMnemonic);
@@ -52,14 +53,14 @@ namespace margelo::nitro::nitroark {
52
53
  prototype.registerHybridMethod("boardAll", &HybridNitroArkSpec::boardAll);
53
54
  prototype.registerHybridMethod("validateArkoorAddress", &HybridNitroArkSpec::validateArkoorAddress);
54
55
  prototype.registerHybridMethod("sendArkoorPayment", &HybridNitroArkSpec::sendArkoorPayment);
55
- prototype.registerHybridMethod("sendLightningPayment", &HybridNitroArkSpec::sendLightningPayment);
56
- prototype.registerHybridMethod("payOffer", &HybridNitroArkSpec::payOffer);
57
- prototype.registerHybridMethod("sendLnaddr", &HybridNitroArkSpec::sendLnaddr);
56
+ prototype.registerHybridMethod("payLightningInvoice", &HybridNitroArkSpec::payLightningInvoice);
57
+ prototype.registerHybridMethod("payLightningOffer", &HybridNitroArkSpec::payLightningOffer);
58
+ prototype.registerHybridMethod("payLightningAddress", &HybridNitroArkSpec::payLightningAddress);
58
59
  prototype.registerHybridMethod("sendRoundOnchainPayment", &HybridNitroArkSpec::sendRoundOnchainPayment);
59
60
  prototype.registerHybridMethod("bolt11Invoice", &HybridNitroArkSpec::bolt11Invoice);
60
61
  prototype.registerHybridMethod("lightningReceiveStatus", &HybridNitroArkSpec::lightningReceiveStatus);
61
- prototype.registerHybridMethod("checkAndClaimLnReceive", &HybridNitroArkSpec::checkAndClaimLnReceive);
62
- prototype.registerHybridMethod("checkAndClaimAllOpenLnReceives", &HybridNitroArkSpec::checkAndClaimAllOpenLnReceives);
62
+ prototype.registerHybridMethod("tryClaimLightningReceive", &HybridNitroArkSpec::tryClaimLightningReceive);
63
+ prototype.registerHybridMethod("tryClaimAllLightningReceives", &HybridNitroArkSpec::tryClaimAllLightningReceives);
63
64
  prototype.registerHybridMethod("offboardSpecific", &HybridNitroArkSpec::offboardSpecific);
64
65
  prototype.registerHybridMethod("offboardAll", &HybridNitroArkSpec::offboardAll);
65
66
  });
@@ -43,6 +43,8 @@ namespace margelo::nitro::nitroark { struct Bolt11PaymentResult; }
43
43
  namespace margelo::nitro::nitroark { struct Bolt12PaymentResult; }
44
44
  // Forward declaration of `LnurlPaymentResult` to properly resolve imports.
45
45
  namespace margelo::nitro::nitroark { struct LnurlPaymentResult; }
46
+ // Forward declaration of `RoundStatus` to properly resolve imports.
47
+ namespace margelo::nitro::nitroark { struct RoundStatus; }
46
48
  // Forward declaration of `Bolt11Invoice` to properly resolve imports.
47
49
  namespace margelo::nitro::nitroark { struct Bolt11Invoice; }
48
50
  // Forward declaration of `LightningReceive` to properly resolve imports.
@@ -67,6 +69,7 @@ namespace margelo::nitro::nitroark { struct LightningReceive; }
67
69
  #include "Bolt11PaymentResult.hpp"
68
70
  #include "Bolt12PaymentResult.hpp"
69
71
  #include "LnurlPaymentResult.hpp"
72
+ #include "RoundStatus.hpp"
70
73
  #include "Bolt11Invoice.hpp"
71
74
  #include "LightningReceive.hpp"
72
75
 
@@ -106,17 +109,18 @@ namespace margelo::nitro::nitroark {
106
109
  virtual std::shared_ptr<Promise<void>> loadWallet(const std::string& datadir, const BarkCreateOpts& config) = 0;
107
110
  virtual std::shared_ptr<Promise<bool>> isWalletLoaded() = 0;
108
111
  virtual std::shared_ptr<Promise<void>> closeWallet() = 0;
112
+ virtual std::shared_ptr<Promise<void>> checkConnection() = 0;
109
113
  virtual std::shared_ptr<Promise<void>> syncPendingBoards() = 0;
110
114
  virtual std::shared_ptr<Promise<void>> maintenance() = 0;
111
115
  virtual std::shared_ptr<Promise<void>> maintenanceWithOnchain() = 0;
112
116
  virtual std::shared_ptr<Promise<void>> maintenanceRefresh() = 0;
113
117
  virtual std::shared_ptr<Promise<void>> sync() = 0;
114
118
  virtual std::shared_ptr<Promise<void>> syncExits() = 0;
115
- virtual std::shared_ptr<Promise<void>> syncPastRounds() = 0;
116
119
  virtual std::shared_ptr<Promise<BarkArkInfo>> getArkInfo() = 0;
117
120
  virtual std::shared_ptr<Promise<OffchainBalanceResult>> offchainBalance() = 0;
118
121
  virtual std::shared_ptr<Promise<KeyPairResult>> deriveStoreNextKeypair() = 0;
119
122
  virtual std::shared_ptr<Promise<KeyPairResult>> peakKeyPair(double index) = 0;
123
+ virtual std::shared_ptr<Promise<NewAddressResult>> peakAddress(double index) = 0;
120
124
  virtual std::shared_ptr<Promise<NewAddressResult>> newAddress() = 0;
121
125
  virtual std::shared_ptr<Promise<std::string>> signMessage(const std::string& message, double index) = 0;
122
126
  virtual std::shared_ptr<Promise<std::string>> signMesssageWithMnemonic(const std::string& message, const std::string& mnemonic, const std::string& network, double index) = 0;
@@ -139,16 +143,16 @@ namespace margelo::nitro::nitroark {
139
143
  virtual std::shared_ptr<Promise<BoardResult>> boardAll() = 0;
140
144
  virtual std::shared_ptr<Promise<void>> validateArkoorAddress(const std::string& address) = 0;
141
145
  virtual std::shared_ptr<Promise<ArkoorPaymentResult>> sendArkoorPayment(const std::string& destination, double amountSat) = 0;
142
- virtual std::shared_ptr<Promise<Bolt11PaymentResult>> sendLightningPayment(const std::string& destination, std::optional<double> amountSat) = 0;
143
- virtual std::shared_ptr<Promise<Bolt12PaymentResult>> payOffer(const std::string& offer, std::optional<double> amountSat) = 0;
144
- virtual std::shared_ptr<Promise<LnurlPaymentResult>> sendLnaddr(const std::string& addr, double amountSat, const std::string& comment) = 0;
145
- virtual std::shared_ptr<Promise<std::string>> sendRoundOnchainPayment(const std::string& destination, double amountSat) = 0;
146
+ virtual std::shared_ptr<Promise<Bolt11PaymentResult>> payLightningInvoice(const std::string& destination, std::optional<double> amountSat) = 0;
147
+ virtual std::shared_ptr<Promise<Bolt12PaymentResult>> payLightningOffer(const std::string& offer, std::optional<double> amountSat) = 0;
148
+ virtual std::shared_ptr<Promise<LnurlPaymentResult>> payLightningAddress(const std::string& addr, double amountSat, const std::string& comment) = 0;
149
+ virtual std::shared_ptr<Promise<RoundStatus>> sendRoundOnchainPayment(const std::string& destination, double amountSat) = 0;
146
150
  virtual std::shared_ptr<Promise<Bolt11Invoice>> bolt11Invoice(double amountMsat) = 0;
147
151
  virtual std::shared_ptr<Promise<std::optional<LightningReceive>>> lightningReceiveStatus(const std::string& paymentHash) = 0;
148
- virtual std::shared_ptr<Promise<void>> checkAndClaimLnReceive(const std::string& paymentHash, bool wait) = 0;
149
- virtual std::shared_ptr<Promise<void>> checkAndClaimAllOpenLnReceives(bool wait) = 0;
150
- virtual std::shared_ptr<Promise<std::string>> offboardSpecific(const std::vector<std::string>& vtxoIds, const std::string& destinationAddress) = 0;
151
- virtual std::shared_ptr<Promise<std::string>> offboardAll(const std::string& destinationAddress) = 0;
152
+ virtual std::shared_ptr<Promise<void>> tryClaimLightningReceive(const std::string& paymentHash, bool wait, const std::optional<std::string>& token) = 0;
153
+ virtual std::shared_ptr<Promise<void>> tryClaimAllLightningReceives(bool wait) = 0;
154
+ virtual std::shared_ptr<Promise<RoundStatus>> offboardSpecific(const std::vector<std::string>& vtxoIds, const std::string& destinationAddress) = 0;
155
+ virtual std::shared_ptr<Promise<RoundStatus>> offboardAll(const std::string& destinationAddress) = 0;
152
156
 
153
157
  protected:
154
158
  // Hybrid Setup
@@ -0,0 +1,99 @@
1
+ ///
2
+ /// RoundStatus.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
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ // Forward declaration of `RoundStatusType` to properly resolve imports.
27
+ namespace margelo::nitro::nitroark { enum class RoundStatusType; }
28
+
29
+ #include "RoundStatusType.hpp"
30
+ #include <string>
31
+ #include <optional>
32
+ #include <vector>
33
+
34
+ namespace margelo::nitro::nitroark {
35
+
36
+ /**
37
+ * A struct which can be represented as a JavaScript object (RoundStatus).
38
+ */
39
+ struct RoundStatus {
40
+ public:
41
+ RoundStatusType status SWIFT_PRIVATE;
42
+ std::optional<std::string> funding_txid SWIFT_PRIVATE;
43
+ std::optional<std::vector<std::string>> unsigned_funding_txids SWIFT_PRIVATE;
44
+ std::optional<std::string> error SWIFT_PRIVATE;
45
+ bool is_final SWIFT_PRIVATE;
46
+ bool is_success SWIFT_PRIVATE;
47
+
48
+ public:
49
+ RoundStatus() = default;
50
+ explicit RoundStatus(RoundStatusType status, std::optional<std::string> funding_txid, std::optional<std::vector<std::string>> unsigned_funding_txids, std::optional<std::string> error, bool is_final, bool is_success): status(status), funding_txid(funding_txid), unsigned_funding_txids(unsigned_funding_txids), error(error), is_final(is_final), is_success(is_success) {}
51
+ };
52
+
53
+ } // namespace margelo::nitro::nitroark
54
+
55
+ namespace margelo::nitro {
56
+
57
+ // C++ RoundStatus <> JS RoundStatus (object)
58
+ template <>
59
+ struct JSIConverter<margelo::nitro::nitroark::RoundStatus> final {
60
+ static inline margelo::nitro::nitroark::RoundStatus fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
61
+ jsi::Object obj = arg.asObject(runtime);
62
+ return margelo::nitro::nitroark::RoundStatus(
63
+ JSIConverter<margelo::nitro::nitroark::RoundStatusType>::fromJSI(runtime, obj.getProperty(runtime, "status")),
64
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "funding_txid")),
65
+ JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, "unsigned_funding_txids")),
66
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "error")),
67
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "is_final")),
68
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "is_success"))
69
+ );
70
+ }
71
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::RoundStatus& arg) {
72
+ jsi::Object obj(runtime);
73
+ obj.setProperty(runtime, "status", JSIConverter<margelo::nitro::nitroark::RoundStatusType>::toJSI(runtime, arg.status));
74
+ obj.setProperty(runtime, "funding_txid", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.funding_txid));
75
+ obj.setProperty(runtime, "unsigned_funding_txids", JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.unsigned_funding_txids));
76
+ obj.setProperty(runtime, "error", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.error));
77
+ obj.setProperty(runtime, "is_final", JSIConverter<bool>::toJSI(runtime, arg.is_final));
78
+ obj.setProperty(runtime, "is_success", JSIConverter<bool>::toJSI(runtime, arg.is_success));
79
+ return obj;
80
+ }
81
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
82
+ if (!value.isObject()) {
83
+ return false;
84
+ }
85
+ jsi::Object obj = value.getObject(runtime);
86
+ if (!nitro::isPlainObject(runtime, obj)) {
87
+ return false;
88
+ }
89
+ if (!JSIConverter<margelo::nitro::nitroark::RoundStatusType>::canConvert(runtime, obj.getProperty(runtime, "status"))) return false;
90
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "funding_txid"))) return false;
91
+ if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, "unsigned_funding_txids"))) return false;
92
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "error"))) return false;
93
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "is_final"))) return false;
94
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "is_success"))) return false;
95
+ return true;
96
+ }
97
+ };
98
+
99
+ } // namespace margelo::nitro
@@ -0,0 +1,84 @@
1
+ ///
2
+ /// RoundStatusType.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/NitroHash.hpp>)
11
+ #include <NitroModules/NitroHash.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
16
+ #include <NitroModules/JSIConverter.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
21
+ #include <NitroModules/NitroDefines.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ namespace margelo::nitro::nitroark {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (RoundStatusType).
30
+ */
31
+ enum class RoundStatusType {
32
+ CONFIRMED SWIFT_NAME(confirmed) = 0,
33
+ UNCONFIRMED SWIFT_NAME(unconfirmed) = 1,
34
+ PENDING SWIFT_NAME(pending) = 2,
35
+ FAILED SWIFT_NAME(failed) = 3,
36
+ } CLOSED_ENUM;
37
+
38
+ } // namespace margelo::nitro::nitroark
39
+
40
+ namespace margelo::nitro {
41
+
42
+ // C++ RoundStatusType <> JS RoundStatusType (union)
43
+ template <>
44
+ struct JSIConverter<margelo::nitro::nitroark::RoundStatusType> final {
45
+ static inline margelo::nitro::nitroark::RoundStatusType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
46
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
47
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
48
+ case hashString("confirmed"): return margelo::nitro::nitroark::RoundStatusType::CONFIRMED;
49
+ case hashString("unconfirmed"): return margelo::nitro::nitroark::RoundStatusType::UNCONFIRMED;
50
+ case hashString("pending"): return margelo::nitro::nitroark::RoundStatusType::PENDING;
51
+ case hashString("failed"): return margelo::nitro::nitroark::RoundStatusType::FAILED;
52
+ default: [[unlikely]]
53
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum RoundStatusType - invalid value!");
54
+ }
55
+ }
56
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitroark::RoundStatusType arg) {
57
+ switch (arg) {
58
+ case margelo::nitro::nitroark::RoundStatusType::CONFIRMED: return JSIConverter<std::string>::toJSI(runtime, "confirmed");
59
+ case margelo::nitro::nitroark::RoundStatusType::UNCONFIRMED: return JSIConverter<std::string>::toJSI(runtime, "unconfirmed");
60
+ case margelo::nitro::nitroark::RoundStatusType::PENDING: return JSIConverter<std::string>::toJSI(runtime, "pending");
61
+ case margelo::nitro::nitroark::RoundStatusType::FAILED: return JSIConverter<std::string>::toJSI(runtime, "failed");
62
+ default: [[unlikely]]
63
+ throw std::invalid_argument("Cannot convert RoundStatusType to JS - invalid value: "
64
+ + std::to_string(static_cast<int>(arg)) + "!");
65
+ }
66
+ }
67
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
68
+ if (!value.isString()) {
69
+ return false;
70
+ }
71
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
72
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
73
+ case hashString("confirmed"):
74
+ case hashString("unconfirmed"):
75
+ case hashString("pending"):
76
+ case hashString("failed"):
77
+ return true;
78
+ default:
79
+ return false;
80
+ }
81
+ }
82
+ };
83
+
84
+ } // namespace margelo::nitro
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-ark",
3
- "version": "0.0.71",
3
+ "version": "0.0.72",
4
4
  "description": "Pure C++ Nitro Modules for Ark client",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",
@@ -15,7 +15,7 @@ export interface BarkConfigOpts {
15
15
  fallback_fee_rate?: number;
16
16
  htlc_recv_claim_delta: number;
17
17
  vtxo_exit_margin: number;
18
- deep_round_confirmations: number;
18
+ round_tx_required_confirmations: number;
19
19
  }
20
20
 
21
21
  export interface BarkCreateOpts {
@@ -147,19 +147,47 @@ export interface LightningReceive {
147
147
  preimage_revealed_at?: number;
148
148
  }
149
149
 
150
- export interface BarkMovementRecipient {
151
- recipient: string;
150
+ export interface BarkMovementSubsystem {
151
+ name: string;
152
+ kind: string;
153
+ }
154
+
155
+ export interface BarkMovementDestination {
156
+ destination: string;
152
157
  amount_sat: number;
153
158
  }
154
159
 
155
160
  export interface BarkMovement {
156
161
  id: number;
157
- kind: string;
158
- fees: number;
159
- spends: BarkVtxo[];
160
- receives: BarkVtxo[];
161
- recipients: BarkMovementRecipient[];
162
+ status: string; // 'pending' | 'finished' | 'failed' | 'cancelled'
163
+ subsystem: BarkMovementSubsystem;
164
+ metadata_json: string;
165
+ intended_balance_sat: number;
166
+ effective_balance_sat: number;
167
+ offchain_fee_sat: number;
168
+ sent_to: BarkMovementDestination[];
169
+ received_on: BarkMovementDestination[];
170
+ input_vtxos: string[];
171
+ output_vtxos: string[];
172
+ exited_vtxos: string[];
162
173
  created_at: string;
174
+ updated_at: string;
175
+ completed_at?: string;
176
+ }
177
+
178
+ export type RoundStatusType =
179
+ | 'confirmed'
180
+ | 'unconfirmed'
181
+ | 'pending'
182
+ | 'failed';
183
+
184
+ export interface RoundStatus {
185
+ status: RoundStatusType;
186
+ funding_txid?: string;
187
+ unsigned_funding_txids?: string[];
188
+ error?: string;
189
+ is_final: boolean;
190
+ is_success: boolean;
163
191
  }
164
192
 
165
193
  // --- Nitro Module Interface ---
@@ -171,19 +199,20 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
171
199
  loadWallet(datadir: string, config: BarkCreateOpts): Promise<void>;
172
200
  isWalletLoaded(): Promise<boolean>;
173
201
  closeWallet(): Promise<void>;
202
+ checkConnection(): Promise<void>;
174
203
  syncPendingBoards(): Promise<void>;
175
204
  maintenance(): Promise<void>;
176
205
  maintenanceWithOnchain(): Promise<void>;
177
206
  maintenanceRefresh(): Promise<void>;
178
207
  sync(): Promise<void>;
179
208
  syncExits(): Promise<void>;
180
- syncPastRounds(): Promise<void>;
181
209
 
182
210
  // --- Wallet Info ---
183
211
  getArkInfo(): Promise<BarkArkInfo>;
184
212
  offchainBalance(): Promise<OffchainBalanceResult>;
185
213
  deriveStoreNextKeypair(): Promise<KeyPairResult>;
186
214
  peakKeyPair(index: number): Promise<KeyPairResult>;
215
+ peakAddress(index: number): Promise<NewAddressResult>;
187
216
  newAddress(): Promise<NewAddressResult>;
188
217
  signMessage(message: string, index: number): Promise<string>;
189
218
  signMesssageWithMnemonic(
@@ -239,12 +268,15 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
239
268
  destination: string,
240
269
  amountSat: number
241
270
  ): Promise<ArkoorPaymentResult>;
242
- sendLightningPayment(
271
+ payLightningInvoice(
243
272
  destination: string,
244
273
  amountSat?: number
245
274
  ): Promise<Bolt11PaymentResult>;
246
- payOffer(offer: string, amountSat?: number): Promise<Bolt12PaymentResult>;
247
- sendLnaddr(
275
+ payLightningOffer(
276
+ offer: string,
277
+ amountSat?: number
278
+ ): Promise<Bolt12PaymentResult>;
279
+ payLightningAddress(
248
280
  addr: string,
249
281
  amountSat: number,
250
282
  comment: string
@@ -252,20 +284,24 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
252
284
  sendRoundOnchainPayment(
253
285
  destination: string,
254
286
  amountSat: number
255
- ): Promise<string>; // Returns JSON status
287
+ ): Promise<RoundStatus>;
256
288
 
257
289
  // --- Lightning Invoicing ---
258
290
  bolt11Invoice(amountMsat: number): Promise<Bolt11Invoice>;
259
291
  lightningReceiveStatus(
260
292
  paymentHash: string
261
293
  ): Promise<LightningReceive | undefined>;
262
- checkAndClaimLnReceive(paymentHash: string, wait: boolean): Promise<void>; // Throws on error
263
- checkAndClaimAllOpenLnReceives(wait: boolean): Promise<void>; // Throws on error
294
+ tryClaimLightningReceive(
295
+ paymentHash: string,
296
+ wait: boolean,
297
+ token?: string
298
+ ): Promise<void>; // Throws on error
299
+ tryClaimAllLightningReceives(wait: boolean): Promise<void>; // Throws on error
264
300
 
265
301
  // --- Offboarding / Exiting ---
266
302
  offboardSpecific(
267
303
  vtxoIds: string[],
268
304
  destinationAddress: string
269
- ): Promise<string>; // Returns JSON result
270
- offboardAll(destinationAddress: string): Promise<string>; // Returns JSON result
305
+ ): Promise<RoundStatus>;
306
+ offboardAll(destinationAddress: string): Promise<RoundStatus>;
271
307
  }
package/src/index.tsx CHANGED
@@ -15,7 +15,9 @@ import type {
15
15
  NewAddressResult,
16
16
  KeyPairResult,
17
17
  LightningReceive,
18
+ BarkMovement as NitroBarkMovement,
18
19
  BoardResult,
20
+ RoundStatus,
19
21
  } from './NitroArk.nitro';
20
22
 
21
23
  export type BarkVtxo = {
@@ -28,28 +30,10 @@ export type BarkVtxo = {
28
30
  state: 'Spendable' | 'Spent' | 'Locked' | 'unknown';
29
31
  };
30
32
 
31
- export interface BarkMovementRecipient {
32
- recipient: string;
33
- amount_sat: number;
34
- }
35
-
36
- export type BarkMovement = {
37
- id: number;
38
- kind:
39
- | 'onboard'
40
- | 'round'
41
- | 'offboard'
42
- | 'arkoor-send'
43
- | 'arkoor-receive'
44
- | 'lightning-send'
45
- | 'lightning-send-revocation'
46
- | 'lightning-receive'
47
- | 'exit';
48
- fees: number;
49
- spends: BarkVtxo[];
50
- receives: BarkVtxo[];
51
- recipients: BarkMovementRecipient[];
52
- created_at: string;
33
+ export type MovementStatus = 'pending' | 'finished' | 'failed' | 'cancelled';
34
+
35
+ export type BarkMovement = NitroBarkMovement & {
36
+ status: MovementStatus;
53
37
  };
54
38
 
55
39
  // Create the hybrid object instance
@@ -101,6 +85,10 @@ export function closeWallet(): Promise<void> {
101
85
  return NitroArkHybridObject.closeWallet();
102
86
  }
103
87
 
88
+ export function checkConnection(): Promise<void> {
89
+ return NitroArkHybridObject.checkConnection();
90
+ }
91
+
104
92
  /**
105
93
  * Checks if a wallet is currently loaded.
106
94
  * @returns A promise resolving to true if a wallet is loaded, false otherwise.
@@ -159,14 +147,6 @@ export function syncExits(): Promise<void> {
159
147
  return NitroArkHybridObject.syncExits();
160
148
  }
161
149
 
162
- /**
163
- * Synchronizes the rounds of the wallet.
164
- * @returns A promise that resolves on success.
165
- */
166
- export function syncPastRounds(): Promise<void> {
167
- return NitroArkHybridObject.syncPastRounds();
168
- }
169
-
170
150
  // --- Wallet Info ---
171
151
 
172
152
  /**
@@ -202,6 +182,15 @@ export function peakKeyPair(index: number): Promise<KeyPairResult> {
202
182
  return NitroArkHybridObject.peakKeyPair(index);
203
183
  }
204
184
 
185
+ /**
186
+ * Peeks a derived address without advancing the wallet's address index.
187
+ * @param index Index of the address to preview.
188
+ * @returns A promise resolving to the NewAddressResult object.
189
+ */
190
+ export function peakAddress(index: number): Promise<NewAddressResult> {
191
+ return NitroArkHybridObject.peakAddress(index);
192
+ }
193
+
205
194
  /**
206
195
  * Gets the wallet's Address.
207
196
  * @returns A promise resolving to NewAddressResult object.
@@ -422,15 +411,22 @@ export function lightningReceiveStatus(
422
411
  }
423
412
 
424
413
  /**
425
- * Checks and claims a Lightning payment.
414
+ * Attempts to claim a Lightning payment, optionally using a claim token.
426
415
  * @param paymentHash The payment hash of the Lightning payment.
416
+ * @param wait Whether to wait for the claim to complete.
417
+ * @param token Optional claim token used when no spendable VTXOs are owned.
427
418
  * @returns A promise that resolves on success or rejects on error.
428
419
  */
429
- export function checkAndClaimLnReceive(
420
+ export function tryClaimLightningReceive(
430
421
  paymentHash: string,
431
- wait: boolean
422
+ wait: boolean,
423
+ token?: string
432
424
  ): Promise<void> {
433
- return NitroArkHybridObject.checkAndClaimLnReceive(paymentHash, wait);
425
+ return NitroArkHybridObject.tryClaimLightningReceive(
426
+ paymentHash,
427
+ wait,
428
+ token
429
+ );
434
430
  }
435
431
 
436
432
  /**
@@ -438,21 +434,21 @@ export function checkAndClaimLnReceive(
438
434
  * @param wait Whether to wait for the claim to complete.
439
435
  * @returns A promise that resolves on success or rejects on error.
440
436
  */
441
- export function checkAndClaimAllOpenLnReceives(wait: boolean): Promise<void> {
442
- return NitroArkHybridObject.checkAndClaimAllOpenLnReceives(wait);
437
+ export function tryClaimAllLightningReceives(wait: boolean): Promise<void> {
438
+ return NitroArkHybridObject.tryClaimAllLightningReceives(wait);
443
439
  }
444
440
 
445
441
  /**
446
- * Sends a Lightning payment.
442
+ * Pays a Bolt11 Lightning invoice.
447
443
  * @param destination The Lightning invoice.
448
444
  * @param amountSat The amount in satoshis to send. Use 0 for invoice amount.
449
445
  * @returns A promise resolving to a Bolt11PaymentResult object
450
446
  */
451
- export function sendLightningPayment(
447
+ export function payLightningInvoice(
452
448
  destination: string,
453
449
  amountSat?: number
454
450
  ): Promise<Bolt11PaymentResult> {
455
- return NitroArkHybridObject.sendLightningPayment(destination, amountSat);
451
+ return NitroArkHybridObject.payLightningInvoice(destination, amountSat);
456
452
  }
457
453
 
458
454
  /**
@@ -461,11 +457,11 @@ export function sendLightningPayment(
461
457
  * @param amountSat The amount in satoshis to send. Use 0 for invoice amount.
462
458
  * @returns A promise resolving to a Bolt12PaymentResult object
463
459
  */
464
- export function payOffer(
460
+ export function payLightningOffer(
465
461
  offer: string,
466
462
  amountSat?: number
467
463
  ): Promise<Bolt12PaymentResult> {
468
- return NitroArkHybridObject.payOffer(offer, amountSat);
464
+ return NitroArkHybridObject.payLightningOffer(offer, amountSat);
469
465
  }
470
466
 
471
467
  /**
@@ -475,12 +471,12 @@ export function payOffer(
475
471
  * @param comment An optional comment.
476
472
  * @returns A promise resolving to a LnurlPaymentResult object
477
473
  */
478
- export function sendLnaddr(
474
+ export function payLightningAddress(
479
475
  addr: string,
480
476
  amountSat: number,
481
477
  comment: string
482
478
  ): Promise<LnurlPaymentResult> {
483
- return NitroArkHybridObject.sendLnaddr(addr, amountSat, comment);
479
+ return NitroArkHybridObject.payLightningAddress(addr, amountSat, comment);
484
480
  }
485
481
 
486
482
  // --- Ark Operations ---
@@ -528,12 +524,12 @@ export function sendArkoorPayment(
528
524
  * Sends an onchain payment via an Ark round.
529
525
  * @param destination The destination Bitcoin address.
530
526
  * @param amountSat The amount in satoshis to send.
531
- * @returns A promise resolving to a JSON status string.
527
+ * @returns A promise resolving to the round status.
532
528
  */
533
529
  export function sendRoundOnchainPayment(
534
530
  destination: string,
535
531
  amountSat: number
536
- ): Promise<string> {
532
+ ): Promise<RoundStatus> {
537
533
  return NitroArkHybridObject.sendRoundOnchainPayment(destination, amountSat);
538
534
  }
539
535
 
@@ -543,23 +539,21 @@ export function sendRoundOnchainPayment(
543
539
  * Offboards specific VTXOs to a destination address.
544
540
  * @param vtxoIds Array of VtxoId strings to offboard.
545
541
  * @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
546
- * @param no_sync If true, skips synchronization with the wallet. Defaults to false.
547
- * @returns A promise resolving to a JSON result string.
542
+ * @returns A promise resolving to the round status.
548
543
  */
549
544
  export function offboardSpecific(
550
545
  vtxoIds: string[],
551
546
  destinationAddress: string
552
- ): Promise<string> {
547
+ ): Promise<RoundStatus> {
553
548
  return NitroArkHybridObject.offboardSpecific(vtxoIds, destinationAddress);
554
549
  }
555
550
 
556
551
  /**
557
552
  * Offboards all VTXOs to a destination address.
558
553
  * @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
559
- * @param no_sync If true, skips synchronization with the wallet. Defaults to false.
560
- * @returns A promise resolving to a JSON result string.
554
+ * @returns A promise resolving to the round status.
561
555
  */
562
- export function offboardAll(destinationAddress: string): Promise<string> {
556
+ export function offboardAll(destinationAddress: string): Promise<RoundStatus> {
563
557
  return NitroArkHybridObject.offboardAll(destinationAddress);
564
558
  }
565
559
 
@@ -583,4 +577,5 @@ export type {
583
577
  KeyPairResult,
584
578
  LightningReceive,
585
579
  LightningReceiveBalance,
580
+ RoundStatus,
586
581
  } from './NitroArk.nitro';