@breeztech/breez-sdk-spark 0.27.2 → 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
@@ -145,6 +145,7 @@ export class BreezSdk {
145
145
  return ret;
146
146
  }
147
147
  /**
148
+ * @deprecated Use `bridgeFromCashApp` on the client from `getBridgingClient`.
148
149
  * @param {BridgeFromCashAppRequest} request
149
150
  * @returns {Promise<BridgeFromCashAppResponse>}
150
151
  */
@@ -153,6 +154,7 @@ export class BreezSdk {
153
154
  return ret;
154
155
  }
155
156
  /**
157
+ * @deprecated Use `bridgeToCashApp` on the client from `getBridgingClient`.
156
158
  * @param {BridgeToCashAppRequest} request
157
159
  * @returns {Promise<BridgeToCashAppResponse>}
158
160
  */
@@ -303,6 +305,16 @@ export class BreezSdk {
303
305
  const ret = wasm.breezsdk_fetchConversionLimits(this.__wbg_ptr, request);
304
306
  return ret;
305
307
  }
308
+ /**
309
+ * @returns {BridgingClient}
310
+ */
311
+ getBridgingClient() {
312
+ const ret = wasm.breezsdk_getBridgingClient(this.__wbg_ptr);
313
+ if (ret[2]) {
314
+ throw takeFromExternrefTable0(ret[1]);
315
+ }
316
+ return BridgingClient.__wrap(ret[0]);
317
+ }
306
318
  /**
307
319
  * @param {CrossChainRouteFilter} filter
308
320
  * @returns {Promise<CrossChainRoutePair[]>}
@@ -468,7 +480,7 @@ export class BreezSdk {
468
480
  return ret;
469
481
  }
470
482
  /**
471
- * @deprecated Use `bridgeFromCashApp`.
483
+ * @deprecated Use `bridgeFromCashApp` on the client from `getBridgingClient`.
472
484
  * @param {PreparePaymentLinkRequest} request
473
485
  * @returns {Promise<PreparePaymentLinkResponse>}
474
486
  */
@@ -672,6 +684,100 @@ export class BreezSdk {
672
684
  }
673
685
  if (Symbol.dispose) BreezSdk.prototype[Symbol.dispose] = BreezSdk.prototype.free;
674
686
 
687
+ /**
688
+ * Creates bridges: orders that pay a recipient from another chain or over
689
+ * Lightning, with no funds moving through the SDK. Only available on mainnet.
690
+ */
691
+ export class BridgingClient {
692
+ static __wrap(ptr) {
693
+ const obj = Object.create(BridgingClient.prototype);
694
+ obj.__wbg_ptr = ptr;
695
+ BridgingClientFinalization.register(obj, obj.__wbg_ptr, obj);
696
+ return obj;
697
+ }
698
+ __destroy_into_raw() {
699
+ const ptr = this.__wbg_ptr;
700
+ this.__wbg_ptr = 0;
701
+ BridgingClientFinalization.unregister(this);
702
+ return ptr;
703
+ }
704
+ free() {
705
+ const ptr = this.__destroy_into_raw();
706
+ wasm.__wbg_bridgingclient_free(ptr, 0);
707
+ }
708
+ /**
709
+ * @param {CreateBridgeRequest} request
710
+ * @returns {Promise<CreateBridgeResponse>}
711
+ */
712
+ bridgeFromCashApp(request) {
713
+ const ret = wasm.bridgingclient_bridgeFromCashApp(this.__wbg_ptr, request);
714
+ return ret;
715
+ }
716
+ /**
717
+ * @param {CreateBridgeRequest} request
718
+ * @returns {Promise<CreateBridgeResponse>}
719
+ */
720
+ bridgeToCashApp(request) {
721
+ const ret = wasm.bridgingclient_bridgeToCashApp(this.__wbg_ptr, request);
722
+ return ret;
723
+ }
724
+ /**
725
+ * @param {CreateBridgeRequest} request
726
+ * @returns {Promise<CreateBridgeResponse>}
727
+ */
728
+ createBridge(request) {
729
+ const ret = wasm.bridgingclient_createBridge(this.__wbg_ptr, request);
730
+ return ret;
731
+ }
732
+ /**
733
+ * @param {GetBridgeStatusRequest} request
734
+ * @returns {Promise<GetBridgeStatusResponse>}
735
+ */
736
+ getBridgeStatus(request) {
737
+ const ret = wasm.bridgingclient_getBridgeStatus(this.__wbg_ptr, request);
738
+ return ret;
739
+ }
740
+ /**
741
+ * @param {GetBridgeRoutesRequest} request
742
+ * @returns {Promise<GetBridgeRoutesResponse>}
743
+ */
744
+ getRoutes(request) {
745
+ const ret = wasm.bridgingclient_getRoutes(this.__wbg_ptr, request);
746
+ return ret;
747
+ }
748
+ }
749
+ if (Symbol.dispose) BridgingClient.prototype[Symbol.dispose] = BridgingClient.prototype.free;
750
+
751
+ /**
752
+ * A logger that prints each log entry to the JavaScript console, with the console method that
753
+ * matches the entry's level.
754
+ */
755
+ export class ConsoleLogger {
756
+ __destroy_into_raw() {
757
+ const ptr = this.__wbg_ptr;
758
+ this.__wbg_ptr = 0;
759
+ ConsoleLoggerFinalization.unregister(this);
760
+ return ptr;
761
+ }
762
+ free() {
763
+ const ptr = this.__destroy_into_raw();
764
+ wasm.__wbg_consolelogger_free(ptr, 0);
765
+ }
766
+ /**
767
+ * @param {LogEntry} entry
768
+ */
769
+ log(entry) {
770
+ wasm.consolelogger_log(this.__wbg_ptr, entry);
771
+ }
772
+ constructor() {
773
+ const ret = wasm.consolelogger_new();
774
+ this.__wbg_ptr = ret;
775
+ ConsoleLoggerFinalization.register(this, this.__wbg_ptr, this);
776
+ return this;
777
+ }
778
+ }
779
+ if (Symbol.dispose) ConsoleLogger.prototype[Symbol.dispose] = ConsoleLogger.prototype.free;
780
+
675
781
  /**
676
782
  * A CPFP signer matching the `CpfpSigner` TypeScript interface.
677
783
  */
