@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.
@@ -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>;
@@ -193,6 +193,14 @@ class BreezSdk {
193
193
  const ret = wasm.breezsdk_checkMessage(this.__wbg_ptr, request);
194
194
  return ret;
195
195
  }
196
+ /**
197
+ * @param {CheckUnilateralExitRequest} request
198
+ * @returns {Promise<CheckUnilateralExitResponse>}
199
+ */
200
+ checkUnilateralExit(request) {
201
+ const ret = wasm.breezsdk_checkUnilateralExit(this.__wbg_ptr, request);
202
+ return ret;
203
+ }
196
204
  /**
197
205
  * @param {ClaimDepositRequest} request
198
206
  * @returns {Promise<ClaimDepositResponse>}
@@ -2245,9 +2253,6 @@ function __wbg_get_imports() {
2245
2253
  const ret = arg0.catch(arg1);
2246
2254
  return ret;
2247
2255
  },
2248
- __wbg_clearInterval_d25b0cf526eff7ae: function(arg0) {
2249
- globalThis.clearInterval(arg0);
2250
- },
2251
2256
  __wbg_clearTimeout_113b1cde814ec762: function(arg0) {
2252
2257
  const ret = clearTimeout(arg0);
2253
2258
  return ret;
@@ -2265,9 +2270,6 @@ function __wbg_get_imports() {
2265
2270
  __wbg_close_de471367367aa5cb: function() { return handleError(function (arg0) {
2266
2271
  arg0.close();
2267
2272
  }, arguments); },
2268
- __wbg_close_f1af935d7d7cec78: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2269
- arg0.close(arg1, getStringFromWasm0(arg2, arg3));
2270
- }, arguments); },
2271
2273
  __wbg_code_be6f339819ebb2c4: function(arg0) {
2272
2274
  const ret = arg0.code;
2273
2275
  return ret;
@@ -3246,10 +3248,6 @@ function __wbg_get_imports() {
3246
3248
  const ret = arg0.setCrossChainSwap(arg1);
3247
3249
  return ret;
3248
3250
  }, arguments); },
3249
- __wbg_setInterval_2aba203c2a1ea83f: function(arg0, arg1) {
3250
- const ret = globalThis.setInterval(arg0, arg1);
3251
- return ret;
3252
- },
3253
3251
  __wbg_setLeaves_3a013e3266762f4b: function() { return handleError(function (arg0, arg1, arg2, arg3) {
3254
3252
  const ret = arg0.setLeaves(arg1, arg2, arg3);
3255
3253
  return ret;
@@ -3676,126 +3674,111 @@ function __wbg_get_imports() {
3676
3674
  return ret;
3677
3675
  },
3678
3676
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
3679
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3680
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2);
3677
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 397, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3678
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25);
3681
3679
  return ret;
3682
3680
  },
3683
3681
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
3684
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3685
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_2);
3682
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 397, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3683
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2);
3686
3684
  return ret;
3687
3685
  },
3688
3686
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
3689
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3690
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3);
3687
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 397, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3688
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3);
3691
3689
  return ret;
3692
3690
  },
3693
3691
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
3694
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3695
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4);
3692
+ // 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`.
3693
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_4);
3696
3694
  return ret;
3697
3695
  },
3698
3696
  __wbindgen_cast_0000000000000006: function(arg0, arg1) {
3699
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3700
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5);
3697
+ // 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`.
3698
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_5);
3701
3699
  return ret;
3702
3700
  },
3703
3701
  __wbindgen_cast_0000000000000007: function(arg0, arg1) {
3704
- // 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`.
3702
+ // 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`.
3705
3703
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6);
3706
3704
  return ret;
3707
3705
  },
3708
3706
  __wbindgen_cast_0000000000000008: function(arg0, arg1) {
3709
- // 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`.
3707
+ // 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`.
3710
3708
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7);
3711
3709
  return ret;
3712
3710
  },
3713
3711
  __wbindgen_cast_0000000000000009: function(arg0, arg1) {
3714
- // 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`.
3715
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_8);
3716
- return ret;
3717
- },
3718
- __wbindgen_cast_000000000000000a: function(arg0, arg1) {
3719
- // 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`.
3720
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_9);
3721
- return ret;
3722
- },
3723
- __wbindgen_cast_000000000000000b: function(arg0, arg1) {
3724
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3712
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 402, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3725
3713
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7);
3726
3714
  return ret;
3727
3715
  },
3728
- __wbindgen_cast_000000000000000c: function(arg0, arg1) {
3729
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 434, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
3730
- const ret = makeClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e);
3731
- return ret;
3732
- },
3733
- __wbindgen_cast_000000000000000d: function(arg0) {
3716
+ __wbindgen_cast_000000000000000a: function(arg0) {
3734
3717
  // Cast intrinsic for `F64 -> Externref`.
3735
3718
  const ret = arg0;
3736
3719
  return ret;
3737
3720
  },
3738
- __wbindgen_cast_000000000000000e: function(arg0) {
3721
+ __wbindgen_cast_000000000000000b: function(arg0) {
3739
3722
  // Cast intrinsic for `I64 -> Externref`.
3740
3723
  const ret = arg0;
3741
3724
  return ret;
3742
3725
  },
3743
- __wbindgen_cast_000000000000000f: function(arg0, arg1) {
3726
+ __wbindgen_cast_000000000000000c: function(arg0, arg1) {
3744
3727
  // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
3745
3728
  const ret = getArrayU8FromWasm0(arg0, arg1);
3746
3729
  return ret;
3747
3730
  },
3748
- __wbindgen_cast_0000000000000010: function(arg0, arg1) {
3731
+ __wbindgen_cast_000000000000000d: function(arg0, arg1) {
3749
3732
  // Cast intrinsic for `Ref(String) -> Externref`.
3750
3733
  const ret = getStringFromWasm0(arg0, arg1);
3751
3734
  return ret;
3752
3735
  },
3753
- __wbindgen_cast_0000000000000011: function(arg0, arg1) {
3736
+ __wbindgen_cast_000000000000000e: function(arg0, arg1) {
3754
3737
  // Cast intrinsic for `U128 -> Externref`.
3755
3738
  const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));
3756
3739
  return ret;
3757
3740
  },
3758
- __wbindgen_cast_0000000000000012: function(arg0) {
3741
+ __wbindgen_cast_000000000000000f: function(arg0) {
3759
3742
  // Cast intrinsic for `U64 -> Externref`.
3760
3743
  const ret = BigInt.asUintN(64, arg0);
3761
3744
  return ret;
3762
3745
  },
3763
- __wbindgen_cast_0000000000000013: function(arg0, arg1) {
3746
+ __wbindgen_cast_0000000000000010: function(arg0, arg1) {
3764
3747
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3765
3748
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3766
3749
  // Cast intrinsic for `Vector(NamedExternref("Contact")) -> Externref`.
3767
3750
  const ret = v0;
3768
3751
  return ret;
3769
3752
  },
3770
- __wbindgen_cast_0000000000000014: function(arg0, arg1) {
3753
+ __wbindgen_cast_0000000000000011: function(arg0, arg1) {
3771
3754
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3772
3755
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3773
3756
  // Cast intrinsic for `Vector(NamedExternref("CrossChainRoutePair")) -> Externref`.
3774
3757
  const ret = v0;
3775
3758
  return ret;
3776
3759
  },
3777
- __wbindgen_cast_0000000000000015: function(arg0, arg1) {
3760
+ __wbindgen_cast_0000000000000012: function(arg0, arg1) {
3778
3761
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3779
3762
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3780
3763
  // Cast intrinsic for `Vector(NamedExternref("ExternalFrostShareResult")) -> Externref`.
3781
3764
  const ret = v0;
3782
3765
  return ret;
3783
3766
  },
3784
- __wbindgen_cast_0000000000000016: function(arg0, arg1) {
3767
+ __wbindgen_cast_0000000000000013: function(arg0, arg1) {
3785
3768
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3786
3769
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3787
3770
  // Cast intrinsic for `Vector(NamedExternref("Webhook")) -> Externref`.
3788
3771
  const ret = v0;
3789
3772
  return ret;
3790
3773
  },
3791
- __wbindgen_cast_0000000000000017: function(arg0, arg1) {
3774
+ __wbindgen_cast_0000000000000014: function(arg0, arg1) {
3792
3775
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3793
3776
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3794
3777
  // Cast intrinsic for `Vector(NamedExternref("string")) -> Externref`.
3795
3778
  const ret = v0;
3796
3779
  return ret;
3797
3780
  },
3798
- __wbindgen_cast_0000000000000018: function(arg0, arg1) {
3781
+ __wbindgen_cast_0000000000000015: function(arg0, arg1) {
3799
3782
  var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
3800
3783
  wasm.__wbindgen_free(arg0, arg1 * 1, 1);
3801
3784
  // Cast intrinsic for `Vector(U8) -> Externref`.
@@ -3822,28 +3805,16 @@ function wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7(arg0, arg
3822
3805
  wasm.wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7(arg0, arg1);
3823
3806
  }
3824
3807
 
3825
- function wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e(arg0, arg1) {
3826
- wasm.wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e(arg0, arg1);
3827
- }
3828
-
3829
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2(arg0, arg1, arg2) {
3830
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2(arg0, arg1, arg2);
3808
+ function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25(arg0, arg1, arg2) {
3809
+ wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25(arg0, arg1, arg2);
3831
3810
  }
3832
3811
 
3833
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_2(arg0, arg1, arg2) {
3834
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_2(arg0, arg1, arg2);
3812
+ function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2(arg0, arg1, arg2) {
3813
+ wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2(arg0, arg1, arg2);
3835
3814
  }
3836
3815
 
3837
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3(arg0, arg1, arg2) {
3838
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3(arg0, arg1, arg2);
3839
- }
3840
-
3841
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4(arg0, arg1, arg2) {
3842
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4(arg0, arg1, arg2);
3843
- }
3844
-
3845
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5(arg0, arg1, arg2) {
3846
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5(arg0, arg1, arg2);
3816
+ function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3(arg0, arg1, arg2) {
3817
+ wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3(arg0, arg1, arg2);
3847
3818
  }
3848
3819
 
3849
3820
  function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522(arg0, arg1, arg2) {
@@ -3853,29 +3824,29 @@ function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522(arg0, arg
3853
3824
  }
3854
3825
  }
3855
3826
 
3856
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6(arg0, arg1, arg2) {
3857
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6(arg0, arg1, arg2);
3827
+ function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_4(arg0, arg1, arg2) {
3828
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_4(arg0, arg1, arg2);
3858
3829
  if (ret[1]) {
3859
3830
  throw takeFromExternrefTable0(ret[0]);
3860
3831
  }
3861
3832
  }
3862
3833
 
3863
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7(arg0, arg1, arg2) {
3864
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7(arg0, arg1, arg2);
3834
+ function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_5(arg0, arg1, arg2) {
3835
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_5(arg0, arg1, arg2);
3865
3836
  if (ret[1]) {
3866
3837
  throw takeFromExternrefTable0(ret[0]);
3867
3838
  }
3868
3839
  }
3869
3840
 
3870
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_8(arg0, arg1, arg2) {
3871
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_8(arg0, arg1, arg2);
3841
+ function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6(arg0, arg1, arg2) {
3842
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6(arg0, arg1, arg2);
3872
3843
  if (ret[1]) {
3873
3844
  throw takeFromExternrefTable0(ret[0]);
3874
3845
  }
3875
3846
  }
3876
3847
 
3877
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_9(arg0, arg1, arg2) {
3878
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_9(arg0, arg1, arg2);
3848
+ function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7(arg0, arg1, arg2) {
3849
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7(arg0, arg1, arg2);
3879
3850
  if (ret[1]) {
3880
3851
  throw takeFromExternrefTable0(ret[0]);
3881
3852
  }
@@ -4090,31 +4061,6 @@ function isLikeNone(x) {
4090
4061
  return x === undefined || x === null;
4091
4062
  }
4092
4063
 
4093
- function makeClosure(arg0, arg1, f) {
4094
- const state = { a: arg0, b: arg1, cnt: 1 };
4095
- const real = (...args) => {
4096
-
4097
- // First up with a closure we increment the internal reference
4098
- // count. This ensures that the Rust closure environment won't
4099
- // be deallocated while we're invoking it.
4100
- state.cnt++;
4101
- try {
4102
- return f(state.a, state.b, ...args);
4103
- } finally {
4104
- real._wbg_cb_unref();
4105
- }
4106
- };
4107
- real._wbg_cb_unref = () => {
4108
- if (--state.cnt === 0) {
4109
- wasm.__wbindgen_destroy_closure(state.a, state.b);
4110
- state.a = 0;
4111
- CLOSURE_DTORS.unregister(state);
4112
- }
4113
- };
4114
- CLOSURE_DTORS.register(real, state, state);
4115
- return real;
4116
- }
4117
-
4118
4064
  function makeMutClosure(arg0, arg1, f) {
4119
4065
  const state = { a: arg0, b: arg1, cnt: 1 };
4120
4066
  const real = (...args) => {
Binary file
@@ -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;
@@ -441,9 +441,9 @@ class MysqlTreeStore {
441
441
  async getVerifiedLeafKeys() {
442
442
  try {
443
443
  // Project just the two pubkeys out of the JSON, skipping each leaf's
444
- // `data` blob (up to five transactions). The filter matches the verified
445
- // categories the SDK expects: every reserved leaf plus every Available
446
- // one, and nothing non-Available and unreserved.
444
+ // `data` blob (up to five transactions). Every stored leaf passed the
445
+ // ownership check on its way in, whatever its status, so all are
446
+ // projected.
447
447
  const [rows] = await this.pool.query(
448
448
  `SELECT l.id AS id,
449
449
  l.verifying_public_key AS verifying,
@@ -451,8 +451,7 @@ class MysqlTreeStore {
451
451
  FROM brz_tree_leaves l
452
452
  LEFT JOIN brz_tree_reservations r
453
453
  ON l.reservation_id = r.id AND l.user_id = r.user_id
454
- WHERE l.user_id = ?
455
- AND (r.purpose IS NOT NULL OR l.status = 'Available')`,
454
+ WHERE l.user_id = ?`,
456
455
  [this.identity]
457
456
  );
458
457
  return rows.map((row) => [row.id, row.verifying, row.keyshare]);
@@ -396,9 +396,9 @@ class PostgresTreeStore {
396
396
  async getVerifiedLeafKeys() {
397
397
  try {
398
398
  // Project just the two pubkeys out of the JSON, skipping each leaf's
399
- // `data` blob (up to five transactions). The filter matches the verified
400
- // categories the SDK expects: every reserved leaf plus every Available
401
- // one, and nothing non-Available and unreserved.
399
+ // `data` blob (up to five transactions). Every stored leaf passed the
400
+ // ownership check on its way in, whatever its status, so all are
401
+ // projected.
402
402
  const result = await this.pool.query(
403
403
  `
404
404
  SELECT l.id AS id,
@@ -408,7 +408,6 @@ class PostgresTreeStore {
408
408
  LEFT JOIN brz_tree_reservations r
409
409
  ON l.reservation_id = r.id AND l.user_id = r.user_id
410
410
  WHERE l.user_id = $1
411
- AND (r.purpose IS NOT NULL OR l.status = 'Available')
412
411
  `,
413
412
  [this.identity]
414
413
  );
@@ -349,9 +349,7 @@ class NodeTreeStore {
349
349
  `SELECT l.id AS id,
350
350
  l.verifying_public_key AS verifying,
351
351
  l.signing_public_key AS keyshare
352
- FROM brz_tree_leaves l
353
- LEFT JOIN brz_tree_reservations r ON l.reservation_id = r.id
354
- WHERE r.purpose IS NOT NULL OR l.status = 'Available'`
352
+ FROM brz_tree_leaves l`
355
353
  )
356
354
  .all();
357
355
  return rows.map((row) => [row.id, row.verifying, row.keyshare]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breeztech/breez-sdk-spark",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "Breez Spark SDK",
5
5
  "repository": "https://github.com/breez/spark-sdk",
6
6
  "author": "Breez <contact@breez.technology> (https://github.com/breez)",