@breeztech/breez-sdk-spark-react-native 0.19.2 → 0.20.0-dev1

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.
@@ -32,6 +32,7 @@ import nativeModule, {
32
32
  type UniffiVTableCallbackInterfaceEventListener,
33
33
  type UniffiVTableCallbackInterfaceLogger,
34
34
  type UniffiVTableCallbackInterfaceBitcoinChainService,
35
+ type UniffiVTableCallbackInterfaceCpfpSigner,
35
36
  type UniffiVTableCallbackInterfaceExternalBreezSigner,
36
37
  type UniffiVTableCallbackInterfaceExternalSigningSigner,
37
38
  type UniffiVTableCallbackInterfaceExternalSparkSigner,
@@ -683,6 +684,28 @@ export async function newSharedSdkContext(
683
684
  throw __error;
684
685
  }
685
686
  }
687
+ /**
688
+ * A CPFP signer backed by a single private key. Signs P2WPKH and P2TR key-path
689
+ * inputs only; taproot script-path spends are not supported.
690
+ */
691
+ export function singleKeyCpfpSigner(
692
+ secretKeyBytes: ArrayBuffer
693
+ ): CpfpSigner /*throws*/ {
694
+ return FfiConverterTypeCpfpSigner.lift(
695
+ uniffiCaller.rustCallWithError(
696
+ /*liftError:*/ FfiConverterTypeSignerError.lift.bind(
697
+ FfiConverterTypeSignerError
698
+ ),
699
+ /*caller:*/ (callStatus) => {
700
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_func_single_key_cpfp_signer(
701
+ FfiConverterArrayBuffer.lower(secretKeyBytes),
702
+ callStatus
703
+ );
704
+ },
705
+ /*liftString:*/ FfiConverterString.lift
706
+ )
707
+ );
708
+ }
686
709
 
687
710
  /**
688
711
  * Trait for event listeners
@@ -10644,6 +10667,73 @@ const FfiConverterTypePaymentRequestSource = (() => {
10644
10667
  return new FFIConverter();
10645
10668
  })();
10646
10669
 
10670
+ /**
10671
+ * How much to fund one branch of the exit to avoid a fan-out.
10672
+ */
10673
+ export type PerBranchFunding = {
10674
+ /**
10675
+ * The leaf whose branch this funds.
10676
+ */
10677
+ leafId: string;
10678
+ /**
10679
+ * Fund a UTXO of at least this many satoshis for this branch.
10680
+ */
10681
+ fundingSat: /*u64*/ bigint;
10682
+ };
10683
+
10684
+ /**
10685
+ * Generated factory for {@link PerBranchFunding} record objects.
10686
+ */
10687
+ export const PerBranchFunding = (() => {
10688
+ const defaults = () => ({});
10689
+ const create = (() => {
10690
+ return uniffiCreateRecord<PerBranchFunding, ReturnType<typeof defaults>>(
10691
+ defaults
10692
+ );
10693
+ })();
10694
+ return Object.freeze({
10695
+ /**
10696
+ * Create a frozen instance of {@link PerBranchFunding}, with defaults specified
10697
+ * in Rust, in the {@link breez_sdk_spark} crate.
10698
+ */
10699
+ create,
10700
+
10701
+ /**
10702
+ * Create a frozen instance of {@link PerBranchFunding}, with defaults specified
10703
+ * in Rust, in the {@link breez_sdk_spark} crate.
10704
+ */
10705
+ new: create,
10706
+
10707
+ /**
10708
+ * Defaults specified in the {@link breez_sdk_spark} crate.
10709
+ */
10710
+ defaults: () => Object.freeze(defaults()) as Partial<PerBranchFunding>,
10711
+ });
10712
+ })();
10713
+
10714
+ const FfiConverterTypePerBranchFunding = (() => {
10715
+ type TypeName = PerBranchFunding;
10716
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
10717
+ read(from: RustBuffer): TypeName {
10718
+ return {
10719
+ leafId: FfiConverterString.read(from),
10720
+ fundingSat: FfiConverterUInt64.read(from),
10721
+ };
10722
+ }
10723
+ write(value: TypeName, into: RustBuffer): void {
10724
+ FfiConverterString.write(value.leafId, into);
10725
+ FfiConverterUInt64.write(value.fundingSat, into);
10726
+ }
10727
+ allocationSize(value: TypeName): number {
10728
+ return (
10729
+ FfiConverterString.allocationSize(value.leafId) +
10730
+ FfiConverterUInt64.allocationSize(value.fundingSat)
10731
+ );
10732
+ }
10733
+ }
10734
+ return new FFIConverter();
10735
+ })();
10736
+
10647
10737
  export type PrepareLnurlPayRequest = {
10648
10738
  /**
10649
10739
  * The amount to send. Denominated in satoshis, or in token base units
@@ -11065,6 +11155,198 @@ const FfiConverterTypePrepareSendPaymentResponse = (() => {
11065
11155
  return new FFIConverter();
11066
11156
  })();
11067
11157
 
11158
+ /**
11159
+ * Request for `prepare_unilateral_exit`, the exit quote.
11160
+ */
11161
+ export type PrepareUnilateralExitRequest = {
11162
+ /**
11163
+ * Target fee rate in sat/vByte, applied to every CPFP child, the fan-out,
11164
+ * and the sweep.
11165
+ */
11166
+ feeRateSatPerVbyte: /*u64*/ bigint;
11167
+ fundingKind: CpfpFundingKind;
11168
+ /**
11169
+ * The Bitcoin address the swept funds are sent to.
11170
+ */
11171
+ destination: string;
11172
+ selection: ExitLeafSelection;
11173
+ };
11174
+
11175
+ /**
11176
+ * Generated factory for {@link PrepareUnilateralExitRequest} record objects.
11177
+ */
11178
+ export const PrepareUnilateralExitRequest = (() => {
11179
+ const defaults = () => ({});
11180
+ const create = (() => {
11181
+ return uniffiCreateRecord<
11182
+ PrepareUnilateralExitRequest,
11183
+ ReturnType<typeof defaults>
11184
+ >(defaults);
11185
+ })();
11186
+ return Object.freeze({
11187
+ /**
11188
+ * Create a frozen instance of {@link PrepareUnilateralExitRequest}, with defaults specified
11189
+ * in Rust, in the {@link breez_sdk_spark} crate.
11190
+ */
11191
+ create,
11192
+
11193
+ /**
11194
+ * Create a frozen instance of {@link PrepareUnilateralExitRequest}, with defaults specified
11195
+ * in Rust, in the {@link breez_sdk_spark} crate.
11196
+ */
11197
+ new: create,
11198
+
11199
+ /**
11200
+ * Defaults specified in the {@link breez_sdk_spark} crate.
11201
+ */
11202
+ defaults: () =>
11203
+ Object.freeze(defaults()) as Partial<PrepareUnilateralExitRequest>,
11204
+ });
11205
+ })();
11206
+
11207
+ const FfiConverterTypePrepareUnilateralExitRequest = (() => {
11208
+ type TypeName = PrepareUnilateralExitRequest;
11209
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
11210
+ read(from: RustBuffer): TypeName {
11211
+ return {
11212
+ feeRateSatPerVbyte: FfiConverterUInt64.read(from),
11213
+ fundingKind: FfiConverterTypeCpfpFundingKind.read(from),
11214
+ destination: FfiConverterString.read(from),
11215
+ selection: FfiConverterTypeExitLeafSelection.read(from),
11216
+ };
11217
+ }
11218
+ write(value: TypeName, into: RustBuffer): void {
11219
+ FfiConverterUInt64.write(value.feeRateSatPerVbyte, into);
11220
+ FfiConverterTypeCpfpFundingKind.write(value.fundingKind, into);
11221
+ FfiConverterString.write(value.destination, into);
11222
+ FfiConverterTypeExitLeafSelection.write(value.selection, into);
11223
+ }
11224
+ allocationSize(value: TypeName): number {
11225
+ return (
11226
+ FfiConverterUInt64.allocationSize(value.feeRateSatPerVbyte) +
11227
+ FfiConverterTypeCpfpFundingKind.allocationSize(value.fundingKind) +
11228
+ FfiConverterString.allocationSize(value.destination) +
11229
+ FfiConverterTypeExitLeafSelection.allocationSize(value.selection)
11230
+ );
11231
+ }
11232
+ }
11233
+ return new FFIConverter();
11234
+ })();
11235
+
11236
+ /**
11237
+ * Response from `prepare_unilateral_exit`: which leaves would exit, the exact
11238
+ * fee at the requested rate, and how much to fund.
11239
+ */
11240
+ export type PrepareUnilateralExitResponse = {
11241
+ leaves: Array<UnilateralExitLeaf>;
11242
+ /**
11243
+ * Total value of the selected leaves, in satoshis.
11244
+ */
11245
+ recoverableValueSat: /*u64*/ bigint;
11246
+ /**
11247
+ * Total on-chain fee when funding with a single UTXO (fanned out across
11248
+ * branches), in satoshis. Exact for the given funding kind; nodes the
11249
+ * operators report on-chain are assumed already paid, so a partially-exited
11250
+ * tree quotes a lower fee than a fresh one.
11251
+ */
11252
+ totalFeeSat: /*u64*/ bigint;
11253
+ /**
11254
+ * The part of `total_fee_sat` paid for the fan-out transaction. Funding one
11255
+ * UTXO per branch (`per_branch_funding`) avoids it. Zero for a single
11256
+ * branch (no fan-out).
11257
+ */
11258
+ fanoutFeeSat: /*u64*/ bigint;
11259
+ /**
11260
+ * Fund a single UTXO of at least this many satoshis to exit with a fan-out.
11261
+ */
11262
+ singleUtxoFundingSat: /*u64*/ bigint;
11263
+ /**
11264
+ * To skip the fan-out, fund one UTXO per branch of at least the given
11265
+ * amount (one entry per selected leaf).
11266
+ */
11267
+ perBranchFunding: Array<PerBranchFunding>;
11268
+ /**
11269
+ * The fee rate this quote was computed at, in sat/vByte.
11270
+ */
11271
+ feeRateSatPerVbyte: /*u64*/ bigint;
11272
+ destination: string;
11273
+ };
11274
+
11275
+ /**
11276
+ * Generated factory for {@link PrepareUnilateralExitResponse} record objects.
11277
+ */
11278
+ export const PrepareUnilateralExitResponse = (() => {
11279
+ const defaults = () => ({});
11280
+ const create = (() => {
11281
+ return uniffiCreateRecord<
11282
+ PrepareUnilateralExitResponse,
11283
+ ReturnType<typeof defaults>
11284
+ >(defaults);
11285
+ })();
11286
+ return Object.freeze({
11287
+ /**
11288
+ * Create a frozen instance of {@link PrepareUnilateralExitResponse}, with defaults specified
11289
+ * in Rust, in the {@link breez_sdk_spark} crate.
11290
+ */
11291
+ create,
11292
+
11293
+ /**
11294
+ * Create a frozen instance of {@link PrepareUnilateralExitResponse}, with defaults specified
11295
+ * in Rust, in the {@link breez_sdk_spark} crate.
11296
+ */
11297
+ new: create,
11298
+
11299
+ /**
11300
+ * Defaults specified in the {@link breez_sdk_spark} crate.
11301
+ */
11302
+ defaults: () =>
11303
+ Object.freeze(defaults()) as Partial<PrepareUnilateralExitResponse>,
11304
+ });
11305
+ })();
11306
+
11307
+ const FfiConverterTypePrepareUnilateralExitResponse = (() => {
11308
+ type TypeName = PrepareUnilateralExitResponse;
11309
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
11310
+ read(from: RustBuffer): TypeName {
11311
+ return {
11312
+ leaves: FfiConverterArrayTypeUnilateralExitLeaf.read(from),
11313
+ recoverableValueSat: FfiConverterUInt64.read(from),
11314
+ totalFeeSat: FfiConverterUInt64.read(from),
11315
+ fanoutFeeSat: FfiConverterUInt64.read(from),
11316
+ singleUtxoFundingSat: FfiConverterUInt64.read(from),
11317
+ perBranchFunding: FfiConverterArrayTypePerBranchFunding.read(from),
11318
+ feeRateSatPerVbyte: FfiConverterUInt64.read(from),
11319
+ destination: FfiConverterString.read(from),
11320
+ };
11321
+ }
11322
+ write(value: TypeName, into: RustBuffer): void {
11323
+ FfiConverterArrayTypeUnilateralExitLeaf.write(value.leaves, into);
11324
+ FfiConverterUInt64.write(value.recoverableValueSat, into);
11325
+ FfiConverterUInt64.write(value.totalFeeSat, into);
11326
+ FfiConverterUInt64.write(value.fanoutFeeSat, into);
11327
+ FfiConverterUInt64.write(value.singleUtxoFundingSat, into);
11328
+ FfiConverterArrayTypePerBranchFunding.write(value.perBranchFunding, into);
11329
+ FfiConverterUInt64.write(value.feeRateSatPerVbyte, into);
11330
+ FfiConverterString.write(value.destination, into);
11331
+ }
11332
+ allocationSize(value: TypeName): number {
11333
+ return (
11334
+ FfiConverterArrayTypeUnilateralExitLeaf.allocationSize(value.leaves) +
11335
+ FfiConverterUInt64.allocationSize(value.recoverableValueSat) +
11336
+ FfiConverterUInt64.allocationSize(value.totalFeeSat) +
11337
+ FfiConverterUInt64.allocationSize(value.fanoutFeeSat) +
11338
+ FfiConverterUInt64.allocationSize(value.singleUtxoFundingSat) +
11339
+ FfiConverterArrayTypePerBranchFunding.allocationSize(
11340
+ value.perBranchFunding
11341
+ ) +
11342
+ FfiConverterUInt64.allocationSize(value.feeRateSatPerVbyte) +
11343
+ FfiConverterString.allocationSize(value.destination)
11344
+ );
11345
+ }
11346
+ }
11347
+ return new FFIConverter();
11348
+ })();
11349
+
11068
11350
  export type ProvisionalPayment = {
11069
11351
  /**
11070
11352
  * Unique identifier for the payment
@@ -11920,6 +12202,84 @@ const FfiConverterTypeRefundDepositResponse = (() => {
11920
12202
  return new FFIConverter();
11921
12203
  })();
11922
12204
 
12205
+ /**
12206
+ * Response from refunding pending conversions.
12207
+ */
12208
+ export type RefundPendingConversionsResponse = {
12209
+ /**
12210
+ * Conversions successfully refunded this pass.
12211
+ */
12212
+ refunded: /*u32*/ number;
12213
+ /**
12214
+ * Conversions intentionally deferred (eligible but held back by a
12215
+ * safety window). The next pass will retry them.
12216
+ */
12217
+ skipped: /*u32*/ number;
12218
+ /**
12219
+ * Conversions whose clawback did not complete this pass (rejected or
12220
+ * errored; funds not returned). The next pass will retry them.
12221
+ */
12222
+ failed: /*u32*/ number;
12223
+ };
12224
+
12225
+ /**
12226
+ * Generated factory for {@link RefundPendingConversionsResponse} record objects.
12227
+ */
12228
+ export const RefundPendingConversionsResponse = (() => {
12229
+ const defaults = () => ({});
12230
+ const create = (() => {
12231
+ return uniffiCreateRecord<
12232
+ RefundPendingConversionsResponse,
12233
+ ReturnType<typeof defaults>
12234
+ >(defaults);
12235
+ })();
12236
+ return Object.freeze({
12237
+ /**
12238
+ * Create a frozen instance of {@link RefundPendingConversionsResponse}, with defaults specified
12239
+ * in Rust, in the {@link breez_sdk_spark} crate.
12240
+ */
12241
+ create,
12242
+
12243
+ /**
12244
+ * Create a frozen instance of {@link RefundPendingConversionsResponse}, with defaults specified
12245
+ * in Rust, in the {@link breez_sdk_spark} crate.
12246
+ */
12247
+ new: create,
12248
+
12249
+ /**
12250
+ * Defaults specified in the {@link breez_sdk_spark} crate.
12251
+ */
12252
+ defaults: () =>
12253
+ Object.freeze(defaults()) as Partial<RefundPendingConversionsResponse>,
12254
+ });
12255
+ })();
12256
+
12257
+ const FfiConverterTypeRefundPendingConversionsResponse = (() => {
12258
+ type TypeName = RefundPendingConversionsResponse;
12259
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
12260
+ read(from: RustBuffer): TypeName {
12261
+ return {
12262
+ refunded: FfiConverterUInt32.read(from),
12263
+ skipped: FfiConverterUInt32.read(from),
12264
+ failed: FfiConverterUInt32.read(from),
12265
+ };
12266
+ }
12267
+ write(value: TypeName, into: RustBuffer): void {
12268
+ FfiConverterUInt32.write(value.refunded, into);
12269
+ FfiConverterUInt32.write(value.skipped, into);
12270
+ FfiConverterUInt32.write(value.failed, into);
12271
+ }
12272
+ allocationSize(value: TypeName): number {
12273
+ return (
12274
+ FfiConverterUInt32.allocationSize(value.refunded) +
12275
+ FfiConverterUInt32.allocationSize(value.skipped) +
12276
+ FfiConverterUInt32.allocationSize(value.failed)
12277
+ );
12278
+ }
12279
+ }
12280
+ return new FFIConverter();
12281
+ })();
12282
+
11923
12283
  export type RegisterLightningAddressRequest = {
11924
12284
  username: string;
11925
12285
  description: string | undefined;
@@ -15538,6 +15898,336 @@ const FfiConverterTypeUnfreezeIssuerTokenResponse = (() => {
15538
15898
  return new FFIConverter();
15539
15899
  })();
15540
15900
 
15901
+ /**
15902
+ * A leaf selected for exit, with its value.
15903
+ */
15904
+ export type UnilateralExitLeaf = {
15905
+ leafId: string;
15906
+ /**
15907
+ * The leaf's value in satoshis.
15908
+ */
15909
+ value: /*u64*/ bigint;
15910
+ };
15911
+
15912
+ /**
15913
+ * Generated factory for {@link UnilateralExitLeaf} record objects.
15914
+ */
15915
+ export const UnilateralExitLeaf = (() => {
15916
+ const defaults = () => ({});
15917
+ const create = (() => {
15918
+ return uniffiCreateRecord<UnilateralExitLeaf, ReturnType<typeof defaults>>(
15919
+ defaults
15920
+ );
15921
+ })();
15922
+ return Object.freeze({
15923
+ /**
15924
+ * Create a frozen instance of {@link UnilateralExitLeaf}, with defaults specified
15925
+ * in Rust, in the {@link breez_sdk_spark} crate.
15926
+ */
15927
+ create,
15928
+
15929
+ /**
15930
+ * Create a frozen instance of {@link UnilateralExitLeaf}, with defaults specified
15931
+ * in Rust, in the {@link breez_sdk_spark} crate.
15932
+ */
15933
+ new: create,
15934
+
15935
+ /**
15936
+ * Defaults specified in the {@link breez_sdk_spark} crate.
15937
+ */
15938
+ defaults: () => Object.freeze(defaults()) as Partial<UnilateralExitLeaf>,
15939
+ });
15940
+ })();
15941
+
15942
+ const FfiConverterTypeUnilateralExitLeaf = (() => {
15943
+ type TypeName = UnilateralExitLeaf;
15944
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
15945
+ read(from: RustBuffer): TypeName {
15946
+ return {
15947
+ leafId: FfiConverterString.read(from),
15948
+ value: FfiConverterUInt64.read(from),
15949
+ };
15950
+ }
15951
+ write(value: TypeName, into: RustBuffer): void {
15952
+ FfiConverterString.write(value.leafId, into);
15953
+ FfiConverterUInt64.write(value.value, into);
15954
+ }
15955
+ allocationSize(value: TypeName): number {
15956
+ return (
15957
+ FfiConverterString.allocationSize(value.leafId) +
15958
+ FfiConverterUInt64.allocationSize(value.value)
15959
+ );
15960
+ }
15961
+ }
15962
+ return new FFIConverter();
15963
+ })();
15964
+
15965
+ /**
15966
+ * Request for `unilateral_exit`: a `prepare_unilateral_exit` quote plus the
15967
+ * funding UTXOs that pay its fees. The signer is passed separately (it is not a
15968
+ * plain data value).
15969
+ */
15970
+ export type UnilateralExitRequest = {
15971
+ /**
15972
+ * The quote returned by `prepare_unilateral_exit`, naming the leaves to exit.
15973
+ */
15974
+ prepared: PrepareUnilateralExitResponse;
15975
+ /**
15976
+ * The funding UTXOs that pay the exit's on-chain fees, meeting the quote's
15977
+ * `single_utxo_funding_sat` (one UTXO) or `per_branch_funding` (one per branch).
15978
+ */
15979
+ fundingInputs: Array<CpfpInput>;
15980
+ };
15981
+
15982
+ /**
15983
+ * Generated factory for {@link UnilateralExitRequest} record objects.
15984
+ */
15985
+ export const UnilateralExitRequest = (() => {
15986
+ const defaults = () => ({});
15987
+ const create = (() => {
15988
+ return uniffiCreateRecord<
15989
+ UnilateralExitRequest,
15990
+ ReturnType<typeof defaults>
15991
+ >(defaults);
15992
+ })();
15993
+ return Object.freeze({
15994
+ /**
15995
+ * Create a frozen instance of {@link UnilateralExitRequest}, with defaults specified
15996
+ * in Rust, in the {@link breez_sdk_spark} crate.
15997
+ */
15998
+ create,
15999
+
16000
+ /**
16001
+ * Create a frozen instance of {@link UnilateralExitRequest}, with defaults specified
16002
+ * in Rust, in the {@link breez_sdk_spark} crate.
16003
+ */
16004
+ new: create,
16005
+
16006
+ /**
16007
+ * Defaults specified in the {@link breez_sdk_spark} crate.
16008
+ */
16009
+ defaults: () => Object.freeze(defaults()) as Partial<UnilateralExitRequest>,
16010
+ });
16011
+ })();
16012
+
16013
+ const FfiConverterTypeUnilateralExitRequest = (() => {
16014
+ type TypeName = UnilateralExitRequest;
16015
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
16016
+ read(from: RustBuffer): TypeName {
16017
+ return {
16018
+ prepared: FfiConverterTypePrepareUnilateralExitResponse.read(from),
16019
+ fundingInputs: FfiConverterArrayTypeCpfpInput.read(from),
16020
+ };
16021
+ }
16022
+ write(value: TypeName, into: RustBuffer): void {
16023
+ FfiConverterTypePrepareUnilateralExitResponse.write(value.prepared, into);
16024
+ FfiConverterArrayTypeCpfpInput.write(value.fundingInputs, into);
16025
+ }
16026
+ allocationSize(value: TypeName): number {
16027
+ return (
16028
+ FfiConverterTypePrepareUnilateralExitResponse.allocationSize(
16029
+ value.prepared
16030
+ ) + FfiConverterArrayTypeCpfpInput.allocationSize(value.fundingInputs)
16031
+ );
16032
+ }
16033
+ }
16034
+ return new FFIConverter();
16035
+ })();
16036
+
16037
+ /**
16038
+ * Result of `unilateral_exit`: a cost summary plus the complete, signed exit
16039
+ * path.
16040
+ */
16041
+ export type UnilateralExitResponse = {
16042
+ /**
16043
+ * Total value of the selected leaves, in satoshis.
16044
+ */
16045
+ recoverableValueSat: /*u64*/ bigint;
16046
+ /**
16047
+ * The actual total on-chain fee the returned transactions pay at the
16048
+ * requested rate, in satoshis. A resumed or partially-confirmed exit pays
16049
+ * less because already-confirmed steps are not rebuilt.
16050
+ */
16051
+ totalFeeSat: /*u64*/ bigint;
16052
+ leaves: Array<UnilateralExitLeaf>;
16053
+ /**
16054
+ * The full signed transaction set, in valid topological (broadcast) order
16055
+ * with shared ancestors appearing once and the sweep last.
16056
+ */
16057
+ transactions: Array<UnilateralExitTransaction>;
16058
+ };
16059
+
16060
+ /**
16061
+ * Generated factory for {@link UnilateralExitResponse} record objects.
16062
+ */
16063
+ export const UnilateralExitResponse = (() => {
16064
+ const defaults = () => ({});
16065
+ const create = (() => {
16066
+ return uniffiCreateRecord<
16067
+ UnilateralExitResponse,
16068
+ ReturnType<typeof defaults>
16069
+ >(defaults);
16070
+ })();
16071
+ return Object.freeze({
16072
+ /**
16073
+ * Create a frozen instance of {@link UnilateralExitResponse}, with defaults specified
16074
+ * in Rust, in the {@link breez_sdk_spark} crate.
16075
+ */
16076
+ create,
16077
+
16078
+ /**
16079
+ * Create a frozen instance of {@link UnilateralExitResponse}, with defaults specified
16080
+ * in Rust, in the {@link breez_sdk_spark} crate.
16081
+ */
16082
+ new: create,
16083
+
16084
+ /**
16085
+ * Defaults specified in the {@link breez_sdk_spark} crate.
16086
+ */
16087
+ defaults: () =>
16088
+ Object.freeze(defaults()) as Partial<UnilateralExitResponse>,
16089
+ });
16090
+ })();
16091
+
16092
+ const FfiConverterTypeUnilateralExitResponse = (() => {
16093
+ type TypeName = UnilateralExitResponse;
16094
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
16095
+ read(from: RustBuffer): TypeName {
16096
+ return {
16097
+ recoverableValueSat: FfiConverterUInt64.read(from),
16098
+ totalFeeSat: FfiConverterUInt64.read(from),
16099
+ leaves: FfiConverterArrayTypeUnilateralExitLeaf.read(from),
16100
+ transactions: FfiConverterArrayTypeUnilateralExitTransaction.read(from),
16101
+ };
16102
+ }
16103
+ write(value: TypeName, into: RustBuffer): void {
16104
+ FfiConverterUInt64.write(value.recoverableValueSat, into);
16105
+ FfiConverterUInt64.write(value.totalFeeSat, into);
16106
+ FfiConverterArrayTypeUnilateralExitLeaf.write(value.leaves, into);
16107
+ FfiConverterArrayTypeUnilateralExitTransaction.write(
16108
+ value.transactions,
16109
+ into
16110
+ );
16111
+ }
16112
+ allocationSize(value: TypeName): number {
16113
+ return (
16114
+ FfiConverterUInt64.allocationSize(value.recoverableValueSat) +
16115
+ FfiConverterUInt64.allocationSize(value.totalFeeSat) +
16116
+ FfiConverterArrayTypeUnilateralExitLeaf.allocationSize(value.leaves) +
16117
+ FfiConverterArrayTypeUnilateralExitTransaction.allocationSize(
16118
+ value.transactions
16119
+ )
16120
+ );
16121
+ }
16122
+ }
16123
+ return new FFIConverter();
16124
+ })();
16125
+
16126
+ /**
16127
+ * One transaction in the unilateral exit path, with everything needed to
16128
+ * order and broadcast it.
16129
+ */
16130
+ export type UnilateralExitTransaction = {
16131
+ kind: UnilateralExitTxKind;
16132
+ /**
16133
+ * The tree node this transaction belongs to. Unset for the fan-out and the
16134
+ * sweep.
16135
+ */
16136
+ nodeId: string | undefined;
16137
+ txid: string;
16138
+ txHex: string;
16139
+ /**
16140
+ * The signed CPFP child to broadcast alongside `tx_hex` as a package.
16141
+ * Unset for the fan-out and the sweep (no anchor to bump) and for a
16142
+ * `Confirmed` step (its CPFP is already on-chain).
16143
+ */
16144
+ cpfpTxHex: string | undefined;
16145
+ /**
16146
+ * Relative CSV timelock, in blocks, that must mature on the spent input
16147
+ * before this transaction can confirm. Unset when there is no timelock.
16148
+ */
16149
+ csvTimelockBlocks: /*u32*/ number | undefined;
16150
+ /**
16151
+ * Txids of other entries in this list that must be confirmed before this
16152
+ * one can be broadcast.
16153
+ */
16154
+ dependsOn: Array<string>;
16155
+ status: ConfirmationStatus;
16156
+ };
16157
+
16158
+ /**
16159
+ * Generated factory for {@link UnilateralExitTransaction} record objects.
16160
+ */
16161
+ export const UnilateralExitTransaction = (() => {
16162
+ const defaults = () => ({});
16163
+ const create = (() => {
16164
+ return uniffiCreateRecord<
16165
+ UnilateralExitTransaction,
16166
+ ReturnType<typeof defaults>
16167
+ >(defaults);
16168
+ })();
16169
+ return Object.freeze({
16170
+ /**
16171
+ * Create a frozen instance of {@link UnilateralExitTransaction}, with defaults specified
16172
+ * in Rust, in the {@link breez_sdk_spark} crate.
16173
+ */
16174
+ create,
16175
+
16176
+ /**
16177
+ * Create a frozen instance of {@link UnilateralExitTransaction}, with defaults specified
16178
+ * in Rust, in the {@link breez_sdk_spark} crate.
16179
+ */
16180
+ new: create,
16181
+
16182
+ /**
16183
+ * Defaults specified in the {@link breez_sdk_spark} crate.
16184
+ */
16185
+ defaults: () =>
16186
+ Object.freeze(defaults()) as Partial<UnilateralExitTransaction>,
16187
+ });
16188
+ })();
16189
+
16190
+ const FfiConverterTypeUnilateralExitTransaction = (() => {
16191
+ type TypeName = UnilateralExitTransaction;
16192
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
16193
+ read(from: RustBuffer): TypeName {
16194
+ return {
16195
+ kind: FfiConverterTypeUnilateralExitTxKind.read(from),
16196
+ nodeId: FfiConverterOptionalString.read(from),
16197
+ txid: FfiConverterString.read(from),
16198
+ txHex: FfiConverterString.read(from),
16199
+ cpfpTxHex: FfiConverterOptionalString.read(from),
16200
+ csvTimelockBlocks: FfiConverterOptionalUInt32.read(from),
16201
+ dependsOn: FfiConverterArrayString.read(from),
16202
+ status: FfiConverterTypeConfirmationStatus.read(from),
16203
+ };
16204
+ }
16205
+ write(value: TypeName, into: RustBuffer): void {
16206
+ FfiConverterTypeUnilateralExitTxKind.write(value.kind, into);
16207
+ FfiConverterOptionalString.write(value.nodeId, into);
16208
+ FfiConverterString.write(value.txid, into);
16209
+ FfiConverterString.write(value.txHex, into);
16210
+ FfiConverterOptionalString.write(value.cpfpTxHex, into);
16211
+ FfiConverterOptionalUInt32.write(value.csvTimelockBlocks, into);
16212
+ FfiConverterArrayString.write(value.dependsOn, into);
16213
+ FfiConverterTypeConfirmationStatus.write(value.status, into);
16214
+ }
16215
+ allocationSize(value: TypeName): number {
16216
+ return (
16217
+ FfiConverterTypeUnilateralExitTxKind.allocationSize(value.kind) +
16218
+ FfiConverterOptionalString.allocationSize(value.nodeId) +
16219
+ FfiConverterString.allocationSize(value.txid) +
16220
+ FfiConverterString.allocationSize(value.txHex) +
16221
+ FfiConverterOptionalString.allocationSize(value.cpfpTxHex) +
16222
+ FfiConverterOptionalUInt32.allocationSize(value.csvTimelockBlocks) +
16223
+ FfiConverterArrayString.allocationSize(value.dependsOn) +
16224
+ FfiConverterTypeConfirmationStatus.allocationSize(value.status)
16225
+ );
16226
+ }
16227
+ }
16228
+ return new FFIConverter();
16229
+ })();
16230
+
15541
16231
  /**
15542
16232
  * Request to unregister an existing webhook.
15543
16233
  */
