react-native-nitro-ark 0.0.71 → 0.0.72
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 +146 -52
- package/cpp/generated/ark_cxx.h +48 -22
- package/lib/module/index.js +29 -25
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NitroArk.nitro.d.ts +39 -17
- package/lib/typescript/src/NitroArk.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +27 -34
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/shared/c++/BarkConfigOpts.hpp +5 -5
- package/nitrogen/generated/shared/c++/BarkMovement.hpp +61 -28
- package/nitrogen/generated/shared/c++/{BarkMovementRecipient.hpp → BarkMovementDestination.hpp} +14 -14
- package/nitrogen/generated/shared/c++/BarkMovementSubsystem.hpp +79 -0
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.cpp +7 -6
- package/nitrogen/generated/shared/c++/HybridNitroArkSpec.hpp +13 -9
- package/nitrogen/generated/shared/c++/RoundStatus.hpp +99 -0
- package/nitrogen/generated/shared/c++/RoundStatusType.hpp +84 -0
- package/package.json +1 -1
- package/src/NitroArk.nitro.ts +53 -17
- package/src/index.tsx +46 -51
|
@@ -10,7 +10,7 @@ export interface BarkConfigOpts {
|
|
|
10
10
|
fallback_fee_rate?: number;
|
|
11
11
|
htlc_recv_claim_delta: number;
|
|
12
12
|
vtxo_exit_margin: number;
|
|
13
|
-
|
|
13
|
+
round_tx_required_confirmations: number;
|
|
14
14
|
}
|
|
15
15
|
export interface BarkCreateOpts {
|
|
16
16
|
regtest?: boolean;
|
|
@@ -116,18 +116,39 @@ export interface LightningReceive {
|
|
|
116
116
|
invoice: string;
|
|
117
117
|
preimage_revealed_at?: number;
|
|
118
118
|
}
|
|
119
|
-
export interface
|
|
120
|
-
|
|
119
|
+
export interface BarkMovementSubsystem {
|
|
120
|
+
name: string;
|
|
121
|
+
kind: string;
|
|
122
|
+
}
|
|
123
|
+
export interface BarkMovementDestination {
|
|
124
|
+
destination: string;
|
|
121
125
|
amount_sat: number;
|
|
122
126
|
}
|
|
123
127
|
export interface BarkMovement {
|
|
124
128
|
id: number;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
status: string;
|
|
130
|
+
subsystem: BarkMovementSubsystem;
|
|
131
|
+
metadata_json: string;
|
|
132
|
+
intended_balance_sat: number;
|
|
133
|
+
effective_balance_sat: number;
|
|
134
|
+
offchain_fee_sat: number;
|
|
135
|
+
sent_to: BarkMovementDestination[];
|
|
136
|
+
received_on: BarkMovementDestination[];
|
|
137
|
+
input_vtxos: string[];
|
|
138
|
+
output_vtxos: string[];
|
|
139
|
+
exited_vtxos: string[];
|
|
130
140
|
created_at: string;
|
|
141
|
+
updated_at: string;
|
|
142
|
+
completed_at?: string;
|
|
143
|
+
}
|
|
144
|
+
export type RoundStatusType = 'confirmed' | 'unconfirmed' | 'pending' | 'failed';
|
|
145
|
+
export interface RoundStatus {
|
|
146
|
+
status: RoundStatusType;
|
|
147
|
+
funding_txid?: string;
|
|
148
|
+
unsigned_funding_txids?: string[];
|
|
149
|
+
error?: string;
|
|
150
|
+
is_final: boolean;
|
|
151
|
+
is_success: boolean;
|
|
131
152
|
}
|
|
132
153
|
export interface NitroArk extends HybridObject<{
|
|
133
154
|
ios: 'c++';
|
|
@@ -138,17 +159,18 @@ export interface NitroArk extends HybridObject<{
|
|
|
138
159
|
loadWallet(datadir: string, config: BarkCreateOpts): Promise<void>;
|
|
139
160
|
isWalletLoaded(): Promise<boolean>;
|
|
140
161
|
closeWallet(): Promise<void>;
|
|
162
|
+
checkConnection(): Promise<void>;
|
|
141
163
|
syncPendingBoards(): Promise<void>;
|
|
142
164
|
maintenance(): Promise<void>;
|
|
143
165
|
maintenanceWithOnchain(): Promise<void>;
|
|
144
166
|
maintenanceRefresh(): Promise<void>;
|
|
145
167
|
sync(): Promise<void>;
|
|
146
168
|
syncExits(): Promise<void>;
|
|
147
|
-
syncPastRounds(): Promise<void>;
|
|
148
169
|
getArkInfo(): Promise<BarkArkInfo>;
|
|
149
170
|
offchainBalance(): Promise<OffchainBalanceResult>;
|
|
150
171
|
deriveStoreNextKeypair(): Promise<KeyPairResult>;
|
|
151
172
|
peakKeyPair(index: number): Promise<KeyPairResult>;
|
|
173
|
+
peakAddress(index: number): Promise<NewAddressResult>;
|
|
152
174
|
newAddress(): Promise<NewAddressResult>;
|
|
153
175
|
signMessage(message: string, index: number): Promise<string>;
|
|
154
176
|
signMesssageWithMnemonic(message: string, mnemonic: string, network: string, index: number): Promise<string>;
|
|
@@ -171,16 +193,16 @@ export interface NitroArk extends HybridObject<{
|
|
|
171
193
|
boardAll(): Promise<BoardResult>;
|
|
172
194
|
validateArkoorAddress(address: string): Promise<void>;
|
|
173
195
|
sendArkoorPayment(destination: string, amountSat: number): Promise<ArkoorPaymentResult>;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
sendRoundOnchainPayment(destination: string, amountSat: number): Promise<
|
|
196
|
+
payLightningInvoice(destination: string, amountSat?: number): Promise<Bolt11PaymentResult>;
|
|
197
|
+
payLightningOffer(offer: string, amountSat?: number): Promise<Bolt12PaymentResult>;
|
|
198
|
+
payLightningAddress(addr: string, amountSat: number, comment: string): Promise<LnurlPaymentResult>;
|
|
199
|
+
sendRoundOnchainPayment(destination: string, amountSat: number): Promise<RoundStatus>;
|
|
178
200
|
bolt11Invoice(amountMsat: number): Promise<Bolt11Invoice>;
|
|
179
201
|
lightningReceiveStatus(paymentHash: string): Promise<LightningReceive | undefined>;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<
|
|
183
|
-
offboardAll(destinationAddress: string): Promise<
|
|
202
|
+
tryClaimLightningReceive(paymentHash: string, wait: boolean, token?: string): Promise<void>;
|
|
203
|
+
tryClaimAllLightningReceives(wait: boolean): Promise<void>;
|
|
204
|
+
offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<RoundStatus>;
|
|
205
|
+
offboardAll(destinationAddress: string): Promise<RoundStatus>;
|
|
184
206
|
}
|
|
185
207
|
export {};
|
|
186
208
|
//# 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;AAM/D,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;IAC3B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,
|
|
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;AAM/D,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;IAC3B,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AAI,EAAE,OAAO,EACb,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,4BAA4B,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAG3D,gBAAgB,CACd,OAAO,EAAE,MAAM,EAAE,EACjB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,WAAW,CAAC,CAAC;IACxB,WAAW,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NitroArk, BarkCreateOpts, BarkArkInfo, Bolt11Invoice, BarkSendManyOutput, ArkoorPaymentResult, Bolt11PaymentResult, Bolt12PaymentResult, LnurlPaymentResult, OnchainPaymentResult, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive, BoardResult } from './NitroArk.nitro';
|
|
1
|
+
import type { NitroArk, BarkCreateOpts, BarkArkInfo, Bolt11Invoice, BarkSendManyOutput, ArkoorPaymentResult, Bolt11PaymentResult, Bolt12PaymentResult, LnurlPaymentResult, OnchainPaymentResult, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive, BarkMovement as NitroBarkMovement, BoardResult, RoundStatus } from './NitroArk.nitro';
|
|
2
2
|
export type BarkVtxo = {
|
|
3
3
|
amount: number;
|
|
4
4
|
expiry_height: number;
|
|
@@ -8,18 +8,9 @@ export type BarkVtxo = {
|
|
|
8
8
|
point: string;
|
|
9
9
|
state: 'Spendable' | 'Spent' | 'Locked' | 'unknown';
|
|
10
10
|
};
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
export type BarkMovement = {
|
|
16
|
-
id: number;
|
|
17
|
-
kind: 'onboard' | 'round' | 'offboard' | 'arkoor-send' | 'arkoor-receive' | 'lightning-send' | 'lightning-send-revocation' | 'lightning-receive' | 'exit';
|
|
18
|
-
fees: number;
|
|
19
|
-
spends: BarkVtxo[];
|
|
20
|
-
receives: BarkVtxo[];
|
|
21
|
-
recipients: BarkMovementRecipient[];
|
|
22
|
-
created_at: string;
|
|
11
|
+
export type MovementStatus = 'pending' | 'finished' | 'failed' | 'cancelled';
|
|
12
|
+
export type BarkMovement = NitroBarkMovement & {
|
|
13
|
+
status: MovementStatus;
|
|
23
14
|
};
|
|
24
15
|
export declare const NitroArkHybridObject: NitroArk;
|
|
25
16
|
/**
|
|
@@ -47,6 +38,7 @@ export declare function loadWallet(datadir: string, config: BarkCreateOpts): Pro
|
|
|
47
38
|
* @returns A promise that resolves on success or rejects on error.
|
|
48
39
|
*/
|
|
49
40
|
export declare function closeWallet(): Promise<void>;
|
|
41
|
+
export declare function checkConnection(): Promise<void>;
|
|
50
42
|
/**
|
|
51
43
|
* Checks if a wallet is currently loaded.
|
|
52
44
|
* @returns A promise resolving to true if a wallet is loaded, false otherwise.
|
|
@@ -84,11 +76,6 @@ export declare function sync(): Promise<void>;
|
|
|
84
76
|
* @returns A promise that resolves on success.
|
|
85
77
|
*/
|
|
86
78
|
export declare function syncExits(): Promise<void>;
|
|
87
|
-
/**
|
|
88
|
-
* Synchronizes the rounds of the wallet.
|
|
89
|
-
* @returns A promise that resolves on success.
|
|
90
|
-
*/
|
|
91
|
-
export declare function syncPastRounds(): Promise<void>;
|
|
92
79
|
/**
|
|
93
80
|
* Gets the Ark-specific information.
|
|
94
81
|
* @returns A promise resolving to the BarkArkInfo object.
|
|
@@ -110,6 +97,12 @@ export declare function deriveStoreNextKeypair(): Promise<KeyPairResult>;
|
|
|
110
97
|
* @returns A promise resolving to the KeyPairResult object.
|
|
111
98
|
*/
|
|
112
99
|
export declare function peakKeyPair(index: number): Promise<KeyPairResult>;
|
|
100
|
+
/**
|
|
101
|
+
* Peeks a derived address without advancing the wallet's address index.
|
|
102
|
+
* @param index Index of the address to preview.
|
|
103
|
+
* @returns A promise resolving to the NewAddressResult object.
|
|
104
|
+
*/
|
|
105
|
+
export declare function peakAddress(index: number): Promise<NewAddressResult>;
|
|
113
106
|
/**
|
|
114
107
|
* Gets the wallet's Address.
|
|
115
108
|
* @returns A promise resolving to NewAddressResult object.
|
|
@@ -231,31 +224,33 @@ export declare function bolt11Invoice(amountMsat: number): Promise<Bolt11Invoice
|
|
|
231
224
|
*/
|
|
232
225
|
export declare function lightningReceiveStatus(paymentHash: string): Promise<LightningReceive | undefined>;
|
|
233
226
|
/**
|
|
234
|
-
*
|
|
227
|
+
* Attempts to claim a Lightning payment, optionally using a claim token.
|
|
235
228
|
* @param paymentHash The payment hash of the Lightning payment.
|
|
229
|
+
* @param wait Whether to wait for the claim to complete.
|
|
230
|
+
* @param token Optional claim token used when no spendable VTXOs are owned.
|
|
236
231
|
* @returns A promise that resolves on success or rejects on error.
|
|
237
232
|
*/
|
|
238
|
-
export declare function
|
|
233
|
+
export declare function tryClaimLightningReceive(paymentHash: string, wait: boolean, token?: string): Promise<void>;
|
|
239
234
|
/**
|
|
240
235
|
* Checks and claims all open Lightning receives.
|
|
241
236
|
* @param wait Whether to wait for the claim to complete.
|
|
242
237
|
* @returns A promise that resolves on success or rejects on error.
|
|
243
238
|
*/
|
|
244
|
-
export declare function
|
|
239
|
+
export declare function tryClaimAllLightningReceives(wait: boolean): Promise<void>;
|
|
245
240
|
/**
|
|
246
|
-
*
|
|
241
|
+
* Pays a Bolt11 Lightning invoice.
|
|
247
242
|
* @param destination The Lightning invoice.
|
|
248
243
|
* @param amountSat The amount in satoshis to send. Use 0 for invoice amount.
|
|
249
244
|
* @returns A promise resolving to a Bolt11PaymentResult object
|
|
250
245
|
*/
|
|
251
|
-
export declare function
|
|
246
|
+
export declare function payLightningInvoice(destination: string, amountSat?: number): Promise<Bolt11PaymentResult>;
|
|
252
247
|
/**
|
|
253
248
|
* Sends a payment to a Bolt12 offer.
|
|
254
249
|
* @param offer The Bolt12 offer.
|
|
255
250
|
* @param amountSat The amount in satoshis to send. Use 0 for invoice amount.
|
|
256
251
|
* @returns A promise resolving to a Bolt12PaymentResult object
|
|
257
252
|
*/
|
|
258
|
-
export declare function
|
|
253
|
+
export declare function payLightningOffer(offer: string, amountSat?: number): Promise<Bolt12PaymentResult>;
|
|
259
254
|
/**
|
|
260
255
|
* Sends a payment to a Lightning Address.
|
|
261
256
|
* @param addr The Lightning Address.
|
|
@@ -263,7 +258,7 @@ export declare function payOffer(offer: string, amountSat?: number): Promise<Bol
|
|
|
263
258
|
* @param comment An optional comment.
|
|
264
259
|
* @returns A promise resolving to a LnurlPaymentResult object
|
|
265
260
|
*/
|
|
266
|
-
export declare function
|
|
261
|
+
export declare function payLightningAddress(addr: string, amountSat: number, comment: string): Promise<LnurlPaymentResult>;
|
|
267
262
|
/**
|
|
268
263
|
* Boards a specific amount from the onchain wallet into Ark.
|
|
269
264
|
* @param amountSat The amount in satoshis to board.
|
|
@@ -292,23 +287,21 @@ export declare function sendArkoorPayment(destination: string, amountSat: number
|
|
|
292
287
|
* Sends an onchain payment via an Ark round.
|
|
293
288
|
* @param destination The destination Bitcoin address.
|
|
294
289
|
* @param amountSat The amount in satoshis to send.
|
|
295
|
-
* @returns A promise resolving to
|
|
290
|
+
* @returns A promise resolving to the round status.
|
|
296
291
|
*/
|
|
297
|
-
export declare function sendRoundOnchainPayment(destination: string, amountSat: number): Promise<
|
|
292
|
+
export declare function sendRoundOnchainPayment(destination: string, amountSat: number): Promise<RoundStatus>;
|
|
298
293
|
/**
|
|
299
294
|
* Offboards specific VTXOs to a destination address.
|
|
300
295
|
* @param vtxoIds Array of VtxoId strings to offboard.
|
|
301
296
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
302
|
-
* @
|
|
303
|
-
* @returns A promise resolving to a JSON result string.
|
|
297
|
+
* @returns A promise resolving to the round status.
|
|
304
298
|
*/
|
|
305
|
-
export declare function offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<
|
|
299
|
+
export declare function offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise<RoundStatus>;
|
|
306
300
|
/**
|
|
307
301
|
* Offboards all VTXOs to a destination address.
|
|
308
302
|
* @param destinationAddress Destination Bitcoin address (if empty, sends to internal wallet).
|
|
309
|
-
* @
|
|
310
|
-
* @returns A promise resolving to a JSON result string.
|
|
303
|
+
* @returns A promise resolving to the round status.
|
|
311
304
|
*/
|
|
312
|
-
export declare function offboardAll(destinationAddress: string): Promise<
|
|
313
|
-
export type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, Bolt11Invoice, BoardResult, BarkSendManyOutput, ArkoorPaymentResult, Bolt11PaymentResult, LnurlPaymentResult, OnchainPaymentResult, PaymentTypes, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive, LightningReceiveBalance, } from './NitroArk.nitro';
|
|
305
|
+
export declare function offboardAll(destinationAddress: string): Promise<RoundStatus>;
|
|
306
|
+
export type { NitroArk, BarkCreateOpts, BarkConfigOpts, BarkArkInfo, Bolt11Invoice, BoardResult, BarkSendManyOutput, ArkoorPaymentResult, Bolt11PaymentResult, LnurlPaymentResult, OnchainPaymentResult, PaymentTypes, OffchainBalanceResult, OnchainBalanceResult, NewAddressResult, KeyPairResult, LightningReceive, LightningReceiveBalance, RoundStatus, } from './NitroArk.nitro';
|
|
314
307
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EA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
|
|
|
45
45
|
std::optional<double> fallback_fee_rate SWIFT_PRIVATE;
|
|
46
46
|
double htlc_recv_claim_delta SWIFT_PRIVATE;
|
|
47
47
|
double vtxo_exit_margin SWIFT_PRIVATE;
|
|
48
|
-
double
|
|
48
|
+
double round_tx_required_confirmations SWIFT_PRIVATE;
|
|
49
49
|
|
|
50
50
|
public:
|
|
51
51
|
BarkConfigOpts() = default;
|
|
52
|
-
explicit BarkConfigOpts(std::optional<std::string> ark, std::optional<std::string> esplora, std::optional<std::string> bitcoind, std::optional<std::string> bitcoind_cookie, std::optional<std::string> bitcoind_user, std::optional<std::string> bitcoind_pass, std::optional<double> vtxo_refresh_expiry_threshold, std::optional<double> fallback_fee_rate, double htlc_recv_claim_delta, double vtxo_exit_margin, double
|
|
52
|
+
explicit BarkConfigOpts(std::optional<std::string> ark, std::optional<std::string> esplora, std::optional<std::string> bitcoind, std::optional<std::string> bitcoind_cookie, std::optional<std::string> bitcoind_user, std::optional<std::string> bitcoind_pass, std::optional<double> vtxo_refresh_expiry_threshold, std::optional<double> fallback_fee_rate, double htlc_recv_claim_delta, double vtxo_exit_margin, double round_tx_required_confirmations): ark(ark), esplora(esplora), bitcoind(bitcoind), bitcoind_cookie(bitcoind_cookie), bitcoind_user(bitcoind_user), bitcoind_pass(bitcoind_pass), vtxo_refresh_expiry_threshold(vtxo_refresh_expiry_threshold), fallback_fee_rate(fallback_fee_rate), htlc_recv_claim_delta(htlc_recv_claim_delta), vtxo_exit_margin(vtxo_exit_margin), round_tx_required_confirmations(round_tx_required_confirmations) {}
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
} // namespace margelo::nitro::nitroark
|
|
@@ -72,7 +72,7 @@ namespace margelo::nitro {
|
|
|
72
72
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "fallback_fee_rate")),
|
|
73
73
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "htlc_recv_claim_delta")),
|
|
74
74
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "vtxo_exit_margin")),
|
|
75
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
75
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "round_tx_required_confirmations"))
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkConfigOpts& arg) {
|
|
@@ -87,7 +87,7 @@ namespace margelo::nitro {
|
|
|
87
87
|
obj.setProperty(runtime, "fallback_fee_rate", JSIConverter<std::optional<double>>::toJSI(runtime, arg.fallback_fee_rate));
|
|
88
88
|
obj.setProperty(runtime, "htlc_recv_claim_delta", JSIConverter<double>::toJSI(runtime, arg.htlc_recv_claim_delta));
|
|
89
89
|
obj.setProperty(runtime, "vtxo_exit_margin", JSIConverter<double>::toJSI(runtime, arg.vtxo_exit_margin));
|
|
90
|
-
obj.setProperty(runtime, "
|
|
90
|
+
obj.setProperty(runtime, "round_tx_required_confirmations", JSIConverter<double>::toJSI(runtime, arg.round_tx_required_confirmations));
|
|
91
91
|
return obj;
|
|
92
92
|
}
|
|
93
93
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -108,7 +108,7 @@ namespace margelo::nitro {
|
|
|
108
108
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "fallback_fee_rate"))) return false;
|
|
109
109
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "htlc_recv_claim_delta"))) return false;
|
|
110
110
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "vtxo_exit_margin"))) return false;
|
|
111
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "
|
|
111
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "round_tx_required_confirmations"))) return false;
|
|
112
112
|
return true;
|
|
113
113
|
}
|
|
114
114
|
};
|
|
@@ -23,15 +23,16 @@
|
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
25
|
|
|
26
|
-
// Forward declaration of `
|
|
27
|
-
namespace margelo::nitro::nitroark { struct
|
|
28
|
-
// Forward declaration of `
|
|
29
|
-
namespace margelo::nitro::nitroark { struct
|
|
26
|
+
// Forward declaration of `BarkMovementSubsystem` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::nitroark { struct BarkMovementSubsystem; }
|
|
28
|
+
// Forward declaration of `BarkMovementDestination` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::nitroark { struct BarkMovementDestination; }
|
|
30
30
|
|
|
31
31
|
#include <string>
|
|
32
|
-
#include "
|
|
32
|
+
#include "BarkMovementSubsystem.hpp"
|
|
33
|
+
#include "BarkMovementDestination.hpp"
|
|
33
34
|
#include <vector>
|
|
34
|
-
#include
|
|
35
|
+
#include <optional>
|
|
35
36
|
|
|
36
37
|
namespace margelo::nitro::nitroark {
|
|
37
38
|
|
|
@@ -41,16 +42,24 @@ namespace margelo::nitro::nitroark {
|
|
|
41
42
|
struct BarkMovement {
|
|
42
43
|
public:
|
|
43
44
|
double id SWIFT_PRIVATE;
|
|
44
|
-
std::string
|
|
45
|
-
|
|
46
|
-
std::
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
std::string status SWIFT_PRIVATE;
|
|
46
|
+
BarkMovementSubsystem subsystem SWIFT_PRIVATE;
|
|
47
|
+
std::string metadata_json SWIFT_PRIVATE;
|
|
48
|
+
double intended_balance_sat SWIFT_PRIVATE;
|
|
49
|
+
double effective_balance_sat SWIFT_PRIVATE;
|
|
50
|
+
double offchain_fee_sat SWIFT_PRIVATE;
|
|
51
|
+
std::vector<BarkMovementDestination> sent_to SWIFT_PRIVATE;
|
|
52
|
+
std::vector<BarkMovementDestination> received_on SWIFT_PRIVATE;
|
|
53
|
+
std::vector<std::string> input_vtxos SWIFT_PRIVATE;
|
|
54
|
+
std::vector<std::string> output_vtxos SWIFT_PRIVATE;
|
|
55
|
+
std::vector<std::string> exited_vtxos SWIFT_PRIVATE;
|
|
49
56
|
std::string created_at SWIFT_PRIVATE;
|
|
57
|
+
std::string updated_at SWIFT_PRIVATE;
|
|
58
|
+
std::optional<std::string> completed_at SWIFT_PRIVATE;
|
|
50
59
|
|
|
51
60
|
public:
|
|
52
61
|
BarkMovement() = default;
|
|
53
|
-
explicit BarkMovement(double id, std::string
|
|
62
|
+
explicit BarkMovement(double id, std::string status, BarkMovementSubsystem subsystem, std::string metadata_json, double intended_balance_sat, double effective_balance_sat, double offchain_fee_sat, std::vector<BarkMovementDestination> sent_to, std::vector<BarkMovementDestination> received_on, std::vector<std::string> input_vtxos, std::vector<std::string> output_vtxos, std::vector<std::string> exited_vtxos, std::string created_at, std::string updated_at, std::optional<std::string> completed_at): id(id), status(status), subsystem(subsystem), metadata_json(metadata_json), intended_balance_sat(intended_balance_sat), effective_balance_sat(effective_balance_sat), offchain_fee_sat(offchain_fee_sat), sent_to(sent_to), received_on(received_on), input_vtxos(input_vtxos), output_vtxos(output_vtxos), exited_vtxos(exited_vtxos), created_at(created_at), updated_at(updated_at), completed_at(completed_at) {}
|
|
54
63
|
};
|
|
55
64
|
|
|
56
65
|
} // namespace margelo::nitro::nitroark
|
|
@@ -64,23 +73,39 @@ namespace margelo::nitro {
|
|
|
64
73
|
jsi::Object obj = arg.asObject(runtime);
|
|
65
74
|
return margelo::nitro::nitroark::BarkMovement(
|
|
66
75
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "id")),
|
|
67
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
68
|
-
JSIConverter<
|
|
69
|
-
JSIConverter<std::
|
|
70
|
-
JSIConverter<
|
|
71
|
-
JSIConverter<
|
|
72
|
-
JSIConverter<
|
|
76
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "status")),
|
|
77
|
+
JSIConverter<margelo::nitro::nitroark::BarkMovementSubsystem>::fromJSI(runtime, obj.getProperty(runtime, "subsystem")),
|
|
78
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "metadata_json")),
|
|
79
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "intended_balance_sat")),
|
|
80
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "effective_balance_sat")),
|
|
81
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "offchain_fee_sat")),
|
|
82
|
+
JSIConverter<std::vector<margelo::nitro::nitroark::BarkMovementDestination>>::fromJSI(runtime, obj.getProperty(runtime, "sent_to")),
|
|
83
|
+
JSIConverter<std::vector<margelo::nitro::nitroark::BarkMovementDestination>>::fromJSI(runtime, obj.getProperty(runtime, "received_on")),
|
|
84
|
+
JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "input_vtxos")),
|
|
85
|
+
JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "output_vtxos")),
|
|
86
|
+
JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "exited_vtxos")),
|
|
87
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "created_at")),
|
|
88
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "updated_at")),
|
|
89
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "completed_at"))
|
|
73
90
|
);
|
|
74
91
|
}
|
|
75
92
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkMovement& arg) {
|
|
76
93
|
jsi::Object obj(runtime);
|
|
77
94
|
obj.setProperty(runtime, "id", JSIConverter<double>::toJSI(runtime, arg.id));
|
|
78
|
-
obj.setProperty(runtime, "
|
|
79
|
-
obj.setProperty(runtime, "
|
|
80
|
-
obj.setProperty(runtime, "
|
|
81
|
-
obj.setProperty(runtime, "
|
|
82
|
-
obj.setProperty(runtime, "
|
|
95
|
+
obj.setProperty(runtime, "status", JSIConverter<std::string>::toJSI(runtime, arg.status));
|
|
96
|
+
obj.setProperty(runtime, "subsystem", JSIConverter<margelo::nitro::nitroark::BarkMovementSubsystem>::toJSI(runtime, arg.subsystem));
|
|
97
|
+
obj.setProperty(runtime, "metadata_json", JSIConverter<std::string>::toJSI(runtime, arg.metadata_json));
|
|
98
|
+
obj.setProperty(runtime, "intended_balance_sat", JSIConverter<double>::toJSI(runtime, arg.intended_balance_sat));
|
|
99
|
+
obj.setProperty(runtime, "effective_balance_sat", JSIConverter<double>::toJSI(runtime, arg.effective_balance_sat));
|
|
100
|
+
obj.setProperty(runtime, "offchain_fee_sat", JSIConverter<double>::toJSI(runtime, arg.offchain_fee_sat));
|
|
101
|
+
obj.setProperty(runtime, "sent_to", JSIConverter<std::vector<margelo::nitro::nitroark::BarkMovementDestination>>::toJSI(runtime, arg.sent_to));
|
|
102
|
+
obj.setProperty(runtime, "received_on", JSIConverter<std::vector<margelo::nitro::nitroark::BarkMovementDestination>>::toJSI(runtime, arg.received_on));
|
|
103
|
+
obj.setProperty(runtime, "input_vtxos", JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.input_vtxos));
|
|
104
|
+
obj.setProperty(runtime, "output_vtxos", JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.output_vtxos));
|
|
105
|
+
obj.setProperty(runtime, "exited_vtxos", JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.exited_vtxos));
|
|
83
106
|
obj.setProperty(runtime, "created_at", JSIConverter<std::string>::toJSI(runtime, arg.created_at));
|
|
107
|
+
obj.setProperty(runtime, "updated_at", JSIConverter<std::string>::toJSI(runtime, arg.updated_at));
|
|
108
|
+
obj.setProperty(runtime, "completed_at", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.completed_at));
|
|
84
109
|
return obj;
|
|
85
110
|
}
|
|
86
111
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -92,12 +117,20 @@ namespace margelo::nitro {
|
|
|
92
117
|
return false;
|
|
93
118
|
}
|
|
94
119
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
95
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "
|
|
96
|
-
if (!JSIConverter<
|
|
97
|
-
if (!JSIConverter<std::
|
|
98
|
-
if (!JSIConverter<
|
|
99
|
-
if (!JSIConverter<
|
|
120
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "status"))) return false;
|
|
121
|
+
if (!JSIConverter<margelo::nitro::nitroark::BarkMovementSubsystem>::canConvert(runtime, obj.getProperty(runtime, "subsystem"))) return false;
|
|
122
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "metadata_json"))) return false;
|
|
123
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "intended_balance_sat"))) return false;
|
|
124
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "effective_balance_sat"))) return false;
|
|
125
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "offchain_fee_sat"))) return false;
|
|
126
|
+
if (!JSIConverter<std::vector<margelo::nitro::nitroark::BarkMovementDestination>>::canConvert(runtime, obj.getProperty(runtime, "sent_to"))) return false;
|
|
127
|
+
if (!JSIConverter<std::vector<margelo::nitro::nitroark::BarkMovementDestination>>::canConvert(runtime, obj.getProperty(runtime, "received_on"))) return false;
|
|
128
|
+
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "input_vtxos"))) return false;
|
|
129
|
+
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "output_vtxos"))) return false;
|
|
130
|
+
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "exited_vtxos"))) return false;
|
|
100
131
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "created_at"))) return false;
|
|
132
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "updated_at"))) return false;
|
|
133
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "completed_at"))) return false;
|
|
101
134
|
return true;
|
|
102
135
|
}
|
|
103
136
|
};
|
package/nitrogen/generated/shared/c++/{BarkMovementRecipient.hpp → BarkMovementDestination.hpp}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// BarkMovementDestination.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -30,35 +30,35 @@
|
|
|
30
30
|
namespace margelo::nitro::nitroark {
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* A struct which can be represented as a JavaScript object (
|
|
33
|
+
* A struct which can be represented as a JavaScript object (BarkMovementDestination).
|
|
34
34
|
*/
|
|
35
|
-
struct
|
|
35
|
+
struct BarkMovementDestination {
|
|
36
36
|
public:
|
|
37
|
-
std::string
|
|
37
|
+
std::string destination SWIFT_PRIVATE;
|
|
38
38
|
double amount_sat SWIFT_PRIVATE;
|
|
39
39
|
|
|
40
40
|
public:
|
|
41
|
-
|
|
42
|
-
explicit
|
|
41
|
+
BarkMovementDestination() = default;
|
|
42
|
+
explicit BarkMovementDestination(std::string destination, double amount_sat): destination(destination), amount_sat(amount_sat) {}
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
} // namespace margelo::nitro::nitroark
|
|
46
46
|
|
|
47
47
|
namespace margelo::nitro {
|
|
48
48
|
|
|
49
|
-
// C++
|
|
49
|
+
// C++ BarkMovementDestination <> JS BarkMovementDestination (object)
|
|
50
50
|
template <>
|
|
51
|
-
struct JSIConverter<margelo::nitro::nitroark::
|
|
52
|
-
static inline margelo::nitro::nitroark::
|
|
51
|
+
struct JSIConverter<margelo::nitro::nitroark::BarkMovementDestination> final {
|
|
52
|
+
static inline margelo::nitro::nitroark::BarkMovementDestination fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
53
53
|
jsi::Object obj = arg.asObject(runtime);
|
|
54
|
-
return margelo::nitro::nitroark::
|
|
55
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "
|
|
54
|
+
return margelo::nitro::nitroark::BarkMovementDestination(
|
|
55
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "destination")),
|
|
56
56
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "amount_sat"))
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::
|
|
59
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkMovementDestination& arg) {
|
|
60
60
|
jsi::Object obj(runtime);
|
|
61
|
-
obj.setProperty(runtime, "
|
|
61
|
+
obj.setProperty(runtime, "destination", JSIConverter<std::string>::toJSI(runtime, arg.destination));
|
|
62
62
|
obj.setProperty(runtime, "amount_sat", JSIConverter<double>::toJSI(runtime, arg.amount_sat));
|
|
63
63
|
return obj;
|
|
64
64
|
}
|
|
@@ -70,7 +70,7 @@ namespace margelo::nitro {
|
|
|
70
70
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
71
71
|
return false;
|
|
72
72
|
}
|
|
73
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "
|
|
73
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "destination"))) return false;
|
|
74
74
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "amount_sat"))) return false;
|
|
75
75
|
return true;
|
|
76
76
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// BarkMovementSubsystem.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
|
+
#include <string>
|
|
29
|
+
|
|
30
|
+
namespace margelo::nitro::nitroark {
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A struct which can be represented as a JavaScript object (BarkMovementSubsystem).
|
|
34
|
+
*/
|
|
35
|
+
struct BarkMovementSubsystem {
|
|
36
|
+
public:
|
|
37
|
+
std::string name SWIFT_PRIVATE;
|
|
38
|
+
std::string kind SWIFT_PRIVATE;
|
|
39
|
+
|
|
40
|
+
public:
|
|
41
|
+
BarkMovementSubsystem() = default;
|
|
42
|
+
explicit BarkMovementSubsystem(std::string name, std::string kind): name(name), kind(kind) {}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
} // namespace margelo::nitro::nitroark
|
|
46
|
+
|
|
47
|
+
namespace margelo::nitro {
|
|
48
|
+
|
|
49
|
+
// C++ BarkMovementSubsystem <> JS BarkMovementSubsystem (object)
|
|
50
|
+
template <>
|
|
51
|
+
struct JSIConverter<margelo::nitro::nitroark::BarkMovementSubsystem> final {
|
|
52
|
+
static inline margelo::nitro::nitroark::BarkMovementSubsystem fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
53
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
54
|
+
return margelo::nitro::nitroark::BarkMovementSubsystem(
|
|
55
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "name")),
|
|
56
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "kind"))
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroark::BarkMovementSubsystem& arg) {
|
|
60
|
+
jsi::Object obj(runtime);
|
|
61
|
+
obj.setProperty(runtime, "name", JSIConverter<std::string>::toJSI(runtime, arg.name));
|
|
62
|
+
obj.setProperty(runtime, "kind", JSIConverter<std::string>::toJSI(runtime, arg.kind));
|
|
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<std::string>::canConvert(runtime, obj.getProperty(runtime, "name"))) return false;
|
|
74
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "kind"))) return false;
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
} // namespace margelo::nitro
|