@breeztech/breez-sdk-spark-react-native 0.24.1 → 0.25.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.
@@ -2593,6 +2593,132 @@ const FfiConverterTypeCheckMessageResponse = (() => {
2593
2593
  return new FFIConverter();
2594
2594
  })();
2595
2595
 
2596
+ /**
2597
+ * Request for `check_unilateral_exit`: the exit you kept from a previous
2598
+ * `unilateral_exit`, as you last stored it.
2599
+ */
2600
+ export type CheckUnilateralExitRequest = {
2601
+ exit: UnilateralExitResponse;
2602
+ };
2603
+
2604
+ /**
2605
+ * Generated factory for {@link CheckUnilateralExitRequest} record objects.
2606
+ */
2607
+ export const CheckUnilateralExitRequest = (() => {
2608
+ const defaults = () => ({});
2609
+ const create = (() => {
2610
+ return uniffiCreateRecord<
2611
+ CheckUnilateralExitRequest,
2612
+ ReturnType<typeof defaults>
2613
+ >(defaults);
2614
+ })();
2615
+ return Object.freeze({
2616
+ /**
2617
+ * Create a frozen instance of {@link CheckUnilateralExitRequest}, with defaults specified
2618
+ * in Rust, in the {@link breez_sdk_spark} crate.
2619
+ */
2620
+ create,
2621
+
2622
+ /**
2623
+ * Create a frozen instance of {@link CheckUnilateralExitRequest}, with defaults specified
2624
+ * in Rust, in the {@link breez_sdk_spark} crate.
2625
+ */
2626
+ new: create,
2627
+
2628
+ /**
2629
+ * Defaults specified in the {@link breez_sdk_spark} crate.
2630
+ */
2631
+ defaults: () =>
2632
+ Object.freeze(defaults()) as Partial<CheckUnilateralExitRequest>,
2633
+ });
2634
+ })();
2635
+
2636
+ const FfiConverterTypeCheckUnilateralExitRequest = (() => {
2637
+ type TypeName = CheckUnilateralExitRequest;
2638
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
2639
+ read(from: RustBuffer): TypeName {
2640
+ return {
2641
+ exit: FfiConverterTypeUnilateralExitResponse.read(from),
2642
+ };
2643
+ }
2644
+ write(value: TypeName, into: RustBuffer): void {
2645
+ FfiConverterTypeUnilateralExitResponse.write(value.exit, into);
2646
+ }
2647
+ allocationSize(value: TypeName): number {
2648
+ return FfiConverterTypeUnilateralExitResponse.allocationSize(value.exit);
2649
+ }
2650
+ }
2651
+ return new FFIConverter();
2652
+ })();
2653
+
2654
+ /**
2655
+ * Result of `check_unilateral_exit`: the same exit, read back against the
2656
+ * chain.
2657
+ */
2658
+ export type CheckUnilateralExitResponse = {
2659
+ /**
2660
+ * The exit with each transaction's status brought up to date. Store it in
2661
+ * place of the copy you passed in.
2662
+ */
2663
+ exit: UnilateralExitResponse;
2664
+ verdict: UnilateralExitVerdict;
2665
+ };
2666
+
2667
+ /**
2668
+ * Generated factory for {@link CheckUnilateralExitResponse} record objects.
2669
+ */
2670
+ export const CheckUnilateralExitResponse = (() => {
2671
+ const defaults = () => ({});
2672
+ const create = (() => {
2673
+ return uniffiCreateRecord<
2674
+ CheckUnilateralExitResponse,
2675
+ ReturnType<typeof defaults>
2676
+ >(defaults);
2677
+ })();
2678
+ return Object.freeze({
2679
+ /**
2680
+ * Create a frozen instance of {@link CheckUnilateralExitResponse}, with defaults specified
2681
+ * in Rust, in the {@link breez_sdk_spark} crate.
2682
+ */
2683
+ create,
2684
+
2685
+ /**
2686
+ * Create a frozen instance of {@link CheckUnilateralExitResponse}, with defaults specified
2687
+ * in Rust, in the {@link breez_sdk_spark} crate.
2688
+ */
2689
+ new: create,
2690
+
2691
+ /**
2692
+ * Defaults specified in the {@link breez_sdk_spark} crate.
2693
+ */
2694
+ defaults: () =>
2695
+ Object.freeze(defaults()) as Partial<CheckUnilateralExitResponse>,
2696
+ });
2697
+ })();
2698
+
2699
+ const FfiConverterTypeCheckUnilateralExitResponse = (() => {
2700
+ type TypeName = CheckUnilateralExitResponse;
2701
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
2702
+ read(from: RustBuffer): TypeName {
2703
+ return {
2704
+ exit: FfiConverterTypeUnilateralExitResponse.read(from),
2705
+ verdict: FfiConverterTypeUnilateralExitVerdict.read(from),
2706
+ };
2707
+ }
2708
+ write(value: TypeName, into: RustBuffer): void {
2709
+ FfiConverterTypeUnilateralExitResponse.write(value.exit, into);
2710
+ FfiConverterTypeUnilateralExitVerdict.write(value.verdict, into);
2711
+ }
2712
+ allocationSize(value: TypeName): number {
2713
+ return (
2714
+ FfiConverterTypeUnilateralExitResponse.allocationSize(value.exit) +
2715
+ FfiConverterTypeUnilateralExitVerdict.allocationSize(value.verdict)
2716
+ );
2717
+ }
2718
+ }
2719
+ return new FFIConverter();
2720
+ })();
2721
+
2596
2722
  /**
2597
2723
  * What one way of claiming a deposit costs.
2598
2724
  */
@@ -3280,6 +3406,75 @@ const FfiConverterTypeConfig = (() => {
3280
3406
  return new FFIConverter();
3281
3407
  })();
3282
3408
 
3409
+ /**
3410
+ * A node of the exit tree that is already on-chain.
3411
+ */
3412
+ export type ConfirmedExitNode = {
3413
+ nodeId: string;
3414
+ confirmedBy: ExitNodeConfirmation;
3415
+ /**
3416
+ * The block it is in, where that is known. Unset for a node put in a block
3417
+ * by a descendant's confirmation rather than read directly.
3418
+ */
3419
+ blockHeight: /*u32*/ number | undefined;
3420
+ };
3421
+
3422
+ /**
3423
+ * Generated factory for {@link ConfirmedExitNode} record objects.
3424
+ */
3425
+ export const ConfirmedExitNode = (() => {
3426
+ const defaults = () => ({});
3427
+ const create = (() => {
3428
+ return uniffiCreateRecord<ConfirmedExitNode, ReturnType<typeof defaults>>(
3429
+ defaults
3430
+ );
3431
+ })();
3432
+ return Object.freeze({
3433
+ /**
3434
+ * Create a frozen instance of {@link ConfirmedExitNode}, with defaults specified
3435
+ * in Rust, in the {@link breez_sdk_spark} crate.
3436
+ */
3437
+ create,
3438
+
3439
+ /**
3440
+ * Create a frozen instance of {@link ConfirmedExitNode}, with defaults specified
3441
+ * in Rust, in the {@link breez_sdk_spark} crate.
3442
+ */
3443
+ new: create,
3444
+
3445
+ /**
3446
+ * Defaults specified in the {@link breez_sdk_spark} crate.
3447
+ */
3448
+ defaults: () => Object.freeze(defaults()) as Partial<ConfirmedExitNode>,
3449
+ });
3450
+ })();
3451
+
3452
+ const FfiConverterTypeConfirmedExitNode = (() => {
3453
+ type TypeName = ConfirmedExitNode;
3454
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
3455
+ read(from: RustBuffer): TypeName {
3456
+ return {
3457
+ nodeId: FfiConverterString.read(from),
3458
+ confirmedBy: FfiConverterTypeExitNodeConfirmation.read(from),
3459
+ blockHeight: FfiConverterOptionalUInt32.read(from),
3460
+ };
3461
+ }
3462
+ write(value: TypeName, into: RustBuffer): void {
3463
+ FfiConverterString.write(value.nodeId, into);
3464
+ FfiConverterTypeExitNodeConfirmation.write(value.confirmedBy, into);
3465
+ FfiConverterOptionalUInt32.write(value.blockHeight, into);
3466
+ }
3467
+ allocationSize(value: TypeName): number {
3468
+ return (
3469
+ FfiConverterString.allocationSize(value.nodeId) +
3470
+ FfiConverterTypeExitNodeConfirmation.allocationSize(value.confirmedBy) +
3471
+ FfiConverterOptionalUInt32.allocationSize(value.blockHeight)
3472
+ );
3473
+ }
3474
+ }
3475
+ return new FFIConverter();
3476
+ })();
3477
+
3283
3478
  export type ConnectRequest = {
3284
3479
  config: Config;
3285
3480
  seed: Seed;
@@ -4553,16 +4748,16 @@ export type CrossChainConfig = {
4553
4748
  /**
4554
4749
  * Default maximum slippage in basis points used when
4555
4750
  * [`PaymentRequest::CrossChain::max_slippage_bps`] is not set on the
4556
- * prepare request. Must be in `10..=500`. Falls back to 100 bps (1%)
4557
- * when this field is `None`.
4751
+ * prepare request. Must be in 10 to 500. Falls back to 100 bps (1%)
4752
+ * when this field is unset.
4558
4753
  */
4559
4754
  defaultSlippageBps: /*u32*/ number | undefined;
4560
4755
  /**
4561
4756
  * Default target-overpay pad in basis points applied to the user's
4562
4757
  * destination amount on `FeesExcluded` conversion sends. Bumps the
4563
4758
  * target upward before quoting so the recipient lands at or above the
4564
- * requested amount despite provider slippage. Must be in `0..=500`.
4565
- * Falls back to 15 bps when `None`.
4759
+ * requested amount despite provider slippage. Must be in 0 to 500.
4760
+ * Falls back to 15 bps when unset.
4566
4761
  */
4567
4762
  defaultTargetOverpayBps: /*u32*/ number | undefined;
4568
4763
  };
@@ -4623,6 +4818,127 @@ const FfiConverterTypeCrossChainConfig = (() => {
4623
4818
  return new FFIConverter();
4624
4819
  })();
4625
4820
 
4821
+ /**
4822
+ * Information about the cross-chain receive quote.
4823
+ */
4824
+ export type CrossChainReceiveInfo = {
4825
+ /**
4826
+ * Bare external deposit address the sender pays to.
4827
+ */
4828
+ depositAddress: string;
4829
+ /**
4830
+ * Amount the sender must deposit, in source-asset base units
4831
+ * (`route.decimals`). On `FeesExcluded` this may differ from the
4832
+ * request's `amount` because the SDK inflates the deposit to absorb
4833
+ * provider fees. Render this value to the sender.
4834
+ */
4835
+ depositAmount: U128;
4836
+ /**
4837
+ * Amount the receiver will see, net of provider fees, in
4838
+ * destination-asset base units. Sats when receiving BTC into Spark,
4839
+ * or token base units when receiving a Spark token (e.g. USDB). The
4840
+ * final delivered amount may move within the slippage tolerance.
4841
+ */
4842
+ expectedReceivedAmount: U128;
4843
+ /**
4844
+ * Symbol of the Spark-side asset `expected_received_amount` is
4845
+ * denominated in, as the provider reports it: `"BTC"` for sats, or the
4846
+ * token symbol (e.g. `"USDB"`).
4847
+ */
4848
+ destinationAsset: string;
4849
+ /**
4850
+ * Spark token identifier when the destination is a token. Absent when
4851
+ * the destination is BTC and the receiver will see sats.
4852
+ */
4853
+ tokenIdentifier: string | undefined;
4854
+ /**
4855
+ * Provider-quoted total fee for this receive, in `service_fee_asset`
4856
+ * units.
4857
+ */
4858
+ serviceFeeAmount: U128;
4859
+ /**
4860
+ * Ticker for `service_fee_amount`. Absent when the fee is denominated
4861
+ * in sats.
4862
+ */
4863
+ serviceFeeAsset: string | undefined;
4864
+ /**
4865
+ * Quote expiry as a unix timestamp in seconds.
4866
+ */
4867
+ expiresAt: /*u64*/ bigint;
4868
+ };
4869
+
4870
+ /**
4871
+ * Generated factory for {@link CrossChainReceiveInfo} record objects.
4872
+ */
4873
+ export const CrossChainReceiveInfo = (() => {
4874
+ const defaults = () => ({});
4875
+ const create = (() => {
4876
+ return uniffiCreateRecord<
4877
+ CrossChainReceiveInfo,
4878
+ ReturnType<typeof defaults>
4879
+ >(defaults);
4880
+ })();
4881
+ return Object.freeze({
4882
+ /**
4883
+ * Create a frozen instance of {@link CrossChainReceiveInfo}, with defaults specified
4884
+ * in Rust, in the {@link breez_sdk_spark} crate.
4885
+ */
4886
+ create,
4887
+
4888
+ /**
4889
+ * Create a frozen instance of {@link CrossChainReceiveInfo}, with defaults specified
4890
+ * in Rust, in the {@link breez_sdk_spark} crate.
4891
+ */
4892
+ new: create,
4893
+
4894
+ /**
4895
+ * Defaults specified in the {@link breez_sdk_spark} crate.
4896
+ */
4897
+ defaults: () => Object.freeze(defaults()) as Partial<CrossChainReceiveInfo>,
4898
+ });
4899
+ })();
4900
+
4901
+ const FfiConverterTypeCrossChainReceiveInfo = (() => {
4902
+ type TypeName = CrossChainReceiveInfo;
4903
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
4904
+ read(from: RustBuffer): TypeName {
4905
+ return {
4906
+ depositAddress: FfiConverterString.read(from),
4907
+ depositAmount: FfiConverterTypeu128.read(from),
4908
+ expectedReceivedAmount: FfiConverterTypeu128.read(from),
4909
+ destinationAsset: FfiConverterString.read(from),
4910
+ tokenIdentifier: FfiConverterOptionalString.read(from),
4911
+ serviceFeeAmount: FfiConverterTypeu128.read(from),
4912
+ serviceFeeAsset: FfiConverterOptionalString.read(from),
4913
+ expiresAt: FfiConverterUInt64.read(from),
4914
+ };
4915
+ }
4916
+ write(value: TypeName, into: RustBuffer): void {
4917
+ FfiConverterString.write(value.depositAddress, into);
4918
+ FfiConverterTypeu128.write(value.depositAmount, into);
4919
+ FfiConverterTypeu128.write(value.expectedReceivedAmount, into);
4920
+ FfiConverterString.write(value.destinationAsset, into);
4921
+ FfiConverterOptionalString.write(value.tokenIdentifier, into);
4922
+ FfiConverterTypeu128.write(value.serviceFeeAmount, into);
4923
+ FfiConverterOptionalString.write(value.serviceFeeAsset, into);
4924
+ FfiConverterUInt64.write(value.expiresAt, into);
4925
+ }
4926
+ allocationSize(value: TypeName): number {
4927
+ return (
4928
+ FfiConverterString.allocationSize(value.depositAddress) +
4929
+ FfiConverterTypeu128.allocationSize(value.depositAmount) +
4930
+ FfiConverterTypeu128.allocationSize(value.expectedReceivedAmount) +
4931
+ FfiConverterString.allocationSize(value.destinationAsset) +
4932
+ FfiConverterOptionalString.allocationSize(value.tokenIdentifier) +
4933
+ FfiConverterTypeu128.allocationSize(value.serviceFeeAmount) +
4934
+ FfiConverterOptionalString.allocationSize(value.serviceFeeAsset) +
4935
+ FfiConverterUInt64.allocationSize(value.expiresAt)
4936
+ );
4937
+ }
4938
+ }
4939
+ return new FFIConverter();
4940
+ })();
4941
+
4626
4942
  /**
4627
4943
  * A single route available for cross-chain transfers, tagged with the provider
4628
4944
  * that offers it. Returned by `get_cross_chain_routes()`.
@@ -4633,17 +4949,17 @@ export type CrossChainRoutePair = {
4633
4949
  */
4634
4950
  provider: CrossChainProvider;
4635
4951
  /**
4636
- * Destination blockchain (e.g. `"base"`, `"solana"`, `"tron"`).
4952
+ * External blockchain (e.g. `"base"`, `"solana"`, `"tron"`).
4637
4953
  */
4638
4954
  chain: string;
4639
4955
  /**
4640
- * Stable chain identifier (e.g. EVM `chainId` as a decimal string).
4956
+ * External chain identifier (e.g. EVM `chainId` as a decimal string).
4641
4957
  * `None` for non-EVM chains that don't expose one, or when the
4642
4958
  * provider doesn't surface it.
4643
4959
  */
4644
4960
  chainId: string | undefined;
4645
4961
  /**
4646
- * Destination asset symbol (e.g. `"USDC"`, `"USDT"`).
4962
+ * External asset symbol (e.g. `"USDC"`, `"USDT"`).
4647
4963
  */
4648
4964
  asset: string;
4649
4965
  /**
@@ -4659,22 +4975,14 @@ export type CrossChainRoutePair = {
4659
4975
  */
4660
4976
  exactOutEligible: boolean;
4661
4977
  /**
4662
- * The source assets this route accepts on the Spark side.
4663
- *
4664
- * Boltz routes accept `[SourceAsset::Bitcoin]`. Orchestra routes accept
4665
- * one or more of `Bitcoin` / `Token(...)` (a given destination endpoint
4666
- * may be fronted by multiple source variants on Orchestra).
4978
+ * Spark-side assets this route accepts.
4667
4979
  */
