react-native-nitro-ark 0.0.47 → 0.0.49

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.
Files changed (27) hide show
  1. package/cpp/NitroArk.hpp +51 -5
  2. package/cpp/generated/ark_cxx.h +6 -0
  3. package/lib/module/index.js +18 -1
  4. package/lib/module/index.js.map +1 -1
  5. package/lib/typescript/src/NitroArk.nitro.d.ts +4 -0
  6. package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
  7. package/lib/typescript/src/index.d.ts +17 -1
  8. package/lib/typescript/src/index.d.ts.map +1 -1
  9. package/nitrogen/generated/shared/c++/ArkoorPaymentResult.hpp +11 -13
  10. package/nitrogen/generated/shared/c++/BarkArkInfo.hpp +4 -6
  11. package/nitrogen/generated/shared/c++/BarkConfigOpts.hpp +5 -7
  12. package/nitrogen/generated/shared/c++/BarkCreateOpts.hpp +7 -9
  13. package/nitrogen/generated/shared/c++/BarkSendManyOutput.hpp +4 -6
  14. package/nitrogen/generated/shared/c++/BarkVtxo.hpp +14 -8
  15. package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +2 -0
  16. package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +4 -2
  17. package/nitrogen/generated/shared/c++/KeyPairResult.hpp +4 -6
  18. package/nitrogen/generated/shared/c++/LightningPaymentResult.hpp +7 -9
  19. package/nitrogen/generated/shared/c++/LnurlPaymentResult.hpp +7 -9
  20. package/nitrogen/generated/shared/c++/NewAddressResult.hpp +4 -6
  21. package/nitrogen/generated/shared/c++/OffchainBalanceResult.hpp +4 -6
  22. package/nitrogen/generated/shared/c++/OnchainBalanceResult.hpp +4 -6
  23. package/nitrogen/generated/shared/c++/OnchainPaymentResult.hpp +7 -9
  24. package/nitrogen/generated/shared/c++/PaymentTypes.hpp +11 -13
  25. package/package.json +4 -4
  26. package/src/NitroArk.nitro.ts +5 -1
  27. package/src/index.tsx +18 -1
package/cpp/NitroArk.hpp CHANGED
@@ -48,7 +48,8 @@ public:
48
48
  }
49
49
 
50
50
  std::shared_ptr<Promise<void>>
