react-native-nitro-ark 0.0.85 → 0.0.86
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 +0 -86
- package/android/src/main/jniLibs/x86_64/libcxxbridge1.a +0 -0
- package/cpp/NitroArk.hpp +12 -60
- package/cpp/generated/ark_cxx.h +3 -3
- package/lib/module/index.js +5 -5
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +3 -12
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +8 -8
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +3 -6
- package/package.json +4 -4
- package/src/NitroArk.nitro.ts +3 -22
- package/src/index.tsx +8 -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)
|
|
@@ -394,21 +323,6 @@ JNIEXPORT void JNICALL Java_com_margelo_nitro_nitroark_NitroArkNative_tryClaimLi
|
|
|
394
323
|
}
|
|
395
324
|
}
|
|
396
325
|
|
|
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
326
|
JNIEXPORT jobject JNICALL Java_com_margelo_nitro_nitroark_NitroArkNative_peakKeyPair(JNIEnv* env, jobject /*thiz*/,
|
|
413
327
|
jint jIndex) {
|
|
414
328
|
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:
|
|
@@ -941,13 +895,11 @@ public:
|
|
|
941
895
|
});
|
|
942
896
|
}
|
|
943
897
|
|
|
944
|
-
std::shared_ptr<Promise<
|
|
945
|
-
|
|
946
|
-
return Promise<RoundStatus>::async([destination, amountSat]() {
|
|
898
|
+
std::shared_ptr<Promise<std::string>> sendOnchain(const std::string& destination, double amountSat) override {
|
|
899
|
+
return Promise<std::string>::async([destination, amountSat]() {
|
|
947
900
|
try {
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
return convertRoundStatus(status_rs);
|
|
901
|
+
rust::String result = bark_cxx::send_onchain(destination, static_cast<uint64_t>(amountSat));
|
|
902
|
+
return std::string(result);
|
|
951
903
|
} catch (const rust::Error& e) {
|
|
952
904
|
throw std::runtime_error(e.what());
|
|
953
905
|
}
|
|
@@ -956,27 +908,27 @@ public:
|
|
|
956
908
|
|
|
957
909
|
// --- Offboarding / Exiting ---
|
|
958
910
|
|
|
959
|
-
std::shared_ptr<Promise<
|
|
911
|
+
std::shared_ptr<Promise<std::string>> offboardSpecific(const std::vector<std::string>& vtxoIds,
|
|
960
912
|
const std::string& destinationAddress) override {
|
|
961
|
-
return Promise<
|
|
913
|
+
return Promise<std::string>::async([vtxoIds, destinationAddress]() {
|
|
962
914
|
try {
|
|
963
915
|
rust::Vec<rust::String> rust_vtxo_ids;
|
|
964
916
|
for (const auto& id : vtxoIds) {
|
|
965
917
|
rust_vtxo_ids.push_back(rust::String(id));
|
|
966
918
|
}
|
|
967
|
-
|
|
968
|
-
return
|
|
919
|
+
rust::String result = bark_cxx::offboard_specific(std::move(rust_vtxo_ids), destinationAddress);
|
|
920
|
+
return std::string(result);
|
|
969
921
|
} catch (const rust::Error& e) {
|
|
970
922
|
throw std::runtime_error(e.what());
|
|
971
923
|
}
|
|
972
924
|
});
|
|
973
925
|
}
|
|
974
926
|
|
|
975
|
-
std::shared_ptr<Promise<
|
|
976
|
-
return Promise<
|
|
927
|
+
std::shared_ptr<Promise<std::string>> offboardAll(const std::string& destinationAddress) override {
|
|
928
|
+
return Promise<std::string>::async([destinationAddress]() {
|
|
977
929
|
try {
|
|
978
|
-
|
|
979
|
-
return
|
|
930
|
+
rust::String result = bark_cxx::offboard_all(destinationAddress);
|
|
931
|
+
return std::string(result);
|
|
980
932
|
} catch (const rust::Error& e) {
|
|
981
933
|
throw std::runtime_error(e.what());
|
|
982
934
|
}
|
package/cpp/generated/ark_cxx.h
CHANGED
|
@@ -1159,11 +1159,11 @@ void validate_arkoor_address(::rust::Str address);
|
|
|
1159
1159
|
|
|
1160
1160
|
::bark_cxx::LightningSend pay_lightning_address(::rust::Str addr, ::std::uint64_t amount_sat, ::rust::Str comment);
|
|
1161
1161
|
|
|
1162
|
-
::
|
|
1162
|
+
::rust::String send_onchain(::rust::Str destination, ::std::uint64_t amount_sat);
|
|
1163
1163
|
|
|
1164
|
-
::
|
|
1164
|
+
::rust::String offboard_specific(::rust::Vec<::rust::String> vtxo_ids, ::rust::Str destination_address);
|
|
1165
1165
|
|
|
1166
|
-
::
|
|
1166
|
+
::rust::String offboard_all(::rust::Str destination_address);
|
|
1167
1167
|
|
|
1168
1168
|
::bark_cxx::LightningReceive try_claim_lightning_receive(::rust::String payment_hash, bool wait, ::rust::String const *token);
|
|
1169
1169
|
|
package/lib/module/index.js
CHANGED
|
@@ -450,10 +450,10 @@ export function sendArkoorPayment(destination, amountSat) {
|
|
|
450
450
|
* Sends an onchain payment via an Ark round.
|
|
451
451
|
* @param destination The destination Bitcoin address.
|
|
452
452
|
* @param amountSat The amount in satoshis to send.
|
|
453
|
-
* @returns A promise resolving to
|
|
453
|
+
* @returns A promise resolving to txid string.
|
|
454
454
|
*/
|
|
455
|
-
export function
|
|
456
|
-
return NitroArkHybridObject.
|
|
455
|
+
export function sendOnchain(destination, amountSat) {
|
|
456
|
+
return NitroArkHybridObject.sendOnchain(destination, amountSat);
|
|
457
457
|
}
|
|
458
458
|
|
|
459
459
|
// --- Offboarding / Exiting ---
|
|
@@ -462,7 +462,7 @@ export function sendRoundOnchainPayment(destination, amountSat) {
|
|
|
462
462
|
* Offboards specific VTXOs to a destination address.
|
|
463
463
|
* @param vtxoIds Array of VtxoId strings to offboard.
|
|
464
464
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
465
|
-
* @returns A promise resolving to the
|
|
465
|
+
* @returns A promise resolving to the txid string.
|
|
466
466
|
*/
|
|
467
467
|
export function offboardSpecific(vtxoIds, destinationAddress) {
|
|
468
468
|
return NitroArkHybridObject.offboardSpecific(vtxoIds, destinationAddress);
|
|
@@ -471,7 +471,7 @@ export function offboardSpecific(vtxoIds, destinationAddress) {
|
|
|
471
471
|
/**
|
|
472
472
|
* Offboards all VTXOs to a destination address.
|
|
473
473
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
474
|
-
* @returns A promise resolving to the
|
|
474
|
+
* @returns A promise resolving to the txid string.
|
|
475
475
|
*/
|
|
476
476
|
export function offboardAll(destinationAddress) {
|
|
477
477
|
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","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;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAoB;EAChD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AA,EAAyB;EAC/C,OAAOnE,oBAAoB,CAACmE,QAAQ,CAAC,CAAC;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAACC,OAAe,EAAiB;EACpE,OAAOrE,oBAAoB,CAACoE,qBAAqB,CAACC,OAAO,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAC/BxB,WAAmB,EACnBC,SAAiB,EACa;EAC9B,OAAO/C,oBAAoB,CAACsE,iBAAiB,CAACxB,WAAW,EAAEC,SAAS,CAAC;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASwB,WAAWA,CACzBzB,WAAmB,EACnBC,SAAiB,EACA;EACjB,OAAO/C,oBAAoB,CAACuE,WAAW,CAACzB,WAAW,EAAEC,SAAS,CAAC;AACjE;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASyB,gBAAgBA,CAC9BC,OAAiB,EACjBC,kBAA0B,EACT;EACjB,OAAO1E,oBAAoB,CAACwE,gBAAgB,CAACC,OAAO,EAAEC,kBAAkB,CAAC;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACD,kBAA0B,EAAmB;EACvE,OAAO1E,oBAAoB,CAAC2E,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++';
|
|
@@ -182,14 +173,14 @@ export interface NitroArk extends HybridObject<{
|
|
|
182
173
|
payLightningInvoice(destination: string, amountSat?: number): Promise<LightningSendResult>;
|
|
183
174
|
payLightningOffer(offer: string, amountSat?: number): Promise<LightningSendResult>;
|
|
184
175
|
payLightningAddress(addr: string, amountSat: number, comment: string): Promise<LightningSendResult>;
|
|
185
|
-
|
|
176
|
+
sendOnchain(destination: string, amountSat: number): Promise<string>;
|
|
186
177
|
bolt11Invoice(amountMsat: number): Promise<Bolt11Invoice>;
|
|
187
178
|
lightningReceiveStatus(paymentHash: string): Promise<LightningReceive | undefined>;
|
|
188
179
|
checkLightningPayment(paymentHash: string, wait: boolean): Promise<string | null>;
|
|
189
180
|
tryClaimLightningReceive(paymentHash: string, wait: boolean, token?: string): Promise<LightningReceive>;
|
|
190
181
|
tryClaimAllLightningReceives(wait: boolean): Promise<void>;
|
|
191
|
-
offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<
|
|
192
|
-
offboardAll(destinationAddress: string): Promise<
|
|
182
|
+
offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<string>;
|
|
183
|
+
offboardAll(destinationAddress: string): Promise<string>;
|
|
193
184
|
}
|
|
194
185
|
export {};
|
|
195
186
|
//# 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,a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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;
|
|
@@ -308,21 +308,21 @@ export declare function sendArkoorPayment(destination: string, amountSat: number
|
|
|
308
308
|
* Sends an onchain payment via an Ark round.
|
|
309
309
|
* @param destination The destination Bitcoin address.
|
|
310
310
|
* @param amountSat The amount in satoshis to send.
|
|
311
|
-
* @returns A promise resolving to
|
|
311
|
+
* @returns A promise resolving to txid string.
|
|
312
312
|
*/
|
|
313
|
-
export declare function
|
|
313
|
+
export declare function sendOnchain(destination: string, amountSat: number): Promise<string>;
|
|
314
314
|
/**
|
|
315
315
|
* Offboards specific VTXOs to a destination address.
|
|
316
316
|
* @param vtxoIds Array of VtxoId strings to offboard.
|
|
317
317
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
318
|
-
* @returns A promise resolving to the
|
|
318
|
+
* @returns A promise resolving to the txid string.
|
|
319
319
|
*/
|
|
320
|
-
export declare function offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<
|
|
320
|
+
export declare function offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<string>;
|
|
321
321
|
/**
|
|
322
322
|
* Offboards all VTXOs to a destination address.
|
|
323
323
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
324
|
-
* @returns A promise resolving to the
|
|
324
|
+
* @returns A promise resolving to the txid string.
|
|
325
325
|
*/
|
|
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,
|
|
326
|
+
export declare function offboardAll(destinationAddress: string): Promise<string>;
|
|
327
|
+
export type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, Bolt11Invoice, BoardResult, BarkSendManyOutput, ArkoorPaymentResult, LightningSendResult, OnchainPaymentResult, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive, } from './NitroArk.nitro';
|
|
328
328
|
//# 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,EAChB,YAAY,IAAI,iBAAiB,EACjC,uBAAuB,IAAI,4BAA4B,EACvD,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1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IG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAEnE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,mBAAmB,CAAC,CAE9B;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAEjB;AAID;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EAAE,EACjB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvE;AAGD,YAAY,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,kBAAkB,CAAC"}
|
|
@@ -57,7 +57,7 @@ namespace margelo::nitro::nitroark {
|
|
|
57
57
|
prototype.registerHybridMethod("payLightningInvoice", &HybridNitroArkSpec::payLightningInvoice);
|
|
58
58
|
prototype.registerHybridMethod("payLightningOffer", &HybridNitroArkSpec::payLightningOffer);
|
|
59
59
|
prototype.registerHybridMethod("payLightningAddress", &HybridNitroArkSpec::payLightningAddress);
|
|
60
|
-
prototype.registerHybridMethod("
|
|
60
|
+
prototype.registerHybridMethod("sendOnchain", &HybridNitroArkSpec::sendOnchain);
|
|
61
61
|
prototype.registerHybridMethod("bolt11Invoice", &HybridNitroArkSpec::bolt11Invoice);
|
|
62
62
|
prototype.registerHybridMethod("lightningReceiveStatus", &HybridNitroArkSpec::lightningReceiveStatus);
|
|
63
63
|
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>
|
|
@@ -143,14 +140,14 @@ namespace margelo::nitro::nitroark {
|
|
|
143
140
|
virtual std::shared_ptr<Promise<LightningSendResult>> payLightningInvoice(const std::string& destination, std::optional<double> amountSat) = 0;
|
|
144
141
|
virtual std::shared_ptr<Promise<LightningSendResult>> payLightningOffer(const std::string& offer, std::optional<double> amountSat) = 0;
|
|
145
142
|
virtual std::shared_ptr<Promise<LightningSendResult>> payLightningAddress(const std::string& addr, double amountSat, const std::string& comment) = 0;
|
|
146
|
-
virtual std::shared_ptr<Promise<
|
|
143
|
+
virtual std::shared_ptr<Promise<std::string>> sendOnchain(const std::string& destination, double amountSat) = 0;
|
|
147
144
|
virtual std::shared_ptr<Promise<Bolt11Invoice>> bolt11Invoice(double amountMsat) = 0;
|
|
148
145
|
virtual std::shared_ptr<Promise<std::optional<LightningReceive>>> lightningReceiveStatus(const std::string& paymentHash) = 0;
|
|
149
146
|
virtual std::shared_ptr<Promise<std::variant<nitro::NullType, std::string>>> checkLightningPayment(const std::string& paymentHash, bool wait) = 0;
|
|
150
147
|
virtual std::shared_ptr<Promise<LightningReceive>> tryClaimLightningReceive(const std::string& paymentHash, bool wait, const std::optional<std::string>& token) = 0;
|
|
151
148
|
virtual std::shared_ptr<Promise<void>> tryClaimAllLightningReceives(bool wait) = 0;
|
|
152
|
-
virtual std::shared_ptr<Promise<
|
|
153
|
-
virtual std::shared_ptr<Promise<
|
|
149
|
+
virtual std::shared_ptr<Promise<std::string>> offboardSpecific(const std::vector<std::string>& vtxoIds, const std::string& destinationAddress) = 0;
|
|
150
|
+
virtual std::shared_ptr<Promise<std::string>> offboardAll(const std::string& destinationAddress) = 0;
|
|
154
151
|
|
|
155
152
|
protected:
|
|
156
153
|
// 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.86",
|
|
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++' }> {
|
|
@@ -262,10 +246,7 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
262
246
|
amountSat: number,
|
|
263
247
|
comment: string
|
|
264
248
|
): Promise<LightningSendResult>;
|
|
265
|
-
|
|
266
|
-
destination: string,
|
|
267
|
-
amountSat: number
|
|
268
|
-
): Promise<RoundStatus>;
|
|
249
|
+
sendOnchain(destination: string, amountSat: number): Promise<string>;
|
|
269
250
|
|
|
270
251
|
// --- Lightning Invoicing ---
|
|
271
252
|
bolt11Invoice(amountMsat: number): Promise<Bolt11Invoice>;
|
|
@@ -287,6 +268,6 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
287
268
|
offboardSpecific(
|
|
288
269
|
vtxoIds: string[],
|
|
289
270
|
destinationAddress: string
|
|
290
|
-
): Promise<
|
|
291
|
-
offboardAll(destinationAddress: string): Promise<
|
|
271
|
+
): Promise<string>;
|
|
272
|
+
offboardAll(destinationAddress: string): Promise<string>;
|
|
292
273
|
}
|
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 = {
|
|
@@ -561,13 +560,13 @@ export function sendArkoorPayment(
|
|
|
561
560
|
* Sends an onchain payment via an Ark round.
|
|
562
561
|
* @param destination The destination Bitcoin address.
|
|
563
562
|
* @param amountSat The amount in satoshis to send.
|
|
564
|
-
* @returns A promise resolving to
|
|
563
|
+
* @returns A promise resolving to txid string.
|
|
565
564
|
*/
|
|
566
|
-
export function
|
|
565
|
+
export function sendOnchain(
|
|
567
566
|
destination: string,
|
|
568
567
|
amountSat: number
|
|
569
|
-
): Promise<
|
|
570
|
-
return NitroArkHybridObject.
|
|
568
|
+
): Promise<string> {
|
|
569
|
+
return NitroArkHybridObject.sendOnchain(destination, amountSat);
|
|
571
570
|
}
|
|
572
571
|
|
|
573
572
|
// --- Offboarding / Exiting ---
|
|
@@ -576,21 +575,21 @@ export function sendRoundOnchainPayment(
|
|
|
576
575
|
* Offboards specific VTXOs to a destination address.
|
|
577
576
|
* @param vtxoIds Array of VtxoId strings to offboard.
|
|
578
577
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
579
|
-
* @returns A promise resolving to the
|
|
578
|
+
* @returns A promise resolving to the txid string.
|
|
580
579
|
*/
|
|
581
580
|
export function offboardSpecific(
|
|
582
581
|
vtxoIds: string[],
|
|
583
582
|
destinationAddress: string
|
|
584
|
-
): Promise<
|
|
583
|
+
): Promise<string> {
|
|
585
584
|
return NitroArkHybridObject.offboardSpecific(vtxoIds, destinationAddress);
|
|
586
585
|
}
|
|
587
586
|
|
|
588
587
|
/**
|
|
589
588
|
* Offboards all VTXOs to a destination address.
|
|
590
589
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
591
|
-
* @returns A promise resolving to the
|
|
590
|
+
* @returns A promise resolving to the txid string.
|
|
592
591
|
*/
|
|
593
|
-
export function offboardAll(destinationAddress: string): Promise<
|
|
592
|
+
export function offboardAll(destinationAddress: string): Promise<string> {
|
|
594
593
|
return NitroArkHybridObject.offboardAll(destinationAddress);
|
|
595
594
|
}
|
|
596
595
|
|
|
@@ -611,5 +610,4 @@ export type {
|
|
|
611
610
|
NewAddressResult,
|
|
612
611
|
KeyPairResult,
|
|
613
612
|
LightningReceive,
|
|
614
|
-
RoundStatus,
|
|
615
613
|
} 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
|