@breeztech/breez-sdk-spark 0.12.2 → 0.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -69
- package/breez-sdk-spark.tgz +0 -0
- package/bundler/breez_sdk_spark_wasm.d.ts +734 -602
- package/bundler/breez_sdk_spark_wasm_bg.js +175 -78
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +8 -6
- package/bundler/storage/index.js +65 -43
- package/deno/breez_sdk_spark_wasm.d.ts +734 -602
- package/deno/breez_sdk_spark_wasm.js +165 -78
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +8 -6
- package/nodejs/breez_sdk_spark_wasm.d.ts +734 -602
- package/nodejs/breez_sdk_spark_wasm.js +175 -78
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +8 -6
- package/nodejs/index.js +16 -2
- package/nodejs/index.mjs +25 -0
- package/nodejs/package.json +3 -1
- 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 +7 -2
- package/ssr/index.d.ts +2 -0
- package/ssr/index.js +126 -0
- package/web/breez_sdk_spark_wasm.d.ts +742 -608
- package/web/breez_sdk_spark_wasm.js +165 -78
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +8 -6
- package/web/storage/index.js +65 -43
|
@@ -234,39 +234,6 @@ module.exports.defaultPostgresStorageConfig = function(connection_string) {
|
|
|
234
234
|
return ret;
|
|
235
235
|
};
|
|
236
236
|
|
|
237
|
-
/**
|
|
238
|
-
* Creates a default external signer from a mnemonic phrase.
|
|
239
|
-
*
|
|
240
|
-
* This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
|
|
241
|
-
* @returns {Promise<SparkStatus>}
|
|
242
|
-
*/
|
|
243
|
-
module.exports.getSparkStatus = function() {
|
|
244
|
-
const ret = wasm.getSparkStatus();
|
|
245
|
-
return ret;
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* @param {Config} config
|
|
250
|
-
* @param {ExternalSigner} signer
|
|
251
|
-
* @param {string} storage_dir
|
|
252
|
-
* @returns {Promise<BreezSdk>}
|
|
253
|
-
*/
|
|
254
|
-
module.exports.connectWithSigner = function(config, signer, storage_dir) {
|
|
255
|
-
const ptr0 = passStringToWasm0(storage_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
256
|
-
const len0 = WASM_VECTOR_LEN;
|
|
257
|
-
const ret = wasm.connectWithSigner(config, signer, ptr0, len0);
|
|
258
|
-
return ret;
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* @param {ConnectRequest} request
|
|
263
|
-
* @returns {Promise<BreezSdk>}
|
|
264
|
-
*/
|
|
265
|
-
module.exports.connect = function(request) {
|
|
266
|
-
const ret = wasm.connect(request);
|
|
267
|
-
return ret;
|
|
268
|
-
};
|
|
269
|
-
|
|
270
237
|
/**
|
|
271
238
|
* @param {Network} network
|
|
272
239
|
* @returns {Config}
|
|
@@ -276,18 +243,6 @@ module.exports.defaultConfig = function(network) {
|
|
|
276
243
|
return ret;
|
|
277
244
|
};
|
|
278
245
|
|
|
279
|
-
/**
|
|
280
|
-
* @param {Logger} logger
|
|
281
|
-
* @param {string | null} [filter]
|
|
282
|
-
* @returns {Promise<void>}
|
|
283
|
-
*/
|
|
284
|
-
module.exports.initLogging = function(logger, filter) {
|
|
285
|
-
var ptr0 = isLikeNone(filter) ? 0 : passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
286
|
-
var len0 = WASM_VECTOR_LEN;
|
|
287
|
-
const ret = wasm.initLogging(logger, ptr0, len0);
|
|
288
|
-
return ret;
|
|
289
|
-
};
|
|
290
|
-
|
|
291
246
|
function takeFromExternrefTable0(idx) {
|
|
292
247
|
const value = wasm.__wbindgen_export_5.get(idx);
|
|
293
248
|
wasm.__externref_table_dealloc(idx);
|
|
@@ -312,6 +267,51 @@ module.exports.defaultExternalSigner = function(mnemonic, passphrase, network, k
|
|
|
312
267
|
return DefaultSigner.__wrap(ret[0]);
|
|
313
268
|
};
|
|
314
269
|
|
|
270
|
+
/**
|
|
271
|
+
* @param {Logger} logger
|
|
272
|
+
* @param {string | null} [filter]
|
|
273
|
+
* @returns {Promise<void>}
|
|
274
|
+
*/
|
|
275
|
+
module.exports.initLogging = function(logger, filter) {
|
|
276
|
+
var ptr0 = isLikeNone(filter) ? 0 : passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
277
|
+
var len0 = WASM_VECTOR_LEN;
|
|
278
|
+
const ret = wasm.initLogging(logger, ptr0, len0);
|
|
279
|
+
return ret;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* @param {Config} config
|
|
284
|
+
* @param {ExternalSigner} signer
|
|
285
|
+
* @param {string} storage_dir
|
|
286
|
+
* @returns {Promise<BreezSdk>}
|
|
287
|
+
*/
|
|
288
|
+
module.exports.connectWithSigner = function(config, signer, storage_dir) {
|
|
289
|
+
const ptr0 = passStringToWasm0(storage_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
290
|
+
const len0 = WASM_VECTOR_LEN;
|
|
291
|
+
const ret = wasm.connectWithSigner(config, signer, ptr0, len0);
|
|
292
|
+
return ret;
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Creates a default external signer from a mnemonic phrase.
|
|
297
|
+
*
|
|
298
|
+
* This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
|
|
299
|
+
* @returns {Promise<SparkStatus>}
|
|
300
|
+
*/
|
|
301
|
+
module.exports.getSparkStatus = function() {
|
|
302
|
+
const ret = wasm.getSparkStatus();
|
|
303
|
+
return ret;
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* @param {ConnectRequest} request
|
|
308
|
+
* @returns {Promise<BreezSdk>}
|
|
309
|
+
*/
|
|
310
|
+
module.exports.connect = function(request) {
|
|
311
|
+
const ret = wasm.connect(request);
|
|
312
|
+
return ret;
|
|
313
|
+
};
|
|
314
|
+
|
|
315
315
|
function passArray8ToWasm0(arg, malloc) {
|
|
316
316
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
317
317
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -330,15 +330,15 @@ module.exports.task_worker_entry_point = function(ptr) {
|
|
|
330
330
|
};
|
|
331
331
|
|
|
332
332
|
function __wbg_adapter_64(arg0, arg1, arg2) {
|
|
333
|
-
wasm.
|
|
333
|
+
wasm.closure383_externref_shim(arg0, arg1, arg2);
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
function __wbg_adapter_69(arg0, arg1) {
|
|
337
|
-
wasm.
|
|
337
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h140914a8cfe47e73(arg0, arg1);
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
function
|
|
341
|
-
wasm.
|
|
340
|
+
function __wbg_adapter_423(arg0, arg1, arg2, arg3) {
|
|
341
|
+
wasm.closure661_externref_shim(arg0, arg1, arg2, arg3);
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
@@ -475,6 +475,13 @@ class BreezSdk {
|
|
|
475
475
|
const ret = wasm.breezsdk_listPayments(this.__wbg_ptr, request);
|
|
476
476
|
return ret;
|
|
477
477
|
}
|
|
478
|
+
/**
|
|
479
|
+
* @returns {Promise<Webhook[]>}
|
|
480
|
+
*/
|
|
481
|
+
listWebhooks() {
|
|
482
|
+
const ret = wasm.breezsdk_listWebhooks(this.__wbg_ptr);
|
|
483
|
+
return ret;
|
|
484
|
+
}
|
|
478
485
|
/**
|
|
479
486
|
* @param {string} id
|
|
480
487
|
* @returns {Promise<void>}
|
|
@@ -538,6 +545,14 @@ class BreezSdk {
|
|
|
538
545
|
const ret = wasm.breezsdk_recommendedFees(this.__wbg_ptr);
|
|
539
546
|
return ret;
|
|
540
547
|
}
|
|
548
|
+
/**
|
|
549
|
+
* @param {RegisterWebhookRequest} request
|
|
550
|
+
* @returns {Promise<RegisterWebhookResponse>}
|
|
551
|
+
*/
|
|
552
|
+
registerWebhook(request) {
|
|
553
|
+
const ret = wasm.breezsdk_registerWebhook(this.__wbg_ptr, request);
|
|
554
|
+
return ret;
|
|
555
|
+
}
|
|
541
556
|
/**
|
|
542
557
|
* @returns {Promise<UserSettings>}
|
|
543
558
|
*/
|
|
@@ -569,6 +584,14 @@ class BreezSdk {
|
|
|
569
584
|
const ret = wasm.breezsdk_claimHtlcPayment(this.__wbg_ptr, request);
|
|
570
585
|
return ret;
|
|
571
586
|
}
|
|
587
|
+
/**
|
|
588
|
+
* @param {UnregisterWebhookRequest} request
|
|
589
|
+
* @returns {Promise<void>}
|
|
590
|
+
*/
|
|
591
|
+
unregisterWebhook(request) {
|
|
592
|
+
const ret = wasm.breezsdk_unregisterWebhook(this.__wbg_ptr, request);
|
|
593
|
+
return ret;
|
|
594
|
+
}
|
|
572
595
|
/**
|
|
573
596
|
* @param {GetTokensMetadataRequest} request
|
|
574
597
|
* @returns {Promise<GetTokensMetadataResponse>}
|
|
@@ -633,8 +656,12 @@ class BreezSdk {
|
|
|
633
656
|
const ret = wasm.breezsdk_listUnclaimedDeposits(this.__wbg_ptr, request);
|
|
634
657
|
return ret;
|
|
635
658
|
}
|
|
659
|
+
/**
|
|
660
|
+
* @returns {Promise<void>}
|
|
661
|
+
*/
|
|
636
662
|
startLeafOptimization() {
|
|
637
|
-
wasm.breezsdk_startLeafOptimization(this.__wbg_ptr);
|
|
663
|
+
const ret = wasm.breezsdk_startLeafOptimization(this.__wbg_ptr);
|
|
664
|
+
return ret;
|
|
638
665
|
}
|
|
639
666
|
/**
|
|
640
667
|
* @returns {Promise<void>}
|
|
@@ -1243,9 +1270,9 @@ class SdkBuilder {
|
|
|
1243
1270
|
* @param {PostgresStorageConfig} config
|
|
1244
1271
|
* @returns {SdkBuilder}
|
|
1245
1272
|
*/
|
|
1246
|
-
|
|
1273
|
+
withPostgresBackend(config) {
|
|
1247
1274
|
const ptr = this.__destroy_into_raw();
|
|
1248
|
-
const ret = wasm.
|
|
1275
|
+
const ret = wasm.sdkbuilder_withPostgresBackend(ptr, config);
|
|
1249
1276
|
return SdkBuilder.__wrap(ret);
|
|
1250
1277
|
}
|
|
1251
1278
|
/**
|
|
@@ -1261,15 +1288,6 @@ class SdkBuilder {
|
|
|
1261
1288
|
const ret = wasm.sdkbuilder_withRestChainService(ptr, ptr0, len0, api_type, isLikeNone(credentials) ? 0 : addToExternrefTable0(credentials));
|
|
1262
1289
|
return SdkBuilder.__wrap(ret);
|
|
1263
1290
|
}
|
|
1264
|
-
/**
|
|
1265
|
-
* @param {PostgresStorageConfig} config
|
|
1266
|
-
* @returns {SdkBuilder}
|
|
1267
|
-
*/
|
|
1268
|
-
withPostgresTreeStore(config) {
|
|
1269
|
-
const ptr = this.__destroy_into_raw();
|
|
1270
|
-
const ret = wasm.sdkbuilder_withPostgresTreeStore(ptr, config);
|
|
1271
|
-
return SdkBuilder.__wrap(ret);
|
|
1272
|
-
}
|
|
1273
1291
|
/**
|
|
1274
1292
|
* @param {Config} config
|
|
1275
1293
|
* @param {Seed} seed
|
|
@@ -1388,13 +1406,13 @@ module.exports.__wbg_abort_775ef1d17fc65868 = function(arg0) {
|
|
|
1388
1406
|
arg0.abort();
|
|
1389
1407
|
};
|
|
1390
1408
|
|
|
1391
|
-
module.exports.
|
|
1409
|
+
module.exports.__wbg_addDeposit_42b1593db58de120 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
1392
1410
|
let deferred0_0;
|
|
1393
1411
|
let deferred0_1;
|
|
1394
1412
|
try {
|
|
1395
1413
|
deferred0_0 = arg1;
|
|
1396
1414
|
deferred0_1 = arg2;
|
|
1397
|
-
const ret = arg0.addDeposit(getStringFromWasm0(arg1, arg2), arg3 >>> 0, BigInt.asUintN(64, arg4));
|
|
1415
|
+
const ret = arg0.addDeposit(getStringFromWasm0(arg1, arg2), arg3 >>> 0, BigInt.asUintN(64, arg4), arg5 !== 0);
|
|
1398
1416
|
return ret;
|
|
1399
1417
|
} finally {
|
|
1400
1418
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
@@ -1498,6 +1516,19 @@ module.exports.__wbg_cancelReservation_d85a13db3e8e3c7b = function() { return ha
|
|
|
1498
1516
|
}
|
|
1499
1517
|
}, arguments) };
|
|
1500
1518
|
|
|
1519
|
+
module.exports.__wbg_cancelReservation_fd3065607b457424 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1520
|
+
let deferred0_0;
|
|
1521
|
+
let deferred0_1;
|
|
1522
|
+
try {
|
|
1523
|
+
deferred0_0 = arg1;
|
|
1524
|
+
deferred0_1 = arg2;
|
|
1525
|
+
const ret = arg0.cancelReservation(getStringFromWasm0(arg1, arg2));
|
|
1526
|
+
return ret;
|
|
1527
|
+
} finally {
|
|
1528
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1529
|
+
}
|
|
1530
|
+
}, arguments) };
|
|
1531
|
+
|
|
1501
1532
|
module.exports.__wbg_cancel_8a308660caa6cadf = function(arg0) {
|
|
1502
1533
|
const ret = arg0.cancel();
|
|
1503
1534
|
return ret;
|
|
@@ -1545,13 +1576,23 @@ module.exports.__wbg_createDefaultStorage_458aa01b5eaead27 = function() { return
|
|
|
1545
1576
|
return ret;
|
|
1546
1577
|
}, arguments) };
|
|
1547
1578
|
|
|
1548
|
-
module.exports.
|
|
1549
|
-
const ret =
|
|
1579
|
+
module.exports.__wbg_createPostgresPool_8b4003e9db8e9432 = function() { return handleError(function (arg0) {
|
|
1580
|
+
const ret = createPostgresPool(arg0);
|
|
1581
|
+
return ret;
|
|
1582
|
+
}, arguments) };
|
|
1583
|
+
|
|
1584
|
+
module.exports.__wbg_createPostgresStorageWithPool_77aa64bddd7440db = function() { return handleError(function (arg0, arg1) {
|
|
1585
|
+
const ret = createPostgresStorageWithPool(arg0, arg1);
|
|
1586
|
+
return ret;
|
|
1587
|
+
}, arguments) };
|
|
1588
|
+
|
|
1589
|
+
module.exports.__wbg_createPostgresTokenStoreWithPool_5e7b75f5975d8b94 = function() { return handleError(function (arg0, arg1) {
|
|
1590
|
+
const ret = createPostgresTokenStoreWithPool(arg0, arg1);
|
|
1550
1591
|
return ret;
|
|
1551
1592
|
}, arguments) };
|
|
1552
1593
|
|
|
1553
|
-
module.exports.
|
|
1554
|
-
const ret =
|
|
1594
|
+
module.exports.__wbg_createPostgresTreeStoreWithPool_55e19122e69fb9e3 = function() { return handleError(function (arg0, arg1) {
|
|
1595
|
+
const ret = createPostgresTreeStoreWithPool(arg0, arg1);
|
|
1555
1596
|
return ret;
|
|
1556
1597
|
}, arguments) };
|
|
1557
1598
|
|
|
@@ -1731,6 +1772,19 @@ module.exports.__wbg_fetch_f156d10be9a5c88a = function(arg0) {
|
|
|
1731
1772
|
return ret;
|
|
1732
1773
|
};
|
|
1733
1774
|
|
|
1775
|
+
module.exports.__wbg_finalizeReservation_86ee8385c17e015b = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1776
|
+
let deferred0_0;
|
|
1777
|
+
let deferred0_1;
|
|
1778
|
+
try {
|
|
1779
|
+
deferred0_0 = arg1;
|
|
1780
|
+
deferred0_1 = arg2;
|
|
1781
|
+
const ret = arg0.finalizeReservation(getStringFromWasm0(arg1, arg2));
|
|
1782
|
+
return ret;
|
|
1783
|
+
} finally {
|
|
1784
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1785
|
+
}
|
|
1786
|
+
}, arguments) };
|
|
1787
|
+
|
|
1734
1788
|
module.exports.__wbg_finalizeReservation_a8fad570b7fe5185 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1735
1789
|
let deferred0_0;
|
|
1736
1790
|
let deferred0_1;
|
|
@@ -1882,6 +1936,11 @@ module.exports.__wbg_getStaticDepositSecretSource_8e310c718339e400 = function()
|
|
|
1882
1936
|
return ret;
|
|
1883
1937
|
}, arguments) };
|
|
1884
1938
|
|
|
1939
|
+
module.exports.__wbg_getTokenOutputs_f51d6f5d47330273 = function() { return handleError(function (arg0, arg1) {
|
|
1940
|
+
const ret = arg0.getTokenOutputs(arg1);
|
|
1941
|
+
return ret;
|
|
1942
|
+
}, arguments) };
|
|
1943
|
+
|
|
1885
1944
|
module.exports.__wbg_getTransactionHex_973b8d0555c60f99 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1886
1945
|
let deferred0_0;
|
|
1887
1946
|
let deferred0_1;
|
|
@@ -1986,6 +2045,11 @@ module.exports.__wbg_insertPayment_2afe3300c5f86ccf = function() { return handle
|
|
|
1986
2045
|
return ret;
|
|
1987
2046
|
}, arguments) };
|
|
1988
2047
|
|
|
2048
|
+
module.exports.__wbg_insertTokenOutputs_043ceea065ff8f65 = function() { return handleError(function (arg0, arg1) {
|
|
2049
|
+
const ret = arg0.insertTokenOutputs(arg1);
|
|
2050
|
+
return ret;
|
|
2051
|
+
}, arguments) };
|
|
2052
|
+
|
|
1989
2053
|
module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
|
|
1990
2054
|
let result;
|
|
1991
2055
|
try {
|
|
@@ -2119,6 +2183,11 @@ module.exports.__wbg_listPayments_d8c53ab09ffc756b = function() { return handleE
|
|
|
2119
2183
|
return ret;
|
|
2120
2184
|
}, arguments) };
|
|
2121
2185
|
|
|
2186
|
+
module.exports.__wbg_listTokensOutputs_4b4500bd5aca2c88 = function() { return handleError(function (arg0) {
|
|
2187
|
+
const ret = arg0.listTokensOutputs();
|
|
2188
|
+
return ret;
|
|
2189
|
+
}, arguments) };
|
|
2190
|
+
|
|
2122
2191
|
module.exports.__wbg_log_62b3ddcc89229688 = function(arg0, arg1) {
|
|
2123
2192
|
arg0.log(arg1);
|
|
2124
2193
|
};
|
|
@@ -2166,7 +2235,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
|
2166
2235
|
const a = state0.a;
|
|
2167
2236
|
state0.a = 0;
|
|
2168
2237
|
try {
|
|
2169
|
-
return
|
|
2238
|
+
return __wbg_adapter_423(a, state0.b, arg0, arg1);
|
|
2170
2239
|
} finally {
|
|
2171
2240
|
state0.a = a;
|
|
2172
2241
|
}
|
|
@@ -2263,6 +2332,11 @@ module.exports.__wbg_now_6af59e24f5a53ad4 = function() { return handleError(func
|
|
|
2263
2332
|
return ret;
|
|
2264
2333
|
}, arguments) };
|
|
2265
2334
|
|
|
2335
|
+
module.exports.__wbg_now_79892f24f17d010a = function() { return handleError(function (arg0) {
|
|
2336
|
+
const ret = arg0.now();
|
|
2337
|
+
return ret;
|
|
2338
|
+
}, arguments) };
|
|
2339
|
+
|
|
2266
2340
|
module.exports.__wbg_now_807e54c39636c349 = function() {
|
|
2267
2341
|
const ret = Date.now();
|
|
2268
2342
|
return ret;
|
|
@@ -2349,6 +2423,24 @@ module.exports.__wbg_require_60cc747a6bc5215a = function() { return handleError(
|
|
|
2349
2423
|
return ret;
|
|
2350
2424
|
}, arguments) };
|
|
2351
2425
|
|
|
2426
|
+
module.exports.__wbg_reserveTokenOutputs_6a190cf797e7d196 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
|
2427
|
+
let deferred0_0;
|
|
2428
|
+
let deferred0_1;
|
|
2429
|
+
let deferred1_0;
|
|
2430
|
+
let deferred1_1;
|
|
2431
|
+
try {
|
|
2432
|
+
deferred0_0 = arg1;
|
|
2433
|
+
deferred0_1 = arg2;
|
|
2434
|
+
deferred1_0 = arg4;
|
|
2435
|
+
deferred1_1 = arg5;
|
|
2436
|
+
const ret = arg0.reserveTokenOutputs(getStringFromWasm0(arg1, arg2), arg3, getStringFromWasm0(arg4, arg5), arg6, arg7);
|
|
2437
|
+
return ret;
|
|
2438
|
+
} finally {
|
|
2439
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
2440
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2441
|
+
}
|
|
2442
|
+
}, arguments) };
|
|
2443
|
+
|
|
2352
2444
|
module.exports.__wbg_resolve_4851785c9c5f573d = function(arg0) {
|
|
2353
2445
|
const ret = Promise.resolve(arg0);
|
|
2354
2446
|
return ret;
|
|
@@ -2415,6 +2507,11 @@ module.exports.__wbg_setTimeout_db2dbaeefb6f39c7 = function() { return handleErr
|
|
|
2415
2507
|
return ret;
|
|
2416
2508
|
}, arguments) };
|
|
2417
2509
|
|
|
2510
|
+
module.exports.__wbg_setTokensOutputs_5b8449721027f347 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2511
|
+
const ret = arg0.setTokensOutputs(arg1, arg2);
|
|
2512
|
+
return ret;
|
|
2513
|
+
}, arguments) };
|
|
2514
|
+
|
|
2418
2515
|
module.exports.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
|
|
2419
2516
|
arg0[arg1 >>> 0] = arg2;
|
|
2420
2517
|
};
|
|
@@ -2791,28 +2888,28 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
2791
2888
|
return ret;
|
|
2792
2889
|
};
|
|
2793
2890
|
|
|
2794
|
-
module.exports.
|
|
2795
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2891
|
+
module.exports.__wbindgen_closure_wrapper10258 = function(arg0, arg1, arg2) {
|
|
2892
|
+
const ret = makeMutClosure(arg0, arg1, 384, __wbg_adapter_69);
|
|
2796
2893
|
return ret;
|
|
2797
2894
|
};
|
|
2798
2895
|
|
|
2799
|
-
module.exports.
|
|
2800
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2896
|
+
module.exports.__wbindgen_closure_wrapper15384 = function(arg0, arg1, arg2) {
|
|
2897
|
+
const ret = makeMutClosure(arg0, arg1, 384, __wbg_adapter_64);
|
|
2801
2898
|
return ret;
|
|
2802
2899
|
};
|
|
2803
2900
|
|
|
2804
|
-
module.exports.
|
|
2805
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2901
|
+
module.exports.__wbindgen_closure_wrapper5940 = function(arg0, arg1, arg2) {
|
|
2902
|
+
const ret = makeMutClosure(arg0, arg1, 384, __wbg_adapter_64);
|
|
2806
2903
|
return ret;
|
|
2807
2904
|
};
|
|
2808
2905
|
|
|
2809
|
-
module.exports.
|
|
2810
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2906
|
+
module.exports.__wbindgen_closure_wrapper5946 = function(arg0, arg1, arg2) {
|
|
2907
|
+
const ret = makeMutClosure(arg0, arg1, 384, __wbg_adapter_64);
|
|
2811
2908
|
return ret;
|
|
2812
2909
|
};
|
|
2813
2910
|
|
|
2814
|
-
module.exports.
|
|
2815
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2911
|
+
module.exports.__wbindgen_closure_wrapper7585 = function(arg0, arg1, arg2) {
|
|
2912
|
+
const ret = makeMutClosure(arg0, arg1, 870, __wbg_adapter_69);
|
|
2816
2913
|
return ret;
|
|
2817
2914
|
};
|
|
2818
2915
|
|
|
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
|
|
130
|
-
export const
|
|
131
|
-
export const
|
|
131
|
+
export const closure383_externref_shim: (a: number, b: number, c: any) => void;
|
|
132
|
+
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h140914a8cfe47e73: (a: number, b: number) => void;
|
|
133
|
+
export const closure661_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
132
134
|
export const __wbindgen_start: () => void;
|
package/nodejs/index.js
CHANGED
|
@@ -16,8 +16,10 @@ try {
|
|
|
16
16
|
|
|
17
17
|
// Automatically import and set up the PostgreSQL storage for Node.js
|
|
18
18
|
try {
|
|
19
|
-
const { createPostgresStorage } = require('./postgres-storage/index.cjs');
|
|
19
|
+
const { createPostgresStorage, createPostgresPool, createPostgresStorageWithPool } = require('./postgres-storage/index.cjs');
|
|
20
20
|
global.createPostgresStorage = createPostgresStorage;
|
|
21
|
+
global.createPostgresPool = createPostgresPool;
|
|
22
|
+
global.createPostgresStorageWithPool = createPostgresStorageWithPool;
|
|
21
23
|
} catch (error) {
|
|
22
24
|
if (error.code !== 'MODULE_NOT_FOUND') {
|
|
23
25
|
console.warn('Breez SDK: Failed to load PostgreSQL storage:', error.message);
|
|
@@ -26,13 +28,25 @@ try {
|
|
|
26
28
|
|
|
27
29
|
// Automatically import and set up the PostgreSQL tree store for Node.js
|
|
28
30
|
try {
|
|
29
|
-
const { createPostgresTreeStore } = require('./postgres-tree-store/index.cjs');
|
|
31
|
+
const { createPostgresTreeStore, createPostgresTreeStoreWithPool } = require('./postgres-tree-store/index.cjs');
|
|
30
32
|
global.createPostgresTreeStore = createPostgresTreeStore;
|
|
33
|
+
global.createPostgresTreeStoreWithPool = createPostgresTreeStoreWithPool;
|
|
31
34
|
} catch (error) {
|
|
32
35
|
if (error.code !== 'MODULE_NOT_FOUND') {
|
|
33
36
|
console.warn('Breez SDK: Failed to load PostgreSQL tree store:', error.message);
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
|
|
40
|
+
// Automatically import and set up the PostgreSQL token store for Node.js
|
|
41
|
+
try {
|
|
42
|
+
const { createPostgresTokenStore, createPostgresTokenStoreWithPool } = require('./postgres-token-store/index.cjs');
|
|
43
|
+
global.createPostgresTokenStore = createPostgresTokenStore;
|
|
44
|
+
global.createPostgresTokenStoreWithPool = createPostgresTokenStoreWithPool;
|
|
45
|
+
} catch (error) {
|
|
46
|
+
if (error.code !== 'MODULE_NOT_FOUND') {
|
|
47
|
+
console.warn('Breez SDK: Failed to load PostgreSQL token store:', error.message);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
37
51
|
// Export all WASM functions
|
|
38
52
|
module.exports = wasmModule;
|
package/nodejs/index.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// ESM wrapper for the CJS Node.js entry — re-exports named bindings
|
|
2
|
+
// so that `import { connect } from '@breeztech/breez-sdk-spark'` works
|
|
3
|
+
// in ESM contexts.
|
|
4
|
+
import pkg from './index.js';
|
|
5
|
+
|
|
6
|
+
export const {
|
|
7
|
+
defaultPostgresStorageConfig,
|
|
8
|
+
defaultConfig,
|
|
9
|
+
defaultExternalSigner,
|
|
10
|
+
initLogging,
|
|
11
|
+
connectWithSigner,
|
|
12
|
+
getSparkStatus,
|
|
13
|
+
connect,
|
|
14
|
+
task_worker_entry_point,
|
|
15
|
+
BreezSdk,
|
|
16
|
+
DefaultSigner,
|
|
17
|
+
IntoUnderlyingByteSource,
|
|
18
|
+
IntoUnderlyingSink,
|
|
19
|
+
IntoUnderlyingSource,
|
|
20
|
+
Passkey,
|
|
21
|
+
SdkBuilder,
|
|
22
|
+
TokenIssuer,
|
|
23
|
+
} = pkg;
|
|
24
|
+
|
|
25
|
+
export default pkg;
|