@breeztech/breez-sdk-spark 0.27.1 → 0.27.3-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +9 -8
  2. package/bundler/breez_sdk_spark_wasm.d.ts +141 -16
  3. package/bundler/breez_sdk_spark_wasm.js +1 -1
  4. package/bundler/breez_sdk_spark_wasm_bg.js +190 -40
  5. package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
  6. package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +23 -11
  7. package/bundler/index.js +6 -13
  8. package/bundler/storage/index.js +89 -17
  9. package/deno/breez_sdk_spark_wasm.d.ts +141 -16
  10. package/deno/breez_sdk_spark_wasm.js +190 -40
  11. package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
  12. package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +23 -11
  13. package/nodejs/breez_sdk_spark_wasm.d.ts +141 -16
  14. package/nodejs/breez_sdk_spark_wasm.js +194 -40
  15. package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
  16. package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +23 -11
  17. package/nodejs/index.d.mts +3 -0
  18. package/nodejs/index.js +30 -120
  19. package/nodejs/index.mjs +4 -0
  20. package/nodejs/mysql-session-store/index.cjs +24 -7
  21. package/nodejs/mysql-session-store/migrations.cjs +6 -0
  22. package/nodejs/mysql-storage/index.cjs +36 -19
  23. package/nodejs/mysql-storage/migrations.cjs +24 -9
  24. package/nodejs/mysql-token-store/index.cjs +28 -18
  25. package/nodejs/postgres-session-store/index.cjs +25 -7
  26. package/nodejs/postgres-session-store/migrations.cjs +12 -9
  27. package/nodejs/postgres-storage/index.cjs +36 -19
  28. package/nodejs/postgres-storage/migrations.cjs +24 -9
  29. package/nodejs/postgres-token-store/index.cjs +32 -18
  30. package/nodejs/postgres-token-store/migrations.cjs +5 -9
  31. package/nodejs/postgres-tree-store/migrations.cjs +5 -9
  32. package/nodejs/storage/index.cjs +35 -14
  33. package/nodejs/storage/migrations.cjs +25 -15
  34. package/nodejs/tree-store/index.cjs +1 -1
  35. package/nodejs/tree-store/migrations.cjs +6 -13
  36. package/package.json +27 -6
  37. package/ssr/index.js +24 -0
  38. package/web/breez_sdk_spark_wasm.d.ts +164 -27
  39. package/web/breez_sdk_spark_wasm.js +190 -40
  40. package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
  41. package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +23 -11
  42. package/web/index.js +6 -13
  43. package/web/passkey-prf-provider/index.js +1 -0
  44. package/web/storage/index.js +89 -17
  45. package/breez-sdk-spark.tgz +0 -0
  46. package/itest/.gitignore +0 -2
  47. package/itest/database-drivers.test.js +0 -45
  48. package/itest/helpers/assert.test.js +0 -70
  49. package/itest/helpers/faucet.js +0 -68
  50. package/itest/helpers/lnurl-fixture.js +0 -229
  51. package/itest/helpers/scenario.js +0 -444
  52. package/itest/package-lock.json +0 -519
  53. package/itest/package.json +0 -18
  54. package/itest/scenarios.test.js +0 -47
  55. package/itest/smoke.test.js +0 -184
@@ -143,6 +143,7 @@ export class BreezSdk {
143
143
  return ret;
144
144
  }
145
145
  /**
146
+ * @deprecated Use `bridgeFromCashApp` on the client from `getBridgingClient`.
146
147
  * @param {BridgeFromCashAppRequest} request
147
148
  * @returns {Promise<BridgeFromCashAppResponse>}
148
149
  */
@@ -151,6 +152,7 @@ export class BreezSdk {
151
152
  return ret;
152
153
  }
153
154
  /**
155
+ * @deprecated Use `bridgeToCashApp` on the client from `getBridgingClient`.
154
156
  * @param {BridgeToCashAppRequest} request
155
157
  * @returns {Promise<BridgeToCashAppResponse>}
156
158
  */
@@ -301,6 +303,16 @@ export class BreezSdk {
301
303
  const ret = wasm.breezsdk_fetchConversionLimits(this.__wbg_ptr, request);
302
304
  return ret;
303
305
  }
