react-native-nitro-ark 0.0.79 → 0.0.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/android/src/main/jniLibs/arm64-v8a/libcxxbridge1.a +0 -0
  2. package/android/src/main/jniLibs/armeabi-v7a/libcxxbridge1.a +0 -0
  3. package/android/src/main/jniLibs/x86_64/libcxxbridge1.a +0 -0
  4. package/cpp/NitroArk.hpp +85 -55
  5. package/cpp/generated/ark_cxx.h +21 -55
  6. package/lib/module/index.js +31 -8
  7. package/lib/module/index.js.map +1 -1
  8. package/lib/typescript/src/NitroArk.nitro.d.ts +16 -26
  9. package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
  10. package/lib/typescript/src/index.d.ts +32 -11
  11. package/lib/typescript/src/index.d.ts.map +1 -1
  12. package/nitrogen/generated/shared/c++/ArkoorPaymentResult.hpp +2 -9
  13. package/nitrogen/generated/shared/c++/BarkArkInfo.hpp +1 -5
  14. package/nitrogen/generated/shared/c++/BarkMovementDestination.hpp +5 -1
  15. package/nitrogen/generated/shared/c++/BoardResult.hpp +6 -8
  16. package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +4 -2
  17. package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +12 -14
  18. package/nitrogen/generated/shared/c++/LightningSendResult.hpp +101 -0
  19. package/nitrogen/generated/shared/c++/OffchainBalanceResult.hpp +3 -8
  20. package/nitrogen/generated/shared/c++/OnchainPaymentResult.hpp +3 -9
  21. package/package.json +4 -4
  22. package/src/NitroArk.nitro.ts +19 -29
  23. package/src/index.tsx +52 -17
  24. package/nitrogen/generated/shared/c++/Bolt11PaymentResult.hpp +0 -85
  25. package/nitrogen/generated/shared/c++/Bolt12PaymentResult.hpp +0 -85
  26. package/nitrogen/generated/shared/c++/LightningReceiveBalance.hpp +0 -79
  27. package/nitrogen/generated/shared/c++/LnurlPaymentResult.hpp +0 -89
  28. package/nitrogen/generated/shared/c++/PaymentTypes.hpp +0 -88