51
- createWallet(const std::string &datadir, const BarkCreateOpts &opts) override {
51
+ createWallet(const std::string &datadir,
52
+ const BarkCreateOpts &opts) override {
52
53
  return Promise<void>::async([datadir, opts]() {
53
54
  try {
54
55
  bark_cxx::ConfigOpts config_opts;
@@ -145,6 +146,16 @@ public:
145
146
  });
146
147
  }
147
148
 
149
+ std::shared_ptr<Promise<void>> maintenanceRefresh() override {
150
+ return Promise<void>::async([]() {
151
+ try {
152
+ bark_cxx::maintenance_refresh();
153
+ } catch (const rust::Error &e) {
154
+ throw std::runtime_error(e.what());
155
+ }
156
+ });
157
+ }
158
+
148
159
  std::shared_ptr<Promise<void>> sync() override {
149
160
  return Promise<void>::async([]() {
150
161
  try {
@@ -227,7 +238,7 @@ public:
227
238
  keypair.public_key = std::string(keypair_rs.public_key.data(),
228
239
  keypair_rs.public_key.length());
229
240
  keypair.secret_key = std::string(keypair_rs.secret_key.data(),
230
- keypair_rs.secret_key.length());
241
+ keypair_rs.secret_key.length());
231
242
 
232
243
  return keypair;
233
244
  } catch (const rust::Error &e) {
@@ -245,7 +256,7 @@ public:
245
256
  keypair.public_key = std::string(keypair_rs.public_key.data(),
246
257
  keypair_rs.public_key.length());
247
258
  keypair.secret_key = std::string(keypair_rs.secret_key.data(),
248
- keypair_rs.secret_key.length());
259
+ keypair_rs.secret_key.length());
249
260
  return keypair;
250
261
  } catch (const rust::Error &e) {
251
262
  throw std::runtime_error(e.what());
@@ -272,8 +283,8 @@ public:
272
283
  });
273
284
  }
274
285
 
275
- std::shared_ptr<Promise<std::string>>
276
- signMessage(const std::string &message, double index) override {
286
+ std::shared_ptr<Promise<std::string>> signMessage(const std::string &message,
287
+ double index) override {
277
288
  return Promise<std::string>::async([message, index]() {
278
289
  try {
279
290
  uint32_t index_val = static_cast<uint32_t>(index);
@@ -306,9 +317,40 @@ public:
306
317
  BarkVtxo vtxo;
307
318
  vtxo.amount = static_cast<double>(rust_vtxo.amount);
308
319
  vtxo.expiry_height = static_cast<double>(rust_vtxo.expiry_height);
320
+ vtxo.asp_pubkey = std::string(rust_vtxo.asp_pubkey.data(),
321
+ rust_vtxo.asp_pubkey.length());
322
+ vtxo.exit_delta = static_cast<double>(rust_vtxo.exit_delta);
323
+ vtxo.anchor_point = std::string(rust_vtxo.anchor_point.data(),
324
+ rust_vtxo.anchor_point.length());
325
+ vtxo.point =
326
+ std::string(rust_vtxo.point.data(), rust_vtxo.point.length());
327
+ vtxos.push_back(vtxo);
328
+ }
329
+ return vtxos;
330
+ } catch (const rust::Error &e) {
331
+ throw std::runtime_error(e.what());
332
+ }
333
+ });
334
+ }
335
+
336
+ std::shared_ptr<Promise<std::vector<BarkVtxo>>>
337
+ getExpiringVtxos(double threshold) override {
338
+ return Promise<std::vector<BarkVtxo>>::async([threshold]() {
339
+ try {
340
+ rust::Vec<bark_cxx::BarkVtxo> rust_vtxos =
341
+ bark_cxx::get_expiring_vtxos(static_cast<uint32_t>(threshold));
342
+ std::vector<BarkVtxo> vtxos;
343
+ for (const auto &rust_vtxo : rust_vtxos) {
344
+ BarkVtxo vtxo;
345
+ vtxo.amount = static_cast<double>(rust_vtxo.amount);
346
+ vtxo.expiry_height = static_cast<double>(rust_vtxo.expiry_height);
347
+ vtxo.asp_pubkey = std::string(rust_vtxo.asp_pubkey.data(),
348
+ rust_vtxo.asp_pubkey.length());
309
349
  vtxo.exit_delta = static_cast<double>(rust_vtxo.exit_delta);
310
350
  vtxo.anchor_point = std::string(rust_vtxo.anchor_point.data(),
311
351
  rust_vtxo.anchor_point.length());
352
+ vtxo.point =
353
+ std::string(rust_vtxo.point.data(), rust_vtxo.point.length());
312
354
  vtxos.push_back(vtxo);
313
355
  }
314
356
  return vtxos;
@@ -586,9 +628,13 @@ public:
586
628
  BarkVtxo vtxo;
587
629
  vtxo.amount = static_cast<double>(rust_vtxo.amount);
588
630
  vtxo.expiry_height = static_cast<double>(rust_vtxo.expiry_height);
631
+ vtxo.asp_pubkey = std::string(rust_vtxo.asp_pubkey.data(),
632
+ rust_vtxo.asp_pubkey.length());
589
633
  vtxo.exit_delta = static_cast<double>(rust_vtxo.exit_delta);
590
634
  vtxo.anchor_point = std::string(rust_vtxo.anchor_point.data(),
591
635
  rust_vtxo.anchor_point.length());
636
+ vtxo.point =
637
+ std::string(rust_vtxo.point.data(), rust_vtxo.point.length());
592
638
  vtxos.push_back(vtxo);
593
639
  }
594
640
  result.vtxos = vtxos;
@@ -820,8 +820,10 @@ namespace bark_cxx {
820
820
  struct BarkVtxo final {
821
821
  ::std::uint64_t amount CXX_DEFAULT_VALUE(0);
822
822
  ::std::uint32_t expiry_height CXX_DEFAULT_VALUE(0);
823
+ ::rust::String asp_pubkey;
823
824
  ::std::uint16_t exit_delta CXX_DEFAULT_VALUE(0);
824
825
  ::rust::String anchor_point;
826
+ ::rust::String point;
825
827
 
826
828
  using IsRelocatable = ::std::true_type;
827
829
  };
@@ -1028,10 +1030,14 @@ bool verify_message(::rust::Str message, ::rust::Str signature, ::rust::Str publ
1028
1030
 
1029
1031
  ::rust::Vec<::bark_cxx::BarkVtxo> get_vtxos();
1030
1032
 
1033
+ ::rust::Vec<::bark_cxx::BarkVtxo> get_expiring_vtxos(::std::uint32_t threshold);
1034
+
1031
1035
  ::rust::String bolt11_invoice(::std::uint64_t amount_msat);
1032
1036
 
1033
1037
  void maintenance();
1034
1038
 
1039
+ void maintenance_refresh();
1040
+
1035
1041
  void sync();
1036
1042
 
1037
1043
  void sync_rounds();
@@ -68,6 +68,14 @@ export function maintenance() {
68
68
  return NitroArkHybridObject.maintenance();
69
69
  }
70
70
 
71
+ /**
72
+ * Refreshes vtxos that need to be refreshed.
73
+ * @returns A promise that resolves on success.
74
+ */
75
+ export function maintenanceRefresh() {
76
+ return NitroArkHybridObject.maintenanceRefresh();
77
+ }
78
+
71
79
  /**
72
80
  * Synchronizes the wallet with the blockchain.
73
81
  * @returns A promise that resolves on success.
@@ -165,6 +173,15 @@ export function getVtxos() {
165
173
  return NitroArkHybridObject.getVtxos();
166
174
  }
167
175
 
176
+ /**
177
+ * Gets the list of expiring VTXOs as a JSON Object of type BarkVtxo.
178
+ * @param threshold The block height threshold to check for expiring VTXOs.
179
+ * @returns A promise resolving BarkVtxo[] array.
180
+
181
+ export function getExpiringVtxos(threshold: number): Promise<BarkVtxo[]> {
182
+ return NitroArkHybridObject.getExpiringVtxos(threshold);
183
+ }
184
+
168
185
  // --- Onchain Operations ---
169
186
 
170
187
  /**
@@ -184,7 +201,7 @@ export function onchainSync() {
184
201
  }
185
202
 
186
203
  /**
187
- * Gets the list of unspent onchain outputs as a JSON string for the loaded wallet.
204
+ * Gets the list of unspent onchain outputs as a JSON Object of type BarkVtxo.
188
205
  * @returns A promise resolving to the JSON string of unspent outputs.
189
206
  */
190
207
  export function onchainListUnspent() {
@@ -1 +1 @@
1
- {"version":3,"names":["NitroModules","NitroArkHybridObject","createHybridObject","createMnemonic","createWallet","datadir","opts","loadWallet","mnemonic","closeWallet","isWalletLoaded","persistConfig","maintenance","sync","syncExits","syncRounds","getArkInfo","offchainBalance","deriveStoreNextKeypair","peakKeyPair","index","newAddress","signMessage","message","verifyMessage","signature","publicKey","getVtxos","onchainBalance","onchainSync","onchainListUnspent","onchainUtxos","onchainAddress","onchainSend","destination","amountSat","onchainDrain","onchainSendMany","outputs","bolt11Invoice","amountMsat","finishLightningReceive","bolt11","sendLightningPayment","sendLnaddr","addr","comment","boardAmount","boardAll","sendArkoorPayment","sendRoundOnchainPayment","offboardSpecific","vtxoIds","destinationAddress","offboardAll"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAkBzD;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,cA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASS,UAAUA,CACxBC,IAAY,EACZV,SAAiB,EACjBW,OAAe,EACc;EAC7B,OAAO7C,oBAAoB,CAAC2C,UAAU,CAACC,IAAI,EAAEV,SAAS,EAAEW,OAAO,CAAC;AAClE;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACZ,SAAiB,EAAmB;EAC9D,OAAOlC,oBAAoB,CAAC8C,WAAW,CAACZ,SAAS,CAAC;AACpD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASa,QAAQA,CAAA,EAAoB;EAC1C,OAAO/C,oBAAoB,CAAC+C,QAAQ,CAAC,CAAC;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAC/Bf,WAAmB,EACnBC,SAAiB,EACa;EAC9B,OAAOlC,oBAAoB,CAACgD,iBAAiB,CAACf,WAAW,EAAEC,SAAS,CAAC;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASe,uBAAuBA,CACrChB,WAAmB,EACnBC,SAAiB,EACA;EACjB,OAAOlC,oBAAoB,CAACiD,uBAAuB,CAAChB,WAAW,EAAEC,SAAS,CAAC;AAC7E;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASgB,gBAAgBA,CAC9BC,OAAiB,EACjBC,kBAA0B,EACT;EACjB,OAAOpD,oBAAoB,CAACkD,gBAAgB,CAACC,OAAO,EAAEC,kBAAkB,CAAC;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACD,kBAA0B,EAAmB;EACvE,OAAOpD,oBAAoB,CAACqD,WAAW,CAACD,kBAAkB,CAAC;AAC7D;;AAEA","ignoreList":[]}
1
+ {"version":3,"names":["NitroModules","NitroArkHybridObject","createHybridObject","createMnemonic","createWallet","datadir","opts","loadWallet","mnemonic","closeWallet","isWalletLoaded","persistConfig","maintenance","maintenanceRefresh","sync","syncExits","syncRounds","getArkInfo","offchainBalance","deriveStoreNextKeypair","peakKeyPair","index","newAddress","signMessage","message","verifyMessage","signature","publicKey","getVtxos","onchainBalance","onchainSync","onchainListUnspent","onchainUtxos","onchainAddress","onchainSend","destination","amountSat","onchainDrain","onchainSendMany","outputs","bolt11Invoice","amountMsat","finishLightningReceive","bolt11","sendLightningPayment","sendLnaddr","addr","comment","boardAmount","boardAll","sendArkoorPayment","sendRoundOnchainPayment","offboardSpecific","vtxoIds","destinationAddress","offboardAll"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAkBzD;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,CAACF,OAAe,EAAEG,QAAgB,EAAiB;EAC3E,OAAOP,oBAAoB,CAACM,UAAU,CAACF,OAAO,EAAEG,QAAQ,CAAC;AAC3D;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAA,EAAkB;EAC3C,OAAOR,oBAAoB,CAACQ,WAAW,CAAC,CAAC;AAC3C;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAqB;EACjD,OAAOT,oBAAoB,CAACS,cAAc,CAAC,CAAC;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAC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;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAC/Bf,WAAmB,EACnBC,SAAiB,EACa;EAC9B,OAAOnC,oBAAoB,CAACiD,iBAAiB,CAACf,WAAW,EAAEC,SAAS,CAAC;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASe,uBAAuBA,CACrChB,WAAmB,EACnBC,SAAiB,EACA;EACjB,OAAOnC,oBAAoB,CAACkD,uBAAuB,CAAChB,WAAW,EAAEC,SAAS,CAAC;AAC7E;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASgB,gBAAgBA,CAC9BC,OAAiB,EACjBC,kBAA0B,EACT;EACjB,OAAOrD,oBAAoB,CAACmD,gBAAgB,CAACC,OAAO,EAAEC,kBAAkB,CAAC;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACD,kBAA0B,EAAmB;EACvE,OAAOrD,oBAAoB,CAACsD,WAAW,CAACD,kBAAkB,CAAC;AAC7D;;AAEA","ignoreList":[]}
@@ -33,8 +33,10 @@ export interface BarkSendManyOutput {
33
33
  export interface BarkVtxo {
34
34
  amount: number;
35
35
  expiry_height: number;
36
+ asp_pubkey: string;
36
37
  exit_delta: number;
37
38
  anchor_point: string;
39
+ point: string;
38
40
  }
39
41
  export type PaymentTypes = 'Bolt11' | 'Lnurl' | 'Arkoor' | 'Onchain';
40
42
  export interface ArkoorPaymentResult {
@@ -91,6 +93,7 @@ export interface NitroArk extends HybridObject<{
91
93
  closeWallet(): Promise<void>;
92
94
  persistConfig(opts: BarkConfigOpts): Promise<void>;
93
95
  maintenance(): Promise<void>;
96
+ maintenanceRefresh(): Promise<void>;
94
97
  sync(): Promise<void>;
95
98
  syncExits(): Promise<void>;
96
99
  syncRounds(): Promise<void>;
@@ -102,6 +105,7 @@ export interface NitroArk extends HybridObject<{
102
105
  signMessage(message: string, index: number): Promise<string>;
103
106
  verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
104
107
  getVtxos(): Promise<BarkVtxo[]>;
108
+ getExpiringVtxos(threshold: number): Promise<BarkVtxo[]>;
105
109
  onchainBalance(): Promise<OnchainBalanceResult>;
106
110
  onchainSync(): Promise<void>;
107
111
  onchainListUnspent(): Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"NitroArk.nitro.d.ts","sourceRoot":"","sources":["../../../src/NitroArk.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM/D,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAGD,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,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CAAC,CAAC;IAC5B,iBAAiB,CACf,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,oBAAoB,CAClB,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACnC,UAAU,CACR,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC/B,uBAAuB,CACrB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAAC;IAGnB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACnD,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAGtD,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"}
@@ -41,6 +41,11 @@ export declare function persistConfig(opts: BarkConfigOpts): Promise<void>;
41
41
  * @returns A promise that resolves on success.
42
42
  */
43
43
  export declare function maintenance(): Promise<void>;
44
+ /**
45
+ * Refreshes vtxos that need to be refreshed.
46
+ * @returns A promise that resolves on success.
47
+ */
48
+ export declare function maintenanceRefresh(): Promise<void>;
44
49
  /**
45
50
  * Synchronizes the wallet with the blockchain.
46
51
  * @returns A promise that resolves on success.
@@ -103,6 +108,17 @@ export declare function verifyMessage(message: string, signature: string, public
103
108
  * @returns A promise resolving BarkVtxo[] array.
104
109
  */
105
110
  export declare function getVtxos(): Promise<BarkVtxo[]>;
111
+ /**
112
+ * Gets the list of expiring VTXOs as a JSON Object of type BarkVtxo.
113
+ * @param threshold The block height threshold to check for expiring VTXOs.
114
+ * @returns A promise resolving BarkVtxo[] array.
115
+
116
+ export function getExpiringVtxos(threshold: number): Promise<BarkVtxo[]> {
117
+ return NitroArkHybridObject.getExpiringVtxos(threshold);
118
+ }
119
+
120
+ // --- Onchain Operations ---
121
+
106
122
  /**
107
123
  * Gets the onchain balance for the loaded wallet.
108
124
  * @returns A promise resolving to the OnchainBalanceResult object.
@@ -114,7 +130,7 @@ export declare function onchainBalance(): Promise<OnchainBalanceResult>;
114
130
  */
115
131
  export declare function onchainSync(): Promise<void>;
116
132
  /**
117
- * Gets the list of unspent onchain outputs as a JSON string for the loaded wallet.
133
+ * Gets the list of unspent onchain outputs as a JSON Object of type BarkVtxo.
118
134
  * @returns A promise resolving to the JSON string of unspent outputs.
119
135
  */
120
136
  export declare function onchainListUnspent(): Promise<string>;
@@ -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,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACd,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,oBAAoB,UACsB,CAAC;AAIxD;;;GAGG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAEhD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3E;AAED;;;GAGG;AACH,wBAAgB,WAAW,I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,OAAO,CAAC,sBAAsB,CAAC,CAEjC;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,CAE7B;AAID;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9D;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,mBAAmB,CAAC,CAE9B;AAED;;;;;GAKG;AACH,wBAAgB,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,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,GACd,MAAM,kBAAkB,CAAC"}
@@ -24,8 +24,8 @@ namespace margelo::nitro::nitroark { struct BarkVtxo; }
24
24
  namespace margelo::nitro::nitroark { enum class PaymentTypes; }
25
25
 
26
26
  #include <string>
27
- #include <vector>
28
27
  #include "BarkVtxo.hpp"
28
+ #include <vector>
29
29
  #include "PaymentTypes.hpp"
30
30
 
31
31
  namespace margelo::nitro::nitroark {
@@ -49,26 +49,24 @@ namespace margelo::nitro::nitroark {
49
49
 
50
50
  namespace margelo::nitro {
51
51
 
52
- using namespace margelo::nitro::nitroark;
53
-
54
52
  // C++ ArkoorPaymentResult <> JS ArkoorPaymentResult (object)
55
53
  template <>
56
- struct JSIConverter<ArkoorPaymentResult> final {
57
- static inline ArkoorPaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
+ struct JSIConverter<margelo::nitro::nitroark::ArkoorPaymentResult> final {
55
+ static inline margelo::nitro::nitroark::ArkoorPaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
58
56
  jsi::Object obj = arg.asObject(runtime);
59
- return ArkoorPaymentResult(
57
+ return margelo::nitro::nitroark::ArkoorPaymentResult(
60
58
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "amount_sat")),
61
59
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "destination_pubkey")),
62
- JSIConverter<std::vector<BarkVtxo>>::fromJSI(runtime, obj.getProperty(runtime, "vtxos")),
63
- JSIConverter<PaymentTypes>::fromJSI(runtime, obj.getProperty(runtime, "payment_type"))
60
+ JSIConverter<std::vector<margelo::nitro::nitroark::BarkVtxo>>::fromJSI(runtime, obj.getProperty(runtime, "vtxos")),
61
+ JSIConverter<margelo::nitro::nitroark::PaymentTypes>::fromJSI(runtime, obj.getProperty(runtime, "payment_type"))
64
62
  );
65
63
  }
66
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const ArkoorPaymentResult& arg) {
64
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::ArkoorPaymentResult& arg) {
67
65
  jsi::Object obj(runtime);
68
66
  obj.setProperty(runtime, "amount_sat", JSIConverter<double>::toJSI(runtime, arg.amount_sat));
69
67
  obj.setProperty(runtime, "destination_pubkey", JSIConverter<std::string>::toJSI(runtime, arg.destination_pubkey));
70
- obj.setProperty(runtime, "vtxos", JSIConverter<std::vector<BarkVtxo>>::toJSI(runtime, arg.vtxos));
71
- obj.setProperty(runtime, "payment_type", JSIConverter<PaymentTypes>::toJSI(runtime, arg.payment_type));
68
+ obj.setProperty(runtime, "vtxos", JSIConverter<std::vector<margelo::nitro::nitroark::BarkVtxo>>::toJSI(runtime, arg.vtxos));
69
+ obj.setProperty(runtime, "payment_type", JSIConverter<margelo::nitro::nitroark::PaymentTypes>::toJSI(runtime, arg.payment_type));
72
70
  return obj;
73
71
  }
74
72
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -78,8 +76,8 @@ namespace margelo::nitro {
78
76
  jsi::Object obj = value.getObject(runtime);
79
77
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "amount_sat"))) return false;
80
78
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "destination_pubkey"))) return false;
81
- if (!JSIConverter<std::vector<BarkVtxo>>::canConvert(runtime, obj.getProperty(runtime, "vtxos"))) return false;
82
- if (!JSIConverter<PaymentTypes>::canConvert(runtime, obj.getProperty(runtime, "payment_type"))) return false;
79
+ if (!JSIConverter<std::vector<margelo::nitro::nitroark::BarkVtxo>>::canConvert(runtime, obj.getProperty(runtime, "vtxos"))) return false;
80
+ if (!JSIConverter<margelo::nitro::nitroark::PaymentTypes>::canConvert(runtime, obj.getProperty(runtime, "payment_type"))) return false;
83
81
  return true;
84
82
  }
85
83
  };
@@ -46,14 +46,12 @@ namespace margelo::nitro::nitroark {
46
46
 
47
47
  namespace margelo::nitro {
48
48
 
49
- using namespace margelo::nitro::nitroark;
50
-
51
49
  // C++ BarkArkInfo <> JS BarkArkInfo (object)
52
50
  template <>
53
- struct JSIConverter<BarkArkInfo> final {
54
- static inline BarkArkInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
51
+ struct JSIConverter<margelo::nitro::nitroark::BarkArkInfo> final {
52
+ static inline margelo::nitro::nitroark::BarkArkInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
55
53
  jsi::Object obj = arg.asObject(runtime);
56
- return BarkArkInfo(
54
+ return margelo::nitro::nitroark::BarkArkInfo(
57
55
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "network")),
58
56
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "asp_pubkey")),
59
57
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "round_interval_secs")),
@@ -63,7 +61,7 @@ namespace margelo::nitro {
63
61
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "max_vtxo_amount_sat"))
64
62
  );
65
63
  }
66
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const BarkArkInfo& arg) {
64
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkArkInfo& arg) {
67
65
  jsi::Object obj(runtime);
68
66
  obj.setProperty(runtime, "network", JSIConverter<std::string>::toJSI(runtime, arg.network));
69
67
  obj.setProperty(runtime, "asp_pubkey", JSIConverter<std::string>::toJSI(runtime, arg.asp_pubkey));
@@ -20,8 +20,8 @@
20
20
 
21
21
 
22
22
 
23
- #include <optional>
24
23
  #include <string>
24
+ #include <optional>
25
25
 
26
26
  namespace margelo::nitro::nitroark {
27
27
 
@@ -48,14 +48,12 @@ namespace margelo::nitro::nitroark {
48
48
 
49
49
  namespace margelo::nitro {
50
50
 
51
- using namespace margelo::nitro::nitroark;
52
-
53
51
  // C++ BarkConfigOpts <> JS BarkConfigOpts (object)
54
52
  template <>
55
- struct JSIConverter<BarkConfigOpts> final {
56
- static inline BarkConfigOpts fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
+ struct JSIConverter<margelo::nitro::nitroark::BarkConfigOpts> final {
54
+ static inline margelo::nitro::nitroark::BarkConfigOpts fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
57
55
  jsi::Object obj = arg.asObject(runtime);
58
- return BarkConfigOpts(
56
+ return margelo::nitro::nitroark::BarkConfigOpts(
59
57
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "asp")),
60
58
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "esplora")),
61
59
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "bitcoind")),
@@ -66,7 +64,7 @@ namespace margelo::nitro {
66
64
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "fallback_fee_rate"))
67
65
  );
68
66
  }
69
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const BarkConfigOpts& arg) {
67
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkConfigOpts& arg) {
70
68
  jsi::Object obj(runtime);
71
69
  obj.setProperty(runtime, "asp", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.asp));
72
70
  obj.setProperty(runtime, "esplora", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.esplora));
@@ -48,30 +48,28 @@ namespace margelo::nitro::nitroark {
48
48
 
49
49
  namespace margelo::nitro {
50
50
 
51
- using namespace margelo::nitro::nitroark;
52
-
53
51
  // C++ BarkCreateOpts <> JS BarkCreateOpts (object)
54
52
  template <>
55
- struct JSIConverter<BarkCreateOpts> final {
56
- static inline BarkCreateOpts fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
+ struct JSIConverter<margelo::nitro::nitroark::BarkCreateOpts> final {
54
+ static inline margelo::nitro::nitroark::BarkCreateOpts fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
57
55
  jsi::Object obj = arg.asObject(runtime);
58
- return BarkCreateOpts(
56
+ return margelo::nitro::nitroark::BarkCreateOpts(
59
57
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "regtest")),
60
58
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "signet")),
61
59
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "bitcoin")),
62
60
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "mnemonic")),
63
61
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "birthday_height")),
64
- JSIConverter<std::optional<BarkConfigOpts>>::fromJSI(runtime, obj.getProperty(runtime, "config"))
62
+ JSIConverter<std::optional<margelo::nitro::nitroark::BarkConfigOpts>>::fromJSI(runtime, obj.getProperty(runtime, "config"))
65
63
  );
