@breeztech/breez-sdk-spark 0.7.21 → 0.8.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/breez-sdk-spark.tgz +0 -0
- package/bundler/breez_sdk_spark_wasm.d.ts +581 -533
- package/bundler/breez_sdk_spark_wasm_bg.js +74 -56
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +4 -2
- package/bundler/storage/index.js +521 -215
- package/deno/breez_sdk_spark_wasm.d.ts +581 -533
- package/deno/breez_sdk_spark_wasm.js +72 -54
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +4 -2
- package/nodejs/breez_sdk_spark_wasm.d.ts +581 -533
- package/nodejs/breez_sdk_spark_wasm.js +74 -56
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +4 -2
- package/nodejs/storage/index.cjs +160 -182
- package/nodejs/storage/migrations.cjs +27 -3
- package/package.json +1 -1
- package/web/breez_sdk_spark_wasm.d.ts +585 -535
- package/web/breez_sdk_spark_wasm.js +72 -54
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +4 -2
- package/web/storage/index.js +521 -215
|
@@ -213,27 +213,6 @@ function debugString(val) {
|
|
|
213
213
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
214
214
|
return className;
|
|
215
215
|
}
|
|
216
|
-
/**
|
|
217
|
-
* @param {ConnectRequest} request
|
|
218
|
-
* @returns {Promise<BreezSdk>}
|
|
219
|
-
*/
|
|
220
|
-
export function connect(request) {
|
|
221
|
-
const ret = wasm.connect(request);
|
|
222
|
-
return ret;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* @param {Logger} logger
|
|
227
|
-
* @param {string | null} [filter]
|
|
228
|
-
* @returns {Promise<void>}
|
|
229
|
-
*/
|
|
230
|
-
export function initLogging(logger, filter) {
|
|
231
|
-
var ptr0 = isLikeNone(filter) ? 0 : passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
232
|
-
var len0 = WASM_VECTOR_LEN;
|
|
233
|
-
const ret = wasm.initLogging(logger, ptr0, len0);
|
|
234
|
-
return ret;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
216
|
/**
|
|
238
217
|
* @param {Config} config
|
|
239
218
|
* @param {ExternalSigner} signer
|
|
@@ -248,11 +227,11 @@ export function connectWithSigner(config, signer, storage_dir) {
|
|
|
248
227
|
}
|
|
249
228
|
|
|
250
229
|
/**
|
|
251
|
-
* @param {
|
|
252
|
-
* @returns {
|
|
230
|
+
* @param {ConnectRequest} request
|
|
231
|
+
* @returns {Promise<BreezSdk>}
|
|
253
232
|
*/
|
|
254
|
-
export function
|
|
255
|
-
const ret = wasm.
|
|
233
|
+
export function connect(request) {
|
|
234
|
+
const ret = wasm.connect(request);
|
|
256
235
|
return ret;
|
|
257
236
|
}
|
|
258
237
|
|
|
@@ -262,9 +241,6 @@ function takeFromExternrefTable0(idx) {
|
|
|
262
241
|
return value;
|
|
263
242
|
}
|
|
264
243
|
/**
|
|
265
|
-
* Creates a default external signer from a mnemonic phrase.
|
|
266
|
-
*
|
|
267
|
-
* This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
|
|
268
244
|
* @param {string} mnemonic
|
|
269
245
|
* @param {string | null | undefined} passphrase
|
|
270
246
|
* @param {Network} network
|
|
@@ -283,6 +259,38 @@ export function defaultExternalSigner(mnemonic, passphrase, network, key_set_con
|
|
|
283
259
|
return DefaultSigner.__wrap(ret[0]);
|
|
284
260
|
}
|
|
285
261
|
|
|
262
|
+
/**
|
|
263
|
+
* @param {Logger} logger
|
|
264
|
+
* @param {string | null} [filter]
|
|
265
|
+
* @returns {Promise<void>}
|
|
266
|
+
*/
|
|
267
|
+
export function initLogging(logger, filter) {
|
|
268
|
+
var ptr0 = isLikeNone(filter) ? 0 : passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
269
|
+
var len0 = WASM_VECTOR_LEN;
|
|
270
|
+
const ret = wasm.initLogging(logger, ptr0, len0);
|
|
271
|
+
return ret;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Creates a default external signer from a mnemonic phrase.
|
|
276
|
+
*
|
|
277
|
+
* This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
|
|
278
|
+
* @returns {Promise<SparkStatus>}
|
|
279
|
+
*/
|
|
280
|
+
export function getSparkStatus() {
|
|
281
|
+
const ret = wasm.getSparkStatus();
|
|
282
|
+
return ret;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* @param {Network} network
|
|
287
|
+
* @returns {Config}
|
|
288
|
+
*/
|
|
289
|
+
export function defaultConfig(network) {
|
|
290
|
+
const ret = wasm.defaultConfig(network);
|
|
291
|
+
return ret;
|
|
292
|
+
}
|
|
293
|
+
|
|
286
294
|
function passArray8ToWasm0(arg, malloc) {
|
|
287
295
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
288
296
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -305,11 +313,11 @@ function __wbg_adapter_64(arg0, arg1) {
|
|
|
305
313
|
}
|
|
306
314
|
|
|
307
315
|
function __wbg_adapter_67(arg0, arg1, arg2) {
|
|
308
|
-
wasm.
|
|
316
|
+
wasm.closure1081_externref_shim(arg0, arg1, arg2);
|
|
309
317
|
}
|
|
310
318
|
|
|
311
|
-
function
|
|
312
|
-
wasm.
|
|
319
|
+
function __wbg_adapter_285(arg0, arg1, arg2, arg3) {
|
|
320
|
+
wasm.closure674_externref_shim(arg0, arg1, arg2, arg3);
|
|
313
321
|
}
|
|
314
322
|
|
|
315
323
|
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
@@ -364,6 +372,14 @@ export class BreezSdk {
|
|
|
364
372
|
const ret = wasm.breezsdk_lnurlAuth(this.__wbg_ptr, request_data);
|
|
365
373
|
return ret;
|
|
366
374
|
}
|
|
375
|
+
/**
|
|
376
|
+
* @param {BuyBitcoinRequest} request
|
|
377
|
+
* @returns {Promise<BuyBitcoinResponse>}
|
|
378
|
+
*/
|
|
379
|
+
buyBitcoin(request) {
|
|
380
|
+
const ret = wasm.breezsdk_buyBitcoin(this.__wbg_ptr, request);
|
|
381
|
+
return ret;
|
|
382
|
+
}
|
|
367
383
|
/**
|
|
368
384
|
* @param {GetPaymentRequest} request
|
|
369
385
|
* @returns {Promise<GetPaymentResponse>}
|
|
@@ -1521,6 +1537,12 @@ function __wbg_get_imports() {
|
|
|
1521
1537
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1522
1538
|
}
|
|
1523
1539
|
}, arguments) };
|
|
1540
|
+
imports.wbg.__wbg_getPaymentsByParentIds_0f8f8e0097a07321 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1541
|
+
var v0 = getArrayJsValueFromWasm0(arg1, arg2).slice();
|
|
1542
|
+
wasm.__wbindgen_free(arg1, arg2 * 4, 4);
|
|
1543
|
+
const ret = arg0.getPaymentsByParentIds(v0);
|
|
1544
|
+
return ret;
|
|
1545
|
+
}, arguments) };
|
|
1524
1546
|
imports.wbg.__wbg_getPublicKeyForNode_5ddb3378904e4ad4 = function() { return handleError(function (arg0, arg1) {
|
|
1525
1547
|
const ret = arg0.getPublicKeyForNode(arg1);
|
|
1526
1548
|
return ret;
|
|
@@ -1633,6 +1655,18 @@ function __wbg_get_imports() {
|
|
|
1633
1655
|
const ret = arg0.identityPublicKey();
|
|
1634
1656
|
return ret;
|
|
1635
1657
|
}, arguments) };
|
|
1658
|
+
imports.wbg.__wbg_insertPaymentMetadata_0c4ebdcde694d29b = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1659
|
+
let deferred0_0;
|
|
1660
|
+
let deferred0_1;
|
|
1661
|
+
try {
|
|
1662
|
+
deferred0_0 = arg1;
|
|
1663
|
+
deferred0_1 = arg2;
|
|
1664
|
+
const ret = arg0.insertPaymentMetadata(getStringFromWasm0(arg1, arg2), arg3);
|
|
1665
|
+
return ret;
|
|
1666
|
+
} finally {
|
|
1667
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1668
|
+
}
|
|
1669
|
+
}, arguments) };
|
|
1636
1670
|
imports.wbg.__wbg_insertPayment_2afe3300c5f86ccf = function() { return handleError(function (arg0, arg1) {
|
|
1637
1671
|
const ret = arg0.insertPayment(arg1);
|
|
1638
1672
|
return ret;
|
|
@@ -1775,7 +1809,7 @@ function __wbg_get_imports() {
|
|
|
1775
1809
|
const a = state0.a;
|
|
1776
1810
|
state0.a = 0;
|
|
1777
1811
|
try {
|
|
1778
|
-
return
|
|
1812
|
+
return __wbg_adapter_285(a, state0.b, arg0, arg1);
|
|
1779
1813
|
} finally {
|
|
1780
1814
|
state0.a = a;
|
|
1781
1815
|
}
|
|
@@ -1940,18 +1974,6 @@ function __wbg_get_imports() {
|
|
|
1940
1974
|
const ret = arg0.setLnurlMetadata(v0);
|
|
1941
1975
|
return ret;
|
|
1942
1976
|
}, arguments) };
|
|
1943
|
-
imports.wbg.__wbg_setPaymentMetadata_0bbf82aa72b85deb = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1944
|
-
let deferred0_0;
|
|
1945
|
-
let deferred0_1;
|
|
1946
|
-
try {
|
|
1947
|
-
deferred0_0 = arg1;
|
|
1948
|
-
deferred0_1 = arg2;
|
|
1949
|
-
const ret = arg0.setPaymentMetadata(getStringFromWasm0(arg1, arg2), arg3);
|
|
1950
|
-
return ret;
|
|
1951
|
-
} finally {
|
|
1952
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1953
|
-
}
|
|
1954
|
-
}, arguments) };
|
|
1955
1977
|
imports.wbg.__wbg_setTimeout_2b339866a2aa3789 = function(arg0, arg1) {
|
|
1956
1978
|
const ret = setTimeout(arg0, arg1);
|
|
1957
1979
|
return ret;
|
|
@@ -2095,8 +2117,8 @@ function __wbg_get_imports() {
|
|
|
2095
2117
|
const ret = arg0.syncAddOutgoingChange(arg1);
|
|
2096
2118
|
return ret;
|
|
2097
2119
|
}, arguments) };
|
|
2098
|
-
imports.wbg.
|
|
2099
|
-
const ret = arg0.syncCompleteOutgoingSync(arg1);
|
|
2120
|
+
imports.wbg.__wbg_syncCompleteOutgoingSync_959431da825d4042 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2121
|
+
const ret = arg0.syncCompleteOutgoingSync(arg1, BigInt.asUintN(64, arg2));
|
|
2100
2122
|
return ret;
|
|
2101
2123
|
}, arguments) };
|
|
2102
2124
|
imports.wbg.__wbg_syncDeleteIncomingRecord_ff76566691e4d7ca = function() { return handleError(function (arg0, arg1) {
|
|
@@ -2125,10 +2147,6 @@ function __wbg_get_imports() {
|
|
|
2125
2147
|
const ret = arg0.syncInsertIncomingRecords(v0);
|
|
2126
2148
|
return ret;
|
|
2127
2149
|
}, arguments) };
|
|
2128
|
-
imports.wbg.__wbg_syncRebasePendingOutgoingRecords_b3441ced5dee0c8e = function() { return handleError(function (arg0, arg1) {
|
|
2129
|
-
const ret = arg0.syncRebasePendingOutgoingRecords(BigInt.asUintN(64, arg1));
|
|
2130
|
-
return ret;
|
|
2131
|
-
}, arguments) };
|
|
2132
2150
|
imports.wbg.__wbg_syncUpdateRecordFromIncoming_a76ad82592bfdcb3 = function() { return handleError(function (arg0, arg1) {
|
|
2133
2151
|
const ret = arg0.syncUpdateRecordFromIncoming(arg1);
|
|
2134
2152
|
return ret;
|
|
@@ -2223,12 +2241,12 @@ function __wbg_get_imports() {
|
|
|
2223
2241
|
const ret = false;
|
|
2224
2242
|
return ret;
|
|
2225
2243
|
};
|
|
2226
|
-
imports.wbg.
|
|
2227
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2244
|
+
imports.wbg.__wbindgen_closure_wrapper11757 = function(arg0, arg1, arg2) {
|
|
2245
|
+
const ret = makeMutClosure(arg0, arg1, 851, __wbg_adapter_64);
|
|
2228
2246
|
return ret;
|
|
2229
2247
|
};
|
|
2230
|
-
imports.wbg.
|
|
2231
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2248
|
+
imports.wbg.__wbindgen_closure_wrapper13706 = function(arg0, arg1, arg2) {
|
|
2249
|
+
const ret = makeMutClosure(arg0, arg1, 1082, __wbg_adapter_67);
|
|
2232
2250
|
return ret;
|
|
2233
2251
|
};
|
|
2234
2252
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
Binary file
|
|
@@ -6,6 +6,7 @@ export const __wbg_defaultsigner_free: (a: number, b: number) => void;
|
|
|
6
6
|
export const __wbg_sdkbuilder_free: (a: number, b: number) => void;
|
|
7
7
|
export const __wbg_tokenissuer_free: (a: number, b: number) => void;
|
|
8
8
|
export const breezsdk_addEventListener: (a: number, b: any) => any;
|
|
9
|
+
export const breezsdk_buyBitcoin: (a: number, b: any) => any;
|
|
9
10
|
export const breezsdk_cancelLeafOptimization: (a: number) => any;
|
|
10
11
|
export const breezsdk_checkLightningAddressAvailable: (a: number, b: any) => any;
|
|
11
12
|
export const breezsdk_checkMessage: (a: number, b: any) => any;
|
|
@@ -65,6 +66,7 @@ export const defaultsigner_staticDepositSecret: (a: number, b: number) => any;
|
|
|
65
66
|
export const defaultsigner_staticDepositSecretEncrypted: (a: number, b: number) => any;
|
|
66
67
|
export const defaultsigner_staticDepositSigningKey: (a: number, b: number) => any;
|
|
67
68
|
export const defaultsigner_subtractSecrets: (a: number, b: any, c: any) => any;
|
|
69
|
+
export const getSparkStatus: () => any;
|
|
68
70
|
export const initLogging: (a: any, b: number, c: number) => any;
|
|
69
71
|
export const sdkbuilder_build: (a: number) => any;
|
|
70
72
|
export const sdkbuilder_new: (a: any, b: any) => number;
|
|
@@ -112,6 +114,6 @@ export const __externref_drop_slice: (a: number, b: number) => void;
|
|
|
112
114
|
export const __wbindgen_export_7: WebAssembly.Table;
|
|
113
115
|
export const __externref_table_dealloc: (a: number) => void;
|
|
114
116
|
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf2ef52c8a8b47594: (a: number, b: number) => void;
|
|
115
|
-
export const
|
|
116
|
-
export const
|
|
117
|
+
export const closure1081_externref_shim: (a: number, b: number, c: any) => void;
|
|
118
|
+
export const closure674_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
117
119
|
export const __wbindgen_start: () => void;
|