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

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.
@@ -460,6 +460,59 @@ export function defaultServerConfig(network: Network): Config {
460
460
  )
461
461
  );
462
462
  }
463
+ /**
464
+ * The session store `backend` provides for `identity` on `network` (its own
465
+ * persistence: `PostgreSQL`/`MySQL` when the backend is DB-backed, else an
466
+ * in-memory store).
467
+ *
468
+ * Returned so it can be wrapped in a decorating [`SessionStore`] and passed to
469
+ * [`SdkBuilder::with_session_store`](crate::SdkBuilder::with_session_store),
470
+ * keeping the backend's persistence. A typical use is at-rest encryption (the
471
+ * SDK does not encrypt tokens itself): wrap it in a store that encrypts on
472
+ * write and decrypts on read. `identity` is the wallet identity public key
473
+ * bytes (the same value the SDK derives from the signer).
474
+ */
475
+ export async function defaultSessionStore(
476
+ backend: StorageBackend,
477
+ network: Network,
478
+ identity: ArrayBuffer,
479
+ asyncOpts_?: { signal: AbortSignal }
480
+ ): Promise<SessionStore> /*throws*/ {
481
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
482
+ try {
483
+ return await uniffiRustCallAsync(
484
+ /*rustCaller:*/ uniffiCaller,
485
+ /*rustFutureFunc:*/ () => {
486
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_func_default_session_store(
487
+ FfiConverterTypeStorageBackend.lower(backend),
488
+ FfiConverterTypeNetwork.lower(network),
489
+ FfiConverterArrayBuffer.lower(identity)
490
+ );
491
+ },
492
+ /*pollFunc:*/ nativeModule()
493
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_pointer,
494
+ /*cancelFunc:*/ nativeModule()
495
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_pointer,
496
+ /*completeFunc:*/ nativeModule()
497
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_pointer,
498
+ /*freeFunc:*/ nativeModule()
499
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_pointer,
500
+ /*liftFunc:*/ FfiConverterTypeSessionStore.lift.bind(
501
+ FfiConverterTypeSessionStore
502
+ ),
503
+ /*liftString:*/ FfiConverterString.lift,
504
+ /*asyncOpts:*/ asyncOpts_,
505
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
506
+ FfiConverterTypeSdkError
507
+ )
508
+ );
509
+ } catch (__error: any) {
510
+ if (uniffiIsDebug && __error instanceof Error) {
511
+ __error.stack = __stack;
512
+ }
513
+ throw __error;
514
+ }
515
+ }
463
516
  /**
464
517
  * File-based `SQLite` storage rooted at `storage_dir` — the default for
465
518
  * mobile and desktop apps. Each tenant gets its own database file under the
@@ -1887,6 +1940,135 @@ const FfiConverterTypeBolt12OfferDetails = (() => {
1887
1940
  return new FFIConverter();
1888
1941
  })();
1889
1942
 
1943
+ export type BuildUnsignedLnurlPayPackageRequest = {
1944
+ prepareResponse: PrepareLnurlPayResponse;
1945
+ };
1946
+
1947
+ /**
1948
+ * Generated factory for {@link BuildUnsignedLnurlPayPackageRequest} record objects.
1949
+ */
1950
+ export const BuildUnsignedLnurlPayPackageRequest = (() => {
1951
+ const defaults = () => ({});
1952
+ const create = (() => {
1953
+ return uniffiCreateRecord<
1954
+ BuildUnsignedLnurlPayPackageRequest,
1955
+ ReturnType<typeof defaults>
1956
+ >(defaults);
1957
+ })();
1958
+ return Object.freeze({
1959
+ /**
1960
+ * Create a frozen instance of {@link BuildUnsignedLnurlPayPackageRequest}, with defaults specified
1961
+ * in Rust, in the {@link breez_sdk_spark} crate.
1962
+ */
1963
+ create,
1964
+
1965
+ /**
1966
+ * Create a frozen instance of {@link BuildUnsignedLnurlPayPackageRequest}, with defaults specified
1967
+ * in Rust, in the {@link breez_sdk_spark} crate.
1968
+ */
1969
+ new: create,
1970
+
1971
+ /**
1972
+ * Defaults specified in the {@link breez_sdk_spark} crate.
1973
+ */
1974
+ defaults: () =>
1975
+ Object.freeze(defaults()) as Partial<BuildUnsignedLnurlPayPackageRequest>,
1976
+ });
1977
+ })();
1978
+
1979
+ const FfiConverterTypeBuildUnsignedLnurlPayPackageRequest = (() => {
1980
+ type TypeName = BuildUnsignedLnurlPayPackageRequest;
1981
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1982
+ read(from: RustBuffer): TypeName {
1983
+ return {
1984
+ prepareResponse: FfiConverterTypePrepareLnurlPayResponse.read(from),
1985
+ };
1986
+ }
1987
+ write(value: TypeName, into: RustBuffer): void {
1988
+ FfiConverterTypePrepareLnurlPayResponse.write(
1989
+ value.prepareResponse,
1990
+ into
1991
+ );
1992
+ }
1993
+ allocationSize(value: TypeName): number {
1994
+ return FfiConverterTypePrepareLnurlPayResponse.allocationSize(
1995
+ value.prepareResponse
1996
+ );
1997
+ }
1998
+ }
1999
+ return new FFIConverter();
2000
+ })();
2001
+
2002
+ export type BuildUnsignedTransferPackageRequest = {
2003
+ prepareResponse: PrepareSendPaymentResponse;
2004
+ options: BuildTransferPackageOptions | undefined;
2005
+ };
2006
+
2007
+ /**
2008
+ * Generated factory for {@link BuildUnsignedTransferPackageRequest} record objects.
2009
+ */
2010
+ export const BuildUnsignedTransferPackageRequest = (() => {
2011
+ const defaults = () => ({ options: undefined });
2012
+ const create = (() => {
2013
+ return uniffiCreateRecord<
2014
+ BuildUnsignedTransferPackageRequest,
2015
+ ReturnType<typeof defaults>
2016
+ >(defaults);
2017
+ })();
2018
+ return Object.freeze({
2019
+ /**
2020
+ * Create a frozen instance of {@link BuildUnsignedTransferPackageRequest}, with defaults specified
2021
+ * in Rust, in the {@link breez_sdk_spark} crate.
2022
+ */
2023
+ create,
2024
+
2025
+ /**
2026
+ * Create a frozen instance of {@link BuildUnsignedTransferPackageRequest}, with defaults specified
2027
+ * in Rust, in the {@link breez_sdk_spark} crate.
2028
+ */
2029
+ new: create,
2030
+
2031
+ /**
2032
+ * Defaults specified in the {@link breez_sdk_spark} crate.
2033
+ */
2034
+ defaults: () =>
2035
+ Object.freeze(defaults()) as Partial<BuildUnsignedTransferPackageRequest>,
2036
+ });
2037
+ })();
2038
+
2039
+ const FfiConverterTypeBuildUnsignedTransferPackageRequest = (() => {
2040
+ type TypeName = BuildUnsignedTransferPackageRequest;
2041
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
2042
+ read(from: RustBuffer): TypeName {
2043
+ return {
2044
+ prepareResponse: FfiConverterTypePrepareSendPaymentResponse.read(from),
2045
+ options: FfiConverterOptionalTypeBuildTransferPackageOptions.read(from),
2046
+ };
2047
+ }
2048
+ write(value: TypeName, into: RustBuffer): void {
2049
+ FfiConverterTypePrepareSendPaymentResponse.write(
2050
+ value.prepareResponse,
2051
+ into
2052
+ );
2053
+ FfiConverterOptionalTypeBuildTransferPackageOptions.write(
2054
+ value.options,
2055
+ into
2056
+ );
2057
+ }
2058
+ allocationSize(value: TypeName): number {
2059
+ return (
2060
+ FfiConverterTypePrepareSendPaymentResponse.allocationSize(
2061
+ value.prepareResponse
2062
+ ) +
2063
+ FfiConverterOptionalTypeBuildTransferPackageOptions.allocationSize(
2064
+ value.options
2065
+ )
2066
+ );
2067
+ }
2068
+ }
2069
+ return new FFIConverter();
2070
+ })();
2071
+
1890
2072
  export type BurnIssuerTokenRequest = {
1891
2073
  amount: U128;
1892
2074
  };
@@ -2794,10 +2976,11 @@ export type ConnectWithPasskeyRequest = {
2794
2976
  */
2795
2977
  label: string | undefined;
2796
2978
  /**
2797
- * Optional credential IDs to restrict the silent sign-in
2798
- * attempt to (reauthentication path). See
2799
- * [`SignInRequest::allow_credentials`]. Ignored on the fallback
2800
- * registration path.
2979
+ * Optional credential IDs to restrict the sign-in attempt to
2980
+ * (reauthentication path). A non-empty list runs the modal sign-in
2981
+ * rather than the immediate probe (a pin means a credential is already
2982
+ * known). See [`SignInRequest::allow_credentials`]. Ignored on the
2983
+ * fallback registration path.
2801
2984
  */
2802
2985
  allowCredentials: Array<ArrayBuffer> | undefined;
2803
2986
  /**
@@ -2885,10 +3068,17 @@ const FfiConverterTypeConnectWithPasskeyRequest = (() => {
2885
3068
  * registered, when the provider surfaces it. The register path also
2886
3069
  * populates the attestation fields (`aaguid`, `backup_eligible`); the
2887
3070
  * sign-in path sets only `credential_id`.
3071
+ *
3072
+ * `labels` is the user's discovered label set when `request.label` was
3073
+ * `None` (the returning-user multi-wallet case): `wallet` is the default
3074
+ * label, and a host showing more than one entry lets the user pick
3075
+ * another via [`PasskeyClient::sign_in`]. Empty on the register path (a
3076
+ * new user has no other labels) and when a specific label was requested.
2888
3077
  */
2889
3078
  export type ConnectWithPasskeyResponse = {
2890
3079
  wallet: Wallet;
2891
3080
  credential: PasskeyCredential | undefined;
3081
+ labels: Array<string>;
2892
3082
  };
2893
3083
 
2894
3084
  /**
@@ -2930,18 +3120,21 @@ const FfiConverterTypeConnectWithPasskeyResponse = (() => {
2930
3120
  return {
2931
3121
  wallet: FfiConverterTypeWallet.read(from),
2932
3122
  credential: FfiConverterOptionalTypePasskeyCredential.read(from),
3123
+ labels: FfiConverterArrayString.read(from),
2933
3124
  };
2934
3125
  }
2935
3126
  write(value: TypeName, into: RustBuffer): void {
2936
3127
  FfiConverterTypeWallet.write(value.wallet, into);
2937
3128
  FfiConverterOptionalTypePasskeyCredential.write(value.credential, into);
3129
+ FfiConverterArrayString.write(value.labels, into);
2938
3130
  }
2939
3131
  allocationSize(value: TypeName): number {
2940
3132
  return (
2941
3133
  FfiConverterTypeWallet.allocationSize(value.wallet) +
2942
3134
  FfiConverterOptionalTypePasskeyCredential.allocationSize(
2943
3135
  value.credential
2944
- )
3136
+ ) +
3137
+ FfiConverterArrayString.allocationSize(value.labels)
2945
3138
  );
2946
3139
  }
2947
3140
  }
@@ -8580,6 +8773,72 @@ const FfiConverterTypeLnurlInfo = (() => {
8580
8773
  return new FFIConverter();
8581
8774
  })();
8582
8775
 
8776
+ export type LnurlPayContext = {
8777
+ payRequest: LnurlPayRequestDetails;
8778
+ comment: string | undefined;
8779
+ successAction: SuccessAction | undefined;
8780
+ };
8781
+
8782
+ /**
8783
+ * Generated factory for {@link LnurlPayContext} record objects.
8784
+ */
8785
+ export const LnurlPayContext = (() => {
8786
+ const defaults = () => ({});
8787
+ const create = (() => {
8788
+ return uniffiCreateRecord<LnurlPayContext, ReturnType<typeof defaults>>(
8789
+ defaults
8790
+ );
8791
+ })();
8792
+ return Object.freeze({
8793
+ /**
8794
+ * Create a frozen instance of {@link LnurlPayContext}, with defaults specified
8795
+ * in Rust, in the {@link breez_sdk_spark} crate.
8796
+ */
8797
+ create,
8798
+
8799
+ /**
8800
+ * Create a frozen instance of {@link LnurlPayContext}, with defaults specified
8801
+ * in Rust, in the {@link breez_sdk_spark} crate.
8802
+ */
8803
+ new: create,
8804
+
8805
+ /**
8806
+ * Defaults specified in the {@link breez_sdk_spark} crate.
8807
+ */
8808
+ defaults: () => Object.freeze(defaults()) as Partial<LnurlPayContext>,
8809
+ });
8810
+ })();
8811
+
8812
+ const FfiConverterTypeLnurlPayContext = (() => {
8813
+ type TypeName = LnurlPayContext;
8814
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
8815
+ read(from: RustBuffer): TypeName {
8816
+ return {
8817
+ payRequest: FfiConverterTypeLnurlPayRequestDetails.read(from),
8818
+ comment: FfiConverterOptionalString.read(from),
8819
+ successAction: FfiConverterOptionalTypeSuccessAction.read(from),
8820
+ };
8821
+ }
8822
+ write(value: TypeName, into: RustBuffer): void {
8823
+ FfiConverterTypeLnurlPayRequestDetails.write(value.payRequest, into);
8824
+ FfiConverterOptionalString.write(value.comment, into);
8825
+ FfiConverterOptionalTypeSuccessAction.write(value.successAction, into);
8826
+ }
8827
+ allocationSize(value: TypeName): number {
8828
+ return (
8829
+ FfiConverterTypeLnurlPayRequestDetails.allocationSize(
8830
+ value.payRequest
8831
+ ) +
8832
+ FfiConverterOptionalString.allocationSize(value.comment) +
8833
+ FfiConverterOptionalTypeSuccessAction.allocationSize(
8834
+ value.successAction
8835
+ )
8836
+ );
8837
+ }
8838
+ }
8839
+ return new FFIConverter();
8840
+ })();
8841
+
8583
8842
  /**
8584
8843
  * Represents the payment LNURL info
8585
8844
  */
