@breeztech/breez-sdk-spark 0.24.0 → 0.25.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.
Binary file
@@ -681,6 +681,15 @@ export interface CheckMessageResponse {
681
681
  isValid: boolean;
682
682
  }
683
683
 
684
+ export interface CheckUnilateralExitRequest {
685
+ exit: UnilateralExitResponse;
686
+ }
687
+
688
+ export interface CheckUnilateralExitResponse {
689
+ exit: UnilateralExitResponse;
690
+ verdict: UnilateralExitVerdict;
691
+ }
692
+
684
693
  export interface ClaimDepositQuote {
685
694
  confirmationsRequired: number;
686
695
  creditAmountSats: number;
@@ -746,6 +755,12 @@ export interface Config {
746
755
  crossChainConfig?: CrossChainConfig;
747
756
  }
748
757
 
758
+ export interface ConfirmedExitNode {
759
+ nodeId: string;
760
+ confirmedBy: ExitNodeConfirmation;
761
+ blockHeight?: number;
762
+ }
763
+
749
764
  export interface ConnectRequest {
750
765
  config: Config;
751
766
  seed: Seed;
@@ -830,6 +845,17 @@ export interface CrossChainConfig {
830
845
  defaultTargetOverpayBps?: number;
831
846
  }
832
847
 
848
+ export interface CrossChainReceiveInfo {
849
+ depositAddress: string;
850
+ depositAmount: string;
851
+ expectedReceivedAmount: string;
852
+ destinationAsset: string;
853
+ tokenIdentifier?: string;
854
+ serviceFeeAmount: string;
855
+ serviceFeeAsset?: string;
856
+ expiresAt: number;
857
+ }
858
+
833
859
  export interface CrossChainRoutePair {
834
860
  provider: CrossChainProvider;
835
861
  chain: string;
@@ -838,8 +864,8 @@ export interface CrossChainRoutePair {
838
864
  contractAddress?: string;
839
865
  decimals: number;
840
866
  exactOutEligible: boolean;
841
- supportedSources: SourceAsset[];
842
- supportedSourceChains: SourceChain[];
867
+ acceptedAssets: SparkAsset[];
868
+ deliveryMethods: DeliveryMethod[];
843
869
  }
844
870
 
845
871
  export interface CurrencyInfo {
@@ -872,6 +898,19 @@ export interface EventListener {
872
898
  onEvent: (e: SdkEvent) => void;
873
899
  }
874
900
 
901
+ export interface ExitChainState {
902
+ confirmedNodes: ConfirmedExitNode[];
903
+ refunds: ExitRefund[];
904
+ stoppedLeafIds: string[];
905
+ unverifiedNodeIds: string[];
906
+ unverifiableConfirmedNodeIds: string[];
907
+ }
908
+
909
+ export interface ExitRefund {
910
+ leafId: string;
911
+ state: ExitRefundState;
912
+ }
913
+
875
914
  export interface ExportUnilateralExitStateResponse {
876
915
  exitState: string;
877
916
  }
@@ -1486,11 +1525,14 @@ export interface PrepareUnilateralExitResponse {
1486
1525
  leaves: UnilateralExitLeaf[];
1487
1526
  recoverableValueSat: number;
1488
1527
  totalFeeSat: number;
1528
+ cpfpFeeSat: number;
1489
1529
  fanoutFeeSat: number;
1530
+ sweepFeeSat: number;
1490
1531
  singleUtxoFundingSat: number;
1491
1532
  perBranchFunding: PerBranchFunding[];
1492
1533
  feeRateSatPerVbyte: number;
1493
1534
  destination: string;
1535
+ exitChainState: ExitChainState;
1494
1536
  }
1495
1537
 
1496
1538
  export interface ProvisionalPayment {
@@ -1530,6 +1572,7 @@ export interface ReceivePaymentRequest {
1530
1572
  export interface ReceivePaymentResponse {
1531
1573
  paymentRequest: string;
1532
1574
  fee: bigint;
1575
+ crossChainInfo?: CrossChainReceiveInfo;
1533
1576
  }
1534
1577
 
1535
1578
  export interface RecommendedFees {
@@ -1635,6 +1678,7 @@ export interface SendOnchainFeeQuote {
1635
1678
  speedFast: SendOnchainSpeedFeeQuote;
1636
1679
  speedMedium: SendOnchainSpeedFeeQuote;
1637
1680
  speedSlow: SendOnchainSpeedFeeQuote;
1681
+ isEstimate: boolean;
1638
1682
  }
1639
1683
 
1640
1684
  export interface SendOnchainSpeedFeeQuote {
@@ -1921,8 +1965,12 @@ export interface UnilateralExitRequest {
1921
1965
  export interface UnilateralExitResponse {
1922
1966
  recoverableValueSat: number;
1923
1967
  totalFeeSat: number;
1968
+ cpfpFeeSat: number;
1969
+ fanoutFeeSat: number;
1970
+ sweepFeeSat: number;
1924
1971
  leaves: UnilateralExitLeaf[];
1925
1972
  transactions: UnilateralExitTransaction[];
1973
+ fundingInputs: CpfpInput[];
1926
1974
  }
1927
1975
 
1928
1976
  export interface UnilateralExitTransaction {
@@ -1933,7 +1981,7 @@ export interface UnilateralExitTransaction {
1933
1981
  cpfpTxHex?: string;
1934
1982
  csvTimelockBlocks?: number;
1935
1983
  dependsOn: string[];
1936
- status: ConfirmationStatus;
1984
+ status: ExitTransactionStatus;
1937
1985
  }
1938
1986
 
1939
1987
  export interface UnregisterWebhookRequest {
@@ -2003,13 +2051,11 @@ export type BuyBitcoinRequest = { type: "moonpay"; lockedAmountSat?: number; red
2003
2051
 
2004
2052
  export type ChainApiType = "esplora" | "mempoolSpace";
2005
2053
 
2006
- export type ConfirmationStatus = "confirmed" | "unconfirmed" | "unverified";
2007
-
2008
2054
  export type ConversionChain = { type: "spark" } | { type: "lightning" } | { type: "external"; name: string; chainId?: string };
2009
2055
 
2010
2056
  export type ConversionFilter = "ammRefundNeeded" | "orchestraPending" | "boltzPending";
2011
2057
 
2012
- export type ConversionInfo = { type: "amm"; poolId: string; conversionId: string; status: ConversionStatus; fee?: string; purpose?: ConversionPurpose; amountAdjustment?: AmountAdjustmentReason; degradation?: SwapDegradation } | { type: "orchestra"; chain: string; chainId?: string; asset?: string; assetContract?: string; recipientAddress: string; assetAmountIn?: string; estimatedOut: string; deliveredAmount?: string; status: ConversionStatus; feeAmount?: string; serviceFeeAmount?: string; serviceFeeAsset?: string; assetDecimals: number; orderId: string; quoteId: string; readToken?: string } | { type: "boltz"; chain: string; chainId?: string; asset?: string; assetContract?: string; recipientAddress: string; assetAmountIn?: string; estimatedOut: string; deliveredAmount?: string; status: ConversionStatus; feeAmount?: string; serviceFeeAmount?: string; serviceFeeAsset?: string; assetDecimals: number; swapId: string; invoice: string; invoiceAmountSats: number; bridgeRef?: string; maxSlippageBps: number; quoteDegraded?: boolean };
2058
+ export type ConversionInfo = { type: "amm"; poolId: string; conversionId: string; status: ConversionStatus; fee?: string; purpose?: ConversionPurpose; amountAdjustment?: AmountAdjustmentReason; degradation?: SwapDegradation } | { type: "orchestra"; chain: string; chainId?: string; asset?: string; assetContract?: string; recipientAddress: string; assetAmountIn?: string; estimatedOut: string; deliveredAmount?: string; externalTxHash?: string; status: ConversionStatus; feeAmount?: string; serviceFeeAmount?: string; serviceFeeAsset?: string; assetDecimals: number; orderId: string; quoteId: string; readToken?: string } | { type: "boltz"; chain: string; chainId?: string; asset?: string; assetContract?: string; recipientAddress: string; assetAmountIn?: string; estimatedOut: string; deliveredAmount?: string; status: ConversionStatus; feeAmount?: string; serviceFeeAmount?: string; serviceFeeAsset?: string; assetDecimals: number; swapId: string; invoice: string; invoiceAmountSats: number; bridgeRef?: string; maxSlippageBps: number; quoteDegraded?: boolean };
2013
2059
 
2014
2060
  export type ConversionProvider = "amm" | "orchestra" | "boltz";
2015
2061
 
@@ -2033,10 +2079,18 @@ export type CrossChainProviderContext = { type: "orchestra"; quoteId: string; de
2033
2079
 
2034
2080
  export type CrossChainRouteFilter = { type: "send"; addressDetails: CrossChainAddressDetails } | { type: "receive"; contractAddress?: string } | { type: "paymentLink"; addressDetails: CrossChainAddressDetails };
2035
2081
 
2082
+ export type DeliveryMethod = "spark" | "lightning" | "bitcoin";
2083
+
2036
2084
  export type DepositClaimError = { type: "maxDepositClaimFeeExceeded"; tx: string; vout: number; maxFee?: Fee; requiredFeeSats: number; requiredFeeRateSatPerVbyte: number } | { type: "missingUtxo"; tx: string; vout: number } | { type: "generic"; message: string };
2037
2085
 
2038
2086
  export type ExitLeafSelection = { type: "auto" } | { type: "specific"; leafIds: string[] };
2039
2087
 
2088
+ export type ExitNodeConfirmation = "cpfp" | "direct";
2089
+
2090
+ export type ExitRefundState = { type: "onChain"; txHex: string; vout: number; valueSat: number; blockHeight?: number } | { type: "swept" };
2091
+
2092
+ export type ExitTransactionStatus = { type: "confirmed"; blockHeight?: number } | { type: "ready" } | { type: "waitingForDependencies" } | { type: "waitingForTimelock"; spendableAtHeight?: number } | { type: "unverified" };
2093
+
2040
2094
  export type ExternalFrostDerivation = { type: "signingLeaf"; leafId: ExternalTreeNodeId } | { type: "staticDeposit"; index: number } | { type: "htlcPreimage" } | { type: "identity" };
2041
2095
 
2042
2096
  export type ExternalSparkInvoiceKind = "sats" | "tokens";
@@ -2083,7 +2137,7 @@ export type PublishSignedLnurlPayResponse = { type: "swapCompleted" } | { type:
2083
2137
 
2084
2138
  export type PublishSignedTransferPackageResponse = { type: "swapCompleted" } | { type: "paymentSent"; payment: Payment } | { type: "paymentsSent"; payments: Payment[] };
2085
2139
 
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 };
2140
+ 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 } | { type: "crossChain"; route: CrossChainRoutePair; amount: string; destination?: SparkAsset; feeMode?: CrossChainFeeMode; maxSlippageBps?: number; targetOverpayBps?: number };
2087
2141
 
2088
2142
  export type RefundState = { type: "broadcastPending"; lastError?: string } | { type: "broadcast" };
2089
2143
 
@@ -2099,9 +2153,7 @@ export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" |
2099
2153
 
2100
2154
  export type SessionStoreError = { type: "notFound" } | ({ type: "generic" } & string);
2101
2155
 
2102
- export type SourceAsset = { type: "bitcoin" } | { type: "token"; tokenIdentifier: string };
2103
-
2104
- export type SourceChain = "spark" | "lightning" | "bitcoin";
2156
+ export type SparkAsset = { type: "bitcoin" } | { type: "token"; tokenIdentifier: string };
2105
2157
 
2106
2158
  export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
2107
2159
 
@@ -2123,8 +2175,12 @@ export type TransferSignature = { type: "transfer"; signed: ExternalPreparedTran
2123
2175
 
2124
2176
  export type TransferTarget = { type: "spark"; address: string; sparkInvoice?: string } | { type: "lightning"; bolt11: string; lnurlPay?: LnurlPayContext; feePolicy: FeePolicy; completionTimeoutSecs?: number } | { type: "coopExit"; address: string; feeQuote: SendOnchainFeeQuote; confirmationSpeed: OnchainConfirmationSpeed };
2125
2177
 
2178
+ export type UnilateralExitRedoReason = "onChainStateDiverged";
2179
+
2126
2180
  export type UnilateralExitTxKind = "fanOut" | "node" | "refund" | "sweep";
2127
2181
 
2182
+ export type UnilateralExitVerdict = { type: "valid" } | { type: "done" } | { type: "redo"; reason: UnilateralExitRedoReason };
2183
+
2128
2184
  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 };
2129
2185
 
2130
2186
  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 };
@@ -2167,6 +2223,7 @@ export class BreezSdk {
2167
2223
  buyBitcoin(request: BuyBitcoinRequest): Promise<BuyBitcoinResponse>;
2168
2224
  checkLightningAddressAvailable(request: CheckLightningAddressRequest): Promise<boolean>;
2169
2225
  checkMessage(request: CheckMessageRequest): Promise<CheckMessageResponse>;
2226
+ checkUnilateralExit(request: CheckUnilateralExitRequest): Promise<CheckUnilateralExitResponse>;
2170
2227
  claimDeposit(request: ClaimDepositRequest): Promise<ClaimDepositResponse>;
2171
2228
  claimHtlcPayment(request: ClaimHtlcPaymentRequest): Promise<ClaimHtlcPaymentResponse>;
2172
2229
  claimLightningAddressTransfer(request: ClaimTransferRequest): Promise<LightningAddressInfo>;
@@ -190,6 +190,14 @@ export class BreezSdk {
190
190
  const ret = wasm.breezsdk_checkMessage(this.__wbg_ptr, request);
191
191
  return ret;
192
192
  }
193
+ /**
194
+ * @param {CheckUnilateralExitRequest} request
195
+ * @returns {Promise<CheckUnilateralExitResponse>}
196
+ */
197
+ checkUnilateralExit(request) {
198
+ const ret = wasm.breezsdk_checkUnilateralExit(this.__wbg_ptr, request);
199
+ return ret;
200
+ }
193
201
  /**
194
202
  * @param {ClaimDepositRequest} request
195
203
  * @returns {Promise<ClaimDepositResponse>}
@@ -2201,9 +2209,6 @@ export function __wbg_catch_f939343cb181958c(arg0, arg1) {
2201
2209
  const ret = arg0.catch(arg1);
2202
2210
  return ret;
2203
2211
  }
2204
- export function __wbg_clearInterval_d25b0cf526eff7ae(arg0) {
2205
- globalThis.clearInterval(arg0);
2206
- }
2207
2212
  export function __wbg_clearTimeout_113b1cde814ec762(arg0) {
2208
2213
  const ret = clearTimeout(arg0);
2209
2214
  return ret;
@@ -2221,9 +2226,6 @@ export function __wbg_close_931d0c62e2aab92c() { return handleError(function (ar
2221
2226
  export function __wbg_close_de471367367aa5cb() { return handleError(function (arg0) {
2222
2227
  arg0.close();
2223
2228
  }, arguments); }
2224
- export function __wbg_close_f1af935d7d7cec78() { return handleError(function (arg0, arg1, arg2, arg3) {
2225
- arg0.close(arg1, getStringFromWasm0(arg2, arg3));
2226
- }, arguments); }
2227
2229
  export function __wbg_code_be6f339819ebb2c4(arg0) {
2228
2230
  const ret = arg0.code;
2229
2231
  return ret;
@@ -3202,10 +3204,6 @@ export function __wbg_setCrossChainSwap_9047f4cc41fe2eca() { return handleError(
3202
3204
  const ret = arg0.setCrossChainSwap(arg1);
3203
3205
  return ret;
3204
3206
  }, arguments); }
3205
- export function __wbg_setInterval_2aba203c2a1ea83f(arg0, arg1) {
3206
- const ret = globalThis.setInterval(arg0, arg1);
3207
- return ret;
3208
- }
3209
3207
  export function __wbg_setLeaves_3a013e3266762f4b() { return handleError(function (arg0, arg1, arg2, arg3) {
3210
3208
  const ret = arg0.setLeaves(arg1, arg2, arg3);
3211
3209
  return ret;
@@ -3632,126 +3630,111 @@ export function __wbindgen_cast_0000000000000001(arg0, arg1) {
3632
3630
  return ret;
3633
3631
  }
3634
3632
  export function __wbindgen_cast_0000000000000002(arg0, arg1) {
3635
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3636
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2);
3633
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 397, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3634
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25);
3637
3635
  return ret;
3638
3636
  }
3639
3637
  export function __wbindgen_cast_0000000000000003(arg0, arg1) {
3640
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3641
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_2);
3638
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 397, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3639
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2);
3642
3640
  return ret;
3643
3641
  }
3644
3642
  export function __wbindgen_cast_0000000000000004(arg0, arg1) {
3645
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3646
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3);
3643
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 397, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3644
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3);
3647
3645
  return ret;
3648
3646
  }
3649
3647
  export function __wbindgen_cast_0000000000000005(arg0, arg1) {
3650
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3651
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4);
3648
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("SessionStore")], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3649
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_4);
3652
3650
  return ret;
3653
3651
  }
3654
3652
  export function __wbindgen_cast_0000000000000006(arg0, arg1) {
3655
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3656
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5);
3653
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Storage")], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3654
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_5);
3657
3655
  return ret;
3658
3656
  }
3659
3657
  export function __wbindgen_cast_0000000000000007(arg0, arg1) {
3660
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("SessionStore")], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3658
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TokenStore")], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3661
3659
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6);
3662
3660
  return ret;
3663
3661
  }
3664
3662
  export function __wbindgen_cast_0000000000000008(arg0, arg1) {
3665
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Storage")], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3663
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TreeStore")], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3666
3664
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7);
3667
3665
  return ret;
3668
3666
  }
3669
3667
  export function __wbindgen_cast_0000000000000009(arg0, arg1) {
3670
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TokenStore")], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3671
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_8);
3672
- return ret;
3673
- }
3674
- export function __wbindgen_cast_000000000000000a(arg0, arg1) {
3675
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TreeStore")], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3676
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_9);
3677
- return ret;
3678
- }
3679
- export function __wbindgen_cast_000000000000000b(arg0, arg1) {
3680
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3668
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 402, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3681
3669
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7);
3682
3670
  return ret;
3683
3671
  }
3684
- export function __wbindgen_cast_000000000000000c(arg0, arg1) {
3685
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 434, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
3686
- const ret = makeClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e);
3687
- return ret;
3688
- }
3689
- export function __wbindgen_cast_000000000000000d(arg0) {
3672
+ export function __wbindgen_cast_000000000000000a(arg0) {
3690
3673
  // Cast intrinsic for `F64 -> Externref`.
3691
3674
  const ret = arg0;
3692
3675
  return ret;
3693
3676
  }
3694
- export function __wbindgen_cast_000000000000000e(arg0) {
3677
+ export function __wbindgen_cast_000000000000000b(arg0) {
3695
3678
  // Cast intrinsic for `I64 -> Externref`.
3696
3679
  const ret = arg0;
3697
3680
  return ret;
3698
3681
  }
3699
- export function __wbindgen_cast_000000000000000f(arg0, arg1) {
3682
+ export function __wbindgen_cast_000000000000000c(arg0, arg1) {
3700
3683
  // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
3701
3684
  const ret = getArrayU8FromWasm0(arg0, arg1);
3702
3685
  return ret;
3703
3686
  }
3704
- export function __wbindgen_cast_0000000000000010(arg0, arg1) {
3687
+ export function __wbindgen_cast_000000000000000d(arg0, arg1) {
3705
3688
  // Cast intrinsic for `Ref(String) -> Externref`.
3706
3689
  const ret = getStringFromWasm0(arg0, arg1);
3707
3690
  return ret;
3708
3691
  }
3709
- export function __wbindgen_cast_0000000000000011(arg0, arg1) {
3692
+ export function __wbindgen_cast_000000000000000e(arg0, arg1) {
3710
3693
  // Cast intrinsic for `U128 -> Externref`.
3711
3694
  const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));
3712
3695
  return ret;
3713
3696
  }
3714
- export function __wbindgen_cast_0000000000000012(arg0) {
3697
+ export function __wbindgen_cast_000000000000000f(arg0) {
3715
3698
  // Cast intrinsic for `U64 -> Externref`.
3716
3699
  const ret = BigInt.asUintN(64, arg0);
3717
3700
  return ret;
3718
3701
  }
3719
- export function __wbindgen_cast_0000000000000013(arg0, arg1) {
3702
+ export function __wbindgen_cast_0000000000000010(arg0, arg1) {
3720
3703
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3721
3704
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3722
3705
  // Cast intrinsic for `Vector(NamedExternref("Contact")) -> Externref`.
3723
3706
  const ret = v0;
3724
3707
  return ret;
3725
3708
  }
3726
- export function __wbindgen_cast_0000000000000014(arg0, arg1) {
3709
+ export function __wbindgen_cast_0000000000000011(arg0, arg1) {
3727
3710
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3728
3711
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3729
3712
  // Cast intrinsic for `Vector(NamedExternref("CrossChainRoutePair")) -> Externref`.
3730
3713
  const ret = v0;
3731
3714
  return ret;
3732
3715
  }
3733
- export function __wbindgen_cast_0000000000000015(arg0, arg1) {
3716
+ export function __wbindgen_cast_0000000000000012(arg0, arg1) {
3734
3717
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3735
3718
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3736
3719
  // Cast intrinsic for `Vector(NamedExternref("ExternalFrostShareResult")) -> Externref`.
3737
3720
  const ret = v0;
3738
3721
  return ret;
3739
3722
  }
3740
- export function __wbindgen_cast_0000000000000016(arg0, arg1) {
3723
+ export function __wbindgen_cast_0000000000000013(arg0, arg1) {
3741
3724
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3742
3725
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3743
3726
  // Cast intrinsic for `Vector(NamedExternref("Webhook")) -> Externref`.
3744
3727
  const ret = v0;
3745
3728
  return ret;
3746
3729
  }
3747
- export function __wbindgen_cast_0000000000000017(arg0, arg1) {
3730
+ export function __wbindgen_cast_0000000000000014(arg0, arg1) {
3748
3731
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3749
3732
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3750
3733
  // Cast intrinsic for `Vector(NamedExternref("string")) -> Externref`.
3751
3734
  const ret = v0;
3752
3735
  return ret;
3753
3736
  }
3754
- export function __wbindgen_cast_0000000000000018(arg0, arg1) {
3737
+ export function __wbindgen_cast_0000000000000015(arg0, arg1) {
3755
3738
  var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
3756
3739
  wasm.__wbindgen_free(arg0, arg1 * 1, 1);
3757
3740
  // Cast intrinsic for `Vector(U8) -> Externref`.
@@ -3771,28 +3754,16 @@ function wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7(arg0, arg
3771
3754
  wasm.wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7(arg0, arg1);
3772
3755
  }
3773
3756
 
3774
- function wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e(arg0, arg1) {
3775
- wasm.wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e(arg0, arg1);
3776
- }
3777
-
3778
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2(arg0, arg1, arg2) {
3779
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2(arg0, arg1, arg2);
3757
+ function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25(arg0, arg1, arg2) {
3758
+ wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25(arg0, arg1, arg2);
3780
3759
  }
3781
3760
 
3782
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_2(arg0, arg1, arg2) {
3783
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_2(arg0, arg1, arg2);
3761
+ function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2(arg0, arg1, arg2) {
3762
+ wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2(arg0, arg1, arg2);
3784
3763
  }
3785
3764
 
3786
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3(arg0, arg1, arg2) {
3787
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3(arg0, arg1, arg2);
3788
- }
3789
-
3790
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4(arg0, arg1, arg2) {
3791
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4(arg0, arg1, arg2);
3792
- }
3793
-
3794
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5(arg0, arg1, arg2) {
3795
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5(arg0, arg1, arg2);
3765
+ function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3(arg0, arg1, arg2) {
3766
+ wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3(arg0, arg1, arg2);
3796
3767
  }
3797
3768
 
3798
3769
  function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522(arg0, arg1, arg2) {
@@ -3802,29 +3773,29 @@ function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522(arg0, arg
3802
3773
  }
3803
3774
  }
3804
3775
 
3805
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6(arg0, arg1, arg2) {
3806
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6(arg0, arg1, arg2);
3776
+ function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_4(arg0, arg1, arg2) {
3777
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_4(arg0, arg1, arg2);
3807
3778
  if (ret[1]) {
3808
3779
  throw takeFromExternrefTable0(ret[0]);
3809
3780
  }
3810
3781
  }
3811
3782
 
3812
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7(arg0, arg1, arg2) {
3813
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7(arg0, arg1, arg2);
3783
+ function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_5(arg0, arg1, arg2) {
3784
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_5(arg0, arg1, arg2);
3814
3785
  if (ret[1]) {
3815
3786
  throw takeFromExternrefTable0(ret[0]);
3816
3787
  }
3817
3788
  }
3818
3789
 
3819
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_8(arg0, arg1, arg2) {
3820
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_8(arg0, arg1, arg2);
3790
+ function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6(arg0, arg1, arg2) {
3791
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6(arg0, arg1, arg2);
3821
3792
  if (ret[1]) {
3822
3793
  throw takeFromExternrefTable0(ret[0]);
3823
3794
  }
3824
3795
  }
3825
3796
 
3826
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_9(arg0, arg1, arg2) {
3827
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_9(arg0, arg1, arg2);
3797
+ function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7(arg0, arg1, arg2) {
3798
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7(arg0, arg1, arg2);
3828
3799
  if (ret[1]) {
3829
3800
  throw takeFromExternrefTable0(ret[0]);
3830
3801
  }
@@ -4039,31 +4010,6 @@ function isLikeNone(x) {
4039
4010
  return x === undefined || x === null;
4040
4011
  }
4041
4012
 
4042
- function makeClosure(arg0, arg1, f) {
4043
- const state = { a: arg0, b: arg1, cnt: 1 };
4044
- const real = (...args) => {
4045
-
4046
- // First up with a closure we increment the internal reference
4047
- // count. This ensures that the Rust closure environment won't
4048
- // be deallocated while we're invoking it.
4049
- state.cnt++;
4050
- try {
4051
- return f(state.a, state.b, ...args);
4052
- } finally {
4053
- real._wbg_cb_unref();
4054
- }
4055
- };
4056
- real._wbg_cb_unref = () => {
4057
- if (--state.cnt === 0) {
4058
- wasm.__wbindgen_destroy_closure(state.a, state.b);
4059
- state.a = 0;
4060
- CLOSURE_DTORS.unregister(state);
4061
- }
4062
- };
4063
- CLOSURE_DTORS.register(real, state, state);
4064
- return real;
4065
- }
4066
-
4067
4013
  function makeMutClosure(arg0, arg1, f) {
4068
4014
  const state = { a: arg0, b: arg1, cnt: 1 };
4069
4015
  const real = (...args) => {
@@ -28,6 +28,7 @@ export const breezsdk_buildUnsignedTransferPackage: (a: number, b: any) => any;
28
28
  export const breezsdk_buyBitcoin: (a: number, b: any) => any;
29
29
  export const breezsdk_checkLightningAddressAvailable: (a: number, b: any) => any;
30
30
  export const breezsdk_checkMessage: (a: number, b: any) => any;
31
+ export const breezsdk_checkUnilateralExit: (a: number, b: any) => any;
31
32
  export const breezsdk_claimDeposit: (a: number, b: any) => any;
32
33
  export const breezsdk_claimHtlcPayment: (a: number, b: any) => any;
33
34
  export const breezsdk_claimLightningAddressTransfer: (a: number, b: any) => any;
@@ -189,18 +190,15 @@ export const __wbg_signingonlyexternalsigners_free: (a: number, b: number) => vo
189
190
  export const signingonlyexternalsigners_breezSigner: (a: number) => number;
190
191
  export const signingonlyexternalsigners_sparkSigner: (a: number) => number;
191
192
  export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522: (a: number, b: number, c: any) => [number, number];
193
+ export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_4: (a: number, b: number, c: any) => [number, number];
194
+ export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_5: (a: number, b: number, c: any) => [number, number];
192
195
  export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6: (a: number, b: number, c: any) => [number, number];
193
196
  export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7: (a: number, b: number, c: any) => [number, number];
194
- export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_8: (a: number, b: number, c: any) => [number, number];
195
- export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_9: (a: number, b: number, c: any) => [number, number];
196
197
  export const wasm_bindgen__convert__closures_____invoke__h41057d61edf43a32: (a: number, b: number, c: any, d: any) => void;
197
- export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2: (a: number, b: number, c: any) => void;
198
- export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_2: (a: number, b: number, c: any) => void;
199
- export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3: (a: number, b: number, c: any) => void;
200
- export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4: (a: number, b: number, c: any) => void;
201
- export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5: (a: number, b: number, c: any) => void;
198
+ export const wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25: (a: number, b: number, c: any) => void;
199
+ export const wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2: (a: number, b: number, c: any) => void;
200
+ export const wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3: (a: number, b: number, c: any) => void;
202
201
  export const wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7: (a: number, b: number) => void;
203
- export const wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e: (a: number, b: number) => void;
204
202
  export const __wbindgen_malloc: (a: number, b: number) => number;
205
203
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
206
204
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
@@ -522,31 +522,18 @@ class WebTreeStore {
522
522
 
523
523
  async getVerifiedLeafKeys() {
524
524
  try {
525
+ // Every stored leaf passed the ownership check on its way in, whatever
526
+ // its status, so all of them are projected.
525
527
  return await this._txRun(
526
- [STORE_LEAVES, STORE_RESERVATIONS],
528
+ [STORE_LEAVES],
527
529
  "readonly",
528
- [
529
- { name: "leaves", store: STORE_LEAVES },
530
- { name: "reservations", store: STORE_RESERVATIONS },
531
- ],
532
- (res) => {
533
- const resIds = new Set(res.reservations.map((r) => r.id));
534
- const out = [];
535
- for (const row of res.leaves) {
536
- const hasReservation =
537
- row.reservation_id != null && resIds.has(row.reservation_id);
538
- // Every reserved leaf plus every Available one; nothing that is
539
- // neither reserved nor Available.
540
- if (hasReservation || row.status === "Available") {
541
- out.push([
542
- row.id,
543
- row.verifying_public_key,
544
- row.signing_public_key,
545
- ]);
546
- }
547
- }
548
- return out;
549
- }
530
+ [{ name: "leaves", store: STORE_LEAVES }],
531
+ (res) =>
532
+ res.leaves.map((row) => [
533
+ row.id,
534
+ row.verifying_public_key,
535
+ row.signing_public_key,
536
+ ])
550
537
  );
551
538
  } catch (error) {
552
539
  if (error instanceof TreeStoreError) throw error;