@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.
@@ -221,27 +221,6 @@ function debugString(val) {
221
221
  // TODO we could test for more things here, like `Set`s and `Map`s.
222
222
  return className;
223
223
  }
224
- /**
225
- * @param {ConnectRequest} request
226
- * @returns {Promise<BreezSdk>}
227
- */
228
- export function connect(request) {
229
- const ret = wasm.connect(request);
230
- return ret;
231
- }
232
-
233
- /**
234
- * @param {Logger} logger
235
- * @param {string | null} [filter]
236
- * @returns {Promise<void>}
237
- */
238
- export function initLogging(logger, filter) {
239
- var ptr0 = isLikeNone(filter) ? 0 : passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
240
- var len0 = WASM_VECTOR_LEN;
241
- const ret = wasm.initLogging(logger, ptr0, len0);
242
- return ret;
243
- }
244
-
245
224
  /**
246
225
  * @param {Config} config
247
226
  * @param {ExternalSigner} signer
@@ -256,11 +235,11 @@ export function connectWithSigner(config, signer, storage_dir) {
256
235
  }
257
236
 
258
237
  /**
259
- * @param {Network} network
260
- * @returns {Config}
238
+ * @param {ConnectRequest} request
239
+ * @returns {Promise<BreezSdk>}
261
240
  */