306
+ /**
307
+ * @returns {BridgingClient}
308
+ */
309
+ getBridgingClient() {
310
+ const ret = wasm.breezsdk_getBridgingClient(this.__wbg_ptr);
311
+ if (ret[2]) {
312
+ throw takeFromExternrefTable0(ret[1]);
313
+ }
314
+ return BridgingClient.__wrap(ret[0]);
315
+ }
304
316
  /**
305
317
  * @param {CrossChainRouteFilter} filter
306
318
  * @returns {Promise<CrossChainRoutePair[]>}
@@ -466,7 +478,7 @@ export class BreezSdk {
466
478
  return ret;
467
479
  }
468
480
  /**
469
- * @deprecated Use `bridgeFromCashApp`.
481
+ * @deprecated Use `bridgeFromCashApp` on the client from `getBridgingClient`.
470
482
  * @param {PreparePaymentLinkRequest} request
471
483
  * @returns {Promise<PreparePaymentLinkResponse>}
472
484
  */
@@ -670,6 +682,100 @@ export class BreezSdk {
670
682
  }
671
683
  if (Symbol.dispose) BreezSdk.prototype[Symbol.dispose] = BreezSdk.prototype.free;
672
684
 
685
+ /**
686
+ * Creates bridges: orders that pay a recipient from another chain or over
687
+ * Lightning, with no funds moving through the SDK. Only available on mainnet.
688
+ */
689
+ export class BridgingClient {
690
+ static __wrap(ptr) {
691
+ const obj = Object.create(BridgingClient.prototype);
692
+ obj.__wbg_ptr = ptr;
693
+ BridgingClientFinalization.register(obj, obj.__wbg_ptr, obj);
694
+ return obj;
695
+ }
696
+ __destroy_into_raw() {
697
+ const ptr = this.__wbg_ptr;
698
+ this.__wbg_ptr = 0;
699
+ BridgingClientFinalization.unregister(this);
700
+ return ptr;
701
+ }
702
+ free() {
703
+ const ptr = this.__destroy_into_raw();
704
+ wasm.__wbg_bridgingclient_free(ptr, 0);
705
+ }
706
+ /**
707
+ * @param {CreateBridgeRequest} request
708
+ * @returns {Promise<CreateBridgeResponse>}
709
+ */
710
+ bridgeFromCashApp(request) {
711
+ const ret = wasm.bridgingclient_bridgeFromCashApp(this.__wbg_ptr, request);
712
+ return ret;
713
+ }
714
+ /**
715
+ * @param {CreateBridgeRequest} request
716
+ * @returns {Promise<CreateBridgeResponse>}
717
+ */
718
+ bridgeToCashApp(request) {
719
+ const ret = wasm.bridgingclient_bridgeToCashApp(this.__wbg_ptr, request);
720
+ return ret;
721
+ }
722
+ /**
723
+ * @param {CreateBridgeRequest} request
724
+ * @returns {Promise<CreateBridgeResponse>}
725
+ */
726
+ createBridge(request) {
727
+ const ret = wasm.bridgingclient_createBridge(this.__wbg_ptr, request);
728
+ return ret;
729
+ }
730
+ /**
731
+ * @param {GetBridgeStatusRequest} request
732
+ * @returns {Promise<GetBridgeStatusResponse>}
733
+ */
734
+ getBridgeStatus(request) {
735
+ const ret = wasm.bridgingclient_getBridgeStatus(this.__wbg_ptr, request);
736
+ return ret;
737
+ }
738
+ /**
739
+ * @param {GetBridgeRoutesRequest} request
740
+ * @returns {Promise<GetBridgeRoutesResponse>}
741
+ */
742
+ getRoutes(request) {
743
+ const ret = wasm.bridgingclient_getRoutes(this.__wbg_ptr, request);
744
+ return ret;
745
+ }
746
+ }
747
+ if (Symbol.dispose) BridgingClient.prototype[Symbol.dispose] = BridgingClient.prototype.free;
748
+
749
+ /**
750
+ * A logger that prints each log entry to the JavaScript console, with the console method that
751
+ * matches the entry's level.
752
+ */
753
+ export class ConsoleLogger {
754
+ __destroy_into_raw() {
755
+ const ptr = this.__wbg_ptr;
756
+ this.__wbg_ptr = 0;
757
+ ConsoleLoggerFinalization.unregister(this);
758
+ return ptr;
759
+ }
760
+ free() {
761
+ const ptr = this.__destroy_into_raw();
762
+ wasm.__wbg_consolelogger_free(ptr, 0);
763
+ }
764
+ /**
765
+ * @param {LogEntry} entry
766
+ */
767
+ log(entry) {
768
+ wasm.consolelogger_log(this.__wbg_ptr, entry);
769
+ }
770
+ constructor() {
771
+ const ret = wasm.consolelogger_new();
772
+ this.__wbg_ptr = ret;
773
+ ConsoleLoggerFinalization.register(this, this.__wbg_ptr, this);
774
+ return this;
775
+ }
776
+ }
777
+ if (Symbol.dispose) ConsoleLogger.prototype[Symbol.dispose] = ConsoleLogger.prototype.free;
778
+
673
779
  /**
674
780
  * A CPFP signer matching the `CpfpSigner` TypeScript interface.
675
781
  */