@@ -10932,6 +11191,118 @@ const FfiConverterTypePublicKeyBytes = (() => {
10932
11191
  return new FFIConverter();
10933
11192
  })();
10934
11193
 
11194
+ export type PublishSignedLnurlPayPackageRequest = {
11195
+ signedPackage: SignedTransferPackage;
11196
+ };
11197
+
11198
+ /**
11199
+ * Generated factory for {@link PublishSignedLnurlPayPackageRequest} record objects.
11200
+ */
11201
+ export const PublishSignedLnurlPayPackageRequest = (() => {
11202
+ const defaults = () => ({});
11203
+ const create = (() => {
11204
+ return uniffiCreateRecord<
11205
+ PublishSignedLnurlPayPackageRequest,
11206
+ ReturnType<typeof defaults>
11207
+ >(defaults);
11208
+ })();
11209
+ return Object.freeze({
11210
+ /**
11211
+ * Create a frozen instance of {@link PublishSignedLnurlPayPackageRequest}, with defaults specified
11212
+ * in Rust, in the {@link breez_sdk_spark} crate.
11213
+ */
11214
+ create,
11215
+
11216
+ /**
11217
+ * Create a frozen instance of {@link PublishSignedLnurlPayPackageRequest}, with defaults specified
11218
+ * in Rust, in the {@link breez_sdk_spark} crate.
11219
+ */
11220
+ new: create,
11221
+
11222
+ /**
11223
+ * Defaults specified in the {@link breez_sdk_spark} crate.
11224
+ */
11225
+ defaults: () =>
11226
+ Object.freeze(defaults()) as Partial<PublishSignedLnurlPayPackageRequest>,
11227
+ });
11228
+ })();
11229
+
11230
+ const FfiConverterTypePublishSignedLnurlPayPackageRequest = (() => {
11231
+ type TypeName = PublishSignedLnurlPayPackageRequest;
11232
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
11233
+ read(from: RustBuffer): TypeName {
11234
+ return {
11235
+ signedPackage: FfiConverterTypeSignedTransferPackage.read(from),
11236
+ };
11237
+ }
11238
+ write(value: TypeName, into: RustBuffer): void {
11239
+ FfiConverterTypeSignedTransferPackage.write(value.signedPackage, into);
11240
+ }
11241
+ allocationSize(value: TypeName): number {
11242
+ return FfiConverterTypeSignedTransferPackage.allocationSize(
11243
+ value.signedPackage
11244
+ );
11245
+ }
11246
+ }
11247
+ return new FFIConverter();
11248
+ })();
11249
+
11250
+ export type PublishSignedTransferPackageRequest = {
11251
+ signedPackage: SignedTransferPackage;
11252
+ };
11253
+
11254
+ /**
11255
+ * Generated factory for {@link PublishSignedTransferPackageRequest} record objects.
11256
+ */
11257
+ export const PublishSignedTransferPackageRequest = (() => {
11258
+ const defaults = () => ({});
11259
+ const create = (() => {
11260
+ return uniffiCreateRecord<
11261
+ PublishSignedTransferPackageRequest,
11262
+ ReturnType<typeof defaults>
11263
+ >(defaults);
11264
+ })();
11265
+ return Object.freeze({
11266
+ /**
11267
+ * Create a frozen instance of {@link PublishSignedTransferPackageRequest}, with defaults specified
11268
+ * in Rust, in the {@link breez_sdk_spark} crate.
11269
+ */
11270
+ create,
11271
+
11272
+ /**
11273
+ * Create a frozen instance of {@link PublishSignedTransferPackageRequest}, with defaults specified
11274
+ * in Rust, in the {@link breez_sdk_spark} crate.
11275
+ */
11276
+ new: create,
11277
+
11278
+ /**
11279
+ * Defaults specified in the {@link breez_sdk_spark} crate.
11280
+ */
11281
+ defaults: () =>
11282
+ Object.freeze(defaults()) as Partial<PublishSignedTransferPackageRequest>,
11283
+ });
11284
+ })();
11285
+
11286
+ const FfiConverterTypePublishSignedTransferPackageRequest = (() => {
11287
+ type TypeName = PublishSignedTransferPackageRequest;
11288
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
11289
+ read(from: RustBuffer): TypeName {
11290
+ return {
11291
+ signedPackage: FfiConverterTypeSignedTransferPackage.read(from),
11292
+ };
11293
+ }
11294
+ write(value: TypeName, into: RustBuffer): void {
11295
+ FfiConverterTypeSignedTransferPackage.write(value.signedPackage, into);
11296
+ }
11297
+ allocationSize(value: TypeName): number {
11298
+ return FfiConverterTypeSignedTransferPackage.allocationSize(
11299
+ value.signedPackage
11300
+ );
11301
+ }
11302
+ }
11303
+ return new FFIConverter();
11304
+ })();
11305
+
10935
11306
  /**
10936
11307
  * Denominator in an exchange rate
10937
11308
  */
@@ -12942,6 +13313,65 @@ const FfiConverterTypeSignMessageResponse = (() => {
12942
13313
  return new FFIConverter();
12943
13314
  })();
12944
13315
 
13316
+ export type SignedTransferPackage = {
13317
+ unsigned: UnsignedTransferPackage;
13318
+ signature: TransferSignature;
13319
+ };
13320
+
13321
+ /**
13322
+ * Generated factory for {@link SignedTransferPackage} record objects.
13323
+ */
13324
+ export const SignedTransferPackage = (() => {
13325
+ const defaults = () => ({});
13326
+ const create = (() => {
13327
+ return uniffiCreateRecord<
13328
+ SignedTransferPackage,
13329
+ ReturnType<typeof defaults>
13330
+ >(defaults);
13331
+ })();
13332
+ return Object.freeze({
13333
+ /**
13334
+ * Create a frozen instance of {@link SignedTransferPackage}, with defaults specified
13335
+ * in Rust, in the {@link breez_sdk_spark} crate.
13336
+ */
13337
+ create,
13338
+
13339
+ /**
13340
+ * Create a frozen instance of {@link SignedTransferPackage}, with defaults specified
13341
+ * in Rust, in the {@link breez_sdk_spark} crate.
13342
+ */
13343
+ new: create,
13344
+
13345
+ /**
13346
+ * Defaults specified in the {@link breez_sdk_spark} crate.
13347
+ */
13348
+ defaults: () => Object.freeze(defaults()) as Partial<SignedTransferPackage>,
13349
+ });
13350
+ })();
13351
+
13352
+ const FfiConverterTypeSignedTransferPackage = (() => {
13353
+ type TypeName = SignedTransferPackage;
13354
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
13355
+ read(from: RustBuffer): TypeName {
13356
+ return {
13357
+ unsigned: FfiConverterTypeUnsignedTransferPackage.read(from),
13358
+ signature: FfiConverterTypeTransferSignature.read(from),
13359
+ };
13360
+ }
13361
+ write(value: TypeName, into: RustBuffer): void {
13362
+ FfiConverterTypeUnsignedTransferPackage.write(value.unsigned, into);
13363
+ FfiConverterTypeTransferSignature.write(value.signature, into);
13364
+ }
13365
+ allocationSize(value: TypeName): number {
13366
+ return (
13367
+ FfiConverterTypeUnsignedTransferPackage.allocationSize(value.unsigned) +
13368
+ FfiConverterTypeTransferSignature.allocationSize(value.signature)
13369
+ );
13370
+ }
13371
+ }
13372
+ return new FFIConverter();
13373
+ })();
13374
+
12945
13375
  /**
12946
13376
  * A signing-only external signer paired with the Spark signer, for wallets that
12947
13377
  * connect via [`connect_with_signing_only_signer`]. The Breez half performs
@@ -13183,6 +13613,12 @@ export type SparkConfig = {
13183
13613
  * Expected relative block locktime for token withdrawals.
13184
13614
  */
13185
13615
  expectedWithdrawRelativeBlockLocktime: /*u64*/ bigint;
13616
+ /**
13617
+ * Cap on the inputs a single token transaction may spend. A send needing
13618
+ * more first consolidates the wallet's token outputs. Unset uses the SDK
13619
+ * default (500).
13620
+ */
13621
+ maxTokenTransactionInputs: /*u32*/ number | undefined;
13186
13622
  };
13187
13623
 
13188
13624
  /**
@@ -13226,6 +13662,7 @@ const FfiConverterTypeSparkConfig = (() => {
13226
13662
  sspConfig: FfiConverterTypeSparkSspConfig.read(from),
13227
13663
  expectedWithdrawBondSats: FfiConverterUInt64.read(from),
13228
13664
  expectedWithdrawRelativeBlockLocktime: FfiConverterUInt64.read(from),
13665
+ maxTokenTransactionInputs: FfiConverterOptionalUInt32.read(from),
13229
13666
  };
13230
13667
  }
13231
13668
  write(value: TypeName, into: RustBuffer): void {
@@ -13241,6 +13678,7 @@ const FfiConverterTypeSparkConfig = (() => {
13241
13678
  value.expectedWithdrawRelativeBlockLocktime,
13242
13679
  into
13243
13680
  );
13681
+ FfiConverterOptionalUInt32.write(value.maxTokenTransactionInputs, into);
13244
13682
  }
13245
13683
  allocationSize(value: TypeName): number {
13246
13684
  return (
@@ -13253,6 +13691,9 @@ const FfiConverterTypeSparkConfig = (() => {
13253
13691
  FfiConverterUInt64.allocationSize(value.expectedWithdrawBondSats) +
13254
13692
  FfiConverterUInt64.allocationSize(
13255
13693
  value.expectedWithdrawRelativeBlockLocktime
13694
+ ) +
13695
+ FfiConverterOptionalUInt32.allocationSize(
13696
+ value.maxTokenTransactionInputs
13256
13697
  )
13257
13698
  );
13258
13699
  }
@@ -14723,17 +15164,41 @@ export type TurnkeyConfig = {
14723
15164
  * either backend.
14724
15165
  */
14725
15166
  accountNumber: /*u32*/ number | undefined;
15167
+ /**
15168
+ * The wallet's identity public key (compressed, hex), to skip fetching it
15169
+ * from Turnkey on init. Obtain it once from a freshly-built signer via
15170
+ * [`ExternalSparkSigner::get_identity_public_key`] — the simplest source,
15171
+ * available right after `create_turnkey_signer` with no separate connect —
15172
+ * or, if you only have a connected SDK, from `identity_pubkey` on the
15173
+ * get-info response. Pass it back on later inits: the signer then serves the
15174
+ * identity key and its Spark address from this value instead of the per-init
15175
+ * Turnkey round-trips, making signer setup network-free. Unset fetches
15176
+ * lazily, as before. It is a stable, non-secret, per-wallet value; a value
15177
+ * that does not match the wallet yields a signer that signs with the wrong
15178
+ * identity, so only pass one read from this same wallet.
15179
+ *
15180
+ * [`ExternalSparkSigner::get_identity_public_key`]: crate::signer::ExternalSparkSigner::get_identity_public_key
15181
+ */
15182
+ identityPublicKey: string | undefined;
14726
15183
  /**
14727
15184
  * Retry policy for Turnkey requests. Unset uses the default policy.
14728
15185
  */
14729
15186
  retry: TurnkeyRetryConfig | undefined;
15187
+ /**
15188
+ * Maximum requests per second the client issues to this suborganization,
15189
+ * across all concurrent operations. The client paces itself to this rate.
15190
+ * Unset uses Turnkey's documented per-suborganization cap of 10 RPS; set it
15191
+ * to the account's actual limit if a different one is provisioned. Must be
15192
+ * greater than 0 when set: 0 is rejected at connect.
15193
+ */
15194
+ maxRps: /*u32*/ number | undefined;
14730
15195
  };
14731
15196
 
14732
15197
  /**
14733
15198
  * Generated factory for {@link TurnkeyConfig} record objects.
14734
15199
  */
