@secondts/bark-react-native 0.2.0-beta.2 → 0.3.0-beta.1

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.
Files changed (38) hide show
  1. package/README.md +2 -2
  2. package/cpp/generated/bark.cpp +8716 -6407
  3. package/cpp/generated/bark.hpp +912 -235
  4. package/lib/commonjs/WalletNotifications.js +82 -0
  5. package/lib/commonjs/WalletNotifications.js.map +1 -0
  6. package/lib/commonjs/generated/bark-ffi.js.map +1 -1
  7. package/lib/commonjs/generated/bark.js +347 -6
  8. package/lib/commonjs/generated/bark.js.map +1 -1
  9. package/lib/commonjs/index.js +13 -1
  10. package/lib/commonjs/index.js.map +1 -1
  11. package/lib/module/WalletNotifications.js +77 -0
  12. package/lib/module/WalletNotifications.js.map +1 -0
  13. package/lib/module/generated/bark-ffi.js.map +1 -1
  14. package/lib/module/generated/bark.js +346 -6
  15. package/lib/module/generated/bark.js.map +1 -1
  16. package/lib/module/index.js +3 -0
  17. package/lib/module/index.js.map +1 -1
  18. package/lib/typescript/commonjs/src/WalletNotifications.d.ts +41 -0
  19. package/lib/typescript/commonjs/src/WalletNotifications.d.ts.map +1 -0
  20. package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts +62 -1
  21. package/lib/typescript/commonjs/src/generated/bark-ffi.d.ts.map +1 -1
  22. package/lib/typescript/commonjs/src/generated/bark.d.ts +254 -4
  23. package/lib/typescript/commonjs/src/generated/bark.d.ts.map +1 -1
  24. package/lib/typescript/commonjs/src/index.d.ts +1 -0
  25. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  26. package/lib/typescript/module/src/WalletNotifications.d.ts +41 -0
  27. package/lib/typescript/module/src/WalletNotifications.d.ts.map +1 -0
  28. package/lib/typescript/module/src/generated/bark-ffi.d.ts +62 -1
  29. package/lib/typescript/module/src/generated/bark-ffi.d.ts.map +1 -1
  30. package/lib/typescript/module/src/generated/bark.d.ts +254 -4
  31. package/lib/typescript/module/src/generated/bark.d.ts.map +1 -1
  32. package/lib/typescript/module/src/index.d.ts +1 -0
  33. package/lib/typescript/module/src/index.d.ts.map +1 -1
  34. package/package.json +4 -4
  35. package/src/WalletNotifications.ts +86 -0
  36. package/src/generated/bark-ffi.ts +172 -1
  37. package/src/generated/bark.ts +584 -17
  38. package/src/index.tsx +3 -0