66
64
  }
67
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const BarkCreateOpts& arg) {
65
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkCreateOpts& arg) {
68
66
  jsi::Object obj(runtime);
69
67
  obj.setProperty(runtime, "regtest", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.regtest));
70
68
  obj.setProperty(runtime, "signet", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.signet));
71
69
  obj.setProperty(runtime, "bitcoin", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.bitcoin));
72
70
  obj.setProperty(runtime, "mnemonic", JSIConverter<std::string>::toJSI(runtime, arg.mnemonic));
73
71
  obj.setProperty(runtime, "birthday_height", JSIConverter<std::optional<double>>::toJSI(runtime, arg.birthday_height));
74
- obj.setProperty(runtime, "config", JSIConverter<std::optional<BarkConfigOpts>>::toJSI(runtime, arg.config));
72
+ obj.setProperty(runtime, "config", JSIConverter<std::optional<margelo::nitro::nitroark::BarkConfigOpts>>::toJSI(runtime, arg.config));
75
73
  return obj;
76
74
  }
77
75
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -84,7 +82,7 @@ namespace margelo::nitro {
84
82
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "bitcoin"))) return false;
85
83
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "mnemonic"))) return false;
86
84
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "birthday_height"))) return false;
87
- if (!JSIConverter<std::optional<BarkConfigOpts>>::canConvert(runtime, obj.getProperty(runtime, "config"))) return false;
85
+ if (!JSIConverter<std::optional<margelo::nitro::nitroark::BarkConfigOpts>>::canConvert(runtime, obj.getProperty(runtime, "config"))) return false;
88
86
  return true;