14735
15200
  export const TurnkeyConfig = (() => {
14736
- const defaults = () => ({});
15201
+ const defaults = () => ({ maxRps: undefined });
14737
15202
  const create = (() => {
14738
15203
  return uniffiCreateRecord<TurnkeyConfig, ReturnType<typeof defaults>>(
14739
15204
  defaults
@@ -14771,7 +15236,9 @@ const FfiConverterTypeTurnkeyConfig = (() => {
14771
15236
  walletId: FfiConverterString.read(from),
14772
15237
  network: FfiConverterTypeNetwork.read(from),
14773
15238
  accountNumber: FfiConverterOptionalUInt32.read(from),
15239
+ identityPublicKey: FfiConverterOptionalString.read(from),
14774
15240
  retry: FfiConverterOptionalTypeTurnkeyRetryConfig.read(from),
15241
+ maxRps: FfiConverterOptionalUInt32.read(from),
14775
15242
  };
14776
15243
  }
14777
15244
  write(value: TypeName, into: RustBuffer): void {
@@ -14782,7 +15249,9 @@ const FfiConverterTypeTurnkeyConfig = (() => {
14782
15249
  FfiConverterString.write(value.walletId, into);
14783
15250
  FfiConverterTypeNetwork.write(value.network, into);
14784
15251
  FfiConverterOptionalUInt32.write(value.accountNumber, into);
15252
+ FfiConverterOptionalString.write(value.identityPublicKey, into);
14785
15253
  FfiConverterOptionalTypeTurnkeyRetryConfig.write(value.retry, into);
15254
+ FfiConverterOptionalUInt32.write(value.maxRps, into);
14786
15255
  }
14787
15256
  allocationSize(value: TypeName): number {
14788
15257
  return (
@@ -14793,7 +15262,9 @@ const FfiConverterTypeTurnkeyConfig = (() => {
14793
15262
  FfiConverterString.allocationSize(value.walletId) +
14794
15263
  FfiConverterTypeNetwork.allocationSize(value.network) +
14795
15264
  FfiConverterOptionalUInt32.allocationSize(value.accountNumber) +
14796
- FfiConverterOptionalTypeTurnkeyRetryConfig.allocationSize(value.retry)
15265
+ FfiConverterOptionalString.allocationSize(value.identityPublicKey) +
15266
+ FfiConverterOptionalTypeTurnkeyRetryConfig.allocationSize(value.retry) +
15267
+ FfiConverterOptionalUInt32.allocationSize(value.maxRps)
14797
15268
  );
14798
15269
  }
14799
15270
  }
@@ -16666,6 +17137,180 @@ const FfiConverterTypeBitcoinNetwork = (() => {
16666
17137
  return new FFIConverter();
16667
17138
  })();
16668
17139
 
17140
+ // Enum: BuildTransferPackageOptions
17141
+ export enum BuildTransferPackageOptions_Tags {
17142
+ BitcoinAddress = 'BitcoinAddress',
17143
+ Bolt11Invoice = 'Bolt11Invoice',
17144
+ }
17145
+ export const BuildTransferPackageOptions = (() => {
17146
+ type BitcoinAddress__interface = {
17147
+ tag: BuildTransferPackageOptions_Tags.BitcoinAddress;
17148
+ inner: Readonly<{ confirmationSpeed: OnchainConfirmationSpeed }>;
17149
+ };
17150
+
17151
+ class BitcoinAddress_
17152
+ extends UniffiEnum
17153
+ implements BitcoinAddress__interface
17154
+ {
17155
+ /**
17156
+ * @private
17157
+ * This field is private and should not be used, use `tag` instead.
17158
+ */
17159
+ readonly [uniffiTypeNameSymbol] = 'BuildTransferPackageOptions';
17160
+ readonly tag = BuildTransferPackageOptions_Tags.BitcoinAddress;
17161
+ readonly inner: Readonly<{ confirmationSpeed: OnchainConfirmationSpeed }>;
17162
+ constructor(inner: { confirmationSpeed: OnchainConfirmationSpeed }) {
17163
+ super('BuildTransferPackageOptions', 'BitcoinAddress');
17164
+ this.inner = Object.freeze(inner);
17165
+ }
17166
+
17167
+ static new(inner: {
17168
+ confirmationSpeed: OnchainConfirmationSpeed;
17169
+ }): BitcoinAddress_ {
17170
+ return new BitcoinAddress_(inner);
17171
+ }
17172
+
17173
+ static instanceOf(obj: any): obj is BitcoinAddress_ {
17174
+ return obj.tag === BuildTransferPackageOptions_Tags.BitcoinAddress;
17175
+ }
17176
+ }
17177
+
17178
+ type Bolt11Invoice__interface = {
17179
+ tag: BuildTransferPackageOptions_Tags.Bolt11Invoice;
17180
+ inner: Readonly<{
17181
+ preferSpark: boolean;
17182
+ completionTimeoutSecs: /*u32*/ number | undefined;
17183
+ }>;
17184
+ };
17185
+
17186
+ class Bolt11Invoice_ extends UniffiEnum implements Bolt11Invoice__interface {
17187
+ /**
17188
+ * @private
17189
+ * This field is private and should not be used, use `tag` instead.
17190
+ */
17191
+ readonly [uniffiTypeNameSymbol] = 'BuildTransferPackageOptions';
17192
+ readonly tag = BuildTransferPackageOptions_Tags.Bolt11Invoice;
17193
+ readonly inner: Readonly<{
17194
+ preferSpark: boolean;
17195
+ completionTimeoutSecs: /*u32*/ number | undefined;
17196
+ }>;
17197
+ constructor(inner: {
17198
+ preferSpark: boolean;
17199
+ /**
17200
+ * If set, publishing the package waits up to this many seconds for the
17201
+ * payment to complete before returning it while still pending. If unset,
17202
+ * publishing returns immediately after initiating the payment.
17203
+ */ completionTimeoutSecs: /*u32*/ number | undefined;
17204
+ }) {
17205
+ super('BuildTransferPackageOptions', 'Bolt11Invoice');
17206
+ this.inner = Object.freeze(inner);
17207
+ }
17208
+
17209
+ static new(inner: {
17210
+ preferSpark: boolean;
17211
+ /**
17212
+ * If set, publishing the package waits up to this many seconds for the
17213
+ * payment to complete before returning it while still pending. If unset,
17214
+ * publishing returns immediately after initiating the payment.
17215
+ */ completionTimeoutSecs: /*u32*/ number | undefined;
17216
+ }): Bolt11Invoice_ {
17217
+ return new Bolt11Invoice_(inner);
17218
+ }
17219
+
17220
+ static instanceOf(obj: any): obj is Bolt11Invoice_ {
17221
+ return obj.tag === BuildTransferPackageOptions_Tags.Bolt11Invoice;
17222
+ }
17223
+ }
17224
+
17225
+ function instanceOf(obj: any): obj is BuildTransferPackageOptions {
17226
+ return obj[uniffiTypeNameSymbol] === 'BuildTransferPackageOptions';
17227
+ }
17228
+
17229
+ return Object.freeze({
17230
+ instanceOf,
17231
+ BitcoinAddress: BitcoinAddress_,
17232
+ Bolt11Invoice: Bolt11Invoice_,
17233
+ });
17234
+ })();
17235
+
17236
+ export type BuildTransferPackageOptions = InstanceType<
17237
+ (typeof BuildTransferPackageOptions)[keyof Omit<
17238
+ typeof BuildTransferPackageOptions,
17239
+ 'instanceOf'
17240
+ >]
17241
+ >;
17242
+
17243
+ // FfiConverter for enum BuildTransferPackageOptions
17244
+ const FfiConverterTypeBuildTransferPackageOptions = (() => {
17245
+ const ordinalConverter = FfiConverterInt32;
17246
+ type TypeName = BuildTransferPackageOptions;
17247
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
17248
+ read(from: RustBuffer): TypeName {
17249
+ switch (ordinalConverter.read(from)) {
17250
+ case 1:
17251
+ return new BuildTransferPackageOptions.BitcoinAddress({
17252
+ confirmationSpeed:
17253
+ FfiConverterTypeOnchainConfirmationSpeed.read(from),
17254
+ });
17255
+ case 2:
17256
+ return new BuildTransferPackageOptions.Bolt11Invoice({
17257
+ preferSpark: FfiConverterBool.read(from),
17258
+ completionTimeoutSecs: FfiConverterOptionalUInt32.read(from),
17259
+ });
17260
+ default:
17261
+ throw new UniffiInternalError.UnexpectedEnumCase();
17262
+ }
17263
+ }
17264
+ write(value: TypeName, into: RustBuffer): void {
17265
+ switch (value.tag) {
17266
+ case BuildTransferPackageOptions_Tags.BitcoinAddress: {
17267
+ ordinalConverter.write(1, into);
17268
+ const inner = value.inner;
17269
+ FfiConverterTypeOnchainConfirmationSpeed.write(
17270
+ inner.confirmationSpeed,
17271
+ into
17272
+ );
17273
+ return;
17274
+ }
17275
+ case BuildTransferPackageOptions_Tags.Bolt11Invoice: {
17276
+ ordinalConverter.write(2, into);
17277
+ const inner = value.inner;
17278
+ FfiConverterBool.write(inner.preferSpark, into);
17279
+ FfiConverterOptionalUInt32.write(inner.completionTimeoutSecs, into);
17280
+ return;
17281
+ }
17282
+ default:
17283
+ // Throwing from here means that BuildTransferPackageOptions_Tags hasn't matched an ordinal.
17284
+ throw new UniffiInternalError.UnexpectedEnumCase();
17285
+ }
17286
+ }
17287
+ allocationSize(value: TypeName): number {
17288
+ switch (value.tag) {
17289
+ case BuildTransferPackageOptions_Tags.BitcoinAddress: {
17290
+ const inner = value.inner;
17291
+ let size = ordinalConverter.allocationSize(1);
17292
+ size += FfiConverterTypeOnchainConfirmationSpeed.allocationSize(
17293
+ inner.confirmationSpeed
17294
+ );
17295
+ return size;
17296
+ }
17297
+ case BuildTransferPackageOptions_Tags.Bolt11Invoice: {
17298
+ const inner = value.inner;
17299
+ let size = ordinalConverter.allocationSize(2);
17300
+ size += FfiConverterBool.allocationSize(inner.preferSpark);
17301
+ size += FfiConverterOptionalUInt32.allocationSize(
17302
+ inner.completionTimeoutSecs
17303
+ );
17304
+ return size;
17305
+ }
17306
+ default:
17307
+ throw new UniffiInternalError.UnexpectedEnumCase();
17308
+ }
17309
+ }
17310
+ }
17311
+ return new FFIConverter();
17312
+ })();
17313
+
16669
17314
  // Enum: BuyBitcoinRequest
16670
17315
  export enum BuyBitcoinRequest_Tags {
16671
17316
  Moonpay = 'Moonpay',
@@ -24281,6 +24926,266 @@ const FfiConverterTypeProvisionalPaymentDetails = (() => {
24281
24926
  return new FFIConverter();
24282
24927
  })();
24283
24928
 
24929
+ // Enum: PublishSignedLnurlPayResponse
24930
+ export enum PublishSignedLnurlPayResponse_Tags {
24931
+ SwapCompleted = 'SwapCompleted',
24932
+ PaymentSent = 'PaymentSent',
24933
+ }
24934
+ export const PublishSignedLnurlPayResponse = (() => {
24935
+ type SwapCompleted__interface = {
24936
+ tag: PublishSignedLnurlPayResponse_Tags.SwapCompleted;
24937
+ };
24938
+
24939
+ class SwapCompleted_ extends UniffiEnum implements SwapCompleted__interface {
24940
+ /**
24941
+ * @private
24942
+ * This field is private and should not be used, use `tag` instead.
24943
+ */
24944
+ readonly [uniffiTypeNameSymbol] = 'PublishSignedLnurlPayResponse';
24945
+ readonly tag = PublishSignedLnurlPayResponse_Tags.SwapCompleted;
24946
+ constructor() {
24947
+ super('PublishSignedLnurlPayResponse', 'SwapCompleted');
24948
+ }
24949
+
24950
+ static new(): SwapCompleted_ {
24951
+ return new SwapCompleted_();
24952
+ }
24953
+
24954
+ static instanceOf(obj: any): obj is SwapCompleted_ {
24955
+ return obj.tag === PublishSignedLnurlPayResponse_Tags.SwapCompleted;
24956
+ }
24957
+ }
24958
+
24959
+ type PaymentSent__interface = {
24960
+ tag: PublishSignedLnurlPayResponse_Tags.PaymentSent;
24961
+ inner: Readonly<{ response: LnurlPayResponse }>;
24962
+ };
24963
+
24964
+ class PaymentSent_ extends UniffiEnum implements PaymentSent__interface {
24965
+ /**
24966
+ * @private
24967
+ * This field is private and should not be used, use `tag` instead.
24968
+ */
24969
+ readonly [uniffiTypeNameSymbol] = 'PublishSignedLnurlPayResponse';
24970
+ readonly tag = PublishSignedLnurlPayResponse_Tags.PaymentSent;
24971
+ readonly inner: Readonly<{ response: LnurlPayResponse }>;
24972
+ constructor(inner: { response: LnurlPayResponse }) {
24973
+ super('PublishSignedLnurlPayResponse', 'PaymentSent');
24974
+ this.inner = Object.freeze(inner);
24975
+ }
24976
+
24977
+ static new(inner: { response: LnurlPayResponse }): PaymentSent_ {
24978
+ return new PaymentSent_(inner);
24979
+ }
24980
+
24981
+ static instanceOf(obj: any): obj is PaymentSent_ {
24982
+ return obj.tag === PublishSignedLnurlPayResponse_Tags.PaymentSent;
24983
+ }
24984
+ }
24985
+
24986
+ function instanceOf(obj: any): obj is PublishSignedLnurlPayResponse {
24987
+ return obj[uniffiTypeNameSymbol] === 'PublishSignedLnurlPayResponse';
24988
+ }
24989
+
24990
+ return Object.freeze({
24991
+ instanceOf,
24992
+ SwapCompleted: SwapCompleted_,
24993
+ PaymentSent: PaymentSent_,
24994
+ });
24995
+ })();
24996
+
24997
+ export type PublishSignedLnurlPayResponse = InstanceType<
24998
+ (typeof PublishSignedLnurlPayResponse)[keyof Omit<
24999
+ typeof PublishSignedLnurlPayResponse,
25000
+ 'instanceOf'
25001
+ >]
25002
+ >;
25003
+
25004
+ // FfiConverter for enum PublishSignedLnurlPayResponse
25005
+ const FfiConverterTypePublishSignedLnurlPayResponse = (() => {
25006
+ const ordinalConverter = FfiConverterInt32;
25007
+ type TypeName = PublishSignedLnurlPayResponse;
25008
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
25009
+ read(from: RustBuffer): TypeName {
25010
+ switch (ordinalConverter.read(from)) {
25011
+ case 1:
25012
+ return new PublishSignedLnurlPayResponse.SwapCompleted();
25013
+ case 2:
25014
+ return new PublishSignedLnurlPayResponse.PaymentSent({
25015
+ response: FfiConverterTypeLnurlPayResponse.read(from),
25016
+ });
25017
+ default:
25018
+ throw new UniffiInternalError.UnexpectedEnumCase();
25019
+ }
25020
+ }
25021
+ write(value: TypeName, into: RustBuffer): void {
25022
+ switch (value.tag) {
25023
+ case PublishSignedLnurlPayResponse_Tags.SwapCompleted: {
25024
+ ordinalConverter.write(1, into);
25025
+ return;
25026
+ }
25027
+ case PublishSignedLnurlPayResponse_Tags.PaymentSent: {
25028
+ ordinalConverter.write(2, into);
25029
+ const inner = value.inner;
25030
+ FfiConverterTypeLnurlPayResponse.write(inner.response, into);
25031
+ return;
25032
+ }
25033
+ default:
25034
+ // Throwing from here means that PublishSignedLnurlPayResponse_Tags hasn't matched an ordinal.
25035
+ throw new UniffiInternalError.UnexpectedEnumCase();
25036
+ }
25037
+ }
25038
+ allocationSize(value: TypeName): number {
25039
+ switch (value.tag) {
25040
+ case PublishSignedLnurlPayResponse_Tags.SwapCompleted: {
25041
+ return ordinalConverter.allocationSize(1);
25042
+ }
25043
+ case PublishSignedLnurlPayResponse_Tags.PaymentSent: {
25044
+ const inner = value.inner;
25045
+ let size = ordinalConverter.allocationSize(2);
25046
+ size += FfiConverterTypeLnurlPayResponse.allocationSize(
25047
+ inner.response
25048
+ );
25049
+ return size;
25050
+ }
25051
+ default:
25052
+ throw new UniffiInternalError.UnexpectedEnumCase();
25053
+ }
25054
+ }
25055
+ }
25056
+ return new FFIConverter();
25057
+ })();
25058
+
25059
+ // Enum: PublishSignedTransferPackageResponse
25060
+ export enum PublishSignedTransferPackageResponse_Tags {
25061
+ SwapCompleted = 'SwapCompleted',
25062
+ PaymentSent = 'PaymentSent',
25063
+ }
25064
+ export const PublishSignedTransferPackageResponse = (() => {
25065
+ type SwapCompleted__interface = {
25066
+ tag: PublishSignedTransferPackageResponse_Tags.SwapCompleted;
25067
+ };
25068
+
25069
+ class SwapCompleted_ extends UniffiEnum implements SwapCompleted__interface {
25070
+ /**
25071
+ * @private
25072
+ * This field is private and should not be used, use `tag` instead.
25073
+ */
25074
+ readonly [uniffiTypeNameSymbol] = 'PublishSignedTransferPackageResponse';
25075
+ readonly tag = PublishSignedTransferPackageResponse_Tags.SwapCompleted;
25076
+ constructor() {
25077
+ super('PublishSignedTransferPackageResponse', 'SwapCompleted');
25078
+ }
25079
+
25080
+ static new(): SwapCompleted_ {
25081
+ return new SwapCompleted_();
25082
+ }
25083
+
25084
+ static instanceOf(obj: any): obj is SwapCompleted_ {
25085
+ return (
25086
+ obj.tag === PublishSignedTransferPackageResponse_Tags.SwapCompleted
25087
+ );
25088
+ }
25089
+ }
25090
+
25091
+ type PaymentSent__interface = {
25092
+ tag: PublishSignedTransferPackageResponse_Tags.PaymentSent;
25093
+ inner: Readonly<{ payment: Payment }>;
25094
+ };
25095
+
25096
+ class PaymentSent_ extends UniffiEnum implements PaymentSent__interface {
25097
+ /**
25098
+ * @private
25099
+ * This field is private and should not be used, use `tag` instead.
25100
+ */
25101
+ readonly [uniffiTypeNameSymbol] = 'PublishSignedTransferPackageResponse';
25102
+ readonly tag = PublishSignedTransferPackageResponse_Tags.PaymentSent;
25103
+ readonly inner: Readonly<{ payment: Payment }>;
25104
+ constructor(inner: { payment: Payment }) {
25105
+ super('PublishSignedTransferPackageResponse', 'PaymentSent');
25106
+ this.inner = Object.freeze(inner);
25107
+ }
25108
+
25109
+ static new(inner: { payment: Payment }): PaymentSent_ {
25110
+ return new PaymentSent_(inner);
25111
+ }
25112
+
25113
+ static instanceOf(obj: any): obj is PaymentSent_ {
25114
+ return obj.tag === PublishSignedTransferPackageResponse_Tags.PaymentSent;
25115
+ }
25116
+ }
25117
+
25118
+ function instanceOf(obj: any): obj is PublishSignedTransferPackageResponse {
25119
+ return obj[uniffiTypeNameSymbol] === 'PublishSignedTransferPackageResponse';
25120
+ }
25121
+
25122
+ return Object.freeze({
25123
+ instanceOf,
25124
+ SwapCompleted: SwapCompleted_,
25125
+ PaymentSent: PaymentSent_,
25126
+ });
25127
+ })();
25128
+
25129
+ export type PublishSignedTransferPackageResponse = InstanceType<
25130
+ (typeof PublishSignedTransferPackageResponse)[keyof Omit<
25131
+ typeof PublishSignedTransferPackageResponse,
25132
+ 'instanceOf'
25133
+ >]
25134
+ >;
25135
+
25136
+ // FfiConverter for enum PublishSignedTransferPackageResponse
25137
+ const FfiConverterTypePublishSignedTransferPackageResponse = (() => {
25138
+ const ordinalConverter = FfiConverterInt32;
25139
+ type TypeName = PublishSignedTransferPackageResponse;
25140
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
25141
+ read(from: RustBuffer): TypeName {
25142
+ switch (ordinalConverter.read(from)) {
25143
+ case 1:
25144
+ return new PublishSignedTransferPackageResponse.SwapCompleted();
25145
+ case 2:
25146
+ return new PublishSignedTransferPackageResponse.PaymentSent({
25147
+ payment: FfiConverterTypePayment.read(from),
25148
+ });
25149
+ default:
25150
+ throw new UniffiInternalError.UnexpectedEnumCase();
25151
+ }
25152
+ }
25153
+ write(value: TypeName, into: RustBuffer): void {
25154
+ switch (value.tag) {
25155
+ case PublishSignedTransferPackageResponse_Tags.SwapCompleted: {
25156
+ ordinalConverter.write(1, into);
25157
+ return;
25158
+ }
25159
+ case PublishSignedTransferPackageResponse_Tags.PaymentSent: {
25160
+ ordinalConverter.write(2, into);
25161
+ const inner = value.inner;
25162
+ FfiConverterTypePayment.write(inner.payment, into);
25163
+ return;
25164
+ }
25165
+ default:
25166
+ // Throwing from here means that PublishSignedTransferPackageResponse_Tags hasn't matched an ordinal.
25167
+ throw new UniffiInternalError.UnexpectedEnumCase();
25168
+ }
25169
+ }
25170
+ allocationSize(value: TypeName): number {
25171
+ switch (value.tag) {
25172
+ case PublishSignedTransferPackageResponse_Tags.SwapCompleted: {
25173
+ return ordinalConverter.allocationSize(1);
25174
+ }
25175
+ case PublishSignedTransferPackageResponse_Tags.PaymentSent: {
25176
+ const inner = value.inner;
25177
+ let size = ordinalConverter.allocationSize(2);
25178
+ size += FfiConverterTypePayment.allocationSize(inner.payment);
25179
+ return size;
25180
+ }
25181
+ default:
25182
+ throw new UniffiInternalError.UnexpectedEnumCase();
25183
+ }
25184
+ }
25185
+ }
25186
+ return new FFIConverter();
25187
+ })();
25188
+
24284
25189
  // Enum: ReceivePaymentMethod
24285
25190
  export enum ReceivePaymentMethod_Tags {
24286
25191
  SparkAddress = 'SparkAddress',
@@ -29547,6 +30452,712 @@ const FfiConverterTypeTokenTransactionType = (() => {
29547
30452
  return new FFIConverter();
29548
30453
  })();
29549
30454
 
30455
+ // Enum: TransferSignature
30456
+ export enum TransferSignature_Tags {
30457
+ Transfer = 'Transfer',
30458
+ Token = 'Token',
30459
+ }
30460
+ export const TransferSignature = (() => {
30461
+ type Transfer__interface = {
30462
+ tag: TransferSignature_Tags.Transfer;
30463
+ inner: Readonly<{ signed: ExternalPreparedTransfer }>;
30464
+ };
30465
+
30466
+ class Transfer_ extends UniffiEnum implements Transfer__interface {
30467
+ /**
30468
+ * @private
30469
+ * This field is private and should not be used, use `tag` instead.
30470
+ */
30471
+ readonly [uniffiTypeNameSymbol] = 'TransferSignature';
30472
+ readonly tag = TransferSignature_Tags.Transfer;
30473
+ readonly inner: Readonly<{ signed: ExternalPreparedTransfer }>;
30474
+ constructor(inner: { signed: ExternalPreparedTransfer }) {
30475
+ super('TransferSignature', 'Transfer');
30476
+ this.inner = Object.freeze(inner);
30477
+ }
30478
+
30479
+ static new(inner: { signed: ExternalPreparedTransfer }): Transfer_ {
30480
+ return new Transfer_(inner);
30481
+ }
30482
+
30483
+ static instanceOf(obj: any): obj is Transfer_ {
30484
+ return obj.tag === TransferSignature_Tags.Transfer;
30485
+ }
30486
+ }
30487
+
30488
+ type Token__interface = {
30489
+ tag: TransferSignature_Tags.Token;
30490
+ inner: Readonly<{ signed: ExternalPreparedTokenTransaction }>;
30491
+ };
30492
+
30493
+ class Token_ extends UniffiEnum implements Token__interface {
30494
+ /**
30495
+ * @private
30496
+ * This field is private and should not be used, use `tag` instead.
30497
+ */
30498
+ readonly [uniffiTypeNameSymbol] = 'TransferSignature';
30499
+ readonly tag = TransferSignature_Tags.Token;
30500
+ readonly inner: Readonly<{ signed: ExternalPreparedTokenTransaction }>;
30501
+ constructor(inner: { signed: ExternalPreparedTokenTransaction }) {
30502
+ super('TransferSignature', 'Token');
30503
+ this.inner = Object.freeze(inner);
30504
+ }
30505
+
30506
+ static new(inner: { signed: ExternalPreparedTokenTransaction }): Token_ {
30507
+ return new Token_(inner);
30508
+ }
30509
+
30510
+ static instanceOf(obj: any): obj is Token_ {
30511
+ return obj.tag === TransferSignature_Tags.Token;
30512
+ }
30513
+ }
30514
+
30515
+ function instanceOf(obj: any): obj is TransferSignature {
30516
+ return obj[uniffiTypeNameSymbol] === 'TransferSignature';
30517
+ }
30518
+
30519
+ return Object.freeze({
30520
+ instanceOf,
30521
+ Transfer: Transfer_,
30522
+ Token: Token_,
30523
+ });
30524
+ })();
30525
+
30526
+ export type TransferSignature = InstanceType<
30527
+ (typeof TransferSignature)[keyof Omit<typeof TransferSignature, 'instanceOf'>]
30528
+ >;
30529
+
30530
+ // FfiConverter for enum TransferSignature
30531
+ const FfiConverterTypeTransferSignature = (() => {
30532
+ const ordinalConverter = FfiConverterInt32;
30533
+ type TypeName = TransferSignature;
30534
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
30535
+ read(from: RustBuffer): TypeName {
30536
+ switch (ordinalConverter.read(from)) {
30537
+ case 1:
30538
+ return new TransferSignature.Transfer({
30539
+ signed: FfiConverterTypeExternalPreparedTransfer.read(from),
30540
+ });
30541
+ case 2:
30542
+ return new TransferSignature.Token({
30543
+ signed: FfiConverterTypeExternalPreparedTokenTransaction.read(from),
30544
+ });
30545
+ default:
30546
+ throw new UniffiInternalError.UnexpectedEnumCase();
30547
+ }
30548
+ }
30549
+ write(value: TypeName, into: RustBuffer): void {
30550
+ switch (value.tag) {
30551
+ case TransferSignature_Tags.Transfer: {
30552
+ ordinalConverter.write(1, into);
30553
+ const inner = value.inner;
30554
+ FfiConverterTypeExternalPreparedTransfer.write(inner.signed, into);
30555
+ return;
30556
+ }
30557
+ case TransferSignature_Tags.Token: {
30558
+ ordinalConverter.write(2, into);
30559
+ const inner = value.inner;
30560
+ FfiConverterTypeExternalPreparedTokenTransaction.write(
30561
+ inner.signed,
30562
+ into
30563
+ );
30564
+ return;
30565
+ }
30566
+ default:
30567
+ // Throwing from here means that TransferSignature_Tags hasn't matched an ordinal.
30568
+ throw new UniffiInternalError.UnexpectedEnumCase();
30569
+ }
30570
+ }
30571
+ allocationSize(value: TypeName): number {
30572
+ switch (value.tag) {
30573
+ case TransferSignature_Tags.Transfer: {
30574
+ const inner = value.inner;
30575
+ let size = ordinalConverter.allocationSize(1);
30576
+ size += FfiConverterTypeExternalPreparedTransfer.allocationSize(
30577
+ inner.signed
30578
+ );
30579
+ return size;
30580
+ }
30581
+ case TransferSignature_Tags.Token: {
30582
+ const inner = value.inner;
30583
+ let size = ordinalConverter.allocationSize(2);
30584
+ size +=
30585
+ FfiConverterTypeExternalPreparedTokenTransaction.allocationSize(
30586
+ inner.signed
30587
+ );
30588
+ return size;
30589
+ }
30590
+ default:
30591
+ throw new UniffiInternalError.UnexpectedEnumCase();
30592
+ }
30593
+ }
30594
+ }
30595
+ return new FFIConverter();
30596
+ })();
30597
+
30598
+ // Enum: TransferTarget
30599
+ export enum TransferTarget_Tags {
30600
+ Spark = 'Spark',
30601
+ Lightning = 'Lightning',
30602
+ CoopExit = 'CoopExit',
30603
+ }
30604
+ export const TransferTarget = (() => {
30605
+ type Spark__interface = {
30606
+ tag: TransferTarget_Tags.Spark;
30607
+ inner: Readonly<{ address: string; sparkInvoice: string | undefined }>;
30608
+ };
30609
+
30610
+ class Spark_ extends UniffiEnum implements Spark__interface {
30611
+ /**
30612
+ * @private
30613
+ * This field is private and should not be used, use `tag` instead.
30614
+ */
30615
+ readonly [uniffiTypeNameSymbol] = 'TransferTarget';
30616
+ readonly tag = TransferTarget_Tags.Spark;
30617
+ readonly inner: Readonly<{
30618
+ address: string;
30619
+ sparkInvoice: string | undefined;
30620
+ }>;
30621
+ constructor(inner: { address: string; sparkInvoice: string | undefined }) {
30622
+ super('TransferTarget', 'Spark');
30623
+ this.inner = Object.freeze(inner);
30624
+ }
30625
+
30626
+ static new(inner: {
30627
+ address: string;
30628
+ sparkInvoice: string | undefined;
30629
+ }): Spark_ {
30630
+ return new Spark_(inner);
30631
+ }
30632
+
30633
+ static instanceOf(obj: any): obj is Spark_ {
30634
+ return obj.tag === TransferTarget_Tags.Spark;
30635
+ }
30636
+ }
30637
+
30638
+ type Lightning__interface = {
30639
+ tag: TransferTarget_Tags.Lightning;
30640
+ inner: Readonly<{
30641
+ bolt11: string;
30642
+ lnurlPay: LnurlPayContext | undefined;
30643
+ feePolicy: FeePolicy;
30644
+ completionTimeoutSecs: /*u32*/ number | undefined;
30645
+ }>;
30646
+ };
30647
+
30648
+ class Lightning_ extends UniffiEnum implements Lightning__interface {
30649
+ /**
30650
+ * @private
30651
+ * This field is private and should not be used, use `tag` instead.
30652
+ */
30653
+ readonly [uniffiTypeNameSymbol] = 'TransferTarget';
30654
+ readonly tag = TransferTarget_Tags.Lightning;
30655
+ readonly inner: Readonly<{
30656
+ bolt11: string;
30657
+ lnurlPay: LnurlPayContext | undefined;
30658
+ feePolicy: FeePolicy;
30659
+ completionTimeoutSecs: /*u32*/ number | undefined;
30660
+ }>;
30661
+ constructor(inner: {
30662
+ bolt11: string;
30663
+ lnurlPay: LnurlPayContext | undefined;
30664
+ feePolicy: FeePolicy;
30665
+ completionTimeoutSecs: /*u32*/ number | undefined;
30666
+ }) {
30667
+ super('TransferTarget', 'Lightning');
30668
+ this.inner = Object.freeze(inner);
30669
+ }
30670
+
30671
+ static new(inner: {
30672
+ bolt11: string;
30673
+ lnurlPay: LnurlPayContext | undefined;
30674
+ feePolicy: FeePolicy;
30675
+ completionTimeoutSecs: /*u32*/ number | undefined;
30676
+ }): Lightning_ {
30677
+ return new Lightning_(inner);
30678
+ }
30679
+
30680
+ static instanceOf(obj: any): obj is Lightning_ {
30681
+ return obj.tag === TransferTarget_Tags.Lightning;
30682
+ }
30683
+ }
30684
+
30685
+ type CoopExit__interface = {
30686
+ tag: TransferTarget_Tags.CoopExit;
30687
+ inner: Readonly<{
30688
+ address: string;
30689
+ feeQuote: SendOnchainFeeQuote;
30690
+ confirmationSpeed: OnchainConfirmationSpeed;
30691
+ }>;
30692
+ };
30693
+
30694
+ class CoopExit_ extends UniffiEnum implements CoopExit__interface {
30695
+ /**
30696
+ * @private
30697
+ * This field is private and should not be used, use `tag` instead.
30698
+ */
30699
+ readonly [uniffiTypeNameSymbol] = 'TransferTarget';
30700
+ readonly tag = TransferTarget_Tags.CoopExit;
30701
+ readonly inner: Readonly<{
30702
+ address: string;
30703
+ feeQuote: SendOnchainFeeQuote;
30704
+ confirmationSpeed: OnchainConfirmationSpeed;
30705
+ }>;
30706
+ constructor(inner: {
30707
+ address: string;
30708
+ feeQuote: SendOnchainFeeQuote;
30709
+ confirmationSpeed: OnchainConfirmationSpeed;
30710
+ }) {
30711
+ super('TransferTarget', 'CoopExit');
30712
+ this.inner = Object.freeze(inner);
30713
+ }
30714
+
30715
+ static new(inner: {
30716
+ address: string;
30717
+ feeQuote: SendOnchainFeeQuote;
30718
+ confirmationSpeed: OnchainConfirmationSpeed;
30719
+ }): CoopExit_ {
30720
+ return new CoopExit_(inner);
30721
+ }
30722
+
30723
+ static instanceOf(obj: any): obj is CoopExit_ {
30724
+ return obj.tag === TransferTarget_Tags.CoopExit;
30725
+ }
30726
+ }
30727
+
30728
+ function instanceOf(obj: any): obj is TransferTarget {
30729
+ return obj[uniffiTypeNameSymbol] === 'TransferTarget';
30730
+ }
30731
+
30732
+ return Object.freeze({
30733
+ instanceOf,
30734
+ Spark: Spark_,
30735
+ Lightning: Lightning_,
30736
+ CoopExit: CoopExit_,
30737
+ });
30738
+ })();
30739
+
30740
+ export type TransferTarget = InstanceType<
30741
+ (typeof TransferTarget)[keyof Omit<typeof TransferTarget, 'instanceOf'>]
30742
+ >;
30743
+
30744
+ // FfiConverter for enum TransferTarget
30745
+ const FfiConverterTypeTransferTarget = (() => {
30746
+ const ordinalConverter = FfiConverterInt32;
30747
+ type TypeName = TransferTarget;
30748
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
30749
+ read(from: RustBuffer): TypeName {
30750
+ switch (ordinalConverter.read(from)) {
30751
+ case 1:
30752
+ return new TransferTarget.Spark({
30753
+ address: FfiConverterString.read(from),
30754
+ sparkInvoice: FfiConverterOptionalString.read(from),
30755
+ });
30756
+ case 2:
30757
+ return new TransferTarget.Lightning({
30758
+ bolt11: FfiConverterString.read(from),
30759
+ lnurlPay: FfiConverterOptionalTypeLnurlPayContext.read(from),
30760
+ feePolicy: FfiConverterTypeFeePolicy.read(from),
30761
+ completionTimeoutSecs: FfiConverterOptionalUInt32.read(from),
30762
+ });
30763
+ case 3:
30764
+ return new TransferTarget.CoopExit({
30765
+ address: FfiConverterString.read(from),
30766
+ feeQuote: FfiConverterTypeSendOnchainFeeQuote.read(from),
30767
+ confirmationSpeed:
30768
+ FfiConverterTypeOnchainConfirmationSpeed.read(from),
30769
+ });
30770
+ default:
30771
+ throw new UniffiInternalError.UnexpectedEnumCase();
30772
+ }
30773
+ }
30774
+ write(value: TypeName, into: RustBuffer): void {
30775
+ switch (value.tag) {
30776
+ case TransferTarget_Tags.Spark: {
30777
+ ordinalConverter.write(1, into);
30778
+ const inner = value.inner;
30779
+ FfiConverterString.write(inner.address, into);
30780
+ FfiConverterOptionalString.write(inner.sparkInvoice, into);
30781
+ return;
30782
+ }
30783
+ case TransferTarget_Tags.Lightning: {
30784
+ ordinalConverter.write(2, into);
30785
+ const inner = value.inner;
30786
+ FfiConverterString.write(inner.bolt11, into);
30787
+ FfiConverterOptionalTypeLnurlPayContext.write(inner.lnurlPay, into);
30788
+ FfiConverterTypeFeePolicy.write(inner.feePolicy, into);
30789
+ FfiConverterOptionalUInt32.write(inner.completionTimeoutSecs, into);
30790
+ return;
30791
+ }
30792
+ case TransferTarget_Tags.CoopExit: {
30793
+ ordinalConverter.write(3, into);
30794
+ const inner = value.inner;
30795
+ FfiConverterString.write(inner.address, into);
30796
+ FfiConverterTypeSendOnchainFeeQuote.write(inner.feeQuote, into);
30797
+ FfiConverterTypeOnchainConfirmationSpeed.write(
30798
+ inner.confirmationSpeed,
30799
+ into
30800
+ );
30801
+ return;
30802
+ }
30803
+ default:
30804
+ // Throwing from here means that TransferTarget_Tags hasn't matched an ordinal.
30805
+ throw new UniffiInternalError.UnexpectedEnumCase();
30806
+ }
30807
+ }
30808
+ allocationSize(value: TypeName): number {
30809
+ switch (value.tag) {
30810
+ case TransferTarget_Tags.Spark: {
30811
+ const inner = value.inner;
30812
+ let size = ordinalConverter.allocationSize(1);
30813
+ size += FfiConverterString.allocationSize(inner.address);
30814
+ size += FfiConverterOptionalString.allocationSize(inner.sparkInvoice);
30815
+ return size;
30816
+ }
30817
+ case TransferTarget_Tags.Lightning: {
30818
+ const inner = value.inner;
30819
+ let size = ordinalConverter.allocationSize(2);
30820
+ size += FfiConverterString.allocationSize(inner.bolt11);
30821
+ size += FfiConverterOptionalTypeLnurlPayContext.allocationSize(
30822
+ inner.lnurlPay
30823
+ );
30824
+ size += FfiConverterTypeFeePolicy.allocationSize(inner.feePolicy);
30825
+ size += FfiConverterOptionalUInt32.allocationSize(
30826
+ inner.completionTimeoutSecs
30827
+ );
30828
+ return size;
30829
+ }
30830
+ case TransferTarget_Tags.CoopExit: {
30831
+ const inner = value.inner;
30832
+ let size = ordinalConverter.allocationSize(3);
30833
+ size += FfiConverterString.allocationSize(inner.address);
30834
+ size += FfiConverterTypeSendOnchainFeeQuote.allocationSize(
30835
+ inner.feeQuote
30836
+ );
30837
+ size += FfiConverterTypeOnchainConfirmationSpeed.allocationSize(
30838
+ inner.confirmationSpeed
30839
+ );
30840
+ return size;
30841
+ }
30842
+ default:
30843
+ throw new UniffiInternalError.UnexpectedEnumCase();
30844
+ }
30845
+ }
30846
+ }
30847
+ return new FFIConverter();
30848
+ })();
30849
+
30850
+ // Enum: UnsignedTransferPackage
30851
+ export enum UnsignedTransferPackage_Tags {
30852
+ Swap = 'Swap',
30853
+ Transfer = 'Transfer',
30854
+ Token = 'Token',
30855
+ }
30856
+ export const UnsignedTransferPackage = (() => {
30857
+ type Swap__interface = {
30858
+ tag: UnsignedTransferPackage_Tags.Swap;
30859
+ inner: Readonly<{
30860
+ prepareTransfer: ExternalPrepareTransferRequest;
30861
+ targetAmounts: Array</*u64*/ bigint>;
30862
+ amountSat: /*u64*/ bigint;
30863
+ feeSat: /*u64*/ bigint;
30864
+ }>;
30865
+ };
30866
+
30867
+ class Swap_ extends UniffiEnum implements Swap__interface {
30868
+ /**
30869
+ * @private
30870
+ * This field is private and should not be used, use `tag` instead.
30871
+ */
30872
+ readonly [uniffiTypeNameSymbol] = 'UnsignedTransferPackage';
30873
+ readonly tag = UnsignedTransferPackage_Tags.Swap;
30874
+ readonly inner: Readonly<{
30875
+ prepareTransfer: ExternalPrepareTransferRequest;
30876
+ targetAmounts: Array</*u64*/ bigint>;
30877
+ amountSat: /*u64*/ bigint;
30878
+ feeSat: /*u64*/ bigint;
30879
+ }>;
30880
+ constructor(inner: {
30881
+ prepareTransfer: ExternalPrepareTransferRequest;
30882
+ targetAmounts: Array</*u64*/ bigint>;
30883
+ amountSat: /*u64*/ bigint;
30884
+ feeSat: /*u64*/ bigint;
30885
+ }) {
30886
+ super('UnsignedTransferPackage', 'Swap');
30887
+ this.inner = Object.freeze(inner);
30888
+ }
30889
+
30890
+ static new(inner: {
30891
+ prepareTransfer: ExternalPrepareTransferRequest;
30892
+ targetAmounts: Array</*u64*/ bigint>;
30893
+ amountSat: /*u64*/ bigint;
30894
+ feeSat: /*u64*/ bigint;
30895
+ }): Swap_ {
30896
+ return new Swap_(inner);
30897
+ }
30898
+
30899
+ static instanceOf(obj: any): obj is Swap_ {
30900
+ return obj.tag === UnsignedTransferPackage_Tags.Swap;
30901
+ }
30902
+ }
30903
+
30904
+ type Transfer__interface = {
30905
+ tag: UnsignedTransferPackage_Tags.Transfer;
30906
+ inner: Readonly<{
30907
+ prepareTransfer: ExternalPrepareTransferRequest;
30908
+ amountSat: /*u64*/ bigint;
30909
+ feeSat: /*u64*/ bigint;
30910
+ target: TransferTarget;
30911
+ }>;
30912
+ };
30913
+
30914
+ class Transfer_ extends UniffiEnum implements Transfer__interface {
30915
+ /**
30916
+ * @private
30917
+ * This field is private and should not be used, use `tag` instead.
30918
+ */
30919
+ readonly [uniffiTypeNameSymbol] = 'UnsignedTransferPackage';
30920
+ readonly tag = UnsignedTransferPackage_Tags.Transfer;
30921
+ readonly inner: Readonly<{
30922
+ prepareTransfer: ExternalPrepareTransferRequest;
30923
+ amountSat: /*u64*/ bigint;
30924
+ feeSat: /*u64*/ bigint;
30925
+ target: TransferTarget;
30926
+ }>;
30927
+ constructor(inner: {
30928
+ prepareTransfer: ExternalPrepareTransferRequest;
30929
+ amountSat: /*u64*/ bigint;
30930
+ feeSat: /*u64*/ bigint;
30931
+ target: TransferTarget;
30932
+ }) {
30933
+ super('UnsignedTransferPackage', 'Transfer');
30934
+ this.inner = Object.freeze(inner);
30935
+ }
30936
+
30937
+ static new(inner: {
30938
+ prepareTransfer: ExternalPrepareTransferRequest;
30939
+ amountSat: /*u64*/ bigint;
30940
+ feeSat: /*u64*/ bigint;
30941
+ target: TransferTarget;
30942
+ }): Transfer_ {
30943
+ return new Transfer_(inner);
30944
+ }
30945
+
30946
+ static instanceOf(obj: any): obj is Transfer_ {
30947
+ return obj.tag === UnsignedTransferPackage_Tags.Transfer;
30948
+ }
30949
+ }
30950
+
30951
+ type Token__interface = {
30952
+ tag: UnsignedTransferPackage_Tags.Token;
30953
+ inner: Readonly<{
30954
+ prepareTokenTransaction: ExternalPrepareTokenTransactionRequest;
30955
+ tokenContext: ArrayBuffer;
30956
+ tokenIdentifier: string;
30957
+ amount: U128;
30958
+ fee: U128;
30959
+ isSwap: boolean;
30960
+ }>;
30961
+ };
30962
+
30963
+ class Token_ extends UniffiEnum implements Token__interface {
30964
+ /**
30965
+ * @private
30966
+ * This field is private and should not be used, use `tag` instead.
30967
+ */
30968
+ readonly [uniffiTypeNameSymbol] = 'UnsignedTransferPackage';
30969
+ readonly tag = UnsignedTransferPackage_Tags.Token;
30970
+ readonly inner: Readonly<{
30971
+ prepareTokenTransaction: ExternalPrepareTokenTransactionRequest;
30972
+ tokenContext: ArrayBuffer;
30973
+ tokenIdentifier: string;
30974
+ amount: U128;
30975
+ fee: U128;
30976
+ isSwap: boolean;
30977
+ }>;
30978
+ constructor(inner: {
30979
+ prepareTokenTransaction: ExternalPrepareTokenTransactionRequest;
30980
+ tokenContext: ArrayBuffer;
30981
+ tokenIdentifier: string;
30982
+ amount: U128;
30983
+ fee: U128;
30984
+ /**
30985
+ * When set, this package re-shapes the wallet's token outputs instead of
30986
+ * sending a payment. Publishing it returns `SwapCompleted`: rebuild the
30987
+ * original send from the same prepare response and submit again.
30988
+ */ isSwap: boolean;
30989
+ }) {
30990
+ super('UnsignedTransferPackage', 'Token');
30991
+ this.inner = Object.freeze(inner);
30992
+ }
30993
+
30994
+ static new(inner: {
30995
+ prepareTokenTransaction: ExternalPrepareTokenTransactionRequest;
30996
+ tokenContext: ArrayBuffer;
30997
+ tokenIdentifier: string;
30998
+ amount: U128;
30999
+ fee: U128;
31000
+ /**
31001
+ * When set, this package re-shapes the wallet's token outputs instead of
31002
+ * sending a payment. Publishing it returns `SwapCompleted`: rebuild the
31003
+ * original send from the same prepare response and submit again.
31004
+ */ isSwap: boolean;
31005
+ }): Token_ {
31006
+ return new Token_(inner);
31007
+ }
31008
+
31009
+ static instanceOf(obj: any): obj is Token_ {
31010
+ return obj.tag === UnsignedTransferPackage_Tags.Token;
31011
+ }
31012
+ }
31013
+
31014
+ function instanceOf(obj: any): obj is UnsignedTransferPackage {
31015
+ return obj[uniffiTypeNameSymbol] === 'UnsignedTransferPackage';
31016
+ }
31017
+
31018
+ return Object.freeze({
31019
+ instanceOf,
31020
+ Swap: Swap_,
31021
+ Transfer: Transfer_,
31022
+ Token: Token_,
31023
+ });
31024
+ })();
31025
+
31026
+ export type UnsignedTransferPackage = InstanceType<
31027
+ (typeof UnsignedTransferPackage)[keyof Omit<
31028
+ typeof UnsignedTransferPackage,
31029
+ 'instanceOf'
31030
+ >]
31031
+ >;
31032
+
31033
+ // FfiConverter for enum UnsignedTransferPackage
31034
+ const FfiConverterTypeUnsignedTransferPackage = (() => {
31035
+ const ordinalConverter = FfiConverterInt32;
31036
+ type TypeName = UnsignedTransferPackage;
31037
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
31038
+ read(from: RustBuffer): TypeName {
31039
+ switch (ordinalConverter.read(from)) {
31040
+ case 1:
31041
+ return new UnsignedTransferPackage.Swap({
31042
+ prepareTransfer:
31043
+ FfiConverterTypeExternalPrepareTransferRequest.read(from),
31044
+ targetAmounts: FfiConverterArrayUInt64.read(from),
31045
+ amountSat: FfiConverterUInt64.read(from),
31046
+ feeSat: FfiConverterUInt64.read(from),
31047
+ });
31048
+ case 2:
31049
+ return new UnsignedTransferPackage.Transfer({
31050
+ prepareTransfer:
31051
+ FfiConverterTypeExternalPrepareTransferRequest.read(from),
31052
+ amountSat: FfiConverterUInt64.read(from),
31053
+ feeSat: FfiConverterUInt64.read(from),
31054
+ target: FfiConverterTypeTransferTarget.read(from),
31055
+ });
31056
+ case 3:
31057
+ return new UnsignedTransferPackage.Token({
31058
+ prepareTokenTransaction:
31059
+ FfiConverterTypeExternalPrepareTokenTransactionRequest.read(from),
31060
+ tokenContext: FfiConverterArrayBuffer.read(from),
31061
+ tokenIdentifier: FfiConverterString.read(from),
31062
+ amount: FfiConverterTypeu128.read(from),
31063
+ fee: FfiConverterTypeu128.read(from),
31064
+ isSwap: FfiConverterBool.read(from),
31065
+ });
31066
+ default:
31067
+ throw new UniffiInternalError.UnexpectedEnumCase();
31068
+ }
31069
+ }
31070
+ write(value: TypeName, into: RustBuffer): void {
31071
+ switch (value.tag) {
31072
+ case UnsignedTransferPackage_Tags.Swap: {
31073
+ ordinalConverter.write(1, into);
31074
+ const inner = value.inner;
31075
+ FfiConverterTypeExternalPrepareTransferRequest.write(
31076
+ inner.prepareTransfer,
31077
+ into
31078
+ );
31079
+ FfiConverterArrayUInt64.write(inner.targetAmounts, into);
31080
+ FfiConverterUInt64.write(inner.amountSat, into);
31081
+ FfiConverterUInt64.write(inner.feeSat, into);
31082
+ return;
31083
+ }
31084
+ case UnsignedTransferPackage_Tags.Transfer: {
31085
+ ordinalConverter.write(2, into);
31086
+ const inner = value.inner;
31087
+ FfiConverterTypeExternalPrepareTransferRequest.write(
31088
+ inner.prepareTransfer,
31089
+ into
31090
+ );
31091
+ FfiConverterUInt64.write(inner.amountSat, into);
31092
+ FfiConverterUInt64.write(inner.feeSat, into);
31093
+ FfiConverterTypeTransferTarget.write(inner.target, into);
31094
+ return;
31095
+ }
31096
+ case UnsignedTransferPackage_Tags.Token: {
31097
+ ordinalConverter.write(3, into);
31098
+ const inner = value.inner;
31099
+ FfiConverterTypeExternalPrepareTokenTransactionRequest.write(
31100
+ inner.prepareTokenTransaction,
31101
+ into
31102
+ );
31103
+ FfiConverterArrayBuffer.write(inner.tokenContext, into);
31104
+ FfiConverterString.write(inner.tokenIdentifier, into);
31105
+ FfiConverterTypeu128.write(inner.amount, into);
31106
+ FfiConverterTypeu128.write(inner.fee, into);
31107
+ FfiConverterBool.write(inner.isSwap, into);
31108
+ return;
31109
+ }
31110
+ default:
31111
+ // Throwing from here means that UnsignedTransferPackage_Tags hasn't matched an ordinal.
31112
+ throw new UniffiInternalError.UnexpectedEnumCase();
31113
+ }
31114
+ }
31115
+ allocationSize(value: TypeName): number {
31116
+ switch (value.tag) {
31117
+ case UnsignedTransferPackage_Tags.Swap: {
31118
+ const inner = value.inner;
31119
+ let size = ordinalConverter.allocationSize(1);
31120
+ size += FfiConverterTypeExternalPrepareTransferRequest.allocationSize(
31121
+ inner.prepareTransfer
31122
+ );
31123
+ size += FfiConverterArrayUInt64.allocationSize(inner.targetAmounts);
31124
+ size += FfiConverterUInt64.allocationSize(inner.amountSat);
31125
+ size += FfiConverterUInt64.allocationSize(inner.feeSat);
31126
+ return size;
31127
+ }
31128
+ case UnsignedTransferPackage_Tags.Transfer: {
31129
+ const inner = value.inner;
31130
+ let size = ordinalConverter.allocationSize(2);
31131
+ size += FfiConverterTypeExternalPrepareTransferRequest.allocationSize(
31132
+ inner.prepareTransfer
31133
+ );
31134
+ size += FfiConverterUInt64.allocationSize(inner.amountSat);
31135
+ size += FfiConverterUInt64.allocationSize(inner.feeSat);
31136
+ size += FfiConverterTypeTransferTarget.allocationSize(inner.target);
31137
+ return size;
31138
+ }
31139
+ case UnsignedTransferPackage_Tags.Token: {
31140
+ const inner = value.inner;
31141
+ let size = ordinalConverter.allocationSize(3);
31142
+ size +=
31143
+ FfiConverterTypeExternalPrepareTokenTransactionRequest.allocationSize(
31144
+ inner.prepareTokenTransaction
31145
+ );
31146
+ size += FfiConverterArrayBuffer.allocationSize(inner.tokenContext);
31147
+ size += FfiConverterString.allocationSize(inner.tokenIdentifier);
31148
+ size += FfiConverterTypeu128.allocationSize(inner.amount);
31149
+ size += FfiConverterTypeu128.allocationSize(inner.fee);
31150
+ size += FfiConverterBool.allocationSize(inner.isSwap);
31151
+ return size;
31152
+ }
31153
+ default:
31154
+ throw new UniffiInternalError.UnexpectedEnumCase();
31155
+ }
31156
+ }
31157
+ }
31158
+ return new FFIConverter();
31159
+ })();
31160
+
29550
31161
  // Enum: UpdateDepositPayload
29551
31162
  export enum UpdateDepositPayload_Tags {
29552
31163
  ClaimError = 'ClaimError',
@@ -30582,6 +32193,14 @@ export interface BreezSdkInterface {
30582
32193
  request: AuthorizeTransferRequest,
30583
32194
  asyncOpts_?: { signal: AbortSignal }
30584
32195
  ): /*throws*/ Promise<TransferAuthorization>;
32196
+ buildUnsignedLnurlPayPackage(
32197
+ request: BuildUnsignedLnurlPayPackageRequest,
32198
+ asyncOpts_?: { signal: AbortSignal }
32199
+ ): /*throws*/ Promise<UnsignedTransferPackage>;
32200
+ buildUnsignedTransferPackage(
32201
+ request: BuildUnsignedTransferPackageRequest,
32202
+ asyncOpts_?: { signal: AbortSignal }
32203
+ ): /*throws*/ Promise<UnsignedTransferPackage>;
30585
32204
  /**
30586
32205
  * Initiates a Bitcoin purchase flow via an external provider.
30587
32206
  *
@@ -30854,6 +32473,14 @@ export interface BreezSdkInterface {
30854
32473
  request: PrepareSendPaymentRequest,
30855
32474
  asyncOpts_?: { signal: AbortSignal }
30856
32475
  ): /*throws*/ Promise<PrepareSendPaymentResponse>;
32476
+ publishSignedLnurlPayPackage(
32477
+ request: PublishSignedLnurlPayPackageRequest,
32478
+ asyncOpts_?: { signal: AbortSignal }
32479
+ ): /*throws*/ Promise<PublishSignedLnurlPayResponse>;
32480
+ publishSignedTransferPackage(
32481
+ request: PublishSignedTransferPackageRequest,
32482
+ asyncOpts_?: { signal: AbortSignal }
32483
+ ): /*throws*/ Promise<PublishSignedTransferPackageResponse>;
30857
32484
  receivePayment(
30858
32485
  request: ReceivePaymentRequest,
30859
32486
  asyncOpts_?: { signal: AbortSignal }
@@ -31145,6 +32772,84 @@ export class BreezSdk
31145
32772
  }
31146
32773
  }
31147
32774
 
32775
+ public async buildUnsignedLnurlPayPackage(
32776
+ request: BuildUnsignedLnurlPayPackageRequest,
32777
+ asyncOpts_?: { signal: AbortSignal }
32778
+ ): Promise<UnsignedTransferPackage> /*throws*/ {
32779
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
32780
+ try {
32781
+ return await uniffiRustCallAsync(
32782
+ /*rustCaller:*/ uniffiCaller,
32783
+ /*rustFutureFunc:*/ () => {
32784
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_build_unsigned_lnurl_pay_package(
32785
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
32786
+ FfiConverterTypeBuildUnsignedLnurlPayPackageRequest.lower(request)
32787
+ );
32788
+ },
32789
+ /*pollFunc:*/ nativeModule()
32790
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
32791
+ /*cancelFunc:*/ nativeModule()
32792
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
32793
+ /*completeFunc:*/ nativeModule()
32794
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
32795
+ /*freeFunc:*/ nativeModule()
32796
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
32797
+ /*liftFunc:*/ FfiConverterTypeUnsignedTransferPackage.lift.bind(
32798
+ FfiConverterTypeUnsignedTransferPackage
32799
+ ),
32800
+ /*liftString:*/ FfiConverterString.lift,
32801
+ /*asyncOpts:*/ asyncOpts_,
32802
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
32803
+ FfiConverterTypeSdkError
32804
+ )
32805
+ );
32806
+ } catch (__error: any) {
32807
+ if (uniffiIsDebug && __error instanceof Error) {
32808
+ __error.stack = __stack;
32809
+ }
32810
+ throw __error;
32811
+ }
32812
+ }
32813
+
32814
+ public async buildUnsignedTransferPackage(
32815
+ request: BuildUnsignedTransferPackageRequest,
32816
+ asyncOpts_?: { signal: AbortSignal }
32817
+ ): Promise<UnsignedTransferPackage> /*throws*/ {
32818
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
32819
+ try {
32820
+ return await uniffiRustCallAsync(
32821
+ /*rustCaller:*/ uniffiCaller,
32822
+ /*rustFutureFunc:*/ () => {
32823
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_build_unsigned_transfer_package(
32824
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
32825
+ FfiConverterTypeBuildUnsignedTransferPackageRequest.lower(request)
32826
+ );
32827
+ },
32828
+ /*pollFunc:*/ nativeModule()
32829
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
32830
+ /*cancelFunc:*/ nativeModule()
32831
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
32832
+ /*completeFunc:*/ nativeModule()
32833
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
32834
+ /*freeFunc:*/ nativeModule()
32835
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
32836
+ /*liftFunc:*/ FfiConverterTypeUnsignedTransferPackage.lift.bind(
32837
+ FfiConverterTypeUnsignedTransferPackage
32838
+ ),
32839
+ /*liftString:*/ FfiConverterString.lift,
32840
+ /*asyncOpts:*/ asyncOpts_,
32841
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
32842
+ FfiConverterTypeSdkError
32843
+ )
32844
+ );
32845
+ } catch (__error: any) {
32846
+ if (uniffiIsDebug && __error instanceof Error) {
32847
+ __error.stack = __stack;
32848
+ }
32849
+ throw __error;
32850
+ }
32851
+ }
32852
+
31148
32853
  /**
31149
32854
  * Initiates a Bitcoin purchase flow via an external provider.
31150
32855
  *
@@ -32432,6 +34137,84 @@ export class BreezSdk
32432
34137
  }
32433
34138
  }
32434
34139
 
34140
+ public async publishSignedLnurlPayPackage(
34141
+ request: PublishSignedLnurlPayPackageRequest,
34142
+ asyncOpts_?: { signal: AbortSignal }
34143
+ ): Promise<PublishSignedLnurlPayResponse> /*throws*/ {
34144
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
34145
+ try {
34146
+ return await uniffiRustCallAsync(
34147
+ /*rustCaller:*/ uniffiCaller,
34148
+ /*rustFutureFunc:*/ () => {
34149
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_publish_signed_lnurl_pay_package(
34150
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
34151
+ FfiConverterTypePublishSignedLnurlPayPackageRequest.lower(request)
34152
+ );
34153
+ },
34154
+ /*pollFunc:*/ nativeModule()
34155
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
34156
+ /*cancelFunc:*/ nativeModule()
34157
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
34158
+ /*completeFunc:*/ nativeModule()
34159
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
34160
+ /*freeFunc:*/ nativeModule()
34161
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
34162
+ /*liftFunc:*/ FfiConverterTypePublishSignedLnurlPayResponse.lift.bind(
34163
+ FfiConverterTypePublishSignedLnurlPayResponse
34164
+ ),
34165
+ /*liftString:*/ FfiConverterString.lift,
34166
+ /*asyncOpts:*/ asyncOpts_,
34167
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
34168
+ FfiConverterTypeSdkError
34169
+ )
34170
+ );
34171
+ } catch (__error: any) {
34172
+ if (uniffiIsDebug && __error instanceof Error) {
34173
+ __error.stack = __stack;
34174
+ }
34175
+ throw __error;
34176
+ }
34177
+ }
34178
+
34179
+ public async publishSignedTransferPackage(
34180
+ request: PublishSignedTransferPackageRequest,
34181
+ asyncOpts_?: { signal: AbortSignal }
34182
+ ): Promise<PublishSignedTransferPackageResponse> /*throws*/ {
34183
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
34184
+ try {
34185
+ return await uniffiRustCallAsync(
34186
+ /*rustCaller:*/ uniffiCaller,
34187
+ /*rustFutureFunc:*/ () => {
34188
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_publish_signed_transfer_package(
34189
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
34190
+ FfiConverterTypePublishSignedTransferPackageRequest.lower(request)
34191
+ );
34192
+ },
34193
+ /*pollFunc:*/ nativeModule()
34194
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
34195
+ /*cancelFunc:*/ nativeModule()
34196
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
34197
+ /*completeFunc:*/ nativeModule()
34198
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
34199
+ /*freeFunc:*/ nativeModule()
34200
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
34201
+ /*liftFunc:*/ FfiConverterTypePublishSignedTransferPackageResponse.lift.bind(
34202
+ FfiConverterTypePublishSignedTransferPackageResponse
34203
+ ),
34204
+ /*liftString:*/ FfiConverterString.lift,
34205
+ /*asyncOpts:*/ asyncOpts_,
34206
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
34207
+ FfiConverterTypeSdkError
34208
+ )
34209
+ );
34210
+ } catch (__error: any) {
34211
+ if (uniffiIsDebug && __error instanceof Error) {
34212
+ __error.stack = __stack;
34213
+ }
34214
+ throw __error;
34215
+ }
34216
+ }
34217
+
32435
34218
  public async receivePayment(
32436
34219
  request: ReceivePaymentRequest,
32437
34220
  asyncOpts_?: { signal: AbortSignal }
@@ -34713,6 +36496,13 @@ export interface ExternalSparkSigner {
34713
36496
  leafId: ExternalTreeNodeId,
34714
36497
  asyncOpts_?: { signal: AbortSignal }
34715
36498
  ): /*throws*/ Promise<PublicKeyBytes>;
36499
+ /**
36500
+ * Whether this signer is backed by a remote service, so its operations are
36501
+ * network round-trips rather than local computation. Local signers return
36502
+ * false; a hosted signer like Turnkey returns true so the SDK can avoid
36503
+ * redundant calls, e.g. re-deriving keys for leaves it has already verified.
36504
+ */
36505
+ isRemote(): boolean;
34716
36506
  /**
34717
36507
  * The static-deposit signing public key at `index`.
34718
36508
  */
@@ -34906,6 +36696,26 @@ export class ExternalSparkSignerImpl
34906
36696
  }