@@ -55,6 +55,7 @@ import {
55
55
  FfiConverterUInt64,
56
56
  RustBuffer,
57
57
  UniffiAbstractObject,
58
+ UniffiEnum,
58
59
  UniffiError,
59
60
  UniffiInternalError,
60
61
  UniffiResult,
@@ -63,6 +64,7 @@ import {
63
64
  pointerLiteralSymbol,
64
65
  uniffiCreateFfiConverterString,
65
66
  uniffiCreateRecord,
67
+ uniffiRustCallAsync,
66
68
  uniffiTraitInterfaceCallWithError,
67
69
  uniffiTypeNameSymbol,
68
70
  variantOrdinalSymbol,
@@ -3265,6 +3267,422 @@ const FfiConverterTypeNetwork = (() => {
3265
3267
  return new FFIConverter();
3266
3268
  })();
3267
3269
 
3270
+ // Enum: WalletNotification
3271
+ export enum WalletNotification_Tags {
3272
+ MovementCreated = "MovementCreated",
3273
+ MovementUpdated = "MovementUpdated",
3274
+ ChannelLagging = "ChannelLagging",
3275
+ }
3276
+ /**
3277
+ * A notification event from the wallet
3278
+ */
3279
+ export const WalletNotification = (() => {
3280
+ type MovementCreated__interface = {
3281
+ tag: WalletNotification_Tags.MovementCreated;
3282
+ inner: Readonly<{ movement: Movement }>;
3283
+ };
3284
+
3285
+ /**
3286
+ * A new movement was created
3287
+ */
3288
+ class MovementCreated_
3289
+ extends UniffiEnum
3290
+ implements MovementCreated__interface
3291
+ {
3292
+ /**
3293
+ * @private
3294
+ * This field is private and should not be used, use `tag` instead.
3295
+ */
3296
+ readonly [uniffiTypeNameSymbol] = "WalletNotification";
3297
+ readonly tag = WalletNotification_Tags.MovementCreated;
3298
+ readonly inner: Readonly<{ movement: Movement }>;
3299
+ constructor(inner: { movement: Movement }) {
3300
+ super("WalletNotification", "MovementCreated");
3301
+ this.inner = Object.freeze(inner);
3302
+ }
3303
+
3304
+ static new(inner: { movement: Movement }): MovementCreated_ {
3305
+ return new MovementCreated_(inner);
3306
+ }
3307
+
3308
+ static instanceOf(obj: any): obj is MovementCreated_ {
3309
+ return obj.tag === WalletNotification_Tags.MovementCreated;
3310
+ }
3311
+ }
3312
+
3313
+ type MovementUpdated__interface = {
3314
+ tag: WalletNotification_Tags.MovementUpdated;
3315
+ inner: Readonly<{ movement: Movement }>;
3316
+ };
3317
+
3318
+ /**
3319
+ * An existing movement was updated
3320
+ */
3321
+ class MovementUpdated_
3322
+ extends UniffiEnum
3323
+ implements MovementUpdated__interface
3324
+ {
3325
+ /**
3326
+ * @private
3327
+ * This field is private and should not be used, use `tag` instead.
3328
+ */
3329
+ readonly [uniffiTypeNameSymbol] = "WalletNotification";
3330
+ readonly tag = WalletNotification_Tags.MovementUpdated;
3331
+ readonly inner: Readonly<{ movement: Movement }>;
3332
+ constructor(inner: { movement: Movement }) {
3333
+ super("WalletNotification", "MovementUpdated");
3334
+ this.inner = Object.freeze(inner);
3335
+ }
3336
+
3337
+ static new(inner: { movement: Movement }): MovementUpdated_ {
3338
+ return new MovementUpdated_(inner);
3339
+ }
3340
+
3341
+ static instanceOf(obj: any): obj is MovementUpdated_ {
3342
+ return obj.tag === WalletNotification_Tags.MovementUpdated;
3343
+ }
3344
+ }
3345
+
3346
+ type ChannelLagging__interface = {
3347
+ tag: WalletNotification_Tags.ChannelLagging;
3348
+ };
3349
+
3350
+ /**
3351
+ * The notification channel is lagging (some notifications were dropped)
3352
+ */
3353
+ class ChannelLagging_
3354
+ extends UniffiEnum
3355
+ implements ChannelLagging__interface
3356
+ {
3357
+ /**
3358
+ * @private
3359
+ * This field is private and should not be used, use `tag` instead.
3360
+ */
3361
+ readonly [uniffiTypeNameSymbol] = "WalletNotification";
3362
+ readonly tag = WalletNotification_Tags.ChannelLagging;
3363
+ constructor() {
3364
+ super("WalletNotification", "ChannelLagging");
3365
+ }
3366
+
3367
+ static new(): ChannelLagging_ {
3368
+ return new ChannelLagging_();
3369
+ }
3370
+
3371
+ static instanceOf(obj: any): obj is ChannelLagging_ {
3372
+ return obj.tag === WalletNotification_Tags.ChannelLagging;
3373
+ }
3374
+ }
3375
+
3376
+ function instanceOf(obj: any): obj is WalletNotification {
3377
+ return obj[uniffiTypeNameSymbol] === "WalletNotification";
3378
+ }
3379
+
3380
+ return Object.freeze({
3381
+ instanceOf,
3382
+ MovementCreated: MovementCreated_,
3383
+ MovementUpdated: MovementUpdated_,
3384
+ ChannelLagging: ChannelLagging_,
3385
+ });
3386
+ })();
3387
+
3388
+ /**
3389
+ * A notification event from the wallet
3390
+ */
3391
+
3392
+ export type WalletNotification = InstanceType<
3393
+ (typeof WalletNotification)[keyof Omit<
3394
+ typeof WalletNotification,
3395
+ "instanceOf"
3396
+ >]
3397
+ >;
3398
+
3399
+ // FfiConverter for enum WalletNotification
3400
+ const FfiConverterTypeWalletNotification = (() => {
3401
+ const ordinalConverter = FfiConverterInt32;
3402
+ type TypeName = WalletNotification;
3403
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
3404
+ read(from: RustBuffer): TypeName {
3405
+ switch (ordinalConverter.read(from)) {
3406
+ case 1:
3407
+ return new WalletNotification.MovementCreated({
3408
+ movement: FfiConverterTypeMovement.read(from),
3409
+ });
3410
+ case 2:
3411
+ return new WalletNotification.MovementUpdated({
3412
+ movement: FfiConverterTypeMovement.read(from),
3413
+ });
3414
+ case 3:
3415
+ return new WalletNotification.ChannelLagging();
3416
+ default:
3417
+ throw new UniffiInternalError.UnexpectedEnumCase();
3418
+ }
3419
+ }
3420
+ write(value: TypeName, into: RustBuffer): void {
3421
+ switch (value.tag) {
3422
+ case WalletNotification_Tags.MovementCreated: {
3423
+ ordinalConverter.write(1, into);
3424
+ const inner = value.inner;
3425
+ FfiConverterTypeMovement.write(inner.movement, into);
3426
+ return;
3427
+ }
3428
+ case WalletNotification_Tags.MovementUpdated: {
3429
+ ordinalConverter.write(2, into);
3430
+ const inner = value.inner;
3431
+ FfiConverterTypeMovement.write(inner.movement, into);
3432
+ return;
3433
+ }
3434
+ case WalletNotification_Tags.ChannelLagging: {
3435
+ ordinalConverter.write(3, into);
3436
+ return;
3437
+ }
3438
+ default:
3439
+ // Throwing from here means that WalletNotification_Tags hasn't matched an ordinal.
3440
+ throw new UniffiInternalError.UnexpectedEnumCase();
3441
+ }
3442
+ }
3443
+ allocationSize(value: TypeName): number {
3444
+ switch (value.tag) {
3445
+ case WalletNotification_Tags.MovementCreated: {
3446
+ const inner = value.inner;
3447
+ let size = ordinalConverter.allocationSize(1);
3448
+ size += FfiConverterTypeMovement.allocationSize(inner.movement);
3449
+ return size;
3450
+ }
3451
+ case WalletNotification_Tags.MovementUpdated: {
3452
+ const inner = value.inner;
3453
+ let size = ordinalConverter.allocationSize(2);
3454
+ size += FfiConverterTypeMovement.allocationSize(inner.movement);
3455
+ return size;
3456
+ }
3457
+ case WalletNotification_Tags.ChannelLagging: {
3458
+ return ordinalConverter.allocationSize(3);
3459
+ }
3460
+ default:
3461
+ throw new UniffiInternalError.UnexpectedEnumCase();
3462
+ }
3463
+ }
3464
+ }
3465
+ return new FFIConverter();
3466
+ })();
3467
+
3468
+ /**
3469
+ * Pull-based handle for consuming wallet notifications.
3470
+ *
3471
+ * Obtain via `Wallet.notifications()`. Call `next_notification()` in a loop
3472
+ * to receive events. Call `cancel_next_notification_wait()` to unblock a
3473
+ * pending wait without destroying the underlying stream.
3474
+ *
3475
+ * Each call to `Wallet.notifications()` creates an independent stream backed
3476
+ * by a new broadcast receiver. Only one consumer loop per holder is assumed.
3477
+ */
3478
+ export interface NotificationHolderInterface {
3479
+ /**
3480
+ * Cancel the currently pending `next_notification()` wait.
3481
+ *
3482
+ * Causes a blocked `next_notification()` to return null.
3483
+ * Has no effect when no wait is active.
3484
+ * Does NOT destroy the underlying stream; subsequent calls to
3485
+ * `next_notification()` will still work.
3486
+ */
3487
+ cancelNextNotificationWait(): void;
3488
+ /**
3489
+ * Wait for the next notification.
3490
+ *
3491
+ * Returns null if the wait was cancelled via `cancel_next_notification_wait()`
3492
+ * or if the wallet's notification source was shut down permanently.
3493
+ *
3494
+ * After a cancellation this method can be called again normally — the
3495
+ * underlying stream is preserved and a fresh cancel channel is set up on
3496
+ * every entry.
3497
+ *
3498
+ * Throws `BarkError.Internal` if called concurrently on the same holder.
3499
+ */
3500
+ nextNotification(asyncOpts_?: {
3501
+ signal: AbortSignal;
3502
+ }): /*throws*/ Promise<WalletNotification | undefined>;
3503
+ }
3504
+
3505
+ /**
3506
+ * Pull-based handle for consuming wallet notifications.
3507
+ *
3508
+ * Obtain via `Wallet.notifications()`. Call `next_notification()` in a loop
3509
+ * to receive events. Call `cancel_next_notification_wait()` to unblock a
3510
+ * pending wait without destroying the underlying stream.
3511
+ *
3512
+ * Each call to `Wallet.notifications()` creates an independent stream backed
3513
+ * by a new broadcast receiver. Only one consumer loop per holder is assumed.
3514
+ */
3515
+ export class NotificationHolder
3516
+ extends UniffiAbstractObject
3517
+ implements NotificationHolderInterface
3518
+ {
3519
+ readonly [uniffiTypeNameSymbol] = "NotificationHolder";
3520
+ readonly [destructorGuardSymbol]: UniffiGcObject;
3521
+ readonly [pointerLiteralSymbol]: UniffiHandle;
3522
+ // No primary constructor declared for this class.
3523
+ private constructor(pointer: UniffiHandle) {
3524
+ super();
3525
+ this[pointerLiteralSymbol] = pointer;
3526
+ this[destructorGuardSymbol] =
3527
+ uniffiTypeNotificationHolderObjectFactory.bless(pointer);
3528
+ }
3529
+
3530
+ /**
3531
+ * Cancel the currently pending `next_notification()` wait.
3532
+ *
3533
+ * Causes a blocked `next_notification()` to return null.
3534
+ * Has no effect when no wait is active.
3535
+ * Does NOT destroy the underlying stream; subsequent calls to
3536
+ * `next_notification()` will still work.
3537
+ */
3538
+ cancelNextNotificationWait(): void {
3539
+ uniffiCaller.rustCall(
3540
+ /*caller:*/ (callStatus) => {
3541
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_notificationholder_cancel_next_notification_wait(
3542
+ uniffiTypeNotificationHolderObjectFactory.clonePointer(this),
3543
+ callStatus
3544
+ );
3545
+ },
3546
+ /*liftString:*/ FfiConverterString.lift
3547
+ );
3548
+ }
3549
+
3550
+ /**
3551
+ * Wait for the next notification.
3552
+ *
3553
+ * Returns null if the wait was cancelled via `cancel_next_notification_wait()`
3554
+ * or if the wallet's notification source was shut down permanently.
3555
+ *
3556
+ * After a cancellation this method can be called again normally — the
3557
+ * underlying stream is preserved and a fresh cancel channel is set up on
3558
+ * every entry.
3559
+ *
3560
+ * Throws `BarkError.Internal` if called concurrently on the same holder.
3561
+ */
3562
+ async nextNotification(asyncOpts_?: {
3563
+ signal: AbortSignal;
3564
+ }): Promise<WalletNotification | undefined> /*throws*/ {
3565
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3566
+ try {
3567
+ return await uniffiRustCallAsync(
3568
+ /*rustCaller:*/ uniffiCaller,
3569
+ /*rustFutureFunc:*/ () => {
3570
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_notificationholder_next_notification(
3571
+ uniffiTypeNotificationHolderObjectFactory.clonePointer(this)
3572
+ );
3573
+ },
3574
+ /*pollFunc:*/ nativeModule()
3575
+ .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
3576
+ /*cancelFunc:*/ nativeModule()
3577
+ .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer,
3578
+ /*completeFunc:*/ nativeModule()
3579
+ .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
3580
+ /*freeFunc:*/ nativeModule()
3581
+ .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
3582
+ /*liftFunc:*/ FfiConverterOptionalTypeWalletNotification.lift.bind(
3583
+ FfiConverterOptionalTypeWalletNotification
3584
+ ),
3585
+ /*liftString:*/ FfiConverterString.lift,
3586
+ /*asyncOpts:*/ asyncOpts_,
3587
+ /*errorHandler:*/ FfiConverterTypeBarkError.lift.bind(
3588
+ FfiConverterTypeBarkError
3589
+ )
3590
+ );
3591
+ } catch (__error: any) {
3592
+ if (uniffiIsDebug && __error instanceof Error) {
3593
+ __error.stack = __stack;
3594
+ }
3595
+ throw __error;
3596
+ }
3597
+ }
3598
+
3599
+ /**
3600
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
3601
+ */
3602
+ uniffiDestroy(): void {
3603
+ const ptr = (this as any)[destructorGuardSymbol];
3604
+ if (ptr !== undefined) {
3605
+ const pointer = uniffiTypeNotificationHolderObjectFactory.pointer(this);
3606
+ uniffiTypeNotificationHolderObjectFactory.freePointer(pointer);
3607
+ uniffiTypeNotificationHolderObjectFactory.unbless(ptr);
3608
+ delete (this as any)[destructorGuardSymbol];
3609
+ }
3610
+ }
3611
+
3612
+ static instanceOf(obj: any): obj is NotificationHolder {
3613
+ return uniffiTypeNotificationHolderObjectFactory.isConcreteType(obj);
3614
+ }
3615
+ }
3616
+
3617
+ const uniffiTypeNotificationHolderObjectFactory: UniffiObjectFactory<NotificationHolderInterface> =
3618
+ (() => {
3619
+ return {
3620
+ create(pointer: UniffiHandle): NotificationHolderInterface {
3621
+ const instance = Object.create(NotificationHolder.prototype);
3622
+ instance[pointerLiteralSymbol] = pointer;
3623
+ instance[destructorGuardSymbol] = this.bless(pointer);
3624
+ instance[uniffiTypeNameSymbol] = "NotificationHolder";
3625
+ return instance;
3626
+ },
3627
+
3628
+ bless(p: UniffiHandle): UniffiGcObject {
3629
+ return uniffiCaller.rustCall(
3630
+ /*caller:*/ (status) =>
3631
+ nativeModule().ubrn_uniffi_internal_fn_method_notificationholder_ffi__bless_pointer(
3632
+ p,
3633
+ status
3634
+ ),
3635
+ /*liftString:*/ FfiConverterString.lift
3636
+ );
3637
+ },
3638
+
3639
+ unbless(ptr: UniffiGcObject) {
3640
+ ptr.markDestroyed();
3641
+ },
3642
+
3643
+ pointer(obj: NotificationHolderInterface): UniffiHandle {
3644
+ if ((obj as any)[destructorGuardSymbol] === undefined) {
3645
+ throw new UniffiInternalError.UnexpectedNullPointer();
3646
+ }
3647
+ return (obj as any)[pointerLiteralSymbol];
3648
+ },
3649
+
3650
+ clonePointer(obj: NotificationHolderInterface): UniffiHandle {
3651
+ const pointer = this.pointer(obj);
3652
+ return uniffiCaller.rustCall(
3653
+ /*caller:*/ (callStatus) =>
3654
+ nativeModule().ubrn_uniffi_bark_ffi_fn_clone_notificationholder(
3655
+ pointer,
3656
+ callStatus
3657
+ ),
3658
+ /*liftString:*/ FfiConverterString.lift
3659
+ );
3660
+ },
3661
+
3662
+ freePointer(pointer: UniffiHandle): void {
3663
+ uniffiCaller.rustCall(
3664
+ /*caller:*/ (callStatus) =>
3665
+ nativeModule().ubrn_uniffi_bark_ffi_fn_free_notificationholder(
3666
+ pointer,
3667
+ callStatus
3668
+ ),
3669
+ /*liftString:*/ FfiConverterString.lift
3670
+ );
3671
+ },
3672
+
3673
+ isConcreteType(obj: any): obj is NotificationHolderInterface {
3674
+ return (
3675
+ obj[destructorGuardSymbol] &&
3676
+ obj[uniffiTypeNameSymbol] === "NotificationHolder"
3677
+ );
3678
+ },
3679
+ };
3680
+ })();
3681
+ // FfiConverter for NotificationHolderInterface
3682
+ const FfiConverterTypeNotificationHolder = new FfiConverterObject(
3683
+ uniffiTypeNotificationHolderObjectFactory
3684
+ );
3685
+
3268
3686
  /**
3269
3687
  * Onchain Bitcoin wallet for boarding and exits
3270
3688
  *
@@ -3770,6 +4188,18 @@ export interface WalletInterface {
3770
4188
  * Get all wallet movements (transaction history)
3771
4189
  */
3772
4190
  history(): /*throws*/ Array<Movement>;
4191
+ /**
4192
+ * Get wallet movements filtered by payment method
4193
+ *
4194
+ * # Arguments
4195
+ *
4196
+ * * `payment_method_type` - Type (e.g. "ark", "bitcoin", "invoice", "offer", "lightning_address", "custom")
4197
+ * * `payment_method_value` - Value (e.g. an address or invoice string)
4198
+ */
4199
+ historyByPaymentMethod(
4200
+ paymentMethodType: string,
4201
+ paymentMethodValue: string
4202
+ ): /*throws*/ Array<Movement>;
3773
4203
  /**
3774
4204
  * Import a serialized VTXO into the wallet
3775
4205
  *
@@ -3863,6 +4293,14 @@ export interface WalletInterface {
3863
4293
  * Returns an error if the server hasn't provided round timing info
3864
4294
  */
3865
4295
  nextRoundStartTime(): /*throws*/ /*u64*/ bigint;
4296
+ /**
4297
+ * Get a pull-based notification holder for this wallet.
4298
+ *
4299
+ * Call `next_notification()` in a loop to receive events.
4300
+ * Call `cancel_next_notification_wait()` to unblock a pending wait without
4301
+ * destroying the stream.
4302
+ */
4303
+ notifications(): NotificationHolderInterface;
3866
4304
  offboardAll(bitcoinAddress: string): /*throws*/ OffboardResult;
3867
4305
  /**
3868
4306
  * Offboard specific VTXOs to a Bitcoin address
@@ -3893,9 +4331,13 @@ export interface WalletInterface {
3893
4331
  amountSats: /*u64*/ bigint | undefined
3894
4332
  ): /*throws*/ LightningSend;
