@breeztech/breez-sdk-spark 0.25.0 → 0.26.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.
@@ -545,7 +545,7 @@ export interface BatchRecipient {
545
545
 
546
546
  export interface BatchTotal {
547
547
  tokenIdentifier?: string;
548
- amount: bigint;
548
+ amount: string;
549
549
  }
550
550
 
551
551
  export interface Bip21Details {
@@ -705,7 +705,7 @@ export interface ClaimDepositRequest {
705
705
  }
706
706
 
707
707
  export interface ClaimDepositResponse {
708
- payment?: Payment;
708
+ outcome: ClaimDepositOutcome;
709
709
  }
710
710
 
711
711
  export interface ClaimHtlcPaymentRequest {
@@ -832,12 +832,17 @@ export interface Credentials {
832
832
  password: string;
833
833
  }
834
834
 
835
+ export interface CrossChainAcceptedAsset {
836
+ asset: SparkAsset;
837
+ limits?: CrossChainRouteLimits;
838
+ }
839
+
835
840
  export interface CrossChainAddressDetails {
836
841
  address: string;
837
842
  addressFamily: CrossChainAddressFamily;
838
843
  contractAddress?: string;
839
844
  chainId?: number;
840
- amount?: bigint;
845
+ amount?: string;
841
846
  }
842
847
 
843
848
  export interface CrossChainConfig {
@@ -853,9 +858,17 @@ export interface CrossChainReceiveInfo {
853
858
  tokenIdentifier?: string;
854
859
  serviceFeeAmount: string;
855
860
  serviceFeeAsset?: string;
861
+ serviceFeeAssetDecimals?: number;
856
862
  expiresAt: number;
857
863
  }
858
864
 
865
+ export interface CrossChainRouteLimits {
866
+ minAmount?: string;
867
+ maxAmount?: string;
868
+ minUsdCents?: number;
869
+ maxUsdCents?: number;
870
+ }
871
+
859
872
  export interface CrossChainRoutePair {
860
873
  provider: CrossChainProvider;
861
874
  chain: string;
@@ -864,7 +877,7 @@ export interface CrossChainRoutePair {
864
877
  contractAddress?: string;
865
878
  decimals: number;
866
879
  exactOutEligible: boolean;
867
- acceptedAssets: SparkAsset[];
880
+ acceptedAssets: CrossChainAcceptedAsset[];
868
881
  deliveryMethods: DeliveryMethod[];
869
882
  }
870
883
 
@@ -888,6 +901,7 @@ export interface DepositInfo {
888
901
  claimError?: DepositClaimError;
889
902
  instantClaimStatus?: InstantClaimStatus;
890
903
  refundState?: RefundState;
904
+ maxClaimFee?: MaxFee;
891
905
  }
892
906
 
893
907
  export interface EcdsaSignatureBytes {
@@ -968,6 +982,10 @@ export interface ExternalInputParser {
968
982
  parserUrl: string;
969
983
  }
970
984
 
985
+ export interface ExternalLeafSigningKey {
986
+ derivedFrom: ExternalTreeNodeId;
987
+ }
988
+
971
989
  export interface ExternalNewLeafKey {
972
990
  nodeId: ExternalTreeNodeId;
973
991
  newSigningPublicKey: number[];
@@ -1114,6 +1132,7 @@ export interface ExternalStartedStaticDepositRefund {
1114
1132
  export interface ExternalTransferLeafInput {
1115
1133
  nodeId: ExternalTreeNodeId;
1116
1134
  newLeafId: ExternalTreeNodeId;
1135
+ signingKey: ExternalLeafSigningKey;
1117
1136
  }
1118
1137
 
1119
1138
  export interface ExternalTreeNodeId {
@@ -1486,6 +1505,7 @@ export interface PreparePaymentLinkResponse {
1486
1505
  asset: string;
1487
1506
  serviceFeeAmount: bigint;
1488
1507
  serviceFeeAsset?: string;
1508
+ serviceFeeAssetDecimals?: number;
1489
1509
  expiresAt: string;
1490
1510
  }
1491
1511
 
@@ -1831,6 +1851,8 @@ export interface Storage {
1831
1851
  deleteDeposit: (txid: string, vout: number) => Promise<void>;
1832
1852
  listDeposits: () => Promise<DepositInfo[]>;
1833
1853
  updateDeposit: (txid: string, vout: number, payload: UpdateDepositPayload) => Promise<void>;
1854
+ listWatchedDepositAddresses: () => Promise<WatchedDepositAddress[]>;
1855
+ updateWatchedDepositAddress: (address: string, payload: UpdateWatchedAddressPayload) => Promise<void>;
1834
1856
  setLnurlMetadata: (metadata: SetLnurlMetadataItem[]) => Promise<void>;
1835
1857
  getPaymentsByParentIds: (parentPaymentIds: string[]) => Promise<{ [parentId: string]: RelatedPayment[] }>;
1836
1858
  listContacts: (request: ListContactsRequest) => Promise<Contact[]>;
@@ -2025,6 +2047,12 @@ export interface Utxo {
2025
2047
  status: TxStatus;
2026
2048
  }
2027
2049
 
2050
+ export interface WatchedDepositAddress {
2051
+ address: string;
2052
+ issuedAt: number;
2053
+ seen: boolean;
2054
+ }
2055
+
2028
2056
  export interface Webhook {
2029
2057
  id: string;
2030
2058
  url: string;
@@ -2051,11 +2079,15 @@ export type BuyBitcoinRequest = { type: "moonpay"; lockedAmountSat?: number; red
2051
2079
 
2052
2080
  export type ChainApiType = "esplora" | "mempoolSpace";
2053
2081
 
2082
+ export type ClaimDeferredReason = { type: "maxFeeExceeded"; requiredFeeSats: number; maxFeeSats: number } | { type: "noEarlyClaimAvailable" } | { type: "providerDeclined"; message: string };
2083
+
2084
+ export type ClaimDepositOutcome = { type: "settled"; payment: Payment } | { type: "submitted" } | { type: "deferred"; reason: ClaimDeferredReason };
2085
+
2054
2086
  export type ConversionChain = { type: "spark" } | { type: "lightning" } | { type: "external"; name: string; chainId?: string };
2055
2087
 
2056
2088
  export type ConversionFilter = "ammRefundNeeded" | "orchestraPending" | "boltzPending";
2057
2089
 
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 };
2090
+ 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; serviceFeeAssetDecimals?: number; 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 };
2059
2091
 
2060
2092
  export type ConversionProvider = "amm" | "orchestra" | "boltz";
2061
2093
 
@@ -2103,13 +2135,13 @@ export type FeePolicy = "feesExcluded" | "feesIncluded";
2103
2135
 
2104
2136
  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);
2105
2137
 
2106
- export type InstantClaimStatus = { type: "declined"; maxFeeSats?: number; confirmations?: number } | { type: "submitted"; claimId: string };
2138
+ export type InstantClaimStatus = { type: "declined"; maxFeeSats?: number; confirmations?: number } | { type: "submitted"; claimId: string } | { type: "claimed" };
2107
2139
 
2108
2140
  export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
2109
2141
 
2110
2142
  export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
2111
2143
 
2112
- export type Network = "mainnet" | "regtest";
2144
+ export type Network = "mainnet" | "regtest" | "signet";
2113
2145
 
2114
2146
  export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
2115
2147
 
@@ -2141,11 +2173,11 @@ export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvo
2141
2173
 
2142
2174
  export type RefundState = { type: "broadcastPending"; lastError?: string } | { type: "broadcast" };
2143
2175
 
2144
- 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" };
2176
+ 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: "paymentMetadataUpdated"; payment: Payment } | { type: "autoOptimization"; optimizationEvent: AutoOptimizationEvent } | { type: "lightningAddressChanged"; lightningAddress?: LightningAddressInfo } | { type: "newDeposits"; newDeposits: DepositInfo[] } | { type: "unilateralExitStateChanged" };
2145
2177
 
2146
2178
  export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
2147
2179
 
2148
- export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string } | { type: "crossChainAddress"; route: CrossChainRoutePair; recipientAddress: string; amountIn: string; assetAmountIn: string; estimatedOut: string; feeAmount: string; serviceFeeAmount: string; serviceFeeAsset?: string; sourceTransferFeeSats: number; feeMode: CrossChainFeeMode; expiresAt: string; providerContext: CrossChainProviderContext };
2180
+ export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string } | { type: "crossChainAddress"; route: CrossChainRoutePair; recipientAddress: string; amountIn: string; assetAmountIn: string; estimatedOut: string; feeAmount: string; serviceFeeAmount: string; serviceFeeAsset?: string; serviceFeeAssetDecimals?: number; sourceTransferFeeSats: number; feeMode: CrossChainFeeMode; expiresAt: string; providerContext: CrossChainProviderContext };
2149
2181
 
2150
2182
  export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
2151
2183
 
@@ -2183,7 +2215,9 @@ export type UnilateralExitVerdict = { type: "valid" } | { type: "done" } | { typ
2183
2215
 
2184
2216
  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 };
2185
2217
 
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 };
2218
+ 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 } | { type: "maxClaimFee"; maxFee?: MaxFee };
2219
+
2220
+ export type UpdateWatchedAddressPayload = { type: "watch"; issuedAt: number } | { type: "seen" } | { type: "unwatch"; issuedAt: number };
2187
2221
 
2188
2222
  export type WebhookEventType = { type: "lightningReceiveFinished" } | { type: "lightningSendFinished" } | { type: "coopExitFinished" } | { type: "staticDepositFinished" } | ({ type: "unknown" } & string);
2189
2223
 
@@ -2896,6 +2896,10 @@ function __wbg_get_imports() {
2896
2896
  const ret = arg0.listTokensOutputs();
2897
2897
  return ret;
2898
2898
  }, arguments); },
2899
+ __wbg_listWatchedDepositAddresses_55fe8af0643e3ea9: function() { return handleError(function (arg0) {
2900
+ const ret = arg0.listWatchedDepositAddresses();
2901
+ return ret;
2902
+ }, arguments); },
2899
2903
  __wbg_log_cf86719f8acabfda: function(arg0, arg1) {
2900
2904
  arg0.log(arg1);
2901
2905
  },
@@ -3595,6 +3599,18 @@ function __wbg_get_imports() {
3595
3599
  const ret = arg0.updateTokenOutputs(arg1, arg2);
3596
3600
  return ret;
3597
3601
  }, arguments); },
