@breeztech/breez-sdk-spark 0.7.2 → 0.7.4
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 +387 -360
- package/bundler/breez_sdk_spark_wasm_bg.js +72 -44
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/bundler/storage/index.js +8 -9
- package/deno/breez_sdk_spark_wasm.d.ts +387 -360
- package/deno/breez_sdk_spark_wasm.js +71 -44
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/nodejs/breez_sdk_spark_wasm.d.ts +387 -360
- package/nodejs/breez_sdk_spark_wasm.js +72 -44
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/nodejs/storage/index.cjs +15 -16
- package/nodejs/storage/migrations.cjs +6 -0
- package/package.json +1 -1
- package/web/breez_sdk_spark_wasm.d.ts +394 -365
- package/web/breez_sdk_spark_wasm.js +71 -44
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/web/storage/index.js +8 -9
|
@@ -305,11 +305,11 @@ function __wbg_adapter_64(arg0, arg1) {
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
function __wbg_adapter_67(arg0, arg1, arg2) {
|
|
308
|
-
wasm.
|
|
308
|
+
wasm.closure1052_externref_shim(arg0, arg1, arg2);
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
function
|
|
312
|
-
wasm.
|
|
311
|
+
function __wbg_adapter_353(arg0, arg1, arg2, arg3) {
|
|
312
|
+
wasm.closure637_externref_shim(arg0, arg1, arg2, arg3);
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
@@ -356,6 +356,14 @@ export class BreezSdk {
|
|
|
356
356
|
const ret = wasm.breezsdk_disconnect(this.__wbg_ptr);
|
|
357
357
|
return ret;
|
|
358
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* @param {LnurlAuthRequestDetails} request_data
|
|
361
|
+
* @returns {Promise<LnurlCallbackStatus>}
|
|
362
|
+
*/
|
|
363
|
+
lnurlAuth(request_data) {
|
|
364
|
+
const ret = wasm.breezsdk_lnurlAuth(this.__wbg_ptr, request_data);
|
|
365
|
+
return ret;
|
|
366
|
+
}
|
|
359
367
|
/**
|
|
360
368
|
* @param {GetPaymentRequest} request
|
|
361
369
|
* @returns {Promise<GetPaymentResponse>}
|
|
@@ -536,6 +544,14 @@ export class BreezSdk {
|
|
|
536
544
|
const ret = wasm.breezsdk_removeEventListener(this.__wbg_ptr, ptr0, len0);
|
|
537
545
|
return ret;
|
|
538
546
|
}
|
|
547
|
+
/**
|
|
548
|
+
* @param {FetchConversionLimitsRequest} request
|
|
549
|
+
* @returns {Promise<FetchConversionLimitsResponse>}
|
|
550
|
+
*/
|
|
551
|
+
fetchConversionLimits(request) {
|
|
552
|
+
const ret = wasm.breezsdk_fetchConversionLimits(this.__wbg_ptr, request);
|
|
553
|
+
return ret;
|
|
554
|
+
}
|
|
539
555
|
/**
|
|
540
556
|
* @param {ListUnclaimedDepositsRequest} request
|
|
541
557
|
* @returns {Promise<ListUnclaimedDepositsResponse>}
|
|
@@ -569,14 +585,6 @@ export class BreezSdk {
|
|
|
569
585
|
const ret = wasm.breezsdk_registerLightningAddress(this.__wbg_ptr, request);
|
|
570
586
|
return ret;
|
|
571
587
|
}
|
|
572
|
-
/**
|
|
573
|
-
* @param {FetchTokenConversionLimitsRequest} request
|
|
574
|
-
* @returns {Promise<FetchTokenConversionLimitsResponse>}
|
|
575
|
-
*/
|
|
576
|
-
fetchTokenConversionLimits(request) {
|
|
577
|
-
const ret = wasm.breezsdk_fetchTokenConversionLimits(this.__wbg_ptr, request);
|
|
578
|
-
return ret;
|
|
579
|
-
}
|
|
580
588
|
/**
|
|
581
589
|
* @returns {OptimizationProgress}
|
|
582
590
|
*/
|
|
@@ -649,16 +657,14 @@ export class DefaultSigner {
|
|
|
649
657
|
wasm.__wbg_defaultsigner_free(ptr, 0);
|
|
650
658
|
}
|
|
651
659
|
/**
|
|
652
|
-
* @param {
|
|
660
|
+
* @param {MessageBytes} message
|
|
653
661
|
* @param {string} path
|
|
654
662
|
* @returns {Promise<EcdsaSignatureBytes>}
|
|
655
663
|
*/
|
|
656
664
|
signEcdsa(message, path) {
|
|
657
|
-
const ptr0 =
|
|
665
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
658
666
|
const len0 = WASM_VECTOR_LEN;
|
|
659
|
-
const
|
|
660
|
-
const len1 = WASM_VECTOR_LEN;
|
|
661
|
-
const ret = wasm.defaultsigner_signEcdsa(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
667
|
+
const ret = wasm.defaultsigner_signEcdsa(this.__wbg_ptr, message, ptr0, len0);
|
|
662
668
|
return ret;
|
|
663
669
|
}
|
|
664
670
|
/**
|
|
@@ -669,6 +675,19 @@ export class DefaultSigner {
|
|
|
669
675
|
const ret = wasm.defaultsigner_signFrost(this.__wbg_ptr, request);
|
|
670
676
|
return ret;
|
|
671
677
|
}
|
|
678
|
+
/**
|
|
679
|
+
* @param {Uint8Array} message
|
|
680
|
+
* @param {string} path
|
|
681
|
+
* @returns {Promise<HashedMessageBytes>}
|
|
682
|
+
*/
|
|
683
|
+
hmacSha256(message, path) {
|
|
684
|
+
const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
|
|
685
|
+
const len0 = WASM_VECTOR_LEN;
|
|
686
|
+
const ptr1 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
687
|
+
const len1 = WASM_VECTOR_LEN;
|
|
688
|
+
const ret = wasm.defaultsigner_hmacSha256(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
689
|
+
return ret;
|
|
690
|
+
}
|
|
672
691
|
/**
|
|
673
692
|
* @param {Uint8Array} message
|
|
674
693
|
* @param {string} path
|
|
@@ -753,16 +772,14 @@ export class DefaultSigner {
|
|
|
753
772
|
return ret;
|
|
754
773
|
}
|
|
755
774
|
/**
|
|
756
|
-
* @param {
|
|
775
|
+
* @param {MessageBytes} message
|
|
757
776
|
* @param {string} path
|
|
758
777
|
* @returns {Promise<RecoverableEcdsaSignatureBytes>}
|
|
759
778
|
*/
|
|
760
779
|
signEcdsaRecoverable(message, path) {
|
|
761
|
-
const ptr0 =
|
|
780
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
762
781
|
const len0 = WASM_VECTOR_LEN;
|
|
763
|
-
const
|
|
764
|
-
const len1 = WASM_VECTOR_LEN;
|
|
765
|
-
const ret = wasm.defaultsigner_signEcdsaRecoverable(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
782
|
+
const ret = wasm.defaultsigner_signEcdsaRecoverable(this.__wbg_ptr, message, ptr0, len0);
|
|
766
783
|
return ret;
|
|
767
784
|
}
|
|
768
785
|
/**
|
|
@@ -1598,6 +1615,20 @@ function __wbg_get_imports() {
|
|
|
1598
1615
|
const ret = arg0.headers;
|
|
1599
1616
|
return ret;
|
|
1600
1617
|
};
|
|
1618
|
+
imports.wbg.__wbg_hmacSha256_c6633de6089f686f = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1619
|
+
let deferred1_0;
|
|
1620
|
+
let deferred1_1;
|
|
1621
|
+
try {
|
|
1622
|
+
var v0 = getArrayU8FromWasm0(arg1, arg2).slice();
|
|
1623
|
+
wasm.__wbindgen_free(arg1, arg2 * 1, 1);
|
|
1624
|
+
deferred1_0 = arg3;
|
|
1625
|
+
deferred1_1 = arg4;
|
|
1626
|
+
const ret = arg0.hmacSha256(v0, getStringFromWasm0(arg3, arg4));
|
|
1627
|
+
return ret;
|
|
1628
|
+
} finally {
|
|
1629
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1630
|
+
}
|
|
1631
|
+
}, arguments) };
|
|
1601
1632
|
imports.wbg.__wbg_identityPublicKey_c8b35005055a3df0 = function() { return handleError(function (arg0) {
|
|
1602
1633
|
const ret = arg0.identityPublicKey();
|
|
1603
1634
|
return ret;
|
|
@@ -1744,7 +1775,7 @@ function __wbg_get_imports() {
|
|
|
1744
1775
|
const a = state0.a;
|
|
1745
1776
|
state0.a = 0;
|
|
1746
1777
|
try {
|
|
1747
|
-
return
|
|
1778
|
+
return __wbg_adapter_353(a, state0.b, arg0, arg1);
|
|
1748
1779
|
} finally {
|
|
1749
1780
|
state0.a = a;
|
|
1750
1781
|
}
|
|
@@ -1978,32 +2009,28 @@ function __wbg_get_imports() {
|
|
|
1978
2009
|
imports.wbg.__wbg_setsignal_75b21ef3a81de905 = function(arg0, arg1) {
|
|
1979
2010
|
arg0.signal = arg1;
|
|
1980
2011
|
};
|
|
1981
|
-
imports.wbg.
|
|
1982
|
-
let
|
|
1983
|
-
let
|
|
2012
|
+
imports.wbg.__wbg_signEcdsaRecoverable_756dd79f08e5ed39 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2013
|
+
let deferred0_0;
|
|
2014
|
+
let deferred0_1;
|
|
1984
2015
|
try {
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
deferred1_1 = arg4;
|
|
1989
|
-
const ret = arg0.signEcdsaRecoverable(v0, getStringFromWasm0(arg3, arg4));
|
|
2016
|
+
deferred0_0 = arg2;
|
|
2017
|
+
deferred0_1 = arg3;
|
|
2018
|
+
const ret = arg0.signEcdsaRecoverable(arg1, getStringFromWasm0(arg2, arg3));
|
|
1990
2019
|
return ret;
|
|
1991
2020
|
} finally {
|
|
1992
|
-
wasm.__wbindgen_free(
|
|
2021
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1993
2022
|
}
|
|
1994
2023
|
}, arguments) };
|
|
1995
|
-
imports.wbg.
|
|
1996
|
-
let
|
|
1997
|
-
let
|
|
2024
|
+
imports.wbg.__wbg_signEcdsa_0ebea9dfc3b7c28f = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2025
|
+
let deferred0_0;
|
|
2026
|
+
let deferred0_1;
|
|
1998
2027
|
try {
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
deferred1_1 = arg4;
|
|
2003
|
-
const ret = arg0.signEcdsa(v0, getStringFromWasm0(arg3, arg4));
|
|
2028
|
+
deferred0_0 = arg2;
|
|
2029
|
+
deferred0_1 = arg3;
|
|
2030
|
+
const ret = arg0.signEcdsa(arg1, getStringFromWasm0(arg2, arg3));
|
|
2004
2031
|
return ret;
|
|
2005
2032
|
} finally {
|
|
2006
|
-
wasm.__wbindgen_free(
|
|
2033
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
2007
2034
|
}
|
|
2008
2035
|
}, arguments) };
|
|
2009
2036
|
imports.wbg.__wbg_signFrost_06ac652135c4e862 = function() { return handleError(function (arg0, arg1) {
|
|
@@ -2196,12 +2223,12 @@ function __wbg_get_imports() {
|
|
|
2196
2223
|
const ret = false;
|
|
2197
2224
|
return ret;
|
|
2198
2225
|
};
|
|
2199
|
-
imports.wbg.
|
|
2200
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2226
|
+
imports.wbg.__wbindgen_closure_wrapper11278 = function(arg0, arg1, arg2) {
|
|
2227
|
+
const ret = makeMutClosure(arg0, arg1, 817, __wbg_adapter_64);
|
|
2201
2228
|
return ret;
|
|
2202
2229
|
};
|
|
2203
|
-
imports.wbg.
|
|
2204
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2230
|
+
imports.wbg.__wbindgen_closure_wrapper13182 = function(arg0, arg1, arg2) {
|
|
2231
|
+
const ret = makeMutClosure(arg0, arg1, 1053, __wbg_adapter_67);
|
|
2205
2232
|
return ret;
|
|
2206
2233
|
};
|
|
2207
2234
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
Binary file
|
|
@@ -13,7 +13,7 @@ export const breezsdk_claimDeposit: (a: number, b: any) => any;
|
|
|
13
13
|
export const breezsdk_claimHtlcPayment: (a: number, b: any) => any;
|
|
14
14
|
export const breezsdk_deleteLightningAddress: (a: number) => any;
|
|
15
15
|
export const breezsdk_disconnect: (a: number) => any;
|
|
16
|
-
export const
|
|
16
|
+
export const breezsdk_fetchConversionLimits: (a: number, b: any) => any;
|
|
17
17
|
export const breezsdk_getInfo: (a: number, b: any) => any;
|
|
18
18
|
export const breezsdk_getLeafOptimizationProgress: (a: number) => any;
|
|
19
19
|
export const breezsdk_getLightningAddress: (a: number) => any;
|
|
@@ -25,6 +25,7 @@ export const breezsdk_listFiatCurrencies: (a: number) => any;
|
|
|
25
25
|
export const breezsdk_listFiatRates: (a: number) => any;
|
|
26
26
|
export const breezsdk_listPayments: (a: number, b: any) => any;
|
|
27
27
|
export const breezsdk_listUnclaimedDeposits: (a: number, b: any) => any;
|
|
28
|
+
export const breezsdk_lnurlAuth: (a: number, b: any) => any;
|
|
28
29
|
export const breezsdk_lnurlPay: (a: number, b: any) => any;
|
|
29
30
|
export const breezsdk_lnurlWithdraw: (a: number, b: any) => any;
|
|
30
31
|
export const breezsdk_parse: (a: number, b: number, c: number) => any;
|
|
@@ -56,9 +57,10 @@ export const defaultsigner_getPublicKeyFromPrivateKeySource: (a: number, b: any)
|
|
|
56
57
|
export const defaultsigner_getStaticDepositPrivateKey: (a: number, b: number) => any;
|
|
57
58
|
export const defaultsigner_getStaticDepositPrivateKeySource: (a: number, b: number) => any;
|
|
58
59
|
export const defaultsigner_getStaticDepositPublicKey: (a: number, b: number) => any;
|
|
60
|
+
export const defaultsigner_hmacSha256: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
59
61
|
export const defaultsigner_identityPublicKey: (a: number) => [number, number, number];
|
|
60
|
-
export const defaultsigner_signEcdsa: (a: number, b:
|
|
61
|
-
export const defaultsigner_signEcdsaRecoverable: (a: number, b:
|
|
62
|
+
export const defaultsigner_signEcdsa: (a: number, b: any, c: number, d: number) => any;
|
|
63
|
+
export const defaultsigner_signEcdsaRecoverable: (a: number, b: any, c: number, d: number) => any;
|
|
62
64
|
export const defaultsigner_signFrost: (a: number, b: any) => any;
|
|
63
65
|
export const defaultsigner_signHashSchnorr: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
64
66
|
export const defaultsigner_splitSecretWithProofs: (a: number, b: any, c: number, d: number) => any;
|
|
@@ -110,6 +112,6 @@ export const __externref_drop_slice: (a: number, b: number) => void;
|
|
|
110
112
|
export const __wbindgen_export_7: WebAssembly.Table;
|
|
111
113
|
export const __externref_table_dealloc: (a: number) => void;
|
|
112
114
|
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hdf0ebd5238280272: (a: number, b: number) => void;
|
|
113
|
-
export const
|
|
114
|
-
export const
|
|
115
|
+
export const closure1052_externref_shim: (a: number, b: number, c: any) => void;
|
|
116
|
+
export const closure637_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
115
117
|
export const __wbindgen_start: () => void;
|
package/web/storage/index.js
CHANGED
|
@@ -686,8 +686,8 @@ class IndexedDBStorage {
|
|
|
686
686
|
? JSON.stringify(metadata.lnurlWithdrawInfo)
|
|
687
687
|
: null,
|
|
688
688
|
lnurlDescription: metadata.lnurlDescription,
|
|
689
|
-
|
|
690
|
-
? JSON.stringify(metadata.
|
|
689
|
+
conversionInfo: metadata.conversionInfo
|
|
690
|
+
? JSON.stringify(metadata.conversionInfo)
|
|
691
691
|
: null,
|
|
692
692
|
};
|
|
693
693
|
|
|
@@ -1546,15 +1546,14 @@ class IndexedDBStorage {
|
|
|
1546
1546
|
) {
|
|
1547
1547
|
if (
|
|
1548
1548
|
details.type !== paymentDetailsFilter.type ||
|
|
1549
|
-
!details.
|
|
1549
|
+
!details.conversionInfo
|
|
1550
1550
|
) {
|
|
1551
1551
|
continue;
|
|
1552
1552
|
}
|
|
1553
1553
|
|
|
1554
1554
|
if (
|
|
1555
|
-
details.tokenConversionInfo.paymentId ||
|
|
1556
1555
|
paymentDetailsFilter.conversionRefundNeeded ===
|
|
1557
|
-
|
|
1556
|
+
(details.conversionInfo.status !== "refundNeeded")
|
|
1558
1557
|
) {
|
|
1559
1558
|
continue;
|
|
1560
1559
|
}
|
|
@@ -1679,13 +1678,13 @@ class IndexedDBStorage {
|
|
|
1679
1678
|
}
|
|
1680
1679
|
}
|
|
1681
1680
|
} else if (details.type == "spark" || details.type == "token") {
|
|
1682
|
-
// If
|
|
1683
|
-
if (metadata.
|
|
1681
|
+
// If conversionInfo exists, parse and add to details
|
|
1682
|
+
if (metadata.conversionInfo) {
|
|
1684
1683
|
try {
|
|
1685
|
-
details.
|
|
1684
|
+
details.conversionInfo = JSON.parse(metadata.conversionInfo);
|
|
1686
1685
|
} catch (e) {
|
|
1687
1686
|
throw new StorageError(
|
|
1688
|
-
`Failed to parse
|
|
1687
|
+
`Failed to parse conversionInfo JSON for payment ${payment.id}: ${e.message}`,
|
|
1689
1688
|
e
|
|
1690
1689
|
);
|
|
1691
1690
|
}
|