@breeztech/breez-sdk-spark 0.11.0 → 0.12.2-dev1

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.
@@ -230,28 +230,37 @@ export function defaultPostgresStorageConfig(connection_string) {
230
230
  return ret;
231
231
  }
232
232
 
233
- function takeFromExternrefTable0(idx) {
234
- const value = wasm.__wbindgen_export_5.get(idx);
235
- wasm.__externref_table_dealloc(idx);
236
- return value;
233
+ /**
234
+ * Creates a default external signer from a mnemonic phrase.
235
+ *
236
+ * This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
237
+ * @returns {Promise<SparkStatus>}
238
+ */
239
+ export function getSparkStatus() {
240
+ const ret = wasm.getSparkStatus();
241
+ return ret;
237
242
  }
243
+
238
244
  /**
239
- * @param {string} mnemonic
240
- * @param {string | null | undefined} passphrase
241
- * @param {Network} network
242
- * @param {KeySetConfig | null} [key_set_config]
243
- * @returns {DefaultSigner}
245
+ * @param {Config} config
246
+ * @param {ExternalSigner} signer
247
+ * @param {string} storage_dir
248
+ * @returns {Promise<BreezSdk>}
244
249
  */
245
- export function defaultExternalSigner(mnemonic, passphrase, network, key_set_config) {
246
- const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
250
+ export function connectWithSigner(config, signer, storage_dir) {
251
+ const ptr0 = passStringToWasm0(storage_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
247
252
  const len0 = WASM_VECTOR_LEN;
248
- var ptr1 = isLikeNone(passphrase) ? 0 : passStringToWasm0(passphrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
249
- var len1 = WASM_VECTOR_LEN;
250
- const ret = wasm.defaultExternalSigner(ptr0, len0, ptr1, len1, network, isLikeNone(key_set_config) ? 0 : addToExternrefTable0(key_set_config));
251
- if (ret[2]) {
252
- throw takeFromExternrefTable0(ret[1]);
253
- }
254
- return DefaultSigner.__wrap(ret[0]);
253
+ const ret = wasm.connectWithSigner(config, signer, ptr0, len0);
254
+ return ret;
255
+ }
256
+
257
+ /**
258
+ * @param {ConnectRequest} request
259
+ * @returns {Promise<BreezSdk>}
260
+ */
261
+ export function connect(request) {
262
+ const ret = wasm.connect(request);
263
+ return ret;
255
264
  }
256
265
 
257
266
  /**
@@ -275,37 +284,28 @@ export function initLogging(logger, filter) {
275
284
  return ret;
276
285
  }
277
286
 
278
- /**
279
- * @param {ConnectRequest} request
280
- * @returns {Promise<BreezSdk>}
281
- */
282
- export function connect(request) {
283
- const ret = wasm.connect(request);
284
- return ret;
285
- }
286
-
287
- /**
288
- * Creates a default external signer from a mnemonic phrase.
289
- *
290
- * This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
291
- * @returns {Promise<SparkStatus>}
292
- */
293
- export function getSparkStatus() {
294
- const ret = wasm.getSparkStatus();
295
- return ret;
287
+ function takeFromExternrefTable0(idx) {
288
+ const value = wasm.__wbindgen_export_5.get(idx);
289
+ wasm.__externref_table_dealloc(idx);
290
+ return value;
296
291
  }
297
-
298
292
  /**
299
- * @param {Config} config
300
- * @param {ExternalSigner} signer
301
- * @param {string} storage_dir
302
- * @returns {Promise<BreezSdk>}
293
+ * @param {string} mnemonic
294
+ * @param {string | null | undefined} passphrase
295
+ * @param {Network} network
296
+ * @param {KeySetConfig | null} [key_set_config]
297
+ * @returns {DefaultSigner}
303
298
  */
304
- export function connectWithSigner(config, signer, storage_dir) {
305
- const ptr0 = passStringToWasm0(storage_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
299
+ export function defaultExternalSigner(mnemonic, passphrase, network, key_set_config) {
300
+ const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
306
301
  const len0 = WASM_VECTOR_LEN;
307
- const ret = wasm.connectWithSigner(config, signer, ptr0, len0);
308
- return ret;
302
+ var ptr1 = isLikeNone(passphrase) ? 0 : passStringToWasm0(passphrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
303
+ var len1 = WASM_VECTOR_LEN;
304
+ const ret = wasm.defaultExternalSigner(ptr0, len0, ptr1, len1, network, isLikeNone(key_set_config) ? 0 : addToExternrefTable0(key_set_config));
305
+ if (ret[2]) {
306
+ throw takeFromExternrefTable0(ret[1]);
307
+ }
308
+ return DefaultSigner.__wrap(ret[0]);
309
309
  }
310
310
 
311
311
  function passArray8ToWasm0(arg, malloc) {
@@ -326,15 +326,15 @@ export function task_worker_entry_point(ptr) {
326
326
  }
327
327
 
328
328
  function __wbg_adapter_64(arg0, arg1, arg2) {
329
- wasm.closure440_externref_shim(arg0, arg1, arg2);
329
+ wasm.closure444_externref_shim(arg0, arg1, arg2);
330
330
  }
331
331
 
332
332
  function __wbg_adapter_69(arg0, arg1) {
333
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h29e986a86553656d(arg0, arg1);
333
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1bbbe552b190da27(arg0, arg1);
334
334
  }
335
335
 
336
- function __wbg_adapter_339(arg0, arg1, arg2, arg3) {
337
- wasm.closure720_externref_shim(arg0, arg1, arg2, arg3);
336
+ function __wbg_adapter_373(arg0, arg1, arg2, arg3) {
337
+ wasm.closure711_externref_shim(arg0, arg1, arg2, arg3);
338
338
  }
339
339
 
340
340
  const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
@@ -1052,7 +1052,7 @@ const PasskeyFinalization = (typeof FinalizationRegistry === 'undefined')
1052
1052
  * Passkey-based wallet operations using WebAuthn PRF extension.
1053
1053
  *
1054
1054
  * Wraps a `PasskeyPrfProvider` and optional relay configuration to provide
1055
- * wallet derivation and name management via Nostr relays.
1055
+ * wallet derivation and label management via Nostr relays.
1056
1056
  */
1057
1057
  export class Passkey {
1058
1058
 
@@ -1068,50 +1068,50 @@ export class Passkey {
1068
1068
  wasm.__wbg_passkey_free(ptr, 0);
1069
1069
  }
1070
1070
  /**
1071
- * Derive a wallet for a given wallet name.
1071
+ * Derive a wallet for a given label.
1072
1072
  *
1073
- * Uses the passkey PRF to derive a `Wallet` containing the seed and resolved name.
1073
+ * Uses the passkey PRF to derive a `Wallet` containing the seed and resolved label.
1074
1074
  *
1075
- * @param walletName - Optional wallet name string (defaults to "Default")
1076
- * @param {string | null} [wallet_name]
1075
+ * @param label - Optional label string (defaults to "Default")
1076
+ * @param {string | null} [label]
1077
1077
  * @returns {Promise<Wallet>}
1078
1078
  */
1079
- getWallet(wallet_name) {
1080
- var ptr0 = isLikeNone(wallet_name) ? 0 : passStringToWasm0(wallet_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1079
+ getWallet(label) {
1080
+ var ptr0 = isLikeNone(label) ? 0 : passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1081
1081
  var len0 = WASM_VECTOR_LEN;
1082
1082
  const ret = wasm.passkey_getWallet(this.__wbg_ptr, ptr0, len0);
1083
1083
  return ret;
1084
1084
  }
1085
1085
  /**
1086
- * Check if passkey PRF is available on this device.
1087
- * @returns {Promise<boolean>}
1088
- */
1089
- isAvailable() {
1090
- const ret = wasm.passkey_isAvailable(this.__wbg_ptr);
1091
- return ret;
1092
- }
1093
- /**
1094
- * List all wallet names published to Nostr for this passkey's identity.
1086
+ * List all labels published to Nostr for this passkey's identity.
1095
1087
  *
1096
1088
  * Requires 1 PRF call (for Nostr identity derivation).
1097
1089
  * @returns {Promise<string[]>}
1098
1090
  */
1099
- listWalletNames() {
1100
- const ret = wasm.passkey_listWalletNames(this.__wbg_ptr);
1091
+ listLabels() {
1092
+ const ret = wasm.passkey_listLabels(this.__wbg_ptr);
1101
1093
  return ret;
1102
1094
  }
1103
1095
  /**
1104
- * Publish a wallet name to Nostr relays for this passkey's identity.
1096
+ * Publish a label to Nostr relays for this passkey's identity.
1105
1097
  *
1106
- * Idempotent: if the wallet name already exists, it is not published again.
1098
+ * Idempotent: if the label already exists, it is not published again.
1107
1099
  * Requires 1 PRF call.
1108
- * @param {string} wallet_name
1100
+ * @param {string} label
1109
1101
  * @returns {Promise<void>}
1110
1102
  */
1111
- storeWalletName(wallet_name) {
1112
- const ptr0 = passStringToWasm0(wallet_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1103
+ storeLabel(label) {
1104
+ const ptr0 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1113
1105
  const len0 = WASM_VECTOR_LEN;
1114
- const ret = wasm.passkey_storeWalletName(this.__wbg_ptr, ptr0, len0);
1106
+ const ret = wasm.passkey_storeLabel(this.__wbg_ptr, ptr0, len0);
1107
+ return ret;
1108
+ }
1109
+ /**
1110
+ * Check if passkey PRF is available on this device.
1111
+ * @returns {Promise<boolean>}
1112
+ */
1113
+ isAvailable() {
1114
+ const ret = wasm.passkey_isAvailable(this.__wbg_ptr);
1115
1115
  return ret;
1116
1116
  }
1117
1117
  /**
@@ -2078,7 +2078,7 @@ function __wbg_get_imports() {
2078
2078
  const a = state0.a;
2079
2079
  state0.a = 0;
2080
2080
  try {
2081
- return __wbg_adapter_339(a, state0.b, arg0, arg1);
2081
+ return __wbg_adapter_373(a, state0.b, arg0, arg1);
2082
2082
  } finally {
2083
2083
  state0.a = a;
2084
2084
  }
@@ -2593,24 +2593,24 @@ function __wbg_get_imports() {
2593
2593
  const ret = false;
2594
2594
  return ret;
2595
2595
  };
2596
- imports.wbg.__wbindgen_closure_wrapper10362 = function(arg0, arg1, arg2) {
2597
- const ret = makeMutClosure(arg0, arg1, 441, __wbg_adapter_69);
2596
+ imports.wbg.__wbindgen_closure_wrapper10368 = function(arg0, arg1, arg2) {
2597
+ const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_69);
2598
2598
  return ret;
2599
2599
  };
2600
- imports.wbg.__wbindgen_closure_wrapper15774 = function(arg0, arg1, arg2) {
2601
- const ret = makeMutClosure(arg0, arg1, 441, __wbg_adapter_64);
2600
+ imports.wbg.__wbindgen_closure_wrapper15754 = function(arg0, arg1, arg2) {
2601
+ const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
2602
2602
  return ret;
2603
2603
  };
2604
- imports.wbg.__wbindgen_closure_wrapper5872 = function(arg0, arg1, arg2) {
2605
- const ret = makeMutClosure(arg0, arg1, 441, __wbg_adapter_64);
2604
+ imports.wbg.__wbindgen_closure_wrapper5890 = function(arg0, arg1, arg2) {
2605
+ const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
2606
2606
  return ret;
2607
2607
  };
2608
- imports.wbg.__wbindgen_closure_wrapper5878 = function(arg0, arg1, arg2) {
2609
- const ret = makeMutClosure(arg0, arg1, 441, __wbg_adapter_64);
2608
+ imports.wbg.__wbindgen_closure_wrapper5898 = function(arg0, arg1, arg2) {
2609
+ const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
2610
2610
  return ret;
2611
2611
  };
2612
- imports.wbg.__wbindgen_closure_wrapper7556 = function(arg0, arg1, arg2) {
2613
- const ret = makeMutClosure(arg0, arg1, 964, __wbg_adapter_69);
2612
+ imports.wbg.__wbindgen_closure_wrapper7595 = function(arg0, arg1, arg2) {
2613
+ const ret = makeMutClosure(arg0, arg1, 954, __wbg_adapter_69);
2614
2614
  return ret;
2615
2615
  };
2616
2616
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Binary file
@@ -76,9 +76,9 @@ export const getSparkStatus: () => any;
76
76
  export const initLogging: (a: any, b: number, c: number) => any;
77
77
  export const passkey_getWallet: (a: number, b: number, c: number) => any;
78
78
  export const passkey_isAvailable: (a: number) => any;
79
- export const passkey_listWalletNames: (a: number) => any;
79
+ export const passkey_listLabels: (a: number) => any;
80
80
  export const passkey_new: (a: any, b: number) => number;
81
- export const passkey_storeWalletName: (a: number, b: number, c: number) => any;
81
+ export const passkey_storeLabel: (a: number, b: number, c: number) => any;
82
82
  export const sdkbuilder_build: (a: number) => any;
83
83
  export const sdkbuilder_new: (a: any, b: any) => number;
84
84
  export const sdkbuilder_newWithSigner: (a: any, b: any) => number;
@@ -126,7 +126,7 @@ export const __wbindgen_export_5: WebAssembly.Table;
126
126
  export const __externref_drop_slice: (a: number, b: number) => void;
127
127
  export const __wbindgen_export_7: WebAssembly.Table;
128
128
  export const __externref_table_dealloc: (a: number) => void;
129
- export const closure440_externref_shim: (a: number, b: number, c: any) => void;
130
- export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h29e986a86553656d: (a: number, b: number) => void;
131
- export const closure720_externref_shim: (a: number, b: number, c: any, d: any) => void;
129
+ export const closure444_externref_shim: (a: number, b: number, c: any) => void;
130
+ export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1bbbe552b190da27: (a: number, b: number) => void;
131
+ export const closure711_externref_shim: (a: number, b: number, c: any, d: any) => void;
132
132
  export const __wbindgen_start: () => void;