89
87
  }
90
88
  };
@@ -41,19 +41,17 @@ namespace margelo::nitro::nitroark {
41
41
 
42
42
  namespace margelo::nitro {
43
43
 
44
- using namespace margelo::nitro::nitroark;
45
-
46
44
  // C++ BarkSendManyOutput <> JS BarkSendManyOutput (object)
47
45
  template <>
48
- struct JSIConverter<BarkSendManyOutput> final {
49
- static inline BarkSendManyOutput fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
46
+ struct JSIConverter<margelo::nitro::nitroark::BarkSendManyOutput> final {
47
+ static inline margelo::nitro::nitroark::BarkSendManyOutput fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
50
48
  jsi::Object obj = arg.asObject(runtime);
51
- return BarkSendManyOutput(
49
+ return margelo::nitro::nitroark::BarkSendManyOutput(
52
50
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "destination")),
53
51
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "amountSat"))
54
52
  );
55
53
  }
56
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const BarkSendManyOutput& arg) {
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkSendManyOutput& arg) {
57
55
  jsi::Object obj(runtime);
58
56
  obj.setProperty(runtime, "destination", JSIConverter<std::string>::toJSI(runtime, arg.destination));
59
57
  obj.setProperty(runtime, "amountSat", JSIConverter<double>::toJSI(runtime, arg.amountSat));
@@ -31,38 +31,42 @@ namespace margelo::nitro::nitroark {
31
31
  public:
32
32
  double amount SWIFT_PRIVATE;
33
33
  double expiry_height SWIFT_PRIVATE;
34
+ std::string asp_pubkey SWIFT_PRIVATE;
34
35
  double exit_delta SWIFT_PRIVATE;
35
36
  std::string anchor_point SWIFT_PRIVATE;
37
+ std::string point SWIFT_PRIVATE;
36
38
 
37
39
  public:
38
40
  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) {}
41
+ explicit BarkVtxo(double amount, double expiry_height, std::string asp_pubkey, double exit_delta, std::string anchor_point, std::string point): amount(amount), expiry_height(expiry_height), asp_pubkey(asp_pubkey), exit_delta(exit_delta), anchor_point(anchor_point), point(point) {}
40
42
  };
