@breeztech/breez-sdk-spark-react-native 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -248,6 +248,54 @@ export function defaultExternalSigner(
248
248
  )
249
249
  );
250
250
  }
251
+ /**
252
+ * Builds a [`Config`] suitable for multi-tenant server-mode deployments.
253
+ *
254
+ * This preset returns the same configuration as [`default_config`] with
255
+ * [`background_tasks_enabled`](Config::background_tasks_enabled) set to
256
+ * `false`. In server mode, the SDK is treated as a library: the host
257
+ * orchestrates sync, claiming, and event delivery (typically via webhooks)
258
+ * explicitly, so an ephemeral SDK instance stays cheap and predictable.
259
+ *
260
+ * Config fields whose background services are gated off are reset to their
261
+ * inactive shape: `real_time_sync_server_url` is set to `None`, and both
262
+ * `leaf_optimization_config.auto_enabled` and
263
+ * `token_optimization_config.auto_enabled` are set to `false`. The SDK
264
+ * rejects builds where `background_tasks_enabled` is `false` and any of
265
+ * those fields is left in its active shape, so flip the flag via this
266
+ * helper rather than by hand.
267
+ *
268
+ * Explicit operations (`sync_wallet`, `claim_deposit`,
269
+ * `list_unclaimed_deposits`, `refund_deposit`,
270
+ * `refund_pending_conversions`, etc.) continue to work and are the intended
271
+ * entry points in this mode.
272
+ *
273
+ * Stable Balance is not supported in this mode because its conversion worker
274
+ * is a background service.
275
+ *
276
+ * One-time setup that the SDK normally applies automatically — notably
277
+ * `private_enabled_default` — is NOT applied in this mode. Drive setup
278
+ * explicitly via `update_user_settings` (and any other relevant APIs) so
279
+ * ephemeral per-request SDK instances incur no implicit setup overhead.
280
+ *
281
+ * `get_info` reads balance directly from the spark wallet in this mode
282
+ * rather than from the background-maintained storage cache, so balance
283
+ * reflects the latest local sync and `ensure_synced=true` is rejected with
284
+ * an invalid-input error
285
+ */
286
+ export function defaultServerConfig(network: Network): Config {
287
+ return FfiConverterTypeConfig.lift(
288
+ uniffiCaller.rustCall(
289
+ /*caller:*/ (callStatus) => {
290
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_func_default_server_config(
291
+ FfiConverterTypeNetwork.lower(network),
292
+ callStatus
293
+ );
294
+ },
295
+ /*liftString:*/ FfiConverterString.lift
296
+ )
297
+ );
298
+ }
251
299
  /**
252
300
  * Fetches the current status of Spark network services relevant to the SDK.
253
301
  *
@@ -306,29 +354,6 @@ export function initLogging(
306
354
  /*liftString:*/ FfiConverterString.lift
307
355
  );
308
356
  }