4668
- supportedSources: Array<SourceAsset>;
4980
+ acceptedAssets: Array<SparkAsset>;
4669
4981
  /**
4670
- * The chains this route can be paid over, orthogonal to
4671
- * `supported_sources` (the asset moved).
4672
- *
4673
- * This is the actual funding rail, which differs by provider: Boltz routes
4674
- * are always paid over Lightning. Orchestra send routes report Spark, and
4675
- * Orchestra payment-link routes report Lightning.
4982
+ * Rails this route can be delivered over, orthogonal to
4983
+ * `accepted_assets` (the asset moved vs the rail moved on).
4676
4984
  */
4677
- supportedSourceChains: Array<SourceChain>;
4985
+ deliveryMethods: Array<DeliveryMethod>;
4678
4986
  };
4679
4987
 
4680
4988
  /**
@@ -4719,8 +5027,8 @@ const FfiConverterTypeCrossChainRoutePair = (() => {
4719
5027
  contractAddress: FfiConverterOptionalString.read(from),
4720
5028
  decimals: FfiConverterUInt8.read(from),
4721
5029
  exactOutEligible: FfiConverterBool.read(from),
4722
- supportedSources: FfiConverterArrayTypeSourceAsset.read(from),
4723
- supportedSourceChains: FfiConverterArrayTypeSourceChain.read(from),
5030
+ acceptedAssets: FfiConverterArrayTypeSparkAsset.read(from),
5031
+ deliveryMethods: FfiConverterArrayTypeDeliveryMethod.read(from),
4724
5032
  };
4725
5033
  }
4726
5034
  write(value: TypeName, into: RustBuffer): void {
@@ -4731,8 +5039,8 @@ const FfiConverterTypeCrossChainRoutePair = (() => {
4731
5039
  FfiConverterOptionalString.write(value.contractAddress, into);
4732
5040
  FfiConverterUInt8.write(value.decimals, into);
4733
5041
  FfiConverterBool.write(value.exactOutEligible, into);
4734
- FfiConverterArrayTypeSourceAsset.write(value.supportedSources, into);
4735
- FfiConverterArrayTypeSourceChain.write(value.supportedSourceChains, into);
5042
+ FfiConverterArrayTypeSparkAsset.write(value.acceptedAssets, into);
5043
+ FfiConverterArrayTypeDeliveryMethod.write(value.deliveryMethods, into);
4736
5044
  }
4737
5045
  allocationSize(value: TypeName): number {
4738
5046
  return (
@@ -4743,11 +5051,9 @@ const FfiConverterTypeCrossChainRoutePair = (() => {
4743
5051
  FfiConverterOptionalString.allocationSize(value.contractAddress) +
4744
5052
  FfiConverterUInt8.allocationSize(value.decimals) +
4745
5053
  FfiConverterBool.allocationSize(value.exactOutEligible) +
4746
- FfiConverterArrayTypeSourceAsset.allocationSize(
4747
- value.supportedSources
4748
- ) +
4749
- FfiConverterArrayTypeSourceChain.allocationSize(
4750
- value.supportedSourceChains
5054
+ FfiConverterArrayTypeSparkAsset.allocationSize(value.acceptedAssets) +
5055
+ FfiConverterArrayTypeDeliveryMethod.allocationSize(
5056
+ value.deliveryMethods
4751
5057
  )
4752
5058
  );
4753
5059
  }
@@ -5174,6 +5480,166 @@ const FfiConverterTypeEcdsaSignatureBytes = (() => {
5174
5480
  return new FFIConverter();
5175
5481
  })();
5176
5482
 
5483
+ /**
5484
+ * What the chain has already done to an exit's leaves, as
5485
+ * `prepare_unilateral_exit` found it. Pass it back to `unilateral_exit`, which
5486
+ * builds only the steps it does not cover.
5487
+ */
5488
+ export type ExitChainState = {
5489
+ /**
5490
+ * Nodes whose transaction is on-chain.
5491
+ */
5492
+ confirmedNodes: Array<ConfirmedExitNode>;
5493
+ /**
5494
+ * Leaves whose refund reached the chain.
5495
+ */
5496
+ refunds: Array<ExitRefund>;
5497
+ /**
5498
+ * Leaves whose lineage was taken on-chain by a transaction the exit cannot
5499
+ * continue from. Nothing further can be driven for them.
5500
+ */
5501
+ stoppedLeafIds: Array<string>;
5502
+ /**
5503
+ * Nodes a chain lookup could not read, so their state is unknown rather
5504
+ * than absent. Transactions depending on them come back
5505
+ * `ExitTransactionStatus::Unverified`.
5506
+ */
5507
+ unverifiedNodeIds: Array<string>;
5508
+ /**
5509
+ * Nodes taken to be on-chain on the operators' word, the chain itself being
5510
+ * unreadable. Their spend is invisible, so anything built over them risks
5511
+ * double-spending an output that is already gone.
5512
+ */
5513
+ unverifiableConfirmedNodeIds: Array<string>;
5514
+ };
5515
+
5516
+ /**
5517
+ * Generated factory for {@link ExitChainState} record objects.
5518
+ */
5519
+ export const ExitChainState = (() => {
5520
+ const defaults = () => ({});
5521
+ const create = (() => {
5522
+ return uniffiCreateRecord<ExitChainState, ReturnType<typeof defaults>>(
5523
+ defaults
5524
+ );
5525
+ })();
5526
+ return Object.freeze({
5527
+ /**
5528
+ * Create a frozen instance of {@link ExitChainState}, with defaults specified
5529
+ * in Rust, in the {@link breez_sdk_spark} crate.
5530
+ */
5531
+ create,
5532
+
5533
+ /**
5534
+ * Create a frozen instance of {@link ExitChainState}, with defaults specified
5535
+ * in Rust, in the {@link breez_sdk_spark} crate.
5536
+ */
5537
+ new: create,
5538
+
5539
+ /**
5540
+ * Defaults specified in the {@link breez_sdk_spark} crate.
5541
+ */
5542
+ defaults: () => Object.freeze(defaults()) as Partial<ExitChainState>,
5543
+ });
5544
+ })();
5545
+
5546
+ const FfiConverterTypeExitChainState = (() => {
5547
+ type TypeName = ExitChainState;
5548
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
5549
+ read(from: RustBuffer): TypeName {
5550
+ return {
5551
+ confirmedNodes: FfiConverterArrayTypeConfirmedExitNode.read(from),
5552
+ refunds: FfiConverterArrayTypeExitRefund.read(from),
5553
+ stoppedLeafIds: FfiConverterArrayString.read(from),
5554
+ unverifiedNodeIds: FfiConverterArrayString.read(from),
5555
+ unverifiableConfirmedNodeIds: FfiConverterArrayString.read(from),
5556
+ };
5557
+ }
5558
+ write(value: TypeName, into: RustBuffer): void {
5559
+ FfiConverterArrayTypeConfirmedExitNode.write(value.confirmedNodes, into);
5560
+ FfiConverterArrayTypeExitRefund.write(value.refunds, into);
5561
+ FfiConverterArrayString.write(value.stoppedLeafIds, into);
5562
+ FfiConverterArrayString.write(value.unverifiedNodeIds, into);
5563
+ FfiConverterArrayString.write(value.unverifiableConfirmedNodeIds, into);
5564
+ }
5565
+ allocationSize(value: TypeName): number {
5566
+ return (
5567
+ FfiConverterArrayTypeConfirmedExitNode.allocationSize(
5568
+ value.confirmedNodes
5569
+ ) +
5570
+ FfiConverterArrayTypeExitRefund.allocationSize(value.refunds) +
5571
+ FfiConverterArrayString.allocationSize(value.stoppedLeafIds) +
5572
+ FfiConverterArrayString.allocationSize(value.unverifiedNodeIds) +
5573
+ FfiConverterArrayString.allocationSize(
5574
+ value.unverifiableConfirmedNodeIds
5575
+ )
5576
+ );
5577
+ }
5578
+ }
5579
+ return new FFIConverter();
5580
+ })();
5581
+
5582
+ /**
5583
+ * A leaf's refund as the chain shows it.
5584
+ */
5585
+ export type ExitRefund = {
5586
+ leafId: string;
5587
+ state: ExitRefundState;
5588
+ };
5589
+
5590
+ /**
5591
+ * Generated factory for {@link ExitRefund} record objects.
5592
+ */
5593
+ export const ExitRefund = (() => {
5594
+ const defaults = () => ({});
5595
+ const create = (() => {
5596
+ return uniffiCreateRecord<ExitRefund, ReturnType<typeof defaults>>(
5597
+ defaults
5598
+ );
5599
+ })();
5600
+ return Object.freeze({
5601
+ /**
5602
+ * Create a frozen instance of {@link ExitRefund}, with defaults specified
5603
+ * in Rust, in the {@link breez_sdk_spark} crate.
5604
+ */
5605
+ create,
5606
+
5607
+ /**
5608
+ * Create a frozen instance of {@link ExitRefund}, with defaults specified
5609
+ * in Rust, in the {@link breez_sdk_spark} crate.
5610
+ */
5611
+ new: create,
5612
+
5613
+ /**
5614
+ * Defaults specified in the {@link breez_sdk_spark} crate.
5615
+ */
5616
+ defaults: () => Object.freeze(defaults()) as Partial<ExitRefund>,
5617
+ });
5618
+ })();
5619
+
5620
+ const FfiConverterTypeExitRefund = (() => {
5621
+ type TypeName = ExitRefund;
5622
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
5623
+ read(from: RustBuffer): TypeName {
5624
+ return {
5625
+ leafId: FfiConverterString.read(from),
5626
+ state: FfiConverterTypeExitRefundState.read(from),
5627
+ };
5628
+ }
5629
+ write(value: TypeName, into: RustBuffer): void {
5630
+ FfiConverterString.write(value.leafId, into);
5631
+ FfiConverterTypeExitRefundState.write(value.state, into);
5632
+ }
5633
+ allocationSize(value: TypeName): number {
5634
+ return (
5635
+ FfiConverterString.allocationSize(value.leafId) +
5636
+ FfiConverterTypeExitRefundState.allocationSize(value.state)
5637
+ );
5638
+ }
5639
+ }
5640
+ return new FFIConverter();
5641
+ })();
5642
+
5177
5643
  /**
5178
5644
  * Result of `export_unilateral_exit_state`: a self-contained copy of the
5179
5645
  * wallet's exit state, ready to be stored outside the wallet.
@@ -12582,16 +13048,34 @@ export type PrepareUnilateralExitResponse = {
12582
13048
  * branches), in satoshis. Exact for the given funding kind; nodes the
12583
13049
  * operators report on-chain are assumed already paid, so a partially-exited
12584
13050
  * tree quotes a lower fee than a fresh one.
13051
+ *
13052
+ * The sum of the three components below, which say who pays what:
13053
+ * `cpfp_fee_sat + fanout_fee_sat + sweep_fee_sat`. The first two come from
13054
+ * your funding UTXO, the third off the value being recovered.
12585
13055
  */
12586
13056
  totalFeeSat: /*u64*/ bigint;
12587
13057
  /**
12588
- * The part of `total_fee_sat` paid for the fan-out transaction. Funding one
12589
- * UTXO per branch (`per_branch_funding`) avoids it. Zero for a single
12590
- * branch (no fan-out).
13058
+ * The part of `total_fee_sat` the CPFP children pay, funded by your UTXOs.
13059
+ * It does not reduce what the exit recovers.
13060
+ */
13061
+ cpfpFeeSat: /*u64*/ bigint;
13062
+ /**
13063
+ * The part of `total_fee_sat` paid for the fan-out transaction, funded by
13064
+ * your UTXO. Funding one UTXO per branch (`per_branch_funding`) avoids it.
13065
+ * Zero for a single branch (no fan-out).
12591
13066
  */
12592
13067
  fanoutFeeSat: /*u64*/ bigint;
13068
+ /**
13069
+ * The part of `total_fee_sat` the final sweep pays. The sweep takes its fee
13070
+ * from the value it moves, so this is the one component subtracted from
13071
+ * what reaches `destination`.
13072
+ */
13073
+ sweepFeeSat: /*u64*/ bigint;
12593
13074
  /**
12594
13075
  * Fund a single UTXO of at least this many satoshis to exit with a fan-out.
13076
+ * Above `cpfp_fee_sat + fanout_fee_sat` by design: it carries the sweep fee
13077
+ * and a per-branch dust allowance as headroom, both of which come back to
13078
+ * you in the sweep.
12595
13079
  */
12596
13080
  singleUtxoFundingSat: /*u64*/ bigint;
12597
13081
  /**
@@ -12604,6 +13088,12 @@ export type PrepareUnilateralExitResponse = {
12604
13088
  */
12605
13089
  feeRateSatPerVbyte: /*u64*/ bigint;
12606
13090
  destination: string;
13091
+ /**
13092
+ * What the chain has already done to these leaves, read while preparing.
13093
+ * Pass it back to `unilateral_exit`, which builds only the steps it does
13094
+ * not already cover.
13095
+ */
13096
+ exitChainState: ExitChainState;
12607
13097
  };
12608
13098
 
12609
13099
  /**
@@ -12646,35 +13136,44 @@ const FfiConverterTypePrepareUnilateralExitResponse = (() => {
12646
13136
  leaves: FfiConverterArrayTypeUnilateralExitLeaf.read(from),
12647
13137
  recoverableValueSat: FfiConverterUInt64.read(from),
12648
13138
  totalFeeSat: FfiConverterUInt64.read(from),
13139
+ cpfpFeeSat: FfiConverterUInt64.read(from),
12649
13140
  fanoutFeeSat: FfiConverterUInt64.read(from),
13141
+ sweepFeeSat: FfiConverterUInt64.read(from),
12650
13142
  singleUtxoFundingSat: FfiConverterUInt64.read(from),
12651
13143
  perBranchFunding: FfiConverterArrayTypePerBranchFunding.read(from),
12652
13144
  feeRateSatPerVbyte: FfiConverterUInt64.read(from),
12653
13145
  destination: FfiConverterString.read(from),
13146
+ exitChainState: FfiConverterTypeExitChainState.read(from),
12654
13147
  };
12655
13148
  }
12656
13149
  write(value: TypeName, into: RustBuffer): void {
12657
13150
  FfiConverterArrayTypeUnilateralExitLeaf.write(value.leaves, into);
12658
13151
  FfiConverterUInt64.write(value.recoverableValueSat, into);
12659
13152
  FfiConverterUInt64.write(value.totalFeeSat, into);
13153
+ FfiConverterUInt64.write(value.cpfpFeeSat, into);
12660
13154
  FfiConverterUInt64.write(value.fanoutFeeSat, into);
13155
+ FfiConverterUInt64.write(value.sweepFeeSat, into);
12661
13156
  FfiConverterUInt64.write(value.singleUtxoFundingSat, into);
12662
13157
  FfiConverterArrayTypePerBranchFunding.write(value.perBranchFunding, into);
12663
13158
  FfiConverterUInt64.write(value.feeRateSatPerVbyte, into);
12664
13159
  FfiConverterString.write(value.destination, into);
13160
+ FfiConverterTypeExitChainState.write(value.exitChainState, into);
12665
13161
  }
12666
13162
  allocationSize(value: TypeName): number {
12667
13163
  return (
12668
13164
  FfiConverterArrayTypeUnilateralExitLeaf.allocationSize(value.leaves) +
12669
13165
  FfiConverterUInt64.allocationSize(value.recoverableValueSat) +
12670
13166
  FfiConverterUInt64.allocationSize(value.totalFeeSat) +
13167
+ FfiConverterUInt64.allocationSize(value.cpfpFeeSat) +
12671
13168
  FfiConverterUInt64.allocationSize(value.fanoutFeeSat) +
13169
+ FfiConverterUInt64.allocationSize(value.sweepFeeSat) +
12672
13170
  FfiConverterUInt64.allocationSize(value.singleUtxoFundingSat) +
12673
13171
  FfiConverterArrayTypePerBranchFunding.allocationSize(
12674
13172
  value.perBranchFunding
12675
13173
  ) +
12676
13174
  FfiConverterUInt64.allocationSize(value.feeRateSatPerVbyte) +
12677
- FfiConverterString.allocationSize(value.destination)
13175
+ FfiConverterString.allocationSize(value.destination) +
13176
+ FfiConverterTypeExitChainState.allocationSize(value.exitChainState)
12678
13177
  );
12679
13178
  }
12680
13179
  }
@@ -13126,6 +13625,10 @@ export type ReceivePaymentResponse = {
13126
13625
  * Denominated in sats or token base units
13127
13626
  */
13128
13627
  fee: U128;
13628
+ /**
13629
+ * Optional information populated only for cross-chain receives.
13630
+ */
13631
+ crossChainInfo: CrossChainReceiveInfo | undefined;
13129
13632
  };
13130
13633
 