3602
+ __wbg_updateWatchedDepositAddress_260322f77dee1443: function() { return handleError(function (arg0, arg1, arg2, arg3) {
3603
+ let deferred0_0;
3604
+ let deferred0_1;
3605
+ try {
3606
+ deferred0_0 = arg1;
3607
+ deferred0_1 = arg2;
3608
+ const ret = arg0.updateWatchedDepositAddress(getStringFromWasm0(arg1, arg2), arg3);
3609
+ return ret;
3610
+ } finally {
3611
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3612
+ }
3613
+ }, arguments); },
3598
3614
  __wbg_url_68fd9a221360e0db: function(arg0, arg1) {
3599
3615
  const ret = arg1.url;
3600
3616
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -3630,47 +3646,47 @@ function __wbg_get_imports() {
3630
3646
  return ret;
3631
3647
  },
3632
3648
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
3633
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3634
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522);
3649
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3650
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a);
3635
3651
  return ret;
3636
3652
  },
3637
3653
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
3638
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 397, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3654
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3639
3655
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25);
3640
3656
  return ret;
3641
3657
  },
3642
3658
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
3643
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 397, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3659
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3644
3660
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2);
3645
3661
  return ret;
3646
3662
  },
3647
3663
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
3648
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 397, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3664
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3649
3665
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3);
3650
3666
  return ret;