41
43
 
42
44
  } // namespace margelo::nitro::nitroark
43
45
 
44
46
  namespace margelo::nitro {
45
47
 
46
- using namespace margelo::nitro::nitroark;
47
-
48
48
  // C++ BarkVtxo <> JS BarkVtxo (object)
49
49
  template <>
50
- struct JSIConverter<BarkVtxo> final {
51
- static inline BarkVtxo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
50
+ struct JSIConverter<margelo::nitro::nitroark::BarkVtxo> final {
51
+ static inline margelo::nitro::nitroark::BarkVtxo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
52
52
  jsi::Object obj = arg.asObject(runtime);
53
- return BarkVtxo(
53
+ return margelo::nitro::nitroark::BarkVtxo(
54
54
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "amount")),
55
55
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "expiry_height")),
56
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "asp_pubkey")),
56
57
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "exit_delta")),
57
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "anchor_point"))
58
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "anchor_point")),
59
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "point"))
58
60
  );
59
61
  }
60
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const BarkVtxo& arg) {
62
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkVtxo& arg) {
61
63
  jsi::Object obj(runtime);
62
64
  obj.setProperty(runtime, "amount", JSIConverter<double>::toJSI(runtime, arg.amount));
63
65
  obj.setProperty(runtime, "expiry_height", JSIConverter<double>::toJSI(runtime, arg.expiry_height));
66
+ obj.setProperty(runtime, "asp_pubkey", JSIConverter<std::string>::toJSI(runtime, arg.asp_pubkey));
64
67
  obj.setProperty(runtime, "exit_delta", JSIConverter<double>::toJSI(runtime, arg.exit_delta));
65
68
  obj.setProperty(runtime, "anchor_point", JSIConverter<std::string>::toJSI(runtime, arg.anchor_point));
69
+ obj.setProperty(runtime, "point", JSIConverter<std::string>::toJSI(runtime, arg.point));
66
70
  return obj;
67
71
  }
68
72
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -72,8 +76,10 @@ namespace margelo::nitro {
72
76
  jsi::Object obj = value.getObject(runtime);
73
77
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "amount"))) return false;
74
78
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "expiry_height"))) return false;
79
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "asp_pubkey"))) return false;
75
80
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "exit_delta"))) return false;
76
81
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "anchor_point"))) return false;
82
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "point"))) return false;
77
83
  return true;
78
84
  }
79
85
  };
