@breeztech/breez-sdk-spark-react-native 0.13.12-dev1 → 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
  *
@@ -340,49 +365,90 @@ export function newConnectionManager(
340
365
  * For one-off, non-shared use, prefer
341
366
  * [`SdkBuilder::with_rest_chain_service`](crate::SdkBuilder::with_rest_chain_service).
342
367
  */
343
- export function newRestChainService(
368
+ export async function newRestChainService(
344
369
  url: string,
345
370
  network: Network,
346
371
  apiType: ChainApiType,
347
- credentials: Credentials | undefined
348
- ): BitcoinChainService {
349
- return FfiConverterTypeBitcoinChainService.lift(
350
- uniffiCaller.rustCall(
351
- /*caller:*/ (callStatus) => {
372
+ credentials: Credentials | undefined,
373
+ asyncOpts_?: { signal: AbortSignal }
374
+ ): Promise<BitcoinChainService> {
375
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
376
+ try {
377
+ return await uniffiRustCallAsync(
378
+ /*rustCaller:*/ uniffiCaller,
379
+ /*rustFutureFunc:*/ () => {
352
380
  return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_func_new_rest_chain_service(
353
381
  FfiConverterString.lower(url),
354
382
  FfiConverterTypeNetwork.lower(network),
355
383
  FfiConverterTypeChainApiType.lower(apiType),
356
- FfiConverterOptionalTypeCredentials.lower(credentials),
357
- callStatus
384
+ FfiConverterOptionalTypeCredentials.lower(credentials)
358
385
  );
359
386
  },
360
- /*liftString:*/ FfiConverterString.lift
361
- )
362
- );
387
+ /*pollFunc:*/ nativeModule()
388
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_pointer,
389
+ /*cancelFunc:*/ nativeModule()
390
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_pointer,
391
+ /*completeFunc:*/ nativeModule()
392
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_pointer,
393
+ /*freeFunc:*/ nativeModule()
394
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_pointer,
395
+ /*liftFunc:*/ FfiConverterTypeBitcoinChainService.lift.bind(
396
+ FfiConverterTypeBitcoinChainService
397
+ ),
398
+ /*liftString:*/ FfiConverterString.lift,
399
+ /*asyncOpts:*/ asyncOpts_
400
+ );
401
+ } catch (__error: any) {
402
+ if (uniffiIsDebug && __error instanceof Error) {
403
+ __error.stack = __stack;
404
+ }
405
+ throw __error;
406
+ }
363
407
  }
364
408
  /**
365
- * Construct a new shared SSP connection manager.
409
+ * Constructs an [`SdkContext`] from a `SdkContextConfig`.
366
410
  *
367
- * Pass the returned `Arc<SspConnectionManager>` to
368
- * [`SdkBuilder::with_ssp_connection_manager`](crate::SdkBuilder::with_ssp_connection_manager)
369
- * when building each SDK instance that should share the underlying HTTP
370
- * connection pool.
371
- */
372
- export function newSspConnectionManager(
373
- userAgent: string | undefined
374
- ): SspConnectionManagerInterface {
375
- return FfiConverterTypeSspConnectionManager.lift(
376
- uniffiCaller.rustCall(
377
- /*caller:*/ (callStatus) => {
378
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_func_new_ssp_connection_manager(
379
- FfiConverterOptionalString.lower(userAgent),
380
- 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)
381
427
  );
382
428
  },
383
- /*liftString:*/ FfiConverterString.lift
384
- )
385
- );
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
+ }
386
452
  }
387
453
 
388
454
  /**
@@ -2126,8 +2192,15 @@ export type Config = {
2126
2192
  /**
2127
2193
  * Whether the Spark private mode is enabled by default.
2128
2194
  *
2129
- * If set to true, the Spark private mode will be enabled on the first initialization of the SDK.
2130
- * 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.
2131
2204
  */
2132
2205
  privateEnabledDefault: boolean;
2133
2206
  /**
@@ -2137,7 +2210,16 @@ export type Config = {
2137
2210
  * Fewer, bigger leaves allow for more funds to be exited unilaterally.
2138
2211
  * More leaves allow payments to be made without needing a swap, reducing payment latency.
2139
2212
  */
2140
- 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;
2141
2223
  /**
2142
2224
  * Configuration for automatic conversion of Bitcoin to stable tokens.
2143
2225
  *
@@ -2159,6 +2241,33 @@ export type Config = {
2159
2241
  * deployments (e.g. dev/staging environments).
2160
2242
  */
2161
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;
2162
2271
  };
2163
2272
 
