@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
|
@@ -221,28 +221,37 @@ export function defaultPostgresStorageConfig(connection_string) {
|
|
|
221
221
|
return ret;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
/**
|
|
225
|
+
* Creates a default external signer from a mnemonic phrase.
|
|
226
|
+
*
|
|
227
|
+
* This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
|
|
228
|
+
* @returns {Promise<SparkStatus>}
|
|
229
|
+
*/
|
|
230
|
+
export function getSparkStatus() {
|
|
231
|
+
const ret = wasm.getSparkStatus();
|
|
232
|
+
return ret;
|
|
228
233
|
}
|
|
234
|
+
|
|
229
235
|
/**
|
|
230
|
-
* @param {
|
|
231
|
-
* @param {
|
|
232
|
-
* @param {
|
|
233
|
-
* @
|
|
234
|
-
* @returns {DefaultSigner}
|
|
236
|
+
* @param {Config} config
|
|
237
|
+
* @param {ExternalSigner} signer
|
|
238
|
+
* @param {string} storage_dir
|
|
239
|
+
* @returns {Promise<BreezSdk>}
|
|
235
240
|
*/
|
|
236
|
-
export function
|
|
237
|
-
const ptr0 = passStringToWasm0(
|
|
241
|
+
export function connectWithSigner(config, signer, storage_dir) {
|
|
242
|
+
const ptr0 = passStringToWasm0(storage_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
238
243
|
const len0 = WASM_VECTOR_LEN;
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
const ret = wasm.connectWithSigner(config, signer, ptr0, len0);
|
|
245
|
+
return ret;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @param {ConnectRequest} request
|
|
250
|
+
* @returns {Promise<BreezSdk>}
|
|
251
|
+
*/
|
|
252
|
+
export function connect(request) {
|
|
253
|
+
const ret = wasm.connect(request);
|
|
254
|
+
return ret;
|
|
246
255
|
}
|
|
247
256
|
|
|
248
257
|
/**
|
|
@@ -266,37 +275,28 @@ export function initLogging(logger, filter) {
|
|
|
266
275
|
return ret;
|
|
267
276
|
}
|
|
268
277
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
export function connect(request) {
|
|
274
|
-
const ret = wasm.connect(request);
|
|
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
|
-
export function getSparkStatus() {
|
|
285
|
-
const ret = wasm.getSparkStatus();
|
|
286
|
-
return ret;
|
|
278
|
+
function takeFromExternrefTable0(idx) {
|
|
279
|
+
const value = wasm.__wbindgen_export_5.get(idx);
|
|
280
|
+
wasm.__externref_table_dealloc(idx);
|
|
281
|
+
return value;
|
|
287
282
|
}
|
|
288
|
-
|
|
289
283
|
/**
|
|
290
|
-
* @param {
|
|
291
|
-
* @param {
|
|
292
|
-
* @param {
|
|
293
|
-
* @
|
|
284
|
+
* @param {string} mnemonic
|
|
285
|
+
* @param {string | null | undefined} passphrase
|
|
286
|
+
* @param {Network} network
|
|
287
|
+
* @param {KeySetConfig | null} [key_set_config]
|
|
288
|
+
* @returns {DefaultSigner}
|
|
294
289
|
*/
|
|
295
|
-
export function
|
|
296
|
-
const ptr0 = passStringToWasm0(
|
|
290
|
+
export function defaultExternalSigner(mnemonic, passphrase, network, key_set_config) {
|
|
291
|
+
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
297
292
|
const len0 = WASM_VECTOR_LEN;
|
|
298
|
-
|
|
299
|
-
|
|
293
|
+
var ptr1 = isLikeNone(passphrase) ? 0 : passStringToWasm0(passphrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
294
|
+
var len1 = WASM_VECTOR_LEN;
|
|
295
|
+
const ret = wasm.defaultExternalSigner(ptr0, len0, ptr1, len1, network, isLikeNone(key_set_config) ? 0 : addToExternrefTable0(key_set_config));
|
|
296
|
+
if (ret[2]) {
|
|
297
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
298
|
+
}
|
|
299
|
+
return DefaultSigner.__wrap(ret[0]);
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
function passArray8ToWasm0(arg, malloc) {
|
|
@@ -317,15 +317,15 @@ export function task_worker_entry_point(ptr) {
|
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
function __wbg_adapter_64(arg0, arg1, arg2) {
|
|
320
|
-
wasm.
|
|
320
|
+
wasm.closure444_externref_shim(arg0, arg1, arg2);
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
function __wbg_adapter_69(arg0, arg1) {
|
|
324
|
-
wasm.
|
|
324
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1bbbe552b190da27(arg0, arg1);
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
function
|
|
328
|
-
wasm.
|
|
327
|
+
function __wbg_adapter_373(arg0, arg1, arg2, arg3) {
|
|
328
|
+
wasm.closure711_externref_shim(arg0, arg1, arg2, arg3);
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
@@ -1043,7 +1043,7 @@ const PasskeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1043
1043
|
* Passkey-based wallet operations using WebAuthn PRF extension.
|
|
1044
1044
|
*
|
|
1045
1045
|
* Wraps a `PasskeyPrfProvider` and optional relay configuration to provide
|
|
1046
|
-
* wallet derivation and
|
|
1046
|
+
* wallet derivation and label management via Nostr relays.
|
|
1047
1047
|
*/
|
|
1048
1048
|
export class Passkey {
|
|
1049
1049
|
|
|
@@ -1059,50 +1059,50 @@ export class Passkey {
|
|
|
1059
1059
|
wasm.__wbg_passkey_free(ptr, 0);
|
|
1060
1060
|
}
|
|
1061
1061
|
/**
|
|
1062
|
-
* Derive a wallet for a given
|
|
1062
|
+
* Derive a wallet for a given label.
|
|
1063
1063
|
*
|
|
1064
|
-
* Uses the passkey PRF to derive a `Wallet` containing the seed and resolved
|
|
1064
|
+
* Uses the passkey PRF to derive a `Wallet` containing the seed and resolved label.
|
|
1065
1065
|
*
|
|
1066
|
-
* @param
|
|
1067
|
-
* @param {string | null} [
|
|
1066
|
+
* @param label - Optional label string (defaults to "Default")
|
|
1067
|
+
* @param {string | null} [label]
|
|
1068
1068
|
* @returns {Promise<Wallet>}
|
|
1069
1069
|
*/
|
|
1070
|
-
getWallet(
|
|
1071
|
-
var ptr0 = isLikeNone(
|
|
1070
|
+
getWallet(label) {
|
|
1071
|
+
var ptr0 = isLikeNone(label) ? 0 : passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1072
1072
|
var len0 = WASM_VECTOR_LEN;
|
|
1073
1073
|
const ret = wasm.passkey_getWallet(this.__wbg_ptr, ptr0, len0);
|
|
1074
1074
|
return ret;
|
|
1075
1075
|
}
|
|
1076
1076
|
/**
|
|
1077
|
-
*
|
|
1078
|
-
* @returns {Promise<boolean>}
|
|
1079
|
-
*/
|
|
1080
|
-
isAvailable() {
|
|
1081
|
-
const ret = wasm.passkey_isAvailable(this.__wbg_ptr);
|
|
1082
|
-
return ret;
|
|
1083
|
-
}
|
|
1084
|
-
/**
|
|
1085
|
-
* List all wallet names published to Nostr for this passkey's identity.
|
|
1077
|
+
* List all labels published to Nostr for this passkey's identity.
|
|
1086
1078
|
*
|
|
1087
1079
|
* Requires 1 PRF call (for Nostr identity derivation).
|
|
1088
1080
|
* @returns {Promise<string[]>}
|
|
1089
1081
|
*/
|
|
1090
|
-
|
|
1091
|
-
const ret = wasm.
|
|
1082
|
+
listLabels() {
|
|
1083
|
+
const ret = wasm.passkey_listLabels(this.__wbg_ptr);
|
|
1092
1084
|
return ret;
|
|
1093
1085
|
}
|
|
1094
1086
|
/**
|
|
1095
|
-
* Publish a
|
|
1087
|
+
* Publish a label to Nostr relays for this passkey's identity.
|
|
1096
1088
|
*
|
|
1097
|
-
* Idempotent: if the
|
|
1089
|
+
* Idempotent: if the label already exists, it is not published again.
|
|
1098
1090
|
* Requires 1 PRF call.
|
|
1099
|
-
* @param {string}
|
|
1091
|
+
* @param {string} label
|
|
1100
1092
|
* @returns {Promise<void>}
|
|
1101
1093
|
*/
|
|
1102
|
-
|
|
1103
|
-
const ptr0 = passStringToWasm0(
|
|
1094
|
+
storeLabel(label) {
|
|
1095
|
+
const ptr0 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1104
1096
|
const len0 = WASM_VECTOR_LEN;
|
|
1105
|
-
const ret = wasm.
|
|
1097
|
+
const ret = wasm.passkey_storeLabel(this.__wbg_ptr, ptr0, len0);
|
|
1098
|
+
return ret;
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* Check if passkey PRF is available on this device.
|
|
1102
|
+
* @returns {Promise<boolean>}
|
|
1103
|
+
*/
|
|
1104
|
+
isAvailable() {
|
|
1105
|
+
const ret = wasm.passkey_isAvailable(this.__wbg_ptr);
|
|
1106
1106
|
return ret;
|
|
1107
1107
|
}
|
|
1108
1108
|
/**
|
|
@@ -2037,7 +2037,7 @@ const imports = {
|
|
|
2037
2037
|
const a = state0.a;
|
|
2038
2038
|
state0.a = 0;
|
|
2039
2039
|
try {
|
|
2040
|
-
return
|
|
2040
|
+
return __wbg_adapter_373(a, state0.b, arg0, arg1);
|
|
2041
2041
|
} finally {
|
|
2042
2042
|
state0.a = a;
|
|
2043
2043
|
}
|
|
@@ -2552,24 +2552,24 @@ const imports = {
|
|
|
2552
2552
|
const ret = false;
|
|
2553
2553
|
return ret;
|
|
2554
2554
|
},
|
|
2555
|
-
|
|
2556
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2555
|
+
__wbindgen_closure_wrapper10368: function(arg0, arg1, arg2) {
|
|
2556
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_69);
|
|
2557
2557
|
return ret;
|
|
2558
2558
|
},
|
|
2559
|
-
|
|
2560
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2559
|
+
__wbindgen_closure_wrapper15754: function(arg0, arg1, arg2) {
|
|
2560
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
|
|
2561
2561
|
return ret;
|
|
2562
2562
|
},
|
|
2563
|
-
|
|
2564
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2563
|
+
__wbindgen_closure_wrapper5890: function(arg0, arg1, arg2) {
|
|
2564
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
|
|
2565
2565
|
return ret;
|
|
2566
2566
|
},
|
|
2567
|
-
|
|
2568
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2567
|
+
__wbindgen_closure_wrapper5898: function(arg0, arg1, arg2) {
|
|
2568
|
+
const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_64);
|
|
2569
2569
|
return ret;
|
|
2570
2570
|
},
|
|
2571
|
-
|
|
2572
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2571
|
+
__wbindgen_closure_wrapper7595: function(arg0, arg1, arg2) {
|
|
2572
|
+
const ret = makeMutClosure(arg0, arg1, 954, __wbg_adapter_69);
|
|
2573
2573
|
return ret;
|
|
2574
2574
|
},
|
|
2575
2575
|
__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
|
|
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;
|