@breeztech/breez-sdk-spark 0.23.0 → 0.24.0
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 +75 -6
- package/bundler/breez_sdk_spark_wasm_bg.js +33 -19
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -3
- package/bundler/storage/index.js +34 -3
- package/deno/breez_sdk_spark_wasm.d.ts +75 -6
- package/deno/breez_sdk_spark_wasm.js +33 -19
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -3
- package/nodejs/breez_sdk_spark_wasm.d.ts +75 -6
- package/nodejs/breez_sdk_spark_wasm.js +33 -19
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -3
- package/nodejs/mysql-storage/index.cjs +133 -5
- package/nodejs/mysql-storage/migrations.cjs +16 -0
- package/nodejs/mysql-token-store/index.cjs +108 -1
- package/nodejs/mysql-tree-store/index.cjs +108 -1
- package/nodejs/postgres-storage/index.cjs +135 -6
- package/nodejs/postgres-storage/migrations.cjs +16 -0
- package/nodejs/postgres-token-store/index.cjs +109 -1
- package/nodejs/postgres-tree-store/index.cjs +109 -1
- package/nodejs/storage/index.cjs +19 -4
- package/nodejs/storage/migrations.cjs +14 -0
- package/package.json +1 -1
- package/web/breez_sdk_spark_wasm.d.ts +80 -9
- package/web/breez_sdk_spark_wasm.js +33 -19
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +5 -3
- package/web/storage/index.js +34 -3
|
@@ -203,6 +203,12 @@ export interface Wallet {
|
|
|
203
203
|
export interface MysqlStorageConfig {
|
|
204
204
|
/**
|
|
205
205
|
* MySQL connection URL (e.g. `mysql://user:pass@host:3306/dbname`).
|
|
206
|
+
*
|
|
207
|
+
* TLS is controlled by the `ssl-mode` query parameter: `required` and
|
|
208
|
+
* `verify_identity` verify the server certificate chain and hostname,
|
|
209
|
+
* `verify_ca` verifies the chain only, `no-verify` encrypts without
|
|
210
|
+
* verification, and absent or `disabled` means no TLS. An unrecognized
|
|
211
|
+
* value fails instead of silently downgrading.
|
|
206
212
|
*/
|
|
207
213
|
connectionString: string;
|
|
208
214
|
/**
|
|
@@ -239,6 +245,13 @@ export interface MysqlStorageConfig {
|
|
|
239
245
|
export interface PostgresStorageConfig {
|
|
240
246
|
/**
|
|
241
247
|
* PostgreSQL connection string (URI format).
|
|
248
|
+
*
|
|
249
|
+
* TLS is controlled by the `sslmode` query parameter: `prefer`,
|
|
250
|
+
* `require`, and `verify-full` require TLS and verify the server
|
|
251
|
+
* certificate chain and hostname; `verify-ca` verifies the chain only;
|
|
252
|
+
* `no-verify` encrypts without verification; absent or `disable` means
|
|
253
|
+
* no TLS. An unrecognized value fails instead of silently changing the
|
|
254
|
+
* TLS level.
|
|
242
255
|
*/
|
|
243
256
|
connectionString: string;
|
|
244
257
|
/**
|
|
@@ -275,6 +288,10 @@ export interface PasskeyConfig {
|
|
|
275
288
|
* zero-config path.
|
|
276
289
|
*/
|
|
277
290
|
providerOptions?: PasskeyProviderOptions;
|
|
291
|
+
/**
|
|
292
|
+
* Always rejected here: a SOCKS5 proxy cannot be honoured on WASM.
|
|
293
|
+
*/
|
|
294
|
+
proxy?: ProxyConfig;
|
|
278
295
|
}
|
|
279
296
|
|
|
280
297
|
/**
|
|
@@ -492,6 +509,12 @@ export interface WasmSdkContextConfig {
|
|
|
492
509
|
* context store their data in MySQL via the shared pool.
|
|
493
510
|
*/
|
|
494
511
|
mysqlConfig?: MysqlStorageConfig;
|
|
512
|
+
/**
|
|
513
|
+
* Routes every connection opened by this context\'s shared clients
|
|
514
|
+
* through a SOCKS5 proxy. Not supported on WASM: setting this always
|
|
515
|
+
* fails validation.
|
|
516
|
+
*/
|
|
517
|
+
proxy?: ProxyConfig;
|
|
495
518
|
}
|
|
496
519
|
|
|
497
520
|
export interface AddContactRequest {
|
|
@@ -550,6 +573,7 @@ export interface BitcoinChainService {
|
|
|
550
573
|
getAddressUtxos(address: string): Promise<Utxo[]>;
|
|
551
574
|
getAddressTxos(address: string): Promise<Utxo[]>;
|
|
552
575
|
getTransactionStatus(txid: string): Promise<TxStatus>;
|
|
576
|
+
tipHeight(): Promise<number>;
|
|
553
577
|
getTransactionHex(txid: string): Promise<string>;
|
|
554
578
|
getOutspend(txid: string, vout: number): Promise<Outspend>;
|
|
555
579
|
broadcastTransaction(tx: string): Promise<void>;
|
|
@@ -657,11 +681,18 @@ export interface CheckMessageResponse {
|
|
|
657
681
|
isValid: boolean;
|
|
658
682
|
}
|
|
659
683
|
|
|
684
|
+
export interface ClaimDepositQuote {
|
|
685
|
+
confirmationsRequired: number;
|
|
686
|
+
creditAmountSats: number;
|
|
687
|
+
feeSats: number;
|
|
688
|
+
feeRateSatPerVbyte: number;
|
|
689
|
+
isEstimate: boolean;
|
|
690
|
+
}
|
|
691
|
+
|
|
660
692
|
export interface ClaimDepositRequest {
|
|
661
693
|
txid: string;
|
|
662
694
|
vout: number;
|
|
663
695
|
maxFee?: MaxFee;
|
|
664
|
-
maxInstantFeeBps?: number;
|
|
665
696
|
}
|
|
666
697
|
|
|
667
698
|
export interface ClaimDepositResponse {
|
|
@@ -686,7 +717,6 @@ export interface Config {
|
|
|
686
717
|
network: Network;
|
|
687
718
|
syncIntervalSecs: number;
|
|
688
719
|
maxDepositClaimFee?: MaxFee;
|
|
689
|
-
maxInstantDepositClaimFeeBps?: number;
|
|
690
720
|
lnurlDomain?: string;
|
|
691
721
|
preferSparkOverLightning: boolean;
|
|
692
722
|
exitChainAutoFetchEnabled: boolean;
|
|
@@ -707,6 +737,12 @@ export interface Config {
|
|
|
707
737
|
maxConcurrentClaims: number;
|
|
708
738
|
sparkConfig?: SparkConfig;
|
|
709
739
|
backgroundTasksEnabled: boolean;
|
|
740
|
+
/**
|
|
741
|
+
* Routes the connections the SDK opens through a SOCKS5 proxy. Not
|
|
742
|
+
* supported on WASM: setting this always fails validation, since the
|
|
743
|
+
* browser owns connection setup and exposes no proxy control.
|
|
744
|
+
*/
|
|
745
|
+
proxy?: ProxyConfig;
|
|
710
746
|
crossChainConfig?: CrossChainConfig;
|
|
711
747
|
}
|
|
712
748
|
|
|
@@ -825,6 +861,7 @@ export interface DepositInfo {
|
|
|
825
861
|
refundTxId?: string;
|
|
826
862
|
claimError?: DepositClaimError;
|
|
827
863
|
instantClaimStatus?: InstantClaimStatus;
|
|
864
|
+
refundState?: RefundState;
|
|
828
865
|
}
|
|
829
866
|
|
|
830
867
|
export interface EcdsaSignatureBytes {
|
|
@@ -1044,6 +1081,18 @@ export interface ExternalTreeNodeId {
|
|
|
1044
1081
|
id: string;
|
|
1045
1082
|
}
|
|
1046
1083
|
|
|
1084
|
+
export interface FetchClaimDepositQuoteRequest {
|
|
1085
|
+
txid: string;
|
|
1086
|
+
vout: number;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
export interface FetchClaimDepositQuoteResponse {
|
|
1090
|
+
amountSats: number;
|
|
1091
|
+
confirmations: number;
|
|
1092
|
+
instant?: ClaimDepositQuote;
|
|
1093
|
+
mature: ClaimDepositQuote;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1047
1096
|
export interface FetchConversionLimitsRequest {
|
|
1048
1097
|
conversionType: ConversionType;
|
|
1049
1098
|
tokenIdentifier?: string;
|
|
@@ -1262,6 +1311,13 @@ export interface LnurlWithdrawRequestDetails {
|
|
|
1262
1311
|
defaultDescription: string;
|
|
1263
1312
|
minWithdrawable: number;
|
|
1264
1313
|
maxWithdrawable: number;
|
|
1314
|
+
/**
|
|
1315
|
+
* The URL of the LNURL-withdraw endpoint these details were fetched from.
|
|
1316
|
+
* Set when the details come from parsing an input; determines how far the
|
|
1317
|
+
* withdraw flow trusts the endpoint-chosen `callback`. Absent or empty
|
|
1318
|
+
* means no exemption: the callback is held to the public-host rules.
|
|
1319
|
+
*/
|
|
1320
|
+
url?: string;
|
|
1265
1321
|
}
|
|
1266
1322
|
|
|
1267
1323
|
export interface LnurlWithdrawResponse {
|
|
@@ -1443,6 +1499,13 @@ export interface ProvisionalPayment {
|
|
|
1443
1499
|
details: ProvisionalPaymentDetails;
|
|
1444
1500
|
}
|
|
1445
1501
|
|
|
1502
|
+
export interface ProxyConfig {
|
|
1503
|
+
host: string;
|
|
1504
|
+
port: number;
|
|
1505
|
+
username?: string;
|
|
1506
|
+
password?: string;
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1446
1509
|
export interface PublicKeyBytes {
|
|
1447
1510
|
bytes: number[];
|
|
1448
1511
|
}
|
|
@@ -1816,6 +1879,10 @@ export interface TurnkeyConfig {
|
|
|
1816
1879
|
identityPublicKey?: string;
|
|
1817
1880
|
retry?: TurnkeyRetryConfig;
|
|
1818
1881
|
maxRps?: number;
|
|
1882
|
+
/**
|
|
1883
|
+
* Always rejected here: a SOCKS5 proxy cannot be honoured on WASM.
|
|
1884
|
+
*/
|
|
1885
|
+
proxy?: ProxyConfig;
|
|
1819
1886
|
}
|
|
1820
1887
|
|
|
1821
1888
|
export interface TurnkeyRetryConfig {
|
|
@@ -1982,9 +2049,7 @@ export type FeePolicy = "feesExcluded" | "feesIncluded";
|
|
|
1982
2049
|
|
|
1983
2050
|
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) | ({ type: "crossChainAddress" } & CrossChainAddressDetails);
|
|
1984
2051
|
|
|
1985
|
-
export type
|
|
1986
|
-
|
|
1987
|
-
export type InstantClaimStatus = { type: "declined"; reason: InstantClaimDeclineReason } | { type: "submitted"; claimId: string };
|
|
2052
|
+
export type InstantClaimStatus = { type: "declined"; maxFeeSats?: number; confirmations?: number } | { type: "submitted"; claimId: string };
|
|
1988
2053
|
|
|
1989
2054
|
export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
|
|
1990
2055
|
|
|
@@ -2020,6 +2085,8 @@ export type PublishSignedTransferPackageResponse = { type: "swapCompleted" } | {
|
|
|
2020
2085
|
|
|
2021
2086
|
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: string; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress"; newAddress?: boolean } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number; paymentHash?: string; receiverIdentityPublicKey?: string };
|
|
2022
2087
|
|
|
2088
|
+
export type RefundState = { type: "broadcastPending"; lastError?: string } | { type: "broadcast" };
|
|
2089
|
+
|
|
2023
2090
|
export type SdkEvent = { type: "synced" } | { type: "unclaimedDeposits"; unclaimedDeposits: DepositInfo[] } | { type: "claimedDeposits"; claimedDeposits: DepositInfo[] } | { type: "paymentSucceeded"; payment: Payment } | { type: "paymentPending"; payment: Payment } | { type: "paymentFailed"; payment: Payment } | { type: "autoOptimization"; optimizationEvent: AutoOptimizationEvent } | { type: "lightningAddressChanged"; lightningAddress?: LightningAddressInfo } | { type: "newDeposits"; newDeposits: DepositInfo[] } | { type: "unilateralExitStateChanged" };
|
|
2024
2091
|
|
|
2025
2092
|
export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
|
|
@@ -2060,7 +2127,7 @@ export type UnilateralExitTxKind = "fanOut" | "node" | "refund" | "sweep";
|
|
|
2060
2127
|
|
|
2061
2128
|
export type UnsignedTransferPackage = { type: "swap"; prepareTransfer: ExternalPrepareTransferRequest; targetAmounts: number[]; amountSat: number; feeSat: number } | { type: "transfer"; prepareTransfer: ExternalPrepareTransferRequest; amountSat: number; feeSat: number; target: TransferTarget } | { type: "token"; prepareTokenTransaction: ExternalPrepareTokenTransactionRequest; tokenContext: number[]; tokenIdentifier: string; amount: string; fee: string; isSwap: boolean } | { type: "tokenBatch"; prepareTokenTransaction: ExternalPrepareTokenTransactionRequest; tokenContext: number[]; totals: BatchTotal[]; isSwap: boolean };
|
|
2062
2129
|
|
|
2063
|
-
export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string } | { type: "instantClaim"; status: InstantClaimStatus };
|
|
2130
|
+
export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string; state: RefundState } | { type: "instantClaim"; status: InstantClaimStatus } | { type: "refundBroadcastState"; refundTxid: string; state: RefundState };
|
|
2064
2131
|
|
|
2065
2132
|
export type WebhookEventType = { type: "lightningReceiveFinished" } | { type: "lightningSendFinished" } | { type: "coopExitFinished" } | { type: "staticDepositFinished" } | ({ type: "unknown" } & string);
|
|
2066
2133
|
|
|
@@ -2084,6 +2151,7 @@ export class BitcoinChainServiceHandle {
|
|
|
2084
2151
|
getTransactionHex(txid: string): Promise<any>;
|
|
2085
2152
|
getTransactionStatus(txid: string): Promise<any>;
|
|
2086
2153
|
recommendedFees(): Promise<any>;
|
|
2154
|
+
tipHeight(): Promise<any>;
|
|
2087
2155
|
}
|
|
2088
2156
|
|
|
2089
2157
|
export class BreezSdk {
|
|
@@ -2106,6 +2174,7 @@ export class BreezSdk {
|
|
|
2106
2174
|
deleteLightningAddress(): Promise<void>;
|
|
2107
2175
|
disconnect(): Promise<void>;
|
|
2108
2176
|
exportUnilateralExitState(): Promise<ExportUnilateralExitStateResponse>;
|
|
2177
|
+
fetchClaimDepositQuote(request: FetchClaimDepositQuoteRequest): Promise<FetchClaimDepositQuoteResponse>;
|
|
2109
2178
|
fetchConversionLimits(request: FetchConversionLimitsRequest): Promise<FetchConversionLimitsResponse>;
|
|
2110
2179
|
getCrossChainRoutes(filter: CrossChainRouteFilter): Promise<CrossChainRoutePair[]>;
|
|
2111
2180
|
getInfo(request: GetInfoRequest): Promise<GetInfoResponse>;
|
|
@@ -2619,6 +2688,7 @@ export interface InitOutput {
|
|
|
2619
2688
|
readonly bitcoinchainservicehandle_getTransactionHex: (a: number, b: number, c: number) => any;
|
|
2620
2689
|
readonly bitcoinchainservicehandle_getTransactionStatus: (a: number, b: number, c: number) => any;
|
|
2621
2690
|
readonly bitcoinchainservicehandle_recommendedFees: (a: number) => any;
|
|
2691
|
+
readonly bitcoinchainservicehandle_tipHeight: (a: number) => any;
|
|
2622
2692
|
readonly breezsdk_addContact: (a: number, b: any) => any;
|
|
2623
2693
|
readonly breezsdk_addEventListener: (a: number, b: any) => any;
|
|
2624
2694
|
readonly breezsdk_authorizeLightningAddressTransfer: (a: number, b: any) => any;
|
|
@@ -2635,6 +2705,7 @@ export interface InitOutput {
|
|
|
2635
2705
|
readonly breezsdk_deleteLightningAddress: (a: number) => any;
|
|
2636
2706
|
readonly breezsdk_disconnect: (a: number) => any;
|
|
2637
2707
|
readonly breezsdk_exportUnilateralExitState: (a: number) => any;
|
|
2708
|
+
readonly breezsdk_fetchClaimDepositQuote: (a: number, b: any) => any;
|
|
2638
2709
|
readonly breezsdk_fetchConversionLimits: (a: number, b: any) => any;
|
|
2639
2710
|
readonly breezsdk_getCrossChainRoutes: (a: number, b: any) => any;
|
|
2640
2711
|
readonly breezsdk_getInfo: (a: number, b: any) => any;
|
|
@@ -2729,7 +2800,7 @@ export interface InitOutput {
|
|
|
2729
2800
|
readonly passkeyclient_checkAvailability: (a: number) => any;
|
|
2730
2801
|
readonly passkeyclient_connectWithPasskey: (a: number, b: any) => any;
|
|
2731
2802
|
readonly passkeyclient_labels: (a: number) => number;
|
|
2732
|
-
readonly passkeyclient_new: (a: any, b: number, c: number, d: number) => number;
|
|
2803
|
+
readonly passkeyclient_new: (a: any, b: number, c: number, d: number) => [number, number, number];
|
|
2733
2804
|
readonly passkeyclient_register: (a: number, b: any) => any;
|
|
2734
2805
|
readonly passkeyclient_signIn: (a: number, b: any) => any;
|
|
2735
2806
|
readonly passkeyclient_supportsImmediateMediation: (a: number) => any;
|
|
@@ -2782,8 +2853,8 @@ export interface InitOutput {
|
|
|
2782
2853
|
readonly intounderlyingsource_pull: (a: number, b: any) => any;
|
|
2783
2854
|
readonly __wbg_externalbreezsignerhandle_free: (a: number, b: number) => void;
|
|
2784
2855
|
readonly __wbg_defaultsessionstore_free: (a: number, b: number) => void;
|
|
2785
|
-
readonly __wbg_externalsparksignerhandle_free: (a: number, b: number) => void;
|
|
2786
2856
|
readonly __wbg_externalsigningsignerhandle_free: (a: number, b: number) => void;
|
|
2857
|
+
readonly __wbg_externalsparksignerhandle_free: (a: number, b: number) => void;
|
|
2787
2858
|
readonly __wbg_signingonlyexternalsigners_free: (a: number, b: number) => void;
|
|
2788
2859
|
readonly signingonlyexternalsigners_breezSigner: (a: number) => number;
|
|
2789
2860
|
readonly signingonlyexternalsigners_sparkSigner: (a: number) => number;
|
|
@@ -2798,7 +2869,7 @@ export interface InitOutput {
|
|
|
2798
2869
|
readonly wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3: (a: number, b: number, c: any) => void;
|
|
2799
2870
|
readonly wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4: (a: number, b: number, c: any) => void;
|
|
2800
2871
|
readonly wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5: (a: number, b: number, c: any) => void;
|
|
2801
|
-
readonly
|
|
2872
|
+
readonly wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7: (a: number, b: number) => void;
|
|
2802
2873
|
readonly wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e: (a: number, b: number) => void;
|
|
2803
2874
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
2804
2875
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
@@ -93,6 +93,13 @@ export class BitcoinChainServiceHandle {
|
|
|
93
93
|
const ret = wasm.bitcoinchainservicehandle_recommendedFees(this.__wbg_ptr);
|
|
94
94
|
return ret;
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* @returns {Promise<any>}
|
|
98
|
+
*/
|
|
99
|
+
tipHeight() {
|
|
100
|
+
const ret = wasm.bitcoinchainservicehandle_tipHeight(this.__wbg_ptr);
|
|
101
|
+
return ret;
|
|
102
|
+
}
|
|
96
103
|
}
|
|
97
104
|
if (Symbol.dispose) BitcoinChainServiceHandle.prototype[Symbol.dispose] = BitcoinChainServiceHandle.prototype.free;
|
|
98
105
|
|
|
@@ -240,6 +247,14 @@ export class BreezSdk {
|
|
|
240
247
|
const ret = wasm.breezsdk_exportUnilateralExitState(this.__wbg_ptr);
|
|
241
248
|
return ret;
|
|
242
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* @param {FetchClaimDepositQuoteRequest} request
|
|
252
|
+
* @returns {Promise<FetchClaimDepositQuoteResponse>}
|
|
253
|
+
*/
|
|
254
|
+
fetchClaimDepositQuote(request) {
|
|
255
|
+
const ret = wasm.breezsdk_fetchClaimDepositQuote(this.__wbg_ptr, request);
|
|
256
|
+
return ret;
|
|
257
|
+
}
|
|
243
258
|
/**
|
|
244
259
|
* @param {FetchConversionLimitsRequest} request
|
|
245
260
|
* @returns {Promise<FetchConversionLimitsResponse>}
|
|
@@ -1220,7 +1235,10 @@ export class PasskeyClient {
|
|
|
1220
1235
|
var ptr0 = isLikeNone(breez_api_key) ? 0 : passStringToWasm0(breez_api_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1221
1236
|
var len0 = WASM_VECTOR_LEN;
|
|
1222
1237
|
const ret = wasm.passkeyclient_new(prf_provider, ptr0, len0, isLikeNone(config) ? 0 : addToExternrefTable0(config));
|
|
1223
|
-
|
|
1238
|
+
if (ret[2]) {
|
|
1239
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1240
|
+
}
|
|
1241
|
+
this.__wbg_ptr = ret[0];
|
|
1224
1242
|
PasskeyClientFinalization.register(this, this.__wbg_ptr, this);
|
|
1225
1243
|
return this;
|
|
1226
1244
|
}
|
|
@@ -2102,10 +2120,6 @@ function __wbg_get_imports() {
|
|
|
2102
2120
|
const ret = arg0.applyPaymentUpdate(arg1);
|
|
2103
2121
|
return ret;
|
|
2104
2122
|
}, arguments); },
|
|
2105
|
-
__wbg_arrayBuffer_87e3ac06d961f7a0: function() { return handleError(function (arg0) {
|
|
2106
|
-
const ret = arg0.arrayBuffer();
|
|
2107
|
-
return ret;
|
|
2108
|
-
}, arguments); },
|
|
2109
2123
|
__wbg_beforeSend_e8a50acd6afd73ed: function() { return handleError(function (arg0, arg1, arg2) {
|
|
2110
2124
|
var v0 = getArrayJsValueFromWasm0(arg1, arg2).slice();
|
|
2111
2125
|
wasm.__wbindgen_free(arg1, arg2 * 4, 4);
|
|
@@ -3504,10 +3518,6 @@ function __wbg_get_imports() {
|
|
|
3504
3518
|
const ret = arg0.syncUpdateRecordFromIncoming(arg1);
|
|
3505
3519
|
return ret;
|
|
3506
3520
|
}, arguments); },
|
|
3507
|
-
__wbg_text_de416916b5c06490: function() { return handleError(function (arg0) {
|
|
3508
|
-
const ret = arg0.text();
|
|
3509
|
-
return ret;
|
|
3510
|
-
}, arguments); },
|
|
3511
3521
|
__wbg_then_20a157d939b514f5: function(arg0, arg1) {
|
|
3512
3522
|
const ret = arg0.then(arg1);
|
|
3513
3523
|
return ret;
|
|
@@ -3516,6 +3526,10 @@ function __wbg_get_imports() {
|
|
|
3516
3526
|
const ret = arg0.then(arg1, arg2);
|
|
3517
3527
|
return ret;
|
|
3518
3528
|
},
|
|
3529
|
+
__wbg_tipHeight_e14ddf8ed9a68d5a: function() { return handleError(function (arg0) {
|
|
3530
|
+
const ret = arg0.tipHeight();
|
|
3531
|
+
return ret;
|
|
3532
|
+
}, arguments); },
|
|
3519
3533
|
__wbg_toString_15656af8d8e71f16: function(arg0, arg1, arg2) {
|
|
3520
3534
|
const ret = arg1.toString(arg2);
|
|
3521
3535
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -3623,27 +3637,27 @@ function __wbg_get_imports() {
|
|
|
3623
3637
|
return ret;
|
|
3624
3638
|
},
|
|
3625
3639
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
3626
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
3640
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3627
3641
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2);
|
|
3628
3642
|
return ret;
|
|
3629
3643
|
},
|
|
3630
3644
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
3631
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx:
|
|
3645
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3632
3646
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_2);
|
|
3633
3647
|
return ret;
|
|
3634
3648
|
},
|
|
3635
3649
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
3636
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx:
|
|
3650
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3637
3651
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3);
|
|
3638
3652
|
return ret;
|
|
3639
3653
|
},
|
|
3640
3654
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
3641
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx:
|
|
3655
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3642
3656
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4);
|
|
3643
3657
|
return ret;
|
|
3644
3658
|
},
|
|
3645
3659
|
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
3646
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx:
|
|
3660
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3647
3661
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5);
|
|
3648
3662
|
return ret;
|
|
3649
3663
|
},
|
|
@@ -3668,12 +3682,12 @@ function __wbg_get_imports() {
|
|
|
3668
3682
|
return ret;
|
|
3669
3683
|
},
|
|
3670
3684
|
__wbindgen_cast_000000000000000b: function(arg0, arg1) {
|
|
3671
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
3672
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3685
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3686
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7);
|
|
3673
3687
|
return ret;
|
|
3674
3688
|
},
|
|
3675
3689
|
__wbindgen_cast_000000000000000c: function(arg0, arg1) {
|
|
3676
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
3690
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 434, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
|
3677
3691
|
const ret = makeClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e);
|
|
3678
3692
|
return ret;
|
|
3679
3693
|
},
|
|
@@ -3765,8 +3779,8 @@ function __wbg_get_imports() {
|
|
|
3765
3779
|
};
|
|
3766
3780
|
}
|
|
3767
3781
|
|
|
3768
|
-
function
|
|
3769
|
-
wasm.
|
|
3782
|
+
function wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7(arg0, arg1) {
|
|
3783
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7(arg0, arg1);
|
|
3770
3784
|
}
|
|
3771
3785
|
|
|
3772
3786
|
function wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e(arg0, arg1) {
|
|
Binary file
|
|
@@ -18,6 +18,7 @@ export const bitcoinchainservicehandle_getOutspend: (a: number, b: number, c: nu
|
|
|
18
18
|
export const bitcoinchainservicehandle_getTransactionHex: (a: number, b: number, c: number) => any;
|
|
19
19
|
export const bitcoinchainservicehandle_getTransactionStatus: (a: number, b: number, c: number) => any;
|
|
20
20
|
export const bitcoinchainservicehandle_recommendedFees: (a: number) => any;
|
|
21
|
+
export const bitcoinchainservicehandle_tipHeight: (a: number) => any;
|
|
21
22
|
export const breezsdk_addContact: (a: number, b: any) => any;
|
|
22
23
|
export const breezsdk_addEventListener: (a: number, b: any) => any;
|
|
23
24
|
export const breezsdk_authorizeLightningAddressTransfer: (a: number, b: any) => any;
|
|
@@ -34,6 +35,7 @@ export const breezsdk_deleteContact: (a: number, b: number, c: number) => any;
|
|
|
34
35
|
export const breezsdk_deleteLightningAddress: (a: number) => any;
|
|
35
36
|
export const breezsdk_disconnect: (a: number) => any;
|
|
36
37
|
export const breezsdk_exportUnilateralExitState: (a: number) => any;
|
|
38
|
+
export const breezsdk_fetchClaimDepositQuote: (a: number, b: any) => any;
|
|
37
39
|
export const breezsdk_fetchConversionLimits: (a: number, b: any) => any;
|
|
38
40
|
export const breezsdk_getCrossChainRoutes: (a: number, b: any) => any;
|
|
39
41
|
export const breezsdk_getInfo: (a: number, b: any) => any;
|
|
@@ -128,7 +130,7 @@ export const newSharedSdkContext: (a: any) => any;
|
|
|
128
130
|
export const passkeyclient_checkAvailability: (a: number) => any;
|
|
129
131
|
export const passkeyclient_connectWithPasskey: (a: number, b: any) => any;
|
|
130
132
|
export const passkeyclient_labels: (a: number) => number;
|
|
131
|
-
export const passkeyclient_new: (a: any, b: number, c: number, d: number) => number;
|
|
133
|
+
export const passkeyclient_new: (a: any, b: number, c: number, d: number) => [number, number, number];
|
|
132
134
|
export const passkeyclient_register: (a: number, b: any) => any;
|
|
133
135
|
export const passkeyclient_signIn: (a: number, b: any) => any;
|
|
134
136
|
export const passkeyclient_supportsImmediateMediation: (a: number) => any;
|
|
@@ -181,8 +183,8 @@ export const intounderlyingsource_cancel: (a: number) => void;
|
|
|
181
183
|
export const intounderlyingsource_pull: (a: number, b: any) => any;
|
|
182
184
|
export const __wbg_externalbreezsignerhandle_free: (a: number, b: number) => void;
|
|
183
185
|
export const __wbg_defaultsessionstore_free: (a: number, b: number) => void;
|
|
184
|
-
export const __wbg_externalsparksignerhandle_free: (a: number, b: number) => void;
|
|
185
186
|
export const __wbg_externalsigningsignerhandle_free: (a: number, b: number) => void;
|
|
187
|
+
export const __wbg_externalsparksignerhandle_free: (a: number, b: number) => void;
|
|
186
188
|
export const __wbg_signingonlyexternalsigners_free: (a: number, b: number) => void;
|
|
187
189
|
export const signingonlyexternalsigners_breezSigner: (a: number) => number;
|
|
188
190
|
export const signingonlyexternalsigners_sparkSigner: (a: number) => number;
|
|
@@ -197,7 +199,7 @@ export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_2: (a
|
|
|
197
199
|
export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3: (a: number, b: number, c: any) => void;
|
|
198
200
|
export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4: (a: number, b: number, c: any) => void;
|
|
199
201
|
export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5: (a: number, b: number, c: any) => void;
|
|
200
|
-
export const
|
|
202
|
+
export const wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7: (a: number, b: number) => void;
|
|
201
203
|
export const wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e: (a: number, b: number) => void;
|
|
202
204
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
203
205
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
package/web/storage/index.js
CHANGED
|
@@ -586,6 +586,31 @@ class MigrationManager {
|
|
|
586
586
|
}
|
|
587
587
|
},
|
|
588
588
|
},
|
|
589
|
+
{
|
|
590
|
+
// Only the Declined shape changed, and clearing it costs at most one extra
|
|
591
|
+
// quote. Submitted entries are left alone: their shape is unchanged and
|
|
592
|
+
// they are the only guard against re-claiming a UTXO whose earlier claim
|
|
593
|
+
// is still settling.
|
|
594
|
+
name: "Clear declined instant claim status after its shape changed",
|
|
595
|
+
upgrade: (db, transaction) => {
|
|
596
|
+
if (!db.objectStoreNames.contains("unclaimed_deposits")) return;
|
|
597
|
+
const store = transaction.objectStore("unclaimed_deposits");
|
|
598
|
+
const cursorRequest = store.openCursor();
|
|
599
|
+
cursorRequest.onsuccess = (event) => {
|
|
600
|
+
const cursor = event.target.result;
|
|
601
|
+
if (!cursor) return;
|
|
602
|
+
const deposit = cursor.value;
|
|
603
|
+
if (
|
|
604
|
+
deposit.instantClaimStatus &&
|
|
605
|
+
String(deposit.instantClaimStatus).toLowerCase().includes("declined")
|
|
606
|
+
) {
|
|
607
|
+
deposit.instantClaimStatus = null;
|
|
608
|
+
cursor.update(deposit);
|
|
609
|
+
}
|
|
610
|
+
cursor.continue();
|
|
611
|
+
};
|
|
612
|
+
},
|
|
613
|
+
},
|
|
589
614
|
];
|
|
590
615
|
}
|
|
591
616
|
}
|
|
@@ -614,7 +639,7 @@ class IndexedDBStorage {
|
|
|
614
639
|
// so existing databases depend on indices never shifting. Never insert,
|
|
615
640
|
// reorder, or delete a migration — only append. dbVersion MUST equal the
|
|
616
641
|
// number of migrations (enforced by the guard in initialize()).
|
|
617
|
-
this.dbVersion =
|
|
642
|
+
this.dbVersion = 21; // Current schema version (= migration count)
|
|
618
643
|
}
|
|
619
644
|
|
|
620
645
|
/**
|
|
@@ -1419,6 +1444,7 @@ class IndexedDBStorage {
|
|
|
1419
1444
|
refundTx: existing?.refundTx ?? null,
|
|
1420
1445
|
refundTxId: existing?.refundTxId ?? null,
|
|
1421
1446
|
instantClaimStatus: existing?.instantClaimStatus ?? null,
|
|
1447
|
+
refundState: existing?.refundState ?? null,
|
|
1422
1448
|
};
|
|
1423
1449
|
|
|
1424
1450
|
const putRequest = store.put(depositToStore);
|
|
@@ -1494,6 +1520,7 @@ class IndexedDBStorage {
|
|
|
1494
1520
|
instantClaimStatus: row.instantClaimStatus
|
|
1495
1521
|
? JSON.parse(row.instantClaimStatus)
|
|
1496
1522
|
: null,
|
|
1523
|
+
refundState: row.refundState ? JSON.parse(row.refundState) : null,
|
|
1497
1524
|
}));
|
|
1498
1525
|
resolve(deposits);
|
|
1499
1526
|
};
|
|
@@ -1537,14 +1564,18 @@ class IndexedDBStorage {
|
|
|
1537
1564
|
|
|
1538
1565
|
if (payload.type === "claimError") {
|
|
1539
1566
|
updatedDeposit.claimError = JSON.stringify(payload.error);
|
|
1540
|
-
updatedDeposit.refundTx = null;
|
|
1541
|
-
updatedDeposit.refundTxId = null;
|
|
1542
1567
|
} else if (payload.type === "refund") {
|
|
1543
1568
|
updatedDeposit.refundTx = payload.refundTx;
|
|
1544
1569
|
updatedDeposit.refundTxId = payload.refundTxid;
|
|
1570
|
+
updatedDeposit.refundState = JSON.stringify(payload.state);
|
|
1545
1571
|
updatedDeposit.claimError = null;
|
|
1546
1572
|
} else if (payload.type === "instantClaim") {
|
|
1547
1573
|
updatedDeposit.instantClaimStatus = JSON.stringify(payload.status);
|
|
1574
|
+
} else if (payload.type === "refundBroadcastState") {
|
|
1575
|
+
// Only while this is still the stored refund.
|
|
1576
|
+
if (existingDeposit.refundTxId === payload.refundTxid) {
|
|
1577
|
+
updatedDeposit.refundState = JSON.stringify(payload.state);
|
|
1578
|
+
}
|
|
1548
1579
|
} else {
|
|
1549
1580
|
reject(new StorageError(`Unknown payload type: ${payload.type}`));
|
|
1550
1581
|
return;
|