309
- /**
310
- * Creates a new shareable [`ConnectionManager`].
311
- *
312
- * `connections_per_operator` controls per-operator connection pooling:
313
- * `None` keeps a single connection per operator (suitable for almost every
314
- * deployment); `Some(n)` opens `n` connections per operator and balances
315
- * requests across them.
316
- */
317
- export function newConnectionManager(
318
- connectionsPerOperator: /*u32*/ number | undefined
319
- ): ConnectionManagerInterface {
320
- return FfiConverterTypeConnectionManager.lift(
321
- uniffiCaller.rustCall(
322
- /*caller:*/ (callStatus) => {
323
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_func_new_connection_manager(
324
- FfiConverterOptionalUInt32.lower(connectionsPerOperator),
325
- callStatus
326
- );
327
- },
328
- /*liftString:*/ FfiConverterString.lift
329
- )
330
- );
331
- }
332
357
  /**
333
358
  * Constructs a shareable REST-based [`BitcoinChainService`].
334
359
  *
@@ -381,27 +406,49 @@ export async function newRestChainService(
381
406
  }
382
407
  }
383
408
  /**
384
- * Construct a new shared SSP connection manager.
409
+ * Constructs an [`SdkContext`] from a `SdkContextConfig`.
385
410
  *
386
- * Pass the returned `Arc<SspConnectionManager>` to
387
- * [`SdkBuilder::with_ssp_connection_manager`](crate::SdkBuilder::with_ssp_connection_manager)
388
- * when building each SDK instance that should share the underlying HTTP
389
- * connection pool.
390
- */
391
- export function newSspConnectionManager(
392
- userAgent: string | undefined
393
- ): SspConnectionManagerInterface {
394
- return FfiConverterTypeSspConnectionManager.lift(
395
- uniffiCaller.rustCall(
396
- /*caller:*/ (callStatus) => {
397
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_func_new_ssp_connection_manager(
398
- FfiConverterOptionalString.lower(userAgent),
399
- callStatus
411
+ * The returned `Arc` is cheap to clone and can back many SDK instances.
412
+ * `SdkContextConfig::new(network)` yields an in-memory, single-tenant setup;
413
+ * supply a DB config to back the SDKs with a shared `PostgreSQL` or `MySQL`
414
+ * pool.
415
+ */
416
+ export async function newSharedSdkContext(
417
+ config: SdkContextConfig,
418
+ asyncOpts_?: { signal: AbortSignal }
419
+ ): Promise<SdkContextInterface> /*throws*/ {
420
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
421
+ try {
422
+ return await uniffiRustCallAsync(
423
+ /*rustCaller:*/ uniffiCaller,
424
+ /*rustFutureFunc:*/ () => {
425
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_func_new_shared_sdk_context(
426
+ FfiConverterTypeSdkContextConfig.lower(config)
400
427
  );
401
428
  },
402
- /*liftString:*/ FfiConverterString.lift
403
- )
404
- );
429
+ /*pollFunc:*/ nativeModule()
430
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_pointer,
431
+ /*cancelFunc:*/ nativeModule()
432
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_pointer,
433
+ /*completeFunc:*/ nativeModule()
434
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_pointer,
435
+ /*freeFunc:*/ nativeModule()
436
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_pointer,
437
+ /*liftFunc:*/ FfiConverterTypeSdkContext.lift.bind(
438
+ FfiConverterTypeSdkContext
439
+ ),
440
+ /*liftString:*/ FfiConverterString.lift,
441
+ /*asyncOpts:*/ asyncOpts_,
442
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
443
+ FfiConverterTypeSdkError
444
+ )
445
+ );
446
+ } catch (__error: any) {
447
+ if (uniffiIsDebug && __error instanceof Error) {
448
+ __error.stack = __stack;
449
+ }
450
+ throw __error;
451
+ }
405
452
  }
406
453
 
407
454
  /**
@@ -2145,8 +2192,15 @@ export type Config = {
2145
2192
  /**
2146
2193
  * Whether the Spark private mode is enabled by default.
2147
2194
  *
2148
- * If set to true, the Spark private mode will be enabled on the first initialization of the SDK.
2149
- * If set to false, no changes will be made to the Spark private mode.
2195
+ * If set to true, the Spark private mode will be enabled on the first
2196
+ * initialization of the SDK. If set to false, no changes will be made
2197
+ * to the Spark private mode.
2198
+ *
2199
+ * This default is only auto-applied when `background_tasks_enabled` is
2200
+ * `true`. When `background_tasks_enabled` is `false`, the SDK does not
2201
+ * touch the Spark private mode on startup; call `update_user_settings`
2202
+ * with `spark_private_mode_enabled` set as needed on a one-time setup
2203
+ * pass.
2150
2204
  */
2151
2205
  privateEnabledDefault: boolean;
2152
2206
  /**
@@ -2156,7 +2210,16 @@ export type Config = {
2156
2210
  * Fewer, bigger leaves allow for more funds to be exited unilaterally.
2157
2211
  * More leaves allow payments to be made without needing a swap, reducing payment latency.
2158
2212
  */
2159
- optimizationConfig: OptimizationConfig;
2213
+ leafOptimizationConfig: LeafOptimizationConfig;
2214
+ /**
2215
+ * Configuration for token-output optimization.
2216
+ *
2217
+ * Token-output optimization controls automatic consolidation of a token's
2218
+ * available outputs. Keeping the output set small reduces transaction size,
2219
+ * while keeping enough distinct outputs preserves concurrency for parallel
2220
+ * sends.
2221
+ */
2222
+ tokenOptimizationConfig: TokenOptimizationConfig;
2160
2223
  /**
2161
2224
  * Configuration for automatic conversion of Bitcoin to stable tokens.
2162
2225
  *
@@ -2178,6 +2241,33 @@ export type Config = {
2178
2241
  * deployments (e.g. dev/staging environments).
2179
2242
  */
2180
2243
  sparkConfig: SparkConfig | undefined;
2244
+ /**
2245
+ * Master switch for per-instance background services.
2246
+ *
2247
+ * When `true` (default), the SDK runs its standard background work:
2248
+ * periodic sync, lightning-address recovery, private-mode initialization,
2249
+ * the leaf and token-output optimizers, the Spark server-event
2250
+ * subscription, and the real-time sync client (when
2251
+ * `real_time_sync_server_url` is set).
2252
+ *
2253
+ * When `false`, **no background service is started**, regardless of any
2254
+ * other setting on this config. This is intended for multi-tenant server
2255
+ * deployments where the host application orchestrates sync and claims
2256
+ * explicitly and receives events via webhooks. Use
2257
+ * `default_server_config` to get this preset.
2258
+ *
2259
+ * Explicit operations (`sync_wallet`, `claim_deposit`,
2260
+ * `list_unclaimed_deposits`, `refund_deposit`,
2261
+ * `refund_pending_conversions`, leaf/token optimization, etc.) work
2262
+ * regardless of this flag.
2263
+ *
2264
+ * When `false`, the SDK rejects builds where fields whose backing
2265
+ * service is gated off are still in their active shape:
2266
+ * `stable_balance_config` must be `None`, `real_time_sync_server_url`
2267
+ * must be `None`, and `optimization_config.auto_enabled` must be `false`.
2268
+ * `default_server_config` already sets these compatible values.
2269
+ */
2270
+ backgroundTasksEnabled: boolean;
2181
2271
  };
2182
2272
 
2183
2273
  /**
@@ -2224,11 +2314,15 @@ const FfiConverterTypeConfig = (() => {
2224
2314
  useDefaultExternalInputParsers: FfiConverterBool.read(from),
2225
2315
  realTimeSyncServerUrl: FfiConverterOptionalString.read(from),
2226
2316
  privateEnabledDefault: FfiConverterBool.read(from),
2227
- optimizationConfig: FfiConverterTypeOptimizationConfig.read(from),
2317
+ leafOptimizationConfig:
2318
+ FfiConverterTypeLeafOptimizationConfig.read(from),
2319
+ tokenOptimizationConfig:
2320
+ FfiConverterTypeTokenOptimizationConfig.read(from),
2228
2321
  stableBalanceConfig:
2229
2322
  FfiConverterOptionalTypeStableBalanceConfig.read(from),
2230
2323
  maxConcurrentClaims: FfiConverterUInt32.read(from),
2231
2324
  sparkConfig: FfiConverterOptionalTypeSparkConfig.read(from),
2325
+ backgroundTasksEnabled: FfiConverterBool.read(from),
2232
2326
  };
2233
2327
  }
2234
2328
  write(value: TypeName, into: RustBuffer): void {
@@ -2245,13 +2339,21 @@ const FfiConverterTypeConfig = (() => {
2245
2339
  FfiConverterBool.write(value.useDefaultExternalInputParsers, into);
2246
2340
  FfiConverterOptionalString.write(value.realTimeSyncServerUrl, into);
2247
2341
  FfiConverterBool.write(value.privateEnabledDefault, into);
2248
- FfiConverterTypeOptimizationConfig.write(value.optimizationConfig, into);
2342
+ FfiConverterTypeLeafOptimizationConfig.write(
2343
+ value.leafOptimizationConfig,
2344
+ into
2345
+ );
2346
+ FfiConverterTypeTokenOptimizationConfig.write(
2347
+ value.tokenOptimizationConfig,
2348
+ into
2349
+ );
2249
2350
  FfiConverterOptionalTypeStableBalanceConfig.write(
2250
2351
  value.stableBalanceConfig,
2251
2352
  into
2252
2353
  );
2253
2354
  FfiConverterUInt32.write(value.maxConcurrentClaims, into);
2254
2355
  FfiConverterOptionalTypeSparkConfig.write(value.sparkConfig, into);
2356
+ FfiConverterBool.write(value.backgroundTasksEnabled, into);
2255
2357
  }
2256
2358
  allocationSize(value: TypeName): number {
2257
2359
  return (
@@ -2269,14 +2371,18 @@ const FfiConverterTypeConfig = (() => {
2269
2371
  FfiConverterBool.allocationSize(value.useDefaultExternalInputParsers) +
2270
2372
  FfiConverterOptionalString.allocationSize(value.realTimeSyncServerUrl) +
2271
2373
  FfiConverterBool.allocationSize(value.privateEnabledDefault) +
2272
- FfiConverterTypeOptimizationConfig.allocationSize(
2273
- value.optimizationConfig
2374
+ FfiConverterTypeLeafOptimizationConfig.allocationSize(
2375
+ value.leafOptimizationConfig
2376
+ ) +
2377
+ FfiConverterTypeTokenOptimizationConfig.allocationSize(
2378
+ value.tokenOptimizationConfig
2274
2379
  ) +
2275
2380
  FfiConverterOptionalTypeStableBalanceConfig.allocationSize(
2276
2381
  value.stableBalanceConfig
2277
2382
  ) +
2278
2383
  FfiConverterUInt32.allocationSize(value.maxConcurrentClaims) +
2279
- FfiConverterOptionalTypeSparkConfig.allocationSize(value.sparkConfig)
2384
+ FfiConverterOptionalTypeSparkConfig.allocationSize(value.sparkConfig) +
2385
+ FfiConverterBool.allocationSize(value.backgroundTasksEnabled)
2280
2386
  );
2281
2387
  }
2282
2388
  }
@@ -4594,6 +4700,14 @@ const FfiConverterTypeFreezeIssuerTokenResponse = (() => {
4594
4700
  * Request to get the balance of the wallet
4595
4701
  */
4596
4702
  export type GetInfoRequest = {
4703
+ /**
4704
+ * When `Some(true)`, and `background_tasks_enabled` is `true`, the call
4705
+ * waits for the initial Full sync to complete before returning.
4706
+ *
4707
+ * When `background_tasks_enabled` is `false`, setting this to `Some(true)`
4708
+ * is rejected with an invalid-input error. There is no background sync to
4709
+ * wait on; call `sync_wallet` explicitly first if you need fresh state.
4710
+ */
4597
4711
  ensureSynced: boolean | undefined;
4598
4712
  };
4599
4713
 
@@ -5314,6 +5428,90 @@ const FfiConverterTypeKeySetConfig = (() => {
5314
5428
  return new FFIConverter();
5315
5429
  })();
5316
5430
 
5431
+ /**
5432
+ * Configuration for leaf optimization.
5433
+ */
5434
+ export type LeafOptimizationConfig = {
5435
+ /**
5436
+ * Whether automatic leaf optimization is enabled.
5437
+ *
5438
+ * If set to true, the SDK will automatically optimize the leaf set when it changes.
5439
+ * Otherwise, the manual optimization API must be used to optimize the leaf set.
5440
+ *
5441
+ * Default value is true.
5442
+ */
5443
+ autoEnabled: boolean;
5444
+ /**
5445
+ * The desired multiplicity for the leaf set.
5446
+ *
5447
+ * Setting this to 0 will optimize for maximizing unilateral exit.
5448
+ * Higher values will optimize for minimizing transfer swaps, with higher values
5449
+ * being more aggressive and allowing better TPS rates.
5450
+ *
5451
+ * For end-user wallets, values of 1-5 are recommended. Values above 5 are
5452
+ * intended for high-throughput server environments and are not recommended
5453
+ * for end-user wallets due to significantly higher unilateral exit costs.
5454
+ *
5455
+ * Default value is 1.
5456
+ */
5457
+ multiplicity: /*u8*/ number;
5458
+ };
5459
+
5460
+ /**
5461
+ * Generated factory for {@link LeafOptimizationConfig} record objects.
5462
+ */
5463
+ export const LeafOptimizationConfig = (() => {
5464
+ const defaults = () => ({});
5465
+ const create = (() => {
5466
+ return uniffiCreateRecord<
5467
+ LeafOptimizationConfig,
5468
+ ReturnType<typeof defaults>
5469
+ >(defaults);
5470
+ })();
5471
+ return Object.freeze({
5472
+ /**
5473
+ * Create a frozen instance of {@link LeafOptimizationConfig}, with defaults specified
5474
+ * in Rust, in the {@link breez_sdk_spark} crate.
5475
+ */
5476
+ create,
5477
+
5478
+ /**
5479
+ * Create a frozen instance of {@link LeafOptimizationConfig}, with defaults specified
5480
+ * in Rust, in the {@link breez_sdk_spark} crate.
5481
+ */
5482
+ new: create,
5483
+
5484
+ /**
5485
+ * Defaults specified in the {@link breez_sdk_spark} crate.
5486
+ */
5487
+ defaults: () =>
5488
+ Object.freeze(defaults()) as Partial<LeafOptimizationConfig>,
5489
+ });
5490
+ })();
5491
+
5492
+ const FfiConverterTypeLeafOptimizationConfig = (() => {
5493
+ type TypeName = LeafOptimizationConfig;
5494
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
5495
+ read(from: RustBuffer): TypeName {
5496
+ return {
5497
+ autoEnabled: FfiConverterBool.read(from),
5498
+ multiplicity: FfiConverterUInt8.read(from),
5499
+ };
5500
+ }
5501
+ write(value: TypeName, into: RustBuffer): void {
5502
+ FfiConverterBool.write(value.autoEnabled, into);
5503
+ FfiConverterUInt8.write(value.multiplicity, into);
5504
+ }
5505
+ allocationSize(value: TypeName): number {
5506
+ return (
5507
+ FfiConverterBool.allocationSize(value.autoEnabled) +
5508
+ FfiConverterUInt8.allocationSize(value.multiplicity)
5509
+ );
5510
+ }
5511
+ }
5512
+ return new FFIConverter();
5513
+ })();
5514
+
5317
5515
  export type LightningAddressDetails = {
5318
5516
  address: string;
5319
5517
  payRequest: LnurlPayRequestDetails;
@@ -7205,85 +7403,6 @@ const FfiConverterTypeNostrRelayConfig = (() => {
7205
7403
  return new FFIConverter();
7206
7404
  })();
7207
7405
 
7208
- export type OptimizationConfig = {
7209
- /**
7210
- * Whether automatic leaf optimization is enabled.
7211
- *
7212
- * If set to true, the SDK will automatically optimize the leaf set when it changes.
7213
- * Otherwise, the manual optimization API must be used to optimize the leaf set.
7214
- *
7215
- * Default value is true.
7216
- */
7217
- autoEnabled: boolean;
7218
- /**
7219
- * The desired multiplicity for the leaf set.
7220
- *
7221
- * Setting this to 0 will optimize for maximizing unilateral exit.
7222
- * Higher values will optimize for minimizing transfer swaps, with higher values
7223
- * being more aggressive and allowing better TPS rates.
7224
- *
7225
- * For end-user wallets, values of 1-5 are recommended. Values above 5 are
7226
- * intended for high-throughput server environments and are not recommended
7227
- * for end-user wallets due to significantly higher unilateral exit costs.
7228
- *
7229
- * Default value is 1.
7230
- */
7231
- multiplicity: /*u8*/ number;
7232
- };
7233
-
7234
- /**
7235
- * Generated factory for {@link OptimizationConfig} record objects.
7236
- */
7237
- export const OptimizationConfig = (() => {
7238
- const defaults = () => ({});
7239
- const create = (() => {
7240
- return uniffiCreateRecord<OptimizationConfig, ReturnType<typeof defaults>>(
7241
- defaults
7242
- );
7243
- })();
7244
- return Object.freeze({
7245
- /**
7246
- * Create a frozen instance of {@link OptimizationConfig}, with defaults specified
7247
- * in Rust, in the {@link breez_sdk_spark} crate.
7248
- */
7249
- create,
7250
-
7251
- /**
7252
- * Create a frozen instance of {@link OptimizationConfig}, with defaults specified
7253
- * in Rust, in the {@link breez_sdk_spark} crate.
7254
- */
7255
- new: create,
7256
-
7257
- /**
7258
- * Defaults specified in the {@link breez_sdk_spark} crate.
7259
- */
7260
- defaults: () => Object.freeze(defaults()) as Partial<OptimizationConfig>,
7261
- });
7262
- })();
7263
-
7264
- const FfiConverterTypeOptimizationConfig = (() => {
7265
- type TypeName = OptimizationConfig;
7266
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
7267
- read(from: RustBuffer): TypeName {
7268
- return {
7269
- autoEnabled: FfiConverterBool.read(from),
7270
- multiplicity: FfiConverterUInt8.read(from),
7271
- };
7272
- }
7273
- write(value: TypeName, into: RustBuffer): void {
7274
- FfiConverterBool.write(value.autoEnabled, into);
7275
- FfiConverterUInt8.write(value.multiplicity, into);
7276
- }
7277
- allocationSize(value: TypeName): number {
7278
- return (
7279
- FfiConverterBool.allocationSize(value.autoEnabled) +
7280
- FfiConverterUInt8.allocationSize(value.multiplicity)
7281
- );
7282
- }
7283
- }
7284
- return new FFIConverter();
7285
- })();
7286
-
7287
7406
  export type OptimizationProgress = {
7288
7407
  isRunning: boolean;
7289
7408
  currentRound: /*u32*/ number;
@@ -9140,6 +9259,91 @@ const FfiConverterTypeSchnorrSignatureBytes = (() => {
9140
9259
  return new FFIConverter();
9141
9260
  })();
9142
9261
 
9262
+ /**
9263
+ * Settings for [`new_shared_sdk_context`]. All fields are optional; the defaults
9264
+ * match the single-SDK happy path.
9265
+ */
9266
+ export type SdkContextConfig = {
9267
+ /**
9268
+ * Network the shared resources target. Defaults to [`Network::Mainnet`].
9269
+ * Used to gate the partner JWT header provider — only constructed on
9270
+ * Mainnet, since Regtest has no JWT-issuing Breez endpoint.
9271
+ */
9272
+ network: Network;
9273
+ /**
9274
+ * Breez API key. When set together with `network == Mainnet`, the
9275
+ * context constructs a shared partner JWT header provider that all
9276
+ * SDKs built from this context will attach to their SO requests.
9277
+ */
9278
+ apiKey: string | undefined;
9279
+ /**
9280
+ * Number of gRPC connections per Spark operator. `None` (or `Some(1)`)
9281
+ * keeps a single connection per operator (the right choice for most
9282
+ * deployments); `Some(n)` opens `n` channels per operator and balances
9283
+ * requests across them.
9284
+ */
9285
+ connectionsPerOperator: /*u32*/ number | undefined;
9286
+ };
9287
+
9288
+ /**
9289
+ * Generated factory for {@link SdkContextConfig} record objects.
9290
+ */
9291
+ export const SdkContextConfig = (() => {
9292
+ const defaults = () => ({
9293
+ apiKey: undefined,
9294
+ connectionsPerOperator: undefined,
9295
+ });
9296
+ const create = (() => {
9297
+ return uniffiCreateRecord<SdkContextConfig, ReturnType<typeof defaults>>(
9298
+ defaults
9299
+ );
9300
+ })();
9301
+ return Object.freeze({
9302
+ /**
9303
+ * Create a frozen instance of {@link SdkContextConfig}, with defaults specified
9304
+ * in Rust, in the {@link breez_sdk_spark} crate.
9305
+ */
9306
+ create,
9307
+
9308
+ /**
9309
+ * Create a frozen instance of {@link SdkContextConfig}, with defaults specified
9310
+ * in Rust, in the {@link breez_sdk_spark} crate.
9311
+ */
9312
+ new: create,
9313
+
9314
+ /**
9315
+ * Defaults specified in the {@link breez_sdk_spark} crate.
9316
+ */
9317
+ defaults: () => Object.freeze(defaults()) as Partial<SdkContextConfig>,
9318
+ });
9319
+ })();
9320
+
9321
+ const FfiConverterTypeSdkContextConfig = (() => {
9322
+ type TypeName = SdkContextConfig;
9323
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
9324
+ read(from: RustBuffer): TypeName {
9325
+ return {
9326
+ network: FfiConverterTypeNetwork.read(from),
9327
+ apiKey: FfiConverterOptionalString.read(from),
9328
+ connectionsPerOperator: FfiConverterOptionalUInt32.read(from),
9329
+ };
9330
+ }
9331
+ write(value: TypeName, into: RustBuffer): void {
9332
+ FfiConverterTypeNetwork.write(value.network, into);
9333
+ FfiConverterOptionalString.write(value.apiKey, into);
9334
+ FfiConverterOptionalUInt32.write(value.connectionsPerOperator, into);
9335
+ }
9336
+ allocationSize(value: TypeName): number {
9337
+ return (
9338
+ FfiConverterTypeNetwork.allocationSize(value.network) +
9339
+ FfiConverterOptionalString.allocationSize(value.apiKey) +
9340
+ FfiConverterOptionalUInt32.allocationSize(value.connectionsPerOperator)
9341
+ );
9342
+ }
9343
+ }
9344
+ return new FFIConverter();
9345
+ })();
9346
+
9143
9347
  /**
9144
9348
  * FFI-safe representation of a private key (32 bytes)
9145
9349
  */
