@breeztech/breez-sdk-spark 0.13.10-dev → 0.13.11-dev1
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/breez-sdk-spark.tgz +0 -0
- package/bundler/breez_sdk_spark_wasm.d.ts +33 -0
- package/bundler/breez_sdk_spark_wasm.js +1 -1
- package/bundler/breez_sdk_spark_wasm_bg.js +66 -24
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/deno/breez_sdk_spark_wasm.d.ts +33 -0
- package/deno/breez_sdk_spark_wasm.js +66 -24
- 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 +33 -0
- package/nodejs/breez_sdk_spark_wasm.js +67 -24
- 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 +34 -0
- package/nodejs/index.mjs +1 -0
- package/nodejs/mysql-storage/errors.cjs +19 -0
- package/nodejs/mysql-storage/index.cjs +1366 -0
- package/nodejs/mysql-storage/migrations.cjs +387 -0
- package/nodejs/mysql-storage/package.json +9 -0
- package/nodejs/mysql-token-store/errors.cjs +9 -0
- package/nodejs/mysql-token-store/index.cjs +988 -0
- package/nodejs/mysql-token-store/migrations.cjs +255 -0
- package/nodejs/mysql-token-store/package.json +9 -0
- package/nodejs/mysql-tree-store/errors.cjs +9 -0
- package/nodejs/mysql-tree-store/index.cjs +939 -0
- package/nodejs/mysql-tree-store/migrations.cjs +221 -0
- package/nodejs/mysql-tree-store/package.json +9 -0
- package/nodejs/package.json +3 -0
- package/nodejs/postgres-storage/index.cjs +147 -92
- package/nodejs/postgres-storage/migrations.cjs +85 -4
- package/nodejs/postgres-token-store/index.cjs +176 -89
- package/nodejs/postgres-token-store/migrations.cjs +92 -3
- package/nodejs/postgres-tree-store/index.cjs +168 -83
- package/nodejs/postgres-tree-store/migrations.cjs +80 -3
- package/package.json +1 -1
- package/ssr/index.js +5 -0
- package/web/breez_sdk_spark_wasm.d.ts +40 -5
- package/web/breez_sdk_spark_wasm.js +66 -24
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
|
@@ -870,6 +870,15 @@ class SdkBuilder {
|
|
|
870
870
|
const ret = wasm.sdkbuilder_withLnurlClient(ptr, lnurl_client);
|
|
871
871
|
return SdkBuilder.__wrap(ret);
|
|
872
872
|
}
|
|
873
|
+
/**
|
|
874
|
+
* @param {MysqlStorageConfig} config
|
|
875
|
+
* @returns {SdkBuilder}
|
|
876
|
+
*/
|
|
877
|
+
withMysqlBackend(config) {
|
|
878
|
+
const ptr = this.__destroy_into_raw();
|
|
879
|
+
const ret = wasm.sdkbuilder_withMysqlBackend(ptr, config);
|
|
880
|
+
return SdkBuilder.__wrap(ret);
|
|
881
|
+
}
|
|
873
882
|
/**
|
|
874
883
|
* @param {PaymentObserver} payment_observer
|
|
875
884
|
* @returns {SdkBuilder}
|
|
@@ -1043,6 +1052,24 @@ function defaultExternalSigner(mnemonic, passphrase, network, key_set_config) {
|
|
|
1043
1052
|
}
|
|
1044
1053
|
exports.defaultExternalSigner = defaultExternalSigner;
|
|
1045
1054
|
|
|
1055
|
+
/**
|
|
1056
|
+
* Creates a default MySQL storage configuration with sensible defaults.
|
|
1057
|
+
*
|
|
1058
|
+
* Default values:
|
|
1059
|
+
* - `maxPoolSize`: 10
|
|
1060
|
+
* - `createTimeoutSecs`: 0 (no timeout)
|
|
1061
|
+
* - `recycleTimeoutSecs`: 10
|
|
1062
|
+
* @param {string} connection_string
|
|
1063
|
+
* @returns {MysqlStorageConfig}
|
|
1064
|
+
*/
|
|
1065
|
+
function defaultMysqlStorageConfig(connection_string) {
|
|
1066
|
+
const ptr0 = passStringToWasm0(connection_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1067
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1068
|
+
const ret = wasm.defaultMysqlStorageConfig(ptr0, len0);
|
|
1069
|
+
return ret;
|
|
1070
|
+
}
|
|
1071
|
+
exports.defaultMysqlStorageConfig = defaultMysqlStorageConfig;
|
|
1072
|
+
|
|
1046
1073
|
/**
|
|
1047
1074
|
* Creates a default PostgreSQL storage configuration with sensible defaults.
|
|
1048
1075
|
*
|
|
@@ -1350,20 +1377,36 @@ function __wbg_get_imports() {
|
|
|
1350
1377
|
const ret = createDefaultStorage(getStringFromWasm0(arg0, arg1), arg2);
|
|
1351
1378
|
return ret;
|
|
1352
1379
|
}, arguments); },
|
|
1380
|
+
__wbg_createMysqlPool_8927bff3a28fcef9: function() { return handleError(function (arg0) {
|
|
1381
|
+
const ret = createMysqlPool(arg0);
|
|
1382
|
+
return ret;
|
|
1383
|
+
}, arguments); },
|
|
1384
|
+
__wbg_createMysqlStorageWithPool_c92d8cd5f2ca6ade: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1385
|
+
const ret = createMysqlStorageWithPool(arg0, getArrayU8FromWasm0(arg1, arg2), arg3);
|
|
1386
|
+
return ret;
|
|
1387
|
+
}, arguments); },
|
|
1388
|
+
__wbg_createMysqlTokenStoreWithPool_cb308b20dccd4b4e: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1389
|
+
const ret = createMysqlTokenStoreWithPool(arg0, getArrayU8FromWasm0(arg1, arg2), arg3);
|
|
1390
|
+
return ret;
|
|
1391
|
+
}, arguments); },
|
|
1392
|
+
__wbg_createMysqlTreeStoreWithPool_98638c799d6a967c: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1393
|
+
const ret = createMysqlTreeStoreWithPool(arg0, getArrayU8FromWasm0(arg1, arg2), arg3);
|
|
1394
|
+
return ret;
|
|
1395
|
+
}, arguments); },
|
|
1353
1396
|
__wbg_createPostgresPool_3c396c7ab2f0eab2: function() { return handleError(function (arg0) {
|
|
1354
1397
|
const ret = createPostgresPool(arg0);
|
|
1355
1398
|
return ret;
|
|
1356
1399
|
}, arguments); },
|
|
1357
|
-
|
|
1358
|
-
const ret = createPostgresStorageWithPool(arg0, arg1);
|
|
1400
|
+
__wbg_createPostgresStorageWithPool_3fe1b7ee3ca10589: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1401
|
+
const ret = createPostgresStorageWithPool(arg0, getArrayU8FromWasm0(arg1, arg2), arg3);
|
|
1359
1402
|
return ret;
|
|
1360
1403
|
}, arguments); },
|
|
1361
|
-
|
|
1362
|
-
const ret = createPostgresTokenStoreWithPool(arg0, arg1);
|
|
1404
|
+
__wbg_createPostgresTokenStoreWithPool_ebd4c54228196816: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1405
|
+
const ret = createPostgresTokenStoreWithPool(arg0, getArrayU8FromWasm0(arg1, arg2), arg3);
|
|
1363
1406
|
return ret;
|
|
1364
1407
|
}, arguments); },
|
|
1365
|
-
|
|
1366
|
-
const ret = createPostgresTreeStoreWithPool(arg0, arg1);
|
|
1408
|
+
__wbg_createPostgresTreeStoreWithPool_6b43821b450142cb: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1409
|
+
const ret = createPostgresTreeStoreWithPool(arg0, getArrayU8FromWasm0(arg1, arg2), arg3);
|
|
1367
1410
|
return ret;
|
|
1368
1411
|
}, arguments); },
|
|
1369
1412
|
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
@@ -1494,7 +1537,7 @@ function __wbg_get_imports() {
|
|
|
1494
1537
|
const ret = Object.entries(arg0);
|
|
1495
1538
|
return ret;
|
|
1496
1539
|
},
|
|
1497
|
-
|
|
1540
|
+
__wbg_error_145dadf4216d70bc: function(arg0, arg1) {
|
|
1498
1541
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
1499
1542
|
},
|
|
1500
1543
|
__wbg_fetchFiatCurrencies_8afa0468f01bf013: function() { return handleError(function (arg0) {
|
|
@@ -2171,7 +2214,7 @@ function __wbg_get_imports() {
|
|
|
2171
2214
|
const ret = arg0.setLnurlMetadata(v0);
|
|
2172
2215
|
return ret;
|
|
2173
2216
|
}, arguments); },
|
|
2174
|
-
|
|
2217
|
+
__wbg_setTimeout_631eb4eafbc308a9: function(arg0, arg1) {
|
|
2175
2218
|
globalThis.setTimeout(arg0, arg1);
|
|
2176
2219
|
},
|
|
2177
2220
|
__wbg_setTimeout_ef24d2fc3ad97385: function() { return handleError(function (arg0, arg1) {
|
|
@@ -2462,41 +2505,41 @@ function __wbg_get_imports() {
|
|
|
2462
2505
|
},
|
|
2463
2506
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2464
2507
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 16, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2465
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2508
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7);
|
|
2466
2509
|
return ret;
|
|
2467
2510
|
},
|
|
2468
2511
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2469
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
2512
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 401, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2470
2513
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h4819aba3eed2db57);
|
|
2471
2514
|
return ret;
|
|
2472
2515
|
},
|
|
2473
2516
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
2474
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx:
|
|
2517
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 401, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2475
2518
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h4819aba3eed2db57_2);
|
|
2476
2519
|
return ret;
|
|
2477
2520
|
},
|
|
2478
2521
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
2479
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx:
|
|
2522
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 401, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2480
2523
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h4819aba3eed2db57_3);
|
|
2481
2524
|
return ret;
|
|
2482
2525
|
},
|
|
2483
2526
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
2484
2527
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Storage")], shim_idx: 16, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2485
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2528
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7_4);
|
|
2486
2529
|
return ret;
|
|
2487
2530
|
},
|
|
2488
2531
|
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
2489
2532
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TokenStore")], shim_idx: 16, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2490
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2533
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7_5);
|
|
2491
2534
|
return ret;
|
|
2492
2535
|
},
|
|
2493
2536
|
__wbindgen_cast_0000000000000007: function(arg0, arg1) {
|
|
2494
2537
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TreeStore")], shim_idx: 16, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2495
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2538
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7_6);
|
|
2496
2539
|
return ret;
|
|
2497
2540
|
},
|
|
2498
2541
|
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
2499
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
2542
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 406, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2500
2543
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7);
|
|
2501
2544
|
return ret;
|
|
2502
2545
|
},
|
|
@@ -2597,29 +2640,29 @@ function wasm_bindgen__convert__closures_____invoke__h4819aba3eed2db57_3(arg0, a
|
|
|
2597
2640
|
wasm.wasm_bindgen__convert__closures_____invoke__h4819aba3eed2db57_3(arg0, arg1, arg2);
|
|
2598
2641
|
}
|
|
2599
2642
|
|
|
2600
|
-
function
|
|
2601
|
-
const ret = wasm.
|
|
2643
|
+
function wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7(arg0, arg1, arg2) {
|
|
2644
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7(arg0, arg1, arg2);
|
|
2602
2645
|
if (ret[1]) {
|
|
2603
2646
|
throw takeFromExternrefTable0(ret[0]);
|
|
2604
2647
|
}
|
|
2605
2648
|
}
|
|
2606
2649
|
|
|
2607
|
-
function
|
|
2608
|
-
const ret = wasm.
|
|
2650
|
+
function wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7_4(arg0, arg1, arg2) {
|
|
2651
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7_4(arg0, arg1, arg2);
|
|
2609
2652
|
if (ret[1]) {
|
|
2610
2653
|
throw takeFromExternrefTable0(ret[0]);
|
|
2611
2654
|
}
|
|
2612
2655
|
}
|
|
2613
2656
|
|
|
2614
|
-
function
|
|
2615
|
-
const ret = wasm.
|
|
2657
|
+
function wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7_5(arg0, arg1, arg2) {
|
|
2658
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7_5(arg0, arg1, arg2);
|
|
2616
2659
|
if (ret[1]) {
|
|
2617
2660
|
throw takeFromExternrefTable0(ret[0]);
|
|
2618
2661
|
}
|
|
2619
2662
|
}
|
|
2620
2663
|
|
|
2621
|
-
function
|
|
2622
|
-
const ret = wasm.
|
|
2664
|
+
function wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7_6(arg0, arg1, arg2) {
|
|
2665
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7_6(arg0, arg1, arg2);
|
|
2623
2666
|
if (ret[1]) {
|
|
2624
2667
|
throw takeFromExternrefTable0(ret[0]);
|
|
2625
2668
|
}
|
|
Binary file
|
|
@@ -54,7 +54,7 @@ export const connect: (a: any) => any;
|
|
|
54
54
|
export const connectWithSigner: (a: any, b: any, c: number, d: number) => any;
|
|
55
55
|
export const defaultConfig: (a: any) => any;
|
|
56
56
|
export const defaultExternalSigner: (a: number, b: number, c: number, d: number, e: any, f: number) => [number, number, number];
|
|
57
|
-
export const
|
|
57
|
+
export const defaultMysqlStorageConfig: (a: number, b: number) => any;
|
|
58
58
|
export const defaultsigner_aggregateFrost: (a: number, b: any) => any;
|
|
59
59
|
export const defaultsigner_decryptEcies: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
60
60
|
export const defaultsigner_derivePublicKey: (a: number, b: number, c: number) => any;
|
|
@@ -90,6 +90,7 @@ export const sdkbuilder_withDefaultStorage: (a: number, b: number, c: number) =>
|
|
|
90
90
|
export const sdkbuilder_withFiatService: (a: number, b: any) => number;
|
|
91
91
|
export const sdkbuilder_withKeySet: (a: number, b: any) => number;
|
|
92
92
|
export const sdkbuilder_withLnurlClient: (a: number, b: any) => number;
|
|
93
|
+
export const sdkbuilder_withMysqlBackend: (a: number, b: any) => number;
|
|
93
94
|
export const sdkbuilder_withPaymentObserver: (a: number, b: any) => number;
|
|
94
95
|
export const sdkbuilder_withPostgresBackend: (a: number, b: any) => number;
|
|
95
96
|
export const sdkbuilder_withRestChainService: (a: number, b: number, c: number, d: any, e: number) => number;
|
|
@@ -119,10 +120,11 @@ export const intounderlyingsink_close: (a: number) => any;
|
|
|
119
120
|
export const intounderlyingsink_write: (a: number, b: any) => any;
|
|
120
121
|
export const intounderlyingsource_cancel: (a: number) => void;
|
|
121
122
|
export const intounderlyingsource_pull: (a: number, b: any) => any;
|
|
122
|
-
export const
|
|
123
|
-
export const
|
|
124
|
-
export const
|
|
125
|
-
export const
|
|
123
|
+
export const defaultPostgresStorageConfig: (a: number, b: number) => any;
|
|
124
|
+
export const wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7: (a: number, b: number, c: any) => [number, number];
|
|
125
|
+
export const wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7_4: (a: number, b: number, c: any) => [number, number];
|
|
126
|
+
export const wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7_5: (a: number, b: number, c: any) => [number, number];
|
|
127
|
+
export const wasm_bindgen__convert__closures_____invoke__h27d08ee20b1285c7_6: (a: number, b: number, c: any) => [number, number];
|
|
126
128
|
export const wasm_bindgen__convert__closures_____invoke__h41057d61edf43a32: (a: number, b: number, c: any, d: any) => void;
|
|
127
129
|
export const wasm_bindgen__convert__closures_____invoke__h4819aba3eed2db57: (a: number, b: number, c: any) => void;
|
|
128
130
|
export const wasm_bindgen__convert__closures_____invoke__h4819aba3eed2db57_2: (a: number, b: number, c: any) => void;
|
package/nodejs/index.js
CHANGED
|
@@ -48,5 +48,39 @@ try {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
// Automatically import and set up the MySQL storage for Node.js
|
|
52
|
+
try {
|
|
53
|
+
const { createMysqlStorage, createMysqlPool, createMysqlStorageWithPool } = require('./mysql-storage/index.cjs');
|
|
54
|
+
global.createMysqlStorage = createMysqlStorage;
|
|
55
|
+
global.createMysqlPool = createMysqlPool;
|
|
56
|
+
global.createMysqlStorageWithPool = createMysqlStorageWithPool;
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error.code !== 'MODULE_NOT_FOUND') {
|
|
59
|
+
console.warn('Breez SDK: Failed to load MySQL storage:', error.message);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Automatically import and set up the MySQL tree store for Node.js
|
|
64
|
+
try {
|
|
65
|
+
const { createMysqlTreeStore, createMysqlTreeStoreWithPool } = require('./mysql-tree-store/index.cjs');
|
|
66
|
+
global.createMysqlTreeStore = createMysqlTreeStore;
|
|
67
|
+
global.createMysqlTreeStoreWithPool = createMysqlTreeStoreWithPool;
|
|
68
|
+
} catch (error) {
|
|
69
|
+
if (error.code !== 'MODULE_NOT_FOUND') {
|
|
70
|
+
console.warn('Breez SDK: Failed to load MySQL tree store:', error.message);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Automatically import and set up the MySQL token store for Node.js
|
|
75
|
+
try {
|
|
76
|
+
const { createMysqlTokenStore, createMysqlTokenStoreWithPool } = require('./mysql-token-store/index.cjs');
|
|
77
|
+
global.createMysqlTokenStore = createMysqlTokenStore;
|
|
78
|
+
global.createMysqlTokenStoreWithPool = createMysqlTokenStoreWithPool;
|
|
79
|
+
} catch (error) {
|
|
80
|
+
if (error.code !== 'MODULE_NOT_FOUND') {
|
|
81
|
+
console.warn('Breez SDK: Failed to load MySQL token store:', error.message);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
51
85
|
// Export all WASM functions
|
|
52
86
|
module.exports = wasmModule;
|
package/nodejs/index.mjs
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage Error Classes for Breez SDK MySQL Storage
|
|
3
|
+
* CommonJS version
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
class StorageError extends Error {
|
|
7
|
+
constructor(message, cause = null) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.name = 'StorageError';
|
|
10
|
+
this.cause = cause;
|
|
11
|
+
|
|
12
|
+
// Maintain proper stack trace for where our error was thrown (only available on V8)
|
|
13
|
+
if (Error.captureStackTrace) {
|
|
14
|
+
Error.captureStackTrace(this, StorageError);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
module.exports = { StorageError };
|