react-native-nitro-ark 0.0.85 → 0.0.87
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/android/src/main/cpp/NitroArkJni.cpp +6 -91
- package/android/src/main/jniLibs/x86_64/libcxxbridge1.a +0 -0
- package/cpp/NitroArk.hpp +32 -60
- package/cpp/generated/ark_cxx.h +7 -3
- package/lib/module/index.js +23 -5
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +5 -12
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +20 -8
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +3 -1
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +5 -6
- package/package.json +4 -4
- package/src/NitroArk.nitro.ts +5 -22
- package/src/index.tsx +26 -10
- package/nitrogen/generated/shared/c++/RoundStatus.hpp +0 -107
- package/nitrogen/generated/shared/c++/RoundStatusType.hpp +0 -88
|
@@ -119,77 +119,6 @@ jobject MakeArrayList(JNIEnv* env, const std::vector<std::string>& elements) {
|
|
|
119
119
|
return arrayListObj;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
jobject MakeRoundStatusResult(JNIEnv* env, const bark_cxx::RoundStatus& status) {
|
|
123
|
-
jclass cls = env->FindClass("com/margelo/nitro/nitroark/RoundStatusResult");
|
|
124
|
-
if (cls == nullptr)
|
|
125
|
-
return nullptr;
|
|
126
|
-
jmethodID ctor =
|
|
127
|
-
env->GetMethodID(cls, "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;ZZ)V");
|
|
128
|
-
if (ctor == nullptr) {
|
|
129
|
-
env->DeleteLocalRef(cls);
|
|
130
|
-
return nullptr;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
std::string statusStr(status.status.data(), status.status.length());
|
|
134
|
-
std::string fundingTxid(status.funding_txid.data(), status.funding_txid.length());
|
|
135
|
-
std::string error(status.error.data(), status.error.length());
|
|
136
|
-
|
|
137
|
-
// Convert unsigned txids
|
|
138
|
-
std::vector<std::string> txids;
|
|
139
|
-
txids.reserve(status.unsigned_funding_txids.size());
|
|
140
|
-
for (const auto& tx : status.unsigned_funding_txids) {
|
|
141
|
-
txids.emplace_back(std::string(tx.data(), tx.length()));
|
|
142
|
-
}
|
|
143
|
-
jobject txidList = MakeArrayList(env, txids);
|
|
144
|
-
|
|
145
|
-
jstring jStatus = env->NewStringUTF(statusStr.c_str());
|
|
146
|
-
if (jStatus == nullptr) {
|
|
147
|
-
if (txidList)
|
|
148
|
-
env->DeleteLocalRef(txidList);
|
|
149
|
-
env->DeleteLocalRef(cls);
|
|
150
|
-
return nullptr;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
jstring jFundingTxid = nullptr;
|
|
154
|
-
if (!fundingTxid.empty()) {
|
|
155
|
-
jFundingTxid = env->NewStringUTF(fundingTxid.c_str());
|
|
156
|
-
if (jFundingTxid == nullptr) {
|
|
157
|
-
env->DeleteLocalRef(jStatus);
|
|
158
|
-
if (txidList)
|
|
159
|
-
env->DeleteLocalRef(txidList);
|
|
160
|
-
env->DeleteLocalRef(cls);
|
|
161
|
-
return nullptr;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
jstring jError = nullptr;
|
|
166
|
-
if (!error.empty()) {
|
|
167
|
-
jError = env->NewStringUTF(error.c_str());
|
|
168
|
-
if (jError == nullptr) {
|
|
169
|
-
env->DeleteLocalRef(jStatus);
|
|
170
|
-
if (jFundingTxid)
|
|
171
|
-
env->DeleteLocalRef(jFundingTxid);
|
|
172
|
-
if (txidList)
|
|
173
|
-
env->DeleteLocalRef(txidList);
|
|
174
|
-
env->DeleteLocalRef(cls);
|
|
175
|
-
return nullptr;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
jobject result =
|
|
180
|
-
env->NewObject(cls, ctor, jStatus, jFundingTxid, txidList, jError, status.is_final, status.is_success);
|
|
181
|
-
|
|
182
|
-
env->DeleteLocalRef(jStatus);
|
|
183
|
-
if (jFundingTxid)
|
|
184
|
-
env->DeleteLocalRef(jFundingTxid);
|
|
185
|
-
if (jError)
|
|
186
|
-
env->DeleteLocalRef(jError);
|
|
187
|
-
if (txidList)
|
|
188
|
-
env->DeleteLocalRef(txidList);
|
|
189
|
-
env->DeleteLocalRef(cls);
|
|
190
|
-
return result;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
122
|
jobject MakeKeyPairResult(JNIEnv* env, const bark_cxx::KeyPairResult& keypair) {
|
|
194
123
|
jclass cls = env->FindClass("com/margelo/nitro/nitroark/KeyPairResultAndroid");
|
|
195
124
|
if (cls == nullptr)
|
|
@@ -355,9 +284,10 @@ JNIEXPORT void JNICALL Java_com_margelo_nitro_nitroark_NitroArkNative_loadWallet
|
|
|
355
284
|
}
|
|
356
285
|
}
|
|
357
286
|
|
|
358
|
-
JNIEXPORT void JNICALL
|
|
287
|
+
JNIEXPORT void JNICALL Java_com_margelo_nitro_nitroark_NitroArkNative_maintenanceDelegated(JNIEnv* env,
|
|
288
|
+
jobject /*thiz*/) {
|
|
359
289
|
try {
|
|
360
|
-
bark_cxx::
|
|
290
|
+
bark_cxx::maintenance_delegated();
|
|
361
291
|
} catch (const std::exception& e) {
|
|
362
292
|
HandleException(env, e);
|
|
363
293
|
} catch (...) {
|
|
@@ -365,10 +295,10 @@ JNIEXPORT void JNICALL Java_com_margelo_nitro_nitroark_NitroArkNative_maintenanc
|
|
|
365
295
|
}
|
|
366
296
|
}
|
|
367
297
|
|
|
368
|
-
JNIEXPORT void JNICALL
|
|
369
|
-
|
|
298
|
+
JNIEXPORT void JNICALL Java_com_margelo_nitro_nitroark_NitroArkNative_maintenanceWithOnchainDelegated(
|
|
299
|
+
JNIEnv* env, jobject /*thiz*/) {
|
|
370
300
|
try {
|
|
371
|
-
bark_cxx::
|
|
301
|
+
bark_cxx::maintenance_with_onchain_delegated();
|
|
372
302
|
} catch (const std::exception& e) {
|
|
373
303
|
HandleException(env, e);
|
|
374
304
|
} catch (...) {
|
|
@@ -394,21 +324,6 @@ JNIEXPORT void JNICALL Java_com_margelo_nitro_nitroark_NitroArkNative_tryClaimLi
|
|
|
394
324
|
}
|
|
395
325
|
}
|
|
396
326
|
|
|
397
|
-
JNIEXPORT jobject JNICALL Java_com_margelo_nitro_nitroark_NitroArkNative_offboardAll(JNIEnv* env, jobject /*thiz*/,
|
|
398
|
-
jstring jDestination) {
|
|
399
|
-
try {
|
|
400
|
-
const std::string destination = JStringToString(env, jDestination);
|
|
401
|
-
bark_cxx::RoundStatus status = bark_cxx::offboard_all(destination);
|
|
402
|
-
return MakeRoundStatusResult(env, status);
|
|
403
|
-
} catch (const std::exception& e) {
|
|
404
|
-
HandleException(env, e);
|
|
405
|
-
return nullptr;
|
|
406
|
-
} catch (...) {
|
|
407
|
-
HandleUnknownException(env);
|
|
408
|
-
return nullptr;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
327
|
JNIEXPORT jobject JNICALL Java_com_margelo_nitro_nitroark_NitroArkNative_peakKeyPair(JNIEnv* env, jobject /*thiz*/,
|
|
413
328
|
jint jIndex) {
|
|
414
329
|
try {
|
|
Binary file
|
package/cpp/NitroArk.hpp
CHANGED
|
@@ -32,52 +32,6 @@ inline std::vector<BarkVtxo> convertRustVtxosToVector(const rust::Vec<bark_cxx::
|
|
|
32
32
|
return vtxos;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
inline RoundStatus convertRoundStatus(const bark_cxx::RoundStatus& status_rs) {
|
|
36
|
-
RoundStatus status;
|
|
37
|
-
std::string status_str(status_rs.status.data(), status_rs.status.length());
|
|
38
|
-
if (status_str == "confirmed") {
|
|
39
|
-
status.status = RoundStatusType::CONFIRMED;
|
|
40
|
-
} else if (status_str == "unconfirmed") {
|
|
41
|
-
status.status = RoundStatusType::UNCONFIRMED;
|
|
42
|
-
} else if (status_str == "pending") {
|
|
43
|
-
status.status = RoundStatusType::PENDING;
|
|
44
|
-
} else if (status_str == "failed") {
|
|
45
|
-
status.status = RoundStatusType::FAILED;
|
|
46
|
-
} else if (status_str == "canceled") {
|
|
47
|
-
status.status = RoundStatusType::CANCELED;
|
|
48
|
-
} else {
|
|
49
|
-
status.status = RoundStatusType::FAILED;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (status_rs.funding_txid.length() > 0) {
|
|
53
|
-
status.funding_txid = std::string(status_rs.funding_txid.data(), status_rs.funding_txid.length());
|
|
54
|
-
} else {
|
|
55
|
-
status.funding_txid = std::nullopt;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (!status_rs.unsigned_funding_txids.empty()) {
|
|
59
|
-
std::vector<std::string> txids;
|
|
60
|
-
txids.reserve(status_rs.unsigned_funding_txids.size());
|
|
61
|
-
for (const auto& txid : status_rs.unsigned_funding_txids) {
|
|
62
|
-
txids.emplace_back(std::string(txid.data(), txid.length()));
|
|
63
|
-
}
|
|
64
|
-
status.unsigned_funding_txids = std::move(txids);
|
|
65
|
-
} else {
|
|
66
|
-
status.unsigned_funding_txids = std::nullopt;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (status_rs.error.length() > 0) {
|
|
70
|
-
status.error = std::string(status_rs.error.data(), status_rs.error.length());
|
|
71
|
-
} else {
|
|
72
|
-
status.error = std::nullopt;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
status.is_final = status_rs.is_final;
|
|
76
|
-
status.is_success = status_rs.is_success;
|
|
77
|
-
|
|
78
|
-
return status;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
35
|
class NitroArk : public HybridNitroArkSpec {
|
|
82
36
|
|
|
83
37
|
private:
|
|
@@ -226,6 +180,26 @@ public:
|
|
|
226
180
|
});
|
|
227
181
|
}
|
|
228
182
|
|
|
183
|
+
std::shared_ptr<Promise<void>> maintenanceDelegated() override {
|
|
184
|
+
return Promise<void>::async([]() {
|
|
185
|
+
try {
|
|
186
|
+
bark_cxx::maintenance_delegated();
|
|
187
|
+
} catch (const rust::Error& e) {
|
|
188
|
+
throw std::runtime_error(e.what());
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
std::shared_ptr<Promise<void>> maintenanceWithOnchainDelegated() override {
|
|
194
|
+
return Promise<void>::async([]() {
|
|
195
|
+
try {
|
|
196
|
+
bark_cxx::maintenance_with_onchain_delegated();
|
|
197
|
+
} catch (const rust::Error& e) {
|
|
198
|
+
throw std::runtime_error(e.what());
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
229
203
|
std::shared_ptr<Promise<void>> maintenanceRefresh() override {
|
|
230
204
|
return Promise<void>::async([]() {
|
|
231
205
|
try {
|
|
@@ -941,13 +915,11 @@ public:
|
|
|
941
915
|
});
|
|
942
916
|
}
|
|
943
917
|
|
|
944
|
-
std::shared_ptr<Promise<
|
|
945
|
-
|
|
946
|
-
return Promise<RoundStatus>::async([destination, amountSat]() {
|
|
918
|
+
std::shared_ptr<Promise<std::string>> sendOnchain(const std::string& destination, double amountSat) override {
|
|
919
|
+
return Promise<std::string>::async([destination, amountSat]() {
|
|
947
920
|
try {
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
return convertRoundStatus(status_rs);
|
|
921
|
+
rust::String result = bark_cxx::send_onchain(destination, static_cast<uint64_t>(amountSat));
|
|
922
|
+
return std::string(result);
|
|
951
923
|
} catch (const rust::Error& e) {
|
|
952
924
|
throw std::runtime_error(e.what());
|
|
953
925
|
}
|
|
@@ -956,27 +928,27 @@ public:
|
|
|
956
928
|
|
|
957
929
|
// --- Offboarding / Exiting ---
|
|
958
930
|
|
|
959
|
-
std::shared_ptr<Promise<
|
|
931
|
+
std::shared_ptr<Promise<std::string>> offboardSpecific(const std::vector<std::string>& vtxoIds,
|
|
960
932
|
const std::string& destinationAddress) override {
|
|
961
|
-
return Promise<
|
|
933
|
+
return Promise<std::string>::async([vtxoIds, destinationAddress]() {
|
|
962
934
|
try {
|
|
963
935
|
rust::Vec<rust::String> rust_vtxo_ids;
|
|
964
936
|
for (const auto& id : vtxoIds) {
|
|
965
937
|
rust_vtxo_ids.push_back(rust::String(id));
|
|
966
938
|
}
|
|
967
|
-
|
|
968
|
-
return
|
|
939
|
+
rust::String result = bark_cxx::offboard_specific(std::move(rust_vtxo_ids), destinationAddress);
|
|
940
|
+
return std::string(result);
|
|
969
941
|
} catch (const rust::Error& e) {
|
|
970
942
|
throw std::runtime_error(e.what());
|
|
971
943
|
}
|
|
972
944
|
});
|
|
973
945
|
}
|
|
974
946
|
|
|
975
|
-
std::shared_ptr<Promise<
|
|
976
|
-
return Promise<
|
|
947
|
+
std::shared_ptr<Promise<std::string>> offboardAll(const std::string& destinationAddress) override {
|
|
948
|
+
return Promise<std::string>::async([destinationAddress]() {
|
|
977
949
|
try {
|
|
978
|
-
|
|
979
|
-
return
|
|
950
|
+
rust::String result = bark_cxx::offboard_all(destinationAddress);
|
|
951
|
+
return std::string(result);
|
|
980
952
|
} catch (const rust::Error& e) {
|
|
981
953
|
throw std::runtime_error(e.what());
|
|
982
954
|
}
|
package/cpp/generated/ark_cxx.h
CHANGED
|
@@ -1133,8 +1133,12 @@ void sync_pending_boards();
|
|
|
1133
1133
|
|
|
1134
1134
|
void maintenance();
|
|
1135
1135
|
|
|
1136
|
+
void maintenance_delegated();
|
|
1137
|
+
|
|
1136
1138
|
void maintenance_with_onchain();
|
|
1137
1139
|
|
|
1140
|
+
void maintenance_with_onchain_delegated();
|
|
1141
|
+
|
|
1138
1142
|
void maintenance_refresh();
|
|
1139
1143
|
|
|
1140
1144
|
void refresh_server();
|
|
@@ -1159,11 +1163,11 @@ void validate_arkoor_address(::rust::Str address);
|
|
|
1159
1163
|
|
|
1160
1164
|
::bark_cxx::LightningSend pay_lightning_address(::rust::Str addr, ::std::uint64_t amount_sat, ::rust::Str comment);
|
|
1161
1165
|
|
|
1162
|
-
::
|
|
1166
|
+
::rust::String send_onchain(::rust::Str destination, ::std::uint64_t amount_sat);
|
|
1163
1167
|
|
|
1164
|
-
::
|
|
1168
|
+
::rust::String offboard_specific(::rust::Vec<::rust::String> vtxo_ids, ::rust::Str destination_address);
|
|
1165
1169
|
|
|
1166
|
-
::
|
|
1170
|
+
::rust::String offboard_all(::rust::Str destination_address);
|
|
1167
1171
|
|
|
1168
1172
|
::bark_cxx::LightningReceive try_claim_lightning_receive(::rust::String payment_hash, bool wait, ::rust::String const *token);
|
|
1169
1173
|
|
package/lib/module/index.js
CHANGED
|
@@ -85,6 +85,24 @@ export function maintenanceWithOnchain() {
|
|
|
85
85
|
return NitroArkHybridObject.maintenanceWithOnchain();
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Runs delegated wallet maintenance tasks for offchain.
|
|
90
|
+
* This includes refreshing vtxos that need to be refreshed using delegated signing.
|
|
91
|
+
* @returns A promise that resolves on success.
|
|
92
|
+
*/
|
|
93
|
+
export function maintenanceDelegated() {
|
|
94
|
+
return NitroArkHybridObject.maintenanceDelegated();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Runs delegated wallet maintenance tasks for both offchain and onchain.
|
|
99
|
+
* This includes refreshing vtxos that need to be refreshed using delegated signing.
|
|
100
|
+
* @returns A promise that resolves on success.
|
|
101
|
+
*/
|
|
102
|
+
export function maintenanceWithOnchainDelegated() {
|
|
103
|
+
return NitroArkHybridObject.maintenanceWithOnchainDelegated();
|
|
104
|
+
}
|
|
105
|
+
|
|
88
106
|
/**
|
|
89
107
|
* Refreshes vtxos that need to be refreshed.
|
|
90
108
|
* @returns A promise that resolves on success.
|
|
@@ -450,10 +468,10 @@ export function sendArkoorPayment(destination, amountSat) {
|
|
|
450
468
|
* Sends an onchain payment via an Ark round.
|
|
451
469
|
* @param destination The destination Bitcoin address.
|
|
452
470
|
* @param amountSat The amount in satoshis to send.
|
|
453
|
-
* @returns A promise resolving to
|
|
471
|
+
* @returns A promise resolving to txid string.
|
|
454
472
|
*/
|
|
455
|
-
export function
|
|
456
|
-
return NitroArkHybridObject.
|
|
473
|
+
export function sendOnchain(destination, amountSat) {
|
|
474
|
+
return NitroArkHybridObject.sendOnchain(destination, amountSat);
|
|
457
475
|
}
|
|
458
476
|
|
|
459
477
|
// --- Offboarding / Exiting ---
|
|
@@ -462,7 +480,7 @@ export function sendRoundOnchainPayment(destination, amountSat) {
|
|
|
462
480
|
* Offboards specific VTXOs to a destination address.
|
|
463
481
|
* @param vtxoIds Array of VtxoId strings to offboard.
|
|
464
482
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
465
|
-
* @returns A promise resolving to the
|
|
483
|
+
* @returns A promise resolving to the txid string.
|
|
466
484
|
*/
|
|
467
485
|
export function offboardSpecific(vtxoIds, destinationAddress) {
|
|
468
486
|
return NitroArkHybridObject.offboardSpecific(vtxoIds, destinationAddress);
|
|
@@ -471,7 +489,7 @@ export function offboardSpecific(vtxoIds, destinationAddress) {
|
|
|
471
489
|
/**
|
|
472
490
|
* Offboards all VTXOs to a destination address.
|
|
473
491
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
474
|
-
* @returns A promise resolving to the
|
|
492
|
+
* @returns A promise resolving to the txid string.
|
|
475
493
|
*/
|
|
476
494
|
export function offboardAll(destinationAddress) {
|
|
477
495
|
return NitroArkHybridObject.offboardAll(destinationAddress);
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NitroModules","NitroArkHybridObject","createHybridObject","createMnemonic","createWallet","datadir","opts","loadWallet","config","closeWallet","refreshServer","isWalletLoaded","syncPendingBoards","maintenance","maintenanceWithOnchain","maintenanceRefresh","sync","syncExits","syncPendingRounds","getArkInfo","offchainBalance","deriveStoreNextKeypair","peakKeyPair","index","peakAddress","newAddress","signMessage","message","signMesssageWithMnemonic","mnemonic","network","deriveKeypairFromMnemonic","verifyMessage","signature","publicKey","history","vtxos","getFirstExpiringVtxoBlockheight","getNextRequiredRefreshBlockheight","getExpiringVtxos","threshold","onchainBalance","onchainSync","onchainListUnspent","onchainUtxos","onchainAddress","onchainSend","destination","amountSat","onchainDrain","onchainSendMany","outputs","bolt11Invoice","amountMsat","lightningReceiveStatus","paymentHash","checkLightningPayment","wait","tryClaimLightningReceive","token","tryClaimAllLightningReceives","payLightningInvoice","payLightningOffer","offer","payLightningAddress","addr","comment","boardAmount","boardAll","validateArkoorAddress","address","sendArkoorPayment","
|
|
1
|
+
{"version":3,"names":["NitroModules","NitroArkHybridObject","createHybridObject","createMnemonic","createWallet","datadir","opts","loadWallet","config","closeWallet","refreshServer","isWalletLoaded","syncPendingBoards","maintenance","maintenanceWithOnchain","maintenanceDelegated","maintenanceWithOnchainDelegated","maintenanceRefresh","sync","syncExits","syncPendingRounds","getArkInfo","offchainBalance","deriveStoreNextKeypair","peakKeyPair","index","peakAddress","newAddress","signMessage","message","signMesssageWithMnemonic","mnemonic","network","deriveKeypairFromMnemonic","verifyMessage","signature","publicKey","history","vtxos","getFirstExpiringVtxoBlockheight","getNextRequiredRefreshBlockheight","getExpiringVtxos","threshold","onchainBalance","onchainSync","onchainListUnspent","onchainUtxos","onchainAddress","onchainSend","destination","amountSat","onchainDrain","onchainSendMany","outputs","bolt11Invoice","amountMsat","lightningReceiveStatus","paymentHash","checkLightningPayment","wait","tryClaimLightningReceive","token","tryClaimAllLightningReceives","payLightningInvoice","payLightningOffer","offer","payLightningAddress","addr","comment","boardAmount","boardAll","validateArkoorAddress","address","sendArkoorPayment","sendOnchain","offboardSpecific","vtxoIds","destinationAddress","offboardAll"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAiDzD;AACA,OAAO,MAAMC,oBAAoB,GAC/BD,YAAY,CAACE,kBAAkB,CAAW,UAAU,CAAC;;AAEvD;;AAE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AAiB,EACjBkB,OAAe,EACe;EAC9B,OAAOnE,oBAAoB,CAACiE,mBAAmB,CAACC,IAAI,EAAEjB,SAAS,EAAEkB,OAAO,CAAC;AAC3E;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACnB,SAAiB,EAAwB;EACnE,OAAOjD,oBAAoB,CAACoE,WAAW,CAACnB,SAAS,CAAC;AACpD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASoB,QAAQA,CAAA,EAAyB;EAC/C,OAAOrE,oBAAoB,CAACqE,QAAQ,CAAC,CAAC;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAACC,OAAe,EAAiB;EACpE,OAAOvE,oBAAoB,CAACsE,qBAAqB,CAACC,OAAO,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAC/BxB,WAAmB,EACnBC,SAAiB,EACa;EAC9B,OAAOjD,oBAAoB,CAACwE,iBAAiB,CAACxB,WAAW,EAAEC,SAAS,CAAC;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASwB,WAAWA,CACzBzB,WAAmB,EACnBC,SAAiB,EACA;EACjB,OAAOjD,oBAAoB,CAACyE,WAAW,CAACzB,WAAW,EAAEC,SAAS,CAAC;AACjE;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASyB,gBAAgBA,CAC9BC,OAAiB,EACjBC,kBAA0B,EACT;EACjB,OAAO5E,oBAAoB,CAAC0E,gBAAgB,CAACC,OAAO,EAAEC,kBAAkB,CAAC;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACD,kBAA0B,EAAmB;EACvE,OAAO5E,oBAAoB,CAAC6E,WAAW,CAACD,kBAAkB,CAAC;AAC7D;;AAEA","ignoreList":[]}
|
|
@@ -126,15 +126,6 @@ export interface BarkMovement {
|
|
|
126
126
|
updated_at: string;
|
|
127
127
|
completed_at?: string;
|
|
128
128
|
}
|
|
129
|
-
export type RoundStatusType = 'confirmed' | 'unconfirmed' | 'pending' | 'failed' | 'canceled';
|
|
130
|
-
export interface RoundStatus {
|
|
131
|
-
status: RoundStatusType;
|
|
132
|
-
funding_txid?: string;
|
|
133
|
-
unsigned_funding_txids?: string[];
|
|
134
|
-
error?: string;
|
|
135
|
-
is_final: boolean;
|
|
136
|
-
is_success: boolean;
|
|
137
|
-
}
|
|
138
129
|
export interface NitroArk extends HybridObject<{
|
|
139
130
|
ios: 'c++';
|
|
140
131
|
android: 'c++';
|
|
@@ -148,6 +139,8 @@ export interface NitroArk extends HybridObject<{
|
|
|
148
139
|
syncPendingBoards(): Promise<void>;
|
|
149
140
|
maintenance(): Promise<void>;
|
|
150
141
|
maintenanceWithOnchain(): Promise<void>;
|
|
142
|
+
maintenanceDelegated(): Promise<void>;
|
|
143
|
+
maintenanceWithOnchainDelegated(): Promise<void>;
|
|
151
144
|
maintenanceRefresh(): Promise<void>;
|
|
152
145
|
sync(): Promise<void>;
|
|
153
146
|
syncExits(): Promise<void>;
|
|
@@ -182,14 +175,14 @@ export interface NitroArk extends HybridObject<{
|
|
|
182
175
|
payLightningInvoice(destination: string, amountSat?: number): Promise<LightningSendResult>;
|
|
183
176
|
payLightningOffer(offer: string, amountSat?: number): Promise<LightningSendResult>;
|
|
184
177
|
payLightningAddress(addr: string, amountSat: number, comment: string): Promise<LightningSendResult>;
|
|
185
|
-
|
|
178
|
+
sendOnchain(destination: string, amountSat: number): Promise<string>;
|
|
186
179
|
bolt11Invoice(amountMsat: number): Promise<Bolt11Invoice>;
|
|
187
180
|
lightningReceiveStatus(paymentHash: string): Promise<LightningReceive | undefined>;
|
|
188
181
|
checkLightningPayment(paymentHash: string, wait: boolean): Promise<string | null>;
|
|
189
182
|
tryClaimLightningReceive(paymentHash: string, wait: boolean, token?: string): Promise<LightningReceive>;
|
|
190
183
|
tryClaimAllLightningReceives(wait: boolean): Promise<void>;
|
|
191
|
-
offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<
|
|
192
|
-
offboardAll(destinationAddress: string): Promise<
|
|
184
|
+
offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<string>;
|
|
185
|
+
offboardAll(destinationAddress: string): Promise<string>;
|
|
193
186
|
}
|
|
194
187
|
export {};
|
|
195
188
|
//# sourceMappingURL=NitroArk.nitro.d.ts.map
|
|
@@ -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;IAC3B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,+BAA+B,EAAE,MAAM,CAAC;CACzC;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,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IAC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AAa,CAAC,CAAC;IAC1D,sBAAsB,CACpB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAC;IACzC,qBAAqB,CACnB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1B,wBAAwB,CACtB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,OAAO,EACb,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7B,4BAA4B,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAG3D,gBAAgB,CACd,OAAO,EAAE,MAAM,EAAE,EACjB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB,WAAW,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NitroArk, BarkCreateOpts, BarkArkInfo, Bolt11Invoice, BarkSendManyOutput, ArkoorPaymentResult, LightningSendResult, OnchainPaymentResult, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive, BarkMovement as NitroBarkMovement, BarkMovementDestination as NitroBarkMovementDestination, BoardResult
|
|
1
|
+
import type { NitroArk, BarkCreateOpts, BarkArkInfo, Bolt11Invoice, BarkSendManyOutput, ArkoorPaymentResult, LightningSendResult, OnchainPaymentResult, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive, BarkMovement as NitroBarkMovement, BarkMovementDestination as NitroBarkMovementDestination, BoardResult } from './NitroArk.nitro';
|
|
2
2
|
export type BarkVtxo = {
|
|
3
3
|
amount: number;
|
|
4
4
|
expiry_height: number;
|
|
@@ -70,6 +70,18 @@ export declare function maintenance(): Promise<void>;
|
|
|
70
70
|
* @returns A promise that resolves on success.
|
|
71
71
|
*/
|
|
72
72
|
export declare function maintenanceWithOnchain(): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Runs delegated wallet maintenance tasks for offchain.
|
|
75
|
+
* This includes refreshing vtxos that need to be refreshed using delegated signing.
|
|
76
|
+
* @returns A promise that resolves on success.
|
|
77
|
+
*/
|
|
78
|
+
export declare function maintenanceDelegated(): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Runs delegated wallet maintenance tasks for both offchain and onchain.
|
|
81
|
+
* This includes refreshing vtxos that need to be refreshed using delegated signing.
|
|
82
|
+
* @returns A promise that resolves on success.
|
|
83
|
+
*/
|
|
84
|
+
export declare function maintenanceWithOnchainDelegated(): Promise<void>;
|
|
73
85
|
/**
|
|
74
86
|
* Refreshes vtxos that need to be refreshed.
|
|
75
87
|
* @returns A promise that resolves on success.
|
|
@@ -308,21 +320,21 @@ export declare function sendArkoorPayment(destination: string, amountSat: number
|
|
|
308
320
|
* Sends an onchain payment via an Ark round.
|
|
309
321
|
* @param destination The destination Bitcoin address.
|
|
310
322
|
* @param amountSat The amount in satoshis to send.
|
|
311
|
-
* @returns A promise resolving to
|
|
323
|
+
* @returns A promise resolving to txid string.
|
|
312
324
|
*/
|
|
313
|
-
export declare function
|
|
325
|
+
export declare function sendOnchain(destination: string, amountSat: number): Promise<string>;
|
|
314
326
|
/**
|
|
315
327
|
* Offboards specific VTXOs to a destination address.
|
|
316
328
|
* @param vtxoIds Array of VtxoId strings to offboard.
|
|
317
329
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
318
|
-
* @returns A promise resolving to the
|
|
330
|
+
* @returns A promise resolving to the txid string.
|
|
319
331
|
*/
|
|
320
|
-
export declare function offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<
|
|
332
|
+
export declare function offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<string>;
|
|
321
333
|
/**
|
|
322
334
|
* Offboards all VTXOs to a destination address.
|
|
323
335
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
324
|
-
* @returns A promise resolving to the
|
|
336
|
+
* @returns A promise resolving to the txid string.
|
|
325
337
|
*/
|
|
326
|
-
export declare function offboardAll(destinationAddress: string): Promise<
|
|
327
|
-
export type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, Bolt11Invoice, BoardResult, BarkSendManyOutput, ArkoorPaymentResult, LightningSendResult, OnchainPaymentResult, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive,
|
|
338
|
+
export declare function offboardAll(destinationAddress: string): Promise<string>;
|
|
339
|
+
export type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, Bolt11Invoice, BoardResult, BarkSendManyOutput, ArkoorPaymentResult, LightningSendResult, OnchainPaymentResult, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive, } from './NitroArk.nitro';
|
|
328
340
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,YAAY,IAAI,iBAAiB,EACjC,uBAAuB,IAAI,4BAA4B,EACvD,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,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espace margelo::nitro::nitroark {
|
|
|
23
23
|
prototype.registerHybridMethod("syncPendingBoards", &HybridNitroArkSpec::syncPendingBoards);
|
|
24
24
|
prototype.registerHybridMethod("maintenance", &HybridNitroArkSpec::maintenance);
|
|
25
25
|
prototype.registerHybridMethod("maintenanceWithOnchain", &HybridNitroArkSpec::maintenanceWithOnchain);
|
|
26
|
+
prototype.registerHybridMethod("maintenanceDelegated", &HybridNitroArkSpec::maintenanceDelegated);
|
|
27
|
+
prototype.registerHybridMethod("maintenanceWithOnchainDelegated", &HybridNitroArkSpec::maintenanceWithOnchainDelegated);
|
|
26
28
|
prototype.registerHybridMethod("maintenanceRefresh", &HybridNitroArkSpec::maintenanceRefresh);
|
|
27
29
|
prototype.registerHybridMethod("sync", &HybridNitroArkSpec::sync);
|
|
28
30
|
prototype.registerHybridMethod("syncExits", &HybridNitroArkSpec::syncExits);
|
|
@@ -57,7 +59,7 @@ namespace margelo::nitro::nitroark {
|
|
|
57
59
|
prototype.registerHybridMethod("payLightningInvoice", &HybridNitroArkSpec::payLightningInvoice);
|
|
58
60
|
prototype.registerHybridMethod("payLightningOffer", &HybridNitroArkSpec::payLightningOffer);
|
|
59
61
|
prototype.registerHybridMethod("payLightningAddress", &HybridNitroArkSpec::payLightningAddress);
|
|
60
|
-
prototype.registerHybridMethod("
|
|
62
|
+
prototype.registerHybridMethod("sendOnchain", &HybridNitroArkSpec::sendOnchain);
|
|
61
63
|
prototype.registerHybridMethod("bolt11Invoice", &HybridNitroArkSpec::bolt11Invoice);
|
|
62
64
|
prototype.registerHybridMethod("lightningReceiveStatus", &HybridNitroArkSpec::lightningReceiveStatus);
|
|
63
65
|
prototype.registerHybridMethod("checkLightningPayment", &HybridNitroArkSpec::checkLightningPayment);
|
|
@@ -39,8 +39,6 @@ namespace margelo::nitro::nitroark { struct BoardResult; }
|
|
|
39
39
|
namespace margelo::nitro::nitroark { struct ArkoorPaymentResult; }
|
|
40
40
|
// Forward declaration of `LightningSendResult` to properly resolve imports.
|
|
41
41
|
namespace margelo::nitro::nitroark { struct LightningSendResult; }
|
|
42
|
-
// Forward declaration of `RoundStatus` to properly resolve imports.
|
|
43
|
-
namespace margelo::nitro::nitroark { struct RoundStatus; }
|
|
44
42
|
// Forward declaration of `Bolt11Invoice` to properly resolve imports.
|
|
45
43
|
namespace margelo::nitro::nitroark { struct Bolt11Invoice; }
|
|
46
44
|
// Forward declaration of `LightningReceive` to properly resolve imports.
|
|
@@ -63,7 +61,6 @@ namespace margelo::nitro::nitroark { struct LightningReceive; }
|
|
|
63
61
|
#include "BoardResult.hpp"
|
|
64
62
|
#include "ArkoorPaymentResult.hpp"
|
|
65
63
|
#include "LightningSendResult.hpp"
|
|
66
|
-
#include "RoundStatus.hpp"
|
|
67
64
|
#include "Bolt11Invoice.hpp"
|
|
68
65
|
#include "LightningReceive.hpp"
|
|
69
66
|
#include <NitroModules/Null.hpp>
|
|
@@ -109,6 +106,8 @@ namespace margelo::nitro::nitroark {
|
|
|
109
106
|
virtual std::shared_ptr<Promise<void>> syncPendingBoards() = 0;
|
|
110
107
|
virtual std::shared_ptr<Promise<void>> maintenance() = 0;
|
|
111
108
|
virtual std::shared_ptr<Promise<void>> maintenanceWithOnchain() = 0;
|
|
109
|
+
virtual std::shared_ptr<Promise<void>> maintenanceDelegated() = 0;
|
|
110
|
+
virtual std::shared_ptr<Promise<void>> maintenanceWithOnchainDelegated() = 0;
|
|
112
111
|
virtual std::shared_ptr<Promise<void>> maintenanceRefresh() = 0;
|
|
113
112
|
virtual std::shared_ptr<Promise<void>> sync() = 0;
|
|
114
113
|
virtual std::shared_ptr<Promise<void>> syncExits() = 0;
|
|
@@ -143,14 +142,14 @@ namespace margelo::nitro::nitroark {
|
|
|
143
142
|
virtual std::shared_ptr<Promise<LightningSendResult>> payLightningInvoice(const std::string& destination, std::optional<double> amountSat) = 0;
|
|
144
143
|
virtual std::shared_ptr<Promise<LightningSendResult>> payLightningOffer(const std::string& offer, std::optional<double> amountSat) = 0;
|
|
145
144
|
virtual std::shared_ptr<Promise<LightningSendResult>> payLightningAddress(const std::string& addr, double amountSat, const std::string& comment) = 0;
|
|
146
|
-
virtual std::shared_ptr<Promise<
|
|
145
|
+
virtual std::shared_ptr<Promise<std::string>> sendOnchain(const std::string& destination, double amountSat) = 0;
|
|
147
146
|
virtual std::shared_ptr<Promise<Bolt11Invoice>> bolt11Invoice(double amountMsat) = 0;
|
|
148
147
|
virtual std::shared_ptr<Promise<std::optional<LightningReceive>>> lightningReceiveStatus(const std::string& paymentHash) = 0;
|
|
149
148
|
virtual std::shared_ptr<Promise<std::variant<nitro::NullType, std::string>>> checkLightningPayment(const std::string& paymentHash, bool wait) = 0;
|
|
150
149
|
virtual std::shared_ptr<Promise<LightningReceive>> tryClaimLightningReceive(const std::string& paymentHash, bool wait, const std::optional<std::string>& token) = 0;
|
|
151
150
|
virtual std::shared_ptr<Promise<void>> tryClaimAllLightningReceives(bool wait) = 0;
|
|
152
|
-
virtual std::shared_ptr<Promise<
|
|
153
|
-
virtual std::shared_ptr<Promise<
|
|
151
|
+
virtual std::shared_ptr<Promise<std::string>> offboardSpecific(const std::vector<std::string>& vtxoIds, const std::string& destinationAddress) = 0;
|
|
152
|
+
virtual std::shared_ptr<Promise<std::string>> offboardAll(const std::string& destinationAddress) = 0;
|
|
154
153
|
|
|
155
154
|
protected:
|
|
156
155
|
// Hybrid Setup
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-nitro-ark",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.87",
|
|
4
4
|
"description": "Pure C++ Nitro Modules for Ark client",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/module/index.js",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@react-native/eslint-config": "^0.81.4",
|
|
78
78
|
"@release-it/conventional-changelog": "^9.0.2",
|
|
79
79
|
"@types/jest": "^29.5.5",
|
|
80
|
-
"@types/react": "^19.0
|
|
80
|
+
"@types/react": "^19.2.0",
|
|
81
81
|
"commitlint": "^19.6.1",
|
|
82
82
|
"del-cli": "^5.1.0",
|
|
83
83
|
"eslint": "^9.22.0",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"jest": "^29.7.0",
|
|
87
87
|
"nitrogen": "^0.32.1",
|
|
88
88
|
"prettier": "^3.0.3",
|
|
89
|
-
"react": "19.
|
|
90
|
-
"react-native": "0.
|
|
89
|
+
"react": "19.2.0",
|
|
90
|
+
"react-native": "0.83.1",
|
|
91
91
|
"react-native-builder-bob": "^0.40.13",
|
|
92
92
|
"react-native-nitro-modules": "^0.32.1",
|
|
93
93
|
"release-it": "^17.10.0",
|
package/src/NitroArk.nitro.ts
CHANGED
|
@@ -154,22 +154,6 @@ export interface BarkMovement {
|
|
|
154
154
|
completed_at?: string;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
export type RoundStatusType =
|
|
158
|
-
| 'confirmed'
|
|
159
|
-
| 'unconfirmed'
|
|
160
|
-
| 'pending'
|
|
161
|
-
| 'failed'
|
|
162
|
-
| 'canceled';
|
|
163
|
-
|
|
164
|
-
export interface RoundStatus {
|
|
165
|
-
status: RoundStatusType;
|
|
166
|
-
funding_txid?: string;
|
|
167
|
-
unsigned_funding_txids?: string[];
|
|
168
|
-
error?: string;
|
|
169
|
-
is_final: boolean;
|
|
170
|
-
is_success: boolean;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
157
|
// --- Nitro Module Interface ---
|
|
174
158
|
|
|
175
159
|
export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
@@ -183,6 +167,8 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
183
167
|
syncPendingBoards(): Promise<void>;
|
|
184
168
|
maintenance(): Promise<void>;
|
|
185
169
|
maintenanceWithOnchain(): Promise<void>;
|
|
170
|
+
maintenanceDelegated(): Promise<void>;
|
|
171
|
+
maintenanceWithOnchainDelegated(): Promise<void>;
|
|
186
172
|
maintenanceRefresh(): Promise<void>;
|
|
187
173
|
sync(): Promise<void>;
|
|
188
174
|
syncExits(): Promise<void>;
|
|
@@ -262,10 +248,7 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
262
248
|
amountSat: number,
|
|
263
249
|
comment: string
|
|
264
250
|
): Promise<LightningSendResult>;
|
|
265
|
-
|
|
266
|
-
destination: string,
|
|
267
|
-
amountSat: number
|
|
268
|
-
): Promise<RoundStatus>;
|
|
251
|
+
sendOnchain(destination: string, amountSat: number): Promise<string>;
|
|
269
252
|
|
|
270
253
|
// --- Lightning Invoicing ---
|
|
271
254
|
bolt11Invoice(amountMsat: number): Promise<Bolt11Invoice>;
|
|
@@ -287,6 +270,6 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
287
270
|
offboardSpecific(
|
|
288
271
|
vtxoIds: string[],
|
|
289
272
|
destinationAddress: string
|
|
290
|
-
): Promise<
|
|
291
|
-
offboardAll(destinationAddress: string): Promise<
|
|
273
|
+
): Promise<string>;
|
|
274
|
+
offboardAll(destinationAddress: string): Promise<string>;
|
|
292
275
|
}
|
package/src/index.tsx
CHANGED
|
@@ -16,7 +16,6 @@ import type {
|
|
|
16
16
|
BarkMovement as NitroBarkMovement,
|
|
17
17
|
BarkMovementDestination as NitroBarkMovementDestination,
|
|
18
18
|
BoardResult,
|
|
19
|
-
RoundStatus,
|
|
20
19
|
} from './NitroArk.nitro';
|
|
21
20
|
|
|
22
21
|
export type BarkVtxo = {
|
|
@@ -139,6 +138,24 @@ export function maintenanceWithOnchain(): Promise<void> {
|
|
|
139
138
|
return NitroArkHybridObject.maintenanceWithOnchain();
|
|
140
139
|
}
|
|
141
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Runs delegated wallet maintenance tasks for offchain.
|
|
143
|
+
* This includes refreshing vtxos that need to be refreshed using delegated signing.
|
|
144
|
+
* @returns A promise that resolves on success.
|
|
145
|
+
*/
|
|
146
|
+
export function maintenanceDelegated(): Promise<void> {
|
|
147
|
+
return NitroArkHybridObject.maintenanceDelegated();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Runs delegated wallet maintenance tasks for both offchain and onchain.
|
|
152
|
+
* This includes refreshing vtxos that need to be refreshed using delegated signing.
|
|
153
|
+
* @returns A promise that resolves on success.
|
|
154
|
+
*/
|
|
155
|
+
export function maintenanceWithOnchainDelegated(): Promise<void> {
|
|
156
|
+
return NitroArkHybridObject.maintenanceWithOnchainDelegated();
|
|
157
|
+
}
|
|
158
|
+
|
|
142
159
|
/**
|
|
143
160
|
* Refreshes vtxos that need to be refreshed.
|
|
144
161
|
* @returns A promise that resolves on success.
|
|
@@ -561,13 +578,13 @@ export function sendArkoorPayment(
|
|
|
561
578
|
* Sends an onchain payment via an Ark round.
|
|
562
579
|
* @param destination The destination Bitcoin address.
|
|
563
580
|
* @param amountSat The amount in satoshis to send.
|
|
564
|
-
* @returns A promise resolving to
|
|
581
|
+
* @returns A promise resolving to txid string.
|
|
565
582
|
*/
|
|
566
|
-
export function
|
|
583
|
+
export function sendOnchain(
|
|
567
584
|
destination: string,
|
|
568
585
|
amountSat: number
|
|
569
|
-
): Promise<
|
|
570
|
-
return NitroArkHybridObject.
|
|
586
|
+
): Promise<string> {
|
|
587
|
+
return NitroArkHybridObject.sendOnchain(destination, amountSat);
|
|
571
588
|
}
|
|
572
589
|
|
|
573
590
|
// --- Offboarding / Exiting ---
|
|
@@ -576,21 +593,21 @@ export function sendRoundOnchainPayment(
|
|
|
576
593
|
* Offboards specific VTXOs to a destination address.
|
|
577
594
|
* @param vtxoIds Array of VtxoId strings to offboard.
|
|
578
595
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
579
|
-
* @returns A promise resolving to the
|
|
596
|
+
* @returns A promise resolving to the txid string.
|
|
580
597
|
*/
|
|
581
598
|
export function offboardSpecific(
|
|
582
599
|
vtxoIds: string[],
|
|
583
600
|
destinationAddress: string
|
|
584
|
-
): Promise<
|
|
601
|
+
): Promise<string> {
|
|
585
602
|
return NitroArkHybridObject.offboardSpecific(vtxoIds, destinationAddress);
|
|
586
603
|
}
|
|
587
604
|
|
|
588
605
|
/**
|
|
589
606
|
* Offboards all VTXOs to a destination address.
|
|
590
607
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
591
|
-
* @returns A promise resolving to the
|
|
608
|
+
* @returns A promise resolving to the txid string.
|
|
592
609
|
*/
|
|
593
|
-
export function offboardAll(destinationAddress: string): Promise<
|
|
610
|
+
export function offboardAll(destinationAddress: string): Promise<string> {
|
|
594
611
|
return NitroArkHybridObject.offboardAll(destinationAddress);
|
|
595
612
|
}
|
|
596
613
|
|
|
@@ -611,5 +628,4 @@ export type {
|
|
|
611
628
|
NewAddressResult,
|
|
612
629
|
KeyPairResult,
|
|
613
630
|
LightningReceive,
|
|
614
|
-
RoundStatus,
|
|
615
631
|
} from './NitroArk.nitro';
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// RoundStatus.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
-
#else
|
|
18
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
-
#endif
|
|
20
|
-
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
-
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
-
#else
|
|
23
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
-
#endif
|
|
25
|
-
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
-
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
-
#else
|
|
28
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
// Forward declaration of `RoundStatusType` to properly resolve imports.
|
|
32
|
-
namespace margelo::nitro::nitroark { enum class RoundStatusType; }
|
|
33
|
-
|
|
34
|
-
#include "RoundStatusType.hpp"
|
|
35
|
-
#include <string>
|
|
36
|
-
#include <optional>
|
|
37
|
-
#include <vector>
|
|
38
|
-
|
|
39
|
-
namespace margelo::nitro::nitroark {
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* A struct which can be represented as a JavaScript object (RoundStatus).
|
|
43
|
-
*/
|
|
44
|
-
struct RoundStatus final {
|
|
45
|
-
public:
|
|
46
|
-
RoundStatusType status SWIFT_PRIVATE;
|
|
47
|
-
std::optional<std::string> funding_txid SWIFT_PRIVATE;
|
|
48
|
-
std::optional<std::vector<std::string>> unsigned_funding_txids SWIFT_PRIVATE;
|
|
49
|
-
std::optional<std::string> error SWIFT_PRIVATE;
|
|
50
|
-
bool is_final SWIFT_PRIVATE;
|
|
51
|
-
bool is_success SWIFT_PRIVATE;
|
|
52
|
-
|
|
53
|
-
public:
|
|
54
|
-
RoundStatus() = default;
|
|
55
|
-
explicit RoundStatus(RoundStatusType status, std::optional<std::string> funding_txid, std::optional<std::vector<std::string>> unsigned_funding_txids, std::optional<std::string> error, bool is_final, bool is_success): status(status), funding_txid(funding_txid), unsigned_funding_txids(unsigned_funding_txids), error(error), is_final(is_final), is_success(is_success) {}
|
|
56
|
-
|
|
57
|
-
public:
|
|
58
|
-
friend bool operator==(const RoundStatus& lhs, const RoundStatus& rhs) = default;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
} // namespace margelo::nitro::nitroark
|
|
62
|
-
|
|
63
|
-
namespace margelo::nitro {
|
|
64
|
-
|
|
65
|
-
// C++ RoundStatus <> JS RoundStatus (object)
|
|
66
|
-
template <>
|
|
67
|
-
struct JSIConverter<margelo::nitro::nitroark::RoundStatus> final {
|
|
68
|
-
static inline margelo::nitro::nitroark::RoundStatus fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
69
|
-
jsi::Object obj = arg.asObject(runtime);
|
|
70
|
-
return margelo::nitro::nitroark::RoundStatus(
|
|
71
|
-
JSIConverter<margelo::nitro::nitroark::RoundStatusType>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "status"))),
|
|
72
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "funding_txid"))),
|
|
73
|
-
JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "unsigned_funding_txids"))),
|
|
74
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "error"))),
|
|
75
|
-
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "is_final"))),
|
|
76
|
-
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "is_success")))
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::RoundStatus& arg) {
|
|
80
|
-
jsi::Object obj(runtime);
|
|
81
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "status"), JSIConverter<margelo::nitro::nitroark::RoundStatusType>::toJSI(runtime, arg.status));
|
|
82
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "funding_txid"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.funding_txid));
|
|
83
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "unsigned_funding_txids"), JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.unsigned_funding_txids));
|
|
84
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "error"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.error));
|
|
85
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "is_final"), JSIConverter<bool>::toJSI(runtime, arg.is_final));
|
|
86
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "is_success"), JSIConverter<bool>::toJSI(runtime, arg.is_success));
|
|
87
|
-
return obj;
|
|
88
|
-
}
|
|
89
|
-
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
90
|
-
if (!value.isObject()) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
jsi::Object obj = value.getObject(runtime);
|
|
94
|
-
if (!nitro::isPlainObject(runtime, obj)) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
if (!JSIConverter<margelo::nitro::nitroark::RoundStatusType>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "status")))) return false;
|
|
98
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "funding_txid")))) return false;
|
|
99
|
-
if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "unsigned_funding_txids")))) return false;
|
|
100
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "error")))) return false;
|
|
101
|
-
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "is_final")))) return false;
|
|
102
|
-
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "is_success")))) return false;
|
|
103
|
-
return true;
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
} // namespace margelo::nitro
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// RoundStatusType.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#if __has_include(<NitroModules/NitroHash.hpp>)
|
|
11
|
-
#include <NitroModules/NitroHash.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
-
#else
|
|
18
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
-
#endif
|
|
20
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
-
#else
|
|
23
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
-
#endif
|
|
25
|
-
|
|
26
|
-
namespace margelo::nitro::nitroark {
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* An enum which can be represented as a JavaScript union (RoundStatusType).
|
|
30
|
-
*/
|
|
31
|
-
enum class RoundStatusType {
|
|
32
|
-
CONFIRMED SWIFT_NAME(confirmed) = 0,
|
|
33
|
-
UNCONFIRMED SWIFT_NAME(unconfirmed) = 1,
|
|
34
|
-
PENDING SWIFT_NAME(pending) = 2,
|
|
35
|
-
FAILED SWIFT_NAME(failed) = 3,
|
|
36
|
-
CANCELED SWIFT_NAME(canceled) = 4,
|
|
37
|
-
} CLOSED_ENUM;
|
|
38
|
-
|
|
39
|
-
} // namespace margelo::nitro::nitroark
|
|
40
|
-
|
|
41
|
-
namespace margelo::nitro {
|
|
42
|
-
|
|
43
|
-
// C++ RoundStatusType <> JS RoundStatusType (union)
|
|
44
|
-
template <>
|
|
45
|
-
struct JSIConverter<margelo::nitro::nitroark::RoundStatusType> final {
|
|
46
|
-
static inline margelo::nitro::nitroark::RoundStatusType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
47
|
-
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
48
|
-
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
49
|
-
case hashString("confirmed"): return margelo::nitro::nitroark::RoundStatusType::CONFIRMED;
|
|
50
|
-
case hashString("unconfirmed"): return margelo::nitro::nitroark::RoundStatusType::UNCONFIRMED;
|
|
51
|
-
case hashString("pending"): return margelo::nitro::nitroark::RoundStatusType::PENDING;
|
|
52
|
-
case hashString("failed"): return margelo::nitro::nitroark::RoundStatusType::FAILED;
|
|
53
|
-
case hashString("canceled"): return margelo::nitro::nitroark::RoundStatusType::CANCELED;
|
|
54
|
-
default: [[unlikely]]
|
|
55
|
-
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum RoundStatusType - invalid value!");
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitroark::RoundStatusType arg) {
|
|
59
|
-
switch (arg) {
|
|
60
|
-
case margelo::nitro::nitroark::RoundStatusType::CONFIRMED: return JSIConverter<std::string>::toJSI(runtime, "confirmed");
|
|
61
|
-
case margelo::nitro::nitroark::RoundStatusType::UNCONFIRMED: return JSIConverter<std::string>::toJSI(runtime, "unconfirmed");
|
|
62
|
-
case margelo::nitro::nitroark::RoundStatusType::PENDING: return JSIConverter<std::string>::toJSI(runtime, "pending");
|
|
63
|
-
case margelo::nitro::nitroark::RoundStatusType::FAILED: return JSIConverter<std::string>::toJSI(runtime, "failed");
|
|
64
|
-
case margelo::nitro::nitroark::RoundStatusType::CANCELED: return JSIConverter<std::string>::toJSI(runtime, "canceled");
|
|
65
|
-
default: [[unlikely]]
|
|
66
|
-
throw std::invalid_argument("Cannot convert RoundStatusType to JS - invalid value: "
|
|
67
|
-
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
71
|
-
if (!value.isString()) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
75
|
-
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
76
|
-
case hashString("confirmed"):
|
|
77
|
-
case hashString("unconfirmed"):
|
|
78
|
-
case hashString("pending"):
|
|
79
|
-
case hashString("failed"):
|
|
80
|
-
case hashString("canceled"):
|
|
81
|
-
return true;
|
|
82
|
-
default:
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
} // namespace margelo::nitro
|