@@ -1865,6 +1971,18 @@ export function createTurnkeySigningOnlySigner(config) {
1865
1971
  return ret;
1866
1972
  }
1867
1973
 
1974
+ /**
1975
+ * Settings for `newBridgingClient` with every optional field unset.
1976
+ * @param {string} api_key
1977
+ * @returns {BridgingConfig}
1978
+ */
1979
+ export function defaultBridgingConfig(api_key) {
1980
+ const ptr0 = passStringToWasm0(api_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1981
+ const len0 = WASM_VECTOR_LEN;
1982
+ const ret = wasm.defaultBridgingConfig(ptr0, len0);
1983
+ return ret;
1984
+ }
1985
+
1868
1986
  /**
1869
1987
  * @param {Network} network
1870
1988
  * @returns {Config}
@@ -2002,6 +2120,16 @@ export function mysqlStorage(config) {
2002
2120
  return WasmStorageConfig.__wrap(ret);
2003
2121
  }
2004
2122
 
2123
+ /**
2124
+ * Builds a `BridgingClient` from an API key, with no seed or storage.
2125
+ * @param {BridgingConfig} config
2126
+ * @returns {Promise<BridgingClient>}
2127
+ */
2128
+ export function newBridgingClient(config) {
2129
+ const ret = wasm.newBridgingClient(config);
2130
+ return ret;
2131
+ }
2132
+
2005
2133
  /**
2006
2134
  * Constructs a shareable REST-based Bitcoin chain service.
2007
2135
  *
@@ -2254,6 +2382,10 @@ export function __wbg_breezsdk_new(arg0) {
2254
2382
  const ret = BreezSdk.__wrap(arg0);
2255
2383
  return ret;
2256
2384
  }
2385
+ export function __wbg_bridgingclient_new(arg0) {
2386
+ const ret = BridgingClient.__wrap(arg0);
2387
+ return ret;
2388
+ }
2257
2389
  export function __wbg_broadcastTransaction_f298d093a11def5e() { return handleError(function (arg0, arg1, arg2) {
2258
2390
  let deferred0_0;
2259
2391
  let deferred0_1;
@@ -2406,6 +2538,9 @@ export function __wbg_data_4a14fad4c5f216c4(arg0) {
2406
2538
  const ret = arg0.data;
2407
2539
  return ret;
2408
2540
  }
2541
+ export function __wbg_debug_37240d2c1d0ce2bb(arg0) {
2542
+ console.debug(arg0);
2543
+ }
2409
2544
  export function __wbg_decryptEcies_ebe426814020926b() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2410
2545
  let deferred1_0;
2411
2546
  let deferred1_1;
@@ -2533,6 +2668,9 @@ export function __wbg_entries_bb9843ba73dc70d6(arg0) {
2533
2668
  export function __wbg_error_145dadf4216d70bc(arg0, arg1) {
2534
2669
  console.error(getStringFromWasm0(arg0, arg1));
2535
2670
  }
2671
+ export function __wbg_error_48655ee7e4756f8b(arg0) {
2672
+ console.error(arg0);
2673
+ }
2536
2674
  export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
2537
2675
  let deferred0_0;
2538
2676
  let deferred0_1;
@@ -2855,6 +2993,9 @@ export function __wbg_hmacSha256_04164bea6bd3c7d4() { return handleError(functio
2855
2993
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2856
2994
  }
2857
2995
  }, arguments); }
2996
+ export function __wbg_info_092aeeab8cd06a0b(arg0) {
2997
+ console.info(arg0);
2998
+ }
2858
2999
  export function __wbg_insertContact_cc39397cb8e88ff8() { return handleError(function (arg0, arg1) {
2859
3000
  const ret = arg0.insertContact(arg1);
2860
3001
  return ret;
@@ -3753,63 +3894,66 @@ export function __wbg_view_16bd97d49793e1a9(arg0) {
3753
3894
  const ret = arg0.view;
3754
3895
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3755
3896
  }
3897
+ export function __wbg_warn_1f9b94806da61fbb(arg0) {
3898
+ console.warn(arg0);
3899
+ }
3756
3900
  export function __wbg_wasmsdkcontext_new(arg0) {
3757
3901
  const ret = WasmSdkContext.__wrap(arg0);
3758
3902
  return ret;
3759
3903
  }
3760
3904
  export function __wbindgen_cast_0000000000000001(arg0, arg1) {
3761
3905
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 26, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3762
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31);
3906
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92);
3763
3907
  return ret;
3764
3908
  }
3765
3909
  export function __wbindgen_cast_0000000000000002(arg0, arg1) {
3766
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 474, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3767
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed);
3910
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 479, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3911
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h168b325370d2795a);
3768
3912
  return ret;
3769
3913
  }
3770
3914
  export function __wbindgen_cast_0000000000000003(arg0, arg1) {
3771
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 474, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3772
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_2);
3915
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 479, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3916
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_2);
3773
3917
  return ret;
3774
3918
  }
3775
3919
  export function __wbindgen_cast_0000000000000004(arg0, arg1) {
3776
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 474, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3777
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_3);
3920
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 479, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3921
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_3);
3778
3922
  return ret;
3779
3923
  }
3780
3924
  export function __wbindgen_cast_0000000000000005(arg0, arg1) {
3781
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 474, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3782
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_4);
3925
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 479, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3926
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_4);
3783
3927
  return ret;
3784
3928
  }
3785
3929
  export function __wbindgen_cast_0000000000000006(arg0, arg1) {
3786
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 474, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3787
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_5);
3930
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 479, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3931
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_5);
3788
3932
  return ret;
3789
3933
  }
3790
3934
  export function __wbindgen_cast_0000000000000007(arg0, arg1) {
3791
3935
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("SessionStore")], shim_idx: 26, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3792
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_6);
3936
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_6);
3793
3937
  return ret;
3794
3938
  }
3795
3939
  export function __wbindgen_cast_0000000000000008(arg0, arg1) {
3796
3940
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Storage")], shim_idx: 26, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3797
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_7);
3941
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_7);
3798
3942
  return ret;
3799
3943
  }
3800
3944
  export function __wbindgen_cast_0000000000000009(arg0, arg1) {
3801
3945
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TokenStore")], shim_idx: 26, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3802
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_8);
3946
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_8);
3803
3947
  return ret;
3804
3948
  }
3805
3949
  export function __wbindgen_cast_000000000000000a(arg0, arg1) {
3806
3950
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TreeStore")], shim_idx: 26, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3807
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_9);
3951
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_9);
3808
3952
  return ret;
3809
3953
  }
3810
3954
  export function __wbindgen_cast_000000000000000b(arg0, arg1) {
3811
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 864, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3812
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h02848814aa3937de);
3955
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 875, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3956
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h8a05c61e16e49565);
3813
3957
  return ret;
3814
3958
  }
3815
3959
  export function __wbindgen_cast_000000000000000c(arg0) {
@@ -3893,60 +4037,60 @@ export function __wbindgen_init_externref_table() {
3893
4037
  table.set(offset + 2, true);
3894
4038
  table.set(offset + 3, false);
3895
4039
  }
3896
- function wasm_bindgen__convert__closures_____invoke__h02848814aa3937de(arg0, arg1) {
3897
- wasm.wasm_bindgen__convert__closures_____invoke__h02848814aa3937de(arg0, arg1);
4040
+ function wasm_bindgen__convert__closures_____invoke__h8a05c61e16e49565(arg0, arg1) {
4041
+ wasm.wasm_bindgen__convert__closures_____invoke__h8a05c61e16e49565(arg0, arg1);
3898
4042
  }
3899
4043
 
3900
- function wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed(arg0, arg1, arg2) {
3901
- wasm.wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed(arg0, arg1, arg2);
4044
+ function wasm_bindgen__convert__closures_____invoke__h168b325370d2795a(arg0, arg1, arg2) {
4045
+ wasm.wasm_bindgen__convert__closures_____invoke__h168b325370d2795a(arg0, arg1, arg2);
3902
4046
  }
3903
4047
 
3904
- function wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_2(arg0, arg1, arg2) {
3905
- wasm.wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_2(arg0, arg1, arg2);
4048
+ function wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_2(arg0, arg1, arg2) {
4049
+ wasm.wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_2(arg0, arg1, arg2);
3906
4050
  }
3907
4051
 
3908
- function wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_3(arg0, arg1, arg2) {
3909
- wasm.wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_3(arg0, arg1, arg2);
4052
+ function wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_3(arg0, arg1, arg2) {
4053
+ wasm.wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_3(arg0, arg1, arg2);
3910
4054
  }
3911
4055
 
3912
- function wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_4(arg0, arg1, arg2) {
3913
- wasm.wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_4(arg0, arg1, arg2);
4056
+ function wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_4(arg0, arg1, arg2) {
4057
+ wasm.wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_4(arg0, arg1, arg2);
3914
4058
  }
3915
4059
 
3916
- function wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_5(arg0, arg1, arg2) {
3917
- wasm.wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_5(arg0, arg1, arg2);
4060
+ function wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_5(arg0, arg1, arg2) {
4061
+ wasm.wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_5(arg0, arg1, arg2);
3918
4062
  }
3919
4063
 
3920
- function wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31(arg0, arg1, arg2) {
3921
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31(arg0, arg1, arg2);
4064
+ function wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92(arg0, arg1, arg2) {
4065
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92(arg0, arg1, arg2);
3922
4066
  if (ret[1]) {
3923
4067
  throw takeFromExternrefTable0(ret[0]);
3924
4068
  }
3925
4069
  }
3926
4070
 
3927
- function wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_6(arg0, arg1, arg2) {
3928
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_6(arg0, arg1, arg2);
4071
+ function wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_6(arg0, arg1, arg2) {
4072
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_6(arg0, arg1, arg2);
3929
4073
  if (ret[1]) {
3930
4074
  throw takeFromExternrefTable0(ret[0]);
3931
4075
  }
3932
4076
  }
3933
4077
 
3934
- function wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_7(arg0, arg1, arg2) {
3935
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_7(arg0, arg1, arg2);
4078
+ function wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_7(arg0, arg1, arg2) {
4079
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_7(arg0, arg1, arg2);
3936
4080
  if (ret[1]) {
3937
4081
  throw takeFromExternrefTable0(ret[0]);
3938
4082
  }
3939
4083
  }
3940
4084
 
3941
- function wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_8(arg0, arg1, arg2) {
3942
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_8(arg0, arg1, arg2);
4085
+ function wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_8(arg0, arg1, arg2) {
4086
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_8(arg0, arg1, arg2);
3943
4087
  if (ret[1]) {
3944
4088
  throw takeFromExternrefTable0(ret[0]);
3945
4089
  }
3946
4090
  }
3947
4091
 
3948
- function wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_9(arg0, arg1, arg2) {
3949
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_9(arg0, arg1, arg2);
4092
+ function wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_9(arg0, arg1, arg2) {
4093
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_9(arg0, arg1, arg2);
3950
4094
  if (ret[1]) {
3951
4095
  throw takeFromExternrefTable0(ret[0]);
3952
4096
  }
@@ -3982,6 +4126,12 @@ const BitcoinChainServiceHandleFinalization = (typeof FinalizationRegistry === '
3982
4126
  const BreezSdkFinalization = (typeof FinalizationRegistry === 'undefined')
3983
4127
  ? { register: () => {}, unregister: () => {} }
3984
4128
  : new FinalizationRegistry(ptr => wasm.__wbg_breezsdk_free(ptr, 1));
4129
+ const BridgingClientFinalization = (typeof FinalizationRegistry === 'undefined')
4130
+ ? { register: () => {}, unregister: () => {} }
4131
+ : new FinalizationRegistry(ptr => wasm.__wbg_bridgingclient_free(ptr, 1));
4132
+ const ConsoleLoggerFinalization = (typeof FinalizationRegistry === 'undefined')
4133
+ ? { register: () => {}, unregister: () => {} }
4134
+ : new FinalizationRegistry(ptr => wasm.__wbg_consolelogger_free(ptr, 1));
3985
4135
  const DefaultCpfpSignerFinalization = (typeof FinalizationRegistry === 'undefined')
3986
4136
  ? { register: () => {}, unregister: () => {} }
3987
4137
  : new FinalizationRegistry(ptr => wasm.__wbg_defaultcpfpsigner_free(ptr, 1));
@@ -3,6 +3,8 @@
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const __wbg_bitcoinchainservicehandle_free: (a: number, b: number) => void;
5
5
  export const __wbg_breezsdk_free: (a: number, b: number) => void;
6
+ export const __wbg_bridgingclient_free: (a: number, b: number) => void;
7
+ export const __wbg_consolelogger_free: (a: number, b: number) => void;
6
8
  export const __wbg_defaultcpfpsigner_free: (a: number, b: number) => void;
7
9
  export const __wbg_externalsigners_free: (a: number, b: number) => void;
8
10
  export const __wbg_passkeyclient_free: (a: number, b: number) => void;
@@ -42,6 +44,7 @@ export const breezsdk_disconnect: (a: number) => any;
42
44
  export const breezsdk_exportUnilateralExitState: (a: number) => any;
43
45
  export const breezsdk_fetchClaimDepositQuote: (a: number, b: any) => any;
44
46
  export const breezsdk_fetchConversionLimits: (a: number, b: any) => any;
47
+ export const breezsdk_getBridgingClient: (a: number) => [number, number, number];
45
48
  export const breezsdk_getCrossChainRoutes: (a: number, b: any) => any;
46
49
  export const breezsdk_getInfo: (a: number, b: any) => any;
47
50
  export const breezsdk_getLightningAddress: (a: number) => any;
@@ -88,11 +91,19 @@ export const breezsdk_syncWallet: (a: number, b: any) => any;
88
91
  export const breezsdk_unregisterWebhook: (a: number, b: any) => any;
89
92
  export const breezsdk_updateContact: (a: number, b: any) => any;
90
93
  export const breezsdk_updateUserSettings: (a: number, b: any) => any;
94
+ export const bridgingclient_bridgeFromCashApp: (a: number, b: any) => any;
95
+ export const bridgingclient_bridgeToCashApp: (a: number, b: any) => any;
96
+ export const bridgingclient_createBridge: (a: number, b: any) => any;
97
+ export const bridgingclient_getBridgeStatus: (a: number, b: any) => any;
98
+ export const bridgingclient_getRoutes: (a: number, b: any) => any;
91
99
  export const connect: (a: any) => any;
92
100
  export const connectWithSigner: (a: any, b: any, c: any, d: number, e: number) => any;
93
101
  export const connectWithSigningOnlySigner: (a: any, b: any, c: any, d: number, e: number) => any;
102
+ export const consolelogger_log: (a: number, b: any) => void;
103
+ export const consolelogger_new: () => number;
94
104
  export const createTurnkeySigner: (a: any) => any;
95
105
  export const createTurnkeySigningOnlySigner: (a: any) => any;
106
+ export const defaultBridgingConfig: (a: number, b: number) => any;
96
107
  export const defaultConfig: (a: any) => any;
97
108
  export const defaultExternalSigners: (a: number, b: number, c: number, d: number, e: any, f: number) => [number, number, number];
98
109
  export const defaultMysqlStorageConfig: (a: number, b: number) => any;
@@ -138,6 +149,7 @@ export const externalsparksignerhandle_startWatchtowerExitRecovery: (a: number,
138
149
  export const getSparkStatus: () => any;
139
150
  export const initLogging: (a: any, b: number, c: number) => any;
140
151
  export const mysqlStorage: (a: any) => number;
152
+ export const newBridgingClient: (a: any) => any;
141
153
  export const newRestChainService: (a: number, b: number, c: any, d: any, e: number) => any;
142
154
  export const newSharedSdkContext: (a: any) => any;
143
155
  export const parseSparkConfig: (a: number, b: number) => [number, number, number];
@@ -202,18 +214,18 @@ export const __wbg_externalsigningsignerhandle_free: (a: number, b: number) => v
202
214
  export const __wbg_signingonlyexternalsigners_free: (a: number, b: number) => void;
203
215
  export const signingonlyexternalsigners_breezSigner: (a: number) => number;
204
216
  export const signingonlyexternalsigners_sparkSigner: (a: number) => number;
205
- export const wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31: (a: number, b: number, c: any) => [number, number];
206
- export const wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_6: (a: number, b: number, c: any) => [number, number];
207
- export const wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_7: (a: number, b: number, c: any) => [number, number];
208
- export const wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_8: (a: number, b: number, c: any) => [number, number];
209
- export const wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_9: (a: number, b: number, c: any) => [number, number];
217
+ export const wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92: (a: number, b: number, c: any) => [number, number];
218
+ export const wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_6: (a: number, b: number, c: any) => [number, number];
219
+ export const wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_7: (a: number, b: number, c: any) => [number, number];
220
+ export const wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_8: (a: number, b: number, c: any) => [number, number];
221
+ export const wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_9: (a: number, b: number, c: any) => [number, number];
210
222
  export const wasm_bindgen__convert__closures_____invoke__h118cfc65b353d9fd: (a: number, b: number, c: any, d: any) => void;
211
- export const wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed: (a: number, b: number, c: any) => void;
212
- export const wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_2: (a: number, b: number, c: any) => void;
213
- export const wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_3: (a: number, b: number, c: any) => void;
214
- export const wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_4: (a: number, b: number, c: any) => void;
215
- export const wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_5: (a: number, b: number, c: any) => void;
216
- export const wasm_bindgen__convert__closures_____invoke__h02848814aa3937de: (a: number, b: number) => void;
223
+ export const wasm_bindgen__convert__closures_____invoke__h168b325370d2795a: (a: number, b: number, c: any) => void;
224
+ export const wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_2: (a: number, b: number, c: any) => void;
225
+ export const wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_3: (a: number, b: number, c: any) => void;
226
+ export const wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_4: (a: number, b: number, c: any) => void;
227
+ export const wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_5: (a: number, b: number, c: any) => void;
228
+ export const wasm_bindgen__convert__closures_____invoke__h8a05c61e16e49565: (a: number, b: number) => void;
217
229
  export const __wbindgen_malloc: (a: number, b: number) => number;
218
230
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
219
231
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
package/bundler/index.js CHANGED
@@ -7,31 +7,24 @@ let storageSetupComplete = false;
7
7
  const setupWebStorage = async () => {
8
8
  if (storageSetupComplete) return;
9
9
 
10
+ // The WASM bridge calls the storage factories as globals. When a storage module fails to
11
+ // load, its factory rejects with the load error, so only an app that uses that storage
12
+ // gets it.
10
13
  try {
11
- // Dynamic import of storage module
12
14
  const { createDefaultStorage } = await import('./storage/index.js');
13
-
14
- // Make createDefaultStorage available globally for WASM to find
15
15
  globalThis.createDefaultStorage = createDefaultStorage;
16
-
17
- console.log('Breez SDK: Web IndexedDB storage automatically enabled');
18
16
  storageSetupComplete = true;
19
17
  } catch (error) {
20
- console.warn('Breez SDK: Failed to load Web storage:', error.message);
21
- console.warn('Breez SDK: Storage operations may not work properly. Ignore this warning if you are not using the default storage.');
18
+ globalThis.createDefaultStorage = () => Promise.reject(error);
22
19
  }
23
20
 
24
21
  try {
25
- // Dynamic import of the IndexedDB tree store module
22
+ // The browser tree store uses its own `-tree` database.
26
23
  const { createWebTreeStore } = await import('./tree-store/index.js');
27
-
28
- // Make createDefaultTreeStore available globally for the WASM bridge to
29
- // find. The browser store uses its own `-tree` database.
30
24
  globalThis.createDefaultTreeStore = (dbName, logger) =>
31
25
  createWebTreeStore(`${dbName}-tree`, logger);
32
26
  } catch (error) {
33
- console.warn('Breez SDK: Failed to load Web tree store:', error.message);
34
- console.warn('Breez SDK: Tree state will not be persisted. Ignore this warning if you are not using the default storage.');
27
+ globalThis.createDefaultTreeStore = () => Promise.reject(error);
35
28
  }
36
29
  };
37
30