@breeztech/breez-sdk-spark 0.3.2 → 0.3.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 +58 -29
- package/bundler/breez_sdk_spark_wasm_bg.js +32 -8
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -2
- package/bundler/storage/index.js +28 -16
- package/deno/breez_sdk_spark_wasm.d.ts +58 -29
- package/deno/breez_sdk_spark_wasm.js +32 -8
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -2
- package/nodejs/breez_sdk_spark_wasm.d.ts +58 -29
- package/nodejs/breez_sdk_spark_wasm.js +32 -8
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -2
- package/nodejs/storage/index.cjs +56 -5
- package/nodejs/storage/migrations.cjs +15 -0
- package/package.json +1 -1
- package/web/breez_sdk_spark_wasm.d.ts +63 -31
- package/web/breez_sdk_spark_wasm.js +32 -8
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -2
- package/web/storage/index.js +28 -16
package/breez-sdk-spark.tgz
CHANGED
|
Binary file
|
|
@@ -113,39 +113,24 @@ export interface ListUnclaimedDepositsResponse {
|
|
|
113
113
|
|
|
114
114
|
export type DepositClaimError = { type: "depositClaimFeeExceeded"; tx: string; vout: number; maxFee: Fee; actualFee: number } | { type: "missingUtxo"; tx: string; vout: number } | { type: "generic"; message: string };
|
|
115
115
|
|
|
116
|
-
export type InputType = ({ type: "bitcoinAddress" } & BitcoinAddressDetails) | ({ type: "bolt11Invoice" } & Bolt11InvoiceDetails) | ({ type: "bolt12Invoice" } & Bolt12InvoiceDetails) | ({ type: "bolt12Offer" } & Bolt12OfferDetails) | ({ type: "lightningAddress" } & LightningAddressDetails) | ({ type: "lnurlPay" } & LnurlPayRequestDetails) | ({ type: "silentPaymentAddress" } & SilentPaymentAddressDetails) | ({ type: "lnurlAuth" } & LnurlAuthRequestDetails) | ({ type: "url" } & string) | ({ type: "bip21" } & Bip21Details) | ({ type: "bolt12InvoiceRequest" } & Bolt12InvoiceRequestDetails) | ({ type: "lnurlWithdraw" } & LnurlWithdrawRequestDetails) | ({ type: "sparkAddress" } & SparkAddressDetails);
|
|
116
|
+
export type InputType = ({ type: "bitcoinAddress" } & BitcoinAddressDetails) | ({ type: "bolt11Invoice" } & Bolt11InvoiceDetails) | ({ type: "bolt12Invoice" } & Bolt12InvoiceDetails) | ({ type: "bolt12Offer" } & Bolt12OfferDetails) | ({ type: "lightningAddress" } & LightningAddressDetails) | ({ type: "lnurlPay" } & LnurlPayRequestDetails) | ({ type: "silentPaymentAddress" } & SilentPaymentAddressDetails) | ({ type: "lnurlAuth" } & LnurlAuthRequestDetails) | ({ type: "url" } & string) | ({ type: "bip21" } & Bip21Details) | ({ type: "bolt12InvoiceRequest" } & Bolt12InvoiceRequestDetails) | ({ type: "lnurlWithdraw" } & LnurlWithdrawRequestDetails) | ({ type: "sparkAddress" } & SparkAddressDetails) | ({ type: "sparkInvoice" } & SparkInvoiceDetails);
|
|
117
117
|
|
|
118
118
|
export interface SparkAddressDetails {
|
|
119
119
|
address: string;
|
|
120
|
-
|
|
120
|
+
identityPublicKey: string;
|
|
121
|
+
network: BitcoinNetwork;
|
|
121
122
|
source: PaymentRequestSource;
|
|
122
123
|
}
|
|
123
124
|
|
|
124
|
-
export interface
|
|
125
|
+
export interface SparkInvoiceDetails {
|
|
126
|
+
invoice: string;
|
|
125
127
|
identityPublicKey: string;
|
|
126
128
|
network: BitcoinNetwork;
|
|
127
|
-
sparkInvoiceFields?: SparkInvoiceFields;
|
|
128
|
-
signature?: string;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export interface SparkInvoiceFields {
|
|
132
|
-
id: string;
|
|
133
|
-
version: number;
|
|
134
|
-
memo?: string;
|
|
135
|
-
senderPublicKey?: string;
|
|
136
|
-
expiryTime?: number;
|
|
137
|
-
paymentType?: SparkAddressPaymentType;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export type SparkAddressPaymentType = ({ type: "tokensPayment" } & TokensPaymentDetails) | ({ type: "satsPayment" } & SatsPaymentDetails);
|
|
141
|
-
|
|
142
|
-
export interface TokensPaymentDetails {
|
|
143
|
-
tokenIdentifier?: string;
|
|
144
129
|
amount?: bigint;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
130
|
+
tokenIdentifier?: string;
|
|
131
|
+
expiryTime?: number;
|
|
132
|
+
description?: string;
|
|
133
|
+
senderPublicKey?: string;
|
|
149
134
|
}
|
|
150
135
|
|
|
151
136
|
export interface BitcoinAddressDetails {
|
|
@@ -298,7 +283,12 @@ export interface Payment {
|
|
|
298
283
|
details?: PaymentDetails;
|
|
299
284
|
}
|
|
300
285
|
|
|
301
|
-
export type PaymentDetails = { type: "spark" } | { type: "token"; metadata: TokenMetadata; txHash: string } | { type: "lightning"; description?: string; preimage?: string; invoice: string; paymentHash: string; destinationPubkey: string; lnurlPayInfo?: LnurlPayInfo } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
|
|
286
|
+
export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails } | { type: "token"; metadata: TokenMetadata; txHash: string; invoiceDetails?: SparkInvoicePaymentDetails } | { type: "lightning"; description?: string; preimage?: string; invoice: string; paymentHash: string; destinationPubkey: string; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
|
|
287
|
+
|
|
288
|
+
export interface SparkInvoicePaymentDetails {
|
|
289
|
+
description?: string;
|
|
290
|
+
invoice: string;
|
|
291
|
+
}
|
|
302
292
|
|
|
303
293
|
export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
|
|
304
294
|
|
|
@@ -338,6 +328,10 @@ export interface AesSuccessActionData {
|
|
|
338
328
|
iv: string;
|
|
339
329
|
}
|
|
340
330
|
|
|
331
|
+
export interface LnurlWithdrawInfo {
|
|
332
|
+
withdrawUrl: string;
|
|
333
|
+
}
|
|
334
|
+
|
|
341
335
|
export type Network = "mainnet" | "regtest";
|
|
342
336
|
|
|
343
337
|
export interface Config {
|
|
@@ -392,7 +386,7 @@ export interface SyncWalletRequest {}
|
|
|
392
386
|
|
|
393
387
|
export interface SyncWalletResponse {}
|
|
394
388
|
|
|
395
|
-
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "bitcoinAddress" } | { type: "bolt11Invoice"; description: string; amountSats?: number };
|
|
389
|
+
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: bigint; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress" } | { type: "bolt11Invoice"; description: string; amountSats?: number };
|
|
396
390
|
|
|
397
391
|
export interface SendOnchainFeeQuote {
|
|
398
392
|
id: string;
|
|
@@ -407,7 +401,7 @@ export interface SendOnchainSpeedFeeQuote {
|
|
|
407
401
|
l1BroadcastFeeSat: number;
|
|
408
402
|
}
|
|
409
403
|
|
|
410
|
-
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: bigint; tokenIdentifier?: string };
|
|
404
|
+
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: bigint; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: bigint; tokenIdentifier?: string };
|
|
411
405
|
|
|
412
406
|
export interface ReceivePaymentRequest {
|
|
413
407
|
paymentMethod: ReceivePaymentMethod;
|
|
@@ -415,7 +409,7 @@ export interface ReceivePaymentRequest {
|
|
|
415
409
|
|
|
416
410
|
export interface ReceivePaymentResponse {
|
|
417
411
|
paymentRequest: string;
|
|
418
|
-
|
|
412
|
+
fee: bigint;
|
|
419
413
|
}
|
|
420
414
|
|
|
421
415
|
export interface PrepareLnurlPayRequest {
|
|
@@ -443,6 +437,17 @@ export interface LnurlPayResponse {
|
|
|
443
437
|
successAction?: SuccessActionProcessed;
|
|
444
438
|
}
|
|
445
439
|
|
|
440
|
+
export interface LnurlWithdrawRequest {
|
|
441
|
+
amountSats: number;
|
|
442
|
+
withdrawRequest: LnurlWithdrawRequestDetails;
|
|
443
|
+
completionTimeoutSecs?: number;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export interface LnurlWithdrawResponse {
|
|
447
|
+
paymentRequest: string;
|
|
448
|
+
payment?: Payment;
|
|
449
|
+
}
|
|
450
|
+
|
|
446
451
|
export interface PrepareSendPaymentRequest {
|
|
447
452
|
paymentRequest: string;
|
|
448
453
|
amount?: bigint;
|
|
@@ -500,6 +505,7 @@ export interface LogEntry {
|
|
|
500
505
|
|
|
501
506
|
export interface PaymentMetadata {
|
|
502
507
|
lnurlPayInfo?: LnurlPayInfo;
|
|
508
|
+
lnurlWithdrawInfo?: LnurlWithdrawInfo;
|
|
503
509
|
lnurlDescription?: string;
|
|
504
510
|
}
|
|
505
511
|
|
|
@@ -591,7 +597,27 @@ export interface ProvisionalPayment {
|
|
|
591
597
|
details: ProvisionalPaymentDetails;
|
|
592
598
|
}
|
|
593
599
|
|
|
594
|
-
export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark";
|
|
600
|
+
export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
|
|
601
|
+
|
|
602
|
+
export interface SignMessageRequest {
|
|
603
|
+
message: string;
|
|
604
|
+
compact: boolean;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
export interface SignMessageResponse {
|
|
608
|
+
pubkey: string;
|
|
609
|
+
signature: string;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
export interface CheckMessageRequest {
|
|
613
|
+
message: string;
|
|
614
|
+
pubkey: string;
|
|
615
|
+
signature: string;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
export interface CheckMessageResponse {
|
|
619
|
+
isValid: boolean;
|
|
620
|
+
}
|
|
595
621
|
|
|
596
622
|
export interface Storage {
|
|
597
623
|
getCachedItem: (key: string) => Promise<string | null>;
|
|
@@ -620,6 +646,7 @@ export class BreezSdk {
|
|
|
620
646
|
prepareSendPayment(request: PrepareSendPaymentRequest): Promise<PrepareSendPaymentResponse>;
|
|
621
647
|
prepareLnurlPay(request: PrepareLnurlPayRequest): Promise<PrepareLnurlPayResponse>;
|
|
622
648
|
lnurlPay(request: LnurlPayRequest): Promise<LnurlPayResponse>;
|
|
649
|
+
lnurlWithdraw(request: LnurlWithdrawRequest): Promise<LnurlWithdrawResponse>;
|
|
623
650
|
sendPayment(request: SendPaymentRequest): Promise<SendPaymentResponse>;
|
|
624
651
|
syncWallet(request: SyncWalletRequest): Promise<SyncWalletResponse>;
|
|
625
652
|
listPayments(request: ListPaymentsRequest): Promise<ListPaymentsResponse>;
|
|
@@ -635,6 +662,8 @@ export class BreezSdk {
|
|
|
635
662
|
listFiatRates(): Promise<ListFiatRatesResponse>;
|
|
636
663
|
waitForPayment(request: WaitForPaymentRequest): Promise<WaitForPaymentResponse>;
|
|
637
664
|
getTokensMetadata(request: GetTokensMetadataRequest): Promise<GetTokensMetadataResponse>;
|
|
665
|
+
signMessage(request: SignMessageRequest): Promise<SignMessageResponse>;
|
|
666
|
+
checkMessage(request: CheckMessageRequest): Promise<CheckMessageResponse>;
|
|
638
667
|
}
|
|
639
668
|
export class IntoUnderlyingByteSource {
|
|
640
669
|
private constructor();
|
|
@@ -283,11 +283,11 @@ function __wbg_adapter_58(arg0, arg1) {
|
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
function __wbg_adapter_61(arg0, arg1, arg2) {
|
|
286
|
-
wasm.
|
|
286
|
+
wasm.closure883_externref_shim(arg0, arg1, arg2);
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
function
|
|
290
|
-
wasm.
|
|
289
|
+
function __wbg_adapter_225(arg0, arg1, arg2, arg3) {
|
|
290
|
+
wasm.closure488_externref_shim(arg0, arg1, arg2, arg3);
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
@@ -402,6 +402,14 @@ export class BreezSdk {
|
|
|
402
402
|
const ret = wasm.breezsdk_lnurlPay(this.__wbg_ptr, request);
|
|
403
403
|
return ret;
|
|
404
404
|
}
|
|
405
|
+
/**
|
|
406
|
+
* @param {LnurlWithdrawRequest} request
|
|
407
|
+
* @returns {Promise<LnurlWithdrawResponse>}
|
|
408
|
+
*/
|
|
409
|
+
lnurlWithdraw(request) {
|
|
410
|
+
const ret = wasm.breezsdk_lnurlWithdraw(this.__wbg_ptr, request);
|
|
411
|
+
return ret;
|
|
412
|
+
}
|
|
405
413
|
/**
|
|
406
414
|
* @param {SendPaymentRequest} request
|
|
407
415
|
* @returns {Promise<SendPaymentResponse>}
|
|
@@ -518,6 +526,22 @@ export class BreezSdk {
|
|
|
518
526
|
const ret = wasm.breezsdk_getTokensMetadata(this.__wbg_ptr, request);
|
|
519
527
|
return ret;
|
|
520
528
|
}
|
|
529
|
+
/**
|
|
530
|
+
* @param {SignMessageRequest} request
|
|
531
|
+
* @returns {Promise<SignMessageResponse>}
|
|
532
|
+
*/
|
|
533
|
+
signMessage(request) {
|
|
534
|
+
const ret = wasm.breezsdk_signMessage(this.__wbg_ptr, request);
|
|
535
|
+
return ret;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* @param {CheckMessageRequest} request
|
|
539
|
+
* @returns {Promise<CheckMessageResponse>}
|
|
540
|
+
*/
|
|
541
|
+
checkMessage(request) {
|
|
542
|
+
const ret = wasm.breezsdk_checkMessage(this.__wbg_ptr, request);
|
|
543
|
+
return ret;
|
|
544
|
+
}
|
|
521
545
|
}
|
|
522
546
|
|
|
523
547
|
const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -1225,7 +1249,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
|
|
|
1225
1249
|
const a = state0.a;
|
|
1226
1250
|
state0.a = 0;
|
|
1227
1251
|
try {
|
|
1228
|
-
return
|
|
1252
|
+
return __wbg_adapter_225(a, state0.b, arg0, arg1);
|
|
1229
1253
|
} finally {
|
|
1230
1254
|
state0.a = a;
|
|
1231
1255
|
}
|
|
@@ -1634,13 +1658,13 @@ export function __wbindgen_cb_drop(arg0) {
|
|
|
1634
1658
|
return ret;
|
|
1635
1659
|
};
|
|
1636
1660
|
|
|
1637
|
-
export function
|
|
1638
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1661
|
+
export function __wbindgen_closure_wrapper10406(arg0, arg1, arg2) {
|
|
1662
|
+
const ret = makeMutClosure(arg0, arg1, 884, __wbg_adapter_61);
|
|
1639
1663
|
return ret;
|
|
1640
1664
|
};
|
|
1641
1665
|
|
|
1642
|
-
export function
|
|
1643
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1666
|
+
export function __wbindgen_closure_wrapper8736(arg0, arg1, arg2) {
|
|
1667
|
+
const ret = makeMutClosure(arg0, arg1, 665, __wbg_adapter_58);
|
|
1644
1668
|
return ret;
|
|
1645
1669
|
};
|
|
1646
1670
|
|
|
Binary file
|
|
@@ -15,6 +15,7 @@ export const breezsdk_receivePayment: (a: number, b: any) => any;
|
|
|
15
15
|
export const breezsdk_prepareSendPayment: (a: number, b: any) => any;
|
|
16
16
|
export const breezsdk_prepareLnurlPay: (a: number, b: any) => any;
|
|
17
17
|
export const breezsdk_lnurlPay: (a: number, b: any) => any;
|
|
18
|
+
export const breezsdk_lnurlWithdraw: (a: number, b: any) => any;
|
|
18
19
|
export const breezsdk_sendPayment: (a: number, b: any) => any;
|
|
19
20
|
export const breezsdk_syncWallet: (a: number, b: any) => any;
|
|
20
21
|
export const breezsdk_listPayments: (a: number, b: any) => any;
|
|
@@ -30,6 +31,8 @@ export const breezsdk_listFiatCurrencies: (a: number) => any;
|
|
|
30
31
|
export const breezsdk_listFiatRates: (a: number) => any;
|
|
31
32
|
export const breezsdk_waitForPayment: (a: number, b: any) => any;
|
|
32
33
|
export const breezsdk_getTokensMetadata: (a: number, b: any) => any;
|
|
34
|
+
export const breezsdk_signMessage: (a: number, b: any) => any;
|
|
35
|
+
export const breezsdk_checkMessage: (a: number, b: any) => any;
|
|
33
36
|
export const __wbg_sdkbuilder_free: (a: number, b: number) => void;
|
|
34
37
|
export const sdkbuilder_new: (a: any, b: any, c: any) => [number, number, number];
|
|
35
38
|
export const sdkbuilder_withKeySet: (a: number, b: any, c: number, d: number) => number;
|
|
@@ -67,6 +70,6 @@ export const __externref_drop_slice: (a: number, b: number) => void;
|
|
|
67
70
|
export const __wbindgen_export_7: WebAssembly.Table;
|
|
68
71
|
export const __externref_table_dealloc: (a: number) => void;
|
|
69
72
|
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7a414ded2eae1947: (a: number, b: number) => void;
|
|
70
|
-
export const
|
|
71
|
-
export const
|
|
73
|
+
export const closure883_externref_shim: (a: number, b: number, c: any) => void;
|
|
74
|
+
export const closure488_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
72
75
|
export const __wbindgen_start: () => void;
|
package/bundler/storage/index.js
CHANGED
|
@@ -558,6 +558,9 @@ class IndexedDBStorage {
|
|
|
558
558
|
lnurlPayInfo: metadata.lnurlPayInfo
|
|
559
559
|
? JSON.stringify(metadata.lnurlPayInfo)
|
|
560
560
|
: null,
|
|
561
|
+
lnurlWithdrawInfo: metadata.lnurlWithdrawInfo
|
|
562
|
+
? JSON.stringify(metadata.lnurlWithdrawInfo)
|
|
563
|
+
: null,
|
|
561
564
|
lnurlDescription: metadata.lnurlDescription,
|
|
562
565
|
};
|
|
563
566
|
|
|
@@ -841,23 +844,32 @@ class IndexedDBStorage {
|
|
|
841
844
|
}
|
|
842
845
|
}
|
|
843
846
|
|
|
844
|
-
// If this is a Lightning payment and we have
|
|
845
|
-
if (
|
|
846
|
-
metadata &&
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
847
|
+
// If this is a Lightning payment and we have metadata
|
|
848
|
+
if (metadata && details && details.type == "lightning") {
|
|
849
|
+
if (metadata.lnurlDescription && !details.description) {
|
|
850
|
+
details.description = metadata.lnurlDescription;
|
|
851
|
+
}
|
|
852
|
+
// If lnurlPayInfo exists, parse and add to details
|
|
853
|
+
if (metadata.lnurlPayInfo) {
|
|
854
|
+
try {
|
|
855
|
+
details.lnurlPayInfo = JSON.parse(metadata.lnurlPayInfo);
|
|
856
|
+
} catch (e) {
|
|
857
|
+
throw new StorageError(
|
|
858
|
+
`Failed to parse lnurlPayInfo JSON for payment ${payment.id}: ${e.message}`,
|
|
859
|
+
e
|
|
860
|
+
);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
// If lnurlWithdrawInfo exists, parse and add to details
|
|
864
|
+
if (metadata.lnurlWithdrawInfo) {
|
|
865
|
+
try {
|
|
866
|
+
details.lnurlWithdrawInfo = JSON.parse(metadata.lnurlWithdrawInfo);
|
|
867
|
+
} catch (e) {
|
|
868
|
+
throw new StorageError(
|
|
869
|
+
`Failed to parse lnurlWithdrawInfo JSON for payment ${payment.id}: ${e.message}`,
|
|
870
|
+
e
|
|
871
|
+
);
|
|
855
872
|
}
|
|
856
|
-
} catch (e) {
|
|
857
|
-
throw new StorageError(
|
|
858
|
-
`Failed to parse lnurl_pay_info JSON for payment ${payment.id}: ${e.message}`,
|
|
859
|
-
e
|
|
860
|
-
);
|
|
861
873
|
}
|
|
862
874
|
}
|
|
863
875
|
|
|
@@ -113,39 +113,24 @@ export interface ListUnclaimedDepositsResponse {
|
|
|
113
113
|
|
|
114
114
|
export type DepositClaimError = { type: "depositClaimFeeExceeded"; tx: string; vout: number; maxFee: Fee; actualFee: number } | { type: "missingUtxo"; tx: string; vout: number } | { type: "generic"; message: string };
|
|
115
115
|
|
|
116
|
-
export type InputType = ({ type: "bitcoinAddress" } & BitcoinAddressDetails) | ({ type: "bolt11Invoice" } & Bolt11InvoiceDetails) | ({ type: "bolt12Invoice" } & Bolt12InvoiceDetails) | ({ type: "bolt12Offer" } & Bolt12OfferDetails) | ({ type: "lightningAddress" } & LightningAddressDetails) | ({ type: "lnurlPay" } & LnurlPayRequestDetails) | ({ type: "silentPaymentAddress" } & SilentPaymentAddressDetails) | ({ type: "lnurlAuth" } & LnurlAuthRequestDetails) | ({ type: "url" } & string) | ({ type: "bip21" } & Bip21Details) | ({ type: "bolt12InvoiceRequest" } & Bolt12InvoiceRequestDetails) | ({ type: "lnurlWithdraw" } & LnurlWithdrawRequestDetails) | ({ type: "sparkAddress" } & SparkAddressDetails);
|
|
116
|
+
export type InputType = ({ type: "bitcoinAddress" } & BitcoinAddressDetails) | ({ type: "bolt11Invoice" } & Bolt11InvoiceDetails) | ({ type: "bolt12Invoice" } & Bolt12InvoiceDetails) | ({ type: "bolt12Offer" } & Bolt12OfferDetails) | ({ type: "lightningAddress" } & LightningAddressDetails) | ({ type: "lnurlPay" } & LnurlPayRequestDetails) | ({ type: "silentPaymentAddress" } & SilentPaymentAddressDetails) | ({ type: "lnurlAuth" } & LnurlAuthRequestDetails) | ({ type: "url" } & string) | ({ type: "bip21" } & Bip21Details) | ({ type: "bolt12InvoiceRequest" } & Bolt12InvoiceRequestDetails) | ({ type: "lnurlWithdraw" } & LnurlWithdrawRequestDetails) | ({ type: "sparkAddress" } & SparkAddressDetails) | ({ type: "sparkInvoice" } & SparkInvoiceDetails);
|
|
117
117
|
|
|
118
118
|
export interface SparkAddressDetails {
|
|
119
119
|
address: string;
|
|
120
|
-
|
|
120
|
+
identityPublicKey: string;
|
|
121
|
+
network: BitcoinNetwork;
|
|
121
122
|
source: PaymentRequestSource;
|
|
122
123
|
}
|
|
123
124
|
|
|
124
|
-
export interface
|
|
125
|
+
export interface SparkInvoiceDetails {
|
|
126
|
+
invoice: string;
|
|
125
127
|
identityPublicKey: string;
|
|
126
128
|
network: BitcoinNetwork;
|
|
127
|
-
sparkInvoiceFields?: SparkInvoiceFields;
|
|
128
|
-
signature?: string;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export interface SparkInvoiceFields {
|
|
132
|
-
id: string;
|
|
133
|
-
version: number;
|
|
134
|
-
memo?: string;
|
|
135
|
-
senderPublicKey?: string;
|
|
136
|
-
expiryTime?: number;
|
|
137
|
-
paymentType?: SparkAddressPaymentType;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export type SparkAddressPaymentType = ({ type: "tokensPayment" } & TokensPaymentDetails) | ({ type: "satsPayment" } & SatsPaymentDetails);
|
|
141
|
-
|
|
142
|
-
export interface TokensPaymentDetails {
|
|
143
|
-
tokenIdentifier?: string;
|
|
144
129
|
amount?: bigint;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
130
|
+
tokenIdentifier?: string;
|
|
131
|
+
expiryTime?: number;
|
|
132
|
+
description?: string;
|
|
133
|
+
senderPublicKey?: string;
|
|
149
134
|
}
|
|
150
135
|
|
|
151
136
|
export interface BitcoinAddressDetails {
|
|
@@ -298,7 +283,12 @@ export interface Payment {
|
|
|
298
283
|
details?: PaymentDetails;
|
|
299
284
|
}
|
|
300
285
|
|
|
301
|
-
export type PaymentDetails = { type: "spark" } | { type: "token"; metadata: TokenMetadata; txHash: string } | { type: "lightning"; description?: string; preimage?: string; invoice: string; paymentHash: string; destinationPubkey: string; lnurlPayInfo?: LnurlPayInfo } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
|
|
286
|
+
export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails } | { type: "token"; metadata: TokenMetadata; txHash: string; invoiceDetails?: SparkInvoicePaymentDetails } | { type: "lightning"; description?: string; preimage?: string; invoice: string; paymentHash: string; destinationPubkey: string; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
|
|
287
|
+
|
|
288
|
+
export interface SparkInvoicePaymentDetails {
|
|
289
|
+
description?: string;
|
|
290
|
+
invoice: string;
|
|
291
|
+
}
|
|
302
292
|
|
|
303
293
|
export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
|
|
304
294
|
|
|
@@ -338,6 +328,10 @@ export interface AesSuccessActionData {
|
|
|
338
328
|
iv: string;
|
|
339
329
|
}
|
|
340
330
|
|
|
331
|
+
export interface LnurlWithdrawInfo {
|
|
332
|
+
withdrawUrl: string;
|
|
333
|
+
}
|
|
334
|
+
|
|
341
335
|
export type Network = "mainnet" | "regtest";
|
|
342
336
|
|
|
343
337
|
export interface Config {
|
|
@@ -392,7 +386,7 @@ export interface SyncWalletRequest {}
|
|
|
392
386
|
|
|
393
387
|
export interface SyncWalletResponse {}
|
|
394
388
|
|
|
395
|
-
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "bitcoinAddress" } | { type: "bolt11Invoice"; description: string; amountSats?: number };
|
|
389
|
+
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: bigint; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress" } | { type: "bolt11Invoice"; description: string; amountSats?: number };
|
|
396
390
|
|
|
397
391
|
export interface SendOnchainFeeQuote {
|
|
398
392
|
id: string;
|
|
@@ -407,7 +401,7 @@ export interface SendOnchainSpeedFeeQuote {
|
|
|
407
401
|
l1BroadcastFeeSat: number;
|
|
408
402
|
}
|
|
409
403
|
|
|
410
|
-
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: bigint; tokenIdentifier?: string };
|
|
404
|
+
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: bigint; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: bigint; tokenIdentifier?: string };
|
|
411
405
|
|
|
412
406
|
export interface ReceivePaymentRequest {
|
|
413
407
|
paymentMethod: ReceivePaymentMethod;
|
|
@@ -415,7 +409,7 @@ export interface ReceivePaymentRequest {
|
|
|
415
409
|
|
|
416
410
|
export interface ReceivePaymentResponse {
|
|
417
411
|
paymentRequest: string;
|
|
418
|
-
|
|
412
|
+
fee: bigint;
|
|
419
413
|
}
|
|
420
414
|
|
|
421
415
|
export interface PrepareLnurlPayRequest {
|
|
@@ -443,6 +437,17 @@ export interface LnurlPayResponse {
|
|
|
443
437
|
successAction?: SuccessActionProcessed;
|
|
444
438
|
}
|
|
445
439
|
|
|
440
|
+
export interface LnurlWithdrawRequest {
|
|
441
|
+
amountSats: number;
|
|
442
|
+
withdrawRequest: LnurlWithdrawRequestDetails;
|
|
443
|
+
completionTimeoutSecs?: number;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export interface LnurlWithdrawResponse {
|
|
447
|
+
paymentRequest: string;
|
|
448
|
+
payment?: Payment;
|
|
449
|
+
}
|
|
450
|
+
|
|
446
451
|
export interface PrepareSendPaymentRequest {
|
|
447
452
|
paymentRequest: string;
|
|
448
453
|
amount?: bigint;
|
|
@@ -500,6 +505,7 @@ export interface LogEntry {
|
|
|
500
505
|
|
|
501
506
|
export interface PaymentMetadata {
|
|
502
507
|
lnurlPayInfo?: LnurlPayInfo;
|
|
508
|
+
lnurlWithdrawInfo?: LnurlWithdrawInfo;
|
|
503
509
|
lnurlDescription?: string;
|
|
504
510
|
}
|
|
505
511
|
|
|
@@ -591,7 +597,27 @@ export interface ProvisionalPayment {
|
|
|
591
597
|
details: ProvisionalPaymentDetails;
|
|
592
598
|
}
|
|
593
599
|
|
|
594
|
-
export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark";
|
|
600
|
+
export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
|
|
601
|
+
|
|
602
|
+
export interface SignMessageRequest {
|
|
603
|
+
message: string;
|
|
604
|
+
compact: boolean;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
export interface SignMessageResponse {
|
|
608
|
+
pubkey: string;
|
|
609
|
+
signature: string;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
export interface CheckMessageRequest {
|
|
613
|
+
message: string;
|
|
614
|
+
pubkey: string;
|
|
615
|
+
signature: string;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
export interface CheckMessageResponse {
|
|
619
|
+
isValid: boolean;
|
|
620
|
+
}
|
|
595
621
|
|
|
596
622
|
export interface Storage {
|
|
597
623
|
getCachedItem: (key: string) => Promise<string | null>;
|
|
@@ -620,6 +646,7 @@ export class BreezSdk {
|
|
|
620
646
|
prepareSendPayment(request: PrepareSendPaymentRequest): Promise<PrepareSendPaymentResponse>;
|
|
621
647
|
prepareLnurlPay(request: PrepareLnurlPayRequest): Promise<PrepareLnurlPayResponse>;
|
|
622
648
|
lnurlPay(request: LnurlPayRequest): Promise<LnurlPayResponse>;
|
|
649
|
+
lnurlWithdraw(request: LnurlWithdrawRequest): Promise<LnurlWithdrawResponse>;
|
|
623
650
|
sendPayment(request: SendPaymentRequest): Promise<SendPaymentResponse>;
|
|
624
651
|
syncWallet(request: SyncWalletRequest): Promise<SyncWalletResponse>;
|
|
625
652
|
listPayments(request: ListPaymentsRequest): Promise<ListPaymentsResponse>;
|
|
@@ -635,6 +662,8 @@ export class BreezSdk {
|
|
|
635
662
|
listFiatRates(): Promise<ListFiatRatesResponse>;
|
|
636
663
|
waitForPayment(request: WaitForPaymentRequest): Promise<WaitForPaymentResponse>;
|
|
637
664
|
getTokensMetadata(request: GetTokensMetadataRequest): Promise<GetTokensMetadataResponse>;
|
|
665
|
+
signMessage(request: SignMessageRequest): Promise<SignMessageResponse>;
|
|
666
|
+
checkMessage(request: CheckMessageRequest): Promise<CheckMessageResponse>;
|
|
638
667
|
}
|
|
639
668
|
export class IntoUnderlyingByteSource {
|
|
640
669
|
private constructor();
|
|
@@ -266,11 +266,11 @@ function __wbg_adapter_58(arg0, arg1) {
|
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
function __wbg_adapter_61(arg0, arg1, arg2) {
|
|
269
|
-
wasm.
|
|
269
|
+
wasm.closure883_externref_shim(arg0, arg1, arg2);
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
function
|
|
273
|
-
wasm.
|
|
272
|
+
function __wbg_adapter_225(arg0, arg1, arg2, arg3) {
|
|
273
|
+
wasm.closure488_externref_shim(arg0, arg1, arg2, arg3);
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
@@ -385,6 +385,14 @@ export class BreezSdk {
|
|
|
385
385
|
const ret = wasm.breezsdk_lnurlPay(this.__wbg_ptr, request);
|
|
386
386
|
return ret;
|
|
387
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* @param {LnurlWithdrawRequest} request
|
|
390
|
+
* @returns {Promise<LnurlWithdrawResponse>}
|
|
391
|
+
*/
|
|
392
|
+
lnurlWithdraw(request) {
|
|
393
|
+
const ret = wasm.breezsdk_lnurlWithdraw(this.__wbg_ptr, request);
|
|
394
|
+
return ret;
|
|
395
|
+
}
|
|
388
396
|
/**
|
|
389
397
|
* @param {SendPaymentRequest} request
|
|
390
398
|
* @returns {Promise<SendPaymentResponse>}
|
|
@@ -501,6 +509,22 @@ export class BreezSdk {
|
|
|
501
509
|
const ret = wasm.breezsdk_getTokensMetadata(this.__wbg_ptr, request);
|
|
502
510
|
return ret;
|
|
503
511
|
}
|
|
512
|
+
/**
|
|
513
|
+
* @param {SignMessageRequest} request
|
|
514
|
+
* @returns {Promise<SignMessageResponse>}
|
|
515
|
+
*/
|
|
516
|
+
signMessage(request) {
|
|
517
|
+
const ret = wasm.breezsdk_signMessage(this.__wbg_ptr, request);
|
|
518
|
+
return ret;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* @param {CheckMessageRequest} request
|
|
522
|
+
* @returns {Promise<CheckMessageResponse>}
|
|
523
|
+
*/
|
|
524
|
+
checkMessage(request) {
|
|
525
|
+
const ret = wasm.breezsdk_checkMessage(this.__wbg_ptr, request);
|
|
526
|
+
return ret;
|
|
527
|
+
}
|
|
504
528
|
}
|
|
505
529
|
|
|
506
530
|
const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -1141,7 +1165,7 @@ const imports = {
|
|
|
1141
1165
|
const a = state0.a;
|
|
1142
1166
|
state0.a = 0;
|
|
1143
1167
|
try {
|
|
1144
|
-
return
|
|
1168
|
+
return __wbg_adapter_225(a, state0.b, arg0, arg1);
|
|
1145
1169
|
} finally {
|
|
1146
1170
|
state0.a = a;
|
|
1147
1171
|
}
|
|
@@ -1476,12 +1500,12 @@ const imports = {
|
|
|
1476
1500
|
const ret = false;
|
|
1477
1501
|
return ret;
|
|
1478
1502
|
},
|
|
1479
|
-
|
|
1480
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1503
|
+
__wbindgen_closure_wrapper10406: function(arg0, arg1, arg2) {
|
|
1504
|
+
const ret = makeMutClosure(arg0, arg1, 884, __wbg_adapter_61);
|
|
1481
1505
|
return ret;
|
|
1482
1506
|
},
|
|
1483
|
-
|
|
1484
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1507
|
+
__wbindgen_closure_wrapper8736: function(arg0, arg1, arg2) {
|
|
1508
|
+
const ret = makeMutClosure(arg0, arg1, 665, __wbg_adapter_58);
|
|
1485
1509
|
return ret;
|
|
1486
1510
|
},
|
|
1487
1511
|
__wbindgen_debug_string: function(arg0, arg1) {
|
|
Binary file
|
|
@@ -15,6 +15,7 @@ export const breezsdk_receivePayment: (a: number, b: any) => any;
|
|
|
15
15
|
export const breezsdk_prepareSendPayment: (a: number, b: any) => any;
|
|
16
16
|
export const breezsdk_prepareLnurlPay: (a: number, b: any) => any;
|
|
17
17
|
export const breezsdk_lnurlPay: (a: number, b: any) => any;
|
|
18
|
+
export const breezsdk_lnurlWithdraw: (a: number, b: any) => any;
|
|
18
19
|
export const breezsdk_sendPayment: (a: number, b: any) => any;
|
|
19
20
|
export const breezsdk_syncWallet: (a: number, b: any) => any;
|
|
20
21
|
export const breezsdk_listPayments: (a: number, b: any) => any;
|
|
@@ -30,6 +31,8 @@ export const breezsdk_listFiatCurrencies: (a: number) => any;
|
|
|
30
31
|
export const breezsdk_listFiatRates: (a: number) => any;
|
|
31
32
|
export const breezsdk_waitForPayment: (a: number, b: any) => any;
|
|
32
33
|
export const breezsdk_getTokensMetadata: (a: number, b: any) => any;
|
|
34
|
+
export const breezsdk_signMessage: (a: number, b: any) => any;
|
|
35
|
+
export const breezsdk_checkMessage: (a: number, b: any) => any;
|
|
33
36
|
export const __wbg_sdkbuilder_free: (a: number, b: number) => void;
|
|
34
37
|
export const sdkbuilder_new: (a: any, b: any, c: any) => [number, number, number];
|
|
35
38
|
export const sdkbuilder_withKeySet: (a: number, b: any, c: number, d: number) => number;
|
|
@@ -67,6 +70,6 @@ export const __externref_drop_slice: (a: number, b: number) => void;
|
|
|
67
70
|
export const __wbindgen_export_7: WebAssembly.Table;
|
|
68
71
|
export const __externref_table_dealloc: (a: number) => void;
|
|
69
72
|
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7a414ded2eae1947: (a: number, b: number) => void;
|
|
70
|
-
export const
|
|
71
|
-
export const
|
|
73
|
+
export const closure883_externref_shim: (a: number, b: number, c: any) => void;
|
|
74
|
+
export const closure488_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
72
75
|
export const __wbindgen_start: () => void;
|