@@ -21,6 +21,7 @@ namespace margelo::nitro::nitroark {
21
21
  prototype.registerHybridMethod("closeWallet", &HybridNitroArkSpec::closeWallet);
22
22
  prototype.registerHybridMethod("persistConfig", &HybridNitroArkSpec::persistConfig);
23
23
  prototype.registerHybridMethod("maintenance", &HybridNitroArkSpec::maintenance);
24
+ prototype.registerHybridMethod("maintenanceRefresh", &HybridNitroArkSpec::maintenanceRefresh);
24
25
  prototype.registerHybridMethod("sync", &HybridNitroArkSpec::sync);
25
26
  prototype.registerHybridMethod("syncExits", &HybridNitroArkSpec::syncExits);
26
27
  prototype.registerHybridMethod("syncRounds", &HybridNitroArkSpec::syncRounds);
@@ -32,6 +33,7 @@ namespace margelo::nitro::nitroark {
32
33
  prototype.registerHybridMethod("signMessage", &HybridNitroArkSpec::signMessage);
33
34
  prototype.registerHybridMethod("verifyMessage", &HybridNitroArkSpec::verifyMessage);
34
35
  prototype.registerHybridMethod("getVtxos", &HybridNitroArkSpec::getVtxos);
36
+ prototype.registerHybridMethod("getExpiringVtxos", &HybridNitroArkSpec::getExpiringVtxos);
35
37
  prototype.registerHybridMethod("onchainBalance", &HybridNitroArkSpec::onchainBalance);
36
38
  prototype.registerHybridMethod("onchainSync", &HybridNitroArkSpec::onchainSync);
37
39
  prototype.registerHybridMethod("onchainListUnspent", &HybridNitroArkSpec::onchainListUnspent);
@@ -40,16 +40,16 @@ namespace margelo::nitro::nitroark { struct LightningPaymentResult; }
40
40
  // Forward declaration of `LnurlPaymentResult` to properly resolve imports.
41
41
  namespace margelo::nitro::nitroark { struct LnurlPaymentResult; }
42
42
 
43
- #include <NitroModules/Promise.hpp>
44
43
  #include <string>
44
+ #include <NitroModules/Promise.hpp>
45
45
  #include "BarkCreateOpts.hpp"
46
46
  #include "BarkConfigOpts.hpp"
47
47
  #include "BarkArkInfo.hpp"
48
48
  #include "OffchainBalanceResult.hpp"
49
49
  #include "KeyPairResult.hpp"
50
50
  #include "NewAddressResult.hpp"
51
- #include <vector>
52
51
  #include "BarkVtxo.hpp"
52
+ #include <vector>
53
53
  #include "OnchainBalanceResult.hpp"
54
54
  #include "OnchainPaymentResult.hpp"
55
55
  #include <optional>
@@ -96,6 +96,7 @@ namespace margelo::nitro::nitroark {
96
96
  virtual std::shared_ptr<Promise<void>> closeWallet() = 0;
97
97
  virtual std::shared_ptr<Promise<void>> persistConfig(const BarkConfigOpts& opts) = 0;
98
98
  virtual std::shared_ptr<Promise<void>> maintenance() = 0;
99
+ virtual std::shared_ptr<Promise<void>> maintenanceRefresh() = 0;
99
100
  virtual std::shared_ptr<Promise<void>> sync() = 0;
100
101
  virtual std::shared_ptr<Promise<void>> syncExits() = 0;
101
102
  virtual std::shared_ptr<Promise<void>> syncRounds() = 0;
@@ -107,6 +108,7 @@ namespace margelo::nitro::nitroark {
107
108
  virtual std::shared_ptr<Promise<std::string>> signMessage(const std::string& message, double index) = 0;
108
109
  virtual std::shared_ptr<Promise<bool>> verifyMessage(const std::string& message, const std::string& signature, const std::string& publicKey) = 0;
109
110
  virtual std::shared_ptr<Promise<std::vector<BarkVtxo>>> getVtxos() = 0;
111
+ virtual std::shared_ptr<Promise<std::vector<BarkVtxo>>> getExpiringVtxos(double threshold) = 0;
110
112
  virtual std::shared_ptr<Promise<OnchainBalanceResult>> onchainBalance() = 0;
111
113
  virtual std::shared_ptr<Promise<void>> onchainSync() = 0;
112
114
  virtual std::shared_ptr<Promise<std::string>> onchainListUnspent() = 0;
@@ -41,19 +41,17 @@ namespace margelo::nitro::nitroark {
41
41
 
42
42
  namespace margelo::nitro {
43
43
 
44
- using namespace margelo::nitro::nitroark;
45
-
46
44
  // C++ KeyPairResult <> JS KeyPairResult (object)
47
45
  template <>
48
- struct JSIConverter<KeyPairResult> final {
49
- static inline KeyPairResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
46
+ struct JSIConverter<margelo::nitro::nitroark::KeyPairResult> final {
47
+ static inline margelo::nitro::nitroark::KeyPairResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
50
48
  jsi::Object obj = arg.asObject(runtime);
51
- return KeyPairResult(
49
+ return margelo::nitro::nitroark::KeyPairResult(
52
50
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "public_key")),
53
51
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "secret_key"))
54
52
  );
55
53
  }
56
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const KeyPairResult& arg) {
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::KeyPairResult& arg) {
57
55
  jsi::Object obj(runtime);
58
56
  obj.setProperty(runtime, "public_key", JSIConverter<std::string>::toJSI(runtime, arg.public_key));
59
57
  obj.setProperty(runtime, "secret_key", JSIConverter<std::string>::toJSI(runtime, arg.secret_key));
@@ -44,24 +44,22 @@ namespace margelo::nitro::nitroark {
44
44
 
45
45
  namespace margelo::nitro {
46
46
 
47
- using namespace margelo::nitro::nitroark;
48
-
49
47
  // C++ LightningPaymentResult <> JS LightningPaymentResult (object)
50
48
  template <>
51
- struct JSIConverter<LightningPaymentResult> final {
52
- static inline LightningPaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ struct JSIConverter<margelo::nitro::nitroark::LightningPaymentResult> final {
50
+ static inline margelo::nitro::nitroark::LightningPaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
51
  jsi::Object obj = arg.asObject(runtime);
54
- return LightningPaymentResult(
52
+ return margelo::nitro::nitroark::LightningPaymentResult(
55
53
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "bolt11_invoice")),
56
54
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "preimage")),
57
- JSIConverter<PaymentTypes>::fromJSI(runtime, obj.getProperty(runtime, "payment_type"))
55
+ JSIConverter<margelo::nitro::nitroark::PaymentTypes>::fromJSI(runtime, obj.getProperty(runtime, "payment_type"))
58
56
  );
59
57
  }
60
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const LightningPaymentResult& arg) {
58
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::LightningPaymentResult& arg) {
61
59
  jsi::Object obj(runtime);
62
60
  obj.setProperty(runtime, "bolt11_invoice", JSIConverter<std::string>::toJSI(runtime, arg.bolt11_invoice));
63
61
  obj.setProperty(runtime, "preimage", JSIConverter<std::string>::toJSI(runtime, arg.preimage));
64
- obj.setProperty(runtime, "payment_type", JSIConverter<PaymentTypes>::toJSI(runtime, arg.payment_type));
62
+ obj.setProperty(runtime, "payment_type", JSIConverter<margelo::nitro::nitroark::PaymentTypes>::toJSI(runtime, arg.payment_type));
65
63
  return obj;
66
64
  }
67
65
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -71,7 +69,7 @@ namespace margelo::nitro {
71
69
  jsi::Object obj = value.getObject(runtime);
72
70
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "bolt11_invoice"))) return false;
73
71
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "preimage"))) return false;
74
- if (!JSIConverter<PaymentTypes>::canConvert(runtime, obj.getProperty(runtime, "payment_type"))) return false;
72
+ if (!JSIConverter<margelo::nitro::nitroark::PaymentTypes>::canConvert(runtime, obj.getProperty(runtime, "payment_type"))) return false;
75
73
  return true;
76
74
  }
77
75
  };
@@ -45,26 +45,24 @@ namespace margelo::nitro::nitroark {
45
45
 
46
46
  namespace margelo::nitro {
47
47
 
48
- using namespace margelo::nitro::nitroark;
49
-
50
48
  // C++ LnurlPaymentResult <> JS LnurlPaymentResult (object)
51
49
  template <>
52
- struct JSIConverter<LnurlPaymentResult> final {
53
- static inline LnurlPaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
50
+ struct JSIConverter<margelo::nitro::nitroark::LnurlPaymentResult> final {
51
+ static inline margelo::nitro::nitroark::LnurlPaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
52
  jsi::Object obj = arg.asObject(runtime);
55
- return LnurlPaymentResult(
53
+ return margelo::nitro::nitroark::LnurlPaymentResult(
56
54
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "lnurl")),
57
55
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "bolt11_invoice")),
58
56
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "preimage")),
59
- JSIConverter<PaymentTypes>::fromJSI(runtime, obj.getProperty(runtime, "payment_type"))
57
+ JSIConverter<margelo::nitro::nitroark::PaymentTypes>::fromJSI(runtime, obj.getProperty(runtime, "payment_type"))
60
58
  );
61
59
  }
62
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const LnurlPaymentResult& arg) {
60
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::LnurlPaymentResult& arg) {
63
61
  jsi::Object obj(runtime);
64
62
  obj.setProperty(runtime, "lnurl", JSIConverter<std::string>::toJSI(runtime, arg.lnurl));
65
63
  obj.setProperty(runtime, "bolt11_invoice", JSIConverter<std::string>::toJSI(runtime, arg.bolt11_invoice));
66
64
  obj.setProperty(runtime, "preimage", JSIConverter<std::string>::toJSI(runtime, arg.preimage));
67
- obj.setProperty(runtime, "payment_type", JSIConverter<PaymentTypes>::toJSI(runtime, arg.payment_type));
65
+ obj.setProperty(runtime, "payment_type", JSIConverter<margelo::nitro::nitroark::PaymentTypes>::toJSI(runtime, arg.payment_type));
68
66
  return obj;
69
67
  }
