@breeztech/breez-sdk-spark 0.12.2-dev1 → 0.12.2-dev3
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.
- package/README.md +4 -4
- package/breez-sdk-spark.tgz +0 -0
- package/bundler/breez_sdk_spark_wasm.d.ts +731 -601
- package/bundler/breez_sdk_spark_wasm_bg.js +151 -54
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/bundler/storage/index.js +65 -43
- package/deno/breez_sdk_spark_wasm.d.ts +731 -601
- package/deno/breez_sdk_spark_wasm.js +141 -54
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/nodejs/breez_sdk_spark_wasm.d.ts +731 -601
- package/nodejs/breez_sdk_spark_wasm.js +151 -54
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/nodejs/index.js +16 -2
- package/nodejs/package.json +1 -0
- package/nodejs/postgres-storage/index.cjs +42 -31
- package/nodejs/postgres-storage/migrations.cjs +24 -0
- package/nodejs/postgres-token-store/errors.cjs +13 -0
- package/nodejs/postgres-token-store/index.cjs +857 -0
- package/nodejs/postgres-token-store/migrations.cjs +163 -0
- package/nodejs/postgres-token-store/package.json +9 -0
- package/nodejs/postgres-tree-store/index.cjs +12 -2
- package/nodejs/storage/index.cjs +19 -28
- package/nodejs/storage/migrations.cjs +18 -0
- package/package.json +1 -1
- package/web/breez_sdk_spark_wasm.d.ts +738 -606
- package/web/breez_sdk_spark_wasm.js +141 -54
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/web/storage/index.js +65 -43
|
@@ -249,19 +249,6 @@ export function getSparkStatus() {
|
|
|
249
249
|
return ret;
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
/**
|
|
253
|
-
* @param {Config} config
|
|
254
|
-
* @param {ExternalSigner} signer
|
|
255
|
-
* @param {string} storage_dir
|
|
256
|
-
* @returns {Promise<BreezSdk>}
|
|
257
|
-
*/
|
|
258
|
-
export function connectWithSigner(config, signer, storage_dir) {
|
|
259
|
-
const ptr0 = passStringToWasm0(storage_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
260
|
-
const len0 = WASM_VECTOR_LEN;
|
|
261
|
-
const ret = wasm.connectWithSigner(config, signer, ptr0, len0);
|
|
262
|
-
return ret;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
252
|
/**
|
|
266
253
|
* @param {ConnectRequest} request
|
|
267
254
|
* @returns {Promise<BreezSdk>}
|
|
@@ -271,15 +258,6 @@ export function connect(request) {
|
|
|
271
258
|
return ret;
|
|
272
259
|
}
|
|
273
260
|
|
|
274
|
-
/**
|
|
275
|
-
* @param {Network} network
|
|
276
|
-
* @returns {Config}
|
|
277
|
-
*/
|
|
278
|
-
export function defaultConfig(network) {
|
|
279
|
-
const ret = wasm.defaultConfig(network);
|
|
280
|
-
return ret;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
261
|
/**
|
|
284
262
|
* @param {Logger} logger
|
|
285
263
|
* @param {string | null} [filter]
|
|
@@ -292,6 +270,15 @@ export function initLogging(logger, filter) {
|
|
|
292
270
|
return ret;
|
|
293
271
|
}
|
|
294
272
|
|
|
273
|
+
/**
|
|
274
|
+
* @param {Network} network
|
|
275
|
+
* @returns {Config}
|
|
276
|
+
*/
|
|
277
|
+
export function defaultConfig(network) {
|
|
278
|
+
const ret = wasm.defaultConfig(network);
|
|
279
|
+
return ret;
|
|
280
|
+
}
|
|
281
|
+
|
|
295
282
|
function takeFromExternrefTable0(idx) {
|
|
296
283
|
const value = wasm.__wbindgen_export_5.get(idx);
|
|
297
284
|
wasm.__externref_table_dealloc(idx);
|
|
@@ -316,6 +303,19 @@ export function defaultExternalSigner(mnemonic, passphrase, network, key_set_con
|
|
|
316
303
|
return DefaultSigner.__wrap(ret[0]);
|
|
317
304
|
}
|
|
318
305
|
|
|
306
|
+
/**
|
|
307
|
+
* @param {Config} config
|
|
308
|
+
* @param {ExternalSigner} signer
|
|
309
|
+
* @param {string} storage_dir
|
|
310
|
+
* @returns {Promise<BreezSdk>}
|
|
311
|
+
*/
|
|
312
|
+
export function connectWithSigner(config, signer, storage_dir) {
|
|
313
|
+
const ptr0 = passStringToWasm0(storage_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
314
|
+
const len0 = WASM_VECTOR_LEN;
|
|
315
|
+
const ret = wasm.connectWithSigner(config, signer, ptr0, len0);
|
|
316
|
+
return ret;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
319
|
function passArray8ToWasm0(arg, malloc) {
|
|
320
320
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
321
321
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -334,15 +334,15 @@ export function task_worker_entry_point(ptr) {
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
function __wbg_adapter_64(arg0, arg1, arg2) {
|
|
337
|
-
wasm.
|
|
337
|
+
wasm.closure456_externref_shim(arg0, arg1, arg2);
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
function __wbg_adapter_69(arg0, arg1) {
|
|
341
341
|
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1bbbe552b190da27(arg0, arg1);
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
function
|
|
345
|
-
wasm.
|
|
344
|
+
function __wbg_adapter_395(arg0, arg1, arg2, arg3) {
|
|
345
|
+
wasm.closure736_externref_shim(arg0, arg1, arg2, arg3);
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
@@ -479,6 +479,13 @@ export class BreezSdk {
|
|
|
479
479
|
const ret = wasm.breezsdk_listPayments(this.__wbg_ptr, request);
|
|
480
480
|
return ret;
|
|
481
481
|
}
|
|
482
|
+
/**
|
|
483
|
+
* @returns {Promise<Webhook[]>}
|
|
484
|
+
*/
|
|
485
|
+
listWebhooks() {
|
|
486
|
+
const ret = wasm.breezsdk_listWebhooks(this.__wbg_ptr);
|
|
487
|
+
return ret;
|
|
488
|
+
}
|
|
482
489
|
/**
|
|
483
490
|
* @param {string} id
|
|
484
491
|
* @returns {Promise<void>}
|
|
@@ -542,6 +549,14 @@ export class BreezSdk {
|
|
|
542
549
|
const ret = wasm.breezsdk_recommendedFees(this.__wbg_ptr);
|
|
543
550
|
return ret;
|
|
544
551
|
}
|
|
552
|
+
/**
|
|
553
|
+
* @param {RegisterWebhookRequest} request
|
|
554
|
+
* @returns {Promise<RegisterWebhookResponse>}
|
|
555
|
+
*/
|
|
556
|
+
registerWebhook(request) {
|
|
557
|
+
const ret = wasm.breezsdk_registerWebhook(this.__wbg_ptr, request);
|
|
558
|
+
return ret;
|
|
559
|
+
}
|
|
545
560
|
/**
|
|
546
561
|
* @returns {Promise<UserSettings>}
|
|
547
562
|
*/
|
|
@@ -573,6 +588,14 @@ export class BreezSdk {
|
|
|
573
588
|
const ret = wasm.breezsdk_claimHtlcPayment(this.__wbg_ptr, request);
|
|
574
589
|
return ret;
|
|
575
590
|
}
|
|
591
|
+
/**
|
|
592
|
+
* @param {UnregisterWebhookRequest} request
|
|
593
|
+
* @returns {Promise<void>}
|
|
594
|
+
*/
|
|
595
|
+
unregisterWebhook(request) {
|
|
596
|
+
const ret = wasm.breezsdk_unregisterWebhook(this.__wbg_ptr, request);
|
|
597
|
+
return ret;
|
|
598
|
+
}
|
|
576
599
|
/**
|
|
577
600
|
* @param {GetTokensMetadataRequest} request
|
|
578
601
|
* @returns {Promise<GetTokensMetadataResponse>}
|
|
@@ -637,8 +660,12 @@ export class BreezSdk {
|
|
|
637
660
|
const ret = wasm.breezsdk_listUnclaimedDeposits(this.__wbg_ptr, request);
|
|
638
661
|
return ret;
|
|
639
662
|
}
|
|
663
|
+
/**
|
|
664
|
+
* @returns {Promise<void>}
|
|
665
|
+
*/
|
|
640
666
|
startLeafOptimization() {
|
|
641
|
-
wasm.breezsdk_startLeafOptimization(this.__wbg_ptr);
|
|
667
|
+
const ret = wasm.breezsdk_startLeafOptimization(this.__wbg_ptr);
|
|
668
|
+
return ret;
|
|
642
669
|
}
|
|
643
670
|
/**
|
|
644
671
|
* @returns {Promise<void>}
|
|
@@ -1241,9 +1268,9 @@ export class SdkBuilder {
|
|
|
1241
1268
|
* @param {PostgresStorageConfig} config
|
|
1242
1269
|
* @returns {SdkBuilder}
|
|
1243
1270
|
*/
|
|
1244
|
-
|
|
1271
|
+
withPostgresBackend(config) {
|
|
1245
1272
|
const ptr = this.__destroy_into_raw();
|
|
1246
|
-
const ret = wasm.
|
|
1273
|
+
const ret = wasm.sdkbuilder_withPostgresBackend(ptr, config);
|
|
1247
1274
|
return SdkBuilder.__wrap(ret);
|
|
1248
1275
|
}
|
|
1249
1276
|
/**
|
|
@@ -1259,15 +1286,6 @@ export class SdkBuilder {
|
|
|
1259
1286
|
const ret = wasm.sdkbuilder_withRestChainService(ptr, ptr0, len0, api_type, isLikeNone(credentials) ? 0 : addToExternrefTable0(credentials));
|
|
1260
1287
|
return SdkBuilder.__wrap(ret);
|
|
1261
1288
|
}
|
|
1262
|
-
/**
|
|
1263
|
-
* @param {PostgresStorageConfig} config
|
|
1264
|
-
* @returns {SdkBuilder}
|
|
1265
|
-
*/
|
|
1266
|
-
withPostgresTreeStore(config) {
|
|
1267
|
-
const ptr = this.__destroy_into_raw();
|
|
1268
|
-
const ret = wasm.sdkbuilder_withPostgresTreeStore(ptr, config);
|
|
1269
|
-
return SdkBuilder.__wrap(ret);
|
|
1270
|
-
}
|
|
1271
1289
|
/**
|
|
1272
1290
|
* @param {Config} config
|
|
1273
1291
|
* @param {Seed} seed
|
|
@@ -1384,13 +1402,13 @@ export function __wbg_abort_775ef1d17fc65868(arg0) {
|
|
|
1384
1402
|
arg0.abort();
|
|
1385
1403
|
};
|
|
1386
1404
|
|
|
1387
|
-
export function
|
|
1405
|
+
export function __wbg_addDeposit_42b1593db58de120() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
1388
1406
|
let deferred0_0;
|
|
1389
1407
|
let deferred0_1;
|
|
1390
1408
|
try {
|
|
1391
1409
|
deferred0_0 = arg1;
|
|
1392
1410
|
deferred0_1 = arg2;
|
|
1393
|
-
const ret = arg0.addDeposit(getStringFromWasm0(arg1, arg2), arg3 >>> 0, BigInt.asUintN(64, arg4));
|
|
1411
|
+
const ret = arg0.addDeposit(getStringFromWasm0(arg1, arg2), arg3 >>> 0, BigInt.asUintN(64, arg4), arg5 !== 0);
|
|
1394
1412
|
return ret;
|
|
1395
1413
|
} finally {
|
|
1396
1414
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
@@ -1494,6 +1512,19 @@ export function __wbg_cancelReservation_d85a13db3e8e3c7b() { return handleError(
|
|
|
1494
1512
|
}
|
|
1495
1513
|
}, arguments) };
|
|
1496
1514
|
|
|
1515
|
+
export function __wbg_cancelReservation_fd3065607b457424() { return handleError(function (arg0, arg1, arg2) {
|
|
1516
|
+
let deferred0_0;
|
|
1517
|
+
let deferred0_1;
|
|
1518
|
+
try {
|
|
1519
|
+
deferred0_0 = arg1;
|
|
1520
|
+
deferred0_1 = arg2;
|
|
1521
|
+
const ret = arg0.cancelReservation(getStringFromWasm0(arg1, arg2));
|
|
1522
|
+
return ret;
|
|
1523
|
+
} finally {
|
|
1524
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1525
|
+
}
|
|
1526
|
+
}, arguments) };
|
|
1527
|
+
|
|
1497
1528
|
export function __wbg_cancel_8a308660caa6cadf(arg0) {
|
|
1498
1529
|
const ret = arg0.cancel();
|
|
1499
1530
|
return ret;
|
|
@@ -1541,13 +1572,23 @@ export function __wbg_createDefaultStorage_458aa01b5eaead27() { return handleErr
|
|
|
1541
1572
|
return ret;
|
|
1542
1573
|
}, arguments) };
|
|
1543
1574
|
|
|
1544
|
-
export function
|
|
1545
|
-
const ret =
|
|
1575
|
+
export function __wbg_createPostgresPool_8b4003e9db8e9432() { return handleError(function (arg0) {
|
|
1576
|
+
const ret = createPostgresPool(arg0);
|
|
1546
1577
|
return ret;
|
|
1547
1578
|
}, arguments) };
|
|
1548
1579
|
|
|
1549
|
-
export function
|
|
1550
|
-
const ret =
|
|
1580
|
+
export function __wbg_createPostgresStorageWithPool_77aa64bddd7440db() { return handleError(function (arg0, arg1) {
|
|
1581
|
+
const ret = createPostgresStorageWithPool(arg0, arg1);
|
|
1582
|
+
return ret;
|
|
1583
|
+
}, arguments) };
|
|
1584
|
+
|
|
1585
|
+
export function __wbg_createPostgresTokenStoreWithPool_5e7b75f5975d8b94() { return handleError(function (arg0, arg1) {
|
|
1586
|
+
const ret = createPostgresTokenStoreWithPool(arg0, arg1);
|
|
1587
|
+
return ret;
|
|
1588
|
+
}, arguments) };
|
|
1589
|
+
|
|
1590
|
+
export function __wbg_createPostgresTreeStoreWithPool_55e19122e69fb9e3() { return handleError(function (arg0, arg1) {
|
|
1591
|
+
const ret = createPostgresTreeStoreWithPool(arg0, arg1);
|
|
1551
1592
|
return ret;
|
|
1552
1593
|
}, arguments) };
|
|
1553
1594
|
|
|
@@ -1727,6 +1768,19 @@ export function __wbg_fetch_f156d10be9a5c88a(arg0) {
|
|
|
1727
1768
|
return ret;
|
|
1728
1769
|
};
|
|
1729
1770
|
|
|
1771
|
+
export function __wbg_finalizeReservation_86ee8385c17e015b() { return handleError(function (arg0, arg1, arg2) {
|
|
1772
|
+
let deferred0_0;
|
|
1773
|
+
let deferred0_1;
|
|
1774
|
+
try {
|
|
1775
|
+
deferred0_0 = arg1;
|
|
1776
|
+
deferred0_1 = arg2;
|
|
1777
|
+
const ret = arg0.finalizeReservation(getStringFromWasm0(arg1, arg2));
|
|
1778
|
+
return ret;
|
|
1779
|
+
} finally {
|
|
1780
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1781
|
+
}
|
|
1782
|
+
}, arguments) };
|
|
1783
|
+
|
|
1730
1784
|
export function __wbg_finalizeReservation_a8fad570b7fe5185() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1731
1785
|
let deferred0_0;
|
|
1732
1786
|
let deferred0_1;
|
|
@@ -1878,6 +1932,11 @@ export function __wbg_getStaticDepositSecretSource_8e310c718339e400() { return h
|
|
|
1878
1932
|
return ret;
|
|
1879
1933
|
}, arguments) };
|
|
1880
1934
|
|
|
1935
|
+
export function __wbg_getTokenOutputs_f51d6f5d47330273() { return handleError(function (arg0, arg1) {
|
|
1936
|
+
const ret = arg0.getTokenOutputs(arg1);
|
|
1937
|
+
return ret;
|
|
1938
|
+
}, arguments) };
|
|
1939
|
+
|
|
1881
1940
|
export function __wbg_getTransactionHex_973b8d0555c60f99() { return handleError(function (arg0, arg1, arg2) {
|
|
1882
1941
|
let deferred0_0;
|
|
1883
1942
|
let deferred0_1;
|
|
@@ -1982,6 +2041,11 @@ export function __wbg_insertPayment_2afe3300c5f86ccf() { return handleError(func
|
|
|
1982
2041
|
return ret;
|
|
1983
2042
|
}, arguments) };
|
|
1984
2043
|
|
|
2044
|
+
export function __wbg_insertTokenOutputs_043ceea065ff8f65() { return handleError(function (arg0, arg1) {
|
|
2045
|
+
const ret = arg0.insertTokenOutputs(arg1);
|
|
2046
|
+
return ret;
|
|
2047
|
+
}, arguments) };
|
|
2048
|
+
|
|
1985
2049
|
export function __wbg_instanceof_ArrayBuffer_e14585432e3737fc(arg0) {
|
|
1986
2050
|
let result;
|
|
1987
2051
|
try {
|
|
@@ -2115,6 +2179,11 @@ export function __wbg_listPayments_d8c53ab09ffc756b() { return handleError(funct
|
|
|
2115
2179
|
return ret;
|
|
2116
2180
|
}, arguments) };
|
|
2117
2181
|
|
|
2182
|
+
export function __wbg_listTokensOutputs_4b4500bd5aca2c88() { return handleError(function (arg0) {
|
|
2183
|
+
const ret = arg0.listTokensOutputs();
|
|
2184
|
+
return ret;
|
|
2185
|
+
}, arguments) };
|
|
2186
|
+
|
|
2118
2187
|
export function __wbg_log_62b3ddcc89229688(arg0, arg1) {
|
|
2119
2188
|
arg0.log(arg1);
|
|
2120
2189
|
};
|
|
@@ -2162,7 +2231,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
|
|
|
2162
2231
|
const a = state0.a;
|
|
2163
2232
|
state0.a = 0;
|
|
2164
2233
|
try {
|
|
2165
|
-
return
|
|
2234
|
+
return __wbg_adapter_395(a, state0.b, arg0, arg1);
|
|
2166
2235
|
} finally {
|
|
2167
2236
|
state0.a = a;
|
|
2168
2237
|
}
|
|
@@ -2259,6 +2328,11 @@ export function __wbg_now_6af59e24f5a53ad4() { return handleError(function () {
|
|
|
2259
2328
|
return ret;
|
|
2260
2329
|
}, arguments) };
|
|
2261
2330
|
|
|
2331
|
+
export function __wbg_now_79892f24f17d010a() { return handleError(function (arg0) {
|
|
2332
|
+
const ret = arg0.now();
|
|
2333
|
+
return ret;
|
|
2334
|
+
}, arguments) };
|
|
2335
|
+
|
|
2262
2336
|
export function __wbg_now_807e54c39636c349() {
|
|
2263
2337
|
const ret = Date.now();
|
|
2264
2338
|
return ret;
|
|
@@ -2345,6 +2419,24 @@ export function __wbg_require_60cc747a6bc5215a() { return handleError(function (
|
|
|
2345
2419
|
return ret;
|
|
2346
2420
|
}, arguments) };
|
|
2347
2421
|
|
|
2422
|
+
export function __wbg_reserveTokenOutputs_6a190cf797e7d196() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
|
2423
|
+
let deferred0_0;
|
|
2424
|
+
let deferred0_1;
|
|
2425
|
+
let deferred1_0;
|
|
2426
|
+
let deferred1_1;
|
|
2427
|
+
try {
|
|
2428
|
+
deferred0_0 = arg1;
|
|
2429
|
+
deferred0_1 = arg2;
|
|
2430
|
+
deferred1_0 = arg4;
|
|
2431
|
+
deferred1_1 = arg5;
|
|
2432
|
+
const ret = arg0.reserveTokenOutputs(getStringFromWasm0(arg1, arg2), arg3, getStringFromWasm0(arg4, arg5), arg6, arg7);
|
|
2433
|
+
return ret;
|
|
2434
|
+
} finally {
|
|
2435
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
2436
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2437
|
+
}
|
|
2438
|
+
}, arguments) };
|
|
2439
|
+
|
|
2348
2440
|
export function __wbg_resolve_4851785c9c5f573d(arg0) {
|
|
2349
2441
|
const ret = Promise.resolve(arg0);
|
|
2350
2442
|
return ret;
|
|
@@ -2411,6 +2503,11 @@ export function __wbg_setTimeout_db2dbaeefb6f39c7() { return handleError(functio
|
|
|
2411
2503
|
return ret;
|
|
2412
2504
|
}, arguments) };
|
|
2413
2505
|
|
|
2506
|
+
export function __wbg_setTokensOutputs_5b8449721027f347() { return handleError(function (arg0, arg1, arg2) {
|
|
2507
|
+
const ret = arg0.setTokensOutputs(arg1, arg2);
|
|
2508
|
+
return ret;
|
|
2509
|
+
}, arguments) };
|
|
2510
|
+
|
|
2414
2511
|
export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
|
|
2415
2512
|
arg0[arg1 >>> 0] = arg2;
|
|
2416
2513
|
};
|
|
@@ -2787,28 +2884,28 @@ export function __wbindgen_cb_drop(arg0) {
|
|
|
2787
2884
|
return ret;
|
|
2788
2885
|
};
|
|
2789
2886
|
|
|
2790
|
-
export function
|
|
2791
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2887
|
+
export function __wbindgen_closure_wrapper10760(arg0, arg1, arg2) {
|
|
2888
|
+
const ret = makeMutClosure(arg0, arg1, 457, __wbg_adapter_69);
|
|
2792
2889
|
return ret;
|
|
2793
2890
|
};
|
|
2794
2891
|
|
|
2795
|
-
export function
|
|
2796
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2892
|
+
export function __wbindgen_closure_wrapper16136(arg0, arg1, arg2) {
|
|
2893
|
+
const ret = makeMutClosure(arg0, arg1, 457, __wbg_adapter_64);
|
|
2797
2894
|
return ret;
|
|
2798
2895
|
};
|
|
2799
2896
|
|
|
2800
|
-
export function
|
|
2801
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2897
|
+
export function __wbindgen_closure_wrapper6193(arg0, arg1, arg2) {
|
|
2898
|
+
const ret = makeMutClosure(arg0, arg1, 457, __wbg_adapter_64);
|
|
2802
2899
|
return ret;
|
|
2803
2900
|
};
|
|
2804
2901
|
|
|
2805
|
-
export function
|
|
2806
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2902
|
+
export function __wbindgen_closure_wrapper6201(arg0, arg1, arg2) {
|
|
2903
|
+
const ret = makeMutClosure(arg0, arg1, 457, __wbg_adapter_64);
|
|
2807
2904
|
return ret;
|
|
2808
2905
|
};
|
|
2809
2906
|
|
|
2810
|
-
export function
|
|
2811
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2907
|
+
export function __wbindgen_closure_wrapper7894(arg0, arg1, arg2) {
|
|
2908
|
+
const ret = makeMutClosure(arg0, arg1, 979, __wbg_adapter_69);
|
|
2812
2909
|
return ret;
|
|
2813
2910
|
};
|
|
2814
2911
|
|
|
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) =>
|
|
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
|
|
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
|
|
131
|
+
export const closure456_externref_shim: (a: number, b: number, c: any) => void;
|
|
130
132
|
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
|
|
133
|
+
export const closure736_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
132
134
|
export const __wbindgen_start: () => void;
|
package/bundler/storage/index.js
CHANGED
|
@@ -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 =
|
|
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
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
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
|
-
|
|
1176
|
-
request.onsuccess = () => resolve();
|
|
1177
|
-
request.onerror = () => {
|
|
1224
|
+
getRequest.onerror = () => {
|
|
1178
1225
|
reject(
|
|
1179
1226
|
new StorageError(
|
|
1180
|
-
`Failed to add deposit '${txid}:${vout}': ${
|
|
1227
|
+
`Failed to add deposit '${txid}:${vout}': ${getRequest.error?.message || "Unknown error"
|
|
1181
1228
|
}`,
|
|
1182
|
-
|
|
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);
|