@@ -15737,13 +16427,24 @@ export type UpdateUserSettingsRequest = {
15737
16427
  * Update the active stable balance token. `None` means no change.
15738
16428
  */
15739
16429
  stableBalanceActiveLabel: StableBalanceActiveLabel | undefined;
16430
+ /**
16431
+ * Designate or remove the wallet's master identity, a second public key
16432
+ * the Spark operators accept as a reader of this wallet's balance and
16433
+ * history while `spark_private_mode_enabled` is set. The master identity
16434
+ * can only read: payments still require the owner's keys. `None` means no
16435
+ * change.
16436
+ */
16437
+ sparkMasterIdentityPublicKey: SparkMasterIdentityPublicKey | undefined;
15740
16438
  };
15741
16439
 
15742
16440
  /**
15743
16441
  * Generated factory for {@link UpdateUserSettingsRequest} record objects.
15744
16442
  */
15745
16443
  export const UpdateUserSettingsRequest = (() => {
15746
- const defaults = () => ({ stableBalanceActiveLabel: undefined });
16444
+ const defaults = () => ({
16445
+ stableBalanceActiveLabel: undefined,
16446
+ sparkMasterIdentityPublicKey: undefined,
16447
+ });
15747
16448
  const create = (() => {
15748
16449
  return uniffiCreateRecord<
15749
16450
  UpdateUserSettingsRequest,
@@ -15779,6 +16480,8 @@ const FfiConverterTypeUpdateUserSettingsRequest = (() => {
15779
16480
  sparkPrivateModeEnabled: FfiConverterOptionalBool.read(from),
15780
16481
  stableBalanceActiveLabel:
15781
16482
  FfiConverterOptionalTypeStableBalanceActiveLabel.read(from),
16483
+ sparkMasterIdentityPublicKey:
16484
+ FfiConverterOptionalTypeSparkMasterIdentityPublicKey.read(from),
15782
16485
  };
15783
16486
  }
15784
16487
  write(value: TypeName, into: RustBuffer): void {
@@ -15787,12 +16490,19 @@ const FfiConverterTypeUpdateUserSettingsRequest = (() => {
15787
16490
  value.stableBalanceActiveLabel,
15788
16491
  into
15789
16492
  );
16493
+ FfiConverterOptionalTypeSparkMasterIdentityPublicKey.write(
16494
+ value.sparkMasterIdentityPublicKey,
16495
+ into
16496
+ );
15790
16497
  }
15791
16498
  allocationSize(value: TypeName): number {
15792
16499
  return (
15793
16500
  FfiConverterOptionalBool.allocationSize(value.sparkPrivateModeEnabled) +
15794
16501
  FfiConverterOptionalTypeStableBalanceActiveLabel.allocationSize(
15795
16502
  value.stableBalanceActiveLabel
16503
+ ) +
16504
+ FfiConverterOptionalTypeSparkMasterIdentityPublicKey.allocationSize(
16505
+ value.sparkMasterIdentityPublicKey
15796
16506
  )
15797
16507
  );
15798
16508
  }
@@ -15880,6 +16590,11 @@ export type UserSettings = {
15880
16590
  * The label of the currently active stable balance token, or `None` if deactivated.
15881
16591
  */
15882
16592
  stableBalanceActiveLabel: string | undefined;
16593
+ /**
16594
+ * The hex encoded public key designated as this wallet's master identity
16595
+ * key, or `None` if none is designated.
16596
+ */
16597
+ sparkMasterIdentityPublicKey: string | undefined;
15883
16598
  };
15884
16599
 
15885
16600
  /**
@@ -15919,17 +16634,25 @@ const FfiConverterTypeUserSettings = (() => {
15919
16634
  return {
15920
16635
  sparkPrivateModeEnabled: FfiConverterBool.read(from),
15921
16636
  stableBalanceActiveLabel: FfiConverterOptionalString.read(from),
16637
+ sparkMasterIdentityPublicKey: FfiConverterOptionalString.read(from),
15922
16638
  };
15923
16639
  }
15924
16640
  write(value: TypeName, into: RustBuffer): void {
15925
16641
  FfiConverterBool.write(value.sparkPrivateModeEnabled, into);
15926
16642
  FfiConverterOptionalString.write(value.stableBalanceActiveLabel, into);
16643
+ FfiConverterOptionalString.write(
16644
+ value.sparkMasterIdentityPublicKey,
16645
+ into
16646
+ );
15927
16647
  }
15928
16648
  allocationSize(value: TypeName): number {
15929
16649
  return (
15930
16650
  FfiConverterBool.allocationSize(value.sparkPrivateModeEnabled) +
15931
16651
  FfiConverterOptionalString.allocationSize(
15932
16652
  value.stableBalanceActiveLabel
16653
+ ) +
16654
+ FfiConverterOptionalString.allocationSize(
16655
+ value.sparkMasterIdentityPublicKey
15933
16656
  )
15934
16657
  );
15935
16658
  }
@@ -17750,6 +18473,58 @@ const FfiConverterTypeChainServiceError = (() => {
17750
18473
  return new FFIConverter();
17751
18474
  })();
17752
18475
 
18476
+ /**
18477
+ * Whether a transaction in the exit path is already on-chain.
18478
+ */
18479
+ export enum ConfirmationStatus {
18480
+ /**
18481
+ * This transaction is confirmed in a block. It needs no action.
18482
+ */
18483
+ Confirmed,
18484
+ /**
18485
+ * This transaction is not yet confirmed. Mempool state is not consulted.
18486
+ */
18487
+ Unconfirmed,
18488
+ /**
18489
+ * The on-chain status could not be determined (the chain service errored).
18490
+ * Broadcasting may fail if a conflicting transaction already landed.
18491
+ */
18492
+ Unverified,
18493
+ }
18494
+
18495
+ const FfiConverterTypeConfirmationStatus = (() => {
18496
+ const ordinalConverter = FfiConverterInt32;
18497
+ type TypeName = ConfirmationStatus;
18498
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
18499
+ read(from: RustBuffer): TypeName {
18500
+ switch (ordinalConverter.read(from)) {
18501
+ case 1:
18502
+ return ConfirmationStatus.Confirmed;
18503
+ case 2:
18504
+ return ConfirmationStatus.Unconfirmed;
18505
+ case 3:
18506
+ return ConfirmationStatus.Unverified;
18507
+ default:
18508
+ throw new UniffiInternalError.UnexpectedEnumCase();
18509
+ }
18510
+ }
18511
+ write(value: TypeName, into: RustBuffer): void {
18512
+ switch (value) {
18513
+ case ConfirmationStatus.Confirmed:
18514
+ return ordinalConverter.write(1, into);
18515
+ case ConfirmationStatus.Unconfirmed:
18516
+ return ordinalConverter.write(2, into);
18517
+ case ConfirmationStatus.Unverified:
18518
+ return ordinalConverter.write(3, into);
18519
+ }
18520
+ }
18521
+ allocationSize(value: TypeName): number {
18522
+ return ordinalConverter.allocationSize(0);
18523
+ }
18524
+ }
18525
+ return new FFIConverter();
18526
+ })();
18527
+
17753
18528
  // Enum: ConversionChain
17754
18529
  export enum ConversionChain_Tags {
17755
18530
  Spark = 'Spark',
@@ -19155,6 +19930,500 @@ const FfiConverterTypeConversionType = (() => {
19155
19930
  return new FFIConverter();
19156
19931
  })();
19157
19932
 
19933
+ // Enum: CpfpFundingKind
19934
+ export enum CpfpFundingKind_Tags {
19935
+ P2wpkh = 'P2wpkh',
19936
+ P2tr = 'P2tr',
19937
+ Custom = 'Custom',
19938
+ }
19939
+ /**
19940
+ * The kind of UTXO that will fund an exit's fees.
19941
+ */
19942
+ export const CpfpFundingKind = (() => {
19943
+ type P2wpkh__interface = {
19944
+ tag: CpfpFundingKind_Tags.P2wpkh;
19945
+ };
19946
+
19947
+ /**
19948
+ * Fees paid from P2WPKH (native segwit v0) UTXOs.
19949
+ */
19950
+ class P2wpkh_ extends UniffiEnum implements P2wpkh__interface {
19951
+ /**
19952
+ * @private
19953
+ * This field is private and should not be used, use `tag` instead.
19954
+ */
19955
+ readonly [uniffiTypeNameSymbol] = 'CpfpFundingKind';
19956
+ readonly tag = CpfpFundingKind_Tags.P2wpkh;
19957
+ constructor() {
19958
+ super('CpfpFundingKind', 'P2wpkh');
19959
+ }
19960
+
19961
+ static new(): P2wpkh_ {
19962
+ return new P2wpkh_();
19963
+ }
19964
+
19965
+ static instanceOf(obj: any): obj is P2wpkh_ {
19966
+ return obj.tag === CpfpFundingKind_Tags.P2wpkh;
19967
+ }
19968
+ }
19969
+
19970
+ type P2tr__interface = {
19971
+ tag: CpfpFundingKind_Tags.P2tr;
19972
+ };
19973
+
19974
+ /**
19975
+ * Fees paid from P2TR (taproot, key-path) UTXOs.
19976
+ */
19977
+ class P2tr_ extends UniffiEnum implements P2tr__interface {
19978
+ /**
19979
+ * @private
19980
+ * This field is private and should not be used, use `tag` instead.
19981
+ */
19982
+ readonly [uniffiTypeNameSymbol] = 'CpfpFundingKind';
19983
+ readonly tag = CpfpFundingKind_Tags.P2tr;
19984
+ constructor() {
19985
+ super('CpfpFundingKind', 'P2tr');
19986
+ }
19987
+
19988
+ static new(): P2tr_ {
19989
+ return new P2tr_();
19990
+ }
19991
+
19992
+ static instanceOf(obj: any): obj is P2tr_ {
19993
+ return obj.tag === CpfpFundingKind_Tags.P2tr;
19994
+ }
19995
+ }
19996
+
19997
+ type Custom__interface = {
19998
+ tag: CpfpFundingKind_Tags.Custom;
19999
+ inner: Readonly<{
20000
+ scriptPubkeyHex: string;
20001
+ signedInputWeight: /*u64*/ bigint;
20002
+ }>;
20003
+ };
20004
+
20005
+ /**
20006
+ * Fees paid from a custom witness-program script (legacy scripts are
20007
+ * rejected). `script_pubkey_hex` (the funding scriptPubKey) sizes the
20008
+ * fan-out output and dust; `signed_input_weight` (weight units) is an upper
20009
+ * bound on the input's signed weight, so the quote stays exact or slightly
20010
+ * conservative.
20011
+ */
20012
+ class Custom_ extends UniffiEnum implements Custom__interface {
20013
+ /**
20014
+ * @private
20015
+ * This field is private and should not be used, use `tag` instead.
20016
+ */
20017
+ readonly [uniffiTypeNameSymbol] = 'CpfpFundingKind';
20018
+ readonly tag = CpfpFundingKind_Tags.Custom;
20019
+ readonly inner: Readonly<{
20020
+ scriptPubkeyHex: string;
20021
+ signedInputWeight: /*u64*/ bigint;
20022
+ }>;
20023
+ constructor(inner: {
20024
+ scriptPubkeyHex: string;
20025
+ signedInputWeight: /*u64*/ bigint;
20026
+ }) {
20027
+ super('CpfpFundingKind', 'Custom');
20028
+ this.inner = Object.freeze(inner);
20029
+ }
20030
+
20031
+ static new(inner: {
20032
+ scriptPubkeyHex: string;
20033
+ signedInputWeight: /*u64*/ bigint;
20034
+ }): Custom_ {
20035
+ return new Custom_(inner);
20036
+ }
20037
+
20038
+ static instanceOf(obj: any): obj is Custom_ {
20039
+ return obj.tag === CpfpFundingKind_Tags.Custom;
20040
+ }
20041
+ }
20042
+
20043
+ function instanceOf(obj: any): obj is CpfpFundingKind {
20044
+ return obj[uniffiTypeNameSymbol] === 'CpfpFundingKind';
20045
+ }
20046
+
20047
+ return Object.freeze({
20048
+ instanceOf,
20049
+ P2wpkh: P2wpkh_,
20050
+ P2tr: P2tr_,
20051
+ Custom: Custom_,
20052
+ });
20053
+ })();
20054
+
20055
+ /**
20056
+ * The kind of UTXO that will fund an exit's fees.
20057
+ */
20058
+
20059
+ export type CpfpFundingKind = InstanceType<
20060
+ (typeof CpfpFundingKind)[keyof Omit<typeof CpfpFundingKind, 'instanceOf'>]
20061
+ >;
20062
+
20063
+ // FfiConverter for enum CpfpFundingKind
20064
+ const FfiConverterTypeCpfpFundingKind = (() => {
20065
+ const ordinalConverter = FfiConverterInt32;
20066
+ type TypeName = CpfpFundingKind;
20067
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
20068
+ read(from: RustBuffer): TypeName {
20069
+ switch (ordinalConverter.read(from)) {
20070
+ case 1:
20071
+ return new CpfpFundingKind.P2wpkh();
20072
+ case 2:
20073
+ return new CpfpFundingKind.P2tr();
20074
+ case 3:
20075
+ return new CpfpFundingKind.Custom({
20076
+ scriptPubkeyHex: FfiConverterString.read(from),
20077
+ signedInputWeight: FfiConverterUInt64.read(from),
20078
+ });
20079
+ default:
20080
+ throw new UniffiInternalError.UnexpectedEnumCase();
20081
+ }
20082
+ }
20083
+ write(value: TypeName, into: RustBuffer): void {
20084
+ switch (value.tag) {
20085
+ case CpfpFundingKind_Tags.P2wpkh: {
20086
+ ordinalConverter.write(1, into);
20087
+ return;
20088
+ }
20089
+ case CpfpFundingKind_Tags.P2tr: {
20090
+ ordinalConverter.write(2, into);
20091
+ return;
20092
+ }
20093
+ case CpfpFundingKind_Tags.Custom: {
20094
+ ordinalConverter.write(3, into);
20095
+ const inner = value.inner;
20096
+ FfiConverterString.write(inner.scriptPubkeyHex, into);
20097
+ FfiConverterUInt64.write(inner.signedInputWeight, into);
20098
+ return;
20099
+ }
20100
+ default:
20101
+ // Throwing from here means that CpfpFundingKind_Tags hasn't matched an ordinal.
20102
+ throw new UniffiInternalError.UnexpectedEnumCase();
20103
+ }
20104
+ }
20105
+ allocationSize(value: TypeName): number {
20106
+ switch (value.tag) {
20107
+ case CpfpFundingKind_Tags.P2wpkh: {
20108
+ return ordinalConverter.allocationSize(1);
20109
+ }
20110
+ case CpfpFundingKind_Tags.P2tr: {
20111
+ return ordinalConverter.allocationSize(2);
20112
+ }
20113
+ case CpfpFundingKind_Tags.Custom: {
20114
+ const inner = value.inner;
20115
+ let size = ordinalConverter.allocationSize(3);
20116
+ size += FfiConverterString.allocationSize(inner.scriptPubkeyHex);
20117
+ size += FfiConverterUInt64.allocationSize(inner.signedInputWeight);
20118
+ return size;
20119
+ }
20120
+ default:
20121
+ throw new UniffiInternalError.UnexpectedEnumCase();
20122
+ }
20123
+ }
20124
+ }
20125
+ return new FFIConverter();
20126
+ })();
20127
+
20128
+ // Enum: CpfpInput
20129
+ export enum CpfpInput_Tags {
20130
+ P2wpkh = 'P2wpkh',
20131
+ P2tr = 'P2tr',
20132
+ Custom = 'Custom',
20133
+ }
20134
+ /**
20135
+ * A funding UTXO that pays the on-chain fees of a unilateral exit.
20136
+ */
20137
+ export const CpfpInput = (() => {
20138
+ type P2wpkh__interface = {
20139
+ tag: CpfpInput_Tags.P2wpkh;
20140
+ inner: Readonly<{
20141
+ txid: string;
20142
+ vout: /*u32*/ number;
20143
+ value: /*u64*/ bigint;
20144
+ pubkey: string;
20145
+ }>;
20146
+ };
20147
+
20148
+ /**
20149
+ * A P2WPKH (native segwit v0) UTXO controlled by `pubkey` (33-byte
20150
+ * compressed, hex).
20151
+ */
20152
+ class P2wpkh_ extends UniffiEnum implements P2wpkh__interface {
20153
+ /**
20154
+ * @private
20155
+ * This field is private and should not be used, use `tag` instead.
20156
+ */
20157
+ readonly [uniffiTypeNameSymbol] = 'CpfpInput';
20158
+ readonly tag = CpfpInput_Tags.P2wpkh;
20159
+ readonly inner: Readonly<{
20160
+ txid: string;
20161
+ vout: /*u32*/ number;
20162
+ value: /*u64*/ bigint;
20163
+ pubkey: string;
20164
+ }>;
20165
+ constructor(inner: {
20166
+ txid: string;
20167
+ vout: /*u32*/ number;
20168
+ value: /*u64*/ bigint;
20169
+ pubkey: string;
20170
+ }) {
20171
+ super('CpfpInput', 'P2wpkh');
20172
+ this.inner = Object.freeze(inner);
20173
+ }
20174
+
20175
+ static new(inner: {
20176
+ txid: string;
20177
+ vout: /*u32*/ number;
20178
+ value: /*u64*/ bigint;
20179
+ pubkey: string;
20180
+ }): P2wpkh_ {
20181
+ return new P2wpkh_(inner);
20182
+ }
20183
+
20184
+ static instanceOf(obj: any): obj is P2wpkh_ {
20185
+ return obj.tag === CpfpInput_Tags.P2wpkh;
20186
+ }
20187
+ }
20188
+
20189
+ type P2tr__interface = {
20190
+ tag: CpfpInput_Tags.P2tr;
20191
+ inner: Readonly<{
20192
+ txid: string;
20193
+ vout: /*u32*/ number;
20194
+ value: /*u64*/ bigint;
20195
+ pubkey: string;
20196
+ }>;
20197
+ };
20198
+
20199
+ /**
20200
+ * A P2TR (taproot, key-path) UTXO. `pubkey` (x-only or compressed, hex) is
20201
+ * the **internal** (untweaked, BIP86 key-path) public key whose secret signs
20202
+ * the input, not the tweaked on-chain output key. The SDK applies the BIP86
20203
+ * taproot tweak itself to derive the funding scriptPubKey, so passing the
20204
+ * already-tweaked output key here produces a scriptPubKey that does not match
20205
+ * the UTXO and the built transaction is rejected at broadcast.
20206
+ */
20207
+ class P2tr_ extends UniffiEnum implements P2tr__interface {
20208
+ /**
20209
+ * @private
20210
+ * This field is private and should not be used, use `tag` instead.
20211
+ */
20212
+ readonly [uniffiTypeNameSymbol] = 'CpfpInput';
20213
+ readonly tag = CpfpInput_Tags.P2tr;
20214
+ readonly inner: Readonly<{
20215
+ txid: string;
20216
+ vout: /*u32*/ number;
20217
+ value: /*u64*/ bigint;
20218
+ pubkey: string;
20219
+ }>;
20220
+ constructor(inner: {
20221
+ txid: string;
20222
+ vout: /*u32*/ number;
20223
+ value: /*u64*/ bigint;
20224
+ pubkey: string;
20225
+ }) {
20226
+ super('CpfpInput', 'P2tr');
20227
+ this.inner = Object.freeze(inner);
20228
+ }
20229
+
20230
+ static new(inner: {
20231
+ txid: string;
20232
+ vout: /*u32*/ number;
20233
+ value: /*u64*/ bigint;
20234
+ pubkey: string;
20235
+ }): P2tr_ {
20236
+ return new P2tr_(inner);
20237
+ }
20238
+
20239
+ static instanceOf(obj: any): obj is P2tr_ {
20240
+ return obj.tag === CpfpInput_Tags.P2tr;
20241
+ }
20242
+ }
20243
+
20244
+ type Custom__interface = {
20245
+ tag: CpfpInput_Tags.Custom;
20246
+ inner: Readonly<{
20247
+ txid: string;
20248
+ vout: /*u32*/ number;
20249
+ value: /*u64*/ bigint;
20250
+ scriptPubkeyHex: string;
20251
+ signedInputWeight: /*u64*/ bigint;
20252
+ }>;
20253
+ };
20254
+
20255
+ /**
20256
+ * Any witness-program script, signed via a custom `CpfpSigner`. Legacy
20257
+ * (non-SegWit) scripts are rejected. `signed_input_weight` (weight units)
20258
+ * is an upper bound on the input's signed weight, so the fee stays exact,
20259
+ * or slightly conservative if the real signature is shorter.
20260
+ */
20261
+ class Custom_ extends UniffiEnum implements Custom__interface {
20262
+ /**
20263
+ * @private
20264
+ * This field is private and should not be used, use `tag` instead.
20265
+ */
20266
+ readonly [uniffiTypeNameSymbol] = 'CpfpInput';
20267
+ readonly tag = CpfpInput_Tags.Custom;
20268
+ readonly inner: Readonly<{
20269
+ txid: string;
20270
+ vout: /*u32*/ number;
20271
+ value: /*u64*/ bigint;
20272
+ scriptPubkeyHex: string;
20273
+ signedInputWeight: /*u64*/ bigint;
20274
+ }>;
20275
+ constructor(inner: {
20276
+ txid: string;
20277
+ vout: /*u32*/ number;
20278
+ value: /*u64*/ bigint;
20279
+ scriptPubkeyHex: string;
20280
+ signedInputWeight: /*u64*/ bigint;
20281
+ }) {
20282
+ super('CpfpInput', 'Custom');
20283
+ this.inner = Object.freeze(inner);
20284
+ }
20285
+
20286
+ static new(inner: {
20287
+ txid: string;
20288
+ vout: /*u32*/ number;
20289
+ value: /*u64*/ bigint;
20290
+ scriptPubkeyHex: string;
20291
+ signedInputWeight: /*u64*/ bigint;
20292
+ }): Custom_ {
20293
+ return new Custom_(inner);
20294
+ }
20295
+
20296
+ static instanceOf(obj: any): obj is Custom_ {
20297
+ return obj.tag === CpfpInput_Tags.Custom;
20298
+ }
20299
+ }
20300
+
20301
+ function instanceOf(obj: any): obj is CpfpInput {
20302
+ return obj[uniffiTypeNameSymbol] === 'CpfpInput';
20303
+ }
20304
+
20305
+ return Object.freeze({
20306
+ instanceOf,
20307
+ P2wpkh: P2wpkh_,
20308
+ P2tr: P2tr_,
20309
+ Custom: Custom_,
20310
+ });
20311
+ })();
20312
+
20313
+ /**
20314
+ * A funding UTXO that pays the on-chain fees of a unilateral exit.
20315
+ */
20316
+
20317
+ export type CpfpInput = InstanceType<
20318
+ (typeof CpfpInput)[keyof Omit<typeof CpfpInput, 'instanceOf'>]
20319
+ >;
20320
+
20321
+ // FfiConverter for enum CpfpInput
20322
+ const FfiConverterTypeCpfpInput = (() => {
20323
+ const ordinalConverter = FfiConverterInt32;
20324
+ type TypeName = CpfpInput;
20325
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
20326
+ read(from: RustBuffer): TypeName {
20327
+ switch (ordinalConverter.read(from)) {
20328
+ case 1:
20329
+ return new CpfpInput.P2wpkh({
20330
+ txid: FfiConverterString.read(from),
20331
+ vout: FfiConverterUInt32.read(from),
20332
+ value: FfiConverterUInt64.read(from),
20333
+ pubkey: FfiConverterString.read(from),
20334
+ });
20335
+ case 2:
20336
+ return new CpfpInput.P2tr({
20337
+ txid: FfiConverterString.read(from),
20338
+ vout: FfiConverterUInt32.read(from),
20339
+ value: FfiConverterUInt64.read(from),
20340
+ pubkey: FfiConverterString.read(from),
20341
+ });
20342
+ case 3:
20343
+ return new CpfpInput.Custom({
20344
+ txid: FfiConverterString.read(from),
20345
+ vout: FfiConverterUInt32.read(from),
20346
+ value: FfiConverterUInt64.read(from),
20347
+ scriptPubkeyHex: FfiConverterString.read(from),
20348
+ signedInputWeight: FfiConverterUInt64.read(from),
20349
+ });
20350
+ default:
20351
+ throw new UniffiInternalError.UnexpectedEnumCase();
20352
+ }
20353
+ }
20354
+ write(value: TypeName, into: RustBuffer): void {
20355
+ switch (value.tag) {
20356
+ case CpfpInput_Tags.P2wpkh: {
20357
+ ordinalConverter.write(1, into);
20358
+ const inner = value.inner;
20359
+ FfiConverterString.write(inner.txid, into);
20360
+ FfiConverterUInt32.write(inner.vout, into);
20361
+ FfiConverterUInt64.write(inner.value, into);
20362
+ FfiConverterString.write(inner.pubkey, into);
20363
+ return;
20364
+ }
20365
+ case CpfpInput_Tags.P2tr: {
20366
+ ordinalConverter.write(2, into);
20367
+ const inner = value.inner;
20368
+ FfiConverterString.write(inner.txid, into);
20369
+ FfiConverterUInt32.write(inner.vout, into);
20370
+ FfiConverterUInt64.write(inner.value, into);
20371
+ FfiConverterString.write(inner.pubkey, into);
20372
+ return;
20373
+ }
20374
+ case CpfpInput_Tags.Custom: {
20375
+ ordinalConverter.write(3, into);
20376
+ const inner = value.inner;
20377
+ FfiConverterString.write(inner.txid, into);
20378
+ FfiConverterUInt32.write(inner.vout, into);
20379
+ FfiConverterUInt64.write(inner.value, into);
20380
+ FfiConverterString.write(inner.scriptPubkeyHex, into);
20381
+ FfiConverterUInt64.write(inner.signedInputWeight, into);
20382
+ return;
20383
+ }
20384
+ default:
20385
+ // Throwing from here means that CpfpInput_Tags hasn't matched an ordinal.
20386
+ throw new UniffiInternalError.UnexpectedEnumCase();
20387
+ }
20388
+ }
20389
+ allocationSize(value: TypeName): number {
20390
+ switch (value.tag) {
20391
+ case CpfpInput_Tags.P2wpkh: {
20392
+ const inner = value.inner;
20393
+ let size = ordinalConverter.allocationSize(1);
20394
+ size += FfiConverterString.allocationSize(inner.txid);
20395
+ size += FfiConverterUInt32.allocationSize(inner.vout);
20396
+ size += FfiConverterUInt64.allocationSize(inner.value);
20397
+ size += FfiConverterString.allocationSize(inner.pubkey);
20398
+ return size;
20399
+ }
20400
+ case CpfpInput_Tags.P2tr: {
20401
+ const inner = value.inner;
20402
+ let size = ordinalConverter.allocationSize(2);
20403
+ size += FfiConverterString.allocationSize(inner.txid);
20404
+ size += FfiConverterUInt32.allocationSize(inner.vout);
20405
+ size += FfiConverterUInt64.allocationSize(inner.value);
20406
+ size += FfiConverterString.allocationSize(inner.pubkey);
20407
+ return size;
20408
+ }
20409
+ case CpfpInput_Tags.Custom: {
20410
+ const inner = value.inner;
20411
+ let size = ordinalConverter.allocationSize(3);
20412
+ size += FfiConverterString.allocationSize(inner.txid);
20413
+ size += FfiConverterUInt32.allocationSize(inner.vout);
20414
+ size += FfiConverterUInt64.allocationSize(inner.value);
20415
+ size += FfiConverterString.allocationSize(inner.scriptPubkeyHex);
20416
+ size += FfiConverterUInt64.allocationSize(inner.signedInputWeight);
20417
+ return size;
20418
+ }
20419
+ default:
20420
+ throw new UniffiInternalError.UnexpectedEnumCase();
20421
+ }
20422
+ }
20423
+ }
20424
+ return new FFIConverter();
20425
+ })();
20426
+
19158
20427
  export enum CrossChainAddressFamily {
19159
20428
  Evm,
19160
20429
  Solana,
@@ -20187,6 +21456,149 @@ const FfiConverterTypeErrorKind = (() => {
20187
21456
  return new FFIConverter();
20188
21457
  })();
20189
21458
 
21459
+ // Enum: ExitLeafSelection
21460
+ export enum ExitLeafSelection_Tags {
21461
+ Auto = 'Auto',
21462
+ Specific = 'Specific',
21463
+ }
21464
+ /**
21465
+ * Which leaves to exit.
21466
+ */
21467
+ export const ExitLeafSelection = (() => {
21468
+ type Auto__interface = {
21469
+ tag: ExitLeafSelection_Tags.Auto;
21470
+ };
21471
+
21472
+ /**
21473
+ * Exit every leaf whose value exceeds its own marginal exit cost (its tree
21474
+ * and refund CPFP fees plus its sweep input). This per-leaf test does not
21475
+ * include the shared fan-out fee, so funding many leaves from a single UTXO
21476
+ * adds `fanout_fee_sat` on top: compare `recoverable_value_sat` with
21477
+ * `total_fee_sat`, or fund one UTXO per branch to avoid the fan-out. Leaves
21478
+ * that fail the per-leaf test are skipped.
21479
+ */
21480
+ class Auto_ extends UniffiEnum implements Auto__interface {
21481
+ /**
21482
+ * @private
21483
+ * This field is private and should not be used, use `tag` instead.
21484
+ */
21485
+ readonly [uniffiTypeNameSymbol] = 'ExitLeafSelection';
21486
+ readonly tag = ExitLeafSelection_Tags.Auto;
21487
+ constructor() {
21488
+ super('ExitLeafSelection', 'Auto');
21489
+ }
21490
+
21491
+ static new(): Auto_ {
21492
+ return new Auto_();
21493
+ }
21494
+
21495
+ static instanceOf(obj: any): obj is Auto_ {
21496
+ return obj.tag === ExitLeafSelection_Tags.Auto;
21497
+ }
21498
+ }
21499
+
21500
+ type Specific__interface = {
21501
+ tag: ExitLeafSelection_Tags.Specific;
21502
+ inner: Readonly<{ leafIds: Array<string> }>;
21503
+ };
21504
+
21505
+ /**
21506
+ * Exit exactly these leaves, regardless of profitability.
21507
+ */
21508
+ class Specific_ extends UniffiEnum implements Specific__interface {
21509
+ /**
21510
+ * @private
21511
+ * This field is private and should not be used, use `tag` instead.
21512
+ */
21513
+ readonly [uniffiTypeNameSymbol] = 'ExitLeafSelection';
21514
+ readonly tag = ExitLeafSelection_Tags.Specific;
21515
+ readonly inner: Readonly<{ leafIds: Array<string> }>;
21516
+ constructor(inner: { leafIds: Array<string> }) {
21517
+ super('ExitLeafSelection', 'Specific');
21518
+ this.inner = Object.freeze(inner);
21519
+ }
21520
+
21521
+ static new(inner: { leafIds: Array<string> }): Specific_ {
21522
+ return new Specific_(inner);
21523
+ }
21524
+
21525
+ static instanceOf(obj: any): obj is Specific_ {
21526
+ return obj.tag === ExitLeafSelection_Tags.Specific;
21527
+ }
21528
+ }
21529
+
21530
+ function instanceOf(obj: any): obj is ExitLeafSelection {
21531
+ return obj[uniffiTypeNameSymbol] === 'ExitLeafSelection';
21532
+ }
21533
+
21534
+ return Object.freeze({
21535
+ instanceOf,
21536
+ Auto: Auto_,
21537
+ Specific: Specific_,
21538
+ });
21539
+ })();
21540
+
21541
+ /**
21542
+ * Which leaves to exit.
21543
+ */
21544
+
21545
+ export type ExitLeafSelection = InstanceType<
21546
+ (typeof ExitLeafSelection)[keyof Omit<typeof ExitLeafSelection, 'instanceOf'>]
21547
+ >;
21548
+
21549
+ // FfiConverter for enum ExitLeafSelection
21550
+ const FfiConverterTypeExitLeafSelection = (() => {
21551
+ const ordinalConverter = FfiConverterInt32;
21552
+ type TypeName = ExitLeafSelection;
21553
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
21554
+ read(from: RustBuffer): TypeName {
21555
+ switch (ordinalConverter.read(from)) {
21556
+ case 1:
21557
+ return new ExitLeafSelection.Auto();
21558
+ case 2:
21559
+ return new ExitLeafSelection.Specific({
21560
+ leafIds: FfiConverterArrayString.read(from),
21561
+ });
21562
+ default:
21563
+ throw new UniffiInternalError.UnexpectedEnumCase();
21564
+ }
21565
+ }
21566
+ write(value: TypeName, into: RustBuffer): void {
21567
+ switch (value.tag) {
21568
+ case ExitLeafSelection_Tags.Auto: {
21569
+ ordinalConverter.write(1, into);
21570
+ return;
21571
+ }
21572
+ case ExitLeafSelection_Tags.Specific: {
21573
+ ordinalConverter.write(2, into);
21574
+ const inner = value.inner;
21575
+ FfiConverterArrayString.write(inner.leafIds, into);
21576
+ return;
21577
+ }
21578
+ default:
21579
+ // Throwing from here means that ExitLeafSelection_Tags hasn't matched an ordinal.
21580
+ throw new UniffiInternalError.UnexpectedEnumCase();
21581
+ }
21582
+ }
21583
+ allocationSize(value: TypeName): number {
21584
+ switch (value.tag) {
21585
+ case ExitLeafSelection_Tags.Auto: {
21586
+ return ordinalConverter.allocationSize(1);
21587
+ }
21588
+ case ExitLeafSelection_Tags.Specific: {
21589
+ const inner = value.inner;
21590
+ let size = ordinalConverter.allocationSize(2);
21591
+ size += FfiConverterArrayString.allocationSize(inner.leafIds);
21592
+ return size;
21593
+ }
21594
+ default:
21595
+ throw new UniffiInternalError.UnexpectedEnumCase();
21596
+ }
21597
+ }
21598
+ }
21599
+ return new FFIConverter();
21600
+ })();
21601
+
20190
21602
  // Enum: ExternalFrostDerivation
20191
21603
  export enum ExternalFrostDerivation_Tags {
20192
21604
  SigningLeaf = 'SigningLeaf',
@@ -22060,6 +23472,160 @@ const FfiConverterTypeOptimizationOutcome = (() => {
22060
23472
  return new FFIConverter();
22061
23473
  })();
22062
23474
 
23475
+ // Enum: Outspend
23476
+ export enum Outspend_Tags {
23477
+ Unspent = 'Unspent',
23478
+ Spent = 'Spent',
23479
+ }
23480
+ /**
23481
+ * The spend status of a transaction output.
23482
+ */
23483
+ export const Outspend = (() => {
23484
+ type Unspent__interface = {
23485
+ tag: Outspend_Tags.Unspent;
23486
+ };
23487
+
23488
+ class Unspent_ extends UniffiEnum implements Unspent__interface {
23489
+ /**
23490
+ * @private
23491
+ * This field is private and should not be used, use `tag` instead.
23492
+ */
23493
+ readonly [uniffiTypeNameSymbol] = 'Outspend';
23494
+ readonly tag = Outspend_Tags.Unspent;
23495
+ constructor() {
23496
+ super('Outspend', 'Unspent');
23497
+ }
23498
+
23499
+ static new(): Unspent_ {
23500
+ return new Unspent_();
23501
+ }
23502
+
23503
+ static instanceOf(obj: any): obj is Unspent_ {
23504
+ return obj.tag === Outspend_Tags.Unspent;
23505
+ }
23506
+ }
23507
+
23508
+ type Spent__interface = {
23509
+ tag: Outspend_Tags.Spent;
23510
+ inner: Readonly<{ txid: string; vin: /*u32*/ number; status: TxStatus }>;
23511
+ };
23512
+
23513
+ /**
23514
+ * The output is spent by input `vin` of transaction `txid`; `status` is
23515
+ * that spending transaction's confirmation status.
23516
+ */
23517
+ class Spent_ extends UniffiEnum implements Spent__interface {
23518
+ /**
23519
+ * @private
23520
+ * This field is private and should not be used, use `tag` instead.
23521
+ */
23522
+ readonly [uniffiTypeNameSymbol] = 'Outspend';
23523
+ readonly tag = Outspend_Tags.Spent;
23524
+ readonly inner: Readonly<{
23525
+ txid: string;
23526
+ vin: /*u32*/ number;
23527
+ status: TxStatus;
23528
+ }>;
23529
+ constructor(inner: {
23530
+ txid: string;
23531
+ vin: /*u32*/ number;
23532
+ status: TxStatus;
23533
+ }) {
23534
+ super('Outspend', 'Spent');
23535
+ this.inner = Object.freeze(inner);
23536
+ }
23537
+
23538
+ static new(inner: {
23539
+ txid: string;
23540
+ vin: /*u32*/ number;
23541
+ status: TxStatus;
23542
+ }): Spent_ {
23543
+ return new Spent_(inner);
23544
+ }
23545
+
23546
+ static instanceOf(obj: any): obj is Spent_ {
23547
+ return obj.tag === Outspend_Tags.Spent;
23548
+ }
23549
+ }
23550
+
23551
+ function instanceOf(obj: any): obj is Outspend {
23552
+ return obj[uniffiTypeNameSymbol] === 'Outspend';
23553
+ }
23554
+
23555
+ return Object.freeze({
23556
+ instanceOf,
23557
+ Unspent: Unspent_,
23558
+ Spent: Spent_,
23559
+ });
23560
+ })();
23561
+
23562
+ /**
23563
+ * The spend status of a transaction output.
23564
+ */
23565
+
23566
+ export type Outspend = InstanceType<
23567
+ (typeof Outspend)[keyof Omit<typeof Outspend, 'instanceOf'>]
23568
+ >;
23569
+
23570
+ // FfiConverter for enum Outspend
23571
+ const FfiConverterTypeOutspend = (() => {
23572
+ const ordinalConverter = FfiConverterInt32;
23573
+ type TypeName = Outspend;
23574
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
23575
+ read(from: RustBuffer): TypeName {
23576
+ switch (ordinalConverter.read(from)) {
23577
+ case 1:
23578
+ return new Outspend.Unspent();
23579
+ case 2:
23580
+ return new Outspend.Spent({
23581
+ txid: FfiConverterString.read(from),
23582
+ vin: FfiConverterUInt32.read(from),
23583
+ status: FfiConverterTypeTxStatus.read(from),
23584
+ });
23585
+ default:
23586
+ throw new UniffiInternalError.UnexpectedEnumCase();
23587
+ }
23588
+ }
23589
+ write(value: TypeName, into: RustBuffer): void {
23590
+ switch (value.tag) {
23591
+ case Outspend_Tags.Unspent: {
23592
+ ordinalConverter.write(1, into);
23593
+ return;
23594
+ }
23595
+ case Outspend_Tags.Spent: {
23596
+ ordinalConverter.write(2, into);
23597
+ const inner = value.inner;
23598
+ FfiConverterString.write(inner.txid, into);
23599
+ FfiConverterUInt32.write(inner.vin, into);
23600
+ FfiConverterTypeTxStatus.write(inner.status, into);
23601
+ return;
23602
+ }
23603
+ default:
23604
+ // Throwing from here means that Outspend_Tags hasn't matched an ordinal.
23605
+ throw new UniffiInternalError.UnexpectedEnumCase();
23606
+ }
23607
+ }
23608
+ allocationSize(value: TypeName): number {
23609
+ switch (value.tag) {
23610
+ case Outspend_Tags.Unspent: {
23611
+ return ordinalConverter.allocationSize(1);
23612
+ }
23613
+ case Outspend_Tags.Spent: {
23614
+ const inner = value.inner;
23615
+ let size = ordinalConverter.allocationSize(2);
23616
+ size += FfiConverterString.allocationSize(inner.txid);
23617
+ size += FfiConverterUInt32.allocationSize(inner.vin);
23618
+ size += FfiConverterTypeTxStatus.allocationSize(inner.status);
23619
+ return size;
23620
+ }
23621
+ default:
23622
+ throw new UniffiInternalError.UnexpectedEnumCase();
23623
+ }
23624
+ }
23625
+ }
23626
+ return new FFIConverter();
23627
+ })();
23628
+
22063
23629
  // Enum: PasskeyAvailability
22064
23630
  export enum PasskeyAvailability_Tags {
22065
23631
  Available = 'Available',
@@ -25539,6 +27105,8 @@ export enum SdkError_Tags {
25539
27105
  Signer = 'Signer',
25540
27106
  OptimizationAlreadyRunning = 'OptimizationAlreadyRunning',
25541
27107
  OptimizationCancelled = 'OptimizationCancelled',
27108
+ InsufficientCpfpFunds = 'InsufficientCpfpFunds',
27109
+ FundingUtxoConflict = 'FundingUtxoConflict',
25542
27110
  Generic = 'Generic',
25543
27111
  }
25544
27112
  /**
@@ -26045,6 +27613,96 @@ export const SdkError = (() => {
26045
27613
  }
26046
27614
  }
26047
27615
 
27616
+ type InsufficientCpfpFunds__interface = {
27617
+ tag: SdkError_Tags.InsufficientCpfpFunds;
27618
+ inner: Readonly<{ requiredSat: /*u64*/ bigint }>;
27619
+ };
27620
+
27621
+ /**
27622
+ * The provided CPFP funding is too low to cover the exit's on-chain fees.
27623
+ */
27624
+ class InsufficientCpfpFunds_
27625
+ extends UniffiError
27626
+ implements InsufficientCpfpFunds__interface
27627
+ {
27628
+ /**
27629
+ * @private
27630
+ * This field is private and should not be used, use `tag` instead.
27631
+ */
27632
+ readonly [uniffiTypeNameSymbol] = 'SdkError';
27633
+ readonly tag = SdkError_Tags.InsufficientCpfpFunds;
27634
+ readonly inner: Readonly<{ requiredSat: /*u64*/ bigint }>;
27635
+ constructor(inner: { requiredSat: /*u64*/ bigint }) {
27636
+ super('SdkError', 'InsufficientCpfpFunds');
27637
+ this.inner = Object.freeze(inner);
27638
+ }
27639
+
27640
+ static new(inner: { requiredSat: /*u64*/ bigint }): InsufficientCpfpFunds_ {
27641
+ return new InsufficientCpfpFunds_(inner);
27642
+ }
27643
+
27644
+ static instanceOf(obj: any): obj is InsufficientCpfpFunds_ {
27645
+ return obj.tag === SdkError_Tags.InsufficientCpfpFunds;
27646
+ }
27647
+
27648
+ static hasInner(obj: any): obj is InsufficientCpfpFunds_ {
27649
+ return InsufficientCpfpFunds_.instanceOf(obj);
27650
+ }
27651
+
27652
+ static getInner(
27653
+ obj: InsufficientCpfpFunds_
27654
+ ): Readonly<{ requiredSat: /*u64*/ bigint }> {
27655
+ return obj.inner;
27656
+ }
27657
+ }
27658
+
27659
+ type FundingUtxoConflict__interface = {
27660
+ tag: SdkError_Tags.FundingUtxoConflict;
27661
+ inner: Readonly<{ txid: string; vout: /*u32*/ number }>;
27662
+ };
27663
+
27664
+ /**
27665
+ * A provided funding UTXO was already spent on-chain by a transaction that
27666
+ * is not the expected fan-out, so it cannot fund this exit.
27667
+ */
27668
+ class FundingUtxoConflict_
27669
+ extends UniffiError
27670
+ implements FundingUtxoConflict__interface
27671
+ {
27672
+ /**
27673
+ * @private
27674
+ * This field is private and should not be used, use `tag` instead.
27675
+ */
27676
+ readonly [uniffiTypeNameSymbol] = 'SdkError';
27677
+ readonly tag = SdkError_Tags.FundingUtxoConflict;
27678
+ readonly inner: Readonly<{ txid: string; vout: /*u32*/ number }>;
27679
+ constructor(inner: { txid: string; vout: /*u32*/ number }) {
27680
+ super('SdkError', 'FundingUtxoConflict');
27681
+ this.inner = Object.freeze(inner);
27682
+ }
27683
+
27684
+ static new(inner: {
27685
+ txid: string;
27686
+ vout: /*u32*/ number;
27687
+ }): FundingUtxoConflict_ {
27688
+ return new FundingUtxoConflict_(inner);
27689
+ }
27690
+
27691
+ static instanceOf(obj: any): obj is FundingUtxoConflict_ {
27692
+ return obj.tag === SdkError_Tags.FundingUtxoConflict;
27693
+ }
27694
+
27695
+ static hasInner(obj: any): obj is FundingUtxoConflict_ {
27696
+ return FundingUtxoConflict_.instanceOf(obj);
27697
+ }
27698
+
27699
+ static getInner(
27700
+ obj: FundingUtxoConflict_
27701
+ ): Readonly<{ txid: string; vout: /*u32*/ number }> {
27702
+ return obj.inner;
27703
+ }
27704
+ }
27705
+
26048
27706
  type Generic__interface = {
26049
27707
  tag: SdkError_Tags.Generic;
26050
27708
  inner: Readonly<[string]>;
@@ -26099,6 +27757,8 @@ export const SdkError = (() => {
26099
27757
  Signer: Signer_,
26100
27758
  OptimizationAlreadyRunning: OptimizationAlreadyRunning_,
26101
27759
  OptimizationCancelled: OptimizationCancelled_,
27760
+ InsufficientCpfpFunds: InsufficientCpfpFunds_,
27761
+ FundingUtxoConflict: FundingUtxoConflict_,
26102
27762
  Generic: Generic_,
26103
27763
  });
26104
27764
  })();
@@ -26154,6 +27814,15 @@ const FfiConverterTypeSdkError = (() => {
26154
27814
  case 13:
26155
27815
  return new SdkError.OptimizationCancelled();
26156
27816
  case 14:
27817
+ return new SdkError.InsufficientCpfpFunds({
27818
+ requiredSat: FfiConverterUInt64.read(from),
27819
+ });
27820
+ case 15:
27821
+ return new SdkError.FundingUtxoConflict({
27822
+ txid: FfiConverterString.read(from),
27823
+ vout: FfiConverterUInt32.read(from),
27824
+ });
27825
+ case 16:
26157
27826
  return new SdkError.Generic(FfiConverterString.read(from));
26158
27827
  default:
26159
27828
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -26238,9 +27907,22 @@ const FfiConverterTypeSdkError = (() => {
26238
27907
  ordinalConverter.write(13, into);
26239
27908
  return;
26240
27909
  }
26241
- case SdkError_Tags.Generic: {
27910
+ case SdkError_Tags.InsufficientCpfpFunds: {
26242
27911
  ordinalConverter.write(14, into);
26243
27912
  const inner = value.inner;
27913
+ FfiConverterUInt64.write(inner.requiredSat, into);
27914
+ return;
27915
+ }
27916
+ case SdkError_Tags.FundingUtxoConflict: {
27917
+ ordinalConverter.write(15, into);
27918
+ const inner = value.inner;
27919
+ FfiConverterString.write(inner.txid, into);
27920
+ FfiConverterUInt32.write(inner.vout, into);
27921
+ return;
27922
+ }
27923
+ case SdkError_Tags.Generic: {
27924
+ ordinalConverter.write(16, into);
27925
+ const inner = value.inner;
26244
27926
  FfiConverterString.write(inner[0], into);
26245
27927
  return;
26246
27928
  }
@@ -26327,9 +28009,22 @@ const FfiConverterTypeSdkError = (() => {
26327
28009
  case SdkError_Tags.OptimizationCancelled: {
26328
28010
  return ordinalConverter.allocationSize(13);
26329
28011
  }
26330
- case SdkError_Tags.Generic: {
28012
+ case SdkError_Tags.InsufficientCpfpFunds: {
26331
28013
  const inner = value.inner;
26332
28014
  let size = ordinalConverter.allocationSize(14);
28015
+ size += FfiConverterUInt64.allocationSize(inner.requiredSat);
28016
+ return size;
28017
+ }
28018
+ case SdkError_Tags.FundingUtxoConflict: {
28019
+ const inner = value.inner;
28020
+ let size = ordinalConverter.allocationSize(15);
28021
+ size += FfiConverterString.allocationSize(inner.txid);
28022
+ size += FfiConverterUInt32.allocationSize(inner.vout);
28023
+ return size;
28024
+ }
28025
+ case SdkError_Tags.Generic: {
28026
+ const inner = value.inner;
28027
+ let size = ordinalConverter.allocationSize(16);
26333
28028
  size += FfiConverterString.allocationSize(inner[0]);
26334
28029
  return size;
26335
28030
  }
@@ -29266,6 +30961,150 @@ const FfiConverterTypeSparkHtlcStatus = (() => {
29266
30961
  return new FFIConverter();
29267
30962
  })();
29268
30963
 
30964
+ // Enum: SparkMasterIdentityPublicKey
30965
+ export enum SparkMasterIdentityPublicKey_Tags {
30966
+ Set = 'Set',
30967
+ Unset = 'Unset',
30968
+ }
30969
+ /**
30970
+ * Specifies how to update the wallet's Spark master identity public key.
30971
+ */
30972
+ export const SparkMasterIdentityPublicKey = (() => {
30973
+ type Set__interface = {
30974
+ tag: SparkMasterIdentityPublicKey_Tags.Set;
30975
+ inner: Readonly<{ publicKey: string }>;
30976
+ };
30977
+
30978
+ /**
30979
+ * Designate the holder of this public key as the wallet's master
30980
+ * identity, replacing any previously designated key. Must be hex encoded
30981
+ * in the 33-byte compressed form.
30982
+ */
30983
+ class Set_ extends UniffiEnum implements Set__interface {
30984
+ /**
30985
+ * @private
30986
+ * This field is private and should not be used, use `tag` instead.
30987
+ */
30988
+ readonly [uniffiTypeNameSymbol] = 'SparkMasterIdentityPublicKey';
30989
+ readonly tag = SparkMasterIdentityPublicKey_Tags.Set;
30990
+ readonly inner: Readonly<{ publicKey: string }>;
30991
+ constructor(inner: { publicKey: string }) {
30992
+ super('SparkMasterIdentityPublicKey', 'Set');
30993
+ this.inner = Object.freeze(inner);
30994
+ }
30995
+
30996
+ static new(inner: { publicKey: string }): Set_ {
30997
+ return new Set_(inner);
30998
+ }
30999
+
31000
+ static instanceOf(obj: any): obj is Set_ {
31001
+ return obj.tag === SparkMasterIdentityPublicKey_Tags.Set;
31002
+ }
31003
+ }
31004
+
31005
+ type Unset__interface = {
31006
+ tag: SparkMasterIdentityPublicKey_Tags.Unset;
31007
+ };
31008
+
31009
+ /**
31010
+ * Remove the designated master identity, leaving the owner as the only
31011
+ * party able to read the wallet under private mode.
31012
+ */
31013
+ class Unset_ extends UniffiEnum implements Unset__interface {
31014
+ /**
31015
+ * @private
31016
+ * This field is private and should not be used, use `tag` instead.
31017
+ */
31018
+ readonly [uniffiTypeNameSymbol] = 'SparkMasterIdentityPublicKey';
31019
+ readonly tag = SparkMasterIdentityPublicKey_Tags.Unset;
31020
+ constructor() {
31021
+ super('SparkMasterIdentityPublicKey', 'Unset');
31022
+ }
31023
+
31024
+ static new(): Unset_ {
31025
+ return new Unset_();
31026
+ }
31027
+
31028
+ static instanceOf(obj: any): obj is Unset_ {
31029
+ return obj.tag === SparkMasterIdentityPublicKey_Tags.Unset;
31030
+ }
31031
+ }
31032
+
31033
+ function instanceOf(obj: any): obj is SparkMasterIdentityPublicKey {
31034
+ return obj[uniffiTypeNameSymbol] === 'SparkMasterIdentityPublicKey';
31035
+ }
31036
+
31037
+ return Object.freeze({
31038
+ instanceOf,
31039
+ Set: Set_,
31040
+ Unset: Unset_,
31041
+ });
31042
+ })();
31043
+
31044
+ /**
31045
+ * Specifies how to update the wallet's Spark master identity public key.
31046
+ */
31047
+
31048
+ export type SparkMasterIdentityPublicKey = InstanceType<
31049
+ (typeof SparkMasterIdentityPublicKey)[keyof Omit<
31050
+ typeof SparkMasterIdentityPublicKey,
31051
+ 'instanceOf'
31052
+ >]
31053
+ >;
31054
+
31055
+ // FfiConverter for enum SparkMasterIdentityPublicKey
31056
+ const FfiConverterTypeSparkMasterIdentityPublicKey = (() => {
31057
+ const ordinalConverter = FfiConverterInt32;
31058
+ type TypeName = SparkMasterIdentityPublicKey;
31059
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
31060
+ read(from: RustBuffer): TypeName {
31061
+ switch (ordinalConverter.read(from)) {
31062
+ case 1:
31063
+ return new SparkMasterIdentityPublicKey.Set({
31064
+ publicKey: FfiConverterString.read(from),
31065
+ });
31066
+ case 2:
31067
+ return new SparkMasterIdentityPublicKey.Unset();
31068
+ default:
31069
+ throw new UniffiInternalError.UnexpectedEnumCase();
31070
+ }
31071
+ }
31072
+ write(value: TypeName, into: RustBuffer): void {
31073
+ switch (value.tag) {
31074
+ case SparkMasterIdentityPublicKey_Tags.Set: {
31075
+ ordinalConverter.write(1, into);
31076
+ const inner = value.inner;
31077
+ FfiConverterString.write(inner.publicKey, into);
31078
+ return;
31079
+ }
31080
+ case SparkMasterIdentityPublicKey_Tags.Unset: {
31081
+ ordinalConverter.write(2, into);
31082
+ return;
31083
+ }
31084
+ default:
31085
+ // Throwing from here means that SparkMasterIdentityPublicKey_Tags hasn't matched an ordinal.
31086
+ throw new UniffiInternalError.UnexpectedEnumCase();
31087
+ }
31088
+ }
31089
+ allocationSize(value: TypeName): number {
31090
+ switch (value.tag) {
31091
+ case SparkMasterIdentityPublicKey_Tags.Set: {
31092
+ const inner = value.inner;
31093
+ let size = ordinalConverter.allocationSize(1);
31094
+ size += FfiConverterString.allocationSize(inner.publicKey);
31095
+ return size;
31096
+ }
31097
+ case SparkMasterIdentityPublicKey_Tags.Unset: {
31098
+ return ordinalConverter.allocationSize(2);
31099
+ }
31100
+ default:
31101
+ throw new UniffiInternalError.UnexpectedEnumCase();
31102
+ }
31103
+ }
31104
+ }
31105
+ return new FFIConverter();
31106
+ })();
31107
+
29269
31108
  // Enum: StableBalanceActiveLabel
29270
31109
  export enum StableBalanceActiveLabel_Tags {
29271
31110
  Set = 'Set',
@@ -30847,6 +32686,66 @@ const FfiConverterTypeTransferTarget = (() => {
30847
32686
  return new FFIConverter();
30848
32687
  })();
30849
32688
 
32689
+ /**
32690
+ * The role of a transaction in the exit path.
32691
+ */
32692
+ export enum UnilateralExitTxKind {
32693
+ /**
32694
+ * Splits the caller's funding into one output per branch. Present only
32695
+ * when the funding couldn't be matched one-to-one to branches.
32696
+ */
32697
+ FanOut,
32698
+ /**
32699
+ * A tree node transaction (root, intermediate, or leaf node).
32700
+ */
32701
+ Node,
32702
+ /**
32703
+ * A leaf's refund transaction.
32704
+ */
32705
+ Refund,
32706
+ /**
32707
+ * The final transaction sweeping all refund outputs to the destination.
32708
+ */
32709
+ Sweep,
32710
+ }
32711
+
32712
+ const FfiConverterTypeUnilateralExitTxKind = (() => {
32713
+ const ordinalConverter = FfiConverterInt32;
32714
+ type TypeName = UnilateralExitTxKind;
32715
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
32716
+ read(from: RustBuffer): TypeName {
32717
+ switch (ordinalConverter.read(from)) {
32718
+ case 1:
32719
+ return UnilateralExitTxKind.FanOut;
32720
+ case 2:
32721
+ return UnilateralExitTxKind.Node;
32722
+ case 3:
32723
+ return UnilateralExitTxKind.Refund;
32724
+ case 4:
32725
+ return UnilateralExitTxKind.Sweep;
32726
+ default:
32727
+ throw new UniffiInternalError.UnexpectedEnumCase();
32728
+ }
32729
+ }
32730
+ write(value: TypeName, into: RustBuffer): void {
32731
+ switch (value) {
32732
+ case UnilateralExitTxKind.FanOut:
32733
+ return ordinalConverter.write(1, into);
32734
+ case UnilateralExitTxKind.Node:
32735
+ return ordinalConverter.write(2, into);
32736
+ case UnilateralExitTxKind.Refund:
32737
+ return ordinalConverter.write(3, into);
32738
+ case UnilateralExitTxKind.Sweep:
32739
+ return ordinalConverter.write(4, into);
32740
+ }
32741
+ }
32742
+ allocationSize(value: TypeName): number {
32743
+ return ordinalConverter.allocationSize(0);
32744
+ }
32745
+ }
32746
+ return new FFIConverter();
32747
+ })();
32748
+
30850
32749
  // Enum: UnsignedTransferPackage
30851
32750
  export enum UnsignedTransferPackage_Tags {
30852
32751
  Swap = 'Swap',
@@ -31578,6 +33477,16 @@ export interface BitcoinChainService {
31578
33477
  address: string,
31579
33478
  asyncOpts_?: { signal: AbortSignal }
31580
33479
  ): /*throws*/ Promise<Array<Utxo>>;
33480
+ /**
33481
+ * Every output ever paid to `address`, spent or not, unlike
33482
+ * [`get_address_utxos`](Self::get_address_utxos) which omits spent ones.
33483
+ * Recovers an output's outpoint and value after it has been spent, so a
33484
+ * swept refund can still be distinguished from one never broadcast.
33485
+ */
33486
+ getAddressTxos(
33487
+ address: string,
33488
+ asyncOpts_?: { signal: AbortSignal }
33489
+ ): /*throws*/ Promise<Array<Utxo>>;
31581
33490
  getTransactionStatus(
31582
33491
  txid: string,
31583
33492
  asyncOpts_?: { signal: AbortSignal }
@@ -31586,6 +33495,11 @@ export interface BitcoinChainService {
31586
33495
  txid: string,
31587
33496
  asyncOpts_?: { signal: AbortSignal }
31588
33497
  ): /*throws*/ Promise<string>;
33498
+ getOutspend(
33499
+ txid: string,
33500
+ vout: /*u32*/ number,
33501
+ asyncOpts_?: { signal: AbortSignal }
33502
+ ): /*throws*/ Promise<Outspend>;
31589
33503
  broadcastTransaction(
31590
33504
  tx: string,
31591
33505
  asyncOpts_?: { signal: AbortSignal }
@@ -31649,6 +33563,51 @@ export class BitcoinChainServiceImpl
31649
33563
  }
31650
33564
  }
31651
33565
 
33566
+ /**
33567
+ * Every output ever paid to `address`, spent or not, unlike
33568
+ * [`get_address_utxos`](Self::get_address_utxos) which omits spent ones.
33569
+ * Recovers an output's outpoint and value after it has been spent, so a
33570
+ * swept refund can still be distinguished from one never broadcast.
33571
+ */
33572
+ public async getAddressTxos(
33573
+ address: string,
33574
+ asyncOpts_?: { signal: AbortSignal }
33575
+ ): Promise<Array<Utxo>> /*throws*/ {
33576
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
33577
+ try {
33578
+ return await uniffiRustCallAsync(
33579
+ /*rustCaller:*/ uniffiCaller,
33580
+ /*rustFutureFunc:*/ () => {
33581
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_address_txos(
33582
+ uniffiTypeBitcoinChainServiceImplObjectFactory.clonePointer(this),
33583
+ FfiConverterString.lower(address)
33584
+ );
33585
+ },
33586
+ /*pollFunc:*/ nativeModule()
33587
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
33588
+ /*cancelFunc:*/ nativeModule()
33589
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
33590
+ /*completeFunc:*/ nativeModule()
33591
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
33592
+ /*freeFunc:*/ nativeModule()
33593
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
33594
+ /*liftFunc:*/ FfiConverterArrayTypeUtxo.lift.bind(
33595
+ FfiConverterArrayTypeUtxo
33596
+ ),
33597
+ /*liftString:*/ FfiConverterString.lift,
33598
+ /*asyncOpts:*/ asyncOpts_,
33599
+ /*errorHandler:*/ FfiConverterTypeChainServiceError.lift.bind(
33600
+ FfiConverterTypeChainServiceError
33601
+ )
33602
+ );
33603
+ } catch (__error: any) {
33604
+ if (uniffiIsDebug && __error instanceof Error) {
33605
+ __error.stack = __stack;
33606
+ }
33607
+ throw __error;
33608
+ }
33609
+ }
33610
+
31652
33611
  public async getTransactionStatus(
31653
33612
  txid: string,
31654
33613
  asyncOpts_?: { signal: AbortSignal }
@@ -31725,6 +33684,47 @@ export class BitcoinChainServiceImpl
31725
33684
  }
31726
33685
  }
31727
33686
 
33687
+ public async getOutspend(
33688
+ txid: string,
33689
+ vout: /*u32*/ number,
33690
+ asyncOpts_?: { signal: AbortSignal }
33691
+ ): Promise<Outspend> /*throws*/ {
33692
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
33693
+ try {
33694
+ return await uniffiRustCallAsync(
33695
+ /*rustCaller:*/ uniffiCaller,
33696
+ /*rustFutureFunc:*/ () => {
33697
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_outspend(
33698
+ uniffiTypeBitcoinChainServiceImplObjectFactory.clonePointer(this),
33699
+ FfiConverterString.lower(txid),
33700
+ FfiConverterUInt32.lower(vout)
33701
+ );
33702
+ },
33703
+ /*pollFunc:*/ nativeModule()
33704
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
33705
+ /*cancelFunc:*/ nativeModule()
33706
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
33707
+ /*completeFunc:*/ nativeModule()
33708
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
33709
+ /*freeFunc:*/ nativeModule()
33710
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
33711
+ /*liftFunc:*/ FfiConverterTypeOutspend.lift.bind(
33712
+ FfiConverterTypeOutspend
33713
+ ),
33714
+ /*liftString:*/ FfiConverterString.lift,
33715
+ /*asyncOpts:*/ asyncOpts_,
33716
+ /*errorHandler:*/ FfiConverterTypeChainServiceError.lift.bind(
33717
+ FfiConverterTypeChainServiceError
33718
+ )
33719
+ );
33720
+ } catch (__error: any) {
33721
+ if (uniffiIsDebug && __error instanceof Error) {
33722
+ __error.stack = __stack;
33723
+ }
33724
+ throw __error;
33725
+ }
33726
+ }
33727
+
31728
33728
  public async broadcastTransaction(
31729
33729
  tx: string,
31730
33730
  asyncOpts_?: { signal: AbortSignal }
@@ -31946,6 +33946,55 @@ const uniffiCallbackInterfaceBitcoinChainService: {
31946
33946
  );
31947
33947
  return uniffiForeignFuture;
31948
33948
  },
33949
+ getAddressTxos: (
33950
+ uniffiHandle: bigint,
33951
+ address: Uint8Array,
33952
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
33953
+ uniffiCallbackData: bigint
33954
+ ) => {
33955
+ const uniffiMakeCall = async (
33956
+ signal: AbortSignal
33957
+ ): Promise<Array<Utxo>> => {
33958
+ const jsCallback =
33959
+ FfiConverterTypeBitcoinChainService.lift(uniffiHandle);
33960
+ return await jsCallback.getAddressTxos(
33961
+ FfiConverterString.lift(address),
33962
+ { signal }
33963
+ );
33964
+ };
33965
+ const uniffiHandleSuccess = (returnValue: Array<Utxo>) => {
33966
+ uniffiFutureCallback.call(
33967
+ uniffiFutureCallback,
33968
+ uniffiCallbackData,
33969
+ /* UniffiForeignFutureStructRustBuffer */ {
33970
+ returnValue: FfiConverterArrayTypeUtxo.lower(returnValue),
33971
+ callStatus: uniffiCaller.createCallStatus(),
33972
+ }
33973
+ );
33974
+ };
33975
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
33976
+ uniffiFutureCallback.call(
33977
+ uniffiFutureCallback,
33978
+ uniffiCallbackData,
33979
+ /* UniffiForeignFutureStructRustBuffer */ {
33980
+ returnValue: /*empty*/ new Uint8Array(0),
33981
+ // TODO create callstatus with error.
33982
+ callStatus: uniffiCaller.createErrorStatus(code, errorBuf),
33983
+ }
33984
+ );
33985
+ };
33986
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
33987
+ /*makeCall:*/ uniffiMakeCall,
33988
+ /*handleSuccess:*/ uniffiHandleSuccess,
33989
+ /*handleError:*/ uniffiHandleError,
33990
+ /*isErrorType:*/ ChainServiceError.instanceOf,
33991
+ /*lowerError:*/ FfiConverterTypeChainServiceError.lower.bind(
33992
+ FfiConverterTypeChainServiceError
33993
+ ),
33994
+ /*lowerString:*/ FfiConverterString.lower
33995
+ );
33996
+ return uniffiForeignFuture;
33997
+ },
31949
33998
  getTransactionStatus: (
31950
33999
  uniffiHandle: bigint,
31951
34000
  txid: Uint8Array,
@@ -32040,6 +34089,55 @@ const uniffiCallbackInterfaceBitcoinChainService: {
32040
34089
  );
32041
34090
  return uniffiForeignFuture;
32042
34091
  },
34092
+ getOutspend: (
34093
+ uniffiHandle: bigint,
34094
+ txid: Uint8Array,
34095
+ vout: number,
34096
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
34097
+ uniffiCallbackData: bigint
34098
+ ) => {
34099
+ const uniffiMakeCall = async (signal: AbortSignal): Promise<Outspend> => {
34100
+ const jsCallback =
34101
+ FfiConverterTypeBitcoinChainService.lift(uniffiHandle);
34102
+ return await jsCallback.getOutspend(
34103
+ FfiConverterString.lift(txid),
34104
+ FfiConverterUInt32.lift(vout),
34105
+ { signal }
34106
+ );
34107
+ };
34108
+ const uniffiHandleSuccess = (returnValue: Outspend) => {
34109
+ uniffiFutureCallback.call(
34110
+ uniffiFutureCallback,
34111
+ uniffiCallbackData,
34112
+ /* UniffiForeignFutureStructRustBuffer */ {
34113
+ returnValue: FfiConverterTypeOutspend.lower(returnValue),
34114
+ callStatus: uniffiCaller.createCallStatus(),
34115
+ }
34116
+ );
34117
+ };
34118
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
34119
+ uniffiFutureCallback.call(
34120
+ uniffiFutureCallback,
34121
+ uniffiCallbackData,
34122
+ /* UniffiForeignFutureStructRustBuffer */ {
34123
+ returnValue: /*empty*/ new Uint8Array(0),
34124
+ // TODO create callstatus with error.
34125
+ callStatus: uniffiCaller.createErrorStatus(code, errorBuf),
34126
+ }
34127
+ );
34128
+ };
34129
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
34130
+ /*makeCall:*/ uniffiMakeCall,
34131
+ /*handleSuccess:*/ uniffiHandleSuccess,
34132
+ /*handleError:*/ uniffiHandleError,
34133
+ /*isErrorType:*/ ChainServiceError.instanceOf,
34134
+ /*lowerError:*/ FfiConverterTypeChainServiceError.lower.bind(
34135
+ FfiConverterTypeChainServiceError
34136
+ ),
34137
+ /*lowerString:*/ FfiConverterString.lower
34138
+ );
34139
+ return uniffiForeignFuture;
34140
+ },
32043
34141
  broadcastTransaction: (
32044
34142
  uniffiHandle: bigint,
32045
34143
  tx: Uint8Array,
@@ -32473,6 +34571,15 @@ export interface BreezSdkInterface {
32473
34571
  request: PrepareSendPaymentRequest,
32474
34572
  asyncOpts_?: { signal: AbortSignal }
32475
34573
  ): /*throws*/ Promise<PrepareSendPaymentResponse>;
34574
+ /**
34575
+ * Quotes a unilateral exit without any funding UTXOs: selects which leaves
34576
+ * would exit, computes the exact fee for the given funding kind, and reports
34577
+ * how much to fund.
34578
+ */
34579
+ prepareUnilateralExit(
34580
+ request: PrepareUnilateralExitRequest,
34581
+ asyncOpts_?: { signal: AbortSignal }
34582
+ ): /*throws*/ Promise<PrepareUnilateralExitResponse>;
32476
34583
  publishSignedLnurlPayPackage(
32477
34584
  request: PublishSignedLnurlPayPackageRequest,
32478
34585
  asyncOpts_?: { signal: AbortSignal }
@@ -32496,19 +34603,20 @@ export interface BreezSdkInterface {
32496
34603
  asyncOpts_?: { signal: AbortSignal }
32497
34604
  ): /*throws*/ Promise<RefundDepositResponse>;
32498
34605
  /**
32499
- * Runs one pass of the pending-conversion refunder.
34606
+ * Runs one full pass of the pending-conversion refunder and returns how
34607
+ * many conversions were refunded, skipped (held back by a safety window),
34608
+ * or failed.
32500
34609
  *
32501
- * Iterates over payments whose conversions failed and have a refund
32502
- * pending, then attempts to refund each one. This is the same logic the
32503
- * SDK runs internally on a periodic schedule when
32504
- * `background_tasks_enabled` is `true`. When background tasks are
32505
- * disabled the periodic refunder does not run, and this method is the
32506
- * explicit entry point for driving the pass; when background tasks are
32507
- * enabled, it can be called to force an immediate refund pass.
34610
+ * The pass has two parts: refunding locally-marked failed conversions, and
34611
+ * reconciling against Flashnet's clawback-eligible listing to catch
34612
+ * conversions with no local marker (e.g. a storage write that never
34613
+ * landed). The SDK's periodic background schedule runs only the local
34614
+ * part; the reconcile runs at SDK init and on each call to this method, so
34615
+ * this is the explicit entry point for driving a full pass on demand.
32508
34616
  */
32509
34617
  refundPendingConversions(asyncOpts_?: {
32510
34618
  signal: AbortSignal;
32511
- }): /*throws*/ Promise<void>;
34619
+ }): /*throws*/ Promise<RefundPendingConversionsResponse>;
32512
34620
  registerLightningAddress(
32513
34621
  request: RegisterLightningAddressRequest,
32514
34622
  asyncOpts_?: { signal: AbortSignal }
@@ -32567,6 +34675,23 @@ export interface BreezSdkInterface {
32567
34675
  request: SyncWalletRequest,
32568
34676
  asyncOpts_?: { signal: AbortSignal }
32569
34677
  ): /*throws*/ Promise<SyncWalletResponse>;
34678
+ /**
34679
+ * Builds and signs a complete unilateral exit from a `prepare_unilateral_exit`
34680
+ * quote and the actual funding UTXOs, returning the full transaction set in
34681
+ * topological broadcast order without broadcasting. Broadcast it over time,
34682
+ * respecting each transaction's `depends_on` and `csv_timelock_blocks`.
34683
+ *
34684
+ * It resolves on-chain state first (see [`resolve_exit_observations`]): an
34685
+ * already-confirmed fan-out or CPFP node is not rebuilt, and a leaf refund
34686
+ * already on-chain (recognized by the leaf's refund address, so any refund
34687
+ * variant counts) is swept directly. Re-running after partial progress
34688
+ * therefore resumes rather than restarts.
34689
+ */
34690
+ unilateralExit(
34691
+ request: UnilateralExitRequest,
34692
+ signer: CpfpSigner,
34693
+ asyncOpts_?: { signal: AbortSignal }
34694
+ ): /*throws*/ Promise<UnilateralExitResponse>;
32570
34695
  /**
32571
34696
  * Unregisters a previously registered webhook.
32572
34697
  *
@@ -34137,6 +36262,50 @@ export class BreezSdk
34137
36262
  }
34138
36263
  }
34139
36264
 
36265
+ /**
36266
+ * Quotes a unilateral exit without any funding UTXOs: selects which leaves
36267
+ * would exit, computes the exact fee for the given funding kind, and reports
36268
+ * how much to fund.
36269
+ */
36270
+ public async prepareUnilateralExit(
36271
+ request: PrepareUnilateralExitRequest,
36272
+ asyncOpts_?: { signal: AbortSignal }
36273
+ ): Promise<PrepareUnilateralExitResponse> /*throws*/ {
36274
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
36275
+ try {
36276
+ return await uniffiRustCallAsync(
36277
+ /*rustCaller:*/ uniffiCaller,
36278
+ /*rustFutureFunc:*/ () => {
36279
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_unilateral_exit(
36280
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
36281
+ FfiConverterTypePrepareUnilateralExitRequest.lower(request)
36282
+ );
36283
+ },
36284
+ /*pollFunc:*/ nativeModule()
36285
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
36286
+ /*cancelFunc:*/ nativeModule()
36287
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
36288
+ /*completeFunc:*/ nativeModule()
36289
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
36290
+ /*freeFunc:*/ nativeModule()
36291
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
36292
+ /*liftFunc:*/ FfiConverterTypePrepareUnilateralExitResponse.lift.bind(
36293
+ FfiConverterTypePrepareUnilateralExitResponse
36294
+ ),
36295
+ /*liftString:*/ FfiConverterString.lift,
36296
+ /*asyncOpts:*/ asyncOpts_,
36297
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
36298
+ FfiConverterTypeSdkError
36299
+ )
36300
+ );
36301
+ } catch (__error: any) {
36302
+ if (uniffiIsDebug && __error instanceof Error) {
36303
+ __error.stack = __stack;
36304
+ }
36305
+ throw __error;
36306
+ }
36307
+ }
36308
+
34140
36309
  public async publishSignedLnurlPayPackage(
34141
36310
  request: PublishSignedLnurlPayPackageRequest,
34142
36311
  asyncOpts_?: { signal: AbortSignal }
@@ -34334,19 +36503,20 @@ export class BreezSdk
34334
36503
  }
34335
36504
 
34336
36505
  /**
34337
- * Runs one pass of the pending-conversion refunder.
36506
+ * Runs one full pass of the pending-conversion refunder and returns how
36507
+ * many conversions were refunded, skipped (held back by a safety window),
36508
+ * or failed.
34338
36509
  *
34339
- * Iterates over payments whose conversions failed and have a refund
34340
- * pending, then attempts to refund each one. This is the same logic the
34341
- * SDK runs internally on a periodic schedule when
34342
- * `background_tasks_enabled` is `true`. When background tasks are
34343
- * disabled the periodic refunder does not run, and this method is the
34344
- * explicit entry point for driving the pass; when background tasks are
34345
- * enabled, it can be called to force an immediate refund pass.
36510
+ * The pass has two parts: refunding locally-marked failed conversions, and
36511
+ * reconciling against Flashnet's clawback-eligible listing to catch
36512
+ * conversions with no local marker (e.g. a storage write that never
36513
+ * landed). The SDK's periodic background schedule runs only the local
36514
+ * part; the reconcile runs at SDK init and on each call to this method, so
36515
+ * this is the explicit entry point for driving a full pass on demand.
34346
36516
  */
34347
36517
  public async refundPendingConversions(asyncOpts_?: {
34348
36518
  signal: AbortSignal;
34349
- }): Promise<void> /*throws*/ {
36519
+ }): Promise<RefundPendingConversionsResponse> /*throws*/ {
34350
36520
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
34351
36521
  try {
34352
36522
  return await uniffiRustCallAsync(
@@ -34357,14 +36527,16 @@ export class BreezSdk
34357
36527
  );
34358
36528
  },
34359
36529
  /*pollFunc:*/ nativeModule()
34360
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
36530
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
34361
36531
  /*cancelFunc:*/ nativeModule()
34362
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
36532
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
34363
36533
  /*completeFunc:*/ nativeModule()
34364
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
36534
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
34365
36535
  /*freeFunc:*/ nativeModule()
34366
- .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
34367
- /*liftFunc:*/ (_v) => {},
36536
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
36537
+ /*liftFunc:*/ FfiConverterTypeRefundPendingConversionsResponse.lift.bind(
36538
+ FfiConverterTypeRefundPendingConversionsResponse
36539
+ ),
34368
36540
  /*liftString:*/ FfiConverterString.lift,
34369
36541
  /*asyncOpts:*/ asyncOpts_,
34370
36542
  /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
@@ -34642,6 +36814,59 @@ export class BreezSdk
34642
36814
  }
34643
36815
  }
34644
36816
 
36817
+ /**
36818
+ * Builds and signs a complete unilateral exit from a `prepare_unilateral_exit`
36819
+ * quote and the actual funding UTXOs, returning the full transaction set in
36820
+ * topological broadcast order without broadcasting. Broadcast it over time,
36821
+ * respecting each transaction's `depends_on` and `csv_timelock_blocks`.
36822
+ *
36823
+ * It resolves on-chain state first (see [`resolve_exit_observations`]): an
36824
+ * already-confirmed fan-out or CPFP node is not rebuilt, and a leaf refund
36825
+ * already on-chain (recognized by the leaf's refund address, so any refund
36826
+ * variant counts) is swept directly. Re-running after partial progress
36827
+ * therefore resumes rather than restarts.
36828
+ */
36829
+ public async unilateralExit(
36830
+ request: UnilateralExitRequest,
36831
+ signer: CpfpSigner,
36832
+ asyncOpts_?: { signal: AbortSignal }
36833
+ ): Promise<UnilateralExitResponse> /*throws*/ {
36834
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
36835
+ try {
36836
+ return await uniffiRustCallAsync(
36837
+ /*rustCaller:*/ uniffiCaller,
36838
+ /*rustFutureFunc:*/ () => {
36839
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_unilateral_exit(
36840
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
36841
+ FfiConverterTypeUnilateralExitRequest.lower(request),
36842
+ FfiConverterTypeCpfpSigner.lower(signer)
36843
+ );
36844
+ },
36845
+ /*pollFunc:*/ nativeModule()
36846
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
36847
+ /*cancelFunc:*/ nativeModule()
36848
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
36849
+ /*completeFunc:*/ nativeModule()
36850
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
36851
+ /*freeFunc:*/ nativeModule()
36852
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
36853
+ /*liftFunc:*/ FfiConverterTypeUnilateralExitResponse.lift.bind(
36854
+ FfiConverterTypeUnilateralExitResponse
36855
+ ),
36856
+ /*liftString:*/ FfiConverterString.lift,
36857
+ /*asyncOpts:*/ asyncOpts_,
36858
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
36859
+ FfiConverterTypeSdkError
36860
+ )
36861
+ );
36862
+ } catch (__error: any) {
36863
+ if (uniffiIsDebug && __error instanceof Error) {
36864
+ __error.stack = __stack;
36865
+ }
36866
+ throw __error;
36867
+ }
36868
+ }
36869
+
34645
36870
  /**
34646
36871
  * Unregisters a previously registered webhook.
34647
36872
  *
@@ -34867,6 +37092,233 @@ const FfiConverterTypeBreezSdk = new FfiConverterObject(
34867
37092
  uniffiTypeBreezSdkObjectFactory
34868
37093
  );
34869
37094
 
37095
+ /**
37096
+ * Signer for external UTXO inputs in CPFP fee-bumping transactions.
37097
+ *
37098
+ * Signs the non-finalized inputs of a PSBT (serialized as bytes) and returns the
37099
+ * signed PSBT (also serialized as bytes).
37100
+ */
37101
+ export interface CpfpSigner {
37102
+ signPsbt(
37103
+ psbtBytes: ArrayBuffer,
37104
+ asyncOpts_?: { signal: AbortSignal }
37105
+ ): /*throws*/ Promise<ArrayBuffer>;
37106
+ }
37107
+
37108
+ /**
37109
+ * Signer for external UTXO inputs in CPFP fee-bumping transactions.
37110
+ *
37111
+ * Signs the non-finalized inputs of a PSBT (serialized as bytes) and returns the
37112
+ * signed PSBT (also serialized as bytes).
37113
+ */
37114
+ export class CpfpSignerImpl extends UniffiAbstractObject implements CpfpSigner {
37115
+ readonly [uniffiTypeNameSymbol] = 'CpfpSignerImpl';
37116
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
37117
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
37118
+ // No primary constructor declared for this class.
37119
+ private constructor(pointer: UnsafeMutableRawPointer) {
37120
+ super();
37121
+ this[pointerLiteralSymbol] = pointer;
37122
+ this[destructorGuardSymbol] =
37123
+ uniffiTypeCpfpSignerImplObjectFactory.bless(pointer);
37124
+ }
37125
+
37126
+ public async signPsbt(
37127
+ psbtBytes: ArrayBuffer,
37128
+ asyncOpts_?: { signal: AbortSignal }
37129
+ ): Promise<ArrayBuffer> /*throws*/ {
37130
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
37131
+ try {
37132
+ return await uniffiRustCallAsync(
37133
+ /*rustCaller:*/ uniffiCaller,
37134
+ /*rustFutureFunc:*/ () => {
37135
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_cpfpsigner_sign_psbt(
37136
+ uniffiTypeCpfpSignerImplObjectFactory.clonePointer(this),
37137
+ FfiConverterArrayBuffer.lower(psbtBytes)
37138
+ );
37139
+ },
37140
+ /*pollFunc:*/ nativeModule()
37141
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
37142
+ /*cancelFunc:*/ nativeModule()
37143
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
37144
+ /*completeFunc:*/ nativeModule()
37145
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
37146
+ /*freeFunc:*/ nativeModule()
37147
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
37148
+ /*liftFunc:*/ FfiConverterArrayBuffer.lift.bind(
37149
+ FfiConverterArrayBuffer
37150
+ ),
37151
+ /*liftString:*/ FfiConverterString.lift,
37152
+ /*asyncOpts:*/ asyncOpts_,
37153
+ /*errorHandler:*/ FfiConverterTypeSignerError.lift.bind(
37154
+ FfiConverterTypeSignerError
37155
+ )
37156
+ );
37157
+ } catch (__error: any) {
37158
+ if (uniffiIsDebug && __error instanceof Error) {
37159
+ __error.stack = __stack;
37160
+ }
37161
+ throw __error;
37162
+ }
37163
+ }
37164
+
37165
+ /**
37166
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
37167
+ */
37168
+ uniffiDestroy(): void {
37169
+ const ptr = (this as any)[destructorGuardSymbol];
37170
+ if (ptr !== undefined) {
37171
+ const pointer = uniffiTypeCpfpSignerImplObjectFactory.pointer(this);
37172
+ uniffiTypeCpfpSignerImplObjectFactory.freePointer(pointer);
37173
+ uniffiTypeCpfpSignerImplObjectFactory.unbless(ptr);
37174
+ delete (this as any)[destructorGuardSymbol];
37175
+ }
37176
+ }
37177
+
37178
+ static instanceOf(obj: any): obj is CpfpSignerImpl {
37179
+ return uniffiTypeCpfpSignerImplObjectFactory.isConcreteType(obj);
37180
+ }
37181
+ }
37182
+
37183
+ const uniffiTypeCpfpSignerImplObjectFactory: UniffiObjectFactory<CpfpSigner> =
37184
+ (() => {
37185
+ return {
37186
+ create(pointer: UnsafeMutableRawPointer): CpfpSigner {
37187
+ const instance = Object.create(CpfpSignerImpl.prototype);
37188
+ instance[pointerLiteralSymbol] = pointer;
37189
+ instance[destructorGuardSymbol] = this.bless(pointer);
37190
+ instance[uniffiTypeNameSymbol] = 'CpfpSignerImpl';
37191
+ return instance;
37192
+ },
37193
+
37194
+ bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr {
37195
+ return uniffiCaller.rustCall(
37196
+ /*caller:*/ (status) =>
37197
+ nativeModule().ubrn_uniffi_internal_fn_method_cpfpsigner_ffi__bless_pointer(
37198
+ p,
37199
+ status
37200
+ ),
37201
+ /*liftString:*/ FfiConverterString.lift
37202
+ );
37203
+ },
37204
+
37205
+ unbless(ptr: UniffiRustArcPtr) {
37206
+ ptr.markDestroyed();
37207
+ },
37208
+
37209
+ pointer(obj: CpfpSigner): UnsafeMutableRawPointer {
37210
+ if ((obj as any)[destructorGuardSymbol] === undefined) {
37211
+ throw new UniffiInternalError.UnexpectedNullPointer();
37212
+ }
37213
+ return (obj as any)[pointerLiteralSymbol];
37214
+ },
37215
+
37216
+ clonePointer(obj: CpfpSigner): UnsafeMutableRawPointer {
37217
+ const pointer = this.pointer(obj);
37218
+ return uniffiCaller.rustCall(
37219
+ /*caller:*/ (callStatus) =>
37220
+ nativeModule().ubrn_uniffi_breez_sdk_spark_fn_clone_cpfpsigner(
37221
+ pointer,
37222
+ callStatus
37223
+ ),
37224
+ /*liftString:*/ FfiConverterString.lift
37225
+ );
37226
+ },
37227
+
37228
+ freePointer(pointer: UnsafeMutableRawPointer): void {
37229
+ uniffiCaller.rustCall(
37230
+ /*caller:*/ (callStatus) =>
37231
+ nativeModule().ubrn_uniffi_breez_sdk_spark_fn_free_cpfpsigner(
37232
+ pointer,
37233
+ callStatus
37234
+ ),
37235
+ /*liftString:*/ FfiConverterString.lift
37236
+ );
37237
+ },
37238
+
37239
+ isConcreteType(obj: any): obj is CpfpSigner {
37240
+ return (
37241
+ obj[destructorGuardSymbol] &&
37242
+ obj[uniffiTypeNameSymbol] === 'CpfpSignerImpl'
37243
+ );
37244
+ },
37245
+ };
37246
+ })();
37247
+ // FfiConverter for CpfpSigner
37248
+ const FfiConverterTypeCpfpSigner = new FfiConverterObjectWithCallbacks(
37249
+ uniffiTypeCpfpSignerImplObjectFactory
37250
+ );
37251
+
37252
+ // Add a vtavble for the callbacks that go in CpfpSigner.
37253
+
37254
+ // Put the implementation in a struct so we don't pollute the top-level namespace
37255
+ const uniffiCallbackInterfaceCpfpSigner: {
37256
+ vtable: UniffiVTableCallbackInterfaceCpfpSigner;
37257
+ register: () => void;
37258
+ } = {
37259
+ // Create the VTable using a series of closures.
37260
+ // ts automatically converts these into C callback functions.
37261
+ vtable: {
37262
+ signPsbt: (
37263
+ uniffiHandle: bigint,
37264
+ psbtBytes: Uint8Array,
37265
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
37266
+ uniffiCallbackData: bigint
37267
+ ) => {
37268
+ const uniffiMakeCall = async (
37269
+ signal: AbortSignal
37270
+ ): Promise<ArrayBuffer> => {
37271
+ const jsCallback = FfiConverterTypeCpfpSigner.lift(uniffiHandle);
37272
+ return await jsCallback.signPsbt(
37273
+ FfiConverterArrayBuffer.lift(psbtBytes),
37274
+ { signal }
37275
+ );
37276
+ };
37277
+ const uniffiHandleSuccess = (returnValue: ArrayBuffer) => {
37278
+ uniffiFutureCallback.call(
37279
+ uniffiFutureCallback,
37280
+ uniffiCallbackData,
37281
+ /* UniffiForeignFutureStructRustBuffer */ {
37282
+ returnValue: FfiConverterArrayBuffer.lower(returnValue),
37283
+ callStatus: uniffiCaller.createCallStatus(),
37284
+ }
37285
+ );
37286
+ };
37287
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
37288
+ uniffiFutureCallback.call(
37289
+ uniffiFutureCallback,
37290
+ uniffiCallbackData,
37291
+ /* UniffiForeignFutureStructRustBuffer */ {
37292
+ returnValue: /*empty*/ new Uint8Array(0),
37293
+ // TODO create callstatus with error.
37294
+ callStatus: uniffiCaller.createErrorStatus(code, errorBuf),
37295
+ }
37296
+ );
37297
+ };
37298
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
37299
+ /*makeCall:*/ uniffiMakeCall,
37300
+ /*handleSuccess:*/ uniffiHandleSuccess,
37301
+ /*handleError:*/ uniffiHandleError,
37302
+ /*isErrorType:*/ SignerError.instanceOf,
37303
+ /*lowerError:*/ FfiConverterTypeSignerError.lower.bind(
37304
+ FfiConverterTypeSignerError
37305
+ ),
37306
+ /*lowerString:*/ FfiConverterString.lower
37307
+ );
37308
+ return uniffiForeignFuture;
37309
+ },
37310
+ uniffiFree: (uniffiHandle: UniffiHandle): void => {
37311
+ // CpfpSigner: this will throw a stale handle error if the handle isn't found.
37312
+ FfiConverterTypeCpfpSigner.drop(uniffiHandle);
37313
+ },
37314
+ },
37315
+ register: () => {
37316
+ nativeModule().ubrn_uniffi_breez_sdk_spark_fn_init_callback_vtable_cpfpsigner(
37317
+ uniffiCallbackInterfaceCpfpSigner.vtable
37318
+ );
37319
+ },
37320
+ };
37321
+
34870
37322
  /**
34871
37323
  * External signer trait that can be implemented by users and passed to the SDK.
34872
37324
  *
@@ -36524,6 +38976,15 @@ export interface ExternalSparkSigner {
36524
38976
  message: ArrayBuffer,
36525
38977
  asyncOpts_?: { signal: AbortSignal }
36526
38978
  ): /*throws*/ Promise<EcdsaSignatureBytes>;