@@ -1,85 +0,0 @@
1
- ///
2
- /// Bolt12PaymentResult.hpp
3
- /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
- /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
6
- ///
7
-
8
- #pragma once
9
-
10
- #if __has_include(<NitroModules/JSIConverter.hpp>)
11
- #include <NitroModules/JSIConverter.hpp>
12
- #else
13
- #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
- #endif
15
- #if __has_include(<NitroModules/NitroDefines.hpp>)
16
- #include <NitroModules/NitroDefines.hpp>
17
- #else
18
- #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
- #endif
20
- #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
-
26
- // Forward declaration of `PaymentTypes` to properly resolve imports.
27
- namespace margelo::nitro::nitroark { enum class PaymentTypes; }
28
-
29
- #include <string>
30
- #include "PaymentTypes.hpp"
31
-
32
- namespace margelo::nitro::nitroark {
33
-
34
- /**
35
- * A struct which can be represented as a JavaScript object (Bolt12PaymentResult).
36
- */
37
- struct Bolt12PaymentResult {
38
- public:
39
- std::string bolt12_offer SWIFT_PRIVATE;
40
- std::string preimage SWIFT_PRIVATE;
41
- PaymentTypes payment_type SWIFT_PRIVATE;
42
-
43
- public:
44
- Bolt12PaymentResult() = default;
45
- explicit Bolt12PaymentResult(std::string bolt12_offer, std::string preimage, PaymentTypes payment_type): bolt12_offer(bolt12_offer), preimage(preimage), payment_type(payment_type) {}
46
- };
47
-
48
- } // namespace margelo::nitro::nitroark
49
-
50
- namespace margelo::nitro {
51
-
52
- // C++ Bolt12PaymentResult <> JS Bolt12PaymentResult (object)
53
- template <>
54
- struct JSIConverter<margelo::nitro::nitroark::Bolt12PaymentResult> final {
55
- static inline margelo::nitro::nitroark::Bolt12PaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
56
- jsi::Object obj = arg.asObject(runtime);
57
- return margelo::nitro::nitroark::Bolt12PaymentResult(
58
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "bolt12_offer")),
59
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "preimage")),
60
- JSIConverter<margelo::nitro::nitroark::PaymentTypes>::fromJSI(runtime, obj.getProperty(runtime, "payment_type"))
61
- );
62
- }
63
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::Bolt12PaymentResult& arg) {
64
- jsi::Object obj(runtime);
65
- obj.setProperty(runtime, "bolt12_offer", JSIConverter<std::string>::toJSI(runtime, arg.bolt12_offer));
66
- obj.setProperty(runtime, "preimage", JSIConverter<std::string>::toJSI(runtime, arg.preimage));
67
- obj.setProperty(runtime, "payment_type", JSIConverter<margelo::nitro::nitroark::PaymentTypes>::toJSI(runtime, arg.payment_type));
68
- return obj;
69
- }
70
- static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
71
- if (!value.isObject()) {
72
- return false;
73
- }
74
- jsi::Object obj = value.getObject(runtime);
75
- if (!nitro::isPlainObject(runtime, obj)) {
76
- return false;
77
- }
78
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "bolt12_offer"))) return false;
79
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "preimage"))) return false;
80
- if (!JSIConverter<margelo::nitro::nitroark::PaymentTypes>::canConvert(runtime, obj.getProperty(runtime, "payment_type"))) return false;
81
- return true;
82
- }
83
- };
84
-
85
- } // namespace margelo::nitro
@@ -1,79 +0,0 @@
1
- ///
2
- /// LightningReceiveBalance.hpp
3
- /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
- /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
6
- ///
7
-
8
- #pragma once
9
-
10
- #if __has_include(<NitroModules/JSIConverter.hpp>)
11
- #include <NitroModules/JSIConverter.hpp>
12
- #else
13
- #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
- #endif
15
- #if __has_include(<NitroModules/NitroDefines.hpp>)
16
- #include <NitroModules/NitroDefines.hpp>
17
- #else
18
- #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
- #endif
20
- #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
-
26
-
27
-
28
-
29
-
30
- namespace margelo::nitro::nitroark {
31
-
32
- /**
33
- * A struct which can be represented as a JavaScript object (LightningReceiveBalance).
34
- */
35
- struct LightningReceiveBalance {
36
- public:
37
- double total SWIFT_PRIVATE;
38
- double claimable SWIFT_PRIVATE;
39
-
40
- public:
41
- LightningReceiveBalance() = default;
42
- explicit LightningReceiveBalance(double total, double claimable): total(total), claimable(claimable) {}
43
- };
44
-
45
- } // namespace margelo::nitro::nitroark
46
-
47
- namespace margelo::nitro {
48
-
49
- // C++ LightningReceiveBalance <> JS LightningReceiveBalance (object)
50
- template <>
51
- struct JSIConverter<margelo::nitro::nitroark::LightningReceiveBalance> final {
52
- static inline margelo::nitro::nitroark::LightningReceiveBalance fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
- jsi::Object obj = arg.asObject(runtime);
54
- return margelo::nitro::nitroark::LightningReceiveBalance(
55
- JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "total")),
56
- JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "claimable"))
57
- );
58
- }
59
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::LightningReceiveBalance& arg) {
60
- jsi::Object obj(runtime);
61
- obj.setProperty(runtime, "total", JSIConverter<double>::toJSI(runtime, arg.total));
62
- obj.setProperty(runtime, "claimable", JSIConverter<double>::toJSI(runtime, arg.claimable));
63
- return obj;
64
- }
65
- static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
66
- if (!value.isObject()) {
67
- return false;
68
- }
69
- jsi::Object obj = value.getObject(runtime);
70
- if (!nitro::isPlainObject(runtime, obj)) {
71
- return false;
72
- }
73
- if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "total"))) return false;
74
- if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "claimable"))) return false;
75
- return true;
76
- }
77
- };
78
-
79
- } // namespace margelo::nitro
@@ -1,89 +0,0 @@
1
- ///
2
- /// LnurlPaymentResult.hpp
3
- /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
- /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
6
- ///
7
-
8
- #pragma once
9
-
10
- #if __has_include(<NitroModules/JSIConverter.hpp>)
11
- #include <NitroModules/JSIConverter.hpp>
12
- #else
13
- #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
- #endif
15
- #if __has_include(<NitroModules/NitroDefines.hpp>)
16
- #include <NitroModules/NitroDefines.hpp>
17
- #else
18
- #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
- #endif
20
- #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
-
26
- // Forward declaration of `PaymentTypes` to properly resolve imports.
27
- namespace margelo::nitro::nitroark { enum class PaymentTypes; }
28
-
29
- #include <string>
30
- #include "PaymentTypes.hpp"
31
-
32
- namespace margelo::nitro::nitroark {
33
-
34
- /**
35
- * A struct which can be represented as a JavaScript object (LnurlPaymentResult).
36
- */
37
- struct LnurlPaymentResult {
38
- public:
39
- std::string lnurl SWIFT_PRIVATE;
40
- std::string bolt11_invoice SWIFT_PRIVATE;
41
- std::string preimage SWIFT_PRIVATE;
42
- PaymentTypes payment_type SWIFT_PRIVATE;
43
-
44
- public:
45
- LnurlPaymentResult() = default;
46
- explicit LnurlPaymentResult(std::string lnurl, std::string bolt11_invoice, std::string preimage, PaymentTypes payment_type): lnurl(lnurl), bolt11_invoice(bolt11_invoice), preimage(preimage), payment_type(payment_type) {}
47
- };
48
-
49
- } // namespace margelo::nitro::nitroark
50
-
51
- namespace margelo::nitro {
52
-
53
- // C++ LnurlPaymentResult <> JS LnurlPaymentResult (object)
54
- template <>
55
- struct JSIConverter<margelo::nitro::nitroark::LnurlPaymentResult> final {
56
- static inline margelo::nitro::nitroark::LnurlPaymentResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
57
- jsi::Object obj = arg.asObject(runtime);
58
- return margelo::nitro::nitroark::LnurlPaymentResult(
59
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "lnurl")),
60
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "bolt11_invoice")),
61
- JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "preimage")),
62
- JSIConverter<margelo::nitro::nitroark::PaymentTypes>::fromJSI(runtime, obj.getProperty(runtime, "payment_type"))
63
- );
64
- }
65
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::LnurlPaymentResult& arg) {
66
- jsi::Object obj(runtime);
67
- obj.setProperty(runtime, "lnurl", JSIConverter<std::string>::toJSI(runtime, arg.lnurl));
68
- obj.setProperty(runtime, "bolt11_invoice", JSIConverter<std::string>::toJSI(runtime, arg.bolt11_invoice));
69
- obj.setProperty(runtime, "preimage", JSIConverter<std::string>::toJSI(runtime, arg.preimage));
70
- obj.setProperty(runtime, "payment_type", JSIConverter<margelo::nitro::nitroark::PaymentTypes>::toJSI(runtime, arg.payment_type));
71
- return obj;
72
- }
73
- static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
74
- if (!value.isObject()) {
75
- return false;
76
- }
77
- jsi::Object obj = value.getObject(runtime);
78
- if (!nitro::isPlainObject(runtime, obj)) {
79
- return false;
80
- }
81
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "lnurl"))) return false;
82
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "bolt11_invoice"))) return false;
83
- if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "preimage"))) return false;
84
- if (!JSIConverter<margelo::nitro::nitroark::PaymentTypes>::canConvert(runtime, obj.getProperty(runtime, "payment_type"))) return false;
85
- return true;
86
- }
87
- };
88
-
89
- } // namespace margelo::nitro
@@ -1,88 +0,0 @@
1
- ///
2
- /// PaymentTypes.hpp
3
- /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
- /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
6
- ///
7
-
8
- #pragma once
9
-
10
- #if __has_include(<NitroModules/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 (PaymentTypes).
30
- */
31
- enum class PaymentTypes {
32
- BOLT11 SWIFT_NAME(bolt11) = 0,
33
- BOLT12 SWIFT_NAME(bolt12) = 1,
34
- LNURL SWIFT_NAME(lnurl) = 2,
35
- ARKOOR SWIFT_NAME(arkoor) = 3,
36
- ONCHAIN SWIFT_NAME(onchain) = 4,
37
- } CLOSED_ENUM;
38
-
39
- } // namespace margelo::nitro::nitroark
40
-
41
- namespace margelo::nitro {
42
-
43
- // C++ PaymentTypes <> JS PaymentTypes (union)
44
- template <>
45
- struct JSIConverter<margelo::nitro::nitroark::PaymentTypes> final {
46
- static inline margelo::nitro::nitroark::PaymentTypes 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("Bolt11"): return margelo::nitro::nitroark::PaymentTypes::BOLT11;
50
- case hashString("Bolt12"): return margelo::nitro::nitroark::PaymentTypes::BOLT12;
51
- case hashString("Lnurl"): return margelo::nitro::nitroark::PaymentTypes::LNURL;
52
- case hashString("Arkoor"): return margelo::nitro::nitroark::PaymentTypes::ARKOOR;
53
- case hashString("Onchain"): return margelo::nitro::nitroark::PaymentTypes::ONCHAIN;
54
- default: [[unlikely]]
55
- throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum PaymentTypes - invalid value!");
56
- }
57
- }
58
- static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitroark::PaymentTypes arg) {
59
- switch (arg) {
60
- case margelo::nitro::nitroark::PaymentTypes::BOLT11: return JSIConverter<std::string>::toJSI(runtime, "Bolt11");
61
- case margelo::nitro::nitroark::PaymentTypes::BOLT12: return JSIConverter<std::string>::toJSI(runtime, "Bolt12");
62
- case margelo::nitro::nitroark::PaymentTypes::LNURL: return JSIConverter<std::string>::toJSI(runtime, "Lnurl");
63
- case margelo::nitro::nitroark::PaymentTypes::ARKOOR: return JSIConverter<std::string>::toJSI(runtime, "Arkoor");
64
- case margelo::nitro::nitroark::PaymentTypes::ONCHAIN: return JSIConverter<std::string>::toJSI(runtime, "Onchain");
65
- default: [[unlikely]]
66
- throw std::invalid_argument("Cannot convert PaymentTypes 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("Bolt11"):
77
- case hashString("Bolt12"):
78
- case hashString("Lnurl"):
79
- case hashString("Arkoor"):
80
- case hashString("Onchain"):
81
- return true;
82
- default:
83
- return false;
84
- }
85
- }
86
- };
87
-
88
- } // namespace margelo::nitro