@@ -11084,6 +11288,106 @@ const FfiConverterTypeTokenMetadata = (() => {
11084
11288
  return new FFIConverter();
11085
11289
  })();
11086
11290
 
11291
+ /**
11292
+ * Configuration for token-output optimization.
11293
+ */
11294
+ export type TokenOptimizationConfig = {
11295
+ /**
11296
+ * Whether automatic token-output consolidation is enabled.
11297
+ *
11298
+ * If set to true, the SDK will periodically consolidate a token's outputs
11299
+ * once their count exceeds [`Self::min_outputs_threshold`]. Otherwise, no
11300
+ * automatic consolidation is performed.
11301
+ *
11302
+ * Default value is true.
11303
+ */
11304
+ autoEnabled: boolean;
11305
+ /**
11306
+ * Number of token outputs to produce when token-output auto-consolidation
11307
+ * fires.
11308
+ *
11309
+ * Instead of collapsing a token's outputs into a single output (which
11310
+ * serializes subsequent payments), the SDK splits the consolidated balance
11311
+ * across this many outputs of roughly equal value. Higher values preserve
11312
+ * concurrency for parallel sends at the cost of a slightly larger output
11313
+ * set.
11314
+ *
11315
+ * Must be >= 1 and strictly less than [`Self::min_outputs_threshold`].
11316
+ *
11317
+ * Default value is 5.
11318
+ */
11319
+ targetOutputCount: /*u32*/ number;
11320
+ /**
11321
+ * Output count that triggers per-token auto-consolidation.
11322
+ *
11323
+ * Auto-consolidation triggers for a token when its available output count
11324
+ * strictly exceeds this threshold.
11325
+ *
11326
+ * Must be greater than 1.
11327
+ *
11328
+ * Default value is 50.
11329
+ */
11330
+ minOutputsThreshold: /*u32*/ number;
11331
+ };
11332
+
11333
+ /**
11334
+ * Generated factory for {@link TokenOptimizationConfig} record objects.
11335
+ */
11336
+ export const TokenOptimizationConfig = (() => {
11337
+ const defaults = () => ({});
11338
+ const create = (() => {
11339
+ return uniffiCreateRecord<
11340
+ TokenOptimizationConfig,
11341
+ ReturnType<typeof defaults>
11342
+ >(defaults);
11343
+ })();
11344
+ return Object.freeze({
11345
+ /**
11346
+ * Create a frozen instance of {@link TokenOptimizationConfig}, with defaults specified
11347
+ * in Rust, in the {@link breez_sdk_spark} crate.
11348
+ */
11349
+ create,
11350
+
11351
+ /**
11352
+ * Create a frozen instance of {@link TokenOptimizationConfig}, with defaults specified
11353
+ * in Rust, in the {@link breez_sdk_spark} crate.
11354
+ */
11355
+ new: create,
11356
+
11357
+ /**
11358
+ * Defaults specified in the {@link breez_sdk_spark} crate.
11359
+ */
11360
+ defaults: () =>
11361
+ Object.freeze(defaults()) as Partial<TokenOptimizationConfig>,
11362
+ });
11363
+ })();
11364
+
11365
+ const FfiConverterTypeTokenOptimizationConfig = (() => {
11366
+ type TypeName = TokenOptimizationConfig;
11367
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
11368
+ read(from: RustBuffer): TypeName {
11369
+ return {
11370
+ autoEnabled: FfiConverterBool.read(from),
11371
+ targetOutputCount: FfiConverterUInt32.read(from),
11372
+ minOutputsThreshold: FfiConverterUInt32.read(from),
11373
+ };
11374
+ }
11375
+ write(value: TypeName, into: RustBuffer): void {
11376
+ FfiConverterBool.write(value.autoEnabled, into);
11377
+ FfiConverterUInt32.write(value.targetOutputCount, into);
11378
+ FfiConverterUInt32.write(value.minOutputsThreshold, into);
11379
+ }
11380
+ allocationSize(value: TypeName): number {
11381
+ return (
11382
+ FfiConverterBool.allocationSize(value.autoEnabled) +
11383
+ FfiConverterUInt32.allocationSize(value.targetOutputCount) +
11384
+ FfiConverterUInt32.allocationSize(value.minOutputsThreshold)
11385
+ );
11386
+ }
11387
+ }
11388
+ return new FFIConverter();
11389
+ })();
11390
+
11087
11391
  export type TxStatus = {
11088
11392
  confirmed: boolean;
11089
11393
  blockHeight: /*u32*/ number | undefined;
@@ -23727,6 +24031,20 @@ export interface BreezSdkInterface {
23727
24031
  request: RefundDepositRequest,
23728
24032
  asyncOpts_?: { signal: AbortSignal }
23729
24033
  ): /*throws*/ Promise<RefundDepositResponse>;
24034
+ /**
24035
+ * Runs one pass of the pending-conversion refunder.
24036
+ *
24037
+ * Iterates over payments whose conversions failed and have a refund
24038
+ * pending, then attempts to refund each one. This is the same logic the
24039
+ * SDK runs internally on a periodic schedule when
24040
+ * `background_tasks_enabled` is `true`. When background tasks are
24041
+ * disabled the periodic refunder does not run, and this method is the
24042
+ * explicit entry point for driving the pass; when background tasks are
24043
+ * enabled, it can be called to force an immediate refund pass.
24044
+ */
24045
+ refundPendingConversions(asyncOpts_?: {
24046
+ signal: AbortSignal;
24047
+ }): /*throws*/ Promise<void>;
23730
24048
  registerLightningAddress(
23731
24049
  request: RegisterLightningAddressRequest,
23732
24050
  asyncOpts_?: { signal: AbortSignal }
@@ -25261,6 +25579,52 @@ export class BreezSdk
25261
25579
  }
25262
25580
  }