13131
13634
  /**
@@ -13167,16 +13670,25 @@ const FfiConverterTypeReceivePaymentResponse = (() => {
13167
13670
  return {
13168
13671
  paymentRequest: FfiConverterString.read(from),
13169
13672
  fee: FfiConverterTypeu128.read(from),
13673
+ crossChainInfo:
13674
+ FfiConverterOptionalTypeCrossChainReceiveInfo.read(from),
13170
13675
  };
13171
13676
  }
13172
13677
  write(value: TypeName, into: RustBuffer): void {
13173
13678
  FfiConverterString.write(value.paymentRequest, into);
13174
13679
  FfiConverterTypeu128.write(value.fee, into);
13680
+ FfiConverterOptionalTypeCrossChainReceiveInfo.write(
13681
+ value.crossChainInfo,
13682
+ into
13683
+ );
13175
13684
  }
13176
13685
  allocationSize(value: TypeName): number {
13177
13686
  return (
13178
13687
  FfiConverterString.allocationSize(value.paymentRequest) +
13179
- FfiConverterTypeu128.allocationSize(value.fee)
13688
+ FfiConverterTypeu128.allocationSize(value.fee) +
13689
+ FfiConverterOptionalTypeCrossChainReceiveInfo.allocationSize(
13690
+ value.crossChainInfo
13691
+ )
13180
13692
  );
13181
13693
  }
13182
13694
  }
@@ -14515,11 +15027,26 @@ const FfiConverterTypeSendBatchResponse = (() => {
14515
15027
  })();
14516
15028
 
14517
15029
  export type SendOnchainFeeQuote = {
15030
+ /**
15031
+ * Identifies the quote to the provider when the payment is sent. Empty on
15032
+ * an estimate, which no provider has issued.
15033
+ */
14518
15034
  id: string;
15035
+ /**
15036
+ * When the quote stops being honoured, as a Unix timestamp in seconds.
15037
+ * Zero on an estimate.
15038
+ */
14519
15039
  expiresAt: /*u64*/ bigint;
14520
15040
  speedFast: SendOnchainSpeedFeeQuote;
14521
15041
  speedMedium: SendOnchainSpeedFeeQuote;
14522
15042
  speedSlow: SendOnchainSpeedFeeQuote;
15043
+ /**
15044
+ * Set when the wallet holds no bitcoin and a token conversion will fund the
15045
+ * send, because the provider will not quote without funds to price against.
15046
+ * The estimate is an upper bound: the payment quotes for real once the
15047
+ * conversion lands, and fails rather than spending more than this.
15048
+ */
15049
+ isEstimate: boolean;
14523
15050
  };
14524
15051
 
14525
15052
  /**
@@ -14562,6 +15089,7 @@ const FfiConverterTypeSendOnchainFeeQuote = (() => {
14562
15089
  speedFast: FfiConverterTypeSendOnchainSpeedFeeQuote.read(from),
14563
15090
  speedMedium: FfiConverterTypeSendOnchainSpeedFeeQuote.read(from),
14564
15091
  speedSlow: FfiConverterTypeSendOnchainSpeedFeeQuote.read(from),
15092
+ isEstimate: FfiConverterBool.read(from),
14565
15093
  };
14566
15094
  }
14567
15095
  write(value: TypeName, into: RustBuffer): void {
@@ -14570,6 +15098,7 @@ const FfiConverterTypeSendOnchainFeeQuote = (() => {
14570
15098
  FfiConverterTypeSendOnchainSpeedFeeQuote.write(value.speedFast, into);
14571
15099
  FfiConverterTypeSendOnchainSpeedFeeQuote.write(value.speedMedium, into);
14572
15100
  FfiConverterTypeSendOnchainSpeedFeeQuote.write(value.speedSlow, into);
15101
+ FfiConverterBool.write(value.isEstimate, into);
14573
15102
  }
14574
15103
  allocationSize(value: TypeName): number {
14575
15104
  return (
@@ -14581,7 +15110,10 @@ const FfiConverterTypeSendOnchainFeeQuote = (() => {
14581
15110
  FfiConverterTypeSendOnchainSpeedFeeQuote.allocationSize(
14582
15111
  value.speedMedium
14583
15112
  ) +
14584
- FfiConverterTypeSendOnchainSpeedFeeQuote.allocationSize(value.speedSlow)
15113
+ FfiConverterTypeSendOnchainSpeedFeeQuote.allocationSize(
15114
+ value.speedSlow
15115
+ ) +
15116
+ FfiConverterBool.allocationSize(value.isEstimate)
14585
15117
  );
14586
15118
  }
14587
15119
  }
@@ -16228,9 +16760,8 @@ const FfiConverterTypeSparkStatus = (() => {
16228
16760
  * Configuration for automatic conversion of Bitcoin to stable tokens.
16229
16761
  *
16230
16762
  * When configured, the SDK automatically monitors the Bitcoin balance after each
16231
- * wallet sync. When the balance exceeds the configured threshold plus the reserved
16232
- * amount, the SDK automatically converts the excess balance (above the reserve)
16233
- * to the active stable token.
16763
+ * wallet sync. Once the balance reaches the configured threshold, the SDK converts
16764
+ * the whole Bitcoin balance to the active stable token.
16234
16765
  *
16235
16766
  * When the balance is held in a stable token, Bitcoin payments can still be sent.
16236
16767
  * The SDK automatically detects when there's not enough Bitcoin balance to cover a
@@ -17691,14 +18222,43 @@ export type UnilateralExitResponse = {
17691
18222
  * The actual total on-chain fee the returned transactions pay at the
17692
18223
  * requested rate, in satoshis. A resumed or partially-confirmed exit pays
17693
18224
  * less because already-confirmed steps are not rebuilt.
18225
+ *
18226
+ * The sum of the three components below, which say who pays what:
18227
+ * `cpfp_fee_sat + fanout_fee_sat + sweep_fee_sat`. The first two come from
18228
+ * your funding UTXOs, the third off the value being recovered.
17694
18229
  */
17695
18230
  totalFeeSat: /*u64*/ bigint;
18231
+ /**
18232
+ * The part of `total_fee_sat` the CPFP children pay, funded by your UTXOs.
18233
+ * It does not reduce what the exit recovers.
18234
+ */
18235
+ cpfpFeeSat: /*u64*/ bigint;
18236
+ /**
18237
+ * The part of `total_fee_sat` the fan-out pays, funded by your UTXO. Zero
18238
+ * when this exit needed no fan-out, and when an earlier attempt's fan-out
18239
+ * had already confirmed.
18240
+ */
18241
+ fanoutFeeSat: /*u64*/ bigint;
18242
+ /**
18243
+ * The part of `total_fee_sat` the sweep pays, taken from the value it
18244
+ * moves, so this is the one component subtracted from what reaches the
18245
+ * destination. Zero while no refund is on-chain yet and the set carries no
18246
+ * sweep.
18247
+ */
18248
+ sweepFeeSat: /*u64*/ bigint;
17696
18249
  leaves: Array<UnilateralExitLeaf>;
17697
18250
  /**
17698
18251
  * The full signed transaction set, in valid topological (broadcast) order
17699
18252
  * with shared ancestors appearing once and the sweep last.
17700
18253
  */
17701
18254
  transactions: Array<UnilateralExitTransaction>;
18255
+ /**
18256
+ * The funding UTXOs this exit was built from, as you supplied them. Hand
18257
+ * them back when you build the exit again and they are followed to whatever
18258
+ * they have since become, so an outpoint an earlier attempt already spent
18259
+ * still funds the rest.
18260
+ */
18261
+ fundingInputs: Array<CpfpInput>;
17702
18262
  };
17703
18263
 
17704
18264
  /**
@@ -17740,27 +18300,39 @@ const FfiConverterTypeUnilateralExitResponse = (() => {
17740
18300
  return {
17741
18301
  recoverableValueSat: FfiConverterUInt64.read(from),
17742
18302
  totalFeeSat: FfiConverterUInt64.read(from),
18303
+ cpfpFeeSat: FfiConverterUInt64.read(from),
18304
+ fanoutFeeSat: FfiConverterUInt64.read(from),
18305
+ sweepFeeSat: FfiConverterUInt64.read(from),
17743
18306
  leaves: FfiConverterArrayTypeUnilateralExitLeaf.read(from),
17744
18307
  transactions: FfiConverterArrayTypeUnilateralExitTransaction.read(from),
18308
+ fundingInputs: FfiConverterArrayTypeCpfpInput.read(from),
17745
18309
  };
17746
18310
  }
17747
18311
  write(value: TypeName, into: RustBuffer): void {
17748
18312
  FfiConverterUInt64.write(value.recoverableValueSat, into);
17749
18313
  FfiConverterUInt64.write(value.totalFeeSat, into);
18314
+ FfiConverterUInt64.write(value.cpfpFeeSat, into);
18315
+ FfiConverterUInt64.write(value.fanoutFeeSat, into);
18316
+ FfiConverterUInt64.write(value.sweepFeeSat, into);
17750
18317
  FfiConverterArrayTypeUnilateralExitLeaf.write(value.leaves, into);
17751
18318
  FfiConverterArrayTypeUnilateralExitTransaction.write(
17752
18319
  value.transactions,
17753
18320
  into
17754
18321
  );
18322
+ FfiConverterArrayTypeCpfpInput.write(value.fundingInputs, into);
17755
18323
  }
17756
18324
  allocationSize(value: TypeName): number {
17757
18325
  return (
17758
18326
  FfiConverterUInt64.allocationSize(value.recoverableValueSat) +
17759
18327
  FfiConverterUInt64.allocationSize(value.totalFeeSat) +
18328
+ FfiConverterUInt64.allocationSize(value.cpfpFeeSat) +
18329
+ FfiConverterUInt64.allocationSize(value.fanoutFeeSat) +
18330
+ FfiConverterUInt64.allocationSize(value.sweepFeeSat) +
17760
18331
  FfiConverterArrayTypeUnilateralExitLeaf.allocationSize(value.leaves) +
17761
18332
  FfiConverterArrayTypeUnilateralExitTransaction.allocationSize(
17762
18333
  value.transactions
17763
- )
18334
+ ) +
18335
+ FfiConverterArrayTypeCpfpInput.allocationSize(value.fundingInputs)
17764
18336
  );
17765
18337
  }
17766
18338
  }
@@ -17796,7 +18368,12 @@ export type UnilateralExitTransaction = {
17796
18368
  * one can be broadcast.
17797
18369
  */
17798
18370
  dependsOn: Array<string>;
17799
- status: ConfirmationStatus;
18371
+ /**
18372
+ * Whether this transaction is on-chain, can go out now, or is waiting on
18373
+ * something. Resolved against the chain tip, so it accounts for
18374
+ * `csv_timelock_blocks` as well as `depends_on`.
18375
+ */
18376
+ status: ExitTransactionStatus;
17800
18377
  };
17801
18378
 
17802
18379
  /**
@@ -17843,7 +18420,7 @@ const FfiConverterTypeUnilateralExitTransaction = (() => {
17843
18420
  cpfpTxHex: FfiConverterOptionalString.read(from),
17844
18421
  csvTimelockBlocks: FfiConverterOptionalUInt32.read(from),
17845
18422
  dependsOn: FfiConverterArrayString.read(from),
17846
- status: FfiConverterTypeConfirmationStatus.read(from),
18423
+ status: FfiConverterTypeExitTransactionStatus.read(from),
17847
18424
  };
17848
18425
  }
17849
18426
  write(value: TypeName, into: RustBuffer): void {
@@ -17854,7 +18431,7 @@ const FfiConverterTypeUnilateralExitTransaction = (() => {
17854
18431
  FfiConverterOptionalString.write(value.cpfpTxHex, into);
17855
18432
  FfiConverterOptionalUInt32.write(value.csvTimelockBlocks, into);
17856
18433
  FfiConverterArrayString.write(value.dependsOn, into);
17857
- FfiConverterTypeConfirmationStatus.write(value.status, into);
18434
+ FfiConverterTypeExitTransactionStatus.write(value.status, into);
17858
18435
  }
17859
18436
  allocationSize(value: TypeName): number {
17860
18437
  return (
@@ -17865,7 +18442,7 @@ const FfiConverterTypeUnilateralExitTransaction = (() => {
17865
18442
  FfiConverterOptionalString.allocationSize(value.cpfpTxHex) +
17866
18443
  FfiConverterOptionalUInt32.allocationSize(value.csvTimelockBlocks) +
17867
18444
  FfiConverterArrayString.allocationSize(value.dependsOn) +
17868
- FfiConverterTypeConfirmationStatus.allocationSize(value.status)
18445
+ FfiConverterTypeExitTransactionStatus.allocationSize(value.status)
17869
18446
  );
17870
18447
  }
17871
18448
  }
@@ -20261,58 +20838,6 @@ const FfiConverterTypeChainServiceError = (() => {
20261
20838
  return new FFIConverter();
20262
20839
  })();
20263
20840
 
20264
- /**
20265
- * Whether a transaction in the exit path is already on-chain.
20266
- */
20267
- export enum ConfirmationStatus {
20268
- /**
20269
- * This transaction is confirmed in a block. It needs no action.
20270
- */
20271
- Confirmed,
20272
- /**
20273
- * This transaction is not yet confirmed. Mempool state is not consulted.
20274
- */
20275
- Unconfirmed,
20276
- /**
20277
- * The on-chain status could not be determined (the chain service errored).
20278
- * Broadcasting may fail if a conflicting transaction already landed.
20279
- */
20280
- Unverified,
20281
- }
20282
-
20283
- const FfiConverterTypeConfirmationStatus = (() => {
20284
- const ordinalConverter = FfiConverterInt32;
20285
- type TypeName = ConfirmationStatus;
20286
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
20287
- read(from: RustBuffer): TypeName {
20288
- switch (ordinalConverter.read(from)) {
20289
- case 1:
20290
- return ConfirmationStatus.Confirmed;
20291
- case 2:
20292
- return ConfirmationStatus.Unconfirmed;
20293
- case 3:
20294
- return ConfirmationStatus.Unverified;
20295
- default:
20296
- throw new UniffiInternalError.UnexpectedEnumCase();
20297
- }
20298
- }
20299
- write(value: TypeName, into: RustBuffer): void {
20300
- switch (value) {
20301
- case ConfirmationStatus.Confirmed:
20302
- return ordinalConverter.write(1, into);
20303
- case ConfirmationStatus.Unconfirmed:
20304
- return ordinalConverter.write(2, into);
20305
- case ConfirmationStatus.Unverified:
20306
- return ordinalConverter.write(3, into);
20307
- }
20308
- }
20309
- allocationSize(value: TypeName): number {
20310
- return ordinalConverter.allocationSize(0);
20311
- }
20312
- }
20313
- return new FFIConverter();
20314
- })();
20315
-
20316
20841
  // Enum: ConversionChain