38979
+ /**
38980
+ * Schnorr-sign `sighash` to spend a tree leaf's P2TR refund output as a
38981
+ * BIP341 key-path spend (empty script tree).
38982
+ */
38983
+ signLeafRefundSpend(
38984
+ leafId: ExternalTreeNodeId,
38985
+ sighash: ArrayBuffer,
38986
+ asyncOpts_?: { signal: AbortSignal }
38987
+ ): /*throws*/ Promise<SchnorrSignatureBytes>;
36527
38988
  /**
36528
38989
  * Produce FROST shares for a batch of jobs.
36529
38990
  */
@@ -36842,6 +39303,51 @@ export class ExternalSparkSignerImpl
36842
39303
  }
36843
39304
  }
36844
39305
 
39306
+ /**
39307
+ * Schnorr-sign `sighash` to spend a tree leaf's P2TR refund output as a
39308
+ * BIP341 key-path spend (empty script tree).
39309
+ */
39310
+ public async signLeafRefundSpend(
39311
+ leafId: ExternalTreeNodeId,
39312
+ sighash: ArrayBuffer,
39313
+ asyncOpts_?: { signal: AbortSignal }
39314
+ ): Promise<SchnorrSignatureBytes> /*throws*/ {
39315
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
39316
+ try {
39317
+ return await uniffiRustCallAsync(
39318
+ /*rustCaller:*/ uniffiCaller,
39319
+ /*rustFutureFunc:*/ () => {
39320
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsparksigner_sign_leaf_refund_spend(
39321
+ uniffiTypeExternalSparkSignerImplObjectFactory.clonePointer(this),
39322
+ FfiConverterTypeExternalTreeNodeId.lower(leafId),
39323
+ FfiConverterArrayBuffer.lower(sighash)
39324
+ );
39325
+ },
39326
+ /*pollFunc:*/ nativeModule()
39327
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
39328
+ /*cancelFunc:*/ nativeModule()
39329
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
39330
+ /*completeFunc:*/ nativeModule()
39331
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
39332
+ /*freeFunc:*/ nativeModule()
39333
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
39334
+ /*liftFunc:*/ FfiConverterTypeSchnorrSignatureBytes.lift.bind(
39335
+ FfiConverterTypeSchnorrSignatureBytes
39336
+ ),
39337
+ /*liftString:*/ FfiConverterString.lift,
39338
+ /*asyncOpts:*/ asyncOpts_,
39339
+ /*errorHandler:*/ FfiConverterTypeSignerError.lift.bind(
39340
+ FfiConverterTypeSignerError
39341
+ )
39342
+ );
39343
+ } catch (__error: any) {
39344
+ if (uniffiIsDebug && __error instanceof Error) {
39345
+ __error.stack = __stack;
39346
+ }
39347
+ throw __error;
39348
+ }
39349
+ }
39350
+
36845
39351
  /**
36846
39352
  * Produce FROST shares for a batch of jobs.
36847
39353
  */