262
- export function defaultConfig(network) {
263
- const ret = wasm.defaultConfig(network);
241
+ export function connect(request) {
242
+ const ret = wasm.connect(request);
264
243
  return ret;
265
244
  }
266
245
 
@@ -270,9 +249,6 @@ function takeFromExternrefTable0(idx) {
270
249
  return value;
271
250
  }
272
251
  /**
273
- * Creates a default external signer from a mnemonic phrase.
274
- *
275
- * This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
276
252
  * @param {string} mnemonic
277
253
  * @param {string | null | undefined} passphrase
278
254
  * @param {Network} network
@@ -291,6 +267,38 @@ export function defaultExternalSigner(mnemonic, passphrase, network, key_set_con
291
267
  return DefaultSigner.__wrap(ret[0]);
292
268
  }
293
269
 
270
+ /**
271
+ * @param {Logger} logger
272
+ * @param {string | null} [filter]
273
+ * @returns {Promise<void>}
274
+ */
275
+ export function initLogging(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
+ * Creates a default external signer from a mnemonic phrase.
284
+ *
285
+ * This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
286
+ * @returns {Promise<SparkStatus>}
287
+ */
288
+ export function getSparkStatus() {
289
+ const ret = wasm.getSparkStatus();
290
+ return ret;
291
+ }
292
+
293
+ /**
294
+ * @param {Network} network
295
+ * @returns {Config}
296
+ */
297
+ export function defaultConfig(network) {
298
+ const ret = wasm.defaultConfig(network);
299
+ return ret;
300
+ }
301
+
294
302
  function passArray8ToWasm0(arg, malloc) {
295
303
  const ptr = malloc(arg.length * 1, 1) >>> 0;
296
304
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -313,11 +321,11 @@ function __wbg_adapter_64(arg0, arg1) {
313
321
  }
314
322
 
315
323
  function __wbg_adapter_67(arg0, arg1, arg2) {
316
- wasm.closure1062_externref_shim(arg0, arg1, arg2);
324
+ wasm.closure1081_externref_shim(arg0, arg1, arg2);
317
325
  }
318
326
 
319
- function __wbg_adapter_283(arg0, arg1, arg2, arg3) {
320
- wasm.closure657_externref_shim(arg0, arg1, arg2, arg3);
327
+ function __wbg_adapter_285(arg0, arg1, arg2, arg3) {
328
+ wasm.closure674_externref_shim(arg0, arg1, arg2, arg3);
321
329
  }
322
330
 
323
331
  const __wbindgen_enum_ReadableStreamType = ["bytes"];
@@ -372,6 +380,14 @@ export class BreezSdk {
372
380
  const ret = wasm.breezsdk_lnurlAuth(this.__wbg_ptr, request_data);
373
381
  return ret;
374
382
  }
383
+ /**
384
+ * @param {BuyBitcoinRequest} request
385
+ * @returns {Promise<BuyBitcoinResponse>}
386
+ */
387
+ buyBitcoin(request) {
388
+ const ret = wasm.breezsdk_buyBitcoin(this.__wbg_ptr, request);
389
+ return ret;
390
+ }
375
391
  /**
376
392
  * @param {GetPaymentRequest} request
377
393
  * @returns {Promise<GetPaymentResponse>}
@@ -1544,6 +1560,13 @@ export function __wbg_getPaymentByInvoice_afddfcbefa5508b0() { return handleErro
1544
1560
  }
1545
1561
  }, arguments) };
1546
1562
 
1563
+ export function __wbg_getPaymentsByParentIds_0f8f8e0097a07321() { return handleError(function (arg0, arg1, arg2) {
1564
+ var v0 = getArrayJsValueFromWasm0(arg1, arg2).slice();
1565
+ wasm.__wbindgen_free(arg1, arg2 * 4, 4);
1566
+ const ret = arg0.getPaymentsByParentIds(v0);
1567
+ return ret;
1568
+ }, arguments) };
1569
+
1547
1570
  export function __wbg_getPublicKeyForNode_5ddb3378904e4ad4() { return handleError(function (arg0, arg1) {
1548
1571
  const ret = arg0.getPublicKeyForNode(arg1);
1549
1572
  return ret;
@@ -1676,6 +1699,19 @@ export function __wbg_identityPublicKey_c8b35005055a3df0() { return handleError(
1676
1699
  return ret;
1677
1700
  }, arguments) };
1678
1701
 
1702
+ export function __wbg_insertPaymentMetadata_0c4ebdcde694d29b() { return handleError(function (arg0, arg1, arg2, arg3) {
1703
+ let deferred0_0;
1704
+ let deferred0_1;
1705
+ try {
1706
+ deferred0_0 = arg1;
1707
+ deferred0_1 = arg2;
1708
+ const ret = arg0.insertPaymentMetadata(getStringFromWasm0(arg1, arg2), arg3);
1709
+ return ret;
1710
+ } finally {
1711
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1712
+ }
1713
+ }, arguments) };
1714
+
1679
1715
  export function __wbg_insertPayment_2afe3300c5f86ccf() { return handleError(function (arg0, arg1) {
1680
1716
  const ret = arg0.insertPayment(arg1);
1681
1717
  return ret;
@@ -1840,7 +1876,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
1840
1876
  const a = state0.a;
1841
1877
  state0.a = 0;
1842
1878
  try {
1843
- return __wbg_adapter_283(a, state0.b, arg0, arg1);
1879
+ return __wbg_adapter_285(a, state0.b, arg0, arg1);
1844
1880
  } finally {
1845
1881
  state0.a = a;
1846
1882
  }
@@ -2039,19 +2075,6 @@ export function __wbg_setLnurlMetadata_0bf15cc7efb6cc11() { return handleError(f
2039
2075
  return ret;
2040
2076
  }, arguments) };
2041
2077
 
2042
- export function __wbg_setPaymentMetadata_0bbf82aa72b85deb() { return handleError(function (arg0, arg1, arg2, arg3) {
2043
- let deferred0_0;
2044
- let deferred0_1;
2045
- try {
2046
- deferred0_0 = arg1;
2047
- deferred0_1 = arg2;
2048
- const ret = arg0.setPaymentMetadata(getStringFromWasm0(arg1, arg2), arg3);
2049
- return ret;
2050
- } finally {
2051
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2052
- }
2053
- }, arguments) };
2054
-
2055
2078
  export function __wbg_setTimeout_2b339866a2aa3789(arg0, arg1) {
2056
2079
  const ret = setTimeout(arg0, arg1);
2057
2080
  return ret;
@@ -2228,8 +2251,8 @@ export function __wbg_syncAddOutgoingChange_9d94d35ba215d3c9() { return handleEr
2228
2251
  return ret;
2229
2252
  }, arguments) };
2230
2253
 
2231
- export function __wbg_syncCompleteOutgoingSync_9acd2319c2fc00d6() { return handleError(function (arg0, arg1) {
2232
- const ret = arg0.syncCompleteOutgoingSync(arg1);
2254
+ export function __wbg_syncCompleteOutgoingSync_959431da825d4042() { return handleError(function (arg0, arg1, arg2) {
2255
+ const ret = arg0.syncCompleteOutgoingSync(arg1, BigInt.asUintN(64, arg2));
2233
2256
  return ret;
2234
2257
  }, arguments) };
2235
2258
 
@@ -2265,11 +2288,6 @@ export function __wbg_syncInsertIncomingRecords_dde4039dbc9cb38f() { return hand
2265
2288
  return ret;
2266
2289
  }, arguments) };
2267
2290
 
2268
- export function __wbg_syncRebasePendingOutgoingRecords_b3441ced5dee0c8e() { return handleError(function (arg0, arg1) {
2269
- const ret = arg0.syncRebasePendingOutgoingRecords(BigInt.asUintN(64, arg1));
2270
- return ret;
2271
- }, arguments) };
2272
-
2273
2291
  export function __wbg_syncUpdateRecordFromIncoming_a76ad82592bfdcb3() { return handleError(function (arg0, arg1) {
2274
2292
  const ret = arg0.syncUpdateRecordFromIncoming(arg1);
2275
2293
  return ret;
@@ -2383,13 +2401,13 @@ export function __wbindgen_cb_drop(arg0) {
2383
2401
  return ret;
2384
2402
  };
2385
2403
 
2386
- export function __wbindgen_closure_wrapper11308(arg0, arg1, arg2) {
2387
- const ret = makeMutClosure(arg0, arg1, 833, __wbg_adapter_64);
2404
+ export function __wbindgen_closure_wrapper11757(arg0, arg1, arg2) {
2405
+ const ret = makeMutClosure(arg0, arg1, 851, __wbg_adapter_64);
2388
2406
  return ret;
2389
2407
  };
2390
2408
 
2391
- export function __wbindgen_closure_wrapper13300(arg0, arg1, arg2) {
2392
- const ret = makeMutClosure(arg0, arg1, 1063, __wbg_adapter_67);
2409
+ export function __wbindgen_closure_wrapper13706(arg0, arg1, arg2) {
2410
+ const ret = makeMutClosure(arg0, arg1, 1082, __wbg_adapter_67);
2393
2411
  return ret;
2394
2412
  };
2395
2413
 
@@ -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;