70
68
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -75,7 +73,7 @@ namespace margelo::nitro {
75
73
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "lnurl"))) return false;
76
74
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "bolt11_invoice"))) return false;
77
75
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "preimage"))) return false;
78
- if (!JSIConverter<PaymentTypes>::canConvert(runtime, obj.getProperty(runtime, "payment_type"))) return false;
76
+ if (!JSIConverter<margelo::nitro::nitroark::PaymentTypes>::canConvert(runtime, obj.getProperty(runtime, "payment_type"))) return false;
79
77
  return true;
80
78
  }
81
79
  };
@@ -42,20 +42,18 @@ namespace margelo::nitro::nitroark {
42
42
 
43
43
  namespace margelo::nitro {
44
44
 
45
- using namespace margelo::nitro::nitroark;
46
-
47
45
  // C++ NewAddressResult <> JS NewAddressResult (object)
48
46
  template <>
49
- struct JSIConverter<NewAddressResult> final {
50
- static inline NewAddressResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
47
+ struct JSIConverter<margelo::nitro::nitroark::NewAddressResult> final {
48
+ static inline margelo::nitro::nitroark::NewAddressResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
51
49
  jsi::Object obj = arg.asObject(runtime);
52
- return NewAddressResult(
50
+ return margelo::nitro::nitroark::NewAddressResult(
53
51
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "user_pubkey")),
54
52
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "ark_id")),
55
53
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "address"))
56
54
  );
57
55
  }
58
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const NewAddressResult& arg) {
56
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::NewAddressResult& arg) {
59
57
  jsi::Object obj(runtime);
60
58
  obj.setProperty(runtime, "user_pubkey", JSIConverter<std::string>::toJSI(runtime, arg.user_pubkey));
61
59
  obj.setProperty(runtime, "ark_id", JSIConverter<std::string>::toJSI(runtime, arg.ark_id));
@@ -42,20 +42,18 @@ namespace margelo::nitro::nitroark {
42
42
 
43
43
  namespace margelo::nitro {
44
44
 
45
- using namespace margelo::nitro::nitroark;
46
-
47
45
  // C++ OffchainBalanceResult <> JS OffchainBalanceResult (object)
48
46
  template <>
49
- struct JSIConverter<OffchainBalanceResult> final {
50
- static inline OffchainBalanceResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
47
+ struct JSIConverter<margelo::nitro::nitroark::OffchainBalanceResult> final {
48
+ static inline margelo::nitro::nitroark::OffchainBalanceResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
51
49
  jsi::Object obj = arg.asObject(runtime);
52
- return OffchainBalanceResult(
50
+ return margelo::nitro::nitroark::OffchainBalanceResult(
53
51
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "spendable")),
54
52
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pending_lightning_send")),
55
53
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pending_exit"))
56
54
  );
57
55
  }
58
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const OffchainBalanceResult& arg) {
56
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::OffchainBalanceResult& arg) {
59
57
  jsi::Object obj(runtime);
60
58
  obj.setProperty(runtime, "spendable", JSIConverter<double>::toJSI(runtime, arg.spendable));
61
59
  obj.setProperty(runtime, "pending_lightning_send", JSIConverter<double>::toJSI(runtime, arg.pending_lightning_send));
@@ -43,21 +43,19 @@ namespace margelo::nitro::nitroark {
43
43
 
44
44
  namespace margelo::nitro {
45
45
 
46
- using namespace margelo::nitro::nitroark;
47
-
48
46
  // C++ OnchainBalanceResult <> JS OnchainBalanceResult (object)
49
47
  template <>
50
- struct JSIConverter<OnchainBalanceResult> final {
51
- static inline OnchainBalanceResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
48
+ struct JSIConverter<margelo::nitro::nitroark::OnchainBalanceResult> final {
49
+ static inline margelo::nitro::nitroark::OnchainBalanceResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
52
50
  jsi::Object obj = arg.asObject(runtime);
53
- return OnchainBalanceResult(
51
+ return margelo::nitro::nitroark::OnchainBalanceResult(
54
52
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "immature")),
55
53
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "trusted_pending")),
56
54
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "untrusted_pending")),
57
55
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "confirmed"))
58
56
  );
59
57
  }
60
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const OnchainBalanceResult& arg) {
58
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::OnchainBalanceResult& arg) {
61
59
  jsi::Object obj(runtime);
62
60
  obj.setProperty(runtime, "immature", JSIConverter<double>::toJSI(runtime, arg.immature));
63
61
  obj.setProperty(runtime, "trusted_pending", JSIConverter<double>::toJSI(runtime, arg.trusted_pending));
@@ -45,26 +45,24 @@ namespace margelo::nitro::nitroark {
45
45
 
46
46
  namespace margelo::nitro {
47
47
 
48
- using namespace margelo::nitro::nitroark;
49
-
50
48
  // C++ OnchainPaymentResult <> JS OnchainPaymentResult (object)
51
49
  template <>
52
- struct JSIConverter<OnchainPaymentResult> final {
53
- static inline OnchainPaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
50
+ struct JSIConverter<margelo::nitro::nitroark::OnchainPaymentResult> final {
51
+ static inline margelo::nitro::nitroark::OnchainPaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
54
52
  jsi::Object obj = arg.asObject(runtime);
55
- return OnchainPaymentResult(
53
+ return margelo::nitro::nitroark::OnchainPaymentResult(
56
54
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "txid")),
57
55
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "amount_sat")),
58
56
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "destination_address")),
59
- JSIConverter<PaymentTypes>::fromJSI(runtime, obj.getProperty(runtime, "payment_type"))
57
+ JSIConverter<margelo::nitro::nitroark::PaymentTypes>::fromJSI(runtime, obj.getProperty(runtime, "payment_type"))
60
58
  );
61
59
  }
62
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const OnchainPaymentResult& arg) {
60
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::OnchainPaymentResult& arg) {
63
61
  jsi::Object obj(runtime);
64
62
  obj.setProperty(runtime, "txid", JSIConverter<std::string>::toJSI(runtime, arg.txid));
65
63
  obj.setProperty(runtime, "amount_sat", JSIConverter<double>::toJSI(runtime, arg.amount_sat));
66
64
  obj.setProperty(runtime, "destination_address", JSIConverter<std::string>::toJSI(runtime, arg.destination_address));
67
- obj.setProperty(runtime, "payment_type", JSIConverter<PaymentTypes>::toJSI(runtime, arg.payment_type));
65
+ obj.setProperty(runtime, "payment_type", JSIConverter<margelo::nitro::nitroark::PaymentTypes>::toJSI(runtime, arg.payment_type));
68
66
  return obj;
69
67
  }
70
68
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -75,7 +73,7 @@ namespace margelo::nitro {
75
73
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "txid"))) return false;
76
74
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "amount_sat"))) return false;
77
75
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "destination_address"))) return false;
78
- if (!JSIConverter<PaymentTypes>::canConvert(runtime, obj.getProperty(runtime, "payment_type"))) return false;
76
+ if (!JSIConverter<margelo::nitro::nitroark::PaymentTypes>::canConvert(runtime, obj.getProperty(runtime, "payment_type"))) return false;
79
77
  return true;
80
78
  }
81
79
  };
