@breeztech/breez-sdk-spark 0.12.2 → 0.12.3

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 (35) hide show
  1. package/README.md +68 -69
  2. package/breez-sdk-spark.tgz +0 -0
  3. package/bundler/breez_sdk_spark_wasm.d.ts +734 -602
  4. package/bundler/breez_sdk_spark_wasm_bg.js +175 -78
  5. package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
  6. package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +8 -6
  7. package/bundler/storage/index.js +65 -43
  8. package/deno/breez_sdk_spark_wasm.d.ts +734 -602
  9. package/deno/breez_sdk_spark_wasm.js +165 -78
  10. package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
  11. package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +8 -6
  12. package/nodejs/breez_sdk_spark_wasm.d.ts +734 -602
  13. package/nodejs/breez_sdk_spark_wasm.js +175 -78
  14. package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
  15. package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +8 -6
  16. package/nodejs/index.js +16 -2
  17. package/nodejs/index.mjs +25 -0
  18. package/nodejs/package.json +3 -1
  19. package/nodejs/postgres-storage/index.cjs +42 -31
  20. package/nodejs/postgres-storage/migrations.cjs +24 -0
  21. package/nodejs/postgres-token-store/errors.cjs +13 -0
  22. package/nodejs/postgres-token-store/index.cjs +857 -0
  23. package/nodejs/postgres-token-store/migrations.cjs +163 -0
  24. package/nodejs/postgres-token-store/package.json +9 -0
  25. package/nodejs/postgres-tree-store/index.cjs +12 -2
  26. package/nodejs/storage/index.cjs +19 -28
  27. package/nodejs/storage/migrations.cjs +18 -0
  28. package/package.json +7 -2
  29. package/ssr/index.d.ts +2 -0
  30. package/ssr/index.js +126 -0
  31. package/web/breez_sdk_spark_wasm.d.ts +742 -608
  32. package/web/breez_sdk_spark_wasm.js +165 -78
  33. package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
  34. package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +8 -6
  35. package/web/storage/index.js +65 -43
@@ -230,39 +230,6 @@ export function defaultPostgresStorageConfig(connection_string) {
230
230
  return ret;
231
231
  }
232
232
 