3895
4333
  /**
3896
- * Peek at an address at a specific index
4334
+ * DEPRECATED: use `peek_address` instead
3897
4335
  */
3898
4336
  peakAddress(index: /*u32*/ number): /*throws*/ string;
4337
+ /**
4338
+ * Peek at an address at a specific index
4339
+ */
4340
+ peekAddress(index: /*u32*/ number): /*throws*/ string;
3899
4341
  /**
3900
4342
  * Get all VTXOs that are part of pending boards
3901
4343
  */
@@ -4017,7 +4459,9 @@ export interface WalletInterface {
4017
4459
  * Sync pending board transactions
4018
4460
  */
4019
4461
  syncPendingBoards(): /*throws*/ void;
4020
- tryClaimAllLightningReceives(wait: boolean): /*throws*/ void;
4462
+ tryClaimAllLightningReceives(
4463
+ wait: boolean
4464
+ ): /*throws*/ Array<LightningReceive>;
4021
4465
  /**
4022
4466
  * Try to claim a specific lightning receive by payment hash
4023
4467
  *
@@ -4871,6 +5315,36 @@ export class Wallet extends UniffiAbstractObject implements WalletInterface {
4871
5315
  );
4872
5316
  }
4873
5317
 
5318
+ /**
5319
+ * Get wallet movements filtered by payment method
5320
+ *
5321
+ * # Arguments
5322
+ *
5323
+ * * `payment_method_type` - Type (e.g. "ark", "bitcoin", "invoice", "offer", "lightning_address", "custom")
5324
+ * * `payment_method_value` - Value (e.g. an address or invoice string)
5325
+ */
5326
+ historyByPaymentMethod(
5327
+ paymentMethodType: string,
5328
+ paymentMethodValue: string
5329
+ ): Array<Movement> /*throws*/ {
5330
+ return FfiConverterArrayTypeMovement.lift(
5331
+ uniffiCaller.rustCallWithError(
5332
+ /*liftError:*/ FfiConverterTypeBarkError.lift.bind(
5333
+ FfiConverterTypeBarkError
5334
+ ),
5335
+ /*caller:*/ (callStatus) => {
5336
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_history_by_payment_method(
5337
+ uniffiTypeWalletObjectFactory.clonePointer(this),
5338
+ FfiConverterString.lower(paymentMethodType),
5339
+ FfiConverterString.lower(paymentMethodValue),
5340
+ callStatus
5341
+ );
5342
+ },
5343
+ /*liftString:*/ FfiConverterString.lift
5344
+ )
5345
+ );
5346
+ }
5347
+
4874
5348
  /**
4875
5349
  * Import a serialized VTXO into the wallet
4876
5350
  *
@@ -5198,6 +5672,27 @@ export class Wallet extends UniffiAbstractObject implements WalletInterface {
5198
5672
  );
5199
5673
  }
5200
5674
 
5675
+ /**
5676
+ * Get a pull-based notification holder for this wallet.
5677
+ *
5678
+ * Call `next_notification()` in a loop to receive events.
5679
+ * Call `cancel_next_notification_wait()` to unblock a pending wait without
5680
+ * destroying the stream.
5681
+ */
5682
+ notifications(): NotificationHolderInterface {
5683
+ return FfiConverterTypeNotificationHolder.lift(
5684
+ uniffiCaller.rustCall(
5685
+ /*caller:*/ (callStatus) => {
5686
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_notifications(
5687
+ uniffiTypeWalletObjectFactory.clonePointer(this),
5688
+ callStatus
5689
+ );
5690
+ },
5691
+ /*liftString:*/ FfiConverterString.lift
5692
+ )
5693
+ );
5694
+ }
5695
+
5201
5696
  offboardAll(bitcoinAddress: string): OffboardResult /*throws*/ {
5202
5697
  return FfiConverterTypeOffboardResult.lift(
5203
5698
  uniffiCaller.rustCallWithError(
@@ -5318,7 +5813,7 @@ export class Wallet extends UniffiAbstractObject implements WalletInterface {
5318
5813
  }
5319
5814
 
5320
5815
  /**
5321
- * Peek at an address at a specific index
5816
+ * DEPRECATED: use `peek_address` instead
5322
5817
  */
5323
5818
  peakAddress(index: /*u32*/ number): string /*throws*/ {
5324
5819
  return FfiConverterString.lift(
@@ -5338,6 +5833,27 @@ export class Wallet extends UniffiAbstractObject implements WalletInterface {
5338
5833
  );
5339
5834
  }
5340
5835
 
5836
+ /**
5837
+ * Peek at an address at a specific index
5838
+ */
5839
+ peekAddress(index: /*u32*/ number): string /*throws*/ {
5840
+ return FfiConverterString.lift(
5841
+ uniffiCaller.rustCallWithError(
5842
+ /*liftError:*/ FfiConverterTypeBarkError.lift.bind(
5843
+ FfiConverterTypeBarkError
5844
+ ),
5845
+ /*caller:*/ (callStatus) => {
5846
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_peek_address(
5847
+ uniffiTypeWalletObjectFactory.clonePointer(this),
5848
+ FfiConverterUInt32.lower(index),
5849
+ callStatus
5850
+ );
5851
+ },
5852
+ /*liftString:*/ FfiConverterString.lift
5853
+ )
5854
+ );
5855
+ }
5856
+
5341
5857
  /**
5342
5858
  * Get all VTXOs that are part of pending boards
5343
5859
  */
@@ -5824,19 +6340,23 @@ export class Wallet extends UniffiAbstractObject implements WalletInterface {
5824
6340
  );
5825
6341
  }
5826
6342
 
5827
- tryClaimAllLightningReceives(wait: boolean): void /*throws*/ {
5828
- uniffiCaller.rustCallWithError(
5829
- /*liftError:*/ FfiConverterTypeBarkError.lift.bind(
5830
- FfiConverterTypeBarkError
5831
- ),
5832
- /*caller:*/ (callStatus) => {
5833
- nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_try_claim_all_lightning_receives(
5834
- uniffiTypeWalletObjectFactory.clonePointer(this),
5835
- FfiConverterBool.lower(wait),
5836
- callStatus
5837
- );
5838
- },
5839
- /*liftString:*/ FfiConverterString.lift
6343
+ tryClaimAllLightningReceives(
6344
+ wait: boolean
6345
+ ): Array<LightningReceive> /*throws*/ {
6346
+ return FfiConverterArrayTypeLightningReceive.lift(
6347
+ uniffiCaller.rustCallWithError(
6348
+ /*liftError:*/ FfiConverterTypeBarkError.lift.bind(
6349
+ FfiConverterTypeBarkError
6350
+ ),
6351
+ /*caller:*/ (callStatus) => {
6352
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_try_claim_all_lightning_receives(
6353
+ uniffiTypeWalletObjectFactory.clonePointer(this),
6354
+ FfiConverterBool.lower(wait),
6355
+ callStatus
6356
+ );
6357
+ },
6358
+ /*liftString:*/ FfiConverterString.lift
6359
+ )
5840
6360
  );
5841
6361
  }
5842
6362
 
@@ -6079,6 +6599,11 @@ const FfiConverterArrayTypeVtxo = new FfiConverterArray(FfiConverterTypeVtxo);
6079
6599
  // FfiConverter for Array<string>
6080
6600
  const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
6081
6601
 
6602
+ // FfiConverter for WalletNotification | undefined
6603
+ const FfiConverterOptionalTypeWalletNotification = new FfiConverterOptional(
6604
+ FfiConverterTypeWalletNotification
6605
+ );
6606
+
6082
6607
  // FfiConverter for Array<string> | undefined
6083
6608
  const FfiConverterOptionalArrayString = new FfiConverterOptional(
6084
6609
  FfiConverterArrayString
@@ -6138,6 +6663,22 @@ function uniffiEnsureInitialized() {
6138
6663
  "uniffi_bark_ffi_checksum_func_validate_mnemonic"
6139
6664
  );
6140
6665
  }
6666
+ if (
6667
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_method_notificationholder_cancel_next_notification_wait() !==
6668
+ 48074
6669
+ ) {
6670
+ throw new UniffiInternalError.ApiChecksumMismatch(
6671
+ "uniffi_bark_ffi_checksum_method_notificationholder_cancel_next_notification_wait"
6672
+ );
6673
+ }
6674
+ if (
6675
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_method_notificationholder_next_notification() !==
6676
+ 10262
6677
+ ) {
6678
+ throw new UniffiInternalError.ApiChecksumMismatch(
6679
+ "uniffi_bark_ffi_checksum_method_notificationholder_next_notification"
6680
+ );
6681
+ }
6141
6682
  if (
6142
6683
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_onchainwallet_balance() !==
6143
6684
  22016
@@ -6410,6 +6951,14 @@ function uniffiEnsureInitialized() {
6410
6951
  "uniffi_bark_ffi_checksum_method_wallet_history"
6411
6952
  );
6412
6953
  }
6954
+ if (
6955
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_history_by_payment_method() !==
6956
+ 52617
6957
+ ) {
6958
+ throw new UniffiInternalError.ApiChecksumMismatch(
6959
+ "uniffi_bark_ffi_checksum_method_wallet_history_by_payment_method"
6960
+ );
6961
+ }
6413
6962
  if (
6414
6963
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_import_vtxo() !==
6415
6964
  31318
@@ -6530,6 +7079,14 @@ function uniffiEnsureInitialized() {
6530
7079
  "uniffi_bark_ffi_checksum_method_wallet_next_round_start_time"
6531
7080
  );
6532
7081
  }
7082
+ if (
7083
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_notifications() !==
7084
+ 32641
7085
+ ) {
7086
+ throw new UniffiInternalError.ApiChecksumMismatch(
7087
+ "uniffi_bark_ffi_checksum_method_wallet_notifications"
7088
+ );
7089
+ }
6533
7090
  if (
6534
7091
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_offboard_all() !==
6535
7092
  61123
@@ -6578,6 +7135,14 @@ function uniffiEnsureInitialized() {
6578
7135
  "uniffi_bark_ffi_checksum_method_wallet_peak_address"
6579
7136
  );
6580
7137
  }
7138
+ if (
7139
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_peek_address() !==
7140
+ 35297
7141
+ ) {
7142
+ throw new UniffiInternalError.ApiChecksumMismatch(
7143
+ "uniffi_bark_ffi_checksum_method_wallet_peek_address"
7144
+ );
7145
+ }
6581
7146
  if (
6582
7147
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_pending_board_vtxos() !==
6583
7148
  58145
@@ -6763,7 +7328,7 @@ function uniffiEnsureInitialized() {
6763
7328
  }
6764
7329
  if (
6765
7330
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_try_claim_all_lightning_receives() !==
6766
- 53132
7331
+ 8587
6767
7332
  ) {
6768
7333
  throw new UniffiInternalError.ApiChecksumMismatch(
6769
7334
  "uniffi_bark_ffi_checksum_method_wallet_try_claim_all_lightning_receives"
@@ -6936,6 +7501,7 @@ export default Object.freeze({
6936
7501
  FfiConverterTypeLightningSend,
6937
7502
  FfiConverterTypeMovement,
6938
7503
  FfiConverterTypeNetwork,
7504
+ FfiConverterTypeNotificationHolder,
6939
7505
  FfiConverterTypeOffboardResult,
6940
7506
  FfiConverterTypeOnchainBalance,
6941
7507
  FfiConverterTypeOnchainWallet,
@@ -6944,6 +7510,7 @@ export default Object.freeze({
6944
7510
  FfiConverterTypeRoundState,
6945
7511
  FfiConverterTypeVtxo,
6946
7512
  FfiConverterTypeWallet,
7513
+ FfiConverterTypeWalletNotification,
6947
7514
  FfiConverterTypeWalletProperties,
6948
7515
  },
6949
7516
  });