@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
|
@@ -241,6 +241,19 @@ export function getSparkStatus() {
|
|
|
241
241
|
return ret;
|
|
242
242
|
}
|
|
243
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
|
+
|
|
244
257
|
/**
|
|
245
258
|
* @param {ConnectRequest} request
|
|
246
259
|
* @returns {Promise<BreezSdk>}
|
|
@@ -250,6 +263,15 @@ export function connect(request) {
|
|
|
250
263
|
return ret;
|
|
251
264
|
}
|
|
252
265
|
|
|
266
|
+
/**
|
|
267
|
+
* @param {Network} network
|
|
268
|
+
* @returns {Config}
|
|
269
|
+
*/
|
|
270
|
+
export function defaultConfig(network) {
|
|
271
|
+
const ret = wasm.defaultConfig(network);
|
|
272
|
+
return ret;
|
|
273
|
+
}
|
|
274
|
+
|
|
253
275
|
/**
|
|
254
276
|
* @param {Logger} logger
|
|
255
277
|
* @param {string | null} [filter]
|
|
@@ -262,15 +284,6 @@ export function initLogging(logger, filter) {
|
|
|
262
284
|
return ret;
|
|
263
285
|
}
|
|
264
286
|
|
|
265
|
-
/**
|
|
266
|
-
* @param {Network} network
|
|
267
|
-
* @returns {Config}
|
|
268
|
-
*/
|
|
269
|
-
export function defaultConfig(network) {
|
|
270
|
-
const ret = wasm.defaultConfig(network);
|
|
271
|
-
return ret;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
287
|
function takeFromExternrefTable0(idx) {
|
|
275
288
|
const value = wasm.__wbindgen_export_5.get(idx);
|
|
276
289
|
wasm.__externref_table_dealloc(idx);
|
|
@@ -295,19 +308,6 @@ export function defaultExternalSigner(mnemonic, passphrase, network, key_set_con
|
|
|
295
308
|
return DefaultSigner.__wrap(ret[0]);
|
|
296
309
|
}
|
|
297
310
|
|
|
298
|
-
/**
|
|
299
|
-
* @param {Config} config
|
|
300
|
-
* @param {ExternalSigner} signer
|
|
301
|
-
* @param {string} storage_dir
|
|
302
|
-
* @returns {Promise<BreezSdk>}
|
|
303
|
-
*/
|
|
304
|
-
export function connectWithSigner(config, signer, storage_dir) {
|
|
305
|
-
const ptr0 = passStringToWasm0(storage_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
306
|
-
const len0 = WASM_VECTOR_LEN;
|
|
307
|
-
const ret = wasm.connectWithSigner(config, signer, ptr0, len0);
|
|
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.
|
|
329
|
+
wasm.closure444_externref_shim(arg0, arg1, arg2);
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
function __wbg_adapter_69(arg0, arg1) {
|
|
333
333
|
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1bbbe552b190da27(arg0, arg1);
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
function
|
|
337
|
-
wasm.
|
|
336
|
+
function __wbg_adapter_373(arg0, arg1, arg2, arg3) {
|
|
337
|
+
wasm.closure711_externref_shim(arg0, arg1, arg2, arg3);
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
@@ -471,13 +471,6 @@ 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
|
-
}
|
|
481
474
|
/**
|
|
482
475
|
* @param {string} id
|
|
483
476
|
* @returns {Promise<void>}
|
|
@@ -541,14 +534,6 @@ export class BreezSdk {
|
|
|
541
534
|
const ret = wasm.breezsdk_recommendedFees(this.__wbg_ptr);
|
|
542
535
|
return ret;
|
|
543
536
|
}
|
|
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
|
-
}
|
|
552
537
|
/**
|
|
553
538
|
* @returns {Promise<UserSettings>}
|
|
554
539
|
*/
|
|
@@ -580,14 +565,6 @@ export class BreezSdk {
|
|
|
580
565
|
const ret = wasm.breezsdk_claimHtlcPayment(this.__wbg_ptr, request);
|
|
581
566
|
return ret;
|
|
582
567
|
}
|
|
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
|
-
}
|
|
591
568
|
/**
|
|
592
569
|
* @param {GetTokensMetadataRequest} request
|
|
593
570
|
* @returns {Promise<GetTokensMetadataResponse>}
|
|
@@ -652,12 +629,8 @@ export class BreezSdk {
|
|
|
652
629
|
const ret = wasm.breezsdk_listUnclaimedDeposits(this.__wbg_ptr, request);
|
|
653
630
|
return ret;
|
|
654
631
|
}
|
|
655
|
-
/**
|
|
656
|
-
* @returns {Promise<void>}
|
|
657
|
-
*/
|
|
658
632
|
startLeafOptimization() {
|
|
659
|
-
|
|
660
|
-
return ret;
|
|
633
|
+
wasm.breezsdk_startLeafOptimization(this.__wbg_ptr);
|
|
661
634
|
}
|
|
662
635
|
/**
|
|
663
636
|
* @returns {Promise<void>}
|
|
@@ -1260,9 +1233,9 @@ export class SdkBuilder {
|
|
|
1260
1233
|
* @param {PostgresStorageConfig} config
|
|
1261
1234
|
* @returns {SdkBuilder}
|
|
1262
1235
|
*/
|
|
1263
|
-
|
|
1236
|
+
withPostgresStorage(config) {
|
|
1264
1237
|
const ptr = this.__destroy_into_raw();
|
|
1265
|
-
const ret = wasm.
|
|
1238
|
+
const ret = wasm.sdkbuilder_withPostgresStorage(ptr, config);
|
|
1266
1239
|
return SdkBuilder.__wrap(ret);
|
|
1267
1240
|
}
|
|
1268
1241
|
/**
|
|
@@ -1278,6 +1251,15 @@ export class SdkBuilder {
|
|
|
1278
1251
|
const ret = wasm.sdkbuilder_withRestChainService(ptr, ptr0, len0, api_type, isLikeNone(credentials) ? 0 : addToExternrefTable0(credentials));
|
|
1279
1252
|
return SdkBuilder.__wrap(ret);
|
|
1280
1253
|
}
|
|
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
|
+
}
|
|
1281
1263
|
/**
|
|
1282
1264
|
* @param {Config} config
|
|
1283
1265
|
* @param {Seed} seed
|
|
@@ -1425,13 +1407,13 @@ function __wbg_get_imports() {
|
|
|
1425
1407
|
imports.wbg.__wbg_abort_775ef1d17fc65868 = function(arg0) {
|
|
1426
1408
|
arg0.abort();
|
|
1427
1409
|
};
|
|
1428
|
-
imports.wbg.
|
|
1410
|
+
imports.wbg.__wbg_addDeposit_5b1f93e7014f1e18 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1429
1411
|
let deferred0_0;
|
|
1430
1412
|
let deferred0_1;
|
|
1431
1413
|
try {
|
|
1432
1414
|
deferred0_0 = arg1;
|
|
1433
1415
|
deferred0_1 = arg2;
|
|
1434
|
-
const ret = arg0.addDeposit(getStringFromWasm0(arg1, arg2), arg3 >>> 0, BigInt.asUintN(64, arg4)
|
|
1416
|
+
const ret = arg0.addDeposit(getStringFromWasm0(arg1, arg2), arg3 >>> 0, BigInt.asUintN(64, arg4));
|
|
1435
1417
|
return ret;
|
|
1436
1418
|
} finally {
|
|
1437
1419
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
@@ -1518,18 +1500,6 @@ function __wbg_get_imports() {
|
|
|
1518
1500
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1519
1501
|
}
|
|
1520
1502
|
}, 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) };
|
|
1533
1503
|
imports.wbg.__wbg_cancel_8a308660caa6cadf = function(arg0) {
|
|
1534
1504
|
const ret = arg0.cancel();
|
|
1535
1505
|
return ret;
|
|
@@ -1567,20 +1537,12 @@ function __wbg_get_imports() {
|
|
|
1567
1537
|
const ret = createDefaultStorage(getStringFromWasm0(arg0, arg1), arg2);
|
|
1568
1538
|
return ret;
|
|
1569
1539
|
}, arguments) };
|
|
1570
|
-
imports.wbg.
|
|
1571
|
-
const ret =
|
|
1572
|
-
return ret;
|
|
1573
|
-
}, arguments) };
|
|
1574
|
-
imports.wbg.__wbg_createPostgresStorageWithPool_77aa64bddd7440db = function() { return handleError(function (arg0, arg1) {
|
|
1575
|
-
const ret = createPostgresStorageWithPool(arg0, arg1);
|
|
1540
|
+
imports.wbg.__wbg_createPostgresStorage_46770cbf8e947f9e = function() { return handleError(function (arg0, arg1) {
|
|
1541
|
+
const ret = createPostgresStorage(arg0, arg1);
|
|
1576
1542
|
return ret;
|
|
1577
1543
|
}, arguments) };
|
|
1578
|
-
imports.wbg.
|
|
1579
|
-
const ret =
|
|
1580
|
-
return ret;
|
|
1581
|
-
}, arguments) };
|
|
1582
|
-
imports.wbg.__wbg_createPostgresTreeStoreWithPool_55e19122e69fb9e3 = function() { return handleError(function (arg0, arg1) {
|
|
1583
|
-
const ret = createPostgresTreeStoreWithPool(arg0, arg1);
|
|
1544
|
+
imports.wbg.__wbg_createPostgresTreeStore_7887b0b703c72f83 = function() { return handleError(function (arg0, arg1) {
|
|
1545
|
+
const ret = createPostgresTreeStore(arg0, arg1);
|
|
1584
1546
|
return ret;
|
|
1585
1547
|
}, arguments) };
|
|
1586
1548
|
imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
|
|
@@ -1738,18 +1700,6 @@ function __wbg_get_imports() {
|
|
|
1738
1700
|
const ret = fetch(arg0);
|
|
1739
1701
|
return ret;
|
|
1740
1702
|
};
|
|
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) };
|
|
1753
1703
|
imports.wbg.__wbg_finalizeReservation_a8fad570b7fe5185 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1754
1704
|
let deferred0_0;
|
|
1755
1705
|
let deferred0_1;
|
|
@@ -1882,10 +1832,6 @@ function __wbg_get_imports() {
|
|
|
1882
1832
|
const ret = arg0.getStaticDepositSecretSource(arg1 >>> 0);
|
|
1883
1833
|
return ret;
|
|
1884
1834
|
}, arguments) };
|
|
1885
|
-
imports.wbg.__wbg_getTokenOutputs_f51d6f5d47330273 = function() { return handleError(function (arg0, arg1) {
|
|
1886
|
-
const ret = arg0.getTokenOutputs(arg1);
|
|
1887
|
-
return ret;
|
|
1888
|
-
}, arguments) };
|
|
1889
1835
|
imports.wbg.__wbg_getTransactionHex_973b8d0555c60f99 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1890
1836
|
let deferred0_0;
|
|
1891
1837
|
let deferred0_1;
|
|
@@ -1976,10 +1922,6 @@ function __wbg_get_imports() {
|
|
|
1976
1922
|
const ret = arg0.insertPayment(arg1);
|
|
1977
1923
|
return ret;
|
|
1978
1924
|
}, arguments) };
|
|
1979
|
-
imports.wbg.__wbg_insertTokenOutputs_043ceea065ff8f65 = function() { return handleError(function (arg0, arg1) {
|
|
1980
|
-
const ret = arg0.insertTokenOutputs(arg1);
|
|
1981
|
-
return ret;
|
|
1982
|
-
}, arguments) };
|
|
1983
1925
|
imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
|
|
1984
1926
|
let result;
|
|
1985
1927
|
try {
|
|
@@ -2096,10 +2038,6 @@ function __wbg_get_imports() {
|
|
|
2096
2038
|
const ret = arg0.listPayments(arg1);
|
|
2097
2039
|
return ret;
|
|
2098
2040
|
}, arguments) };
|
|
2099
|
-
imports.wbg.__wbg_listTokensOutputs_4b4500bd5aca2c88 = function() { return handleError(function (arg0) {
|
|
2100
|
-
const ret = arg0.listTokensOutputs();
|
|
2101
|
-
return ret;
|
|
2102
|
-
}, arguments) };
|
|
2103
2041
|
imports.wbg.__wbg_log_62b3ddcc89229688 = function(arg0, arg1) {
|
|
2104
2042
|
arg0.log(arg1);
|
|
2105
2043
|
};
|
|
@@ -2140,7 +2078,7 @@ function __wbg_get_imports() {
|
|
|
2140
2078
|
const a = state0.a;
|
|
2141
2079
|
state0.a = 0;
|
|
2142
2080
|
try {
|
|
2143
|
-
return
|
|
2081
|
+
return __wbg_adapter_373(a, state0.b, arg0, arg1);
|
|
2144
2082
|
} finally {
|
|
2145
2083
|
state0.a = a;
|
|
2146
2084
|
}
|
|
@@ -2219,10 +2157,6 @@ function __wbg_get_imports() {
|
|
|
2219
2157
|
const ret = Date.now();
|
|
2220
2158
|
return ret;
|
|
2221
2159
|
}, arguments) };
|
|
2222
|
-
imports.wbg.__wbg_now_79892f24f17d010a = function() { return handleError(function (arg0) {
|
|
2223
|
-
const ret = arg0.now();
|
|
2224
|
-
return ret;
|
|
2225
|
-
}, arguments) };
|
|
2226
2160
|
imports.wbg.__wbg_now_807e54c39636c349 = function() {
|
|
2227
2161
|
const ret = Date.now();
|
|
2228
2162
|
return ret;
|
|
@@ -2294,23 +2228,6 @@ function __wbg_get_imports() {
|
|
|
2294
2228
|
const ret = module.require;
|
|
2295
2229
|
return ret;
|
|
2296
2230
|
}, 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) };
|
|
2314
2231
|
imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
|
|
2315
2232
|
const ret = Promise.resolve(arg0);
|
|
2316
2233
|
return ret;
|
|
@@ -2366,10 +2283,6 @@ function __wbg_get_imports() {
|
|
|
2366
2283
|
const ret = setTimeout(arg0, arg1);
|
|
2367
2284
|
return ret;
|
|
2368
2285
|
}, 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) };
|
|
2373
2286
|
imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
|
|
2374
2287
|
arg0[arg1 >>> 0] = arg2;
|
|
2375
2288
|
};
|
|
@@ -2680,24 +2593,24 @@ function __wbg_get_imports() {
|
|
|
2680
2593
|
const ret = false;
|
|
2681
2594
|
return ret;
|
|
2682
2595
|
};
|
|
2683
|
-
imports.wbg.
|
|
2684
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2596
|
+
imports.wbg.__wbindgen_closure_wrapper10368 = function(arg0, arg1, arg2) {
|
|
2597
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_69);
|
|
2685
2598
|
return ret;
|
|
2686
2599
|
};
|
|
2687
|
-
imports.wbg.
|
|
2688
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2600
|
+
imports.wbg.__wbindgen_closure_wrapper15754 = function(arg0, arg1, arg2) {
|
|
2601
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
|
|
2689
2602
|
return ret;
|
|
2690
2603
|
};
|
|
2691
|
-
imports.wbg.
|
|
2692
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2604
|
+
imports.wbg.__wbindgen_closure_wrapper5890 = function(arg0, arg1, arg2) {
|
|
2605
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
|
|
2693
2606
|
return ret;
|
|
2694
2607
|
};
|
|
2695
|
-
imports.wbg.
|
|
2696
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2608
|
+
imports.wbg.__wbindgen_closure_wrapper5898 = function(arg0, arg1, arg2) {
|
|
2609
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
|
|
2697
2610
|
return ret;
|
|
2698
2611
|
};
|
|
2699
|
-
imports.wbg.
|
|
2700
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2612
|
+
imports.wbg.__wbindgen_closure_wrapper7595 = function(arg0, arg1, arg2) {
|
|
2613
|
+
const ret = makeMutClosure(arg0, arg1, 954, __wbg_adapter_69);
|
|
2701
2614
|
return ret;
|
|
2702
2615
|
};
|
|
2703
2616
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
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/web/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);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// errors.cjs - Token store error wrapper with cause chain support
|
|
2
|
-
class TokenStoreError extends Error {
|
|
3
|
-
constructor(message, cause = null) {
|
|
4
|
-
super(message);
|
|
5
|
-
this.name = 'TokenStoreError';
|
|
6
|
-
this.cause = cause;
|
|
7
|
-
if (Error.captureStackTrace) {
|
|
8
|
-
Error.captureStackTrace(this, TokenStoreError);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
module.exports = { TokenStoreError };
|