25263
25581
 
25582
+ /**
25583
+ * Runs one pass of the pending-conversion refunder.
25584
+ *
25585
+ * Iterates over payments whose conversions failed and have a refund
25586
+ * pending, then attempts to refund each one. This is the same logic the
25587
+ * SDK runs internally on a periodic schedule when
25588
+ * `background_tasks_enabled` is `true`. When background tasks are
25589
+ * disabled the periodic refunder does not run, and this method is the
25590
+ * explicit entry point for driving the pass; when background tasks are
25591
+ * enabled, it can be called to force an immediate refund pass.
25592
+ */
25593
+ public async refundPendingConversions(asyncOpts_?: {
25594
+ signal: AbortSignal;
25595
+ }): Promise<void> /*throws*/ {
25596
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
25597
+ try {
25598
+ return await uniffiRustCallAsync(
25599
+ /*rustCaller:*/ uniffiCaller,
25600
+ /*rustFutureFunc:*/ () => {
25601
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_refund_pending_conversions(
25602
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this)
25603
+ );
25604
+ },
25605
+ /*pollFunc:*/ nativeModule()
25606
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
25607
+ /*cancelFunc:*/ nativeModule()
25608
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
25609
+ /*completeFunc:*/ nativeModule()
25610
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
25611
+ /*freeFunc:*/ nativeModule()
25612
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
25613
+ /*liftFunc:*/ (_v) => {},
25614
+ /*liftString:*/ FfiConverterString.lift,
25615
+ /*asyncOpts:*/ asyncOpts_,
25616
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
25617
+ FfiConverterTypeSdkError
25618
+ )
25619
+ );
25620
+ } catch (__error: any) {
25621
+ if (uniffiIsDebug && __error instanceof Error) {
25622
+ __error.stack = __stack;
25623
+ }
25624
+ throw __error;
25625
+ }
25626
+ }
25627
+
25264
25628
  public async registerLightningAddress(
25265
25629
  request: RegisterLightningAddressRequest,
25266
25630
  asyncOpts_?: { signal: AbortSignal }
@@ -25788,136 +26152,6 @@ const FfiConverterTypeBreezSdk = new FfiConverterObject(
25788
26152
  uniffiTypeBreezSdkObjectFactory
25789
26153
  );
25790
26154
 
25791
- /**
25792
- * A shareable manager for gRPC connections to the Spark operators.
25793
- *
25794
- * Construct one via [`new_connection_manager`] and pass the same `Arc` to
25795
- * multiple [`SdkBuilder`](crate::SdkBuilder)s via
25796
- * [`SdkBuilder::with_connection_manager`](crate::SdkBuilder::with_connection_manager).
25797
- * Connections close when the last `Arc<ConnectionManager>` is dropped;
25798
- * [`BreezSdk::disconnect`](crate::BreezSdk::disconnect) does not affect them.
25799
- *
25800
- * All SDK instances sharing a `ConnectionManager` must be configured for the
25801
- * same network and operator pool. The TLS settings and user agent of the
25802
- * first SDK to connect to a given operator are reused for everyone afterwards.
25803
- */
25804
- export interface ConnectionManagerInterface {}
25805
-
25806
- /**
25807
- * A shareable manager for gRPC connections to the Spark operators.
25808
- *
25809
- * Construct one via [`new_connection_manager`] and pass the same `Arc` to
25810
- * multiple [`SdkBuilder`](crate::SdkBuilder)s via
25811
- * [`SdkBuilder::with_connection_manager`](crate::SdkBuilder::with_connection_manager).
25812
- * Connections close when the last `Arc<ConnectionManager>` is dropped;
25813
- * [`BreezSdk::disconnect`](crate::BreezSdk::disconnect) does not affect them.
25814
- *
25815
- * All SDK instances sharing a `ConnectionManager` must be configured for the
25816
- * same network and operator pool. The TLS settings and user agent of the
25817
- * first SDK to connect to a given operator are reused for everyone afterwards.
25818
- */
25819
- export class ConnectionManager
25820
- extends UniffiAbstractObject
25821
- implements ConnectionManagerInterface
25822
- {
25823
- readonly [uniffiTypeNameSymbol] = 'ConnectionManager';
25824
- readonly [destructorGuardSymbol]: UniffiRustArcPtr;
25825
- readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
25826
- // No primary constructor declared for this class.
25827
- private constructor(pointer: UnsafeMutableRawPointer) {
25828
- super();
25829
- this[pointerLiteralSymbol] = pointer;
25830
- this[destructorGuardSymbol] =
25831
- uniffiTypeConnectionManagerObjectFactory.bless(pointer);
25832
- }
25833
-
25834
- /**
25835
- * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
25836
- */
25837
- uniffiDestroy(): void {
25838
- const ptr = (this as any)[destructorGuardSymbol];
25839
- if (ptr !== undefined) {
25840
- const pointer = uniffiTypeConnectionManagerObjectFactory.pointer(this);
25841
- uniffiTypeConnectionManagerObjectFactory.freePointer(pointer);
25842
- uniffiTypeConnectionManagerObjectFactory.unbless(ptr);
25843
- delete (this as any)[destructorGuardSymbol];
25844
- }
25845
- }
25846
-
25847
- static instanceOf(obj: any): obj is ConnectionManager {
25848
- return uniffiTypeConnectionManagerObjectFactory.isConcreteType(obj);
25849
- }
25850
- }
25851
-
25852
- const uniffiTypeConnectionManagerObjectFactory: UniffiObjectFactory<ConnectionManagerInterface> =
25853
- (() => {
25854
- return {
25855
- create(pointer: UnsafeMutableRawPointer): ConnectionManagerInterface {
25856
- const instance = Object.create(ConnectionManager.prototype);
25857
- instance[pointerLiteralSymbol] = pointer;
25858
- instance[destructorGuardSymbol] = this.bless(pointer);
25859
- instance[uniffiTypeNameSymbol] = 'ConnectionManager';
25860
- return instance;
25861
- },
25862
-
25863
- bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr {
25864
- return uniffiCaller.rustCall(
25865
- /*caller:*/ (status) =>
25866
- nativeModule().ubrn_uniffi_internal_fn_method_connectionmanager_ffi__bless_pointer(
25867
- p,
25868
- status
25869
- ),
25870
- /*liftString:*/ FfiConverterString.lift
25871
- );
25872
- },
25873
-
25874
- unbless(ptr: UniffiRustArcPtr) {
25875
- ptr.markDestroyed();
25876
- },
25877
-
25878
- pointer(obj: ConnectionManagerInterface): UnsafeMutableRawPointer {
25879
- if ((obj as any)[destructorGuardSymbol] === undefined) {
25880
- throw new UniffiInternalError.UnexpectedNullPointer();
25881
- }
25882
- return (obj as any)[pointerLiteralSymbol];
25883
- },
25884
-
25885
- clonePointer(obj: ConnectionManagerInterface): UnsafeMutableRawPointer {
25886
- const pointer = this.pointer(obj);
25887
- return uniffiCaller.rustCall(
25888
- /*caller:*/ (callStatus) =>
25889
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_clone_connectionmanager(
25890
- pointer,
25891
- callStatus
25892
- ),
25893
- /*liftString:*/ FfiConverterString.lift
25894
- );
25895
- },
25896
-
25897
- freePointer(pointer: UnsafeMutableRawPointer): void {
25898
- uniffiCaller.rustCall(
25899
- /*caller:*/ (callStatus) =>
25900
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_free_connectionmanager(
25901
- pointer,
25902
- callStatus
25903
- ),
25904
- /*liftString:*/ FfiConverterString.lift
25905
- );
25906
- },
25907
-
25908
- isConcreteType(obj: any): obj is ConnectionManagerInterface {
25909
- return (
25910
- obj[destructorGuardSymbol] &&
25911
- obj[uniffiTypeNameSymbol] === 'ConnectionManager'
25912
- );
25913
- },
25914
- };
25915
- })();
25916
- // FfiConverter for ConnectionManagerInterface
25917
- const FfiConverterTypeConnectionManager = new FfiConverterObject(
25918
- uniffiTypeConnectionManagerObjectFactory
25919
- );
25920
-
25921
26155
  /**
25922
26156
  * External signer trait that can be implemented by users and passed to the SDK.
25923
26157
  *
@@ -30104,15 +30338,6 @@ export interface SdkBuilderInterface {
30104
30338
  chainService: BitcoinChainService,
30105
30339
  asyncOpts_?: { signal: AbortSignal }
30106
30340
  ): Promise<void>;
30107
- /**
30108
- * Sets a shared connection manager to be reused across SDK instances.
30109
- * Arguments:
30110
- * - `connection_manager`: The shared connection manager.
30111
- */
30112
- withConnectionManager(
30113
- connectionManager: ConnectionManagerInterface,
30114
- asyncOpts_?: { signal: AbortSignal }
30115
- ): Promise<void>;
30116
30341
  /**
30117
30342
  * Sets the root storage directory to initialize the default storage with.
30118
30343
  * This initializes both storage and real-time sync storage with the
@@ -30169,23 +30394,15 @@ export interface SdkBuilderInterface {
30169
30394
  asyncOpts_?: { signal: AbortSignal }
30170
30395
  ): Promise<void>;
30171
30396
  /**
30172
- * Sets a custom session manager used to persist authentication sessions.
30397
+ * Threads a shared [`SdkContext`](crate::SdkContext) into the builder.
30173
30398
  *
30174
- * Provide a shared, persistent implementation (e.g. backed by `PostgreSQL`
30175
- * or Redis) to let multiple SDK instances share authentication state and
30176
- * bootstrap quickly. If not set, an in-memory session manager is used.
30399
+ * Construct the context once via
30400
+ * [`new_shared_sdk_context`](crate::new_shared_sdk_context) and pass the
30401
+ * same `Arc` to every `SdkBuilder` whose SDKs should share its resources
30402
+ * (operator gRPC channels, SSP HTTP client, database pool).
30177
30403
  */
30178
- withSessionManager(
30179
- sessionManager: SessionManager,
30180
- asyncOpts_?: { signal: AbortSignal }
30181
- ): Promise<void>;
30182
- /**
30183
- * Sets a shared SSP connection manager to be reused across SDK instances.
30184
- * Arguments:
30185
- * - `manager`: The shared SSP connection manager.
30186
- */
30187
- withSspConnectionManager(
30188
- manager: SspConnectionManagerInterface,
30404
+ withSharedContext(
30405
+ context: SdkContextInterface,
30189
30406
  asyncOpts_?: { signal: AbortSignal }
30190
30407
  ): Promise<void>;
30191
30408
  /**
@@ -30311,45 +30528,6 @@ export class SdkBuilder
30311
30528
  }
30312
30529
  }
30313
30530
 
30314
- /**
30315
- * Sets a shared connection manager to be reused across SDK instances.
30316
- * Arguments:
30317
- * - `connection_manager`: The shared connection manager.
30318
- */
30319
- public async withConnectionManager(
30320
- connectionManager: ConnectionManagerInterface,
30321
- asyncOpts_?: { signal: AbortSignal }
30322
- ): Promise<void> {
30323
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
30324
- try {
30325
- return await uniffiRustCallAsync(
30326
- /*rustCaller:*/ uniffiCaller,
30327
- /*rustFutureFunc:*/ () => {
30328
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_connection_manager(
30329
- uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30330
- FfiConverterTypeConnectionManager.lower(connectionManager)
30331
- );
30332
- },
30333
- /*pollFunc:*/ nativeModule()
30334
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
30335
- /*cancelFunc:*/ nativeModule()
30336
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
30337
- /*completeFunc:*/ nativeModule()
30338
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
30339
- /*freeFunc:*/ nativeModule()
30340
- .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
30341
- /*liftFunc:*/ (_v) => {},
30342
- /*liftString:*/ FfiConverterString.lift,
30343
- /*asyncOpts:*/ asyncOpts_
30344
- );
30345
- } catch (__error: any) {
30346
- if (uniffiIsDebug && __error instanceof Error) {
30347
- __error.stack = __stack;
30348
- }
30349
- throw __error;
30350
- }
30351
- }
30352
-
30353
30531
  /**
30354
30532
  * Sets the root storage directory to initialize the default storage with.
30355
30533
  * This initializes both storage and real-time sync storage with the
@@ -30430,47 +30608,13 @@ export class SdkBuilder
30430
30608
  }
30431
30609
  }
30432
30610
 
30433
- /**
30434
- * Sets the key set type to be used by the SDK.
30435
- * Arguments:
30436
- * - `config`: Key set configuration containing the key set type, address index flag, and optional account number.
30437
- */
30438
- public async withKeySet(
30439
- config: KeySetConfig,
30440
- asyncOpts_?: { signal: AbortSignal }
30441
- ): Promise<void> {
30442
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
30443
- try {
30444
- return await uniffiRustCallAsync(
30445
- /*rustCaller:*/ uniffiCaller,
30446
- /*rustFutureFunc:*/ () => {
30447
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set(
30448
- uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30449
- FfiConverterTypeKeySetConfig.lower(config)
30450
- );
30451
- },
30452
- /*pollFunc:*/ nativeModule()
30453
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
30454
- /*cancelFunc:*/ nativeModule()
30455
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
30456
- /*completeFunc:*/ nativeModule()
30457
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
30458
- /*freeFunc:*/ nativeModule()
30459
- .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
30460
- /*liftFunc:*/ (_v) => {},
30461
- /*liftString:*/ FfiConverterString.lift,
30462
- /*asyncOpts:*/ asyncOpts_
30463
- );
30464
- } catch (__error: any) {
30465
- if (uniffiIsDebug && __error instanceof Error) {
30466
- __error.stack = __stack;
30467
- }
30468
- throw __error;
30469
- }
30470
- }
30471
-
30472
- public async withLnurlClient(
30473
- lnurlClient: RestClient,
30611
+ /**
30612
+ * Sets the key set type to be used by the SDK.
30613
+ * Arguments:
30614
+ * - `config`: Key set configuration containing the key set type, address index flag, and optional account number.
30615
+ */
30616
+ public async withKeySet(
30617
+ config: KeySetConfig,
30474
30618
  asyncOpts_?: { signal: AbortSignal }
30475
30619
  ): Promise<void> {
30476
30620
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -30478,9 +30622,9 @@ export class SdkBuilder
30478
30622
  return await uniffiRustCallAsync(
30479
30623
  /*rustCaller:*/ uniffiCaller,
30480
30624
  /*rustFutureFunc:*/ () => {
30481
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_lnurl_client(
30625
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set(
30482
30626
  uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30483
- FfiConverterTypeRestClient.lower(lnurlClient)
30627
+ FfiConverterTypeKeySetConfig.lower(config)
30484
30628
  );
30485
30629
  },
30486
30630
  /*pollFunc:*/ nativeModule()
@@ -30503,13 +30647,8 @@ export class SdkBuilder
30503
30647
  }
30504
30648
  }
30505
30649
 
30506
- /**
30507
- * Sets the payment observer to be used by the SDK.
30508
- * Arguments:
30509
- * - `payment_observer`: The payment observer to be used.
30510
- */
30511
- public async withPaymentObserver(
30512
- paymentObserver: PaymentObserver,
30650
+ public async withLnurlClient(
30651
+ lnurlClient: RestClient,
30513
30652
  asyncOpts_?: { signal: AbortSignal }
30514
30653
  ): Promise<void> {
30515
30654
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -30517,9 +30656,9 @@ export class SdkBuilder
30517
30656
  return await uniffiRustCallAsync(
30518
30657
  /*rustCaller:*/ uniffiCaller,
30519
30658
  /*rustFutureFunc:*/ () => {
30520
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_payment_observer(
30659
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_lnurl_client(
30521
30660
  uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30522
- FfiConverterTypePaymentObserver.lower(paymentObserver)
30661
+ FfiConverterTypeRestClient.lower(lnurlClient)
30523
30662
  );
30524
30663
  },
30525
30664
  /*pollFunc:*/ nativeModule()
@@ -30543,16 +30682,12 @@ export class SdkBuilder
30543
30682
  }
30544
30683
 
30545
30684
  /**
30546
- * Sets the REST chain service to be used by the SDK.
30685
+ * Sets the payment observer to be used by the SDK.
30547
30686
  * Arguments:
30548
- * - `url`: The base URL of the REST API.
30549
- * - `api_type`: The API type to be used.
30550
- * - `credentials`: Optional credentials for basic authentication.
30687
+ * - `payment_observer`: The payment observer to be used.
30551
30688
  */
30552
- public async withRestChainService(
30553
- url: string,
30554
- apiType: ChainApiType,
30555
- credentials: Credentials | undefined,
30689
+ public async withPaymentObserver(
30690
+ paymentObserver: PaymentObserver,
30556
30691
  asyncOpts_?: { signal: AbortSignal }
30557
30692
  ): Promise<void> {
30558
30693
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -30560,11 +30695,9 @@ export class SdkBuilder
30560
30695
  return await uniffiRustCallAsync(
30561
30696
  /*rustCaller:*/ uniffiCaller,
30562
30697
  /*rustFutureFunc:*/ () => {
30563
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_rest_chain_service(
30698
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_payment_observer(
30564
30699
  uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30565
- FfiConverterString.lower(url),
30566
- FfiConverterTypeChainApiType.lower(apiType),
30567
- FfiConverterOptionalTypeCredentials.lower(credentials)
30700
+ FfiConverterTypePaymentObserver.lower(paymentObserver)
30568
30701
  );
30569
30702
  },
30570
30703
  /*pollFunc:*/ nativeModule()
@@ -30588,14 +30721,16 @@ export class SdkBuilder
30588
30721
  }
30589
30722
 
30590
30723
  /**
30591
- * Sets a custom session manager used to persist authentication sessions.
30592
- *
30593
- * Provide a shared, persistent implementation (e.g. backed by `PostgreSQL`
30594
- * or Redis) to let multiple SDK instances share authentication state and
30595
- * bootstrap quickly. If not set, an in-memory session manager is used.
30724
+ * Sets the REST chain service to be used by the SDK.
30725
+ * Arguments:
30726
+ * - `url`: The base URL of the REST API.
30727
+ * - `api_type`: The API type to be used.
30728
+ * - `credentials`: Optional credentials for basic authentication.
30596
30729
  */
30597
- public async withSessionManager(
30598
- sessionManager: SessionManager,
30730
+ public async withRestChainService(
30731
+ url: string,
30732
+ apiType: ChainApiType,
30733
+ credentials: Credentials | undefined,
30599
30734
  asyncOpts_?: { signal: AbortSignal }
30600
30735
  ): Promise<void> {
30601
30736
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -30603,9 +30738,11 @@ export class SdkBuilder
30603
30738
  return await uniffiRustCallAsync(
30604
30739
  /*rustCaller:*/ uniffiCaller,
30605
30740
  /*rustFutureFunc:*/ () => {
30606
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_session_manager(
30741
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_rest_chain_service(
30607
30742
  uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30608
- FfiConverterTypeSessionManager.lower(sessionManager)
30743
+ FfiConverterString.lower(url),
30744
+ FfiConverterTypeChainApiType.lower(apiType),
30745
+ FfiConverterOptionalTypeCredentials.lower(credentials)
30609
30746
  );
30610
30747
  },
30611
30748
  /*pollFunc:*/ nativeModule()
@@ -30629,12 +30766,15 @@ export class SdkBuilder
30629
30766
  }
30630
30767
 
30631
30768
  /**
30632
- * Sets a shared SSP connection manager to be reused across SDK instances.
30633
- * Arguments:
30634
- * - `manager`: The shared SSP connection manager.
30769
+ * Threads a shared [`SdkContext`](crate::SdkContext) into the builder.
30770
+ *
30771
+ * Construct the context once via
30772
+ * [`new_shared_sdk_context`](crate::new_shared_sdk_context) and pass the
30773
+ * same `Arc` to every `SdkBuilder` whose SDKs should share its resources
30774
+ * (operator gRPC channels, SSP HTTP client, database pool).
30635
30775
  */
30636
- public async withSspConnectionManager(
30637
- manager: SspConnectionManagerInterface,
30776
+ public async withSharedContext(
30777
+ context: SdkContextInterface,
30638
30778
  asyncOpts_?: { signal: AbortSignal }
30639
30779
  ): Promise<void> {
30640
30780
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -30642,9 +30782,9 @@ export class SdkBuilder
30642
30782
  return await uniffiRustCallAsync(
30643
30783
  /*rustCaller:*/ uniffiCaller,
30644
30784
  /*rustFutureFunc:*/ () => {
30645
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_ssp_connection_manager(
30785
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_shared_context(
30646
30786
  uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30647
- FfiConverterTypeSspConnectionManager.lower(manager)
30787
+ FfiConverterTypeSdkContext.lower(context)
30648
30788
  );
30649
30789
  },
30650
30790
  /*pollFunc:*/ nativeModule()
@@ -30793,6 +30933,140 @@ const FfiConverterTypeSdkBuilder = new FfiConverterObject(
30793
30933
  uniffiTypeSdkBuilderObjectFactory
30794
30934
  );
30795
30935
 
30936
+ /**
30937
+ * Process-shared resources that can back many `BreezSdk` instances.
30938
+ *
30939
+ * Construct one with [`new_shared_sdk_context`] and pass the same `Arc` to every
30940
+ * [`SdkBuilder`](crate::SdkBuilder) whose SDKs should share those resources
30941
+ * (a single HTTP client across SSP / chain / LNURL / JWT / etc., a gRPC
30942
+ * channel pool to the Spark operators, the Breez backend gRPC client, a
30943
+ * database connection pool, …). Useful for multi-tenant servers that load
30944
+ * many wallets in one process.
30945
+ *
30946
+ * The struct is intentionally opaque — all fields are crate-private. There
30947
+ * is no way to inject pre-built sub-components: the factory builds them
30948
+ * from settings so callers don't need to know about session managers,
30949
+ * connection-manager wiring, or pool plumbing.
30950
+ */
30951
+ export interface SdkContextInterface {}
30952
+
30953
+ /**
30954
+ * Process-shared resources that can back many `BreezSdk` instances.
30955
+ *
30956
+ * Construct one with [`new_shared_sdk_context`] and pass the same `Arc` to every
30957
+ * [`SdkBuilder`](crate::SdkBuilder) whose SDKs should share those resources
30958
+ * (a single HTTP client across SSP / chain / LNURL / JWT / etc., a gRPC
30959
+ * channel pool to the Spark operators, the Breez backend gRPC client, a
30960
+ * database connection pool, …). Useful for multi-tenant servers that load
30961
+ * many wallets in one process.
30962
+ *
30963
+ * The struct is intentionally opaque — all fields are crate-private. There
30964
+ * is no way to inject pre-built sub-components: the factory builds them
30965
+ * from settings so callers don't need to know about session managers,
30966
+ * connection-manager wiring, or pool plumbing.
30967
+ */
30968
+ export class SdkContext
30969
+ extends UniffiAbstractObject
30970
+ implements SdkContextInterface
30971
+ {
30972
+ readonly [uniffiTypeNameSymbol] = 'SdkContext';
30973
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
30974
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
30975
+ // No primary constructor declared for this class.
30976
+ private constructor(pointer: UnsafeMutableRawPointer) {
30977
+ super();
30978
+ this[pointerLiteralSymbol] = pointer;
30979
+ this[destructorGuardSymbol] =
30980
+ uniffiTypeSdkContextObjectFactory.bless(pointer);
30981
+ }
30982
+
30983
+ /**
30984
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
30985
+ */
30986
+ uniffiDestroy(): void {
30987
+ const ptr = (this as any)[destructorGuardSymbol];
30988
+ if (ptr !== undefined) {
30989
+ const pointer = uniffiTypeSdkContextObjectFactory.pointer(this);
30990
+ uniffiTypeSdkContextObjectFactory.freePointer(pointer);
30991
+ uniffiTypeSdkContextObjectFactory.unbless(ptr);
30992
+ delete (this as any)[destructorGuardSymbol];
30993
+ }
30994
+ }
30995
+
30996
+ static instanceOf(obj: any): obj is SdkContext {
30997
+ return uniffiTypeSdkContextObjectFactory.isConcreteType(obj);
30998
+ }
30999
+ }
31000
+
31001
+ const uniffiTypeSdkContextObjectFactory: UniffiObjectFactory<SdkContextInterface> =
31002
+ (() => {
31003
+ return {
31004
+ create(pointer: UnsafeMutableRawPointer): SdkContextInterface {
31005
+ const instance = Object.create(SdkContext.prototype);
31006
+ instance[pointerLiteralSymbol] = pointer;
31007
+ instance[destructorGuardSymbol] = this.bless(pointer);
31008
+ instance[uniffiTypeNameSymbol] = 'SdkContext';
31009
+ return instance;
31010
+ },
31011
+
31012
+ bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr {
31013
+ return uniffiCaller.rustCall(
31014
+ /*caller:*/ (status) =>
31015
+ nativeModule().ubrn_uniffi_internal_fn_method_sdkcontext_ffi__bless_pointer(
31016
+ p,
31017
+ status
31018
+ ),
31019
+ /*liftString:*/ FfiConverterString.lift
31020
+ );
31021
+ },
31022
+
31023
+ unbless(ptr: UniffiRustArcPtr) {
31024
+ ptr.markDestroyed();
31025
+ },
31026
+
31027
+ pointer(obj: SdkContextInterface): UnsafeMutableRawPointer {
31028
+ if ((obj as any)[destructorGuardSymbol] === undefined) {
31029
+ throw new UniffiInternalError.UnexpectedNullPointer();
31030
+ }
31031
+ return (obj as any)[pointerLiteralSymbol];
31032
+ },
31033
+
31034
+ clonePointer(obj: SdkContextInterface): UnsafeMutableRawPointer {
31035
+ const pointer = this.pointer(obj);
31036
+ return uniffiCaller.rustCall(
31037
+ /*caller:*/ (callStatus) =>
31038
+ nativeModule().ubrn_uniffi_breez_sdk_spark_fn_clone_sdkcontext(
31039
+ pointer,
31040
+ callStatus
31041
+ ),
31042
+ /*liftString:*/ FfiConverterString.lift
31043
+ );
31044
+ },
31045
+
31046
+ freePointer(pointer: UnsafeMutableRawPointer): void {
31047
+ uniffiCaller.rustCall(
31048
+ /*caller:*/ (callStatus) =>
31049
+ nativeModule().ubrn_uniffi_breez_sdk_spark_fn_free_sdkcontext(
31050
+ pointer,
31051
+ callStatus
31052
+ ),
31053
+ /*liftString:*/ FfiConverterString.lift
31054
+ );
31055
+ },
31056
+
31057
+ isConcreteType(obj: any): obj is SdkContextInterface {
31058
+ return (
31059
+ obj[destructorGuardSymbol] &&
31060
+ obj[uniffiTypeNameSymbol] === 'SdkContext'
31061
+ );
31062
+ },
31063
+ };
31064
+ })();
31065
+ // FfiConverter for SdkContextInterface
31066
+ const FfiConverterTypeSdkContext = new FfiConverterObject(
31067
+ uniffiTypeSdkContextObjectFactory
31068
+ );
31069
+
30796
31070
  /**
30797
31071
  * Persistent storage for authentication sessions, keyed by the service's
30798
31072
  * identity public key. Implementations should be thread-safe and may be
@@ -31111,146 +31385,6 @@ const uniffiCallbackInterfaceSessionManager: {
31111
31385
  },
31112
31386
  };
31113
31387
 
31114
- /**
31115
- * A shared HTTP transport for SSP GraphQL traffic.
31116
- *
31117
- * All SDK instances that are built with the same `SspConnectionManager` send
31118
- * SSP requests over the same pooled `reqwest::Client`. This means each
31119
- * process opens at most one TCP+TLS+HTTP/2 connection to the SSP regardless
31120
- * of how many wallets are loaded — useful for multi-tenant servers running
31121
- * many SDK instances.
31122
- *
31123
- * # Caveats
31124
- *
31125
- * - The user-agent of the first SDK to construct this manager is reused for
31126
- * all subsequent instances. This is rarely a problem since SDK instances
31127
- * in one process typically share a build version.
31128
- * - Connections close when the last `Arc<SspConnectionManager>` is dropped.
31129
- * `BreezSdk::disconnect` does not close them.
31130
- */
31131
- export interface SspConnectionManagerInterface {}
31132
-
31133
- /**
31134
- * A shared HTTP transport for SSP GraphQL traffic.
31135
- *
31136
- * All SDK instances that are built with the same `SspConnectionManager` send
31137
- * SSP requests over the same pooled `reqwest::Client`. This means each
31138
- * process opens at most one TCP+TLS+HTTP/2 connection to the SSP regardless
31139
- * of how many wallets are loaded — useful for multi-tenant servers running
31140
- * many SDK instances.
31141
- *
31142
- * # Caveats
31143
- *
31144
- * - The user-agent of the first SDK to construct this manager is reused for
31145
- * all subsequent instances. This is rarely a problem since SDK instances
31146
- * in one process typically share a build version.
31147
- * - Connections close when the last `Arc<SspConnectionManager>` is dropped.
31148
- * `BreezSdk::disconnect` does not close them.
31149
- */
31150
- export class SspConnectionManager
31151
- extends UniffiAbstractObject
31152
- implements SspConnectionManagerInterface
31153
- {
31154
- readonly [uniffiTypeNameSymbol] = 'SspConnectionManager';
31155
- readonly [destructorGuardSymbol]: UniffiRustArcPtr;
31156
- readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
31157
- // No primary constructor declared for this class.
31158
- private constructor(pointer: UnsafeMutableRawPointer) {
31159
- super();
31160
- this[pointerLiteralSymbol] = pointer;
31161
- this[destructorGuardSymbol] =
31162
- uniffiTypeSspConnectionManagerObjectFactory.bless(pointer);
31163
- }
31164
-
31165
- /**
31166
- * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
31167
- */
31168
- uniffiDestroy(): void {
31169
- const ptr = (this as any)[destructorGuardSymbol];
31170
- if (ptr !== undefined) {
31171
- const pointer = uniffiTypeSspConnectionManagerObjectFactory.pointer(this);
31172
- uniffiTypeSspConnectionManagerObjectFactory.freePointer(pointer);
31173
- uniffiTypeSspConnectionManagerObjectFactory.unbless(ptr);
31174
- delete (this as any)[destructorGuardSymbol];
31175
- }
31176
- }
31177
-
31178
- static instanceOf(obj: any): obj is SspConnectionManager {
31179
- return uniffiTypeSspConnectionManagerObjectFactory.isConcreteType(obj);
31180
- }
31181
- }
31182
-
31183
- const uniffiTypeSspConnectionManagerObjectFactory: UniffiObjectFactory<SspConnectionManagerInterface> =
31184
- (() => {
31185
- return {
31186
- create(pointer: UnsafeMutableRawPointer): SspConnectionManagerInterface {
31187
- const instance = Object.create(SspConnectionManager.prototype);
31188
- instance[pointerLiteralSymbol] = pointer;
31189
- instance[destructorGuardSymbol] = this.bless(pointer);
31190
- instance[uniffiTypeNameSymbol] = 'SspConnectionManager';
31191
- return instance;
31192
- },
31193
-
31194
- bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr {
31195
- return uniffiCaller.rustCall(
31196
- /*caller:*/ (status) =>
31197
- nativeModule().ubrn_uniffi_internal_fn_method_sspconnectionmanager_ffi__bless_pointer(
31198
- p,
31199
- status
31200
- ),
31201
- /*liftString:*/ FfiConverterString.lift
31202
- );
31203
- },
31204
-
31205
- unbless(ptr: UniffiRustArcPtr) {
31206
- ptr.markDestroyed();
31207
- },
31208
-
31209
- pointer(obj: SspConnectionManagerInterface): UnsafeMutableRawPointer {
31210
- if ((obj as any)[destructorGuardSymbol] === undefined) {
31211
- throw new UniffiInternalError.UnexpectedNullPointer();
31212
- }
31213
- return (obj as any)[pointerLiteralSymbol];
31214
- },
31215
-
31216
- clonePointer(
31217
- obj: SspConnectionManagerInterface
31218
- ): UnsafeMutableRawPointer {
31219
- const pointer = this.pointer(obj);
31220
- return uniffiCaller.rustCall(
31221
- /*caller:*/ (callStatus) =>
31222
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_clone_sspconnectionmanager(
31223
- pointer,
31224
- callStatus
31225
- ),
31226
- /*liftString:*/ FfiConverterString.lift
31227
- );
31228
- },
31229
-
31230
- freePointer(pointer: UnsafeMutableRawPointer): void {
31231
- uniffiCaller.rustCall(
31232
- /*caller:*/ (callStatus) =>
31233
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_free_sspconnectionmanager(
31234
- pointer,
31235
- callStatus
31236
- ),
31237
- /*liftString:*/ FfiConverterString.lift
31238
- );
31239
- },
31240
-
31241
- isConcreteType(obj: any): obj is SspConnectionManagerInterface {
31242
- return (
31243
- obj[destructorGuardSymbol] &&
31244
- obj[uniffiTypeNameSymbol] === 'SspConnectionManager'
31245
- );
31246
- },
31247
- };
31248
- })();
31249
- // FfiConverter for SspConnectionManagerInterface
31250
- const FfiConverterTypeSspConnectionManager = new FfiConverterObject(
31251
- uniffiTypeSspConnectionManagerObjectFactory
31252
- );
31253
-
31254
31388
  /**
31255
31389
  * Trait for persistent storage
31256
31390
  */
@@ -35090,6 +35224,14 @@ function uniffiEnsureInitialized() {
35090
35224
  'uniffi_breez_sdk_spark_checksum_func_default_external_signer'
35091
35225
  );
35092
35226
  }
35227
+ if (
35228
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_default_server_config() !==
35229
+ 33858
35230
+ ) {
35231
+ throw new UniffiInternalError.ApiChecksumMismatch(
35232
+ 'uniffi_breez_sdk_spark_checksum_func_default_server_config'
35233
+ );
35234
+ }
35093
35235
  if (
35094
35236
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_get_spark_status() !==
35095
35237
  62888
@@ -35106,14 +35248,6 @@ function uniffiEnsureInitialized() {
35106
35248
  'uniffi_breez_sdk_spark_checksum_func_init_logging'
35107
35249
  );
35108
35250
  }
35109
- if (
35110
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_new_connection_manager() !==
35111
- 25164
35112
- ) {
35113
- throw new UniffiInternalError.ApiChecksumMismatch(
35114
- 'uniffi_breez_sdk_spark_checksum_func_new_connection_manager'
35115
- );
35116
- }
35117
35251
  if (
35118
35252
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_new_rest_chain_service() !==
35119
35253
  23177
@@ -35123,11 +35257,11 @@ function uniffiEnsureInitialized() {
35123
35257
  );
35124
35258
  }
35125
35259
  if (
35126
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_new_ssp_connection_manager() !==
35127
- 15222
35260
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_new_shared_sdk_context() !==
35261
+ 28438
35128
35262
  ) {
35129
35263
  throw new UniffiInternalError.ApiChecksumMismatch(
35130
- 'uniffi_breez_sdk_spark_checksum_func_new_ssp_connection_manager'
35264
+ 'uniffi_breez_sdk_spark_checksum_func_new_shared_sdk_context'
35131
35265
  );
35132
35266
  }
35133
35267
  if (
@@ -35442,6 +35576,14 @@ function uniffiEnsureInitialized() {
35442
35576
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_deposit'
35443
35577
  );
35444
35578
  }
35579
+ if (
35580
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_pending_conversions() !==
35581
+ 24173
35582
+ ) {
35583
+ throw new UniffiInternalError.ApiChecksumMismatch(
35584
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_pending_conversions'
35585
+ );
35586
+ }
35445
35587
  if (
35446
35588
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_register_lightning_address() !==
35447
35589
  530
@@ -35794,14 +35936,6 @@ function uniffiEnsureInitialized() {
35794
35936
  'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service'
35795
35937
  );
35796
35938
  }
35797
- if (
35798
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_connection_manager() !==
35799
- 51797
35800
- ) {
35801
- throw new UniffiInternalError.ApiChecksumMismatch(
35802
- 'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_connection_manager'
35803
- );
35804
- }
35805
35939
  if (
35806
35940
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_default_storage() !==
35807
35941
  14543
@@ -35851,19 +35985,11 @@ function uniffiEnsureInitialized() {
35851
35985
  );
35852
35986
  }
35853
35987
  if (
35854
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_session_manager() !==
35855
- 64189
35856
- ) {
35857
- throw new UniffiInternalError.ApiChecksumMismatch(
35858
- 'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_session_manager'
35859
- );
35860
- }
35861
- if (
35862
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_ssp_connection_manager() !==
35863
- 65505
35988
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_shared_context() !==
35989
+ 64829
35864
35990
  ) {
35865
35991
  throw new UniffiInternalError.ApiChecksumMismatch(
35866
- 'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_ssp_connection_manager'
35992
+ 'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_shared_context'
35867
35993
  );
35868
35994
  }
35869
35995
  if (
@@ -36248,7 +36374,6 @@ export default Object.freeze({
36248
36374
  FfiConverterTypeConfig,
36249
36375
  FfiConverterTypeConnectRequest,
36250
36376
  FfiConverterTypeConnectWithSignerRequest,
36251
- FfiConverterTypeConnectionManager,
36252
36377
  FfiConverterTypeContact,
36253
36378
  FfiConverterTypeConversionDetails,
36254
36379
  FfiConverterTypeConversionEstimate,
@@ -36302,6 +36427,7 @@ export default Object.freeze({
36302
36427
  FfiConverterTypeInputType,
36303
36428
  FfiConverterTypeKeySetConfig,
36304
36429
  FfiConverterTypeKeySetType,
36430
+ FfiConverterTypeLeafOptimizationConfig,
36305
36431
  FfiConverterTypeLightningAddressDetails,
36306
36432
  FfiConverterTypeLightningAddressInfo,
36307
36433
  FfiConverterTypeListContactsRequest,
@@ -36334,7 +36460,6 @@ export default Object.freeze({
36334
36460
  FfiConverterTypeNetwork,
36335
36461
  FfiConverterTypeNostrRelayConfig,
36336
36462
  FfiConverterTypeOnchainConfirmationSpeed,
36337
- FfiConverterTypeOptimizationConfig,
36338
36463
  FfiConverterTypeOptimizationEvent,
36339
36464
  FfiConverterTypeOptimizationProgress,
36340
36465
  FfiConverterTypeOutgoingChange,
@@ -36378,6 +36503,8 @@ export default Object.freeze({
36378
36503
  FfiConverterTypeRestResponse,
36379
36504
  FfiConverterTypeSchnorrSignatureBytes,
36380
36505
  FfiConverterTypeSdkBuilder,
36506
+ FfiConverterTypeSdkContext,
36507
+ FfiConverterTypeSdkContextConfig,
36381
36508
  FfiConverterTypeSdkError,
36382
36509
  FfiConverterTypeSdkEvent,
36383
36510
  FfiConverterTypeSecretBytes,
@@ -36408,7 +36535,6 @@ export default Object.freeze({
36408
36535
  FfiConverterTypeSparkSigningOperator,
36409
36536
  FfiConverterTypeSparkSspConfig,
36410
36537
  FfiConverterTypeSparkStatus,
36411
- FfiConverterTypeSspConnectionManager,
36412
36538
  FfiConverterTypeStableBalanceActiveLabel,
36413
36539
  FfiConverterTypeStableBalanceConfig,
36414
36540
  FfiConverterTypeStableBalanceToken,
@@ -36424,6 +36550,7 @@ export default Object.freeze({
36424
36550
  FfiConverterTypeTokenBalance,
36425
36551
  FfiConverterTypeTokenIssuer,
36426
36552
  FfiConverterTypeTokenMetadata,
36553
+ FfiConverterTypeTokenOptimizationConfig,
36427
36554
  FfiConverterTypeTokenTransactionType,
36428
36555
  FfiConverterTypeTxStatus,
36429
36556
  FfiConverterTypeUnfreezeIssuerTokenRequest,