@breeztech/breez-sdk-spark-react-native 0.19.2 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/BreezSdkSparkReactNative.podspec +6 -0
  2. package/cpp/generated/breez_sdk_spark.cpp +1527 -125
  3. package/cpp/generated/breez_sdk_spark.hpp +84 -0
  4. package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
  5. package/lib/commonjs/generated/breez_sdk_spark.js +554 -62
  6. package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
  7. package/lib/commonjs/passkey-prf-provider.js +31 -11
  8. package/lib/commonjs/passkey-prf-provider.js.map +1 -1
  9. package/lib/module/generated/breez_sdk_spark-ffi.js.map +1 -1
  10. package/lib/module/generated/breez_sdk_spark.js +553 -61
  11. package/lib/module/generated/breez_sdk_spark.js.map +1 -1
  12. package/lib/module/passkey-prf-provider.js +31 -11
  13. package/lib/module/passkey-prf-provider.js.map +1 -1
  14. package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +56 -21
  15. package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
  16. package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts +2251 -144
  17. package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts.map +1 -1
  18. package/lib/typescript/commonjs/src/passkey-prf-provider.d.ts +24 -6
  19. package/lib/typescript/commonjs/src/passkey-prf-provider.d.ts.map +1 -1
  20. package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts +56 -21
  21. package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
  22. package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts +2251 -144
  23. package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts.map +1 -1
  24. package/lib/typescript/module/src/passkey-prf-provider.d.ts +24 -6
  25. package/lib/typescript/module/src/passkey-prf-provider.d.ts.map +1 -1
  26. package/package.json +4 -4
  27. package/plugin/build/index.d.ts +1 -1
  28. package/plugin/build/index.js +3 -1
  29. package/plugin/build/withAndroid.d.ts +1 -1
  30. package/plugin/build/withAndroid.js +1 -1
  31. package/plugin/build/withBinaryArtifacts.d.ts +1 -1
  32. package/plugin/build/withBinaryArtifacts.js +1 -1
  33. package/plugin/build/withIOS.d.ts +1 -1
  34. package/plugin/build/withIOS.js +1 -1
  35. package/scripts/post-ubrn.js +42 -0
  36. package/src/generated/breez_sdk_spark-ffi.ts +122 -19
  37. package/src/generated/breez_sdk_spark.ts +3999 -77
  38. package/src/passkey-prf-provider.ts +41 -12
@@ -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
@@ -1073,6 +1096,149 @@ const FfiConverterTypeAuthorizeTransferRequest = (() => {
1073
1096
  return new FFIConverter();
1074
1097
  })();
1075
1098
 
1099
+ /**
1100
+ * A single payee in a batch send.
1101
+ */
1102
+ export type BatchRecipient = {
1103
+ /**
1104
+ * Spark address or Spark invoice identifying the payee.
1105
+ */
1106
+ paymentRequest: string;
1107
+ /**
1108
+ * Amount to send, in the base units of the asset being sent. Required
1109
+ * unless `payment_request` is an invoice that carries its own amount.
1110
+ */
1111
+ amount: U128 | undefined;
1112
+ /**
1113
+ * Token to send. Unset means sats, which a batch cannot send yet, so a
1114
+ * plain address needs this set. An invoice that names a token does not.
1115
+ */
1116
+ tokenIdentifier: string | undefined;
1117
+ };
1118
+
1119
+ /**
1120
+ * Generated factory for {@link BatchRecipient} record objects.
1121
+ */
1122
+ export const BatchRecipient = (() => {
1123
+ const defaults = () => ({ amount: undefined, tokenIdentifier: undefined });
1124
+ const create = (() => {
1125
+ return uniffiCreateRecord<BatchRecipient, ReturnType<typeof defaults>>(
1126
+ defaults
1127
+ );
1128
+ })();
1129
+ return Object.freeze({
1130
+ /**
1131
+ * Create a frozen instance of {@link BatchRecipient}, with defaults specified
1132
+ * in Rust, in the {@link breez_sdk_spark} crate.
1133
+ */
1134
+ create,
1135
+
1136
+ /**
1137
+ * Create a frozen instance of {@link BatchRecipient}, with defaults specified
1138
+ * in Rust, in the {@link breez_sdk_spark} crate.
1139
+ */
1140
+ new: create,
1141
+
1142
+ /**
1143
+ * Defaults specified in the {@link breez_sdk_spark} crate.
1144
+ */
1145
+ defaults: () => Object.freeze(defaults()) as Partial<BatchRecipient>,
1146
+ });
1147
+ })();
1148
+
1149
+ const FfiConverterTypeBatchRecipient = (() => {
1150
+ type TypeName = BatchRecipient;
1151
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1152
+ read(from: RustBuffer): TypeName {
1153
+ return {
1154
+ paymentRequest: FfiConverterString.read(from),
1155
+ amount: FfiConverterOptionalTypeu128.read(from),
1156
+ tokenIdentifier: FfiConverterOptionalString.read(from),
1157
+ };
1158
+ }
1159
+ write(value: TypeName, into: RustBuffer): void {
1160
+ FfiConverterString.write(value.paymentRequest, into);
1161
+ FfiConverterOptionalTypeu128.write(value.amount, into);
1162
+ FfiConverterOptionalString.write(value.tokenIdentifier, into);
1163
+ }
1164
+ allocationSize(value: TypeName): number {
1165
+ return (
1166
+ FfiConverterString.allocationSize(value.paymentRequest) +
1167
+ FfiConverterOptionalTypeu128.allocationSize(value.amount) +
1168
+ FfiConverterOptionalString.allocationSize(value.tokenIdentifier)
1169
+ );
1170
+ }
1171
+ }
1172
+ return new FFIConverter();
1173
+ })();
1174
+
1175
+ /**
1176
+ * What a batch debits for one asset.
1177
+ */
1178
+ export type BatchTotal = {
1179
+ /**
1180
+ * The token debited. Unset means sats, which a batch cannot send yet.
1181
+ */
1182
+ tokenIdentifier: string | undefined;
1183
+ /**
1184
+ * Amount in the asset's base units.
1185
+ */
1186
+ amount: U128;
1187
+ };
1188
+
1189
+ /**
1190
+ * Generated factory for {@link BatchTotal} record objects.
1191
+ */
1192
+ export const BatchTotal = (() => {
1193
+ const defaults = () => ({});
1194
+ const create = (() => {
1195
+ return uniffiCreateRecord<BatchTotal, ReturnType<typeof defaults>>(
1196
+ defaults
1197
+ );
1198
+ })();
1199
+ return Object.freeze({
1200
+ /**
1201
+ * Create a frozen instance of {@link BatchTotal}, with defaults specified
1202
+ * in Rust, in the {@link breez_sdk_spark} crate.
1203
+ */
1204
+ create,
1205
+
1206
+ /**
1207
+ * Create a frozen instance of {@link BatchTotal}, with defaults specified
1208
+ * in Rust, in the {@link breez_sdk_spark} crate.
1209
+ */
1210
+ new: create,
1211
+
1212
+ /**
1213
+ * Defaults specified in the {@link breez_sdk_spark} crate.
1214
+ */
1215
+ defaults: () => Object.freeze(defaults()) as Partial<BatchTotal>,
1216
+ });
1217
+ })();
1218
+
1219
+ const FfiConverterTypeBatchTotal = (() => {
1220
+ type TypeName = BatchTotal;
1221
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1222
+ read(from: RustBuffer): TypeName {
1223
+ return {
1224
+ tokenIdentifier: FfiConverterOptionalString.read(from),
1225
+ amount: FfiConverterTypeu128.read(from),
1226
+ };
1227
+ }
1228
+ write(value: TypeName, into: RustBuffer): void {
1229
+ FfiConverterOptionalString.write(value.tokenIdentifier, into);
1230
+ FfiConverterTypeu128.write(value.amount, into);
1231
+ }
1232
+ allocationSize(value: TypeName): number {
1233
+ return (
1234
+ FfiConverterOptionalString.allocationSize(value.tokenIdentifier) +
1235
+ FfiConverterTypeu128.allocationSize(value.amount)
1236
+ );
1237
+ }
1238
+ }
1239
+ return new FFIConverter();
1240
+ })();
1241
+
1076
1242
  export type Bip21Details = {
1077
1243
  amountSat: /*u64*/ bigint | undefined;
1078
1244
  assetId: string | undefined;
@@ -1940,6 +2106,65 @@ const FfiConverterTypeBolt12OfferDetails = (() => {
1940
2106
  return new FFIConverter();
1941
2107
  })();
1942
2108
 
2109
+ export type BuildUnsignedBatchPackageRequest = {
2110
+ prepareResponse: PrepareSendBatchResponse;
2111
+ };
2112
+
2113
+ /**
2114
+ * Generated factory for {@link BuildUnsignedBatchPackageRequest} record objects.
2115
+ */
2116
+ export const BuildUnsignedBatchPackageRequest = (() => {
2117
+ const defaults = () => ({});
2118
+ const create = (() => {
2119
+ return uniffiCreateRecord<
2120
+ BuildUnsignedBatchPackageRequest,
2121
+ ReturnType<typeof defaults>
2122
+ >(defaults);
2123
+ })();
2124
+ return Object.freeze({
2125
+ /**
2126
+ * Create a frozen instance of {@link BuildUnsignedBatchPackageRequest}, with defaults specified
2127
+ * in Rust, in the {@link breez_sdk_spark} crate.
2128
+ */
2129
+ create,
2130
+
2131
+ /**
2132
+ * Create a frozen instance of {@link BuildUnsignedBatchPackageRequest}, with defaults specified
2133
+ * in Rust, in the {@link breez_sdk_spark} crate.
2134
+ */
2135
+ new: create,
2136
+
2137
+ /**
2138
+ * Defaults specified in the {@link breez_sdk_spark} crate.
2139
+ */
2140
+ defaults: () =>
2141
+ Object.freeze(defaults()) as Partial<BuildUnsignedBatchPackageRequest>,
2142
+ });
2143
+ })();
2144
+
2145
+ const FfiConverterTypeBuildUnsignedBatchPackageRequest = (() => {
2146
+ type TypeName = BuildUnsignedBatchPackageRequest;
2147
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
2148
+ read(from: RustBuffer): TypeName {
2149
+ return {
2150
+ prepareResponse: FfiConverterTypePrepareSendBatchResponse.read(from),
2151
+ };
2152
+ }
2153
+ write(value: TypeName, into: RustBuffer): void {
2154
+ FfiConverterTypePrepareSendBatchResponse.write(
2155
+ value.prepareResponse,
2156
+ into
2157
+ );
2158
+ }
2159
+ allocationSize(value: TypeName): number {
2160
+ return FfiConverterTypePrepareSendBatchResponse.allocationSize(
2161
+ value.prepareResponse
2162
+ );
2163
+ }
2164
+ }
2165
+ return new FFIConverter();
2166
+ })();
2167
+
1943
2168
  export type BuildUnsignedLnurlPayPackageRequest = {
1944
2169
  prepareResponse: PrepareLnurlPayResponse;
1945
2170
  };
@@ -3963,6 +4188,77 @@ const FfiConverterTypeCreateIssuerTokenRequest = (() => {
3963
4188
  return new FFIConverter();
3964
4189
  })();
3965
4190
 
