@buildonspark/spark-sdk 0.2.11 → 0.2.13

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 (102) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/bare/index.cjs +761 -243
  3. package/dist/bare/index.d.cts +70 -11
  4. package/dist/bare/index.d.ts +70 -11
  5. package/dist/bare/index.js +684 -170
  6. package/dist/{chunk-A5M55UR3.js → chunk-5VWGOHED.js} +499 -8
  7. package/dist/{chunk-3WBPICWC.js → chunk-CKHJFQUA.js} +1 -1
  8. package/dist/{chunk-QNYJGFPD.js → chunk-LX45BCZW.js} +207 -160
  9. package/dist/{chunk-76SYPHOC.js → chunk-TB7DG5CU.js} +2 -2
  10. package/dist/{chunk-6CMNEDBK.js → chunk-XXTWWW6L.js} +1 -1
  11. package/dist/{client-Dd3QnxQu.d.ts → client-D7KDa4Ih.d.ts} +1 -1
  12. package/dist/{client-B9CAWKWz.d.cts → client-DVuA5-7M.d.cts} +1 -1
  13. package/dist/debug.cjs +761 -243
  14. package/dist/debug.d.cts +4 -4
  15. package/dist/debug.d.ts +4 -4
  16. package/dist/debug.js +4 -4
  17. package/dist/graphql/objects/index.d.cts +3 -3
  18. package/dist/graphql/objects/index.d.ts +3 -3
  19. package/dist/index.cjs +783 -265
  20. package/dist/index.d.cts +6 -6
  21. package/dist/index.d.ts +6 -6
  22. package/dist/index.js +5 -5
  23. package/dist/index.node.cjs +783 -265
  24. package/dist/index.node.d.cts +6 -6
  25. package/dist/index.node.d.ts +6 -6
  26. package/dist/index.node.js +4 -4
  27. package/dist/{logging-BOAzMqpM.d.cts → logging-BfTyKwqb.d.cts} +3 -3
  28. package/dist/{logging-Bt_WdZbu.d.ts → logging-CaNpBgiE.d.ts} +3 -3
  29. package/dist/native/index.cjs +782 -264
  30. package/dist/native/index.d.cts +70 -11
  31. package/dist/native/index.d.ts +70 -11
  32. package/dist/native/index.js +686 -172
  33. package/dist/proto/spark.cjs +499 -8
  34. package/dist/proto/spark.d.cts +1 -1
  35. package/dist/proto/spark.d.ts +1 -1
  36. package/dist/proto/spark.js +17 -1
  37. package/dist/proto/spark_token.d.cts +1 -1
  38. package/dist/proto/spark_token.d.ts +1 -1
  39. package/dist/proto/spark_token.js +2 -2
  40. package/dist/{spark-CtGJPkx4.d.cts → spark-C7OG9mGJ.d.cts} +79 -2
  41. package/dist/{spark-CtGJPkx4.d.ts → spark-C7OG9mGJ.d.ts} +79 -2
  42. package/dist/{spark-wallet-Cp3yv6cK.d.ts → spark-wallet-D0Df_P_x.d.ts} +26 -13
  43. package/dist/{spark-wallet-yc2KhsVY.d.cts → spark-wallet-Dvh1BLP6.d.cts} +26 -13
  44. package/dist/{spark-wallet.node-D0Qw5Wb4.d.cts → spark-wallet.node-B3V8_fgw.d.cts} +1 -1
  45. package/dist/{spark-wallet.node-D4IovOHu.d.ts → spark-wallet.node-bGmy8-T8.d.ts} +1 -1
  46. package/dist/tests/test-utils.cjs +573 -66
  47. package/dist/tests/test-utils.d.cts +4 -4
  48. package/dist/tests/test-utils.d.ts +4 -4
  49. package/dist/tests/test-utils.js +5 -5
  50. package/dist/{token-transactions-CwhlOgIP.d.cts → token-transactions-D1ta-sHH.d.cts} +2 -2
  51. package/dist/{token-transactions-0nmR9mQO.d.ts → token-transactions-DINiKBzd.d.ts} +2 -2
  52. package/dist/types/index.cjs +492 -9
  53. package/dist/types/index.d.cts +2 -2
  54. package/dist/types/index.d.ts +2 -2
  55. package/dist/types/index.js +2 -2
  56. package/package.json +3 -3
  57. package/src/proto/common.ts +1 -1
  58. package/src/proto/google/protobuf/descriptor.ts +4 -10
  59. package/src/proto/google/protobuf/duration.ts +1 -1
  60. package/src/proto/google/protobuf/empty.ts +1 -1
  61. package/src/proto/google/protobuf/timestamp.ts +1 -1
  62. package/src/proto/mock.ts +1 -1
  63. package/src/proto/spark.ts +593 -3
  64. package/src/proto/spark_authn.ts +1 -1
  65. package/src/proto/spark_token.ts +1 -1
  66. package/src/proto/validate/validate.ts +27 -79
  67. package/src/services/deposit.ts +55 -3
  68. package/src/services/lightning.ts +2 -2
  69. package/src/services/signing.ts +1 -1
  70. package/src/services/token-transactions.ts +2 -5
  71. package/src/services/transfer.ts +2 -28
  72. package/src/signer/signer.ts +2 -2
  73. package/src/spark-wallet/proto-descriptors.ts +22 -0
  74. package/src/spark-wallet/proto-hash.ts +743 -0
  75. package/src/spark-wallet/proto-reflection.ts +193 -0
  76. package/src/spark-wallet/spark-wallet.ts +95 -57
  77. package/src/spark_descriptors.pb +0 -0
  78. package/src/tests/address.test.ts +10 -10
  79. package/src/tests/bitcoin.test.ts +2 -2
  80. package/src/tests/bufbuild-reflection.test.ts +151 -0
  81. package/src/tests/cross-language-hash.test.ts +79 -0
  82. package/src/tests/integration/address.test.ts +3 -12
  83. package/src/tests/integration/coop-exit.test.ts +1 -1
  84. package/src/tests/integration/lightning.test.ts +1 -1
  85. package/src/tests/integration/ssp/static_deposit.test.ts +128 -1
  86. package/src/tests/integration/static_deposit.test.ts +26 -0
  87. package/src/tests/integration/swap.test.ts +1 -1
  88. package/src/tests/integration/transfer.test.ts +1 -129
  89. package/src/tests/integration/wallet.test.ts +7 -7
  90. package/src/tests/integration/watchtower.test.ts +1 -1
  91. package/src/tests/token-hashing.test.ts +3 -6
  92. package/src/tests/token-outputs.test.ts +3 -3
  93. package/src/tests/utils/test-faucet.ts +2 -2
  94. package/src/types/sdk-types.ts +1 -1
  95. package/src/utils/adaptor-signature.ts +1 -1
  96. package/src/utils/address.ts +1 -1
  97. package/src/utils/bitcoin.ts +1 -5
  98. package/src/utils/keys.ts +1 -1
  99. package/src/utils/secret-sharing.ts +1 -1
  100. package/src/utils/token-transactions.ts +1 -2
  101. package/src/utils/transfer_package.ts +1 -1
  102. package/src/utils/unilateral-exit.ts +1 -1