34907
36697
  }
34908
36698
 
36699
+ /**
36700
+ * Whether this signer is backed by a remote service, so its operations are
36701
+ * network round-trips rather than local computation. Local signers return
36702
+ * false; a hosted signer like Turnkey returns true so the SDK can avoid
36703
+ * redundant calls, e.g. re-deriving keys for leaves it has already verified.
36704
+ */
36705
+ public isRemote(): boolean {
36706
+ return FfiConverterBool.lift(
36707
+ uniffiCaller.rustCall(
36708
+ /*caller:*/ (callStatus) => {
36709
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_externalsparksigner_is_remote(
36710
+ uniffiTypeExternalSparkSignerImplObjectFactory.clonePointer(this),
36711
+ callStatus
36712
+ );
36713
+ },
36714
+ /*liftString:*/ FfiConverterString.lift
36715
+ )
36716
+ );
36717
+ }
36718
+
34909
36719
  /**
34910
36720
  * The static-deposit signing public key at `index`.
34911
36721
  */
@@ -35654,6 +37464,27 @@ const uniffiCallbackInterfaceExternalSparkSigner: {
35654
37464
  );
35655
37465
  return uniffiForeignFuture;
35656
37466
  },
37467
+ isRemote: (uniffiHandle: bigint) => {
37468
+ const uniffiMakeCall = (): boolean => {
37469
+ const jsCallback =
37470
+ FfiConverterTypeExternalSparkSigner.lift(uniffiHandle);
37471
+ return jsCallback.isRemote();
37472
+ };
37473
+ const uniffiResult = UniffiResult.ready<number>();
37474
+ const uniffiHandleSuccess = (obj: any) => {
37475
+ UniffiResult.writeSuccess(uniffiResult, FfiConverterBool.lower(obj));
37476
+ };
37477
+ const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => {
37478
+ UniffiResult.writeError(uniffiResult, code, errBuf);
37479
+ };
37480
+ uniffiTraitInterfaceCall(
37481
+ /*makeCall:*/ uniffiMakeCall,
37482
+ /*handleSuccess:*/ uniffiHandleSuccess,
37483
+ /*handleError:*/ uniffiHandleError,
37484
+ /*lowerString:*/ FfiConverterString.lower
37485
+ );
37486
+ return uniffiResult;
37487
+ },
35657
37488
  getStaticDepositPublicKey: (
35658
37489
  uniffiHandle: bigint,
35659
37490
  index: number,
@@ -36677,8 +38508,7 @@ export interface PasskeyClientInterface {
36677
38508
  }): /*throws*/ Promise<PasskeyAvailability>;