4191
+ /**
4192
+ * A newly created credential, plus the PRF outputs when the platform
4193
+ * evaluated them during the create ceremony itself.
4194
+ *
4195
+ * `seeds` present means no assertion is needed: the caller skips the
4196
+ * second ceremony, and with it the window in which a credential exists
4197
+ * but is not yet resolvable. Absent means the platform returned no PRF
4198
+ * results at create (or dropped one of a pair), so the caller derives
4199
+ * through [`super::PrfProvider::derive_seeds`] as before.
4200
+ */
4201
+ export type CreatePasskeyOutput = {
4202
+ credential: PasskeyCredential;
4203
+ /**
4204
+ * One output per requested salt, in request order.
4205
+ */
4206
+ seeds: Array<ArrayBuffer> | undefined;
4207
+ };
4208
+
4209
+ /**
4210
+ * Generated factory for {@link CreatePasskeyOutput} record objects.
4211
+ */
4212
+ export const CreatePasskeyOutput = (() => {
4213
+ const defaults = () => ({});
4214
+ const create = (() => {
4215
+ return uniffiCreateRecord<CreatePasskeyOutput, ReturnType<typeof defaults>>(
4216
+ defaults
4217
+ );
4218
+ })();
4219
+ return Object.freeze({
4220
+ /**
4221
+ * Create a frozen instance of {@link CreatePasskeyOutput}, with defaults specified
4222
+ * in Rust, in the {@link breez_sdk_spark} crate.
4223
+ */
4224
+ create,
4225
+
4226
+ /**
4227
+ * Create a frozen instance of {@link CreatePasskeyOutput}, with defaults specified
4228
+ * in Rust, in the {@link breez_sdk_spark} crate.
4229
+ */
4230
+ new: create,
4231
+
4232
+ /**
4233
+ * Defaults specified in the {@link breez_sdk_spark} crate.
4234
+ */
4235
+ defaults: () => Object.freeze(defaults()) as Partial<CreatePasskeyOutput>,
4236
+ });
4237
+ })();
4238
+
4239
+ const FfiConverterTypeCreatePasskeyOutput = (() => {
4240
+ type TypeName = CreatePasskeyOutput;
4241
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
4242
+ read(from: RustBuffer): TypeName {
4243
+ return {
4244
+ credential: FfiConverterTypePasskeyCredential.read(from),
4245
+ seeds: FfiConverterOptionalArrayArrayBuffer.read(from),
4246
+ };
4247
+ }
4248
+ write(value: TypeName, into: RustBuffer): void {
4249
+ FfiConverterTypePasskeyCredential.write(value.credential, into);
4250
+ FfiConverterOptionalArrayArrayBuffer.write(value.seeds, into);
4251
+ }
4252
+ allocationSize(value: TypeName): number {
4253
+ return (
4254
+ FfiConverterTypePasskeyCredential.allocationSize(value.credential) +
4255
+ FfiConverterOptionalArrayArrayBuffer.allocationSize(value.seeds)
4256
+ );
4257
+ }
4258
+ }
4259
+ return new FFIConverter();
4260
+ })();
4261
+
3966
4262
  export type Credentials = {
3967
4263
  username: string;
3968
4264
  password: string;
@@ -10644,6 +10940,73 @@ const FfiConverterTypePaymentRequestSource = (() => {
10644
10940
  return new FFIConverter();
10645
10941
  })();
10646
10942
 
10943
+ /**
10944
+ * How much to fund one branch of the exit to avoid a fan-out.
10945
+ */
10946
+ export type PerBranchFunding = {
10947
+ /**
10948
+ * The leaf whose branch this funds.
10949
+ */
10950
+ leafId: string;
10951
+ /**
10952
+ * Fund a UTXO of at least this many satoshis for this branch.
10953
+ */
10954
+ fundingSat: /*u64*/ bigint;
10955
+ };
10956
+
10957
+ /**
10958
+ * Generated factory for {@link PerBranchFunding} record objects.
10959
+ */
10960
+ export const PerBranchFunding = (() => {
10961
+ const defaults = () => ({});
10962
+ const create = (() => {
10963
+ return uniffiCreateRecord<PerBranchFunding, ReturnType<typeof defaults>>(
10964
+ defaults
10965
+ );
10966
+ })();
10967
+ return Object.freeze({
10968
+ /**
10969
+ * Create a frozen instance of {@link PerBranchFunding}, with defaults specified
10970
+ * in Rust, in the {@link breez_sdk_spark} crate.
10971
+ */
10972
+ create,
10973
+
10974
+ /**
10975
+ * Create a frozen instance of {@link PerBranchFunding}, with defaults specified
10976
+ * in Rust, in the {@link breez_sdk_spark} crate.
10977
+ */
10978
+ new: create,
10979
+
10980
+ /**
10981
+ * Defaults specified in the {@link breez_sdk_spark} crate.
10982
+ */
10983
+ defaults: () => Object.freeze(defaults()) as Partial<PerBranchFunding>,
10984
+ });
10985
+ })();
10986
+
10987
+ const FfiConverterTypePerBranchFunding = (() => {
10988
+ type TypeName = PerBranchFunding;
10989
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
10990
+ read(from: RustBuffer): TypeName {
10991
+ return {
10992
+ leafId: FfiConverterString.read(from),
10993
+ fundingSat: FfiConverterUInt64.read(from),
10994
+ };
10995
+ }
10996
+ write(value: TypeName, into: RustBuffer): void {
10997
+ FfiConverterString.write(value.leafId, into);
10998
+ FfiConverterUInt64.write(value.fundingSat, into);
10999
+ }
11000
+ allocationSize(value: TypeName): number {
11001
+ return (
11002
+ FfiConverterString.allocationSize(value.leafId) +
11003
+ FfiConverterUInt64.allocationSize(value.fundingSat)
11004
+ );
11005
+ }
11006
+ }
11007
+ return new FFIConverter();
11008
+ })();
11009
+
10647
11010
  export type PrepareLnurlPayRequest = {
10648
11011
  /**
10649
11012
  * The amount to send. Denominated in satoshis, or in token base units
@@ -10866,6 +11229,135 @@ const FfiConverterTypePrepareLnurlPayResponse = (() => {
10866
11229
  return new FFIConverter();
10867
11230
  })();
10868
11231
 
11232
+ export type PrepareSendBatchRequest = {
11233
+ /**
11234
+ * The payees, all paid by one transaction. They may span several tokens,
11235
+ * and may mix Spark addresses with Spark invoices. Once a Spark invoice is
11236
+ * among them, every recipient must be paid in the same token.
11237
+ */
11238
+ recipients: Array<BatchRecipient>;
11239
+ };
11240
+
11241
+ /**
11242
+ * Generated factory for {@link PrepareSendBatchRequest} record objects.
11243
+ */
11244
+ export const PrepareSendBatchRequest = (() => {
11245
+ const defaults = () => ({});
11246
+ const create = (() => {
11247
+ return uniffiCreateRecord<
11248
+ PrepareSendBatchRequest,
11249
+ ReturnType<typeof defaults>
11250
+ >(defaults);
11251
+ })();
11252
+ return Object.freeze({
11253
+ /**
11254
+ * Create a frozen instance of {@link PrepareSendBatchRequest}, with defaults specified
11255
+ * in Rust, in the {@link breez_sdk_spark} crate.
11256
+ */
11257
+ create,
11258
+
11259
+ /**
11260
+ * Create a frozen instance of {@link PrepareSendBatchRequest}, with defaults specified
11261
+ * in Rust, in the {@link breez_sdk_spark} crate.
11262
+ */
11263
+ new: create,
11264
+
11265
+ /**
11266
+ * Defaults specified in the {@link breez_sdk_spark} crate.
11267
+ */
11268
+ defaults: () =>
11269
+ Object.freeze(defaults()) as Partial<PrepareSendBatchRequest>,
11270
+ });
11271
+ })();
11272
+
11273
+ const FfiConverterTypePrepareSendBatchRequest = (() => {
11274
+ type TypeName = PrepareSendBatchRequest;
11275
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
11276
+ read(from: RustBuffer): TypeName {
11277
+ return {
11278
+ recipients: FfiConverterArrayTypeBatchRecipient.read(from),
11279
+ };
11280
+ }
11281
+ write(value: TypeName, into: RustBuffer): void {
11282
+ FfiConverterArrayTypeBatchRecipient.write(value.recipients, into);
11283
+ }
11284
+ allocationSize(value: TypeName): number {
11285
+ return FfiConverterArrayTypeBatchRecipient.allocationSize(
11286
+ value.recipients
11287
+ );
11288
+ }
11289
+ }
11290
+ return new FFIConverter();
11291
+ })();
11292
+
11293
+ export type PrepareSendBatchResponse = {
11294
+ /**
11295
+ * The payees in the order they were requested, which is the order their
11296
+ * payments come back in.
11297
+ */
11298
+ recipients: Array<ResolvedBatchRecipient>;
11299
+ /**
11300
+ * What the batch debits, one entry per distinct asset.
11301
+ */
11302
+ totals: Array<BatchTotal>;
11303
+ };
11304
+
11305
+ /**
11306
+ * Generated factory for {@link PrepareSendBatchResponse} record objects.
11307
+ */
11308
+ export const PrepareSendBatchResponse = (() => {
11309
+ const defaults = () => ({});
11310
+ const create = (() => {
11311
+ return uniffiCreateRecord<
11312
+ PrepareSendBatchResponse,
11313
+ ReturnType<typeof defaults>
11314
+ >(defaults);
11315
+ })();
11316
+ return Object.freeze({
11317
+ /**
11318
+ * Create a frozen instance of {@link PrepareSendBatchResponse}, with defaults specified
11319
+ * in Rust, in the {@link breez_sdk_spark} crate.
11320
+ */
11321
+ create,
11322
+
11323
+ /**
11324
+ * Create a frozen instance of {@link PrepareSendBatchResponse}, with defaults specified
11325
+ * in Rust, in the {@link breez_sdk_spark} crate.
11326
+ */
11327
+ new: create,
11328
+
11329
+ /**
11330
+ * Defaults specified in the {@link breez_sdk_spark} crate.
11331
+ */
11332
+ defaults: () =>
11333
+ Object.freeze(defaults()) as Partial<PrepareSendBatchResponse>,
11334
+ });
11335
+ })();
11336
+
11337
+ const FfiConverterTypePrepareSendBatchResponse = (() => {
11338
+ type TypeName = PrepareSendBatchResponse;
11339
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
11340
+ read(from: RustBuffer): TypeName {
11341
+ return {
11342
+ recipients: FfiConverterArrayTypeResolvedBatchRecipient.read(from),
11343
+ totals: FfiConverterArrayTypeBatchTotal.read(from),
11344
+ };
11345
+ }
11346
+ write(value: TypeName, into: RustBuffer): void {
11347
+ FfiConverterArrayTypeResolvedBatchRecipient.write(value.recipients, into);
11348
+ FfiConverterArrayTypeBatchTotal.write(value.totals, into);
11349
+ }
11350
+ allocationSize(value: TypeName): number {
11351
+ return (
11352
+ FfiConverterArrayTypeResolvedBatchRecipient.allocationSize(
11353
+ value.recipients
11354
+ ) + FfiConverterArrayTypeBatchTotal.allocationSize(value.totals)
11355
+ );
11356
+ }
11357
+ }
11358
+ return new FFIConverter();
11359
+ })();
11360
+
10869
11361
  export type PrepareSendPaymentRequest = {
10870
11362
  paymentRequest: PaymentRequest;
10871
11363
  /**
@@ -11065,6 +11557,198 @@ const FfiConverterTypePrepareSendPaymentResponse = (() => {
11065
11557
  return new FFIConverter();
11066
11558
  })();
11067
11559
 
11560
+ /**
11561
+ * Request for `prepare_unilateral_exit`, the exit quote.
11562
+ */
11563
+ export type PrepareUnilateralExitRequest = {
11564
+ /**
11565
+ * Target fee rate in sat/vByte, applied to every CPFP child, the fan-out,
11566
+ * and the sweep.
11567
+ */
11568
+ feeRateSatPerVbyte: /*u64*/ bigint;
11569
+ fundingKind: CpfpFundingKind;
11570
+ /**
11571
+ * The Bitcoin address the swept funds are sent to.
11572
+ */
11573
+ destination: string;
11574
+ selection: ExitLeafSelection;
11575
+ };
11576
+
11577
+ /**
11578
+ * Generated factory for {@link PrepareUnilateralExitRequest} record objects.
11579
+ */
11580
+ export const PrepareUnilateralExitRequest = (() => {
11581
+ const defaults = () => ({});
11582
+ const create = (() => {
11583
+ return uniffiCreateRecord<
11584
+ PrepareUnilateralExitRequest,
11585
+ ReturnType<typeof defaults>
11586
+ >(defaults);
11587
+ })();
11588
+ return Object.freeze({
11589
+ /**
11590
+ * Create a frozen instance of {@link PrepareUnilateralExitRequest}, with defaults specified
11591
+ * in Rust, in the {@link breez_sdk_spark} crate.
11592
+ */
11593
+ create,
11594
+
11595
+ /**
11596
+ * Create a frozen instance of {@link PrepareUnilateralExitRequest}, with defaults specified
11597
+ * in Rust, in the {@link breez_sdk_spark} crate.
11598
+ */
11599
+ new: create,
11600
+
11601
+ /**
11602
+ * Defaults specified in the {@link breez_sdk_spark} crate.
11603
+ */
11604
+ defaults: () =>
11605
+ Object.freeze(defaults()) as Partial<PrepareUnilateralExitRequest>,
11606
+ });
11607
+ })();
11608
+
11609
+ const FfiConverterTypePrepareUnilateralExitRequest = (() => {
11610
+ type TypeName = PrepareUnilateralExitRequest;
11611
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
11612
+ read(from: RustBuffer): TypeName {
11613
+ return {
11614
+ feeRateSatPerVbyte: FfiConverterUInt64.read(from),
11615
+ fundingKind: FfiConverterTypeCpfpFundingKind.read(from),
11616
+ destination: FfiConverterString.read(from),
11617
+ selection: FfiConverterTypeExitLeafSelection.read(from),
11618
+ };
11619
+ }
11620
+ write(value: TypeName, into: RustBuffer): void {
11621
+ FfiConverterUInt64.write(value.feeRateSatPerVbyte, into);
11622
+ FfiConverterTypeCpfpFundingKind.write(value.fundingKind, into);
11623
+ FfiConverterString.write(value.destination, into);
11624
+ FfiConverterTypeExitLeafSelection.write(value.selection, into);
11625
+ }
11626
+ allocationSize(value: TypeName): number {
11627
+ return (
11628
+ FfiConverterUInt64.allocationSize(value.feeRateSatPerVbyte) +
11629
+ FfiConverterTypeCpfpFundingKind.allocationSize(value.fundingKind) +
11630
+ FfiConverterString.allocationSize(value.destination) +
11631
+ FfiConverterTypeExitLeafSelection.allocationSize(value.selection)
11632
+ );
11633
+ }
11634
+ }
11635
+ return new FFIConverter();
11636
+ })();
11637
+
11638
+ /**
11639
+ * Response from `prepare_unilateral_exit`: which leaves would exit, the exact
11640
+ * fee at the requested rate, and how much to fund.
11641
+ */
11642
+ export type PrepareUnilateralExitResponse = {
11643
+ leaves: Array<UnilateralExitLeaf>;
11644
+ /**
11645
+ * Total value of the selected leaves, in satoshis.
11646
+ */
11647
+ recoverableValueSat: /*u64*/ bigint;
11648
+ /**
11649
+ * Total on-chain fee when funding with a single UTXO (fanned out across
11650
+ * branches), in satoshis. Exact for the given funding kind; nodes the
11651
+ * operators report on-chain are assumed already paid, so a partially-exited
11652
+ * tree quotes a lower fee than a fresh one.
11653
+ */
11654
+ totalFeeSat: /*u64*/ bigint;
11655
+ /**
11656
+ * The part of `total_fee_sat` paid for the fan-out transaction. Funding one
11657
+ * UTXO per branch (`per_branch_funding`) avoids it. Zero for a single
11658
+ * branch (no fan-out).
11659
+ */
11660
+ fanoutFeeSat: /*u64*/ bigint;
11661
+ /**
11662
+ * Fund a single UTXO of at least this many satoshis to exit with a fan-out.
11663
+ */
11664
+ singleUtxoFundingSat: /*u64*/ bigint;
11665
+ /**
11666
+ * To skip the fan-out, fund one UTXO per branch of at least the given
11667
+ * amount (one entry per selected leaf).
11668
+ */
11669
+ perBranchFunding: Array<PerBranchFunding>;
11670
+ /**
11671
+ * The fee rate this quote was computed at, in sat/vByte.
11672
+ */
11673
+ feeRateSatPerVbyte: /*u64*/ bigint;
11674
+ destination: string;
11675
+ };
11676
+
11677
+ /**
11678
+ * Generated factory for {@link PrepareUnilateralExitResponse} record objects.
11679
+ */
11680
+ export const PrepareUnilateralExitResponse = (() => {
11681
+ const defaults = () => ({});
11682
+ const create = (() => {
11683
+ return uniffiCreateRecord<
11684
+ PrepareUnilateralExitResponse,
11685
+ ReturnType<typeof defaults>
11686
+ >(defaults);
11687
+ })();
11688
+ return Object.freeze({
11689
+ /**
11690
+ * Create a frozen instance of {@link PrepareUnilateralExitResponse}, with defaults specified
11691
+ * in Rust, in the {@link breez_sdk_spark} crate.
11692
+ */
11693
+ create,
11694
+
11695
+ /**
11696
+ * Create a frozen instance of {@link PrepareUnilateralExitResponse}, with defaults specified
11697
+ * in Rust, in the {@link breez_sdk_spark} crate.
11698
+ */
11699
+ new: create,
11700
+
11701
+ /**
11702
+ * Defaults specified in the {@link breez_sdk_spark} crate.
11703
+ */
11704
+ defaults: () =>
11705
+ Object.freeze(defaults()) as Partial<PrepareUnilateralExitResponse>,
11706
+ });
11707
+ })();
11708
+
11709
+ const FfiConverterTypePrepareUnilateralExitResponse = (() => {
11710
+ type TypeName = PrepareUnilateralExitResponse;
11711
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
11712
+ read(from: RustBuffer): TypeName {
11713
+ return {
11714
+ leaves: FfiConverterArrayTypeUnilateralExitLeaf.read(from),
11715
+ recoverableValueSat: FfiConverterUInt64.read(from),
11716
+ totalFeeSat: FfiConverterUInt64.read(from),
11717
+ fanoutFeeSat: FfiConverterUInt64.read(from),
11718
+ singleUtxoFundingSat: FfiConverterUInt64.read(from),
11719
+ perBranchFunding: FfiConverterArrayTypePerBranchFunding.read(from),
11720
+ feeRateSatPerVbyte: FfiConverterUInt64.read(from),
11721
+ destination: FfiConverterString.read(from),
11722
+ };
11723
+ }
11724
+ write(value: TypeName, into: RustBuffer): void {
11725
+ FfiConverterArrayTypeUnilateralExitLeaf.write(value.leaves, into);
11726
+ FfiConverterUInt64.write(value.recoverableValueSat, into);
11727
+ FfiConverterUInt64.write(value.totalFeeSat, into);
11728
+ FfiConverterUInt64.write(value.fanoutFeeSat, into);
11729
+ FfiConverterUInt64.write(value.singleUtxoFundingSat, into);
11730
+ FfiConverterArrayTypePerBranchFunding.write(value.perBranchFunding, into);
11731
+ FfiConverterUInt64.write(value.feeRateSatPerVbyte, into);
11732
+ FfiConverterString.write(value.destination, into);
11733
+ }
11734
+ allocationSize(value: TypeName): number {
11735
+ return (
11736
+ FfiConverterArrayTypeUnilateralExitLeaf.allocationSize(value.leaves) +
11737
+ FfiConverterUInt64.allocationSize(value.recoverableValueSat) +
11738
+ FfiConverterUInt64.allocationSize(value.totalFeeSat) +
11739
+ FfiConverterUInt64.allocationSize(value.fanoutFeeSat) +
11740
+ FfiConverterUInt64.allocationSize(value.singleUtxoFundingSat) +
11741
+ FfiConverterArrayTypePerBranchFunding.allocationSize(
11742
+ value.perBranchFunding
11743
+ ) +
11744
+ FfiConverterUInt64.allocationSize(value.feeRateSatPerVbyte) +
11745
+ FfiConverterString.allocationSize(value.destination)
11746
+ );
11747
+ }
11748
+ }
11749
+ return new FFIConverter();
11750
+ })();
11751
+
11068
11752
  export type ProvisionalPayment = {
11069
11753
  /**
11070
11754
  * Unique identifier for the payment
@@ -11920,6 +12604,84 @@ const FfiConverterTypeRefundDepositResponse = (() => {
11920
12604
  return new FFIConverter();
11921
12605
  })();
11922
12606
 
12607
+ /**
12608
+ * Response from refunding pending conversions.
12609
+ */
12610
+ export type RefundPendingConversionsResponse = {
12611
+ /**
12612
+ * Conversions successfully refunded this pass.
12613
+ */
12614
+ refunded: /*u32*/ number;
12615
+ /**
12616
+ * Conversions intentionally deferred (eligible but held back by a
12617
+ * safety window). The next pass will retry them.
12618
+ */
12619
+ skipped: /*u32*/ number;
12620
+ /**
12621
+ * Conversions whose clawback did not complete this pass (rejected or
12622
+ * errored; funds not returned). The next pass will retry them.
12623
+ */
12624
+ failed: /*u32*/ number;
12625
+ };
12626
+
12627
+ /**
12628
+ * Generated factory for {@link RefundPendingConversionsResponse} record objects.
12629
+ */
12630
+ export const RefundPendingConversionsResponse = (() => {
12631
+ const defaults = () => ({});
12632
+ const create = (() => {
12633
+ return uniffiCreateRecord<
12634
+ RefundPendingConversionsResponse,
12635
+ ReturnType<typeof defaults>
12636
+ >(defaults);
12637
+ })();
12638
+ return Object.freeze({
12639
+ /**
12640
+ * Create a frozen instance of {@link RefundPendingConversionsResponse}, with defaults specified
12641
+ * in Rust, in the {@link breez_sdk_spark} crate.
12642
+ */
12643
+ create,
12644
+
12645
+ /**
12646
+ * Create a frozen instance of {@link RefundPendingConversionsResponse}, with defaults specified
12647
+ * in Rust, in the {@link breez_sdk_spark} crate.
12648
+ */
12649
+ new: create,
12650
+
12651
+ /**
12652
+ * Defaults specified in the {@link breez_sdk_spark} crate.
12653
+ */
12654
+ defaults: () =>
12655
+ Object.freeze(defaults()) as Partial<RefundPendingConversionsResponse>,
12656
+ });
12657
+ })();
12658
+
12659
+ const FfiConverterTypeRefundPendingConversionsResponse = (() => {
12660
+ type TypeName = RefundPendingConversionsResponse;
12661
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
12662
+ read(from: RustBuffer): TypeName {
12663
+ return {
12664
+ refunded: FfiConverterUInt32.read(from),
12665
+ skipped: FfiConverterUInt32.read(from),
12666
+ failed: FfiConverterUInt32.read(from),
12667
+ };
12668
+ }
12669
+ write(value: TypeName, into: RustBuffer): void {
12670
+ FfiConverterUInt32.write(value.refunded, into);
12671
+ FfiConverterUInt32.write(value.skipped, into);
12672
+ FfiConverterUInt32.write(value.failed, into);
12673
+ }
12674
+ allocationSize(value: TypeName): number {
12675
+ return (
12676
+ FfiConverterUInt32.allocationSize(value.refunded) +
12677
+ FfiConverterUInt32.allocationSize(value.skipped) +
12678
+ FfiConverterUInt32.allocationSize(value.failed)
12679
+ );
12680
+ }
12681
+ }
12682
+ return new FFIConverter();
12683
+ })();
12684
+
11923
12685
  export type RegisterLightningAddressRequest = {
11924
12686
  username: string;
11925
12687
  description: string | undefined;
@@ -12267,6 +13029,80 @@ const FfiConverterTypeRegisterWebhookResponse = (() => {
12267
13029
  return new FFIConverter();
12268
13030
  })();
12269
13031
 
13032
+ /**
13033
+ * A recipient after prepare has resolved the asset and amount it is owed.
13034
+ */
13035
+ export type ResolvedBatchRecipient = {
13036
+ destination: BatchDestination;
13037
+ /**
13038
+ * Amount in the base units of the asset this recipient is paid in.
13039
+ */
13040
+ amount: U128;
13041
+ /**
13042
+ * The token this recipient is paid in. Unset means sats, which a batch
13043
+ * cannot send yet.
13044
+ */
13045
+ tokenIdentifier: string | undefined;
13046
+ };
13047
+
13048
+ /**
13049
+ * Generated factory for {@link ResolvedBatchRecipient} record objects.
13050
+ */
13051
+ export const ResolvedBatchRecipient = (() => {
13052
+ const defaults = () => ({});
13053
+ const create = (() => {
13054
+ return uniffiCreateRecord<
13055
+ ResolvedBatchRecipient,
13056
+ ReturnType<typeof defaults>
13057
+ >(defaults);
13058
+ })();
13059
+ return Object.freeze({
13060
+ /**
13061
+ * Create a frozen instance of {@link ResolvedBatchRecipient}, with defaults specified
13062
+ * in Rust, in the {@link breez_sdk_spark} crate.
13063
+ */
13064
+ create,
13065
+
13066
+ /**
13067
+ * Create a frozen instance of {@link ResolvedBatchRecipient}, with defaults specified
13068
+ * in Rust, in the {@link breez_sdk_spark} crate.
13069
+ */
13070
+ new: create,
13071
+
13072
+ /**
13073
+ * Defaults specified in the {@link breez_sdk_spark} crate.
13074
+ */
13075
+ defaults: () =>
13076
+ Object.freeze(defaults()) as Partial<ResolvedBatchRecipient>,
13077
+ });
13078
+ })();
13079
+
13080
+ const FfiConverterTypeResolvedBatchRecipient = (() => {
13081
+ type TypeName = ResolvedBatchRecipient;
13082
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
13083
+ read(from: RustBuffer): TypeName {
13084
+ return {
13085
+ destination: FfiConverterTypeBatchDestination.read(from),
13086
+ amount: FfiConverterTypeu128.read(from),
13087
+ tokenIdentifier: FfiConverterOptionalString.read(from),
13088
+ };
13089
+ }
13090
+ write(value: TypeName, into: RustBuffer): void {
13091
+ FfiConverterTypeBatchDestination.write(value.destination, into);
13092
+ FfiConverterTypeu128.write(value.amount, into);
13093
+ FfiConverterOptionalString.write(value.tokenIdentifier, into);
13094
+ }
13095
+ allocationSize(value: TypeName): number {
13096
+ return (
13097
+ FfiConverterTypeBatchDestination.allocationSize(value.destination) +
13098
+ FfiConverterTypeu128.allocationSize(value.amount) +
13099
+ FfiConverterOptionalString.allocationSize(value.tokenIdentifier)
13100
+ );
13101
+ }
13102
+ }
13103
+ return new FFIConverter();
13104
+ })();
13105
+
12270
13106
  export type RestResponse = {
12271
13107
  status: /*u16*/ number;
12272
13108
  body: string;
@@ -12537,6 +13373,119 @@ const FfiConverterTypeSecretBytes = (() => {
12537
13373
  return new FFIConverter();
12538
13374
  })();
12539
13375
 
13376
+ export type SendBatchRequest = {
13377
+ prepareResponse: PrepareSendBatchResponse;
13378
+ };
13379
+
13380
+ /**
13381
+ * Generated factory for {@link SendBatchRequest} record objects.
13382
+ */
13383
+ export const SendBatchRequest = (() => {
13384
+ const defaults = () => ({});
13385
+ const create = (() => {
13386
+ return uniffiCreateRecord<SendBatchRequest, ReturnType<typeof defaults>>(
13387
+ defaults
13388
+ );
13389
+ })();
13390
+ return Object.freeze({
13391
+ /**
13392
+ * Create a frozen instance of {@link SendBatchRequest}, with defaults specified
13393
+ * in Rust, in the {@link breez_sdk_spark} crate.
13394
+ */
13395
+ create,
13396
+
13397
+ /**
13398
+ * Create a frozen instance of {@link SendBatchRequest}, with defaults specified
13399
+ * in Rust, in the {@link breez_sdk_spark} crate.
13400
+ */
13401
+ new: create,
13402
+
13403
+ /**
13404
+ * Defaults specified in the {@link breez_sdk_spark} crate.
13405
+ */
13406
+ defaults: () => Object.freeze(defaults()) as Partial<SendBatchRequest>,
13407
+ });
13408
+ })();
13409
+
13410
+ const FfiConverterTypeSendBatchRequest = (() => {
13411
+ type TypeName = SendBatchRequest;
13412
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
13413
+ read(from: RustBuffer): TypeName {
13414
+ return {
13415
+ prepareResponse: FfiConverterTypePrepareSendBatchResponse.read(from),
13416
+ };
13417
+ }
13418
+ write(value: TypeName, into: RustBuffer): void {
13419
+ FfiConverterTypePrepareSendBatchResponse.write(
13420
+ value.prepareResponse,
13421
+ into
13422
+ );
13423
+ }
13424
+ allocationSize(value: TypeName): number {
13425
+ return FfiConverterTypePrepareSendBatchResponse.allocationSize(
13426
+ value.prepareResponse
13427
+ );
13428
+ }
13429
+ }
13430
+ return new FFIConverter();
13431
+ })();
13432
+
13433
+ export type SendBatchResponse = {
13434
+ /**
13435
+ * One payment per recipient, in recipient order, all sharing a transaction
13436
+ * hash.
13437
+ */
13438
+ payments: Array<Payment>;
13439
+ };
13440
+
13441
+ /**
13442
+ * Generated factory for {@link SendBatchResponse} record objects.
13443
+ */
13444
+ export const SendBatchResponse = (() => {
13445
+ const defaults = () => ({});
13446
+ const create = (() => {
13447
+ return uniffiCreateRecord<SendBatchResponse, ReturnType<typeof defaults>>(
13448
+ defaults
13449
+ );
13450
+ })();
13451
+ return Object.freeze({
13452
+ /**
13453
+ * Create a frozen instance of {@link SendBatchResponse}, with defaults specified
13454
+ * in Rust, in the {@link breez_sdk_spark} crate.
13455
+ */
13456
+ create,
13457
+
13458
+ /**
13459
+ * Create a frozen instance of {@link SendBatchResponse}, with defaults specified
13460
+ * in Rust, in the {@link breez_sdk_spark} crate.
13461
+ */
13462
+ new: create,
13463
+
13464
+ /**
13465
+ * Defaults specified in the {@link breez_sdk_spark} crate.
13466
+ */
13467
+ defaults: () => Object.freeze(defaults()) as Partial<SendBatchResponse>,
13468
+ });
13469
+ })();
13470
+
13471
+ const FfiConverterTypeSendBatchResponse = (() => {
13472
+ type TypeName = SendBatchResponse;
13473
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
13474
+ read(from: RustBuffer): TypeName {
13475
+ return {
13476
+ payments: FfiConverterArrayTypePayment.read(from),
13477
+ };
13478
+ }
13479
+ write(value: TypeName, into: RustBuffer): void {
13480
+ FfiConverterArrayTypePayment.write(value.payments, into);
13481
+ }
13482
+ allocationSize(value: TypeName): number {
13483
+ return FfiConverterArrayTypePayment.allocationSize(value.payments);
13484
+ }
13485
+ }
13486
+ return new FFIConverter();
13487
+ })();
13488
+
12540
13489
  export type SendOnchainFeeQuote = {
12541
13490
  id: string;
12542
13491
  expiresAt: /*u64*/ bigint;
@@ -15538,6 +16487,336 @@ const FfiConverterTypeUnfreezeIssuerTokenResponse = (() => {
15538
16487
  return new FFIConverter();
15539
16488
  })();
15540
16489
 
16490
+ /**
16491
+ * A leaf selected for exit, with its value.
16492
+ */
16493
+ export type UnilateralExitLeaf = {
16494
+ leafId: string;
16495
+ /**
16496
+ * The leaf's value in satoshis.
16497
+ */
16498
+ value: /*u64*/ bigint;
16499
+ };
16500
+
16501
+ /**
16502
+ * Generated factory for {@link UnilateralExitLeaf} record objects.
16503
+ */
16504
+ export const UnilateralExitLeaf = (() => {
16505
+ const defaults = () => ({});
16506
+ const create = (() => {
16507
+ return uniffiCreateRecord<UnilateralExitLeaf, ReturnType<typeof defaults>>(
16508
+ defaults
16509
+ );
16510
+ })();
16511
+ return Object.freeze({
16512
+ /**
16513
+ * Create a frozen instance of {@link UnilateralExitLeaf}, with defaults specified
16514
+ * in Rust, in the {@link breez_sdk_spark} crate.
16515
+ */
16516
+ create,
16517
+
16518
+ /**
16519
+ * Create a frozen instance of {@link UnilateralExitLeaf}, with defaults specified
16520
+ * in Rust, in the {@link breez_sdk_spark} crate.
16521
+ */
16522
+ new: create,
16523
+
16524
+ /**
16525
+ * Defaults specified in the {@link breez_sdk_spark} crate.
16526
+ */
16527
+ defaults: () => Object.freeze(defaults()) as Partial<UnilateralExitLeaf>,
16528
+ });
16529
+ })();
16530
+
16531
+ const FfiConverterTypeUnilateralExitLeaf = (() => {
16532
+ type TypeName = UnilateralExitLeaf;
16533
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
16534
+ read(from: RustBuffer): TypeName {
16535
+ return {
16536
+ leafId: FfiConverterString.read(from),
16537
+ value: FfiConverterUInt64.read(from),
16538
+ };
16539
+ }
16540
+ write(value: TypeName, into: RustBuffer): void {
16541
+ FfiConverterString.write(value.leafId, into);
16542
+ FfiConverterUInt64.write(value.value, into);
16543
+ }
16544
+ allocationSize(value: TypeName): number {
16545
+ return (
16546
+ FfiConverterString.allocationSize(value.leafId) +
16547
+ FfiConverterUInt64.allocationSize(value.value)
16548
+ );
16549
+ }
16550
+ }
16551
+ return new FFIConverter();
16552
+ })();
16553
+
16554
+ /**
16555
+ * Request for `unilateral_exit`: a `prepare_unilateral_exit` quote plus the
16556
+ * funding UTXOs that pay its fees. The signer is passed separately (it is not a
16557
+ * plain data value).
16558
+ */
16559
+ export type UnilateralExitRequest = {
16560
+ /**
16561
+ * The quote returned by `prepare_unilateral_exit`, naming the leaves to exit.
16562
+ */
16563
+ prepared: PrepareUnilateralExitResponse;
16564
+ /**
16565
+ * The funding UTXOs that pay the exit's on-chain fees, meeting the quote's
16566
+ * `single_utxo_funding_sat` (one UTXO) or `per_branch_funding` (one per branch).
16567
+ */
16568
+ fundingInputs: Array<CpfpInput>;
16569
+ };
16570
+
16571
+ /**
16572
+ * Generated factory for {@link UnilateralExitRequest} record objects.
16573
+ */
16574
+ export const UnilateralExitRequest = (() => {
16575
+ const defaults = () => ({});
16576
+ const create = (() => {
16577
+ return uniffiCreateRecord<
16578
+ UnilateralExitRequest,
16579
+ ReturnType<typeof defaults>
16580
+ >(defaults);
16581
+ })();
16582
+ return Object.freeze({
16583
+ /**
16584
+ * Create a frozen instance of {@link UnilateralExitRequest}, with defaults specified
16585
+ * in Rust, in the {@link breez_sdk_spark} crate.
16586
+ */
16587
+ create,
16588
+
16589
+ /**
16590
+ * Create a frozen instance of {@link UnilateralExitRequest}, with defaults specified
16591
+ * in Rust, in the {@link breez_sdk_spark} crate.
16592
+ */
16593
+ new: create,
16594
+
16595
+ /**
16596
+ * Defaults specified in the {@link breez_sdk_spark} crate.
16597
+ */
16598
+ defaults: () => Object.freeze(defaults()) as Partial<UnilateralExitRequest>,
16599
+ });
16600
+ })();
16601
+
16602
+ const FfiConverterTypeUnilateralExitRequest = (() => {
16603
+ type TypeName = UnilateralExitRequest;
16604
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
16605
+ read(from: RustBuffer): TypeName {
16606
+ return {
16607
+ prepared: FfiConverterTypePrepareUnilateralExitResponse.read(from),
16608
+ fundingInputs: FfiConverterArrayTypeCpfpInput.read(from),
16609
+ };
16610
+ }
16611
+ write(value: TypeName, into: RustBuffer): void {
16612
+ FfiConverterTypePrepareUnilateralExitResponse.write(value.prepared, into);
16613
+ FfiConverterArrayTypeCpfpInput.write(value.fundingInputs, into);
16614
+ }
16615
+ allocationSize(value: TypeName): number {
16616
+ return (
16617
+ FfiConverterTypePrepareUnilateralExitResponse.allocationSize(
16618
+ value.prepared
16619
+ ) + FfiConverterArrayTypeCpfpInput.allocationSize(value.fundingInputs)
16620
+ );
16621
+ }
16622
+ }
16623
+ return new FFIConverter();
16624
+ })();
16625
+
16626
+ /**
16627
+ * Result of `unilateral_exit`: a cost summary plus the complete, signed exit
16628
+ * path.
16629
+ */
16630
+ export type UnilateralExitResponse = {
16631
+ /**
16632
+ * Total value of the selected leaves, in satoshis.
16633
+ */
16634
+ recoverableValueSat: /*u64*/ bigint;
16635
+ /**
16636
+ * The actual total on-chain fee the returned transactions pay at the
16637
+ * requested rate, in satoshis. A resumed or partially-confirmed exit pays
16638
+ * less because already-confirmed steps are not rebuilt.
16639
+ */
16640
+ totalFeeSat: /*u64*/ bigint;
16641
+ leaves: Array<UnilateralExitLeaf>;
16642
+ /**
16643
+ * The full signed transaction set, in valid topological (broadcast) order
16644
+ * with shared ancestors appearing once and the sweep last.
16645
+ */
16646
+ transactions: Array<UnilateralExitTransaction>;
16647
+ };
16648
+
16649
+ /**
16650
+ * Generated factory for {@link UnilateralExitResponse} record objects.
16651
+ */
16652
+ export const UnilateralExitResponse = (() => {
16653
+ const defaults = () => ({});
16654
+ const create = (() => {
16655
+ return uniffiCreateRecord<
16656
+ UnilateralExitResponse,
16657
+ ReturnType<typeof defaults>
16658
+ >(defaults);
16659
+ })();
16660
+ return Object.freeze({
16661
+ /**
16662
+ * Create a frozen instance of {@link UnilateralExitResponse}, with defaults specified
16663
+ * in Rust, in the {@link breez_sdk_spark} crate.
16664
+ */
16665
+ create,
16666
+
16667
+ /**
16668
+ * Create a frozen instance of {@link UnilateralExitResponse}, with defaults specified
16669
+ * in Rust, in the {@link breez_sdk_spark} crate.
16670
+ */
16671
+ new: create,
16672
+
16673
+ /**
16674
+ * Defaults specified in the {@link breez_sdk_spark} crate.
16675
+ */
16676
+ defaults: () =>
16677
+ Object.freeze(defaults()) as Partial<UnilateralExitResponse>,
16678
+ });
16679
+ })();
16680
+
16681
+ const FfiConverterTypeUnilateralExitResponse = (() => {
16682
+ type TypeName = UnilateralExitResponse;
16683
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
16684
+ read(from: RustBuffer): TypeName {
16685
+ return {
16686
+ recoverableValueSat: FfiConverterUInt64.read(from),
16687
+ totalFeeSat: FfiConverterUInt64.read(from),
16688
+ leaves: FfiConverterArrayTypeUnilateralExitLeaf.read(from),
16689
+ transactions: FfiConverterArrayTypeUnilateralExitTransaction.read(from),
16690
+ };
16691
+ }
16692
+ write(value: TypeName, into: RustBuffer): void {
16693
+ FfiConverterUInt64.write(value.recoverableValueSat, into);
16694
+ FfiConverterUInt64.write(value.totalFeeSat, into);
16695
+ FfiConverterArrayTypeUnilateralExitLeaf.write(value.leaves, into);
16696
+ FfiConverterArrayTypeUnilateralExitTransaction.write(
16697
+ value.transactions,
16698
+ into
16699
+ );
16700
+ }
16701
+ allocationSize(value: TypeName): number {
16702
+ return (
16703
+ FfiConverterUInt64.allocationSize(value.recoverableValueSat) +
16704
+ FfiConverterUInt64.allocationSize(value.totalFeeSat) +
16705
+ FfiConverterArrayTypeUnilateralExitLeaf.allocationSize(value.leaves) +
16706
+ FfiConverterArrayTypeUnilateralExitTransaction.allocationSize(
16707
+ value.transactions
16708
+ )
16709
+ );
16710
+ }
16711
+ }
16712
+ return new FFIConverter();
16713
+ })();
16714
+
16715
+ /**
16716
+ * One transaction in the unilateral exit path, with everything needed to
16717
+ * order and broadcast it.
16718
+ */
16719
+ export type UnilateralExitTransaction = {
16720
+ kind: UnilateralExitTxKind;
16721
+ /**
16722
+ * The tree node this transaction belongs to. Unset for the fan-out and the
16723
+ * sweep.
16724
+ */
16725
+ nodeId: string | undefined;
16726
+ txid: string;
16727
+ txHex: string;
16728
+ /**
16729
+ * The signed CPFP child to broadcast alongside `tx_hex` as a package.
16730
+ * Unset for the fan-out and the sweep (no anchor to bump) and for a
16731
+ * `Confirmed` step (its CPFP is already on-chain).
16732
+ */
16733
+ cpfpTxHex: string | undefined;
16734
+ /**
16735
+ * Relative CSV timelock, in blocks, that must mature on the spent input
16736
+ * before this transaction can confirm. Unset when there is no timelock.
16737
+ */
16738
+ csvTimelockBlocks: /*u32*/ number | undefined;
16739
+ /**
16740
+ * Txids of other entries in this list that must be confirmed before this
16741
+ * one can be broadcast.
16742
+ */
16743
+ dependsOn: Array<string>;
16744
+ status: ConfirmationStatus;
16745
+ };
16746
+
16747
+ /**
16748
+ * Generated factory for {@link UnilateralExitTransaction} record objects.
16749
+ */
16750
+ export const UnilateralExitTransaction = (() => {
16751
+ const defaults = () => ({});
16752
+ const create = (() => {
16753
+ return uniffiCreateRecord<
16754
+ UnilateralExitTransaction,
16755
+ ReturnType<typeof defaults>
16756
+ >(defaults);
16757
+ })();
16758
+ return Object.freeze({
16759
+ /**
16760
+ * Create a frozen instance of {@link UnilateralExitTransaction}, with defaults specified
16761
+ * in Rust, in the {@link breez_sdk_spark} crate.
16762
+ */
16763
+ create,
16764
+
16765
+ /**
16766
+ * Create a frozen instance of {@link UnilateralExitTransaction}, with defaults specified
16767
+ * in Rust, in the {@link breez_sdk_spark} crate.
16768
+ */
16769
+ new: create,
16770
+
16771
+ /**
16772
+ * Defaults specified in the {@link breez_sdk_spark} crate.
16773
+ */
16774
+ defaults: () =>
16775
+ Object.freeze(defaults()) as Partial<UnilateralExitTransaction>,
16776
+ });
16777
+ })();
16778
+
16779
+ const FfiConverterTypeUnilateralExitTransaction = (() => {
16780
+ type TypeName = UnilateralExitTransaction;
16781
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
16782
+ read(from: RustBuffer): TypeName {
16783
+ return {
16784
+ kind: FfiConverterTypeUnilateralExitTxKind.read(from),
16785
+ nodeId: FfiConverterOptionalString.read(from),
16786
+ txid: FfiConverterString.read(from),
16787
+ txHex: FfiConverterString.read(from),
16788
+ cpfpTxHex: FfiConverterOptionalString.read(from),
16789
+ csvTimelockBlocks: FfiConverterOptionalUInt32.read(from),
16790
+ dependsOn: FfiConverterArrayString.read(from),
16791
+ status: FfiConverterTypeConfirmationStatus.read(from),
16792
+ };
16793
+ }
16794
+ write(value: TypeName, into: RustBuffer): void {
16795
+ FfiConverterTypeUnilateralExitTxKind.write(value.kind, into);
16796
+ FfiConverterOptionalString.write(value.nodeId, into);
16797
+ FfiConverterString.write(value.txid, into);
16798
+ FfiConverterString.write(value.txHex, into);
16799
+ FfiConverterOptionalString.write(value.cpfpTxHex, into);
16800
+ FfiConverterOptionalUInt32.write(value.csvTimelockBlocks, into);
16801
+ FfiConverterArrayString.write(value.dependsOn, into);
16802
+ FfiConverterTypeConfirmationStatus.write(value.status, into);
16803
+ }
16804
+ allocationSize(value: TypeName): number {
16805
+ return (
16806
+ FfiConverterTypeUnilateralExitTxKind.allocationSize(value.kind) +
16807
+ FfiConverterOptionalString.allocationSize(value.nodeId) +
16808
+ FfiConverterString.allocationSize(value.txid) +
16809
+ FfiConverterString.allocationSize(value.txHex) +
16810
+ FfiConverterOptionalString.allocationSize(value.cpfpTxHex) +
16811
+ FfiConverterOptionalUInt32.allocationSize(value.csvTimelockBlocks) +
16812
+ FfiConverterArrayString.allocationSize(value.dependsOn) +
16813
+ FfiConverterTypeConfirmationStatus.allocationSize(value.status)
16814
+ );
16815
+ }
16816
+ }
16817
+ return new FFIConverter();
16818
+ })();
16819
+
15541
16820
  /**
15542
16821
  * Request to unregister an existing webhook.
15543
16822
  */
