@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.
@@ -217,27 +217,6 @@ function debugString(val) {
217
217
  // TODO we could test for more things here, like `Set`s and `Map`s.
218
218
  return className;
219
219
  }
220
- /**
221
- * @param {ConnectRequest} request
222
- * @returns {Promise<BreezSdk>}
223
- */
224
- module.exports.connect = function(request) {
225
- const ret = wasm.connect(request);
226
- return ret;
227
- };
228
-
229
- /**
230
- * @param {Logger} logger
231
- * @param {string | null} [filter]
232
- * @returns {Promise<void>}
233
- */
234
- module.exports.initLogging = function(logger, filter) {
235
- var ptr0 = isLikeNone(filter) ? 0 : passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
236
- var len0 = WASM_VECTOR_LEN;
237
- const ret = wasm.initLogging(logger, ptr0, len0);
238
- return ret;
239
- };
240
-
241
220
  /**
242
221
  * @param {Config} config
243
222
  * @param {ExternalSigner} signer
@@ -252,11 +231,11 @@ module.exports.connectWithSigner = function(config, signer, storage_dir) {
252
231
  };
253
232
 
254
233
  /**
255
- * @param {Network} network
256
- * @returns {Config}
234
+ * @param {ConnectRequest} request
235
+ * @returns {Promise<BreezSdk>}
257
236
  */