36678
38509
  /**
36679
38510
  * Single-CTA onboarding: silent sign-in, falling through to
36680
- * registration when no credential exists on the device. The returned
36681
- * [`ConnectFlow`] tells the caller which path ran.
38511
+ * registration when no credential exists on the device.
36682
38512
  *
36683
38513
  * The silent sign-in pins `prefer_immediately_available_credentials =
36684
38514
  * true` regardless of [`SignInRequest`]: the fallback depends on the OS
@@ -36687,11 +38517,12 @@ export interface PasskeyClientInterface {
36687
38517
  * register path; every other error (`Cancel`, `Timeout`, ...) propagates
36688
38518
  * unchanged.
36689
38519
  *
36690
- * Mobile-only: meant for iOS 18+ / Android 9+ where
36691
- * `preferImmediatelyAvailableCredentials` is honored. The web
36692
- * equivalent (`mediation: 'immediate'`) is not yet stable
36693
- * cross-browser, so this is not surfaced on WASM; web hosts call
36694
- * [`Self::sign_in`] and catch `CredentialNotFound` themselves.
38520
+ * On WASM the silent sign-in maps to `WebAuthn` `uiMode: 'immediate'`
38521
+ * where the browser advertises it. Web hosts gate on the browser's
38522
+ * immediate-mediation capability (the WASM client surfaces it):
38523
+ * without it the probe shows the standard picker and a dismiss is a
38524
+ * cancel, not `CredentialNotFound`, so it never reaches register.
38525
+ * Present an explicit create / sign-in choice there instead.
36695
38526
  */