@@ -15737,13 +17016,24 @@ export type UpdateUserSettingsRequest = {
15737
17016
  * Update the active stable balance token. `None` means no change.
15738
17017
  */
15739
17018
  stableBalanceActiveLabel: StableBalanceActiveLabel | undefined;
17019
+ /**
17020
+ * Designate or remove the wallet's master identity, a second public key
17021
+ * the Spark operators accept as a reader of this wallet's balance and
17022
+ * history while `spark_private_mode_enabled` is set. The master identity
17023
+ * can only read: payments still require the owner's keys. `None` means no
17024
+ * change.
17025
+ */
17026
+ sparkMasterIdentityPublicKey: SparkMasterIdentityPublicKey | undefined;
15740
17027
  };
15741
17028
 
15742
17029
  /**
15743
17030
  * Generated factory for {@link UpdateUserSettingsRequest} record objects.
15744
17031
  */
15745
17032
  export const UpdateUserSettingsRequest = (() => {
15746
- const defaults = () => ({ stableBalanceActiveLabel: undefined });
17033
+ const defaults = () => ({
17034
+ stableBalanceActiveLabel: undefined,
17035
+ sparkMasterIdentityPublicKey: undefined,
17036
+ });
15747
17037
  const create = (() => {
15748
17038
  return uniffiCreateRecord<
15749
17039
  UpdateUserSettingsRequest,
@@ -15779,6 +17069,8 @@ const FfiConverterTypeUpdateUserSettingsRequest = (() => {
15779
17069
  sparkPrivateModeEnabled: FfiConverterOptionalBool.read(from),
15780
17070
  stableBalanceActiveLabel:
15781
17071
  FfiConverterOptionalTypeStableBalanceActiveLabel.read(from),
17072
+ sparkMasterIdentityPublicKey:
17073
+ FfiConverterOptionalTypeSparkMasterIdentityPublicKey.read(from),
15782
17074
  };
15783
17075
  }
15784
17076
  write(value: TypeName, into: RustBuffer): void {
@@ -15787,12 +17079,19 @@ const FfiConverterTypeUpdateUserSettingsRequest = (() => {
15787
17079
  value.stableBalanceActiveLabel,
15788
17080
  into
15789
17081
  );
17082
+ FfiConverterOptionalTypeSparkMasterIdentityPublicKey.write(
17083
+ value.sparkMasterIdentityPublicKey,
17084
+ into
17085
+ );
15790
17086
  }
15791
17087
  allocationSize(value: TypeName): number {
15792
17088
  return (
15793
17089
  FfiConverterOptionalBool.allocationSize(value.sparkPrivateModeEnabled) +
15794
17090
  FfiConverterOptionalTypeStableBalanceActiveLabel.allocationSize(
15795
17091
  value.stableBalanceActiveLabel
17092
+ ) +
17093
+ FfiConverterOptionalTypeSparkMasterIdentityPublicKey.allocationSize(
17094
+ value.sparkMasterIdentityPublicKey
15796
17095
  )
15797
17096
  );
15798
17097
  }
@@ -15880,6 +17179,11 @@ export type UserSettings = {
15880
17179
  * The label of the currently active stable balance token, or `None` if deactivated.
15881
17180
  */
15882
17181
  stableBalanceActiveLabel: string | undefined;
17182
+ /**
17183
+ * The hex encoded public key designated as this wallet's master identity
17184
+ * key, or `None` if none is designated.
17185
+ */
17186
+ sparkMasterIdentityPublicKey: string | undefined;
15883
17187
  };
15884
17188
 
15885
17189
  /**
@@ -15919,17 +17223,25 @@ const FfiConverterTypeUserSettings = (() => {
15919
17223
  return {
15920
17224
  sparkPrivateModeEnabled: FfiConverterBool.read(from),
15921
17225
  stableBalanceActiveLabel: FfiConverterOptionalString.read(from),
17226
+ sparkMasterIdentityPublicKey: FfiConverterOptionalString.read(from),
15922
17227
  };
15923
17228
  }
15924
17229
  write(value: TypeName, into: RustBuffer): void {
15925
17230
  FfiConverterBool.write(value.sparkPrivateModeEnabled, into);
15926
17231
  FfiConverterOptionalString.write(value.stableBalanceActiveLabel, into);
17232
+ FfiConverterOptionalString.write(
17233
+ value.sparkMasterIdentityPublicKey,
17234
+ into
17235
+ );
15927
17236
  }
15928
17237
  allocationSize(value: TypeName): number {
15929
17238
  return (
15930
17239
  FfiConverterBool.allocationSize(value.sparkPrivateModeEnabled) +
15931
17240
  FfiConverterOptionalString.allocationSize(
15932
17241
  value.stableBalanceActiveLabel
17242
+ ) +
17243
+ FfiConverterOptionalString.allocationSize(
17244
+ value.sparkMasterIdentityPublicKey
15933
17245
  )
15934
17246
  );
15935
17247
  }
@@ -17085,6 +18397,150 @@ const FfiConverterTypeAutoOptimizationEvent = (() => {
17085
18397
  return new FFIConverter();
17086
18398
  })();
17087
18399
 
18400
+ // Enum: BatchDestination
18401
+ export enum BatchDestination_Tags {
18402
+ SparkAddress = 'SparkAddress',
18403
+ SparkInvoice = 'SparkInvoice',
18404
+ }
18405
+ /**
18406
+ * Where a batch recipient is paid, once prepare has decoded its payment request.
18407
+ */
18408
+ export const BatchDestination = (() => {
18409
+ type SparkAddress__interface = {
18410
+ tag: BatchDestination_Tags.SparkAddress;
18411
+ inner: Readonly<{ address: string }>;
18412
+ };
18413
+
18414
+ class SparkAddress_ extends UniffiEnum implements SparkAddress__interface {
18415
+ /**
18416
+ * @private
18417
+ * This field is private and should not be used, use `tag` instead.
18418
+ */
18419
+ readonly [uniffiTypeNameSymbol] = 'BatchDestination';
18420
+ readonly tag = BatchDestination_Tags.SparkAddress;
18421
+ readonly inner: Readonly<{ address: string }>;
18422
+ constructor(inner: { address: string }) {
18423
+ super('BatchDestination', 'SparkAddress');
18424
+ this.inner = Object.freeze(inner);
18425
+ }
18426
+
18427
+ static new(inner: { address: string }): SparkAddress_ {
18428
+ return new SparkAddress_(inner);
18429
+ }
18430
+
18431
+ static instanceOf(obj: any): obj is SparkAddress_ {
18432
+ return obj.tag === BatchDestination_Tags.SparkAddress;
18433
+ }
18434
+ }
18435
+
18436
+ type SparkInvoice__interface = {
18437
+ tag: BatchDestination_Tags.SparkInvoice;
18438
+ inner: Readonly<{ invoiceDetails: SparkInvoiceDetails }>;
18439
+ };
18440
+
18441
+ class SparkInvoice_ extends UniffiEnum implements SparkInvoice__interface {
18442
+ /**
18443
+ * @private
18444
+ * This field is private and should not be used, use `tag` instead.
18445
+ */
18446
+ readonly [uniffiTypeNameSymbol] = 'BatchDestination';
18447
+ readonly tag = BatchDestination_Tags.SparkInvoice;
18448
+ readonly inner: Readonly<{ invoiceDetails: SparkInvoiceDetails }>;
18449
+ constructor(inner: { invoiceDetails: SparkInvoiceDetails }) {
18450
+ super('BatchDestination', 'SparkInvoice');
18451
+ this.inner = Object.freeze(inner);
18452
+ }
18453
+
18454
+ static new(inner: { invoiceDetails: SparkInvoiceDetails }): SparkInvoice_ {
18455
+ return new SparkInvoice_(inner);
18456
+ }
18457
+
18458
+ static instanceOf(obj: any): obj is SparkInvoice_ {
18459
+ return obj.tag === BatchDestination_Tags.SparkInvoice;
18460
+ }
18461
+ }
18462
+
18463
+ function instanceOf(obj: any): obj is BatchDestination {
18464
+ return obj[uniffiTypeNameSymbol] === 'BatchDestination';
18465
+ }
18466
+
18467
+ return Object.freeze({
18468
+ instanceOf,
18469
+ SparkAddress: SparkAddress_,
18470
+ SparkInvoice: SparkInvoice_,
18471
+ });
18472
+ })();
18473
+
18474
+ /**
18475
+ * Where a batch recipient is paid, once prepare has decoded its payment request.
18476
+ */
18477
+
18478
+ export type BatchDestination = InstanceType<
18479
+ (typeof BatchDestination)[keyof Omit<typeof BatchDestination, 'instanceOf'>]
18480
+ >;
18481
+
18482
+ // FfiConverter for enum BatchDestination
18483
+ const FfiConverterTypeBatchDestination = (() => {
18484
+ const ordinalConverter = FfiConverterInt32;
18485
+ type TypeName = BatchDestination;
18486
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
18487
+ read(from: RustBuffer): TypeName {
18488
+ switch (ordinalConverter.read(from)) {
18489
+ case 1:
18490
+ return new BatchDestination.SparkAddress({
18491
+ address: FfiConverterString.read(from),
18492
+ });
18493
+ case 2:
18494
+ return new BatchDestination.SparkInvoice({
18495
+ invoiceDetails: FfiConverterTypeSparkInvoiceDetails.read(from),
18496
+ });
18497
+ default:
18498
+ throw new UniffiInternalError.UnexpectedEnumCase();
18499
+ }
18500
+ }
18501
+ write(value: TypeName, into: RustBuffer): void {
18502
+ switch (value.tag) {
18503
+ case BatchDestination_Tags.SparkAddress: {
18504
+ ordinalConverter.write(1, into);
18505
+ const inner = value.inner;
18506
+ FfiConverterString.write(inner.address, into);
18507
+ return;
18508
+ }
18509
+ case BatchDestination_Tags.SparkInvoice: {
18510
+ ordinalConverter.write(2, into);
18511
+ const inner = value.inner;
18512
+ FfiConverterTypeSparkInvoiceDetails.write(inner.invoiceDetails, into);
18513
+ return;
18514
+ }
18515
+ default:
18516
+ // Throwing from here means that BatchDestination_Tags hasn't matched an ordinal.
18517
+ throw new UniffiInternalError.UnexpectedEnumCase();
18518
+ }
18519
+ }
18520
+ allocationSize(value: TypeName): number {
18521
+ switch (value.tag) {
18522
+ case BatchDestination_Tags.SparkAddress: {
18523
+ const inner = value.inner;
18524
+ let size = ordinalConverter.allocationSize(1);
18525
+ size += FfiConverterString.allocationSize(inner.address);
18526
+ return size;
18527
+ }
18528
+ case BatchDestination_Tags.SparkInvoice: {
18529
+ const inner = value.inner;
18530
+ let size = ordinalConverter.allocationSize(2);
18531
+ size += FfiConverterTypeSparkInvoiceDetails.allocationSize(
18532
+ inner.invoiceDetails
18533
+ );
18534
+ return size;
18535
+ }
18536
+ default:
18537
+ throw new UniffiInternalError.UnexpectedEnumCase();
18538
+ }
18539
+ }
18540
+ }
18541
+ return new FFIConverter();
18542
+ })();
18543
+
17088
18544
  export enum BitcoinNetwork {
17089
18545
  /**
17090
18546
  * Mainnet
@@ -17750,6 +19206,58 @@ const FfiConverterTypeChainServiceError = (() => {
17750
19206
  return new FFIConverter();
17751
19207
  })();
17752
19208
 
19209
+ /**
19210
+ * Whether a transaction in the exit path is already on-chain.
19211
+ */
19212
+ export enum ConfirmationStatus {
19213
+ /**
19214
+ * This transaction is confirmed in a block. It needs no action.
19215
+ */
19216
+ Confirmed,
19217
+ /**
19218
+ * This transaction is not yet confirmed. Mempool state is not consulted.
19219
+ */
19220
+ Unconfirmed,
19221
+ /**
19222
+ * The on-chain status could not be determined (the chain service errored).
19223
+ * Broadcasting may fail if a conflicting transaction already landed.
19224
+ */
19225
+ Unverified,
19226
+ }
19227
+
19228
+ const FfiConverterTypeConfirmationStatus = (() => {
19229
+ const ordinalConverter = FfiConverterInt32;
19230
+ type TypeName = ConfirmationStatus;
19231
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
19232
+ read(from: RustBuffer): TypeName {
19233
+ switch (ordinalConverter.read(from)) {
19234
+ case 1:
19235
+ return ConfirmationStatus.Confirmed;
19236
+ case 2:
19237
+ return ConfirmationStatus.Unconfirmed;
19238
+ case 3:
19239
+ return ConfirmationStatus.Unverified;
19240
+ default:
19241
+ throw new UniffiInternalError.UnexpectedEnumCase();
19242
+ }
19243
+ }
19244
+ write(value: TypeName, into: RustBuffer): void {
19245
+ switch (value) {
19246
+ case ConfirmationStatus.Confirmed:
19247
+ return ordinalConverter.write(1, into);
19248
+ case ConfirmationStatus.Unconfirmed:
19249
+ return ordinalConverter.write(2, into);
19250
+ case ConfirmationStatus.Unverified:
19251
+ return ordinalConverter.write(3, into);
19252
+ }
19253
+ }
19254
+ allocationSize(value: TypeName): number {
19255
+ return ordinalConverter.allocationSize(0);
19256
+ }
19257
+ }
19258
+ return new FFIConverter();
19259
+ })();
19260
+
17753
19261
  // Enum: ConversionChain
17754
19262
  export enum ConversionChain_Tags {
17755
19263
  Spark = 'Spark',
@@ -19155,6 +20663,500 @@ const FfiConverterTypeConversionType = (() => {
19155
20663
  return new FFIConverter();
19156
20664
  })();
19157
20665
 
20666
+ // Enum: CpfpFundingKind
20667
+ export enum CpfpFundingKind_Tags {
20668
+ P2wpkh = 'P2wpkh',
20669
+ P2tr = 'P2tr',
20670
+ Custom = 'Custom',
20671
+ }
20672
+ /**
20673
+ * The kind of UTXO that will fund an exit's fees.
20674
+ */
20675
+ export const CpfpFundingKind = (() => {
20676
+ type P2wpkh__interface = {
20677
+ tag: CpfpFundingKind_Tags.P2wpkh;
20678
+ };
20679
+
20680
+ /**
20681
+ * Fees paid from P2WPKH (native segwit v0) UTXOs.
20682
+ */
20683
+ class P2wpkh_ extends UniffiEnum implements P2wpkh__interface {
20684
+ /**
20685
+ * @private
20686
+ * This field is private and should not be used, use `tag` instead.
20687
+ */
20688
+ readonly [uniffiTypeNameSymbol] = 'CpfpFundingKind';
20689
+ readonly tag = CpfpFundingKind_Tags.P2wpkh;
20690
+ constructor() {
20691
+ super('CpfpFundingKind', 'P2wpkh');
20692
+ }
20693
+
20694
+ static new(): P2wpkh_ {
20695
+ return new P2wpkh_();
20696
+ }
20697
+
20698
+ static instanceOf(obj: any): obj is P2wpkh_ {
20699
+ return obj.tag === CpfpFundingKind_Tags.P2wpkh;
20700
+ }
20701
+ }
20702
+
20703
+ type P2tr__interface = {
20704
+ tag: CpfpFundingKind_Tags.P2tr;
20705
+ };
20706
+
20707
+ /**
20708
+ * Fees paid from P2TR (taproot, key-path) UTXOs.
20709
+ */
20710
+ class P2tr_ extends UniffiEnum implements P2tr__interface {
20711
+ /**
20712
+ * @private
20713
+ * This field is private and should not be used, use `tag` instead.
20714
+ */
20715
+ readonly [uniffiTypeNameSymbol] = 'CpfpFundingKind';
20716
+ readonly tag = CpfpFundingKind_Tags.P2tr;
20717
+ constructor() {
20718
+ super('CpfpFundingKind', 'P2tr');
20719
+ }
20720
+
20721
+ static new(): P2tr_ {
20722
+ return new P2tr_();
20723
+ }
20724
+
20725
+ static instanceOf(obj: any): obj is P2tr_ {
20726
+ return obj.tag === CpfpFundingKind_Tags.P2tr;
20727
+ }
20728
+ }
20729
+
20730
+ type Custom__interface = {
20731
+ tag: CpfpFundingKind_Tags.Custom;
20732
+ inner: Readonly<{
20733
+ scriptPubkeyHex: string;
20734
+ signedInputWeight: /*u64*/ bigint;
20735
+ }>;
20736
+ };
20737
+
20738
+ /**
20739
+ * Fees paid from a custom witness-program script (legacy scripts are
20740
+ * rejected). `script_pubkey_hex` (the funding scriptPubKey) sizes the
20741
+ * fan-out output and dust; `signed_input_weight` (weight units) is an upper
20742
+ * bound on the input's signed weight, so the quote stays exact or slightly
20743
+ * conservative.
20744
+ */
20745
+ class Custom_ extends UniffiEnum implements Custom__interface {
20746
+ /**
20747
+ * @private
20748
+ * This field is private and should not be used, use `tag` instead.
20749
+ */
20750
+ readonly [uniffiTypeNameSymbol] = 'CpfpFundingKind';
20751
+ readonly tag = CpfpFundingKind_Tags.Custom;
20752
+ readonly inner: Readonly<{
20753
+ scriptPubkeyHex: string;
20754
+ signedInputWeight: /*u64*/ bigint;
20755
+ }>;
20756
+ constructor(inner: {
20757
+ scriptPubkeyHex: string;
20758
+ signedInputWeight: /*u64*/ bigint;
20759
+ }) {
20760
+ super('CpfpFundingKind', 'Custom');
20761
+ this.inner = Object.freeze(inner);
20762
+ }
20763
+
20764
+ static new(inner: {
20765
+ scriptPubkeyHex: string;
20766
+ signedInputWeight: /*u64*/ bigint;
20767
+ }): Custom_ {
20768
+ return new Custom_(inner);
20769
+ }
20770
+
20771
+ static instanceOf(obj: any): obj is Custom_ {
20772
+ return obj.tag === CpfpFundingKind_Tags.Custom;
20773
+ }
20774
+ }
20775
+
20776
+ function instanceOf(obj: any): obj is CpfpFundingKind {
20777
+ return obj[uniffiTypeNameSymbol] === 'CpfpFundingKind';
20778
+ }
20779
+
20780
+ return Object.freeze({
20781
+ instanceOf,
20782
+ P2wpkh: P2wpkh_,
20783
+ P2tr: P2tr_,
20784
+ Custom: Custom_,
20785
+ });
20786
+ })();
20787
+
20788
+ /**
20789
+ * The kind of UTXO that will fund an exit's fees.
20790
+ */
20791
+
20792
+ export type CpfpFundingKind = InstanceType<
20793
+ (typeof CpfpFundingKind)[keyof Omit<typeof CpfpFundingKind, 'instanceOf'>]
20794
+ >;
20795
+
20796
+ // FfiConverter for enum CpfpFundingKind
20797
+ const FfiConverterTypeCpfpFundingKind = (() => {
20798
+ const ordinalConverter = FfiConverterInt32;
20799
+ type TypeName = CpfpFundingKind;
20800
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
20801
+ read(from: RustBuffer): TypeName {
20802
+ switch (ordinalConverter.read(from)) {
20803
+ case 1:
20804
+ return new CpfpFundingKind.P2wpkh();
20805
+ case 2:
20806
+ return new CpfpFundingKind.P2tr();
20807
+ case 3:
20808
+ return new CpfpFundingKind.Custom({
20809
+ scriptPubkeyHex: FfiConverterString.read(from),
20810
+ signedInputWeight: FfiConverterUInt64.read(from),
20811
+ });
20812
+ default:
20813
+ throw new UniffiInternalError.UnexpectedEnumCase();
20814
+ }
20815
+ }
20816
+ write(value: TypeName, into: RustBuffer): void {
20817
+ switch (value.tag) {
20818
+ case CpfpFundingKind_Tags.P2wpkh: {
20819
+ ordinalConverter.write(1, into);
20820
+ return;
20821
+ }
20822
+ case CpfpFundingKind_Tags.P2tr: {
20823
+ ordinalConverter.write(2, into);
20824
+ return;
20825
+ }
20826
+ case CpfpFundingKind_Tags.Custom: {
20827
+ ordinalConverter.write(3, into);
20828
+ const inner = value.inner;
20829
+ FfiConverterString.write(inner.scriptPubkeyHex, into);
20830
+ FfiConverterUInt64.write(inner.signedInputWeight, into);
20831
+ return;
20832
+ }
20833
+ default:
20834
+ // Throwing from here means that CpfpFundingKind_Tags hasn't matched an ordinal.
20835
+ throw new UniffiInternalError.UnexpectedEnumCase();
20836
+ }
20837
+ }
20838
+ allocationSize(value: TypeName): number {
20839
+ switch (value.tag) {
20840
+ case CpfpFundingKind_Tags.P2wpkh: {
20841
+ return ordinalConverter.allocationSize(1);
20842
+ }
20843
+ case CpfpFundingKind_Tags.P2tr: {
20844
+ return ordinalConverter.allocationSize(2);
20845
+ }
20846
+ case CpfpFundingKind_Tags.Custom: {
20847
+ const inner = value.inner;
20848
+ let size = ordinalConverter.allocationSize(3);
20849
+ size += FfiConverterString.allocationSize(inner.scriptPubkeyHex);
20850
+ size += FfiConverterUInt64.allocationSize(inner.signedInputWeight);
20851
+ return size;
20852
+ }
20853
+ default:
20854
+ throw new UniffiInternalError.UnexpectedEnumCase();
20855
+ }
20856
+ }
20857
+ }
20858
+ return new FFIConverter();
20859
+ })();
20860
+
20861
+ // Enum: CpfpInput
20862
+ export enum CpfpInput_Tags {
20863
+ P2wpkh = 'P2wpkh',
20864
+ P2tr = 'P2tr',
20865
+ Custom = 'Custom',
20866
+ }
20867
+ /**
20868
+ * A funding UTXO that pays the on-chain fees of a unilateral exit.
20869
+ */
20870
+ export const CpfpInput = (() => {
20871
+ type P2wpkh__interface = {
20872
+ tag: CpfpInput_Tags.P2wpkh;
20873
+ inner: Readonly<{
20874
+ txid: string;
20875
+ vout: /*u32*/ number;
20876
+ value: /*u64*/ bigint;
20877
+ pubkey: string;
20878
+ }>;
20879
+ };
20880
+
20881
+ /**
20882
+ * A P2WPKH (native segwit v0) UTXO controlled by `pubkey` (33-byte
20883
+ * compressed, hex).
20884
+ */
20885
+ class P2wpkh_ extends UniffiEnum implements P2wpkh__interface {
20886
+ /**
20887
+ * @private
20888
+ * This field is private and should not be used, use `tag` instead.
20889
+ */
20890
+ readonly [uniffiTypeNameSymbol] = 'CpfpInput';
20891
+ readonly tag = CpfpInput_Tags.P2wpkh;
20892
+ readonly inner: Readonly<{
20893
+ txid: string;
20894
+ vout: /*u32*/ number;
20895
+ value: /*u64*/ bigint;
20896
+ pubkey: string;
20897
+ }>;
20898
+ constructor(inner: {
20899
+ txid: string;
20900
+ vout: /*u32*/ number;
20901
+ value: /*u64*/ bigint;
20902
+ pubkey: string;
20903
+ }) {
20904
+ super('CpfpInput', 'P2wpkh');
20905
+ this.inner = Object.freeze(inner);
20906
+ }
20907
+
20908
+ static new(inner: {
20909
+ txid: string;
20910
+ vout: /*u32*/ number;
20911
+ value: /*u64*/ bigint;
20912
+ pubkey: string;
20913
+ }): P2wpkh_ {
20914
+ return new P2wpkh_(inner);
20915
+ }
20916
+
20917
+ static instanceOf(obj: any): obj is P2wpkh_ {
20918
+ return obj.tag === CpfpInput_Tags.P2wpkh;
20919
+ }
20920
+ }
20921
+
20922
+ type P2tr__interface = {
20923
+ tag: CpfpInput_Tags.P2tr;
20924
+ inner: Readonly<{
20925
+ txid: string;
20926
+ vout: /*u32*/ number;
20927
+ value: /*u64*/ bigint;
20928
+ pubkey: string;
20929
+ }>;
20930
+ };
20931
+
20932
+ /**
20933
+ * A P2TR (taproot, key-path) UTXO. `pubkey` (x-only or compressed, hex) is
20934
+ * the **internal** (untweaked, BIP86 key-path) public key whose secret signs
20935
+ * the input, not the tweaked on-chain output key. The SDK applies the BIP86
20936
+ * taproot tweak itself to derive the funding scriptPubKey, so passing the
20937
+ * already-tweaked output key here produces a scriptPubKey that does not match
20938
+ * the UTXO and the built transaction is rejected at broadcast.
20939
+ */
20940
+ class P2tr_ extends UniffiEnum implements P2tr__interface {
20941
+ /**
20942
+ * @private
20943
+ * This field is private and should not be used, use `tag` instead.
20944
+ */
20945
+ readonly [uniffiTypeNameSymbol] = 'CpfpInput';
20946
+ readonly tag = CpfpInput_Tags.P2tr;
20947
+ readonly inner: Readonly<{
20948
+ txid: string;
20949
+ vout: /*u32*/ number;
20950
+ value: /*u64*/ bigint;
20951
+ pubkey: string;
20952
+ }>;
20953
+ constructor(inner: {
20954
+ txid: string;
20955
+ vout: /*u32*/ number;
20956
+ value: /*u64*/ bigint;
20957
+ pubkey: string;
20958
+ }) {
20959
+ super('CpfpInput', 'P2tr');
20960
+ this.inner = Object.freeze(inner);
20961
+ }
20962
+
20963
+ static new(inner: {
20964
+ txid: string;
20965
+ vout: /*u32*/ number;
20966
+ value: /*u64*/ bigint;
20967
+ pubkey: string;
20968
+ }): P2tr_ {
20969
+ return new P2tr_(inner);
20970
+ }
20971
+
20972
+ static instanceOf(obj: any): obj is P2tr_ {
20973
+ return obj.tag === CpfpInput_Tags.P2tr;
20974
+ }
20975
+ }
20976
+
20977
+ type Custom__interface = {
20978
+ tag: CpfpInput_Tags.Custom;
20979
+ inner: Readonly<{
20980
+ txid: string;
20981
+ vout: /*u32*/ number;
20982
+ value: /*u64*/ bigint;
20983
+ scriptPubkeyHex: string;
20984
+ signedInputWeight: /*u64*/ bigint;
20985
+ }>;
20986
+ };
20987
+
20988
+ /**
20989
+ * Any witness-program script, signed via a custom `CpfpSigner`. Legacy
20990
+ * (non-SegWit) scripts are rejected. `signed_input_weight` (weight units)
20991
+ * is an upper bound on the input's signed weight, so the fee stays exact,
20992
+ * or slightly conservative if the real signature is shorter.
20993
+ */
20994
+ class Custom_ extends UniffiEnum implements Custom__interface {
20995
+ /**
20996
+ * @private
20997
+ * This field is private and should not be used, use `tag` instead.
20998
+ */
20999
+ readonly [uniffiTypeNameSymbol] = 'CpfpInput';
21000
+ readonly tag = CpfpInput_Tags.Custom;
21001
+ readonly inner: Readonly<{
21002
+ txid: string;
21003
+ vout: /*u32*/ number;
21004
+ value: /*u64*/ bigint;
21005
+ scriptPubkeyHex: string;
21006
+ signedInputWeight: /*u64*/ bigint;
21007
+ }>;
21008
+ constructor(inner: {
21009
+ txid: string;
21010
+ vout: /*u32*/ number;
21011
+ value: /*u64*/ bigint;
21012
+ scriptPubkeyHex: string;
21013
+ signedInputWeight: /*u64*/ bigint;
21014
+ }) {
21015
+ super('CpfpInput', 'Custom');
21016
+ this.inner = Object.freeze(inner);
21017
+ }
21018
+
21019
+ static new(inner: {
21020
+ txid: string;
21021
+ vout: /*u32*/ number;
21022
+ value: /*u64*/ bigint;
21023
+ scriptPubkeyHex: string;
21024
+ signedInputWeight: /*u64*/ bigint;
21025
+ }): Custom_ {
21026
+ return new Custom_(inner);
21027
+ }
21028
+
21029
+ static instanceOf(obj: any): obj is Custom_ {
21030
+ return obj.tag === CpfpInput_Tags.Custom;
21031
+ }
21032
+ }
21033
+
21034
+ function instanceOf(obj: any): obj is CpfpInput {
21035
+ return obj[uniffiTypeNameSymbol] === 'CpfpInput';
21036
+ }
21037
+
21038
+ return Object.freeze({
21039
+ instanceOf,
21040
+ P2wpkh: P2wpkh_,
21041
+ P2tr: P2tr_,
21042
+ Custom: Custom_,
21043
+ });
21044
+ })();
21045
+
21046
+ /**
21047
+ * A funding UTXO that pays the on-chain fees of a unilateral exit.
21048
+ */
21049
+
21050
+ export type CpfpInput = InstanceType<
21051
+ (typeof CpfpInput)[keyof Omit<typeof CpfpInput, 'instanceOf'>]
21052
+ >;
21053
+
21054
+ // FfiConverter for enum CpfpInput
21055
+ const FfiConverterTypeCpfpInput = (() => {
21056
+ const ordinalConverter = FfiConverterInt32;
21057
+ type TypeName = CpfpInput;
21058
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
21059
+ read(from: RustBuffer): TypeName {
21060
+ switch (ordinalConverter.read(from)) {
21061
+ case 1:
21062
+ return new CpfpInput.P2wpkh({
21063
+ txid: FfiConverterString.read(from),
21064
+ vout: FfiConverterUInt32.read(from),
21065
+ value: FfiConverterUInt64.read(from),
21066
+ pubkey: FfiConverterString.read(from),
21067
+ });
21068
+ case 2:
21069
+ return new CpfpInput.P2tr({
21070
+ txid: FfiConverterString.read(from),
21071
+ vout: FfiConverterUInt32.read(from),
21072
+ value: FfiConverterUInt64.read(from),
21073
+ pubkey: FfiConverterString.read(from),
21074
+ });
21075
+ case 3:
21076
+ return new CpfpInput.Custom({
21077
+ txid: FfiConverterString.read(from),
21078
+ vout: FfiConverterUInt32.read(from),
21079
+ value: FfiConverterUInt64.read(from),
21080
+ scriptPubkeyHex: FfiConverterString.read(from),
21081
+ signedInputWeight: FfiConverterUInt64.read(from),
21082
+ });
21083
+ default:
21084
+ throw new UniffiInternalError.UnexpectedEnumCase();
21085
+ }
21086
+ }
21087
+ write(value: TypeName, into: RustBuffer): void {
21088
+ switch (value.tag) {
21089
+ case CpfpInput_Tags.P2wpkh: {
21090
+ ordinalConverter.write(1, into);
21091
+ const inner = value.inner;
21092
+ FfiConverterString.write(inner.txid, into);
21093
+ FfiConverterUInt32.write(inner.vout, into);
21094
+ FfiConverterUInt64.write(inner.value, into);
21095
+ FfiConverterString.write(inner.pubkey, into);
21096
+ return;
21097
+ }
21098
+ case CpfpInput_Tags.P2tr: {
21099
+ ordinalConverter.write(2, into);
21100
+ const inner = value.inner;
21101
+ FfiConverterString.write(inner.txid, into);
21102
+ FfiConverterUInt32.write(inner.vout, into);
21103
+ FfiConverterUInt64.write(inner.value, into);
21104
+ FfiConverterString.write(inner.pubkey, into);
21105
+ return;
21106
+ }
21107
+ case CpfpInput_Tags.Custom: {
21108
+ ordinalConverter.write(3, into);
21109
+ const inner = value.inner;
21110
+ FfiConverterString.write(inner.txid, into);
21111
+ FfiConverterUInt32.write(inner.vout, into);
21112
+ FfiConverterUInt64.write(inner.value, into);
21113
+ FfiConverterString.write(inner.scriptPubkeyHex, into);
21114
+ FfiConverterUInt64.write(inner.signedInputWeight, into);
21115
+ return;
21116
+ }
21117
+ default:
21118
+ // Throwing from here means that CpfpInput_Tags hasn't matched an ordinal.
21119
+ throw new UniffiInternalError.UnexpectedEnumCase();
21120
+ }
21121
+ }
21122
+ allocationSize(value: TypeName): number {
21123
+ switch (value.tag) {
21124
+ case CpfpInput_Tags.P2wpkh: {
21125
+ const inner = value.inner;
21126
+ let size = ordinalConverter.allocationSize(1);
21127
+ size += FfiConverterString.allocationSize(inner.txid);
21128
+ size += FfiConverterUInt32.allocationSize(inner.vout);
21129
+ size += FfiConverterUInt64.allocationSize(inner.value);
21130
+ size += FfiConverterString.allocationSize(inner.pubkey);
21131
+ return size;
21132
+ }
21133
+ case CpfpInput_Tags.P2tr: {
21134
+ const inner = value.inner;
21135
+ let size = ordinalConverter.allocationSize(2);
21136
+ size += FfiConverterString.allocationSize(inner.txid);
21137
+ size += FfiConverterUInt32.allocationSize(inner.vout);
21138
+ size += FfiConverterUInt64.allocationSize(inner.value);
21139
+ size += FfiConverterString.allocationSize(inner.pubkey);
21140
+ return size;
21141
+ }
21142
+ case CpfpInput_Tags.Custom: {
21143
+ const inner = value.inner;
21144
+ let size = ordinalConverter.allocationSize(3);
21145
+ size += FfiConverterString.allocationSize(inner.txid);
21146
+ size += FfiConverterUInt32.allocationSize(inner.vout);
21147
+ size += FfiConverterUInt64.allocationSize(inner.value);
21148
+ size += FfiConverterString.allocationSize(inner.scriptPubkeyHex);
21149
+ size += FfiConverterUInt64.allocationSize(inner.signedInputWeight);
21150
+ return size;
21151
+ }
21152
+ default:
21153
+ throw new UniffiInternalError.UnexpectedEnumCase();
21154
+ }
21155
+ }
21156
+ }
21157
+ return new FFIConverter();
21158
+ })();
21159
+
19158
21160
  export enum CrossChainAddressFamily {
19159
21161
  Evm,
19160
21162
  Solana,
@@ -20187,6 +22189,149 @@ const FfiConverterTypeErrorKind = (() => {
20187
22189
  return new FFIConverter();
20188
22190
  })();
20189
22191
 
22192
+ // Enum: ExitLeafSelection
22193
+ export enum ExitLeafSelection_Tags {
22194
+ Auto = 'Auto',
22195
+ Specific = 'Specific',
22196
+ }
22197
+ /**
22198
+ * Which leaves to exit.
22199
+ */
22200
+ export const ExitLeafSelection = (() => {
22201
+ type Auto__interface = {
22202
+ tag: ExitLeafSelection_Tags.Auto;
22203
+ };
22204
+
22205
+ /**
22206
+ * Exit every leaf whose value exceeds its own marginal exit cost (its tree
22207
+ * and refund CPFP fees plus its sweep input). This per-leaf test does not
22208
+ * include the shared fan-out fee, so funding many leaves from a single UTXO
22209
+ * adds `fanout_fee_sat` on top: compare `recoverable_value_sat` with
22210
+ * `total_fee_sat`, or fund one UTXO per branch to avoid the fan-out. Leaves
22211
+ * that fail the per-leaf test are skipped.
22212
+ */
22213
+ class Auto_ extends UniffiEnum implements Auto__interface {
22214
+ /**
22215
+ * @private
22216
+ * This field is private and should not be used, use `tag` instead.
22217
+ */
22218
+ readonly [uniffiTypeNameSymbol] = 'ExitLeafSelection';
22219
+ readonly tag = ExitLeafSelection_Tags.Auto;
22220
+ constructor() {
22221
+ super('ExitLeafSelection', 'Auto');
22222
+ }
22223
+
22224
+ static new(): Auto_ {
22225
+ return new Auto_();
22226
+ }
22227
+
22228
+ static instanceOf(obj: any): obj is Auto_ {
22229
+ return obj.tag === ExitLeafSelection_Tags.Auto;
22230
+ }
22231
+ }
22232
+
22233
+ type Specific__interface = {
22234
+ tag: ExitLeafSelection_Tags.Specific;
22235
+ inner: Readonly<{ leafIds: Array<string> }>;
22236
+ };
22237
+
22238
+ /**
22239
+ * Exit exactly these leaves, regardless of profitability.
22240
+ */
22241
+ class Specific_ extends UniffiEnum implements Specific__interface {
22242
+ /**
22243
+ * @private
22244
+ * This field is private and should not be used, use `tag` instead.
22245
+ */
22246
+ readonly [uniffiTypeNameSymbol] = 'ExitLeafSelection';
22247
+ readonly tag = ExitLeafSelection_Tags.Specific;
22248
+ readonly inner: Readonly<{ leafIds: Array<string> }>;
22249
+ constructor(inner: { leafIds: Array<string> }) {
22250
+ super('ExitLeafSelection', 'Specific');
22251
+ this.inner = Object.freeze(inner);
22252
+ }
22253
+
22254
+ static new(inner: { leafIds: Array<string> }): Specific_ {
22255
+ return new Specific_(inner);
22256
+ }
22257
+
22258
+ static instanceOf(obj: any): obj is Specific_ {
22259
+ return obj.tag === ExitLeafSelection_Tags.Specific;
22260
+ }
22261
+ }
22262
+
22263
+ function instanceOf(obj: any): obj is ExitLeafSelection {
22264
+ return obj[uniffiTypeNameSymbol] === 'ExitLeafSelection';
22265
+ }
22266
+
22267
+ return Object.freeze({
22268
+ instanceOf,
22269
+ Auto: Auto_,
22270
+ Specific: Specific_,
22271
+ });
22272
+ })();
22273
+
22274
+ /**
22275
+ * Which leaves to exit.
22276
+ */
22277
+
22278
+ export type ExitLeafSelection = InstanceType<
22279
+ (typeof ExitLeafSelection)[keyof Omit<typeof ExitLeafSelection, 'instanceOf'>]
22280
+ >;
22281
+
22282
+ // FfiConverter for enum ExitLeafSelection
22283
+ const FfiConverterTypeExitLeafSelection = (() => {
22284
+ const ordinalConverter = FfiConverterInt32;
22285
+ type TypeName = ExitLeafSelection;
22286
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
22287
+ read(from: RustBuffer): TypeName {
22288
+ switch (ordinalConverter.read(from)) {
22289
+ case 1:
22290
+ return new ExitLeafSelection.Auto();
22291
+ case 2:
22292
+ return new ExitLeafSelection.Specific({
22293
+ leafIds: FfiConverterArrayString.read(from),
22294
+ });
22295
+ default:
22296
+ throw new UniffiInternalError.UnexpectedEnumCase();
22297
+ }
22298
+ }
22299
+ write(value: TypeName, into: RustBuffer): void {
22300
+ switch (value.tag) {
22301
+ case ExitLeafSelection_Tags.Auto: {
22302
+ ordinalConverter.write(1, into);
22303
+ return;
22304
+ }
22305
+ case ExitLeafSelection_Tags.Specific: {
22306
+ ordinalConverter.write(2, into);
22307
+ const inner = value.inner;
22308
+ FfiConverterArrayString.write(inner.leafIds, into);
22309
+ return;
22310
+ }
22311
+ default:
22312
+ // Throwing from here means that ExitLeafSelection_Tags hasn't matched an ordinal.
22313
+ throw new UniffiInternalError.UnexpectedEnumCase();
22314
+ }
22315
+ }
22316
+ allocationSize(value: TypeName): number {
22317
+ switch (value.tag) {
22318
+ case ExitLeafSelection_Tags.Auto: {
22319
+ return ordinalConverter.allocationSize(1);
22320
+ }
22321
+ case ExitLeafSelection_Tags.Specific: {
22322
+ const inner = value.inner;
22323
+ let size = ordinalConverter.allocationSize(2);
22324
+ size += FfiConverterArrayString.allocationSize(inner.leafIds);
22325
+ return size;
22326
+ }
22327
+ default:
22328
+ throw new UniffiInternalError.UnexpectedEnumCase();
22329
+ }
22330
+ }
22331
+ }
22332
+ return new FFIConverter();
22333
+ })();
22334
+
20190
22335
  // Enum: ExternalFrostDerivation
20191
22336
  export enum ExternalFrostDerivation_Tags {
20192
22337
  SigningLeaf = 'SigningLeaf',
@@ -22060,6 +24205,160 @@ const FfiConverterTypeOptimizationOutcome = (() => {
22060
24205
  return new FFIConverter();
22061
24206
  })();
22062
24207
 
24208
+ // Enum: Outspend
24209
+ export enum Outspend_Tags {
24210
+ Unspent = 'Unspent',
24211
+ Spent = 'Spent',
24212
+ }
24213
+ /**
24214
+ * The spend status of a transaction output.
24215
+ */
24216
+ export const Outspend = (() => {
24217
+ type Unspent__interface = {
24218
+ tag: Outspend_Tags.Unspent;
24219
+ };
24220
+
24221
+ class Unspent_ extends UniffiEnum implements Unspent__interface {
24222
+ /**
24223
+ * @private
24224
+ * This field is private and should not be used, use `tag` instead.
24225
+ */
24226
+ readonly [uniffiTypeNameSymbol] = 'Outspend';
24227
+ readonly tag = Outspend_Tags.Unspent;
24228
+ constructor() {
24229
+ super('Outspend', 'Unspent');
24230
+ }
24231
+
24232
+ static new(): Unspent_ {
24233
+ return new Unspent_();
24234
+ }
24235
+
24236
+ static instanceOf(obj: any): obj is Unspent_ {
24237
+ return obj.tag === Outspend_Tags.Unspent;
24238
+ }
24239
+ }
24240
+
24241
+ type Spent__interface = {
24242
+ tag: Outspend_Tags.Spent;
24243
+ inner: Readonly<{ txid: string; vin: /*u32*/ number; status: TxStatus }>;
24244
+ };
24245
+
24246
+ /**
24247
+ * The output is spent by input `vin` of transaction `txid`; `status` is
24248
+ * that spending transaction's confirmation status.
24249
+ */
24250
+ class Spent_ extends UniffiEnum implements Spent__interface {
24251
+ /**
24252
+ * @private
24253
+ * This field is private and should not be used, use `tag` instead.
24254
+ */
24255
+ readonly [uniffiTypeNameSymbol] = 'Outspend';
24256
+ readonly tag = Outspend_Tags.Spent;
24257
+ readonly inner: Readonly<{
24258
+ txid: string;
24259
+ vin: /*u32*/ number;
24260
+ status: TxStatus;
24261
+ }>;
24262
+ constructor(inner: {
24263
+ txid: string;
24264
+ vin: /*u32*/ number;
24265
+ status: TxStatus;
24266
+ }) {
24267
+ super('Outspend', 'Spent');
24268
+ this.inner = Object.freeze(inner);
24269
+ }
24270
+
24271
+ static new(inner: {
24272
+ txid: string;
24273
+ vin: /*u32*/ number;
24274
+ status: TxStatus;
24275
+ }): Spent_ {
24276
+ return new Spent_(inner);
24277
+ }
24278
+
24279
+ static instanceOf(obj: any): obj is Spent_ {
24280
+ return obj.tag === Outspend_Tags.Spent;
24281
+ }
24282
+ }
24283
+
24284
+ function instanceOf(obj: any): obj is Outspend {
24285
+ return obj[uniffiTypeNameSymbol] === 'Outspend';
24286
+ }
24287
+
24288
+ return Object.freeze({
24289
+ instanceOf,
24290
+ Unspent: Unspent_,
24291
+ Spent: Spent_,
24292
+ });
24293
+ })();
24294
+
24295
+ /**
24296
+ * The spend status of a transaction output.
24297
+ */
24298
+
24299
+ export type Outspend = InstanceType<
24300
+ (typeof Outspend)[keyof Omit<typeof Outspend, 'instanceOf'>]
24301
+ >;
24302
+
24303
+ // FfiConverter for enum Outspend
24304
+ const FfiConverterTypeOutspend = (() => {
24305
+ const ordinalConverter = FfiConverterInt32;
24306
+ type TypeName = Outspend;
24307
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
24308
+ read(from: RustBuffer): TypeName {
24309
+ switch (ordinalConverter.read(from)) {
24310
+ case 1:
24311
+ return new Outspend.Unspent();
24312
+ case 2:
24313
+ return new Outspend.Spent({
24314
+ txid: FfiConverterString.read(from),
24315
+ vin: FfiConverterUInt32.read(from),
24316
+ status: FfiConverterTypeTxStatus.read(from),
24317
+ });
24318
+ default:
24319
+ throw new UniffiInternalError.UnexpectedEnumCase();
24320
+ }
24321
+ }
24322
+ write(value: TypeName, into: RustBuffer): void {
24323
+ switch (value.tag) {
24324
+ case Outspend_Tags.Unspent: {
24325
+ ordinalConverter.write(1, into);
24326
+ return;
24327
+ }
24328
+ case Outspend_Tags.Spent: {
24329
+ ordinalConverter.write(2, into);
24330
+ const inner = value.inner;
24331
+ FfiConverterString.write(inner.txid, into);
24332
+ FfiConverterUInt32.write(inner.vin, into);
24333
+ FfiConverterTypeTxStatus.write(inner.status, into);
24334
+ return;
24335
+ }
24336
+ default:
24337
+ // Throwing from here means that Outspend_Tags hasn't matched an ordinal.
24338
+ throw new UniffiInternalError.UnexpectedEnumCase();
24339
+ }
24340
+ }
24341
+ allocationSize(value: TypeName): number {
24342
+ switch (value.tag) {
24343
+ case Outspend_Tags.Unspent: {
24344
+ return ordinalConverter.allocationSize(1);
24345
+ }
24346
+ case Outspend_Tags.Spent: {
24347
+ const inner = value.inner;
24348
+ let size = ordinalConverter.allocationSize(2);
24349
+ size += FfiConverterString.allocationSize(inner.txid);
24350
+ size += FfiConverterUInt32.allocationSize(inner.vin);
24351
+ size += FfiConverterTypeTxStatus.allocationSize(inner.status);
24352
+ return size;
24353
+ }
24354
+ default:
24355
+ throw new UniffiInternalError.UnexpectedEnumCase();
24356
+ }
24357
+ }
24358
+ }
24359
+ return new FFIConverter();
24360
+ })();
24361
+
22063
24362
  // Enum: PasskeyAvailability
22064
24363
  export enum PasskeyAvailability_Tags {
22065
24364
  Available = 'Available',
@@ -22318,6 +24617,7 @@ export enum PasskeyError_Tags {
22318
24617
  InvalidPrfOutput = 'InvalidPrfOutput',
22319
24618
  MnemonicError = 'MnemonicError',
22320
24619
  InvalidSalt = 'InvalidSalt',
24620
+ CreatedButNotDerived = 'CreatedButNotDerived',
22321
24621
  Generic = 'Generic',
22322
24622
  }
22323
24623
  /**
@@ -22625,6 +24925,66 @@ export const PasskeyError = (() => {
22625
24925
  }
22626
24926
  }
22627
24927
 
24928
+ type CreatedButNotDerived__interface = {
24929
+ tag: PasskeyError_Tags.CreatedButNotDerived;
24930
+ inner: Readonly<{ credentialId: ArrayBuffer; source: PrfProviderError }>;
24931
+ };
24932
+
24933
+ /**
24934
+ * Registration created the credential, then the derive that
24935
+ * followed it failed. The passkey exists on the device: recover by
24936
+ * signing in pinned to `credential_id`. Registering again would
24937
+ * leave this one behind, owning a wallet nothing points to.
24938
+ *
24939
+ * Only wraps a [`PrfProviderError`], so hosts unwrap once and keep
24940
+ * the arms they already have. Failures that are not the
24941
+ * authenticator's (mnemonic, key derivation, invalid PRF output)
24942
+ * propagate as their own variant, unwrapped.
24943
+ */
24944
+ class CreatedButNotDerived_
24945
+ extends UniffiError
24946
+ implements CreatedButNotDerived__interface
24947
+ {
24948
+ /**
24949
+ * @private
24950
+ * This field is private and should not be used, use `tag` instead.
24951
+ */
24952
+ readonly [uniffiTypeNameSymbol] = 'PasskeyError';
24953
+ readonly tag = PasskeyError_Tags.CreatedButNotDerived;
24954
+ readonly inner: Readonly<{
24955
+ credentialId: ArrayBuffer;
24956
+ source: PrfProviderError;
24957
+ }>;
24958
+ constructor(inner: {
24959
+ credentialId: ArrayBuffer;
24960
+ source: PrfProviderError;
24961
+ }) {
24962
+ super('PasskeyError', 'CreatedButNotDerived');
24963
+ this.inner = Object.freeze(inner);
24964
+ }
24965
+
24966
+ static new(inner: {
24967
+ credentialId: ArrayBuffer;
24968
+ source: PrfProviderError;
24969
+ }): CreatedButNotDerived_ {
24970
+ return new CreatedButNotDerived_(inner);
24971
+ }
24972
+
24973
+ static instanceOf(obj: any): obj is CreatedButNotDerived_ {
24974
+ return obj.tag === PasskeyError_Tags.CreatedButNotDerived;
24975
+ }
24976
+
24977
+ static hasInner(obj: any): obj is CreatedButNotDerived_ {
24978
+ return CreatedButNotDerived_.instanceOf(obj);
24979
+ }
24980
+
24981
+ static getInner(
24982
+ obj: CreatedButNotDerived_
24983
+ ): Readonly<{ credentialId: ArrayBuffer; source: PrfProviderError }> {
24984
+ return obj.inner;
24985
+ }
24986
+ }
24987
+
22628
24988
  type Generic__interface = {
22629
24989
  tag: PasskeyError_Tags.Generic;
22630
24990
  inner: Readonly<[string]>;
@@ -22674,6 +25034,7 @@ export const PasskeyError = (() => {
22674
25034
  InvalidPrfOutput: InvalidPrfOutput_,
22675
25035
  MnemonicError: MnemonicError_,
22676
25036
  InvalidSalt: InvalidSalt_,
25037
+ CreatedButNotDerived: CreatedButNotDerived_,
22677
25038
  Generic: Generic_,
22678
25039
  });
22679
25040
  })();
@@ -22722,6 +25083,11 @@ const FfiConverterTypePasskeyError = (() => {
22722
25083
  case 8:
22723
25084
  return new PasskeyError.InvalidSalt(FfiConverterString.read(from));
22724
25085
  case 9:
25086
+ return new PasskeyError.CreatedButNotDerived({
25087
+ credentialId: FfiConverterArrayBuffer.read(from),
25088
+ source: FfiConverterTypePrfProviderError.read(from),
25089
+ });
25090
+ case 10:
22725
25091
  return new PasskeyError.Generic(FfiConverterString.read(from));
22726
25092
  default:
22727
25093
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -22777,9 +25143,16 @@ const FfiConverterTypePasskeyError = (() => {
22777
25143
  FfiConverterString.write(inner[0], into);
22778
25144
  return;
22779
25145
  }
22780
- case PasskeyError_Tags.Generic: {
25146
+ case PasskeyError_Tags.CreatedButNotDerived: {
22781
25147
  ordinalConverter.write(9, into);
22782
25148
  const inner = value.inner;
25149
+ FfiConverterArrayBuffer.write(inner.credentialId, into);
25150
+ FfiConverterTypePrfProviderError.write(inner.source, into);
25151
+ return;
25152
+ }
25153
+ case PasskeyError_Tags.Generic: {
25154
+ ordinalConverter.write(10, into);
25155
+ const inner = value.inner;
22783
25156
  FfiConverterString.write(inner[0], into);
22784
25157
  return;
22785
25158
  }
@@ -22838,9 +25211,16 @@ const FfiConverterTypePasskeyError = (() => {
22838
25211
  size += FfiConverterString.allocationSize(inner[0]);
22839
25212
  return size;
22840
25213
  }
22841
- case PasskeyError_Tags.Generic: {
25214
+ case PasskeyError_Tags.CreatedButNotDerived: {
22842
25215
  const inner = value.inner;
22843
25216
  let size = ordinalConverter.allocationSize(9);
25217
+ size += FfiConverterArrayBuffer.allocationSize(inner.credentialId);
25218
+ size += FfiConverterTypePrfProviderError.allocationSize(inner.source);
25219
+ return size;
25220
+ }
25221
+ case PasskeyError_Tags.Generic: {
25222
+ const inner = value.inner;
25223
+ let size = ordinalConverter.allocationSize(10);
22844
25224
  size += FfiConverterString.allocationSize(inner[0]);
22845
25225
  return size;
22846
25226
  }
@@ -25060,6 +27440,7 @@ const FfiConverterTypePublishSignedLnurlPayResponse = (() => {
25060
27440
  export enum PublishSignedTransferPackageResponse_Tags {
25061
27441
  SwapCompleted = 'SwapCompleted',
25062
27442
  PaymentSent = 'PaymentSent',
27443
+ PaymentsSent = 'PaymentsSent',
25063
27444
  }
25064
27445
  export const PublishSignedTransferPackageResponse = (() => {
25065
27446
  type SwapCompleted__interface = {
@@ -25115,6 +27496,37 @@ export const PublishSignedTransferPackageResponse = (() => {
25115
27496
  }
25116
27497
  }
25117
27498
 
27499
+ type PaymentsSent__interface = {
27500
+ tag: PublishSignedTransferPackageResponse_Tags.PaymentsSent;
27501
+ inner: Readonly<{ payments: Array<Payment> }>;
27502
+ };
27503
+
27504
+ /**
27505
+ * Returned for a batch package: one payment per recipient, in recipient
27506
+ * order.
27507
+ */
27508
+ class PaymentsSent_ extends UniffiEnum implements PaymentsSent__interface {
27509
+ /**
27510
+ * @private
27511
+ * This field is private and should not be used, use `tag` instead.
27512
+ */
27513
+ readonly [uniffiTypeNameSymbol] = 'PublishSignedTransferPackageResponse';
27514
+ readonly tag = PublishSignedTransferPackageResponse_Tags.PaymentsSent;
27515
+ readonly inner: Readonly<{ payments: Array<Payment> }>;
27516
+ constructor(inner: { payments: Array<Payment> }) {
27517
+ super('PublishSignedTransferPackageResponse', 'PaymentsSent');
27518
+ this.inner = Object.freeze(inner);
27519
+ }
27520
+
27521
+ static new(inner: { payments: Array<Payment> }): PaymentsSent_ {
27522
+ return new PaymentsSent_(inner);
27523
+ }
27524
+
27525
+ static instanceOf(obj: any): obj is PaymentsSent_ {
27526
+ return obj.tag === PublishSignedTransferPackageResponse_Tags.PaymentsSent;
27527
+ }
27528
+ }
27529
+
25118
27530
  function instanceOf(obj: any): obj is PublishSignedTransferPackageResponse {
25119
27531
  return obj[uniffiTypeNameSymbol] === 'PublishSignedTransferPackageResponse';
25120
27532
  }
@@ -25123,6 +27535,7 @@ export const PublishSignedTransferPackageResponse = (() => {
25123
27535
  instanceOf,
25124
27536
  SwapCompleted: SwapCompleted_,
25125
27537
  PaymentSent: PaymentSent_,
27538
+ PaymentsSent: PaymentsSent_,
25126
27539
  });
25127
27540
  })();
25128
27541
 
@@ -25146,6 +27559,10 @@ const FfiConverterTypePublishSignedTransferPackageResponse = (() => {
25146
27559
  return new PublishSignedTransferPackageResponse.PaymentSent({
25147
27560
  payment: FfiConverterTypePayment.read(from),
25148
27561
  });
27562
+ case 3:
27563
+ return new PublishSignedTransferPackageResponse.PaymentsSent({
27564
+ payments: FfiConverterArrayTypePayment.read(from),
27565
+ });
25149
27566
  default:
25150
27567
  throw new UniffiInternalError.UnexpectedEnumCase();
25151
27568
  }
@@ -25162,6 +27579,12 @@ const FfiConverterTypePublishSignedTransferPackageResponse = (() => {
25162
27579
  FfiConverterTypePayment.write(inner.payment, into);
25163
27580
  return;
25164
27581
  }
27582
+ case PublishSignedTransferPackageResponse_Tags.PaymentsSent: {
27583
+ ordinalConverter.write(3, into);
27584
+ const inner = value.inner;
27585
+ FfiConverterArrayTypePayment.write(inner.payments, into);
27586
+ return;
27587
+ }
25165
27588
  default:
25166
27589
  // Throwing from here means that PublishSignedTransferPackageResponse_Tags hasn't matched an ordinal.
25167
27590
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -25178,6 +27601,12 @@ const FfiConverterTypePublishSignedTransferPackageResponse = (() => {
25178
27601
  size += FfiConverterTypePayment.allocationSize(inner.payment);
25179
27602
  return size;
25180
27603
  }
27604
+ case PublishSignedTransferPackageResponse_Tags.PaymentsSent: {
27605
+ const inner = value.inner;
27606
+ let size = ordinalConverter.allocationSize(3);
27607
+ size += FfiConverterArrayTypePayment.allocationSize(inner.payments);
27608
+ return size;
27609
+ }
25181
27610
  default:
25182
27611
  throw new UniffiInternalError.UnexpectedEnumCase();
25183
27612
  }
@@ -25539,6 +27968,8 @@ export enum SdkError_Tags {
25539
27968
  Signer = 'Signer',
25540
27969
  OptimizationAlreadyRunning = 'OptimizationAlreadyRunning',
25541
27970
  OptimizationCancelled = 'OptimizationCancelled',
27971
+ InsufficientCpfpFunds = 'InsufficientCpfpFunds',
27972
+ FundingUtxoConflict = 'FundingUtxoConflict',
25542
27973
  Generic = 'Generic',
25543
27974
  }
25544
27975
  /**
@@ -25582,6 +28013,7 @@ export const SdkError = (() => {
25582
28013
 
25583
28014
  type InsufficientFunds__interface = {
25584
28015
  tag: SdkError_Tags.InsufficientFunds;
28016
+ inner: Readonly<{ tokenIdentifier: string | undefined }>;
25585
28017
  };
25586
28018
 
25587
28019
  class InsufficientFunds_
@@ -25594,12 +28026,24 @@ export const SdkError = (() => {
25594
28026
  */
25595
28027
  readonly [uniffiTypeNameSymbol] = 'SdkError';
25596
28028
  readonly tag = SdkError_Tags.InsufficientFunds;
25597
- constructor() {
28029
+ readonly inner: Readonly<{ tokenIdentifier: string | undefined }>;
28030
+ constructor(inner: {
28031
+ /**
28032
+ * The token that cannot cover the payment. Unset when the shortfall is
28033
+ * in sats or when no single token can be named.
28034
+ */ tokenIdentifier: string | undefined;
28035
+ }) {
25598
28036
  super('SdkError', 'InsufficientFunds');
28037
+ this.inner = Object.freeze(inner);
25599
28038
  }
25600
28039
 
25601
- static new(): InsufficientFunds_ {
25602
- return new InsufficientFunds_();
28040
+ static new(inner: {
28041
+ /**
28042
+ * The token that cannot cover the payment. Unset when the shortfall is
28043
+ * in sats or when no single token can be named.
28044
+ */ tokenIdentifier: string | undefined;
28045
+ }): InsufficientFunds_ {
28046
+ return new InsufficientFunds_(inner);
25603
28047
  }
25604
28048
 
25605
28049
  static instanceOf(obj: any): obj is InsufficientFunds_ {
@@ -25607,7 +28051,13 @@ export const SdkError = (() => {
25607
28051
  }
25608
28052
 
25609
28053
  static hasInner(obj: any): obj is InsufficientFunds_ {
25610
- return false;
28054
+ return InsufficientFunds_.instanceOf(obj);
28055
+ }
28056
+
28057
+ static getInner(
28058
+ obj: InsufficientFunds_
28059
+ ): Readonly<{ tokenIdentifier: string | undefined }> {
28060
+ return obj.inner;
25611
28061
  }
25612
28062
  }
25613
28063
 
@@ -26045,6 +28495,96 @@ export const SdkError = (() => {
26045
28495
  }
26046
28496
  }
26047
28497
 
28498
+ type InsufficientCpfpFunds__interface = {
28499
+ tag: SdkError_Tags.InsufficientCpfpFunds;
28500
+ inner: Readonly<{ requiredSat: /*u64*/ bigint }>;
28501
+ };
28502
+
28503
+ /**
28504
+ * The provided CPFP funding is too low to cover the exit's on-chain fees.
28505
+ */
28506
+ class InsufficientCpfpFunds_
28507
+ extends UniffiError
28508
+ implements InsufficientCpfpFunds__interface
28509
+ {
28510
+ /**
28511
+ * @private
28512
+ * This field is private and should not be used, use `tag` instead.
28513
+ */
28514
+ readonly [uniffiTypeNameSymbol] = 'SdkError';
28515
+ readonly tag = SdkError_Tags.InsufficientCpfpFunds;
28516
+ readonly inner: Readonly<{ requiredSat: /*u64*/ bigint }>;
28517
+ constructor(inner: { requiredSat: /*u64*/ bigint }) {
28518
+ super('SdkError', 'InsufficientCpfpFunds');
28519
+ this.inner = Object.freeze(inner);
28520
+ }
28521
+
28522
+ static new(inner: { requiredSat: /*u64*/ bigint }): InsufficientCpfpFunds_ {
28523
+ return new InsufficientCpfpFunds_(inner);
28524
+ }
28525
+
28526
+ static instanceOf(obj: any): obj is InsufficientCpfpFunds_ {
28527
+ return obj.tag === SdkError_Tags.InsufficientCpfpFunds;
28528
+ }
28529
+
28530
+ static hasInner(obj: any): obj is InsufficientCpfpFunds_ {
28531
+ return InsufficientCpfpFunds_.instanceOf(obj);
28532
+ }
28533
+
28534
+ static getInner(
28535
+ obj: InsufficientCpfpFunds_
28536
+ ): Readonly<{ requiredSat: /*u64*/ bigint }> {
28537
+ return obj.inner;
28538
+ }
28539
+ }
28540
+
28541
+ type FundingUtxoConflict__interface = {
28542
+ tag: SdkError_Tags.FundingUtxoConflict;
28543
+ inner: Readonly<{ txid: string; vout: /*u32*/ number }>;
28544
+ };
28545
+
28546
+ /**
28547
+ * A provided funding UTXO was already spent on-chain by a transaction that
28548
+ * is not the expected fan-out, so it cannot fund this exit.
28549
+ */
28550
+ class FundingUtxoConflict_
28551
+ extends UniffiError
28552
+ implements FundingUtxoConflict__interface
28553
+ {
28554
+ /**
28555
+ * @private
28556
+ * This field is private and should not be used, use `tag` instead.
28557
+ */
28558
+ readonly [uniffiTypeNameSymbol] = 'SdkError';
28559
+ readonly tag = SdkError_Tags.FundingUtxoConflict;
28560
+ readonly inner: Readonly<{ txid: string; vout: /*u32*/ number }>;
28561
+ constructor(inner: { txid: string; vout: /*u32*/ number }) {
28562
+ super('SdkError', 'FundingUtxoConflict');
28563
+ this.inner = Object.freeze(inner);
28564
+ }
28565
+
28566
+ static new(inner: {
28567
+ txid: string;
28568
+ vout: /*u32*/ number;
28569
+ }): FundingUtxoConflict_ {
28570
+ return new FundingUtxoConflict_(inner);
28571
+ }
28572
+
28573
+ static instanceOf(obj: any): obj is FundingUtxoConflict_ {
28574
+ return obj.tag === SdkError_Tags.FundingUtxoConflict;
28575
+ }
28576
+
28577
+ static hasInner(obj: any): obj is FundingUtxoConflict_ {
28578
+ return FundingUtxoConflict_.instanceOf(obj);
28579
+ }
28580
+
28581
+ static getInner(
28582
+ obj: FundingUtxoConflict_
28583
+ ): Readonly<{ txid: string; vout: /*u32*/ number }> {
28584
+ return obj.inner;
28585
+ }
28586
+ }
28587
+
26048
28588
  type Generic__interface = {
26049
28589
  tag: SdkError_Tags.Generic;
26050
28590
  inner: Readonly<[string]>;
@@ -26099,6 +28639,8 @@ export const SdkError = (() => {
26099
28639
  Signer: Signer_,
26100
28640
  OptimizationAlreadyRunning: OptimizationAlreadyRunning_,
26101
28641
  OptimizationCancelled: OptimizationCancelled_,
28642
+ InsufficientCpfpFunds: InsufficientCpfpFunds_,
28643
+ FundingUtxoConflict: FundingUtxoConflict_,
26102
28644
  Generic: Generic_,
26103
28645
  });
26104
28646
  })();
@@ -26121,7 +28663,9 @@ const FfiConverterTypeSdkError = (() => {
26121
28663
  case 1:
26122
28664
  return new SdkError.SparkError(FfiConverterString.read(from));
26123
28665
  case 2:
26124
- return new SdkError.InsufficientFunds();
28666
+ return new SdkError.InsufficientFunds({
28667
+ tokenIdentifier: FfiConverterOptionalString.read(from),
28668
+ });
26125
28669
  case 3:
26126
28670
  return new SdkError.InvalidUuid(FfiConverterString.read(from));
26127
28671
  case 4:
@@ -26154,6 +28698,15 @@ const FfiConverterTypeSdkError = (() => {
26154
28698
  case 13:
26155
28699
  return new SdkError.OptimizationCancelled();
26156
28700
  case 14:
28701
+ return new SdkError.InsufficientCpfpFunds({
28702
+ requiredSat: FfiConverterUInt64.read(from),
28703
+ });
28704
+ case 15:
28705
+ return new SdkError.FundingUtxoConflict({
28706
+ txid: FfiConverterString.read(from),
28707
+ vout: FfiConverterUInt32.read(from),
28708
+ });
28709
+ case 16:
26157
28710
  return new SdkError.Generic(FfiConverterString.read(from));
26158
28711
  default:
26159
28712
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -26169,6 +28722,8 @@ const FfiConverterTypeSdkError = (() => {
26169
28722
  }
26170
28723
  case SdkError_Tags.InsufficientFunds: {
26171
28724
  ordinalConverter.write(2, into);
28725
+ const inner = value.inner;
28726
+ FfiConverterOptionalString.write(inner.tokenIdentifier, into);
26172
28727
  return;
26173
28728
  }
26174
28729
  case SdkError_Tags.InvalidUuid: {
@@ -26238,9 +28793,22 @@ const FfiConverterTypeSdkError = (() => {
26238
28793
  ordinalConverter.write(13, into);
26239
28794
  return;
26240
28795
  }
26241
- case SdkError_Tags.Generic: {
28796
+ case SdkError_Tags.InsufficientCpfpFunds: {
26242
28797
  ordinalConverter.write(14, into);
26243
28798
  const inner = value.inner;
28799
+ FfiConverterUInt64.write(inner.requiredSat, into);
28800
+ return;
28801
+ }
28802
+ case SdkError_Tags.FundingUtxoConflict: {
28803
+ ordinalConverter.write(15, into);
28804
+ const inner = value.inner;
28805
+ FfiConverterString.write(inner.txid, into);
28806
+ FfiConverterUInt32.write(inner.vout, into);
28807
+ return;
28808
+ }
28809
+ case SdkError_Tags.Generic: {
28810
+ ordinalConverter.write(16, into);
28811
+ const inner = value.inner;
26244
28812
  FfiConverterString.write(inner[0], into);
26245
28813
  return;
26246
28814
  }
@@ -26258,7 +28826,12 @@ const FfiConverterTypeSdkError = (() => {
26258
28826
  return size;
26259
28827
  }
26260
28828
  case SdkError_Tags.InsufficientFunds: {
26261
- return ordinalConverter.allocationSize(2);
28829
+ const inner = value.inner;
28830
+ let size = ordinalConverter.allocationSize(2);
28831
+ size += FfiConverterOptionalString.allocationSize(
28832
+ inner.tokenIdentifier
28833
+ );
28834
+ return size;
26262
28835
  }
26263
28836
  case SdkError_Tags.InvalidUuid: {
26264
28837
  const inner = value.inner;
@@ -26327,9 +28900,22 @@ const FfiConverterTypeSdkError = (() => {
26327
28900
  case SdkError_Tags.OptimizationCancelled: {
26328
28901
  return ordinalConverter.allocationSize(13);
26329
28902
  }
26330
- case SdkError_Tags.Generic: {
28903
+ case SdkError_Tags.InsufficientCpfpFunds: {
26331
28904
  const inner = value.inner;
26332
28905
  let size = ordinalConverter.allocationSize(14);
28906
+ size += FfiConverterUInt64.allocationSize(inner.requiredSat);
28907
+ return size;
28908
+ }
28909
+ case SdkError_Tags.FundingUtxoConflict: {
28910
+ const inner = value.inner;
28911
+ let size = ordinalConverter.allocationSize(15);
28912
+ size += FfiConverterString.allocationSize(inner.txid);
28913
+ size += FfiConverterUInt32.allocationSize(inner.vout);
28914
+ return size;
28915
+ }
28916
+ case SdkError_Tags.Generic: {
28917
+ const inner = value.inner;
28918
+ let size = ordinalConverter.allocationSize(16);
26333
28919
  size += FfiConverterString.allocationSize(inner[0]);
26334
28920
  return size;
26335
28921
  }
@@ -29266,6 +31852,150 @@ const FfiConverterTypeSparkHtlcStatus = (() => {
29266
31852
  return new FFIConverter();
29267
31853
  })();
29268
31854
 
31855
+ // Enum: SparkMasterIdentityPublicKey
31856
+ export enum SparkMasterIdentityPublicKey_Tags {
31857
+ Set = 'Set',
31858
+ Unset = 'Unset',
31859
+ }
31860
+ /**
31861
+ * Specifies how to update the wallet's Spark master identity public key.
31862
+ */
31863
+ export const SparkMasterIdentityPublicKey = (() => {
31864
+ type Set__interface = {
31865
+ tag: SparkMasterIdentityPublicKey_Tags.Set;
31866
+ inner: Readonly<{ publicKey: string }>;
31867
+ };
31868
+
31869
+ /**
31870
+ * Designate the holder of this public key as the wallet's master
31871
+ * identity, replacing any previously designated key. Must be hex encoded
31872
+ * in the 33-byte compressed form.
31873
+ */
31874
+ class Set_ extends UniffiEnum implements Set__interface {
31875
+ /**
31876
+ * @private
31877
+ * This field is private and should not be used, use `tag` instead.
31878
+ */
31879
+ readonly [uniffiTypeNameSymbol] = 'SparkMasterIdentityPublicKey';
31880
+ readonly tag = SparkMasterIdentityPublicKey_Tags.Set;
31881
+ readonly inner: Readonly<{ publicKey: string }>;
31882
+ constructor(inner: { publicKey: string }) {
31883
+ super('SparkMasterIdentityPublicKey', 'Set');
31884
+ this.inner = Object.freeze(inner);
31885
+ }
31886
+
31887
+ static new(inner: { publicKey: string }): Set_ {
31888
+ return new Set_(inner);
31889
+ }
31890
+
31891
+ static instanceOf(obj: any): obj is Set_ {
31892
+ return obj.tag === SparkMasterIdentityPublicKey_Tags.Set;
31893
+ }
31894
+ }
31895
+
31896
+ type Unset__interface = {
31897
+ tag: SparkMasterIdentityPublicKey_Tags.Unset;
31898
+ };
31899
+
31900
+ /**
31901
+ * Remove the designated master identity, leaving the owner as the only
31902
+ * party able to read the wallet under private mode.
31903
+ */
31904
+ class Unset_ extends UniffiEnum implements Unset__interface {
31905
+ /**
31906
+ * @private
31907
+ * This field is private and should not be used, use `tag` instead.
31908
+ */
31909
+ readonly [uniffiTypeNameSymbol] = 'SparkMasterIdentityPublicKey';
31910
+ readonly tag = SparkMasterIdentityPublicKey_Tags.Unset;
31911
+ constructor() {
31912
+ super('SparkMasterIdentityPublicKey', 'Unset');
31913
+ }
31914
+
31915
+ static new(): Unset_ {
31916
+ return new Unset_();
31917
+ }
31918
+
31919
+ static instanceOf(obj: any): obj is Unset_ {
31920
+ return obj.tag === SparkMasterIdentityPublicKey_Tags.Unset;
31921
+ }
31922
+ }
31923
+
31924
+ function instanceOf(obj: any): obj is SparkMasterIdentityPublicKey {
31925
+ return obj[uniffiTypeNameSymbol] === 'SparkMasterIdentityPublicKey';
31926
+ }
31927
+
31928
+ return Object.freeze({
31929
+ instanceOf,
31930
+ Set: Set_,
31931
+ Unset: Unset_,
31932
+ });
31933
+ })();
31934
+
31935
+ /**
31936
+ * Specifies how to update the wallet's Spark master identity public key.
31937
+ */
31938
+
31939
+ export type SparkMasterIdentityPublicKey = InstanceType<
31940
+ (typeof SparkMasterIdentityPublicKey)[keyof Omit<
31941
+ typeof SparkMasterIdentityPublicKey,
31942
+ 'instanceOf'
31943
+ >]
31944
+ >;
31945
+
31946
+ // FfiConverter for enum SparkMasterIdentityPublicKey
31947
+ const FfiConverterTypeSparkMasterIdentityPublicKey = (() => {
31948
+ const ordinalConverter = FfiConverterInt32;
31949
+ type TypeName = SparkMasterIdentityPublicKey;
31950
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
31951
+ read(from: RustBuffer): TypeName {
31952
+ switch (ordinalConverter.read(from)) {
31953
+ case 1:
31954
+ return new SparkMasterIdentityPublicKey.Set({
31955
+ publicKey: FfiConverterString.read(from),
31956
+ });
31957
+ case 2:
31958
+ return new SparkMasterIdentityPublicKey.Unset();
31959
+ default:
31960
+ throw new UniffiInternalError.UnexpectedEnumCase();
31961
+ }
31962
+ }
31963
+ write(value: TypeName, into: RustBuffer): void {
31964
+ switch (value.tag) {
31965
+ case SparkMasterIdentityPublicKey_Tags.Set: {
31966
+ ordinalConverter.write(1, into);
31967
+ const inner = value.inner;
31968
+ FfiConverterString.write(inner.publicKey, into);
31969
+ return;
31970
+ }
31971
+ case SparkMasterIdentityPublicKey_Tags.Unset: {
31972
+ ordinalConverter.write(2, into);
31973
+ return;
31974
+ }
31975
+ default:
31976
+ // Throwing from here means that SparkMasterIdentityPublicKey_Tags hasn't matched an ordinal.
31977
+ throw new UniffiInternalError.UnexpectedEnumCase();
31978
+ }
31979
+ }
31980
+ allocationSize(value: TypeName): number {
31981
+ switch (value.tag) {
31982
+ case SparkMasterIdentityPublicKey_Tags.Set: {
31983
+ const inner = value.inner;
31984
+ let size = ordinalConverter.allocationSize(1);
31985
+ size += FfiConverterString.allocationSize(inner.publicKey);
31986
+ return size;
31987
+ }
31988
+ case SparkMasterIdentityPublicKey_Tags.Unset: {
31989
+ return ordinalConverter.allocationSize(2);
31990
+ }
31991
+ default:
31992
+ throw new UniffiInternalError.UnexpectedEnumCase();
31993
+ }
31994
+ }
31995
+ }
31996
+ return new FFIConverter();
31997
+ })();
31998
+
29269
31999
  // Enum: StableBalanceActiveLabel
29270
32000
  export enum StableBalanceActiveLabel_Tags {
29271
32001
  Set = 'Set',
@@ -30847,11 +33577,72 @@ const FfiConverterTypeTransferTarget = (() => {
30847
33577
  return new FFIConverter();
30848
33578
  })();
30849
33579
 
33580
+ /**
33581
+ * The role of a transaction in the exit path.
33582
+ */
33583
+ export enum UnilateralExitTxKind {
33584
+ /**
33585
+ * Splits the caller's funding into one output per branch. Present only
33586
+ * when the funding couldn't be matched one-to-one to branches.
33587
+ */
33588
+ FanOut,
33589
+ /**
33590
+ * A tree node transaction (root, intermediate, or leaf node).
33591
+ */
33592
+ Node,
33593
+ /**
33594
+ * A leaf's refund transaction.
33595
+ */
33596
+ Refund,
33597
+ /**
33598
+ * The final transaction sweeping all refund outputs to the destination.
33599
+ */
33600
+ Sweep,
33601
+ }
33602
+
33603
+ const FfiConverterTypeUnilateralExitTxKind = (() => {
33604
+ const ordinalConverter = FfiConverterInt32;
33605
+ type TypeName = UnilateralExitTxKind;
33606
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
33607
+ read(from: RustBuffer): TypeName {
33608
+ switch (ordinalConverter.read(from)) {
33609
+ case 1:
33610
+ return UnilateralExitTxKind.FanOut;
33611
+ case 2:
33612
+ return UnilateralExitTxKind.Node;
33613
+ case 3:
33614
+ return UnilateralExitTxKind.Refund;
33615
+ case 4:
33616
+ return UnilateralExitTxKind.Sweep;
33617
+ default:
33618
+ throw new UniffiInternalError.UnexpectedEnumCase();
33619
+ }
33620
+ }
33621
+ write(value: TypeName, into: RustBuffer): void {
33622
+ switch (value) {
33623
+ case UnilateralExitTxKind.FanOut:
33624
+ return ordinalConverter.write(1, into);
33625
+ case UnilateralExitTxKind.Node:
33626
+ return ordinalConverter.write(2, into);
33627
+ case UnilateralExitTxKind.Refund:
33628
+ return ordinalConverter.write(3, into);
33629
+ case UnilateralExitTxKind.Sweep:
33630
+ return ordinalConverter.write(4, into);
33631
+ }
33632
+ }
33633
+ allocationSize(value: TypeName): number {
33634
+ return ordinalConverter.allocationSize(0);
33635
+ }
33636
+ }
33637
+ return new FFIConverter();
33638
+ })();
33639
+
30850
33640
  // Enum: UnsignedTransferPackage
30851
33641
  export enum UnsignedTransferPackage_Tags {
30852
33642
  Swap = 'Swap',
30853
33643
  Transfer = 'Transfer',
30854
33644
  Token = 'Token',
33645
+ TokenBatch = 'TokenBatch',
30855
33646
  }
30856
33647
  export const UnsignedTransferPackage = (() => {
30857
33648
  type Swap__interface = {
@@ -31011,6 +33802,71 @@ export const UnsignedTransferPackage = (() => {
31011
33802
  }
31012
33803
  }
31013
33804
 
33805
+ type TokenBatch__interface = {
33806
+ tag: UnsignedTransferPackage_Tags.TokenBatch;
33807
+ inner: Readonly<{
33808
+ prepareTokenTransaction: ExternalPrepareTokenTransactionRequest;
33809
+ tokenContext: ArrayBuffer;
33810
+ totals: Array<BatchTotal>;
33811
+ isSwap: boolean;
33812
+ }>;
33813
+ };
33814
+
33815
+ /**
33816
+ * One token transaction paying several recipients. Publishing it returns
33817
+ * `PaymentsSent` with one payment per recipient.
33818
+ */
33819
+ class TokenBatch_ extends UniffiEnum implements TokenBatch__interface {
33820
+ /**
33821
+ * @private
33822
+ * This field is private and should not be used, use `tag` instead.
33823
+ */
33824
+ readonly [uniffiTypeNameSymbol] = 'UnsignedTransferPackage';
33825
+ readonly tag = UnsignedTransferPackage_Tags.TokenBatch;
33826
+ readonly inner: Readonly<{
33827
+ prepareTokenTransaction: ExternalPrepareTokenTransactionRequest;
33828
+ tokenContext: ArrayBuffer;
33829
+ totals: Array<BatchTotal>;
33830
+ isSwap: boolean;
33831
+ }>;
33832
+ constructor(inner: {
33833
+ prepareTokenTransaction: ExternalPrepareTokenTransactionRequest;
33834
+ tokenContext: ArrayBuffer;
33835
+ /**
33836
+ * What the batch debits, per token. A batch spanning tokens has no
33837
+ * single amount to report.
33838
+ */ totals: Array<BatchTotal>;
33839
+ /**
33840
+ * When set, this package re-shapes the wallet's token outputs instead of
33841
+ * sending a payment. Publishing it returns `SwapCompleted`: rebuild the
33842
+ * original send from the same prepare response and submit again.
33843
+ */ isSwap: boolean;
33844
+ }) {
33845
+ super('UnsignedTransferPackage', 'TokenBatch');
33846
+ this.inner = Object.freeze(inner);
33847
+ }
33848
+
33849
+ static new(inner: {
33850
+ prepareTokenTransaction: ExternalPrepareTokenTransactionRequest;
33851
+ tokenContext: ArrayBuffer;
33852
+ /**
33853
+ * What the batch debits, per token. A batch spanning tokens has no
33854
+ * single amount to report.
33855
+ */ totals: Array<BatchTotal>;
33856
+ /**
33857
+ * When set, this package re-shapes the wallet's token outputs instead of
33858
+ * sending a payment. Publishing it returns `SwapCompleted`: rebuild the
33859
+ * original send from the same prepare response and submit again.
33860
+ */ isSwap: boolean;
33861
+ }): TokenBatch_ {
33862
+ return new TokenBatch_(inner);
33863
+ }
33864
+
33865
+ static instanceOf(obj: any): obj is TokenBatch_ {
33866
+ return obj.tag === UnsignedTransferPackage_Tags.TokenBatch;
33867
+ }
33868
+ }
33869
+
31014
33870
  function instanceOf(obj: any): obj is UnsignedTransferPackage {
31015
33871
  return obj[uniffiTypeNameSymbol] === 'UnsignedTransferPackage';
31016
33872
  }
@@ -31020,6 +33876,7 @@ export const UnsignedTransferPackage = (() => {
31020
33876
  Swap: Swap_,
31021
33877
  Transfer: Transfer_,
31022
33878
  Token: Token_,
33879
+ TokenBatch: TokenBatch_,
31023
33880
  });
31024
33881
  })();
31025
33882
 
@@ -31063,6 +33920,14 @@ const FfiConverterTypeUnsignedTransferPackage = (() => {
31063
33920
  fee: FfiConverterTypeu128.read(from),
31064
33921
  isSwap: FfiConverterBool.read(from),
31065
33922
  });
33923
+ case 4:
33924
+ return new UnsignedTransferPackage.TokenBatch({
33925
+ prepareTokenTransaction:
33926
+ FfiConverterTypeExternalPrepareTokenTransactionRequest.read(from),
33927
+ tokenContext: FfiConverterArrayBuffer.read(from),
33928
+ totals: FfiConverterArrayTypeBatchTotal.read(from),
33929
+ isSwap: FfiConverterBool.read(from),
33930
+ });
31066
33931
  default:
31067
33932
  throw new UniffiInternalError.UnexpectedEnumCase();
31068
33933
  }
@@ -31107,6 +33972,18 @@ const FfiConverterTypeUnsignedTransferPackage = (() => {
31107
33972
  FfiConverterBool.write(inner.isSwap, into);
31108
33973
  return;
31109
33974
  }
33975
+ case UnsignedTransferPackage_Tags.TokenBatch: {
33976
+ ordinalConverter.write(4, into);
33977
+ const inner = value.inner;
33978
+ FfiConverterTypeExternalPrepareTokenTransactionRequest.write(
33979
+ inner.prepareTokenTransaction,
33980
+ into
33981
+ );
33982
+ FfiConverterArrayBuffer.write(inner.tokenContext, into);
33983
+ FfiConverterArrayTypeBatchTotal.write(inner.totals, into);
33984
+ FfiConverterBool.write(inner.isSwap, into);
33985
+ return;
33986
+ }
31110
33987
  default:
31111
33988
  // Throwing from here means that UnsignedTransferPackage_Tags hasn't matched an ordinal.
31112
33989
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -31150,6 +34027,18 @@ const FfiConverterTypeUnsignedTransferPackage = (() => {
31150
34027
  size += FfiConverterBool.allocationSize(inner.isSwap);
31151
34028
  return size;
31152
34029
  }
34030
+ case UnsignedTransferPackage_Tags.TokenBatch: {
34031
+ const inner = value.inner;
34032
+ let size = ordinalConverter.allocationSize(4);
34033
+ size +=
34034
+ FfiConverterTypeExternalPrepareTokenTransactionRequest.allocationSize(
34035
+ inner.prepareTokenTransaction
34036
+ );
34037
+ size += FfiConverterArrayBuffer.allocationSize(inner.tokenContext);
34038
+ size += FfiConverterArrayTypeBatchTotal.allocationSize(inner.totals);
34039
+ size += FfiConverterBool.allocationSize(inner.isSwap);
34040
+ return size;
34041
+ }
31153
34042
  default:
31154
34043
  throw new UniffiInternalError.UnexpectedEnumCase();
31155
34044
  }
@@ -31578,6 +34467,16 @@ export interface BitcoinChainService {
31578
34467
  address: string,
31579
34468
  asyncOpts_?: { signal: AbortSignal }
31580
34469
  ): /*throws*/ Promise<Array<Utxo>>;
34470
+ /**
34471
+ * Every output ever paid to `address`, spent or not, unlike
34472
+ * [`get_address_utxos`](Self::get_address_utxos) which omits spent ones.
34473
+ * Recovers an output's outpoint and value after it has been spent, so a
34474
+ * swept refund can still be distinguished from one never broadcast.
34475
+ */
34476
+ getAddressTxos(
34477
+ address: string,
34478
+ asyncOpts_?: { signal: AbortSignal }
34479
+ ): /*throws*/ Promise<Array<Utxo>>;
31581
34480
  getTransactionStatus(
31582
34481
  txid: string,
31583
34482
  asyncOpts_?: { signal: AbortSignal }
@@ -31586,6 +34485,11 @@ export interface BitcoinChainService {
31586
34485
  txid: string,
31587
34486
  asyncOpts_?: { signal: AbortSignal }
31588
34487
  ): /*throws*/ Promise<string>;
34488
+ getOutspend(
34489
+ txid: string,
34490
+ vout: /*u32*/ number,
34491
+ asyncOpts_?: { signal: AbortSignal }
34492
+ ): /*throws*/ Promise<Outspend>;
31589
34493
  broadcastTransaction(
31590
34494
  tx: string,
31591
34495
  asyncOpts_?: { signal: AbortSignal }
@@ -31649,6 +34553,51 @@ export class BitcoinChainServiceImpl
31649
34553
  }
31650
34554
  }
31651
34555
 
34556
+ /**
34557
+ * Every output ever paid to `address`, spent or not, unlike
34558
+ * [`get_address_utxos`](Self::get_address_utxos) which omits spent ones.
34559
+ * Recovers an output's outpoint and value after it has been spent, so a
34560
+ * swept refund can still be distinguished from one never broadcast.
34561
+ */
34562
+ public async getAddressTxos(
34563
+ address: string,
34564
+ asyncOpts_?: { signal: AbortSignal }
34565
+ ): Promise<Array<Utxo>> /*throws*/ {
34566
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
34567
+ try {
34568
+ return await uniffiRustCallAsync(
34569
+ /*rustCaller:*/ uniffiCaller,
34570
+ /*rustFutureFunc:*/ () => {
34571
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_address_txos(
34572
+ uniffiTypeBitcoinChainServiceImplObjectFactory.clonePointer(this),
34573
+ FfiConverterString.lower(address)
34574
+ );
34575
+ },
34576
+ /*pollFunc:*/ nativeModule()
34577
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
34578
+ /*cancelFunc:*/ nativeModule()
34579
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
34580
+ /*completeFunc:*/ nativeModule()
34581
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
34582
+ /*freeFunc:*/ nativeModule()
34583
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
34584
+ /*liftFunc:*/ FfiConverterArrayTypeUtxo.lift.bind(
34585
+ FfiConverterArrayTypeUtxo
34586
+ ),
34587
+ /*liftString:*/ FfiConverterString.lift,
34588
+ /*asyncOpts:*/ asyncOpts_,
34589
+ /*errorHandler:*/ FfiConverterTypeChainServiceError.lift.bind(
34590
+ FfiConverterTypeChainServiceError
34591
+ )
34592
+ );
34593
+ } catch (__error: any) {
34594
+ if (uniffiIsDebug && __error instanceof Error) {
34595
+ __error.stack = __stack;
34596
+ }
34597
+ throw __error;
34598
+ }
34599
+ }
34600
+
31652
34601
  public async getTransactionStatus(
31653
34602
  txid: string,
31654
34603
  asyncOpts_?: { signal: AbortSignal }
@@ -31725,6 +34674,47 @@ export class BitcoinChainServiceImpl
31725
34674
  }
31726
34675
  }
31727
34676
 
34677
+ public async getOutspend(
34678
+ txid: string,
34679
+ vout: /*u32*/ number,
34680
+ asyncOpts_?: { signal: AbortSignal }
34681
+ ): Promise<Outspend> /*throws*/ {
34682
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
34683
+ try {
34684
+ return await uniffiRustCallAsync(
34685
+ /*rustCaller:*/ uniffiCaller,
34686
+ /*rustFutureFunc:*/ () => {
34687
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_bitcoinchainservice_get_outspend(
34688
+ uniffiTypeBitcoinChainServiceImplObjectFactory.clonePointer(this),
34689
+ FfiConverterString.lower(txid),
34690
+ FfiConverterUInt32.lower(vout)
34691
+ );
34692
+ },
34693
+ /*pollFunc:*/ nativeModule()
34694
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
34695
+ /*cancelFunc:*/ nativeModule()
34696
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
34697
+ /*completeFunc:*/ nativeModule()
34698
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
34699
+ /*freeFunc:*/ nativeModule()
34700
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
34701
+ /*liftFunc:*/ FfiConverterTypeOutspend.lift.bind(
34702
+ FfiConverterTypeOutspend
34703
+ ),
34704
+ /*liftString:*/ FfiConverterString.lift,
34705
+ /*asyncOpts:*/ asyncOpts_,
34706
+ /*errorHandler:*/ FfiConverterTypeChainServiceError.lift.bind(
34707
+ FfiConverterTypeChainServiceError
34708
+ )
34709
+ );
34710
+ } catch (__error: any) {
34711
+ if (uniffiIsDebug && __error instanceof Error) {
34712
+ __error.stack = __stack;
34713
+ }
34714
+ throw __error;
34715
+ }
34716
+ }
34717
+
31728
34718
  public async broadcastTransaction(
31729
34719
  tx: string,
31730
34720
  asyncOpts_?: { signal: AbortSignal }
@@ -31946,6 +34936,55 @@ const uniffiCallbackInterfaceBitcoinChainService: {
31946
34936
  );
31947
34937
  return uniffiForeignFuture;
31948
34938
  },
34939
+ getAddressTxos: (
34940
+ uniffiHandle: bigint,
34941
+ address: Uint8Array,
34942
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
34943
+ uniffiCallbackData: bigint
34944
+ ) => {
34945
+ const uniffiMakeCall = async (
34946
+ signal: AbortSignal
34947
+ ): Promise<Array<Utxo>> => {
34948
+ const jsCallback =
34949
+ FfiConverterTypeBitcoinChainService.lift(uniffiHandle);
34950
+ return await jsCallback.getAddressTxos(
34951
+ FfiConverterString.lift(address),
34952
+ { signal }
34953
+ );
34954
+ };
34955
+ const uniffiHandleSuccess = (returnValue: Array<Utxo>) => {
34956
+ uniffiFutureCallback.call(
34957
+ uniffiFutureCallback,
34958
+ uniffiCallbackData,
34959
+ /* UniffiForeignFutureStructRustBuffer */ {
34960
+ returnValue: FfiConverterArrayTypeUtxo.lower(returnValue),
34961
+ callStatus: uniffiCaller.createCallStatus(),
34962
+ }
34963
+ );
34964
+ };
34965
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
34966
+ uniffiFutureCallback.call(
34967
+ uniffiFutureCallback,
34968
+ uniffiCallbackData,
34969
+ /* UniffiForeignFutureStructRustBuffer */ {
34970
+ returnValue: /*empty*/ new Uint8Array(0),
34971
+ // TODO create callstatus with error.
34972
+ callStatus: uniffiCaller.createErrorStatus(code, errorBuf),
34973
+ }
34974
+ );
34975
+ };
34976
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
34977
+ /*makeCall:*/ uniffiMakeCall,
34978
+ /*handleSuccess:*/ uniffiHandleSuccess,
34979
+ /*handleError:*/ uniffiHandleError,
34980
+ /*isErrorType:*/ ChainServiceError.instanceOf,
34981
+ /*lowerError:*/ FfiConverterTypeChainServiceError.lower.bind(
34982
+ FfiConverterTypeChainServiceError
34983
+ ),
34984
+ /*lowerString:*/ FfiConverterString.lower
34985
+ );
34986
+ return uniffiForeignFuture;
34987
+ },
31949
34988
  getTransactionStatus: (
31950
34989
  uniffiHandle: bigint,
31951
34990
  txid: Uint8Array,
@@ -32040,6 +35079,55 @@ const uniffiCallbackInterfaceBitcoinChainService: {
32040
35079
  );
32041
35080
  return uniffiForeignFuture;
32042
35081
  },
35082
+ getOutspend: (
35083
+ uniffiHandle: bigint,
35084
+ txid: Uint8Array,
35085
+ vout: number,
35086
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
35087
+ uniffiCallbackData: bigint
35088
+ ) => {
35089
+ const uniffiMakeCall = async (signal: AbortSignal): Promise<Outspend> => {
35090
+ const jsCallback =
35091
+ FfiConverterTypeBitcoinChainService.lift(uniffiHandle);
35092
+ return await jsCallback.getOutspend(
35093
+ FfiConverterString.lift(txid),
35094
+ FfiConverterUInt32.lift(vout),
35095
+ { signal }
35096
+ );
35097
+ };
35098
+ const uniffiHandleSuccess = (returnValue: Outspend) => {
35099
+ uniffiFutureCallback.call(
35100
+ uniffiFutureCallback,
35101
+ uniffiCallbackData,
35102
+ /* UniffiForeignFutureStructRustBuffer */ {
35103
+ returnValue: FfiConverterTypeOutspend.lower(returnValue),
35104
+ callStatus: uniffiCaller.createCallStatus(),
35105
+ }
35106
+ );
35107
+ };
35108
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
35109
+ uniffiFutureCallback.call(
35110
+ uniffiFutureCallback,
35111
+ uniffiCallbackData,
35112
+ /* UniffiForeignFutureStructRustBuffer */ {
35113
+ returnValue: /*empty*/ new Uint8Array(0),
35114
+ // TODO create callstatus with error.
35115
+ callStatus: uniffiCaller.createErrorStatus(code, errorBuf),
35116
+ }
35117
+ );
35118
+ };
35119
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
35120
+ /*makeCall:*/ uniffiMakeCall,
35121
+ /*handleSuccess:*/ uniffiHandleSuccess,
35122
+ /*handleError:*/ uniffiHandleError,
35123
+ /*isErrorType:*/ ChainServiceError.instanceOf,
35124
+ /*lowerError:*/ FfiConverterTypeChainServiceError.lower.bind(
35125
+ FfiConverterTypeChainServiceError
35126
+ ),
35127
+ /*lowerString:*/ FfiConverterString.lower
35128
+ );
35129
+ return uniffiForeignFuture;
35130
+ },
32043
35131
  broadcastTransaction: (
32044
35132
  uniffiHandle: bigint,
32045
35133
  tx: Uint8Array,
@@ -32193,6 +35281,17 @@ export interface BreezSdkInterface {
32193
35281
  request: AuthorizeTransferRequest,
32194
35282
  asyncOpts_?: { signal: AbortSignal }
32195
35283
  ): /*throws*/ Promise<TransferAuthorization>;
35284
+ /**
35285
+ * Builds the unsigned package for the batch prepared by
35286
+ * [`BreezSdk::prepare_send_batch`], for signing outside the SDK.
35287
+ *
35288
+ * Publish the signed package with
35289
+ * [`BreezSdk::publish_signed_transfer_package`], which returns every payment.
35290
+ */
35291
+ buildUnsignedBatchPackage(
35292
+ request: BuildUnsignedBatchPackageRequest,
35293
+ asyncOpts_?: { signal: AbortSignal }
35294
+ ): /*throws*/ Promise<UnsignedTransferPackage>;
32196
35295
  buildUnsignedLnurlPayPackage(
32197
35296
  request: BuildUnsignedLnurlPayPackageRequest,
32198
35297
  asyncOpts_?: { signal: AbortSignal }
@@ -32469,10 +35568,37 @@ export interface BreezSdkInterface {
32469
35568
  request: PrepareLnurlPayRequest,
32470
35569
  asyncOpts_?: { signal: AbortSignal }
32471
35570
  ): /*throws*/ Promise<PrepareLnurlPayResponse>;
35571
+ /**
35572
+ * Prepares a send to several payees, all paid by one transaction.
35573
+ *
35574
+ * Each recipient is a Spark address or a Spark invoice, and one batch may
35575
+ * span several tokens. The response resolves every invoice into the asset
35576
+ * and amount it requests, and reports what the batch debits per asset.
35577
+ *
35578
+ * A batch pays tokens: sending sats to several payees at once is not
35579
+ * supported yet, so a recipient that resolves to sats is rejected.
35580
+ *
35581
+ * A batch that pays a Spark invoice is limited to a single token: the
35582
+ * operators reject a transaction that carries an invoice and pays more
35583
+ * than one. Send those as one batch per token.
35584
+ */
35585
+ prepareSendBatch(
35586
+ request: PrepareSendBatchRequest,
35587
+ asyncOpts_?: { signal: AbortSignal }
35588
+ ): /*throws*/ Promise<PrepareSendBatchResponse>;
32472
35589
  prepareSendPayment(
32473
35590
  request: PrepareSendPaymentRequest,
32474
35591
  asyncOpts_?: { signal: AbortSignal }
32475
35592
  ): /*throws*/ Promise<PrepareSendPaymentResponse>;
35593
+ /**
35594
+ * Quotes a unilateral exit without any funding UTXOs: selects which leaves
35595
+ * would exit, computes the exact fee for the given funding kind, and reports
35596
+ * how much to fund.
35597
+ */
35598
+ prepareUnilateralExit(
35599
+ request: PrepareUnilateralExitRequest,
35600
+ asyncOpts_?: { signal: AbortSignal }
35601
+ ): /*throws*/ Promise<PrepareUnilateralExitResponse>;
32476
35602
  publishSignedLnurlPayPackage(
32477
35603
  request: PublishSignedLnurlPayPackageRequest,
32478
35604
  asyncOpts_?: { signal: AbortSignal }
@@ -32496,19 +35622,20 @@ export interface BreezSdkInterface {
32496
35622
  asyncOpts_?: { signal: AbortSignal }
32497
35623
  ): /*throws*/ Promise<RefundDepositResponse>;
32498
35624
  /**
32499
- * Runs one pass of the pending-conversion refunder.
35625
+ * Runs one full pass of the pending-conversion refunder and returns how
35626
+ * many conversions were refunded, skipped (held back by a safety window),
35627
+ * or failed.
32500
35628
  *
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.
35629
+ * The pass has two parts: refunding locally-marked failed conversions, and
35630
+ * reconciling against Flashnet's clawback-eligible listing to catch
35631
+ * conversions with no local marker (e.g. a storage write that never
35632
+ * landed). The SDK's periodic background schedule runs only the local
35633
+ * part; the reconcile runs at SDK init and on each call to this method, so
35634
+ * this is the explicit entry point for driving a full pass on demand.
32508
35635
  */
32509
35636
  refundPendingConversions(asyncOpts_?: {
32510
35637
  signal: AbortSignal;
32511
- }): /*throws*/ Promise<void>;
35638
+ }): /*throws*/ Promise<RefundPendingConversionsResponse>;
32512
35639
  registerLightningAddress(
32513
35640
  request: RegisterLightningAddressRequest,
32514
35641
  asyncOpts_?: { signal: AbortSignal }
@@ -32547,6 +35674,20 @@ export interface BreezSdkInterface {
32547
35674
  id: string,
32548
35675
  asyncOpts_?: { signal: AbortSignal }
32549
35676
  ): Promise<boolean>;
35677
+ /**
35678
+ * Sends the batch prepared by [`BreezSdk::prepare_send_batch`], returning
35679
+ * one payment per recipient in recipient order.
35680
+ *
35681
+ * Retrying after a failure that leaves the outcome unknown may pay twice:
35682
+ * a token transfer has no idempotency key, since the operator can only be
35683
+ * asked about a transaction by a hash that is computed while broadcasting.
35684
+ * Look for the batch with a `Token` payment details filter on the
35685
+ * transaction hash before sending it again.
35686
+ */
35687
+ sendBatch(
35688
+ request: SendBatchRequest,
35689
+ asyncOpts_?: { signal: AbortSignal }
35690
+ ): /*throws*/ Promise<SendBatchResponse>;
32550
35691
  sendPayment(
32551
35692
  request: SendPaymentRequest,
32552
35693
  asyncOpts_?: { signal: AbortSignal }
@@ -32567,6 +35708,23 @@ export interface BreezSdkInterface {
32567
35708
  request: SyncWalletRequest,
32568
35709
  asyncOpts_?: { signal: AbortSignal }
32569
35710
  ): /*throws*/ Promise<SyncWalletResponse>;
35711
+ /**
35712
+ * Builds and signs a complete unilateral exit from a `prepare_unilateral_exit`
35713
+ * quote and the actual funding UTXOs, returning the full transaction set in
35714
+ * topological broadcast order without broadcasting. Broadcast it over time,
35715
+ * respecting each transaction's `depends_on` and `csv_timelock_blocks`.
35716
+ *
35717
+ * It resolves on-chain state first (see [`resolve_exit_observations`]): an
35718
+ * already-confirmed fan-out or CPFP node is not rebuilt, and a leaf refund
35719
+ * already on-chain (recognized by the leaf's refund address, so any refund
35720
+ * variant counts) is swept directly. Re-running after partial progress
35721
+ * therefore resumes rather than restarts.
35722
+ */
35723
+ unilateralExit(
35724
+ request: UnilateralExitRequest,
35725
+ signer: CpfpSigner,
35726
+ asyncOpts_?: { signal: AbortSignal }
35727
+ ): /*throws*/ Promise<UnilateralExitResponse>;
32570
35728
  /**
32571
35729
  * Unregisters a previously registered webhook.
32572
35730
  *
@@ -32772,6 +35930,52 @@ export class BreezSdk
32772
35930
  }
32773
35931
  }
32774
35932
 
35933
+ /**
35934
+ * Builds the unsigned package for the batch prepared by
35935
+ * [`BreezSdk::prepare_send_batch`], for signing outside the SDK.
35936
+ *
35937
+ * Publish the signed package with
35938
+ * [`BreezSdk::publish_signed_transfer_package`], which returns every payment.
35939
+ */
35940
+ public async buildUnsignedBatchPackage(
35941
+ request: BuildUnsignedBatchPackageRequest,
35942
+ asyncOpts_?: { signal: AbortSignal }
35943
+ ): Promise<UnsignedTransferPackage> /*throws*/ {
35944
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
35945
+ try {
35946
+ return await uniffiRustCallAsync(
35947
+ /*rustCaller:*/ uniffiCaller,
35948
+ /*rustFutureFunc:*/ () => {
35949
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_build_unsigned_batch_package(
35950
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
35951
+ FfiConverterTypeBuildUnsignedBatchPackageRequest.lower(request)
35952
+ );
35953
+ },
35954
+ /*pollFunc:*/ nativeModule()
35955
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
35956
+ /*cancelFunc:*/ nativeModule()
35957
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
35958
+ /*completeFunc:*/ nativeModule()
35959
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
35960
+ /*freeFunc:*/ nativeModule()
35961
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
35962
+ /*liftFunc:*/ FfiConverterTypeUnsignedTransferPackage.lift.bind(
35963
+ FfiConverterTypeUnsignedTransferPackage
35964
+ ),
35965
+ /*liftString:*/ FfiConverterString.lift,
35966
+ /*asyncOpts:*/ asyncOpts_,
35967
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
35968
+ FfiConverterTypeSdkError
35969
+ )
35970
+ );
35971
+ } catch (__error: any) {
35972
+ if (uniffiIsDebug && __error instanceof Error) {
35973
+ __error.stack = __stack;
35974
+ }
35975
+ throw __error;
35976
+ }
35977
+ }
35978
+
32775
35979
  public async buildUnsignedLnurlPayPackage(
32776
35980
  request: BuildUnsignedLnurlPayPackageRequest,
32777
35981
  asyncOpts_?: { signal: AbortSignal }
@@ -34098,6 +37302,59 @@ export class BreezSdk
34098
37302
  }
34099
37303
  }
34100
37304
 
37305
+ /**
37306
+ * Prepares a send to several payees, all paid by one transaction.
37307
+ *
37308
+ * Each recipient is a Spark address or a Spark invoice, and one batch may
37309
+ * span several tokens. The response resolves every invoice into the asset
37310
+ * and amount it requests, and reports what the batch debits per asset.
37311
+ *
37312
+ * A batch pays tokens: sending sats to several payees at once is not
37313
+ * supported yet, so a recipient that resolves to sats is rejected.
37314
+ *
37315
+ * A batch that pays a Spark invoice is limited to a single token: the
37316
+ * operators reject a transaction that carries an invoice and pays more
37317
+ * than one. Send those as one batch per token.
37318
+ */
37319
+ public async prepareSendBatch(
37320
+ request: PrepareSendBatchRequest,
37321
+ asyncOpts_?: { signal: AbortSignal }
37322
+ ): Promise<PrepareSendBatchResponse> /*throws*/ {
37323
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
37324
+ try {
37325
+ return await uniffiRustCallAsync(
37326
+ /*rustCaller:*/ uniffiCaller,
37327
+ /*rustFutureFunc:*/ () => {
37328
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_send_batch(
37329
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
37330
+ FfiConverterTypePrepareSendBatchRequest.lower(request)
37331
+ );
37332
+ },
37333
+ /*pollFunc:*/ nativeModule()
37334
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
37335
+ /*cancelFunc:*/ nativeModule()
37336
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
37337
+ /*completeFunc:*/ nativeModule()
37338
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
37339
+ /*freeFunc:*/ nativeModule()
37340
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
37341
+ /*liftFunc:*/ FfiConverterTypePrepareSendBatchResponse.lift.bind(
37342
+ FfiConverterTypePrepareSendBatchResponse
37343
+ ),
37344
+ /*liftString:*/ FfiConverterString.lift,
37345
+ /*asyncOpts:*/ asyncOpts_,
37346
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
37347
+ FfiConverterTypeSdkError
37348
+ )
37349
+ );
37350
+ } catch (__error: any) {
37351
+ if (uniffiIsDebug && __error instanceof Error) {
37352
+ __error.stack = __stack;
37353
+ }
37354
+ throw __error;
37355
+ }
37356
+ }
37357
+
34101
37358
  public async prepareSendPayment(
34102
37359
  request: PrepareSendPaymentRequest,
34103
37360
  asyncOpts_?: { signal: AbortSignal }
@@ -34137,6 +37394,50 @@ export class BreezSdk
34137
37394
  }
34138
37395
  }
34139
37396
 
37397
+ /**
37398
+ * Quotes a unilateral exit without any funding UTXOs: selects which leaves
37399
+ * would exit, computes the exact fee for the given funding kind, and reports
37400
+ * how much to fund.
37401
+ */
37402
+ public async prepareUnilateralExit(
37403
+ request: PrepareUnilateralExitRequest,
37404
+ asyncOpts_?: { signal: AbortSignal }
37405
+ ): Promise<PrepareUnilateralExitResponse> /*throws*/ {
37406
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
37407
+ try {
37408
+ return await uniffiRustCallAsync(
37409
+ /*rustCaller:*/ uniffiCaller,
37410
+ /*rustFutureFunc:*/ () => {
37411
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_unilateral_exit(
37412
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
37413
+ FfiConverterTypePrepareUnilateralExitRequest.lower(request)
37414
+ );
37415
+ },
37416
+ /*pollFunc:*/ nativeModule()
37417
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
37418
+ /*cancelFunc:*/ nativeModule()
37419
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
37420
+ /*completeFunc:*/ nativeModule()
37421
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
37422
+ /*freeFunc:*/ nativeModule()
37423
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
37424
+ /*liftFunc:*/ FfiConverterTypePrepareUnilateralExitResponse.lift.bind(
37425
+ FfiConverterTypePrepareUnilateralExitResponse
37426
+ ),
37427
+ /*liftString:*/ FfiConverterString.lift,
37428
+ /*asyncOpts:*/ asyncOpts_,
37429
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
37430
+ FfiConverterTypeSdkError
37431
+ )
37432
+ );
37433
+ } catch (__error: any) {
37434
+ if (uniffiIsDebug && __error instanceof Error) {
37435
+ __error.stack = __stack;
37436
+ }
37437
+ throw __error;
37438
+ }
37439
+ }
37440
+
34140
37441
  public async publishSignedLnurlPayPackage(
34141
37442
  request: PublishSignedLnurlPayPackageRequest,
34142
37443
  asyncOpts_?: { signal: AbortSignal }
@@ -34334,19 +37635,20 @@ export class BreezSdk
34334
37635
  }
34335
37636
 
34336
37637
  /**
34337
- * Runs one pass of the pending-conversion refunder.
37638
+ * Runs one full pass of the pending-conversion refunder and returns how
37639
+ * many conversions were refunded, skipped (held back by a safety window),
37640
+ * or failed.
34338
37641
  *
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.
37642
+ * The pass has two parts: refunding locally-marked failed conversions, and
37643
+ * reconciling against Flashnet's clawback-eligible listing to catch
37644
+ * conversions with no local marker (e.g. a storage write that never
37645
+ * landed). The SDK's periodic background schedule runs only the local
37646
+ * part; the reconcile runs at SDK init and on each call to this method, so
37647
+ * this is the explicit entry point for driving a full pass on demand.
34346
37648
  */
34347
37649
  public async refundPendingConversions(asyncOpts_?: {
34348
37650
  signal: AbortSignal;
34349
- }): Promise<void> /*throws*/ {
37651
+ }): Promise<RefundPendingConversionsResponse> /*throws*/ {
34350
37652
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
34351
37653
  try {
34352
37654
  return await uniffiRustCallAsync(
@@ -34357,14 +37659,16 @@ export class BreezSdk
34357
37659
  );
34358
37660
  },
34359
37661
  /*pollFunc:*/ nativeModule()
34360
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
37662
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
34361
37663
  /*cancelFunc:*/ nativeModule()
34362
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
37664
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
34363
37665
  /*completeFunc:*/ nativeModule()
34364
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
37666
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
34365
37667
  /*freeFunc:*/ nativeModule()
34366
- .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
34367
- /*liftFunc:*/ (_v) => {},
37668
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
37669
+ /*liftFunc:*/ FfiConverterTypeRefundPendingConversionsResponse.lift.bind(
37670
+ FfiConverterTypeRefundPendingConversionsResponse
37671
+ ),
34368
37672
  /*liftString:*/ FfiConverterString.lift,
34369
37673
  /*asyncOpts:*/ asyncOpts_,
34370
37674
  /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
@@ -34517,6 +37821,55 @@ export class BreezSdk
34517
37821
  }
34518
37822
  }
34519
37823
 
37824
+ /**
37825
+ * Sends the batch prepared by [`BreezSdk::prepare_send_batch`], returning
37826
+ * one payment per recipient in recipient order.
37827
+ *
37828
+ * Retrying after a failure that leaves the outcome unknown may pay twice:
37829
+ * a token transfer has no idempotency key, since the operator can only be
37830
+ * asked about a transaction by a hash that is computed while broadcasting.
37831
+ * Look for the batch with a `Token` payment details filter on the
37832
+ * transaction hash before sending it again.
37833
+ */
37834
+ public async sendBatch(
37835
+ request: SendBatchRequest,
37836
+ asyncOpts_?: { signal: AbortSignal }
37837
+ ): Promise<SendBatchResponse> /*throws*/ {
37838
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
37839
+ try {
37840
+ return await uniffiRustCallAsync(
37841
+ /*rustCaller:*/ uniffiCaller,
37842
+ /*rustFutureFunc:*/ () => {
37843
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_send_batch(
37844
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
37845
+ FfiConverterTypeSendBatchRequest.lower(request)
37846
+ );
37847
+ },
37848
+ /*pollFunc:*/ nativeModule()
37849
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
37850
+ /*cancelFunc:*/ nativeModule()
37851
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
37852
+ /*completeFunc:*/ nativeModule()
37853
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
37854
+ /*freeFunc:*/ nativeModule()
37855
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
37856
+ /*liftFunc:*/ FfiConverterTypeSendBatchResponse.lift.bind(
37857
+ FfiConverterTypeSendBatchResponse
37858
+ ),
37859
+ /*liftString:*/ FfiConverterString.lift,
37860
+ /*asyncOpts:*/ asyncOpts_,
37861
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
37862
+ FfiConverterTypeSdkError
37863
+ )
37864
+ );
37865
+ } catch (__error: any) {
37866
+ if (uniffiIsDebug && __error instanceof Error) {
37867
+ __error.stack = __stack;
37868
+ }
37869
+ throw __error;
37870
+ }
37871
+ }
37872
+
34520
37873
  public async sendPayment(
34521
37874
  request: SendPaymentRequest,
34522
37875
  asyncOpts_?: { signal: AbortSignal }
@@ -34642,6 +37995,59 @@ export class BreezSdk
34642
37995
  }
34643
37996
  }
34644
37997
 
37998
+ /**
37999
+ * Builds and signs a complete unilateral exit from a `prepare_unilateral_exit`
38000
+ * quote and the actual funding UTXOs, returning the full transaction set in
38001
+ * topological broadcast order without broadcasting. Broadcast it over time,
38002
+ * respecting each transaction's `depends_on` and `csv_timelock_blocks`.
38003
+ *
38004
+ * It resolves on-chain state first (see [`resolve_exit_observations`]): an
38005
+ * already-confirmed fan-out or CPFP node is not rebuilt, and a leaf refund
38006
+ * already on-chain (recognized by the leaf's refund address, so any refund
38007
+ * variant counts) is swept directly. Re-running after partial progress
38008
+ * therefore resumes rather than restarts.
38009
+ */
38010
+ public async unilateralExit(
38011
+ request: UnilateralExitRequest,
38012
+ signer: CpfpSigner,
38013
+ asyncOpts_?: { signal: AbortSignal }
38014
+ ): Promise<UnilateralExitResponse> /*throws*/ {
38015
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
38016
+ try {
38017
+ return await uniffiRustCallAsync(
38018
+ /*rustCaller:*/ uniffiCaller,
38019
+ /*rustFutureFunc:*/ () => {
38020
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_unilateral_exit(
38021
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
38022
+ FfiConverterTypeUnilateralExitRequest.lower(request),
38023
+ FfiConverterTypeCpfpSigner.lower(signer)
38024
+ );
38025
+ },
38026
+ /*pollFunc:*/ nativeModule()
38027
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
38028
+ /*cancelFunc:*/ nativeModule()
38029
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
38030
+ /*completeFunc:*/ nativeModule()
38031
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
38032
+ /*freeFunc:*/ nativeModule()
38033
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
38034
+ /*liftFunc:*/ FfiConverterTypeUnilateralExitResponse.lift.bind(
38035
+ FfiConverterTypeUnilateralExitResponse
38036
+ ),
38037
+ /*liftString:*/ FfiConverterString.lift,
38038
+ /*asyncOpts:*/ asyncOpts_,
38039
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
38040
+ FfiConverterTypeSdkError
38041
+ )
38042
+ );
38043
+ } catch (__error: any) {
38044
+ if (uniffiIsDebug && __error instanceof Error) {
38045
+ __error.stack = __stack;
38046
+ }
38047
+ throw __error;
38048
+ }
38049
+ }
38050
+
34645
38051
  /**
34646
38052
  * Unregisters a previously registered webhook.
34647
38053
  *
@@ -34867,6 +38273,233 @@ const FfiConverterTypeBreezSdk = new FfiConverterObject(
34867
38273
  uniffiTypeBreezSdkObjectFactory
34868
38274
  );
34869
38275
 
38276
+ /**
38277
+ * Signer for external UTXO inputs in CPFP fee-bumping transactions.
38278
+ *
38279
+ * Signs the non-finalized inputs of a PSBT (serialized as bytes) and returns the
38280
+ * signed PSBT (also serialized as bytes).
38281
+ */
38282
+ export interface CpfpSigner {
38283
+ signPsbt(
38284
+ psbtBytes: ArrayBuffer,
38285
+ asyncOpts_?: { signal: AbortSignal }
38286
+ ): /*throws*/ Promise<ArrayBuffer>;
38287
+ }
38288
+
38289
+ /**
38290
+ * Signer for external UTXO inputs in CPFP fee-bumping transactions.
38291
+ *
38292
+ * Signs the non-finalized inputs of a PSBT (serialized as bytes) and returns the
38293
+ * signed PSBT (also serialized as bytes).
38294
+ */
38295
+ export class CpfpSignerImpl extends UniffiAbstractObject implements CpfpSigner {
38296
+ readonly [uniffiTypeNameSymbol] = 'CpfpSignerImpl';
38297
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
38298
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
38299
+ // No primary constructor declared for this class.
38300
+ private constructor(pointer: UnsafeMutableRawPointer) {
38301
+ super();
38302
+ this[pointerLiteralSymbol] = pointer;
38303
+ this[destructorGuardSymbol] =
38304
+ uniffiTypeCpfpSignerImplObjectFactory.bless(pointer);
38305
+ }
38306
+
38307
+ public async signPsbt(
38308
+ psbtBytes: ArrayBuffer,
38309
+ asyncOpts_?: { signal: AbortSignal }
38310
+ ): Promise<ArrayBuffer> /*throws*/ {
38311
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
38312
+ try {
38313
+ return await uniffiRustCallAsync(
38314
+ /*rustCaller:*/ uniffiCaller,
38315
+ /*rustFutureFunc:*/ () => {
38316
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_cpfpsigner_sign_psbt(
38317
+ uniffiTypeCpfpSignerImplObjectFactory.clonePointer(this),
38318
+ FfiConverterArrayBuffer.lower(psbtBytes)
38319
+ );
38320
+ },
38321
+ /*pollFunc:*/ nativeModule()
38322
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
38323
+ /*cancelFunc:*/ nativeModule()
38324
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
38325
+ /*completeFunc:*/ nativeModule()
38326
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
38327
+ /*freeFunc:*/ nativeModule()
38328
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
38329
+ /*liftFunc:*/ FfiConverterArrayBuffer.lift.bind(
38330
+ FfiConverterArrayBuffer
38331
+ ),
38332
+ /*liftString:*/ FfiConverterString.lift,
38333
+ /*asyncOpts:*/ asyncOpts_,
38334
+ /*errorHandler:*/ FfiConverterTypeSignerError.lift.bind(
38335
+ FfiConverterTypeSignerError
38336
+ )
38337
+ );
38338
+ } catch (__error: any) {
38339
+ if (uniffiIsDebug && __error instanceof Error) {
38340
+ __error.stack = __stack;
38341
+ }
38342
+ throw __error;
38343
+ }
38344
+ }
38345
+
38346
+ /**
38347
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
38348
+ */
38349
+ uniffiDestroy(): void {
38350
+ const ptr = (this as any)[destructorGuardSymbol];
38351
+ if (ptr !== undefined) {
38352
+ const pointer = uniffiTypeCpfpSignerImplObjectFactory.pointer(this);
38353
+ uniffiTypeCpfpSignerImplObjectFactory.freePointer(pointer);
38354
+ uniffiTypeCpfpSignerImplObjectFactory.unbless(ptr);
38355
+ delete (this as any)[destructorGuardSymbol];
38356
+ }
38357
+ }
38358
+
38359
+ static instanceOf(obj: any): obj is CpfpSignerImpl {
38360
+ return uniffiTypeCpfpSignerImplObjectFactory.isConcreteType(obj);
38361
+ }
38362
+ }
38363
+
38364
+ const uniffiTypeCpfpSignerImplObjectFactory: UniffiObjectFactory<CpfpSigner> =
38365
+ (() => {
38366
+ return {
38367
+ create(pointer: UnsafeMutableRawPointer): CpfpSigner {
38368
+ const instance = Object.create(CpfpSignerImpl.prototype);
38369
+ instance[pointerLiteralSymbol] = pointer;
38370
+ instance[destructorGuardSymbol] = this.bless(pointer);
38371
+ instance[uniffiTypeNameSymbol] = 'CpfpSignerImpl';
38372
+ return instance;
38373
+ },
38374
+
38375
+ bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr {
38376
+ return uniffiCaller.rustCall(
38377
+ /*caller:*/ (status) =>
38378
+ nativeModule().ubrn_uniffi_internal_fn_method_cpfpsigner_ffi__bless_pointer(
38379
+ p,
38380
+ status
38381
+ ),
38382
+ /*liftString:*/ FfiConverterString.lift
38383
+ );
38384
+ },
38385
+
38386
+ unbless(ptr: UniffiRustArcPtr) {
38387
+ ptr.markDestroyed();
38388
+ },
38389
+
38390
+ pointer(obj: CpfpSigner): UnsafeMutableRawPointer {
38391
+ if ((obj as any)[destructorGuardSymbol] === undefined) {
38392
+ throw new UniffiInternalError.UnexpectedNullPointer();
38393
+ }
38394
+ return (obj as any)[pointerLiteralSymbol];
38395
+ },
38396
+
38397
+ clonePointer(obj: CpfpSigner): UnsafeMutableRawPointer {
38398
+ const pointer = this.pointer(obj);
38399
+ return uniffiCaller.rustCall(
38400
+ /*caller:*/ (callStatus) =>
38401
+ nativeModule().ubrn_uniffi_breez_sdk_spark_fn_clone_cpfpsigner(
38402
+ pointer,
38403
+ callStatus
38404
+ ),
38405
+ /*liftString:*/ FfiConverterString.lift
38406
+ );
38407
+ },
38408
+
38409
+ freePointer(pointer: UnsafeMutableRawPointer): void {
38410
+ uniffiCaller.rustCall(
38411
+ /*caller:*/ (callStatus) =>
38412
+ nativeModule().ubrn_uniffi_breez_sdk_spark_fn_free_cpfpsigner(
38413
+ pointer,
38414
+ callStatus
38415
+ ),
38416
+ /*liftString:*/ FfiConverterString.lift
38417
+ );
38418
+ },
38419
+
38420
+ isConcreteType(obj: any): obj is CpfpSigner {
38421
+ return (
38422
+ obj[destructorGuardSymbol] &&
38423
+ obj[uniffiTypeNameSymbol] === 'CpfpSignerImpl'
38424
+ );
38425
+ },
38426
+ };
38427
+ })();
38428
+ // FfiConverter for CpfpSigner
38429
+ const FfiConverterTypeCpfpSigner = new FfiConverterObjectWithCallbacks(
38430
+ uniffiTypeCpfpSignerImplObjectFactory
38431
+ );
38432
+
38433
+ // Add a vtavble for the callbacks that go in CpfpSigner.
38434
+
38435
+ // Put the implementation in a struct so we don't pollute the top-level namespace
38436
+ const uniffiCallbackInterfaceCpfpSigner: {
38437
+ vtable: UniffiVTableCallbackInterfaceCpfpSigner;
38438
+ register: () => void;
38439
+ } = {
38440
+ // Create the VTable using a series of closures.
38441
+ // ts automatically converts these into C callback functions.
38442
+ vtable: {
38443
+ signPsbt: (
38444
+ uniffiHandle: bigint,
38445
+ psbtBytes: Uint8Array,
38446
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
38447
+ uniffiCallbackData: bigint
38448
+ ) => {
38449
+ const uniffiMakeCall = async (
38450
+ signal: AbortSignal
38451
+ ): Promise<ArrayBuffer> => {
38452
+ const jsCallback = FfiConverterTypeCpfpSigner.lift(uniffiHandle);
38453
+ return await jsCallback.signPsbt(
38454
+ FfiConverterArrayBuffer.lift(psbtBytes),
38455
+ { signal }
38456
+ );
38457
+ };
38458
+ const uniffiHandleSuccess = (returnValue: ArrayBuffer) => {
38459
+ uniffiFutureCallback.call(
38460
+ uniffiFutureCallback,
38461
+ uniffiCallbackData,
38462
+ /* UniffiForeignFutureStructRustBuffer */ {
38463
+ returnValue: FfiConverterArrayBuffer.lower(returnValue),
38464
+ callStatus: uniffiCaller.createCallStatus(),
38465
+ }
38466
+ );
38467
+ };
38468
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
38469
+ uniffiFutureCallback.call(
38470
+ uniffiFutureCallback,
38471
+ uniffiCallbackData,
38472
+ /* UniffiForeignFutureStructRustBuffer */ {
38473
+ returnValue: /*empty*/ new Uint8Array(0),
38474
+ // TODO create callstatus with error.
38475
+ callStatus: uniffiCaller.createErrorStatus(code, errorBuf),
38476
+ }
38477
+ );
38478
+ };
38479
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
38480
+ /*makeCall:*/ uniffiMakeCall,
38481
+ /*handleSuccess:*/ uniffiHandleSuccess,
38482
+ /*handleError:*/ uniffiHandleError,
38483
+ /*isErrorType:*/ SignerError.instanceOf,
38484
+ /*lowerError:*/ FfiConverterTypeSignerError.lower.bind(
38485
+ FfiConverterTypeSignerError
38486
+ ),
38487
+ /*lowerString:*/ FfiConverterString.lower
38488
+ );
38489
+ return uniffiForeignFuture;
38490
+ },
38491
+ uniffiFree: (uniffiHandle: UniffiHandle): void => {
38492
+ // CpfpSigner: this will throw a stale handle error if the handle isn't found.
38493
+ FfiConverterTypeCpfpSigner.drop(uniffiHandle);
38494
+ },
38495
+ },
38496
+ register: () => {
38497
+ nativeModule().ubrn_uniffi_breez_sdk_spark_fn_init_callback_vtable_cpfpsigner(
38498
+ uniffiCallbackInterfaceCpfpSigner.vtable
38499
+ );
38500
+ },
38501
+ };
38502
+
34870
38503
  /**
34871
38504
  * External signer trait that can be implemented by users and passed to the SDK.
34872
38505
  *
@@ -36524,6 +40157,15 @@ export interface ExternalSparkSigner {
36524
40157
  message: ArrayBuffer,
36525
40158
  asyncOpts_?: { signal: AbortSignal }
36526
40159
  ): /*throws*/ Promise<EcdsaSignatureBytes>;
40160
+ /**
40161
+ * Schnorr-sign `sighash` to spend a tree leaf's P2TR refund output as a
40162
+ * BIP341 key-path spend (empty script tree).
40163
+ */
40164
+ signLeafRefundSpend(
40165
+ leafId: ExternalTreeNodeId,
40166
+ sighash: ArrayBuffer,
40167
+ asyncOpts_?: { signal: AbortSignal }
40168
+ ): /*throws*/ Promise<SchnorrSignatureBytes>;
36527
40169
  /**
36528
40170
  * Produce FROST shares for a batch of jobs.
36529
40171
  */
@@ -36842,6 +40484,51 @@ export class ExternalSparkSignerImpl
36842
40484
  }
36843
40485
  }
36844
40486
 
40487
+ /**
40488
+ * Schnorr-sign `sighash` to spend a tree leaf's P2TR refund output as a
40489
+ * BIP341 key-path spend (empty script tree).
40490
+ */
40491
+ public async signLeafRefundSpend(
40492
+ leafId: ExternalTreeNodeId,
40493
+ sighash: ArrayBuffer,
40494
+ asyncOpts_?: { signal: AbortSignal }
40495
+ ): Promise<SchnorrSignatureBytes> /*throws*/ {
40496
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
40497
+ try {
40498
+ return await uniffiRustCallAsync(
40499
+ /*rustCaller:*/ uniffiCaller,
40500
+ /*rustFutureFunc:*/ () => {
40501
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsparksigner_sign_leaf_refund_spend(
40502
+ uniffiTypeExternalSparkSignerImplObjectFactory.clonePointer(this),
40503
+ FfiConverterTypeExternalTreeNodeId.lower(leafId),
40504
+ FfiConverterArrayBuffer.lower(sighash)
40505
+ );
40506
+ },
40507
+ /*pollFunc:*/ nativeModule()
40508
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
40509
+ /*cancelFunc:*/ nativeModule()
40510
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
40511
+ /*completeFunc:*/ nativeModule()
40512
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
40513
+ /*freeFunc:*/ nativeModule()
40514
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
40515
+ /*liftFunc:*/ FfiConverterTypeSchnorrSignatureBytes.lift.bind(
40516
+ FfiConverterTypeSchnorrSignatureBytes
40517
+ ),
40518
+ /*liftString:*/ FfiConverterString.lift,
40519
+ /*asyncOpts:*/ asyncOpts_,
40520
+ /*errorHandler:*/ FfiConverterTypeSignerError.lift.bind(
40521
+ FfiConverterTypeSignerError
40522
+ )
40523
+ );
40524
+ } catch (__error: any) {
40525
+ if (uniffiIsDebug && __error instanceof Error) {
40526
+ __error.stack = __stack;
40527
+ }
40528
+ throw __error;
40529
+ }
40530
+ }
40531
+
36845
40532
  /**
36846
40533
  * Produce FROST shares for a batch of jobs.
36847
40534
  */
@@ -37632,6 +41319,58 @@ const uniffiCallbackInterfaceExternalSparkSigner: {
37632
41319
  );
37633
41320
  return uniffiForeignFuture;
37634
41321
  },
41322
+ signLeafRefundSpend: (
41323
+ uniffiHandle: bigint,
41324
+ leafId: Uint8Array,
41325
+ sighash: Uint8Array,
41326
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
41327
+ uniffiCallbackData: bigint
41328
+ ) => {
41329
+ const uniffiMakeCall = async (
41330
+ signal: AbortSignal
41331
+ ): Promise<SchnorrSignatureBytes> => {
41332
+ const jsCallback =
41333
+ FfiConverterTypeExternalSparkSigner.lift(uniffiHandle);
41334
+ return await jsCallback.signLeafRefundSpend(
41335
+ FfiConverterTypeExternalTreeNodeId.lift(leafId),
41336
+ FfiConverterArrayBuffer.lift(sighash),
41337
+ { signal }
41338
+ );
41339
+ };
41340
+ const uniffiHandleSuccess = (returnValue: SchnorrSignatureBytes) => {
41341
+ uniffiFutureCallback.call(
41342
+ uniffiFutureCallback,
41343
+ uniffiCallbackData,
41344
+ /* UniffiForeignFutureStructRustBuffer */ {
41345
+ returnValue:
41346
+ FfiConverterTypeSchnorrSignatureBytes.lower(returnValue),
41347
+ callStatus: uniffiCaller.createCallStatus(),
41348
+ }
41349
+ );
41350
+ };
41351
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
41352
+ uniffiFutureCallback.call(
41353
+ uniffiFutureCallback,
41354
+ uniffiCallbackData,
41355
+ /* UniffiForeignFutureStructRustBuffer */ {
41356
+ returnValue: /*empty*/ new Uint8Array(0),
41357
+ // TODO create callstatus with error.
41358
+ callStatus: uniffiCaller.createErrorStatus(code, errorBuf),
41359
+ }
41360
+ );
41361
+ };
41362
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
41363
+ /*makeCall:*/ uniffiMakeCall,
41364
+ /*handleSuccess:*/ uniffiHandleSuccess,
41365
+ /*handleError:*/ uniffiHandleError,
41366
+ /*isErrorType:*/ SignerError.instanceOf,
41367
+ /*lowerError:*/ FfiConverterTypeSignerError.lower.bind(
41368
+ FfiConverterTypeSignerError
41369
+ ),
41370
+ /*lowerString:*/ FfiConverterString.lower
41371
+ );
41372
+ return uniffiForeignFuture;
41373
+ },
37635
41374
  signFrost: (
37636
41375
  uniffiHandle: bigint,
37637
41376
  jobs: Uint8Array,
@@ -38534,10 +42273,12 @@ export interface PasskeyClientInterface {
38534
42273
  */
38535
42274
  labels(): PasskeyLabelsInterface;
38536
42275
  /**
38537
- * First-time setup. Drives [`PrfProvider::create_passkey`] (one
38538
- * ceremony) followed by the wallet-derivation flow that backs
38539
- * [`Passkey::setup_wallet`] (one ceremony, dual-salt where
38540
- * supported). The label is always published on success.
42276
+ * First-time setup. Drives [`PrfProvider::create_passkey`], which
42277
+ * returns the seeds inline where the platform evaluates PRF during
42278
+ * the create ceremony; otherwise the wallet-derivation flow behind
42279
+ * [`Passkey::setup_wallet`] runs as a second ceremony. The label is
42280
+ * validated before anything is created, and published in the
42281
+ * background: it may still be in flight when this returns `Ok`.
38541
42282
  */
38542
42283
  register(
38543
42284
  request: RegisterRequest,
@@ -38723,10 +42464,12 @@ export class PasskeyClient
38723
42464
  }
38724
42465
 
38725
42466
  /**
38726
- * First-time setup. Drives [`PrfProvider::create_passkey`] (one
38727
- * ceremony) followed by the wallet-derivation flow that backs
38728
- * [`Passkey::setup_wallet`] (one ceremony, dual-salt where
38729
- * supported). The label is always published on success.
42467
+ * First-time setup. Drives [`PrfProvider::create_passkey`], which
42468
+ * returns the seeds inline where the platform evaluates PRF during
42469
+ * the create ceremony; otherwise the wallet-derivation flow behind
42470
+ * [`Passkey::setup_wallet`] runs as a second ceremony. The label is
42471
+ * validated before anything is created, and published in the
42472
+ * background: it may still be in flight when this returns `Ok`.
38730
42473
  */
38731
42474
  public async register(
38732
42475
  request: RegisterRequest,
@@ -39464,20 +43207,35 @@ export interface PrfProvider {
39464
43207
  signal: AbortSignal;
39465
43208
  }): /*throws*/ Promise<boolean>;
39466
43209
  /**
39467
- * Explicit registration. Platform passkey providers override this to
39468
- * drive the OS create ceremony and surface the credential metadata
39469
- * hosts need for `exclude_credentials` bookkeeping. CLI / hardware
39470
- * providers register lazily in [`Self::derive_seeds`] and inherit the
39471
- * default `PrfNotSupported`.
43210
+ * Explicit registration: drive the OS create ceremony, and where the
43211
+ * platform supports it, evaluate PRF for `salts` in the same
43212
+ * ceremony. Platform passkey providers override this to surface the
43213
+ * credential metadata hosts need for `exclude_credentials`
43214
+ * bookkeeping. CLI / hardware providers register lazily in
43215
+ * [`Self::derive_seeds`] and inherit the default `PrfNotSupported`.
39472
43216
  *
39473
43217
  * `exclude_credentials` lists already-registered IDs and surfaces
39474
43218
  * duplicates as `CredentialAlreadyExists`. The `user.id` is always
39475
43219
  * provider-minted and returned on `PasskeyCredential.user_id`.
43220
+ *
43221
+ * Returning seeds removes the assertion that would otherwise follow
43222
+ * a create, and with it the window where the new credential exists
43223
+ * but the platform cannot yet resolve it. Return `seeds: None` for
43224
+ * anything short of one output per salt (some authenticators drop
43225
+ * `prf.eval.second`): a partial result is not usable, and the caller
43226
+ * falls back to [`Self::derive_seeds`]. Empty `salts` means the
43227
+ * caller wants the credential only.
43228
+ *
43229
+ * Seeds returned here must equal what [`Self::derive_seeds`] would
43230
+ * return for the same salts. The wallet is derived from them either
43231
+ * way, so a mismatch means register and sign-in land on different
43232
+ * wallets, and the one register created is unreachable.
39476
43233
  */
39477
43234
  createPasskey(
39478
43235
  excludeCredentials: Array<ArrayBuffer>,
43236
+ salts: Array<string>,
39479
43237
  asyncOpts_?: { signal: AbortSignal }
39480
- ): /*throws*/ Promise<PasskeyCredential>;
43238
+ ): /*throws*/ Promise<CreatePasskeyOutput>;
39481
43239
  /**
39482
43240
  * Advisory check against the platform's out-of-band verification
39483
43241
  * source (iOS AASA / Android assetlinks / browser rpId scope).
@@ -39614,20 +43372,35 @@ export class PrfProviderImpl
39614
43372
  }
39615
43373
 
39616
43374
  /**
39617
- * Explicit registration. Platform passkey providers override this to
39618
- * drive the OS create ceremony and surface the credential metadata
39619
- * hosts need for `exclude_credentials` bookkeeping. CLI / hardware
39620
- * providers register lazily in [`Self::derive_seeds`] and inherit the
39621
- * default `PrfNotSupported`.
43375
+ * Explicit registration: drive the OS create ceremony, and where the
43376
+ * platform supports it, evaluate PRF for `salts` in the same
43377
+ * ceremony. Platform passkey providers override this to surface the
43378
+ * credential metadata hosts need for `exclude_credentials`
43379
+ * bookkeeping. CLI / hardware providers register lazily in
43380
+ * [`Self::derive_seeds`] and inherit the default `PrfNotSupported`.
39622
43381
  *
39623
43382
  * `exclude_credentials` lists already-registered IDs and surfaces
39624
43383
  * duplicates as `CredentialAlreadyExists`. The `user.id` is always
39625
43384
  * provider-minted and returned on `PasskeyCredential.user_id`.
43385
+ *
43386
+ * Returning seeds removes the assertion that would otherwise follow
43387
+ * a create, and with it the window where the new credential exists
43388
+ * but the platform cannot yet resolve it. Return `seeds: None` for
43389
+ * anything short of one output per salt (some authenticators drop
43390
+ * `prf.eval.second`): a partial result is not usable, and the caller
43391
+ * falls back to [`Self::derive_seeds`]. Empty `salts` means the
43392
+ * caller wants the credential only.
43393
+ *
43394
+ * Seeds returned here must equal what [`Self::derive_seeds`] would
43395
+ * return for the same salts. The wallet is derived from them either
43396
+ * way, so a mismatch means register and sign-in land on different
43397
+ * wallets, and the one register created is unreachable.
39626
43398
  */
39627
43399
  public async createPasskey(
39628
43400
  excludeCredentials: Array<ArrayBuffer>,
43401
+ salts: Array<string>,
39629
43402
  asyncOpts_?: { signal: AbortSignal }
39630
- ): Promise<PasskeyCredential> /*throws*/ {
43403
+ ): Promise<CreatePasskeyOutput> /*throws*/ {
39631
43404
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
39632
43405
  try {
39633
43406
  return await uniffiRustCallAsync(
@@ -39635,7 +43408,8 @@ export class PrfProviderImpl
39635
43408
  /*rustFutureFunc:*/ () => {
39636
43409
  return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_prfprovider_create_passkey(
39637
43410
  uniffiTypePrfProviderImplObjectFactory.clonePointer(this),
39638
- FfiConverterArrayArrayBuffer.lower(excludeCredentials)
43411
+ FfiConverterArrayArrayBuffer.lower(excludeCredentials),
43412
+ FfiConverterArrayString.lower(salts)
39639
43413
  );
39640
43414
  },
39641
43415
  /*pollFunc:*/ nativeModule()
@@ -39646,8 +43420,8 @@ export class PrfProviderImpl
39646
43420
  .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
39647
43421
  /*freeFunc:*/ nativeModule()
39648
43422
  .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
39649
- /*liftFunc:*/ FfiConverterTypePasskeyCredential.lift.bind(
39650
- FfiConverterTypePasskeyCredential
43423
+ /*liftFunc:*/ FfiConverterTypeCreatePasskeyOutput.lift.bind(
43424
+ FfiConverterTypeCreatePasskeyOutput
39651
43425
  ),
39652
43426
  /*liftString:*/ FfiConverterString.lift,
39653
43427
  /*asyncOpts:*/ asyncOpts_,
@@ -39904,24 +43678,26 @@ const uniffiCallbackInterfacePrfProvider: {
39904
43678
  createPasskey: (
39905
43679
  uniffiHandle: bigint,
39906
43680
  excludeCredentials: Uint8Array,
43681
+ salts: Uint8Array,
39907
43682
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
39908
43683
  uniffiCallbackData: bigint
39909
43684
  ) => {
39910
43685
  const uniffiMakeCall = async (
39911
43686
  signal: AbortSignal
39912
- ): Promise<PasskeyCredential> => {
43687
+ ): Promise<CreatePasskeyOutput> => {
39913
43688
  const jsCallback = FfiConverterTypePrfProvider.lift(uniffiHandle);
39914
43689
  return await jsCallback.createPasskey(
39915
43690
  FfiConverterArrayArrayBuffer.lift(excludeCredentials),
43691
+ FfiConverterArrayString.lift(salts),
39916
43692
  { signal }
39917
43693
  );
39918
43694
  };
39919
- const uniffiHandleSuccess = (returnValue: PasskeyCredential) => {
43695
+ const uniffiHandleSuccess = (returnValue: CreatePasskeyOutput) => {
39920
43696
  uniffiFutureCallback.call(
39921
43697
  uniffiFutureCallback,
39922
43698
  uniffiCallbackData,
39923
43699
  /* UniffiForeignFutureStructRustBuffer */ {
39924
- returnValue: FfiConverterTypePasskeyCredential.lower(returnValue),
43700
+ returnValue: FfiConverterTypeCreatePasskeyOutput.lower(returnValue),
39925
43701
  callStatus: uniffiCaller.createCallStatus(),
39926
43702
  }
39927
43703
  );
@@ -45839,6 +49615,16 @@ const FfiConverterArrayArrayBuffer = new FfiConverterArray(
45839
49615
  FfiConverterArrayBuffer
45840
49616
  );
45841
49617
 
49618
+ // FfiConverter for Array<BatchRecipient>
49619
+ const FfiConverterArrayTypeBatchRecipient = new FfiConverterArray(
49620
+ FfiConverterTypeBatchRecipient
49621
+ );
49622
+
49623
+ // FfiConverter for Array<BatchTotal>
49624
+ const FfiConverterArrayTypeBatchTotal = new FfiConverterArray(
49625
+ FfiConverterTypeBatchTotal
49626
+ );
49627
+
45842
49628
  // FfiConverter for Array<Bip21Extra>
45843
49629
  const FfiConverterArrayTypeBip21Extra = new FfiConverterArray(
45844
49630
  FfiConverterTypeBip21Extra
@@ -45969,6 +49755,11 @@ const FfiConverterArrayTypePaymentIdUpdate = new FfiConverterArray(
45969
49755
  FfiConverterTypePaymentIdUpdate
45970
49756
  );
45971
49757
 
49758
+ // FfiConverter for Array<PerBranchFunding>
49759
+ const FfiConverterArrayTypePerBranchFunding = new FfiConverterArray(
49760
+ FfiConverterTypePerBranchFunding
49761
+ );
49762
+
45972
49763
  // FfiConverter for Array<ProvisionalPayment>
45973
49764
  const FfiConverterArrayTypeProvisionalPayment = new FfiConverterArray(
45974
49765
  FfiConverterTypeProvisionalPayment
@@ -45982,6 +49773,11 @@ const FfiConverterArrayTypeRecord = new FfiConverterArray(
45982
49773
  FfiConverterTypeRecord
45983
49774
  );
45984
49775
 
49776
+ // FfiConverter for Array<ResolvedBatchRecipient>
49777
+ const FfiConverterArrayTypeResolvedBatchRecipient = new FfiConverterArray(
49778
+ FfiConverterTypeResolvedBatchRecipient
49779
+ );
49780
+
45985
49781
  // FfiConverter for Array<SetLnurlMetadataItem>
45986
49782
  const FfiConverterArrayTypeSetLnurlMetadataItem = new FfiConverterArray(
45987
49783
  FfiConverterTypeSetLnurlMetadataItem
@@ -46007,6 +49803,16 @@ const FfiConverterArrayTypeTokenMetadata = new FfiConverterArray(
46007
49803
  FfiConverterTypeTokenMetadata
46008
49804
  );
46009
49805
 
49806
+ // FfiConverter for Array<UnilateralExitLeaf>
49807
+ const FfiConverterArrayTypeUnilateralExitLeaf = new FfiConverterArray(
49808
+ FfiConverterTypeUnilateralExitLeaf
49809
+ );
49810
+
49811
+ // FfiConverter for Array<UnilateralExitTransaction>
49812
+ const FfiConverterArrayTypeUnilateralExitTransaction = new FfiConverterArray(
49813
+ FfiConverterTypeUnilateralExitTransaction
49814
+ );
49815
+
46010
49816
  // FfiConverter for Array<Utxo>
46011
49817
  const FfiConverterArrayTypeUtxo = new FfiConverterArray(FfiConverterTypeUtxo);
46012
49818
 
@@ -46101,6 +49907,10 @@ const FfiConverterOptionalTypeSendPaymentOptions = new FfiConverterOptional(
46101
49907
  FfiConverterTypeSendPaymentOptions
46102
49908
  );
46103
49909
 
49910
+ // FfiConverter for SparkMasterIdentityPublicKey | undefined
49911
+ const FfiConverterOptionalTypeSparkMasterIdentityPublicKey =
49912
+ new FfiConverterOptional(FfiConverterTypeSparkMasterIdentityPublicKey);
49913
+
46104
49914
  // FfiConverter for StableBalanceActiveLabel | undefined
46105
49915
  const FfiConverterOptionalTypeStableBalanceActiveLabel =
46106
49916
  new FfiConverterOptional(FfiConverterTypeStableBalanceActiveLabel);
@@ -46139,6 +49949,11 @@ const FfiConverterOptionalArrayArrayBuffer = new FfiConverterOptional(
46139
49949
  const FfiConverterOptionalArrayTypeExternalInputParser =
46140
49950
  new FfiConverterOptional(FfiConverterArrayTypeExternalInputParser);
46141
49951
 
49952
+ // FfiConverter for Array<CpfpInput>
49953
+ const FfiConverterArrayTypeCpfpInput = new FfiConverterArray(
49954
+ FfiConverterTypeCpfpInput
49955
+ );
49956
+
46142
49957
  // FfiConverter for Array<InputType>
46143
49958
  const FfiConverterArrayTypeInputType = new FfiConverterArray(
46144
49959
  FfiConverterTypeInputType
@@ -46343,6 +50158,14 @@ function uniffiEnsureInitialized() {
46343
50158
  'uniffi_breez_sdk_spark_checksum_func_new_shared_sdk_context'
46344
50159
  );
46345
50160
  }
50161
+ if (
50162
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_single_key_cpfp_signer() !==
50163
+ 28762
50164
+ ) {
50165
+ throw new UniffiInternalError.ApiChecksumMismatch(
50166
+ 'uniffi_breez_sdk_spark_checksum_func_single_key_cpfp_signer'
50167
+ );
50168
+ }
46346
50169
  if (
46347
50170
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos() !==
46348
50171
  20959
@@ -46351,9 +50174,17 @@ function uniffiEnsureInitialized() {
46351
50174
  'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos'
46352
50175
  );
46353
50176
  }
50177
+ if (
50178
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_txos() !==
50179
+ 10702
50180
+ ) {
50181
+ throw new UniffiInternalError.ApiChecksumMismatch(
50182
+ 'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_txos'
50183
+ );
50184
+ }
46354
50185
  if (
46355
50186
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status() !==
46356
- 23018
50187
+ 53546
46357
50188
  ) {
46358
50189
  throw new UniffiInternalError.ApiChecksumMismatch(
46359
50190
  'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status'
@@ -46361,15 +50192,23 @@ function uniffiEnsureInitialized() {
46361
50192
  }
46362
50193
  if (
46363
50194
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_hex() !==
46364
- 59376
50195
+ 16866
46365
50196
  ) {
46366
50197
  throw new UniffiInternalError.ApiChecksumMismatch(
46367
50198
  'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_hex'
46368
50199
  );
46369
50200
  }
50201
+ if (
50202
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_outspend() !==
50203
+ 42521
50204
+ ) {
50205
+ throw new UniffiInternalError.ApiChecksumMismatch(
50206
+ 'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_outspend'
50207
+ );
50208
+ }
46370
50209
  if (
46371
50210
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_broadcast_transaction() !==
46372
- 65179
50211
+ 13500
46373
50212
  ) {
46374
50213
  throw new UniffiInternalError.ApiChecksumMismatch(
46375
50214
  'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_broadcast_transaction'
@@ -46377,7 +50216,7 @@ function uniffiEnsureInitialized() {
46377
50216
  }
46378
50217
  if (
46379
50218
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_recommended_fees() !==
46380
- 43230
50219
+ 50885
46381
50220
  ) {
46382
50221
  throw new UniffiInternalError.ApiChecksumMismatch(
46383
50222
  'uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_recommended_fees'
@@ -46407,6 +50246,14 @@ function uniffiEnsureInitialized() {
46407
50246
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_authorize_lightning_address_transfer'
46408
50247
  );
46409
50248
  }
50249
+ if (
50250
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_build_unsigned_batch_package() !==
50251
+ 52999
50252
+ ) {
50253
+ throw new UniffiInternalError.ApiChecksumMismatch(
50254
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_build_unsigned_batch_package'
50255
+ );
50256
+ }
46410
50257
  if (
46411
50258
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_build_unsigned_lnurl_pay_package() !==
46412
50259
  23822
@@ -46655,6 +50502,14 @@ function uniffiEnsureInitialized() {
46655
50502
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay'
46656
50503
  );
46657
50504
  }
50505
+ if (
50506
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_batch() !==
50507
+ 59347
50508
+ ) {
50509
+ throw new UniffiInternalError.ApiChecksumMismatch(
50510
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_batch'
50511
+ );
50512
+ }
46658
50513
  if (
46659
50514
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_payment() !==
46660
50515
  34185
@@ -46663,6 +50518,14 @@ function uniffiEnsureInitialized() {
46663
50518
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_payment'
46664
50519
  );
46665
50520
  }
50521
+ if (
50522
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_unilateral_exit() !==
50523
+ 36492
50524
+ ) {
50525
+ throw new UniffiInternalError.ApiChecksumMismatch(
50526
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_unilateral_exit'
50527
+ );
50528
+ }
46666
50529
  if (
46667
50530
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_publish_signed_lnurl_pay_package() !==
46668
50531
  48698
@@ -46705,7 +50568,7 @@ function uniffiEnsureInitialized() {
46705
50568
  }
46706
50569
  if (
46707
50570
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_pending_conversions() !==
46708
- 24173
50571
+ 11342
46709
50572
  ) {
46710
50573
  throw new UniffiInternalError.ApiChecksumMismatch(
46711
50574
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_pending_conversions'
@@ -46735,6 +50598,14 @@ function uniffiEnsureInitialized() {
46735
50598
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener'
46736
50599
  );
46737
50600
  }
50601
+ if (
50602
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_batch() !==
50603
+ 34563
50604
+ ) {
50605
+ throw new UniffiInternalError.ApiChecksumMismatch(
50606
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_send_batch'
50607
+ );
50608
+ }
46738
50609
  if (
46739
50610
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment() !==
46740
50611
  54349
@@ -46759,6 +50630,14 @@ function uniffiEnsureInitialized() {
46759
50630
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet'
46760
50631
  );
46761
50632
  }
50633
+ if (
50634
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_unilateral_exit() !==
50635
+ 23033
50636
+ ) {
50637
+ throw new UniffiInternalError.ApiChecksumMismatch(
50638
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_unilateral_exit'
50639
+ );
50640
+ }
46762
50641
  if (
46763
50642
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_unregister_webhook() !==
46764
50643
  34100
@@ -46783,6 +50662,14 @@ function uniffiEnsureInitialized() {
46783
50662
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_update_user_settings'
46784
50663
  );
46785
50664
  }
50665
+ if (
50666
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_cpfpsigner_sign_psbt() !==
50667
+ 20736
50668
+ ) {
50669
+ throw new UniffiInternalError.ApiChecksumMismatch(
50670
+ 'uniffi_breez_sdk_spark_checksum_method_cpfpsigner_sign_psbt'
50671
+ );
50672
+ }
46786
50673
  if (
46787
50674
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalbreezsigner_derive_public_key() !==
46788
50675
  26700
@@ -46919,9 +50806,17 @@ function uniffiEnsureInitialized() {
46919
50806
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_message'
46920
50807
  );
46921
50808
  }
50809
+ if (
50810
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_leaf_refund_spend() !==
50811
+ 62629
50812
+ ) {
50813
+ throw new UniffiInternalError.ApiChecksumMismatch(
50814
+ 'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_leaf_refund_spend'
50815
+ );
50816
+ }
46922
50817
  if (
46923
50818
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_frost() !==
46924
- 41995
50819
+ 58732
46925
50820
  ) {
46926
50821
  throw new UniffiInternalError.ApiChecksumMismatch(
46927
50822
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_frost'
@@ -46929,7 +50824,7 @@ function uniffiEnsureInitialized() {
46929
50824
  }
46930
50825
  if (
46931
50826
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_transfer() !==
46932
- 7663
50827
+ 29829
46933
50828
  ) {
46934
50829
  throw new UniffiInternalError.ApiChecksumMismatch(
46935
50830
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_transfer'
@@ -46937,7 +50832,7 @@ function uniffiEnsureInitialized() {
46937
50832
  }
46938
50833
  if (
46939
50834
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_claim() !==
46940
- 40463
50835
+ 17684
46941
50836
  ) {
46942
50837
  throw new UniffiInternalError.ApiChecksumMismatch(
46943
50838
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_claim'
@@ -46945,7 +50840,7 @@ function uniffiEnsureInitialized() {
46945
50840
  }
46946
50841
  if (
46947
50842
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_lightning_receive() !==
46948
- 22362
50843
+ 25306
46949
50844
  ) {
46950
50845
  throw new UniffiInternalError.ApiChecksumMismatch(
46951
50846
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_lightning_receive'
@@ -46953,7 +50848,7 @@ function uniffiEnsureInitialized() {
46953
50848
  }
46954
50849
  if (
46955
50850
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_static_deposit() !==
46956
- 44945
50851
+ 3348
46957
50852
  ) {
46958
50853
  throw new UniffiInternalError.ApiChecksumMismatch(
46959
50854
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_static_deposit'
@@ -46961,7 +50856,7 @@ function uniffiEnsureInitialized() {
46961
50856
  }
46962
50857
  if (
46963
50858
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_start_static_deposit_refund() !==
46964
- 15575
50859
+ 22709
46965
50860
  ) {
46966
50861
  throw new UniffiInternalError.ApiChecksumMismatch(
46967
50862
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_start_static_deposit_refund'
@@ -46969,7 +50864,7 @@ function uniffiEnsureInitialized() {
46969
50864
  }
46970
50865
  if (
46971
50866
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_static_deposit_refund() !==
46972
- 3082
50867
+ 52719
46973
50868
  ) {
46974
50869
  throw new UniffiInternalError.ApiChecksumMismatch(
46975
50870
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_static_deposit_refund'
@@ -46977,7 +50872,7 @@ function uniffiEnsureInitialized() {
46977
50872
  }
46978
50873
  if (
46979
50874
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_spark_invoice() !==
46980
- 33
50875
+ 39737
46981
50876
  ) {
46982
50877
  throw new UniffiInternalError.ApiChecksumMismatch(
46983
50878
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_spark_invoice'
@@ -46985,7 +50880,7 @@ function uniffiEnsureInitialized() {
46985
50880
  }
46986
50881
  if (
46987
50882
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_token_transaction() !==
46988
- 33122
50883
+ 12801
46989
50884
  ) {
46990
50885
  throw new UniffiInternalError.ApiChecksumMismatch(
46991
50886
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_token_transaction'
@@ -46993,7 +50888,7 @@ function uniffiEnsureInitialized() {
46993
50888
  }
46994
50889
  if (
46995
50890
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_static_deposit_claim() !==
46996
- 14601
50891
+ 53174
46997
50892
  ) {
46998
50893
  throw new UniffiInternalError.ApiChecksumMismatch(
46999
50894
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_static_deposit_claim'
@@ -47041,7 +50936,7 @@ function uniffiEnsureInitialized() {
47041
50936
  }
47042
50937
  if (
47043
50938
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_passkeyclient_register() !==
47044
- 18330
50939
+ 27748
47045
50940
  ) {
47046
50941
  throw new UniffiInternalError.ApiChecksumMismatch(
47047
50942
  'uniffi_breez_sdk_spark_checksum_method_passkeyclient_register'
@@ -47105,7 +51000,7 @@ function uniffiEnsureInitialized() {
47105
51000
  }
47106
51001
  if (
47107
51002
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_prfprovider_create_passkey() !==
47108
- 1967
51003
+ 61235
47109
51004
  ) {
47110
51005
  throw new UniffiInternalError.ApiChecksumMismatch(
47111
51006
  'uniffi_breez_sdk_spark_checksum_method_prfprovider_create_passkey'
@@ -47611,6 +51506,7 @@ function uniffiEnsureInitialized() {
47611
51506
  uniffiCallbackInterfaceEventListener.register();
47612
51507
  uniffiCallbackInterfaceLogger.register();
47613
51508
  uniffiCallbackInterfaceBitcoinChainService.register();
51509
+ uniffiCallbackInterfaceCpfpSigner.register();
47614
51510
  uniffiCallbackInterfaceExternalBreezSigner.register();
47615
51511
  uniffiCallbackInterfaceExternalSigningSigner.register();
47616
51512
  uniffiCallbackInterfaceExternalSparkSigner.register();
@@ -47634,6 +51530,9 @@ export default Object.freeze({
47634
51530
  FfiConverterTypeAssetFilter,
47635
51531
  FfiConverterTypeAuthorizeTransferRequest,
47636
51532
  FfiConverterTypeAutoOptimizationEvent,
51533
+ FfiConverterTypeBatchDestination,
51534
+ FfiConverterTypeBatchRecipient,
51535
+ FfiConverterTypeBatchTotal,
47637
51536
  FfiConverterTypeBip21Details,
47638
51537
  FfiConverterTypeBip21Extra,
47639
51538
  FfiConverterTypeBitcoinAddressDetails,
@@ -47651,6 +51550,7 @@ export default Object.freeze({
47651
51550
  FfiConverterTypeBolt12OfferDetails,
47652
51551
  FfiConverterTypeBreezSdk,
47653
51552
  FfiConverterTypeBuildTransferPackageOptions,
51553
+ FfiConverterTypeBuildUnsignedBatchPackageRequest,
47654
51554
  FfiConverterTypeBuildUnsignedLnurlPayPackageRequest,
47655
51555
  FfiConverterTypeBuildUnsignedTransferPackageRequest,
47656
51556
  FfiConverterTypeBurnIssuerTokenRequest,
@@ -47667,6 +51567,7 @@ export default Object.freeze({
47667
51567
  FfiConverterTypeClaimHtlcPaymentResponse,
47668
51568
  FfiConverterTypeClaimTransferRequest,
47669
51569
  FfiConverterTypeConfig,
51570
+ FfiConverterTypeConfirmationStatus,
47670
51571
  FfiConverterTypeConnectRequest,
47671
51572
  FfiConverterTypeConnectWithPasskeyRequest,
47672
51573
  FfiConverterTypeConnectWithPasskeyResponse,
@@ -47686,7 +51587,11 @@ export default Object.freeze({
47686
51587
  FfiConverterTypeConversionSide,
47687
51588
  FfiConverterTypeConversionStatus,
47688
51589
  FfiConverterTypeConversionType,
51590
+ FfiConverterTypeCpfpFundingKind,
51591
+ FfiConverterTypeCpfpInput,
51592
+ FfiConverterTypeCpfpSigner,
47689
51593
  FfiConverterTypeCreateIssuerTokenRequest,
51594
+ FfiConverterTypeCreatePasskeyOutput,
47690
51595
  FfiConverterTypeCredentials,
47691
51596
  FfiConverterTypeCrossChainAddressDetails,
47692
51597
  FfiConverterTypeCrossChainAddressFamily,
@@ -47704,6 +51609,7 @@ export default Object.freeze({
47704
51609
  FfiConverterTypeDomainAssociation,
47705
51610
  FfiConverterTypeEcdsaSignatureBytes,
47706
51611
  FfiConverterTypeErrorKind,
51612
+ FfiConverterTypeExitLeafSelection,
47707
51613
  FfiConverterTypeExternalBreezSigner,
47708
51614
  FfiConverterTypeExternalClaimLeafInput,
47709
51615
  FfiConverterTypeExternalFrostCommitments,
@@ -47800,6 +51706,7 @@ export default Object.freeze({
47800
51706
  FfiConverterTypeOptimizeLeavesRequest,
47801
51707
  FfiConverterTypeOptimizeLeavesResponse,
47802
51708
  FfiConverterTypeOutgoingChange,
51709
+ FfiConverterTypeOutspend,
47803
51710
  FfiConverterTypePasskeyAvailability,
47804
51711
  FfiConverterTypePasskeyClient,
47805
51712
  FfiConverterTypePasskeyConfig,
@@ -47819,10 +51726,15 @@ export default Object.freeze({
47819
51726
  FfiConverterTypePaymentRequestSource,
47820
51727
  FfiConverterTypePaymentStatus,
47821
51728
  FfiConverterTypePaymentType,
51729
+ FfiConverterTypePerBranchFunding,
47822
51730
  FfiConverterTypePrepareLnurlPayRequest,
47823
51731
  FfiConverterTypePrepareLnurlPayResponse,
51732
+ FfiConverterTypePrepareSendBatchRequest,
51733
+ FfiConverterTypePrepareSendBatchResponse,
47824
51734
  FfiConverterTypePrepareSendPaymentRequest,
47825
51735
  FfiConverterTypePrepareSendPaymentResponse,
51736
+ FfiConverterTypePrepareUnilateralExitRequest,
51737
+ FfiConverterTypePrepareUnilateralExitResponse,
47826
51738
  FfiConverterTypePrfProvider,
47827
51739
  FfiConverterTypePrfProviderError,
47828
51740
  FfiConverterTypeProvisionalPayment,
@@ -47844,11 +51756,13 @@ export default Object.freeze({
47844
51756
  FfiConverterTypeRecoverableEcdsaSignatureBytes,
47845
51757
  FfiConverterTypeRefundDepositRequest,
47846
51758
  FfiConverterTypeRefundDepositResponse,
51759
+ FfiConverterTypeRefundPendingConversionsResponse,
47847
51760
  FfiConverterTypeRegisterLightningAddressRequest,
47848
51761
  FfiConverterTypeRegisterRequest,
47849
51762
  FfiConverterTypeRegisterResponse,
47850
51763
  FfiConverterTypeRegisterWebhookRequest,
47851
51764
  FfiConverterTypeRegisterWebhookResponse,
51765
+ FfiConverterTypeResolvedBatchRecipient,
47852
51766
  FfiConverterTypeResolvedStores,
47853
51767
  FfiConverterTypeRestClient,
47854
51768
  FfiConverterTypeRestResponse,
@@ -47860,6 +51774,8 @@ export default Object.freeze({
47860
51774
  FfiConverterTypeSdkEvent,
47861
51775
  FfiConverterTypeSecretBytes,
47862
51776
  FfiConverterTypeSeed,
51777
+ FfiConverterTypeSendBatchRequest,
51778
+ FfiConverterTypeSendBatchResponse,
47863
51779
  FfiConverterTypeSendOnchainFeeQuote,
47864
51780
  FfiConverterTypeSendOnchainSpeedFeeQuote,
47865
51781
  FfiConverterTypeSendPaymentMethod,
@@ -47889,6 +51805,7 @@ export default Object.freeze({
47889
51805
  FfiConverterTypeSparkHtlcStatus,
47890
51806
  FfiConverterTypeSparkInvoiceDetails,
47891
51807
  FfiConverterTypeSparkInvoicePaymentDetails,
51808
+ FfiConverterTypeSparkMasterIdentityPublicKey,
47892
51809
  FfiConverterTypeSparkSigningOperator,
47893
51810
  FfiConverterTypeSparkSspConfig,
47894
51811
  FfiConverterTypeSparkStatus,
@@ -47919,6 +51836,11 @@ export default Object.freeze({
47919
51836
  FfiConverterTypeTxStatus,
47920
51837
  FfiConverterTypeUnfreezeIssuerTokenRequest,
47921
51838
  FfiConverterTypeUnfreezeIssuerTokenResponse,
51839
+ FfiConverterTypeUnilateralExitLeaf,
51840
+ FfiConverterTypeUnilateralExitRequest,
51841
+ FfiConverterTypeUnilateralExitResponse,
51842
+ FfiConverterTypeUnilateralExitTransaction,
51843
+ FfiConverterTypeUnilateralExitTxKind,
47922
51844
  FfiConverterTypeUnregisterWebhookRequest,
47923
51845
  FfiConverterTypeUnsignedTransferPackage,
47924
51846
  FfiConverterTypeUnversionedRecordChange,