@@ -260,6 +260,13 @@ declare enum UtxoSwapRequestType {
260
260
  Refund = 2,
261
261
  UNRECOGNIZED = -1
262
262
  }
263
+ declare enum InvoiceStatus {
264
+ NOT_FOUND = 0,
265
+ PENDING = 1,
266
+ FINALIZED = 2,
267
+ EXPIRED = 3,
268
+ UNRECOGNIZED = -1
269
+ }
263
270
  declare enum InitiatePreimageSwapRequest_Reason {
264
271
  /** REASON_SEND - The associated lightning service is sending the payment. */
265
272
  REASON_SEND = 0,
@@ -350,6 +357,21 @@ interface GenerateDepositAddressResponse {
350
357
  depositAddress: Address | undefined;
351
358
  }
352
359
  declare const GenerateDepositAddressResponse: MessageFns$2<GenerateDepositAddressResponse>;
360
+ /** GenerateStaticDepositAddressRequest is the request to generate a static deposit address. */
361
+ interface GenerateStaticDepositAddressRequest {
362
+ /** The signing public key of the user. */
363
+ signingPublicKey: Uint8Array;
364
+ /** The identity public key of the user. */
365
+ identityPublicKey: Uint8Array;
366
+ /** The network of the bitcoin network. */
367
+ network: Network$1;
368
+ }
369
+ declare const GenerateStaticDepositAddressRequest: MessageFns$2<GenerateStaticDepositAddressRequest>;
370
+ /** GenerateStaticDepositAddressResponse is the response to the request to generate a static deposit address. */
371
+ interface GenerateStaticDepositAddressResponse {
372
+ depositAddress: Address | undefined;
373
+ }
374
+ declare const GenerateStaticDepositAddressResponse: MessageFns$2<GenerateStaticDepositAddressResponse>;
353
375
  /**
354
376
  * UTXO represents a utxo on the bitcoin network.
355
377
  * The UTXO is used to create a tree on Spark, it can also be an off-chain utxo so that the user
@@ -941,6 +963,7 @@ interface TransferLeaf {
941
963
  intermediateRefundTx: Uint8Array;
942
964
  intermediateDirectRefundTx: Uint8Array;
943
965
  intermediateDirectFromCpfpRefundTx: Uint8Array;
966
+ pendingKeyTweakPublicKey: Uint8Array;
944
967
  }
945
968
  declare const TransferLeaf: MessageFns$2<TransferLeaf>;
946
969
  interface TransferFilter {
@@ -1140,6 +1163,7 @@ interface QueryUserSignedRefundsRequest {
1140
1163
  declare const QueryUserSignedRefundsRequest: MessageFns$2<QueryUserSignedRefundsRequest>;
1141
1164
  interface QueryUserSignedRefundsResponse {
1142
1165
  userSignedRefunds: UserSignedRefund[];
1166
+ transfer: Transfer$1 | undefined;
1143
1167
  }
1144
1168
  declare const QueryUserSignedRefundsResponse: MessageFns$2<QueryUserSignedRefundsResponse>;
1145
1169
  interface ProvidePreimageRequest {
@@ -1221,6 +1245,7 @@ interface DepositAddressQueryResult {
1221
1245
  userSigningPublicKey: Uint8Array;
1222
1246
  verifyingPublicKey: Uint8Array;
1223
1247
  leafId?: string | undefined;
1248
+ proofOfPossession?: DepositAddressProof | undefined;
1224
1249
  }
1225
1250
  declare const DepositAddressQueryResult: MessageFns$2<DepositAddressQueryResult>;
1226
1251
  interface QueryUnusedDepositAddressesResponse {
@@ -1383,6 +1408,7 @@ interface GetUtxosForAddressRequest {
1383
1408
  offset: number;
1384
1409
  limit: number;
1385
1410
  network: Network$1;
1411
+ excludeClaimed: boolean;
1386
1412
  }
1387
1413
  declare const GetUtxosForAddressRequest: MessageFns$2<GetUtxosForAddressRequest>;
1388
1414
  interface GetUtxosForAddressResponse {
@@ -1390,8 +1416,27 @@ interface GetUtxosForAddressResponse {
1390
1416
  offset: number;
1391
1417
  }
1392
1418
  declare const GetUtxosForAddressResponse: MessageFns$2<GetUtxosForAddressResponse>;
1419
+ interface QuerySparkInvoicesRequest {
1420
+ limit: number;
1421
+ offset: number;
1422
+ /** returns the status for the provided list of spark invoices. */
1423
+ invoice: string[];
1424
+ }
1425
+ declare const QuerySparkInvoicesRequest: MessageFns$2<QuerySparkInvoicesRequest>;
1426
+ interface QuerySparkInvoicesResponse {
1427
+ offset: number;
1428
+ invoiceStatuses: InvoiceResponse[];
1429
+ }
1430
+ declare const QuerySparkInvoicesResponse: MessageFns$2<QuerySparkInvoicesResponse>;
1431
+ interface InvoiceResponse {
1432
+ invoice: string;
1433
+ status: InvoiceStatus;
1434
+ }
1435
+ declare const InvoiceResponse: MessageFns$2<InvoiceResponse>;
1393
1436
  interface SparkServiceClient<CallOptionsExt = {}> {
1394
1437
  generate_deposit_address(request: DeepPartial$2<GenerateDepositAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GenerateDepositAddressResponse>;
1438
+ /** Generates a new static deposit address of the user or returns the existing one for the specified network. */
1439
+ generate_static_deposit_address(request: DeepPartial$2<GenerateStaticDepositAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GenerateStaticDepositAddressResponse>;
1395
1440
  start_deposit_tree_creation(request: DeepPartial$2<StartDepositTreeCreationRequest>, options?: CallOptions & CallOptionsExt): Promise<StartDepositTreeCreationResponse>;
1396
1441
  /**
1397
1442
  * This is deprecated, please use start_deposit_tree_creation instead.
@@ -1484,6 +1529,7 @@ interface SparkServiceClient<CallOptionsExt = {}> {
1484
1529
  start_transfer_v2(request: DeepPartial$2<StartTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransferResponse>;
1485
1530
  refresh_timelock_v2(request: DeepPartial$2<RefreshTimelockRequest>, options?: CallOptions & CallOptionsExt): Promise<RefreshTimelockResponse>;
1486
1531
  get_utxos_for_address(request: DeepPartial$2<GetUtxosForAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GetUtxosForAddressResponse>;
1532
+ query_spark_invoices(request: DeepPartial$2<QuerySparkInvoicesRequest>, options?: CallOptions & CallOptionsExt): Promise<QuerySparkInvoicesResponse>;
1487
1533
  }
1488
1534
  type Builtin$2 = Date | Function | Uint8Array | string | number | boolean | undefined;
1489
1535
  type DeepPartial$2<T> = T extends Builtin$2 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$2<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$2<U>> : T extends {
@@ -3284,7 +3330,6 @@ declare class TransferService extends BaseTransferService {
3284
3330
  private prepareClaimLeafKeyTweaks;
3285
3331
  claimTransferSignRefunds(transfer: Transfer$1, leafKeys: LeafKeyTweak[], proofMap?: Map<string, Uint8Array[]>): Promise<NodeSignatures[]>;
3286
3332
  private finalizeNodeSignatures;
3287
- cancelTransfer(transfer: Transfer$1, operatorAddress: string): Promise<Transfer$1 | undefined>;
3288
3333
  queryPendingTransfersBySender(operatorAddress: string): Promise<QueryTransfersResponse>;
3289
3334
  private refreshTimelockNodesInternal;
3290
3335
  refreshTimelockNodes(node: TreeNode, parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
@@ -3473,8 +3518,6 @@ declare class SparkWallet extends EventEmitter {
3473
3518
  getStaticDepositAddress(): Promise<string>;
3474
3519
  /**
3475
3520
  * Generates a deposit address for receiving funds.
3476
- *
3477
- * @param {boolean} static - Whether the address is static or single use
3478
3521
  * @returns {Promise<string>} A deposit address
3479
3522
  * @private
3480
3523
  */
@@ -3488,7 +3531,7 @@ declare class SparkWallet extends EventEmitter {
3488
3531
  * @param offset - Pagination offset (default 0).
3489
3532
  * @returns {Promise<{ txid: string, vout: number }[]>} List of confirmed UTXOs.
3490
3533
  */
3491
- getUtxosForDepositAddress(depositAddress: string, limit?: number, offset?: number): Promise<{
3534
+ getUtxosForDepositAddress(depositAddress: string, limit?: number, offset?: number, excludeClaimed?: boolean): Promise<{
3492
3535
  txid: string;
3493
3536
  vout: number;
3494
3537
  }[]>;
@@ -3547,6 +3590,29 @@ declare class SparkWallet extends EventEmitter {
3547
3590
  /** @deprecated use `satsPerVbyteFee` */ fee?: number;
3548
3591
  satsPerVbyteFee?: number;
3549
3592
  }): Promise<string>;
3593
+ /**
3594
+ * Refunds a static deposit and broadcasts the transaction to the network.
3595
+ *
3596
+ * @param {Object} params - The refund parameters
3597
+ * @param {string} params.depositTransactionId - The ID of the transaction
3598
+ * @param {number} [params.outputIndex] - The index of the output
3599
+ * @param {string} params.destinationAddress - The destination address
3600
+ * @param {number} [params.satsPerVbyteFee] - The fee per vbyte to refund
3601
+ * @returns {Promise<string>} The transaction ID
3602
+ */
3603
+ refundAndBroadcastStaticDeposit({ depositTransactionId, outputIndex, destinationAddress, satsPerVbyteFee, }: {
3604
+ depositTransactionId: string;
3605
+ outputIndex?: number;
3606
+ destinationAddress: string;
3607
+ satsPerVbyteFee?: number;
3608
+ }): Promise<string>;
3609
+ /**
3610
+ * Broadcasts a transaction to the network.
3611
+ *
3612
+ * @param {string} txHex - The hex of the transaction
3613
+ * @returns {Promise<string>} The transaction ID
3614
+ */
3615
+ private broadcastTx;
3550
3616
  private getStaticDepositSigningPayload;
3551
3617
  private getDepositTransactionVout;
3552
3618
  private getDepositTransaction;
@@ -3632,13 +3698,6 @@ declare class SparkWallet extends EventEmitter {
3632
3698
  * @private
3633
3699
  */
3634
3700
  private claimTransfers;
3635
- /**
3636
- * Cancels all sender-initiated transfers.
3637
- *
3638
- * @returns {Promise<void>}
3639
- * @private
3640
- */
3641
- private cancelAllSenderInitiatedTransfers;
3642
3701
  /**
3643
3702
  * Creates a Lightning invoice for receiving payments.
3644
3703
  *
@@ -260,6 +260,13 @@ declare enum UtxoSwapRequestType {
260
260
  Refund = 2,
261
261
  UNRECOGNIZED = -1
262
262
  }
263
+ declare enum InvoiceStatus {
264
+ NOT_FOUND = 0,
265
+ PENDING = 1,
266
+ FINALIZED = 2,
267
+ EXPIRED = 3,
268
+ UNRECOGNIZED = -1
269
+ }
263
270
  declare enum InitiatePreimageSwapRequest_Reason {
264
271
  /** REASON_SEND - The associated lightning service is sending the payment. */
265
272
  REASON_SEND = 0,
@@ -350,6 +357,21 @@ interface GenerateDepositAddressResponse {
350
357
  depositAddress: Address | undefined;
351
358
  }
352
359
  declare const GenerateDepositAddressResponse: MessageFns$2<GenerateDepositAddressResponse>;
360
+ /** GenerateStaticDepositAddressRequest is the request to generate a static deposit address. */
361
+ interface GenerateStaticDepositAddressRequest {
362
+ /** The signing public key of the user. */
363
+ signingPublicKey: Uint8Array;
364
+ /** The identity public key of the user. */
365
+ identityPublicKey: Uint8Array;
366
+ /** The network of the bitcoin network. */
367
+ network: Network$1;
368
+ }
369
+ declare const GenerateStaticDepositAddressRequest: MessageFns$2<GenerateStaticDepositAddressRequest>;
370
+ /** GenerateStaticDepositAddressResponse is the response to the request to generate a static deposit address. */
371
+ interface GenerateStaticDepositAddressResponse {
372
+ depositAddress: Address | undefined;
373
+ }
374
+ declare const GenerateStaticDepositAddressResponse: MessageFns$2<GenerateStaticDepositAddressResponse>;
353
375
  /**
354
376
  * UTXO represents a utxo on the bitcoin network.
355
377
  * The UTXO is used to create a tree on Spark, it can also be an off-chain utxo so that the user
@@ -941,6 +963,7 @@ interface TransferLeaf {
941
963
  intermediateRefundTx: Uint8Array;
942
964
  intermediateDirectRefundTx: Uint8Array;
943
965
  intermediateDirectFromCpfpRefundTx: Uint8Array;
966
+ pendingKeyTweakPublicKey: Uint8Array;
944
967
  }
945
968
  declare const TransferLeaf: MessageFns$2<TransferLeaf>;
946
969
  interface TransferFilter {
@@ -1140,6 +1163,7 @@ interface QueryUserSignedRefundsRequest {
1140
1163
  declare const QueryUserSignedRefundsRequest: MessageFns$2<QueryUserSignedRefundsRequest>;
1141
1164
  interface QueryUserSignedRefundsResponse {
1142
1165
  userSignedRefunds: UserSignedRefund[];
1166
+ transfer: Transfer$1 | undefined;
1143
1167
  }
1144
1168
  declare const QueryUserSignedRefundsResponse: MessageFns$2<QueryUserSignedRefundsResponse>;
1145
1169
  interface ProvidePreimageRequest {
@@ -1221,6 +1245,7 @@ interface DepositAddressQueryResult {
1221
1245
  userSigningPublicKey: Uint8Array;
1222
1246
  verifyingPublicKey: Uint8Array;
1223
1247
  leafId?: string | undefined;
1248
+ proofOfPossession?: DepositAddressProof | undefined;
1224
1249
  }
1225
1250
  declare const DepositAddressQueryResult: MessageFns$2<DepositAddressQueryResult>;
1226
1251
  interface QueryUnusedDepositAddressesResponse {
@@ -1383,6 +1408,7 @@ interface GetUtxosForAddressRequest {
1383
1408
  offset: number;
1384
1409
  limit: number;
1385
1410
  network: Network$1;
1411
+ excludeClaimed: boolean;
1386
1412
  }
1387
1413
  declare const GetUtxosForAddressRequest: MessageFns$2<GetUtxosForAddressRequest>;
1388
1414
  interface GetUtxosForAddressResponse {
@@ -1390,8 +1416,27 @@ interface GetUtxosForAddressResponse {
1390
1416
  offset: number;
1391
1417
  }
1392
1418
  declare const GetUtxosForAddressResponse: MessageFns$2<GetUtxosForAddressResponse>;
1419
+ interface QuerySparkInvoicesRequest {
1420
+ limit: number;
1421
+ offset: number;
1422
+ /** returns the status for the provided list of spark invoices. */
1423
+ invoice: string[];
1424
+ }
1425
+ declare const QuerySparkInvoicesRequest: MessageFns$2<QuerySparkInvoicesRequest>;
1426
+ interface QuerySparkInvoicesResponse {
1427
+ offset: number;
1428
+ invoiceStatuses: InvoiceResponse[];
1429
+ }
1430
+ declare const QuerySparkInvoicesResponse: MessageFns$2<QuerySparkInvoicesResponse>;
1431
+ interface InvoiceResponse {
1432
+ invoice: string;
1433
+ status: InvoiceStatus;
1434
+ }
1435
+ declare const InvoiceResponse: MessageFns$2<InvoiceResponse>;
1393
1436
  interface SparkServiceClient<CallOptionsExt = {}> {
1394
1437
  generate_deposit_address(request: DeepPartial$2<GenerateDepositAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GenerateDepositAddressResponse>;
1438
+ /** Generates a new static deposit address of the user or returns the existing one for the specified network. */
1439
+ generate_static_deposit_address(request: DeepPartial$2<GenerateStaticDepositAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GenerateStaticDepositAddressResponse>;
1395
1440
  start_deposit_tree_creation(request: DeepPartial$2<StartDepositTreeCreationRequest>, options?: CallOptions & CallOptionsExt): Promise<StartDepositTreeCreationResponse>;
1396
1441
  /**
1397
1442
  * This is deprecated, please use start_deposit_tree_creation instead.
@@ -1484,6 +1529,7 @@ interface SparkServiceClient<CallOptionsExt = {}> {
1484
1529
  start_transfer_v2(request: DeepPartial$2<StartTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransferResponse>;
1485
1530
  refresh_timelock_v2(request: DeepPartial$2<RefreshTimelockRequest>, options?: CallOptions & CallOptionsExt): Promise<RefreshTimelockResponse>;
1486
1531
  get_utxos_for_address(request: DeepPartial$2<GetUtxosForAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GetUtxosForAddressResponse>;
1532
+ query_spark_invoices(request: DeepPartial$2<QuerySparkInvoicesRequest>, options?: CallOptions & CallOptionsExt): Promise<QuerySparkInvoicesResponse>;
1487
1533
  }
1488
1534
  type Builtin$2 = Date | Function | Uint8Array | string | number | boolean | undefined;
1489
1535
  type DeepPartial$2<T> = T extends Builtin$2 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$2<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$2<U>> : T extends {
@@ -3284,7 +3330,6 @@ declare class TransferService extends BaseTransferService {
3284
3330
  private prepareClaimLeafKeyTweaks;
3285
3331
  claimTransferSignRefunds(transfer: Transfer$1, leafKeys: LeafKeyTweak[], proofMap?: Map<string, Uint8Array[]>): Promise<NodeSignatures[]>;
3286
3332
  private finalizeNodeSignatures;
3287
- cancelTransfer(transfer: Transfer$1, operatorAddress: string): Promise<Transfer$1 | undefined>;
3288
3333
  queryPendingTransfersBySender(operatorAddress: string): Promise<QueryTransfersResponse>;
3289
3334
  private refreshTimelockNodesInternal;
3290
3335
  refreshTimelockNodes(node: TreeNode, parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
@@ -3473,8 +3518,6 @@ declare class SparkWallet extends EventEmitter {
3473
3518
  getStaticDepositAddress(): Promise<string>;
3474
3519
  /**
3475
3520
  * Generates a deposit address for receiving funds.
3476
- *
3477
- * @param {boolean} static - Whether the address is static or single use
3478
3521
  * @returns {Promise<string>} A deposit address
3479
3522
  * @private
3480
3523
  */
@@ -3488,7 +3531,7 @@ declare class SparkWallet extends EventEmitter {
3488
3531
  * @param offset - Pagination offset (default 0).
3489
3532
  * @returns {Promise<{ txid: string, vout: number }[]>} List of confirmed UTXOs.
3490
3533
  */
3491
- getUtxosForDepositAddress(depositAddress: string, limit?: number, offset?: number): Promise<{
3534
+ getUtxosForDepositAddress(depositAddress: string, limit?: number, offset?: number, excludeClaimed?: boolean): Promise<{
3492
3535
  txid: string;
3493
3536
  vout: number;
3494
3537
  }[]>;
@@ -3547,6 +3590,29 @@ declare class SparkWallet extends EventEmitter {
3547
3590
  /** @deprecated use `satsPerVbyteFee` */ fee?: number;
3548
3591
  satsPerVbyteFee?: number;
3549
3592
  }): Promise<string>;
3593
+ /**
3594
+ * Refunds a static deposit and broadcasts the transaction to the network.
3595
+ *
3596
+ * @param {Object} params - The refund parameters
3597
+ * @param {string} params.depositTransactionId - The ID of the transaction
3598
+ * @param {number} [params.outputIndex] - The index of the output
3599
+ * @param {string} params.destinationAddress - The destination address
3600
+ * @param {number} [params.satsPerVbyteFee] - The fee per vbyte to refund
3601
+ * @returns {Promise<string>} The transaction ID
3602
+ */
3603
+ refundAndBroadcastStaticDeposit({ depositTransactionId, outputIndex, destinationAddress, satsPerVbyteFee, }: {
3604
+ depositTransactionId: string;
3605
+ outputIndex?: number;
3606
+ destinationAddress: string;
3607
+ satsPerVbyteFee?: number;
3608
+ }): Promise<string>;
3609
+ /**
3610
+ * Broadcasts a transaction to the network.
3611
+ *
3612
+ * @param {string} txHex - The hex of the transaction
3613
+ * @returns {Promise<string>} The transaction ID
3614
+ */
3615
+ private broadcastTx;
3550
3616
  private getStaticDepositSigningPayload;
3551
3617
  private getDepositTransactionVout;
3552
3618
  private getDepositTransaction;
@@ -3632,13 +3698,6 @@ declare class SparkWallet extends EventEmitter {
3632
3698
  * @private
3633
3699
  */
3634
3700
  private claimTransfers;
3635
- /**
3636
- * Cancels all sender-initiated transfers.
3637
- *
3638
- * @returns {Promise<void>}
3639
- * @private
3640
- */
3641
- private cancelAllSenderInitiatedTransfers;
3642
3701
  /**
3643
3702
  * Creates a Lightning invoice for receiving payments.
3644
3703
  *