2164
2273
  /**
@@ -2205,11 +2314,15 @@ const FfiConverterTypeConfig = (() => {
2205
2314
  useDefaultExternalInputParsers: FfiConverterBool.read(from),
2206
2315
  realTimeSyncServerUrl: FfiConverterOptionalString.read(from),
2207
2316
  privateEnabledDefault: FfiConverterBool.read(from),
2208
- optimizationConfig: FfiConverterTypeOptimizationConfig.read(from),
2317
+ leafOptimizationConfig:
2318
+ FfiConverterTypeLeafOptimizationConfig.read(from),
2319
+ tokenOptimizationConfig:
2320
+ FfiConverterTypeTokenOptimizationConfig.read(from),
2209
2321
  stableBalanceConfig:
2210
2322
  FfiConverterOptionalTypeStableBalanceConfig.read(from),
2211
2323
  maxConcurrentClaims: FfiConverterUInt32.read(from),
2212
2324
  sparkConfig: FfiConverterOptionalTypeSparkConfig.read(from),
2325
+ backgroundTasksEnabled: FfiConverterBool.read(from),
2213
2326
  };
2214
2327
  }
2215
2328
  write(value: TypeName, into: RustBuffer): void {
@@ -2226,13 +2339,21 @@ const FfiConverterTypeConfig = (() => {
2226
2339
  FfiConverterBool.write(value.useDefaultExternalInputParsers, into);
2227
2340
  FfiConverterOptionalString.write(value.realTimeSyncServerUrl, into);
2228
2341
  FfiConverterBool.write(value.privateEnabledDefault, into);
2229
- FfiConverterTypeOptimizationConfig.write(value.optimizationConfig, into);
2342
+ FfiConverterTypeLeafOptimizationConfig.write(
2343
+ value.leafOptimizationConfig,
2344
+ into
2345
+ );
2346
+ FfiConverterTypeTokenOptimizationConfig.write(
2347
+ value.tokenOptimizationConfig,
2348
+ into
2349
+ );
2230
2350
  FfiConverterOptionalTypeStableBalanceConfig.write(
2231
2351
  value.stableBalanceConfig,
2232
2352
  into
2233
2353
  );
2234
2354
  FfiConverterUInt32.write(value.maxConcurrentClaims, into);
2235
2355
  FfiConverterOptionalTypeSparkConfig.write(value.sparkConfig, into);
2356
+ FfiConverterBool.write(value.backgroundTasksEnabled, into);
2236
2357
  }
2237
2358
  allocationSize(value: TypeName): number {
2238
2359
  return (
@@ -2250,14 +2371,18 @@ const FfiConverterTypeConfig = (() => {
2250
2371
  FfiConverterBool.allocationSize(value.useDefaultExternalInputParsers) +
2251
2372
  FfiConverterOptionalString.allocationSize(value.realTimeSyncServerUrl) +
2252
2373
  FfiConverterBool.allocationSize(value.privateEnabledDefault) +
2253
- FfiConverterTypeOptimizationConfig.allocationSize(
2254
- value.optimizationConfig
2374
+ FfiConverterTypeLeafOptimizationConfig.allocationSize(
2375
+ value.leafOptimizationConfig
2376
+ ) +
2377
+ FfiConverterTypeTokenOptimizationConfig.allocationSize(
2378
+ value.tokenOptimizationConfig
2255
2379
  ) +
2256
2380
  FfiConverterOptionalTypeStableBalanceConfig.allocationSize(
2257
2381
  value.stableBalanceConfig
2258
2382
  ) +
2259
2383
  FfiConverterUInt32.allocationSize(value.maxConcurrentClaims) +
2260
- FfiConverterOptionalTypeSparkConfig.allocationSize(value.sparkConfig)
2384
+ FfiConverterOptionalTypeSparkConfig.allocationSize(value.sparkConfig) +
2385
+ FfiConverterBool.allocationSize(value.backgroundTasksEnabled)
2261
2386
  );
2262
2387
  }
2263
2388
  }
@@ -4575,6 +4700,14 @@ const FfiConverterTypeFreezeIssuerTokenResponse = (() => {
4575
4700
  * Request to get the balance of the wallet
4576
4701
  */
4577
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
+ */
4578
4711
  ensureSynced: boolean | undefined;
4579
4712
  };
4580
4713
 
@@ -5295,6 +5428,90 @@ const FfiConverterTypeKeySetConfig = (() => {
5295
5428
  return new FFIConverter();
5296
5429
  })();
