@breeztech/breez-sdk-spark 0.7.1 → 0.7.3
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 +37 -27
- package/bundler/breez_sdk_spark_wasm_bg.js +14 -14
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +3 -3
- package/bundler/storage/index.js +8 -9
- package/deno/breez_sdk_spark_wasm.d.ts +37 -27
- package/deno/breez_sdk_spark_wasm.js +14 -14
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +3 -3
- package/nodejs/breez_sdk_spark_wasm.d.ts +37 -27
- package/nodejs/breez_sdk_spark_wasm.js +14 -14
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +3 -3
- 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 +40 -30
- package/web/breez_sdk_spark_wasm.js +14 -14
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +3 -3
- package/web/storage/index.js +8 -9
package/breez-sdk-spark.tgz
CHANGED
|
Binary file
|
|
@@ -87,7 +87,7 @@ export interface ListUnclaimedDepositsResponse {
|
|
|
87
87
|
deposits: DepositInfo[];
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?:
|
|
90
|
+
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: string; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress" } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number };
|
|
91
91
|
|
|
92
92
|
export interface SparkHtlcDetails {
|
|
93
93
|
paymentHash: string;
|
|
@@ -119,7 +119,7 @@ export interface PrepareSendPaymentRequest {
|
|
|
119
119
|
paymentRequest: string;
|
|
120
120
|
amount?: bigint;
|
|
121
121
|
tokenIdentifier?: string;
|
|
122
|
-
|
|
122
|
+
conversionOptions?: ConversionOptions;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
export interface CurrencyInfo {
|
|
@@ -132,7 +132,7 @@ export interface CurrencyInfo {
|
|
|
132
132
|
localeOverrides: LocaleOverrides[];
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee:
|
|
135
|
+
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string };
|
|
136
136
|
|
|
137
137
|
export interface CheckLightningAddressRequest {
|
|
138
138
|
username: string;
|
|
@@ -163,7 +163,7 @@ export interface TokenMetadata {
|
|
|
163
163
|
name: string;
|
|
164
164
|
ticker: string;
|
|
165
165
|
decimals: number;
|
|
166
|
-
maxSupply:
|
|
166
|
+
maxSupply: string;
|
|
167
167
|
isFreezable: boolean;
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -238,6 +238,11 @@ export interface LnurlPayRequest {
|
|
|
238
238
|
idempotencyKey?: string;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
+
export interface FetchConversionLimitsResponse {
|
|
242
|
+
minFromAmount?: bigint;
|
|
243
|
+
minToAmount?: bigint;
|
|
244
|
+
}
|
|
245
|
+
|
|
241
246
|
export interface ExternalInputParser {
|
|
242
247
|
providerId: string;
|
|
243
248
|
inputRegex: string;
|
|
@@ -331,6 +336,11 @@ export interface OptimizationConfig {
|
|
|
331
336
|
multiplicity: number;
|
|
332
337
|
}
|
|
333
338
|
|
|
339
|
+
export interface FetchConversionLimitsRequest {
|
|
340
|
+
conversionType: ConversionType;
|
|
341
|
+
tokenIdentifier?: string;
|
|
342
|
+
}
|
|
343
|
+
|
|
334
344
|
export interface Bolt11InvoiceDetails {
|
|
335
345
|
amountMsat?: number;
|
|
336
346
|
description?: string;
|
|
@@ -352,11 +362,7 @@ export interface MessageSuccessActionData {
|
|
|
352
362
|
message: string;
|
|
353
363
|
}
|
|
354
364
|
|
|
355
|
-
export
|
|
356
|
-
conversionType: TokenConversionType;
|
|
357
|
-
maxSlippageBps?: number;
|
|
358
|
-
completionTimeoutSecs?: number;
|
|
359
|
-
}
|
|
365
|
+
export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" };
|
|
360
366
|
|
|
361
367
|
export type PaymentType = "send" | "receive";
|
|
362
368
|
|
|
@@ -392,11 +398,10 @@ export interface RecordChange {
|
|
|
392
398
|
revision: number;
|
|
393
399
|
}
|
|
394
400
|
|
|
395
|
-
export interface
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
fee
|
|
399
|
-
refundIdentifier?: string;
|
|
401
|
+
export interface ConversionEstimate {
|
|
402
|
+
options: ConversionOptions;
|
|
403
|
+
amount: bigint;
|
|
404
|
+
fee: bigint;
|
|
400
405
|
}
|
|
401
406
|
|
|
402
407
|
export interface LnurlWithdrawRequestDetails {
|
|
@@ -459,9 +464,10 @@ export interface ListPaymentsResponse {
|
|
|
459
464
|
payments: Payment[];
|
|
460
465
|
}
|
|
461
466
|
|
|
462
|
-
export interface
|
|
463
|
-
|
|
464
|
-
|
|
467
|
+
export interface ConversionOptions {
|
|
468
|
+
conversionType: ConversionType;
|
|
469
|
+
maxSlippageBps?: number;
|
|
470
|
+
completionTimeoutSecs?: number;
|
|
465
471
|
}
|
|
466
472
|
|
|
467
473
|
export interface SyncWalletResponse {}
|
|
@@ -474,9 +480,12 @@ export interface LnurlWithdrawRequest {
|
|
|
474
480
|
|
|
475
481
|
export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
|
|
476
482
|
|
|
477
|
-
export interface
|
|
478
|
-
|
|
479
|
-
|
|
483
|
+
export interface ConversionInfo {
|
|
484
|
+
poolId: string;
|
|
485
|
+
conversionId: string;
|
|
486
|
+
status: ConversionStatus;
|
|
487
|
+
fee?: string;
|
|
488
|
+
purpose?: ConversionPurpose;
|
|
480
489
|
}
|
|
481
490
|
|
|
482
491
|
export interface SendOnchainSpeedFeeQuote {
|
|
@@ -571,7 +580,7 @@ export interface RefundDepositResponse {
|
|
|
571
580
|
txHex: string;
|
|
572
581
|
}
|
|
573
582
|
|
|
574
|
-
export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails;
|
|
583
|
+
export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails; conversionInfo?: ConversionInfo } | { type: "token"; metadata: TokenMetadata; txHash: string; invoiceDetails?: SparkInvoicePaymentDetails; conversionInfo?: ConversionInfo } | { type: "lightning"; description?: string; preimage?: string; invoice: string; paymentHash: string; destinationPubkey: string; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo; lnurlReceiveMetadata?: LnurlReceiveMetadata } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
|
|
575
584
|
|
|
576
585
|
export interface RecordId {
|
|
577
586
|
type: string;
|
|
@@ -644,7 +653,7 @@ export interface PaymentMetadata {
|
|
|
644
653
|
lnurlPayInfo?: LnurlPayInfo;
|
|
645
654
|
lnurlWithdrawInfo?: LnurlWithdrawInfo;
|
|
646
655
|
lnurlDescription?: string;
|
|
647
|
-
|
|
656
|
+
conversionInfo?: ConversionInfo;
|
|
648
657
|
}
|
|
649
658
|
|
|
650
659
|
export interface ClaimDepositResponse {
|
|
@@ -705,7 +714,7 @@ export interface Credentials {
|
|
|
705
714
|
password: string;
|
|
706
715
|
}
|
|
707
716
|
|
|
708
|
-
export type
|
|
717
|
+
export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
|
|
709
718
|
|
|
710
719
|
export interface GetPaymentResponse {
|
|
711
720
|
payment: Payment;
|
|
@@ -715,13 +724,15 @@ export interface SparkInvoiceDetails {
|
|
|
715
724
|
invoice: string;
|
|
716
725
|
identityPublicKey: string;
|
|
717
726
|
network: BitcoinNetwork;
|
|
718
|
-
amount?:
|
|
727
|
+
amount?: string;
|
|
719
728
|
tokenIdentifier?: string;
|
|
720
729
|
expiryTime?: number;
|
|
721
730
|
description?: string;
|
|
722
731
|
senderPublicKey?: string;
|
|
723
732
|
}
|
|
724
733
|
|
|
734
|
+
export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
|
|
735
|
+
|
|
725
736
|
export interface GetTokensMetadataResponse {
|
|
726
737
|
tokensMetadata: TokenMetadata[];
|
|
727
738
|
}
|
|
@@ -738,8 +749,7 @@ export interface PrepareSendPaymentResponse {
|
|
|
738
749
|
paymentMethod: SendPaymentMethod;
|
|
739
750
|
amount: bigint;
|
|
740
751
|
tokenIdentifier?: string;
|
|
741
|
-
|
|
742
|
-
tokenConversionFee?: bigint;
|
|
752
|
+
conversionEstimate?: ConversionEstimate;
|
|
743
753
|
}
|
|
744
754
|
|
|
745
755
|
export interface OutgoingChange {
|
|
@@ -979,12 +989,12 @@ export class BreezSdk {
|
|
|
979
989
|
updateUserSettings(request: UpdateUserSettingsRequest): Promise<void>;
|
|
980
990
|
getLightningAddress(): Promise<LightningAddressInfo | undefined>;
|
|
981
991
|
removeEventListener(id: string): Promise<boolean>;
|
|
992
|
+
fetchConversionLimits(request: FetchConversionLimitsRequest): Promise<FetchConversionLimitsResponse>;
|
|
982
993
|
listUnclaimedDeposits(request: ListUnclaimedDepositsRequest): Promise<ListUnclaimedDepositsResponse>;
|
|
983
994
|
startLeafOptimization(): void;
|
|
984
995
|
cancelLeafOptimization(): Promise<void>;
|
|
985
996
|
deleteLightningAddress(): Promise<void>;
|
|
986
997
|
registerLightningAddress(request: RegisterLightningAddressRequest): Promise<LightningAddressInfo>;
|
|
987
|
-
fetchTokenConversionLimits(request: FetchTokenConversionLimitsRequest): Promise<FetchTokenConversionLimitsResponse>;
|
|
988
998
|
getLeafOptimizationProgress(): OptimizationProgress;
|
|
989
999
|
checkLightningAddressAvailable(request: CheckLightningAddressRequest): Promise<boolean>;
|
|
990
1000
|
parse(input: string): Promise<InputType>;
|
|
@@ -313,11 +313,11 @@ function __wbg_adapter_64(arg0, arg1) {
|
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
function __wbg_adapter_67(arg0, arg1, arg2) {
|
|
316
|
-
wasm.
|
|
316
|
+
wasm.closure1050_externref_shim(arg0, arg1, arg2);
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
function __wbg_adapter_349(arg0, arg1, arg2, arg3) {
|
|
320
|
-
wasm.
|
|
320
|
+
wasm.closure635_externref_shim(arg0, arg1, arg2, arg3);
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
@@ -544,6 +544,14 @@ export class BreezSdk {
|
|
|
544
544
|
const ret = wasm.breezsdk_removeEventListener(this.__wbg_ptr, ptr0, len0);
|
|
545
545
|
return ret;
|
|
546
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
|
+
}
|
|
547
555
|
/**
|
|
548
556
|
* @param {ListUnclaimedDepositsRequest} request
|
|
549
557
|
* @returns {Promise<ListUnclaimedDepositsResponse>}
|
|
@@ -577,14 +585,6 @@ export class BreezSdk {
|
|
|
577
585
|
const ret = wasm.breezsdk_registerLightningAddress(this.__wbg_ptr, request);
|
|
578
586
|
return ret;
|
|
579
587
|
}
|
|
580
|
-
/**
|
|
581
|
-
* @param {FetchTokenConversionLimitsRequest} request
|
|
582
|
-
* @returns {Promise<FetchTokenConversionLimitsResponse>}
|
|
583
|
-
*/
|
|
584
|
-
fetchTokenConversionLimits(request) {
|
|
585
|
-
const ret = wasm.breezsdk_fetchTokenConversionLimits(this.__wbg_ptr, request);
|
|
586
|
-
return ret;
|
|
587
|
-
}
|
|
588
588
|
/**
|
|
589
589
|
* @returns {OptimizationProgress}
|
|
590
590
|
*/
|
|
@@ -2355,13 +2355,13 @@ export function __wbindgen_cb_drop(arg0) {
|
|
|
2355
2355
|
return ret;
|
|
2356
2356
|
};
|
|
2357
2357
|
|
|
2358
|
-
export function
|
|
2359
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2358
|
+
export function __wbindgen_closure_wrapper11216(arg0, arg1, arg2) {
|
|
2359
|
+
const ret = makeMutClosure(arg0, arg1, 815, __wbg_adapter_64);
|
|
2360
2360
|
return ret;
|
|
2361
2361
|
};
|
|
2362
2362
|
|
|
2363
|
-
export function
|
|
2364
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2363
|
+
export function __wbindgen_closure_wrapper13122(arg0, arg1, arg2) {
|
|
2364
|
+
const ret = makeMutClosure(arg0, arg1, 1051, __wbg_adapter_67);
|
|
2365
2365
|
return ret;
|
|
2366
2366
|
};
|
|
2367
2367
|
|
|
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;
|
|
@@ -110,6 +110,6 @@ export const __externref_drop_slice: (a: number, b: number) => void;
|
|
|
110
110
|
export const __wbindgen_export_7: WebAssembly.Table;
|
|
111
111
|
export const __externref_table_dealloc: (a: number) => void;
|
|
112
112
|
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
|
|
113
|
+
export const closure1050_externref_shim: (a: number, b: number, c: any) => void;
|
|
114
|
+
export const closure635_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
115
115
|
export const __wbindgen_start: () => void;
|
package/bundler/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
|
}
|
|
@@ -87,7 +87,7 @@ export interface ListUnclaimedDepositsResponse {
|
|
|
87
87
|
deposits: DepositInfo[];
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?:
|
|
90
|
+
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: string; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress" } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number };
|
|
91
91
|
|
|
92
92
|
export interface SparkHtlcDetails {
|
|
93
93
|
paymentHash: string;
|
|
@@ -119,7 +119,7 @@ export interface PrepareSendPaymentRequest {
|
|
|
119
119
|
paymentRequest: string;
|
|
120
120
|
amount?: bigint;
|
|
121
121
|
tokenIdentifier?: string;
|
|
122
|
-
|
|
122
|
+
conversionOptions?: ConversionOptions;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
export interface CurrencyInfo {
|
|
@@ -132,7 +132,7 @@ export interface CurrencyInfo {
|
|
|
132
132
|
localeOverrides: LocaleOverrides[];
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee:
|
|
135
|
+
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string };
|
|
136
136
|
|
|
137
137
|
export interface CheckLightningAddressRequest {
|
|
138
138
|
username: string;
|
|
@@ -163,7 +163,7 @@ export interface TokenMetadata {
|
|
|
163
163
|
name: string;
|
|
164
164
|
ticker: string;
|
|
165
165
|
decimals: number;
|
|
166
|
-
maxSupply:
|
|
166
|
+
maxSupply: string;
|
|
167
167
|
isFreezable: boolean;
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -238,6 +238,11 @@ export interface LnurlPayRequest {
|
|
|
238
238
|
idempotencyKey?: string;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
+
export interface FetchConversionLimitsResponse {
|
|
242
|
+
minFromAmount?: bigint;
|
|
243
|
+
minToAmount?: bigint;
|
|
244
|
+
}
|
|
245
|
+
|
|
241
246
|
export interface ExternalInputParser {
|
|
242
247
|
providerId: string;
|
|
243
248
|
inputRegex: string;
|
|
@@ -331,6 +336,11 @@ export interface OptimizationConfig {
|
|
|
331
336
|
multiplicity: number;
|
|
332
337
|
}
|
|
333
338
|
|
|
339
|
+
export interface FetchConversionLimitsRequest {
|
|
340
|
+
conversionType: ConversionType;
|
|
341
|
+
tokenIdentifier?: string;
|
|
342
|
+
}
|
|
343
|
+
|
|
334
344
|
export interface Bolt11InvoiceDetails {
|
|
335
345
|
amountMsat?: number;
|
|
336
346
|
description?: string;
|
|
@@ -352,11 +362,7 @@ export interface MessageSuccessActionData {
|
|
|
352
362
|
message: string;
|
|
353
363
|
}
|
|
354
364
|
|
|
355
|
-
export
|
|
356
|
-
conversionType: TokenConversionType;
|
|
357
|
-
maxSlippageBps?: number;
|
|
358
|
-
completionTimeoutSecs?: number;
|
|
359
|
-
}
|
|
365
|
+
export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" };
|
|
360
366
|
|
|
361
367
|
export type PaymentType = "send" | "receive";
|
|
362
368
|
|
|
@@ -392,11 +398,10 @@ export interface RecordChange {
|
|
|
392
398
|
revision: number;
|
|
393
399
|
}
|
|
394
400
|
|
|
395
|
-
export interface
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
fee
|
|
399
|
-
refundIdentifier?: string;
|
|
401
|
+
export interface ConversionEstimate {
|
|
402
|
+
options: ConversionOptions;
|
|
403
|
+
amount: bigint;
|
|
404
|
+
fee: bigint;
|
|
400
405
|
}
|
|
401
406
|
|
|
402
407
|
export interface LnurlWithdrawRequestDetails {
|
|
@@ -459,9 +464,10 @@ export interface ListPaymentsResponse {
|
|
|
459
464
|
payments: Payment[];
|
|
460
465
|
}
|
|
461
466
|
|
|
462
|
-
export interface
|
|
463
|
-
|
|
464
|
-
|
|
467
|
+
export interface ConversionOptions {
|
|
468
|
+
conversionType: ConversionType;
|
|
469
|
+
maxSlippageBps?: number;
|
|
470
|
+
completionTimeoutSecs?: number;
|
|
465
471
|
}
|
|
466
472
|
|
|
467
473
|
export interface SyncWalletResponse {}
|
|
@@ -474,9 +480,12 @@ export interface LnurlWithdrawRequest {
|
|
|
474
480
|
|
|
475
481
|
export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
|
|
476
482
|
|
|
477
|
-
export interface
|
|
478
|
-
|
|
479
|
-
|
|
483
|
+
export interface ConversionInfo {
|
|
484
|
+
poolId: string;
|
|
485
|
+
conversionId: string;
|
|
486
|
+
status: ConversionStatus;
|
|
487
|
+
fee?: string;
|
|
488
|
+
purpose?: ConversionPurpose;
|
|
480
489
|
}
|
|
481
490
|
|
|
482
491
|
export interface SendOnchainSpeedFeeQuote {
|
|
@@ -571,7 +580,7 @@ export interface RefundDepositResponse {
|
|
|
571
580
|
txHex: string;
|
|
572
581
|
}
|
|
573
582
|
|
|
574
|
-
export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails;
|
|
583
|
+
export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails; conversionInfo?: ConversionInfo } | { type: "token"; metadata: TokenMetadata; txHash: string; invoiceDetails?: SparkInvoicePaymentDetails; conversionInfo?: ConversionInfo } | { type: "lightning"; description?: string; preimage?: string; invoice: string; paymentHash: string; destinationPubkey: string; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo; lnurlReceiveMetadata?: LnurlReceiveMetadata } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
|
|
575
584
|
|
|
576
585
|
export interface RecordId {
|
|
577
586
|
type: string;
|
|
@@ -644,7 +653,7 @@ export interface PaymentMetadata {
|
|
|
644
653
|
lnurlPayInfo?: LnurlPayInfo;
|
|
645
654
|
lnurlWithdrawInfo?: LnurlWithdrawInfo;
|
|
646
655
|
lnurlDescription?: string;
|
|
647
|
-
|
|
656
|
+
conversionInfo?: ConversionInfo;
|
|
648
657
|
}
|
|
649
658
|
|
|
650
659
|
export interface ClaimDepositResponse {
|
|
@@ -705,7 +714,7 @@ export interface Credentials {
|
|
|
705
714
|
password: string;
|
|
706
715
|
}
|
|
707
716
|
|
|
708
|
-
export type
|
|
717
|
+
export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
|
|
709
718
|
|
|
710
719
|
export interface GetPaymentResponse {
|
|
711
720
|
payment: Payment;
|
|
@@ -715,13 +724,15 @@ export interface SparkInvoiceDetails {
|
|
|
715
724
|
invoice: string;
|
|
716
725
|
identityPublicKey: string;
|
|
717
726
|
network: BitcoinNetwork;
|
|
718
|
-
amount?:
|
|
727
|
+
amount?: string;
|
|
719
728
|
tokenIdentifier?: string;
|
|
720
729
|
expiryTime?: number;
|
|
721
730
|
description?: string;
|
|
722
731
|
senderPublicKey?: string;
|
|
723
732
|
}
|
|
724
733
|
|
|
734
|
+
export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
|
|
735
|
+
|
|
725
736
|
export interface GetTokensMetadataResponse {
|
|
726
737
|
tokensMetadata: TokenMetadata[];
|
|
727
738
|
}
|
|
@@ -738,8 +749,7 @@ export interface PrepareSendPaymentResponse {
|
|
|
738
749
|
paymentMethod: SendPaymentMethod;
|
|
739
750
|
amount: bigint;
|
|
740
751
|
tokenIdentifier?: string;
|
|
741
|
-
|
|
742
|
-
tokenConversionFee?: bigint;
|
|
752
|
+
conversionEstimate?: ConversionEstimate;
|
|
743
753
|
}
|
|
744
754
|
|
|
745
755
|
export interface OutgoingChange {
|
|
@@ -979,12 +989,12 @@ export class BreezSdk {
|
|
|
979
989
|
updateUserSettings(request: UpdateUserSettingsRequest): Promise<void>;
|
|
980
990
|
getLightningAddress(): Promise<LightningAddressInfo | undefined>;
|
|
981
991
|
removeEventListener(id: string): Promise<boolean>;
|
|
992
|
+
fetchConversionLimits(request: FetchConversionLimitsRequest): Promise<FetchConversionLimitsResponse>;
|
|
982
993
|
listUnclaimedDeposits(request: ListUnclaimedDepositsRequest): Promise<ListUnclaimedDepositsResponse>;
|
|
983
994
|
startLeafOptimization(): void;
|
|
984
995
|
cancelLeafOptimization(): Promise<void>;
|
|
985
996
|
deleteLightningAddress(): Promise<void>;
|
|
986
997
|
registerLightningAddress(request: RegisterLightningAddressRequest): Promise<LightningAddressInfo>;
|
|
987
|
-
fetchTokenConversionLimits(request: FetchTokenConversionLimitsRequest): Promise<FetchTokenConversionLimitsResponse>;
|
|
988
998
|
getLeafOptimizationProgress(): OptimizationProgress;
|
|
989
999
|
checkLightningAddressAvailable(request: CheckLightningAddressRequest): Promise<boolean>;
|
|
990
1000
|
parse(input: string): Promise<InputType>;
|
|
@@ -296,11 +296,11 @@ function __wbg_adapter_64(arg0, arg1) {
|
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
function __wbg_adapter_67(arg0, arg1, arg2) {
|
|
299
|
-
wasm.
|
|
299
|
+
wasm.closure1050_externref_shim(arg0, arg1, arg2);
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
function __wbg_adapter_349(arg0, arg1, arg2, arg3) {
|
|
303
|
-
wasm.
|
|
303
|
+
wasm.closure635_externref_shim(arg0, arg1, arg2, arg3);
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
@@ -527,6 +527,14 @@ export class BreezSdk {
|
|
|
527
527
|
const ret = wasm.breezsdk_removeEventListener(this.__wbg_ptr, ptr0, len0);
|
|
528
528
|
return ret;
|
|
529
529
|
}
|
|
530
|
+
/**
|
|
531
|
+
* @param {FetchConversionLimitsRequest} request
|
|
532
|
+
* @returns {Promise<FetchConversionLimitsResponse>}
|
|
533
|
+
*/
|
|
534
|
+
fetchConversionLimits(request) {
|
|
535
|
+
const ret = wasm.breezsdk_fetchConversionLimits(this.__wbg_ptr, request);
|
|
536
|
+
return ret;
|
|
537
|
+
}
|
|
530
538
|
/**
|
|
531
539
|
* @param {ListUnclaimedDepositsRequest} request
|
|
532
540
|
* @returns {Promise<ListUnclaimedDepositsResponse>}
|
|
@@ -560,14 +568,6 @@ export class BreezSdk {
|
|
|
560
568
|
const ret = wasm.breezsdk_registerLightningAddress(this.__wbg_ptr, request);
|
|
561
569
|
return ret;
|
|
562
570
|
}
|
|
563
|
-
/**
|
|
564
|
-
* @param {FetchTokenConversionLimitsRequest} request
|
|
565
|
-
* @returns {Promise<FetchTokenConversionLimitsResponse>}
|
|
566
|
-
*/
|
|
567
|
-
fetchTokenConversionLimits(request) {
|
|
568
|
-
const ret = wasm.breezsdk_fetchTokenConversionLimits(this.__wbg_ptr, request);
|
|
569
|
-
return ret;
|
|
570
|
-
}
|
|
571
571
|
/**
|
|
572
572
|
* @returns {OptimizationProgress}
|
|
573
573
|
*/
|
|
@@ -2155,12 +2155,12 @@ const imports = {
|
|
|
2155
2155
|
const ret = false;
|
|
2156
2156
|
return ret;
|
|
2157
2157
|
},
|
|
2158
|
-
|
|
2159
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2158
|
+
__wbindgen_closure_wrapper11216: function(arg0, arg1, arg2) {
|
|
2159
|
+
const ret = makeMutClosure(arg0, arg1, 815, __wbg_adapter_64);
|
|
2160
2160
|
return ret;
|
|
2161
2161
|
},
|
|
2162
|
-
|
|
2163
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2162
|
+
__wbindgen_closure_wrapper13122: function(arg0, arg1, arg2) {
|
|
2163
|
+
const ret = makeMutClosure(arg0, arg1, 1051, __wbg_adapter_67);
|
|
2164
2164
|
return ret;
|
|
2165
2165
|
},
|
|
2166
2166
|
__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;
|
|
@@ -110,6 +110,6 @@ export const __externref_drop_slice: (a: number, b: number) => void;
|
|
|
110
110
|
export const __wbindgen_export_7: WebAssembly.Table;
|
|
111
111
|
export const __externref_table_dealloc: (a: number) => void;
|
|
112
112
|
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
|
|
113
|
+
export const closure1050_externref_shim: (a: number, b: number, c: any) => void;
|
|
114
|
+
export const closure635_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
115
115
|
export const __wbindgen_start: () => void;
|
|
@@ -87,7 +87,7 @@ export interface ListUnclaimedDepositsResponse {
|
|
|
87
87
|
deposits: DepositInfo[];
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?:
|
|
90
|
+
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: string; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress" } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number };
|
|
91
91
|
|
|
92
92
|
export interface SparkHtlcDetails {
|
|
93
93
|
paymentHash: string;
|
|
@@ -119,7 +119,7 @@ export interface PrepareSendPaymentRequest {
|
|
|
119
119
|
paymentRequest: string;
|
|
120
120
|
amount?: bigint;
|
|
121
121
|
tokenIdentifier?: string;
|
|
122
|
-
|
|
122
|
+
conversionOptions?: ConversionOptions;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
export interface CurrencyInfo {
|
|
@@ -132,7 +132,7 @@ export interface CurrencyInfo {
|
|
|
132
132
|
localeOverrides: LocaleOverrides[];
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee:
|
|
135
|
+
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string };
|
|
136
136
|
|
|
137
137
|
export interface CheckLightningAddressRequest {
|
|
138
138
|
username: string;
|
|
@@ -163,7 +163,7 @@ export interface TokenMetadata {
|
|
|
163
163
|
name: string;
|
|
164
164
|
ticker: string;
|
|
165
165
|
decimals: number;
|
|
166
|
-
maxSupply:
|
|
166
|
+
maxSupply: string;
|
|
167
167
|
isFreezable: boolean;
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -238,6 +238,11 @@ export interface LnurlPayRequest {
|
|
|
238
238
|
idempotencyKey?: string;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
+
export interface FetchConversionLimitsResponse {
|
|
242
|
+
minFromAmount?: bigint;
|
|
243
|
+
minToAmount?: bigint;
|
|
244
|
+
}
|
|
245
|
+
|
|
241
246
|
export interface ExternalInputParser {
|
|
242
247
|
providerId: string;
|
|
243
248
|
inputRegex: string;
|
|
@@ -331,6 +336,11 @@ export interface OptimizationConfig {
|
|
|
331
336
|
multiplicity: number;
|
|
332
337
|
}
|
|
333
338
|
|
|
339
|
+
export interface FetchConversionLimitsRequest {
|
|
340
|
+
conversionType: ConversionType;
|
|
341
|
+
tokenIdentifier?: string;
|
|
342
|
+
}
|
|
343
|
+
|
|
334
344
|
export interface Bolt11InvoiceDetails {
|
|
335
345
|
amountMsat?: number;
|
|
336
346
|
description?: string;
|
|
@@ -352,11 +362,7 @@ export interface MessageSuccessActionData {
|
|
|
352
362
|
message: string;
|
|
353
363
|
}
|
|
354
364
|
|
|
355
|
-
export
|
|
356
|
-
conversionType: TokenConversionType;
|
|
357
|
-
maxSlippageBps?: number;
|
|
358
|
-
completionTimeoutSecs?: number;
|
|
359
|
-
}
|
|
365
|
+
export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" };
|
|
360
366
|
|
|
361
367
|
export type PaymentType = "send" | "receive";
|
|
362
368
|
|
|
@@ -392,11 +398,10 @@ export interface RecordChange {
|
|
|
392
398
|
revision: number;
|
|
393
399
|
}
|
|
394
400
|
|
|
395
|
-
export interface
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
fee
|
|
399
|
-
refundIdentifier?: string;
|
|
401
|
+
export interface ConversionEstimate {
|
|
402
|
+
options: ConversionOptions;
|
|
403
|
+
amount: bigint;
|
|
404
|
+
fee: bigint;
|
|
400
405
|
}
|
|
401
406
|
|
|
402
407
|
export interface LnurlWithdrawRequestDetails {
|
|
@@ -459,9 +464,10 @@ export interface ListPaymentsResponse {
|
|
|
459
464
|
payments: Payment[];
|
|
460
465
|
}
|
|
461
466
|
|
|
462
|
-
export interface
|
|
463
|
-
|
|
464
|
-
|
|
467
|
+
export interface ConversionOptions {
|
|
468
|
+
conversionType: ConversionType;
|
|
469
|
+
maxSlippageBps?: number;
|
|
470
|
+
completionTimeoutSecs?: number;
|
|
465
471
|
}
|
|
466
472
|
|
|
467
473
|
export interface SyncWalletResponse {}
|
|
@@ -474,9 +480,12 @@ export interface LnurlWithdrawRequest {
|
|
|
474
480
|
|
|
475
481
|
export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
|
|
476
482
|
|
|
477
|
-
export interface
|
|
478
|
-
|
|
479
|
-
|
|
483
|
+
export interface ConversionInfo {
|
|
484
|
+
poolId: string;
|
|
485
|
+
conversionId: string;
|
|
486
|
+
status: ConversionStatus;
|
|
487
|
+
fee?: string;
|
|
488
|
+
purpose?: ConversionPurpose;
|
|
480
489
|
}
|
|
481
490
|
|
|
482
491
|
export interface SendOnchainSpeedFeeQuote {
|
|
@@ -571,7 +580,7 @@ export interface RefundDepositResponse {
|
|
|
571
580
|
txHex: string;
|
|
572
581
|
}
|
|
573
582
|
|
|
574
|
-
export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails;
|
|
583
|
+
export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails; conversionInfo?: ConversionInfo } | { type: "token"; metadata: TokenMetadata; txHash: string; invoiceDetails?: SparkInvoicePaymentDetails; conversionInfo?: ConversionInfo } | { type: "lightning"; description?: string; preimage?: string; invoice: string; paymentHash: string; destinationPubkey: string; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo; lnurlReceiveMetadata?: LnurlReceiveMetadata } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
|
|
575
584
|
|
|
576
585
|
export interface RecordId {
|
|
577
586
|
type: string;
|
|
@@ -644,7 +653,7 @@ export interface PaymentMetadata {
|
|
|
644
653
|
lnurlPayInfo?: LnurlPayInfo;
|
|
645
654
|
lnurlWithdrawInfo?: LnurlWithdrawInfo;
|
|
646
655
|
lnurlDescription?: string;
|
|
647
|
-
|
|
656
|
+
conversionInfo?: ConversionInfo;
|
|
648
657
|
}
|
|
649
658
|
|
|
650
659
|
export interface ClaimDepositResponse {
|
|
@@ -705,7 +714,7 @@ export interface Credentials {
|
|
|
705
714
|
password: string;
|
|
706
715
|
}
|
|
707
716
|
|
|
708
|
-
export type
|
|
717
|
+
export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
|
|
709
718
|
|
|
710
719
|
export interface GetPaymentResponse {
|
|
711
720
|
payment: Payment;
|
|
@@ -715,13 +724,15 @@ export interface SparkInvoiceDetails {
|
|
|
715
724
|
invoice: string;
|
|
716
725
|
identityPublicKey: string;
|
|
717
726
|
network: BitcoinNetwork;
|
|
718
|
-
amount?:
|
|
727
|
+
amount?: string;
|
|
719
728
|
tokenIdentifier?: string;
|
|
720
729
|
expiryTime?: number;
|
|
721
730
|
description?: string;
|
|
722
731
|
senderPublicKey?: string;
|
|
723
732
|
}
|
|
724
733
|
|
|
734
|
+
export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
|
|
735
|
+
|
|
725
736
|
export interface GetTokensMetadataResponse {
|
|
726
737
|
tokensMetadata: TokenMetadata[];
|
|
727
738
|
}
|
|
@@ -738,8 +749,7 @@ export interface PrepareSendPaymentResponse {
|
|
|
738
749
|
paymentMethod: SendPaymentMethod;
|
|
739
750
|
amount: bigint;
|
|
740
751
|
tokenIdentifier?: string;
|
|
741
|
-
|
|
742
|
-
tokenConversionFee?: bigint;
|
|
752
|
+
conversionEstimate?: ConversionEstimate;
|
|
743
753
|
}
|
|
744
754
|
|
|
745
755
|
export interface OutgoingChange {
|
|
@@ -979,12 +989,12 @@ export class BreezSdk {
|
|
|
979
989
|
updateUserSettings(request: UpdateUserSettingsRequest): Promise<void>;
|
|
980
990
|
getLightningAddress(): Promise<LightningAddressInfo | undefined>;
|
|
981
991
|
removeEventListener(id: string): Promise<boolean>;
|
|
992
|
+
fetchConversionLimits(request: FetchConversionLimitsRequest): Promise<FetchConversionLimitsResponse>;
|
|
982
993
|
listUnclaimedDeposits(request: ListUnclaimedDepositsRequest): Promise<ListUnclaimedDepositsResponse>;
|
|
983
994
|
startLeafOptimization(): void;
|
|
984
995
|
cancelLeafOptimization(): Promise<void>;
|
|
985
996
|
deleteLightningAddress(): Promise<void>;
|
|
986
997
|
registerLightningAddress(request: RegisterLightningAddressRequest): Promise<LightningAddressInfo>;
|
|
987
|
-
fetchTokenConversionLimits(request: FetchTokenConversionLimitsRequest): Promise<FetchTokenConversionLimitsResponse>;
|
|
988
998
|
getLeafOptimizationProgress(): OptimizationProgress;
|
|
989
999
|
checkLightningAddressAvailable(request: CheckLightningAddressRequest): Promise<boolean>;
|
|
990
1000
|
parse(input: string): Promise<InputType>;
|
|
@@ -309,11 +309,11 @@ function __wbg_adapter_64(arg0, arg1) {
|
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
function __wbg_adapter_67(arg0, arg1, arg2) {
|
|
312
|
-
wasm.
|
|
312
|
+
wasm.closure1050_externref_shim(arg0, arg1, arg2);
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
function __wbg_adapter_349(arg0, arg1, arg2, arg3) {
|
|
316
|
-
wasm.
|
|
316
|
+
wasm.closure635_externref_shim(arg0, arg1, arg2, arg3);
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
@@ -540,6 +540,14 @@ class BreezSdk {
|
|
|
540
540
|
const ret = wasm.breezsdk_removeEventListener(this.__wbg_ptr, ptr0, len0);
|
|
541
541
|
return ret;
|
|
542
542
|
}
|
|
543
|
+
/**
|
|
544
|
+
* @param {FetchConversionLimitsRequest} request
|
|
545
|
+
* @returns {Promise<FetchConversionLimitsResponse>}
|
|
546
|
+
*/
|
|
547
|
+
fetchConversionLimits(request) {
|
|
548
|
+
const ret = wasm.breezsdk_fetchConversionLimits(this.__wbg_ptr, request);
|
|
549
|
+
return ret;
|
|
550
|
+
}
|
|
543
551
|
/**
|
|
544
552
|
* @param {ListUnclaimedDepositsRequest} request
|
|
545
553
|
* @returns {Promise<ListUnclaimedDepositsResponse>}
|
|
@@ -573,14 +581,6 @@ class BreezSdk {
|
|
|
573
581
|
const ret = wasm.breezsdk_registerLightningAddress(this.__wbg_ptr, request);
|
|
574
582
|
return ret;
|
|
575
583
|
}
|
|
576
|
-
/**
|
|
577
|
-
* @param {FetchTokenConversionLimitsRequest} request
|
|
578
|
-
* @returns {Promise<FetchTokenConversionLimitsResponse>}
|
|
579
|
-
*/
|
|
580
|
-
fetchTokenConversionLimits(request) {
|
|
581
|
-
const ret = wasm.breezsdk_fetchTokenConversionLimits(this.__wbg_ptr, request);
|
|
582
|
-
return ret;
|
|
583
|
-
}
|
|
584
584
|
/**
|
|
585
585
|
* @returns {OptimizationProgress}
|
|
586
586
|
*/
|
|
@@ -2358,13 +2358,13 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
2358
2358
|
return ret;
|
|
2359
2359
|
};
|
|
2360
2360
|
|
|
2361
|
-
module.exports.
|
|
2362
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2361
|
+
module.exports.__wbindgen_closure_wrapper11216 = function(arg0, arg1, arg2) {
|
|
2362
|
+
const ret = makeMutClosure(arg0, arg1, 815, __wbg_adapter_64);
|
|
2363
2363
|
return ret;
|
|
2364
2364
|
};
|
|
2365
2365
|
|
|
2366
|
-
module.exports.
|
|
2367
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2366
|
+
module.exports.__wbindgen_closure_wrapper13122 = function(arg0, arg1, arg2) {
|
|
2367
|
+
const ret = makeMutClosure(arg0, arg1, 1051, __wbg_adapter_67);
|
|
2368
2368
|
return ret;
|
|
2369
2369
|
};
|
|
2370
2370
|
|
|
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;
|
|
@@ -110,6 +110,6 @@ export const __externref_drop_slice: (a: number, b: number) => void;
|
|
|
110
110
|
export const __wbindgen_export_7: WebAssembly.Table;
|
|
111
111
|
export const __externref_table_dealloc: (a: number) => void;
|
|
112
112
|
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
|
|
113
|
+
export const closure1050_externref_shim: (a: number, b: number, c: any) => void;
|
|
114
|
+
export const closure635_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
115
115
|
export const __wbindgen_start: () => void;
|
package/nodejs/storage/index.cjs
CHANGED
|
@@ -179,14 +179,13 @@ class SqliteStorage {
|
|
|
179
179
|
paymentDetailsFilter.conversionRefundNeeded !== undefined
|
|
180
180
|
) {
|
|
181
181
|
const typeCheck = paymentDetailsFilter.type === "spark" ? "p.spark = 1" : "p.spark IS NULL";
|
|
182
|
-
const
|
|
182
|
+
const refundNeeded =
|
|
183
183
|
paymentDetailsFilter.conversionRefundNeeded === true
|
|
184
|
-
? "
|
|
185
|
-
: "
|
|
184
|
+
? "= 'refundNeeded'"
|
|
185
|
+
: "!= 'refundNeeded'";
|
|
186
186
|
paymentDetailsClauses.push(
|
|
187
|
-
`${typeCheck} AND pm.
|
|
188
|
-
json_extract(pm.
|
|
189
|
-
json_extract(pm.token_conversion_info, '$.refundIdentifier') ${nullCheck}`
|
|
187
|
+
`${typeCheck} AND pm.conversion_info IS NOT NULL AND
|
|
188
|
+
json_extract(pm.conversion_info, '$.status') ${refundNeeded}`
|
|
190
189
|
);
|
|
191
190
|
}
|
|
192
191
|
// Filter by token transaction hash
|
|
@@ -247,7 +246,7 @@ class SqliteStorage {
|
|
|
247
246
|
, l.preimage AS lightning_preimage
|
|
248
247
|
, pm.lnurl_pay_info
|
|
249
248
|
, pm.lnurl_withdraw_info
|
|
250
|
-
, pm.
|
|
249
|
+
, pm.conversion_info
|
|
251
250
|
, t.metadata AS token_metadata
|
|
252
251
|
, t.tx_hash AS token_tx_hash
|
|
253
252
|
, t.invoice_details AS token_invoice_details
|
|
@@ -427,7 +426,7 @@ class SqliteStorage {
|
|
|
427
426
|
, l.preimage AS lightning_preimage
|
|
428
427
|
, pm.lnurl_pay_info
|
|
429
428
|
, pm.lnurl_withdraw_info
|
|
430
|
-
, pm.
|
|
429
|
+
, pm.conversion_info
|
|
431
430
|
, t.metadata AS token_metadata
|
|
432
431
|
, t.tx_hash AS token_tx_hash
|
|
433
432
|
, t.invoice_details AS token_invoice_details
|
|
@@ -491,7 +490,7 @@ class SqliteStorage {
|
|
|
491
490
|
, l.preimage AS lightning_preimage
|
|
492
491
|
, pm.lnurl_pay_info
|
|
493
492
|
, pm.lnurl_withdraw_info
|
|
494
|
-
, pm.
|
|
493
|
+
, pm.conversion_info
|
|
495
494
|
, t.metadata AS token_metadata
|
|
496
495
|
, t.tx_hash AS token_tx_hash
|
|
497
496
|
, t.invoice_details AS token_invoice_details
|
|
@@ -530,7 +529,7 @@ class SqliteStorage {
|
|
|
530
529
|
setPaymentMetadata(paymentId, metadata) {
|
|
531
530
|
try {
|
|
532
531
|
const stmt = this.db.prepare(`
|
|
533
|
-
INSERT OR REPLACE INTO payment_metadata (payment_id, parent_payment_id, lnurl_pay_info, lnurl_withdraw_info, lnurl_description,
|
|
532
|
+
INSERT OR REPLACE INTO payment_metadata (payment_id, parent_payment_id, lnurl_pay_info, lnurl_withdraw_info, lnurl_description, conversion_info)
|
|
534
533
|
VALUES (?, ?, ?, ?, ?, ?)
|
|
535
534
|
`);
|
|
536
535
|
|
|
@@ -542,8 +541,8 @@ class SqliteStorage {
|
|
|
542
541
|
? JSON.stringify(metadata.lnurlWithdrawInfo)
|
|
543
542
|
: null,
|
|
544
543
|
metadata.lnurlDescription,
|
|
545
|
-
metadata.
|
|
546
|
-
? JSON.stringify(metadata.
|
|
544
|
+
metadata.conversionInfo
|
|
545
|
+
? JSON.stringify(metadata.conversionInfo)
|
|
547
546
|
: null
|
|
548
547
|
);
|
|
549
548
|
return Promise.resolve();
|
|
@@ -747,8 +746,8 @@ class SqliteStorage {
|
|
|
747
746
|
htlcDetails: row.spark_htlc_details
|
|
748
747
|
? JSON.parse(row.spark_htlc_details)
|
|
749
748
|
: null,
|
|
750
|
-
|
|
751
|
-
? JSON.parse(row.
|
|
749
|
+
conversionInfo: row.conversion_info
|
|
750
|
+
? JSON.parse(row.conversion_info)
|
|
752
751
|
: null,
|
|
753
752
|
};
|
|
754
753
|
} else if (row.token_metadata) {
|
|
@@ -759,8 +758,8 @@ class SqliteStorage {
|
|
|
759
758
|
invoiceDetails: row.token_invoice_details
|
|
760
759
|
? JSON.parse(row.token_invoice_details)
|
|
761
760
|
: null,
|
|
762
|
-
|
|
763
|
-
? JSON.parse(row.
|
|
761
|
+
conversionInfo: row.conversion_info
|
|
762
|
+
? JSON.parse(row.conversion_info)
|
|
764
763
|
: null,
|
|
765
764
|
};
|
|
766
765
|
}
|
|
@@ -315,6 +315,12 @@ class MigrationManager {
|
|
|
315
315
|
name: "Add parent payment id to payment_metadata",
|
|
316
316
|
sql: `ALTER TABLE payment_metadata ADD COLUMN parent_payment_id TEXT`
|
|
317
317
|
},
|
|
318
|
+
{
|
|
319
|
+
name: "Add conversion info to payment_metadata",
|
|
320
|
+
sql: [
|
|
321
|
+
`ALTER TABLE payment_metadata DROP COLUMN token_conversion_info`,
|
|
322
|
+
`ALTER TABLE payment_metadata ADD COLUMN conversion_info TEXT`]
|
|
323
|
+
},
|
|
318
324
|
];
|
|
319
325
|
}
|
|
320
326
|
}
|
package/package.json
CHANGED
|
@@ -87,7 +87,7 @@ export interface ListUnclaimedDepositsResponse {
|
|
|
87
87
|
deposits: DepositInfo[];
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?:
|
|
90
|
+
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: string; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress" } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number };
|
|
91
91
|
|
|
92
92
|
export interface SparkHtlcDetails {
|
|
93
93
|
paymentHash: string;
|
|
@@ -119,7 +119,7 @@ export interface PrepareSendPaymentRequest {
|
|
|
119
119
|
paymentRequest: string;
|
|
120
120
|
amount?: bigint;
|
|
121
121
|
tokenIdentifier?: string;
|
|
122
|
-
|
|
122
|
+
conversionOptions?: ConversionOptions;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
export interface CurrencyInfo {
|
|
@@ -132,7 +132,7 @@ export interface CurrencyInfo {
|
|
|
132
132
|
localeOverrides: LocaleOverrides[];
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee:
|
|
135
|
+
export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string };
|
|
136
136
|
|
|
137
137
|
export interface CheckLightningAddressRequest {
|
|
138
138
|
username: string;
|
|
@@ -163,7 +163,7 @@ export interface TokenMetadata {
|
|
|
163
163
|
name: string;
|
|
164
164
|
ticker: string;
|
|
165
165
|
decimals: number;
|
|
166
|
-
maxSupply:
|
|
166
|
+
maxSupply: string;
|
|
167
167
|
isFreezable: boolean;
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -238,6 +238,11 @@ export interface LnurlPayRequest {
|
|
|
238
238
|
idempotencyKey?: string;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
+
export interface FetchConversionLimitsResponse {
|
|
242
|
+
minFromAmount?: bigint;
|
|
243
|
+
minToAmount?: bigint;
|
|
244
|
+
}
|
|
245
|
+
|
|
241
246
|
export interface ExternalInputParser {
|
|
242
247
|
providerId: string;
|
|
243
248
|
inputRegex: string;
|
|
@@ -331,6 +336,11 @@ export interface OptimizationConfig {
|
|
|
331
336
|
multiplicity: number;
|
|
332
337
|
}
|
|
333
338
|
|
|
339
|
+
export interface FetchConversionLimitsRequest {
|
|
340
|
+
conversionType: ConversionType;
|
|
341
|
+
tokenIdentifier?: string;
|
|
342
|
+
}
|
|
343
|
+
|
|
334
344
|
export interface Bolt11InvoiceDetails {
|
|
335
345
|
amountMsat?: number;
|
|
336
346
|
description?: string;
|
|
@@ -352,11 +362,7 @@ export interface MessageSuccessActionData {
|
|
|
352
362
|
message: string;
|
|
353
363
|
}
|
|
354
364
|
|
|
355
|
-
export
|
|
356
|
-
conversionType: TokenConversionType;
|
|
357
|
-
maxSlippageBps?: number;
|
|
358
|
-
completionTimeoutSecs?: number;
|
|
359
|
-
}
|
|
365
|
+
export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" };
|
|
360
366
|
|
|
361
367
|
export type PaymentType = "send" | "receive";
|
|
362
368
|
|
|
@@ -392,11 +398,10 @@ export interface RecordChange {
|
|
|
392
398
|
revision: number;
|
|
393
399
|
}
|
|
394
400
|
|
|
395
|
-
export interface
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
fee
|
|
399
|
-
refundIdentifier?: string;
|
|
401
|
+
export interface ConversionEstimate {
|
|
402
|
+
options: ConversionOptions;
|
|
403
|
+
amount: bigint;
|
|
404
|
+
fee: bigint;
|
|
400
405
|
}
|
|
401
406
|
|
|
402
407
|
export interface LnurlWithdrawRequestDetails {
|
|
@@ -459,9 +464,10 @@ export interface ListPaymentsResponse {
|
|
|
459
464
|
payments: Payment[];
|
|
460
465
|
}
|
|
461
466
|
|
|
462
|
-
export interface
|
|
463
|
-
|
|
464
|
-
|
|
467
|
+
export interface ConversionOptions {
|
|
468
|
+
conversionType: ConversionType;
|
|
469
|
+
maxSlippageBps?: number;
|
|
470
|
+
completionTimeoutSecs?: number;
|
|
465
471
|
}
|
|
466
472
|
|
|
467
473
|
export interface SyncWalletResponse {}
|
|
@@ -474,9 +480,12 @@ export interface LnurlWithdrawRequest {
|
|
|
474
480
|
|
|
475
481
|
export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
|
|
476
482
|
|
|
477
|
-
export interface
|
|
478
|
-
|
|
479
|
-
|
|
483
|
+
export interface ConversionInfo {
|
|
484
|
+
poolId: string;
|
|
485
|
+
conversionId: string;
|
|
486
|
+
status: ConversionStatus;
|
|
487
|
+
fee?: string;
|
|
488
|
+
purpose?: ConversionPurpose;
|
|
480
489
|
}
|
|
481
490
|
|
|
482
491
|
export interface SendOnchainSpeedFeeQuote {
|
|
@@ -571,7 +580,7 @@ export interface RefundDepositResponse {
|
|
|
571
580
|
txHex: string;
|
|
572
581
|
}
|
|
573
582
|
|
|
574
|
-
export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails;
|
|
583
|
+
export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails; conversionInfo?: ConversionInfo } | { type: "token"; metadata: TokenMetadata; txHash: string; invoiceDetails?: SparkInvoicePaymentDetails; conversionInfo?: ConversionInfo } | { type: "lightning"; description?: string; preimage?: string; invoice: string; paymentHash: string; destinationPubkey: string; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo; lnurlReceiveMetadata?: LnurlReceiveMetadata } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
|
|
575
584
|
|
|
576
585
|
export interface RecordId {
|
|
577
586
|
type: string;
|
|
@@ -644,7 +653,7 @@ export interface PaymentMetadata {
|
|
|
644
653
|
lnurlPayInfo?: LnurlPayInfo;
|
|
645
654
|
lnurlWithdrawInfo?: LnurlWithdrawInfo;
|
|
646
655
|
lnurlDescription?: string;
|
|
647
|
-
|
|
656
|
+
conversionInfo?: ConversionInfo;
|
|
648
657
|
}
|
|
649
658
|
|
|
650
659
|
export interface ClaimDepositResponse {
|
|
@@ -705,7 +714,7 @@ export interface Credentials {
|
|
|
705
714
|
password: string;
|
|
706
715
|
}
|
|
707
716
|
|
|
708
|
-
export type
|
|
717
|
+
export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
|
|
709
718
|
|
|
710
719
|
export interface GetPaymentResponse {
|
|
711
720
|
payment: Payment;
|
|
@@ -715,13 +724,15 @@ export interface SparkInvoiceDetails {
|
|
|
715
724
|
invoice: string;
|
|
716
725
|
identityPublicKey: string;
|
|
717
726
|
network: BitcoinNetwork;
|
|
718
|
-
amount?:
|
|
727
|
+
amount?: string;
|
|
719
728
|
tokenIdentifier?: string;
|
|
720
729
|
expiryTime?: number;
|
|
721
730
|
description?: string;
|
|
722
731
|
senderPublicKey?: string;
|
|
723
732
|
}
|
|
724
733
|
|
|
734
|
+
export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
|
|
735
|
+
|
|
725
736
|
export interface GetTokensMetadataResponse {
|
|
726
737
|
tokensMetadata: TokenMetadata[];
|
|
727
738
|
}
|
|
@@ -738,8 +749,7 @@ export interface PrepareSendPaymentResponse {
|
|
|
738
749
|
paymentMethod: SendPaymentMethod;
|
|
739
750
|
amount: bigint;
|
|
740
751
|
tokenIdentifier?: string;
|
|
741
|
-
|
|
742
|
-
tokenConversionFee?: bigint;
|
|
752
|
+
conversionEstimate?: ConversionEstimate;
|
|
743
753
|
}
|
|
744
754
|
|
|
745
755
|
export interface OutgoingChange {
|
|
@@ -979,12 +989,12 @@ export class BreezSdk {
|
|
|
979
989
|
updateUserSettings(request: UpdateUserSettingsRequest): Promise<void>;
|
|
980
990
|
getLightningAddress(): Promise<LightningAddressInfo | undefined>;
|
|
981
991
|
removeEventListener(id: string): Promise<boolean>;
|
|
992
|
+
fetchConversionLimits(request: FetchConversionLimitsRequest): Promise<FetchConversionLimitsResponse>;
|
|
982
993
|
listUnclaimedDeposits(request: ListUnclaimedDepositsRequest): Promise<ListUnclaimedDepositsResponse>;
|
|
983
994
|
startLeafOptimization(): void;
|
|
984
995
|
cancelLeafOptimization(): Promise<void>;
|
|
985
996
|
deleteLightningAddress(): Promise<void>;
|
|
986
997
|
registerLightningAddress(request: RegisterLightningAddressRequest): Promise<LightningAddressInfo>;
|
|
987
|
-
fetchTokenConversionLimits(request: FetchTokenConversionLimitsRequest): Promise<FetchTokenConversionLimitsResponse>;
|
|
988
998
|
getLeafOptimizationProgress(): OptimizationProgress;
|
|
989
999
|
checkLightningAddressAvailable(request: CheckLightningAddressRequest): Promise<boolean>;
|
|
990
1000
|
parse(input: string): Promise<InputType>;
|
|
@@ -1083,7 +1093,7 @@ export interface InitOutput {
|
|
|
1083
1093
|
readonly breezsdk_claimHtlcPayment: (a: number, b: any) => any;
|
|
1084
1094
|
readonly breezsdk_deleteLightningAddress: (a: number) => any;
|
|
1085
1095
|
readonly breezsdk_disconnect: (a: number) => any;
|
|
1086
|
-
readonly
|
|
1096
|
+
readonly breezsdk_fetchConversionLimits: (a: number, b: any) => any;
|
|
1087
1097
|
readonly breezsdk_getInfo: (a: number, b: any) => any;
|
|
1088
1098
|
readonly breezsdk_getLeafOptimizationProgress: (a: number) => any;
|
|
1089
1099
|
readonly breezsdk_getLightningAddress: (a: number) => any;
|
|
@@ -1180,8 +1190,8 @@ export interface InitOutput {
|
|
|
1180
1190
|
readonly __wbindgen_export_7: WebAssembly.Table;
|
|
1181
1191
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
1182
1192
|
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hdf0ebd5238280272: (a: number, b: number) => void;
|
|
1183
|
-
readonly
|
|
1184
|
-
readonly
|
|
1193
|
+
readonly closure1050_externref_shim: (a: number, b: number, c: any) => void;
|
|
1194
|
+
readonly closure635_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
1185
1195
|
readonly __wbindgen_start: () => void;
|
|
1186
1196
|
}
|
|
1187
1197
|
|
|
@@ -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.closure1050_externref_shim(arg0, arg1, arg2);
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
function __wbg_adapter_349(arg0, arg1, arg2, arg3) {
|
|
312
|
-
wasm.
|
|
312
|
+
wasm.closure635_externref_shim(arg0, arg1, arg2, arg3);
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
@@ -536,6 +536,14 @@ export class BreezSdk {
|
|
|
536
536
|
const ret = wasm.breezsdk_removeEventListener(this.__wbg_ptr, ptr0, len0);
|
|
537
537
|
return ret;
|
|
538
538
|
}
|
|
539
|
+
/**
|
|
540
|
+
* @param {FetchConversionLimitsRequest} request
|
|
541
|
+
* @returns {Promise<FetchConversionLimitsResponse>}
|
|
542
|
+
*/
|
|
543
|
+
fetchConversionLimits(request) {
|
|
544
|
+
const ret = wasm.breezsdk_fetchConversionLimits(this.__wbg_ptr, request);
|
|
545
|
+
return ret;
|
|
546
|
+
}
|
|
539
547
|
/**
|
|
540
548
|
* @param {ListUnclaimedDepositsRequest} request
|
|
541
549
|
* @returns {Promise<ListUnclaimedDepositsResponse>}
|
|
@@ -569,14 +577,6 @@ export class BreezSdk {
|
|
|
569
577
|
const ret = wasm.breezsdk_registerLightningAddress(this.__wbg_ptr, request);
|
|
570
578
|
return ret;
|
|
571
579
|
}
|
|
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
580
|
/**
|
|
581
581
|
* @returns {OptimizationProgress}
|
|
582
582
|
*/
|
|
@@ -2196,12 +2196,12 @@ function __wbg_get_imports() {
|
|
|
2196
2196
|
const ret = false;
|
|
2197
2197
|
return ret;
|
|
2198
2198
|
};
|
|
2199
|
-
imports.wbg.
|
|
2200
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2199
|
+
imports.wbg.__wbindgen_closure_wrapper11216 = function(arg0, arg1, arg2) {
|
|
2200
|
+
const ret = makeMutClosure(arg0, arg1, 815, __wbg_adapter_64);
|
|
2201
2201
|
return ret;
|
|
2202
2202
|
};
|
|
2203
|
-
imports.wbg.
|
|
2204
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2203
|
+
imports.wbg.__wbindgen_closure_wrapper13122 = function(arg0, arg1, arg2) {
|
|
2204
|
+
const ret = makeMutClosure(arg0, arg1, 1051, __wbg_adapter_67);
|
|
2205
2205
|
return ret;
|
|
2206
2206
|
};
|
|
2207
2207
|
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;
|
|
@@ -110,6 +110,6 @@ export const __externref_drop_slice: (a: number, b: number) => void;
|
|
|
110
110
|
export const __wbindgen_export_7: WebAssembly.Table;
|
|
111
111
|
export const __externref_table_dealloc: (a: number) => void;
|
|
112
112
|
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
|
|
113
|
+
export const closure1050_externref_shim: (a: number, b: number, c: any) => void;
|
|
114
|
+
export const closure635_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
115
115
|
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
|
}
|