react-native-nitro-ark 0.0.15 → 0.0.17
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 +105 -105
- package/cpp/bark-cpp.h +30 -227
- package/lib/module/index.js +89 -110
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +22 -19
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +59 -86
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +4 -1
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +23 -20
- package/package.json +1 -1
- package/src/NitroArk.nitro.ts +18 -65
- package/src/index.tsx +79 -203
package/lib/module/index.js
CHANGED
|
@@ -15,253 +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);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// --- Lightning Operations ---
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Creates a Bolt 11 invoice.
|
|
119
|
+
* @param amountMsat The amount in millisatoshis for the invoice.
|
|
120
|
+
* @returns A promise resolving to the Bolt 11 invoice string.
|
|
121
|
+
*/
|
|
122
|
+
export function bolt11Invoice(amountMsat) {
|
|
123
|
+
return NitroArkHybridObject.bolt11Invoice(amountMsat);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Claims a Bolt 11 payment.
|
|
128
|
+
* @param bolt11 The Bolt 11 invoice string to claim.
|
|
129
|
+
* @returns A promise that resolves on success or rejects on error.
|
|
130
|
+
*/
|
|
131
|
+
export function claimBolt11Payment(bolt11) {
|
|
132
|
+
return NitroArkHybridObject.claimBolt11Payment(bolt11);
|
|
120
133
|
}
|
|
121
134
|
|
|
122
135
|
// --- Ark Operations ---
|
|
123
136
|
|
|
124
137
|
/**
|
|
125
|
-
* Refreshes VTXOs based on specified criteria.
|
|
126
|
-
* @param datadir Path to the data directory.
|
|
127
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
138
|
+
* Refreshes VTXOs based on specified criteria for the loaded wallet.
|
|
128
139
|
* @param refreshOpts Options specifying which VTXOs to refresh.
|
|
129
|
-
*
|
|
130
|
-
* @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.
|
|
131
141
|
* @returns A promise resolving to a JSON status string.
|
|
132
|
-
* @example
|
|
133
|
-
* // Refresh using default threshold
|
|
134
|
-
* refreshVtxos(datadir, mnemonic, { mode_type: 'DefaultThreshold' });
|
|
135
|
-
* // Refresh specific VTXOs
|
|
136
|
-
* refreshVtxos(datadir, mnemonic, { mode_type: 'Specific', specific_vtxo_ids: ['vtxo_id_1', 'vtxo_id_2'] });
|
|
137
|
-
* // Refresh if older than 10 blocks
|
|
138
|
-
* refreshVtxos(datadir, mnemonic, { mode_type: 'ThresholdBlocks', threshold_value: 10 });
|
|
139
142
|
*/
|
|
140
|
-
export function refreshVtxos(
|
|
141
|
-
// Ensure mode_type is provided (should be handled by TS type system)
|
|
143
|
+
export function refreshVtxos(refreshOpts, no_sync = false) {
|
|
142
144
|
if (!refreshOpts.mode_type) {
|
|
143
145
|
return Promise.reject(new Error('refreshVtxos requires refreshOpts.mode_type'));
|
|
144
146
|
}
|
|
145
|
-
// Additional validation for specific modes could be added here if desired
|
|
146
147
|
if (refreshOpts.mode_type === 'Specific' && (!refreshOpts.specific_vtxo_ids || refreshOpts.specific_vtxo_ids.length === 0)) {
|
|
147
148
|
return Promise.reject(new Error("refreshVtxos with mode_type 'Specific' requires non-empty specific_vtxo_ids array"));
|
|
148
149
|
}
|
|
149
150
|
if ((refreshOpts.mode_type === 'ThresholdBlocks' || refreshOpts.mode_type === 'ThresholdHours') && (refreshOpts.threshold_value === undefined || refreshOpts.threshold_value <= 0)) {
|
|
150
151
|
return Promise.reject(new Error(`refreshVtxos with mode_type '${refreshOpts.mode_type}' requires a positive threshold_value`));
|
|
151
152
|
}
|
|
152
|
-
return NitroArkHybridObject.refreshVtxos(
|
|
153
|
+
return NitroArkHybridObject.refreshVtxos(refreshOpts, no_sync);
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
/**
|
|
156
157
|
* Boards a specific amount from the onchain wallet into Ark.
|
|
157
|
-
* @param datadir Path to the data directory.
|
|
158
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
159
158
|
* @param amountSat The amount in satoshis to board.
|
|
160
|
-
* @param no_sync
|
|
159
|
+
* @param no_sync If true, skips synchronization with the onchain wallet. Defaults to false.
|
|
161
160
|
* @returns A promise resolving to a JSON status string.
|
|
162
161
|
*/
|
|
163
|
-
export function boardAmount(
|
|
164
|
-
return NitroArkHybridObject.boardAmount(
|
|
162
|
+
export function boardAmount(amountSat, no_sync = false) {
|
|
163
|
+
return NitroArkHybridObject.boardAmount(amountSat, no_sync);
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
/**
|
|
168
167
|
* Boards all available funds from the onchain wallet into Ark.
|
|
169
|
-
* @param
|
|
170
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
171
|
-
* @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.
|
|
172
169
|
* @returns A promise resolving to a JSON status string.
|
|
173
170
|
*/
|
|
174
|
-
export function boardAll(
|
|
175
|
-
return NitroArkHybridObject.boardAll(
|
|
171
|
+
export function boardAll(no_sync = false) {
|
|
172
|
+
return NitroArkHybridObject.boardAll(no_sync);
|
|
176
173
|
}
|
|
177
174
|
|
|
178
175
|
/**
|
|
179
176
|
* Sends funds offchain using Ark VTXOs.
|
|
180
|
-
* @param datadir Path to the data directory.
|
|
181
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
182
177
|
* @param destination Ark address (VTXO pubkey) or onchain Bitcoin address.
|
|
183
178
|
* @param amountSat The amount in satoshis to send.
|
|
184
|
-
* @param comment Optional comment
|
|
185
|
-
* @param no_sync
|
|
179
|
+
* @param comment Optional comment.
|
|
180
|
+
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
186
181
|
* @returns A promise resolving to a JSON status string.
|
|
187
182
|
*/
|
|
188
|
-
export function send(
|
|
189
|
-
return NitroArkHybridObject.send(
|
|
183
|
+
export function send(destination, amountSat, comment = null, no_sync = false) {
|
|
184
|
+
return NitroArkHybridObject.send(destination, amountSat, comment, no_sync);
|
|
190
185
|
}
|
|
191
186
|
|
|
192
187
|
/**
|
|
193
188
|
* Sends an onchain payment via an Ark round.
|
|
194
|
-
* @param datadir Path to the data directory.
|
|
195
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
196
189
|
* @param destination The destination Bitcoin address.
|
|
197
190
|
* @param amountSat The amount in satoshis to send.
|
|
198
|
-
* @param no_sync
|
|
191
|
+
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
199
192
|
* @returns A promise resolving to a JSON status string.
|
|
200
193
|
*/
|
|
201
|
-
export function sendRoundOnchain(
|
|
202
|
-
return NitroArkHybridObject.sendRoundOnchain(
|
|
194
|
+
export function sendRoundOnchain(destination, amountSat, no_sync = false) {
|
|
195
|
+
return NitroArkHybridObject.sendRoundOnchain(destination, amountSat, no_sync);
|
|
203
196
|
}
|
|
204
197
|
|
|
205
198
|
// --- Offboarding / Exiting ---
|
|
206
199
|
|
|
207
200
|
/**
|
|
208
201
|
* Offboards specific VTXOs to an optional onchain address.
|
|
209
|
-
* @param datadir Path to the data directory.
|
|
210
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
211
202
|
* @param vtxoIds Array of VtxoId strings to offboard.
|
|
212
203
|
* @param optionalAddress Optional destination Bitcoin address (null if sending to internal wallet).
|
|
213
|
-
* @param no_sync
|
|
204
|
+
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
214
205
|
* @returns A promise resolving to a JSON result string.
|
|
215
206
|
*/
|
|
216
|
-
export function offboardSpecific(
|
|
217
|
-
return NitroArkHybridObject.offboardSpecific(
|
|
207
|
+
export function offboardSpecific(vtxoIds, optionalAddress = null, no_sync = false) {
|
|
208
|
+
return NitroArkHybridObject.offboardSpecific(vtxoIds, optionalAddress, no_sync);
|
|
218
209
|
}
|
|
219
210
|
|
|
220
211
|
/**
|
|
221
212
|
* Offboards all VTXOs to an optional onchain address.
|
|
222
|
-
* @param datadir Path to the data directory.
|
|
223
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
224
213
|
* @param optionalAddress Optional destination Bitcoin address (null if sending to internal wallet).
|
|
225
|
-
* @param no_sync
|
|
214
|
+
* @param no_sync If true, skips synchronization with the wallet. Defaults to false.
|
|
226
215
|
* @returns A promise resolving to a JSON result string.
|
|
227
216
|
*/
|
|
228
|
-
export function offboardAll(
|
|
229
|
-
return NitroArkHybridObject.offboardAll(
|
|
217
|
+
export function offboardAll(optionalAddress = null, no_sync = false) {
|
|
218
|
+
return NitroArkHybridObject.offboardAll(optionalAddress, no_sync);
|
|
230
219
|
}
|
|
231
220
|
|
|
232
221
|
/**
|
|
233
222
|
* Starts the exit process for specific VTXOs.
|
|
234
|
-
* @param datadir Path to the data directory.
|
|
235
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
236
223
|
* @param vtxoIds Array of VtxoId strings to start exiting.
|
|
237
|
-
* @param no_sync Whether to skip syncing the wallet (Note: This might depend on potential C header updates). Defaults to false.
|
|
238
224
|
* @returns A promise resolving to a JSON status string.
|
|
239
225
|
*/
|
|
240
|
-
export function exitStartSpecific(
|
|
241
|
-
|
|
242
|
-
return NitroArkHybridObject.exitStartSpecific(datadir, mnemonic, vtxoIds, no_sync);
|
|
226
|
+
export function exitStartSpecific(vtxoIds) {
|
|
227
|
+
return NitroArkHybridObject.exitStartSpecific(vtxoIds);
|
|
243
228
|
}
|
|
244
229
|
|
|
245
230
|
/**
|
|
246
231
|
* Starts the exit process for all VTXOs in the wallet.
|
|
247
|
-
* @param datadir Path to the data directory.
|
|
248
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
249
|
-
* @param no_sync Whether to skip syncing the wallet (Note: This might depend on potential C header updates). Defaults to false.
|
|
250
232
|
* @returns A promise resolving to a JSON status string.
|
|
251
233
|
*/
|
|
252
|
-
export function exitStartAll(
|
|
253
|
-
|
|
254
|
-
return NitroArkHybridObject.exitStartAll(datadir, mnemonic, no_sync);
|
|
234
|
+
export function exitStartAll() {
|
|
235
|
+
return NitroArkHybridObject.exitStartAll();
|
|
255
236
|
}
|
|
256
237
|
|
|
257
238
|
/**
|
|
258
239
|
* Progresses the exit process once and returns the current status.
|
|
259
|
-
* @param datadir Path to the data directory.
|
|
260
|
-
* @param mnemonic The wallet mnemonic phrase.
|
|
261
240
|
* @returns A promise resolving to a JSON status string.
|
|
262
241
|
*/
|
|
263
|
-
export function exitProgressOnce(
|
|
264
|
-
return NitroArkHybridObject.exitProgressOnce(
|
|
242
|
+
export function exitProgressOnce() {
|
|
243
|
+
return NitroArkHybridObject.exitProgressOnce();
|
|
265
244
|
}
|
|
266
245
|
|
|
267
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;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAA,EAAkB;EAC3C,OAAON,oBAAoB,CAACM,WAAW,CAAC,CAAC;AAC3C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,OAAgB,GAAG,KAAK,EAAwB;EACzE,OAAOR,oBAAoB,CAACO,UAAU,CAACC,OAAO,CAAC;AACjD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAA,EAAoB;EACnD,OAAOT,oBAA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AAC;AAChD;;AAEA","ignoreList":[]}
|
|
@@ -38,24 +38,27 @@ export interface NitroArk extends HybridObject<{
|
|
|
38
38
|
android: 'c++';
|
|
39
39
|
}> {
|
|
40
40
|
createMnemonic(): Promise<string>;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
41
|
+
loadWallet(datadir: string, opts: BarkCreateOpts): Promise<void>;
|
|
42
|
+
closeWallet(): Promise<void>;
|
|
43
|
+
getBalance(no_sync: boolean): Promise<BarkBalance>;
|
|
44
|
+
getOnchainAddress(): Promise<string>;
|
|
45
|
+
getOnchainUtxos(no_sync: boolean): Promise<string>;
|
|
46
|
+
getVtxoPubkey(index?: number): Promise<string>;
|
|
47
|
+
getVtxos(no_sync: boolean): Promise<string>;
|
|
48
|
+
sendOnchain(destination: string, amountSat: number, no_sync: boolean): Promise<string>;
|
|
49
|
+
drainOnchain(destination: string, no_sync: boolean): Promise<string>;
|
|
50
|
+
sendManyOnchain(outputs: BarkSendManyOutput[], no_sync: boolean): Promise<string>;
|
|
51
|
+
refreshVtxos(refreshOpts: BarkRefreshOpts, no_sync: boolean): Promise<string>;
|
|
52
|
+
boardAmount(amountSat: number, no_sync: boolean): Promise<string>;
|
|
53
|
+
boardAll(no_sync: boolean): Promise<string>;
|
|
54
|
+
send(destination: string, amountSat: number, comment: string | null, no_sync: boolean): Promise<string>;
|
|
55
|
+
sendRoundOnchain(destination: string, amountSat: number, no_sync: boolean): Promise<string>;
|
|
56
|
+
bolt11Invoice(amountMsat: number): Promise<string>;
|
|
57
|
+
claimBolt11Payment(bolt11: string): Promise<void>;
|
|
58
|
+
offboardSpecific(vtxoIds: string[], optionalAddress: string | null, no_sync: boolean): Promise<string>;
|
|
59
|
+
offboardAll(optionalAddress: string | null, no_sync: boolean): Promise<string>;
|
|
60
|
+
exitStartSpecific(vtxoIds: string[]): Promise<string>;
|
|
61
|
+
exitStartAll(): Promise<string>;
|
|
62
|
+
exitProgressOnce(): Promise<string>;
|
|
60
63
|
}
|
|
61
64
|
//# 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,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM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