5297
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
+
5298
5515
  export type LightningAddressDetails = {
5299
5516
  address: string;
5300
5517
  payRequest: LnurlPayRequestDetails;
@@ -7186,85 +7403,6 @@ const FfiConverterTypeNostrRelayConfig = (() => {
7186
7403
  return new FFIConverter();
7187
7404
  })();
7188
7405
 
7189
- export type OptimizationConfig = {
7190
- /**
7191
- * Whether automatic leaf optimization is enabled.
7192
- *
7193
- * If set to true, the SDK will automatically optimize the leaf set when it changes.
7194
- * Otherwise, the manual optimization API must be used to optimize the leaf set.
7195
- *
7196
- * Default value is true.
7197
- */
7198
- autoEnabled: boolean;
7199
- /**
7200
- * The desired multiplicity for the leaf set.
7201
- *
7202
- * Setting this to 0 will optimize for maximizing unilateral exit.
7203
- * Higher values will optimize for minimizing transfer swaps, with higher values
7204
- * being more aggressive and allowing better TPS rates.
7205
- *
7206
- * For end-user wallets, values of 1-5 are recommended. Values above 5 are
7207
- * intended for high-throughput server environments and are not recommended
7208
- * for end-user wallets due to significantly higher unilateral exit costs.
7209
- *
7210
- * Default value is 1.
7211
- */
7212
- multiplicity: /*u8*/ number;
7213
- };
7214
-
7215
- /**
7216
- * Generated factory for {@link OptimizationConfig} record objects.
7217
- */
7218
- export const OptimizationConfig = (() => {
7219
- const defaults = () => ({});
7220
- const create = (() => {
7221
- return uniffiCreateRecord<OptimizationConfig, ReturnType<typeof defaults>>(
7222
- defaults
7223
- );
7224
- })();
7225
- return Object.freeze({
7226
- /**
7227
- * Create a frozen instance of {@link OptimizationConfig}, with defaults specified
7228
- * in Rust, in the {@link breez_sdk_spark} crate.
7229
- */
7230
- create,
7231
-
7232
- /**
7233
- * Create a frozen instance of {@link OptimizationConfig}, with defaults specified
7234
- * in Rust, in the {@link breez_sdk_spark} crate.
7235
- */
7236
- new: create,
7237
-
7238
- /**
7239
- * Defaults specified in the {@link breez_sdk_spark} crate.
7240
- */
7241
- defaults: () => Object.freeze(defaults()) as Partial<OptimizationConfig>,
7242
- });
7243
- })();
7244
-
7245
- const FfiConverterTypeOptimizationConfig = (() => {
7246
- type TypeName = OptimizationConfig;
7247
- class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
7248
- read(from: RustBuffer): TypeName {
7249
- return {
7250
- autoEnabled: FfiConverterBool.read(from),
7251
- multiplicity: FfiConverterUInt8.read(from),
7252
- };
7253
- }
7254
- write(value: TypeName, into: RustBuffer): void {
7255
- FfiConverterBool.write(value.autoEnabled, into);
7256
- FfiConverterUInt8.write(value.multiplicity, into);
7257
- }
7258
- allocationSize(value: TypeName): number {
7259
- return (
7260
- FfiConverterBool.allocationSize(value.autoEnabled) +
7261
- FfiConverterUInt8.allocationSize(value.multiplicity)
7262
- );
7263
- }
7264
- }
7265
- return new FFIConverter();
7266
- })();
7267
-
7268
7406
  export type OptimizationProgress = {
7269
7407
  isRunning: boolean;
7270
7408
  currentRound: /*u32*/ number;
@@ -9121,6 +9259,91 @@ const FfiConverterTypeSchnorrSignatureBytes = (() => {
9121
9259
  return new FFIConverter();
9122
9260
  })();
9123
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
+
9124
9347
  /**
9125
9348
  * FFI-safe representation of a private key (32 bytes)
9126
9349
  */
@@ -11065,6 +11288,106 @@ const FfiConverterTypeTokenMetadata = (() => {
11065
11288
  return new FFIConverter();
11066
11289
  })();
11067
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
+
11068
11391
  export type TxStatus = {
11069
11392
  confirmed: boolean;
11070
11393
  blockHeight: /*u32*/ number | undefined;
@@ -23708,6 +24031,20 @@ export interface BreezSdkInterface {
23708
24031
  request: RefundDepositRequest,
23709
24032
  asyncOpts_?: { signal: AbortSignal }
23710
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>;
23711
24048
  registerLightningAddress(
23712
24049
  request: RegisterLightningAddressRequest,
23713
24050
  asyncOpts_?: { signal: AbortSignal }
@@ -25242,6 +25579,52 @@ export class BreezSdk
25242
25579
  }
25243
25580
  }
25244
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
+
25245
25628
  public async registerLightningAddress(
25246
25629
  request: RegisterLightningAddressRequest,
25247
25630
  asyncOpts_?: { signal: AbortSignal }
@@ -25769,136 +26152,6 @@ const FfiConverterTypeBreezSdk = new FfiConverterObject(
25769
26152
  uniffiTypeBreezSdkObjectFactory
25770
26153
  );
25771
26154
 
25772
- /**
25773
- * A shareable manager for gRPC connections to the Spark operators.
25774
- *
25775
- * Construct one via [`new_connection_manager`] and pass the same `Arc` to
25776
- * multiple [`SdkBuilder`](crate::SdkBuilder)s via
25777
- * [`SdkBuilder::with_connection_manager`](crate::SdkBuilder::with_connection_manager).
25778
- * Connections close when the last `Arc<ConnectionManager>` is dropped;
25779
- * [`BreezSdk::disconnect`](crate::BreezSdk::disconnect) does not affect them.
25780
- *
25781
- * All SDK instances sharing a `ConnectionManager` must be configured for the
25782
- * same network and operator pool. The TLS settings and user agent of the
25783
- * first SDK to connect to a given operator are reused for everyone afterwards.
25784
- */
25785
- export interface ConnectionManagerInterface {}
25786
-
25787
- /**
25788
- * A shareable manager for gRPC connections to the Spark operators.
25789
- *
25790
- * Construct one via [`new_connection_manager`] and pass the same `Arc` to
25791
- * multiple [`SdkBuilder`](crate::SdkBuilder)s via
25792
- * [`SdkBuilder::with_connection_manager`](crate::SdkBuilder::with_connection_manager).
25793
- * Connections close when the last `Arc<ConnectionManager>` is dropped;
25794
- * [`BreezSdk::disconnect`](crate::BreezSdk::disconnect) does not affect them.
25795
- *
25796
- * All SDK instances sharing a `ConnectionManager` must be configured for the
25797
- * same network and operator pool. The TLS settings and user agent of the
25798
- * first SDK to connect to a given operator are reused for everyone afterwards.
25799
- */
25800
- export class ConnectionManager
25801
- extends UniffiAbstractObject
25802
- implements ConnectionManagerInterface
25803
- {
25804
- readonly [uniffiTypeNameSymbol] = 'ConnectionManager';
25805
- readonly [destructorGuardSymbol]: UniffiRustArcPtr;
25806
- readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
25807
- // No primary constructor declared for this class.
25808
- private constructor(pointer: UnsafeMutableRawPointer) {
25809
- super();
25810
- this[pointerLiteralSymbol] = pointer;
25811
- this[destructorGuardSymbol] =
25812
- uniffiTypeConnectionManagerObjectFactory.bless(pointer);
25813
- }
25814
-
25815
- /**
25816
- * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
25817
- */
25818
- uniffiDestroy(): void {
25819
- const ptr = (this as any)[destructorGuardSymbol];
25820
- if (ptr !== undefined) {
25821
- const pointer = uniffiTypeConnectionManagerObjectFactory.pointer(this);
25822
- uniffiTypeConnectionManagerObjectFactory.freePointer(pointer);
25823
- uniffiTypeConnectionManagerObjectFactory.unbless(ptr);
25824
- delete (this as any)[destructorGuardSymbol];
25825
- }
25826
- }
25827
-
25828
- static instanceOf(obj: any): obj is ConnectionManager {
25829
- return uniffiTypeConnectionManagerObjectFactory.isConcreteType(obj);
25830
- }
25831
- }
25832
-
25833
- const uniffiTypeConnectionManagerObjectFactory: UniffiObjectFactory<ConnectionManagerInterface> =
25834
- (() => {
25835
- return {
25836
- create(pointer: UnsafeMutableRawPointer): ConnectionManagerInterface {
25837
- const instance = Object.create(ConnectionManager.prototype);
25838
- instance[pointerLiteralSymbol] = pointer;
25839
- instance[destructorGuardSymbol] = this.bless(pointer);
25840
- instance[uniffiTypeNameSymbol] = 'ConnectionManager';
25841
- return instance;
25842
- },
25843
-
25844
- bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr {
25845
- return uniffiCaller.rustCall(
25846
- /*caller:*/ (status) =>
25847
- nativeModule().ubrn_uniffi_internal_fn_method_connectionmanager_ffi__bless_pointer(
25848
- p,
25849
- status
25850
- ),
25851
- /*liftString:*/ FfiConverterString.lift
25852
- );
25853
- },
25854
-
25855
- unbless(ptr: UniffiRustArcPtr) {
25856
- ptr.markDestroyed();
25857
- },
25858
-
25859
- pointer(obj: ConnectionManagerInterface): UnsafeMutableRawPointer {
25860
- if ((obj as any)[destructorGuardSymbol] === undefined) {
25861
- throw new UniffiInternalError.UnexpectedNullPointer();
25862
- }
25863
- return (obj as any)[pointerLiteralSymbol];
25864
- },
25865
-
25866
- clonePointer(obj: ConnectionManagerInterface): UnsafeMutableRawPointer {
25867
- const pointer = this.pointer(obj);
25868
- return uniffiCaller.rustCall(
25869
- /*caller:*/ (callStatus) =>
25870
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_clone_connectionmanager(
25871
- pointer,
25872
- callStatus
25873
- ),
25874
- /*liftString:*/ FfiConverterString.lift
25875
- );
25876
- },
25877
-
25878
- freePointer(pointer: UnsafeMutableRawPointer): void {
25879
- uniffiCaller.rustCall(
25880
- /*caller:*/ (callStatus) =>
25881
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_free_connectionmanager(
25882
- pointer,
25883
- callStatus
25884
- ),
25885
- /*liftString:*/ FfiConverterString.lift
25886
- );
25887
- },
25888
-
25889
- isConcreteType(obj: any): obj is ConnectionManagerInterface {
25890
- return (
25891
- obj[destructorGuardSymbol] &&
25892
- obj[uniffiTypeNameSymbol] === 'ConnectionManager'
25893
- );
25894
- },
25895
- };
25896
- })();
25897
- // FfiConverter for ConnectionManagerInterface
25898
- const FfiConverterTypeConnectionManager = new FfiConverterObject(
25899
- uniffiTypeConnectionManagerObjectFactory
25900
- );
25901
-
25902
26155
  /**
25903
26156
  * External signer trait that can be implemented by users and passed to the SDK.
25904
26157
  *
@@ -30085,15 +30338,6 @@ export interface SdkBuilderInterface {
30085
30338
  chainService: BitcoinChainService,
30086
30339
  asyncOpts_?: { signal: AbortSignal }
30087
30340
  ): Promise<void>;
30088
- /**
30089
- * Sets a shared connection manager to be reused across SDK instances.
30090
- * Arguments:
30091
- * - `connection_manager`: The shared connection manager.
30092
- */
30093
- withConnectionManager(
30094
- connectionManager: ConnectionManagerInterface,
30095
- asyncOpts_?: { signal: AbortSignal }
30096
- ): Promise<void>;
30097
30341
  /**
30098
30342
  * Sets the root storage directory to initialize the default storage with.
30099
30343
  * This initializes both storage and real-time sync storage with the
@@ -30150,23 +30394,15 @@ export interface SdkBuilderInterface {
30150
30394
  asyncOpts_?: { signal: AbortSignal }
30151
30395
  ): Promise<void>;
30152
30396
  /**
30153
- * Sets a custom session manager used to persist authentication sessions.
30397
+ * Threads a shared [`SdkContext`](crate::SdkContext) into the builder.
30154
30398
  *
30155
- * Provide a shared, persistent implementation (e.g. backed by `PostgreSQL`
30156
- * or Redis) to let multiple SDK instances share authentication state and
30157
- * 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).
30158
30403
  */
30159
- withSessionManager(
30160
- sessionManager: SessionManager,
30161
- asyncOpts_?: { signal: AbortSignal }
30162
- ): Promise<void>;
30163
- /**
30164
- * Sets a shared SSP connection manager to be reused across SDK instances.
30165
- * Arguments:
30166
- * - `manager`: The shared SSP connection manager.
30167
- */
30168
- withSspConnectionManager(
30169
- manager: SspConnectionManagerInterface,
30404
+ withSharedContext(
30405
+ context: SdkContextInterface,
30170
30406
  asyncOpts_?: { signal: AbortSignal }
30171
30407
  ): Promise<void>;
30172
30408
  /**
@@ -30292,45 +30528,6 @@ export class SdkBuilder
30292
30528
  }
30293
30529
  }
30294
30530
 
30295
- /**
30296
- * Sets a shared connection manager to be reused across SDK instances.
30297
- * Arguments:
30298
- * - `connection_manager`: The shared connection manager.
30299
- */
30300
- public async withConnectionManager(
30301
- connectionManager: ConnectionManagerInterface,
30302
- asyncOpts_?: { signal: AbortSignal }
30303
- ): Promise<void> {
30304
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
30305
- try {
30306
- return await uniffiRustCallAsync(
30307
- /*rustCaller:*/ uniffiCaller,
30308
- /*rustFutureFunc:*/ () => {
30309
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_connection_manager(
30310
- uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30311
- FfiConverterTypeConnectionManager.lower(connectionManager)
30312
- );
30313
- },
30314
- /*pollFunc:*/ nativeModule()
30315
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
30316
- /*cancelFunc:*/ nativeModule()
30317
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
30318
- /*completeFunc:*/ nativeModule()
30319
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
30320
- /*freeFunc:*/ nativeModule()
30321
- .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
30322
- /*liftFunc:*/ (_v) => {},
30323
- /*liftString:*/ FfiConverterString.lift,
30324
- /*asyncOpts:*/ asyncOpts_
30325
- );
30326
- } catch (__error: any) {
30327
- if (uniffiIsDebug && __error instanceof Error) {
30328
- __error.stack = __stack;
30329
- }
30330
- throw __error;
30331
- }
30332
- }
30333
-
30334
30531
  /**
30335
30532
  * Sets the root storage directory to initialize the default storage with.
30336
30533
  * This initializes both storage and real-time sync storage with the
@@ -30411,47 +30608,13 @@ export class SdkBuilder
30411
30608
  }
30412
30609
  }
30413
30610
 
30414
- /**
30415
- * Sets the key set type to be used by the SDK.
30416
- * Arguments:
30417
- * - `config`: Key set configuration containing the key set type, address index flag, and optional account number.
30418
- */
30419
- public async withKeySet(
30420
- config: KeySetConfig,
30421
- asyncOpts_?: { signal: AbortSignal }
30422
- ): Promise<void> {
30423
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
30424
- try {
30425
- return await uniffiRustCallAsync(
30426
- /*rustCaller:*/ uniffiCaller,
30427
- /*rustFutureFunc:*/ () => {
30428
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set(
30429
- uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30430
- FfiConverterTypeKeySetConfig.lower(config)
30431
- );
30432
- },
30433
- /*pollFunc:*/ nativeModule()
30434
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
30435
- /*cancelFunc:*/ nativeModule()
30436
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
30437
- /*completeFunc:*/ nativeModule()
30438
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
30439
- /*freeFunc:*/ nativeModule()
30440
- .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
30441
- /*liftFunc:*/ (_v) => {},
30442
- /*liftString:*/ FfiConverterString.lift,
30443
- /*asyncOpts:*/ asyncOpts_
30444
- );
30445
- } catch (__error: any) {
30446
- if (uniffiIsDebug && __error instanceof Error) {
30447
- __error.stack = __stack;
30448
- }
30449
- throw __error;
30450
- }
30451
- }
30452
-
30453
- public async withLnurlClient(
30454
- 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,
30455
30618
  asyncOpts_?: { signal: AbortSignal }
30456
30619
  ): Promise<void> {
30457
30620
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -30459,9 +30622,9 @@ export class SdkBuilder
30459
30622
  return await uniffiRustCallAsync(
30460
30623
  /*rustCaller:*/ uniffiCaller,
30461
30624
  /*rustFutureFunc:*/ () => {
30462
- 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(
30463
30626
  uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30464
- FfiConverterTypeRestClient.lower(lnurlClient)
30627
+ FfiConverterTypeKeySetConfig.lower(config)
30465
30628
  );
30466
30629
  },
30467
30630
  /*pollFunc:*/ nativeModule()
@@ -30484,13 +30647,8 @@ export class SdkBuilder
30484
30647
  }
30485
30648
  }
30486
30649
 
30487
- /**
30488
- * Sets the payment observer to be used by the SDK.
30489
- * Arguments:
30490
- * - `payment_observer`: The payment observer to be used.
30491
- */
30492
- public async withPaymentObserver(
30493
- paymentObserver: PaymentObserver,
30650
+ public async withLnurlClient(
30651
+ lnurlClient: RestClient,
30494
30652
  asyncOpts_?: { signal: AbortSignal }
30495
30653
  ): Promise<void> {
30496
30654
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -30498,9 +30656,9 @@ export class SdkBuilder
30498
30656
  return await uniffiRustCallAsync(
30499
30657
  /*rustCaller:*/ uniffiCaller,
30500
30658
  /*rustFutureFunc:*/ () => {
30501
- 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(
30502
30660
  uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30503
- FfiConverterTypePaymentObserver.lower(paymentObserver)
30661
+ FfiConverterTypeRestClient.lower(lnurlClient)
30504
30662
  );
30505
30663
  },
30506
30664
  /*pollFunc:*/ nativeModule()
@@ -30524,16 +30682,12 @@ export class SdkBuilder
30524
30682
  }
30525
30683
 
30526
30684
  /**
30527
- * Sets the REST chain service to be used by the SDK.
30685
+ * Sets the payment observer to be used by the SDK.
30528
30686
  * Arguments:
30529
- * - `url`: The base URL of the REST API.
30530
- * - `api_type`: The API type to be used.
30531
- * - `credentials`: Optional credentials for basic authentication.
30687
+ * - `payment_observer`: The payment observer to be used.
30532
30688
  */
30533
- public async withRestChainService(
30534
- url: string,
30535
- apiType: ChainApiType,
30536
- credentials: Credentials | undefined,
30689
+ public async withPaymentObserver(
30690
+ paymentObserver: PaymentObserver,
30537
30691
  asyncOpts_?: { signal: AbortSignal }
30538
30692
  ): Promise<void> {
30539
30693
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -30541,11 +30695,9 @@ export class SdkBuilder
30541
30695
  return await uniffiRustCallAsync(
30542
30696
  /*rustCaller:*/ uniffiCaller,
30543
30697
  /*rustFutureFunc:*/ () => {
30544
- 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(
30545
30699
  uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30546
- FfiConverterString.lower(url),
30547
- FfiConverterTypeChainApiType.lower(apiType),
30548
- FfiConverterOptionalTypeCredentials.lower(credentials)
30700
+ FfiConverterTypePaymentObserver.lower(paymentObserver)
30549
30701
  );
30550
30702
  },
30551
30703
  /*pollFunc:*/ nativeModule()
@@ -30569,14 +30721,16 @@ export class SdkBuilder
30569
30721
  }
30570
30722
 
30571
30723
  /**
30572
- * Sets a custom session manager used to persist authentication sessions.
30573
- *
30574
- * Provide a shared, persistent implementation (e.g. backed by `PostgreSQL`
30575
- * or Redis) to let multiple SDK instances share authentication state and
30576
- * 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.
30577
30729
  */
30578
- public async withSessionManager(
30579
- sessionManager: SessionManager,
30730
+ public async withRestChainService(
30731
+ url: string,
30732
+ apiType: ChainApiType,
30733
+ credentials: Credentials | undefined,
30580
30734
  asyncOpts_?: { signal: AbortSignal }
30581
30735
  ): Promise<void> {
30582
30736
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -30584,9 +30738,11 @@ export class SdkBuilder
30584
30738
  return await uniffiRustCallAsync(
30585
30739
  /*rustCaller:*/ uniffiCaller,
30586
30740
  /*rustFutureFunc:*/ () => {
30587
- 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(
30588
30742
  uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30589
- FfiConverterTypeSessionManager.lower(sessionManager)
30743
+ FfiConverterString.lower(url),
30744
+ FfiConverterTypeChainApiType.lower(apiType),
30745
+ FfiConverterOptionalTypeCredentials.lower(credentials)
30590
30746
  );
30591
30747
  },
30592
30748
  /*pollFunc:*/ nativeModule()
@@ -30610,12 +30766,15 @@ export class SdkBuilder
30610
30766
  }
30611
30767
 
30612
30768
  /**
30613
- * Sets a shared SSP connection manager to be reused across SDK instances.
30614
- * Arguments:
30615
- * - `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).
30616
30775
  */
30617
- public async withSspConnectionManager(
30618
- manager: SspConnectionManagerInterface,
30776
+ public async withSharedContext(
30777
+ context: SdkContextInterface,
30619
30778
  asyncOpts_?: { signal: AbortSignal }
30620
30779
  ): Promise<void> {
30621
30780
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -30623,9 +30782,9 @@ export class SdkBuilder
30623
30782
  return await uniffiRustCallAsync(
30624
30783
  /*rustCaller:*/ uniffiCaller,
30625
30784
  /*rustFutureFunc:*/ () => {
30626
- 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(
30627
30786
  uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
30628
- FfiConverterTypeSspConnectionManager.lower(manager)
30787
+ FfiConverterTypeSdkContext.lower(context)
30629
30788
  );
30630
30789
  },
30631
30790
  /*pollFunc:*/ nativeModule()
@@ -30774,6 +30933,140 @@ const FfiConverterTypeSdkBuilder = new FfiConverterObject(
30774
30933
  uniffiTypeSdkBuilderObjectFactory
30775
30934
  );
30776
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
+
30777
31070
  /**
30778
31071
  * Persistent storage for authentication sessions, keyed by the service's
30779
31072
  * identity public key. Implementations should be thread-safe and may be
@@ -31092,146 +31385,6 @@ const uniffiCallbackInterfaceSessionManager: {
31092
31385
  },
31093
31386
  };
31094
31387
 
31095
- /**
31096
- * A shared HTTP transport for SSP GraphQL traffic.
31097
- *
31098
- * All SDK instances that are built with the same `SspConnectionManager` send
31099
- * SSP requests over the same pooled `reqwest::Client`. This means each
31100
- * process opens at most one TCP+TLS+HTTP/2 connection to the SSP regardless
31101
- * of how many wallets are loaded — useful for multi-tenant servers running
31102
- * many SDK instances.
31103
- *
31104
- * # Caveats
31105
- *
31106
- * - The user-agent of the first SDK to construct this manager is reused for
31107
- * all subsequent instances. This is rarely a problem since SDK instances
31108
- * in one process typically share a build version.
31109
- * - Connections close when the last `Arc<SspConnectionManager>` is dropped.
31110
- * `BreezSdk::disconnect` does not close them.
31111
- */
31112
- export interface SspConnectionManagerInterface {}
31113
-
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 class SspConnectionManager
31132
- extends UniffiAbstractObject
31133
- implements SspConnectionManagerInterface
31134
- {
31135
- readonly [uniffiTypeNameSymbol] = 'SspConnectionManager';
31136
- readonly [destructorGuardSymbol]: UniffiRustArcPtr;
31137
- readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
31138
- // No primary constructor declared for this class.
31139
- private constructor(pointer: UnsafeMutableRawPointer) {
31140
- super();
31141
- this[pointerLiteralSymbol] = pointer;
31142
- this[destructorGuardSymbol] =
31143
- uniffiTypeSspConnectionManagerObjectFactory.bless(pointer);
31144
- }
31145
-
31146
- /**
31147
- * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
31148
- */
31149
- uniffiDestroy(): void {
31150
- const ptr = (this as any)[destructorGuardSymbol];
31151
- if (ptr !== undefined) {
31152
- const pointer = uniffiTypeSspConnectionManagerObjectFactory.pointer(this);
31153
- uniffiTypeSspConnectionManagerObjectFactory.freePointer(pointer);
31154
- uniffiTypeSspConnectionManagerObjectFactory.unbless(ptr);
31155
- delete (this as any)[destructorGuardSymbol];
31156
- }
31157
- }
31158
-
31159
- static instanceOf(obj: any): obj is SspConnectionManager {
31160
- return uniffiTypeSspConnectionManagerObjectFactory.isConcreteType(obj);
31161
- }
31162
- }
31163
-
31164
- const uniffiTypeSspConnectionManagerObjectFactory: UniffiObjectFactory<SspConnectionManagerInterface> =
31165
- (() => {
31166
- return {
31167
- create(pointer: UnsafeMutableRawPointer): SspConnectionManagerInterface {
31168
- const instance = Object.create(SspConnectionManager.prototype);
31169
- instance[pointerLiteralSymbol] = pointer;
31170
- instance[destructorGuardSymbol] = this.bless(pointer);
31171
- instance[uniffiTypeNameSymbol] = 'SspConnectionManager';
31172
- return instance;
31173
- },
31174
-
31175
- bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr {
31176
- return uniffiCaller.rustCall(
31177
- /*caller:*/ (status) =>
31178
- nativeModule().ubrn_uniffi_internal_fn_method_sspconnectionmanager_ffi__bless_pointer(
31179
- p,
31180
- status
31181
- ),
31182
- /*liftString:*/ FfiConverterString.lift
31183
- );
31184
- },
31185
-
31186
- unbless(ptr: UniffiRustArcPtr) {
31187
- ptr.markDestroyed();
31188
- },
31189
-
31190
- pointer(obj: SspConnectionManagerInterface): UnsafeMutableRawPointer {
31191
- if ((obj as any)[destructorGuardSymbol] === undefined) {
31192
- throw new UniffiInternalError.UnexpectedNullPointer();
31193
- }
31194
- return (obj as any)[pointerLiteralSymbol];
31195
- },
31196
-
31197
- clonePointer(
31198
- obj: SspConnectionManagerInterface
31199
- ): UnsafeMutableRawPointer {
31200
- const pointer = this.pointer(obj);
31201
- return uniffiCaller.rustCall(
31202
- /*caller:*/ (callStatus) =>
31203
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_clone_sspconnectionmanager(
31204
- pointer,
31205
- callStatus
31206
- ),
31207
- /*liftString:*/ FfiConverterString.lift
31208
- );
31209
- },
31210
-
31211
- freePointer(pointer: UnsafeMutableRawPointer): void {
31212
- uniffiCaller.rustCall(
31213
- /*caller:*/ (callStatus) =>
31214
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_free_sspconnectionmanager(
31215
- pointer,
31216
- callStatus
31217
- ),
31218
- /*liftString:*/ FfiConverterString.lift
31219
- );
31220
- },
31221
-
31222
- isConcreteType(obj: any): obj is SspConnectionManagerInterface {
31223
- return (
31224
- obj[destructorGuardSymbol] &&
31225
- obj[uniffiTypeNameSymbol] === 'SspConnectionManager'
31226
- );
31227
- },
31228
- };
31229
- })();
31230
- // FfiConverter for SspConnectionManagerInterface
31231
- const FfiConverterTypeSspConnectionManager = new FfiConverterObject(
31232
- uniffiTypeSspConnectionManagerObjectFactory
31233
- );
31234
-
31235
31388
  /**
31236
31389
  * Trait for persistent storage
31237
31390
  */
@@ -35071,6 +35224,14 @@ function uniffiEnsureInitialized() {
35071
35224
  'uniffi_breez_sdk_spark_checksum_func_default_external_signer'
35072
35225
  );
35073
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
+ }
35074
35235
  if (
35075
35236
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_get_spark_status() !==
35076
35237
  62888
@@ -35087,28 +35248,20 @@ function uniffiEnsureInitialized() {
35087
35248
  'uniffi_breez_sdk_spark_checksum_func_init_logging'
35088
35249
  );
35089
35250
  }
35090
- if (
35091
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_new_connection_manager() !==
35092
- 25164
35093
- ) {
35094
- throw new UniffiInternalError.ApiChecksumMismatch(
35095
- 'uniffi_breez_sdk_spark_checksum_func_new_connection_manager'
35096
- );
35097
- }
35098
35251
  if (
35099
35252
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_new_rest_chain_service() !==
35100
- 62980
35253
+ 23177
35101
35254
  ) {
35102
35255
  throw new UniffiInternalError.ApiChecksumMismatch(
35103
35256
  'uniffi_breez_sdk_spark_checksum_func_new_rest_chain_service'
35104
35257
  );
35105
35258
  }
35106
35259
  if (
35107
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_new_ssp_connection_manager() !==
35108
- 15222
35260
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_new_shared_sdk_context() !==
35261
+ 28438
35109
35262
  ) {
35110
35263
  throw new UniffiInternalError.ApiChecksumMismatch(
35111
- 'uniffi_breez_sdk_spark_checksum_func_new_ssp_connection_manager'
35264
+ 'uniffi_breez_sdk_spark_checksum_func_new_shared_sdk_context'
35112
35265
  );
35113
35266
  }
35114
35267
  if (
@@ -35423,6 +35576,14 @@ function uniffiEnsureInitialized() {
35423
35576
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_deposit'
35424
35577
  );
35425
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
+ }
35426
35587
  if (
35427
35588
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_register_lightning_address() !==
35428
35589
  530
@@ -35775,14 +35936,6 @@ function uniffiEnsureInitialized() {
35775
35936
  'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service'
35776
35937
  );
35777
35938
  }
35778
- if (
35779
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_connection_manager() !==
35780
- 51797
35781
- ) {
35782
- throw new UniffiInternalError.ApiChecksumMismatch(
35783
- 'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_connection_manager'
35784
- );
35785
- }
35786
35939
  if (
35787
35940
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_default_storage() !==
35788
35941
  14543
@@ -35832,19 +35985,11 @@ function uniffiEnsureInitialized() {
35832
35985
  );
35833
35986
  }
35834
35987
  if (
35835
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_session_manager() !==
35836
- 64189
35837
- ) {
35838
- throw new UniffiInternalError.ApiChecksumMismatch(
35839
- 'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_session_manager'
35840
- );
35841
- }
35842
- if (
35843
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_ssp_connection_manager() !==
35844
- 65505
35988
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_shared_context() !==
35989
+ 64829
35845
35990
  ) {
35846
35991
  throw new UniffiInternalError.ApiChecksumMismatch(
35847
- 'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_ssp_connection_manager'
35992
+ 'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_shared_context'
35848
35993
  );
35849
35994
  }
35850
35995
  if (
@@ -36229,7 +36374,6 @@ export default Object.freeze({
36229
36374
  FfiConverterTypeConfig,
36230
36375
  FfiConverterTypeConnectRequest,
36231
36376
  FfiConverterTypeConnectWithSignerRequest,
36232
- FfiConverterTypeConnectionManager,
36233
36377
  FfiConverterTypeContact,
36234
36378
  FfiConverterTypeConversionDetails,
36235
36379
  FfiConverterTypeConversionEstimate,
@@ -36283,6 +36427,7 @@ export default Object.freeze({
36283
36427
  FfiConverterTypeInputType,
36284
36428
  FfiConverterTypeKeySetConfig,
36285
36429
  FfiConverterTypeKeySetType,
36430
+ FfiConverterTypeLeafOptimizationConfig,
36286
36431
  FfiConverterTypeLightningAddressDetails,
36287
36432
  FfiConverterTypeLightningAddressInfo,
36288
36433
  FfiConverterTypeListContactsRequest,
@@ -36315,7 +36460,6 @@ export default Object.freeze({
36315
36460
  FfiConverterTypeNetwork,
36316
36461
  FfiConverterTypeNostrRelayConfig,
36317
36462
  FfiConverterTypeOnchainConfirmationSpeed,
36318
- FfiConverterTypeOptimizationConfig,
36319
36463
  FfiConverterTypeOptimizationEvent,
36320
36464
  FfiConverterTypeOptimizationProgress,
36321
36465
  FfiConverterTypeOutgoingChange,
@@ -36359,6 +36503,8 @@ export default Object.freeze({
36359
36503
  FfiConverterTypeRestResponse,
36360
36504
  FfiConverterTypeSchnorrSignatureBytes,
36361
36505
  FfiConverterTypeSdkBuilder,
36506
+ FfiConverterTypeSdkContext,
36507
+ FfiConverterTypeSdkContextConfig,
36362
36508
  FfiConverterTypeSdkError,
36363
36509
  FfiConverterTypeSdkEvent,
36364
36510
  FfiConverterTypeSecretBytes,
@@ -36389,7 +36535,6 @@ export default Object.freeze({
36389
36535
  FfiConverterTypeSparkSigningOperator,
36390
36536
  FfiConverterTypeSparkSspConfig,
36391
36537
  FfiConverterTypeSparkStatus,
36392
- FfiConverterTypeSspConnectionManager,
36393
36538
  FfiConverterTypeStableBalanceActiveLabel,
36394
36539
  FfiConverterTypeStableBalanceConfig,
36395
36540
  FfiConverterTypeStableBalanceToken,
@@ -36405,6 +36550,7 @@ export default Object.freeze({
36405
36550
  FfiConverterTypeTokenBalance,
36406
36551
  FfiConverterTypeTokenIssuer,
36407
36552
  FfiConverterTypeTokenMetadata,
36553
+ FfiConverterTypeTokenOptimizationConfig,
36408
36554
  FfiConverterTypeTokenTransactionType,
36409
36555
  FfiConverterTypeTxStatus,
36410
36556
  FfiConverterTypeUnfreezeIssuerTokenRequest,