@secondts/bark-react-native 0.25.0 → 0.26.0
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/README.md +1 -1
- package/cpp/generated/bark.cpp +519 -31
- package/cpp/generated/bark.hpp +28 -2
- package/lib/commonjs/generated/bark-ffi.js.map +1 -1
- package/lib/commonjs/generated/bark.js +436 -61
- package/lib/commonjs/generated/bark.js.map +1 -1
- package/lib/module/generated/bark-ffi.js.map +1 -1
- package/lib/module/generated/bark.js +436 -61
- package/lib/module/generated/bark.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +34 -8
- package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/bark.d.ts +1580 -159
- package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark-ffi.d.ts +34 -8
- package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/bark.d.ts +1580 -159
- package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
- package/package.json +4 -4
- package/scripts/postinstall.js +35 -9
- package/src/generated/bark-ffi.ts +81 -8
- package/src/generated/bark.ts +3373 -539
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { type UniffiGcObject, type UniffiHandle, Cursor, FfiConverterObject, FfiConverterObjectWithCallbacks, UniffiAbstractObject, destructorGuardSymbol, pointerLiteralSymbol, uniffiTypeNameSymbol, variantOrdinalSymbol } from "@ubjs/core";
|
|
3
|
+
/**
|
|
4
|
+
* Turn logging off and detach the current logger, which is never released.
|
|
5
|
+
*
|
|
6
|
+
* React Native calls this when its JS runtime starts, so a logger left by a
|
|
7
|
+
* runtime that was reloaded is never called.
|
|
8
|
+
*/
|
|
9
|
+
export declare function clearLogger(): void;
|
|
10
|
+
/**
|
|
11
|
+
* Decode a BOLT11 invoice, for example to show its amount, description,
|
|
12
|
+
* payee and expiry before paying it.
|
|
13
|
+
*
|
|
14
|
+
* Only decodes: it does not check the invoice's network or whether it has
|
|
15
|
+
* expired. `Wallet::parse_payment_request` checks the network.
|
|
16
|
+
*/
|
|
17
|
+
export declare function decodeBolt11Invoice(invoice: string): Bolt11InvoiceDetails;
|
|
3
18
|
/**
|
|
4
19
|
* Default for `Config.vtxo_key_gap_limit`: the run of consecutive unused
|
|
5
20
|
* seed-derived VTXO key indices a scan crosses before concluding a VTXO
|
|
@@ -40,10 +55,22 @@ export declare function initWallet(network: Network, mnemonicOrSeed: string, con
|
|
|
40
55
|
*/
|
|
41
56
|
export declare function maxVtxoKeyGapLimit(): number;
|
|
42
57
|
/**
|
|
43
|
-
*
|
|
58
|
+
* Network and seed fingerprint of the wallet in `datadir`, or `None` when no
|
|
59
|
+
* wallet is initialized there. Same side-effect guarantees as
|
|
60
|
+
* [`wallet_exists`].
|
|
44
61
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
62
|
+
* Not named `datadir_info`: the Go bindings would export it as `DatadirInfo`,
|
|
63
|
+
* which collides with the record of the same name.
|
|
64
|
+
*/
|
|
65
|
+
export declare function readDatadirInfo(datadir: string): DatadirInfo | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Send bark's log records at or above `max_level` to `logger`.
|
|
68
|
+
*
|
|
69
|
+
* Calling this again replaces the current logger and level. The replaced
|
|
70
|
+
* logger is never released. `clear_logger` turns logging off.
|
|
71
|
+
*
|
|
72
|
+
* Errors if another logger for Rust's `log` crate was installed in this
|
|
73
|
+
* process before the first call.
|
|
47
74
|
*/
|
|
48
75
|
export declare function setLogger(logger: BarkLogger, maxLevel: LogLevel): void;
|
|
49
76
|
/**
|
|
@@ -58,6 +85,17 @@ export declare function validateArkAddress(address: string): boolean;
|
|
|
58
85
|
* Validate a BIP39 mnemonic phrase
|
|
59
86
|
*/
|
|
60
87
|
export declare function validateMnemonic(mnemonic: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Whether `datadir` holds an initialized bark wallet.
|
|
90
|
+
*
|
|
91
|
+
* Answers without side effects: the database is opened read-only, no
|
|
92
|
+
* migration runs and no file or directory is created. Returns `false` for a
|
|
93
|
+
* missing or empty directory and for a database that never got its wallet
|
|
94
|
+
* properties (for example after a crash during creation). Returns an error
|
|
95
|
+
* when a database exists but cannot be read, so a corrupt wallet is never
|
|
96
|
+
* mistaken for an absent one.
|
|
97
|
+
*/
|
|
98
|
+
export declare function walletExists(datadir: string): boolean;
|
|
61
99
|
export type AddressWithIndex = {
|
|
62
100
|
address: string;
|
|
63
101
|
index: number;
|
|
@@ -170,97 +208,793 @@ export declare const LightningReceiveFees: Readonly<{
|
|
|
170
208
|
defaults: () => Partial<LightningReceiveFees>;
|
|
171
209
|
}>;
|
|
172
210
|
/**
|
|
173
|
-
* Fees for sending over lightning.
|
|
211
|
+
* Fees for sending over lightning.
|
|
212
|
+
*/
|
|
213
|
+
export type LightningSendFees = {
|
|
214
|
+
minFeeSats: bigint;
|
|
215
|
+
baseFeeSats: bigint;
|
|
216
|
+
ppmExpiryTable: Array<PpmExpiryFeeEntry>;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Generated factory for {@link LightningSendFees} record objects.
|
|
220
|
+
*/
|
|
221
|
+
export declare const LightningSendFees: Readonly<{
|
|
222
|
+
create: (partial: Partial<LightningSendFees> & Required<Omit<LightningSendFees, never>>) => LightningSendFees;
|
|
223
|
+
new: (partial: Partial<LightningSendFees> & Required<Omit<LightningSendFees, never>>) => LightningSendFees;
|
|
224
|
+
defaults: () => Partial<LightningSendFees>;
|
|
225
|
+
}>;
|
|
226
|
+
/**
|
|
227
|
+
* The Ark server's complete fee schedule, mirroring `ark::fees::FeeSchedule`.
|
|
228
|
+
*/
|
|
229
|
+
export type FeeSchedule = {
|
|
230
|
+
board: BoardFees;
|
|
231
|
+
offboard: OffboardFees;
|
|
232
|
+
refresh: RefreshFees;
|
|
233
|
+
lightningReceive: LightningReceiveFees;
|
|
234
|
+
lightningSend: LightningSendFees;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* Generated factory for {@link FeeSchedule} record objects.
|
|
238
|
+
*/
|
|
239
|
+
export declare const FeeSchedule: Readonly<{
|
|
240
|
+
create: (partial: Partial<FeeSchedule> & Required<Omit<FeeSchedule, never>>) => FeeSchedule;
|
|
241
|
+
new: (partial: Partial<FeeSchedule> & Required<Omit<FeeSchedule, never>>) => FeeSchedule;
|
|
242
|
+
defaults: () => Partial<FeeSchedule>;
|
|
243
|
+
}>;
|
|
244
|
+
export type ArkInfo = {
|
|
245
|
+
network: Network;
|
|
246
|
+
serverPubkey: string;
|
|
247
|
+
roundIntervalSecs: bigint;
|
|
248
|
+
nbRoundNonces: number;
|
|
249
|
+
vtxoExitDelta: number;
|
|
250
|
+
/**
|
|
251
|
+
* The number of blocks a VTXO lives before it expires.
|
|
252
|
+
*/
|
|
253
|
+
vtxoLifetime: number;
|
|
254
|
+
/**
|
|
255
|
+
* The number of blocks a VTXO lives before it expires.
|
|
256
|
+
*
|
|
257
|
+
* Deprecated: upstream renamed this to `vtxo_lifetime`. Both names are
|
|
258
|
+
* exposed and carry the same value; migrate to `vtxo_lifetime`, this one
|
|
259
|
+
* goes away once upstream drops it.
|
|
260
|
+
*/
|
|
261
|
+
vtxoExpiryDelta: number;
|
|
262
|
+
htlcSendExpiryDelta: number;
|
|
263
|
+
htlcExpiryDelta: number;
|
|
264
|
+
maxVtxoAmountSats?: bigint;
|
|
265
|
+
requiredBoardConfirmations: number;
|
|
266
|
+
maxUserInvoiceCltvDelta: number;
|
|
267
|
+
minBoardAmountSats: bigint;
|
|
268
|
+
lnReceiveAntiDosRequired: boolean;
|
|
269
|
+
/**
|
|
270
|
+
* The server's fee schedule (board, offboard, refresh, lightning fees).
|
|
271
|
+
*/
|
|
272
|
+
feeSchedule: FeeSchedule;
|
|
273
|
+
/**
|
|
274
|
+
* Maximum exit depth (genesis chain length) allowed for a VTXO before the
|
|
275
|
+
* server refuses to cosign further OOR transactions spending it.
|
|
276
|
+
*/
|
|
277
|
+
maxVtxoExitDepth: number;
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* Generated factory for {@link ArkInfo} record objects.
|
|
281
|
+
*/
|
|
282
|
+
export declare const ArkInfo: Readonly<{
|
|
283
|
+
create: (partial: Partial<ArkInfo> & Required<Omit<ArkInfo, "maxVtxoAmountSats">>) => ArkInfo;
|
|
284
|
+
new: (partial: Partial<ArkInfo> & Required<Omit<ArkInfo, "maxVtxoAmountSats">>) => ArkInfo;
|
|
285
|
+
defaults: () => Partial<ArkInfo>;
|
|
286
|
+
}>;
|
|
287
|
+
export declare enum PaymentMethod_Tags {
|
|
288
|
+
Ark = "Ark",
|
|
289
|
+
Bitcoin = "Bitcoin",
|
|
290
|
+
OutputScript = "OutputScript",
|
|
291
|
+
Invoice = "Invoice",
|
|
292
|
+
Offer = "Offer",
|
|
293
|
+
LightningAddress = "LightningAddress",
|
|
294
|
+
Lnurl = "Lnurl",
|
|
295
|
+
Custom = "Custom"
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* A payment destination, mirroring `bark::movement::PaymentMethod`.
|
|
299
|
+
*
|
|
300
|
+
* Each variant carries the destination as a string. `type` and `value`
|
|
301
|
+
* match upstream's JSON encoding (`{"type":"ark","value":"tark1…"}`), which
|
|
302
|
+
* is what `Movement.sent_to_addresses` and `Movement.received_on_addresses`
|
|
303
|
+
* hold and what `Wallet::history_by_payment_method` takes.
|
|
304
|
+
*/
|
|
305
|
+
export declare const PaymentMethod: Readonly<{
|
|
306
|
+
instanceOf: (obj: any) => obj is PaymentMethod;
|
|
307
|
+
Ark: {
|
|
308
|
+
new (inner: {
|
|
309
|
+
value: string;
|
|
310
|
+
}): {
|
|
311
|
+
readonly tag: PaymentMethod_Tags.Ark;
|
|
312
|
+
readonly inner: Readonly<{
|
|
313
|
+
value: string;
|
|
314
|
+
}>;
|
|
315
|
+
/**
|
|
316
|
+
* @private
|
|
317
|
+
* This field is private and should not be used, use `tag` instead.
|
|
318
|
+
*/
|
|
319
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
320
|
+
};
|
|
321
|
+
new(inner: {
|
|
322
|
+
value: string;
|
|
323
|
+
}): {
|
|
324
|
+
readonly tag: PaymentMethod_Tags.Ark;
|
|
325
|
+
readonly inner: Readonly<{
|
|
326
|
+
value: string;
|
|
327
|
+
}>;
|
|
328
|
+
/**
|
|
329
|
+
* @private
|
|
330
|
+
* This field is private and should not be used, use `tag` instead.
|
|
331
|
+
*/
|
|
332
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
333
|
+
};
|
|
334
|
+
instanceOf(obj: any): obj is {
|
|
335
|
+
readonly tag: PaymentMethod_Tags.Ark;
|
|
336
|
+
readonly inner: Readonly<{
|
|
337
|
+
value: string;
|
|
338
|
+
}>;
|
|
339
|
+
/**
|
|
340
|
+
* @private
|
|
341
|
+
* This field is private and should not be used, use `tag` instead.
|
|
342
|
+
*/
|
|
343
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
Bitcoin: {
|
|
347
|
+
new (inner: {
|
|
348
|
+
value: string;
|
|
349
|
+
}): {
|
|
350
|
+
readonly tag: PaymentMethod_Tags.Bitcoin;
|
|
351
|
+
readonly inner: Readonly<{
|
|
352
|
+
value: string;
|
|
353
|
+
}>;
|
|
354
|
+
/**
|
|
355
|
+
* @private
|
|
356
|
+
* This field is private and should not be used, use `tag` instead.
|
|
357
|
+
*/
|
|
358
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
359
|
+
};
|
|
360
|
+
new(inner: {
|
|
361
|
+
value: string;
|
|
362
|
+
}): {
|
|
363
|
+
readonly tag: PaymentMethod_Tags.Bitcoin;
|
|
364
|
+
readonly inner: Readonly<{
|
|
365
|
+
value: string;
|
|
366
|
+
}>;
|
|
367
|
+
/**
|
|
368
|
+
* @private
|
|
369
|
+
* This field is private and should not be used, use `tag` instead.
|
|
370
|
+
*/
|
|
371
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
372
|
+
};
|
|
373
|
+
instanceOf(obj: any): obj is {
|
|
374
|
+
readonly tag: PaymentMethod_Tags.Bitcoin;
|
|
375
|
+
readonly inner: Readonly<{
|
|
376
|
+
value: string;
|
|
377
|
+
}>;
|
|
378
|
+
/**
|
|
379
|
+
* @private
|
|
380
|
+
* This field is private and should not be used, use `tag` instead.
|
|
381
|
+
*/
|
|
382
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
OutputScript: {
|
|
386
|
+
new (inner: {
|
|
387
|
+
value: string;
|
|
388
|
+
}): {
|
|
389
|
+
readonly tag: PaymentMethod_Tags.OutputScript;
|
|
390
|
+
readonly inner: Readonly<{
|
|
391
|
+
value: string;
|
|
392
|
+
}>;
|
|
393
|
+
/**
|
|
394
|
+
* @private
|
|
395
|
+
* This field is private and should not be used, use `tag` instead.
|
|
396
|
+
*/
|
|
397
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
398
|
+
};
|
|
399
|
+
new(inner: {
|
|
400
|
+
value: string;
|
|
401
|
+
}): {
|
|
402
|
+
readonly tag: PaymentMethod_Tags.OutputScript;
|
|
403
|
+
readonly inner: Readonly<{
|
|
404
|
+
value: string;
|
|
405
|
+
}>;
|
|
406
|
+
/**
|
|
407
|
+
* @private
|
|
408
|
+
* This field is private and should not be used, use `tag` instead.
|
|
409
|
+
*/
|
|
410
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
411
|
+
};
|
|
412
|
+
instanceOf(obj: any): obj is {
|
|
413
|
+
readonly tag: PaymentMethod_Tags.OutputScript;
|
|
414
|
+
readonly inner: Readonly<{
|
|
415
|
+
value: string;
|
|
416
|
+
}>;
|
|
417
|
+
/**
|
|
418
|
+
* @private
|
|
419
|
+
* This field is private and should not be used, use `tag` instead.
|
|
420
|
+
*/
|
|
421
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
Invoice: {
|
|
425
|
+
new (inner: {
|
|
426
|
+
value: string;
|
|
427
|
+
}): {
|
|
428
|
+
readonly tag: PaymentMethod_Tags.Invoice;
|
|
429
|
+
readonly inner: Readonly<{
|
|
430
|
+
value: string;
|
|
431
|
+
}>;
|
|
432
|
+
/**
|
|
433
|
+
* @private
|
|
434
|
+
* This field is private and should not be used, use `tag` instead.
|
|
435
|
+
*/
|
|
436
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
437
|
+
};
|
|
438
|
+
new(inner: {
|
|
439
|
+
value: string;
|
|
440
|
+
}): {
|
|
441
|
+
readonly tag: PaymentMethod_Tags.Invoice;
|
|
442
|
+
readonly inner: Readonly<{
|
|
443
|
+
value: string;
|
|
444
|
+
}>;
|
|
445
|
+
/**
|
|
446
|
+
* @private
|
|
447
|
+
* This field is private and should not be used, use `tag` instead.
|
|
448
|
+
*/
|
|
449
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
450
|
+
};
|
|
451
|
+
instanceOf(obj: any): obj is {
|
|
452
|
+
readonly tag: PaymentMethod_Tags.Invoice;
|
|
453
|
+
readonly inner: Readonly<{
|
|
454
|
+
value: string;
|
|
455
|
+
}>;
|
|
456
|
+
/**
|
|
457
|
+
* @private
|
|
458
|
+
* This field is private and should not be used, use `tag` instead.
|
|
459
|
+
*/
|
|
460
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
Offer: {
|
|
464
|
+
new (inner: {
|
|
465
|
+
value: string;
|
|
466
|
+
}): {
|
|
467
|
+
readonly tag: PaymentMethod_Tags.Offer;
|
|
468
|
+
readonly inner: Readonly<{
|
|
469
|
+
value: string;
|
|
470
|
+
}>;
|
|
471
|
+
/**
|
|
472
|
+
* @private
|
|
473
|
+
* This field is private and should not be used, use `tag` instead.
|
|
474
|
+
*/
|
|
475
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
476
|
+
};
|
|
477
|
+
new(inner: {
|
|
478
|
+
value: string;
|
|
479
|
+
}): {
|
|
480
|
+
readonly tag: PaymentMethod_Tags.Offer;
|
|
481
|
+
readonly inner: Readonly<{
|
|
482
|
+
value: string;
|
|
483
|
+
}>;
|
|
484
|
+
/**
|
|
485
|
+
* @private
|
|
486
|
+
* This field is private and should not be used, use `tag` instead.
|
|
487
|
+
*/
|
|
488
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
489
|
+
};
|
|
490
|
+
instanceOf(obj: any): obj is {
|
|
491
|
+
readonly tag: PaymentMethod_Tags.Offer;
|
|
492
|
+
readonly inner: Readonly<{
|
|
493
|
+
value: string;
|
|
494
|
+
}>;
|
|
495
|
+
/**
|
|
496
|
+
* @private
|
|
497
|
+
* This field is private and should not be used, use `tag` instead.
|
|
498
|
+
*/
|
|
499
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
500
|
+
};
|
|
501
|
+
};
|
|
502
|
+
LightningAddress: {
|
|
503
|
+
new (inner: {
|
|
504
|
+
value: string;
|
|
505
|
+
}): {
|
|
506
|
+
readonly tag: PaymentMethod_Tags.LightningAddress;
|
|
507
|
+
readonly inner: Readonly<{
|
|
508
|
+
value: string;
|
|
509
|
+
}>;
|
|
510
|
+
/**
|
|
511
|
+
* @private
|
|
512
|
+
* This field is private and should not be used, use `tag` instead.
|
|
513
|
+
*/
|
|
514
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
515
|
+
};
|
|
516
|
+
new(inner: {
|
|
517
|
+
value: string;
|
|
518
|
+
}): {
|
|
519
|
+
readonly tag: PaymentMethod_Tags.LightningAddress;
|
|
520
|
+
readonly inner: Readonly<{
|
|
521
|
+
value: string;
|
|
522
|
+
}>;
|
|
523
|
+
/**
|
|
524
|
+
* @private
|
|
525
|
+
* This field is private and should not be used, use `tag` instead.
|
|
526
|
+
*/
|
|
527
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
528
|
+
};
|
|
529
|
+
instanceOf(obj: any): obj is {
|
|
530
|
+
readonly tag: PaymentMethod_Tags.LightningAddress;
|
|
531
|
+
readonly inner: Readonly<{
|
|
532
|
+
value: string;
|
|
533
|
+
}>;
|
|
534
|
+
/**
|
|
535
|
+
* @private
|
|
536
|
+
* This field is private and should not be used, use `tag` instead.
|
|
537
|
+
*/
|
|
538
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
Lnurl: {
|
|
542
|
+
new (inner: {
|
|
543
|
+
value: string;
|
|
544
|
+
}): {
|
|
545
|
+
readonly tag: PaymentMethod_Tags.Lnurl;
|
|
546
|
+
readonly inner: Readonly<{
|
|
547
|
+
value: string;
|
|
548
|
+
}>;
|
|
549
|
+
/**
|
|
550
|
+
* @private
|
|
551
|
+
* This field is private and should not be used, use `tag` instead.
|
|
552
|
+
*/
|
|
553
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
554
|
+
};
|
|
555
|
+
new(inner: {
|
|
556
|
+
value: string;
|
|
557
|
+
}): {
|
|
558
|
+
readonly tag: PaymentMethod_Tags.Lnurl;
|
|
559
|
+
readonly inner: Readonly<{
|
|
560
|
+
value: string;
|
|
561
|
+
}>;
|
|
562
|
+
/**
|
|
563
|
+
* @private
|
|
564
|
+
* This field is private and should not be used, use `tag` instead.
|
|
565
|
+
*/
|
|
566
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
567
|
+
};
|
|
568
|
+
instanceOf(obj: any): obj is {
|
|
569
|
+
readonly tag: PaymentMethod_Tags.Lnurl;
|
|
570
|
+
readonly inner: Readonly<{
|
|
571
|
+
value: string;
|
|
572
|
+
}>;
|
|
573
|
+
/**
|
|
574
|
+
* @private
|
|
575
|
+
* This field is private and should not be used, use `tag` instead.
|
|
576
|
+
*/
|
|
577
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
578
|
+
};
|
|
579
|
+
};
|
|
580
|
+
Custom: {
|
|
581
|
+
new (inner: {
|
|
582
|
+
value: string;
|
|
583
|
+
}): {
|
|
584
|
+
readonly tag: PaymentMethod_Tags.Custom;
|
|
585
|
+
readonly inner: Readonly<{
|
|
586
|
+
value: string;
|
|
587
|
+
}>;
|
|
588
|
+
/**
|
|
589
|
+
* @private
|
|
590
|
+
* This field is private and should not be used, use `tag` instead.
|
|
591
|
+
*/
|
|
592
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
593
|
+
};
|
|
594
|
+
new(inner: {
|
|
595
|
+
value: string;
|
|
596
|
+
}): {
|
|
597
|
+
readonly tag: PaymentMethod_Tags.Custom;
|
|
598
|
+
readonly inner: Readonly<{
|
|
599
|
+
value: string;
|
|
600
|
+
}>;
|
|
601
|
+
/**
|
|
602
|
+
* @private
|
|
603
|
+
* This field is private and should not be used, use `tag` instead.
|
|
604
|
+
*/
|
|
605
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
606
|
+
};
|
|
607
|
+
instanceOf(obj: any): obj is {
|
|
608
|
+
readonly tag: PaymentMethod_Tags.Custom;
|
|
609
|
+
readonly inner: Readonly<{
|
|
610
|
+
value: string;
|
|
611
|
+
}>;
|
|
612
|
+
/**
|
|
613
|
+
* @private
|
|
614
|
+
* This field is private and should not be used, use `tag` instead.
|
|
615
|
+
*/
|
|
616
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethod";
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
}>;
|
|
620
|
+
/**
|
|
621
|
+
* A payment destination, mirroring `bark::movement::PaymentMethod`.
|
|
622
|
+
*
|
|
623
|
+
* Each variant carries the destination as a string. `type` and `value`
|
|
624
|
+
* match upstream's JSON encoding (`{"type":"ark","value":"tark1…"}`), which
|
|
625
|
+
* is what `Movement.sent_to_addresses` and `Movement.received_on_addresses`
|
|
626
|
+
* hold and what `Wallet::history_by_payment_method` takes.
|
|
627
|
+
*/
|
|
628
|
+
export type PaymentMethod = InstanceType<(typeof PaymentMethod)["Ark" | "Bitcoin" | "OutputScript" | "Invoice" | "Offer" | "LightningAddress" | "Lnurl" | "Custom"]>;
|
|
629
|
+
export declare enum PaymentMethodParsingError_Tags {
|
|
630
|
+
NetworkMismatch = "NetworkMismatch",
|
|
631
|
+
InvalidArkAddress = "InvalidArkAddress",
|
|
632
|
+
AmountMismatch = "AmountMismatch",
|
|
633
|
+
InvalidAmount = "InvalidAmount",
|
|
634
|
+
Unsupported = "Unsupported"
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Why an option of a [`PaymentRequest`] may not be payable, mirroring
|
|
638
|
+
* `bark::PaymentMethodParsingError`.
|
|
639
|
+
*
|
|
640
|
+
* Returned as data in [`AvailablePaymentMethod::errors`] rather than as an
|
|
641
|
+
* error, so the caller can still show every option and flag the bad ones.
|
|
642
|
+
*/
|
|
643
|
+
export declare const PaymentMethodParsingError: Readonly<{
|
|
644
|
+
instanceOf: (obj: any) => obj is PaymentMethodParsingError;
|
|
645
|
+
NetworkMismatch: {
|
|
646
|
+
new (): {
|
|
647
|
+
readonly tag: PaymentMethodParsingError_Tags.NetworkMismatch;
|
|
648
|
+
/**
|
|
649
|
+
* @private
|
|
650
|
+
* This field is private and should not be used, use `tag` instead.
|
|
651
|
+
*/
|
|
652
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
653
|
+
};
|
|
654
|
+
new(): {
|
|
655
|
+
readonly tag: PaymentMethodParsingError_Tags.NetworkMismatch;
|
|
656
|
+
/**
|
|
657
|
+
* @private
|
|
658
|
+
* This field is private and should not be used, use `tag` instead.
|
|
659
|
+
*/
|
|
660
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
661
|
+
};
|
|
662
|
+
instanceOf(obj: any): obj is {
|
|
663
|
+
readonly tag: PaymentMethodParsingError_Tags.NetworkMismatch;
|
|
664
|
+
/**
|
|
665
|
+
* @private
|
|
666
|
+
* This field is private and should not be used, use `tag` instead.
|
|
667
|
+
*/
|
|
668
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
669
|
+
};
|
|
670
|
+
};
|
|
671
|
+
InvalidArkAddress: {
|
|
672
|
+
new (inner: {
|
|
673
|
+
reason: string;
|
|
674
|
+
}): {
|
|
675
|
+
readonly tag: PaymentMethodParsingError_Tags.InvalidArkAddress;
|
|
676
|
+
readonly inner: Readonly<{
|
|
677
|
+
reason: string;
|
|
678
|
+
}>;
|
|
679
|
+
/**
|
|
680
|
+
* @private
|
|
681
|
+
* This field is private and should not be used, use `tag` instead.
|
|
682
|
+
*/
|
|
683
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
684
|
+
};
|
|
685
|
+
new(inner: {
|
|
686
|
+
reason: string;
|
|
687
|
+
}): {
|
|
688
|
+
readonly tag: PaymentMethodParsingError_Tags.InvalidArkAddress;
|
|
689
|
+
readonly inner: Readonly<{
|
|
690
|
+
reason: string;
|
|
691
|
+
}>;
|
|
692
|
+
/**
|
|
693
|
+
* @private
|
|
694
|
+
* This field is private and should not be used, use `tag` instead.
|
|
695
|
+
*/
|
|
696
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
697
|
+
};
|
|
698
|
+
instanceOf(obj: any): obj is {
|
|
699
|
+
readonly tag: PaymentMethodParsingError_Tags.InvalidArkAddress;
|
|
700
|
+
readonly inner: Readonly<{
|
|
701
|
+
reason: string;
|
|
702
|
+
}>;
|
|
703
|
+
/**
|
|
704
|
+
* @private
|
|
705
|
+
* This field is private and should not be used, use `tag` instead.
|
|
706
|
+
*/
|
|
707
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
AmountMismatch: {
|
|
711
|
+
new (inner: {
|
|
712
|
+
expectedSats: bigint;
|
|
713
|
+
gotSats: bigint;
|
|
714
|
+
}): {
|
|
715
|
+
readonly tag: PaymentMethodParsingError_Tags.AmountMismatch;
|
|
716
|
+
readonly inner: Readonly<{
|
|
717
|
+
expectedSats: bigint;
|
|
718
|
+
gotSats: bigint;
|
|
719
|
+
}>;
|
|
720
|
+
/**
|
|
721
|
+
* @private
|
|
722
|
+
* This field is private and should not be used, use `tag` instead.
|
|
723
|
+
*/
|
|
724
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
725
|
+
};
|
|
726
|
+
new(inner: {
|
|
727
|
+
expectedSats: bigint;
|
|
728
|
+
gotSats: bigint;
|
|
729
|
+
}): {
|
|
730
|
+
readonly tag: PaymentMethodParsingError_Tags.AmountMismatch;
|
|
731
|
+
readonly inner: Readonly<{
|
|
732
|
+
expectedSats: bigint;
|
|
733
|
+
gotSats: bigint;
|
|
734
|
+
}>;
|
|
735
|
+
/**
|
|
736
|
+
* @private
|
|
737
|
+
* This field is private and should not be used, use `tag` instead.
|
|
738
|
+
*/
|
|
739
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
740
|
+
};
|
|
741
|
+
instanceOf(obj: any): obj is {
|
|
742
|
+
readonly tag: PaymentMethodParsingError_Tags.AmountMismatch;
|
|
743
|
+
readonly inner: Readonly<{
|
|
744
|
+
expectedSats: bigint;
|
|
745
|
+
gotSats: bigint;
|
|
746
|
+
}>;
|
|
747
|
+
/**
|
|
748
|
+
* @private
|
|
749
|
+
* This field is private and should not be used, use `tag` instead.
|
|
750
|
+
*/
|
|
751
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
752
|
+
};
|
|
753
|
+
};
|
|
754
|
+
InvalidAmount: {
|
|
755
|
+
new (): {
|
|
756
|
+
readonly tag: PaymentMethodParsingError_Tags.InvalidAmount;
|
|
757
|
+
/**
|
|
758
|
+
* @private
|
|
759
|
+
* This field is private and should not be used, use `tag` instead.
|
|
760
|
+
*/
|
|
761
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
762
|
+
};
|
|
763
|
+
new(): {
|
|
764
|
+
readonly tag: PaymentMethodParsingError_Tags.InvalidAmount;
|
|
765
|
+
/**
|
|
766
|
+
* @private
|
|
767
|
+
* This field is private and should not be used, use `tag` instead.
|
|
768
|
+
*/
|
|
769
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
770
|
+
};
|
|
771
|
+
instanceOf(obj: any): obj is {
|
|
772
|
+
readonly tag: PaymentMethodParsingError_Tags.InvalidAmount;
|
|
773
|
+
/**
|
|
774
|
+
* @private
|
|
775
|
+
* This field is private and should not be used, use `tag` instead.
|
|
776
|
+
*/
|
|
777
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
778
|
+
};
|
|
779
|
+
};
|
|
780
|
+
Unsupported: {
|
|
781
|
+
new (): {
|
|
782
|
+
readonly tag: PaymentMethodParsingError_Tags.Unsupported;
|
|
783
|
+
/**
|
|
784
|
+
* @private
|
|
785
|
+
* This field is private and should not be used, use `tag` instead.
|
|
786
|
+
*/
|
|
787
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
788
|
+
};
|
|
789
|
+
new(): {
|
|
790
|
+
readonly tag: PaymentMethodParsingError_Tags.Unsupported;
|
|
791
|
+
/**
|
|
792
|
+
* @private
|
|
793
|
+
* This field is private and should not be used, use `tag` instead.
|
|
794
|
+
*/
|
|
795
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
796
|
+
};
|
|
797
|
+
instanceOf(obj: any): obj is {
|
|
798
|
+
readonly tag: PaymentMethodParsingError_Tags.Unsupported;
|
|
799
|
+
/**
|
|
800
|
+
* @private
|
|
801
|
+
* This field is private and should not be used, use `tag` instead.
|
|
802
|
+
*/
|
|
803
|
+
readonly [uniffiTypeNameSymbol]: "PaymentMethodParsingError";
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
}>;
|
|
807
|
+
/**
|
|
808
|
+
* Why an option of a [`PaymentRequest`] may not be payable, mirroring
|
|
809
|
+
* `bark::PaymentMethodParsingError`.
|
|
810
|
+
*
|
|
811
|
+
* Returned as data in [`AvailablePaymentMethod::errors`] rather than as an
|
|
812
|
+
* error, so the caller can still show every option and flag the bad ones.
|
|
813
|
+
*/
|
|
814
|
+
export type PaymentMethodParsingError = InstanceType<(typeof PaymentMethodParsingError)["NetworkMismatch" | "InvalidArkAddress" | "AmountMismatch" | "InvalidAmount" | "Unsupported"]>;
|
|
815
|
+
/**
|
|
816
|
+
* One way to pay a [`PaymentRequest`], mirroring
|
|
817
|
+
* `bark::AvailablePaymentMethod`.
|
|
818
|
+
*/
|
|
819
|
+
export type AvailablePaymentMethod = {
|
|
820
|
+
method: PaymentMethod;
|
|
821
|
+
/**
|
|
822
|
+
* Why this option may not be payable. Empty when bark found no problem.
|
|
823
|
+
*/
|
|
824
|
+
errors: Array<PaymentMethodParsingError>;
|
|
825
|
+
/**
|
|
826
|
+
* Whether `Wallet::send_payment` needs an amount for this method: always
|
|
827
|
+
* for addresses and LNURL, and for invoices and offers that carry none.
|
|
828
|
+
*/
|
|
829
|
+
requiresAmount: boolean;
|
|
830
|
+
};
|
|
831
|
+
/**
|
|
832
|
+
* Generated factory for {@link AvailablePaymentMethod} record objects.
|
|
833
|
+
*/
|
|
834
|
+
export declare const AvailablePaymentMethod: Readonly<{
|
|
835
|
+
create: (partial: Partial<AvailablePaymentMethod> & Required<Omit<AvailablePaymentMethod, never>>) => AvailablePaymentMethod;
|
|
836
|
+
new: (partial: Partial<AvailablePaymentMethod> & Required<Omit<AvailablePaymentMethod, never>>) => AvailablePaymentMethod;
|
|
837
|
+
defaults: () => Partial<AvailablePaymentMethod>;
|
|
838
|
+
}>;
|
|
839
|
+
export type Balance = {
|
|
840
|
+
/**
|
|
841
|
+
* Sats that can be spent right now. Excludes `needs_refresh_sats`.
|
|
842
|
+
*/
|
|
843
|
+
spendableSats: bigint;
|
|
844
|
+
/**
|
|
845
|
+
* Sats in VTXOs that have expired or reached the server's maximum exit
|
|
846
|
+
* depth. They can still be offboarded, exited or refreshed, but not sent
|
|
847
|
+
* out-of-round until maintenance has refreshed them.
|
|
848
|
+
*/
|
|
849
|
+
needsRefreshSats: bigint;
|
|
850
|
+
pendingInRoundSats: bigint;
|
|
851
|
+
pendingExitSats: bigint;
|
|
852
|
+
pendingLightningSendSats: bigint;
|
|
853
|
+
claimableLightningReceiveSats: bigint;
|
|
854
|
+
pendingBoardSats: bigint;
|
|
855
|
+
/**
|
|
856
|
+
* Sats locked in an outgoing arkoor payment that has not completed yet.
|
|
857
|
+
*/
|
|
858
|
+
pendingArkoorSendSats: bigint;
|
|
859
|
+
/**
|
|
860
|
+
* Sats locked in an offboard whose transaction has not been broadcast
|
|
861
|
+
* yet, including any change that comes back.
|
|
862
|
+
*/
|
|
863
|
+
pendingOffboardSats: bigint;
|
|
864
|
+
};
|
|
865
|
+
/**
|
|
866
|
+
* Generated factory for {@link Balance} record objects.
|
|
867
|
+
*/
|
|
868
|
+
export declare const Balance: Readonly<{
|
|
869
|
+
create: (partial: Partial<Balance> & Required<Omit<Balance, never>>) => Balance;
|
|
870
|
+
new: (partial: Partial<Balance> & Required<Omit<Balance, never>>) => Balance;
|
|
871
|
+
defaults: () => Partial<Balance>;
|
|
872
|
+
}>;
|
|
873
|
+
/**
|
|
874
|
+
* The numbers to show a user without the breakdown of [`Balance`],
|
|
875
|
+
* mirroring `bark::BalanceSummary`.
|
|
876
|
+
*
|
|
877
|
+
* Show `spendable_sats` as what a user can pay with and `total_sats` as what
|
|
878
|
+
* a user owns.
|
|
879
|
+
*/
|
|
880
|
+
export type BalanceSummary = {
|
|
881
|
+
/**
|
|
882
|
+
* Sats that can be spent right now.
|
|
883
|
+
*/
|
|
884
|
+
spendableSats: bigint;
|
|
885
|
+
/**
|
|
886
|
+
* Sats that need a refresh before they can be sent again.
|
|
887
|
+
*/
|
|
888
|
+
needsRefreshSats: bigint;
|
|
889
|
+
/**
|
|
890
|
+
* Sats held by operations in progress. They either come back as
|
|
891
|
+
* spendable or leave the wallet, for example to the onchain wallet.
|
|
892
|
+
*/
|
|
893
|
+
pendingSats: bigint;
|
|
894
|
+
/**
|
|
895
|
+
* All sats that belong to the wallet:
|
|
896
|
+
* `spendable_sats + needs_refresh_sats + pending_sats`.
|
|
897
|
+
*/
|
|
898
|
+
totalSats: bigint;
|
|
899
|
+
};
|
|
900
|
+
/**
|
|
901
|
+
* Generated factory for {@link BalanceSummary} record objects.
|
|
174
902
|
*/
|
|
175
|
-
export
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
903
|
+
export declare const BalanceSummary: Readonly<{
|
|
904
|
+
create: (partial: Partial<BalanceSummary> & Required<Omit<BalanceSummary, never>>) => BalanceSummary;
|
|
905
|
+
new: (partial: Partial<BalanceSummary> & Required<Omit<BalanceSummary, never>>) => BalanceSummary;
|
|
906
|
+
defaults: () => Partial<BalanceSummary>;
|
|
907
|
+
}>;
|
|
908
|
+
export type LightningInvoice = {
|
|
909
|
+
invoice: string;
|
|
910
|
+
paymentHash: string;
|
|
911
|
+
amountSats: bigint;
|
|
179
912
|
};
|
|
180
913
|
/**
|
|
181
|
-
* Generated factory for {@link
|
|
914
|
+
* Generated factory for {@link LightningInvoice} record objects.
|
|
182
915
|
*/
|
|
183
|
-
export declare const
|
|
184
|
-
create: (partial: Partial<
|
|
185
|
-
new: (partial: Partial<
|
|
186
|
-
defaults: () => Partial<
|
|
916
|
+
export declare const LightningInvoice: Readonly<{
|
|
917
|
+
create: (partial: Partial<LightningInvoice> & Required<Omit<LightningInvoice, never>>) => LightningInvoice;
|
|
918
|
+
new: (partial: Partial<LightningInvoice> & Required<Omit<LightningInvoice, never>>) => LightningInvoice;
|
|
919
|
+
defaults: () => Partial<LightningInvoice>;
|
|
187
920
|
}>;
|
|
188
921
|
/**
|
|
189
|
-
*
|
|
922
|
+
* A BIP 321 URI built by `Wallet::bip321_uri`, with the destinations in it.
|
|
190
923
|
*/
|
|
191
|
-
export type
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
924
|
+
export type Bip321Uri = {
|
|
925
|
+
/**
|
|
926
|
+
* The `bitcoin:` URI, for example to show as a QR code.
|
|
927
|
+
*/
|
|
928
|
+
uri: string;
|
|
929
|
+
/**
|
|
930
|
+
* The new Ark address in the URI.
|
|
931
|
+
*/
|
|
932
|
+
arkAddress?: string;
|
|
933
|
+
/**
|
|
934
|
+
* The new invoice in the URI. Follow the receive by its `payment_hash`.
|
|
935
|
+
*/
|
|
936
|
+
lightningInvoice?: LightningInvoice;
|
|
937
|
+
/**
|
|
938
|
+
* The onchain address in the URI.
|
|
939
|
+
*/
|
|
940
|
+
onchainAddress?: string;
|
|
197
941
|
};
|
|
198
942
|
/**
|
|
199
|
-
* Generated factory for {@link
|
|
943
|
+
* Generated factory for {@link Bip321Uri} record objects.
|
|
200
944
|
*/
|
|
201
|
-
export declare const
|
|
202
|
-
create: (partial: Partial<
|
|
203
|
-
new: (partial: Partial<
|
|
204
|
-
defaults: () => Partial<
|
|
945
|
+
export declare const Bip321Uri: Readonly<{
|
|
946
|
+
create: (partial: Partial<Bip321Uri> & Required<Omit<Bip321Uri, "arkAddress" | "lightningInvoice" | "onchainAddress">>) => Bip321Uri;
|
|
947
|
+
new: (partial: Partial<Bip321Uri> & Required<Omit<Bip321Uri, "arkAddress" | "lightningInvoice" | "onchainAddress">>) => Bip321Uri;
|
|
948
|
+
defaults: () => Partial<Bip321Uri>;
|
|
205
949
|
}>;
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
nbRoundNonces: number;
|
|
211
|
-
vtxoExitDelta: number;
|
|
950
|
+
/**
|
|
951
|
+
* What `Wallet::bip321_uri` puts in the URI. Every field is optional.
|
|
952
|
+
*/
|
|
953
|
+
export type Bip321UriOptions = {
|
|
212
954
|
/**
|
|
213
|
-
* The
|
|
955
|
+
* The amount to request. A lightning invoice needs one.
|
|
956
|
+
*
|
|
957
|
+
* Default: none
|
|
214
958
|
*/
|
|
215
|
-
|
|
959
|
+
amountSats?: bigint;
|
|
216
960
|
/**
|
|
217
|
-
*
|
|
961
|
+
* Default: none
|
|
962
|
+
*/
|
|
963
|
+
label?: string;
|
|
964
|
+
/**
|
|
965
|
+
* Default: none
|
|
966
|
+
*/
|
|
967
|
+
message?: string;
|
|
968
|
+
/**
|
|
969
|
+
* Whether to include a new Ark address.
|
|
218
970
|
*
|
|
219
|
-
*
|
|
220
|
-
* exposed and carry the same value; migrate to `vtxo_lifetime`, this one
|
|
221
|
-
* goes away once upstream drops it.
|
|
971
|
+
* Default: true
|
|
222
972
|
*/
|
|
223
|
-
|
|
224
|
-
htlcSendExpiryDelta: number;
|
|
225
|
-
htlcExpiryDelta: number;
|
|
226
|
-
maxVtxoAmountSats?: bigint;
|
|
227
|
-
requiredBoardConfirmations: number;
|
|
228
|
-
maxUserInvoiceCltvDelta: number;
|
|
229
|
-
minBoardAmountSats: bigint;
|
|
230
|
-
lnReceiveAntiDosRequired: boolean;
|
|
973
|
+
ark: boolean;
|
|
231
974
|
/**
|
|
232
|
-
*
|
|
975
|
+
* Whether to include a new BOLT11 invoice. Ignored without
|
|
976
|
+
* `amount_sats`.
|
|
977
|
+
*
|
|
978
|
+
* Default: true
|
|
233
979
|
*/
|
|
234
|
-
|
|
980
|
+
lightning: boolean;
|
|
235
981
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
982
|
+
* An onchain address to include, such as one from the host's own
|
|
983
|
+
* onchain wallet. It must be for the wallet's network. As in bark's own
|
|
984
|
+
* builder, a mainnet address goes in the URI path and any other in a
|
|
985
|
+
* `tb=` parameter.
|
|
986
|
+
*
|
|
987
|
+
* Default: none
|
|
238
988
|
*/
|
|
239
|
-
|
|
240
|
-
};
|
|
241
|
-
/**
|
|
242
|
-
* Generated factory for {@link ArkInfo} record objects.
|
|
243
|
-
*/
|
|
244
|
-
export declare const ArkInfo: Readonly<{
|
|
245
|
-
create: (partial: Partial<ArkInfo> & Required<Omit<ArkInfo, "maxVtxoAmountSats">>) => ArkInfo;
|
|
246
|
-
new: (partial: Partial<ArkInfo> & Required<Omit<ArkInfo, "maxVtxoAmountSats">>) => ArkInfo;
|
|
247
|
-
defaults: () => Partial<ArkInfo>;
|
|
248
|
-
}>;
|
|
249
|
-
export type Balance = {
|
|
250
|
-
spendableSats: bigint;
|
|
251
|
-
pendingInRoundSats: bigint;
|
|
252
|
-
pendingExitSats: bigint;
|
|
253
|
-
pendingLightningSendSats: bigint;
|
|
254
|
-
claimableLightningReceiveSats: bigint;
|
|
255
|
-
pendingBoardSats: bigint;
|
|
989
|
+
onchainAddress?: string;
|
|
256
990
|
};
|
|
257
991
|
/**
|
|
258
|
-
* Generated factory for {@link
|
|
992
|
+
* Generated factory for {@link Bip321UriOptions} record objects.
|
|
259
993
|
*/
|
|
260
|
-
export declare const
|
|
261
|
-
create: (partial: Partial<
|
|
262
|
-
new: (partial: Partial<
|
|
263
|
-
defaults: () => Partial<
|
|
994
|
+
export declare const Bip321UriOptions: Readonly<{
|
|
995
|
+
create: (partial: Partial<Bip321UriOptions> & Required<Omit<Bip321UriOptions, "amountSats" | "onchainAddress" | "label" | "message" | "ark" | "lightning">>) => Bip321UriOptions;
|
|
996
|
+
new: (partial: Partial<Bip321UriOptions> & Required<Omit<Bip321UriOptions, "amountSats" | "onchainAddress" | "label" | "message" | "ark" | "lightning">>) => Bip321UriOptions;
|
|
997
|
+
defaults: () => Partial<Bip321UriOptions>;
|
|
264
998
|
}>;
|
|
265
999
|
/**
|
|
266
1000
|
* Reference to a block in the blockchain
|
|
@@ -298,6 +1032,50 @@ export declare const BoardFundingInfo: Readonly<{
|
|
|
298
1032
|
new: (partial: Partial<BoardFundingInfo> & Required<Omit<BoardFundingInfo, never>>) => BoardFundingInfo;
|
|
299
1033
|
defaults: () => Partial<BoardFundingInfo>;
|
|
300
1034
|
}>;
|
|
1035
|
+
/**
|
|
1036
|
+
* Fields of a BOLT11 invoice, as returned by `decode_bolt11_invoice`.
|
|
1037
|
+
*/
|
|
1038
|
+
export type Bolt11InvoiceDetails = {
|
|
1039
|
+
paymentHash: string;
|
|
1040
|
+
/**
|
|
1041
|
+
* `None` for an amountless invoice, which needs an amount to pay.
|
|
1042
|
+
*/
|
|
1043
|
+
amountMsat?: bigint;
|
|
1044
|
+
/**
|
|
1045
|
+
* `amount_msat` rounded up to whole sats.
|
|
1046
|
+
*/
|
|
1047
|
+
amountSats?: bigint;
|
|
1048
|
+
/**
|
|
1049
|
+
* The description, when the invoice carries it directly.
|
|
1050
|
+
*/
|
|
1051
|
+
description?: string;
|
|
1052
|
+
/**
|
|
1053
|
+
* The hex SHA-256 of the description, when the invoice carries that
|
|
1054
|
+
* instead.
|
|
1055
|
+
*/
|
|
1056
|
+
descriptionHash?: string;
|
|
1057
|
+
/**
|
|
1058
|
+
* The payee's node public key, hex.
|
|
1059
|
+
*/
|
|
1060
|
+
payeePubkey: string;
|
|
1061
|
+
/**
|
|
1062
|
+
* Creation time, in unix seconds.
|
|
1063
|
+
*/
|
|
1064
|
+
createdAt: bigint;
|
|
1065
|
+
/**
|
|
1066
|
+
* Expiry time, in unix seconds. Compare it with the current time to
|
|
1067
|
+
* tell whether the invoice can still be paid.
|
|
1068
|
+
*/
|
|
1069
|
+
expiresAt: bigint;
|
|
1070
|
+
};
|
|
1071
|
+
/**
|
|
1072
|
+
* Generated factory for {@link Bolt11InvoiceDetails} record objects.
|
|
1073
|
+
*/
|
|
1074
|
+
export declare const Bolt11InvoiceDetails: Readonly<{
|
|
1075
|
+
create: (partial: Partial<Bolt11InvoiceDetails> & Required<Omit<Bolt11InvoiceDetails, "amountSats" | "amountMsat" | "description" | "descriptionHash">>) => Bolt11InvoiceDetails;
|
|
1076
|
+
new: (partial: Partial<Bolt11InvoiceDetails> & Required<Omit<Bolt11InvoiceDetails, "amountSats" | "amountMsat" | "description" | "descriptionHash">>) => Bolt11InvoiceDetails;
|
|
1077
|
+
defaults: () => Partial<Bolt11InvoiceDetails>;
|
|
1078
|
+
}>;
|
|
301
1079
|
export type Config = {
|
|
302
1080
|
serverAddress: string;
|
|
303
1081
|
serverAccessToken?: string;
|
|
@@ -356,6 +1134,55 @@ export declare const CpfpParams: Readonly<{
|
|
|
356
1134
|
new: (partial: Partial<CpfpParams> & Required<Omit<CpfpParams, "currentPackageFeeSats">>) => CpfpParams;
|
|
357
1135
|
defaults: () => Partial<CpfpParams>;
|
|
358
1136
|
}>;
|
|
1137
|
+
/**
|
|
1138
|
+
* What [`read_datadir_info`] found in a wallet directory.
|
|
1139
|
+
*/
|
|
1140
|
+
export type DatadirInfo = {
|
|
1141
|
+
/**
|
|
1142
|
+
* Path of the database file that was read.
|
|
1143
|
+
*/
|
|
1144
|
+
dbFile: string;
|
|
1145
|
+
network: Network;
|
|
1146
|
+
/**
|
|
1147
|
+
* Fingerprint of the wallet seed, as `Wallet::fingerprint` returns it.
|
|
1148
|
+
* Compare it against the seed you are about to open with to catch a
|
|
1149
|
+
* restore-over-the-wrong-wallet before any file is touched.
|
|
1150
|
+
*/
|
|
1151
|
+
fingerprint: string;
|
|
1152
|
+
};
|
|
1153
|
+
/**
|
|
1154
|
+
* Generated factory for {@link DatadirInfo} record objects.
|
|
1155
|
+
*/
|
|
1156
|
+
export declare const DatadirInfo: Readonly<{
|
|
1157
|
+
create: (partial: Partial<DatadirInfo> & Required<Omit<DatadirInfo, never>>) => DatadirInfo;
|
|
1158
|
+
new: (partial: Partial<DatadirInfo> & Required<Omit<DatadirInfo, never>>) => DatadirInfo;
|
|
1159
|
+
defaults: () => Partial<DatadirInfo>;
|
|
1160
|
+
}>;
|
|
1161
|
+
/**
|
|
1162
|
+
* Wallet information that helps to debug issues, mirroring
|
|
1163
|
+
* `bark::DebugInfo` (what `bark debug-info` prints). Users can share it in
|
|
1164
|
+
* support requests.
|
|
1165
|
+
*/
|
|
1166
|
+
export type DebugInfo = {
|
|
1167
|
+
network: Network;
|
|
1168
|
+
/**
|
|
1169
|
+
* The wallet's server mailbox id, hex-encoded like
|
|
1170
|
+
* `Wallet::mailbox_identifier`.
|
|
1171
|
+
*/
|
|
1172
|
+
mailboxId: string;
|
|
1173
|
+
/**
|
|
1174
|
+
* The xpub every VTXO keypair is derived from.
|
|
1175
|
+
*/
|
|
1176
|
+
vtxoXpub: string;
|
|
1177
|
+
};
|
|
1178
|
+
/**
|
|
1179
|
+
* Generated factory for {@link DebugInfo} record objects.
|
|
1180
|
+
*/
|
|
1181
|
+
export declare const DebugInfo: Readonly<{
|
|
1182
|
+
create: (partial: Partial<DebugInfo> & Required<Omit<DebugInfo, never>>) => DebugInfo;
|
|
1183
|
+
new: (partial: Partial<DebugInfo> & Required<Omit<DebugInfo, never>>) => DebugInfo;
|
|
1184
|
+
defaults: () => Partial<DebugInfo>;
|
|
1185
|
+
}>;
|
|
359
1186
|
/**
|
|
360
1187
|
* A Bitcoin transaction output destination
|
|
361
1188
|
*/
|
|
@@ -382,9 +1209,10 @@ export declare const Destination: Readonly<{
|
|
|
382
1209
|
*/
|
|
383
1210
|
export type EmergencyExitFeeEstimate = {
|
|
384
1211
|
/**
|
|
385
|
-
* CPFP fees to broadcast every not-yet-confirmed exit transaction
|
|
386
|
-
*
|
|
387
|
-
*
|
|
1212
|
+
* CPFP fees to broadcast every not-yet-confirmed exit transaction,
|
|
1213
|
+
* scaled by the fee margin, so deliberately above `fee_rate × weight`.
|
|
1214
|
+
* Paid now from confirmed onchain funds; this is the onchain balance to
|
|
1215
|
+
* fund the exit with at that margin.
|
|
388
1216
|
*/
|
|
389
1217
|
exitBroadcastFeeSats: bigint;
|
|
390
1218
|
/**
|
|
@@ -397,9 +1225,9 @@ export type EmergencyExitFeeEstimate = {
|
|
|
397
1225
|
*/
|
|
398
1226
|
totalFeeSats: bigint;
|
|
399
1227
|
/**
|
|
400
|
-
* Fee rate the exit-broadcast leg was priced at
|
|
401
|
-
* Unless an explicit rate was supplied, the claim
|
|
402
|
-
* separately at the chain's `regular` rate.
|
|
1228
|
+
* Fee rate the exit-broadcast leg was priced at, before the fee margin
|
|
1229
|
+
* (sat/vB, rounded up). Unless an explicit rate was supplied, the claim
|
|
1230
|
+
* leg is priced separately at the chain's `regular` rate.
|
|
403
1231
|
*/
|
|
404
1232
|
feeRateSatPerVb: bigint;
|
|
405
1233
|
/**
|
|
@@ -408,10 +1236,12 @@ export type EmergencyExitFeeEstimate = {
|
|
|
408
1236
|
*/
|
|
409
1237
|
txsToBroadcast: bigint;
|
|
410
1238
|
/**
|
|
411
|
-
* Whether the wallet's
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
1239
|
+
* Whether the onchain wallet's last synced balance covers
|
|
1240
|
+
* `exit_broadcast_fee_sats`. `false` without an onchain wallet.
|
|
1241
|
+
*
|
|
1242
|
+
* Deprecated: bark dropped this field. Compare `exit_broadcast_fee_sats`
|
|
1243
|
+
* against the onchain balance instead; this one goes away in a later
|
|
1244
|
+
* release, as it does in bark-rest.
|
|
415
1245
|
*/
|
|
416
1246
|
fundable: boolean;
|
|
417
1247
|
};
|
|
@@ -439,7 +1269,8 @@ export declare enum ExitStateKind {
|
|
|
439
1269
|
ClaimInProgress = 4,
|
|
440
1270
|
Claimed = 5,
|
|
441
1271
|
VtxoAlreadySpent = 6,
|
|
442
|
-
|
|
1272
|
+
VtxoSwept = 7,
|
|
1273
|
+
Canceled = 8
|
|
443
1274
|
}
|
|
444
1275
|
export declare enum ExitCancelFailure_Tags {
|
|
445
1276
|
NotExiting = "NotExiting",
|
|
@@ -592,21 +1423,6 @@ export declare const ExitCancelResult: Readonly<{
|
|
|
592
1423
|
new: (partial: Partial<ExitCancelResult> & Required<Omit<ExitCancelResult, "reason">>) => ExitCancelResult;
|
|
593
1424
|
defaults: () => Partial<ExitCancelResult>;
|
|
594
1425
|
}>;
|
|
595
|
-
/**
|
|
596
|
-
* Claim transaction for exited funds
|
|
597
|
-
*/
|
|
598
|
-
export type ExitClaimTransaction = {
|
|
599
|
-
psbtBase64: string;
|
|
600
|
-
feeSats: bigint;
|
|
601
|
-
};
|
|
602
|
-
/**
|
|
603
|
-
* Generated factory for {@link ExitClaimTransaction} record objects.
|
|
604
|
-
*/
|
|
605
|
-
export declare const ExitClaimTransaction: Readonly<{
|
|
606
|
-
create: (partial: Partial<ExitClaimTransaction> & Required<Omit<ExitClaimTransaction, never>>) => ExitClaimTransaction;
|
|
607
|
-
new: (partial: Partial<ExitClaimTransaction> & Required<Omit<ExitClaimTransaction, never>>) => ExitClaimTransaction;
|
|
608
|
-
defaults: () => Partial<ExitClaimTransaction>;
|
|
609
|
-
}>;
|
|
610
1426
|
export declare enum ExitTxOrigin_Tags {
|
|
611
1427
|
Wallet = "Wallet",
|
|
612
1428
|
Mempool = "Mempool",
|
|
@@ -726,6 +1542,61 @@ export declare const ExitTxOrigin: Readonly<{
|
|
|
726
1542
|
* Where an exit transaction was first seen, mirroring `bark::exit::ExitTxOrigin`.
|
|
727
1543
|
*/
|
|
728
1544
|
export type ExitTxOrigin = InstanceType<(typeof ExitTxOrigin)["Wallet" | "Mempool" | "Block"]>;
|
|
1545
|
+
/**
|
|
1546
|
+
* The CPFP child of an exit transaction.
|
|
1547
|
+
*/
|
|
1548
|
+
export type ExitChildTransaction = {
|
|
1549
|
+
txid: string;
|
|
1550
|
+
txHex: string;
|
|
1551
|
+
/**
|
|
1552
|
+
* Who created the child. Only a `Wallet` child was paid for by this
|
|
1553
|
+
* wallet, which is what fee attribution needs.
|
|
1554
|
+
*/
|
|
1555
|
+
origin: ExitTxOrigin;
|
|
1556
|
+
/**
|
|
1557
|
+
* Effective fee rate of the child and its unconfirmed ancestors, in
|
|
1558
|
+
* sat/kwu. `None` until the mempool has been queried for it.
|
|
1559
|
+
*/
|
|
1560
|
+
feeRateSatPerKwu?: bigint;
|
|
1561
|
+
/**
|
|
1562
|
+
* Fee of the child plus the fees of its unconfirmed ancestors. `None`
|
|
1563
|
+
* until the mempool has been queried for it.
|
|
1564
|
+
*/
|
|
1565
|
+
totalFeeSats?: bigint;
|
|
1566
|
+
};
|
|
1567
|
+
/**
|
|
1568
|
+
* Generated factory for {@link ExitChildTransaction} record objects.
|
|
1569
|
+
*/
|
|
1570
|
+
export declare const ExitChildTransaction: Readonly<{
|
|
1571
|
+
create: (partial: Partial<ExitChildTransaction> & Required<Omit<ExitChildTransaction, "totalFeeSats" | "feeRateSatPerKwu">>) => ExitChildTransaction;
|
|
1572
|
+
new: (partial: Partial<ExitChildTransaction> & Required<Omit<ExitChildTransaction, "totalFeeSats" | "feeRateSatPerKwu">>) => ExitChildTransaction;
|
|
1573
|
+
defaults: () => Partial<ExitChildTransaction>;
|
|
1574
|
+
}>;
|
|
1575
|
+
/**
|
|
1576
|
+
* Claim transaction for exited funds
|
|
1577
|
+
*/
|
|
1578
|
+
export type ExitClaimTransaction = {
|
|
1579
|
+
psbtBase64: string;
|
|
1580
|
+
feeSats: bigint;
|
|
1581
|
+
/**
|
|
1582
|
+
* The exits the PSBT actually spends. Link the claim transaction to
|
|
1583
|
+
* these, not to the ids you asked for.
|
|
1584
|
+
*/
|
|
1585
|
+
vtxoIds: Array<string>;
|
|
1586
|
+
/**
|
|
1587
|
+
* Requested ids that were left out because they were not claimable when
|
|
1588
|
+
* the PSBT was built. Empty when draining all claimable exits.
|
|
1589
|
+
*/
|
|
1590
|
+
skippedVtxoIds: Array<string>;
|
|
1591
|
+
};
|
|
1592
|
+
/**
|
|
1593
|
+
* Generated factory for {@link ExitClaimTransaction} record objects.
|
|
1594
|
+
*/
|
|
1595
|
+
export declare const ExitClaimTransaction: Readonly<{
|
|
1596
|
+
create: (partial: Partial<ExitClaimTransaction> & Required<Omit<ExitClaimTransaction, never>>) => ExitClaimTransaction;
|
|
1597
|
+
new: (partial: Partial<ExitClaimTransaction> & Required<Omit<ExitClaimTransaction, never>>) => ExitClaimTransaction;
|
|
1598
|
+
defaults: () => Partial<ExitClaimTransaction>;
|
|
1599
|
+
}>;
|
|
729
1600
|
export declare enum ExitTxStatus_Tags {
|
|
730
1601
|
VerifyInputs = "VerifyInputs",
|
|
731
1602
|
AwaitingInputConfirmation = "AwaitingInputConfirmation",
|
|
@@ -944,6 +1815,21 @@ export declare const ExitTx: Readonly<{
|
|
|
944
1815
|
new: (partial: Partial<ExitTx> & Required<Omit<ExitTx, never>>) => ExitTx;
|
|
945
1816
|
defaults: () => Partial<ExitTx>;
|
|
946
1817
|
}>;
|
|
1818
|
+
/**
|
|
1819
|
+
* A Bitcoin transaction outpoint (reference to a previous output)
|
|
1820
|
+
*/
|
|
1821
|
+
export type OutPoint = {
|
|
1822
|
+
txid: string;
|
|
1823
|
+
vout: number;
|
|
1824
|
+
};
|
|
1825
|
+
/**
|
|
1826
|
+
* Generated factory for {@link OutPoint} record objects.
|
|
1827
|
+
*/
|
|
1828
|
+
export declare const OutPoint: Readonly<{
|
|
1829
|
+
create: (partial: Partial<OutPoint> & Required<Omit<OutPoint, never>>) => OutPoint;
|
|
1830
|
+
new: (partial: Partial<OutPoint> & Required<Omit<OutPoint, never>>) => OutPoint;
|
|
1831
|
+
defaults: () => Partial<OutPoint>;
|
|
1832
|
+
}>;
|
|
947
1833
|
export declare enum ExitState_Tags {
|
|
948
1834
|
Start = "Start",
|
|
949
1835
|
Processing = "Processing",
|
|
@@ -952,6 +1838,7 @@ export declare enum ExitState_Tags {
|
|
|
952
1838
|
ClaimInProgress = "ClaimInProgress",
|
|
953
1839
|
Claimed = "Claimed",
|
|
954
1840
|
VtxoAlreadySpent = "VtxoAlreadySpent",
|
|
1841
|
+
VtxoSwept = "VtxoSwept",
|
|
955
1842
|
Canceled = "Canceled"
|
|
956
1843
|
}
|
|
957
1844
|
/**
|
|
@@ -959,7 +1846,8 @@ export declare enum ExitState_Tags {
|
|
|
959
1846
|
*
|
|
960
1847
|
* Serde/TS tags match upstream's kebab-case serialization (`"start"`,
|
|
961
1848
|
* `"processing"`, `"awaiting-delta"`, `"claimable"`, `"claim-in-progress"`,
|
|
962
|
-
* `"claimed"`, `"vtxo-already-spent"`, `"canceled"`), with
|
|
1849
|
+
* `"claimed"`, `"vtxo-already-spent"`, `"vtxo-swept"`, `"canceled"`), with
|
|
1850
|
+
* camelCase fields.
|
|
963
1851
|
*/
|
|
964
1852
|
export declare const ExitState: Readonly<{
|
|
965
1853
|
instanceOf: (obj: any) => obj is ExitState;
|
|
@@ -1229,11 +2117,50 @@ export declare const ExitState: Readonly<{
|
|
|
1229
2117
|
readonly [uniffiTypeNameSymbol]: "ExitState";
|
|
1230
2118
|
};
|
|
1231
2119
|
instanceOf(obj: any): obj is {
|
|
1232
|
-
readonly tag: ExitState_Tags.Claimed;
|
|
2120
|
+
readonly tag: ExitState_Tags.Claimed;
|
|
2121
|
+
readonly inner: Readonly<{
|
|
2122
|
+
tipHeight: number;
|
|
2123
|
+
txid: string;
|
|
2124
|
+
block: BlockRef;
|
|
2125
|
+
}>;
|
|
2126
|
+
/**
|
|
2127
|
+
* @private
|
|
2128
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2129
|
+
*/
|
|
2130
|
+
readonly [uniffiTypeNameSymbol]: "ExitState";
|
|
2131
|
+
};
|
|
2132
|
+
};
|
|
2133
|
+
VtxoAlreadySpent: {
|
|
2134
|
+
new (inner: {
|
|
2135
|
+
tipHeight: number;
|
|
2136
|
+
}): {
|
|
2137
|
+
readonly tag: ExitState_Tags.VtxoAlreadySpent;
|
|
2138
|
+
readonly inner: Readonly<{
|
|
2139
|
+
tipHeight: number;
|
|
2140
|
+
}>;
|
|
2141
|
+
/**
|
|
2142
|
+
* @private
|
|
2143
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2144
|
+
*/
|
|
2145
|
+
readonly [uniffiTypeNameSymbol]: "ExitState";
|
|
2146
|
+
};
|
|
2147
|
+
new(inner: {
|
|
2148
|
+
tipHeight: number;
|
|
2149
|
+
}): {
|
|
2150
|
+
readonly tag: ExitState_Tags.VtxoAlreadySpent;
|
|
2151
|
+
readonly inner: Readonly<{
|
|
2152
|
+
tipHeight: number;
|
|
2153
|
+
}>;
|
|
2154
|
+
/**
|
|
2155
|
+
* @private
|
|
2156
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2157
|
+
*/
|
|
2158
|
+
readonly [uniffiTypeNameSymbol]: "ExitState";
|
|
2159
|
+
};
|
|
2160
|
+
instanceOf(obj: any): obj is {
|
|
2161
|
+
readonly tag: ExitState_Tags.VtxoAlreadySpent;
|
|
1233
2162
|
readonly inner: Readonly<{
|
|
1234
2163
|
tipHeight: number;
|
|
1235
|
-
txid: string;
|
|
1236
|
-
block: BlockRef;
|
|
1237
2164
|
}>;
|
|
1238
2165
|
/**
|
|
1239
2166
|
* @private
|
|
@@ -1242,13 +2169,15 @@ export declare const ExitState: Readonly<{
|
|
|
1242
2169
|
readonly [uniffiTypeNameSymbol]: "ExitState";
|
|
1243
2170
|
};
|
|
1244
2171
|
};
|
|
1245
|
-
|
|
2172
|
+
VtxoSwept: {
|
|
1246
2173
|
new (inner: {
|
|
1247
2174
|
tipHeight: number;
|
|
2175
|
+
spentInputs: Array<OutPoint>;
|
|
1248
2176
|
}): {
|
|
1249
|
-
readonly tag: ExitState_Tags.
|
|
2177
|
+
readonly tag: ExitState_Tags.VtxoSwept;
|
|
1250
2178
|
readonly inner: Readonly<{
|
|
1251
2179
|
tipHeight: number;
|
|
2180
|
+
spentInputs: Array<OutPoint>;
|
|
1252
2181
|
}>;
|
|
1253
2182
|
/**
|
|
1254
2183
|
* @private
|
|
@@ -1258,10 +2187,12 @@ export declare const ExitState: Readonly<{
|
|
|
1258
2187
|
};
|
|
1259
2188
|
new(inner: {
|
|
1260
2189
|
tipHeight: number;
|
|
2190
|
+
spentInputs: Array<OutPoint>;
|
|
1261
2191
|
}): {
|
|
1262
|
-
readonly tag: ExitState_Tags.
|
|
2192
|
+
readonly tag: ExitState_Tags.VtxoSwept;
|
|
1263
2193
|
readonly inner: Readonly<{
|
|
1264
2194
|
tipHeight: number;
|
|
2195
|
+
spentInputs: Array<OutPoint>;
|
|
1265
2196
|
}>;
|
|
1266
2197
|
/**
|
|
1267
2198
|
* @private
|
|
@@ -1270,9 +2201,10 @@ export declare const ExitState: Readonly<{
|
|
|
1270
2201
|
readonly [uniffiTypeNameSymbol]: "ExitState";
|
|
1271
2202
|
};
|
|
1272
2203
|
instanceOf(obj: any): obj is {
|
|
1273
|
-
readonly tag: ExitState_Tags.
|
|
2204
|
+
readonly tag: ExitState_Tags.VtxoSwept;
|
|
1274
2205
|
readonly inner: Readonly<{
|
|
1275
2206
|
tipHeight: number;
|
|
2207
|
+
spentInputs: Array<OutPoint>;
|
|
1276
2208
|
}>;
|
|
1277
2209
|
/**
|
|
1278
2210
|
* @private
|
|
@@ -1326,9 +2258,10 @@ export declare const ExitState: Readonly<{
|
|
|
1326
2258
|
*
|
|
1327
2259
|
* Serde/TS tags match upstream's kebab-case serialization (`"start"`,
|
|
1328
2260
|
* `"processing"`, `"awaiting-delta"`, `"claimable"`, `"claim-in-progress"`,
|
|
1329
|
-
* `"claimed"`, `"vtxo-already-spent"`, `"canceled"`), with
|
|
2261
|
+
* `"claimed"`, `"vtxo-already-spent"`, `"vtxo-swept"`, `"canceled"`), with
|
|
2262
|
+
* camelCase fields.
|
|
1330
2263
|
*/
|
|
1331
|
-
export type ExitState = InstanceType<(typeof ExitState)["Start" | "Processing" | "AwaitingDelta" | "Claimable" | "ClaimInProgress" | "Claimed" | "VtxoAlreadySpent" | "Canceled"]>;
|
|
2264
|
+
export type ExitState = InstanceType<(typeof ExitState)["Start" | "Processing" | "AwaitingDelta" | "Claimable" | "ClaimInProgress" | "Claimed" | "VtxoAlreadySpent" | "VtxoSwept" | "Canceled"]>;
|
|
1332
2265
|
/**
|
|
1333
2266
|
* Status of an exit progression
|
|
1334
2267
|
*/
|
|
@@ -1345,14 +2278,43 @@ export declare const ExitProgressStatus: Readonly<{
|
|
|
1345
2278
|
new: (partial: Partial<ExitProgressStatus> & Required<Omit<ExitProgressStatus, "error">>) => ExitProgressStatus;
|
|
1346
2279
|
defaults: () => Partial<ExitProgressStatus>;
|
|
1347
2280
|
}>;
|
|
2281
|
+
/**
|
|
2282
|
+
* One transaction of an exit: the exit transaction itself and, once it was
|
|
2283
|
+
* fee-bumped, the child that confirms it. A unilateral exit is a chain of
|
|
2284
|
+
* these, root first.
|
|
2285
|
+
*/
|
|
2286
|
+
export type ExitTransactionPackage = {
|
|
2287
|
+
exitTxid: string;
|
|
2288
|
+
exitTxHex: string;
|
|
2289
|
+
child?: ExitChildTransaction;
|
|
2290
|
+
};
|
|
2291
|
+
/**
|
|
2292
|
+
* Generated factory for {@link ExitTransactionPackage} record objects.
|
|
2293
|
+
*/
|
|
2294
|
+
export declare const ExitTransactionPackage: Readonly<{
|
|
2295
|
+
create: (partial: Partial<ExitTransactionPackage> & Required<Omit<ExitTransactionPackage, "child">>) => ExitTransactionPackage;
|
|
2296
|
+
new: (partial: Partial<ExitTransactionPackage> & Required<Omit<ExitTransactionPackage, "child">>) => ExitTransactionPackage;
|
|
2297
|
+
defaults: () => Partial<ExitTransactionPackage>;
|
|
2298
|
+
}>;
|
|
1348
2299
|
/**
|
|
1349
2300
|
* Detailed status of an exit transaction
|
|
2301
|
+
*
|
|
2302
|
+
* Returned for live and finished exits alike by `get_exit_status`,
|
|
2303
|
+
* `list_all_exits`, `list_live_exits` and `list_finished_exits`.
|
|
1350
2304
|
*/
|
|
1351
2305
|
export type ExitTransactionStatus = {
|
|
1352
2306
|
vtxoId: string;
|
|
1353
2307
|
state: ExitState;
|
|
1354
2308
|
history?: Array<ExitState>;
|
|
2309
|
+
/**
|
|
2310
|
+
* Same as `transactions.len()`. Kept for callers that only want the count.
|
|
2311
|
+
*/
|
|
1355
2312
|
transactionCount: number;
|
|
2313
|
+
/**
|
|
2314
|
+
* The exit transaction chain, root first. Empty unless the status was
|
|
2315
|
+
* requested with `include_transactions`.
|
|
2316
|
+
*/
|
|
2317
|
+
transactions: Array<ExitTransactionPackage>;
|
|
1356
2318
|
};
|
|
1357
2319
|
/**
|
|
1358
2320
|
* Generated factory for {@link ExitTransactionStatus} record objects.
|
|
@@ -1450,19 +2412,6 @@ export declare const ImportVtxoArgs: Readonly<{
|
|
|
1450
2412
|
new: (partial: Partial<ImportVtxoArgs> & Required<Omit<ImportVtxoArgs, "gapLimit" | "skipStatusCheck" | "allowPartial">>) => ImportVtxoArgs;
|
|
1451
2413
|
defaults: () => Partial<ImportVtxoArgs>;
|
|
1452
2414
|
}>;
|
|
1453
|
-
export type LightningInvoice = {
|
|
1454
|
-
invoice: string;
|
|
1455
|
-
paymentHash: string;
|
|
1456
|
-
amountSats: bigint;
|
|
1457
|
-
};
|
|
1458
|
-
/**
|
|
1459
|
-
* Generated factory for {@link LightningInvoice} record objects.
|
|
1460
|
-
*/
|
|
1461
|
-
export declare const LightningInvoice: Readonly<{
|
|
1462
|
-
create: (partial: Partial<LightningInvoice> & Required<Omit<LightningInvoice, never>>) => LightningInvoice;
|
|
1463
|
-
new: (partial: Partial<LightningInvoice> & Required<Omit<LightningInvoice, never>>) => LightningInvoice;
|
|
1464
|
-
defaults: () => Partial<LightningInvoice>;
|
|
1465
|
-
}>;
|
|
1466
2415
|
export type LightningReceive = {
|
|
1467
2416
|
paymentHash: string;
|
|
1468
2417
|
invoice: string;
|
|
@@ -1502,6 +2451,16 @@ export declare const LightningReceive: Readonly<{
|
|
|
1502
2451
|
}>;
|
|
1503
2452
|
export type LightningSend = {
|
|
1504
2453
|
invoice: string;
|
|
2454
|
+
/**
|
|
2455
|
+
* Payment hash of the invoice being paid. Poll `lightning_send_state`
|
|
2456
|
+
* with it; for BOLT12 there is no invoice string to parse it from.
|
|
2457
|
+
*/
|
|
2458
|
+
paymentHash: string;
|
|
2459
|
+
/**
|
|
2460
|
+
* Id of the `Movement` that records this send. `None` only for sends
|
|
2461
|
+
* checkpointed by a bark version that predates the field.
|
|
2462
|
+
*/
|
|
2463
|
+
movementId?: number;
|
|
1505
2464
|
/**
|
|
1506
2465
|
* Amount being paid, in sats (`payment_amount`).
|
|
1507
2466
|
*/
|
|
@@ -1524,8 +2483,8 @@ export type LightningSend = {
|
|
|
1524
2483
|
* Generated factory for {@link LightningSend} record objects.
|
|
1525
2484
|
*/
|
|
1526
2485
|
export declare const LightningSend: Readonly<{
|
|
1527
|
-
create: (partial: Partial<LightningSend> & Required<Omit<LightningSend,
|
|
1528
|
-
new: (partial: Partial<LightningSend> & Required<Omit<LightningSend,
|
|
2486
|
+
create: (partial: Partial<LightningSend> & Required<Omit<LightningSend, "movementId">>) => LightningSend;
|
|
2487
|
+
new: (partial: Partial<LightningSend> & Required<Omit<LightningSend, "movementId">>) => LightningSend;
|
|
1529
2488
|
defaults: () => Partial<LightningSend>;
|
|
1530
2489
|
}>;
|
|
1531
2490
|
export type Movement = {
|
|
@@ -1553,12 +2512,23 @@ export type Movement = {
|
|
|
1553
2512
|
* Generated factory for {@link Movement} record objects.
|
|
1554
2513
|
*/
|
|
1555
2514
|
export declare const Movement: Readonly<{
|
|
1556
|
-
create: (partial: Partial<Movement> & Required<Omit<Movement, "paymentHash" | "
|
|
1557
|
-
new: (partial: Partial<Movement> & Required<Omit<Movement, "paymentHash" | "
|
|
2515
|
+
create: (partial: Partial<Movement> & Required<Omit<Movement, "paymentHash" | "lightningInvoice" | "completedAt" | "lightningOffer">>) => Movement;
|
|
2516
|
+
new: (partial: Partial<Movement> & Required<Omit<Movement, "paymentHash" | "lightningInvoice" | "completedAt" | "lightningOffer">>) => Movement;
|
|
1558
2517
|
defaults: () => Partial<Movement>;
|
|
1559
2518
|
}>;
|
|
2519
|
+
/**
|
|
2520
|
+
* What `offboard_all`, `offboard_vtxos` and `send_onchain` broadcast,
|
|
2521
|
+
* mirroring `bark::OffboardResult`.
|
|
2522
|
+
*/
|
|
1560
2523
|
export type OffboardResult = {
|
|
2524
|
+
/**
|
|
2525
|
+
* The offboard transaction the server built and bark broadcast.
|
|
2526
|
+
*/
|
|
1561
2527
|
txid: string;
|
|
2528
|
+
/**
|
|
2529
|
+
* The movement that records this offboard.
|
|
2530
|
+
*/
|
|
2531
|
+
movementId: number;
|
|
1562
2532
|
};
|
|
1563
2533
|
/**
|
|
1564
2534
|
* Generated factory for {@link OffboardResult} record objects.
|
|
@@ -1582,24 +2552,43 @@ export declare const OnchainBalance: Readonly<{
|
|
|
1582
2552
|
defaults: () => Partial<OnchainBalance>;
|
|
1583
2553
|
}>;
|
|
1584
2554
|
/**
|
|
1585
|
-
* A
|
|
2555
|
+
* A parsed payment string, mirroring `bark::PaymentRequest`.
|
|
2556
|
+
*
|
|
2557
|
+
* `label` and `message` come from a BIP 321 URI. For a bare BOLT11 invoice
|
|
2558
|
+
* or BOLT12 offer, `amount_sats` is its amount and `message` its
|
|
2559
|
+
* description.
|
|
1586
2560
|
*/
|
|
1587
|
-
export type
|
|
1588
|
-
|
|
1589
|
-
|
|
2561
|
+
export type PaymentRequest = {
|
|
2562
|
+
amountSats?: bigint;
|
|
2563
|
+
label?: string;
|
|
2564
|
+
message?: string;
|
|
2565
|
+
/**
|
|
2566
|
+
* Every destination found, in the order bark parsed them.
|
|
2567
|
+
*/
|
|
2568
|
+
options: Array<AvailablePaymentMethod>;
|
|
2569
|
+
/**
|
|
2570
|
+
* The option to pay when the user doesn't pick one: Ark, then
|
|
2571
|
+
* lightning, then onchain, skipping options with errors. `None` when
|
|
2572
|
+
* every option has errors.
|
|
2573
|
+
*/
|
|
2574
|
+
defaultOption?: AvailablePaymentMethod;
|
|
1590
2575
|
};
|
|
1591
2576
|
/**
|
|
1592
|
-
* Generated factory for {@link
|
|
2577
|
+
* Generated factory for {@link PaymentRequest} record objects.
|
|
1593
2578
|
*/
|
|
1594
|
-
export declare const
|
|
1595
|
-
create: (partial: Partial<
|
|
1596
|
-
new: (partial: Partial<
|
|
1597
|
-
defaults: () => Partial<
|
|
2579
|
+
export declare const PaymentRequest: Readonly<{
|
|
2580
|
+
create: (partial: Partial<PaymentRequest> & Required<Omit<PaymentRequest, "amountSats" | "label" | "message" | "defaultOption">>) => PaymentRequest;
|
|
2581
|
+
new: (partial: Partial<PaymentRequest> & Required<Omit<PaymentRequest, "amountSats" | "label" | "message" | "defaultOption">>) => PaymentRequest;
|
|
2582
|
+
defaults: () => Partial<PaymentRequest>;
|
|
1598
2583
|
}>;
|
|
1599
2584
|
export type PendingBoard = {
|
|
1600
2585
|
vtxoId: string;
|
|
1601
2586
|
amountSats: bigint;
|
|
1602
2587
|
txid: string;
|
|
2588
|
+
/**
|
|
2589
|
+
* Id of the `Movement` that records this board.
|
|
2590
|
+
*/
|
|
2591
|
+
movementId: number;
|
|
1603
2592
|
};
|
|
1604
2593
|
/**
|
|
1605
2594
|
* Generated factory for {@link PendingBoard} record objects.
|
|
@@ -2607,6 +3596,143 @@ export declare enum LogLevel {
|
|
|
2607
3596
|
Debug = 3,
|
|
2608
3597
|
Trace = 4
|
|
2609
3598
|
}
|
|
3599
|
+
export declare enum PaymentResult_Tags {
|
|
3600
|
+
Onchain = "Onchain",
|
|
3601
|
+
Lightning = "Lightning",
|
|
3602
|
+
Ark = "Ark"
|
|
3603
|
+
}
|
|
3604
|
+
/**
|
|
3605
|
+
* Outcome of `Wallet::send_payment`, mirroring `bark::PaymentInitOutput`.
|
|
3606
|
+
*/
|
|
3607
|
+
export declare const PaymentResult: Readonly<{
|
|
3608
|
+
instanceOf: (obj: any) => obj is PaymentResult;
|
|
3609
|
+
Onchain: {
|
|
3610
|
+
new (inner: {
|
|
3611
|
+
txid: string;
|
|
3612
|
+
}): {
|
|
3613
|
+
readonly tag: PaymentResult_Tags.Onchain;
|
|
3614
|
+
readonly inner: Readonly<{
|
|
3615
|
+
txid: string;
|
|
3616
|
+
}>;
|
|
3617
|
+
/**
|
|
3618
|
+
* @private
|
|
3619
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3620
|
+
*/
|
|
3621
|
+
readonly [uniffiTypeNameSymbol]: "PaymentResult";
|
|
3622
|
+
};
|
|
3623
|
+
new(inner: {
|
|
3624
|
+
txid: string;
|
|
3625
|
+
}): {
|
|
3626
|
+
readonly tag: PaymentResult_Tags.Onchain;
|
|
3627
|
+
readonly inner: Readonly<{
|
|
3628
|
+
txid: string;
|
|
3629
|
+
}>;
|
|
3630
|
+
/**
|
|
3631
|
+
* @private
|
|
3632
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3633
|
+
*/
|
|
3634
|
+
readonly [uniffiTypeNameSymbol]: "PaymentResult";
|
|
3635
|
+
};
|
|
3636
|
+
instanceOf(obj: any): obj is {
|
|
3637
|
+
readonly tag: PaymentResult_Tags.Onchain;
|
|
3638
|
+
readonly inner: Readonly<{
|
|
3639
|
+
txid: string;
|
|
3640
|
+
}>;
|
|
3641
|
+
/**
|
|
3642
|
+
* @private
|
|
3643
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3644
|
+
*/
|
|
3645
|
+
readonly [uniffiTypeNameSymbol]: "PaymentResult";
|
|
3646
|
+
};
|
|
3647
|
+
};
|
|
3648
|
+
Lightning: {
|
|
3649
|
+
new (inner: {
|
|
3650
|
+
invoice: string;
|
|
3651
|
+
paymentHash: string;
|
|
3652
|
+
}): {
|
|
3653
|
+
readonly tag: PaymentResult_Tags.Lightning;
|
|
3654
|
+
readonly inner: Readonly<{
|
|
3655
|
+
invoice: string;
|
|
3656
|
+
paymentHash: string;
|
|
3657
|
+
}>;
|
|
3658
|
+
/**
|
|
3659
|
+
* @private
|
|
3660
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3661
|
+
*/
|
|
3662
|
+
readonly [uniffiTypeNameSymbol]: "PaymentResult";
|
|
3663
|
+
};
|
|
3664
|
+
new(inner: {
|
|
3665
|
+
invoice: string;
|
|
3666
|
+
paymentHash: string;
|
|
3667
|
+
}): {
|
|
3668
|
+
readonly tag: PaymentResult_Tags.Lightning;
|
|
3669
|
+
readonly inner: Readonly<{
|
|
3670
|
+
invoice: string;
|
|
3671
|
+
paymentHash: string;
|
|
3672
|
+
}>;
|
|
3673
|
+
/**
|
|
3674
|
+
* @private
|
|
3675
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3676
|
+
*/
|
|
3677
|
+
readonly [uniffiTypeNameSymbol]: "PaymentResult";
|
|
3678
|
+
};
|
|
3679
|
+
instanceOf(obj: any): obj is {
|
|
3680
|
+
readonly tag: PaymentResult_Tags.Lightning;
|
|
3681
|
+
readonly inner: Readonly<{
|
|
3682
|
+
invoice: string;
|
|
3683
|
+
paymentHash: string;
|
|
3684
|
+
}>;
|
|
3685
|
+
/**
|
|
3686
|
+
* @private
|
|
3687
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3688
|
+
*/
|
|
3689
|
+
readonly [uniffiTypeNameSymbol]: "PaymentResult";
|
|
3690
|
+
};
|
|
3691
|
+
};
|
|
3692
|
+
Ark: {
|
|
3693
|
+
new (inner: {
|
|
3694
|
+
movementId: number;
|
|
3695
|
+
}): {
|
|
3696
|
+
readonly tag: PaymentResult_Tags.Ark;
|
|
3697
|
+
readonly inner: Readonly<{
|
|
3698
|
+
movementId: number;
|
|
3699
|
+
}>;
|
|
3700
|
+
/**
|
|
3701
|
+
* @private
|
|
3702
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3703
|
+
*/
|
|
3704
|
+
readonly [uniffiTypeNameSymbol]: "PaymentResult";
|
|
3705
|
+
};
|
|
3706
|
+
new(inner: {
|
|
3707
|
+
movementId: number;
|
|
3708
|
+
}): {
|
|
3709
|
+
readonly tag: PaymentResult_Tags.Ark;
|
|
3710
|
+
readonly inner: Readonly<{
|
|
3711
|
+
movementId: number;
|
|
3712
|
+
}>;
|
|
3713
|
+
/**
|
|
3714
|
+
* @private
|
|
3715
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3716
|
+
*/
|
|
3717
|
+
readonly [uniffiTypeNameSymbol]: "PaymentResult";
|
|
3718
|
+
};
|
|
3719
|
+
instanceOf(obj: any): obj is {
|
|
3720
|
+
readonly tag: PaymentResult_Tags.Ark;
|
|
3721
|
+
readonly inner: Readonly<{
|
|
3722
|
+
movementId: number;
|
|
3723
|
+
}>;
|
|
3724
|
+
/**
|
|
3725
|
+
* @private
|
|
3726
|
+
* This field is private and should not be used, use `tag` instead.
|
|
3727
|
+
*/
|
|
3728
|
+
readonly [uniffiTypeNameSymbol]: "PaymentResult";
|
|
3729
|
+
};
|
|
3730
|
+
};
|
|
3731
|
+
}>;
|
|
3732
|
+
/**
|
|
3733
|
+
* Outcome of `Wallet::send_payment`, mirroring `bark::PaymentInitOutput`.
|
|
3734
|
+
*/
|
|
3735
|
+
export type PaymentResult = InstanceType<(typeof PaymentResult)["Onchain" | "Lightning" | "Ark"]>;
|
|
2610
3736
|
export declare enum RecoveryStatus_Tags {
|
|
2611
3737
|
NotRun = "NotRun",
|
|
2612
3738
|
Failed = "Failed",
|
|
@@ -2925,7 +4051,11 @@ export interface CustomOnchainWalletCallbacks {
|
|
|
2925
4051
|
*/
|
|
2926
4052
|
prepareDrainTx(address: string, feeRateSatPerVb: bigint): string;
|
|
2927
4053
|
/**
|
|
2928
|
-
* Sign and finalize a PSBT
|
|
4054
|
+
* Sign and finalize a PSBT, without recording the transaction
|
|
4055
|
+
*
|
|
4056
|
+
* The wallet must not treat the transaction as spent yet: a board that
|
|
4057
|
+
* fails after signing has to leave the wallet untouched. Once the
|
|
4058
|
+
* transaction is broadcast, Bark reports it through `register_tx`.
|
|
2929
4059
|
*
|
|
2930
4060
|
* # Arguments
|
|
2931
4061
|
* * `psbt_base64` - Base64-encoded PSBT
|
|
@@ -2934,7 +4064,7 @@ export interface CustomOnchainWalletCallbacks {
|
|
|
2934
4064
|
* Base64-encoded fully signed PSBT (all witnesses filled in). Rejected
|
|
2935
4065
|
* unless the unsigned transaction is unchanged.
|
|
2936
4066
|
*/
|
|
2937
|
-
|
|
4067
|
+
signPsbt(psbtBase64: string): string;
|
|
2938
4068
|
/**
|
|
2939
4069
|
* Whether a script pubkey belongs to the wallet's keychains
|
|
2940
4070
|
*
|
|
@@ -3029,7 +4159,11 @@ export declare class CustomOnchainWalletCallbacksImpl extends UniffiAbstractObje
|
|
|
3029
4159
|
*/
|
|
3030
4160
|
prepareDrainTx(address: string, feeRateSatPerVb: bigint): string;
|
|
3031
4161
|
/**
|
|
3032
|
-
* Sign and finalize a PSBT
|
|
4162
|
+
* Sign and finalize a PSBT, without recording the transaction
|
|
4163
|
+
*
|
|
4164
|
+
* The wallet must not treat the transaction as spent yet: a board that
|
|
4165
|
+
* fails after signing has to leave the wallet untouched. Once the
|
|
4166
|
+
* transaction is broadcast, Bark reports it through `register_tx`.
|
|
3033
4167
|
*
|
|
3034
4168
|
* # Arguments
|
|
3035
4169
|
* * `psbt_base64` - Base64-encoded PSBT
|
|
@@ -3038,7 +4172,7 @@ export declare class CustomOnchainWalletCallbacksImpl extends UniffiAbstractObje
|
|
|
3038
4172
|
* Base64-encoded fully signed PSBT (all witnesses filled in). Rejected
|
|
3039
4173
|
* unless the unsigned transaction is unchanged.
|
|
3040
4174
|
*/
|
|
3041
|
-
|
|
4175
|
+
signPsbt(psbtBase64: string): string;
|
|
3042
4176
|
/**
|
|
3043
4177
|
* Whether a script pubkey belongs to the wallet's keychains
|
|
3044
4178
|
*
|
|
@@ -3227,6 +4361,21 @@ export interface WalletLike {
|
|
|
3227
4361
|
balance(asyncOpts_?: {
|
|
3228
4362
|
signal: AbortSignal;
|
|
3229
4363
|
}): Promise<Balance>;
|
|
4364
|
+
/**
|
|
4365
|
+
* The numbers to show a user, without the breakdown of `balance`: what
|
|
4366
|
+
* they can spend, what needs a refresh, what is pending and the total.
|
|
4367
|
+
*/
|
|
4368
|
+
balanceSummary(asyncOpts_?: {
|
|
4369
|
+
signal: AbortSignal;
|
|
4370
|
+
}): Promise<BalanceSummary>;
|
|
4371
|
+
/**
|
|
4372
|
+
* Build a BIP 321 `bitcoin:` URI with a new Ark address, a new BOLT11
|
|
4373
|
+
* invoice (when there is an amount) and the caller's onchain address,
|
|
4374
|
+
* as `options` selects.
|
|
4375
|
+
*/
|
|
4376
|
+
bip321Uri(options: Bip321UriOptions, asyncOpts_?: {
|
|
4377
|
+
signal: AbortSignal;
|
|
4378
|
+
}): Promise<Bip321Uri>;
|
|
3230
4379
|
boardAll(asyncOpts_?: {
|
|
3231
4380
|
signal: AbortSignal;
|
|
3232
4381
|
}): Promise<PendingBoard>;
|
|
@@ -3292,6 +4441,13 @@ export interface WalletLike {
|
|
|
3292
4441
|
config(asyncOpts_?: {
|
|
3293
4442
|
signal: AbortSignal;
|
|
3294
4443
|
}): Promise<Config>;
|
|
4444
|
+
/**
|
|
4445
|
+
* The network, mailbox id and VTXO xpub, as `bark debug-info` prints
|
|
4446
|
+
* them. Users can share this in support requests.
|
|
4447
|
+
*/
|
|
4448
|
+
debugInfo(asyncOpts_?: {
|
|
4449
|
+
signal: AbortSignal;
|
|
4450
|
+
}): Promise<DebugInfo>;
|
|
3295
4451
|
/**
|
|
3296
4452
|
* Build a PSBT claiming exited VTXOs to `address`.
|
|
3297
4453
|
*
|
|
@@ -3316,13 +4472,14 @@ export interface WalletLike {
|
|
|
3316
4472
|
* spendable VTXO). `fee_rate_sat_per_vb` applies to both legs; omit it to
|
|
3317
4473
|
* use the chain's fast rate for the broadcast leg and regular rate for
|
|
3318
4474
|
* the claim leg. `destination` only affects the claim transaction's weight.
|
|
4475
|
+
* `fee_margin` scales the broadcast leg (finite and non-negative; default
|
|
4476
|
+
* 1.2).
|
|
3319
4477
|
*
|
|
3320
|
-
* The
|
|
3321
|
-
*
|
|
3322
|
-
*
|
|
3323
|
-
* and return an error.
|
|
4478
|
+
* The estimate never reads the onchain wallet, so it works before the
|
|
4479
|
+
* wallet holds funds and with callback wallets
|
|
4480
|
+
* (`CustomOnchainWalletCallbacks`) too.
|
|
3324
4481
|
*/
|
|
3325
|
-
estimateEmergencyExitFee(vtxoIds: Array<string>, feeRateSatPerVb: bigint | undefined, destination: string | undefined, asyncOpts_?: {
|
|
4482
|
+
estimateEmergencyExitFee(vtxoIds: Array<string>, feeRateSatPerVb: bigint | undefined, destination: string | undefined, feeMargin: number | undefined, asyncOpts_?: {
|
|
3326
4483
|
signal: AbortSignal;
|
|
3327
4484
|
}): Promise<EmergencyExitFeeEstimate>;
|
|
3328
4485
|
estimateLightningReceiveFee(amountSats: bigint, asyncOpts_?: {
|
|
@@ -3337,6 +4494,12 @@ export interface WalletLike {
|
|
|
3337
4494
|
estimateOffboardFee(address: string, vtxoIds: Array<string>, asyncOpts_?: {
|
|
3338
4495
|
signal: AbortSignal;
|
|
3339
4496
|
}): Promise<FeeEstimate>;
|
|
4497
|
+
/**
|
|
4498
|
+
* Estimate the fee of paying `amount_sats` to `method`.
|
|
4499
|
+
*/
|
|
4500
|
+
estimatePaymentFee(method: PaymentMethod, amountSats: bigint, asyncOpts_?: {
|
|
4501
|
+
signal: AbortSignal;
|
|
4502
|
+
}): Promise<FeeEstimate>;
|
|
3340
4503
|
estimateRefreshFee(vtxoIds: Array<string>, asyncOpts_?: {
|
|
3341
4504
|
signal: AbortSignal;
|
|
3342
4505
|
}): Promise<FeeEstimate>;
|
|
@@ -3344,9 +4507,17 @@ export interface WalletLike {
|
|
|
3344
4507
|
signal: AbortSignal;
|
|
3345
4508
|
}): Promise<FeeEstimate>;
|
|
3346
4509
|
fingerprint(): string;
|
|
4510
|
+
/**
|
|
4511
|
+
* Status of one exit, live or finished. `None` if no exit was ever
|
|
4512
|
+
* started for the VTXO.
|
|
4513
|
+
*/
|
|
3347
4514
|
getExitStatus(vtxoId: string, includeHistory: boolean, includeTransactions: boolean, asyncOpts_?: {
|
|
3348
4515
|
signal: AbortSignal;
|
|
3349
4516
|
}): Promise<ExitTransactionStatus | undefined>;
|
|
4517
|
+
/**
|
|
4518
|
+
* Live exits only. Finished exits leave this list; see
|
|
4519
|
+
* `list_finished_exits` and `get_exit_status`.
|
|
4520
|
+
*/
|
|
3350
4521
|
getExitVtxos(asyncOpts_?: {
|
|
3351
4522
|
signal: AbortSignal;
|
|
3352
4523
|
}): Promise<Array<ExitVtxo>>;
|
|
@@ -3422,9 +4593,29 @@ export interface WalletLike {
|
|
|
3422
4593
|
lightningSendState(paymentHash: string, asyncOpts_?: {
|
|
3423
4594
|
signal: AbortSignal;
|
|
3424
4595
|
}): Promise<LightningSendStatus>;
|
|
4596
|
+
/**
|
|
4597
|
+
* Status of every exit this wallet ever started, live and finished.
|
|
4598
|
+
*/
|
|
4599
|
+
listAllExits(includeHistory: boolean, includeTransactions: boolean, asyncOpts_?: {
|
|
4600
|
+
signal: AbortSignal;
|
|
4601
|
+
}): Promise<Array<ExitTransactionStatus>>;
|
|
3425
4602
|
listClaimableExits(asyncOpts_?: {
|
|
3426
4603
|
signal: AbortSignal;
|
|
3427
4604
|
}): Promise<Array<ExitVtxo>>;
|
|
4605
|
+
/**
|
|
4606
|
+
* Status of the exits in a terminal state: claimed, canceled, or aborted
|
|
4607
|
+
* because the VTXO was already spent or swept. They stay queryable after
|
|
4608
|
+
* completion, so a client need not snapshot them at drain time.
|
|
4609
|
+
*/
|
|
4610
|
+
listFinishedExits(includeHistory: boolean, includeTransactions: boolean, asyncOpts_?: {
|
|
4611
|
+
signal: AbortSignal;
|
|
4612
|
+
}): Promise<Array<ExitTransactionStatus>>;
|
|
4613
|
+
/**
|
|
4614
|
+
* Status of the exits that are still progressing.
|
|
4615
|
+
*/
|
|
4616
|
+
listLiveExits(includeHistory: boolean, includeTransactions: boolean, asyncOpts_?: {
|
|
4617
|
+
signal: AbortSignal;
|
|
4618
|
+
}): Promise<Array<ExitTransactionStatus>>;
|
|
3428
4619
|
/**
|
|
3429
4620
|
* Reserve VTXOs so wallet-driven flows leave them alone: a locked VTXO is
|
|
3430
4621
|
* excluded from coin selection.
|
|
@@ -3472,16 +4663,38 @@ export interface WalletLike {
|
|
|
3472
4663
|
offboardVtxos(vtxoIds: Array<string>, bitcoinAddress: string, asyncOpts_?: {
|
|
3473
4664
|
signal: AbortSignal;
|
|
3474
4665
|
}): Promise<OffboardResult>;
|
|
4666
|
+
/**
|
|
4667
|
+
* Parse any payment string bark understands: a BIP 321 `bitcoin:` URI, a
|
|
4668
|
+
* `lightning:` URI (any case), a BOLT11 invoice, a BOLT12 offer, a
|
|
4669
|
+
* lightning address, an LNURL-pay link or LUD-17 `lnurlp://` URI, an Ark
|
|
4670
|
+
* address, a bitcoin address or a hex output script. Surrounding
|
|
4671
|
+
* whitespace is not trimmed.
|
|
4672
|
+
*
|
|
4673
|
+
* Problems with a single option (wrong network, an Ark address of
|
|
4674
|
+
* another server, an amount mismatch) are reported in that option's
|
|
4675
|
+
* `errors`. Errors only when nothing in the string can be paid at all.
|
|
4676
|
+
* Checking an Ark address needs a server connection.
|
|
4677
|
+
*/
|
|
4678
|
+
parsePaymentRequest(payment: string, asyncOpts_?: {
|
|
4679
|
+
signal: AbortSignal;
|
|
4680
|
+
}): Promise<PaymentRequest>;
|
|
3475
4681
|
/**
|
|
3476
4682
|
* Pay to a Lightning Address (`user@domain`), resolved via LNURL-pay.
|
|
3477
4683
|
*/
|
|
3478
|
-
payLightningAddress(lightningAddress: string, amountSats: bigint, comment: string | undefined, wait: boolean, asyncOpts_?: {
|
|
4684
|
+
payLightningAddress(lightningAddress: string, amountSats: bigint, comment: string | undefined, wait: boolean, retryForSecs: bigint | undefined, asyncOpts_?: {
|
|
3479
4685
|
signal: AbortSignal;
|
|
3480
4686
|
}): Promise<LightningSendStatus>;
|
|
3481
|
-
|
|
4687
|
+
/**
|
|
4688
|
+
* Pay a BOLT11 invoice.
|
|
4689
|
+
*
|
|
4690
|
+
* `retry_for_secs` is how long the Ark server keeps trying to pay,
|
|
4691
|
+
* capped to the server's maximum; `None` leaves it to the server and 0
|
|
4692
|
+
* makes a single attempt. The same holds for every `pay_*` method.
|
|
4693
|
+
*/
|
|
4694
|
+
payLightningInvoice(invoice: string, amountSats: bigint | undefined, wait: boolean, retryForSecs: bigint | undefined, asyncOpts_?: {
|
|
3482
4695
|
signal: AbortSignal;
|
|
3483
4696
|
}): Promise<LightningSendStatus>;
|
|
3484
|
-
payLightningOffer(offer: string, amountSats: bigint | undefined, wait: boolean, asyncOpts_?: {
|
|
4697
|
+
payLightningOffer(offer: string, amountSats: bigint | undefined, wait: boolean, retryForSecs: bigint | undefined, asyncOpts_?: {
|
|
3485
4698
|
signal: AbortSignal;
|
|
3486
4699
|
}): Promise<LightningSendStatus>;
|
|
3487
4700
|
/**
|
|
@@ -3490,7 +4703,7 @@ export interface WalletLike {
|
|
|
3490
4703
|
* Resolves the LNURL-pay endpoint to a BOLT11 invoice and pays it. Errors
|
|
3491
4704
|
* if the link decodes to a non-pay LNURL (auth, withdraw, channel).
|
|
3492
4705
|
*/
|
|
3493
|
-
payLnurl(lnurl: string, amountSats: bigint, comment: string | undefined, wait: boolean, asyncOpts_?: {
|
|
4706
|
+
payLnurl(lnurl: string, amountSats: bigint, comment: string | undefined, wait: boolean, retryForSecs: bigint | undefined, asyncOpts_?: {
|
|
3494
4707
|
signal: AbortSignal;
|
|
3495
4708
|
}): Promise<LightningSendStatus>;
|
|
3496
4709
|
peekAddress(index: number, asyncOpts_?: {
|
|
@@ -3589,13 +4802,32 @@ export interface WalletLike {
|
|
|
3589
4802
|
*
|
|
3590
4803
|
* An address this bark cannot deliver to (see `validateArkoorAddress`) is
|
|
3591
4804
|
* rejected up front, leaving the VTXOs spendable rather than cosigned.
|
|
4805
|
+
*
|
|
4806
|
+
* Returns the id of the movement that records the payment.
|
|
3592
4807
|
*/
|
|
3593
4808
|
sendArkoorPayment(arkAddress: string, amountSats: bigint, asyncOpts_?: {
|
|
3594
4809
|
signal: AbortSignal;
|
|
3595
|
-
}): Promise<
|
|
4810
|
+
}): Promise<number>;
|
|
4811
|
+
/**
|
|
4812
|
+
* Send `amount_sats` from the offchain balance to an onchain address,
|
|
4813
|
+
* as an offboard. Returns the offboard txid and its movement id.
|
|
4814
|
+
*/
|
|
3596
4815
|
sendOnchain(address: string, amountSats: bigint, asyncOpts_?: {
|
|
3597
4816
|
signal: AbortSignal;
|
|
3598
|
-
}): Promise<
|
|
4817
|
+
}): Promise<OffboardResult>;
|
|
4818
|
+
/**
|
|
4819
|
+
* Pay `method` over the matching rail: Ark, lightning or onchain.
|
|
4820
|
+
*
|
|
4821
|
+
* `amount_sats` is required for addresses and LNURL, and for invoices
|
|
4822
|
+
* and offers without an amount (`AvailablePaymentMethod.requires_amount`).
|
|
4823
|
+
* `comment` only reaches lightning addresses and LNURL. `wait` and
|
|
4824
|
+
* `retry_for_secs` only affect lightning. `retry_for_secs` is how long
|
|
4825
|
+
* the Ark server keeps trying to pay, capped to the server's maximum;
|
|
4826
|
+
* `None` leaves it to the server and 0 makes a single attempt.
|
|
4827
|
+
*/
|
|
4828
|
+
sendPayment(method: PaymentMethod, amountSats: bigint | undefined, comment: string | undefined, wait: boolean, retryForSecs: bigint | undefined, asyncOpts_?: {
|
|
4829
|
+
signal: AbortSignal;
|
|
4830
|
+
}): Promise<PaymentResult>;
|
|
3599
4831
|
signExitClaimInputs(psbtBase64: string, asyncOpts_?: {
|
|
3600
4832
|
signal: AbortSignal;
|
|
3601
4833
|
}): Promise<string>;
|
|
@@ -3747,6 +4979,21 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
3747
4979
|
balance(asyncOpts_?: {
|
|
3748
4980
|
signal: AbortSignal;
|
|
3749
4981
|
}): Promise<Balance>;
|
|
4982
|
+
/**
|
|
4983
|
+
* The numbers to show a user, without the breakdown of `balance`: what
|
|
4984
|
+
* they can spend, what needs a refresh, what is pending and the total.
|
|
4985
|
+
*/
|
|
4986
|
+
balanceSummary(asyncOpts_?: {
|
|
4987
|
+
signal: AbortSignal;
|
|
4988
|
+
}): Promise<BalanceSummary>;
|
|
4989
|
+
/**
|
|
4990
|
+
* Build a BIP 321 `bitcoin:` URI with a new Ark address, a new BOLT11
|
|
4991
|
+
* invoice (when there is an amount) and the caller's onchain address,
|
|
4992
|
+
* as `options` selects.
|
|
4993
|
+
*/
|
|
4994
|
+
bip321Uri(options: Bip321UriOptions, asyncOpts_?: {
|
|
4995
|
+
signal: AbortSignal;
|
|
4996
|
+
}): Promise<Bip321Uri>;
|
|
3750
4997
|
boardAll(asyncOpts_?: {
|
|
3751
4998
|
signal: AbortSignal;
|
|
3752
4999
|
}): Promise<PendingBoard>;
|
|
@@ -3812,6 +5059,13 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
3812
5059
|
config(asyncOpts_?: {
|
|
3813
5060
|
signal: AbortSignal;
|
|
3814
5061
|
}): Promise<Config>;
|
|
5062
|
+
/**
|
|
5063
|
+
* The network, mailbox id and VTXO xpub, as `bark debug-info` prints
|
|
5064
|
+
* them. Users can share this in support requests.
|
|
5065
|
+
*/
|
|
5066
|
+
debugInfo(asyncOpts_?: {
|
|
5067
|
+
signal: AbortSignal;
|
|
5068
|
+
}): Promise<DebugInfo>;
|
|
3815
5069
|
/**
|
|
3816
5070
|
* Build a PSBT claiming exited VTXOs to `address`.
|
|
3817
5071
|
*
|
|
@@ -3836,13 +5090,14 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
3836
5090
|
* spendable VTXO). `fee_rate_sat_per_vb` applies to both legs; omit it to
|
|
3837
5091
|
* use the chain's fast rate for the broadcast leg and regular rate for
|
|
3838
5092
|
* the claim leg. `destination` only affects the claim transaction's weight.
|
|
5093
|
+
* `fee_margin` scales the broadcast leg (finite and non-negative; default
|
|
5094
|
+
* 1.2).
|
|
3839
5095
|
*
|
|
3840
|
-
* The
|
|
3841
|
-
*
|
|
3842
|
-
*
|
|
3843
|
-
* and return an error.
|
|
5096
|
+
* The estimate never reads the onchain wallet, so it works before the
|
|
5097
|
+
* wallet holds funds and with callback wallets
|
|
5098
|
+
* (`CustomOnchainWalletCallbacks`) too.
|
|
3844
5099
|
*/
|
|
3845
|
-
estimateEmergencyExitFee(vtxoIds: Array<string>, feeRateSatPerVb: bigint | undefined, destination: string | undefined, asyncOpts_?: {
|
|
5100
|
+
estimateEmergencyExitFee(vtxoIds: Array<string>, feeRateSatPerVb: bigint | undefined, destination: string | undefined, feeMargin?: number | undefined, asyncOpts_?: {
|
|
3846
5101
|
signal: AbortSignal;
|
|
3847
5102
|
}): Promise<EmergencyExitFeeEstimate>;
|
|
3848
5103
|
estimateLightningReceiveFee(amountSats: bigint, asyncOpts_?: {
|
|
@@ -3857,6 +5112,12 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
3857
5112
|
estimateOffboardFee(address: string, vtxoIds: Array<string>, asyncOpts_?: {
|
|
3858
5113
|
signal: AbortSignal;
|
|
3859
5114
|
}): Promise<FeeEstimate>;
|
|
5115
|
+
/**
|
|
5116
|
+
* Estimate the fee of paying `amount_sats` to `method`.
|
|
5117
|
+
*/
|
|
5118
|
+
estimatePaymentFee(method: PaymentMethod, amountSats: bigint, asyncOpts_?: {
|
|
5119
|
+
signal: AbortSignal;
|
|
5120
|
+
}): Promise<FeeEstimate>;
|
|
3860
5121
|
estimateRefreshFee(vtxoIds: Array<string>, asyncOpts_?: {
|
|
3861
5122
|
signal: AbortSignal;
|
|
3862
5123
|
}): Promise<FeeEstimate>;
|
|
@@ -3864,9 +5125,17 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
3864
5125
|
signal: AbortSignal;
|
|
3865
5126
|
}): Promise<FeeEstimate>;
|
|
3866
5127
|
fingerprint(): string;
|
|
5128
|
+
/**
|
|
5129
|
+
* Status of one exit, live or finished. `None` if no exit was ever
|
|
5130
|
+
* started for the VTXO.
|
|
5131
|
+
*/
|
|
3867
5132
|
getExitStatus(vtxoId: string, includeHistory: boolean, includeTransactions: boolean, asyncOpts_?: {
|
|
3868
5133
|
signal: AbortSignal;
|
|
3869
5134
|
}): Promise<ExitTransactionStatus | undefined>;
|
|
5135
|
+
/**
|
|
5136
|
+
* Live exits only. Finished exits leave this list; see
|
|
5137
|
+
* `list_finished_exits` and `get_exit_status`.
|
|
5138
|
+
*/
|
|
3870
5139
|
getExitVtxos(asyncOpts_?: {
|
|
3871
5140
|
signal: AbortSignal;
|
|
3872
5141
|
}): Promise<Array<ExitVtxo>>;
|
|
@@ -3942,9 +5211,29 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
3942
5211
|
lightningSendState(paymentHash: string, asyncOpts_?: {
|
|
3943
5212
|
signal: AbortSignal;
|
|
3944
5213
|
}): Promise<LightningSendStatus>;
|
|
5214
|
+
/**
|
|
5215
|
+
* Status of every exit this wallet ever started, live and finished.
|
|
5216
|
+
*/
|
|
5217
|
+
listAllExits(includeHistory?: boolean, includeTransactions?: boolean, asyncOpts_?: {
|
|
5218
|
+
signal: AbortSignal;
|
|
5219
|
+
}): Promise<Array<ExitTransactionStatus>>;
|
|
3945
5220
|
listClaimableExits(asyncOpts_?: {
|
|
3946
5221
|
signal: AbortSignal;
|
|
3947
5222
|
}): Promise<Array<ExitVtxo>>;
|
|
5223
|
+
/**
|
|
5224
|
+
* Status of the exits in a terminal state: claimed, canceled, or aborted
|
|
5225
|
+
* because the VTXO was already spent or swept. They stay queryable after
|
|
5226
|
+
* completion, so a client need not snapshot them at drain time.
|
|
5227
|
+
*/
|
|
5228
|
+
listFinishedExits(includeHistory?: boolean, includeTransactions?: boolean, asyncOpts_?: {
|
|
5229
|
+
signal: AbortSignal;
|
|
5230
|
+
}): Promise<Array<ExitTransactionStatus>>;
|
|
5231
|
+
/**
|
|
5232
|
+
* Status of the exits that are still progressing.
|
|
5233
|
+
*/
|
|
5234
|
+
listLiveExits(includeHistory?: boolean, includeTransactions?: boolean, asyncOpts_?: {
|
|
5235
|
+
signal: AbortSignal;
|
|
5236
|
+
}): Promise<Array<ExitTransactionStatus>>;
|
|
3948
5237
|
/**
|
|
3949
5238
|
* Reserve VTXOs so wallet-driven flows leave them alone: a locked VTXO is
|
|
3950
5239
|
* excluded from coin selection.
|
|
@@ -3992,16 +5281,38 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
3992
5281
|
offboardVtxos(vtxoIds: Array<string>, bitcoinAddress: string, asyncOpts_?: {
|
|
3993
5282
|
signal: AbortSignal;
|
|
3994
5283
|
}): Promise<OffboardResult>;
|
|
5284
|
+
/**
|
|
5285
|
+
* Parse any payment string bark understands: a BIP 321 `bitcoin:` URI, a
|
|
5286
|
+
* `lightning:` URI (any case), a BOLT11 invoice, a BOLT12 offer, a
|
|
5287
|
+
* lightning address, an LNURL-pay link or LUD-17 `lnurlp://` URI, an Ark
|
|
5288
|
+
* address, a bitcoin address or a hex output script. Surrounding
|
|
5289
|
+
* whitespace is not trimmed.
|
|
5290
|
+
*
|
|
5291
|
+
* Problems with a single option (wrong network, an Ark address of
|
|
5292
|
+
* another server, an amount mismatch) are reported in that option's
|
|
5293
|
+
* `errors`. Errors only when nothing in the string can be paid at all.
|
|
5294
|
+
* Checking an Ark address needs a server connection.
|
|
5295
|
+
*/
|
|
5296
|
+
parsePaymentRequest(payment: string, asyncOpts_?: {
|
|
5297
|
+
signal: AbortSignal;
|
|
5298
|
+
}): Promise<PaymentRequest>;
|
|
3995
5299
|
/**
|
|
3996
5300
|
* Pay to a Lightning Address (`user@domain`), resolved via LNURL-pay.
|
|
3997
5301
|
*/
|
|
3998
|
-
payLightningAddress(lightningAddress: string, amountSats: bigint, comment: string | undefined, wait?: boolean, asyncOpts_?: {
|
|
5302
|
+
payLightningAddress(lightningAddress: string, amountSats: bigint, comment: string | undefined, wait?: boolean, retryForSecs?: bigint | undefined, asyncOpts_?: {
|
|
3999
5303
|
signal: AbortSignal;
|
|
4000
5304
|
}): Promise<LightningSendStatus>;
|
|
4001
|
-
|
|
5305
|
+
/**
|
|
5306
|
+
* Pay a BOLT11 invoice.
|
|
5307
|
+
*
|
|
5308
|
+
* `retry_for_secs` is how long the Ark server keeps trying to pay,
|
|
5309
|
+
* capped to the server's maximum; `None` leaves it to the server and 0
|
|
5310
|
+
* makes a single attempt. The same holds for every `pay_*` method.
|
|
5311
|
+
*/
|
|
5312
|
+
payLightningInvoice(invoice: string, amountSats: bigint | undefined, wait?: boolean, retryForSecs?: bigint | undefined, asyncOpts_?: {
|
|
4002
5313
|
signal: AbortSignal;
|
|
4003
5314
|
}): Promise<LightningSendStatus>;
|
|
4004
|
-
payLightningOffer(offer: string, amountSats: bigint | undefined, wait?: boolean, asyncOpts_?: {
|
|
5315
|
+
payLightningOffer(offer: string, amountSats: bigint | undefined, wait?: boolean, retryForSecs?: bigint | undefined, asyncOpts_?: {
|
|
4005
5316
|
signal: AbortSignal;
|
|
4006
5317
|
}): Promise<LightningSendStatus>;
|
|
4007
5318
|
/**
|
|
@@ -4010,7 +5321,7 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
4010
5321
|
* Resolves the LNURL-pay endpoint to a BOLT11 invoice and pays it. Errors
|
|
4011
5322
|
* if the link decodes to a non-pay LNURL (auth, withdraw, channel).
|
|
4012
5323
|
*/
|
|
4013
|
-
payLnurl(lnurl: string, amountSats: bigint, comment: string | undefined, wait?: boolean, asyncOpts_?: {
|
|
5324
|
+
payLnurl(lnurl: string, amountSats: bigint, comment: string | undefined, wait?: boolean, retryForSecs?: bigint | undefined, asyncOpts_?: {
|
|
4014
5325
|
signal: AbortSignal;
|
|
4015
5326
|
}): Promise<LightningSendStatus>;
|
|
4016
5327
|
peekAddress(index: number, asyncOpts_?: {
|
|
@@ -4109,13 +5420,32 @@ export declare class Wallet extends UniffiAbstractObject implements WalletLike {
|
|
|
4109
5420
|
*
|
|
4110
5421
|
* An address this bark cannot deliver to (see `validateArkoorAddress`) is
|
|
4111
5422
|
* rejected up front, leaving the VTXOs spendable rather than cosigned.
|
|
5423
|
+
*
|
|
5424
|
+
* Returns the id of the movement that records the payment.
|
|
4112
5425
|
*/
|
|
4113
5426
|
sendArkoorPayment(arkAddress: string, amountSats: bigint, asyncOpts_?: {
|
|
4114
5427
|
signal: AbortSignal;
|
|
4115
|
-
}): Promise<
|
|
5428
|
+
}): Promise<number>;
|
|
5429
|
+
/**
|
|
5430
|
+
* Send `amount_sats` from the offchain balance to an onchain address,
|
|
5431
|
+
* as an offboard. Returns the offboard txid and its movement id.
|
|
5432
|
+
*/
|
|
4116
5433
|
sendOnchain(address: string, amountSats: bigint, asyncOpts_?: {
|
|
4117
5434
|
signal: AbortSignal;
|
|
4118
|
-
}): Promise<
|
|
5435
|
+
}): Promise<OffboardResult>;
|
|
5436
|
+
/**
|
|
5437
|
+
* Pay `method` over the matching rail: Ark, lightning or onchain.
|
|
5438
|
+
*
|
|
5439
|
+
* `amount_sats` is required for addresses and LNURL, and for invoices
|
|
5440
|
+
* and offers without an amount (`AvailablePaymentMethod.requires_amount`).
|
|
5441
|
+
* `comment` only reaches lightning addresses and LNURL. `wait` and
|
|
5442
|
+
* `retry_for_secs` only affect lightning. `retry_for_secs` is how long
|
|
5443
|
+
* the Ark server keeps trying to pay, capped to the server's maximum;
|
|
5444
|
+
* `None` leaves it to the server and 0 makes a single attempt.
|
|
5445
|
+
*/
|
|
5446
|
+
sendPayment(method: PaymentMethod, amountSats?: bigint | undefined, comment?: string | undefined, wait?: boolean, retryForSecs?: bigint | undefined, asyncOpts_?: {
|
|
5447
|
+
signal: AbortSignal;
|
|
5448
|
+
}): Promise<PaymentResult>;
|
|
4119
5449
|
signExitClaimInputs(psbtBase64: string, asyncOpts_?: {
|
|
4120
5450
|
signal: AbortSignal;
|
|
4121
5451
|
}): Promise<string>;
|
|
@@ -4241,6 +5571,13 @@ declare const _default: Readonly<{
|
|
|
4241
5571
|
lift(value: Uint8Array): ArkInfo;
|
|
4242
5572
|
lower(value: ArkInfo, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
4243
5573
|
};
|
|
5574
|
+
FfiConverterTypeAvailablePaymentMethod: {
|
|
5575
|
+
readFromCursor(c: Cursor): AvailablePaymentMethod;
|
|
5576
|
+
writeIntoCursor(value: AvailablePaymentMethod, c: Cursor): void;
|
|
5577
|
+
allocationSize(value: AvailablePaymentMethod): number;
|
|
5578
|
+
lift(value: Uint8Array): AvailablePaymentMethod;
|
|
5579
|
+
lower(value: AvailablePaymentMethod, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5580
|
+
};
|
|
4244
5581
|
FfiConverterTypeBalance: {
|
|
4245
5582
|
readFromCursor(c: Cursor): Balance;
|
|
4246
5583
|
writeIntoCursor(value: Balance, c: Cursor): void;
|
|
@@ -4248,7 +5585,28 @@ declare const _default: Readonly<{
|
|
|
4248
5585
|
lift(value: Uint8Array): Balance;
|
|
4249
5586
|
lower(value: Balance, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
4250
5587
|
};
|
|
5588
|
+
FfiConverterTypeBalanceSummary: {
|
|
5589
|
+
readFromCursor(c: Cursor): BalanceSummary;
|
|
5590
|
+
writeIntoCursor(value: BalanceSummary, c: Cursor): void;
|
|
5591
|
+
allocationSize(value: BalanceSummary): number;
|
|
5592
|
+
lift(value: Uint8Array): BalanceSummary;
|
|
5593
|
+
lower(value: BalanceSummary, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5594
|
+
};
|
|
4251
5595
|
FfiConverterTypeBarkLogger: FfiConverterObjectWithCallbacks<BarkLogger>;
|
|
5596
|
+
FfiConverterTypeBip321Uri: {
|
|
5597
|
+
readFromCursor(c: Cursor): Bip321Uri;
|
|
5598
|
+
writeIntoCursor(value: Bip321Uri, c: Cursor): void;
|
|
5599
|
+
allocationSize(value: Bip321Uri): number;
|
|
5600
|
+
lift(value: Uint8Array): Bip321Uri;
|
|
5601
|
+
lower(value: Bip321Uri, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5602
|
+
};
|
|
5603
|
+
FfiConverterTypeBip321UriOptions: {
|
|
5604
|
+
readFromCursor(c: Cursor): Bip321UriOptions;
|
|
5605
|
+
writeIntoCursor(value: Bip321UriOptions, c: Cursor): void;
|
|
5606
|
+
allocationSize(value: Bip321UriOptions): number;
|
|
5607
|
+
lift(value: Uint8Array): Bip321UriOptions;
|
|
5608
|
+
lower(value: Bip321UriOptions, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5609
|
+
};
|
|
4252
5610
|
FfiConverterTypeBlockRef: {
|
|
4253
5611
|
readFromCursor(c: Cursor): BlockRef;
|
|
4254
5612
|
writeIntoCursor(value: BlockRef, c: Cursor): void;
|
|
@@ -4270,6 +5628,13 @@ declare const _default: Readonly<{
|
|
|
4270
5628
|
lift(value: Uint8Array): BoardFundingInfo;
|
|
4271
5629
|
lower(value: BoardFundingInfo, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
4272
5630
|
};
|
|
5631
|
+
FfiConverterTypeBolt11InvoiceDetails: {
|
|
5632
|
+
readFromCursor(c: Cursor): Bolt11InvoiceDetails;
|
|
5633
|
+
writeIntoCursor(value: Bolt11InvoiceDetails, c: Cursor): void;
|
|
5634
|
+
allocationSize(value: Bolt11InvoiceDetails): number;
|
|
5635
|
+
lift(value: Uint8Array): Bolt11InvoiceDetails;
|
|
5636
|
+
lower(value: Bolt11InvoiceDetails, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5637
|
+
};
|
|
4273
5638
|
FfiConverterTypeConfig: {
|
|
4274
5639
|
readFromCursor(c: Cursor): Config;
|
|
4275
5640
|
writeIntoCursor(value: Config, c: Cursor): void;
|
|
@@ -4285,6 +5650,20 @@ declare const _default: Readonly<{
|
|
|
4285
5650
|
lower(value: CpfpParams, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
4286
5651
|
};
|
|
4287
5652
|
FfiConverterTypeCustomOnchainWalletCallbacks: FfiConverterObjectWithCallbacks<CustomOnchainWalletCallbacks>;
|
|
5653
|
+
FfiConverterTypeDatadirInfo: {
|
|
5654
|
+
readFromCursor(c: Cursor): DatadirInfo;
|
|
5655
|
+
writeIntoCursor(value: DatadirInfo, c: Cursor): void;
|
|
5656
|
+
allocationSize(value: DatadirInfo): number;
|
|
5657
|
+
lift(value: Uint8Array): DatadirInfo;
|
|
5658
|
+
lower(value: DatadirInfo, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5659
|
+
};
|
|
5660
|
+
FfiConverterTypeDebugInfo: {
|
|
5661
|
+
readFromCursor(c: Cursor): DebugInfo;
|
|
5662
|
+
writeIntoCursor(value: DebugInfo, c: Cursor): void;
|
|
5663
|
+
allocationSize(value: DebugInfo): number;
|
|
5664
|
+
lift(value: Uint8Array): DebugInfo;
|
|
5665
|
+
lower(value: DebugInfo, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5666
|
+
};
|
|
4288
5667
|
FfiConverterTypeDestination: {
|
|
4289
5668
|
readFromCursor(c: Cursor): Destination;
|
|
4290
5669
|
writeIntoCursor(value: Destination, c: Cursor): void;
|
|
@@ -4400,6 +5779,13 @@ declare const _default: Readonly<{
|
|
|
4400
5779
|
lift(value: Uint8Array): ExitCancelResult;
|
|
4401
5780
|
lower(value: ExitCancelResult, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
4402
5781
|
};
|
|
5782
|
+
FfiConverterTypeExitChildTransaction: {
|
|
5783
|
+
readFromCursor(c: Cursor): ExitChildTransaction;
|
|
5784
|
+
writeIntoCursor(value: ExitChildTransaction, c: Cursor): void;
|
|
5785
|
+
allocationSize(value: ExitChildTransaction): number;
|
|
5786
|
+
lift(value: Uint8Array): ExitChildTransaction;
|
|
5787
|
+
lower(value: ExitChildTransaction, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5788
|
+
};
|
|
4403
5789
|
FfiConverterTypeExitClaimTransaction: {
|
|
4404
5790
|
readFromCursor(c: Cursor): ExitClaimTransaction;
|
|
4405
5791
|
writeIntoCursor(value: ExitClaimTransaction, c: Cursor): void;
|
|
@@ -4428,6 +5814,13 @@ declare const _default: Readonly<{
|
|
|
4428
5814
|
lift(value: Uint8Array): ExitStateKind;
|
|
4429
5815
|
lower(value: ExitStateKind, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
4430
5816
|
};
|
|
5817
|
+
FfiConverterTypeExitTransactionPackage: {
|
|
5818
|
+
readFromCursor(c: Cursor): ExitTransactionPackage;
|
|
5819
|
+
writeIntoCursor(value: ExitTransactionPackage, c: Cursor): void;
|
|
5820
|
+
allocationSize(value: ExitTransactionPackage): number;
|
|
5821
|
+
lift(value: Uint8Array): ExitTransactionPackage;
|
|
5822
|
+
lower(value: ExitTransactionPackage, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5823
|
+
};
|
|
4431
5824
|
FfiConverterTypeExitTransactionStatus: {
|
|
4432
5825
|
readFromCursor(c: Cursor): ExitTransactionStatus;
|
|
4433
5826
|
writeIntoCursor(value: ExitTransactionStatus, c: Cursor): void;
|
|
@@ -4591,6 +5984,34 @@ declare const _default: Readonly<{
|
|
|
4591
5984
|
lift(value: Uint8Array): OutPoint;
|
|
4592
5985
|
lower(value: OutPoint, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
4593
5986
|
};
|
|
5987
|
+
FfiConverterTypePaymentMethod: {
|
|
5988
|
+
readFromCursor(c: Cursor): PaymentMethod;
|
|
5989
|
+
writeIntoCursor(value: PaymentMethod, c: Cursor): void;
|
|
5990
|
+
allocationSize(value: PaymentMethod): number;
|
|
5991
|
+
lift(value: Uint8Array): PaymentMethod;
|
|
5992
|
+
lower(value: PaymentMethod, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
5993
|
+
};
|
|
5994
|
+
FfiConverterTypePaymentMethodParsingError: {
|
|
5995
|
+
readFromCursor(c: Cursor): PaymentMethodParsingError;
|
|
5996
|
+
writeIntoCursor(value: PaymentMethodParsingError, c: Cursor): void;
|
|
5997
|
+
allocationSize(value: PaymentMethodParsingError): number;
|
|
5998
|
+
lift(value: Uint8Array): PaymentMethodParsingError;
|
|
5999
|
+
lower(value: PaymentMethodParsingError, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6000
|
+
};
|
|
6001
|
+
FfiConverterTypePaymentRequest: {
|
|
6002
|
+
readFromCursor(c: Cursor): PaymentRequest;
|
|
6003
|
+
writeIntoCursor(value: PaymentRequest, c: Cursor): void;
|
|
6004
|
+
allocationSize(value: PaymentRequest): number;
|
|
6005
|
+
lift(value: Uint8Array): PaymentRequest;
|
|
6006
|
+
lower(value: PaymentRequest, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6007
|
+
};
|
|
6008
|
+
FfiConverterTypePaymentResult: {
|
|
6009
|
+
readFromCursor(c: Cursor): PaymentResult;
|
|
6010
|
+
writeIntoCursor(value: PaymentResult, c: Cursor): void;
|
|
6011
|
+
allocationSize(value: PaymentResult): number;
|
|
6012
|
+
lift(value: Uint8Array): PaymentResult;
|
|
6013
|
+
lower(value: PaymentResult, alloc: import("@ubjs/core").RustBufferAllocator): Uint8Array;
|
|
6014
|
+
};
|
|
4594
6015
|
FfiConverterTypePendingBoard: {
|
|
4595
6016
|
readFromCursor(c: Cursor): PendingBoard;
|
|
4596
6017
|
writeIntoCursor(value: PendingBoard, c: Cursor): void;
|