@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.
- package/breez-sdk-spark.tgz +0 -0
- package/bundler/breez_sdk_spark_wasm.d.ts +621 -621
- package/bundler/breez_sdk_spark_wasm_bg.js +84 -84
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -5
- package/deno/breez_sdk_spark_wasm.d.ts +621 -621
- package/deno/breez_sdk_spark_wasm.js +84 -84
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -5
- package/nodejs/breez_sdk_spark_wasm.d.ts +621 -621
- package/nodejs/breez_sdk_spark_wasm.js +86 -86
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -5
- package/package.json +1 -1
- package/web/breez_sdk_spark_wasm.d.ts +626 -626
- package/web/breez_sdk_spark_wasm.js +84 -84
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -5
|
@@ -238,28 +238,37 @@ export function defaultPostgresStorageConfig(connection_string) {
|
|
|
238
238
|
return ret;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
241
|
+
/**
|
|
242
|
+
* Creates a default external signer from a mnemonic phrase.
|
|
243
|
+
*
|
|
244
|
+
* This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
|
|
245
|
+
* @returns {Promise<SparkStatus>}
|
|
246
|
+
*/
|
|
247
|
+
export function getSparkStatus() {
|
|
248
|
+
const ret = wasm.getSparkStatus();
|
|
249
|
+
return ret;
|
|
245
250
|
}
|
|
251
|
+
|
|
246
252
|
/**
|
|
247
|
-
* @param {
|
|
248
|
-
* @param {
|
|
249
|
-
* @param {
|
|
250
|
-
* @
|
|
251
|
-
* @returns {DefaultSigner}
|
|
253
|
+
* @param {Config} config
|
|
254
|
+
* @param {ExternalSigner} signer
|
|
255
|
+
* @param {string} storage_dir
|
|
256
|
+
* @returns {Promise<BreezSdk>}
|
|
252
257
|
*/
|
|
253
|
-
export function
|
|
254
|
-
const ptr0 = passStringToWasm0(
|
|
258
|
+
export function connectWithSigner(config, signer, storage_dir) {
|
|
259
|
+
const ptr0 = passStringToWasm0(storage_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
255
260
|
const len0 = WASM_VECTOR_LEN;
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
const ret = wasm.connectWithSigner(config, signer, ptr0, len0);
|
|
262
|
+
return ret;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* @param {ConnectRequest} request
|
|
267
|
+
* @returns {Promise<BreezSdk>}
|
|
268
|
+
*/
|
|
269
|
+
export function connect(request) {
|
|
270
|
+
const ret = wasm.connect(request);
|
|
271
|
+
return ret;
|
|
263
272
|
}
|
|
264
273
|
|
|
265
274
|
/**
|
|
@@ -283,37 +292,28 @@ export function initLogging(logger, filter) {
|
|
|
283
292
|
return ret;
|
|
284
293
|
}
|
|
285
294
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
export function connect(request) {
|
|
291
|
-
const ret = wasm.connect(request);
|
|
292
|
-
return ret;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Creates a default external signer from a mnemonic phrase.
|
|
297
|
-
*
|
|
298
|
-
* This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
|
|
299
|
-
* @returns {Promise<SparkStatus>}
|
|
300
|
-
*/
|
|
301
|
-
export function getSparkStatus() {
|
|
302
|
-
const ret = wasm.getSparkStatus();
|
|
303
|
-
return ret;
|
|
295
|
+
function takeFromExternrefTable0(idx) {
|
|
296
|
+
const value = wasm.__wbindgen_export_5.get(idx);
|
|
297
|
+
wasm.__externref_table_dealloc(idx);
|
|
298
|
+
return value;
|
|
304
299
|
}
|
|
305
|
-
|
|
306
300
|
/**
|
|
307
|
-
* @param {
|
|
308
|
-
* @param {
|
|
309
|
-
* @param {
|
|
310
|
-
* @
|
|
301
|
+
* @param {string} mnemonic
|
|
302
|
+
* @param {string | null | undefined} passphrase
|
|
303
|
+
* @param {Network} network
|
|
304
|
+
* @param {KeySetConfig | null} [key_set_config]
|
|
305
|
+
* @returns {DefaultSigner}
|
|
311
306
|
*/
|
|
312
|
-
export function
|
|
313
|
-
const ptr0 = passStringToWasm0(
|
|
307
|
+
export function defaultExternalSigner(mnemonic, passphrase, network, key_set_config) {
|
|
308
|
+
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
314
309
|
const len0 = WASM_VECTOR_LEN;
|
|
315
|
-
|
|
316
|
-
|
|
310
|
+
var ptr1 = isLikeNone(passphrase) ? 0 : passStringToWasm0(passphrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
311
|
+
var len1 = WASM_VECTOR_LEN;
|
|
312
|
+
const ret = wasm.defaultExternalSigner(ptr0, len0, ptr1, len1, network, isLikeNone(key_set_config) ? 0 : addToExternrefTable0(key_set_config));
|
|
313
|
+
if (ret[2]) {
|
|
314
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
315
|
+
}
|
|
316
|
+
return DefaultSigner.__wrap(ret[0]);
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
function passArray8ToWasm0(arg, malloc) {
|
|
@@ -334,15 +334,15 @@ export function task_worker_entry_point(ptr) {
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
function __wbg_adapter_64(arg0, arg1, arg2) {
|
|
337
|
-
wasm.
|
|
337
|
+
wasm.closure444_externref_shim(arg0, arg1, arg2);
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
function __wbg_adapter_69(arg0, arg1) {
|
|
341
|
-
wasm.
|
|
341
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1bbbe552b190da27(arg0, arg1);
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
function
|
|
345
|
-
wasm.
|
|
344
|
+
function __wbg_adapter_373(arg0, arg1, arg2, arg3) {
|
|
345
|
+
wasm.closure711_externref_shim(arg0, arg1, arg2, arg3);
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
@@ -1060,7 +1060,7 @@ const PasskeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1060
1060
|
* Passkey-based wallet operations using WebAuthn PRF extension.
|
|
1061
1061
|
*
|
|
1062
1062
|
* Wraps a `PasskeyPrfProvider` and optional relay configuration to provide
|
|
1063
|
-
* wallet derivation and
|
|
1063
|
+
* wallet derivation and label management via Nostr relays.
|
|
1064
1064
|
*/
|
|
1065
1065
|
export class Passkey {
|
|
1066
1066
|
|
|
@@ -1076,50 +1076,50 @@ export class Passkey {
|
|
|
1076
1076
|
wasm.__wbg_passkey_free(ptr, 0);
|
|
1077
1077
|
}
|
|
1078
1078
|
/**
|
|
1079
|
-
* Derive a wallet for a given
|
|
1079
|
+
* Derive a wallet for a given label.
|
|
1080
1080
|
*
|
|
1081
|
-
* Uses the passkey PRF to derive a `Wallet` containing the seed and resolved
|
|
1081
|
+
* Uses the passkey PRF to derive a `Wallet` containing the seed and resolved label.
|
|
1082
1082
|
*
|
|
1083
|
-
* @param
|
|
1084
|
-
* @param {string | null} [
|
|
1083
|
+
* @param label - Optional label string (defaults to "Default")
|
|
1084
|
+
* @param {string | null} [label]
|
|
1085
1085
|
* @returns {Promise<Wallet>}
|
|
1086
1086
|
*/
|
|
1087
|
-
getWallet(
|
|
1088
|
-
var ptr0 = isLikeNone(
|
|
1087
|
+
getWallet(label) {
|
|
1088
|
+
var ptr0 = isLikeNone(label) ? 0 : passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1089
1089
|
var len0 = WASM_VECTOR_LEN;
|
|
1090
1090
|
const ret = wasm.passkey_getWallet(this.__wbg_ptr, ptr0, len0);
|
|
1091
1091
|
return ret;
|
|
1092
1092
|
}
|
|
1093
1093
|
/**
|
|
1094
|
-
*
|
|
1095
|
-
* @returns {Promise<boolean>}
|
|
1096
|
-
*/
|
|
1097
|
-
isAvailable() {
|
|
1098
|
-
const ret = wasm.passkey_isAvailable(this.__wbg_ptr);
|
|
1099
|
-
return ret;
|
|
1100
|
-
}
|
|
1101
|
-
/**
|
|
1102
|
-
* List all wallet names published to Nostr for this passkey's identity.
|
|
1094
|
+
* List all labels published to Nostr for this passkey's identity.
|
|
1103
1095
|
*
|
|
1104
1096
|
* Requires 1 PRF call (for Nostr identity derivation).
|
|
1105
1097
|
* @returns {Promise<string[]>}
|
|
1106
1098
|
*/
|
|
1107
|
-
|
|
1108
|
-
const ret = wasm.
|
|
1099
|
+
listLabels() {
|
|
1100
|
+
const ret = wasm.passkey_listLabels(this.__wbg_ptr);
|
|
1109
1101
|
return ret;
|
|
1110
1102
|
}
|
|
1111
1103
|
/**
|
|
1112
|
-
* Publish a
|
|
1104
|
+
* Publish a label to Nostr relays for this passkey's identity.
|
|
1113
1105
|
*
|
|
1114
|
-
* Idempotent: if the
|
|
1106
|
+
* Idempotent: if the label already exists, it is not published again.
|
|
1115
1107
|
* Requires 1 PRF call.
|
|
1116
|
-
* @param {string}
|
|
1108
|
+
* @param {string} label
|
|
1117
1109
|
* @returns {Promise<void>}
|
|
1118
1110
|
*/
|
|
1119
|
-
|
|
1120
|
-
const ptr0 = passStringToWasm0(
|
|
1111
|
+
storeLabel(label) {
|
|
1112
|
+
const ptr0 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1121
1113
|
const len0 = WASM_VECTOR_LEN;
|
|
1122
|
-
const ret = wasm.
|
|
1114
|
+
const ret = wasm.passkey_storeLabel(this.__wbg_ptr, ptr0, len0);
|
|
1115
|
+
return ret;
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Check if passkey PRF is available on this device.
|
|
1119
|
+
* @returns {Promise<boolean>}
|
|
1120
|
+
*/
|
|
1121
|
+
isAvailable() {
|
|
1122
|
+
const ret = wasm.passkey_isAvailable(this.__wbg_ptr);
|
|
1123
1123
|
return ret;
|
|
1124
1124
|
}
|
|
1125
1125
|
/**
|
|
@@ -2162,7 +2162,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
|
|
|
2162
2162
|
const a = state0.a;
|
|
2163
2163
|
state0.a = 0;
|
|
2164
2164
|
try {
|
|
2165
|
-
return
|
|
2165
|
+
return __wbg_adapter_373(a, state0.b, arg0, arg1);
|
|
2166
2166
|
} finally {
|
|
2167
2167
|
state0.a = a;
|
|
2168
2168
|
}
|
|
@@ -2787,28 +2787,28 @@ export function __wbindgen_cb_drop(arg0) {
|
|
|
2787
2787
|
return ret;
|
|
2788
2788
|
};
|
|
2789
2789
|
|
|
2790
|
-
export function
|
|
2791
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2790
|
+
export function __wbindgen_closure_wrapper10368(arg0, arg1, arg2) {
|
|
2791
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_69);
|
|
2792
2792
|
return ret;
|
|
2793
2793
|
};
|
|
2794
2794
|
|
|
2795
|
-
export function
|
|
2796
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2795
|
+
export function __wbindgen_closure_wrapper15754(arg0, arg1, arg2) {
|
|
2796
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
|
|
2797
2797
|
return ret;
|
|
2798
2798
|
};
|
|
2799
2799
|
|
|
2800
|
-
export function
|
|
2801
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2800
|
+
export function __wbindgen_closure_wrapper5890(arg0, arg1, arg2) {
|
|
2801
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
|
|
2802
2802
|
return ret;
|
|
2803
2803
|
};
|
|
2804
2804
|
|
|
2805
|
-
export function
|
|
2806
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2805
|
+
export function __wbindgen_closure_wrapper5898(arg0, arg1, arg2) {
|
|
2806
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
|
|
2807
2807
|
return ret;
|
|
2808
2808
|
};
|
|
2809
2809
|
|
|
2810
|
-
export function
|
|
2811
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2810
|
+
export function __wbindgen_closure_wrapper7595(arg0, arg1, arg2) {
|
|
2811
|
+
const ret = makeMutClosure(arg0, arg1, 954, __wbg_adapter_69);
|
|
2812
2812
|
return ret;
|
|
2813
2813
|
};
|
|
2814
2814
|
|
|
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
|
|
79
|
+
export const passkey_listLabels: (a: number) => any;
|
|
80
80
|
export const passkey_new: (a: any, b: number) => number;
|
|
81
|
-
export const
|
|
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
|
|
130
|
-
export const
|
|
131
|
-
export const
|
|
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;
|