react-native-nitro-ark 0.0.50 → 0.0.52
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 +76 -10
- package/cpp/generated/ark_cxx.h +24 -3
- package/lib/module/index.js +31 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +13 -3
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +22 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/shared/c++/BarkArkInfo.hpp +5 -5
- package/nitrogen/generated/shared/c++/BarkConfigOpts.hpp +5 -5
- package/nitrogen/generated/shared/c++/BarkVtxo.hpp +5 -5
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +3 -0
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +6 -0
- package/nitrogen/generated/shared/c++/LightningReceive.hpp +80 -0
- package/nitrogen/generated/shared/c++/OffchainBalanceResult.hpp +5 -1
- package/package.json +1 -1
- package/src/NitroArk.nitro.ts +20 -3
- package/src/index.tsx +43 -0
package/cpp/NitroArk.hpp
CHANGED
|
@@ -54,7 +54,7 @@ public:
|
|
|
54
54
|
try {
|
|
55
55
|
bark_cxx::ConfigOpts config_opts;
|
|
56
56
|
if (opts.config.has_value()) {
|
|
57
|
-
config_opts.
|
|
57
|
+
config_opts.ark = opts.config->ark.value_or("");
|
|
58
58
|
config_opts.esplora = opts.config->esplora.value_or("");
|
|
59
59
|
config_opts.bitcoind = opts.config->bitcoind.value_or("");
|
|
60
60
|
config_opts.bitcoind_cookie =
|
|
@@ -119,7 +119,7 @@ public:
|
|
|
119
119
|
return Promise<void>::async([opts]() {
|
|
120
120
|
try {
|
|
121
121
|
bark_cxx::ConfigOpts config_opts;
|
|
122
|
-
config_opts.
|
|
122
|
+
config_opts.ark = opts.ark.value_or("");
|
|
123
123
|
config_opts.esplora = opts.esplora.value_or("");
|
|
124
124
|
config_opts.bitcoind = opts.bitcoind.value_or("");
|
|
125
125
|
config_opts.bitcoind_cookie = opts.bitcoind_cookie.value_or("");
|
|
@@ -195,8 +195,8 @@ public:
|
|
|
195
195
|
BarkArkInfo info;
|
|
196
196
|
info.network =
|
|
197
197
|
std::string(rust_info.network.data(), rust_info.network.length());
|
|
198
|
-
info.
|
|
199
|
-
rust_info.
|
|
198
|
+
info.server_pubkey = std::string(rust_info.server_pubkey.data(),
|
|
199
|
+
rust_info.server_pubkey.length());
|
|
200
200
|
info.round_interval_secs =
|
|
201
201
|
static_cast<double>(rust_info.round_interval_secs);
|
|
202
202
|
info.vtxo_exit_delta = static_cast<double>(rust_info.vtxo_exit_delta);
|
|
@@ -221,6 +221,8 @@ public:
|
|
|
221
221
|
balance.spendable = static_cast<double>(rust_balance.spendable);
|
|
222
222
|
balance.pending_lightning_send =
|
|
223
223
|
static_cast<double>(rust_balance.pending_lightning_send);
|
|
224
|
+
balance.pending_in_round =
|
|
225
|
+
static_cast<double>(rust_balance.pending_in_round);
|
|
224
226
|
balance.pending_exit = static_cast<double>(rust_balance.pending_exit);
|
|
225
227
|
return balance;
|
|
226
228
|
} catch (const rust::Error &e) {
|
|
@@ -309,6 +311,25 @@ public:
|
|
|
309
311
|
});
|
|
310
312
|
}
|
|
311
313
|
|
|
314
|
+
std::shared_ptr<Promise<KeyPairResult>>
|
|
315
|
+
deriveKeypairFromMnemonic(const std::string &mnemonic, const std::string &network,
|
|
316
|
+
double index) override {
|
|
317
|
+
return Promise<KeyPairResult>::async([mnemonic, network, index]() {
|
|
318
|
+
try {
|
|
319
|
+
uint32_t index_val = static_cast<uint32_t>(index);
|
|
320
|
+
bark_cxx::KeyPairResult keypair_rs = bark_cxx::derive_keypair_from_mnemonic(mnemonic, network, index_val);
|
|
321
|
+
KeyPairResult keypair;
|
|
322
|
+
keypair.public_key = std::string(keypair_rs.public_key.data(),
|
|
323
|
+
keypair_rs.public_key.length());
|
|
324
|
+
keypair.secret_key = std::string(keypair_rs.secret_key.data(),
|
|
325
|
+
keypair_rs.secret_key.length());
|
|
326
|
+
return keypair;
|
|
327
|
+
} catch (const rust::Error &e) {
|
|
328
|
+
throw std::runtime_error(e.what());
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
|
|
312
333
|
std::shared_ptr<Promise<bool>>
|
|
313
334
|
verifyMessage(const std::string &message, const std::string &signature,
|
|
314
335
|
const std::string &publicKey) override {
|
|
@@ -330,8 +351,8 @@ public:
|
|
|
330
351
|
BarkVtxo vtxo;
|
|
331
352
|
vtxo.amount = static_cast<double>(rust_vtxo.amount);
|
|
332
353
|
vtxo.expiry_height = static_cast<double>(rust_vtxo.expiry_height);
|
|
333
|
-
vtxo.
|
|
334
|
-
rust_vtxo.
|
|
354
|
+
vtxo.server_pubkey = std::string(rust_vtxo.server_pubkey.data(),
|
|
355
|
+
rust_vtxo.server_pubkey.length());
|
|
335
356
|
vtxo.exit_delta = static_cast<double>(rust_vtxo.exit_delta);
|
|
336
357
|
vtxo.anchor_point = std::string(rust_vtxo.anchor_point.data(),
|
|
337
358
|
rust_vtxo.anchor_point.length());
|
|
@@ -357,8 +378,8 @@ public:
|
|
|
357
378
|
BarkVtxo vtxo;
|
|
358
379
|
vtxo.amount = static_cast<double>(rust_vtxo.amount);
|
|
359
380
|
vtxo.expiry_height = static_cast<double>(rust_vtxo.expiry_height);
|
|
360
|
-
vtxo.
|
|
361
|
-
rust_vtxo.
|
|
381
|
+
vtxo.server_pubkey = std::string(rust_vtxo.server_pubkey.data(),
|
|
382
|
+
rust_vtxo.server_pubkey.length());
|
|
362
383
|
vtxo.exit_delta = static_cast<double>(rust_vtxo.exit_delta);
|
|
363
384
|
vtxo.anchor_point = std::string(rust_vtxo.anchor_point.data(),
|
|
364
385
|
rust_vtxo.anchor_point.length());
|
|
@@ -596,6 +617,41 @@ public:
|
|
|
596
617
|
});
|
|
597
618
|
}
|
|
598
619
|
|
|
620
|
+
std::shared_ptr<Promise<std::optional<LightningReceive>>>
|
|
621
|
+
lightningReceiveStatus(const std::string &payment) override {
|
|
622
|
+
return Promise<std::optional<LightningReceive>>::async([payment]() {
|
|
623
|
+
try {
|
|
624
|
+
const bark_cxx::LightningReceive *status_ptr =
|
|
625
|
+
bark_cxx::lightning_receive_status(payment);
|
|
626
|
+
|
|
627
|
+
if (status_ptr == nullptr) {
|
|
628
|
+
return std::optional<LightningReceive>();
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
std::unique_ptr<const bark_cxx::LightningReceive> status(status_ptr);
|
|
632
|
+
|
|
633
|
+
LightningReceive result;
|
|
634
|
+
result.payment_hash = std::string(status->payment_hash.data(),
|
|
635
|
+
status->payment_hash.length());
|
|
636
|
+
result.payment_preimage = std::string(status->payment_preimage.data(),
|
|
637
|
+
status->payment_preimage.length());
|
|
638
|
+
result.invoice =
|
|
639
|
+
std::string(status->invoice.data(), status->invoice.length());
|
|
640
|
+
|
|
641
|
+
if (status->preimage_revealed_at != nullptr) {
|
|
642
|
+
result.preimage_revealed_at =
|
|
643
|
+
static_cast<double>(*status->preimage_revealed_at);
|
|
644
|
+
} else {
|
|
645
|
+
result.preimage_revealed_at = std::nullopt;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
return std::optional<LightningReceive>(result);
|
|
649
|
+
} catch (const rust::Error &e) {
|
|
650
|
+
throw std::runtime_error(e.what());
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
|
|
599
655
|
// --- Ark Operations ---
|
|
600
656
|
|
|
601
657
|
std::shared_ptr<Promise<std::string>> boardAmount(double amountSat) override {
|
|
@@ -621,6 +677,16 @@ public:
|
|
|
621
677
|
});
|
|
622
678
|
}
|
|
623
679
|
|
|
680
|
+
std::shared_ptr<Promise<void>> validateArkoorAddress(const std::string &address) override {
|
|
681
|
+
return Promise<void>::async([address]() {
|
|
682
|
+
try {
|
|
683
|
+
bark_cxx::validate_arkoor_address(address);
|
|
684
|
+
} catch (const rust::Error &e) {
|
|
685
|
+
throw std::runtime_error(e.what());
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
|
|
624
690
|
std::shared_ptr<Promise<ArkoorPaymentResult>>
|
|
625
691
|
sendArkoorPayment(const std::string &destination, double amountSat) override {
|
|
626
692
|
return Promise<ArkoorPaymentResult>::async([destination, amountSat]() {
|
|
@@ -641,8 +707,8 @@ public:
|
|
|
641
707
|
BarkVtxo vtxo;
|
|
642
708
|
vtxo.amount = static_cast<double>(rust_vtxo.amount);
|
|
643
709
|
vtxo.expiry_height = static_cast<double>(rust_vtxo.expiry_height);
|
|
644
|
-
vtxo.
|
|
645
|
-
rust_vtxo.
|
|
710
|
+
vtxo.server_pubkey = std::string(rust_vtxo.server_pubkey.data(),
|
|
711
|
+
rust_vtxo.server_pubkey.length());
|
|
646
712
|
vtxo.exit_delta = static_cast<double>(rust_vtxo.exit_delta);
|
|
647
713
|
vtxo.anchor_point = std::string(rust_vtxo.anchor_point.data(),
|
|
648
714
|
rust_vtxo.anchor_point.length());
|
package/cpp/generated/ark_cxx.h
CHANGED
|
@@ -809,6 +809,7 @@ namespace bark_cxx {
|
|
|
809
809
|
struct CreateOpts;
|
|
810
810
|
struct SendManyOutput;
|
|
811
811
|
enum class RefreshModeType : ::std::uint8_t;
|
|
812
|
+
struct LightningReceive;
|
|
812
813
|
struct OffchainBalance;
|
|
813
814
|
struct OnChainBalance;
|
|
814
815
|
struct KeyPairResult;
|
|
@@ -820,7 +821,7 @@ namespace bark_cxx {
|
|
|
820
821
|
struct BarkVtxo final {
|
|
821
822
|
::std::uint64_t amount CXX_DEFAULT_VALUE(0);
|
|
822
823
|
::std::uint32_t expiry_height CXX_DEFAULT_VALUE(0);
|
|
823
|
-
::rust::String
|
|
824
|
+
::rust::String server_pubkey;
|
|
824
825
|
::std::uint16_t exit_delta CXX_DEFAULT_VALUE(0);
|
|
825
826
|
::rust::String anchor_point;
|
|
826
827
|
::rust::String point;
|
|
@@ -901,7 +902,7 @@ struct OnchainPaymentResult final {
|
|
|
901
902
|
#define CXXBRIDGE1_STRUCT_bark_cxx$CxxArkInfo
|
|
902
903
|
struct CxxArkInfo final {
|
|
903
904
|
::rust::String network;
|
|
904
|
-
::rust::String
|
|
905
|
+
::rust::String server_pubkey;
|
|
905
906
|
::std::uint64_t round_interval_secs CXX_DEFAULT_VALUE(0);
|
|
906
907
|
::std::uint16_t vtxo_exit_delta CXX_DEFAULT_VALUE(0);
|
|
907
908
|
::std::uint16_t vtxo_expiry_delta CXX_DEFAULT_VALUE(0);
|
|
@@ -915,7 +916,7 @@ struct CxxArkInfo final {
|
|
|
915
916
|
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$ConfigOpts
|
|
916
917
|
#define CXXBRIDGE1_STRUCT_bark_cxx$ConfigOpts
|
|
917
918
|
struct ConfigOpts final {
|
|
918
|
-
::rust::String
|
|
919
|
+
::rust::String ark;
|
|
919
920
|
::rust::String esplora;
|
|
920
921
|
::rust::String bitcoind;
|
|
921
922
|
::rust::String bitcoind_cookie;
|
|
@@ -964,6 +965,18 @@ enum class RefreshModeType : ::std::uint8_t {
|
|
|
964
965
|
};
|
|
965
966
|
#endif // CXXBRIDGE1_ENUM_bark_cxx$RefreshModeType
|
|
966
967
|
|
|
968
|
+
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$LightningReceive
|
|
969
|
+
#define CXXBRIDGE1_STRUCT_bark_cxx$LightningReceive
|
|
970
|
+
struct LightningReceive final {
|
|
971
|
+
::rust::String payment_hash;
|
|
972
|
+
::rust::String payment_preimage;
|
|
973
|
+
::rust::String invoice;
|
|
974
|
+
::std::uint64_t const *preimage_revealed_at CXX_DEFAULT_VALUE(nullptr);
|
|
975
|
+
|
|
976
|
+
using IsRelocatable = ::std::true_type;
|
|
977
|
+
};
|
|
978
|
+
#endif // CXXBRIDGE1_STRUCT_bark_cxx$LightningReceive
|
|
979
|
+
|
|
967
980
|
#ifndef CXXBRIDGE1_STRUCT_bark_cxx$OffchainBalance
|
|
968
981
|
#define CXXBRIDGE1_STRUCT_bark_cxx$OffchainBalance
|
|
969
982
|
struct OffchainBalance final {
|
|
@@ -971,6 +984,8 @@ struct OffchainBalance final {
|
|
|
971
984
|
::std::uint64_t spendable CXX_DEFAULT_VALUE(0);
|
|
972
985
|
// Coins that are in the process of being sent over Lightning.
|
|
973
986
|
::std::uint64_t pending_lightning_send CXX_DEFAULT_VALUE(0);
|
|
987
|
+
// Coins locked in a round.
|
|
988
|
+
::std::uint64_t pending_in_round CXX_DEFAULT_VALUE(0);
|
|
974
989
|
// Coins that are in the process of unilaterally exiting the Ark.
|
|
975
990
|
::std::uint64_t pending_exit CXX_DEFAULT_VALUE(0);
|
|
976
991
|
|
|
@@ -1028,6 +1043,8 @@ void persist_config(::bark_cxx::ConfigOpts opts);
|
|
|
1028
1043
|
|
|
1029
1044
|
::rust::String sign_messsage_with_mnemonic(::rust::Str message, ::rust::Str mnemonic, ::rust::Str network, ::std::uint32_t index);
|
|
1030
1045
|
|
|
1046
|
+
::bark_cxx::KeyPairResult derive_keypair_from_mnemonic(::rust::Str mnemonic, ::rust::Str network, ::std::uint32_t index);
|
|
1047
|
+
|
|
1031
1048
|
bool verify_message(::rust::Str message, ::rust::Str signature, ::rust::Str public_key);
|
|
1032
1049
|
|
|
1033
1050
|
::rust::Vec<::bark_cxx::BarkVtxo> get_vtxos();
|
|
@@ -1036,6 +1053,8 @@ bool verify_message(::rust::Str message, ::rust::Str signature, ::rust::Str publ
|
|
|
1036
1053
|
|
|
1037
1054
|
::rust::String bolt11_invoice(::std::uint64_t amount_msat);
|
|
1038
1055
|
|
|
1056
|
+
::bark_cxx::LightningReceive const *lightning_receive_status(::rust::String payment);
|
|
1057
|
+
|
|
1039
1058
|
void maintenance();
|
|
1040
1059
|
|
|
1041
1060
|
void maintenance_refresh();
|
|
@@ -1052,6 +1071,8 @@ void load_wallet(::rust::Str datadir, ::rust::Str mnemonic);
|
|
|
1052
1071
|
|
|
1053
1072
|
::rust::String board_all();
|
|
1054
1073
|
|
|
1074
|
+
void validate_arkoor_address(::rust::Str address);
|
|
1075
|
+
|
|
1055
1076
|
::bark_cxx::ArkoorPaymentResult send_arkoor_payment(::rust::Str destination, ::std::uint64_t amount_sat);
|
|
1056
1077
|
|
|
1057
1078
|
::bark_cxx::Bolt11PaymentResult send_lightning_payment(::rust::Str destination, ::std::uint64_t const *amount_sat);
|
package/lib/module/index.js
CHANGED
|
@@ -165,6 +165,18 @@ export function signMesssageWithMnemonic(message, mnemonic, network, index) {
|
|
|
165
165
|
return NitroArkHybridObject.signMesssageWithMnemonic(message, mnemonic, network, index);
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Derives a keypair from a mnemonic.
|
|
170
|
+
* @param mnemonic The mnemonic to derive the keypair from.
|
|
171
|
+
* @param network The network to derive the keypair for.
|
|
172
|
+
* @param index The index to derive the keypair from.
|
|
173
|
+
* @returns A promise resolving to the KeyPairResult object.
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
export function deriveKeypairFromMnemonic(mnemonic, network, index) {
|
|
177
|
+
return NitroArkHybridObject.deriveKeypairFromMnemonic(mnemonic, network, index);
|
|
178
|
+
}
|
|
179
|
+
|
|
168
180
|
/**
|
|
169
181
|
* Verifies a signed message.
|
|
170
182
|
* @param message The original message.
|
|
@@ -276,6 +288,16 @@ export function bolt11Invoice(amountMsat) {
|
|
|
276
288
|
return NitroArkHybridObject.bolt11Invoice(amountMsat);
|
|
277
289
|
}
|
|
278
290
|
|
|
291
|
+
/**
|
|
292
|
+
* Gets the status of a Lightning receive.
|
|
293
|
+
* @param payment The payment hash of the Lightning receive.
|
|
294
|
+
* @returns A promise resolving to the Lightning receive status.
|
|
295
|
+
*/
|
|
296
|
+
|
|
297
|
+
export function lightningReceiveStatus(payment) {
|
|
298
|
+
return NitroArkHybridObject.lightningReceiveStatus(payment);
|
|
299
|
+
}
|
|
300
|
+
|
|
279
301
|
/**
|
|
280
302
|
* Claims a Lightning payment.
|
|
281
303
|
* @param bolt11 The Lightning invoice string to claim.
|
|
@@ -325,6 +347,15 @@ export function boardAll() {
|
|
|
325
347
|
return NitroArkHybridObject.boardAll();
|
|
326
348
|
}
|
|
327
349
|
|
|
350
|
+
/**
|
|
351
|
+
* Validates an Arkoor address.
|
|
352
|
+
* @param address The Arkoor address to validate.
|
|
353
|
+
* @returns A promise resolving to void.
|
|
354
|
+
*/
|
|
355
|
+
export function validateArkoorAddress(address) {
|
|
356
|
+
return NitroArkHybridObject.validateArkoorAddress(address);
|
|
357
|
+
}
|
|
358
|
+
|
|
328
359
|
/**
|
|
329
360
|
* Sends an Arkoor payment.
|
|
330
361
|
* @param destination The destination Arkoor address.
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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","signMesssageWithMnemonic","network","verifyMessage","signature","publicKey","getVtxos","getExpiringVtxos","threshold","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;
|
|
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","signMesssageWithMnemonic","network","deriveKeypairFromMnemonic","verifyMessage","signature","publicKey","getVtxos","getExpiringVtxos","threshold","onchainBalance","onchainSync","onchainListUnspent","onchainUtxos","onchainAddress","onchainSend","destination","amountSat","onchainDrain","onchainSendMany","outputs","bolt11Invoice","amountMsat","lightningReceiveStatus","payment","finishLightningReceive","bolt11","sendLightningPayment","sendLnaddr","addr","comment","boardAmount","boardAll","validateArkoorAddress","address","sendArkoorPayment","sendRoundOnchainPayment","offboardSpecific","vtxoIds","destinationAddress","offboardAll"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAmBzD;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;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AiB,EACjBC,kBAA0B,EACT;EACjB,OAAO9D,oBAAoB,CAAC4D,gBAAgB,CAACC,OAAO,EAAEC,kBAAkB,CAAC;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACD,kBAA0B,EAAmB;EACvE,OAAO9D,oBAAoB,CAAC+D,WAAW,CAACD,kBAAkB,CAAC;AAC7D;;AAEA","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
2
|
export interface BarkConfigOpts {
|
|
3
|
-
|
|
3
|
+
ark?: string;
|
|
4
4
|
esplora?: string;
|
|
5
5
|
bitcoind?: string;
|
|
6
6
|
bitcoind_cookie?: string;
|
|
@@ -19,7 +19,7 @@ export interface BarkCreateOpts {
|
|
|
19
19
|
}
|
|
20
20
|
export interface BarkArkInfo {
|
|
21
21
|
network: string;
|
|
22
|
-
|
|
22
|
+
server_pubkey: string;
|
|
23
23
|
round_interval_secs: number;
|
|
24
24
|
vtxo_exit_delta: number;
|
|
25
25
|
vtxo_expiry_delta: number;
|
|
@@ -33,7 +33,7 @@ export interface BarkSendManyOutput {
|
|
|
33
33
|
export interface BarkVtxo {
|
|
34
34
|
amount: number;
|
|
35
35
|
expiry_height: number;
|
|
36
|
-
|
|
36
|
+
server_pubkey: string;
|
|
37
37
|
exit_delta: number;
|
|
38
38
|
anchor_point: string;
|
|
39
39
|
point: string;
|
|
@@ -65,6 +65,7 @@ export interface OnchainPaymentResult {
|
|
|
65
65
|
export interface OffchainBalanceResult {
|
|
66
66
|
spendable: number;
|
|
67
67
|
pending_lightning_send: number;
|
|
68
|
+
pending_in_round: number;
|
|
68
69
|
pending_exit: number;
|
|
69
70
|
}
|
|
70
71
|
export interface OnchainBalanceResult {
|
|
@@ -82,6 +83,12 @@ export interface KeyPairResult {
|
|
|
82
83
|
public_key: string;
|
|
83
84
|
secret_key: string;
|
|
84
85
|
}
|
|
86
|
+
export interface LightningReceive {
|
|
87
|
+
payment_hash: string;
|
|
88
|
+
payment_preimage: string;
|
|
89
|
+
invoice: string;
|
|
90
|
+
preimage_revealed_at?: number;
|
|
91
|
+
}
|
|
85
92
|
export interface NitroArk extends HybridObject<{
|
|
86
93
|
ios: 'c++';
|
|
87
94
|
android: 'c++';
|
|
@@ -104,6 +111,7 @@ export interface NitroArk extends HybridObject<{
|
|
|
104
111
|
newAddress(): Promise<NewAddressResult>;
|
|
105
112
|
signMessage(message: string, index: number): Promise<string>;
|
|
106
113
|
signMesssageWithMnemonic(message: string, mnemonic: string, network: string, index: number): Promise<string>;
|
|
114
|
+
deriveKeypairFromMnemonic(mnemonic: string, network: string, index: number): Promise<KeyPairResult>;
|
|
107
115
|
verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
108
116
|
getVtxos(): Promise<BarkVtxo[]>;
|
|
109
117
|
getExpiringVtxos(threshold: number): Promise<BarkVtxo[]>;
|
|
@@ -117,11 +125,13 @@ export interface NitroArk extends HybridObject<{
|
|
|
117
125
|
onchainSendMany(outputs: BarkSendManyOutput[], feeRate?: number): Promise<string>;
|
|
118
126
|
boardAmount(amountSat: number): Promise<string>;
|
|
119
127
|
boardAll(): Promise<string>;
|
|
128
|
+
validateArkoorAddress(address: string): Promise<void>;
|
|
120
129
|
sendArkoorPayment(destination: string, amountSat: number): Promise<ArkoorPaymentResult>;
|
|
121
130
|
sendLightningPayment(destination: string, amountSat?: number): Promise<LightningPaymentResult>;
|
|
122
131
|
sendLnaddr(addr: string, amountSat: number, comment: string): Promise<LnurlPaymentResult>;
|
|
123
132
|
sendRoundOnchainPayment(destination: string, amountSat: number): Promise<string>;
|
|
124
133
|
bolt11Invoice(amountMsat: number): Promise<string>;
|
|
134
|
+
lightningReceiveStatus(payment: string): Promise<LightningReceive | undefined>;
|
|
125
135
|
finishLightningReceive(bolt11: string): Promise<void>;
|
|
126
136
|
offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<string>;
|
|
127
137
|
offboardAll(destinationAddress: string): 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,
|
|
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;IACv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I,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,CACpB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAC;IACzC,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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput, ArkoorPaymentResult, LightningPaymentResult, LnurlPaymentResult, OnchainPaymentResult, BarkVtxo, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult } from './NitroArk.nitro';
|
|
1
|
+
import type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput, ArkoorPaymentResult, LightningPaymentResult, LnurlPaymentResult, OnchainPaymentResult, BarkVtxo, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive } from './NitroArk.nitro';
|
|
2
2
|
export declare const NitroArkHybridObject: NitroArk;
|
|
3
3
|
/**
|
|
4
4
|
* Creates a new BIP39 mnemonic phrase.
|
|
@@ -103,6 +103,14 @@ export declare function signMessage(message: string, index: number): Promise<str
|
|
|
103
103
|
* @returns A promise resolving to the signature string.
|
|
104
104
|
*/
|
|
105
105
|
export declare function signMesssageWithMnemonic(message: string, mnemonic: string, network: string, index: number): Promise<string>;
|
|
106
|
+
/**
|
|
107
|
+
* Derives a keypair from a mnemonic.
|
|
108
|
+
* @param mnemonic The mnemonic to derive the keypair from.
|
|
109
|
+
* @param network The network to derive the keypair for.
|
|
110
|
+
* @param index The index to derive the keypair from.
|
|
111
|
+
* @returns A promise resolving to the KeyPairResult object.
|
|
112
|
+
*/
|
|
113
|
+
export declare function deriveKeypairFromMnemonic(mnemonic: string, network: string, index: number): Promise<KeyPairResult>;
|
|
106
114
|
/**
|
|
107
115
|
* Verifies a signed message.
|
|
108
116
|
* @param message The original message.
|
|
@@ -173,6 +181,12 @@ export declare function onchainSendMany(outputs: BarkSendManyOutput[]): Promise<
|
|
|
173
181
|
* @returns A promise resolving to the Bolt 11 invoice string.
|
|
174
182
|
*/
|
|
175
183
|
export declare function bolt11Invoice(amountMsat: number): Promise<string>;
|
|
184
|
+
/**
|
|
185
|
+
* Gets the status of a Lightning receive.
|
|
186
|
+
* @param payment The payment hash of the Lightning receive.
|
|
187
|
+
* @returns A promise resolving to the Lightning receive status.
|
|
188
|
+
*/
|
|
189
|
+
export declare function lightningReceiveStatus(payment: string): Promise<LightningReceive | undefined>;
|
|
176
190
|
/**
|
|
177
191
|
* Claims a Lightning payment.
|
|
178
192
|
* @param bolt11 The Lightning invoice string to claim.
|
|
@@ -205,6 +219,12 @@ export declare function boardAmount(amountSat: number): Promise<string>;
|
|
|
205
219
|
* @returns A promise resolving to a JSON status string.
|
|
206
220
|
*/
|
|
207
221
|
export declare function boardAll(): Promise<string>;
|
|
222
|
+
/**
|
|
223
|
+
* Validates an Arkoor address.
|
|
224
|
+
* @param address The Arkoor address to validate.
|
|
225
|
+
* @returns A promise resolving to void.
|
|
226
|
+
*/
|
|
227
|
+
export declare function validateArkoorAddress(address: string): Promise<void>;
|
|
208
228
|
/**
|
|
209
229
|
* Sends an Arkoor payment.
|
|
210
230
|
* @param destination The destination Arkoor address.
|
|
@@ -234,5 +254,5 @@ export declare function offboardSpecific(vtxoIds: string[], destinationAddress:
|
|
|
234
254
|
* @returns A promise resolving to a JSON result string.
|
|
235
255
|
*/
|
|
236
256
|
export declare function offboardAll(destinationAddress: string): Promise<string>;
|
|
237
|
-
export type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput, ArkoorPaymentResult, LightningPaymentResult, LnurlPaymentResult, OnchainPaymentResult, PaymentTypes, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, } from './NitroArk.nitro';
|
|
257
|
+
export type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, BarkSendManyOutput, ArkoorPaymentResult, LightningPaymentResult, LnurlPaymentResult, OnchainPaymentResult, PaymentTypes, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive, } from './NitroArk.nitro';
|
|
238
258
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,
|
|
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,EACb,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAG1B,eAA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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,EACb,gBAAgB,GACjB,MAAM,kBAAkB,CAAC"}
|
|
@@ -30,7 +30,7 @@ namespace margelo::nitro::nitroark {
|
|
|
30
30
|
struct BarkArkInfo {
|
|
31
31
|
public:
|
|
32
32
|
std::string network SWIFT_PRIVATE;
|
|
33
|
-
std::string
|
|
33
|
+
std::string server_pubkey SWIFT_PRIVATE;
|
|
34
34
|
double round_interval_secs SWIFT_PRIVATE;
|
|
35
35
|
double vtxo_exit_delta SWIFT_PRIVATE;
|
|
36
36
|
double vtxo_expiry_delta SWIFT_PRIVATE;
|
|
@@ -39,7 +39,7 @@ namespace margelo::nitro::nitroark {
|
|
|
39
39
|
|
|
40
40
|
public:
|
|
41
41
|
BarkArkInfo() = default;
|
|
42
|
-
explicit BarkArkInfo(std::string network, std::string
|
|
42
|
+
explicit BarkArkInfo(std::string network, std::string server_pubkey, double round_interval_secs, double vtxo_exit_delta, double vtxo_expiry_delta, double htlc_expiry_delta, double max_vtxo_amount_sat): network(network), server_pubkey(server_pubkey), round_interval_secs(round_interval_secs), vtxo_exit_delta(vtxo_exit_delta), vtxo_expiry_delta(vtxo_expiry_delta), htlc_expiry_delta(htlc_expiry_delta), max_vtxo_amount_sat(max_vtxo_amount_sat) {}
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
} // namespace margelo::nitro::nitroark
|
|
@@ -53,7 +53,7 @@ namespace margelo::nitro {
|
|
|
53
53
|
jsi::Object obj = arg.asObject(runtime);
|
|
54
54
|
return margelo::nitro::nitroark::BarkArkInfo(
|
|
55
55
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "network")),
|
|
56
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
56
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "server_pubkey")),
|
|
57
57
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "round_interval_secs")),
|
|
58
58
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "vtxo_exit_delta")),
|
|
59
59
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "vtxo_expiry_delta")),
|
|
@@ -64,7 +64,7 @@ namespace margelo::nitro {
|
|
|
64
64
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkArkInfo& arg) {
|
|
65
65
|
jsi::Object obj(runtime);
|
|
66
66
|
obj.setProperty(runtime, "network", JSIConverter<std::string>::toJSI(runtime, arg.network));
|
|
67
|
-
obj.setProperty(runtime, "
|
|
67
|
+
obj.setProperty(runtime, "server_pubkey", JSIConverter<std::string>::toJSI(runtime, arg.server_pubkey));
|
|
68
68
|
obj.setProperty(runtime, "round_interval_secs", JSIConverter<double>::toJSI(runtime, arg.round_interval_secs));
|
|
69
69
|
obj.setProperty(runtime, "vtxo_exit_delta", JSIConverter<double>::toJSI(runtime, arg.vtxo_exit_delta));
|
|
70
70
|
obj.setProperty(runtime, "vtxo_expiry_delta", JSIConverter<double>::toJSI(runtime, arg.vtxo_expiry_delta));
|
|
@@ -78,7 +78,7 @@ namespace margelo::nitro {
|
|
|
78
78
|
}
|
|
79
79
|
jsi::Object obj = value.getObject(runtime);
|
|
80
80
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "network"))) return false;
|
|
81
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "
|
|
81
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "server_pubkey"))) return false;
|
|
82
82
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "round_interval_secs"))) return false;
|
|
83
83
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "vtxo_exit_delta"))) return false;
|
|
84
84
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "vtxo_expiry_delta"))) return false;
|
|
@@ -30,7 +30,7 @@ namespace margelo::nitro::nitroark {
|
|
|
30
30
|
*/
|
|
31
31
|
struct BarkConfigOpts {
|
|
32
32
|
public:
|
|
33
|
-
std::optional<std::string>
|
|
33
|
+
std::optional<std::string> ark SWIFT_PRIVATE;
|
|
34
34
|
std::optional<std::string> esplora SWIFT_PRIVATE;
|
|
35
35
|
std::optional<std::string> bitcoind SWIFT_PRIVATE;
|
|
36
36
|
std::optional<std::string> bitcoind_cookie SWIFT_PRIVATE;
|
|
@@ -41,7 +41,7 @@ namespace margelo::nitro::nitroark {
|
|
|
41
41
|
|
|
42
42
|
public:
|
|
43
43
|
BarkConfigOpts() = default;
|
|
44
|
-
explicit BarkConfigOpts(std::optional<std::string>
|
|
44
|
+
explicit BarkConfigOpts(std::optional<std::string> ark, std::optional<std::string> esplora, std::optional<std::string> bitcoind, std::optional<std::string> bitcoind_cookie, std::optional<std::string> bitcoind_user, std::optional<std::string> bitcoind_pass, std::optional<double> vtxo_refresh_expiry_threshold, std::optional<double> fallback_fee_rate): ark(ark), esplora(esplora), bitcoind(bitcoind), bitcoind_cookie(bitcoind_cookie), bitcoind_user(bitcoind_user), bitcoind_pass(bitcoind_pass), vtxo_refresh_expiry_threshold(vtxo_refresh_expiry_threshold), fallback_fee_rate(fallback_fee_rate) {}
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
} // namespace margelo::nitro::nitroark
|
|
@@ -54,7 +54,7 @@ namespace margelo::nitro {
|
|
|
54
54
|
static inline margelo::nitro::nitroark::BarkConfigOpts fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
55
55
|
jsi::Object obj = arg.asObject(runtime);
|
|
56
56
|
return margelo::nitro::nitroark::BarkConfigOpts(
|
|
57
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
57
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "ark")),
|
|
58
58
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "esplora")),
|
|
59
59
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "bitcoind")),
|
|
60
60
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "bitcoind_cookie")),
|
|
@@ -66,7 +66,7 @@ namespace margelo::nitro {
|
|
|
66
66
|
}
|
|
67
67
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkConfigOpts& arg) {
|
|
68
68
|
jsi::Object obj(runtime);
|
|
69
|
-
obj.setProperty(runtime, "
|
|
69
|
+
obj.setProperty(runtime, "ark", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.ark));
|
|
70
70
|
obj.setProperty(runtime, "esplora", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.esplora));
|
|
71
71
|
obj.setProperty(runtime, "bitcoind", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.bitcoind));
|
|
72
72
|
obj.setProperty(runtime, "bitcoind_cookie", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.bitcoind_cookie));
|
|
@@ -81,7 +81,7 @@ namespace margelo::nitro {
|
|
|
81
81
|
return false;
|
|
82
82
|
}
|
|
83
83
|
jsi::Object obj = value.getObject(runtime);
|
|
84
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "
|
|
84
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "ark"))) return false;
|
|
85
85
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "esplora"))) return false;
|
|
86
86
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "bitcoind"))) return false;
|
|
87
87
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "bitcoind_cookie"))) return false;
|
|
@@ -31,14 +31,14 @@ namespace margelo::nitro::nitroark {
|
|
|
31
31
|
public:
|
|
32
32
|
double amount SWIFT_PRIVATE;
|
|
33
33
|
double expiry_height SWIFT_PRIVATE;
|
|
34
|
-
std::string
|
|
34
|
+
std::string server_pubkey SWIFT_PRIVATE;
|
|
35
35
|
double exit_delta SWIFT_PRIVATE;
|
|
36
36
|
std::string anchor_point SWIFT_PRIVATE;
|
|
37
37
|
std::string point SWIFT_PRIVATE;
|
|
38
38
|
|
|
39
39
|
public:
|
|
40
40
|
BarkVtxo() = default;
|
|
41
|
-
explicit BarkVtxo(double amount, double expiry_height, std::string
|
|
41
|
+
explicit BarkVtxo(double amount, double expiry_height, std::string server_pubkey, double exit_delta, std::string anchor_point, std::string point): amount(amount), expiry_height(expiry_height), server_pubkey(server_pubkey), exit_delta(exit_delta), anchor_point(anchor_point), point(point) {}
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
} // namespace margelo::nitro::nitroark
|
|
@@ -53,7 +53,7 @@ namespace margelo::nitro {
|
|
|
53
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, "
|
|
56
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "server_pubkey")),
|
|
57
57
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "exit_delta")),
|
|
58
58
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "anchor_point")),
|
|
59
59
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "point"))
|
|
@@ -63,7 +63,7 @@ namespace margelo::nitro {
|
|
|
63
63
|
jsi::Object obj(runtime);
|
|
64
64
|
obj.setProperty(runtime, "amount", JSIConverter<double>::toJSI(runtime, arg.amount));
|
|
65
65
|
obj.setProperty(runtime, "expiry_height", JSIConverter<double>::toJSI(runtime, arg.expiry_height));
|
|
66
|
-
obj.setProperty(runtime, "
|
|
66
|
+
obj.setProperty(runtime, "server_pubkey", JSIConverter<std::string>::toJSI(runtime, arg.server_pubkey));
|
|
67
67
|
obj.setProperty(runtime, "exit_delta", JSIConverter<double>::toJSI(runtime, arg.exit_delta));
|
|
68
68
|
obj.setProperty(runtime, "anchor_point", JSIConverter<std::string>::toJSI(runtime, arg.anchor_point));
|
|
69
69
|
obj.setProperty(runtime, "point", JSIConverter<std::string>::toJSI(runtime, arg.point));
|
|
@@ -76,7 +76,7 @@ namespace margelo::nitro {
|
|
|
76
76
|
jsi::Object obj = value.getObject(runtime);
|
|
77
77
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "amount"))) return false;
|
|
78
78
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "expiry_height"))) return false;
|
|
79
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "
|
|
79
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "server_pubkey"))) return false;
|
|
80
80
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "exit_delta"))) return false;
|
|
81
81
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "anchor_point"))) return false;
|
|
82
82
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "point"))) return false;
|
|
@@ -32,6 +32,7 @@ namespace margelo::nitro::nitroark {
|
|
|
32
32
|
prototype.registerHybridMethod("newAddress", &HybridNitroArkSpec::newAddress);
|
|
33
33
|
prototype.registerHybridMethod("signMessage", &HybridNitroArkSpec::signMessage);
|
|
34
34
|
prototype.registerHybridMethod("signMesssageWithMnemonic", &HybridNitroArkSpec::signMesssageWithMnemonic);
|
|
35
|
+
prototype.registerHybridMethod("deriveKeypairFromMnemonic", &HybridNitroArkSpec::deriveKeypairFromMnemonic);
|
|
35
36
|
prototype.registerHybridMethod("verifyMessage", &HybridNitroArkSpec::verifyMessage);
|
|
36
37
|
prototype.registerHybridMethod("getVtxos", &HybridNitroArkSpec::getVtxos);
|
|
37
38
|
prototype.registerHybridMethod("getExpiringVtxos", &HybridNitroArkSpec::getExpiringVtxos);
|
|
@@ -45,11 +46,13 @@ namespace margelo::nitro::nitroark {
|
|
|
45
46
|
prototype.registerHybridMethod("onchainSendMany", &HybridNitroArkSpec::onchainSendMany);
|
|
46
47
|
prototype.registerHybridMethod("boardAmount", &HybridNitroArkSpec::boardAmount);
|
|
47
48
|
prototype.registerHybridMethod("boardAll", &HybridNitroArkSpec::boardAll);
|
|
49
|
+
prototype.registerHybridMethod("validateArkoorAddress", &HybridNitroArkSpec::validateArkoorAddress);
|
|
48
50
|
prototype.registerHybridMethod("sendArkoorPayment", &HybridNitroArkSpec::sendArkoorPayment);
|
|
49
51
|
prototype.registerHybridMethod("sendLightningPayment", &HybridNitroArkSpec::sendLightningPayment);
|
|
50
52
|
prototype.registerHybridMethod("sendLnaddr", &HybridNitroArkSpec::sendLnaddr);
|
|
51
53
|
prototype.registerHybridMethod("sendRoundOnchainPayment", &HybridNitroArkSpec::sendRoundOnchainPayment);
|
|
52
54
|
prototype.registerHybridMethod("bolt11Invoice", &HybridNitroArkSpec::bolt11Invoice);
|
|
55
|
+
prototype.registerHybridMethod("lightningReceiveStatus", &HybridNitroArkSpec::lightningReceiveStatus);
|
|
53
56
|
prototype.registerHybridMethod("finishLightningReceive", &HybridNitroArkSpec::finishLightningReceive);
|
|
54
57
|
prototype.registerHybridMethod("offboardSpecific", &HybridNitroArkSpec::offboardSpecific);
|
|
55
58
|
prototype.registerHybridMethod("offboardAll", &HybridNitroArkSpec::offboardAll);
|
|
@@ -39,6 +39,8 @@ namespace margelo::nitro::nitroark { struct ArkoorPaymentResult; }
|
|
|
39
39
|
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
|
+
// Forward declaration of `LightningReceive` to properly resolve imports.
|
|
43
|
+
namespace margelo::nitro::nitroark { struct LightningReceive; }
|
|
42
44
|
|
|
43
45
|
#include <string>
|
|
44
46
|
#include <NitroModules/Promise.hpp>
|
|
@@ -57,6 +59,7 @@ namespace margelo::nitro::nitroark { struct LnurlPaymentResult; }
|
|
|
57
59
|
#include "ArkoorPaymentResult.hpp"
|
|
58
60
|
#include "LightningPaymentResult.hpp"
|
|
59
61
|
#include "LnurlPaymentResult.hpp"
|
|
62
|
+
#include "LightningReceive.hpp"
|
|
60
63
|
|
|
61
64
|
namespace margelo::nitro::nitroark {
|
|
62
65
|
|
|
@@ -107,6 +110,7 @@ namespace margelo::nitro::nitroark {
|
|
|
107
110
|
virtual std::shared_ptr<Promise<NewAddressResult>> newAddress() = 0;
|
|
108
111
|
virtual std::shared_ptr<Promise<std::string>> signMessage(const std::string& message, double index) = 0;
|
|
109
112
|
virtual std::shared_ptr<Promise<std::string>> signMesssageWithMnemonic(const std::string& message, const std::string& mnemonic, const std::string& network, double index) = 0;
|
|
113
|
+
virtual std::shared_ptr<Promise<KeyPairResult>> deriveKeypairFromMnemonic(const std::string& mnemonic, const std::string& network, double index) = 0;
|
|
110
114
|
virtual std::shared_ptr<Promise<bool>> verifyMessage(const std::string& message, const std::string& signature, const std::string& publicKey) = 0;
|
|
111
115
|
virtual std::shared_ptr<Promise<std::vector<BarkVtxo>>> getVtxos() = 0;
|
|
112
116
|
virtual std::shared_ptr<Promise<std::vector<BarkVtxo>>> getExpiringVtxos(double threshold) = 0;
|
|
@@ -120,11 +124,13 @@ namespace margelo::nitro::nitroark {
|
|
|
120
124
|
virtual std::shared_ptr<Promise<std::string>> onchainSendMany(const std::vector<BarkSendManyOutput>& outputs, std::optional<double> feeRate) = 0;
|
|
121
125
|
virtual std::shared_ptr<Promise<std::string>> boardAmount(double amountSat) = 0;
|
|
122
126
|
virtual std::shared_ptr<Promise<std::string>> boardAll() = 0;
|
|
127
|
+
virtual std::shared_ptr<Promise<void>> validateArkoorAddress(const std::string& address) = 0;
|
|
123
128
|
virtual std::shared_ptr<Promise<ArkoorPaymentResult>> sendArkoorPayment(const std::string& destination, double amountSat) = 0;
|
|
124
129
|
virtual std::shared_ptr<Promise<LightningPaymentResult>> sendLightningPayment(const std::string& destination, std::optional<double> amountSat) = 0;
|
|
125
130
|
virtual std::shared_ptr<Promise<LnurlPaymentResult>> sendLnaddr(const std::string& addr, double amountSat, const std::string& comment) = 0;
|
|
126
131
|
virtual std::shared_ptr<Promise<std::string>> sendRoundOnchainPayment(const std::string& destination, double amountSat) = 0;
|
|
127
132
|
virtual std::shared_ptr<Promise<std::string>> bolt11Invoice(double amountMsat) = 0;
|
|
133
|
+
virtual std::shared_ptr<Promise<std::optional<LightningReceive>>> lightningReceiveStatus(const std::string& payment) = 0;
|
|
128
134
|
virtual std::shared_ptr<Promise<void>> finishLightningReceive(const std::string& bolt11) = 0;
|
|
129
135
|
virtual std::shared_ptr<Promise<std::string>> offboardSpecific(const std::vector<std::string>& vtxoIds, const std::string& destinationAddress) = 0;
|
|
130
136
|
virtual std::shared_ptr<Promise<std::string>> offboardAll(const std::string& destinationAddress) = 0;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// LightningReceive.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
|
+
#include <optional>
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::nitroark {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A struct which can be represented as a JavaScript object (LightningReceive).
|
|
30
|
+
*/
|
|
31
|
+
struct LightningReceive {
|
|
32
|
+
public:
|
|
33
|
+
std::string payment_hash SWIFT_PRIVATE;
|
|
34
|
+
std::string payment_preimage SWIFT_PRIVATE;
|
|
35
|
+
std::string invoice SWIFT_PRIVATE;
|
|
36
|
+
std::optional<double> preimage_revealed_at SWIFT_PRIVATE;
|
|
37
|
+
|
|
38
|
+
public:
|
|
39
|
+
LightningReceive() = default;
|
|
40
|
+
explicit LightningReceive(std::string payment_hash, std::string payment_preimage, std::string invoice, std::optional<double> preimage_revealed_at): payment_hash(payment_hash), payment_preimage(payment_preimage), invoice(invoice), preimage_revealed_at(preimage_revealed_at) {}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
} // namespace margelo::nitro::nitroark
|
|
44
|
+
|
|
45
|
+
namespace margelo::nitro {
|
|
46
|
+
|
|
47
|
+
// C++ LightningReceive <> JS LightningReceive (object)
|
|
48
|
+
template <>
|
|
49
|
+
struct JSIConverter<margelo::nitro::nitroark::LightningReceive> final {
|
|
50
|
+
static inline margelo::nitro::nitroark::LightningReceive fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
51
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
52
|
+
return margelo::nitro::nitroark::LightningReceive(
|
|
53
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "payment_hash")),
|
|
54
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "payment_preimage")),
|
|
55
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "invoice")),
|
|
56
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "preimage_revealed_at"))
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::LightningReceive& arg) {
|
|
60
|
+
jsi::Object obj(runtime);
|
|
61
|
+
obj.setProperty(runtime, "payment_hash", JSIConverter<std::string>::toJSI(runtime, arg.payment_hash));
|
|
62
|
+
obj.setProperty(runtime, "payment_preimage", JSIConverter<std::string>::toJSI(runtime, arg.payment_preimage));
|
|
63
|
+
obj.setProperty(runtime, "invoice", JSIConverter<std::string>::toJSI(runtime, arg.invoice));
|
|
64
|
+
obj.setProperty(runtime, "preimage_revealed_at", JSIConverter<std::optional<double>>::toJSI(runtime, arg.preimage_revealed_at));
|
|
65
|
+
return obj;
|
|
66
|
+
}
|
|
67
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
68
|
+
if (!value.isObject()) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
jsi::Object obj = value.getObject(runtime);
|
|
72
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "payment_hash"))) return false;
|
|
73
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "payment_preimage"))) return false;
|
|
74
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "invoice"))) return false;
|
|
75
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "preimage_revealed_at"))) return false;
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro
|
|
@@ -31,11 +31,12 @@ namespace margelo::nitro::nitroark {
|
|
|
31
31
|
public:
|
|
32
32
|
double spendable SWIFT_PRIVATE;
|
|
33
33
|
double pending_lightning_send SWIFT_PRIVATE;
|
|
34
|
+
double pending_in_round SWIFT_PRIVATE;
|
|
34
35
|
double pending_exit SWIFT_PRIVATE;
|
|
35
36
|
|
|
36
37
|
public:
|
|
37
38
|
OffchainBalanceResult() = default;
|
|
38
|
-
explicit OffchainBalanceResult(double spendable, double pending_lightning_send, double pending_exit): spendable(spendable), pending_lightning_send(pending_lightning_send), pending_exit(pending_exit) {}
|
|
39
|
+
explicit OffchainBalanceResult(double spendable, double pending_lightning_send, double pending_in_round, double pending_exit): spendable(spendable), pending_lightning_send(pending_lightning_send), pending_in_round(pending_in_round), pending_exit(pending_exit) {}
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
} // namespace margelo::nitro::nitroark
|
|
@@ -50,6 +51,7 @@ namespace margelo::nitro {
|
|
|
50
51
|
return margelo::nitro::nitroark::OffchainBalanceResult(
|
|
51
52
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "spendable")),
|
|
52
53
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pending_lightning_send")),
|
|
54
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pending_in_round")),
|
|
53
55
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pending_exit"))
|
|
54
56
|
);
|
|
55
57
|
}
|
|
@@ -57,6 +59,7 @@ namespace margelo::nitro {
|
|
|
57
59
|
jsi::Object obj(runtime);
|
|
58
60
|
obj.setProperty(runtime, "spendable", JSIConverter<double>::toJSI(runtime, arg.spendable));
|
|
59
61
|
obj.setProperty(runtime, "pending_lightning_send", JSIConverter<double>::toJSI(runtime, arg.pending_lightning_send));
|
|
62
|
+
obj.setProperty(runtime, "pending_in_round", JSIConverter<double>::toJSI(runtime, arg.pending_in_round));
|
|
60
63
|
obj.setProperty(runtime, "pending_exit", JSIConverter<double>::toJSI(runtime, arg.pending_exit));
|
|
61
64
|
return obj;
|
|
62
65
|
}
|
|
@@ -67,6 +70,7 @@ namespace margelo::nitro {
|
|
|
67
70
|
jsi::Object obj = value.getObject(runtime);
|
|
68
71
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "spendable"))) return false;
|
|
69
72
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pending_lightning_send"))) return false;
|
|
73
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pending_in_round"))) return false;
|
|
70
74
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pending_exit"))) return false;
|
|
71
75
|
return true;
|
|
72
76
|
}
|
package/package.json
CHANGED
package/src/NitroArk.nitro.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { HybridObject } from 'react-native-nitro-modules';
|
|
|
5
5
|
// Note: BarkError is handled via Promise rejection, not exposed directly.
|
|
6
6
|
|
|
7
7
|
export interface BarkConfigOpts {
|
|
8
|
-
|
|
8
|
+
ark?: string;
|
|
9
9
|
esplora?: string;
|
|
10
10
|
bitcoind?: string;
|
|
11
11
|
bitcoind_cookie?: string;
|
|
@@ -26,7 +26,7 @@ export interface BarkCreateOpts {
|
|
|
26
26
|
|
|
27
27
|
export interface BarkArkInfo {
|
|
28
28
|
network: string;
|
|
29
|
-
|
|
29
|
+
server_pubkey: string;
|
|
30
30
|
round_interval_secs: number; // u64
|
|
31
31
|
vtxo_exit_delta: number; // u16
|
|
32
32
|
vtxo_expiry_delta: number; // u16
|
|
@@ -43,7 +43,7 @@ export interface BarkSendManyOutput {
|
|
|
43
43
|
export interface BarkVtxo {
|
|
44
44
|
amount: number; // u64
|
|
45
45
|
expiry_height: number; // u32
|
|
46
|
-
|
|
46
|
+
server_pubkey: string;
|
|
47
47
|
exit_delta: number; // u16
|
|
48
48
|
anchor_point: string;
|
|
49
49
|
point: string;
|
|
@@ -81,6 +81,7 @@ export interface OnchainPaymentResult {
|
|
|
81
81
|
export interface OffchainBalanceResult {
|
|
82
82
|
spendable: number; // u64
|
|
83
83
|
pending_lightning_send: number; // u64
|
|
84
|
+
pending_in_round: number; // u64
|
|
84
85
|
pending_exit: number; // u64
|
|
85
86
|
}
|
|
86
87
|
|
|
@@ -106,6 +107,13 @@ export interface KeyPairResult {
|
|
|
106
107
|
secret_key: string;
|
|
107
108
|
}
|
|
108
109
|
|
|
110
|
+
export interface LightningReceive {
|
|
111
|
+
payment_hash: string;
|
|
112
|
+
payment_preimage: string;
|
|
113
|
+
invoice: string;
|
|
114
|
+
preimage_revealed_at?: number;
|
|
115
|
+
}
|
|
116
|
+
|
|
109
117
|
// --- Nitro Module Interface ---
|
|
110
118
|
|
|
111
119
|
export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
@@ -135,6 +143,11 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
135
143
|
network: string,
|
|
136
144
|
index: number
|
|
137
145
|
): Promise<string>;
|
|
146
|
+
deriveKeypairFromMnemonic(
|
|
147
|
+
mnemonic: string,
|
|
148
|
+
network: string,
|
|
149
|
+
index: number
|
|
150
|
+
): Promise<KeyPairResult>;
|
|
138
151
|
verifyMessage(
|
|
139
152
|
message: string,
|
|
140
153
|
signature: string,
|
|
@@ -169,6 +182,7 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
169
182
|
// --- Ark & Lightning Payments ---
|
|
170
183
|
boardAmount(amountSat: number): Promise<string>; // Returns JSON status
|
|
171
184
|
boardAll(): Promise<string>; // Returns JSON status
|
|
185
|
+
validateArkoorAddress(address: string): Promise<void>;
|
|
172
186
|
sendArkoorPayment(
|
|
173
187
|
destination: string,
|
|
174
188
|
amountSat: number
|
|
@@ -189,6 +203,9 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
189
203
|
|
|
190
204
|
// --- Lightning Invoicing ---
|
|
191
205
|
bolt11Invoice(amountMsat: number): Promise<string>; // Returns invoice string
|
|
206
|
+
lightningReceiveStatus(
|
|
207
|
+
payment: string
|
|
208
|
+
): Promise<LightningReceive | undefined>;
|
|
192
209
|
finishLightningReceive(bolt11: string): Promise<void>; // Throws on error
|
|
193
210
|
|
|
194
211
|
// --- Offboarding / Exiting ---
|
package/src/index.tsx
CHANGED
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
OnchainBalanceResult,
|
|
15
15
|
NewAddressResult,
|
|
16
16
|
KeyPairResult,
|
|
17
|
+
LightningReceive,
|
|
17
18
|
} from './NitroArk.nitro';
|
|
18
19
|
|
|
19
20
|
// Create the hybrid object instance
|
|
@@ -194,6 +195,26 @@ export function signMesssageWithMnemonic(
|
|
|
194
195
|
);
|
|
195
196
|
}
|
|
196
197
|
|
|
198
|
+
/**
|
|
199
|
+
* Derives a keypair from a mnemonic.
|
|
200
|
+
* @param mnemonic The mnemonic to derive the keypair from.
|
|
201
|
+
* @param network The network to derive the keypair for.
|
|
202
|
+
* @param index The index to derive the keypair from.
|
|
203
|
+
* @returns A promise resolving to the KeyPairResult object.
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
export function deriveKeypairFromMnemonic(
|
|
207
|
+
mnemonic: string,
|
|
208
|
+
network: string,
|
|
209
|
+
index: number
|
|
210
|
+
): Promise<KeyPairResult> {
|
|
211
|
+
return NitroArkHybridObject.deriveKeypairFromMnemonic(
|
|
212
|
+
mnemonic,
|
|
213
|
+
network,
|
|
214
|
+
index
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
|
|
197
218
|
/**
|
|
198
219
|
* Verifies a signed message.
|
|
199
220
|
* @param message The original message.
|
|
@@ -314,6 +335,18 @@ export function bolt11Invoice(amountMsat: number): Promise<string> {
|
|
|
314
335
|
return NitroArkHybridObject.bolt11Invoice(amountMsat);
|
|
315
336
|
}
|
|
316
337
|
|
|
338
|
+
/**
|
|
339
|
+
* Gets the status of a Lightning receive.
|
|
340
|
+
* @param payment The payment hash of the Lightning receive.
|
|
341
|
+
* @returns A promise resolving to the Lightning receive status.
|
|
342
|
+
*/
|
|
343
|
+
|
|
344
|
+
export function lightningReceiveStatus(
|
|
345
|
+
payment: string
|
|
346
|
+
): Promise<LightningReceive | undefined> {
|
|
347
|
+
return NitroArkHybridObject.lightningReceiveStatus(payment);
|
|
348
|
+
}
|
|
349
|
+
|
|
317
350
|
/**
|
|
318
351
|
* Claims a Lightning payment.
|
|
319
352
|
* @param bolt11 The Lightning invoice string to claim.
|
|
@@ -370,6 +403,15 @@ export function boardAll(): Promise<string> {
|
|
|
370
403
|
return NitroArkHybridObject.boardAll();
|
|
371
404
|
}
|
|
372
405
|
|
|
406
|
+
/**
|
|
407
|
+
* Validates an Arkoor address.
|
|
408
|
+
* @param address The Arkoor address to validate.
|
|
409
|
+
* @returns A promise resolving to void.
|
|
410
|
+
*/
|
|
411
|
+
export function validateArkoorAddress(address: string): Promise<void> {
|
|
412
|
+
return NitroArkHybridObject.validateArkoorAddress(address);
|
|
413
|
+
}
|
|
414
|
+
|
|
373
415
|
/**
|
|
374
416
|
* Sends an Arkoor payment.
|
|
375
417
|
* @param destination The destination Arkoor address.
|
|
@@ -438,4 +480,5 @@ export type {
|
|
|
438
480
|
OnchainBalanceResult,
|
|
439
481
|
NewAddressResult,
|
|
440
482
|
KeyPairResult,
|
|
483
|
+
LightningReceive,
|
|
441
484
|
} from './NitroArk.nitro';
|