@@ -39,28 +39,26 @@ namespace margelo::nitro::nitroark {
39
39
 
40
40
  namespace margelo::nitro {
41
41
 
42
- using namespace margelo::nitro::nitroark;
43
-
44
42
  // C++ PaymentTypes <> JS PaymentTypes (union)
45
43
  template <>
46
- struct JSIConverter<PaymentTypes> final {
47
- static inline PaymentTypes fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
44
+ struct JSIConverter<margelo::nitro::nitroark::PaymentTypes> final {
45
+ static inline margelo::nitro::nitroark::PaymentTypes fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
48
46
  std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
49
47
  switch (hashString(unionValue.c_str(), unionValue.size())) {
50
- case hashString("Bolt11"): return PaymentTypes::BOLT11;
51
- case hashString("Lnurl"): return PaymentTypes::LNURL;
52
- case hashString("Arkoor"): return PaymentTypes::ARKOOR;
53
- case hashString("Onchain"): return PaymentTypes::ONCHAIN;
48
+ case hashString("Bolt11"): return margelo::nitro::nitroark::PaymentTypes::BOLT11;
49
+ case hashString("Lnurl"): return margelo::nitro::nitroark::PaymentTypes::LNURL;
50
+ case hashString("Arkoor"): return margelo::nitro::nitroark::PaymentTypes::ARKOOR;
51
+ case hashString("Onchain"): return margelo::nitro::nitroark::PaymentTypes::ONCHAIN;
54
52
  default: [[unlikely]]
55
53
  throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum PaymentTypes - invalid value!");
56
54
  }
57
55
  }
58
- static inline jsi::Value toJSI(jsi::Runtime& runtime, PaymentTypes arg) {
56
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitroark::PaymentTypes arg) {
59
57
  switch (arg) {
60
- case PaymentTypes::BOLT11: return JSIConverter<std::string>::toJSI(runtime, "Bolt11");
61
- case PaymentTypes::LNURL: return JSIConverter<std::string>::toJSI(runtime, "Lnurl");
62
- case PaymentTypes::ARKOOR: return JSIConverter<std::string>::toJSI(runtime, "Arkoor");
63
- case PaymentTypes::ONCHAIN: return JSIConverter<std::string>::toJSI(runtime, "Onchain");
58
+ case margelo::nitro::nitroark::PaymentTypes::BOLT11: return JSIConverter<std::string>::toJSI(runtime, "Bolt11");
59
+ case margelo::nitro::nitroark::PaymentTypes::LNURL: return JSIConverter<std::string>::toJSI(runtime, "Lnurl");
60
+ case margelo::nitro::nitroark::PaymentTypes::ARKOOR: return JSIConverter<std::string>::toJSI(runtime, "Arkoor");
61
+ case margelo::nitro::nitroark::PaymentTypes::ONCHAIN: return JSIConverter<std::string>::toJSI(runtime, "Onchain");
64
62
  default: [[unlikely]]
65
63
  throw std::invalid_argument("Cannot convert PaymentTypes to JS - invalid value: "
66
64
  + std::to_string(static_cast<int>(arg)) + "!");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-ark",
3
- "version": "0.0.47",
3
+ "version": "0.0.49",
4
4
  "description": "Pure C++ Nitro Modules for Ark client",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",
@@ -82,12 +82,12 @@
82
82
  "eslint-config-prettier": "^10.1.1",
83
83
  "eslint-plugin-prettier": "^5.2.3",
84
84
  "jest": "^29.7.0",
85
- "nitro-codegen": "^0.26.4",
85
+ "nitro-codegen": "^0.28.0",
86
86
  "prettier": "^3.0.3",
87
87
  "react": "19.0.0",
88
88
  "react-native": "0.79.5",
89
89
  "react-native-builder-bob": "^0.40.13",
90
- "react-native-nitro-modules": "^0.26.4",
90
+ "react-native-nitro-modules": "^0.28.0",
91
91
  "release-it": "^17.10.0",
92
92
  "turbo": "^1.10.7",
93
93
  "typescript": "^5.2.2"
@@ -95,7 +95,7 @@
95
95
  "peerDependencies": {
96
96
  "react": "*",
97
97
  "react-native": "*",
98
- "react-native-nitro-modules": "^0.26.4"
98
+ "react-native-nitro-modules": "^0.28.0"
99
99
  },
100
100
  "workspaces": [
101
101
  "example"
@@ -43,8 +43,10 @@ export interface BarkSendManyOutput {
43
43
  export interface BarkVtxo {
44
44
  amount: number; // u64
45
45
  expiry_height: number; // u32
46
+ asp_pubkey: string;
46
47
  exit_delta: number; // u16
47
48
  anchor_point: string;
49
+ point: string;
48
50
  }
49
51
 
50
52
  export type PaymentTypes = 'Bolt11' | 'Lnurl' | 'Arkoor' | 'Onchain';
@@ -115,6 +117,7 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
115
117
  closeWallet(): Promise<void>;
116
118
  persistConfig(opts: BarkConfigOpts): Promise<void>;
117
119
  maintenance(): Promise<void>;
120
+ maintenanceRefresh(): Promise<void>;
118
121
  sync(): Promise<void>;
119
122
  syncExits(): Promise<void>;
120
123
  syncRounds(): Promise<void>;
@@ -131,7 +134,8 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
131
134
  signature: string,
132
135
  publicKey: string
133
136
  ): Promise<boolean>;
134
- getVtxos(): Promise<BarkVtxo[]>; // Returns JSON string
137
+ getVtxos(): Promise<BarkVtxo[]>;
138
+ getExpiringVtxos(threshold: number): Promise<BarkVtxo[]>;
135
139
 
136
140
  // --- Onchain Operations ---
137
141
  onchainBalance(): Promise<OnchainBalanceResult>;
package/src/index.tsx CHANGED
@@ -87,6 +87,14 @@ export function maintenance(): Promise<void> {
87
87
  return NitroArkHybridObject.maintenance();
88
88
  }
89
89
 
90
+ /**
91
+ * Refreshes vtxos that need to be refreshed.
92
+ * @returns A promise that resolves on success.
93
+ */
94
+ export function maintenanceRefresh(): Promise<void> {
95
+ return NitroArkHybridObject.maintenanceRefresh();
96
+ }
97
+
90
98
  /**
91
99
  * Synchronizes the wallet with the blockchain.
92
100
  * @returns A promise that resolves on success.
@@ -188,6 +196,15 @@ export function getVtxos(): Promise<BarkVtxo[]> {
188
196
  return NitroArkHybridObject.getVtxos();
189
197
  }
190
198
 
199
+ /**
200
+ * Gets the list of expiring VTXOs as a JSON Object of type BarkVtxo.
201
+ * @param threshold The block height threshold to check for expiring VTXOs.
202
+ * @returns A promise resolving BarkVtxo[] array.
203
+
204
+ export function getExpiringVtxos(threshold: number): Promise<BarkVtxo[]> {
205
+ return NitroArkHybridObject.getExpiringVtxos(threshold);
206
+ }
207
+
191
208
  // --- Onchain Operations ---
192
209
 
193
210
  /**
@@ -207,7 +224,7 @@ export function onchainSync(): Promise<void> {
207
224
  }
208
225
 
209
226
  /**
210
- * Gets the list of unspent onchain outputs as a JSON string for the loaded wallet.
227
+ * Gets the list of unspent onchain outputs as a JSON Object of type BarkVtxo.
211
228
  * @returns A promise resolving to the JSON string of unspent outputs.
212
229
  */
213
230
  export function onchainListUnspent(): Promise<string> {