@breeztech/breez-sdk-spark 0.12.2-dev3 → 0.12.2
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 +601 -731
- package/bundler/breez_sdk_spark_wasm_bg.js +54 -151
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -7
- package/bundler/storage/index.js +43 -65
- package/deno/breez_sdk_spark_wasm.d.ts +601 -731
- package/deno/breez_sdk_spark_wasm.js +54 -141
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -7
- package/nodejs/breez_sdk_spark_wasm.d.ts +601 -731
- package/nodejs/breez_sdk_spark_wasm.js +54 -151
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -7
- package/nodejs/index.js +2 -16
- package/nodejs/package.json +0 -1
- package/nodejs/postgres-storage/index.cjs +31 -42
- package/nodejs/postgres-storage/migrations.cjs +0 -24
- package/nodejs/postgres-tree-store/index.cjs +2 -12
- package/nodejs/storage/index.cjs +28 -19
- package/nodejs/storage/migrations.cjs +0 -18
- package/package.json +1 -1
- package/web/breez_sdk_spark_wasm.d.ts +606 -738
- package/web/breez_sdk_spark_wasm.js +54 -141
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -7
- package/web/storage/index.js +43 -65
- package/nodejs/postgres-token-store/errors.cjs +0 -13
- package/nodejs/postgres-token-store/index.cjs +0 -857
- package/nodejs/postgres-token-store/migrations.cjs +0 -163
- package/nodejs/postgres-token-store/package.json +0 -9
|
@@ -249,6 +249,19 @@ 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
|
+
|
|
252
265
|
/**
|
|
253
266
|
* @param {ConnectRequest} request
|
|
254
267
|
* @returns {Promise<BreezSdk>}
|
|
@@ -258,6 +271,15 @@ export function connect(request) {
|
|
|
258
271
|
return ret;
|
|
259
272
|
}
|
|
260
273
|
|
|
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
|
+
|
|
261
283
|
/**
|
|
262
284
|
* @param {Logger} logger
|
|
263
285
|
* @param {string | null} [filter]
|
|
@@ -270,15 +292,6 @@ export function initLogging(logger, filter) {
|
|
|
270
292
|
return ret;
|
|
271
293
|
}
|
|
272
294
|
|
|
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
|
-
|
|
282
295
|
function takeFromExternrefTable0(idx) {
|
|
283
296
|
const value = wasm.__wbindgen_export_5.get(idx);
|
|
284
297
|
wasm.__externref_table_dealloc(idx);
|
|
@@ -303,19 +316,6 @@ export function defaultExternalSigner(mnemonic, passphrase, network, key_set_con
|
|
|
303
316
|
return DefaultSigner.__wrap(ret[0]);
|
|
304
317
|
}
|
|
305
318
|
|
|
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.closure444_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_373(arg0, arg1, arg2, arg3) {
|
|
345
|
+
wasm.closure711_externref_shim(arg0, arg1, arg2, arg3);
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
@@ -479,13 +479,6 @@ 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
|
-
}
|
|
489
482
|
/**
|
|
490
483
|
* @param {string} id
|
|
491
484
|
* @returns {Promise<void>}
|
|
@@ -549,14 +542,6 @@ export class BreezSdk {
|
|
|
549
542
|
const ret = wasm.breezsdk_recommendedFees(this.__wbg_ptr);
|
|
550
543
|
return ret;
|
|
551
544
|
}
|
|
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
|
-
}
|
|
560
545
|
/**
|
|
561
546
|
* @returns {Promise<UserSettings>}
|
|
562
547
|
*/
|
|
@@ -588,14 +573,6 @@ export class BreezSdk {
|
|
|
588
573
|
const ret = wasm.breezsdk_claimHtlcPayment(this.__wbg_ptr, request);
|
|
589
574
|
return ret;
|
|
590
575
|
}
|
|
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
|
-
}
|
|
599
576
|
/**
|
|
600
577
|
* @param {GetTokensMetadataRequest} request
|
|
601
578
|
* @returns {Promise<GetTokensMetadataResponse>}
|
|
@@ -660,12 +637,8 @@ export class BreezSdk {
|
|
|
660
637
|
const ret = wasm.breezsdk_listUnclaimedDeposits(this.__wbg_ptr, request);
|
|
661
638
|
return ret;
|
|
662
639
|
}
|
|
663
|
-
/**
|
|
664
|
-
* @returns {Promise<void>}
|
|
665
|
-
*/
|
|
666
640
|
startLeafOptimization() {
|
|
667
|
-
|
|
668
|
-
return ret;
|
|
641
|
+
wasm.breezsdk_startLeafOptimization(this.__wbg_ptr);
|
|
669
642
|
}
|
|
670
643
|
/**
|
|
671
644
|
* @returns {Promise<void>}
|
|
@@ -1268,9 +1241,9 @@ export class SdkBuilder {
|
|
|
1268
1241
|
* @param {PostgresStorageConfig} config
|
|
1269
1242
|
* @returns {SdkBuilder}
|
|
1270
1243
|
*/
|
|
1271
|
-
|
|
1244
|
+
withPostgresStorage(config) {
|
|
1272
1245
|
const ptr = this.__destroy_into_raw();
|
|
1273
|
-
const ret = wasm.
|
|
1246
|
+
const ret = wasm.sdkbuilder_withPostgresStorage(ptr, config);
|
|
1274
1247
|
return SdkBuilder.__wrap(ret);
|
|
1275
1248
|
}
|
|
1276
1249
|
/**
|
|
@@ -1286,6 +1259,15 @@ export class SdkBuilder {
|
|
|
1286
1259
|
const ret = wasm.sdkbuilder_withRestChainService(ptr, ptr0, len0, api_type, isLikeNone(credentials) ? 0 : addToExternrefTable0(credentials));
|
|
1287
1260
|
return SdkBuilder.__wrap(ret);
|
|
1288
1261
|
}
|
|
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
|
+
}
|
|
1289
1271
|
/**
|
|
1290
1272
|
* @param {Config} config
|
|
1291
1273
|
* @param {Seed} seed
|
|
@@ -1402,13 +1384,13 @@ export function __wbg_abort_775ef1d17fc65868(arg0) {
|
|
|
1402
1384
|
arg0.abort();
|
|
1403
1385
|
};
|
|
1404
1386
|
|
|
1405
|
-
export function
|
|
1387
|
+
export function __wbg_addDeposit_5b1f93e7014f1e18() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1406
1388
|
let deferred0_0;
|
|
1407
1389
|
let deferred0_1;
|
|
1408
1390
|
try {
|
|
1409
1391
|
deferred0_0 = arg1;
|
|
1410
1392
|
deferred0_1 = arg2;
|
|
1411
|
-
const ret = arg0.addDeposit(getStringFromWasm0(arg1, arg2), arg3 >>> 0, BigInt.asUintN(64, arg4)
|
|
1393
|
+
const ret = arg0.addDeposit(getStringFromWasm0(arg1, arg2), arg3 >>> 0, BigInt.asUintN(64, arg4));
|
|
1412
1394
|
return ret;
|
|
1413
1395
|
} finally {
|
|
1414
1396
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
@@ -1512,19 +1494,6 @@ export function __wbg_cancelReservation_d85a13db3e8e3c7b() { return handleError(
|
|
|
1512
1494
|
}
|
|
1513
1495
|
}, arguments) };
|
|
1514
1496
|
|
|
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
|
-
|
|
1528
1497
|
export function __wbg_cancel_8a308660caa6cadf(arg0) {
|
|
1529
1498
|
const ret = arg0.cancel();
|
|
1530
1499
|
return ret;
|
|
@@ -1572,23 +1541,13 @@ export function __wbg_createDefaultStorage_458aa01b5eaead27() { return handleErr
|
|
|
1572
1541
|
return ret;
|
|
1573
1542
|
}, arguments) };
|
|
1574
1543
|
|
|
1575
|
-
export function
|
|
1576
|
-
const ret =
|
|
1544
|
+
export function __wbg_createPostgresStorage_46770cbf8e947f9e() { return handleError(function (arg0, arg1) {
|
|
1545
|
+
const ret = createPostgresStorage(arg0, arg1);
|
|
1577
1546
|
return ret;
|
|
1578
1547
|
}, arguments) };
|
|
1579
1548
|
|
|
1580
|
-
export function
|
|
1581
|
-
const ret =
|
|
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);
|
|
1549
|
+
export function __wbg_createPostgresTreeStore_7887b0b703c72f83() { return handleError(function (arg0, arg1) {
|
|
1550
|
+
const ret = createPostgresTreeStore(arg0, arg1);
|
|
1592
1551
|
return ret;
|
|
1593
1552
|
}, arguments) };
|
|
1594
1553
|
|
|
@@ -1768,19 +1727,6 @@ export function __wbg_fetch_f156d10be9a5c88a(arg0) {
|
|
|
1768
1727
|
return ret;
|
|
1769
1728
|
};
|
|
1770
1729
|
|
|
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
|
-
|
|
1784
1730
|
export function __wbg_finalizeReservation_a8fad570b7fe5185() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1785
1731
|
let deferred0_0;
|
|
1786
1732
|
let deferred0_1;
|
|
@@ -1932,11 +1878,6 @@ export function __wbg_getStaticDepositSecretSource_8e310c718339e400() { return h
|
|
|
1932
1878
|
return ret;
|
|
1933
1879
|
}, arguments) };
|
|
1934
1880
|
|
|
1935
|
-
export function __wbg_getTokenOutputs_f51d6f5d47330273() { return handleError(function (arg0, arg1) {
|
|
1936
|
-
const ret = arg0.getTokenOutputs(arg1);
|
|
1937
|
-
return ret;
|
|
1938
|
-
}, arguments) };
|
|
1939
|
-
|
|
1940
1881
|
export function __wbg_getTransactionHex_973b8d0555c60f99() { return handleError(function (arg0, arg1, arg2) {
|
|
1941
1882
|
let deferred0_0;
|
|
1942
1883
|
let deferred0_1;
|
|
@@ -2041,11 +1982,6 @@ export function __wbg_insertPayment_2afe3300c5f86ccf() { return handleError(func
|
|
|
2041
1982
|
return ret;
|
|
2042
1983
|
}, arguments) };
|
|
2043
1984
|
|
|
2044
|
-
export function __wbg_insertTokenOutputs_043ceea065ff8f65() { return handleError(function (arg0, arg1) {
|
|
2045
|
-
const ret = arg0.insertTokenOutputs(arg1);
|
|
2046
|
-
return ret;
|
|
2047
|
-
}, arguments) };
|
|
2048
|
-
|
|
2049
1985
|
export function __wbg_instanceof_ArrayBuffer_e14585432e3737fc(arg0) {
|
|
2050
1986
|
let result;
|
|
2051
1987
|
try {
|
|
@@ -2179,11 +2115,6 @@ export function __wbg_listPayments_d8c53ab09ffc756b() { return handleError(funct
|
|
|
2179
2115
|
return ret;
|
|
2180
2116
|
}, arguments) };
|
|
2181
2117
|
|
|
2182
|
-
export function __wbg_listTokensOutputs_4b4500bd5aca2c88() { return handleError(function (arg0) {
|
|
2183
|
-
const ret = arg0.listTokensOutputs();
|
|
2184
|
-
return ret;
|
|
2185
|
-
}, arguments) };
|
|
2186
|
-
|
|
2187
2118
|
export function __wbg_log_62b3ddcc89229688(arg0, arg1) {
|
|
2188
2119
|
arg0.log(arg1);
|
|
2189
2120
|
};
|
|
@@ -2231,7 +2162,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
|
|
|
2231
2162
|
const a = state0.a;
|
|
2232
2163
|
state0.a = 0;
|
|
2233
2164
|
try {
|
|
2234
|
-
return
|
|
2165
|
+
return __wbg_adapter_373(a, state0.b, arg0, arg1);
|
|
2235
2166
|
} finally {
|
|
2236
2167
|
state0.a = a;
|
|
2237
2168
|
}
|
|
@@ -2328,11 +2259,6 @@ export function __wbg_now_6af59e24f5a53ad4() { return handleError(function () {
|
|
|
2328
2259
|
return ret;
|
|
2329
2260
|
}, arguments) };
|
|
2330
2261
|
|
|
2331
|
-
export function __wbg_now_79892f24f17d010a() { return handleError(function (arg0) {
|
|
2332
|
-
const ret = arg0.now();
|
|
2333
|
-
return ret;
|
|
2334
|
-
}, arguments) };
|
|
2335
|
-
|
|
2336
2262
|
export function __wbg_now_807e54c39636c349() {
|
|
2337
2263
|
const ret = Date.now();
|
|
2338
2264
|
return ret;
|
|
@@ -2419,24 +2345,6 @@ export function __wbg_require_60cc747a6bc5215a() { return handleError(function (
|
|
|
2419
2345
|
return ret;
|
|
2420
2346
|
}, arguments) };
|
|
2421
2347
|
|
|
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
|
-
|
|
2440
2348
|
export function __wbg_resolve_4851785c9c5f573d(arg0) {
|
|
2441
2349
|
const ret = Promise.resolve(arg0);
|
|
2442
2350
|
return ret;
|
|
@@ -2503,11 +2411,6 @@ export function __wbg_setTimeout_db2dbaeefb6f39c7() { return handleError(functio
|
|
|
2503
2411
|
return ret;
|
|
2504
2412
|
}, arguments) };
|
|
2505
2413
|
|
|
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
|
-
|
|
2511
2414
|
export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
|
|
2512
2415
|
arg0[arg1 >>> 0] = arg2;
|
|
2513
2416
|
};
|
|
@@ -2884,28 +2787,28 @@ export function __wbindgen_cb_drop(arg0) {
|
|
|
2884
2787
|
return ret;
|
|
2885
2788
|
};
|
|
2886
2789
|
|
|
2887
|
-
export function
|
|
2888
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2790
|
+
export function __wbindgen_closure_wrapper10368(arg0, arg1, arg2) {
|
|
2791
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_69);
|
|
2889
2792
|
return ret;
|
|
2890
2793
|
};
|
|
2891
2794
|
|
|
2892
|
-
export function
|
|
2893
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2795
|
+
export function __wbindgen_closure_wrapper15754(arg0, arg1, arg2) {
|
|
2796
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
|
|
2894
2797
|
return ret;
|
|
2895
2798
|
};
|
|
2896
2799
|
|
|
2897
|
-
export function
|
|
2898
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2800
|
+
export function __wbindgen_closure_wrapper5890(arg0, arg1, arg2) {
|
|
2801
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
|
|
2899
2802
|
return ret;
|
|
2900
2803
|
};
|
|
2901
2804
|
|
|
2902
|
-
export function
|
|
2903
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2805
|
+
export function __wbindgen_closure_wrapper5898(arg0, arg1, arg2) {
|
|
2806
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
|
|
2904
2807
|
return ret;
|
|
2905
2808
|
};
|
|
2906
2809
|
|
|
2907
|
-
export function
|
|
2908
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2810
|
+
export function __wbindgen_closure_wrapper7595(arg0, arg1, arg2) {
|
|
2811
|
+
const ret = makeMutClosure(arg0, arg1, 954, __wbg_adapter_69);
|
|
2909
2812
|
return ret;
|
|
2910
2813
|
};
|
|
2911
2814
|
|
|
Binary file
|
|
@@ -30,7 +30,6 @@ 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;
|
|
34
33
|
export const breezsdk_lnurlAuth: (a: number, b: any) => any;
|
|
35
34
|
export const breezsdk_lnurlPay: (a: number, b: any) => any;
|
|
36
35
|
export const breezsdk_lnurlWithdraw: (a: number, b: any) => any;
|
|
@@ -41,13 +40,11 @@ export const breezsdk_receivePayment: (a: number, b: any) => any;
|
|
|
41
40
|
export const breezsdk_recommendedFees: (a: number) => any;
|
|
42
41
|
export const breezsdk_refundDeposit: (a: number, b: any) => any;
|
|
43
42
|
export const breezsdk_registerLightningAddress: (a: number, b: any) => any;
|
|
44
|
-
export const breezsdk_registerWebhook: (a: number, b: any) => any;
|
|
45
43
|
export const breezsdk_removeEventListener: (a: number, b: number, c: number) => any;
|
|
46
44
|
export const breezsdk_sendPayment: (a: number, b: any) => any;
|
|
47
45
|
export const breezsdk_signMessage: (a: number, b: any) => any;
|
|
48
|
-
export const breezsdk_startLeafOptimization: (a: number) =>
|
|
46
|
+
export const breezsdk_startLeafOptimization: (a: number) => void;
|
|
49
47
|
export const breezsdk_syncWallet: (a: number, b: any) => any;
|
|
50
|
-
export const breezsdk_unregisterWebhook: (a: number, b: any) => any;
|
|
51
48
|
export const breezsdk_updateContact: (a: number, b: any) => any;
|
|
52
49
|
export const breezsdk_updateUserSettings: (a: number, b: any) => any;
|
|
53
50
|
export const connect: (a: any) => any;
|
|
@@ -91,7 +88,8 @@ export const sdkbuilder_withFiatService: (a: number, b: any) => number;
|
|
|
91
88
|
export const sdkbuilder_withKeySet: (a: number, b: any) => number;
|
|
92
89
|
export const sdkbuilder_withLnurlClient: (a: number, b: any) => number;
|
|
93
90
|
export const sdkbuilder_withPaymentObserver: (a: number, b: any) => number;
|
|
94
|
-
export const
|
|
91
|
+
export const sdkbuilder_withPostgresStorage: (a: number, b: any) => number;
|
|
92
|
+
export const sdkbuilder_withPostgresTreeStore: (a: number, b: any) => number;
|
|
95
93
|
export const sdkbuilder_withRestChainService: (a: number, b: number, c: number, d: any, e: number) => number;
|
|
96
94
|
export const sdkbuilder_withStorage: (a: number, b: any) => number;
|
|
97
95
|
export const tokenissuer_burnIssuerToken: (a: number, b: any) => any;
|
|
@@ -128,7 +126,7 @@ export const __wbindgen_export_5: WebAssembly.Table;
|
|
|
128
126
|
export const __externref_drop_slice: (a: number, b: number) => void;
|
|
129
127
|
export const __wbindgen_export_7: WebAssembly.Table;
|
|
130
128
|
export const __externref_table_dealloc: (a: number) => void;
|
|
131
|
-
export const
|
|
129
|
+
export const closure444_externref_shim: (a: number, b: number, c: any) => void;
|
|
132
130
|
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1bbbe552b190da27: (a: number, b: number) => void;
|
|
133
|
-
export const
|
|
131
|
+
export const closure711_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
134
132
|
export const __wbindgen_start: () => void;
|
package/bundler/storage/index.js
CHANGED
|
@@ -428,35 +428,6 @@ 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
|
-
},
|
|
460
431
|
];
|
|
461
432
|
}
|
|
462
433
|
}
|
|
@@ -480,7 +451,7 @@ class IndexedDBStorage {
|
|
|
480
451
|
this.db = null;
|
|
481
452
|
this.migrationManager = null;
|
|
482
453
|
this.logger = logger;
|
|
483
|
-
this.dbVersion =
|
|
454
|
+
this.dbVersion = 14; // Current schema version
|
|
484
455
|
}
|
|
485
456
|
|
|
486
457
|
/**
|
|
@@ -1152,7 +1123,6 @@ class IndexedDBStorage {
|
|
|
1152
1123
|
conversionInfo: metadata.conversionInfo
|
|
1153
1124
|
? JSON.stringify(metadata.conversionInfo)
|
|
1154
1125
|
: existing.conversionInfo ?? null,
|
|
1155
|
-
conversionStatus: metadata.conversionStatus ?? existing.conversionStatus ?? null,
|
|
1156
1126
|
};
|
|
1157
1127
|
|
|
1158
1128
|
const putRequest = store.put(metadataToStore);
|
|
@@ -1181,7 +1151,7 @@ class IndexedDBStorage {
|
|
|
1181
1151
|
|
|
1182
1152
|
// ===== Deposit Operations =====
|
|
1183
1153
|
|
|
1184
|
-
async addDeposit(txid, vout, amountSats
|
|
1154
|
+
async addDeposit(txid, vout, amountSats) {
|
|
1185
1155
|
if (!this.db) {
|
|
1186
1156
|
throw new StorageError("Database not initialized");
|
|
1187
1157
|
}
|
|
@@ -1193,40 +1163,23 @@ class IndexedDBStorage {
|
|
|
1193
1163
|
);
|
|
1194
1164
|
const store = transaction.objectStore("unclaimed_deposits");
|
|
1195
1165
|
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
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
|
-
};
|
|
1166
|
+
const depositToStore = {
|
|
1167
|
+
txid,
|
|
1168
|
+
vout,
|
|
1169
|
+
amountSats,
|
|
1170
|
+
claimError: null,
|
|
1171
|
+
refundTx: null,
|
|
1172
|
+
refundTxId: null,
|
|
1222
1173
|
};
|
|
1223
1174
|
|
|
1224
|
-
|
|
1175
|
+
const request = store.put(depositToStore);
|
|
1176
|
+
request.onsuccess = () => resolve();
|
|
1177
|
+
request.onerror = () => {
|
|
1225
1178
|
reject(
|
|
1226
1179
|
new StorageError(
|
|
1227
|
-
`Failed to add deposit '${txid}:${vout}': ${
|
|
1180
|
+
`Failed to add deposit '${txid}:${vout}': ${request.error?.message || "Unknown error"
|
|
1228
1181
|
}`,
|
|
1229
|
-
|
|
1182
|
+
request.error
|
|
1230
1183
|
)
|
|
1231
1184
|
);
|
|
1232
1185
|
};
|
|
@@ -1274,7 +1227,6 @@ class IndexedDBStorage {
|
|
|
1274
1227
|
txid: row.txid,
|
|
1275
1228
|
vout: row.vout,
|
|
1276
1229
|
amountSats: row.amountSats,
|
|
1277
|
-
isMature: row.isMature ?? true,
|
|
1278
1230
|
claimError: row.claimError ? JSON.parse(row.claimError) : null,
|
|
1279
1231
|
refundTx: row.refundTx,
|
|
1280
1232
|
refundTxId: row.refundTxId,
|
|
@@ -1383,6 +1335,7 @@ class IndexedDBStorage {
|
|
|
1383
1335
|
nostrZapRequest: item.nostrZapRequest || null,
|
|
1384
1336
|
nostrZapReceipt: item.nostrZapReceipt || null,
|
|
1385
1337
|
senderComment: item.senderComment || null,
|
|
1338
|
+
preimage: item.preimage || null,
|
|
1386
1339
|
});
|
|
1387
1340
|
|
|
1388
1341
|
request.onsuccess = () => {
|
|
@@ -2136,6 +2089,33 @@ class IndexedDBStorage {
|
|
|
2136
2089
|
continue;
|
|
2137
2090
|
}
|
|
2138
2091
|
}
|
|
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
|
+
}
|
|
2139
2119
|
|
|
2140
2120
|
|
|
2141
2121
|
paymentDetailsFilterMatches = true;
|
|
@@ -2274,9 +2254,6 @@ class IndexedDBStorage {
|
|
|
2274
2254
|
timestamp: payment.timestamp,
|
|
2275
2255
|
method,
|
|
2276
2256
|
details,
|
|
2277
|
-
conversionDetails: metadata?.conversionStatus
|
|
2278
|
-
? { status: metadata.conversionStatus, from: null, to: null }
|
|
2279
|
-
: null,
|
|
2280
2257
|
};
|
|
2281
2258
|
}
|
|
2282
2259
|
|
|
@@ -2306,6 +2283,7 @@ class IndexedDBStorage {
|
|
|
2306
2283
|
nostrZapRequest: lnurlReceiveMetadata.nostrZapRequest || null,
|
|
2307
2284
|
nostrZapReceipt: lnurlReceiveMetadata.nostrZapReceipt || null,
|
|
2308
2285
|
senderComment: lnurlReceiveMetadata.senderComment || null,
|
|
2286
|
+
preimage: lnurlReceiveMetadata.preimage || null,
|
|
2309
2287
|
};
|
|
2310
2288
|
}
|
|
2311
2289
|
resolve(payment);
|