3651
3667
  },
3652
3668
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
3653
- // 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`.
3654
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_4);
3669
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("SessionStore")], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3670
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4);
3655
3671
  return ret;
3656
3672
  },
3657
3673
  __wbindgen_cast_0000000000000006: function(arg0, arg1) {
3658
- // 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`.
3659
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_5);
3674
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Storage")], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3675
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5);
3660
3676
  return ret;
3661
3677
  },
3662
3678
  __wbindgen_cast_0000000000000007: function(arg0, arg1) {
3663
- // 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`.
3664
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6);
3679
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TokenStore")], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3680
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6);
3665
3681
  return ret;
3666
3682
  },
3667
3683
  __wbindgen_cast_0000000000000008: function(arg0, arg1) {
3668
- // 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`.
3669
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7);
3684
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TreeStore")], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3685
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7);
3670
3686
  return ret;
3671
3687
  },
3672
3688
  __wbindgen_cast_0000000000000009: function(arg0, arg1) {
3673
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 402, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3689
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 409, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3674
3690
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7);
3675
3691
  return ret;
3676
3692
  },
@@ -3778,36 +3794,36 @@ function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3(arg0, a
3778
3794
  wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3(arg0, arg1, arg2);
3779
3795
  }
3780
3796
 
3781
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522(arg0, arg1, arg2) {
3782
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522(arg0, arg1, arg2);
3797
+ function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a(arg0, arg1, arg2) {
3798
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a(arg0, arg1, arg2);
3783
3799
  if (ret[1]) {
3784
3800
  throw takeFromExternrefTable0(ret[0]);
3785
3801
  }
3786
3802
  }
3787
3803
 
3788
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_4(arg0, arg1, arg2) {
3789
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_4(arg0, arg1, arg2);
3804
+ function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4(arg0, arg1, arg2) {
3805
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4(arg0, arg1, arg2);
3790
3806
  if (ret[1]) {
3791
3807
  throw takeFromExternrefTable0(ret[0]);
3792
3808
  }
3793
3809
  }
3794
3810
 
3795
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_5(arg0, arg1, arg2) {
3796
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_5(arg0, arg1, arg2);
3811
+ function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5(arg0, arg1, arg2) {
3812
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5(arg0, arg1, arg2);
3797
3813
  if (ret[1]) {
3798
3814
  throw takeFromExternrefTable0(ret[0]);
3799
3815
  }
3800
3816
  }
3801
3817
 
3802
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6(arg0, arg1, arg2) {
3803
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6(arg0, arg1, arg2);
3818
+ function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6(arg0, arg1, arg2) {
3819
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6(arg0, arg1, arg2);
3804
3820
  if (ret[1]) {
3805
3821
  throw takeFromExternrefTable0(ret[0]);
3806
3822
  }
3807
3823
  }
3808
3824
 
3809
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7(arg0, arg1, arg2) {
3810
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7(arg0, arg1, arg2);
3825
+ function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7(arg0, arg1, arg2) {
3826
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7(arg0, arg1, arg2);
3811
3827
  if (ret[1]) {
3812
3828
  throw takeFromExternrefTable0(ret[0]);
3813
3829
  }
Binary file
@@ -189,11 +189,11 @@ export const __wbg_externalsparksignerhandle_free: (a: number, b: number) => voi
189
189
  export const __wbg_signingonlyexternalsigners_free: (a: number, b: number) => void;
190
190
  export const signingonlyexternalsigners_breezSigner: (a: number) => number;
191
191
  export const signingonlyexternalsigners_sparkSigner: (a: number) => number;
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];
195
- export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6: (a: number, b: number, c: any) => [number, number];
196
- export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7: (a: number, b: number, c: any) => [number, number];
192
+ export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a: (a: number, b: number, c: any) => [number, number];
193
+ export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4: (a: number, b: number, c: any) => [number, number];
194
+ export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5: (a: number, b: number, c: any) => [number, number];
195
+ export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6: (a: number, b: number, c: any) => [number, number];
196
+ export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7: (a: number, b: number, c: any) => [number, number];
197
197
  export const wasm_bindgen__convert__closures_____invoke__h41057d61edf43a32: (a: number, b: number, c: any, d: any) => void;
198
198
  export const wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25: (a: number, b: number, c: any) => void;
199
199
  export const wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2: (a: number, b: number, c: any) => void;
@@ -545,7 +545,7 @@ export interface BatchRecipient {
545
545
 
546
546
  export interface BatchTotal {
547
547
  tokenIdentifier?: string;
548
- amount: bigint;
548
+ amount: string;
549
549
  }
550
550
 
551
551
  export interface Bip21Details {
@@ -705,7 +705,7 @@ export interface ClaimDepositRequest {
705
705
  }
706
706
 
707
707
  export interface ClaimDepositResponse {
708
- payment?: Payment;
708
+ outcome: ClaimDepositOutcome;
709
709
  }
710
710
 
711
711
  export interface ClaimHtlcPaymentRequest {
@@ -832,12 +832,17 @@ export interface Credentials {
832
832
  password: string;
833
833
  }
834
834
 
835
+ export interface CrossChainAcceptedAsset {
836
+ asset: SparkAsset;
837
+ limits?: CrossChainRouteLimits;
838
+ }
839
+
835
840
  export interface CrossChainAddressDetails {
836
841
  address: string;
837
842
  addressFamily: CrossChainAddressFamily;
838
843
  contractAddress?: string;
839
844
  chainId?: number;
840
- amount?: bigint;
845
+ amount?: string;
841
846
  }
842
847
 
843
848
  export interface CrossChainConfig {
@@ -853,9 +858,17 @@ export interface CrossChainReceiveInfo {
853
858
  tokenIdentifier?: string;
854
859
  serviceFeeAmount: string;
855
860
  serviceFeeAsset?: string;
861
+ serviceFeeAssetDecimals?: number;
856
862
  expiresAt: number;
857
863
  }
858
864
 
865
+ export interface CrossChainRouteLimits {
866
+ minAmount?: string;
867
+ maxAmount?: string;
868
+ minUsdCents?: number;
869
+ maxUsdCents?: number;
870
+ }
871
+
859
872
  export interface CrossChainRoutePair {
860
873
  provider: CrossChainProvider;
861
874
  chain: string;
@@ -864,7 +877,7 @@ export interface CrossChainRoutePair {
864
877
  contractAddress?: string;
865
878
  decimals: number;
866
879
  exactOutEligible: boolean;
867
- acceptedAssets: SparkAsset[];
880
+ acceptedAssets: CrossChainAcceptedAsset[];
868
881
  deliveryMethods: DeliveryMethod[];
869
882
  }
870
883
 
@@ -888,6 +901,7 @@ export interface DepositInfo {
888
901
  claimError?: DepositClaimError;
889
902
  instantClaimStatus?: InstantClaimStatus;
890
903
  refundState?: RefundState;
904
+ maxClaimFee?: MaxFee;
891
905
  }
892
906
 
893
907
  export interface EcdsaSignatureBytes {
@@ -968,6 +982,10 @@ export interface ExternalInputParser {
968
982
  parserUrl: string;
969
983
  }
970
984
 
985
+ export interface ExternalLeafSigningKey {
986
+ derivedFrom: ExternalTreeNodeId;
987
+ }
988
+
971
989
  export interface ExternalNewLeafKey {
972
990
  nodeId: ExternalTreeNodeId;
973
991
  newSigningPublicKey: number[];
@@ -1114,6 +1132,7 @@ export interface ExternalStartedStaticDepositRefund {
1114
1132
  export interface ExternalTransferLeafInput {
1115
1133
  nodeId: ExternalTreeNodeId;
1116
1134
  newLeafId: ExternalTreeNodeId;
1135
+ signingKey: ExternalLeafSigningKey;
1117
1136
  }
1118
1137
 
1119
1138
  export interface ExternalTreeNodeId {
@@ -1486,6 +1505,7 @@ export interface PreparePaymentLinkResponse {
1486
1505
  asset: string;
1487
1506
  serviceFeeAmount: bigint;
1488
1507
  serviceFeeAsset?: string;
1508
+ serviceFeeAssetDecimals?: number;
1489
1509
  expiresAt: string;
1490
1510
  }
1491
1511
 
@@ -1831,6 +1851,8 @@ export interface Storage {
1831
1851
  deleteDeposit: (txid: string, vout: number) => Promise<void>;
1832
1852
  listDeposits: () => Promise<DepositInfo[]>;
1833
1853
  updateDeposit: (txid: string, vout: number, payload: UpdateDepositPayload) => Promise<void>;
1854
+ listWatchedDepositAddresses: () => Promise<WatchedDepositAddress[]>;
1855
+ updateWatchedDepositAddress: (address: string, payload: UpdateWatchedAddressPayload) => Promise<void>;
1834
1856
  setLnurlMetadata: (metadata: SetLnurlMetadataItem[]) => Promise<void>;
1835
1857
  getPaymentsByParentIds: (parentPaymentIds: string[]) => Promise<{ [parentId: string]: RelatedPayment[] }>;
1836
1858
  listContacts: (request: ListContactsRequest) => Promise<Contact[]>;
@@ -2025,6 +2047,12 @@ export interface Utxo {
2025
2047
  status: TxStatus;
2026
2048
  }
2027
2049
 
2050
+ export interface WatchedDepositAddress {
2051
+ address: string;
2052
+ issuedAt: number;
2053
+ seen: boolean;
2054
+ }
2055
+
2028
2056
  export interface Webhook {
2029
2057
  id: string;
2030
2058
  url: string;
@@ -2051,11 +2079,15 @@ export type BuyBitcoinRequest = { type: "moonpay"; lockedAmountSat?: number; red
2051
2079
 
2052
2080
  export type ChainApiType = "esplora" | "mempoolSpace";
2053
2081
 
2082
+ export type ClaimDeferredReason = { type: "maxFeeExceeded"; requiredFeeSats: number; maxFeeSats: number } | { type: "noEarlyClaimAvailable" } | { type: "providerDeclined"; message: string };
2083
+
2084
+ export type ClaimDepositOutcome = { type: "settled"; payment: Payment } | { type: "submitted" } | { type: "deferred"; reason: ClaimDeferredReason };
2085
+
2054
2086
  export type ConversionChain = { type: "spark" } | { type: "lightning" } | { type: "external"; name: string; chainId?: string };
2055
2087
 
2056
2088
  export type ConversionFilter = "ammRefundNeeded" | "orchestraPending" | "boltzPending";
2057
2089
 
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 };
2090
+ 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; serviceFeeAssetDecimals?: number; 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 };
2059
2091
 
2060
2092
  export type ConversionProvider = "amm" | "orchestra" | "boltz";
2061
2093
 
@@ -2103,13 +2135,13 @@ export type FeePolicy = "feesExcluded" | "feesIncluded";
2103
2135
 
2104
2136
  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);
2105
2137
 
2106
- export type InstantClaimStatus = { type: "declined"; maxFeeSats?: number; confirmations?: number } | { type: "submitted"; claimId: string };
2138
+ export type InstantClaimStatus = { type: "declined"; maxFeeSats?: number; confirmations?: number } | { type: "submitted"; claimId: string } | { type: "claimed" };
2107
2139
 
2108
2140
  export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
2109
2141
 
2110
2142
  export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
2111
2143
 
2112
- export type Network = "mainnet" | "regtest";
2144
+ export type Network = "mainnet" | "regtest" | "signet";
2113
2145
 
2114
2146
  export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
2115
2147
 
@@ -2141,11 +2173,11 @@ export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvo
2141
2173
 
2142
2174
  export type RefundState = { type: "broadcastPending"; lastError?: string } | { type: "broadcast" };
2143
2175
 
2144
- 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" };
2176
+ 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: "paymentMetadataUpdated"; payment: Payment } | { type: "autoOptimization"; optimizationEvent: AutoOptimizationEvent } | { type: "lightningAddressChanged"; lightningAddress?: LightningAddressInfo } | { type: "newDeposits"; newDeposits: DepositInfo[] } | { type: "unilateralExitStateChanged" };
2145
2177
 
2146
2178
  export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
2147
2179
 
2148
- export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string } | { type: "crossChainAddress"; route: CrossChainRoutePair; recipientAddress: string; amountIn: string; assetAmountIn: string; estimatedOut: string; feeAmount: string; serviceFeeAmount: string; serviceFeeAsset?: string; sourceTransferFeeSats: number; feeMode: CrossChainFeeMode; expiresAt: string; providerContext: CrossChainProviderContext };
2180
+ export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string } | { type: "crossChainAddress"; route: CrossChainRoutePair; recipientAddress: string; amountIn: string; assetAmountIn: string; estimatedOut: string; feeAmount: string; serviceFeeAmount: string; serviceFeeAsset?: string; serviceFeeAssetDecimals?: number; sourceTransferFeeSats: number; feeMode: CrossChainFeeMode; expiresAt: string; providerContext: CrossChainProviderContext };
2149
2181
 
2150
2182
  export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
2151
2183
 
@@ -2183,7 +2215,9 @@ export type UnilateralExitVerdict = { type: "valid" } | { type: "done" } | { typ
2183
2215
 
2184
2216
  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 };
2185
2217
 
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 };
2218
+ 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 } | { type: "maxClaimFee"; maxFee?: MaxFee };
2219
+
2220
+ export type UpdateWatchedAddressPayload = { type: "watch"; issuedAt: number } | { type: "seen" } | { type: "unwatch"; issuedAt: number };
2187
2221
 
2188
2222
  export type WebhookEventType = { type: "lightningReceiveFinished" } | { type: "lightningSendFinished" } | { type: "coopExitFinished" } | { type: "staticDepositFinished" } | ({ type: "unknown" } & string);
2189
2223