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