react-native-nitro-ark 0.0.24 → 0.0.25
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/ArkCxxBridge.xcframework/Info.plist +48 -0
- package/ArkCxxBridge.xcframework/ios-arm64/Headers/ark_cxx.h +932 -0
- package/ArkCxxBridge.xcframework/ios-arm64/Headers/cxx.rs.h +87 -0
- package/ArkCxxBridge.xcframework/ios-arm64/libcxxbridge1.a +0 -0
- package/ArkCxxBridge.xcframework/ios-arm64_x86_64-simulator/Headers/ark_cxx.h +932 -0
- package/ArkCxxBridge.xcframework/ios-arm64_x86_64-simulator/Headers/cxx.rs.h +87 -0
- package/ArkCxxBridge.xcframework/ios-arm64_x86_64-simulator/libcxxbridge1.a +0 -0
- package/android/CMakeLists.txt +12 -0
- package/android/src/main/jniLibs/arm64-v8a/libcxxbridge1.a +0 -0
- package/android/src/main/jniLibs/x86_64/libcxxbridge1.a +0 -0
- package/cpp/NitroArk.hpp +416 -600
- package/cpp/generated/ark_cxx.h +932 -0
- package/cpp/generated/cxx.h +1149 -0
- package/package.json +2 -1
- package/cpp/bark-cpp.h +0 -183
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.25",
|
|
4
4
|
"description": "Pure C++ Nitro Modules for Ark client",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/module/index.js",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"ios",
|
|
20
20
|
"cpp",
|
|
21
21
|
"nitrogen",
|
|
22
|
+
"ArkCxxBridge.xcframework",
|
|
22
23
|
"*.podspec",
|
|
23
24
|
"react-native.config.js",
|
|
24
25
|
"!ios/build",
|
package/cpp/bark-cpp.h
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
// Auto-generated C/C++ bindings for bark-cpp
|
|
2
|
-
|
|
3
|
-
#ifndef BARK_CPP_H
|
|
4
|
-
#define BARK_CPP_H
|
|
5
|
-
|
|
6
|
-
/* Generated with cbindgen:0.28.0 */
|
|
7
|
-
|
|
8
|
-
#include <cstdarg>
|
|
9
|
-
#include <cstdint>
|
|
10
|
-
#include <cstdlib>
|
|
11
|
-
#include <ostream>
|
|
12
|
-
#include <new>
|
|
13
|
-
|
|
14
|
-
namespace bark
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
enum class bark_BarkRefreshModeType
|
|
18
|
-
{
|
|
19
|
-
DefaultThreshold,
|
|
20
|
-
ThresholdBlocks,
|
|
21
|
-
ThresholdHours,
|
|
22
|
-
Counterparty,
|
|
23
|
-
All,
|
|
24
|
-
Specific,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
struct bark_BarkError
|
|
28
|
-
{
|
|
29
|
-
char *message;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
struct bark_BarkConfigOpts
|
|
33
|
-
{
|
|
34
|
-
const char *asp;
|
|
35
|
-
const char *esplora;
|
|
36
|
-
const char *bitcoind;
|
|
37
|
-
const char *bitcoind_cookie;
|
|
38
|
-
const char *bitcoind_user;
|
|
39
|
-
const char *bitcoind_pass;
|
|
40
|
-
uint32_t vtxo_refresh_expiry_threshold;
|
|
41
|
-
const uint64_t *fallback_fee_rate;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
struct bark_BarkCreateOpts
|
|
45
|
-
{
|
|
46
|
-
bool regtest;
|
|
47
|
-
bool signet;
|
|
48
|
-
bool bitcoin;
|
|
49
|
-
const char *mnemonic;
|
|
50
|
-
uint32_t birthday_height;
|
|
51
|
-
bark_BarkConfigOpts config;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
struct bark_BarkBalance
|
|
55
|
-
{
|
|
56
|
-
uint64_t onchain;
|
|
57
|
-
uint64_t offchain;
|
|
58
|
-
uint64_t pending_exit;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
struct bark_BarkRefreshOpts
|
|
62
|
-
{
|
|
63
|
-
bark_BarkRefreshModeType mode_type;
|
|
64
|
-
uint32_t threshold_value;
|
|
65
|
-
const char *const *specific_vtxo_ids;
|
|
66
|
-
uintptr_t num_specific_vtxo_ids;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
extern "C"
|
|
70
|
-
{
|
|
71
|
-
|
|
72
|
-
/// Initializes the logger for the library.
|
|
73
|
-
/// This should be called once when the library is loaded by the C/C++ application,
|
|
74
|
-
/// before any other library functions are used.
|
|
75
|
-
void bark_init_logger();
|
|
76
|
-
|
|
77
|
-
void bark_free_error(bark_BarkError *error);
|
|
78
|
-
|
|
79
|
-
const char *bark_error_message(const bark_BarkError *error);
|
|
80
|
-
|
|
81
|
-
/// Frees a C string allocated by a bark-cpp function.
|
|
82
|
-
void bark_free_string(char *s);
|
|
83
|
-
|
|
84
|
-
/// Create a new mnemonic
|
|
85
|
-
char *bark_create_mnemonic();
|
|
86
|
-
|
|
87
|
-
/// Load an existing wallet or create a new one at the specified directory
|
|
88
|
-
bark_BarkError *bark_load_wallet(const char *datadir, bark_BarkCreateOpts opts);
|
|
89
|
-
|
|
90
|
-
/// Close the currently loaded wallet
|
|
91
|
-
bark_BarkError *bark_close_wallet();
|
|
92
|
-
|
|
93
|
-
/// Checks if a wallet is currently loaded.
|
|
94
|
-
bool bark_is_wallet_loaded();
|
|
95
|
-
|
|
96
|
-
/// Get offchain and onchain balances
|
|
97
|
-
bark_BarkError *bark_get_balance(bool no_sync, bark_BarkBalance *balance_out);
|
|
98
|
-
|
|
99
|
-
/// Get an onchain address.
|
|
100
|
-
bark_BarkError *bark_get_onchain_address(char **address_out);
|
|
101
|
-
|
|
102
|
-
/// Send funds using the onchain wallet.
|
|
103
|
-
bark_BarkError *bark_send_onchain(const char *destination,
|
|
104
|
-
uint64_t amount_sat,
|
|
105
|
-
bool no_sync,
|
|
106
|
-
char **txid_out);
|
|
107
|
-
|
|
108
|
-
/// Send all funds from the onchain wallet to a destination address.
|
|
109
|
-
bark_BarkError *bark_drain_onchain(const char *destination, bool no_sync, char **txid_out);
|
|
110
|
-
|
|
111
|
-
/// Send funds to multiple recipients using the onchain wallet.
|
|
112
|
-
bark_BarkError *bark_send_many_onchain(const char *const *destinations,
|
|
113
|
-
const uint64_t *amounts_sat,
|
|
114
|
-
uintptr_t num_outputs,
|
|
115
|
-
bool no_sync,
|
|
116
|
-
char **txid_out);
|
|
117
|
-
|
|
118
|
-
/// Get the list of onchain UTXOs as a JSON string.
|
|
119
|
-
bark_BarkError *bark_get_onchain_utxos(bool no_sync, char **utxos_json_out);
|
|
120
|
-
|
|
121
|
-
/// Get the wallet's VTXO public key (hex string).
|
|
122
|
-
bark_BarkError *bark_get_vtxo_pubkey(const uint32_t *index, char **pubkey_hex_out);
|
|
123
|
-
|
|
124
|
-
/// Get the list of VTXOs as a JSON string.
|
|
125
|
-
bark_BarkError *bark_get_vtxos(bool no_sync, char **vtxos_json_out);
|
|
126
|
-
|
|
127
|
-
/// Refresh VTXOs based on specified criteria.
|
|
128
|
-
bark_BarkError *bark_refresh_vtxos(bark_BarkRefreshOpts refresh_opts,
|
|
129
|
-
bool no_sync,
|
|
130
|
-
char **status_json_out);
|
|
131
|
-
|
|
132
|
-
/// Board a specific amount from the onchain wallet into Ark.
|
|
133
|
-
bark_BarkError *bark_board_amount(uint64_t amount_sat, bool no_sync, char **status_json_out);
|
|
134
|
-
|
|
135
|
-
/// Board all available funds from the onchain wallet into Ark.
|
|
136
|
-
bark_BarkError *bark_board_all(bool no_sync, char **status_json_out);
|
|
137
|
-
|
|
138
|
-
bark_BarkError *bark_send(const char *destination,
|
|
139
|
-
const uint64_t *amount_sat,
|
|
140
|
-
const char *comment,
|
|
141
|
-
bool no_sync,
|
|
142
|
-
char **status_json_out);
|
|
143
|
-
|
|
144
|
-
/// Send an onchain payment via an Ark round.
|
|
145
|
-
bark_BarkError *bark_send_round_onchain(const char *destination,
|
|
146
|
-
uint64_t amount_sat,
|
|
147
|
-
bool no_sync,
|
|
148
|
-
char **status_json_out);
|
|
149
|
-
|
|
150
|
-
/// Offboard specific VTXOs to an optional onchain address.
|
|
151
|
-
bark_BarkError *bark_offboard_specific(const char *const *specific_vtxo_ids,
|
|
152
|
-
uintptr_t num_specific_vtxo_ids,
|
|
153
|
-
const char *optional_address,
|
|
154
|
-
bool no_sync,
|
|
155
|
-
char **status_json_out);
|
|
156
|
-
|
|
157
|
-
/// Offboard all VTXOs to an optional onchain address.
|
|
158
|
-
bark_BarkError *bark_offboard_all(const char *optional_address,
|
|
159
|
-
bool no_sync,
|
|
160
|
-
char **status_json_out);
|
|
161
|
-
|
|
162
|
-
/// Start the exit process for specific VTXOs.
|
|
163
|
-
bark_BarkError *bark_exit_start_specific(const char *const *specific_vtxo_ids,
|
|
164
|
-
uintptr_t num_specific_vtxo_ids,
|
|
165
|
-
char **status_json_out);
|
|
166
|
-
|
|
167
|
-
/// Start the exit process for all VTXOs in the wallet.
|
|
168
|
-
bark_BarkError *bark_exit_start_all(char **status_json_out);
|
|
169
|
-
|
|
170
|
-
/// Progress the exit process once and return the current status.
|
|
171
|
-
bark_BarkError *bark_exit_progress_once(char **status_json_out);
|
|
172
|
-
|
|
173
|
-
/// FFI: Creates a BOLT11 invoice for receiving payments.
|
|
174
|
-
bark_BarkError *bark_bolt11_invoice(uint64_t amount_msat, char **invoice_out);
|
|
175
|
-
|
|
176
|
-
/// FFI: Claims a BOLT11 payment using an invoice.
|
|
177
|
-
bark_BarkError *bark_claim_bolt11_payment(const char *bolt11);
|
|
178
|
-
|
|
179
|
-
} // extern "C"
|
|
180
|
-
|
|
181
|
-
} // namespace bark
|
|
182
|
-
|
|
183
|
-
#endif // BARK_CPP_H
|