233
- /**
234
- * Creates a default external signer from a mnemonic phrase.
235
- *
236
- * This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
237
- * @returns {Promise<SparkStatus>}
238
- */
239
- export function getSparkStatus() {
240
- const ret = wasm.getSparkStatus();
241
- return ret;
242
- }
243
-
244
- /**
245
- * @param {Config} config
246
- * @param {ExternalSigner} signer
247
- * @param {string} storage_dir
248
- * @returns {Promise<BreezSdk>}
249
- */
250
- export function connectWithSigner(config, signer, storage_dir) {
251
- const ptr0 = passStringToWasm0(storage_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
252
- const len0 = WASM_VECTOR_LEN;
253
- const ret = wasm.connectWithSigner(config, signer, ptr0, len0);
254
- return ret;
255
- }
256
-
257
- /**
258
- * @param {ConnectRequest} request
259
- * @returns {Promise<BreezSdk>}
260
- */
261
- export function connect(request) {
262
- const ret = wasm.connect(request);
263
- return ret;
264
- }
265
-
266
233
  /**
267
234
  * @param {Network} network
268
235
  * @returns {Config}
@@ -272,18 +239,6 @@ export function defaultConfig(network) {
272
239
  return ret;
273
240
  }
274
241
 
275
- /**
276
- * @param {Logger} logger
277
- * @param {string | null} [filter]
278
- * @returns {Promise<void>}
279
- */
280
- export function initLogging(logger, filter) {
281
- var ptr0 = isLikeNone(filter) ? 0 : passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
282
- var len0 = WASM_VECTOR_LEN;
283
- const ret = wasm.initLogging(logger, ptr0, len0);
284
- return ret;
285
- }
286
-
287
242
  function takeFromExternrefTable0(idx) {
288
243
  const value = wasm.__wbindgen_export_5.get(idx);
289
244
  wasm.__externref_table_dealloc(idx);
@@ -308,6 +263,51 @@ export function defaultExternalSigner(mnemonic, passphrase, network, key_set_con
308
263
  return DefaultSigner.__wrap(ret[0]);
309
264
  }
310
265
 
266
+ /**
267
+ * @param {Logger} logger
268
+ * @param {string | null} [filter]
269
+ * @returns {Promise<void>}
270
+ */
271
+ export function initLogging(logger, filter) {
272
+ var ptr0 = isLikeNone(filter) ? 0 : passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
273
+ var len0 = WASM_VECTOR_LEN;
274
+ const ret = wasm.initLogging(logger, ptr0, len0);
275
+ return ret;
276
+ }
277
+
278
+ /**
279
+ * @param {Config} config
280
+ * @param {ExternalSigner} signer
281
+ * @param {string} storage_dir
282
+ * @returns {Promise<BreezSdk>}
283
+ */
284
+ export function connectWithSigner(config, signer, storage_dir) {
285
+ const ptr0 = passStringToWasm0(storage_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
286
+ const len0 = WASM_VECTOR_LEN;
287
+ const ret = wasm.connectWithSigner(config, signer, ptr0, len0);
288
+ return ret;
289
+ }
290
+
291
+ /**
292
+ * Creates a default external signer from a mnemonic phrase.
293
+ *
294
+ * This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
295
+ * @returns {Promise<SparkStatus>}
296
+ */
297
+ export function getSparkStatus() {
298
+ const ret = wasm.getSparkStatus();
299
+ return ret;
300
+ }
301
+
302
+ /**
303
+ * @param {ConnectRequest} request
304
+ * @returns {Promise<BreezSdk>}
305
+ */
306
+ export function connect(request) {
307
+ const ret = wasm.connect(request);
308
+ return ret;
309
+ }
310
+
311
311
  function passArray8ToWasm0(arg, malloc) {
312
312
  const ptr = malloc(arg.length * 1, 1) >>> 0;
313
313
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -326,15 +326,15 @@ export function task_worker_entry_point(ptr) {
326
326
  }
327
327
 
328
328
  function __wbg_adapter_64(arg0, arg1, arg2) {
329
- wasm.closure444_externref_shim(arg0, arg1, arg2);
329
+ wasm.closure383_externref_shim(arg0, arg1, arg2);
330
330
  }
331
331
 
332
332
  function __wbg_adapter_69(arg0, arg1) {
333
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1bbbe552b190da27(arg0, arg1);
333
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h140914a8cfe47e73(arg0, arg1);
334
334
  }
335
335
 
336
- function __wbg_adapter_373(arg0, arg1, arg2, arg3) {
337
- wasm.closure711_externref_shim(arg0, arg1, arg2, arg3);
336
+ function __wbg_adapter_423(arg0, arg1, arg2, arg3) {
337
+ wasm.closure661_externref_shim(arg0, arg1, arg2, arg3);
338
338
  }
339
339
 
340
340
  const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
@@ -471,6 +471,13 @@ export class BreezSdk {
471
471
  const ret = wasm.breezsdk_listPayments(this.__wbg_ptr, request);
472
472
  return ret;
473
473
  }
474
+ /**
475
+ * @returns {Promise<Webhook[]>}
476
+ */
477
+ listWebhooks() {
478
+ const ret = wasm.breezsdk_listWebhooks(this.__wbg_ptr);
479
+ return ret;
480
+ }
474
481
  /**
475
482
  * @param {string} id
476
483
  * @returns {Promise<void>}
@@ -534,6 +541,14 @@ export class BreezSdk {
534
541
  const ret = wasm.breezsdk_recommendedFees(this.__wbg_ptr);
535
542
  return ret;
536
543
  }
544
+ /**
545
+ * @param {RegisterWebhookRequest} request
546
+ * @returns {Promise<RegisterWebhookResponse>}
547
+ */
548
+ registerWebhook(request) {
549
+ const ret = wasm.breezsdk_registerWebhook(this.__wbg_ptr, request);
550
+ return ret;
551
+ }
537
552
  /**
538
553
  * @returns {Promise<UserSettings>}
539
554
  */
@@ -565,6 +580,14 @@ export class BreezSdk {
565
580
  const ret = wasm.breezsdk_claimHtlcPayment(this.__wbg_ptr, request);
566
581
  return ret;
567
582
  }
583
+ /**
584
+ * @param {UnregisterWebhookRequest} request
585
+ * @returns {Promise<void>}
586
+ */
587
+ unregisterWebhook(request) {
588
+ const ret = wasm.breezsdk_unregisterWebhook(this.__wbg_ptr, request);
589
+ return ret;
590
+ }
568
591
  /**
569
592
  * @param {GetTokensMetadataRequest} request
570
593
  * @returns {Promise<GetTokensMetadataResponse>}
@@ -629,8 +652,12 @@ export class BreezSdk {
629
652
  const ret = wasm.breezsdk_listUnclaimedDeposits(this.__wbg_ptr, request);
630
653
  return ret;
631
654
  }
655
+ /**
656
+ * @returns {Promise<void>}
657
+ */
632
658
  startLeafOptimization() {
633
- wasm.breezsdk_startLeafOptimization(this.__wbg_ptr);
659
+ const ret = wasm.breezsdk_startLeafOptimization(this.__wbg_ptr);
660
+ return ret;
634
661
  }
635
662
  /**
636
663
  * @returns {Promise<void>}
@@ -1233,9 +1260,9 @@ export class SdkBuilder {
1233
1260
  * @param {PostgresStorageConfig} config
1234
1261
  * @returns {SdkBuilder}
1235
1262
  */
1236
- withPostgresStorage(config) {
1263
+ withPostgresBackend(config) {
1237
1264
  const ptr = this.__destroy_into_raw();
1238
- const ret = wasm.sdkbuilder_withPostgresStorage(ptr, config);
1265
+ const ret = wasm.sdkbuilder_withPostgresBackend(ptr, config);
1239
1266
  return SdkBuilder.__wrap(ret);
1240
1267
  }
1241
1268
  /**
@@ -1251,15 +1278,6 @@ export class SdkBuilder {
1251
1278
  const ret = wasm.sdkbuilder_withRestChainService(ptr, ptr0, len0, api_type, isLikeNone(credentials) ? 0 : addToExternrefTable0(credentials));
1252
1279
  return SdkBuilder.__wrap(ret);
1253
1280
  }
1254
- /**
1255
- * @param {PostgresStorageConfig} config
1256
- * @returns {SdkBuilder}
1257
- */
1258
- withPostgresTreeStore(config) {
1259
- const ptr = this.__destroy_into_raw();
1260
- const ret = wasm.sdkbuilder_withPostgresTreeStore(ptr, config);
1261
- return SdkBuilder.__wrap(ret);
1262
- }
1263
1281
  /**
1264
1282
  * @param {Config} config
1265
1283
  * @param {Seed} seed
@@ -1407,13 +1425,13 @@ function __wbg_get_imports() {
1407
1425
  imports.wbg.__wbg_abort_775ef1d17fc65868 = function(arg0) {
1408
1426
  arg0.abort();
1409
1427
  };
1410
- imports.wbg.__wbg_addDeposit_5b1f93e7014f1e18 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1428
+ imports.wbg.__wbg_addDeposit_42b1593db58de120 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
1411
1429
  let deferred0_0;
1412
1430
  let deferred0_1;
1413
1431
  try {
1414
1432
  deferred0_0 = arg1;
1415
1433
  deferred0_1 = arg2;
1416
- const ret = arg0.addDeposit(getStringFromWasm0(arg1, arg2), arg3 >>> 0, BigInt.asUintN(64, arg4));
1434
+ const ret = arg0.addDeposit(getStringFromWasm0(arg1, arg2), arg3 >>> 0, BigInt.asUintN(64, arg4), arg5 !== 0);
1417
1435
  return ret;
1418
1436
  } finally {
1419
1437
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
@@ -1500,6 +1518,18 @@ function __wbg_get_imports() {
1500
1518
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1501
1519
  }
1502
1520
  }, arguments) };
1521
+ imports.wbg.__wbg_cancelReservation_fd3065607b457424 = function() { return handleError(function (arg0, arg1, arg2) {
1522
+ let deferred0_0;
1523
+ let deferred0_1;
1524
+ try {
1525
+ deferred0_0 = arg1;
1526
+ deferred0_1 = arg2;
1527
+ const ret = arg0.cancelReservation(getStringFromWasm0(arg1, arg2));
1528
+ return ret;
1529
+ } finally {
1530
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1531
+ }
1532
+ }, arguments) };
1503
1533
  imports.wbg.__wbg_cancel_8a308660caa6cadf = function(arg0) {
1504
1534
  const ret = arg0.cancel();
1505
1535
  return ret;
@@ -1537,12 +1567,20 @@ function __wbg_get_imports() {
1537
1567
  const ret = createDefaultStorage(getStringFromWasm0(arg0, arg1), arg2);
1538
1568
  return ret;
1539
1569
  }, arguments) };
1540
- imports.wbg.__wbg_createPostgresStorage_46770cbf8e947f9e = function() { return handleError(function (arg0, arg1) {
1541
- const ret = createPostgresStorage(arg0, arg1);
1570
+ imports.wbg.__wbg_createPostgresPool_8b4003e9db8e9432 = function() { return handleError(function (arg0) {
1571
+ const ret = createPostgresPool(arg0);
1572
+ return ret;
1573
+ }, arguments) };
1574
+ imports.wbg.__wbg_createPostgresStorageWithPool_77aa64bddd7440db = function() { return handleError(function (arg0, arg1) {
1575
+ const ret = createPostgresStorageWithPool(arg0, arg1);
1576
+ return ret;
1577
+ }, arguments) };
1578
+ imports.wbg.__wbg_createPostgresTokenStoreWithPool_5e7b75f5975d8b94 = function() { return handleError(function (arg0, arg1) {
1579
+ const ret = createPostgresTokenStoreWithPool(arg0, arg1);
1542
1580
  return ret;
1543
1581
  }, arguments) };
1544
- imports.wbg.__wbg_createPostgresTreeStore_7887b0b703c72f83 = function() { return handleError(function (arg0, arg1) {
1545
- const ret = createPostgresTreeStore(arg0, arg1);
1582
+ imports.wbg.__wbg_createPostgresTreeStoreWithPool_55e19122e69fb9e3 = function() { return handleError(function (arg0, arg1) {
1583
+ const ret = createPostgresTreeStoreWithPool(arg0, arg1);
1546
1584
  return ret;
1547
1585
  }, arguments) };
1548
1586
  imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
@@ -1700,6 +1738,18 @@ function __wbg_get_imports() {
1700
1738
  const ret = fetch(arg0);
1701
1739
  return ret;
1702
1740
  };
1741
+ imports.wbg.__wbg_finalizeReservation_86ee8385c17e015b = function() { return handleError(function (arg0, arg1, arg2) {
1742
+ let deferred0_0;
1743
+ let deferred0_1;
1744
+ try {
1745
+ deferred0_0 = arg1;
1746
+ deferred0_1 = arg2;
1747
+ const ret = arg0.finalizeReservation(getStringFromWasm0(arg1, arg2));
1748
+ return ret;
1749
+ } finally {
1750
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1751
+ }
1752
+ }, arguments) };
1703
1753
  imports.wbg.__wbg_finalizeReservation_a8fad570b7fe5185 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1704
1754
  let deferred0_0;
1705
1755
  let deferred0_1;
@@ -1832,6 +1882,10 @@ function __wbg_get_imports() {
1832
1882
  const ret = arg0.getStaticDepositSecretSource(arg1 >>> 0);
1833
1883
  return ret;
1834
1884
  }, arguments) };
1885
+ imports.wbg.__wbg_getTokenOutputs_f51d6f5d47330273 = function() { return handleError(function (arg0, arg1) {
1886
+ const ret = arg0.getTokenOutputs(arg1);
1887
+ return ret;
1888
+ }, arguments) };
1835
1889
  imports.wbg.__wbg_getTransactionHex_973b8d0555c60f99 = function() { return handleError(function (arg0, arg1, arg2) {
1836
1890
  let deferred0_0;
1837
1891
  let deferred0_1;
@@ -1922,6 +1976,10 @@ function __wbg_get_imports() {
1922
1976
  const ret = arg0.insertPayment(arg1);
1923
1977
  return ret;
1924
1978
  }, arguments) };
1979
+ imports.wbg.__wbg_insertTokenOutputs_043ceea065ff8f65 = function() { return handleError(function (arg0, arg1) {
1980
+ const ret = arg0.insertTokenOutputs(arg1);
1981
+ return ret;
1982
+ }, arguments) };
1925
1983
  imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
1926
1984
  let result;
1927
1985
  try {
@@ -2038,6 +2096,10 @@ function __wbg_get_imports() {
2038
2096
  const ret = arg0.listPayments(arg1);
2039
2097
  return ret;
2040
2098
  }, arguments) };
2099
+ imports.wbg.__wbg_listTokensOutputs_4b4500bd5aca2c88 = function() { return handleError(function (arg0) {
2100
+ const ret = arg0.listTokensOutputs();
2101
+ return ret;
2102
+ }, arguments) };
2041
2103
  imports.wbg.__wbg_log_62b3ddcc89229688 = function(arg0, arg1) {
2042
2104
  arg0.log(arg1);
2043
2105
  };
@@ -2078,7 +2140,7 @@ function __wbg_get_imports() {
2078
2140
  const a = state0.a;
2079
2141
  state0.a = 0;
2080
2142
  try {
2081
- return __wbg_adapter_373(a, state0.b, arg0, arg1);
2143
+ return __wbg_adapter_423(a, state0.b, arg0, arg1);
2082
2144
  } finally {
2083
2145
  state0.a = a;
2084
2146
  }
@@ -2157,6 +2219,10 @@ function __wbg_get_imports() {
2157
2219
  const ret = Date.now();
2158
2220
  return ret;
2159
2221
  }, arguments) };
2222
+ imports.wbg.__wbg_now_79892f24f17d010a = function() { return handleError(function (arg0) {
2223
+ const ret = arg0.now();
2224
+ return ret;
2225
+ }, arguments) };
2160
2226
  imports.wbg.__wbg_now_807e54c39636c349 = function() {
2161
2227
  const ret = Date.now();
2162
2228
  return ret;
@@ -2228,6 +2294,23 @@ function __wbg_get_imports() {
2228
2294
  const ret = module.require;
2229
2295
  return ret;
2230
2296
  }, arguments) };
2297
+ imports.wbg.__wbg_reserveTokenOutputs_6a190cf797e7d196 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
2298
+ let deferred0_0;
2299
+ let deferred0_1;
2300
+ let deferred1_0;
2301
+ let deferred1_1;
2302
+ try {
2303
+ deferred0_0 = arg1;
2304
+ deferred0_1 = arg2;
2305
+ deferred1_0 = arg4;
2306
+ deferred1_1 = arg5;
2307
+ const ret = arg0.reserveTokenOutputs(getStringFromWasm0(arg1, arg2), arg3, getStringFromWasm0(arg4, arg5), arg6, arg7);
2308
+ return ret;
2309
+ } finally {
2310
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2311
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2312
+ }
2313
+ }, arguments) };
2231
2314
  imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
2232
2315
  const ret = Promise.resolve(arg0);
2233
2316
  return ret;
@@ -2283,6 +2366,10 @@ function __wbg_get_imports() {
2283
2366
  const ret = setTimeout(arg0, arg1);
2284
2367
  return ret;
2285
2368
  }, arguments) };
2369
+ imports.wbg.__wbg_setTokensOutputs_5b8449721027f347 = function() { return handleError(function (arg0, arg1, arg2) {
2370
+ const ret = arg0.setTokensOutputs(arg1, arg2);
2371
+ return ret;
2372
+ }, arguments) };
2286
2373
  imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
2287
2374
  arg0[arg1 >>> 0] = arg2;
2288
2375
  };
@@ -2593,24 +2680,24 @@ function __wbg_get_imports() {
2593
2680
  const ret = false;
2594
2681
  return ret;
2595
2682
  };
2596
- imports.wbg.__wbindgen_closure_wrapper10368 = function(arg0, arg1, arg2) {
2597
- const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_69);
2683
+ imports.wbg.__wbindgen_closure_wrapper10258 = function(arg0, arg1, arg2) {
2684
+ const ret = makeMutClosure(arg0, arg1, 384, __wbg_adapter_69);
2598
2685
  return ret;
2599
2686
  };
2600
- imports.wbg.__wbindgen_closure_wrapper15754 = function(arg0, arg1, arg2) {
2601
- const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
2687
+ imports.wbg.__wbindgen_closure_wrapper15384 = function(arg0, arg1, arg2) {
2688
+ const ret = makeMutClosure(arg0, arg1, 384, __wbg_adapter_64);
2602
2689
  return ret;
2603
2690
  };
2604
- imports.wbg.__wbindgen_closure_wrapper5890 = function(arg0, arg1, arg2) {
2605
- const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
2691
+ imports.wbg.__wbindgen_closure_wrapper5940 = function(arg0, arg1, arg2) {
2692
+ const ret = makeMutClosure(arg0, arg1, 384, __wbg_adapter_64);
2606
2693
  return ret;
2607
2694
  };
2608
- imports.wbg.__wbindgen_closure_wrapper5898 = function(arg0, arg1, arg2) {
2609
- const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
2695
+ imports.wbg.__wbindgen_closure_wrapper5946 = function(arg0, arg1, arg2) {
2696
+ const ret = makeMutClosure(arg0, arg1, 384, __wbg_adapter_64);
2610
2697
  return ret;
2611
2698
  };
2612
- imports.wbg.__wbindgen_closure_wrapper7595 = function(arg0, arg1, arg2) {
2613
- const ret = makeMutClosure(arg0, arg1, 954, __wbg_adapter_69);
2699
+ imports.wbg.__wbindgen_closure_wrapper7585 = function(arg0, arg1, arg2) {
2700
+ const ret = makeMutClosure(arg0, arg1, 870, __wbg_adapter_69);
2614
2701
  return ret;
2615
2702
  };
2616
2703
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Binary file
@@ -30,6 +30,7 @@ export const breezsdk_listFiatCurrencies: (a: number) => any;
30
30
  export const breezsdk_listFiatRates: (a: number) => any;
31
31
  export const breezsdk_listPayments: (a: number, b: any) => any;
32
32
  export const breezsdk_listUnclaimedDeposits: (a: number, b: any) => any;
33
+ export const breezsdk_listWebhooks: (a: number) => any;
33
34
  export const breezsdk_lnurlAuth: (a: number, b: any) => any;
34
35
  export const breezsdk_lnurlPay: (a: number, b: any) => any;
35
36
  export const breezsdk_lnurlWithdraw: (a: number, b: any) => any;
@@ -40,11 +41,13 @@ export const breezsdk_receivePayment: (a: number, b: any) => any;
40
41
  export const breezsdk_recommendedFees: (a: number) => any;
41
42
  export const breezsdk_refundDeposit: (a: number, b: any) => any;
42
43
  export const breezsdk_registerLightningAddress: (a: number, b: any) => any;
44
+ export const breezsdk_registerWebhook: (a: number, b: any) => any;
43
45
  export const breezsdk_removeEventListener: (a: number, b: number, c: number) => any;
44
46
  export const breezsdk_sendPayment: (a: number, b: any) => any;
45
47
  export const breezsdk_signMessage: (a: number, b: any) => any;
46
- export const breezsdk_startLeafOptimization: (a: number) => void;
48
+ export const breezsdk_startLeafOptimization: (a: number) => any;
47
49
  export const breezsdk_syncWallet: (a: number, b: any) => any;
50
+ export const breezsdk_unregisterWebhook: (a: number, b: any) => any;
48
51
  export const breezsdk_updateContact: (a: number, b: any) => any;
49
52
  export const breezsdk_updateUserSettings: (a: number, b: any) => any;
50
53
  export const connect: (a: any) => any;
@@ -88,8 +91,7 @@ export const sdkbuilder_withFiatService: (a: number, b: any) => number;
88
91
  export const sdkbuilder_withKeySet: (a: number, b: any) => number;
89
92
  export const sdkbuilder_withLnurlClient: (a: number, b: any) => number;
90
93
  export const sdkbuilder_withPaymentObserver: (a: number, b: any) => number;
91
- export const sdkbuilder_withPostgresStorage: (a: number, b: any) => number;
92
- export const sdkbuilder_withPostgresTreeStore: (a: number, b: any) => number;
94
+ export const sdkbuilder_withPostgresBackend: (a: number, b: any) => number;
93
95
  export const sdkbuilder_withRestChainService: (a: number, b: number, c: number, d: any, e: number) => number;
94
96
  export const sdkbuilder_withStorage: (a: number, b: any) => number;
95
97
  export const tokenissuer_burnIssuerToken: (a: number, b: any) => any;
@@ -126,7 +128,7 @@ export const __wbindgen_export_5: WebAssembly.Table;
126
128
  export const __externref_drop_slice: (a: number, b: number) => void;
127
129
  export const __wbindgen_export_7: WebAssembly.Table;
128
130
  export const __externref_table_dealloc: (a: number) => void;
129
- export const closure444_externref_shim: (a: number, b: number, c: any) => void;
130
- export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1bbbe552b190da27: (a: number, b: number) => void;
131
- export const closure711_externref_shim: (a: number, b: number, c: any, d: any) => void;
131
+ export const closure383_externref_shim: (a: number, b: number, c: any) => void;
132
+ export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h140914a8cfe47e73: (a: number, b: number) => void;
133
+ export const closure661_externref_shim: (a: number, b: number, c: any, d: any) => void;
132
134
  export const __wbindgen_start: () => void;
@@ -428,6 +428,35 @@ class MigrationManager {
428
428
  }
429
429
  }
430
430
  },
431
+ {
432
+ name: "Drop preimage from lnurl_receive_metadata records",
433
+ upgrade: (db, transaction) => {
434
+ if (db.objectStoreNames.contains("lnurl_receive_metadata")) {
435
+ const store = transaction.objectStore("lnurl_receive_metadata");
436
+ const request = store.openCursor();
437
+ request.onsuccess = (event) => {
438
+ const cursor = event.target.result;
439
+ if (cursor) {
440
+ const record = cursor.value;
441
+ if ("preimage" in record) {
442
+ delete record.preimage;
443
+ cursor.update(record);
444
+ }
445
+ cursor.continue();
446
+ }
447
+ };
448
+ }
449
+ }
450
+ },
451
+ {
452
+ name: "Clear cached lightning address for CachedLightningAddress format change",
453
+ upgrade: (db, transaction) => {
454
+ if (db.objectStoreNames.contains("settings")) {
455
+ const settings = transaction.objectStore("settings");
456
+ settings.delete("lightning_address");
457
+ }
458
+ }
459
+ },
431
460
  ];
432
461
  }
433
462
  }
@@ -451,7 +480,7 @@ class IndexedDBStorage {
451
480
  this.db = null;
452
481
  this.migrationManager = null;
453
482
  this.logger = logger;
454
- this.dbVersion = 14; // Current schema version
483
+ this.dbVersion = 15; // Current schema version
455
484
  }
456
485
 
457
486
  /**
@@ -1123,6 +1152,7 @@ class IndexedDBStorage {
1123
1152
  conversionInfo: metadata.conversionInfo
1124
1153
  ? JSON.stringify(metadata.conversionInfo)
1125
1154
  : existing.conversionInfo ?? null,
1155
+ conversionStatus: metadata.conversionStatus ?? existing.conversionStatus ?? null,
1126
1156
  };
1127
1157
 
1128
1158
  const putRequest = store.put(metadataToStore);
@@ -1151,7 +1181,7 @@ class IndexedDBStorage {
1151
1181
 
1152
1182
  // ===== Deposit Operations =====
1153
1183
 
1154
- async addDeposit(txid, vout, amountSats) {
1184
+ async addDeposit(txid, vout, amountSats, isMature) {
1155
1185
  if (!this.db) {
1156
1186
  throw new StorageError("Database not initialized");
1157
1187
  }
@@ -1163,23 +1193,40 @@ class IndexedDBStorage {
1163
1193
  );
1164
1194
  const store = transaction.objectStore("unclaimed_deposits");
1165
1195
 
1166
- const depositToStore = {
1167
- txid,
1168
- vout,
1169
- amountSats,
1170
- claimError: null,
1171
- refundTx: null,
1172
- refundTxId: null,
1196
+ // Get existing deposit first to preserve fields on upsert
1197
+ const getRequest = store.get([txid, vout]);
1198
+
1199
+ getRequest.onsuccess = () => {
1200
+ const existing = getRequest.result;
1201
+ const depositToStore = {
1202
+ txid,
1203
+ vout,
1204
+ amountSats,
1205
+ isMature: isMature ?? true,
1206
+ claimError: existing?.claimError ?? null,
1207
+ refundTx: existing?.refundTx ?? null,
1208
+ refundTxId: existing?.refundTxId ?? null,
1209
+ };
1210
+
1211
+ const putRequest = store.put(depositToStore);
1212
+ putRequest.onsuccess = () => resolve();
1213
+ putRequest.onerror = () => {
1214
+ reject(
1215
+ new StorageError(
1216
+ `Failed to add deposit '${txid}:${vout}': ${putRequest.error?.message || "Unknown error"
1217
+ }`,
1218
+ putRequest.error
1219
+ )
1220
+ );
1221
+ };
1173
1222
  };
1174
1223
 
1175
- const request = store.put(depositToStore);
1176
- request.onsuccess = () => resolve();
1177
- request.onerror = () => {
1224
+ getRequest.onerror = () => {
1178
1225
  reject(
1179
1226
  new StorageError(
1180
- `Failed to add deposit '${txid}:${vout}': ${request.error?.message || "Unknown error"
1227
+ `Failed to add deposit '${txid}:${vout}': ${getRequest.error?.message || "Unknown error"
1181
1228
  }`,
1182
- request.error
1229
+ getRequest.error
1183
1230
  )
1184
1231
  );
1185
1232
  };
@@ -1227,6 +1274,7 @@ class IndexedDBStorage {
1227
1274
  txid: row.txid,
1228
1275
  vout: row.vout,
1229
1276
  amountSats: row.amountSats,
1277
+ isMature: row.isMature ?? true,
1230
1278
  claimError: row.claimError ? JSON.parse(row.claimError) : null,
1231
1279
  refundTx: row.refundTx,
1232
1280
  refundTxId: row.refundTxId,
@@ -1335,7 +1383,6 @@ class IndexedDBStorage {
1335
1383
  nostrZapRequest: item.nostrZapRequest || null,
1336
1384
  nostrZapReceipt: item.nostrZapReceipt || null,
1337
1385
  senderComment: item.senderComment || null,
1338
- preimage: item.preimage || null,
1339
1386
  });
1340
1387
 
1341
1388
  request.onsuccess = () => {
@@ -2089,33 +2136,6 @@ class IndexedDBStorage {
2089
2136
  continue;
2090
2137
  }
2091
2138
  }
2092
- // Filter by LNURL preimage status
2093
- if (
2094
- paymentDetailsFilter.type === "lightning" &&
2095
- paymentDetailsFilter.hasLnurlPreimage != null
2096
- ) {
2097
- if (details.type !== "lightning") {
2098
- continue;
2099
- }
2100
- if (paymentDetailsFilter.hasLnurlPreimage) {
2101
- // Has lnurl preimage - check lnurlReceiveMetadata.preimage exists
2102
- if (
2103
- !details.lnurlReceiveMetadata ||
2104
- !details.lnurlReceiveMetadata.preimage
2105
- ) {
2106
- continue;
2107
- }
2108
- } else {
2109
- // Pending: has lnurl metadata, has lightning preimage, but lnurl preimage not yet sent
2110
- if (
2111
- !details.lnurlReceiveMetadata ||
2112
- !details.htlcDetails?.preimage ||
2113
- details.lnurlReceiveMetadata.preimage
2114
- ) {
2115
- continue;
2116
- }
2117
- }
2118
- }
2119
2139
 
2120
2140
 
2121
2141
  paymentDetailsFilterMatches = true;
@@ -2254,6 +2274,9 @@ class IndexedDBStorage {
2254
2274
  timestamp: payment.timestamp,
2255
2275
  method,
2256
2276
  details,
2277
+ conversionDetails: metadata?.conversionStatus
2278
+ ? { status: metadata.conversionStatus, from: null, to: null }
2279
+ : null,
2257
2280
  };
2258
2281
  }
2259
2282
 
@@ -2283,7 +2306,6 @@ class IndexedDBStorage {
2283
2306
  nostrZapRequest: lnurlReceiveMetadata.nostrZapRequest || null,
2284
2307
  nostrZapReceipt: lnurlReceiveMetadata.nostrZapReceipt || null,
2285
2308
  senderComment: lnurlReceiveMetadata.senderComment || null,
2286
- preimage: lnurlReceiveMetadata.preimage || null,
2287
2309
  };
2288
2310
  }
2289
2311
  resolve(payment);