react-native-nitro-ark 0.0.82 → 0.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cpp/NitroArk.hpp +28 -5
- package/cpp/generated/ark_cxx.h +2 -14
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +2 -5
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/android/NitroArk+autolinking.cmake +1 -1
- package/nitrogen/generated/android/NitroArk+autolinking.gradle +1 -1
- package/nitrogen/generated/android/NitroArkOnLoad.cpp +1 -1
- package/nitrogen/generated/android/NitroArkOnLoad.hpp +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroark/NitroArkOnLoad.kt +1 -1
- package/nitrogen/generated/ios/NitroArk+autolinking.rb +2 -2
- package/nitrogen/generated/ios/NitroArk-Swift-Cxx-Bridge.cpp +1 -1
- package/nitrogen/generated/ios/NitroArk-Swift-Cxx-Bridge.hpp +1 -1
- package/nitrogen/generated/ios/NitroArk-Swift-Cxx-Umbrella.hpp +1 -1
- package/nitrogen/generated/ios/NitroArkAutolinking.mm +1 -1
- package/nitrogen/generated/ios/NitroArkAutolinking.swift +1 -1
- package/nitrogen/generated/shared/c++/ArkoorPaymentResult.hpp +19 -11
- package/nitrogen/generated/shared/c++/BarkArkInfo.hpp +37 -29
- package/nitrogen/generated/shared/c++/BarkConfigOpts.hpp +43 -35
- package/nitrogen/generated/shared/c++/BarkCreateOpts.hpp +28 -20
- package/nitrogen/generated/shared/c++/BarkMovement.hpp +55 -47
- package/nitrogen/generated/shared/c++/BarkMovementDestination.hpp +19 -11
- package/nitrogen/generated/shared/c++/BarkMovementSubsystem.hpp +16 -8
- package/nitrogen/generated/shared/c++/BarkSendManyOutput.hpp +16 -8
- package/nitrogen/generated/shared/c++/BarkVtxo.hpp +31 -23
- package/nitrogen/generated/shared/c++/BoardResult.hpp +16 -8
- package/nitrogen/generated/shared/c++/Bolt11Invoice.hpp +19 -11
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +2 -2
- package/nitrogen/generated/shared/c++/KeyPairResult.hpp +16 -8
- package/nitrogen/generated/shared/c++/LightningReceive.hpp +27 -15
- package/nitrogen/generated/shared/c++/LightningSendResult.hpp +28 -20
- package/nitrogen/generated/shared/c++/NewAddressResult.hpp +19 -11
- package/nitrogen/generated/shared/c++/OffchainBalanceResult.hpp +25 -17
- package/nitrogen/generated/shared/c++/OnchainBalanceResult.hpp +22 -14
- package/nitrogen/generated/shared/c++/OnchainPaymentResult.hpp +19 -11
- package/nitrogen/generated/shared/c++/RoundStatus.hpp +28 -20
- package/nitrogen/generated/shared/c++/RoundStatusType.hpp +1 -1
- package/package.json +4 -4
- package/src/NitroArk.nitro.ts +2 -8
- package/src/index.tsx +3 -4
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// OffchainBalanceResult.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
#else
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
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
|
|
25
30
|
|
|
26
31
|
|
|
27
32
|
|
|
@@ -32,7 +37,7 @@ namespace margelo::nitro::nitroark {
|
|
|
32
37
|
/**
|
|
33
38
|
* A struct which can be represented as a JavaScript object (OffchainBalanceResult).
|
|
34
39
|
*/
|
|
35
|
-
struct OffchainBalanceResult {
|
|
40
|
+
struct OffchainBalanceResult final {
|
|
36
41
|
public:
|
|
37
42
|
double spendable SWIFT_PRIVATE;
|
|
38
43
|
double pending_lightning_send SWIFT_PRIVATE;
|
|
@@ -43,6 +48,9 @@ namespace margelo::nitro::nitroark {
|
|
|
43
48
|
public:
|
|
44
49
|
OffchainBalanceResult() = default;
|
|
45
50
|
explicit OffchainBalanceResult(double spendable, double pending_lightning_send, double pending_in_round, double pending_exit, double pending_board): spendable(spendable), pending_lightning_send(pending_lightning_send), pending_in_round(pending_in_round), pending_exit(pending_exit), pending_board(pending_board) {}
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
friend bool operator==(const OffchainBalanceResult& lhs, const OffchainBalanceResult& rhs) = default;
|
|
46
54
|
};
|
|
47
55
|
|
|
48
56
|
} // namespace margelo::nitro::nitroark
|
|
@@ -55,20 +63,20 @@ namespace margelo::nitro {
|
|
|
55
63
|
static inline margelo::nitro::nitroark::OffchainBalanceResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
56
64
|
jsi::Object obj = arg.asObject(runtime);
|
|
57
65
|
return margelo::nitro::nitroark::OffchainBalanceResult(
|
|
58
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "spendable")),
|
|
59
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pending_lightning_send")),
|
|
60
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pending_in_round")),
|
|
61
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pending_exit")),
|
|
62
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pending_board"))
|
|
66
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "spendable"))),
|
|
67
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_lightning_send"))),
|
|
68
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_in_round"))),
|
|
69
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_exit"))),
|
|
70
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_board")))
|
|
63
71
|
);
|
|
64
72
|
}
|
|
65
73
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::OffchainBalanceResult& arg) {
|
|
66
74
|
jsi::Object obj(runtime);
|
|
67
|
-
obj.setProperty(runtime, "spendable", JSIConverter<double>::toJSI(runtime, arg.spendable));
|
|
68
|
-
obj.setProperty(runtime, "pending_lightning_send", JSIConverter<double>::toJSI(runtime, arg.pending_lightning_send));
|
|
69
|
-
obj.setProperty(runtime, "pending_in_round", JSIConverter<double>::toJSI(runtime, arg.pending_in_round));
|
|
70
|
-
obj.setProperty(runtime, "pending_exit", JSIConverter<double>::toJSI(runtime, arg.pending_exit));
|
|
71
|
-
obj.setProperty(runtime, "pending_board", JSIConverter<double>::toJSI(runtime, arg.pending_board));
|
|
75
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "spendable"), JSIConverter<double>::toJSI(runtime, arg.spendable));
|
|
76
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "pending_lightning_send"), JSIConverter<double>::toJSI(runtime, arg.pending_lightning_send));
|
|
77
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "pending_in_round"), JSIConverter<double>::toJSI(runtime, arg.pending_in_round));
|
|
78
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "pending_exit"), JSIConverter<double>::toJSI(runtime, arg.pending_exit));
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "pending_board"), JSIConverter<double>::toJSI(runtime, arg.pending_board));
|
|
72
80
|
return obj;
|
|
73
81
|
}
|
|
74
82
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -79,11 +87,11 @@ namespace margelo::nitro {
|
|
|
79
87
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
80
88
|
return false;
|
|
81
89
|
}
|
|
82
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "spendable"))) return false;
|
|
83
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pending_lightning_send"))) return false;
|
|
84
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pending_in_round"))) return false;
|
|
85
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pending_exit"))) return false;
|
|
86
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pending_board"))) return false;
|
|
90
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "spendable")))) return false;
|
|
91
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_lightning_send")))) return false;
|
|
92
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_in_round")))) return false;
|
|
93
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_exit")))) return false;
|
|
94
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pending_board")))) return false;
|
|
87
95
|
return true;
|
|
88
96
|
}
|
|
89
97
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// OnchainBalanceResult.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
#else
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
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
|
|
25
30
|
|
|
26
31
|
|
|
27
32
|
|
|
@@ -32,7 +37,7 @@ namespace margelo::nitro::nitroark {
|
|
|
32
37
|
/**
|
|
33
38
|
* A struct which can be represented as a JavaScript object (OnchainBalanceResult).
|
|
34
39
|
*/
|
|
35
|
-
struct OnchainBalanceResult {
|
|
40
|
+
struct OnchainBalanceResult final {
|
|
36
41
|
public:
|
|
37
42
|
double immature SWIFT_PRIVATE;
|
|
38
43
|
double trusted_pending SWIFT_PRIVATE;
|
|
@@ -42,6 +47,9 @@ namespace margelo::nitro::nitroark {
|
|
|
42
47
|
public:
|
|
43
48
|
OnchainBalanceResult() = default;
|
|
44
49
|
explicit OnchainBalanceResult(double immature, double trusted_pending, double untrusted_pending, double confirmed): immature(immature), trusted_pending(trusted_pending), untrusted_pending(untrusted_pending), confirmed(confirmed) {}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
friend bool operator==(const OnchainBalanceResult& lhs, const OnchainBalanceResult& rhs) = default;
|
|
45
53
|
};
|
|
46
54
|
|
|
47
55
|
} // namespace margelo::nitro::nitroark
|
|
@@ -54,18 +62,18 @@ namespace margelo::nitro {
|
|
|
54
62
|
static inline margelo::nitro::nitroark::OnchainBalanceResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
55
63
|
jsi::Object obj = arg.asObject(runtime);
|
|
56
64
|
return margelo::nitro::nitroark::OnchainBalanceResult(
|
|
57
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "immature")),
|
|
58
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "trusted_pending")),
|
|
59
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "untrusted_pending")),
|
|
60
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "confirmed"))
|
|
65
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "immature"))),
|
|
66
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "trusted_pending"))),
|
|
67
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "untrusted_pending"))),
|
|
68
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "confirmed")))
|
|
61
69
|
);
|
|
62
70
|
}
|
|
63
71
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::OnchainBalanceResult& arg) {
|
|
64
72
|
jsi::Object obj(runtime);
|
|
65
|
-
obj.setProperty(runtime, "immature", JSIConverter<double>::toJSI(runtime, arg.immature));
|
|
66
|
-
obj.setProperty(runtime, "trusted_pending", JSIConverter<double>::toJSI(runtime, arg.trusted_pending));
|
|
67
|
-
obj.setProperty(runtime, "untrusted_pending", JSIConverter<double>::toJSI(runtime, arg.untrusted_pending));
|
|
68
|
-
obj.setProperty(runtime, "confirmed", JSIConverter<double>::toJSI(runtime, arg.confirmed));
|
|
73
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "immature"), JSIConverter<double>::toJSI(runtime, arg.immature));
|
|
74
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "trusted_pending"), JSIConverter<double>::toJSI(runtime, arg.trusted_pending));
|
|
75
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "untrusted_pending"), JSIConverter<double>::toJSI(runtime, arg.untrusted_pending));
|
|
76
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "confirmed"), JSIConverter<double>::toJSI(runtime, arg.confirmed));
|
|
69
77
|
return obj;
|
|
70
78
|
}
|
|
71
79
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -76,10 +84,10 @@ namespace margelo::nitro {
|
|
|
76
84
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
77
85
|
return false;
|
|
78
86
|
}
|
|
79
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "immature"))) return false;
|
|
80
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "trusted_pending"))) return false;
|
|
81
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "untrusted_pending"))) return false;
|
|
82
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "confirmed"))) return false;
|
|
87
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "immature")))) return false;
|
|
88
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "trusted_pending")))) return false;
|
|
89
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "untrusted_pending")))) return false;
|
|
90
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "confirmed")))) return false;
|
|
83
91
|
return true;
|
|
84
92
|
}
|
|
85
93
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// OnchainPaymentResult.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
#else
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
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
|
|
25
30
|
|
|
26
31
|
|
|
27
32
|
|
|
@@ -32,7 +37,7 @@ namespace margelo::nitro::nitroark {
|
|
|
32
37
|
/**
|
|
33
38
|
* A struct which can be represented as a JavaScript object (OnchainPaymentResult).
|
|
34
39
|
*/
|
|
35
|
-
struct OnchainPaymentResult {
|
|
40
|
+
struct OnchainPaymentResult final {
|
|
36
41
|
public:
|
|
37
42
|
std::string txid SWIFT_PRIVATE;
|
|
38
43
|
double amount_sat SWIFT_PRIVATE;
|
|
@@ -41,6 +46,9 @@ namespace margelo::nitro::nitroark {
|
|
|
41
46
|
public:
|
|
42
47
|
OnchainPaymentResult() = default;
|
|
43
48
|
explicit OnchainPaymentResult(std::string txid, double amount_sat, std::string destination_address): txid(txid), amount_sat(amount_sat), destination_address(destination_address) {}
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
friend bool operator==(const OnchainPaymentResult& lhs, const OnchainPaymentResult& rhs) = default;
|
|
44
52
|
};
|
|
45
53
|
|
|
46
54
|
} // namespace margelo::nitro::nitroark
|
|
@@ -53,16 +61,16 @@ namespace margelo::nitro {
|
|
|
53
61
|
static inline margelo::nitro::nitroark::OnchainPaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
54
62
|
jsi::Object obj = arg.asObject(runtime);
|
|
55
63
|
return margelo::nitro::nitroark::OnchainPaymentResult(
|
|
56
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "txid")),
|
|
57
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "amount_sat")),
|
|
58
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "destination_address"))
|
|
64
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "txid"))),
|
|
65
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "amount_sat"))),
|
|
66
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "destination_address")))
|
|
59
67
|
);
|
|
60
68
|
}
|
|
61
69
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::OnchainPaymentResult& arg) {
|
|
62
70
|
jsi::Object obj(runtime);
|
|
63
|
-
obj.setProperty(runtime, "txid", JSIConverter<std::string>::toJSI(runtime, arg.txid));
|
|
64
|
-
obj.setProperty(runtime, "amount_sat", JSIConverter<double>::toJSI(runtime, arg.amount_sat));
|
|
65
|
-
obj.setProperty(runtime, "destination_address", JSIConverter<std::string>::toJSI(runtime, arg.destination_address));
|
|
71
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "txid"), JSIConverter<std::string>::toJSI(runtime, arg.txid));
|
|
72
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "amount_sat"), JSIConverter<double>::toJSI(runtime, arg.amount_sat));
|
|
73
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "destination_address"), JSIConverter<std::string>::toJSI(runtime, arg.destination_address));
|
|
66
74
|
return obj;
|
|
67
75
|
}
|
|
68
76
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -73,9 +81,9 @@ namespace margelo::nitro {
|
|
|
73
81
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
74
82
|
return false;
|
|
75
83
|
}
|
|
76
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "txid"))) return false;
|
|
77
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "amount_sat"))) return false;
|
|
78
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "destination_address"))) return false;
|
|
84
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "txid")))) return false;
|
|
85
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "amount_sat")))) return false;
|
|
86
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "destination_address")))) return false;
|
|
79
87
|
return true;
|
|
80
88
|
}
|
|
81
89
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// RoundStatus.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright ©
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
#else
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
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
|
|
25
30
|
|
|
26
31
|
// Forward declaration of `RoundStatusType` to properly resolve imports.
|
|
27
32
|
namespace margelo::nitro::nitroark { enum class RoundStatusType; }
|
|
@@ -36,7 +41,7 @@ namespace margelo::nitro::nitroark {
|
|
|
36
41
|
/**
|
|
37
42
|
* A struct which can be represented as a JavaScript object (RoundStatus).
|
|
38
43
|
*/
|
|
39
|
-
struct RoundStatus {
|
|
44
|
+
struct RoundStatus final {
|
|
40
45
|
public:
|
|
41
46
|
RoundStatusType status SWIFT_PRIVATE;
|
|
42
47
|
std::optional<std::string> funding_txid SWIFT_PRIVATE;
|
|
@@ -48,6 +53,9 @@ namespace margelo::nitro::nitroark {
|
|
|
48
53
|
public:
|
|
49
54
|
RoundStatus() = default;
|
|
50
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;
|
|
51
59
|
};
|
|
52
60
|
|
|
53
61
|
} // namespace margelo::nitro::nitroark
|
|
@@ -60,22 +68,22 @@ namespace margelo::nitro {
|
|
|
60
68
|
static inline margelo::nitro::nitroark::RoundStatus fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
61
69
|
jsi::Object obj = arg.asObject(runtime);
|
|
62
70
|
return margelo::nitro::nitroark::RoundStatus(
|
|
63
|
-
JSIConverter<margelo::nitro::nitroark::RoundStatusType>::fromJSI(runtime, obj.getProperty(runtime, "status")),
|
|
64
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "funding_txid")),
|
|
65
|
-
JSIConverter<std::optional<std::vector<std::string>>>::fromJSI(runtime, obj.getProperty(runtime, "unsigned_funding_txids")),
|
|
66
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "error")),
|
|
67
|
-
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "is_final")),
|
|
68
|
-
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "is_success"))
|
|
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")))
|
|
69
77
|
);
|
|
70
78
|
}
|
|
71
79
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::RoundStatus& arg) {
|
|
72
80
|
jsi::Object obj(runtime);
|
|
73
|
-
obj.setProperty(runtime, "status", JSIConverter<margelo::nitro::nitroark::RoundStatusType>::toJSI(runtime, arg.status));
|
|
74
|
-
obj.setProperty(runtime, "funding_txid", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.funding_txid));
|
|
75
|
-
obj.setProperty(runtime, "unsigned_funding_txids", JSIConverter<std::optional<std::vector<std::string>>>::toJSI(runtime, arg.unsigned_funding_txids));
|
|
76
|
-
obj.setProperty(runtime, "error", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.error));
|
|
77
|
-
obj.setProperty(runtime, "is_final", JSIConverter<bool>::toJSI(runtime, arg.is_final));
|
|
78
|
-
obj.setProperty(runtime, "is_success", JSIConverter<bool>::toJSI(runtime, arg.is_success));
|
|
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));
|
|
79
87
|
return obj;
|
|
80
88
|
}
|
|
81
89
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -86,12 +94,12 @@ namespace margelo::nitro {
|
|
|
86
94
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
87
95
|
return false;
|
|
88
96
|
}
|
|
89
|
-
if (!JSIConverter<margelo::nitro::nitroark::RoundStatusType>::canConvert(runtime, obj.getProperty(runtime, "status"))) return false;
|
|
90
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "funding_txid"))) return false;
|
|
91
|
-
if (!JSIConverter<std::optional<std::vector<std::string>>>::canConvert(runtime, obj.getProperty(runtime, "unsigned_funding_txids"))) return false;
|
|
92
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "error"))) return false;
|
|
93
|
-
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "is_final"))) return false;
|
|
94
|
-
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "is_success"))) return false;
|
|
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;
|
|
95
103
|
return true;
|
|
96
104
|
}
|
|
97
105
|
};
|
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.84",
|
|
4
4
|
"description": "Pure C++ Nitro Modules for Ark client",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/module/index.js",
|
|
@@ -84,12 +84,12 @@
|
|
|
84
84
|
"eslint-config-prettier": "^10.1.1",
|
|
85
85
|
"eslint-plugin-prettier": "^5.2.3",
|
|
86
86
|
"jest": "^29.7.0",
|
|
87
|
-
"nitrogen": "^0.
|
|
87
|
+
"nitrogen": "^0.32.0",
|
|
88
88
|
"prettier": "^3.0.3",
|
|
89
89
|
"react": "19.1.0",
|
|
90
90
|
"react-native": "0.81.4",
|
|
91
91
|
"react-native-builder-bob": "^0.40.13",
|
|
92
|
-
"react-native-nitro-modules": "^0.
|
|
92
|
+
"react-native-nitro-modules": "^0.32.0",
|
|
93
93
|
"release-it": "^17.10.0",
|
|
94
94
|
"turbo": "^1.10.7",
|
|
95
95
|
"typescript": "^5.2.2"
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"peerDependencies": {
|
|
98
98
|
"react": "*",
|
|
99
99
|
"react-native": "*",
|
|
100
|
-
"react-native-nitro-modules": "^0.
|
|
100
|
+
"react-native-nitro-modules": "^0.32.0"
|
|
101
101
|
},
|
|
102
102
|
"workspaces": [
|
|
103
103
|
"example"
|
package/src/NitroArk.nitro.ts
CHANGED
|
@@ -87,13 +87,6 @@ export interface OnchainPaymentResult {
|
|
|
87
87
|
destination_address: string; // Destination address
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export interface LightningReceiveBalance {
|
|
91
|
-
/// Sum of all pending lightning invoices
|
|
92
|
-
total: number;
|
|
93
|
-
/// Sum of all invoices for which we received the HTLC VTXOs
|
|
94
|
-
claimable: number;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
90
|
export interface OffchainBalanceResult {
|
|
98
91
|
spendable: number; // u64
|
|
99
92
|
pending_lightning_send: number; // u64
|
|
@@ -129,6 +122,7 @@ export interface LightningReceive {
|
|
|
129
122
|
payment_preimage: string;
|
|
130
123
|
invoice: string;
|
|
131
124
|
preimage_revealed_at?: number;
|
|
125
|
+
finished_at?: number;
|
|
132
126
|
}
|
|
133
127
|
|
|
134
128
|
export interface BarkMovementSubsystem {
|
|
@@ -286,7 +280,7 @@ export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++' }> {
|
|
|
286
280
|
paymentHash: string,
|
|
287
281
|
wait: boolean,
|
|
288
282
|
token?: string
|
|
289
|
-
): Promise<
|
|
283
|
+
): Promise<LightningReceive>; // Throws on error
|
|
290
284
|
tryClaimAllLightningReceives(wait: boolean): Promise<void>; // Throws on error
|
|
291
285
|
|
|
292
286
|
// --- Offboarding / Exiting ---
|
package/src/index.tsx
CHANGED
|
@@ -452,18 +452,18 @@ export function checkLightningPayment(
|
|
|
452
452
|
* @param paymentHash The payment hash of the Lightning payment.
|
|
453
453
|
* @param wait Whether to wait for the claim to complete.
|
|
454
454
|
* @param token Optional claim token used when no spendable VTXOs are owned.
|
|
455
|
-
* @returns A promise resolving to the claimed
|
|
455
|
+
* @returns A promise resolving to the claimed LightningReceive if successful, or null if not.
|
|
456
456
|
*/
|
|
457
457
|
export function tryClaimLightningReceive(
|
|
458
458
|
paymentHash: string,
|
|
459
459
|
wait: boolean,
|
|
460
460
|
token?: string
|
|
461
|
-
): Promise<
|
|
461
|
+
): Promise<LightningReceive> {
|
|
462
462
|
return NitroArkHybridObject.tryClaimLightningReceive(
|
|
463
463
|
paymentHash,
|
|
464
464
|
wait,
|
|
465
465
|
token
|
|
466
|
-
)
|
|
466
|
+
);
|
|
467
467
|
}
|
|
468
468
|
|
|
469
469
|
/**
|
|
@@ -611,6 +611,5 @@ export type {
|
|
|
611
611
|
NewAddressResult,
|
|
612
612
|
KeyPairResult,
|
|
613
613
|
LightningReceive,
|
|
614
|
-
LightningReceiveBalance,
|
|
615
614
|
RoundStatus,
|
|
616
615
|
} from './NitroArk.nitro';
|