@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
|
@@ -204,27 +204,6 @@ function debugString(val) {
|
|
|
204
204
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
205
205
|
return className;
|
|
206
206
|
}
|
|
207
|
-
/**
|
|
208
|
-
* @param {ConnectRequest} request
|
|
209
|
-
* @returns {Promise<BreezSdk>}
|
|
210
|
-
*/
|
|
211
|
-
export function connect(request) {
|
|
212
|
-
const ret = wasm.connect(request);
|
|
213
|
-
return ret;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* @param {Logger} logger
|
|
218
|
-
* @param {string | null} [filter]
|
|
219
|
-
* @returns {Promise<void>}
|
|
220
|
-
*/
|
|
221
|
-
export function initLogging(logger, filter) {
|
|
222
|
-
var ptr0 = isLikeNone(filter) ? 0 : passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
223
|
-
var len0 = WASM_VECTOR_LEN;
|
|
224
|
-
const ret = wasm.initLogging(logger, ptr0, len0);
|
|
225
|
-
return ret;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
207
|
/**
|
|
229
208
|
* @param {Config} config
|
|
230
209
|
* @param {ExternalSigner} signer
|
|
@@ -239,11 +218,11 @@ export function connectWithSigner(config, signer, storage_dir) {
|
|
|
239
218
|
}
|
|
240
219
|
|
|
241
220
|
/**
|
|
242
|
-
* @param {
|
|
243
|
-
* @returns {
|
|
221
|
+
* @param {ConnectRequest} request
|
|
222
|
+
* @returns {Promise<BreezSdk>}
|
|
244
223
|
*/
|
|
245
|
-
export function
|
|
246
|
-
const ret = wasm.
|
|
224
|
+
export function connect(request) {
|
|
225
|
+
const ret = wasm.connect(request);
|
|
247
226
|
return ret;
|
|
248
227
|
}
|
|
249
228
|
|
|
@@ -253,9 +232,6 @@ function takeFromExternrefTable0(idx) {
|
|
|
253
232
|
return value;
|
|
254
233
|
}
|
|
255
234
|
/**
|
|
256
|
-
* Creates a default external signer from a mnemonic phrase.
|
|
257
|
-
*
|
|
258
|
-
* This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
|
|
259
235
|
* @param {string} mnemonic
|
|
260
236
|
* @param {string | null | undefined} passphrase
|
|
261
237
|
* @param {Network} network
|
|
@@ -274,6 +250,38 @@ export function defaultExternalSigner(mnemonic, passphrase, network, key_set_con
|
|
|
274
250
|
return DefaultSigner.__wrap(ret[0]);
|
|
275
251
|
}
|
|
276
252
|
|
|
253
|
+
/**
|
|
254
|
+
* @param {Logger} logger
|
|
255
|
+
* @param {string | null} [filter]
|
|
256
|
+
* @returns {Promise<void>}
|
|
257
|
+
*/
|
|
258
|
+
export function initLogging(logger, filter) {
|
|
259
|
+
var ptr0 = isLikeNone(filter) ? 0 : passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
260
|
+
var len0 = WASM_VECTOR_LEN;
|
|
261
|
+
const ret = wasm.initLogging(logger, ptr0, len0);
|
|
262
|
+
return ret;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Creates a default external signer from a mnemonic phrase.
|
|
267
|
+
*
|
|
268
|
+
* This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
|
|
269
|
+
* @returns {Promise<SparkStatus>}
|
|
270
|
+
*/
|
|
271
|
+
export function getSparkStatus() {
|
|
272
|
+
const ret = wasm.getSparkStatus();
|
|
273
|
+
return ret;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* @param {Network} network
|
|
278
|
+
* @returns {Config}
|
|
279
|
+
*/
|
|
280
|
+
export function defaultConfig(network) {
|
|
281
|
+
const ret = wasm.defaultConfig(network);
|
|
282
|
+
return ret;
|
|
283
|
+
}
|
|
284
|
+
|
|
277
285
|
function passArray8ToWasm0(arg, malloc) {
|
|
278
286
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
279
287
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -296,11 +304,11 @@ function __wbg_adapter_64(arg0, arg1) {
|
|
|
296
304
|
}
|
|
297
305
|
|
|
298
306
|
function __wbg_adapter_67(arg0, arg1, arg2) {
|
|
299
|
-
wasm.
|
|
307
|
+
wasm.closure1081_externref_shim(arg0, arg1, arg2);
|
|
300
308
|
}
|
|
301
309
|
|
|
302
|
-
function
|
|
303
|
-
wasm.
|
|
310
|
+
function __wbg_adapter_285(arg0, arg1, arg2, arg3) {
|
|
311
|
+
wasm.closure674_externref_shim(arg0, arg1, arg2, arg3);
|
|
304
312
|
}
|
|
305
313
|
|
|
306
314
|
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
@@ -355,6 +363,14 @@ export class BreezSdk {
|
|
|
355
363
|
const ret = wasm.breezsdk_lnurlAuth(this.__wbg_ptr, request_data);
|
|
356
364
|
return ret;
|
|
357
365
|
}
|
|
366
|
+
/**
|
|
367
|
+
* @param {BuyBitcoinRequest} request
|
|
368
|
+
* @returns {Promise<BuyBitcoinResponse>}
|
|
369
|
+
*/
|
|
370
|
+
buyBitcoin(request) {
|
|
371
|
+
const ret = wasm.breezsdk_buyBitcoin(this.__wbg_ptr, request);
|
|
372
|
+
return ret;
|
|
373
|
+
}
|
|
358
374
|
/**
|
|
359
375
|
* @param {GetPaymentRequest} request
|
|
360
376
|
* @returns {Promise<GetPaymentResponse>}
|
|
@@ -1480,6 +1496,12 @@ const imports = {
|
|
|
1480
1496
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1481
1497
|
}
|
|
1482
1498
|
}, arguments) },
|
|
1499
|
+
__wbg_getPaymentsByParentIds_0f8f8e0097a07321: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1500
|
+
var v0 = getArrayJsValueFromWasm0(arg1, arg2).slice();
|
|
1501
|
+
wasm.__wbindgen_free(arg1, arg2 * 4, 4);
|
|
1502
|
+
const ret = arg0.getPaymentsByParentIds(v0);
|
|
1503
|
+
return ret;
|
|
1504
|
+
}, arguments) },
|
|
1483
1505
|
__wbg_getPublicKeyForNode_5ddb3378904e4ad4: function() { return handleError(function (arg0, arg1) {
|
|
1484
1506
|
const ret = arg0.getPublicKeyForNode(arg1);
|
|
1485
1507
|
return ret;
|
|
@@ -1592,6 +1614,18 @@ const imports = {
|
|
|
1592
1614
|
const ret = arg0.identityPublicKey();
|
|
1593
1615
|
return ret;
|
|
1594
1616
|
}, arguments) },
|
|
1617
|
+
__wbg_insertPaymentMetadata_0c4ebdcde694d29b: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1618
|
+
let deferred0_0;
|
|
1619
|
+
let deferred0_1;
|
|
1620
|
+
try {
|
|
1621
|
+
deferred0_0 = arg1;
|
|
1622
|
+
deferred0_1 = arg2;
|
|
1623
|
+
const ret = arg0.insertPaymentMetadata(getStringFromWasm0(arg1, arg2), arg3);
|
|
1624
|
+
return ret;
|
|
1625
|
+
} finally {
|
|
1626
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1627
|
+
}
|
|
1628
|
+
}, arguments) },
|
|
1595
1629
|
__wbg_insertPayment_2afe3300c5f86ccf: function() { return handleError(function (arg0, arg1) {
|
|
1596
1630
|
const ret = arg0.insertPayment(arg1);
|
|
1597
1631
|
return ret;
|
|
@@ -1734,7 +1768,7 @@ const imports = {
|
|
|
1734
1768
|
const a = state0.a;
|
|
1735
1769
|
state0.a = 0;
|
|
1736
1770
|
try {
|
|
1737
|
-
return
|
|
1771
|
+
return __wbg_adapter_285(a, state0.b, arg0, arg1);
|
|
1738
1772
|
} finally {
|
|
1739
1773
|
state0.a = a;
|
|
1740
1774
|
}
|
|
@@ -1899,18 +1933,6 @@ const imports = {
|
|
|
1899
1933
|
const ret = arg0.setLnurlMetadata(v0);
|
|
1900
1934
|
return ret;
|
|
1901
1935
|
}, arguments) },
|
|
1902
|
-
__wbg_setPaymentMetadata_0bbf82aa72b85deb: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1903
|
-
let deferred0_0;
|
|
1904
|
-
let deferred0_1;
|
|
1905
|
-
try {
|
|
1906
|
-
deferred0_0 = arg1;
|
|
1907
|
-
deferred0_1 = arg2;
|
|
1908
|
-
const ret = arg0.setPaymentMetadata(getStringFromWasm0(arg1, arg2), arg3);
|
|
1909
|
-
return ret;
|
|
1910
|
-
} finally {
|
|
1911
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1912
|
-
}
|
|
1913
|
-
}, arguments) },
|
|
1914
1936
|
__wbg_setTimeout_2b339866a2aa3789: function(arg0, arg1) {
|
|
1915
1937
|
const ret = setTimeout(arg0, arg1);
|
|
1916
1938
|
return ret;
|
|
@@ -2054,8 +2076,8 @@ const imports = {
|
|
|
2054
2076
|
const ret = arg0.syncAddOutgoingChange(arg1);
|
|
2055
2077
|
return ret;
|
|
2056
2078
|
}, arguments) },
|
|
2057
|
-
|
|
2058
|
-
const ret = arg0.syncCompleteOutgoingSync(arg1);
|
|
2079
|
+
__wbg_syncCompleteOutgoingSync_959431da825d4042: function() { return handleError(function (arg0, arg1, arg2) {
|
|
2080
|
+
const ret = arg0.syncCompleteOutgoingSync(arg1, BigInt.asUintN(64, arg2));
|
|
2059
2081
|
return ret;
|
|
2060
2082
|
}, arguments) },
|
|
2061
2083
|
__wbg_syncDeleteIncomingRecord_ff76566691e4d7ca: function() { return handleError(function (arg0, arg1) {
|
|
@@ -2084,10 +2106,6 @@ const imports = {
|
|
|
2084
2106
|
const ret = arg0.syncInsertIncomingRecords(v0);
|
|
2085
2107
|
return ret;
|
|
2086
2108
|
}, arguments) },
|
|
2087
|
-
__wbg_syncRebasePendingOutgoingRecords_b3441ced5dee0c8e: function() { return handleError(function (arg0, arg1) {
|
|
2088
|
-
const ret = arg0.syncRebasePendingOutgoingRecords(BigInt.asUintN(64, arg1));
|
|
2089
|
-
return ret;
|
|
2090
|
-
}, arguments) },
|
|
2091
2109
|
__wbg_syncUpdateRecordFromIncoming_a76ad82592bfdcb3: function() { return handleError(function (arg0, arg1) {
|
|
2092
2110
|
const ret = arg0.syncUpdateRecordFromIncoming(arg1);
|
|
2093
2111
|
return ret;
|
|
@@ -2182,12 +2200,12 @@ const imports = {
|
|
|
2182
2200
|
const ret = false;
|
|
2183
2201
|
return ret;
|
|
2184
2202
|
},
|
|
2185
|
-
|
|
2186
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2203
|
+
__wbindgen_closure_wrapper11757: function(arg0, arg1, arg2) {
|
|
2204
|
+
const ret = makeMutClosure(arg0, arg1, 851, __wbg_adapter_64);
|
|
2187
2205
|
return ret;
|
|
2188
2206
|
},
|
|
2189
|
-
|
|
2190
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2207
|
+
__wbindgen_closure_wrapper13706: function(arg0, arg1, arg2) {
|
|
2208
|
+
const ret = makeMutClosure(arg0, arg1, 1082, __wbg_adapter_67);
|
|
2191
2209
|
return ret;
|
|
2192
2210
|
},
|
|
2193
2211
|
__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;
|