@@ -1867,6 +1973,18 @@ export function createTurnkeySigningOnlySigner(config) {
1867
1973
  return ret;
1868
1974
  }
1869
1975
 
1976
+ /**
1977
+ * Settings for `newBridgingClient` with every optional field unset.
1978
+ * @param {string} api_key
1979
+ * @returns {BridgingConfig}
1980
+ */
1981
+ export function defaultBridgingConfig(api_key) {
1982
+ const ptr0 = passStringToWasm0(api_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1983
+ const len0 = WASM_VECTOR_LEN;
1984
+ const ret = wasm.defaultBridgingConfig(ptr0, len0);
1985
+ return ret;
1986
+ }
1987
+
1870
1988
  /**
1871
1989
  * @param {Network} network
1872
1990
  * @returns {Config}
@@ -2004,6 +2122,16 @@ export function mysqlStorage(config) {
2004
2122
  return WasmStorageConfig.__wrap(ret);
2005
2123
  }
2006
2124
 
2125
+ /**
2126
+ * Builds a `BridgingClient` from an API key, with no seed or storage.
2127
+ * @param {BridgingConfig} config
2128
+ * @returns {Promise<BridgingClient>}
2129
+ */
2130
+ export function newBridgingClient(config) {
2131
+ const ret = wasm.newBridgingClient(config);
2132
+ return ret;
2133
+ }
2134
+
2007
2135
  /**
2008
2136
  * Constructs a shareable REST-based Bitcoin chain service.
2009
2137
  *
@@ -2259,6 +2387,10 @@ function __wbg_get_imports() {
2259
2387
  const ret = BreezSdk.__wrap(arg0);
2260
2388
  return ret;
2261
2389
  },
2390
+ __wbg_bridgingclient_new: function(arg0) {
2391
+ const ret = BridgingClient.__wrap(arg0);
2392
+ return ret;
2393
+ },
2262
2394
  __wbg_broadcastTransaction_f298d093a11def5e: function() { return handleError(function (arg0, arg1, arg2) {
2263
2395
  let deferred0_0;
2264
2396
  let deferred0_1;
@@ -2411,6 +2543,9 @@ function __wbg_get_imports() {
2411
2543
  const ret = arg0.data;
2412
2544
  return ret;
2413
2545
  },
2546
+ __wbg_debug_37240d2c1d0ce2bb: function(arg0) {
2547
+ console.debug(arg0);
2548
+ },
2414
2549
  __wbg_decryptEcies_ebe426814020926b: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2415
2550
  let deferred1_0;
2416
2551
  let deferred1_1;
@@ -2538,6 +2673,9 @@ function __wbg_get_imports() {
2538
2673
  __wbg_error_145dadf4216d70bc: function(arg0, arg1) {
2539
2674
  console.error(getStringFromWasm0(arg0, arg1));
2540
2675
  },
2676
+ __wbg_error_48655ee7e4756f8b: function(arg0) {
2677
+ console.error(arg0);
2678
+ },
2541
2679
  __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
2542
2680
  let deferred0_0;
2543
2681
  let deferred0_1;
@@ -2860,6 +2998,9 @@ function __wbg_get_imports() {
2860
2998
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2861
2999
  }
2862
3000
  }, arguments); },
3001
+ __wbg_info_092aeeab8cd06a0b: function(arg0) {
3002
+ console.info(arg0);
3003
+ },
2863
3004
  __wbg_insertContact_cc39397cb8e88ff8: function() { return handleError(function (arg0, arg1) {
2864
3005
  const ret = arg0.insertContact(arg1);
2865
3006
  return ret;
@@ -3758,63 +3899,66 @@ function __wbg_get_imports() {
3758
3899
  const ret = arg0.view;
3759
3900
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3760
3901
  },
3902
+ __wbg_warn_1f9b94806da61fbb: function(arg0) {
3903
+ console.warn(arg0);
3904
+ },
3761
3905
  __wbg_wasmsdkcontext_new: function(arg0) {
3762
3906
  const ret = WasmSdkContext.__wrap(arg0);
3763
3907
  return ret;
3764
3908
  },
3765
3909
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
3766
3910
  // 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`.
3767
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31);
3911
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92);
3768
3912
  return ret;
3769
3913
  },
3770
3914
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
3771
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 474, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3772
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed);
3915
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 479, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3916
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h168b325370d2795a);
3773
3917
  return ret;
3774
3918
  },
3775
3919
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
3776
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 474, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3777
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_2);
3920
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 479, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3921
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_2);
3778
3922
  return ret;
3779
3923
  },
3780
3924
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
3781
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 474, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3782
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_3);
3925
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 479, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3926
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_3);
3783
3927
  return ret;
3784
3928
  },
3785
3929
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
3786
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 474, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3787
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_4);
3930
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 479, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3931
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_4);
3788
3932
  return ret;
3789
3933
  },
3790
3934
  __wbindgen_cast_0000000000000006: function(arg0, arg1) {
3791
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 474, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3792
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_5);
3935
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 479, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3936
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_5);
3793
3937
  return ret;
3794
3938
  },
3795
3939
  __wbindgen_cast_0000000000000007: function(arg0, arg1) {
3796
3940
  // 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`.
3797
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_6);
3941
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_6);
3798
3942
  return ret;
3799
3943
  },
3800
3944
  __wbindgen_cast_0000000000000008: function(arg0, arg1) {
3801
3945
  // 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`.
3802
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_7);
3946
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_7);
3803
3947
  return ret;
3804
3948
  },
3805
3949
  __wbindgen_cast_0000000000000009: function(arg0, arg1) {
3806
3950
  // 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`.
3807
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_8);
3951
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_8);
3808
3952
  return ret;
3809
3953
  },
3810
3954
  __wbindgen_cast_000000000000000a: function(arg0, arg1) {
3811
3955
  // 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`.
3812
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_9);
3956
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_9);
3813
3957
  return ret;
3814
3958
  },
3815
3959
  __wbindgen_cast_000000000000000b: function(arg0, arg1) {
3816
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 864, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3817
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h02848814aa3937de);
3960
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 875, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3961
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h8a05c61e16e49565);
3818
3962
  return ret;
3819
3963
  },
3820
3964
  __wbindgen_cast_000000000000000c: function(arg0) {
@@ -3905,60 +4049,60 @@ function __wbg_get_imports() {
3905
4049
  };
3906
4050
  }
3907
4051
 
3908
- function wasm_bindgen__convert__closures_____invoke__h02848814aa3937de(arg0, arg1) {
3909
- wasm.wasm_bindgen__convert__closures_____invoke__h02848814aa3937de(arg0, arg1);
4052
+ function wasm_bindgen__convert__closures_____invoke__h8a05c61e16e49565(arg0, arg1) {
4053
+ wasm.wasm_bindgen__convert__closures_____invoke__h8a05c61e16e49565(arg0, arg1);
3910
4054
  }
3911
4055
 
3912
- function wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed(arg0, arg1, arg2) {
3913
- wasm.wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed(arg0, arg1, arg2);
4056
+ function wasm_bindgen__convert__closures_____invoke__h168b325370d2795a(arg0, arg1, arg2) {
4057
+ wasm.wasm_bindgen__convert__closures_____invoke__h168b325370d2795a(arg0, arg1, arg2);
3914
4058
  }
3915
4059
 
3916
- function wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_2(arg0, arg1, arg2) {
3917
- wasm.wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_2(arg0, arg1, arg2);
4060
+ function wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_2(arg0, arg1, arg2) {
4061
+ wasm.wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_2(arg0, arg1, arg2);
3918
4062
  }
3919
4063
 
3920
- function wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_3(arg0, arg1, arg2) {
3921
- wasm.wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_3(arg0, arg1, arg2);
4064
+ function wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_3(arg0, arg1, arg2) {
4065
+ wasm.wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_3(arg0, arg1, arg2);
3922
4066
  }
3923
4067
 
3924
- function wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_4(arg0, arg1, arg2) {
3925
- wasm.wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_4(arg0, arg1, arg2);
4068
+ function wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_4(arg0, arg1, arg2) {
4069
+ wasm.wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_4(arg0, arg1, arg2);
3926
4070
  }
3927
4071
 
3928
- function wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_5(arg0, arg1, arg2) {
3929
- wasm.wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_5(arg0, arg1, arg2);
4072
+ function wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_5(arg0, arg1, arg2) {
4073
+ wasm.wasm_bindgen__convert__closures_____invoke__h168b325370d2795a_5(arg0, arg1, arg2);
3930
4074
  }
3931
4075
 
3932
- function wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31(arg0, arg1, arg2) {
3933
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31(arg0, arg1, arg2);
4076
+ function wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92(arg0, arg1, arg2) {
4077
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92(arg0, arg1, arg2);
3934
4078
  if (ret[1]) {
3935
4079
  throw takeFromExternrefTable0(ret[0]);
3936
4080
  }
3937
4081
  }
3938
4082
 
3939
- function wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_6(arg0, arg1, arg2) {
3940
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_6(arg0, arg1, arg2);
4083
+ function wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_6(arg0, arg1, arg2) {
4084
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_6(arg0, arg1, arg2);
3941
4085
  if (ret[1]) {
3942
4086
  throw takeFromExternrefTable0(ret[0]);
3943
4087
  }
3944
4088
  }
3945
4089
 
3946
- function wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_7(arg0, arg1, arg2) {
3947
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_7(arg0, arg1, arg2);
4090
+ function wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_7(arg0, arg1, arg2) {
4091
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_7(arg0, arg1, arg2);
3948
4092
  if (ret[1]) {
3949
4093
  throw takeFromExternrefTable0(ret[0]);
3950
4094
  }
3951
4095
  }
3952
4096
 
3953
- function wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_8(arg0, arg1, arg2) {
3954
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_8(arg0, arg1, arg2);
4097
+ function wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_8(arg0, arg1, arg2) {
4098
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_8(arg0, arg1, arg2);
3955
4099
  if (ret[1]) {
3956
4100
  throw takeFromExternrefTable0(ret[0]);
3957
4101
  }
3958
4102
  }
3959
4103
 
3960
- function wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_9(arg0, arg1, arg2) {
3961
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_9(arg0, arg1, arg2);
4104
+ function wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_9(arg0, arg1, arg2) {
4105
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h43ca79db2f165a92_9(arg0, arg1, arg2);
3962
4106
  if (ret[1]) {
3963
4107
  throw takeFromExternrefTable0(ret[0]);
3964
4108
  }
@@ -3994,6 +4138,12 @@ const BitcoinChainServiceHandleFinalization = (typeof FinalizationRegistry === '
3994
4138
  const BreezSdkFinalization = (typeof FinalizationRegistry === 'undefined')
3995
4139
  ? { register: () => {}, unregister: () => {} }
3996
4140
  : new FinalizationRegistry(ptr => wasm.__wbg_breezsdk_free(ptr, 1));
4141
+ const BridgingClientFinalization = (typeof FinalizationRegistry === 'undefined')
4142
+ ? { register: () => {}, unregister: () => {} }
4143
+ : new FinalizationRegistry(ptr => wasm.__wbg_bridgingclient_free(ptr, 1));
4144
+ const ConsoleLoggerFinalization = (typeof FinalizationRegistry === 'undefined')
4145
+ ? { register: () => {}, unregister: () => {} }
4146
+ : new FinalizationRegistry(ptr => wasm.__wbg_consolelogger_free(ptr, 1));
3997
4147
  const DefaultCpfpSignerFinalization = (typeof FinalizationRegistry === 'undefined')
3998
4148
  ? { register: () => {}, unregister: () => {} }
3999
4149
  : new FinalizationRegistry(ptr => wasm.__wbg_defaultcpfpsigner_free(ptr, 1));
Binary file
@@ -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/web/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
 
@@ -482,6 +482,7 @@ export class PasskeyProvider {
482
482
  } else {
483
483
  // Surface the fallback: silently using standard mediation
484
484
  // hides why a single-CTA probe still shows a sheet.
485
+ // eslint-disable-next-line no-console
485
486
  console.debug('breez-sdk: preferImmediatelyAvailableCredentials set but immediate UI mode is unsupported by this browser; using standard mediation');
486
487
  }
487
488
  }