react-native-nitro-ark 0.0.16 → 0.0.19
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 +76 -111
- package/cpp/bark-cpp.h +26 -252
- package/lib/module/index.js +74 -119
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +22 -22
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +50 -93
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/shared/c++/BarkCreateOpts.hpp +1 -5
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +2 -1
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +23 -22
- package/package.json +1 -1
- package/src/NitroArk.nitro.ts +16 -76
- package/src/index.tsx +64 -220
package/lib/module/index.js
CHANGED
|
@@ -15,277 +15,232 @@ export function createMnemonic() {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Loads an existing wallet or creates a new one at the specified directory.
|
|
19
|
+
* Once loaded, the wallet state is managed internally.
|
|
19
20
|
* @param datadir Path to the data directory.
|
|
20
|
-
* @param opts Creation options.
|
|
21
|
+
* @param opts Creation and configuration options.
|
|
21
22
|
* @returns A promise that resolves on success or rejects on error.
|
|
22
23
|
*/
|
|
23
|
-
export function
|
|
24
|
-
return NitroArkHybridObject.
|
|
24
|
+
export function loadWallet(datadir, opts) {
|
|
25
|
+
return NitroArkHybridObject.loadWallet(datadir, opts);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Closes the currently loaded wallet, clearing its state from memory.
|
|
30
|
+
* @returns A promise that resolves on success or rejects on error.
|
|
31
|
+
*/
|
|
32
|
+
export function closeWallet() {
|
|
33
|
+
return NitroArkHybridObject.closeWallet();
|
|
25
34
|
}
|
|
26
35
|
|
|
27
36
|
// --- Wallet Info ---
|
|
28
37
|
|
|
29
38
|
/**
|
|
30
|
-
* Gets the
|
|
31
|
-
* @param
|
|
32
|
-
* @param no_sync Whether to skip syncing the wallet. Defaults to false.
|
|
33
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
39
|
+
* Gets the onchain and offchain balances for the loaded wallet.
|
|
40
|
+
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
34
41
|
* @returns A promise resolving to the BarkBalance object.
|
|
35
42
|
*/
|
|
36
|
-
export function getBalance(
|
|
37
|
-
|
|
38
|
-
return NitroArkHybridObject.getBalance(datadir, no_sync, mnemonic);
|
|
43
|
+
export function getBalance(no_sync = false) {
|
|
44
|
+
return NitroArkHybridObject.getBalance(no_sync);
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
/**
|
|
42
|
-
* Gets a fresh onchain address.
|
|
43
|
-
* @param datadir Path to the data directory.
|
|
44
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
48
|
+
* Gets a fresh onchain address for the loaded wallet.
|
|
45
49
|
* @returns A promise resolving to the Bitcoin address string.
|
|
46
50
|
*/
|
|
47
|
-
export function getOnchainAddress(
|
|
48
|
-
return NitroArkHybridObject.getOnchainAddress(
|
|
51
|
+
export function getOnchainAddress() {
|
|
52
|
+
return NitroArkHybridObject.getOnchainAddress();
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
/**
|
|
52
|
-
* Gets the list of onchain UTXOs as a JSON string.
|
|
53
|
-
* @param
|
|
54
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
55
|
-
* @param no_sync Whether to skip syncing the wallet. Defaults to false.
|
|
56
|
+
* Gets the list of onchain UTXOs as a JSON string for the loaded wallet.
|
|
57
|
+
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
56
58
|
* @returns A promise resolving to the JSON string of UTXOs.
|
|
57
59
|
*/
|
|
58
|
-
export function getOnchainUtxos(
|
|
59
|
-
return NitroArkHybridObject.getOnchainUtxos(
|
|
60
|
+
export function getOnchainUtxos(no_sync = false) {
|
|
61
|
+
return NitroArkHybridObject.getOnchainUtxos(no_sync);
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
/**
|
|
63
65
|
* Gets the wallet's VTXO public key (hex string).
|
|
64
|
-
* @param
|
|
65
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
66
|
+
* @param index Optional index of the VTXO pubkey to retrieve.
|
|
66
67
|
* @returns A promise resolving to the hex-encoded public key string.
|
|
67
68
|
*/
|
|
68
|
-
export function getVtxoPubkey(
|
|
69
|
-
return NitroArkHybridObject.getVtxoPubkey(
|
|
69
|
+
export function getVtxoPubkey(index) {
|
|
70
|
+
return NitroArkHybridObject.getVtxoPubkey(index);
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
/**
|
|
73
|
-
* Gets the list of VTXOs as a JSON string.
|
|
74
|
-
* @param
|
|
75
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
76
|
-
* @param no_sync Whether to skip syncing the wallet. Defaults to false.
|
|
74
|
+
* Gets the list of VTXOs as a JSON string for the loaded wallet.
|
|
75
|
+
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
77
76
|
* @returns A promise resolving to the JSON string of VTXOs.
|
|
78
77
|
*/
|
|
79
|
-
export function getVtxos(
|
|
80
|
-
return NitroArkHybridObject.getVtxos(
|
|
78
|
+
export function getVtxos(no_sync = false) {
|
|
79
|
+
return NitroArkHybridObject.getVtxos(no_sync);
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
// --- Onchain Operations ---
|
|
84
83
|
|
|
85
84
|
/**
|
|
86
85
|
* Sends funds using the onchain wallet.
|
|
87
|
-
* @param datadir Path to the data directory.
|
|
88
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
89
86
|
* @param destination The destination Bitcoin address.
|
|
90
87
|
* @param amountSat The amount to send in satoshis.
|
|
91
|
-
* @param no_sync
|
|
88
|
+
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
92
89
|
* @returns A promise resolving to the transaction ID string.
|
|
93
90
|
*/
|
|
94
|
-
export function sendOnchain(
|
|
95
|
-
return NitroArkHybridObject.sendOnchain(
|
|
91
|
+
export function sendOnchain(destination, amountSat, no_sync = false) {
|
|
92
|
+
return NitroArkHybridObject.sendOnchain(destination, amountSat, no_sync);
|
|
96
93
|
}
|
|
97
94
|
|
|
98
95
|
/**
|
|
99
96
|
* Sends all funds from the onchain wallet to a destination address.
|
|
100
|
-
* @param datadir Path to the data directory.
|
|
101
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
102
97
|
* @param destination The destination Bitcoin address.
|
|
103
|
-
* @param no_sync
|
|
98
|
+
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
104
99
|
* @returns A promise resolving to the transaction ID string.
|
|
105
100
|
*/
|
|
106
|
-
export function drainOnchain(
|
|
107
|
-
return NitroArkHybridObject.drainOnchain(
|
|
101
|
+
export function drainOnchain(destination, no_sync = false) {
|
|
102
|
+
return NitroArkHybridObject.drainOnchain(destination, no_sync);
|
|
108
103
|
}
|
|
109
104
|
|
|
110
105
|
/**
|
|
111
106
|
* Sends funds to multiple recipients using the onchain wallet.
|
|
112
|
-
* @param datadir Path to the data directory.
|
|
113
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
114
107
|
* @param outputs An array of objects containing destination address and amountSat.
|
|
115
|
-
* @param no_sync
|
|
108
|
+
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
116
109
|
* @returns A promise resolving to the transaction ID string.
|
|
117
110
|
*/
|
|
118
|
-
export function sendManyOnchain(
|
|
119
|
-
return NitroArkHybridObject.sendManyOnchain(
|
|
111
|
+
export function sendManyOnchain(outputs, no_sync = false) {
|
|
112
|
+
return NitroArkHybridObject.sendManyOnchain(outputs, no_sync);
|
|
120
113
|
}
|
|
121
114
|
|
|
122
115
|
// --- Lightning Operations ---
|
|
123
116
|
|
|
124
117
|
/**
|
|
125
118
|
* Creates a Bolt 11 invoice.
|
|
126
|
-
* @param
|
|
127
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
128
|
-
* @param amountSat The amount in satoshis for the invoice.
|
|
119
|
+
* @param amountMsat The amount in millisatoshis for the invoice.
|
|
129
120
|
* @returns A promise resolving to the Bolt 11 invoice string.
|
|
130
121
|
*/
|
|
131
|
-
export function bolt11Invoice(
|
|
132
|
-
return NitroArkHybridObject.bolt11Invoice(
|
|
122
|
+
export function bolt11Invoice(amountMsat) {
|
|
123
|
+
return NitroArkHybridObject.bolt11Invoice(amountMsat);
|
|
133
124
|
}
|
|
134
125
|
|
|
135
126
|
/**
|
|
136
127
|
* Claims a Bolt 11 payment.
|
|
137
|
-
* @param datadir Path to the data directory.
|
|
138
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
139
128
|
* @param bolt11 The Bolt 11 invoice string to claim.
|
|
140
129
|
* @returns A promise that resolves on success or rejects on error.
|
|
141
130
|
*/
|
|
142
|
-
export function claimBolt11Payment(
|
|
143
|
-
return NitroArkHybridObject.claimBolt11Payment(
|
|
131
|
+
export function claimBolt11Payment(bolt11) {
|
|
132
|
+
return NitroArkHybridObject.claimBolt11Payment(bolt11);
|
|
144
133
|
}
|
|
145
134
|
|
|
146
135
|
// --- Ark Operations ---
|
|
147
136
|
|
|
148
137
|
/**
|
|
149
|
-
* Refreshes VTXOs based on specified criteria.
|
|
150
|
-
* @param datadir Path to the data directory.
|
|
151
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
138
|
+
* Refreshes VTXOs based on specified criteria for the loaded wallet.
|
|
152
139
|
* @param refreshOpts Options specifying which VTXOs to refresh.
|
|
153
|
-
*
|
|
154
|
-
* @param no_sync Whether to skip syncing the wallet. Defaults to false.
|
|
140
|
+
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
155
141
|
* @returns A promise resolving to a JSON status string.
|
|
156
|
-
* @example
|
|
157
|
-
* // Refresh using default threshold
|
|
158
|
-
* refreshVtxos(datadir, mnemonic, { mode_type: 'DefaultThreshold' });
|
|
159
|
-
* // Refresh specific VTXOs
|
|
160
|
-
* refreshVtxos(datadir, mnemonic, { mode_type: 'Specific', specific_vtxo_ids: ['vtxo_id_1', 'vtxo_id_2'] });
|
|
161
|
-
* // Refresh if older than 10 blocks
|
|
162
|
-
* refreshVtxos(datadir, mnemonic, { mode_type: 'ThresholdBlocks', threshold_value: 10 });
|
|
163
142
|
*/
|
|
164
|
-
export function refreshVtxos(
|
|
165
|
-
// Ensure mode_type is provided (should be handled by TS type system)
|
|
143
|
+
export function refreshVtxos(refreshOpts, no_sync = false) {
|
|
166
144
|
if (!refreshOpts.mode_type) {
|
|
167
145
|
return Promise.reject(new Error('refreshVtxos requires refreshOpts.mode_type'));
|
|
168
146
|
}
|
|
169
|
-
// Additional validation for specific modes could be added here if desired
|
|
170
147
|
if (refreshOpts.mode_type === 'Specific' && (!refreshOpts.specific_vtxo_ids || refreshOpts.specific_vtxo_ids.length === 0)) {
|
|
171
148
|
return Promise.reject(new Error("refreshVtxos with mode_type 'Specific' requires non-empty specific_vtxo_ids array"));
|
|
172
149
|
}
|
|
173
150
|
if ((refreshOpts.mode_type === 'ThresholdBlocks' || refreshOpts.mode_type === 'ThresholdHours') && (refreshOpts.threshold_value === undefined || refreshOpts.threshold_value <= 0)) {
|
|
174
151
|
return Promise.reject(new Error(`refreshVtxos with mode_type '${refreshOpts.mode_type}' requires a positive threshold_value`));
|
|
175
152
|
}
|
|
176
|
-
return NitroArkHybridObject.refreshVtxos(
|
|
153
|
+
return NitroArkHybridObject.refreshVtxos(refreshOpts, no_sync);
|
|
177
154
|
}
|
|
178
155
|
|
|
179
156
|
/**
|
|
180
157
|
* Boards a specific amount from the onchain wallet into Ark.
|
|
181
|
-
* @param datadir Path to the data directory.
|
|
182
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
183
158
|
* @param amountSat The amount in satoshis to board.
|
|
184
|
-
* @param no_sync
|
|
159
|
+
* @param no_sync If true, skips synchronization with the onchain wallet. Defaults to false.
|
|
185
160
|
* @returns A promise resolving to a JSON status string.
|
|
186
161
|
*/
|
|
187
|
-
export function boardAmount(
|
|
188
|
-
return NitroArkHybridObject.boardAmount(
|
|
162
|
+
export function boardAmount(amountSat, no_sync = false) {
|
|
163
|
+
return NitroArkHybridObject.boardAmount(amountSat, no_sync);
|
|
189
164
|
}
|
|
190
165
|
|
|
191
166
|
/**
|
|
192
167
|
* Boards all available funds from the onchain wallet into Ark.
|
|
193
|
-
* @param
|
|
194
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
195
|
-
* @param no_sync Whether to skip syncing the onchain wallet. Defaults to false.
|
|
168
|
+
* @param no_sync If true, skips synchronization with the onchain wallet. Defaults to false.
|
|
196
169
|
* @returns A promise resolving to a JSON status string.
|
|
197
170
|
*/
|
|
198
|
-
export function boardAll(
|
|
199
|
-
return NitroArkHybridObject.boardAll(
|
|
171
|
+
export function boardAll(no_sync = false) {
|
|
172
|
+
return NitroArkHybridObject.boardAll(no_sync);
|
|
200
173
|
}
|
|
201
174
|
|
|
202
175
|
/**
|
|
203
176
|
* Sends funds offchain using Ark VTXOs.
|
|
204
|
-
* @param datadir Path to the data directory.
|
|
205
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
206
177
|
* @param destination Ark address (VTXO pubkey) or onchain Bitcoin address.
|
|
207
178
|
* @param amountSat The amount in satoshis to send.
|
|
208
|
-
* @param comment Optional comment
|
|
209
|
-
* @param no_sync
|
|
179
|
+
* @param comment Optional comment.
|
|
180
|
+
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
210
181
|
* @returns A promise resolving to a JSON status string.
|
|
211
182
|
*/
|
|
212
|
-
export function send(
|
|
213
|
-
return NitroArkHybridObject.send(
|
|
183
|
+
export function send(destination, amountSat, comment = null, no_sync = false) {
|
|
184
|
+
return NitroArkHybridObject.send(destination, amountSat, comment, no_sync);
|
|
214
185
|
}
|
|
215
186
|
|
|
216
187
|
/**
|
|
217
188
|
* Sends an onchain payment via an Ark round.
|
|
218
|
-
* @param datadir Path to the data directory.
|
|
219
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
220
189
|
* @param destination The destination Bitcoin address.
|
|
221
190
|
* @param amountSat The amount in satoshis to send.
|
|
222
|
-
* @param no_sync
|
|
191
|
+
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
223
192
|
* @returns A promise resolving to a JSON status string.
|
|
224
193
|
*/
|
|
225
|
-
export function sendRoundOnchain(
|
|
226
|
-
return NitroArkHybridObject.sendRoundOnchain(
|
|
194
|
+
export function sendRoundOnchain(destination, amountSat, no_sync = false) {
|
|
195
|
+
return NitroArkHybridObject.sendRoundOnchain(destination, amountSat, no_sync);
|
|
227
196
|
}
|
|
228
197
|
|
|
229
198
|
// --- Offboarding / Exiting ---
|
|
230
199
|
|
|
231
200
|
/**
|
|
232
201
|
* Offboards specific VTXOs to an optional onchain address.
|
|
233
|
-
* @param datadir Path to the data directory.
|
|
234
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
235
202
|
* @param vtxoIds Array of VtxoId strings to offboard.
|
|
236
203
|
* @param optionalAddress Optional destination Bitcoin address (null if sending to internal wallet).
|
|
237
|
-
* @param no_sync
|
|
204
|
+
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
238
205
|
* @returns A promise resolving to a JSON result string.
|
|
239
206
|
*/
|
|
240
|
-
export function offboardSpecific(
|
|
241
|
-
return NitroArkHybridObject.offboardSpecific(
|
|
207
|
+
export function offboardSpecific(vtxoIds, optionalAddress = null, no_sync = false) {
|
|
208
|
+
return NitroArkHybridObject.offboardSpecific(vtxoIds, optionalAddress, no_sync);
|
|
242
209
|
}
|
|
243
210
|
|
|
244
211
|
/**
|
|
245
212
|
* Offboards all VTXOs to an optional onchain address.
|
|
246
|
-
* @param datadir Path to the data directory.
|
|
247
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
248
213
|
* @param optionalAddress Optional destination Bitcoin address (null if sending to internal wallet).
|
|
249
|
-
* @param no_sync
|
|
214
|
+
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
250
215
|
* @returns A promise resolving to a JSON result string.
|
|
251
216
|
*/
|
|
252
|
-
export function offboardAll(
|
|
253
|
-
return NitroArkHybridObject.offboardAll(
|
|
217
|
+
export function offboardAll(optionalAddress = null, no_sync = false) {
|
|
218
|
+
return NitroArkHybridObject.offboardAll(optionalAddress, no_sync);
|
|
254
219
|
}
|
|
255
220
|
|
|
256
221
|
/**
|
|
257
222
|
* Starts the exit process for specific VTXOs.
|
|
258
|
-
* @param datadir Path to the data directory.
|
|
259
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
260
223
|
* @param vtxoIds Array of VtxoId strings to start exiting.
|
|
261
|
-
* @param no_sync Whether to skip syncing the wallet (Note: This might depend on potential C header updates). Defaults to false.
|
|
262
224
|
* @returns A promise resolving to a JSON status string.
|
|
263
225
|
*/
|
|
264
|
-
export function exitStartSpecific(
|
|
265
|
-
|
|
266
|
-
return NitroArkHybridObject.exitStartSpecific(datadir, mnemonic, vtxoIds, no_sync);
|
|
226
|
+
export function exitStartSpecific(vtxoIds) {
|
|
227
|
+
return NitroArkHybridObject.exitStartSpecific(vtxoIds);
|
|
267
228
|
}
|
|
268
229
|
|
|
269
230
|
/**
|
|
270
231
|
* Starts the exit process for all VTXOs in the wallet.
|
|
271
|
-
* @param datadir Path to the data directory.
|
|
272
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
273
|
-
* @param no_sync Whether to skip syncing the wallet (Note: This might depend on potential C header updates). Defaults to false.
|
|
274
232
|
* @returns A promise resolving to a JSON status string.
|
|
275
233
|
*/
|
|
276
|
-
export function exitStartAll(
|
|
277
|
-
|
|
278
|
-
return NitroArkHybridObject.exitStartAll(datadir, mnemonic, no_sync);
|
|
234
|
+
export function exitStartAll() {
|
|
235
|
+
return NitroArkHybridObject.exitStartAll();
|
|
279
236
|
}
|
|
280
237
|
|
|
281
238
|
/**
|
|
282
239
|
* Progresses the exit process once and returns the current status.
|
|
283
|
-
* @param datadir Path to the data directory.
|
|
284
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
285
240
|
* @returns A promise resolving to a JSON status string.
|
|
286
241
|
*/
|
|
287
|
-
export function exitProgressOnce(
|
|
288
|
-
return NitroArkHybridObject.exitProgressOnce(
|
|
242
|
+
export function exitProgressOnce() {
|
|
243
|
+
return NitroArkHybridObject.exitProgressOnce();
|
|
289
244
|
}
|
|
290
245
|
|
|
291
246
|
// --- Re-export types and enums ---
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NitroModules","NitroArkHybridObject","createHybridObject","createMnemonic","
|
|
1
|
+
{"version":3,"names":["NitroModules","NitroArkHybridObject","createHybridObject","createMnemonic","loadWallet","datadir","opts","closeWallet","getBalance","no_sync","getOnchainAddress","getOnchainUtxos","getVtxoPubkey","index","getVtxos","sendOnchain","destination","amountSat","drainOnchain","sendManyOnchain","outputs","bolt11Invoice","amountMsat","claimBolt11Payment","bolt11","refreshVtxos","refreshOpts","mode_type","Promise","reject","Error","specific_vtxo_ids","length","threshold_value","undefined","boardAmount","boardAll","send","comment","sendRoundOnchain","offboardSpecific","vtxoIds","optionalAddress","offboardAll","exitStartSpecific","exitStartAll","exitProgressOnce"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AASzD;AACA,OAAO,MAAMC,oBAAoB,GAC/BD,YAAY,CAACE,kBAAkB,CAAW,UAAU,CAAC;;AAEvD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAoB;EAChD,OAAOF,oBAAoB,CAACE,cAAc,CAAC,CAAC;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CACxBC,OAAe,EACfC,IAAoB,EACL;EACf,OAAOL,oBAAoB,CAACG,UAAU,CAACC,OAAO,EAAEC,IAAI,CAAC;AACvD;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A;AACA,OAAO,SAASmC,iBAAiBA,CAACH,OAAiB,EAAmB;EACpE,OAAOxC,oBAAoB,CAAC2C,iBAAiB,CAACH,OAAO,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASI,YAAYA,CAAA,EAAoB;EAC9C,OAAO5C,oBAAoB,CAAC4C,YAAY,CAAC,CAAC;AAC5C;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAA,EAAoB;EAClD,OAAO7C,oBAAoB,CAAC6C,gBAAgB,CAAC,CAAC;AAChD;;AAEA","ignoreList":[]}
|
|
@@ -11,7 +11,6 @@ export interface BarkConfigOpts {
|
|
|
11
11
|
fallback_fee_rate?: number;
|
|
12
12
|
}
|
|
13
13
|
export interface BarkCreateOpts {
|
|
14
|
-
force?: boolean;
|
|
15
14
|
regtest?: boolean;
|
|
16
15
|
signet?: boolean;
|
|
17
16
|
bitcoin?: boolean;
|
|
@@ -38,26 +37,27 @@ export interface NitroArk extends HybridObject<{
|
|
|
38
37
|
android: 'c++';
|
|
39
38
|
}> {
|
|
40
39
|
createMnemonic(): Promise<string>;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
40
|
+
loadWallet(datadir: string, opts: BarkCreateOpts): Promise<void>;
|
|
41
|
+
closeWallet(): Promise<void>;
|
|
42
|
+
getBalance(no_sync: boolean): Promise<BarkBalance>;
|
|
43
|
+
getOnchainAddress(): Promise<string>;
|
|
44
|
+
getOnchainUtxos(no_sync: boolean): Promise<string>;
|
|
45
|
+
getVtxoPubkey(index?: number): Promise<string>;
|
|
46
|
+
getVtxos(no_sync: boolean): Promise<string>;
|
|
47
|
+
sendOnchain(destination: string, amountSat: number, no_sync: boolean): Promise<string>;
|
|
48
|
+
drainOnchain(destination: string, no_sync: boolean): Promise<string>;
|
|
49
|
+
sendManyOnchain(outputs: BarkSendManyOutput[], no_sync: boolean): Promise<string>;
|
|
50
|
+
refreshVtxos(refreshOpts: BarkRefreshOpts, no_sync: boolean): Promise<string>;
|
|
51
|
+
boardAmount(amountSat: number, no_sync: boolean): Promise<string>;
|
|
52
|
+
boardAll(no_sync: boolean): Promise<string>;
|
|
53
|
+
send(destination: string, amountSat: number, comment: string | null, no_sync: boolean): Promise<string>;
|
|
54
|
+
sendRoundOnchain(destination: string, amountSat: number, no_sync: boolean): Promise<string>;
|
|
55
|
+
bolt11Invoice(amountMsat: number): Promise<string>;
|
|
56
|
+
claimBolt11Payment(bolt11: string): Promise<void>;
|
|
57
|
+
offboardSpecific(vtxoIds: string[], optionalAddress: string | null, no_sync: boolean): Promise<string>;
|
|
58
|
+
offboardAll(optionalAddress: string | null, no_sync: boolean): Promise<string>;
|
|
59
|
+
exitStartSpecific(vtxoIds: string[]): Promise<string>;
|
|
60
|
+
exitStartAll(): Promise<string>;
|
|
61
|
+
exitProgressOnce(): Promise<string>;
|
|
62
62
|
}
|
|
63
63
|
//# 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;AAI/D,MAAM,MAAM,mBAAmB,GAC3B,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,cAAc,GACd,KAAK,GACL,UAAU,CAAC;AAIf,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB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