react-native-nitro-ark 0.0.38 → 0.0.39
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/jniLibs/arm64-v8a/libcxxbridge1.a +0 -0
- package/android/src/main/jniLibs/x86_64/libcxxbridge1.a +0 -0
- package/cpp/NitroArk.hpp +195 -165
- package/cpp/generated/ark_cxx.h +55 -23
- package/lib/module/index.js +86 -92
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +29 -18
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +60 -66
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +15 -15
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +31 -22
- package/nitrogen/generated/shared/c++/{Bolt11PaymentResult.hpp → LightningPaymentResult.hpp} +10 -10
- package/nitrogen/generated/shared/c++/OffchainBalanceResult.hpp +77 -0
- package/nitrogen/generated/shared/c++/OnchainBalanceResult.hpp +81 -0
- package/package.json +1 -1
- package/src/NitroArk.nitro.ts +47 -24
- package/src/index.tsx +101 -105
package/src/index.tsx
CHANGED
|
@@ -6,9 +6,12 @@ import type {
|
|
|
6
6
|
BarkArkInfo,
|
|
7
7
|
BarkSendManyOutput,
|
|
8
8
|
ArkoorPaymentResult,
|
|
9
|
-
|
|
9
|
+
LightningPaymentResult,
|
|
10
10
|
LnurlPaymentResult,
|
|
11
11
|
OnchainPaymentResult,
|
|
12
|
+
BarkVtxo,
|
|
13
|
+
OffchainBalanceResult,
|
|
14
|
+
OnchainBalanceResult,
|
|
12
15
|
} from './NitroArk.nitro';
|
|
13
16
|
|
|
14
17
|
// Create the hybrid object instance
|
|
@@ -81,11 +84,11 @@ export function sync(): Promise<void> {
|
|
|
81
84
|
}
|
|
82
85
|
|
|
83
86
|
/**
|
|
84
|
-
* Synchronizes the Ark-specific
|
|
87
|
+
* Synchronizes the Ark-specific exits.
|
|
85
88
|
* @returns A promise that resolves on success.
|
|
86
89
|
*/
|
|
87
|
-
export function
|
|
88
|
-
return NitroArkHybridObject.
|
|
90
|
+
export function syncExits(): Promise<void> {
|
|
91
|
+
return NitroArkHybridObject.syncExits();
|
|
89
92
|
}
|
|
90
93
|
|
|
91
94
|
/**
|
|
@@ -107,96 +110,114 @@ export function getArkInfo(): Promise<BarkArkInfo> {
|
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
/**
|
|
110
|
-
* Gets the
|
|
111
|
-
* @returns A promise resolving to the
|
|
113
|
+
* Gets the offchain balance for the loaded wallet.
|
|
114
|
+
* @returns A promise resolving to the OffchainBalanceResult object.
|
|
112
115
|
*/
|
|
113
|
-
export function
|
|
114
|
-
return NitroArkHybridObject.
|
|
116
|
+
export function offchainBalance(): Promise<OffchainBalanceResult> {
|
|
117
|
+
return NitroArkHybridObject.offchainBalance();
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
/**
|
|
118
|
-
*
|
|
119
|
-
* @returns A promise resolving to the
|
|
121
|
+
* Derives the next keypair for the store.
|
|
122
|
+
* @returns A promise resolving to the hex-encoded public key string.
|
|
120
123
|
*/
|
|
121
|
-
export function
|
|
122
|
-
return NitroArkHybridObject.
|
|
124
|
+
export function deriveStoreNextKeypair(): Promise<string> {
|
|
125
|
+
return NitroArkHybridObject.deriveStoreNextKeypair();
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
/**
|
|
126
|
-
* Gets
|
|
127
|
-
* @
|
|
129
|
+
* Gets the wallet's VTXO public key (hex string).
|
|
130
|
+
* @param index Index of the VTXO pubkey to retrieve.
|
|
131
|
+
* @returns A promise resolving to the hex-encoded public key string.
|
|
128
132
|
*/
|
|
129
|
-
export function
|
|
130
|
-
return NitroArkHybridObject.
|
|
133
|
+
export function peakKeyPair(index: number): Promise<string> {
|
|
134
|
+
return NitroArkHybridObject.peakKeyPair(index);
|
|
131
135
|
}
|
|
132
136
|
|
|
133
137
|
/**
|
|
134
|
-
* Gets the list of
|
|
138
|
+
* Gets the list of VTXOs as a JSON string for the loaded wallet.
|
|
135
139
|
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
136
|
-
* @returns A promise resolving
|
|
140
|
+
* @returns A promise resolving BarkVtxo[] array.
|
|
137
141
|
*/
|
|
138
|
-
export function
|
|
139
|
-
return NitroArkHybridObject.
|
|
142
|
+
export function getVtxos(): Promise<BarkVtxo[]> {
|
|
143
|
+
return NitroArkHybridObject.getVtxos();
|
|
140
144
|
}
|
|
141
145
|
|
|
146
|
+
// --- Onchain Operations ---
|
|
147
|
+
|
|
142
148
|
/**
|
|
143
|
-
* Gets the
|
|
144
|
-
* @
|
|
145
|
-
* @returns A promise resolving to the hex-encoded public key string.
|
|
149
|
+
* Gets the onchain balance for the loaded wallet.
|
|
150
|
+
* @returns A promise resolving to the OnchainBalanceResult object.
|
|
146
151
|
*/
|
|
147
|
-
export function
|
|
148
|
-
return NitroArkHybridObject.
|
|
152
|
+
export function onchainBalance(): Promise<OnchainBalanceResult> {
|
|
153
|
+
return NitroArkHybridObject.onchainBalance();
|
|
149
154
|
}
|
|
150
155
|
|
|
151
156
|
/**
|
|
152
|
-
*
|
|
153
|
-
* @
|
|
154
|
-
* @returns A promise resolving to the JSON string of VTXOs.
|
|
157
|
+
* Synchronizes the onchain state of the wallet.
|
|
158
|
+
* @returns A promise that resolves on success.
|
|
155
159
|
*/
|
|
156
|
-
export function
|
|
157
|
-
return NitroArkHybridObject.
|
|
160
|
+
export function onchainSync(): Promise<void> {
|
|
161
|
+
return NitroArkHybridObject.onchainSync();
|
|
158
162
|
}
|
|
159
163
|
|
|
160
|
-
|
|
164
|
+
/**
|
|
165
|
+
* Gets the list of unspent onchain outputs as a JSON string for the loaded wallet.
|
|
166
|
+
* @returns A promise resolving to the JSON string of unspent outputs.
|
|
167
|
+
*/
|
|
168
|
+
export function onchainListUnspent(): Promise<string> {
|
|
169
|
+
return NitroArkHybridObject.onchainListUnspent();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Gets the list of onchain UTXOs as a JSON string for the loaded wallet.
|
|
174
|
+
* @returns A promise resolving to the JSON string of UTXOs.
|
|
175
|
+
*/
|
|
176
|
+
export function onchainUtxos(): Promise<string> {
|
|
177
|
+
return NitroArkHybridObject.onchainUtxos();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Gets a fresh onchain address for the loaded wallet.
|
|
182
|
+
* @returns A promise resolving to the Bitcoin address string.
|
|
183
|
+
*/
|
|
184
|
+
export function onchainAddress(): Promise<string> {
|
|
185
|
+
return NitroArkHybridObject.onchainAddress();
|
|
186
|
+
}
|
|
161
187
|
|
|
162
188
|
/**
|
|
163
189
|
* Sends funds using the onchain wallet.
|
|
164
190
|
* @param destination The destination Bitcoin address.
|
|
165
191
|
* @param amountSat The amount to send in satoshis.
|
|
166
|
-
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
167
192
|
* @returns A promise resolving to the OnchainPaymentResult object
|
|
168
193
|
*/
|
|
169
|
-
export function
|
|
194
|
+
export function onchainSend(
|
|
170
195
|
destination: string,
|
|
171
196
|
amountSat: number
|
|
172
197
|
): Promise<OnchainPaymentResult> {
|
|
173
|
-
return NitroArkHybridObject.
|
|
198
|
+
return NitroArkHybridObject.onchainSend(destination, amountSat);
|
|
174
199
|
}
|
|
175
200
|
|
|
176
201
|
/**
|
|
177
202
|
* Sends all funds from the onchain wallet to a destination address.
|
|
178
203
|
* @param destination The destination Bitcoin address.
|
|
179
|
-
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
180
204
|
* @returns A promise resolving to the transaction ID string.
|
|
181
205
|
*/
|
|
182
|
-
export function
|
|
183
|
-
destination: string
|
|
184
|
-
no_sync: boolean = false
|
|
206
|
+
export function onchainDrain(
|
|
207
|
+
destination: string
|
|
185
208
|
): Promise<string> {
|
|
186
|
-
return NitroArkHybridObject.
|
|
209
|
+
return NitroArkHybridObject.onchainDrain(destination);
|
|
187
210
|
}
|
|
188
211
|
|
|
189
212
|
/**
|
|
190
213
|
* Sends funds to multiple recipients using the onchain wallet.
|
|
191
214
|
* @param outputs An array of objects containing destination address and amountSat.
|
|
192
|
-
* @param no_sync If true, skips synchronization with the blockchain. Defaults to false.
|
|
193
215
|
* @returns A promise resolving to the transaction ID string.
|
|
194
216
|
*/
|
|
195
|
-
export function
|
|
217
|
+
export function onchainSendMany(
|
|
196
218
|
outputs: BarkSendManyOutput[],
|
|
197
|
-
no_sync: boolean = false
|
|
198
219
|
): Promise<string> {
|
|
199
|
-
return NitroArkHybridObject.
|
|
220
|
+
return NitroArkHybridObject.onchainSendMany(outputs);
|
|
200
221
|
}
|
|
201
222
|
|
|
202
223
|
// --- Lightning Operations ---
|
|
@@ -211,12 +232,40 @@ export function bolt11Invoice(amountMsat: number): Promise<string> {
|
|
|
211
232
|
}
|
|
212
233
|
|
|
213
234
|
/**
|
|
214
|
-
* Claims a
|
|
215
|
-
* @param bolt11 The
|
|
235
|
+
* Claims a Lightning payment.
|
|
236
|
+
* @param bolt11 The Lightning invoice string to claim.
|
|
216
237
|
* @returns A promise that resolves on success or rejects on error.
|
|
217
238
|
*/
|
|
218
|
-
export function
|
|
219
|
-
return NitroArkHybridObject.
|
|
239
|
+
export function finishLightningReceive(bolt11: string): Promise<void> {
|
|
240
|
+
return NitroArkHybridObject.finishLightningReceive(bolt11);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Sends a Lightning payment.
|
|
245
|
+
* @param destination The Lightning invoice.
|
|
246
|
+
* @param amountSat The amount in satoshis to send. Use 0 for invoice amount.
|
|
247
|
+
* @returns A promise resolving to a LightningPaymentResult object
|
|
248
|
+
*/
|
|
249
|
+
export function sendLightningPayment(
|
|
250
|
+
destination: string,
|
|
251
|
+
amountSat?: number
|
|
252
|
+
): Promise<LightningPaymentResult> {
|
|
253
|
+
return NitroArkHybridObject.sendLightningPayment(destination, amountSat);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Sends a payment to a Lightning Address.
|
|
258
|
+
* @param addr The Lightning Address.
|
|
259
|
+
* @param amountSat The amount in satoshis to send.
|
|
260
|
+
* @param comment An optional comment.
|
|
261
|
+
* @returns A promise resolving to a LnurlPaymentResult object
|
|
262
|
+
*/
|
|
263
|
+
export function sendLnaddr(
|
|
264
|
+
addr: string,
|
|
265
|
+
amountSat: number,
|
|
266
|
+
comment: string
|
|
267
|
+
): Promise<LnurlPaymentResult> {
|
|
268
|
+
return NitroArkHybridObject.sendLnaddr(addr, amountSat, comment);
|
|
220
269
|
}
|
|
221
270
|
|
|
222
271
|
// --- Ark Operations ---
|
|
@@ -251,47 +300,17 @@ export function sendArkoorPayment(
|
|
|
251
300
|
return NitroArkHybridObject.sendArkoorPayment(destination, amountSat);
|
|
252
301
|
}
|
|
253
302
|
|
|
254
|
-
/**
|
|
255
|
-
* Sends a Bolt11 payment.
|
|
256
|
-
* @param destination The Bolt11 invoice.
|
|
257
|
-
* @param amountSat The amount in satoshis to send. Use 0 for invoice amount.
|
|
258
|
-
* @returns A promise resolving to a Bolt11PaymentResult object
|
|
259
|
-
*/
|
|
260
|
-
export function sendBolt11Payment(
|
|
261
|
-
destination: string,
|
|
262
|
-
amountSat?: number
|
|
263
|
-
): Promise<Bolt11PaymentResult> {
|
|
264
|
-
return NitroArkHybridObject.sendBolt11Payment(destination, amountSat);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Sends a payment to a Lightning Address.
|
|
269
|
-
* @param addr The Lightning Address.
|
|
270
|
-
* @param amountSat The amount in satoshis to send.
|
|
271
|
-
* @param comment An optional comment.
|
|
272
|
-
* @returns A promise resolving to a LnurlPaymentResult object
|
|
273
|
-
*/
|
|
274
|
-
export function sendLnaddr(
|
|
275
|
-
addr: string,
|
|
276
|
-
amountSat: number,
|
|
277
|
-
comment: string
|
|
278
|
-
): Promise<LnurlPaymentResult> {
|
|
279
|
-
return NitroArkHybridObject.sendLnaddr(addr, amountSat, comment);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
303
|
/**
|
|
283
304
|
* Sends an onchain payment via an Ark round.
|
|
284
305
|
* @param destination The destination Bitcoin address.
|
|
285
306
|
* @param amountSat The amount in satoshis to send.
|
|
286
|
-
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
287
307
|
* @returns A promise resolving to a JSON status string.
|
|
288
308
|
*/
|
|
289
|
-
export function
|
|
309
|
+
export function sendRoundOnchainPayment(
|
|
290
310
|
destination: string,
|
|
291
311
|
amountSat: number,
|
|
292
|
-
no_sync: boolean = false
|
|
293
312
|
): Promise<string> {
|
|
294
|
-
return NitroArkHybridObject.
|
|
313
|
+
return NitroArkHybridObject.sendRoundOnchainPayment(destination, amountSat);
|
|
295
314
|
}
|
|
296
315
|
|
|
297
316
|
// --- Offboarding / Exiting ---
|
|
@@ -320,31 +339,6 @@ export function offboardAll(destinationAddress: string): Promise<string> {
|
|
|
320
339
|
return NitroArkHybridObject.offboardAll(destinationAddress);
|
|
321
340
|
}
|
|
322
341
|
|
|
323
|
-
/**
|
|
324
|
-
* Starts the exit process for specific VTXOs.
|
|
325
|
-
* @param vtxoIds Array of VtxoId strings to start exiting.
|
|
326
|
-
* @returns A promise resolving to a JSON status string.
|
|
327
|
-
*/
|
|
328
|
-
export function startExitForVtxos(vtxoIds: string[]): Promise<string> {
|
|
329
|
-
return NitroArkHybridObject.exitStartSpecific(vtxoIds);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* Starts the exit process for all VTXOs in the wallet.
|
|
334
|
-
* @returns A promise that resolves or rejects.
|
|
335
|
-
*/
|
|
336
|
-
export function startExitForEntireWallet(): Promise<void> {
|
|
337
|
-
return NitroArkHybridObject.startExitForEntireWallet();
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Progresses the exit process once and returns the current status.
|
|
342
|
-
* @returns A promise resolving to a JSON status string.
|
|
343
|
-
*/
|
|
344
|
-
export function exitProgressOnce(): Promise<string> {
|
|
345
|
-
return NitroArkHybridObject.exitProgressOnce();
|
|
346
|
-
}
|
|
347
|
-
|
|
348
342
|
// --- Re-export types and enums ---
|
|
349
343
|
export type {
|
|
350
344
|
NitroArk,
|
|
@@ -353,8 +347,10 @@ export type {
|
|
|
353
347
|
BarkArkInfo,
|
|
354
348
|
BarkSendManyOutput,
|
|
355
349
|
ArkoorPaymentResult,
|
|
356
|
-
|
|
350
|
+
LightningPaymentResult,
|
|
357
351
|
LnurlPaymentResult,
|
|
358
352
|
OnchainPaymentResult,
|
|
359
353
|
PaymentTypes,
|
|
354
|
+
OffchainBalanceResult,
|
|
355
|
+
OnchainBalanceResult
|
|
360
356
|
} from './NitroArk.nitro';
|