36696
38527
  connectWithPasskey(
36697
38528
  request: ConnectWithPasskeyRequest,
@@ -36818,8 +38649,7 @@ export class PasskeyClient
36818
38649
 
36819
38650
  /**
36820
38651
  * Single-CTA onboarding: silent sign-in, falling through to
36821
- * registration when no credential exists on the device. The returned
36822
- * [`ConnectFlow`] tells the caller which path ran.
38652
+ * registration when no credential exists on the device.
36823
38653
  *
36824
38654
  * The silent sign-in pins `prefer_immediately_available_credentials =
36825
38655
  * true` regardless of [`SignInRequest`]: the fallback depends on the OS
@@ -36828,11 +38658,12 @@ export class PasskeyClient
36828
38658
  * register path; every other error (`Cancel`, `Timeout`, ...) propagates
36829
38659
  * unchanged.
36830
38660
  *
36831
- * Mobile-only: meant for iOS 18+ / Android 9+ where
36832
- * `preferImmediatelyAvailableCredentials` is honored. The web
36833
- * equivalent (`mediation: 'immediate'`) is not yet stable
36834
- * cross-browser, so this is not surfaced on WASM; web hosts call
36835
- * [`Self::sign_in`] and catch `CredentialNotFound` themselves.
38661
+ * On WASM the silent sign-in maps to `WebAuthn` `uiMode: 'immediate'`
38662
+ * where the browser advertises it. Web hosts gate on the browser's
38663
+ * immediate-mediation capability (the WASM client surfaces it):
38664
+ * without it the probe shows the standard picker and a dismiss is a
38665
+ * cancel, not `CredentialNotFound`, so it never reaches register.
38666
+ * Present an explicit create / sign-in choice there instead.
36836
38667
  */
36837
38668
  public async connectWithPasskey(
36838
38669
  request: ConnectWithPasskeyRequest,
@@ -38843,6 +40674,19 @@ export interface SdkBuilderInterface {
38843
40674
  credentials: Credentials | undefined,
38844
40675
  asyncOpts_?: { signal: AbortSignal }
38845
40676
  ): Promise<void>;
40677
+ /**
40678
+ * Overrides the session store used to cache auth tokens, replacing the one
40679
+ * the backend provides. Supply any [`SessionStore`]: for example one that
40680
+ * wraps the backend's own store (from
40681
+ * [`default_session_store`](crate::default_session_store)) to add at-rest
40682
+ * encryption, which the SDK does not apply itself.
40683
+ * Arguments:
40684
+ * - `session_store`: The session store to use in place of the backend's.
40685
+ */
40686
+ withSessionStore(
40687
+ sessionStore: SessionStore,
40688
+ asyncOpts_?: { signal: AbortSignal }
40689
+ ): Promise<void>;
38846
40690
  /**
38847
40691
  * Threads a shared [`SdkContext`](crate::SdkContext) into the builder.
38848
40692
  *
@@ -39298,6 +41142,49 @@ export class SdkBuilder
39298
41142
  }
39299
41143
  }
39300
41144
 
41145
+ /**
41146
+ * Overrides the session store used to cache auth tokens, replacing the one
41147
+ * the backend provides. Supply any [`SessionStore`]: for example one that
41148
+ * wraps the backend's own store (from
41149
+ * [`default_session_store`](crate::default_session_store)) to add at-rest
41150
+ * encryption, which the SDK does not apply itself.
41151
+ * Arguments:
41152
+ * - `session_store`: The session store to use in place of the backend's.
41153
+ */
41154
+ public async withSessionStore(
41155
+ sessionStore: SessionStore,
41156
+ asyncOpts_?: { signal: AbortSignal }
41157
+ ): Promise<void> {
41158
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
41159
+ try {
41160
+ return await uniffiRustCallAsync(
41161
+ /*rustCaller:*/ uniffiCaller,
41162
+ /*rustFutureFunc:*/ () => {
41163
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_session_store(
41164
+ uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
41165
+ FfiConverterTypeSessionStore.lower(sessionStore)
41166
+ );
41167
+ },
41168
+ /*pollFunc:*/ nativeModule()
41169
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
41170
+ /*cancelFunc:*/ nativeModule()
41171
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
41172
+ /*completeFunc:*/ nativeModule()
41173
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
41174
+ /*freeFunc:*/ nativeModule()
41175
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
41176
+ /*liftFunc:*/ (_v) => {},
41177
+ /*liftString:*/ FfiConverterString.lift,
41178
+ /*asyncOpts:*/ asyncOpts_
41179
+ );
41180
+ } catch (__error: any) {
41181
+ if (uniffiIsDebug && __error instanceof Error) {
41182
+ __error.stack = __stack;
41183
+ }
41184
+ throw __error;
41185
+ }
41186
+ }
41187
+
39301
41188
  /**
39302
41189
  * Threads a shared [`SdkContext`](crate::SdkContext) into the builder.
39303
41190
  *
@@ -43849,6 +45736,11 @@ const FfiConverterOptionalTypeLightningAddressInfo = new FfiConverterOptional(
43849
45736
  FfiConverterTypeLightningAddressInfo
43850
45737
  );
43851
45738
 
45739
+ // FfiConverter for LnurlPayContext | undefined
45740
+ const FfiConverterOptionalTypeLnurlPayContext = new FfiConverterOptional(
45741
+ FfiConverterTypeLnurlPayContext
45742
+ );
45743
+
43852
45744
  // FfiConverter for LnurlPayInfo | undefined
43853
45745
  const FfiConverterOptionalTypeLnurlPayInfo = new FfiConverterOptional(
43854
45746
  FfiConverterTypeLnurlPayInfo
@@ -44126,6 +46018,9 @@ const FfiConverterArrayTypeWebhook = new FfiConverterArray(
44126
46018
  // FfiConverter for Array<string>
44127
46019
  const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
44128
46020
 
46021
+ // FfiConverter for Array</*u64*/bigint>
46022
+ const FfiConverterArrayUInt64 = new FfiConverterArray(FfiConverterUInt64);
46023
+
44129
46024
  // FfiConverter for Map<string, Array<Payment>>
44130
46025
  const FfiConverterMapStringArrayTypePayment = new FfiConverterMap(
44131
46026
  FfiConverterString,
@@ -44152,6 +46047,10 @@ const FfiConverterOptionalTypeAssetFilter = new FfiConverterOptional(
44152
46047
  FfiConverterTypeAssetFilter
44153
46048
  );
44154
46049
 
46050
+ // FfiConverter for BuildTransferPackageOptions | undefined
46051
+ const FfiConverterOptionalTypeBuildTransferPackageOptions =
46052
+ new FfiConverterOptional(FfiConverterTypeBuildTransferPackageOptions);
46053
+
44155
46054
  // FfiConverter for ConversionFilter | undefined
44156
46055
  const FfiConverterOptionalTypeConversionFilter = new FfiConverterOptional(
44157
46056
  FfiConverterTypeConversionFilter
@@ -44396,6 +46295,14 @@ function uniffiEnsureInitialized() {
44396
46295
  'uniffi_breez_sdk_spark_checksum_func_default_server_config'
44397
46296
  );
44398
46297
  }
46298
+ if (
46299
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_default_session_store() !==
46300
+ 24904
46301
+ ) {
46302
+ throw new UniffiInternalError.ApiChecksumMismatch(
46303
+ 'uniffi_breez_sdk_spark_checksum_func_default_session_store'
46304
+ );
46305
+ }
44399
46306
  if (
44400
46307
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_default_storage() !==
44401
46308
  56226
@@ -44500,6 +46407,22 @@ function uniffiEnsureInitialized() {
44500
46407
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_authorize_lightning_address_transfer'
44501
46408
  );
44502
46409
  }
46410
+ if (
46411
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_build_unsigned_lnurl_pay_package() !==
46412
+ 23822
46413
+ ) {
46414
+ throw new UniffiInternalError.ApiChecksumMismatch(
46415
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_build_unsigned_lnurl_pay_package'
46416
+ );
46417
+ }
46418
+ if (
46419
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_build_unsigned_transfer_package() !==
46420
+ 60228
46421
+ ) {
46422
+ throw new UniffiInternalError.ApiChecksumMismatch(
46423
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_build_unsigned_transfer_package'
46424
+ );
46425
+ }
44503
46426
  if (
44504
46427
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_buy_bitcoin() !==
44505
46428
  34179
@@ -44740,6 +46663,22 @@ function uniffiEnsureInitialized() {
44740
46663
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_payment'
44741
46664
  );
44742
46665
  }
46666
+ if (
46667
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_publish_signed_lnurl_pay_package() !==
46668
+ 48698
46669
+ ) {
46670
+ throw new UniffiInternalError.ApiChecksumMismatch(
46671
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_publish_signed_lnurl_pay_package'
46672
+ );
46673
+ }
46674
+ if (
46675
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_publish_signed_transfer_package() !==
46676
+ 59188
46677
+ ) {
46678
+ throw new UniffiInternalError.ApiChecksumMismatch(
46679
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_publish_signed_transfer_package'
46680
+ );
46681
+ }
44743
46682
  if (
44744
46683
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_receive_payment() !==
44745
46684
  36984
@@ -44948,9 +46887,17 @@ function uniffiEnsureInitialized() {
44948
46887
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_get_public_key_for_leaf'
44949
46888
  );
44950
46889
  }
46890
+ if (
46891
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_is_remote() !==
46892
+ 63049
46893
+ ) {
46894
+ throw new UniffiInternalError.ApiChecksumMismatch(
46895
+ 'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_is_remote'
46896
+ );
46897
+ }
44951
46898
  if (
44952
46899
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_get_static_deposit_public_key() !==
44953
- 11994
46900
+ 54380
44954
46901
  ) {
44955
46902
  throw new UniffiInternalError.ApiChecksumMismatch(
44956
46903
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_get_static_deposit_public_key'
@@ -44958,7 +46905,7 @@ function uniffiEnsureInitialized() {
44958
46905
  }
44959
46906
  if (
44960
46907
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_authentication_challenge() !==
44961
- 57313
46908
+ 53611
44962
46909
  ) {
44963
46910
  throw new UniffiInternalError.ApiChecksumMismatch(
44964
46911
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_authentication_challenge'
@@ -44966,7 +46913,7 @@ function uniffiEnsureInitialized() {
44966
46913
  }
44967
46914
  if (
44968
46915
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_message() !==
44969
- 56093
46916
+ 1815
44970
46917
  ) {
44971
46918
  throw new UniffiInternalError.ApiChecksumMismatch(
44972
46919
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_message'
@@ -44974,7 +46921,7 @@ function uniffiEnsureInitialized() {
44974
46921
  }
44975
46922
  if (
44976
46923
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_frost() !==
44977
- 44871
46924
+ 41995
44978
46925
  ) {
44979
46926
  throw new UniffiInternalError.ApiChecksumMismatch(
44980
46927
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_frost'
@@ -44982,7 +46929,7 @@ function uniffiEnsureInitialized() {
44982
46929
  }
44983
46930
  if (
44984
46931
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_transfer() !==
44985
- 42596
46932
+ 7663
44986
46933
  ) {
44987
46934
  throw new UniffiInternalError.ApiChecksumMismatch(
44988
46935
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_transfer'
@@ -44990,7 +46937,7 @@ function uniffiEnsureInitialized() {
44990
46937
  }
44991
46938
  if (
44992
46939
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_claim() !==
44993
- 109
46940
+ 40463
44994
46941
  ) {
44995
46942
  throw new UniffiInternalError.ApiChecksumMismatch(
44996
46943
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_claim'
@@ -44998,7 +46945,7 @@ function uniffiEnsureInitialized() {
44998
46945
  }
44999
46946
  if (
45000
46947
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_lightning_receive() !==
45001
- 49812
46948
+ 22362
45002
46949
  ) {
45003
46950
  throw new UniffiInternalError.ApiChecksumMismatch(
45004
46951
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_lightning_receive'
@@ -45006,7 +46953,7 @@ function uniffiEnsureInitialized() {
45006
46953
  }
45007
46954
  if (
45008
46955
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_static_deposit() !==
45009
- 119
46956
+ 44945
45010
46957
  ) {
45011
46958
  throw new UniffiInternalError.ApiChecksumMismatch(
45012
46959
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_static_deposit'
@@ -45014,7 +46961,7 @@ function uniffiEnsureInitialized() {
45014
46961
  }
45015
46962
  if (
45016
46963
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_start_static_deposit_refund() !==
45017
- 22509
46964
+ 15575
45018
46965
  ) {
45019
46966
  throw new UniffiInternalError.ApiChecksumMismatch(
45020
46967
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_start_static_deposit_refund'
@@ -45022,7 +46969,7 @@ function uniffiEnsureInitialized() {
45022
46969
  }
45023
46970
  if (
45024
46971
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_static_deposit_refund() !==
45025
- 28885
46972
+ 3082
45026
46973
  ) {
45027
46974
  throw new UniffiInternalError.ApiChecksumMismatch(
45028
46975
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_static_deposit_refund'
@@ -45030,7 +46977,7 @@ function uniffiEnsureInitialized() {
45030
46977
  }
45031
46978
  if (
45032
46979
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_spark_invoice() !==
45033
- 11535
46980
+ 33
45034
46981
  ) {
45035
46982
  throw new UniffiInternalError.ApiChecksumMismatch(
45036
46983
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_sign_spark_invoice'
@@ -45038,7 +46985,7 @@ function uniffiEnsureInitialized() {
45038
46985
  }
45039
46986
  if (
45040
46987
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_token_transaction() !==
45041
- 58955
46988
+ 33122
45042
46989
  ) {
45043
46990
  throw new UniffiInternalError.ApiChecksumMismatch(
45044
46991
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_token_transaction'
@@ -45046,7 +46993,7 @@ function uniffiEnsureInitialized() {
45046
46993
  }
45047
46994
  if (
45048
46995
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_static_deposit_claim() !==
45049
- 64724
46996
+ 14601
45050
46997
  ) {
45051
46998
  throw new UniffiInternalError.ApiChecksumMismatch(
45052
46999
  'uniffi_breez_sdk_spark_checksum_method_externalsparksigner_prepare_static_deposit_claim'
@@ -45078,7 +47025,7 @@ function uniffiEnsureInitialized() {
45078
47025
  }
45079
47026
  if (
45080
47027
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_passkeyclient_connect_with_passkey() !==
45081
- 47815
47028
+ 32814
45082
47029
  ) {
45083
47030
  throw new UniffiInternalError.ApiChecksumMismatch(
45084
47031
  'uniffi_breez_sdk_spark_checksum_method_passkeyclient_connect_with_passkey'
@@ -45260,6 +47207,14 @@ function uniffiEnsureInitialized() {
45260
47207
  'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_rest_chain_service'
45261
47208
  );
45262
47209
  }
47210
+ if (
47211
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_session_store() !==
47212
+ 32818
47213
+ ) {
47214
+ throw new UniffiInternalError.ApiChecksumMismatch(
47215
+ 'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_session_store'
47216
+ );
47217
+ }
45263
47218
  if (
45264
47219
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_shared_context() !==
45265
47220
  64829
@@ -45695,6 +47650,9 @@ export default Object.freeze({
45695
47650
  FfiConverterTypeBolt12OfferBlindedPath,
45696
47651
  FfiConverterTypeBolt12OfferDetails,
45697
47652
  FfiConverterTypeBreezSdk,
47653
+ FfiConverterTypeBuildTransferPackageOptions,
47654
+ FfiConverterTypeBuildUnsignedLnurlPayPackageRequest,
47655
+ FfiConverterTypeBuildUnsignedTransferPackageRequest,
45698
47656
  FfiConverterTypeBurnIssuerTokenRequest,
45699
47657
  FfiConverterTypeBuyBitcoinRequest,
45700
47658
  FfiConverterTypeBuyBitcoinResponse,
@@ -45818,6 +47776,7 @@ export default Object.freeze({
45818
47776
  FfiConverterTypeLnurlCallbackStatus,
45819
47777
  FfiConverterTypeLnurlErrorDetails,
45820
47778
  FfiConverterTypeLnurlInfo,
47779
+ FfiConverterTypeLnurlPayContext,
45821
47780
  FfiConverterTypeLnurlPayInfo,
45822
47781
  FfiConverterTypeLnurlPayRequest,
45823
47782
  FfiConverterTypeLnurlPayRequestDetails,
@@ -45870,6 +47829,10 @@ export default Object.freeze({
45870
47829
  FfiConverterTypeProvisionalPaymentDetails,
45871
47830
  FfiConverterTypePublicKey,
45872
47831
  FfiConverterTypePublicKeyBytes,
47832
+ FfiConverterTypePublishSignedLnurlPayPackageRequest,
47833
+ FfiConverterTypePublishSignedLnurlPayResponse,
47834
+ FfiConverterTypePublishSignedTransferPackageRequest,
47835
+ FfiConverterTypePublishSignedTransferPackageResponse,
45873
47836
  FfiConverterTypeRate,
45874
47837
  FfiConverterTypeReceivePaymentMethod,
45875
47838
  FfiConverterTypeReceivePaymentRequest,
@@ -45914,6 +47877,7 @@ export default Object.freeze({
45914
47877
  FfiConverterTypeSignInResponse,
45915
47878
  FfiConverterTypeSignMessageRequest,
45916
47879
  FfiConverterTypeSignMessageResponse,
47880
+ FfiConverterTypeSignedTransferPackage,
45917
47881
  FfiConverterTypeSignerError,
45918
47882
  FfiConverterTypeSigningOnlyExternalSigners,
45919
47883
  FfiConverterTypeSilentPaymentAddressDetails,
@@ -45948,12 +47912,15 @@ export default Object.freeze({
45948
47912
  FfiConverterTypeTokenOptimizationConfig,
45949
47913
  FfiConverterTypeTokenTransactionType,
45950
47914
  FfiConverterTypeTransferAuthorization,
47915
+ FfiConverterTypeTransferSignature,
47916
+ FfiConverterTypeTransferTarget,
45951
47917
  FfiConverterTypeTurnkeyConfig,
45952
47918
  FfiConverterTypeTurnkeyRetryConfig,
45953
47919
  FfiConverterTypeTxStatus,
45954
47920
  FfiConverterTypeUnfreezeIssuerTokenRequest,
45955
47921
  FfiConverterTypeUnfreezeIssuerTokenResponse,
45956
47922
  FfiConverterTypeUnregisterWebhookRequest,
47923
+ FfiConverterTypeUnsignedTransferPackage,
45957
47924
  FfiConverterTypeUnversionedRecordChange,
45958
47925
  FfiConverterTypeUpdateContactRequest,
45959
47926
  FfiConverterTypeUpdateDepositPayload,