20317
20842
  export enum ConversionChain_Tags {
20318
20843
  Spark = 'Spark',
@@ -20575,8 +21100,9 @@ export enum ConversionInfo_Tags {
20575
21100
  *
20576
21101
  * The variant identifies which provider handled the conversion:
20577
21102
  * - [`ConversionInfo::Amm`] for Spark token swaps via Flashnet AMM pools.
20578
- * - [`ConversionInfo::Orchestra`] for cross-chain sends via Flashnet
20579
- * Orchestra (Spark → external chain).
21103
+ * - [`ConversionInfo::Orchestra`] for cross-chain transfers via Flashnet
21104
+ * Orchestra, in either direction (Spark → external chain, or external
21105
+ * chain → Spark).
20580
21106
  * - [`ConversionInfo::Boltz`] for sats → stable-coin reverse swaps via Boltz.
20581
21107
  */
20582
21108
  export const ConversionInfo = (() => {
@@ -20687,6 +21213,7 @@ export const ConversionInfo = (() => {
20687
21213
  assetAmountIn: U128 | undefined;
20688
21214
  estimatedOut: U128;
20689
21215
  deliveredAmount: U128 | undefined;
21216
+ externalTxHash: string | undefined;
20690
21217
  status: ConversionStatus;
20691
21218
  feeAmount: U128 | undefined;
20692
21219
  serviceFeeAmount: U128 | undefined;
@@ -20697,7 +21224,13 @@ export const ConversionInfo = (() => {
20697
21224
  };
20698
21225
 
20699
21226
  /**
20700
- * Orchestra cross-chain conversion via the Flashnet orchestration API.
21227
+ * Orchestra cross-chain conversion via the Flashnet orchestration API,
21228
+ * in either direction.
21229
+ *
21230
+ * `chain`, `asset`, `asset_decimals` and `asset_contract` always describe
21231
+ * the external (non-Spark) side: the destination on a send, the source on
21232
+ * a receive. Amounts follow the direction of the transfer, so read each
21233
+ * amount field's own denomination.
20701
21234
  */
20702
21235
  class Orchestra_ extends UniffiEnum implements Orchestra__interface {
20703
21236
  /**
@@ -20717,6 +21250,7 @@ export const ConversionInfo = (() => {
20717
21250
  assetAmountIn: U128 | undefined;
20718
21251
  estimatedOut: U128;
20719
21252
  deliveredAmount: U128 | undefined;
21253
+ externalTxHash: string | undefined;
20720
21254
  status: ConversionStatus;
20721
21255
  feeAmount: U128 | undefined;
20722
21256
  serviceFeeAmount: U128 | undefined;
@@ -20746,21 +21280,33 @@ export const ConversionInfo = (() => {
20746
21280
  * Asset ticker (e.g. `"USDC"`, `"USDT"`).
20747
21281
  */ asset: string;
20748
21282
  /**
20749
- * Recipient address on the target chain.
21283
+ * The target-chain address on a send, the receiving Spark address
21284
+ * on a receive.
20750
21285
  */ recipientAddress: string;
20751
21286
  /**
20752
- * Amount in expressed in the cross-chain asset's base units, via
20753
- * the rate the SDK used at prepare time.
21287
+ * Amount paid in, in `asset` base units. On a send it is the Spark
21288
+ * amount expressed in `asset` via the rate the SDK used at prepare
21289
+ * time. On a receive it is the deposit the sender made on `chain`.
20754
21290
  */ assetAmountIn: U128 | undefined;
20755
21291
  /**
20756
- * Estimated recipient amount, frozen at prepare time.
21292
+ * Estimated amount delivered to the receiving end, frozen at prepare
21293
+ * time. In `asset` base units on a send, and in Spark-side units on
21294
+ * a receive (sats for Bitcoin, token base units for a token).
20757
21295
  */ estimatedOut: U128;
20758
21296
  /**
20759
- * Actual delivered amount, Unset until the order reaches a terminal state.
21297
+ * Actual delivered amount, in the same units as `estimated_out`.
21298
+ * Unset until the order reaches a terminal state.
20760
21299
  */ deliveredAmount: U128 | undefined;
21300
+ /**
21301
+ * Transaction on `chain`, the non-Spark side of the conversion: the
21302
+ * delivery on a send, the funding deposit on a receive. Format follows
21303
+ * the chain (e.g. `0x`-prefixed hex on EVM, a base58 signature on
21304
+ * Solana). Unset until that transaction exists, and on orders that
21305
+ * failed or were refunded.
21306
+ */ externalTxHash: string | undefined;
20761
21307
  status: ConversionStatus;
20762
21308
  /**
20763
- * Best-available total fee in destination asset base units.
21309
+ * Best-available total fee, in `asset` base units.
20764
21310
  * Prepare-time estimate while pending, realized fee when Completed.
20765
21311
  */ feeAmount: U128 | undefined;
20766
21312
  /**
@@ -20773,7 +21319,8 @@ export const ConversionInfo = (() => {
20773
21319
  * Asset decimals (e.g. 6 for USDC).
20774
21320
  */ assetDecimals: /*u32*/ number;
20775
21321
  /**
20776
- * Token contract / mint address. Unset for native-asset destinations.
21322
+ * Token contract / mint address on `chain`. Unset when that side is
21323
+ * the chain's native asset.
20777
21324
  */ assetContract: string | undefined;
20778
21325
  }) {
20779
21326
  super('ConversionInfo', 'Orchestra');
@@ -20802,21 +21349,33 @@ export const ConversionInfo = (() => {
20802
21349
  * Asset ticker (e.g. `"USDC"`, `"USDT"`).
20803
21350
  */ asset: string;
20804
21351
  /**
20805
- * Recipient address on the target chain.
21352
+ * The target-chain address on a send, the receiving Spark address
21353
+ * on a receive.
20806
21354
  */ recipientAddress: string;
20807
21355
  /**
20808
- * Amount in expressed in the cross-chain asset's base units, via
20809
- * the rate the SDK used at prepare time.
21356
+ * Amount paid in, in `asset` base units. On a send it is the Spark
21357
+ * amount expressed in `asset` via the rate the SDK used at prepare
21358
+ * time. On a receive it is the deposit the sender made on `chain`.
20810
21359
  */ assetAmountIn: U128 | undefined;
20811
21360
  /**
20812
- * Estimated recipient amount, frozen at prepare time.
21361
+ * Estimated amount delivered to the receiving end, frozen at prepare
21362
+ * time. In `asset` base units on a send, and in Spark-side units on
21363
+ * a receive (sats for Bitcoin, token base units for a token).
20813
21364
  */ estimatedOut: U128;
20814
21365
  /**
20815
- * Actual delivered amount, Unset until the order reaches a terminal state.
21366
+ * Actual delivered amount, in the same units as `estimated_out`.
21367
+ * Unset until the order reaches a terminal state.
20816
21368
  */ deliveredAmount: U128 | undefined;
21369
+ /**
21370
+ * Transaction on `chain`, the non-Spark side of the conversion: the
21371
+ * delivery on a send, the funding deposit on a receive. Format follows
21372
+ * the chain (e.g. `0x`-prefixed hex on EVM, a base58 signature on
21373
+ * Solana). Unset until that transaction exists, and on orders that
21374
+ * failed or were refunded.
21375
+ */ externalTxHash: string | undefined;
20817
21376
  status: ConversionStatus;
20818
21377
  /**
20819
- * Best-available total fee in destination asset base units.
21378
+ * Best-available total fee, in `asset` base units.
20820
21379
  * Prepare-time estimate while pending, realized fee when Completed.
20821
21380
  */ feeAmount: U128 | undefined;
20822
21381
  /**
@@ -20829,7 +21388,8 @@ export const ConversionInfo = (() => {
20829
21388
  * Asset decimals (e.g. 6 for USDC).
20830
21389
  */ assetDecimals: /*u32*/ number;
20831
21390
  /**
20832
- * Token contract / mint address. Unset for native-asset destinations.
21391
+ * Token contract / mint address on `chain`. Unset when that side is
21392
+ * the chain's native asset.
20833
21393
  */ assetContract: string | undefined;
20834
21394
  }): Orchestra_ {
20835
21395
  return new Orchestra_(inner);
@@ -20961,7 +21521,8 @@ export const ConversionInfo = (() => {
20961
21521
  * Asset decimals (e.g. 6 for USDT).
20962
21522
  */ assetDecimals: /*u32*/ number;
20963
21523
  /**
20964
- * Token contract / mint address. Unset for native-asset destinations.
21524
+ * Token contract / mint address on `chain`. Unset when that side is
21525
+ * the chain's native asset.
20965
21526
  */ assetContract: string | undefined;
20966
21527
  }) {
20967
21528
  super('ConversionInfo', 'Boltz');
@@ -21030,7 +21591,8 @@ export const ConversionInfo = (() => {
21030
21591
  * Asset decimals (e.g. 6 for USDT).
21031
21592
  */ assetDecimals: /*u32*/ number;
21032
21593
  /**
21033
- * Token contract / mint address. Unset for native-asset destinations.
21594
+ * Token contract / mint address on `chain`. Unset when that side is
21595
+ * the chain's native asset.
21034
21596
  */ assetContract: string | undefined;
21035
21597
  }): Boltz_ {
21036
21598
  return new Boltz_(inner);
@@ -21059,8 +21621,9 @@ export const ConversionInfo = (() => {
21059
21621
  *
21060
21622
  * The variant identifies which provider handled the conversion:
21061
21623
  * - [`ConversionInfo::Amm`] for Spark token swaps via Flashnet AMM pools.
21062
- * - [`ConversionInfo::Orchestra`] for cross-chain sends via Flashnet
21063
- * Orchestra (Spark → external chain).
21624
+ * - [`ConversionInfo::Orchestra`] for cross-chain transfers via Flashnet
21625
+ * Orchestra, in either direction (Spark → external chain, or external
21626
+ * chain → Spark).
21064
21627
  * - [`ConversionInfo::Boltz`] for sats → stable-coin reverse swaps via Boltz.
21065
21628
  */
21066
21629
 
@@ -21098,6 +21661,7 @@ const FfiConverterTypeConversionInfo = (() => {
21098
21661
  assetAmountIn: FfiConverterOptionalTypeu128.read(from),
21099
21662
  estimatedOut: FfiConverterTypeu128.read(from),
21100
21663
  deliveredAmount: FfiConverterOptionalTypeu128.read(from),
21664
+ externalTxHash: FfiConverterOptionalString.read(from),
21101
21665
  status: FfiConverterTypeConversionStatus.read(from),
21102
21666
  feeAmount: FfiConverterOptionalTypeu128.read(from),
21103
21667
  serviceFeeAmount: FfiConverterOptionalTypeu128.read(from),
@@ -21164,6 +21728,7 @@ const FfiConverterTypeConversionInfo = (() => {
21164
21728
  FfiConverterOptionalTypeu128.write(inner.assetAmountIn, into);
21165
21729
  FfiConverterTypeu128.write(inner.estimatedOut, into);
21166
21730
  FfiConverterOptionalTypeu128.write(inner.deliveredAmount, into);
21731
+ FfiConverterOptionalString.write(inner.externalTxHash, into);
21167
21732
  FfiConverterTypeConversionStatus.write(inner.status, into);
21168
21733
  FfiConverterOptionalTypeu128.write(inner.feeAmount, into);
21169
21734
  FfiConverterOptionalTypeu128.write(inner.serviceFeeAmount, into);
@@ -21238,6 +21803,9 @@ const FfiConverterTypeConversionInfo = (() => {
21238
21803
  size += FfiConverterOptionalTypeu128.allocationSize(
21239
21804
  inner.deliveredAmount
21240
21805
  );
21806
+ size += FfiConverterOptionalString.allocationSize(
21807
+ inner.externalTxHash
21808
+ );
21241
21809
  size += FfiConverterTypeConversionStatus.allocationSize(inner.status);
21242
21810
  size += FfiConverterOptionalTypeu128.allocationSize(inner.feeAmount);
21243
21811
  size += FfiConverterOptionalTypeu128.allocationSize(
@@ -22270,15 +22838,27 @@ const FfiConverterTypeCrossChainAddressFamily = (() => {
22270
22838
  })();
22271
22839
 
22272
22840
  /**
22273
- * How the caller wants fees handled against the request `amount`.
22274
- *
22275
- * - `FeesExcluded`: `amount` is the provider invoice/deposit target; the
22276
- * wallet pays `amount + source_transfer_fee_sats` in total.
22277
- * - `FeesIncluded`: `amount` is the wallet's total sats budget; the provider
22278
- * leg is sized so `amount_in + source_transfer_fee_sats <= amount`.
22841
+ * Which side of the transfer the request `amount` sizes: what leaves the
22842
+ * payer, or what reaches the receiver.
22279
22843
  */
22280
22844
  export enum CrossChainFeeMode {
22845
+ /**
22846
+ * `amount` sizes the receiving end, and fees are paid on top.
22847
+ *
22848
+ * Sending: `amount` is the provider invoice/deposit target, and the
22849
+ * wallet pays `amount + source_transfer_fee_sats` in total.
22850
+ * Receiving: `amount` is what the wallet ends up with, and the deposit
22851
+ * the sender is asked for is sized above it to cover fees.
22852
+ */
22281
22853
  FeesExcluded,
22854
+ /**
22855
+ * `amount` sizes the paying end, and fees come out of it.
22856
+ *
22857
+ * Sending: `amount` is the wallet's total sats budget, and the provider
22858
+ * leg is sized so `amount_in + source_transfer_fee_sats <= amount`.
22859
+ * Receiving: `amount` is the deposit the sender makes, and the wallet
22860
+ * ends up with that minus fees.
22861
+ */
22282
22862
  FeesIncluded,
22283
22863
  }
22284
22864
 
@@ -22313,6 +22893,9 @@ const FfiConverterTypeCrossChainFeeMode = (() => {
22313
22893
 
22314
22894
  export enum CrossChainProvider {
22315
22895
  Orchestra,
22896
+ /**
22897
+ * Not operational: no routes are currently offered under this provider.
22898
+ */
22316
22899
  Boltz,
22317
22900
  }
22318
22901
 
@@ -22792,6 +23375,57 @@ const FfiConverterTypeCrossChainRouteFilter = (() => {
22792
23375
  return new FFIConverter();
22793
23376
  })();
22794
23377
 
23378
+ /**
23379
+ * The rail a cross-chain payment is delivered over.
23380
+ */
23381
+ export enum DeliveryMethod {
23382
+ /**
23383
+ * Delivered over the Spark network.
23384
+ */
23385
+ Spark,
23386
+ /**
23387
+ * Delivered over Lightning.
23388
+ */
23389
+ Lightning,
23390
+ /**
23391
+ * Delivered on-chain over Bitcoin.
23392
+ */
23393
+ Bitcoin,
23394
+ }
23395
+
23396
+ const FfiConverterTypeDeliveryMethod = (() => {
23397
+ const ordinalConverter = FfiConverterInt32;
23398
+ type TypeName = DeliveryMethod;
23399
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
23400
+ read(from: RustBuffer): TypeName {
23401
+ switch (ordinalConverter.read(from)) {
23402
+ case 1:
23403
+ return DeliveryMethod.Spark;
23404
+ case 2:
23405
+ return DeliveryMethod.Lightning;
23406
+ case 3:
23407
+ return DeliveryMethod.Bitcoin;
23408
+ default:
23409
+ throw new UniffiInternalError.UnexpectedEnumCase();
23410
+ }
23411
+ }
23412
+ write(value: TypeName, into: RustBuffer): void {
23413
+ switch (value) {
23414
+ case DeliveryMethod.Spark:
23415
+ return ordinalConverter.write(1, into);
23416
+ case DeliveryMethod.Lightning:
23417
+ return ordinalConverter.write(2, into);
23418
+ case DeliveryMethod.Bitcoin:
23419
+ return ordinalConverter.write(3, into);
23420
+ }
23421
+ }
23422
+ allocationSize(value: TypeName): number {
23423
+ return ordinalConverter.allocationSize(0);
23424
+ }
23425
+ }
23426
+ return new FFIConverter();
23427
+ })();
23428
+
22795
23429
  // Enum: DepositClaimError
22796
23430
  export enum DepositClaimError_Tags {
22797
23431
  MaxDepositClaimFeeExceeded = 'MaxDepositClaimFeeExceeded',
@@ -23462,6 +24096,501 @@ const FfiConverterTypeExitLeafSelection = (() => {
23462
24096
  return new FFIConverter();
23463
24097
  })();
23464
24098
 
24099
+ /**
24100
+ * Which of a node's two pre-signed spends took it on-chain.
24101
+ */
24102
+ export enum ExitNodeConfirmation {
24103
+ /**
24104
+ * The CPFP transaction, whose fee a child paid.
24105
+ */
24106
+ Cpfp,
24107
+ /**
24108
+ * The direct transaction, which pays its own fee. A leaf that went out this
24109
+ * way is refunded by its direct refund transaction.
24110
+ */
24111
+ Direct,
24112
+ }
24113
+
24114
+ const FfiConverterTypeExitNodeConfirmation = (() => {
24115
+ const ordinalConverter = FfiConverterInt32;
24116
+ type TypeName = ExitNodeConfirmation;
24117
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
24118
+ read(from: RustBuffer): TypeName {
24119
+ switch (ordinalConverter.read(from)) {
24120
+ case 1:
24121
+ return ExitNodeConfirmation.Cpfp;
24122
+ case 2:
24123
+ return ExitNodeConfirmation.Direct;
24124
+ default:
24125
+ throw new UniffiInternalError.UnexpectedEnumCase();
24126
+ }
24127
+ }
24128
+ write(value: TypeName, into: RustBuffer): void {
24129
+ switch (value) {
24130
+ case ExitNodeConfirmation.Cpfp:
24131
+ return ordinalConverter.write(1, into);
24132
+ case ExitNodeConfirmation.Direct:
24133
+ return ordinalConverter.write(2, into);
24134
+ }
24135
+ }
24136
+ allocationSize(value: TypeName): number {
24137
+ return ordinalConverter.allocationSize(0);
24138
+ }
24139
+ }
24140
+ return new FFIConverter();
24141
+ })();
24142
+
24143
+ // Enum: ExitRefundState
24144
+ export enum ExitRefundState_Tags {
24145
+ OnChain = 'OnChain',
24146
+ Swept = 'Swept',
24147
+ }
24148
+ export const ExitRefundState = (() => {
24149
+ type OnChain__interface = {
24150
+ tag: ExitRefundState_Tags.OnChain;
24151
+ inner: Readonly<{
24152
+ txHex: string;
24153
+ vout: /*u32*/ number;
24154
+ valueSat: /*u64*/ bigint;
24155
+ blockHeight: /*u32*/ number | undefined;
24156
+ }>;
24157
+ };
24158
+
24159
+ /**
24160
+ * On-chain with its output still there, which is what the sweep pulls from.
24161
+ * A sweep sitting unconfirmed in the mempool leaves the refund here, so
24162
+ * that sweep is rebuilt rather than dropped.
24163
+ */
24164
+ class OnChain_ extends UniffiEnum implements OnChain__interface {
24165
+ /**
24166
+ * @private
24167
+ * This field is private and should not be used, use `tag` instead.
24168
+ */
24169
+ readonly [uniffiTypeNameSymbol] = 'ExitRefundState';
24170
+ readonly tag = ExitRefundState_Tags.OnChain;
24171
+ readonly inner: Readonly<{
24172
+ txHex: string;
24173
+ vout: /*u32*/ number;
24174
+ valueSat: /*u64*/ bigint;
24175
+ blockHeight: /*u32*/ number | undefined;
24176
+ }>;
24177
+ constructor(inner: {
24178
+ txHex: string;
24179
+ vout: /*u32*/ number;
24180
+ valueSat: /*u64*/ bigint;
24181
+ blockHeight: /*u32*/ number | undefined;
24182
+ }) {
24183
+ super('ExitRefundState', 'OnChain');
24184
+ this.inner = Object.freeze(inner);
24185
+ }
24186
+
24187
+ static new(inner: {
24188
+ txHex: string;
24189
+ vout: /*u32*/ number;
24190
+ valueSat: /*u64*/ bigint;
24191
+ blockHeight: /*u32*/ number | undefined;
24192
+ }): OnChain_ {
24193
+ return new OnChain_(inner);
24194
+ }
24195
+
24196
+ static instanceOf(obj: any): obj is OnChain_ {
24197
+ return obj.tag === ExitRefundState_Tags.OnChain;
24198
+ }
24199
+ }
24200
+
24201
+ type Swept__interface = {
24202
+ tag: ExitRefundState_Tags.Swept;
24203
+ };
24204
+
24205
+ /**
24206
+ * Spent by a confirmed transaction: the sweep landed.
24207
+ */
24208
+ class Swept_ extends UniffiEnum implements Swept__interface {
24209
+ /**
24210
+ * @private
24211
+ * This field is private and should not be used, use `tag` instead.
24212
+ */
24213
+ readonly [uniffiTypeNameSymbol] = 'ExitRefundState';
24214
+ readonly tag = ExitRefundState_Tags.Swept;
24215
+ constructor() {
24216
+ super('ExitRefundState', 'Swept');
24217
+ }
24218
+
24219
+ static new(): Swept_ {
24220
+ return new Swept_();
24221
+ }
24222
+
24223
+ static instanceOf(obj: any): obj is Swept_ {
24224
+ return obj.tag === ExitRefundState_Tags.Swept;
24225
+ }
24226
+ }
24227
+
24228
+ function instanceOf(obj: any): obj is ExitRefundState {
24229
+ return obj[uniffiTypeNameSymbol] === 'ExitRefundState';
24230
+ }
24231
+
24232
+ return Object.freeze({
24233
+ instanceOf,
24234
+ OnChain: OnChain_,
24235
+ Swept: Swept_,
24236
+ });
24237
+ })();
24238
+
24239
+ export type ExitRefundState = InstanceType<
24240
+ (typeof ExitRefundState)[keyof Omit<typeof ExitRefundState, 'instanceOf'>]
24241
+ >;
24242
+
24243
+ // FfiConverter for enum ExitRefundState
24244
+ const FfiConverterTypeExitRefundState = (() => {
24245
+ const ordinalConverter = FfiConverterInt32;
24246
+ type TypeName = ExitRefundState;
24247
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
24248
+ read(from: RustBuffer): TypeName {
24249
+ switch (ordinalConverter.read(from)) {
24250
+ case 1:
24251
+ return new ExitRefundState.OnChain({
24252
+ txHex: FfiConverterString.read(from),
24253
+ vout: FfiConverterUInt32.read(from),
24254
+ valueSat: FfiConverterUInt64.read(from),
24255
+ blockHeight: FfiConverterOptionalUInt32.read(from),
24256
+ });
24257
+ case 2:
24258
+ return new ExitRefundState.Swept();
24259
+ default:
24260
+ throw new UniffiInternalError.UnexpectedEnumCase();
24261
+ }
24262
+ }
24263
+ write(value: TypeName, into: RustBuffer): void {
24264
+ switch (value.tag) {
24265
+ case ExitRefundState_Tags.OnChain: {
24266
+ ordinalConverter.write(1, into);
24267
+ const inner = value.inner;
24268
+ FfiConverterString.write(inner.txHex, into);
24269
+ FfiConverterUInt32.write(inner.vout, into);
24270
+ FfiConverterUInt64.write(inner.valueSat, into);
24271
+ FfiConverterOptionalUInt32.write(inner.blockHeight, into);
24272
+ return;
24273
+ }
24274
+ case ExitRefundState_Tags.Swept: {
24275
+ ordinalConverter.write(2, into);
24276
+ return;
24277
+ }
24278
+ default:
24279
+ // Throwing from here means that ExitRefundState_Tags hasn't matched an ordinal.
24280
+ throw new UniffiInternalError.UnexpectedEnumCase();
24281
+ }
24282
+ }
24283
+ allocationSize(value: TypeName): number {
24284
+ switch (value.tag) {
24285
+ case ExitRefundState_Tags.OnChain: {
24286
+ const inner = value.inner;
24287
+ let size = ordinalConverter.allocationSize(1);
24288
+ size += FfiConverterString.allocationSize(inner.txHex);
24289
+ size += FfiConverterUInt32.allocationSize(inner.vout);
24290
+ size += FfiConverterUInt64.allocationSize(inner.valueSat);
24291
+ size += FfiConverterOptionalUInt32.allocationSize(inner.blockHeight);
24292
+ return size;
24293
+ }
24294
+ case ExitRefundState_Tags.Swept: {
24295
+ return ordinalConverter.allocationSize(2);
24296
+ }
24297
+ default:
24298
+ throw new UniffiInternalError.UnexpectedEnumCase();
24299
+ }
24300
+ }
24301
+ }
24302
+ return new FFIConverter();
24303
+ })();
24304
+
24305
+ // Enum: ExitTransactionStatus
24306
+ export enum ExitTransactionStatus_Tags {
24307
+ Confirmed = 'Confirmed',
24308
+ Ready = 'Ready',
24309
+ WaitingForDependencies = 'WaitingForDependencies',
24310
+ WaitingForTimelock = 'WaitingForTimelock',
24311
+ Unverified = 'Unverified',
24312
+ }
24313
+ /**
24314
+ * Where a transaction in the exit path stands: on-chain, ready to send, or
24315
+ * waiting for something.
24316
+ */
24317
+ export const ExitTransactionStatus = (() => {
24318
+ type Confirmed__interface = {
24319
+ tag: ExitTransactionStatus_Tags.Confirmed;
24320
+ inner: Readonly<{ blockHeight: /*u32*/ number | undefined }>;
24321
+ };
24322
+
24323
+ /**
24324
+ * Confirmed in a block, at `block_height` where the chain service reported
24325
+ * one. It needs no action.
24326
+ *
24327
+ * A relative `csv_timelock_blocks` counts from the height of the
24328
+ * transaction it spends, so this is what tells you when a child of this one
24329
+ * can go out, without fetching it again.
24330
+ */
24331
+ class Confirmed_ extends UniffiEnum implements Confirmed__interface {
24332
+ /**
24333
+ * @private
24334
+ * This field is private and should not be used, use `tag` instead.
24335
+ */
24336
+ readonly [uniffiTypeNameSymbol] = 'ExitTransactionStatus';
24337
+ readonly tag = ExitTransactionStatus_Tags.Confirmed;
24338
+ readonly inner: Readonly<{ blockHeight: /*u32*/ number | undefined }>;
24339
+ constructor(inner: { blockHeight: /*u32*/ number | undefined }) {
24340
+ super('ExitTransactionStatus', 'Confirmed');
24341
+ this.inner = Object.freeze(inner);
24342
+ }
24343
+
24344
+ static new(inner: { blockHeight: /*u32*/ number | undefined }): Confirmed_ {
24345
+ return new Confirmed_(inner);
24346
+ }
24347
+
24348
+ static instanceOf(obj: any): obj is Confirmed_ {
24349
+ return obj.tag === ExitTransactionStatus_Tags.Confirmed;
24350
+ }
24351
+ }
24352
+
24353
+ type Ready__interface = {
24354
+ tag: ExitTransactionStatus_Tags.Ready;
24355
+ };
24356
+
24357
+ /**
24358
+ * Not on-chain, and nothing is holding it back. Broadcast it, with its
24359
+ * `cpfp_tx_hex` where it has one.
24360
+ */
24361
+ class Ready_ extends UniffiEnum implements Ready__interface {
24362
+ /**
24363
+ * @private
24364
+ * This field is private and should not be used, use `tag` instead.
24365
+ */
24366
+ readonly [uniffiTypeNameSymbol] = 'ExitTransactionStatus';
24367
+ readonly tag = ExitTransactionStatus_Tags.Ready;
24368
+ constructor() {
24369
+ super('ExitTransactionStatus', 'Ready');
24370
+ }
24371
+
24372
+ static new(): Ready_ {
24373
+ return new Ready_();
24374
+ }
24375
+
24376
+ static instanceOf(obj: any): obj is Ready_ {
24377
+ return obj.tag === ExitTransactionStatus_Tags.Ready;
24378
+ }
24379
+ }
24380
+
24381
+ type WaitingForDependencies__interface = {
24382
+ tag: ExitTransactionStatus_Tags.WaitingForDependencies;
24383
+ };
24384
+
24385
+ /**
24386
+ * A transaction in `depends_on` has yet to confirm. A relative timelock
24387
+ * only starts counting once it does.
24388
+ */
24389
+ class WaitingForDependencies_
24390
+ extends UniffiEnum
24391
+ implements WaitingForDependencies__interface
24392
+ {
24393
+ /**
24394
+ * @private
24395
+ * This field is private and should not be used, use `tag` instead.
24396
+ */
24397
+ readonly [uniffiTypeNameSymbol] = 'ExitTransactionStatus';
24398
+ readonly tag = ExitTransactionStatus_Tags.WaitingForDependencies;
24399
+ constructor() {
24400
+ super('ExitTransactionStatus', 'WaitingForDependencies');
24401
+ }
24402
+
24403
+ static new(): WaitingForDependencies_ {
24404
+ return new WaitingForDependencies_();
24405
+ }
24406
+
24407
+ static instanceOf(obj: any): obj is WaitingForDependencies_ {
24408
+ return obj.tag === ExitTransactionStatus_Tags.WaitingForDependencies;
24409
+ }
24410
+ }
24411
+
24412
+ type WaitingForTimelock__interface = {
24413
+ tag: ExitTransactionStatus_Tags.WaitingForTimelock;
24414
+ inner: Readonly<{ spendableAtHeight: /*u32*/ number | undefined }>;
24415
+ };
24416
+
24417
+ /**
24418
+ * Every input is confirmed, but a relative timelock has yet to mature.
24419
+ * `spendable_at_height` is the first block that can include this
24420
+ * transaction, and is unset when the height it counts from could not be
24421
+ * read from the chain.
24422
+ */
24423
+ class WaitingForTimelock_
24424
+ extends UniffiEnum
24425
+ implements WaitingForTimelock__interface
24426
+ {
24427
+ /**
24428
+ * @private
24429
+ * This field is private and should not be used, use `tag` instead.
24430
+ */
24431
+ readonly [uniffiTypeNameSymbol] = 'ExitTransactionStatus';
24432
+ readonly tag = ExitTransactionStatus_Tags.WaitingForTimelock;
24433
+ readonly inner: Readonly<{ spendableAtHeight: /*u32*/ number | undefined }>;
24434
+ constructor(inner: { spendableAtHeight: /*u32*/ number | undefined }) {
24435
+ super('ExitTransactionStatus', 'WaitingForTimelock');
24436
+ this.inner = Object.freeze(inner);
24437
+ }
24438
+
24439
+ static new(inner: {
24440
+ spendableAtHeight: /*u32*/ number | undefined;
24441
+ }): WaitingForTimelock_ {
24442
+ return new WaitingForTimelock_(inner);
24443
+ }
24444
+
24445
+ static instanceOf(obj: any): obj is WaitingForTimelock_ {
24446
+ return obj.tag === ExitTransactionStatus_Tags.WaitingForTimelock;
24447
+ }
24448
+ }
24449
+
24450
+ type Unverified__interface = {
24451
+ tag: ExitTransactionStatus_Tags.Unverified;
24452
+ };
24453
+
24454
+ /**
24455
+ * The on-chain status could not be determined (the chain service errored),
24456
+ * which also leaves what it is waiting for unknown. Broadcasting may fail
24457
+ * if a conflicting transaction already landed.
24458
+ */
24459
+ class Unverified_ extends UniffiEnum implements Unverified__interface {
24460
+ /**
24461
+ * @private
24462
+ * This field is private and should not be used, use `tag` instead.
24463
+ */
24464
+ readonly [uniffiTypeNameSymbol] = 'ExitTransactionStatus';
24465
+ readonly tag = ExitTransactionStatus_Tags.Unverified;
24466
+ constructor() {
24467
+ super('ExitTransactionStatus', 'Unverified');
24468
+ }
24469
+
24470
+ static new(): Unverified_ {
24471
+ return new Unverified_();
24472
+ }
24473
+
24474
+ static instanceOf(obj: any): obj is Unverified_ {
24475
+ return obj.tag === ExitTransactionStatus_Tags.Unverified;
24476
+ }
24477
+ }
24478
+
24479
+ function instanceOf(obj: any): obj is ExitTransactionStatus {
24480
+ return obj[uniffiTypeNameSymbol] === 'ExitTransactionStatus';
24481
+ }
24482
+
24483
+ return Object.freeze({
24484
+ instanceOf,
24485
+ Confirmed: Confirmed_,
24486
+ Ready: Ready_,
24487
+ WaitingForDependencies: WaitingForDependencies_,
24488
+ WaitingForTimelock: WaitingForTimelock_,
24489
+ Unverified: Unverified_,
24490
+ });
24491
+ })();
24492
+
24493
+ /**
24494
+ * Where a transaction in the exit path stands: on-chain, ready to send, or
24495
+ * waiting for something.
24496
+ */
24497
+
24498
+ export type ExitTransactionStatus = InstanceType<
24499
+ (typeof ExitTransactionStatus)[keyof Omit<
24500
+ typeof ExitTransactionStatus,
24501
+ 'instanceOf'
24502
+ >]
24503
+ >;
24504
+
24505
+ // FfiConverter for enum ExitTransactionStatus
24506
+ const FfiConverterTypeExitTransactionStatus = (() => {
24507
+ const ordinalConverter = FfiConverterInt32;
24508
+ type TypeName = ExitTransactionStatus;
24509
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
24510
+ read(from: RustBuffer): TypeName {
24511
+ switch (ordinalConverter.read(from)) {
24512
+ case 1:
24513
+ return new ExitTransactionStatus.Confirmed({
24514
+ blockHeight: FfiConverterOptionalUInt32.read(from),
24515
+ });
24516
+ case 2:
24517
+ return new ExitTransactionStatus.Ready();
24518
+ case 3:
24519
+ return new ExitTransactionStatus.WaitingForDependencies();
24520
+ case 4:
24521
+ return new ExitTransactionStatus.WaitingForTimelock({
24522
+ spendableAtHeight: FfiConverterOptionalUInt32.read(from),
24523
+ });
24524
+ case 5:
24525
+ return new ExitTransactionStatus.Unverified();
24526
+ default:
24527
+ throw new UniffiInternalError.UnexpectedEnumCase();
24528
+ }
24529
+ }
24530
+ write(value: TypeName, into: RustBuffer): void {
24531
+ switch (value.tag) {
24532
+ case ExitTransactionStatus_Tags.Confirmed: {
24533
+ ordinalConverter.write(1, into);
24534
+ const inner = value.inner;
24535
+ FfiConverterOptionalUInt32.write(inner.blockHeight, into);
24536
+ return;
24537
+ }
24538
+ case ExitTransactionStatus_Tags.Ready: {
24539
+ ordinalConverter.write(2, into);
24540
+ return;
24541
+ }
24542
+ case ExitTransactionStatus_Tags.WaitingForDependencies: {
24543
+ ordinalConverter.write(3, into);
24544
+ return;
24545
+ }
24546
+ case ExitTransactionStatus_Tags.WaitingForTimelock: {
24547
+ ordinalConverter.write(4, into);
24548
+ const inner = value.inner;
24549
+ FfiConverterOptionalUInt32.write(inner.spendableAtHeight, into);
24550
+ return;
24551
+ }
24552
+ case ExitTransactionStatus_Tags.Unverified: {
24553
+ ordinalConverter.write(5, into);
24554
+ return;
24555
+ }
24556
+ default:
24557
+ // Throwing from here means that ExitTransactionStatus_Tags hasn't matched an ordinal.
24558
+ throw new UniffiInternalError.UnexpectedEnumCase();
24559
+ }
24560
+ }
24561
+ allocationSize(value: TypeName): number {
24562
+ switch (value.tag) {
24563
+ case ExitTransactionStatus_Tags.Confirmed: {
24564
+ const inner = value.inner;
24565
+ let size = ordinalConverter.allocationSize(1);
24566
+ size += FfiConverterOptionalUInt32.allocationSize(inner.blockHeight);
24567
+ return size;
24568
+ }
24569
+ case ExitTransactionStatus_Tags.Ready: {
24570
+ return ordinalConverter.allocationSize(2);
24571
+ }
24572
+ case ExitTransactionStatus_Tags.WaitingForDependencies: {
24573
+ return ordinalConverter.allocationSize(3);
24574
+ }
24575
+ case ExitTransactionStatus_Tags.WaitingForTimelock: {
24576
+ const inner = value.inner;
24577
+ let size = ordinalConverter.allocationSize(4);
24578
+ size += FfiConverterOptionalUInt32.allocationSize(
24579
+ inner.spendableAtHeight
24580
+ );
24581
+ return size;
24582
+ }
24583
+ case ExitTransactionStatus_Tags.Unverified: {
24584
+ return ordinalConverter.allocationSize(5);
24585
+ }
24586
+ default:
24587
+ throw new UniffiInternalError.UnexpectedEnumCase();
24588
+ }
24589
+ }
24590
+ }
24591
+ return new FFIConverter();
24592
+ })();
24593
+
23465
24594
  // Enum: ExternalFrostDerivation
23466
24595
  export enum ExternalFrostDerivation_Tags {
23467
24596
  SigningLeaf = 'SigningLeaf',
@@ -27644,16 +28773,16 @@ export const PaymentRequest = (() => {
27644
28773
  route: CrossChainRoutePair;
27645
28774
  /**
27646
28775
  * Maximum slippage tolerance in basis points (1/100 of a percent)
27647
- * for the cross-chain quote. Must be in `10..=500`. Falls back to
27648
- * [`Config::default_slippage_bps`] when `None`, which itself
27649
- * defaults to 100 bps (1%) when unset.
28776
+ * for the cross-chain quote. Must be in 10 to 500. Falls back to
28777
+ * [`Config::default_slippage_bps`] when unset, which itself
28778
+ * defaults to 100 bps (1%).
27650
28779
  */ maxSlippageBps: /*u32*/ number | undefined;
27651
28780
  /**
27652
28781
  * Target-overpay pad in basis points applied on `FeesExcluded`
27653
28782
  * conversion sends. Inflates the destination target before quoting
27654
28783
  * so the recipient lands at or above the user's requested amount
27655
- * despite provider slippage. Must be in `0..=500`. Falls back to
27656
- * [`CrossChainConfig::default_target_overpay_bps`] when `None`,
28784
+ * despite provider slippage. Must be in 0 to 500. Falls back to
28785
+ * [`CrossChainConfig::default_target_overpay_bps`] when unset,
27657
28786
  * which itself defaults to 15 bps.
27658
28787
  */ targetOverpayBps: /*u32*/ number | undefined;
27659
28788
  }) {
@@ -27666,16 +28795,16 @@ export const PaymentRequest = (() => {
27666
28795
  route: CrossChainRoutePair;
27667
28796
  /**
27668
28797
  * Maximum slippage tolerance in basis points (1/100 of a percent)
27669
- * for the cross-chain quote. Must be in `10..=500`. Falls back to
27670
- * [`Config::default_slippage_bps`] when `None`, which itself
27671
- * defaults to 100 bps (1%) when unset.
28798
+ * for the cross-chain quote. Must be in 10 to 500. Falls back to
28799
+ * [`Config::default_slippage_bps`] when unset, which itself
28800
+ * defaults to 100 bps (1%).
27672
28801
  */ maxSlippageBps: /*u32*/ number | undefined;
27673
28802
  /**
27674
28803
  * Target-overpay pad in basis points applied on `FeesExcluded`
27675
28804
  * conversion sends. Inflates the destination target before quoting
27676
28805
  * so the recipient lands at or above the user's requested amount
27677
- * despite provider slippage. Must be in `0..=500`. Falls back to
27678
- * [`CrossChainConfig::default_target_overpay_bps`] when `None`,
28806
+ * despite provider slippage. Must be in 0 to 500. Falls back to
28807
+ * [`CrossChainConfig::default_target_overpay_bps`] when unset,
27679
28808
  * which itself defaults to 15 bps.
27680
28809
  */ targetOverpayBps: /*u32*/ number | undefined;
27681
28810
  }): CrossChain_ {
@@ -28978,6 +30107,7 @@ export enum ReceivePaymentMethod_Tags {
28978
30107
  SparkInvoice = 'SparkInvoice',
28979
30108
  BitcoinAddress = 'BitcoinAddress',
28980
30109
  Bolt11Invoice = 'Bolt11Invoice',
30110
+ CrossChain = 'CrossChain',
28981
30111
  }
28982
30112
  export const ReceivePaymentMethod = (() => {
28983
30113
  type SparkAddress__interface = {
@@ -29188,6 +30318,121 @@ export const ReceivePaymentMethod = (() => {
29188
30318
  }
29189
30319
  }
29190
30320
 
30321
+ type CrossChain__interface = {
30322
+ tag: ReceivePaymentMethod_Tags.CrossChain;
30323
+ inner: Readonly<{
30324
+ route: CrossChainRoutePair;
30325
+ amount: U128;
30326
+ destination: SparkAsset | undefined;
30327
+ feeMode: CrossChainFeeMode | undefined;
30328
+ maxSlippageBps: /*u32*/ number | undefined;
30329
+ targetOverpayBps: /*u32*/ number | undefined;
30330
+ }>;
30331
+ };
30332
+
30333
+ class CrossChain_ extends UniffiEnum implements CrossChain__interface {
30334
+ /**
30335
+ * @private
30336
+ * This field is private and should not be used, use `tag` instead.
30337
+ */
30338
+ readonly [uniffiTypeNameSymbol] = 'ReceivePaymentMethod';
30339
+ readonly tag = ReceivePaymentMethod_Tags.CrossChain;
30340
+ readonly inner: Readonly<{
30341
+ route: CrossChainRoutePair;
30342
+ amount: U128;
30343
+ destination: SparkAsset | undefined;
30344
+ feeMode: CrossChainFeeMode | undefined;
30345
+ maxSlippageBps: /*u32*/ number | undefined;
30346
+ targetOverpayBps: /*u32*/ number | undefined;
30347
+ }>;
30348
+ constructor(inner: {
30349
+ /**
30350
+ * The selected cross-chain route in the receive direction.
30351
+ */ route: CrossChainRoutePair;
30352
+ /**
30353
+ * The amount, in the source asset's base units (`route.decimals`).
30354
+ * USD-stable sources are at parity, so `1 USD = 10^route.decimals`
30355
+ * (e.g. `1_000_000` for 6-decimal USDC/USDT, `10^18` for 18-decimal
30356
+ * BSC USDC).
30357
+ *
30358
+ * - `FeesExcluded` (default): what the receiver ends up with, sized
30359
+ * as if `amount` source units were converted to the Spark-side
30360
+ * destination at parity (USDB) or the live BTC/USD rate (Bitcoin).
30361
+ * - `FeesIncluded`: what the sender deposits. The receiver ends up
30362
+ * with that amount minus provider fees.
30363
+ */ amount: U128;
30364
+ /**
30365
+ * Spark-side asset the receiver wants delivered. When absent, the
30366
+ * SDK auto-selects: the wallet's active stable-balance token if
30367
+ * the route supports it, otherwise Bitcoin (sats). When set, the
30368
+ * value must appear in the route's `accepted_assets`.
30369
+ */ destination: SparkAsset | undefined;
30370
+ /**
30371
+ * How `amount` should be interpreted. When absent, defaults to
30372
+ * `FeesExcluded`.
30373
+ */ feeMode: CrossChainFeeMode | undefined;
30374
+ /**
30375
+ * Maximum slippage in basis points. When absent, the SDK default
30376
+ * (100 bps) is used.
30377
+ */ maxSlippageBps: /*u32*/ number | undefined;
30378
+ /**
30379
+ * Per-request override for the overpay buffer applied to the
30380
+ * sender's deposit when `fee_mode == FeesExcluded`. Range 0 to 500.
30381
+ * When absent, falls back to `CrossChainConfig::default_target_overpay_bps`
30382
+ * then the built-in default (15 bps). Ignored when `fee_mode`
30383
+ * is `FeesIncluded`.
30384
+ */ targetOverpayBps: /*u32*/ number | undefined;
30385
+ }) {
30386
+ super('ReceivePaymentMethod', 'CrossChain');
30387
+ this.inner = Object.freeze(inner);
30388
+ }
30389
+
30390
+ static new(inner: {
30391
+ /**
30392
+ * The selected cross-chain route in the receive direction.
30393
+ */ route: CrossChainRoutePair;
30394
+ /**
30395
+ * The amount, in the source asset's base units (`route.decimals`).
30396
+ * USD-stable sources are at parity, so `1 USD = 10^route.decimals`
30397
+ * (e.g. `1_000_000` for 6-decimal USDC/USDT, `10^18` for 18-decimal
30398
+ * BSC USDC).
30399
+ *
30400
+ * - `FeesExcluded` (default): what the receiver ends up with, sized
30401
+ * as if `amount` source units were converted to the Spark-side
30402
+ * destination at parity (USDB) or the live BTC/USD rate (Bitcoin).
30403
+ * - `FeesIncluded`: what the sender deposits. The receiver ends up
30404
+ * with that amount minus provider fees.
30405
+ */ amount: U128;
30406
+ /**
30407
+ * Spark-side asset the receiver wants delivered. When absent, the
30408
+ * SDK auto-selects: the wallet's active stable-balance token if
30409
+ * the route supports it, otherwise Bitcoin (sats). When set, the
30410
+ * value must appear in the route's `accepted_assets`.
30411
+ */ destination: SparkAsset | undefined;
30412
+ /**
30413
+ * How `amount` should be interpreted. When absent, defaults to
30414
+ * `FeesExcluded`.
30415
+ */ feeMode: CrossChainFeeMode | undefined;
30416
+ /**
30417
+ * Maximum slippage in basis points. When absent, the SDK default
30418
+ * (100 bps) is used.
30419
+ */ maxSlippageBps: /*u32*/ number | undefined;
30420
+ /**
30421
+ * Per-request override for the overpay buffer applied to the
30422
+ * sender's deposit when `fee_mode == FeesExcluded`. Range 0 to 500.
30423
+ * When absent, falls back to `CrossChainConfig::default_target_overpay_bps`
30424
+ * then the built-in default (15 bps). Ignored when `fee_mode`
30425
+ * is `FeesIncluded`.
30426
+ */ targetOverpayBps: /*u32*/ number | undefined;
30427
+ }): CrossChain_ {
30428
+ return new CrossChain_(inner);
30429
+ }
30430
+
30431
+ static instanceOf(obj: any): obj is CrossChain_ {
30432
+ return obj.tag === ReceivePaymentMethod_Tags.CrossChain;
30433
+ }
30434
+ }
30435
+
29191
30436
  function instanceOf(obj: any): obj is ReceivePaymentMethod {
29192
30437
  return obj[uniffiTypeNameSymbol] === 'ReceivePaymentMethod';
29193
30438
  }
@@ -29198,6 +30443,7 @@ export const ReceivePaymentMethod = (() => {
29198
30443
  SparkInvoice: SparkInvoice_,
29199
30444
  BitcoinAddress: BitcoinAddress_,
29200
30445
  Bolt11Invoice: Bolt11Invoice_,
30446
+ CrossChain: CrossChain_,
29201
30447
  });
29202
30448
  })();
29203
30449
 
@@ -29237,6 +30483,15 @@ const FfiConverterTypeReceivePaymentMethod = (() => {
29237
30483
  paymentHash: FfiConverterOptionalString.read(from),
29238
30484
  receiverIdentityPublicKey: FfiConverterOptionalString.read(from),
29239
30485
  });
30486
+ case 5:
30487
+ return new ReceivePaymentMethod.CrossChain({
30488
+ route: FfiConverterTypeCrossChainRoutePair.read(from),
30489
+ amount: FfiConverterTypeu128.read(from),
30490
+ destination: FfiConverterOptionalTypeSparkAsset.read(from),
30491
+ feeMode: FfiConverterOptionalTypeCrossChainFeeMode.read(from),
30492
+ maxSlippageBps: FfiConverterOptionalUInt32.read(from),
30493
+ targetOverpayBps: FfiConverterOptionalUInt32.read(from),
30494
+ });
29240
30495
  default:
29241
30496
  throw new UniffiInternalError.UnexpectedEnumCase();
29242
30497
  }
@@ -29276,6 +30531,17 @@ const FfiConverterTypeReceivePaymentMethod = (() => {
29276
30531
  );
29277
30532
  return;
29278
30533
  }
30534
+ case ReceivePaymentMethod_Tags.CrossChain: {
30535
+ ordinalConverter.write(5, into);
30536
+ const inner = value.inner;
30537
+ FfiConverterTypeCrossChainRoutePair.write(inner.route, into);
30538
+ FfiConverterTypeu128.write(inner.amount, into);
30539
+ FfiConverterOptionalTypeSparkAsset.write(inner.destination, into);
30540
+ FfiConverterOptionalTypeCrossChainFeeMode.write(inner.feeMode, into);
30541
+ FfiConverterOptionalUInt32.write(inner.maxSlippageBps, into);
30542
+ FfiConverterOptionalUInt32.write(inner.targetOverpayBps, into);
30543
+ return;
30544
+ }
29279
30545
  default:
29280
30546
  // Throwing from here means that ReceivePaymentMethod_Tags hasn't matched an ordinal.
29281
30547
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -29318,6 +30584,27 @@ const FfiConverterTypeReceivePaymentMethod = (() => {
29318
30584
  );
29319
30585
  return size;
29320
30586
  }
30587
+ case ReceivePaymentMethod_Tags.CrossChain: {
30588
+ const inner = value.inner;
30589
+ let size = ordinalConverter.allocationSize(5);
30590
+ size += FfiConverterTypeCrossChainRoutePair.allocationSize(
30591
+ inner.route
30592
+ );
30593
+ size += FfiConverterTypeu128.allocationSize(inner.amount);
30594
+ size += FfiConverterOptionalTypeSparkAsset.allocationSize(
30595
+ inner.destination
30596
+ );
30597
+ size += FfiConverterOptionalTypeCrossChainFeeMode.allocationSize(
30598
+ inner.feeMode
30599
+ );
30600
+ size += FfiConverterOptionalUInt32.allocationSize(
30601
+ inner.maxSlippageBps
30602
+ );
30603
+ size += FfiConverterOptionalUInt32.allocationSize(
30604
+ inner.targetOverpayBps
30605
+ );
30606
+ return size;
30607
+ }
29321
30608
  default:
29322
30609
  throw new UniffiInternalError.UnexpectedEnumCase();
29323
30610
  }
@@ -29491,7 +30778,6 @@ export enum SdkError_Tags {
29491
30778
  OptimizationAlreadyRunning = 'OptimizationAlreadyRunning',
29492
30779
  OptimizationCancelled = 'OptimizationCancelled',
29493
30780
  InsufficientCpfpFunds = 'InsufficientCpfpFunds',
29494
- FundingUtxoConflict = 'FundingUtxoConflict',
29495
30781
  Generic = 'Generic',
29496
30782
  }
29497
30783
  /**
@@ -30165,53 +31451,6 @@ export const SdkError = (() => {
30165
31451
  }
30166
31452
  }
30167
31453
 
30168
- type FundingUtxoConflict__interface = {
30169
- tag: SdkError_Tags.FundingUtxoConflict;
30170
- inner: Readonly<{ txid: string; vout: /*u32*/ number }>;
30171
- };
30172
-
30173
- /**
30174
- * A provided funding UTXO was already spent on-chain by a transaction that
30175
- * is not the expected fan-out, so it cannot fund this exit.
30176
- */
30177
- class FundingUtxoConflict_
30178
- extends UniffiError
30179
- implements FundingUtxoConflict__interface
30180
- {
30181
- /**
30182
- * @private
30183
- * This field is private and should not be used, use `tag` instead.
30184
- */
30185
- readonly [uniffiTypeNameSymbol] = 'SdkError';
30186
- readonly tag = SdkError_Tags.FundingUtxoConflict;
30187
- readonly inner: Readonly<{ txid: string; vout: /*u32*/ number }>;
30188
- constructor(inner: { txid: string; vout: /*u32*/ number }) {
30189
- super('SdkError', 'FundingUtxoConflict');
30190
- this.inner = Object.freeze(inner);
30191
- }
30192
-
30193
- static new(inner: {
30194
- txid: string;
30195
- vout: /*u32*/ number;
30196
- }): FundingUtxoConflict_ {
30197
- return new FundingUtxoConflict_(inner);
30198
- }
30199
-
30200
- static instanceOf(obj: any): obj is FundingUtxoConflict_ {
30201
- return obj.tag === SdkError_Tags.FundingUtxoConflict;
30202
- }
30203
-
30204
- static hasInner(obj: any): obj is FundingUtxoConflict_ {
30205
- return FundingUtxoConflict_.instanceOf(obj);
30206
- }
30207
-
30208
- static getInner(
30209
- obj: FundingUtxoConflict_
30210
- ): Readonly<{ txid: string; vout: /*u32*/ number }> {
30211
- return obj.inner;
30212
- }
30213
- }
30214
-
30215
31454
  type Generic__interface = {
30216
31455
  tag: SdkError_Tags.Generic;
30217
31456
  inner: Readonly<[string]>;
@@ -30269,7 +31508,6 @@ export const SdkError = (() => {
30269
31508
  OptimizationAlreadyRunning: OptimizationAlreadyRunning_,
30270
31509
  OptimizationCancelled: OptimizationCancelled_,
30271
31510
  InsufficientCpfpFunds: InsufficientCpfpFunds_,
30272
- FundingUtxoConflict: FundingUtxoConflict_,
30273
31511
  Generic: Generic_,
30274
31512
  });
30275
31513
  })();
@@ -30341,11 +31579,6 @@ const FfiConverterTypeSdkError = (() => {
30341
31579
  requiredSat: FfiConverterUInt64.read(from),
30342
31580
  });
30343
31581
  case 17:
30344
- return new SdkError.FundingUtxoConflict({
30345
- txid: FfiConverterString.read(from),
30346
- vout: FfiConverterUInt32.read(from),
30347
- });
30348
- case 18:
30349
31582
  return new SdkError.Generic(FfiConverterString.read(from));
30350
31583
  default:
30351
31584
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -30452,15 +31685,8 @@ const FfiConverterTypeSdkError = (() => {
30452
31685
  FfiConverterUInt64.write(inner.requiredSat, into);
30453
31686
  return;
30454
31687
  }
30455
- case SdkError_Tags.FundingUtxoConflict: {
30456
- ordinalConverter.write(17, into);
30457
- const inner = value.inner;
30458
- FfiConverterString.write(inner.txid, into);
30459
- FfiConverterUInt32.write(inner.vout, into);
30460
- return;
30461
- }
30462
31688
  case SdkError_Tags.Generic: {
30463
- ordinalConverter.write(18, into);
31689
+ ordinalConverter.write(17, into);
30464
31690
  const inner = value.inner;
30465
31691
  FfiConverterString.write(inner[0], into);
30466
31692
  return;
@@ -30573,16 +31799,9 @@ const FfiConverterTypeSdkError = (() => {
30573
31799
  size += FfiConverterUInt64.allocationSize(inner.requiredSat);
30574
31800
  return size;
30575
31801
  }
30576
- case SdkError_Tags.FundingUtxoConflict: {
30577
- const inner = value.inner;
30578
- let size = ordinalConverter.allocationSize(17);
30579
- size += FfiConverterString.allocationSize(inner.txid);
30580
- size += FfiConverterUInt32.allocationSize(inner.vout);
30581
- return size;
30582
- }
30583
31802
  case SdkError_Tags.Generic: {
30584
31803
  const inner = value.inner;
30585
- let size = ordinalConverter.allocationSize(18);
31804
+ let size = ordinalConverter.allocationSize(17);
30586
31805
  size += FfiConverterString.allocationSize(inner[0]);
30587
31806
  return size;
30588
31807
  }
@@ -33399,17 +34618,17 @@ const FfiConverterTypeSignerError = (() => {
33399
34618
  return new FFIConverter();
33400
34619
  })();
33401
34620
 
33402
- // Enum: SourceAsset
33403
- export enum SourceAsset_Tags {
34621
+ // Enum: SparkAsset
34622
+ export enum SparkAsset_Tags {
33404
34623
  Bitcoin = 'Bitcoin',
33405
34624
  Token = 'Token',
33406
34625
  }
33407
34626
  /**
33408
- * The source asset a cross-chain route accepts as input on the Spark side.
34627
+ * The asset a cross-chain route accepts on the Spark side.
33409
34628
  */
33410
- export const SourceAsset = (() => {
34629
+ export const SparkAsset = (() => {
33411
34630
  type Bitcoin__interface = {
33412
- tag: SourceAsset_Tags.Bitcoin;
34631
+ tag: SparkAsset_Tags.Bitcoin;
33413
34632
  };
33414
34633
 
33415
34634
  /**
@@ -33420,10 +34639,10 @@ export const SourceAsset = (() => {
33420
34639
  * @private
33421
34640
  * This field is private and should not be used, use `tag` instead.
33422
34641
  */
33423
- readonly [uniffiTypeNameSymbol] = 'SourceAsset';
33424
- readonly tag = SourceAsset_Tags.Bitcoin;
34642
+ readonly [uniffiTypeNameSymbol] = 'SparkAsset';
34643
+ readonly tag = SparkAsset_Tags.Bitcoin;
33425
34644
  constructor() {
33426
- super('SourceAsset', 'Bitcoin');
34645
+ super('SparkAsset', 'Bitcoin');
33427
34646
  }
33428
34647
 
33429
34648
  static new(): Bitcoin_ {
@@ -33431,12 +34650,12 @@ export const SourceAsset = (() => {
33431
34650
  }
33432
34651
 
33433
34652
  static instanceOf(obj: any): obj is Bitcoin_ {
33434
- return obj.tag === SourceAsset_Tags.Bitcoin;
34653
+ return obj.tag === SparkAsset_Tags.Bitcoin;
33435
34654
  }
33436
34655
  }
33437
34656
 
33438
34657
  type Token__interface = {
33439
- tag: SourceAsset_Tags.Token;
34658
+ tag: SparkAsset_Tags.Token;
33440
34659
  inner: Readonly<{ tokenIdentifier: string }>;
33441
34660
  };
33442
34661
 
@@ -33448,11 +34667,11 @@ export const SourceAsset = (() => {
33448
34667
  * @private
33449
34668
  * This field is private and should not be used, use `tag` instead.
33450
34669
  */
33451
- readonly [uniffiTypeNameSymbol] = 'SourceAsset';
33452
- readonly tag = SourceAsset_Tags.Token;
34670
+ readonly [uniffiTypeNameSymbol] = 'SparkAsset';
34671
+ readonly tag = SparkAsset_Tags.Token;
33453
34672
  readonly inner: Readonly<{ tokenIdentifier: string }>;
33454
34673
  constructor(inner: { tokenIdentifier: string }) {
33455
- super('SourceAsset', 'Token');
34674
+ super('SparkAsset', 'Token');
33456
34675
  this.inner = Object.freeze(inner);
33457
34676
  }
33458
34677
 
@@ -33461,12 +34680,12 @@ export const SourceAsset = (() => {
33461
34680
  }
33462
34681
 
33463
34682
  static instanceOf(obj: any): obj is Token_ {
33464
- return obj.tag === SourceAsset_Tags.Token;
34683
+ return obj.tag === SparkAsset_Tags.Token;
33465
34684
  }
33466
34685
  }
33467
34686
 
33468
- function instanceOf(obj: any): obj is SourceAsset {
33469
- return obj[uniffiTypeNameSymbol] === 'SourceAsset';
34687
+ function instanceOf(obj: any): obj is SparkAsset {
34688
+ return obj[uniffiTypeNameSymbol] === 'SparkAsset';
33470
34689
  }
33471
34690
 
33472
34691
  return Object.freeze({
@@ -33477,24 +34696,24 @@ export const SourceAsset = (() => {
33477
34696
  })();
33478
34697
 
33479
34698
  /**
33480
- * The source asset a cross-chain route accepts as input on the Spark side.
34699
+ * The asset a cross-chain route accepts on the Spark side.
33481
34700
  */
33482
34701
 
33483
- export type SourceAsset = InstanceType<
33484
- (typeof SourceAsset)[keyof Omit<typeof SourceAsset, 'instanceOf'>]
34702
+ export type SparkAsset = InstanceType<
34703
+ (typeof SparkAsset)[keyof Omit<typeof SparkAsset, 'instanceOf'>]
33485
34704
  >;
33486
34705
 
33487
- // FfiConverter for enum SourceAsset
33488
- const FfiConverterTypeSourceAsset = (() => {
34706
+ // FfiConverter for enum SparkAsset
34707
+ const FfiConverterTypeSparkAsset = (() => {
33489
34708
  const ordinalConverter = FfiConverterInt32;
33490
- type TypeName = SourceAsset;
34709
+ type TypeName = SparkAsset;
33491
34710
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
33492
34711
  read(from: RustBuffer): TypeName {
33493
34712
  switch (ordinalConverter.read(from)) {
33494
34713
  case 1:
33495
- return new SourceAsset.Bitcoin();
34714
+ return new SparkAsset.Bitcoin();
33496
34715
  case 2:
33497
- return new SourceAsset.Token({
34716
+ return new SparkAsset.Token({
33498
34717
  tokenIdentifier: FfiConverterString.read(from),
33499
34718
  });
33500
34719
  default:
@@ -33503,27 +34722,27 @@ const FfiConverterTypeSourceAsset = (() => {
33503
34722
  }
33504
34723
  write(value: TypeName, into: RustBuffer): void {
33505
34724
  switch (value.tag) {
33506
- case SourceAsset_Tags.Bitcoin: {
34725
+ case SparkAsset_Tags.Bitcoin: {
33507
34726
  ordinalConverter.write(1, into);
33508
34727
  return;
33509
34728
  }
33510
- case SourceAsset_Tags.Token: {
34729
+ case SparkAsset_Tags.Token: {
33511
34730
  ordinalConverter.write(2, into);
33512
34731
  const inner = value.inner;
33513
34732
  FfiConverterString.write(inner.tokenIdentifier, into);
33514
34733
  return;
33515
34734
  }
33516
34735
  default:
33517
- // Throwing from here means that SourceAsset_Tags hasn't matched an ordinal.
34736
+ // Throwing from here means that SparkAsset_Tags hasn't matched an ordinal.
33518
34737
  throw new UniffiInternalError.UnexpectedEnumCase();
33519
34738
  }
33520
34739
  }
33521
34740
  allocationSize(value: TypeName): number {
33522
34741
  switch (value.tag) {
33523
- case SourceAsset_Tags.Bitcoin: {
34742
+ case SparkAsset_Tags.Bitcoin: {
33524
34743
  return ordinalConverter.allocationSize(1);
33525
34744
  }
33526
- case SourceAsset_Tags.Token: {
34745
+ case SparkAsset_Tags.Token: {
33527
34746
  const inner = value.inner;
33528
34747
  let size = ordinalConverter.allocationSize(2);
33529
34748
  size += FfiConverterString.allocationSize(inner.tokenIdentifier);
@@ -33537,58 +34756,6 @@ const FfiConverterTypeSourceAsset = (() => {
33537
34756
  return new FFIConverter();
33538
34757
  })();
33539
34758
 
33540
- /**
33541
- * The chain a cross-chain route is funded from, orthogonal to the
33542
- * [`SourceAsset`] that moves.
33543
- */
33544
- export enum SourceChain {
33545
- /**
33546
- * Paid over Spark, using a Bitcoin or token source asset.
33547
- */
33548
- Spark,
33549
- /**
33550
- * Paid over Lightning, using a Bitcoin source asset.
33551
- */
33552
- Lightning,
33553
- /**
33554
- * Paid on-chain to Bitcoin (L1), using a Bitcoin source asset.
33555
- */
33556
- Bitcoin,
33557
- }
33558
-
33559
- const FfiConverterTypeSourceChain = (() => {
33560
- const ordinalConverter = FfiConverterInt32;
33561
- type TypeName = SourceChain;
33562
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
33563
- read(from: RustBuffer): TypeName {
33564
- switch (ordinalConverter.read(from)) {
33565
- case 1:
33566
- return SourceChain.Spark;
33567
- case 2:
33568
- return SourceChain.Lightning;
33569
- case 3:
33570
- return SourceChain.Bitcoin;
33571
- default:
33572
- throw new UniffiInternalError.UnexpectedEnumCase();
33573
- }
33574
- }
33575
- write(value: TypeName, into: RustBuffer): void {
33576
- switch (value) {
33577
- case SourceChain.Spark:
33578
- return ordinalConverter.write(1, into);
33579
- case SourceChain.Lightning:
33580
- return ordinalConverter.write(2, into);
33581
- case SourceChain.Bitcoin:
33582
- return ordinalConverter.write(3, into);
33583
- }
33584
- }
33585
- allocationSize(value: TypeName): number {
33586
- return ordinalConverter.allocationSize(0);
33587
- }
33588
- }
33589
- return new FFIConverter();
33590
- })();
33591
-
33592
34759
  export enum SparkHtlcStatus {
33593
34760
  /**
33594
34761
  * The HTLC is waiting for the preimage to be shared by the receiver
@@ -35417,6 +36584,44 @@ const FfiConverterTypeTransferTarget = (() => {
35417
36584
  return new FFIConverter();
35418
36585
  })();
35419
36586
 
36587
+ /**
36588
+ * Why an exit has to be built again.
36589
+ */
36590
+ export enum UnilateralExitRedoReason {
36591
+ /**
36592
+ * The chain no longer matches the exit: something that is not one of its
36593
+ * own transactions took an outpoint it still needs. A different refund, a
36594
+ * fee bump from elsewhere, or funding spent on something else all land
36595
+ * here.
36596
+ */
36597
+ OnChainStateDiverged,
36598
+ }
36599
+
36600
+ const FfiConverterTypeUnilateralExitRedoReason = (() => {
36601
+ const ordinalConverter = FfiConverterInt32;
36602
+ type TypeName = UnilateralExitRedoReason;
36603
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
36604
+ read(from: RustBuffer): TypeName {
36605
+ switch (ordinalConverter.read(from)) {
36606
+ case 1:
36607
+ return UnilateralExitRedoReason.OnChainStateDiverged;
36608
+ default:
36609
+ throw new UniffiInternalError.UnexpectedEnumCase();
36610
+ }
36611
+ }
36612
+ write(value: TypeName, into: RustBuffer): void {
36613
+ switch (value) {
36614
+ case UnilateralExitRedoReason.OnChainStateDiverged:
36615
+ return ordinalConverter.write(1, into);
36616
+ }
36617
+ }
36618
+ allocationSize(value: TypeName): number {
36619
+ return ordinalConverter.allocationSize(0);
36620
+ }
36621
+ }
36622
+ return new FFIConverter();
36623
+ })();
36624
+
35420
36625
  /**
35421
36626
  * The role of a transaction in the exit path.
35422
36627
  */
@@ -35477,6 +36682,189 @@ const FfiConverterTypeUnilateralExitTxKind = (() => {
35477
36682
  return new FFIConverter();
35478
36683
  })();
35479
36684
 
36685
+ // Enum: UnilateralExitVerdict
36686
+ export enum UnilateralExitVerdict_Tags {
36687
+ Valid = 'Valid',
36688
+ Done = 'Done',
36689
+ Redo = 'Redo',
36690
+ }
36691
+ /**
36692
+ * What to do with an exit that has been read back against the chain.
36693
+ */
36694
+ export const UnilateralExitVerdict = (() => {
36695
+ type Valid__interface = {
36696
+ tag: UnilateralExitVerdict_Tags.Valid;
36697
+ };
36698
+
36699
+ /**
36700
+ * The exit still holds. Broadcast the transactions whose dependencies are
36701
+ * confirmed and whose timelocks have matured.
36702
+ */
36703
+ class Valid_ extends UniffiEnum implements Valid__interface {
36704
+ /**
36705
+ * @private
36706
+ * This field is private and should not be used, use `tag` instead.
36707
+ */
36708
+ readonly [uniffiTypeNameSymbol] = 'UnilateralExitVerdict';
36709
+ readonly tag = UnilateralExitVerdict_Tags.Valid;
36710
+ constructor() {
36711
+ super('UnilateralExitVerdict', 'Valid');
36712
+ }
36713
+
36714
+ static new(): Valid_ {
36715
+ return new Valid_();
36716
+ }
36717
+
36718
+ static instanceOf(obj: any): obj is Valid_ {
36719
+ return obj.tag === UnilateralExitVerdict_Tags.Valid;
36720
+ }
36721
+ }
36722
+
36723
+ type Done__interface = {
36724
+ tag: UnilateralExitVerdict_Tags.Done;
36725
+ };
36726
+
36727
+ /**
36728
+ * Every transaction is confirmed, the sweep included. The funds have
36729
+ * arrived and there is nothing left to send.
36730
+ */
36731
+ class Done_ extends UniffiEnum implements Done__interface {
36732
+ /**
36733
+ * @private
36734
+ * This field is private and should not be used, use `tag` instead.
36735
+ */
36736
+ readonly [uniffiTypeNameSymbol] = 'UnilateralExitVerdict';
36737
+ readonly tag = UnilateralExitVerdict_Tags.Done;
36738
+ constructor() {
36739
+ super('UnilateralExitVerdict', 'Done');
36740
+ }
36741
+
36742
+ static new(): Done_ {
36743
+ return new Done_();
36744
+ }
36745
+
36746
+ static instanceOf(obj: any): obj is Done_ {
36747
+ return obj.tag === UnilateralExitVerdict_Tags.Done;
36748
+ }
36749
+ }
36750
+
36751
+ type Redo__interface = {
36752
+ tag: UnilateralExitVerdict_Tags.Redo;
36753
+ inner: Readonly<{ reason: UnilateralExitRedoReason }>;
36754
+ };
36755
+
36756
+ /**
36757
+ * The exit cannot be finished as it stands. Quote and build it again.
36758
+ */
36759
+ class Redo_ extends UniffiEnum implements Redo__interface {
36760
+ /**
36761
+ * @private
36762
+ * This field is private and should not be used, use `tag` instead.
36763
+ */
36764
+ readonly [uniffiTypeNameSymbol] = 'UnilateralExitVerdict';
36765
+ readonly tag = UnilateralExitVerdict_Tags.Redo;
36766
+ readonly inner: Readonly<{ reason: UnilateralExitRedoReason }>;
36767
+ constructor(inner: { reason: UnilateralExitRedoReason }) {
36768
+ super('UnilateralExitVerdict', 'Redo');
36769
+ this.inner = Object.freeze(inner);
36770
+ }
36771
+
36772
+ static new(inner: { reason: UnilateralExitRedoReason }): Redo_ {
36773
+ return new Redo_(inner);
36774
+ }
36775
+
36776
+ static instanceOf(obj: any): obj is Redo_ {
36777
+ return obj.tag === UnilateralExitVerdict_Tags.Redo;
36778
+ }
36779
+ }
36780
+
36781
+ function instanceOf(obj: any): obj is UnilateralExitVerdict {
36782
+ return obj[uniffiTypeNameSymbol] === 'UnilateralExitVerdict';
36783
+ }
36784
+
36785
+ return Object.freeze({
36786
+ instanceOf,
36787
+ Valid: Valid_,
36788
+ Done: Done_,
36789
+ Redo: Redo_,
36790
+ });
36791
+ })();
36792
+
36793
+ /**
36794
+ * What to do with an exit that has been read back against the chain.
36795
+ */
36796
+
36797
+ export type UnilateralExitVerdict = InstanceType<
36798
+ (typeof UnilateralExitVerdict)[keyof Omit<
36799
+ typeof UnilateralExitVerdict,
36800
+ 'instanceOf'
36801
+ >]
36802
+ >;
36803
+
36804
+ // FfiConverter for enum UnilateralExitVerdict
36805
+ const FfiConverterTypeUnilateralExitVerdict = (() => {
36806
+ const ordinalConverter = FfiConverterInt32;
36807
+ type TypeName = UnilateralExitVerdict;
36808
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
36809
+ read(from: RustBuffer): TypeName {
36810
+ switch (ordinalConverter.read(from)) {
36811
+ case 1:
36812
+ return new UnilateralExitVerdict.Valid();
36813
+ case 2:
36814
+ return new UnilateralExitVerdict.Done();
36815
+ case 3:
36816
+ return new UnilateralExitVerdict.Redo({
36817
+ reason: FfiConverterTypeUnilateralExitRedoReason.read(from),
36818
+ });
36819
+ default:
36820
+ throw new UniffiInternalError.UnexpectedEnumCase();
36821
+ }
36822
+ }
36823
+ write(value: TypeName, into: RustBuffer): void {
36824
+ switch (value.tag) {
36825
+ case UnilateralExitVerdict_Tags.Valid: {
36826
+ ordinalConverter.write(1, into);
36827
+ return;
36828
+ }
36829
+ case UnilateralExitVerdict_Tags.Done: {
36830
+ ordinalConverter.write(2, into);
36831
+ return;
36832
+ }
36833
+ case UnilateralExitVerdict_Tags.Redo: {
36834
+ ordinalConverter.write(3, into);
36835
+ const inner = value.inner;
36836
+ FfiConverterTypeUnilateralExitRedoReason.write(inner.reason, into);
36837
+ return;
36838
+ }
36839
+ default:
36840
+ // Throwing from here means that UnilateralExitVerdict_Tags hasn't matched an ordinal.
36841
+ throw new UniffiInternalError.UnexpectedEnumCase();
36842
+ }
36843
+ }
36844
+ allocationSize(value: TypeName): number {
36845
+ switch (value.tag) {
36846
+ case UnilateralExitVerdict_Tags.Valid: {
36847
+ return ordinalConverter.allocationSize(1);
36848
+ }
36849
+ case UnilateralExitVerdict_Tags.Done: {
36850
+ return ordinalConverter.allocationSize(2);
36851
+ }
36852
+ case UnilateralExitVerdict_Tags.Redo: {
36853
+ const inner = value.inner;
36854
+ let size = ordinalConverter.allocationSize(3);
36855
+ size += FfiConverterTypeUnilateralExitRedoReason.allocationSize(
36856
+ inner.reason
36857
+ );
36858
+ return size;
36859
+ }
36860
+ default:
36861
+ throw new UniffiInternalError.UnexpectedEnumCase();
36862
+ }
36863
+ }
36864
+ }
36865
+ return new FFIConverter();
36866
+ })();
36867
+
35480
36868
  // Enum: UnsignedTransferPackage
35481
36869
  export enum UnsignedTransferPackage_Tags {
35482
36870
  Swap = 'Swap',
@@ -37392,6 +38780,18 @@ export interface BreezSdkInterface {
37392
38780
  request: CheckMessageRequest,
37393
38781
  asyncOpts_?: { signal: AbortSignal }
37394
38782
  ): /*throws*/ Promise<CheckMessageResponse>;
38783
+ /**
38784
+ * Reads an exit you kept back against the chain: which of its transactions
38785
+ * are now in a block, and whether it can still be finished as it stands.
38786
+ *
38787
+ * Needs neither the wallet's leaves nor a signer, so an exit can be followed
38788
+ * from the response alone. Store the response in place of the one you passed
38789
+ * in, and broadcast what its statuses leave to send.
38790
+ */
38791
+ checkUnilateralExit(
38792
+ request: CheckUnilateralExitRequest,
38793
+ asyncOpts_?: { signal: AbortSignal }
38794
+ ): /*throws*/ Promise<CheckUnilateralExitResponse>;
37395
38795
  claimDeposit(
37396
38796
  request: ClaimDepositRequest,
37397
38797
  asyncOpts_?: { signal: AbortSignal }
@@ -37849,11 +39249,10 @@ export interface BreezSdkInterface {
37849
39249
  * topological broadcast order without broadcasting. Broadcast it over time,
37850
39250
  * respecting each transaction's `depends_on` and `csv_timelock_blocks`.
37851
39251
  *
37852
- * It resolves on-chain state first (see [`resolve_exit_observations`]): an
37853
- * already-confirmed fan-out or CPFP node is not rebuilt, and a leaf refund
37854
- * already on-chain (recognized by the leaf's refund address, so any refund
37855
- * variant counts) is swept directly. Re-running after partial progress
37856
- * therefore resumes rather than restarts.
39252
+ * It reads on-chain state first: an already-confirmed fan-out or CPFP node
39253
+ * is not rebuilt, and a leaf refund already on-chain (recognized by the
39254
+ * leaf's refund address, so any refund variant counts) is swept directly.
39255
+ * Re-running after partial progress therefore resumes rather than restarts.
37857
39256
  */
37858
39257
  unilateralExit(
37859
39258
  request: UnilateralExitRequest,
@@ -38325,6 +39724,53 @@ export class BreezSdk
38325
39724
  }
38326
39725
  }
38327
39726
 
39727
+ /**
39728
+ * Reads an exit you kept back against the chain: which of its transactions
39729
+ * are now in a block, and whether it can still be finished as it stands.
39730
+ *
39731
+ * Needs neither the wallet's leaves nor a signer, so an exit can be followed
39732
+ * from the response alone. Store the response in place of the one you passed
39733
+ * in, and broadcast what its statuses leave to send.
39734
+ */
39735
+ public async checkUnilateralExit(
39736
+ request: CheckUnilateralExitRequest,
39737
+ asyncOpts_?: { signal: AbortSignal }
39738
+ ): Promise<CheckUnilateralExitResponse> /*throws*/ {
39739
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
39740
+ try {
39741
+ return await uniffiRustCallAsync(
39742
+ /*rustCaller:*/ uniffiCaller,
39743
+ /*rustFutureFunc:*/ () => {
39744
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_check_unilateral_exit(
39745
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
39746
+ FfiConverterTypeCheckUnilateralExitRequest.lower(request)
39747
+ );
39748
+ },
39749
+ /*pollFunc:*/ nativeModule()
39750
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
39751
+ /*cancelFunc:*/ nativeModule()
39752
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
39753
+ /*completeFunc:*/ nativeModule()
39754
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
39755
+ /*freeFunc:*/ nativeModule()
39756
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
39757
+ /*liftFunc:*/ FfiConverterTypeCheckUnilateralExitResponse.lift.bind(
39758
+ FfiConverterTypeCheckUnilateralExitResponse
39759
+ ),
39760
+ /*liftString:*/ FfiConverterString.lift,
39761
+ /*asyncOpts:*/ asyncOpts_,
39762
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
39763
+ FfiConverterTypeSdkError
39764
+ )
39765
+ );
39766
+ } catch (__error: any) {
39767
+ if (uniffiIsDebug && __error instanceof Error) {
39768
+ __error.stack = __stack;
39769
+ }
39770
+ throw __error;
39771
+ }
39772
+ }
39773
+
38328
39774
  public async claimDeposit(
38329
39775
  request: ClaimDepositRequest,
38330
39776
  asyncOpts_?: { signal: AbortSignal }
@@ -40351,11 +41797,10 @@ export class BreezSdk
40351
41797
  * topological broadcast order without broadcasting. Broadcast it over time,
40352
41798
  * respecting each transaction's `depends_on` and `csv_timelock_blocks`.
40353
41799
  *
40354
- * It resolves on-chain state first (see [`resolve_exit_observations`]): an
40355
- * already-confirmed fan-out or CPFP node is not rebuilt, and a leaf refund
40356
- * already on-chain (recognized by the leaf's refund address, so any refund
40357
- * variant counts) is swept directly. Re-running after partial progress
40358
- * therefore resumes rather than restarts.
41800
+ * It reads on-chain state first: an already-confirmed fan-out or CPFP node
41801
+ * is not rebuilt, and a leaf refund already on-chain (recognized by the
41802
+ * leaf's refund address, so any refund variant counts) is swept directly.
41803
+ * Re-running after partial progress therefore resumes rather than restarts.
40359
41804
  */
40360
41805
  public async unilateralExit(
40361
41806
  request: UnilateralExitRequest,
@@ -51869,6 +53314,11 @@ const FfiConverterOptionalTypeCrossChainConfig = new FfiConverterOptional(
51869
53314
  FfiConverterTypeCrossChainConfig
51870
53315
  );
51871
53316
 
53317
+ // FfiConverter for CrossChainReceiveInfo | undefined
53318
+ const FfiConverterOptionalTypeCrossChainReceiveInfo = new FfiConverterOptional(
53319
+ FfiConverterTypeCrossChainReceiveInfo
53320
+ );
53321
+
51872
53322
  // FfiConverter for LightningAddressInfo | undefined
51873
53323
  const FfiConverterOptionalTypeLightningAddressInfo = new FfiConverterOptional(
51874
53324
  FfiConverterTypeLightningAddressInfo
@@ -52012,6 +53462,11 @@ const FfiConverterArrayTypeBolt12OfferBlindedPath = new FfiConverterArray(
52012
53462
  FfiConverterTypeBolt12OfferBlindedPath
52013
53463
  );
52014
53464
 
53465
+ // FfiConverter for Array<ConfirmedExitNode>
53466
+ const FfiConverterArrayTypeConfirmedExitNode = new FfiConverterArray(
53467
+ FfiConverterTypeConfirmedExitNode
53468
+ );
53469
+
52015
53470
  // FfiConverter for Array<Contact>
52016
53471
  const FfiConverterArrayTypeContact = new FfiConverterArray(
52017
53472
  FfiConverterTypeContact
@@ -52032,6 +53487,11 @@ const FfiConverterArrayTypeDepositInfo = new FfiConverterArray(
52032
53487
  FfiConverterTypeDepositInfo
52033
53488
  );
52034
53489
 
53490
+ // FfiConverter for Array<ExitRefund>
53491
+ const FfiConverterArrayTypeExitRefund = new FfiConverterArray(
53492
+ FfiConverterTypeExitRefund
53493
+ );
53494
+
52035
53495
  // FfiConverter for Array<ExternalClaimLeafInput>
52036
53496
  const FfiConverterArrayTypeExternalClaimLeafInput = new FfiConverterArray(
52037
53497
  FfiConverterTypeExternalClaimLeafInput
@@ -52244,6 +53704,11 @@ const FfiConverterOptionalTypeConversionStatus = new FfiConverterOptional(
52244
53704
  FfiConverterTypeConversionStatus
52245
53705
  );
52246
53706
 
53707
+ // FfiConverter for CrossChainFeeMode | undefined
53708
+ const FfiConverterOptionalTypeCrossChainFeeMode = new FfiConverterOptional(
53709
+ FfiConverterTypeCrossChainFeeMode
53710
+ );
53711
+
52247
53712
  // FfiConverter for DepositClaimError | undefined
52248
53713
  const FfiConverterOptionalTypeDepositClaimError = new FfiConverterOptional(
52249
53714
  FfiConverterTypeDepositClaimError
@@ -52284,6 +53749,11 @@ const FfiConverterOptionalTypeSendPaymentOptions = new FfiConverterOptional(
52284
53749
  FfiConverterTypeSendPaymentOptions
52285
53750
  );
52286
53751
 
53752
+ // FfiConverter for SparkAsset | undefined
53753
+ const FfiConverterOptionalTypeSparkAsset = new FfiConverterOptional(
53754
+ FfiConverterTypeSparkAsset
53755
+ );
53756
+
52287
53757
  // FfiConverter for SparkMasterIdentityPublicKey | undefined
52288
53758
  const FfiConverterOptionalTypeSparkMasterIdentityPublicKey =
52289
53759
  new FfiConverterOptional(FfiConverterTypeSparkMasterIdentityPublicKey);
@@ -52336,6 +53806,11 @@ const FfiConverterArrayTypeCpfpInput = new FfiConverterArray(
52336
53806
  FfiConverterTypeCpfpInput
52337
53807
  );
52338
53808
 
53809
+ // FfiConverter for Array<DeliveryMethod>
53810
+ const FfiConverterArrayTypeDeliveryMethod = new FfiConverterArray(
53811
+ FfiConverterTypeDeliveryMethod
53812
+ );
53813
+
52339
53814
  // FfiConverter for Array<InputType>
52340
53815
  const FfiConverterArrayTypeInputType = new FfiConverterArray(
52341
53816
  FfiConverterTypeInputType
@@ -52356,14 +53831,9 @@ const FfiConverterArrayTypePaymentType = new FfiConverterArray(
52356
53831
  FfiConverterTypePaymentType
52357
53832
  );
52358
53833
 
52359
- // FfiConverter for Array<SourceAsset>
52360
- const FfiConverterArrayTypeSourceAsset = new FfiConverterArray(
52361
- FfiConverterTypeSourceAsset
52362
- );
52363
-
52364
- // FfiConverter for Array<SourceChain>
52365
- const FfiConverterArrayTypeSourceChain = new FfiConverterArray(
52366
- FfiConverterTypeSourceChain
53834
+ // FfiConverter for Array<SparkAsset>
53835
+ const FfiConverterArrayTypeSparkAsset = new FfiConverterArray(
53836
+ FfiConverterTypeSparkAsset
52367
53837
  );
52368
53838
 
52369
53839
  // FfiConverter for Array<SparkHtlcStatus>
@@ -52689,6 +54159,14 @@ function uniffiEnsureInitialized() {
52689
54159
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_check_message'
52690
54160
  );
52691
54161
  }
54162
+ if (
54163
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_check_unilateral_exit() !==
54164
+ 27303
54165
+ ) {
54166
+ throw new UniffiInternalError.ApiChecksumMismatch(
54167
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_check_unilateral_exit'
54168
+ );
54169
+ }
52692
54170
  if (
52693
54171
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_claim_deposit() !==
52694
54172
  43529
@@ -53059,7 +54537,7 @@ function uniffiEnsureInitialized() {
53059
54537
  }
53060
54538
  if (
53061
54539
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_unilateral_exit() !==
53062
- 23033
54540
+ 58676
53063
54541
  ) {
53064
54542
  throw new UniffiInternalError.ApiChecksumMismatch(
53065
54543
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_unilateral_exit'
@@ -53988,6 +55466,8 @@ export default Object.freeze({
53988
55466
  FfiConverterTypeCheckLightningAddressRequest,
53989
55467
  FfiConverterTypeCheckMessageRequest,
53990
55468
  FfiConverterTypeCheckMessageResponse,
55469
+ FfiConverterTypeCheckUnilateralExitRequest,
55470
+ FfiConverterTypeCheckUnilateralExitResponse,
53991
55471
  FfiConverterTypeClaimDepositQuote,
53992
55472
  FfiConverterTypeClaimDepositRequest,
53993
55473
  FfiConverterTypeClaimDepositResponse,
@@ -53995,7 +55475,7 @@ export default Object.freeze({
53995
55475
  FfiConverterTypeClaimHtlcPaymentResponse,
53996
55476
  FfiConverterTypeClaimTransferRequest,
53997
55477
  FfiConverterTypeConfig,
53998
- FfiConverterTypeConfirmationStatus,
55478
+ FfiConverterTypeConfirmedExitNode,
53999
55479
  FfiConverterTypeConnectRequest,
54000
55480
  FfiConverterTypeConnectWithPasskeyRequest,
54001
55481
  FfiConverterTypeConnectWithPasskeyResponse,
@@ -54027,9 +55507,11 @@ export default Object.freeze({
54027
55507
  FfiConverterTypeCrossChainFeeMode,
54028
55508
  FfiConverterTypeCrossChainProvider,
54029
55509
  FfiConverterTypeCrossChainProviderContext,
55510
+ FfiConverterTypeCrossChainReceiveInfo,
54030
55511
  FfiConverterTypeCrossChainRouteFilter,
54031
55512
  FfiConverterTypeCrossChainRoutePair,
54032
55513
  FfiConverterTypeCurrencyInfo,
55514
+ FfiConverterTypeDeliveryMethod,
54033
55515
  FfiConverterTypeDepositClaimError,
54034
55516
  FfiConverterTypeDepositInfo,
54035
55517
  FfiConverterTypeDeriveSeedsOutput,
@@ -54037,7 +55519,12 @@ export default Object.freeze({
54037
55519
  FfiConverterTypeDomainAssociation,
54038
55520
  FfiConverterTypeEcdsaSignatureBytes,
54039
55521
  FfiConverterTypeErrorKind,
55522
+ FfiConverterTypeExitChainState,
54040
55523
  FfiConverterTypeExitLeafSelection,
55524
+ FfiConverterTypeExitNodeConfirmation,
55525
+ FfiConverterTypeExitRefund,
55526
+ FfiConverterTypeExitRefundState,
55527
+ FfiConverterTypeExitTransactionStatus,
54041
55528
  FfiConverterTypeExportUnilateralExitStateResponse,
54042
55529
  FfiConverterTypeExternalBreezSigner,
54043
55530
  FfiConverterTypeExternalClaimLeafInput,
@@ -54237,9 +55724,8 @@ export default Object.freeze({
54237
55724
  FfiConverterTypeSignerError,
54238
55725
  FfiConverterTypeSigningOnlyExternalSigners,
54239
55726
  FfiConverterTypeSilentPaymentAddressDetails,
54240
- FfiConverterTypeSourceAsset,
54241
- FfiConverterTypeSourceChain,
54242
55727
  FfiConverterTypeSparkAddressDetails,
55728
+ FfiConverterTypeSparkAsset,
54243
55729
  FfiConverterTypeSparkConfig,
54244
55730
  FfiConverterTypeSparkHtlcDetails,
54245
55731
  FfiConverterTypeSparkHtlcOptions,
@@ -54279,10 +55765,12 @@ export default Object.freeze({
54279
55765
  FfiConverterTypeUnfreezeIssuerTokenRequest,
54280
55766
  FfiConverterTypeUnfreezeIssuerTokenResponse,
54281
55767
  FfiConverterTypeUnilateralExitLeaf,
55768
+ FfiConverterTypeUnilateralExitRedoReason,
54282
55769
  FfiConverterTypeUnilateralExitRequest,
54283
55770
  FfiConverterTypeUnilateralExitResponse,
54284
55771
  FfiConverterTypeUnilateralExitTransaction,
54285
55772
  FfiConverterTypeUnilateralExitTxKind,
55773
+ FfiConverterTypeUnilateralExitVerdict,
54286
55774
  FfiConverterTypeUnregisterWebhookRequest,
54287
55775
  FfiConverterTypeUnsignedTransferPackage,
54288
55776
  FfiConverterTypeUnversionedRecordChange,