258
- module.exports.defaultConfig = function(network) {
259
- const ret = wasm.defaultConfig(network);
237
+ module.exports.connect = function(request) {
238
+ const ret = wasm.connect(request);
260
239
  return ret;
261
240
  };
262
241
 
@@ -266,9 +245,6 @@ function takeFromExternrefTable0(idx) {
266
245
  return value;
267
246
  }
268
247
  /**
269
- * Creates a default external signer from a mnemonic phrase.
270
- *
271
- * This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
272
248
  * @param {string} mnemonic
273
249
  * @param {string | null | undefined} passphrase
274
250
  * @param {Network} network
@@ -287,6 +263,38 @@ module.exports.defaultExternalSigner = function(mnemonic, passphrase, network, k
287
263
  return DefaultSigner.__wrap(ret[0]);
288
264
  };
289
265
 
266
+ /**
267
+ * @param {Logger} logger
268
+ * @param {string | null} [filter]
269
+ * @returns {Promise<void>}
270
+ */
271
+ module.exports.initLogging = function(logger, filter) {
272
+ var ptr0 = isLikeNone(filter) ? 0 : passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
273
+ var len0 = WASM_VECTOR_LEN;
274
+ const ret = wasm.initLogging(logger, ptr0, len0);
275
+ return ret;
276
+ };
277
+
278
+ /**
279
+ * Creates a default external signer from a mnemonic phrase.
280
+ *
281
+ * This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
282
+ * @returns {Promise<SparkStatus>}
283
+ */
284
+ module.exports.getSparkStatus = function() {
285
+ const ret = wasm.getSparkStatus();
286
+ return ret;
287
+ };
288
+
289
+ /**
290
+ * @param {Network} network
291
+ * @returns {Config}
292
+ */
293
+ module.exports.defaultConfig = function(network) {
294
+ const ret = wasm.defaultConfig(network);
295
+ return ret;
296
+ };
297
+
290
298
  function passArray8ToWasm0(arg, malloc) {
291
299
  const ptr = malloc(arg.length * 1, 1) >>> 0;
292
300
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -309,11 +317,11 @@ function __wbg_adapter_64(arg0, arg1) {
309
317
  }
310
318
 
311
319
  function __wbg_adapter_67(arg0, arg1, arg2) {
312
- wasm.closure1062_externref_shim(arg0, arg1, arg2);
320
+ wasm.closure1081_externref_shim(arg0, arg1, arg2);
313
321
  }
314
322
 
315
- function __wbg_adapter_283(arg0, arg1, arg2, arg3) {
316
- wasm.closure657_externref_shim(arg0, arg1, arg2, arg3);
323
+ function __wbg_adapter_285(arg0, arg1, arg2, arg3) {
324
+ wasm.closure674_externref_shim(arg0, arg1, arg2, arg3);
317
325
  }
318
326
 
319
327
  const __wbindgen_enum_ReadableStreamType = ["bytes"];
@@ -368,6 +376,14 @@ class BreezSdk {
368
376
  const ret = wasm.breezsdk_lnurlAuth(this.__wbg_ptr, request_data);
369
377
  return ret;
370
378
  }
379
+ /**
380
+ * @param {BuyBitcoinRequest} request
381
+ * @returns {Promise<BuyBitcoinResponse>}
382
+ */
383
+ buyBitcoin(request) {
384
+ const ret = wasm.breezsdk_buyBitcoin(this.__wbg_ptr, request);
385
+ return ret;
386
+ }
371
387
  /**
372
388
  * @param {GetPaymentRequest} request
373
389
  * @returns {Promise<GetPaymentResponse>}
@@ -1547,6 +1563,13 @@ module.exports.__wbg_getPaymentByInvoice_afddfcbefa5508b0 = function() { return
1547
1563
  }
1548
1564
  }, arguments) };
1549
1565
 
1566
+ module.exports.__wbg_getPaymentsByParentIds_0f8f8e0097a07321 = function() { return handleError(function (arg0, arg1, arg2) {
1567
+ var v0 = getArrayJsValueFromWasm0(arg1, arg2).slice();
1568
+ wasm.__wbindgen_free(arg1, arg2 * 4, 4);
1569
+ const ret = arg0.getPaymentsByParentIds(v0);
1570
+ return ret;
1571
+ }, arguments) };
1572
+
1550
1573
  module.exports.__wbg_getPublicKeyForNode_5ddb3378904e4ad4 = function() { return handleError(function (arg0, arg1) {
1551
1574
  const ret = arg0.getPublicKeyForNode(arg1);
1552
1575
  return ret;
@@ -1679,6 +1702,19 @@ module.exports.__wbg_identityPublicKey_c8b35005055a3df0 = function() { return ha
1679
1702
  return ret;
1680
1703
  }, arguments) };
1681
1704
 
1705
+ module.exports.__wbg_insertPaymentMetadata_0c4ebdcde694d29b = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1706
+ let deferred0_0;
1707
+ let deferred0_1;
1708
+ try {
1709
+ deferred0_0 = arg1;
1710
+ deferred0_1 = arg2;
1711
+ const ret = arg0.insertPaymentMetadata(getStringFromWasm0(arg1, arg2), arg3);
1712
+ return ret;
1713
+ } finally {
1714
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1715
+ }
1716
+ }, arguments) };
1717
+
1682
1718
  module.exports.__wbg_insertPayment_2afe3300c5f86ccf = function() { return handleError(function (arg0, arg1) {
1683
1719
  const ret = arg0.insertPayment(arg1);
1684
1720
  return ret;
@@ -1843,7 +1879,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
1843
1879
  const a = state0.a;
1844
1880
  state0.a = 0;
1845
1881
  try {
1846
- return __wbg_adapter_283(a, state0.b, arg0, arg1);
1882
+ return __wbg_adapter_285(a, state0.b, arg0, arg1);
1847
1883
  } finally {
1848
1884
  state0.a = a;
1849
1885
  }
@@ -2042,19 +2078,6 @@ module.exports.__wbg_setLnurlMetadata_0bf15cc7efb6cc11 = function() { return han
2042
2078
  return ret;
2043
2079
  }, arguments) };
2044
2080
 
2045
- module.exports.__wbg_setPaymentMetadata_0bbf82aa72b85deb = function() { return handleError(function (arg0, arg1, arg2, arg3) {
2046
- let deferred0_0;
2047
- let deferred0_1;
2048
- try {
2049
- deferred0_0 = arg1;
2050
- deferred0_1 = arg2;
2051
- const ret = arg0.setPaymentMetadata(getStringFromWasm0(arg1, arg2), arg3);
2052
- return ret;
2053
- } finally {
2054
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2055
- }
2056
- }, arguments) };
2057
-
2058
2081
  module.exports.__wbg_setTimeout_2b339866a2aa3789 = function(arg0, arg1) {
2059
2082
  const ret = setTimeout(arg0, arg1);
2060
2083
  return ret;
@@ -2231,8 +2254,8 @@ module.exports.__wbg_syncAddOutgoingChange_9d94d35ba215d3c9 = function() { retur
2231
2254
  return ret;
2232
2255
  }, arguments) };
2233
2256
 
2234
- module.exports.__wbg_syncCompleteOutgoingSync_9acd2319c2fc00d6 = function() { return handleError(function (arg0, arg1) {
2235
- const ret = arg0.syncCompleteOutgoingSync(arg1);
2257
+ module.exports.__wbg_syncCompleteOutgoingSync_959431da825d4042 = function() { return handleError(function (arg0, arg1, arg2) {
2258
+ const ret = arg0.syncCompleteOutgoingSync(arg1, BigInt.asUintN(64, arg2));
2236
2259
  return ret;
2237
2260
  }, arguments) };
2238
2261
 
@@ -2268,11 +2291,6 @@ module.exports.__wbg_syncInsertIncomingRecords_dde4039dbc9cb38f = function() { r
2268
2291
  return ret;
2269
2292
  }, arguments) };
2270
2293
 
2271
- module.exports.__wbg_syncRebasePendingOutgoingRecords_b3441ced5dee0c8e = function() { return handleError(function (arg0, arg1) {
2272
- const ret = arg0.syncRebasePendingOutgoingRecords(BigInt.asUintN(64, arg1));
2273
- return ret;
2274
- }, arguments) };
2275
-
2276
2294
  module.exports.__wbg_syncUpdateRecordFromIncoming_a76ad82592bfdcb3 = function() { return handleError(function (arg0, arg1) {
2277
2295
  const ret = arg0.syncUpdateRecordFromIncoming(arg1);
2278
2296
  return ret;
@@ -2386,13 +2404,13 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
2386
2404
  return ret;
2387
2405
  };
2388
2406
 
2389
- module.exports.__wbindgen_closure_wrapper11308 = function(arg0, arg1, arg2) {
2390
- const ret = makeMutClosure(arg0, arg1, 833, __wbg_adapter_64);
2407
+ module.exports.__wbindgen_closure_wrapper11757 = function(arg0, arg1, arg2) {
2408
+ const ret = makeMutClosure(arg0, arg1, 851, __wbg_adapter_64);
2391
2409
  return ret;
2392
2410
  };
2393
2411
 
2394
- module.exports.__wbindgen_closure_wrapper13300 = function(arg0, arg1, arg2) {
2395
- const ret = makeMutClosure(arg0, arg1, 1063, __wbg_adapter_67);
2412
+ module.exports.__wbindgen_closure_wrapper13706 = function(arg0, arg1, arg2) {
2413
+ const ret = makeMutClosure(arg0, arg1, 1082, __wbg_adapter_67);
2396
2414
  return ret;
2397
2415
  };
2398
2416
 
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 closure1062_externref_shim: (a: number, b: number, c: any) => void;
116
- export const closure657_externref_shim: (a: number, b: number, c: any, d: any) => void;
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;