@breeztech/breez-sdk-spark 0.19.2 → 0.21.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.
Files changed (36) hide show
  1. package/breez-sdk-spark.tgz +0 -0
  2. package/bundler/breez_sdk_spark_wasm.d.ts +170 -12
  3. package/bundler/breez_sdk_spark_wasm.js +1 -1
  4. package/bundler/breez_sdk_spark_wasm_bg.js +186 -44
  5. package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
  6. package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +11 -0
  7. package/deno/breez_sdk_spark_wasm.d.ts +170 -12
  8. package/deno/breez_sdk_spark_wasm.js +186 -44
  9. package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
  10. package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +11 -0
  11. package/itest/.gitignore +2 -0
  12. package/itest/helpers/assert.test.js +70 -0
  13. package/itest/helpers/faucet.js +68 -0
  14. package/itest/helpers/lnurl-fixture.js +229 -0
  15. package/itest/helpers/scenario.js +444 -0
  16. package/itest/package-lock.json +519 -0
  17. package/itest/package.json +18 -0
  18. package/itest/scenarios.test.js +47 -0
  19. package/itest/smoke.test.js +184 -0
  20. package/nodejs/breez_sdk_spark_wasm.d.ts +170 -12
  21. package/nodejs/breez_sdk_spark_wasm.js +188 -44
  22. package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
  23. package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +11 -0
  24. package/nodejs/index.mjs +2 -0
  25. package/nodejs/mysql-token-store/index.cjs +302 -205
  26. package/nodejs/mysql-tree-store/index.cjs +43 -24
  27. package/nodejs/postgres-token-store/index.cjs +284 -205
  28. package/nodejs/postgres-tree-store/index.cjs +33 -17
  29. package/package.json +1 -1
  30. package/ssr/index.js +12 -0
  31. package/web/breez_sdk_spark_wasm.d.ts +181 -12
  32. package/web/breez_sdk_spark_wasm.js +186 -44
  33. package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
  34. package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +11 -0
  35. package/web/passkey-prf-provider/index.d.ts +9 -2
  36. package/web/passkey-prf-provider/index.js +49 -11
Binary file
@@ -89,7 +89,7 @@ interface WasmTokenOutputWithPrevOut {
89
89
  }
90
90
 
91
91
  interface WasmTokenOutputs {
92
- metadata: WasmTokenMetadata;
92
+ metadata: WasmTokenMetadata[];
93
93
  outputs: WasmTokenOutputWithPrevOut[];
94
94
  }
95
95
 
@@ -119,26 +119,23 @@ type WasmReservationTarget =
119
119
  | { type: 'maxOutputCount'; value: number };
120
120
 