@@ -37632,6 +40138,58 @@ const uniffiCallbackInterfaceExternalSparkSigner: {
37632
40138
  );
37633
40139
  return uniffiForeignFuture;
37634
40140
  },
40141
+ signLeafRefundSpend: (
40142
+ uniffiHandle: bigint,
40143
+ leafId: Uint8Array,
40144
+ sighash: Uint8Array,
40145
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
40146
+ uniffiCallbackData: bigint
40147
+ ) => {
40148
+ const uniffiMakeCall = async (
40149
+ signal: AbortSignal
40150
+ ): Promise<SchnorrSignatureBytes> => {
40151
+ const jsCallback =
40152
+ FfiConverterTypeExternalSparkSigner.lift(uniffiHandle);
40153
+ return await jsCallback.signLeafRefundSpend(
40154
+ FfiConverterTypeExternalTreeNodeId.lift(leafId),
40155
+ FfiConverterArrayBuffer.lift(sighash),
40156
+ { signal }
40157
+ );
40158
+ };
40159
+ const uniffiHandleSuccess = (returnValue: SchnorrSignatureBytes) => {
40160
+ uniffiFutureCallback.call(
40161
+ uniffiFutureCallback,
40162
+ uniffiCallbackData,
40163
+ /* UniffiForeignFutureStructRustBuffer */ {
40164
+ returnValue:
40165
+ FfiConverterTypeSchnorrSignatureBytes.lower(returnValue),
40166
+ callStatus: uniffiCaller.createCallStatus(),
40167
+ }
40168
+ );
40169
+ };
40170
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
40171
+ uniffiFutureCallback.call(
40172
+ uniffiFutureCallback,
40173
+ uniffiCallbackData,
40174
+ /* UniffiForeignFutureStructRustBuffer */ {
40175
+ returnValue: /*empty*/ new Uint8Array(0),
40176
+ // TODO create callstatus with error.
40177
+ callStatus: uniffiCaller.createErrorStatus(code, errorBuf),
40178
+ }
40179
+ );
40180
+ };
40181
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
40182
+ /*makeCall:*/ uniffiMakeCall,
40183
+ /*handleSuccess:*/ uniffiHandleSuccess,
40184
+ /*handleError:*/ uniffiHandleError,
40185
+ /*isErrorType:*/ SignerError.instanceOf,
40186
+ /*lowerError:*/ FfiConverterTypeSignerError.lower.bind(
40187
+ FfiConverterTypeSignerError
40188
+ ),
40189
+ /*lowerString:*/ FfiConverterString.lower
40190
+ );
40191
+ return uniffiForeignFuture;
40192
+ },
37635
40193
  signFrost: (
37636
40194
  uniffiHandle: bigint,
37637
40195
  jobs: Uint8Array,
@@ -45969,6 +48527,11 @@ const FfiConverterArrayTypePaymentIdUpdate = new FfiConverterArray(
45969
48527
  FfiConverterTypePaymentIdUpdate
45970
48528
  );
45971
48529
 
48530
+ // FfiConverter for Array<PerBranchFunding>
48531
+ const FfiConverterArrayTypePerBranchFunding = new FfiConverterArray(
48532
+ FfiConverterTypePerBranchFunding
48533
+ );
48534
+
45972
48535
  // FfiConverter for Array<ProvisionalPayment>
45973
48536
  const FfiConverterArrayTypeProvisionalPayment = new FfiConverterArray(
45974
48537
  FfiConverterTypeProvisionalPayment
@@ -46007,6 +48570,16 @@ const FfiConverterArrayTypeTokenMetadata = new FfiConverterArray(
46007
48570
  FfiConverterTypeTokenMetadata
46008
48571
  );
46009
48572
 
48573
+ // FfiConverter for Array<UnilateralExitLeaf>
48574
+ const FfiConverterArrayTypeUnilateralExitLeaf = new FfiConverterArray(
48575
+ FfiConverterTypeUnilateralExitLeaf
48576
+ );
48577
+
48578
+ // FfiConverter for Array<UnilateralExitTransaction>
48579
+ const FfiConverterArrayTypeUnilateralExitTransaction = new FfiConverterArray(
48580
+ FfiConverterTypeUnilateralExitTransaction
48581
+ );
48582
+
46010
48583
  // FfiConverter for Array<Utxo>
46011
48584
  const FfiConverterArrayTypeUtxo = new FfiConverterArray(FfiConverterTypeUtxo);
46012
48585
 
@@ -46101,6 +48674,10 @@ const FfiConverterOptionalTypeSendPaymentOptions = new FfiConverterOptional(
46101
48674
  FfiConverterTypeSendPaymentOptions
46102
48675
  );
46103
48676
 
48677
+ // FfiConverter for SparkMasterIdentityPublicKey | undefined
48678
+ const FfiConverterOptionalTypeSparkMasterIdentityPublicKey =
48679
+ new FfiConverterOptional(FfiConverterTypeSparkMasterIdentityPublicKey);
48680
+
46104
48681
  // FfiConverter for StableBalanceActiveLabel | undefined
46105
48682
  const FfiConverterOptionalTypeStableBalanceActiveLabel =
46106
48683
  new FfiConverterOptional(FfiConverterTypeStableBalanceActiveLabel);
@@ -46139,6 +48716,11 @@ const FfiConverterOptionalArrayArrayBuffer = new FfiConverterOptional(
46139
48716
  const FfiConverterOptionalArrayTypeExternalInputParser =
46140
48717
  new FfiConverterOptional(FfiConverterArrayTypeExternalInputParser);
46141
48718
 
48719
+ // FfiConverter for Array<CpfpInput>
48720
+ const FfiConverterArrayTypeCpfpInput = new FfiConverterArray(
48721
+ FfiConverterTypeCpfpInput
48722
+ );
48723
+
46142
48724
  // FfiConverter for Array<InputType>
46143
48725
  const FfiConverterArrayTypeInputType = new FfiConverterArray(
46144
48726
  FfiConverterTypeInputType
@@ -46343,6 +48925,14 @@ function uniffiEnsureInitialized() {
46343
48925
  'uniffi_breez_sdk_spark_checksum_func_new_shared_sdk_context'
46344
48926
  );
46345
48927
  }
48928
+ if (
48929
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_single_key_cpfp_signer() !==
48930
+ 28762
48931
+ ) {
48932
+ throw new UniffiInternalError.ApiChecksumMismatch(
48933
+ 'uniffi_breez_sdk_spark_checksum_func_single_key_cpfp_signer'
48934
+ );
48935
+ }
46346
48936
  if (
46347
48937
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos() !==
46348
48938
  20959
@@ -46351,9 +48941,17 @@ function uniffiEnsureInitialized() {
46351
48941
  'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos'
46352
48942
  );
46353
48943
  }
48944
+ if (
48945
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_txos() !==
48946
+ 10702
48947
+ ) {
48948
+ throw new UniffiInternalError.ApiChecksumMismatch(
48949
+ 'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_txos'
48950
+ );
48951
+ }
46354
48952
  if (
46355
48953
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status() !==
46356
- 23018
48954
+ 53546
46357
48955
  ) {
46358
48956
  throw new UniffiInternalError.ApiChecksumMismatch(
46359
48957
  'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status'
@@ -46361,15 +48959,23 @@ function uniffiEnsureInitialized() {
46361
48959
  }
46362
48960
  if (
46363
48961
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_hex() !==
46364
- 59376
48962
+ 16866
46365
48963
  ) {
46366
48964
  throw new UniffiInternalError.ApiChecksumMismatch(
46367
48965
  'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_hex'
46368
48966
  );
46369
48967
  }
48968
+ if (
48969
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_outspend() !==
48970
+ 42521
48971
+ ) {
48972
+ throw new UniffiInternalError.ApiChecksumMismatch(
48973
+ 'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_outspend'
48974
+ );
48975
+ }
46370
48976
  if (
46371
48977
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_broadcast_transaction() !==
46372
- 65179
48978
+ 13500
46373
48979
  ) {
46374
48980
  throw new UniffiInternalError.ApiChecksumMismatch(
46375
48981
  'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_broadcast_transaction'
@@ -46377,7 +48983,7 @@ function uniffiEnsureInitialized() {
46377
48983
  }
46378
48984
  if (
46379
48985
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_recommended_fees() !==
46380
- 43230
48986
+ 50885
46381
48987
  ) {
46382
48988
  throw new UniffiInternalError.ApiChecksumMismatch(
46383
48989
  'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_recommended_fees'
@@ -46663,6 +49269,14 @@ function uniffiEnsureInitialized() {
46663
49269
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_payment'
46664
49270
  );
46665
49271
  }
49272
+ if (
49273
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_unilateral_exit() !==
49274
+ 36492
49275
+ ) {
49276
+ throw new UniffiInternalError.ApiChecksumMismatch(
49277
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_unilateral_exit'
49278
+ );
49279
+ }
46666
49280
  if (
46667
49281
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_publish_signed_lnurl_pay_package() !==
46668
49282
  48698
@@ -46705,7 +49319,7 @@ function uniffiEnsureInitialized() {
46705
49319
  }
46706
49320
  if (
46707
49321
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_pending_conversions() !==
46708
- 24173
49322
+ 11342
46709
49323
  ) {
46710
49324
  throw new UniffiInternalError.ApiChecksumMismatch(
46711
49325
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_pending_conversions'
@@ -46759,6 +49373,14 @@ function uniffiEnsureInitialized() {
46759
49373
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet'
46760
49374
  );
46761
49375
  }
49376
+ if (
49377
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_unilateral_exit() !==
49378
+ 23033
49379
+ ) {
49380
+ throw new UniffiInternalError.ApiChecksumMismatch(
49381
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_unilateral_exit'
49382
+ );
49383
+ }
46762
49384
  if (
46763
49385
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_unregister_webhook() !==
46764
49386
  34100
@@ -46783,6 +49405,14 @@ function uniffiEnsureInitialized() {
46783
49405
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_update_user_settings'
46784
49406
  );
46785
49407
  }
49408
+ if (
49409
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_cpfpsigner_sign_psbt() !==
49410
+ 20736
49411
+ ) {
49412
+ throw new UniffiInternalError.ApiChecksumMismatch(
49413
+ 'uniffi_breez_sdk_spark_checksum_method_cpfpsigner_sign_psbt'
49414
+ );
49415
+ }
46786
49416
  if (
46787
49417
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalbreezsigner_derive_public_key() !==
46788
49418
  26700
@@ -46919,9 +49549,17 @@ function uniffiEnsureInitialized() {
46919
49549
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_message'
46920
49550
  );
46921
49551
  }
49552
+ if (
49553
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_leaf_refund_spend() !==
49554
+ 62629
49555
+ ) {
49556
+ throw new UniffiInternalError.ApiChecksumMismatch(
49557
+ 'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_leaf_refund_spend'
49558
+ );
49559
+ }
46922
49560
  if (
46923
49561
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_frost() !==
46924
- 41995
49562
+ 58732
46925
49563
  ) {
46926
49564
  throw new UniffiInternalError.ApiChecksumMismatch(
46927
49565
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_frost'
@@ -46929,7 +49567,7 @@ function uniffiEnsureInitialized() {
46929
49567
  }
46930
49568
  if (
46931
49569
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_transfer() !==
46932
- 7663
49570
+ 29829
46933
49571
  ) {
46934
49572
  throw new UniffiInternalError.ApiChecksumMismatch(
46935
49573
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_transfer'
@@ -46937,7 +49575,7 @@ function uniffiEnsureInitialized() {
46937
49575
  }
46938
49576
  if (
46939
49577
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_claim() !==
46940
- 40463
49578
+ 17684
46941
49579
  ) {
46942
49580
  throw new UniffiInternalError.ApiChecksumMismatch(
46943
49581
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_claim'
@@ -46945,7 +49583,7 @@ function uniffiEnsureInitialized() {
46945
49583
  }
46946
49584
  if (
46947
49585
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_lightning_receive() !==
46948
- 22362
49586
+ 25306
46949
49587
  ) {
46950
49588
  throw new UniffiInternalError.ApiChecksumMismatch(
46951
49589
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_lightning_receive'
@@ -46953,7 +49591,7 @@ function uniffiEnsureInitialized() {
46953
49591
  }
46954
49592
  if (
46955
49593
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_static_deposit() !==
46956
- 44945
49594
+ 3348
46957
49595
  ) {
46958
49596
  throw new UniffiInternalError.ApiChecksumMismatch(
46959
49597
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_static_deposit'
@@ -46961,7 +49599,7 @@ function uniffiEnsureInitialized() {
46961
49599
  }
46962
49600
  if (
46963
49601
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_start_static_deposit_refund() !==
46964
- 15575
49602
+ 22709
46965
49603
  ) {
46966
49604
  throw new UniffiInternalError.ApiChecksumMismatch(
46967
49605
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_start_static_deposit_refund'
@@ -46969,7 +49607,7 @@ function uniffiEnsureInitialized() {
46969
49607
  }
46970
49608
  if (
46971
49609
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_static_deposit_refund() !==
46972
- 3082
49610
+ 52719
46973
49611
  ) {
46974
49612
  throw new UniffiInternalError.ApiChecksumMismatch(
46975
49613
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_static_deposit_refund'
@@ -46977,7 +49615,7 @@ function uniffiEnsureInitialized() {
46977
49615
  }
46978
49616
  if (
46979
49617
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_spark_invoice() !==
46980
- 33
49618
+ 39737
46981
49619
  ) {
46982
49620
  throw new UniffiInternalError.ApiChecksumMismatch(
46983
49621
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_spark_invoice'
@@ -46985,7 +49623,7 @@ function uniffiEnsureInitialized() {
46985
49623
  }
46986
49624
  if (
46987
49625
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_token_transaction() !==
46988
- 33122
49626
+ 12801
46989
49627
  ) {
46990
49628
  throw new UniffiInternalError.ApiChecksumMismatch(
46991
49629
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_token_transaction'
@@ -46993,7 +49631,7 @@ function uniffiEnsureInitialized() {
46993
49631
  }
46994
49632
  if (
46995
49633
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_static_deposit_claim() !==
46996
- 14601
49634
+ 53174
46997
49635
  ) {
46998
49636
  throw new UniffiInternalError.ApiChecksumMismatch(
46999
49637
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_static_deposit_claim'
@@ -47611,6 +50249,7 @@ function uniffiEnsureInitialized() {
47611
50249
  uniffiCallbackInterfaceEventListener.register();
47612
50250
  uniffiCallbackInterfaceLogger.register();
47613
50251
  uniffiCallbackInterfaceBitcoinChainService.register();
50252
+ uniffiCallbackInterfaceCpfpSigner.register();
47614
50253
  uniffiCallbackInterfaceExternalBreezSigner.register();
47615
50254
  uniffiCallbackInterfaceExternalSigningSigner.register();
47616
50255
  uniffiCallbackInterfaceExternalSparkSigner.register();
@@ -47667,6 +50306,7 @@ export default Object.freeze({
47667
50306
  FfiConverterTypeClaimHtlcPaymentResponse,
47668
50307
  FfiConverterTypeClaimTransferRequest,
47669
50308
  FfiConverterTypeConfig,
50309
+ FfiConverterTypeConfirmationStatus,
47670
50310
  FfiConverterTypeConnectRequest,
47671
50311
  FfiConverterTypeConnectWithPasskeyRequest,
47672
50312
  FfiConverterTypeConnectWithPasskeyResponse,
@@ -47686,6 +50326,9 @@ export default Object.freeze({
47686
50326
  FfiConverterTypeConversionSide,
47687
50327
  FfiConverterTypeConversionStatus,
47688
50328
  FfiConverterTypeConversionType,
50329
+ FfiConverterTypeCpfpFundingKind,
50330
+ FfiConverterTypeCpfpInput,
50331
+ FfiConverterTypeCpfpSigner,
47689
50332
  FfiConverterTypeCreateIssuerTokenRequest,
47690
50333
  FfiConverterTypeCredentials,
47691
50334
  FfiConverterTypeCrossChainAddressDetails,
@@ -47704,6 +50347,7 @@ export default Object.freeze({
47704
50347
  FfiConverterTypeDomainAssociation,
47705
50348
  FfiConverterTypeEcdsaSignatureBytes,
47706
50349
  FfiConverterTypeErrorKind,
50350
+ FfiConverterTypeExitLeafSelection,
47707
50351
  FfiConverterTypeExternalBreezSigner,
47708
50352
  FfiConverterTypeExternalClaimLeafInput,
47709
50353
  FfiConverterTypeExternalFrostCommitments,
@@ -47800,6 +50444,7 @@ export default Object.freeze({
47800
50444
  FfiConverterTypeOptimizeLeavesRequest,
47801
50445
  FfiConverterTypeOptimizeLeavesResponse,
47802
50446
  FfiConverterTypeOutgoingChange,
50447
+ FfiConverterTypeOutspend,
47803
50448
  FfiConverterTypePasskeyAvailability,
47804
50449
  FfiConverterTypePasskeyClient,
47805
50450
  FfiConverterTypePasskeyConfig,
@@ -47819,10 +50464,13 @@ export default Object.freeze({
47819
50464
  FfiConverterTypePaymentRequestSource,
47820
50465
  FfiConverterTypePaymentStatus,
47821
50466
  FfiConverterTypePaymentType,
50467
+ FfiConverterTypePerBranchFunding,
47822
50468
  FfiConverterTypePrepareLnurlPayRequest,
47823
50469
  FfiConverterTypePrepareLnurlPayResponse,
47824
50470
  FfiConverterTypePrepareSendPaymentRequest,
47825
50471
  FfiConverterTypePrepareSendPaymentResponse,
50472
+ FfiConverterTypePrepareUnilateralExitRequest,
50473
+ FfiConverterTypePrepareUnilateralExitResponse,
47826
50474
  FfiConverterTypePrfProvider,
47827
50475
  FfiConverterTypePrfProviderError,
47828
50476
  FfiConverterTypeProvisionalPayment,
@@ -47844,6 +50492,7 @@ export default Object.freeze({
47844
50492
  FfiConverterTypeRecoverableEcdsaSignatureBytes,
47845
50493
  FfiConverterTypeRefundDepositRequest,
47846
50494
  FfiConverterTypeRefundDepositResponse,
50495
+ FfiConverterTypeRefundPendingConversionsResponse,
47847
50496
  FfiConverterTypeRegisterLightningAddressRequest,
47848
50497
  FfiConverterTypeRegisterRequest,
47849
50498
  FfiConverterTypeRegisterResponse,
@@ -47889,6 +50538,7 @@ export default Object.freeze({
47889
50538
  FfiConverterTypeSparkHtlcStatus,
47890
50539
  FfiConverterTypeSparkInvoiceDetails,
47891
50540
  FfiConverterTypeSparkInvoicePaymentDetails,
50541
+ FfiConverterTypeSparkMasterIdentityPublicKey,
47892
50542
  FfiConverterTypeSparkSigningOperator,
47893
50543
  FfiConverterTypeSparkSspConfig,
47894
50544
  FfiConverterTypeSparkStatus,
@@ -47919,6 +50569,11 @@ export default Object.freeze({
47919
50569
  FfiConverterTypeTxStatus,
47920
50570
  FfiConverterTypeUnfreezeIssuerTokenRequest,
47921
50571
  FfiConverterTypeUnfreezeIssuerTokenResponse,
50572
+ FfiConverterTypeUnilateralExitLeaf,
50573
+ FfiConverterTypeUnilateralExitRequest,
50574
+ FfiConverterTypeUnilateralExitResponse,
50575
+ FfiConverterTypeUnilateralExitTransaction,
50576
+ FfiConverterTypeUnilateralExitTxKind,
47922
50577
  FfiConverterTypeUnregisterWebhookRequest,
47923
50578
  FfiConverterTypeUnsignedTransferPackage,
47924
50579
  FfiConverterTypeUnversionedRecordChange,