121
121
  export interface TokenStore {
122
- setTokensOutputs: (tokenOutputs: WasmTokenOutputs[], refreshStartedAtMs: number) => Promise<void>;
122
+ setTokensOutputs: (tokenOutputs: WasmTokenOutputs, refreshStartedAtMs: number) => Promise<void>;
123
123
  listTokensOutputs: () => Promise<WasmTokenOutputsPerStatus[]>;
124
124
  getTokenBalances: () => Promise<WasmTokenBalance[]>;
125
125
  getTokenOutputs: (filter: WasmGetTokenOutputsFilter) => Promise<WasmTokenOutputsPerStatus>;
126
- updateTokenOutputs: (outputsToRemove: [string, number][], outputsToAdd: WasmTokenOutputs | null) => Promise<void>;
126
+ updateTokenOutputs: (outputsToRemove: [string, number][], outputsToAdd: WasmTokenOutputs) => Promise<void>;
127
127
  reserveTokenOutputs: (
128
- tokenIdentifier: string,
129
- target: WasmReservationTarget,
128
+ targets: [string, WasmReservationTarget][],
130
129
  purpose: string,
131
130
  preferredOutputs: WasmTokenOutputWithPrevOut[] | null,
132
131
  selectionStrategy: string | null
133
132
  ) => Promise<WasmTokenOutputsReservation>;
134
133
  selectTokenOutputs: (
135
- tokenIdentifier: string,
136
- target: WasmReservationTarget,
134
+ targets: [string, WasmReservationTarget][],
137
135
  preferredOutputs: WasmTokenOutputWithPrevOut[] | null,
138
136
  selectionStrategy: string | null
139
137
  ) => Promise<WasmTokenOutputs>;
140
138
  reserveTokenOutputsByOutpoints: (
141
- tokenIdentifier: string,
142
139
  outpoints: { prevTxHash: string; prevTxVout: number }[],
143
140
  purpose: string
144
141
  ) => Promise<WasmTokenOutputsReservation>;
@@ -147,6 +144,20 @@ export interface TokenStore {
147
144
  now: () => Promise<number>;
148
145
  }
149
146
 
147
+ /**
148
+ * A created credential, plus the PRF outputs when the browser evaluated
149
+ * them during the create ceremony. `seeds` is null when it did not, so
150
+ * the caller derives through `deriveSeeds`.
151
+ *
152
+ * Seeds returned here must equal what `deriveSeeds` returns for the same
153
+ * salts: the wallet is derived from them either way, so a mismatch means
154
+ * register and sign-in land on different wallets.
155
+ */
156
+ export interface CreatePasskeyOutput {
157
+ credential: PasskeyCredential;
158
+ seeds?: Uint8Array[] | null;
159
+ }
160
+
150
161
  /**
151
162
  * A passkey credential from `register` or `signIn`. `credentialId` is
152
163
  * always set. The attestation fields (`userId`, `aaguid`,
@@ -297,10 +308,14 @@ export interface PrfProvider {
297
308
  * `excludeCredentials` lists already-registered IDs; a match raises
298
309
  * `PasskeyAlreadyExistsError`.
299
310
  *
311
+ * Evaluating PRF for `salts` in the same ceremony returns the seeds on
312
+ * `seeds`, and the caller then needs no assertion. Return `seeds: null`
313
+ * when the authenticator evaluated none, or fewer than one per salt.
314
+ *
300
315
  * @throws `PasskeyAlreadyExistsError` when an entry in
301
316
  * `excludeCredentials` matches a credential already on the device.
302
317
  */
303
- createPasskey?(excludeCredentials: Uint8Array[]): Promise<PasskeyCredential>;
318
+ createPasskey?(excludeCredentials: Uint8Array[], salts: string[]): Promise<CreatePasskeyOutput>;
304
319
 
305
320
  /**
306
321
  * Whether this provider can produce PRF outputs on the current
@@ -488,6 +503,17 @@ export interface AuthorizeTransferRequest {
488
503
  transfereePubkey: string;
489
504
  }
490
505
 
506
+ export interface BatchRecipient {
507
+ paymentRequest: string;
508
+ amount?: bigint;
509
+ tokenIdentifier?: string;
510
+ }
511
+
512
+ export interface BatchTotal {
513
+ tokenIdentifier?: string;
514
+ amount: bigint;
515
+ }
516
+
491
517
  export interface Bip21Details {
492
518
  amountSat?: number;
493
519
  assetId?: string;
@@ -511,8 +537,10 @@ export interface BitcoinAddressDetails {
511
537
 
512
538
  export interface BitcoinChainService {
513
539
  getAddressUtxos(address: string): Promise<Utxo[]>;
540
+ getAddressTxos(address: string): Promise<Utxo[]>;
514
541
  getTransactionStatus(txid: string): Promise<TxStatus>;
515
542
  getTransactionHex(txid: string): Promise<string>;
543
+ getOutspend(txid: string, vout: number): Promise<Outspend>;
516
544
  broadcastTransaction(tx: string): Promise<void>;
517
545
  recommendedFees(): Promise<RecommendedFees>;
518
546
  }
@@ -583,6 +611,10 @@ export interface Bolt12OfferDetails {
583
611
  signingPubkey?: string;
584
612
  }
585
613
 
614
+ export interface BuildUnsignedBatchPackageRequest {
615
+ prepareResponse: PrepareSendBatchResponse;
616
+ }
617
+
586
618
  export interface BuildUnsignedLnurlPayPackageRequest {
587
619
  prepareResponse: PrepareLnurlPayResponse;
588
620
  }
@@ -718,6 +750,10 @@ export interface ConversionSide {
718
750
  fee: string;
719
751
  }
720
752
 
753
+ export interface CpfpSigner {
754
+ signPsbt(psbtBytes: Uint8Array): Promise<Uint8Array>;
755
+ }
756
+
721
757
  export interface CreateIssuerTokenRequest {
722
758
  name: string;
723
759
  ticker: string;
@@ -955,6 +991,7 @@ export interface ExternalSparkSigner {
955
991
  getStaticDepositPublicKey(index: number): Promise<PublicKeyBytes>;
956
992
  signAuthenticationChallenge(challenge: Uint8Array): Promise<EcdsaSignatureBytes>;
957
993
  signMessage(message: Uint8Array): Promise<EcdsaSignatureBytes>;
994
+ signLeafRefundSpend(leafId: ExternalTreeNodeId, sighash: Uint8Array): Promise<SchnorrSignatureBytes>;
958
995
  signFrost(jobs: ExternalFrostJob[]): Promise<ExternalFrostShareResult[]>;
959
996
  prepareTransfer(request: ExternalPrepareTransferRequest): Promise<ExternalPreparedTransfer>;
960
997
  prepareClaim(request: ExternalPrepareClaimRequest): Promise<ExternalPreparedClaim>;
@@ -1282,6 +1319,11 @@ export interface PaymentRequestSource {
1282
1319
  bip353Address?: string;
1283
1320
  }
1284
1321
 
1322
+ export interface PerBranchFunding {
1323
+ leafId: string;
1324
+ fundingSat: number;
1325
+ }
1326
+
1285
1327
  export interface PrepareLnurlPayRequest {
1286
1328
  amount: bigint;
1287
1329
  comment?: string;
@@ -1303,6 +1345,15 @@ export interface PrepareLnurlPayResponse {
1303
1345
  feePolicy: FeePolicy;
1304
1346
  }
1305
1347
 
1348
+ export interface PrepareSendBatchRequest {
1349
+ recipients: BatchRecipient[];
1350
+ }
1351
+
1352
+ export interface PrepareSendBatchResponse {
1353
+ recipients: ResolvedBatchRecipient[];
1354
+ totals: BatchTotal[];
1355
+ }
1356
+
1306
1357
  export interface PrepareSendPaymentRequest {
1307
1358
  paymentRequest: PaymentRequest;
1308
1359
  amount?: bigint;
@@ -1319,6 +1370,24 @@ export interface PrepareSendPaymentResponse {
1319
1370
  feePolicy: FeePolicy;
1320
1371
  }
1321
1372
 
1373
+ export interface PrepareUnilateralExitRequest {
1374
+ feeRateSatPerVbyte: number;
1375
+ fundingKind: CpfpFundingKind;
1376
+ destination: string;
1377
+ selection: ExitLeafSelection;
1378
+ }
1379
+
1380
+ export interface PrepareUnilateralExitResponse {
1381
+ leaves: UnilateralExitLeaf[];
1382
+ recoverableValueSat: number;
1383
+ totalFeeSat: number;
1384
+ fanoutFeeSat: number;
1385
+ singleUtxoFundingSat: number;
1386
+ perBranchFunding: PerBranchFunding[];
1387
+ feeRateSatPerVbyte: number;
1388
+ destination: string;
1389
+ }
1390
+
1322
1391
  export interface ProvisionalPayment {
1323
1392
  paymentId: string;
1324
1393
  amount: bigint;
@@ -1394,6 +1463,12 @@ export interface RefundDepositResponse {
1394
1463
  txHex: string;
1395
1464
  }
1396
1465
 
1466
+ export interface RefundPendingConversionsResponse {
1467
+ refunded: number;
1468
+ skipped: number;
1469
+ failed: number;
1470
+ }
1471
+
1397
1472
  export interface RegisterLightningAddressRequest {
1398
1473
  username: string;
1399
1474
  description?: string;
@@ -1409,6 +1484,12 @@ export interface RegisterWebhookResponse {
1409
1484
  webhookId: string;
1410
1485
  }
1411
1486
 
1487
+ export interface ResolvedBatchRecipient {
1488
+ destination: BatchDestination;
1489
+ amount: bigint;
1490
+ tokenIdentifier?: string;
1491
+ }
1492
+
1412
1493
  export interface RestClient {
1413
1494
  getRequest(url: string, headers?: Record<string, string>): Promise<RestResponse>;
1414
1495
  postRequest(url: string, headers?: Record<string, string>, body?: string): Promise<RestResponse>;
@@ -1428,6 +1509,14 @@ export interface SecretBytes {
1428
1509
  bytes: number[];
1429
1510
  }
1430
1511
 
1512
+ export interface SendBatchRequest {
1513
+ prepareResponse: PrepareSendBatchResponse;
1514
+ }
1515
+
1516
+ export interface SendBatchResponse {
1517
+ payments: Payment[];
1518
+ }
1519
+
1431
1520
  export interface SendOnchainFeeQuote {
1432
1521
  id: string;
1433
1522
  expiresAt: number;
@@ -1701,6 +1790,34 @@ export interface UnfreezeIssuerTokenResponse {
1701
1790
  impactedTokenAmount: bigint;
1702
1791
  }
1703
1792
 
1793
+ export interface UnilateralExitLeaf {
1794
+ leafId: string;
1795
+ value: number;
1796
+ }
1797
+
1798
+ export interface UnilateralExitRequest {
1799
+ prepared: PrepareUnilateralExitResponse;
1800
+ fundingInputs: CpfpInput[];
1801
+ }
1802
+
1803
+ export interface UnilateralExitResponse {
1804
+ recoverableValueSat: number;
1805
+ totalFeeSat: number;
1806
+ leaves: UnilateralExitLeaf[];
1807
+ transactions: UnilateralExitTransaction[];
1808
+ }
1809
+
1810
+ export interface UnilateralExitTransaction {
1811
+ kind: UnilateralExitTxKind;
1812
+ nodeId?: string;
1813
+ txid: string;
1814
+ txHex: string;
1815
+ cpfpTxHex?: string;
1816
+ csvTimelockBlocks?: number;
1817
+ dependsOn: string[];
1818
+ status: ConfirmationStatus;
1819
+ }
1820
+
1704
1821
  export interface UnregisterWebhookRequest {
1705
1822
  webhookId: string;
1706
1823
  }
@@ -1720,6 +1837,7 @@ export interface UpdateContactRequest {
1720
1837
  export interface UpdateUserSettingsRequest {
1721
1838
  sparkPrivateModeEnabled?: boolean;
1722
1839
  stableBalanceActiveLabel?: StableBalanceActiveLabel;
1840
+ sparkMasterIdentityPublicKey?: SparkMasterIdentityPublicKey;
1723
1841
  }
1724
1842
 
1725
1843
  export interface UrlSuccessActionData {
@@ -1731,6 +1849,7 @@ export interface UrlSuccessActionData {
1731
1849
  export interface UserSettings {
1732
1850
  sparkPrivateModeEnabled: boolean;
1733
1851
  stableBalanceActiveLabel?: string;
1852
+ sparkMasterIdentityPublicKey?: string;
1734
1853
  }
1735
1854
 
1736
1855
  export interface Utxo {
@@ -1756,6 +1875,8 @@ export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier
1756
1875
 
1757
1876
  export type AutoOptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
1758
1877
 
1878
+ export type BatchDestination = { type: "sparkAddress"; address: string } | { type: "sparkInvoice"; invoiceDetails: SparkInvoiceDetails };
1879
+
1759
1880
  export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
1760
1881
 
1761
1882
  export type BuildTransferPackageOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number };
@@ -1764,6 +1885,8 @@ export type BuyBitcoinRequest = { type: "moonpay"; lockedAmountSat?: number; red
1764
1885
 
1765
1886
  export type ChainApiType = "esplora" | "mempoolSpace";
1766
1887
 
1888
+ export type ConfirmationStatus = "confirmed" | "unconfirmed" | "unverified";
1889
+
1767
1890
  export type ConversionChain = { type: "spark" } | { type: "lightning" } | { type: "external"; name: string; chainId?: string };
1768
1891
 
1769
1892
  export type ConversionFilter = "ammRefundNeeded" | "orchestraPending" | "boltzPending";
@@ -1778,6 +1901,10 @@ export type ConversionStatus = "pending" | "completed" | "failed" | "refundNeede
1778
1901
 
1779
1902
  export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
1780
1903
 
1904
+ export type CpfpFundingKind = { type: "p2wpkh" } | { type: "p2tr" } | { type: "custom"; scriptPubkeyHex: string; signedInputWeight: number };
1905
+
1906
+ export type CpfpInput = { type: "p2wpkh"; txid: string; vout: number; value: number; pubkey: string } | { type: "p2tr"; txid: string; vout: number; value: number; pubkey: string } | { type: "custom"; txid: string; vout: number; value: number; scriptPubkeyHex: string; signedInputWeight: number };
1907
+
1781
1908
  export type CrossChainAddressFamily = "evm" | "solana" | "tron";
1782
1909
 
1783
1910
  export type CrossChainFeeMode = "feesExcluded" | "feesIncluded";
@@ -1790,6 +1917,8 @@ export type CrossChainRouteFilter = { type: "send"; addressDetails: CrossChainAd
1790
1917
 
1791
1918
  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 };
1792
1919
 
1920
+ export type ExitLeafSelection = { type: "auto" } | { type: "specific"; leafIds: string[] };
1921
+
1793
1922
  export type ExternalFrostDerivation = { type: "signingLeaf"; leafId: ExternalTreeNodeId } | { type: "staticDeposit"; index: number } | { type: "htlcPreimage" } | { type: "identity" };
1794
1923
 
1795
1924
  export type ExternalSparkInvoiceKind = "sats" | "tokens";
@@ -1814,6 +1943,8 @@ export type OptimizationMode = "full" | "singleRound";
1814
1943
 
1815
1944
  export type OptimizationOutcome = { type: "completed"; roundsExecuted: number } | { type: "inProgress" };
1816
1945
 
1946
+ export type Outspend = { type: "unspent" } | { type: "spent"; txid: string; vin: number; status: TxStatus };
1947
+
1817
1948
  export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails; conversionInfo?: ConversionInfo } | { type: "token"; metadata: TokenMetadata; txHash: string; txType: TokenTransactionType; invoiceDetails?: SparkInvoicePaymentDetails; conversionInfo?: ConversionInfo } | { type: "lightning"; description?: string; invoice: string; destinationPubkey: string; htlcDetails: SparkHtlcDetails; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo; lnurlReceiveMetadata?: LnurlReceiveMetadata; conversionInfo?: ConversionInfo } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string; vout: number };
1818
1949
 
1819
1950
  export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
@@ -1830,7 +1961,7 @@ export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: st
1830
1961
 
1831
1962
  export type PublishSignedLnurlPayResponse = { type: "swapCompleted" } | { type: "paymentSent"; response: LnurlPayResponse };
1832
1963
 
1833
- export type PublishSignedTransferPackageResponse = { type: "swapCompleted" } | { type: "paymentSent"; payment: Payment };
1964
+ export type PublishSignedTransferPackageResponse = { type: "swapCompleted" } | { type: "paymentSent"; payment: Payment } | { type: "paymentsSent"; payments: Payment[] };
1834
1965
 
1835
1966
  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 };
1836
1967
 
@@ -1850,6 +1981,8 @@ export type SourceAsset = { type: "bitcoin" } | { type: "token"; tokenIdentifier
1850
1981
 
1851
1982
  export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
1852
1983
 
1984
+ export type SparkMasterIdentityPublicKey = { type: "set"; publicKey: string } | { type: "unset" };
1985
+
1853
1986
  export type StableBalanceActiveLabel = { type: "set"; label: string } | { type: "unset" };
1854
1987
 
1855
1988
  export type StoragePaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionFilter?: ConversionFilter } | { type: "token"; conversionFilter?: ConversionFilter; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[]; conversionFilter?: ConversionFilter };
@@ -1864,7 +1997,9 @@ export type TransferSignature = { type: "transfer"; signed: ExternalPreparedTran
1864
1997
 
1865
1998
  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 };
1866
1999
 
1867
- 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 };
2000
+ export type UnilateralExitTxKind = "fanOut" | "node" | "refund" | "sweep";
2001
+
2002
+ 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 };
1868
2003
 
1869
2004
  export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
1870
2005
 
@@ -1884,7 +2019,9 @@ export class BitcoinChainServiceHandle {
1884
2019
  free(): void;
1885
2020
  [Symbol.dispose](): void;
1886
2021
  broadcastTransaction(tx: string): Promise<void>;
2022
+ getAddressTxos(address: string): Promise<any>;
1887
2023
  getAddressUtxos(address: string): Promise<any>;
2024
+ getOutspend(txid: string, vout: number): Promise<any>;
1888
2025
  getTransactionHex(txid: string): Promise<any>;
1889
2026
  getTransactionStatus(txid: string): Promise<any>;
1890
2027
  recommendedFees(): Promise<any>;
@@ -1897,6 +2034,7 @@ export class BreezSdk {
1897
2034
  addContact(request: AddContactRequest): Promise<Contact>;
1898
2035
  addEventListener(listener: EventListener): Promise<string>;
1899
2036
  authorizeLightningAddressTransfer(request: AuthorizeTransferRequest): Promise<TransferAuthorization>;
2037
+ buildUnsignedBatchPackage(request: BuildUnsignedBatchPackageRequest): Promise<UnsignedTransferPackage>;
1900
2038
  buildUnsignedLnurlPayPackage(request: BuildUnsignedLnurlPayPackageRequest): Promise<UnsignedTransferPackage>;
1901
2039
  buildUnsignedTransferPackage(request: BuildUnsignedTransferPackageRequest): Promise<UnsignedTransferPackage>;
1902
2040
  buyBitcoin(request: BuyBitcoinRequest): Promise<BuyBitcoinResponse>;
@@ -1928,24 +2066,38 @@ export class BreezSdk {
1928
2066
  optimizeLeaves(request: OptimizeLeavesRequest): Promise<OptimizeLeavesResponse>;
1929
2067
  parse(input: string): Promise<InputType>;
1930
2068
  prepareLnurlPay(request: PrepareLnurlPayRequest): Promise<PrepareLnurlPayResponse>;
2069
+ prepareSendBatch(request: PrepareSendBatchRequest): Promise<PrepareSendBatchResponse>;
1931
2070
  prepareSendPayment(request: PrepareSendPaymentRequest): Promise<PrepareSendPaymentResponse>;
2071
+ prepareUnilateralExit(request: PrepareUnilateralExitRequest): Promise<PrepareUnilateralExitResponse>;
1932
2072
  publishSignedLnurlPayPackage(request: PublishSignedLnurlPayPackageRequest): Promise<PublishSignedLnurlPayResponse>;
1933
2073
  publishSignedTransferPackage(request: PublishSignedTransferPackageRequest): Promise<PublishSignedTransferPackageResponse>;
1934
2074
  receivePayment(request: ReceivePaymentRequest): Promise<ReceivePaymentResponse>;
1935
2075
  recommendedFees(): Promise<RecommendedFees>;
1936
2076
  refundDeposit(request: RefundDepositRequest): Promise<RefundDepositResponse>;
1937
- refundPendingConversions(): Promise<void>;
2077
+ refundPendingConversions(): Promise<RefundPendingConversionsResponse>;
1938
2078
  registerLightningAddress(request: RegisterLightningAddressRequest): Promise<LightningAddressInfo>;
1939
2079
  registerWebhook(request: RegisterWebhookRequest): Promise<RegisterWebhookResponse>;
1940
2080
  removeEventListener(id: string): Promise<boolean>;
2081
+ sendBatch(request: SendBatchRequest): Promise<SendBatchResponse>;
1941
2082
  sendPayment(request: SendPaymentRequest): Promise<SendPaymentResponse>;
1942
2083
  signMessage(request: SignMessageRequest): Promise<SignMessageResponse>;
1943
2084
  syncWallet(request: SyncWalletRequest): Promise<SyncWalletResponse>;
2085
+ unilateralExit(request: UnilateralExitRequest, signer: CpfpSigner): Promise<UnilateralExitResponse>;
1944
2086
  unregisterWebhook(request: UnregisterWebhookRequest): Promise<void>;
1945
2087
  updateContact(request: UpdateContactRequest): Promise<Contact>;
1946
2088
  updateUserSettings(request: UpdateUserSettingsRequest): Promise<void>;
1947
2089
  }
1948
2090
 
2091
+ /**
2092
+ * A CPFP signer matching the `CpfpSigner` TypeScript interface.
2093
+ */
2094
+ export class DefaultCpfpSigner {
2095
+ private constructor();
2096
+ free(): void;
2097
+ [Symbol.dispose](): void;
2098
+ signPsbt(psbt_bytes: Uint8Array): Promise<Uint8Array>;
2099
+ }
2100
+
1949
2101
  /**
1950
2102
  * A JS handle to a backend's own session store (from `defaultSessionStore`),
1951
2103
  * exposing the same `getSession` / `setSession` interface. Wrap it in a JS
@@ -2041,6 +2193,7 @@ export class ExternalSparkSignerHandle {
2041
2193
  prepareTransfer(request: ExternalPrepareTransferRequest): Promise<ExternalPreparedTransfer>;
2042
2194
  signAuthenticationChallenge(challenge: Uint8Array): Promise<EcdsaSignatureBytes>;
2043
2195
  signFrost(jobs: ExternalFrostJob[]): Promise<ExternalFrostShareResult[]>;
2196
+ signLeafRefundSpend(leaf_id: ExternalTreeNodeId, sighash: Uint8Array): Promise<SchnorrSignatureBytes>;
2044
2197
  signMessage(message: Uint8Array): Promise<EcdsaSignatureBytes>;
2045
2198
  signSparkInvoice(request: ExternalSignSparkInvoiceRequest): Promise<ExternalSignedSparkInvoice>;
2046
2199
  signStaticDepositRefund(request: ExternalSignStaticDepositRefundRequest): Promise<ExternalFrostSignature>;
@@ -2365,6 +2518,11 @@ export function newSharedSdkContext(config: WasmSdkContextConfig): Promise<WasmS
2365
2518
  */
2366
2519
  export function postgresStorage(config: PostgresStorageConfig): WasmStorageConfig;
2367
2520
 
2521
+ /**
2522
+ * Creates a default CPFP signer backed by a single private key.
2523
+ */
2524
+ export function singleKeyCpfpSigner(secret_key_bytes: Uint8Array): DefaultCpfpSigner;
2525
+
2368
2526
  /**
2369
2527
  * Runs automatically when the wasm module is instantiated. Installs the
2370
2528
  * panic hook so Rust panics surface as readable `console.error` output
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./breez_sdk_spark_wasm_bg.js";
5
5
  __wbg_set_wasm(wasm);
6
6
  wasm.__wbindgen_start();
7
7
  export {
8
- BitcoinChainServiceHandle, BreezSdk, DefaultSessionStore, ExternalBreezSignerHandle, ExternalSigners, ExternalSigningSignerHandle, ExternalSparkSignerHandle, IntoUnderlyingByteSource, IntoUnderlyingSink, IntoUnderlyingSource, PasskeyClient, PasskeyLabels, SdkBuilder, SigningOnlyExternalSigners, TokenIssuer, WasmSdkContext, WasmStorageConfig, connect, connectWithSigner, connectWithSigningOnlySigner, createTurnkeySigner, createTurnkeySigningOnlySigner, defaultConfig, defaultExternalSigners, defaultMysqlStorageConfig, defaultPostgresStorageConfig, defaultServerConfig, defaultSessionStore, defaultStorage, getSparkStatus, initLogging, mysqlStorage, newRestChainService, newSharedSdkContext, postgresStorage, start, task_worker_entry_point
8
+ BitcoinChainServiceHandle, BreezSdk, DefaultCpfpSigner, DefaultSessionStore, ExternalBreezSignerHandle, ExternalSigners, ExternalSigningSignerHandle, ExternalSparkSignerHandle, IntoUnderlyingByteSource, IntoUnderlyingSink, IntoUnderlyingSource, PasskeyClient, PasskeyLabels, SdkBuilder, SigningOnlyExternalSigners, TokenIssuer, WasmSdkContext, WasmStorageConfig, connect, connectWithSigner, connectWithSigningOnlySigner, createTurnkeySigner, createTurnkeySigningOnlySigner, defaultConfig, defaultExternalSigners, defaultMysqlStorageConfig, defaultPostgresStorageConfig, defaultServerConfig, defaultSessionStore, defaultStorage, getSparkStatus, initLogging, mysqlStorage, newRestChainService, newSharedSdkContext, postgresStorage, singleKeyCpfpSigner, start, task_worker_entry_point
9
9
  } from "./breez_sdk_spark_wasm_bg.js";