@buildonspark/spark-sdk 0.2.3 → 0.2.5

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 (91) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{chunk-3SEOTO43.js → chunk-3SPMJMUX.js} +3 -2
  3. package/dist/{chunk-CDLETEDT.js → chunk-CQY5ML2A.js} +16 -3
  4. package/dist/{chunk-PTRXJS7Q.js → chunk-LQZL2D3Y.js} +1 -1
  5. package/dist/{chunk-PLLJIZC3.js → chunk-U7LRIWTF.js} +2471 -822
  6. package/dist/{client-CcYzmpmj.d.cts → client-C88GCTPB.d.cts} +211 -104
  7. package/dist/{client-CGTRS23n.d.ts → client-Dg6vS_2I.d.ts} +211 -104
  8. package/dist/debug.cjs +2511 -831
  9. package/dist/debug.d.cts +19 -6
  10. package/dist/debug.d.ts +19 -6
  11. package/dist/debug.js +3 -3
  12. package/dist/graphql/objects/index.cjs +13 -1
  13. package/dist/graphql/objects/index.d.cts +6 -51
  14. package/dist/graphql/objects/index.d.ts +6 -51
  15. package/dist/graphql/objects/index.js +1 -1
  16. package/dist/index.cjs +2491 -797
  17. package/dist/index.d.cts +189 -9
  18. package/dist/index.d.ts +189 -9
  19. package/dist/index.js +32 -4
  20. package/dist/index.node.cjs +2596 -799
  21. package/dist/index.node.d.cts +9 -190
  22. package/dist/index.node.d.ts +9 -190
  23. package/dist/index.node.js +134 -4
  24. package/dist/native/index.cjs +2491 -797
  25. package/dist/native/index.d.cts +309 -174
  26. package/dist/native/index.d.ts +309 -174
  27. package/dist/native/index.js +2495 -814
  28. package/dist/proto/lrc20.d.cts +1 -1
  29. package/dist/proto/lrc20.d.ts +1 -1
  30. package/dist/proto/spark.d.cts +1 -1
  31. package/dist/proto/spark.d.ts +1 -1
  32. package/dist/proto/spark_token.d.cts +1 -1
  33. package/dist/proto/spark_token.d.ts +1 -1
  34. package/dist/{spark-B_7nZx6T.d.cts → spark-ESAfZARg.d.cts} +1 -1
  35. package/dist/{spark-B_7nZx6T.d.ts → spark-ESAfZARg.d.ts} +1 -1
  36. package/dist/{spark-wallet-CxcGPXRB.d.ts → spark-wallet-B2WwKN8W.d.ts} +57 -35
  37. package/dist/{spark-wallet-DJJm19BP.d.cts → spark-wallet-Di65w0Us.d.cts} +57 -35
  38. package/dist/spark-wallet.node-7R0Rxyj9.d.cts +13 -0
  39. package/dist/spark-wallet.node-CSPWOWRu.d.ts +13 -0
  40. package/dist/tests/test-utils.cjs +578 -77
  41. package/dist/tests/test-utils.d.cts +12 -13
  42. package/dist/tests/test-utils.d.ts +12 -13
  43. package/dist/tests/test-utils.js +54 -17
  44. package/dist/types/index.cjs +16 -3
  45. package/dist/types/index.d.cts +3 -4
  46. package/dist/types/index.d.ts +3 -4
  47. package/dist/types/index.js +2 -2
  48. package/dist/{xchain-address-Bh9w1SeC.d.ts → xchain-address-BsveIy5l.d.ts} +56 -8
  49. package/dist/{xchain-address-SZ7dkVUE.d.cts → xchain-address-CqRu3F21.d.cts} +56 -8
  50. package/package.json +1 -1
  51. package/src/graphql/client.ts +57 -8
  52. package/src/graphql/mutations/CompleteLeavesSwap.ts +9 -1
  53. package/src/graphql/mutations/RequestSwapLeaves.ts +4 -0
  54. package/src/graphql/objects/CompleteLeavesSwapInput.ts +34 -34
  55. package/src/graphql/objects/LeavesSwapRequest.ts +4 -0
  56. package/src/graphql/objects/RequestLeavesSwapInput.ts +48 -47
  57. package/src/graphql/objects/SparkWalletUser.ts +1 -1
  58. package/src/graphql/objects/SwapLeaf.ts +40 -32
  59. package/src/graphql/objects/UserLeafInput.ts +24 -0
  60. package/src/graphql/objects/UserRequest.ts +4 -0
  61. package/src/graphql/queries/Transfers.ts +15 -0
  62. package/src/index.node.ts +1 -1
  63. package/src/native/index.ts +4 -5
  64. package/src/services/coop-exit.ts +171 -36
  65. package/src/services/deposit.ts +471 -74
  66. package/src/services/lightning.ts +18 -5
  67. package/src/services/signing.ts +162 -50
  68. package/src/services/transfer.ts +950 -384
  69. package/src/services/tree-creation.ts +342 -121
  70. package/src/spark-wallet/spark-wallet.node.ts +71 -66
  71. package/src/spark-wallet/spark-wallet.ts +561 -192
  72. package/src/tests/integration/coop-exit.test.ts +3 -8
  73. package/src/tests/integration/deposit.test.ts +3 -3
  74. package/src/tests/integration/lightning.test.ts +521 -466
  75. package/src/tests/integration/ssp/static_deposit.test.ts +83 -1
  76. package/src/tests/integration/ssp/transfers.test.ts +97 -0
  77. package/src/tests/integration/swap.test.ts +559 -307
  78. package/src/tests/integration/transfer.test.ts +625 -623
  79. package/src/tests/integration/wallet.test.ts +2 -2
  80. package/src/tests/integration/watchtower.test.ts +211 -0
  81. package/src/tests/test-utils.ts +63 -14
  82. package/src/tests/utils/test-faucet.ts +4 -2
  83. package/src/types/sdk-types.ts +15 -0
  84. package/src/utils/adaptor-signature.ts +15 -5
  85. package/src/utils/bitcoin.ts +13 -0
  86. package/src/utils/fetch.ts +75 -0
  87. package/src/utils/mempool.ts +9 -4
  88. package/src/utils/transaction.ts +388 -26
  89. package/dist/sdk-types-CB9HrW5O.d.cts +0 -44
  90. package/dist/sdk-types-CkRNraXT.d.ts +0 -44
  91. package/src/graphql/queries/Transfer.ts +0 -10
@@ -1651,6 +1651,7 @@ declare function getTxFromRawTxBytes(rawTxBytes: Uint8Array): btc.Transaction;
1651
1651
  declare function getSigHashFromTx(tx: btc.Transaction, inputIndex: number, prevOutput: TransactionOutput): Uint8Array;
1652
1652
  declare function getTxId(tx: btc.Transaction): string;
1653
1653
  declare function getTxIdNoReverse(tx: btc.Transaction): string;
1654
+ declare function getTxEstimatedVbytesSizeByNumberOfInputsOutputs(numInputs: number, numOutputs: number): number;
1654
1655
 
1655
1656
  declare function addPublicKeys(a: Uint8Array, b: Uint8Array): Uint8Array;
1656
1657
  declare function applyAdditiveTweakToPublicKey(pubkey: Uint8Array, tweak: Uint8Array): Uint8Array<ArrayBufferLike>;
@@ -2163,8 +2164,21 @@ declare class DefaultSparkSigner implements SparkSigner {
2163
2164
  signTransactionIndex(tx: Transaction, index: number, publicKey: Uint8Array): void;
2164
2165
  }
2165
2166
 
2166
- interface ClaimStaticDepositOutput {
2167
- transferId: string;
2167
+ declare enum ClaimStaticDepositStatus {
2168
+ /**
2169
+ * This is an enum value that represents values that could be added in the future.
2170
+ * Clients should support unknown values as more of them could be added without notice.
2171
+ */
2172
+ FUTURE_VALUE = "FUTURE_VALUE",
2173
+ CREATED = "CREATED",
2174
+ TRANSFER_CREATED = "TRANSFER_CREATED",
2175
+ TRANSFER_CREATION_FAILED = "TRANSFER_CREATION_FAILED",
2176
+ REFUND_SIGNING_COMMITMENTS_QUERYING_FAILED = "REFUND_SIGNING_COMMITMENTS_QUERYING_FAILED",
2177
+ REFUND_SIGNING_FAILED = "REFUND_SIGNING_FAILED",
2178
+ UTXO_SWAPPING_FAILED = "UTXO_SWAPPING_FAILED",
2179
+ TRANSFER_COMPLETED = "TRANSFER_COMPLETED",
2180
+ SPEND_TX_CREATED = "SPEND_TX_CREATED",
2181
+ SPEND_TX_BROADCAST = "SPEND_TX_BROADCAST"
2168
2182
  }
2169
2183
 
2170
2184
  /** This enum identifies the unit of currency associated with a CurrencyAmount. **/
@@ -2216,6 +2230,36 @@ interface CurrencyAmount {
2216
2230
  preferredCurrencyValueApprox: number;
2217
2231
  }
2218
2232
 
2233
+ interface ClaimStaticDeposit {
2234
+ /**
2235
+ * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
2236
+ * string.
2237
+ **/
2238
+ id: string;
2239
+ /** The date and time when the entity was first created. **/
2240
+ createdAt: string;
2241
+ /** The date and time when the entity was last updated. **/
2242
+ updatedAt: string;
2243
+ /** The network the lightning send request is on. **/
2244
+ network: BitcoinNetwork;
2245
+ /** The amount of credit to be added to the user's balance. **/
2246
+ creditAmount: CurrencyAmount;
2247
+ /** The maximum fee that the user is willing to pay. **/
2248
+ maxFee: CurrencyAmount;
2249
+ /** The status of the request. **/
2250
+ status: ClaimStaticDepositStatus;
2251
+ /** The transaction id of the deposit. **/
2252
+ transactionId: string;
2253
+ /** The output index of the deposit. **/
2254
+ outputIndex: number;
2255
+ /** The Bitcoin network of the deposit. **/
2256
+ bitcoinNetwork: BitcoinNetwork;
2257
+ /** The typename of the object **/
2258
+ typename: string;
2259
+ /** The id of the transfer. **/
2260
+ transferSparkId?: string | undefined;
2261
+ }
2262
+
2219
2263
  declare enum ExitSpeed {
2220
2264
  /**
2221
2265
  * This is an enum value that represents values that could be added in the future.
@@ -2334,88 +2378,6 @@ interface CoopExitRequest {
2334
2378
  transfer?: Transfer | undefined;
2335
2379
  }
2336
2380
 
2337
- interface CompleteCoopExitInput {
2338
- userOutboundTransferExternalId: string;
2339
- coopExitRequestId: string;
2340
- }
2341
-
2342
- interface CompleteLeavesSwapInput {
2343
- adaptorSecretKey: string;
2344
- userOutboundTransferExternalId: string;
2345
- leavesSwapRequestId: string;
2346
- }
2347
-
2348
- interface CoopExitFeeEstimate {
2349
- userFee: CurrencyAmount;
2350
- l1BroadcastFee: CurrencyAmount;
2351
- }
2352
-
2353
- interface CoopExitFeeEstimatesInput {
2354
- leafExternalIds: string[];
2355
- withdrawalAddress: string;
2356
- }
2357
-
2358
- interface CoopExitFeeEstimatesOutput {
2359
- speedFast?: CoopExitFeeEstimate | undefined;
2360
- speedMedium?: CoopExitFeeEstimate | undefined;
2361
- speedSlow?: CoopExitFeeEstimate | undefined;
2362
- }
2363
-
2364
- interface CoopExitFeeQuote {
2365
- /**
2366
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
2367
- * string.
2368
- **/
2369
- id: string;
2370
- /** The date and time when the entity was first created. **/
2371
- createdAt: string;
2372
- /** The date and time when the entity was last updated. **/
2373
- updatedAt: string;
2374
- /** The network the coop exit fee quote is on. **/
2375
- network: BitcoinNetwork;
2376
- /** The total currency amount of all the nodes user swapped for the coop exit quote. **/
2377
- totalAmount: CurrencyAmount;
2378
- /** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is fast. **/
2379
- userFeeFast: CurrencyAmount;
2380
- /** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is medium. **/
2381
- userFeeMedium: CurrencyAmount;
2382
- /** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is slow. **/
2383
- userFeeSlow: CurrencyAmount;
2384
- /** The L1 broadcast fee user pays for the coop exit when exit speed is fast. **/
2385
- l1BroadcastFeeFast: CurrencyAmount;
2386
- /** The L1 broadcast fee user pays for the coop exit when exit speed is medium. **/
2387
- l1BroadcastFeeMedium: CurrencyAmount;
2388
- /** The L1 broadcast fee user pays for the coop exit when exit speed is slow. **/
2389
- l1BroadcastFeeSlow: CurrencyAmount;
2390
- /** The time when the coop exit fee quote expires. **/
2391
- expiresAt: string;
2392
- /** The typename of the object **/
2393
- typename: string;
2394
- }
2395
-
2396
- interface CoopExitFeeQuoteInput {
2397
- leafExternalIds: string[];
2398
- withdrawalAddress: string;
2399
- }
2400
-
2401
- interface GetChallengeOutput {
2402
- protectedChallenge: string;
2403
- }
2404
-
2405
- interface Invoice {
2406
- encodedInvoice: string;
2407
- bitcoinNetwork: BitcoinNetwork;
2408
- paymentHash: string;
2409
- amount: CurrencyAmount;
2410
- createdAt: string;
2411
- expiresAt: string;
2412
- memo?: string | undefined;
2413
- }
2414
-
2415
- interface LeavesSwapFeeEstimateOutput {
2416
- feeEstimate: CurrencyAmount;
2417
- }
2418
-
2419
2381
  declare enum SparkLeavesSwapRequestStatus {
2420
2382
  /**
2421
2383
  * This is an enum value that represents values that could be added in the future.
@@ -2436,6 +2398,10 @@ interface SwapLeaf {
2436
2398
  leafId: string;
2437
2399
  rawUnsignedRefundTransaction: string;
2438
2400
  adaptorSignedSignature: string;
2401
+ directRawUnsignedRefundTransaction?: string;
2402
+ directAdaptorSignedSignature?: string;
2403
+ directFromCpfpRawUnsignedRefundTransaction?: string;
2404
+ directFromCpfpAdaptorSignedSignature?: string;
2439
2405
  }
2440
2406
 
2441
2407
  interface LeavesSwapRequest {
@@ -2470,6 +2436,16 @@ interface LeavesSwapRequest {
2470
2436
  expiresAt?: string | undefined;
2471
2437
  }
2472
2438
 
2439
+ interface Invoice {
2440
+ encodedInvoice: string;
2441
+ bitcoinNetwork: BitcoinNetwork;
2442
+ paymentHash: string;
2443
+ amount: CurrencyAmount;
2444
+ createdAt: string;
2445
+ expiresAt: string;
2446
+ memo?: string | undefined;
2447
+ }
2448
+
2473
2449
  declare enum LightningReceiveRequestStatus {
2474
2450
  /**
2475
2451
  * This is an enum value that represents values that could be added in the future.
@@ -2514,19 +2490,6 @@ interface LightningReceiveRequest {
2514
2490
  receiverIdentityPublicKey?: string | undefined;
2515
2491
  }
2516
2492
 
2517
- interface LightningSendFeeEstimateInput {
2518
- encodedInvoice: string;
2519
- /**
2520
- * The amount you will pay for this invoice in sats. It should ONLY be set when the invoice amount is
2521
- * zero.
2522
- **/
2523
- amountSats?: number | undefined;
2524
- }
2525
-
2526
- interface LightningSendFeeEstimateOutput {
2527
- feeEstimate: CurrencyAmount;
2528
- }
2529
-
2530
2493
  declare enum LightningSendRequestStatus {
2531
2494
  /**
2532
2495
  * This is an enum value that represents values that could be added in the future.
@@ -2570,6 +2533,137 @@ interface LightningSendRequest {
2570
2533
  paymentPreimage?: string | undefined;
2571
2534
  }
2572
2535
 
2536
+ interface WalletLeaf {
2537
+ id: string;
2538
+ treeId: string;
2539
+ value: number;
2540
+ parentNodeId?: string | undefined;
2541
+ nodeTx: string;
2542
+ refundTx: string;
2543
+ vout: number;
2544
+ verifyingPublicKey: string;
2545
+ ownerIdentityPublicKey: string;
2546
+ signingKeyshare: SigningKeyshare | undefined;
2547
+ status: string;
2548
+ network: keyof typeof Network$1;
2549
+ }
2550
+ declare enum TransferDirection {
2551
+ INCOMING = "INCOMING",
2552
+ OUTGOING = "OUTGOING"
2553
+ }
2554
+ type UserRequestType = LightningSendRequest | LightningReceiveRequest | LeavesSwapRequest | CoopExitRequest | ClaimStaticDeposit;
2555
+ interface WalletTransfer {
2556
+ id: string;
2557
+ senderIdentityPublicKey: string;
2558
+ receiverIdentityPublicKey: string;
2559
+ status: keyof typeof TransferStatus;
2560
+ totalValue: number;
2561
+ expiryTime: Date | undefined;
2562
+ leaves: WalletTransferLeaf[];
2563
+ createdTime: Date | undefined;
2564
+ updatedTime: Date | undefined;
2565
+ type: keyof typeof TransferType;
2566
+ transferDirection: keyof typeof TransferDirection;
2567
+ userRequest: Omit<UserRequestType, "transfer"> | undefined;
2568
+ }
2569
+ interface WalletTransferLeaf {
2570
+ leaf: WalletLeaf | undefined;
2571
+ secretCipher: string;
2572
+ signature: string;
2573
+ intermediateRefundTx: string;
2574
+ }
2575
+
2576
+ interface ClaimStaticDepositOutput {
2577
+ transferId: string;
2578
+ }
2579
+
2580
+ interface CompleteCoopExitInput {
2581
+ userOutboundTransferExternalId: string;
2582
+ coopExitRequestId: string;
2583
+ }
2584
+
2585
+ interface CompleteLeavesSwapInput {
2586
+ adaptorSecretKey: string;
2587
+ directAdaptorSecretKey: string;
2588
+ directFromCpfpAdaptorSecretKey: string;
2589
+ userOutboundTransferExternalId: string;
2590
+ leavesSwapRequestId: string;
2591
+ }
2592
+
2593
+ interface CoopExitFeeEstimate {
2594
+ userFee: CurrencyAmount;
2595
+ l1BroadcastFee: CurrencyAmount;
2596
+ }
2597
+
2598
+ interface CoopExitFeeEstimatesInput {
2599
+ leafExternalIds: string[];
2600
+ withdrawalAddress: string;
2601
+ }
2602
+
2603
+ interface CoopExitFeeEstimatesOutput {
2604
+ speedFast?: CoopExitFeeEstimate | undefined;
2605
+ speedMedium?: CoopExitFeeEstimate | undefined;
2606
+ speedSlow?: CoopExitFeeEstimate | undefined;
2607
+ }
2608
+
2609
+ interface CoopExitFeeQuote {
2610
+ /**
2611
+ * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
2612
+ * string.
2613
+ **/
2614
+ id: string;
2615
+ /** The date and time when the entity was first created. **/
2616
+ createdAt: string;
2617
+ /** The date and time when the entity was last updated. **/
2618
+ updatedAt: string;
2619
+ /** The network the coop exit fee quote is on. **/
2620
+ network: BitcoinNetwork;
2621
+ /** The total currency amount of all the nodes user swapped for the coop exit quote. **/
2622
+ totalAmount: CurrencyAmount;
2623
+ /** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is fast. **/
2624
+ userFeeFast: CurrencyAmount;
2625
+ /** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is medium. **/
2626
+ userFeeMedium: CurrencyAmount;
2627
+ /** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is slow. **/
2628
+ userFeeSlow: CurrencyAmount;
2629
+ /** The L1 broadcast fee user pays for the coop exit when exit speed is fast. **/
2630
+ l1BroadcastFeeFast: CurrencyAmount;
2631
+ /** The L1 broadcast fee user pays for the coop exit when exit speed is medium. **/
2632
+ l1BroadcastFeeMedium: CurrencyAmount;
2633
+ /** The L1 broadcast fee user pays for the coop exit when exit speed is slow. **/
2634
+ l1BroadcastFeeSlow: CurrencyAmount;
2635
+ /** The time when the coop exit fee quote expires. **/
2636
+ expiresAt: string;
2637
+ /** The typename of the object **/
2638
+ typename: string;
2639
+ }
2640
+
2641
+ interface CoopExitFeeQuoteInput {
2642
+ leafExternalIds: string[];
2643
+ withdrawalAddress: string;
2644
+ }
2645
+
2646
+ interface GetChallengeOutput {
2647
+ protectedChallenge: string;
2648
+ }
2649
+
2650
+ interface LeavesSwapFeeEstimateOutput {
2651
+ feeEstimate: CurrencyAmount;
2652
+ }
2653
+
2654
+ interface LightningSendFeeEstimateInput {
2655
+ encodedInvoice: string;
2656
+ /**
2657
+ * The amount you will pay for this invoice in sats. It should ONLY be set when the invoice amount is
2658
+ * zero.
2659
+ **/
2660
+ amountSats?: number | undefined;
2661
+ }
2662
+
2663
+ interface LightningSendFeeEstimateOutput {
2664
+ feeEstimate: CurrencyAmount;
2665
+ }
2666
+
2573
2667
  interface RequestCoopExitInput {
2574
2668
  leafExternalIds: string[];
2575
2669
  withdrawalAddress: string;
@@ -2583,11 +2677,17 @@ interface RequestCoopExitInput {
2583
2677
  interface UserLeafInput {
2584
2678
  leaf_id: string;
2585
2679
  raw_unsigned_refund_transaction: string;
2680
+ direct_raw_unsigned_refund_transaction: string;
2681
+ direct_from_cpfp_raw_unsigned_refund_transaction: string;
2586
2682
  adaptor_added_signature: string;
2683
+ direct_adaptor_added_signature: string;
2684
+ direct_from_cpfp_adaptor_added_signature: string;
2587
2685
  }
2588
2686
 
2589
2687
  interface RequestLeavesSwapInput {
2590
2688
  adaptorPubkey: string;
2689
+ directAdaptorPubkey?: string;
2690
+ directFromCpfpAdaptorPubkey?: string;
2591
2691
  totalAmountSats: number;
2592
2692
  targetAmountSats: number;
2593
2693
  feeSats: number;
@@ -2671,6 +2771,9 @@ interface SspClientOptions {
2671
2771
  identityPublicKey: string;
2672
2772
  schemaEndpoint?: string;
2673
2773
  }
2774
+ interface TransferWithUserRequest extends Transfer {
2775
+ userRequest?: UserRequestType;
2776
+ }
2674
2777
  interface MayHaveSspClientOptions {
2675
2778
  readonly sspClientOptions?: SspClientOptions;
2676
2779
  }
@@ -2694,8 +2797,8 @@ declare class SspClient {
2694
2797
  requestCoopExit({ leafExternalIds, withdrawalAddress, idempotencyKey, exitSpeed, feeLeafExternalIds, feeQuoteId, withdrawAll, }: RequestCoopExitInput): Promise<CoopExitRequest | null>;
2695
2798
  requestLightningReceive({ amountSats, network, paymentHash, expirySecs, memo, includeSparkAddress, receiverIdentityPubkey, descriptionHash, }: RequestLightningReceiveInput): Promise<LightningReceiveRequest | null>;
2696
2799
  requestLightningSend({ encodedInvoice, idempotencyKey, amountSats, }: RequestLightningSendInput): Promise<LightningSendRequest | null>;
2697
- requestLeaveSwap({ adaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, targetAmountSatsList, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
2698
- completeLeaveSwap({ adaptorSecretKey, userOutboundTransferExternalId, leavesSwapRequestId, }: CompleteLeavesSwapInput): Promise<LeavesSwapRequest | null>;
2800
+ requestLeaveSwap({ adaptorPubkey, directAdaptorPubkey, directFromCpfpAdaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, targetAmountSatsList, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
2801
+ completeLeaveSwap({ adaptorSecretKey, directAdaptorSecretKey, directFromCpfpAdaptorSecretKey, userOutboundTransferExternalId, leavesSwapRequestId, }: CompleteLeavesSwapInput): Promise<LeavesSwapRequest | null>;
2699
2802
  getLightningReceiveRequest(id: string): Promise<LightningReceiveRequest | null>;
2700
2803
  getLightningSendRequest(id: string): Promise<LightningSendRequest | null>;
2701
2804
  getLeaveSwapRequest(id: string): Promise<LeavesSwapRequest | null>;
@@ -2710,7 +2813,7 @@ declare class SspClient {
2710
2813
  signature: string;
2711
2814
  sspSignature: string;
2712
2815
  }): Promise<ClaimStaticDepositOutput | null>;
2713
- getTransfer(id: string): Promise<Transfer | null>;
2816
+ getTransfers(ids: string[]): Promise<TransferWithUserRequest[]>;
2714
2817
  getChallenge(): Promise<GetChallengeOutput | null>;
2715
2818
  verifyChallenge(signature: string, protectedChallenge: string): Promise<VerifyChallengeOutput | null>;
2716
2819
  authenticate(): Promise<void>;
@@ -2844,19 +2947,66 @@ declare function filterTokenBalanceForTokenPublicKey(tokenBalances: TokenBalance
2844
2947
 
2845
2948
  declare function getTransferPackageSigningPayload(transferID: string, transferPackage: TransferPackage): Uint8Array;
2846
2949
 
2950
+ declare const DIRECT_TIMELOCK_OFFSET = 50;
2951
+ declare const INITIAL_SEQUENCE: number;
2952
+ declare const INITIAL_DIRECT_SEQUENCE: number;
2953
+ declare const TEST_UNILATERAL_SEQUENCE: number;
2954
+ declare const TEST_UNILATERAL_DIRECT_SEQUENCE: number;
2847
2955
  declare const DEFAULT_FEE_SATS: number;
2848
2956
  /**
2849
2957
  * Subtracts the default fee from the amount if it's greater than the fee.
2850
2958
  * Returns the original amount if it's less than or equal to the fee.
2851
2959
  */
2852
2960
  declare function maybeApplyFee(amount: bigint): bigint;
2853
- declare function createRefundTx(sequence: number, nodeOutPoint: TransactionInput, amountSats: bigint, receivingPubkey: Uint8Array, network: Network): Transaction;
2961
+ declare function createRootTx(depositOutPoint: TransactionInput, depositTxOut: TransactionOutput): [Transaction, Transaction];
2962
+ declare function createSplitTx(parentOutPoint: TransactionInput, childTxOuts: TransactionOutput[]): [Transaction, Transaction];
2963
+ interface CreateNodeTxInput {
2964
+ txOut: TransactionOutput;
2965
+ parentOutPoint: TransactionInput;
2966
+ applyFee?: boolean;
2967
+ includeAnchor?: boolean;
2968
+ }
2969
+ declare function createNodeTx({ txOut, parentOutPoint, applyFee, includeAnchor, }: CreateNodeTxInput): Transaction;
2970
+ declare function createNodeTxs(txOut: TransactionOutput, txIn: TransactionInput, directTxIn?: TransactionInput): {
2971
+ cpfpNodeTx: Transaction;
2972
+ directNodeTx?: Transaction;
2973
+ };
2974
+ declare function createLeafNodeTx(sequence: number, directSequence: number, parentOutPoint: TransactionInput, txOut: TransactionOutput, shouldCalculateFee: boolean): [Transaction, Transaction];
2975
+ interface CreateRefundTxInput {
2976
+ sequence: number;
2977
+ input: TransactionInput;
2978
+ amountSats: bigint;
2979
+ receivingPubkey: Uint8Array;
2980
+ network: Network;
2981
+ shouldCalculateFee: boolean;
2982
+ includeAnchor: boolean;
2983
+ }
2984
+ declare function createRefundTx({ sequence, input, amountSats, receivingPubkey, network, shouldCalculateFee, includeAnchor, }: CreateRefundTxInput): Transaction;
2985
+ interface CreateRefundTxsInput {
2986
+ sequence: number;
2987
+ directSequence?: number;
2988
+ input: TransactionInput;
2989
+ directInput?: TransactionInput;
2990
+ amountSats: bigint;
2991
+ receivingPubkey: Uint8Array;
2992
+ network: Network;
2993
+ }
2994
+ declare function createRefundTxs({ sequence, directSequence, input, directInput, amountSats, receivingPubkey, network, }: CreateRefundTxsInput): {
2995
+ cpfpRefundTx: Transaction;
2996
+ directRefundTx?: Transaction;
2997
+ directFromCpfpRefundTx?: Transaction;
2998
+ };
2999
+ declare function createConnectorRefundTransactions(sequence: number, cpfpNodeOutPoint: TransactionInput, directNodeOutPoint: TransactionInput, connectorOutput: TransactionInput, amountSats: bigint, receiverPubKey: Uint8Array, network: Network, shouldCalculateFee: boolean): [Transaction, Transaction, Transaction];
2854
3000
  declare function getCurrentTimelock(currSequence?: number): number;
2855
- declare function getTransactionSequence(currSequence?: number): number;
3001
+ declare function getTransactionSequence(currSequence?: number): {
3002
+ nextSequence: number;
3003
+ nextDirectSequence: number;
3004
+ };
2856
3005
  declare function checkIfValidSequence(currSequence?: number): void;
2857
- declare function getNextTransactionSequence(currSequence?: number, forRefresh?: boolean): {
3006
+ declare function doesLeafNeedRefresh(currSequence: number, isNodeTx?: boolean): boolean;
3007
+ declare function getNextTransactionSequence(currSequence: number, isNodeTx?: boolean): {
2858
3008
  nextSequence: number;
2859
- needRefresh: boolean;
3009
+ nextDirectSequence: number;
2860
3010
  };
2861
3011
  declare function getEphemeralAnchorOutput(): TransactionOutput;
2862
3012
 
@@ -3027,7 +3177,12 @@ declare class ConnectionManager {
3027
3177
  declare class SigningService {
3028
3178
  private readonly config;
3029
3179
  constructor(config: WalletConfigService);
3030
- signRefunds(leaves: LeafKeyTweak[], signingCommitments: RequestedSigningCommitments[], receiverIdentityPubkey: Uint8Array): Promise<UserSignedTxSigningJob[]>;
3180
+ private signRefundsInternal;
3181
+ signRefunds(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, cpfpSigningCommitments: RequestedSigningCommitments[], directSigningCommitments: RequestedSigningCommitments[], directFromCpfpSigningCommitments: RequestedSigningCommitments[]): Promise<{
3182
+ cpfpLeafSigningJobs: UserSignedTxSigningJob[];
3183
+ directLeafSigningJobs: UserSignedTxSigningJob[];
3184
+ directFromCpfpLeafSigningJobs: UserSignedTxSigningJob[];
3185
+ }>;
3031
3186
  }
3032
3187
 
3033
3188
  type LeafKeyTweak = {
@@ -3035,19 +3190,17 @@ type LeafKeyTweak = {
3035
3190
  keyDerivation: KeyDerivation;
3036
3191
  newKeyDerivation: KeyDerivation;
3037
3192
  };
3038
- type ClaimLeafData = {
3039
- keyDerivation: KeyDerivation;
3040
- tx?: Transaction;
3041
- refundTx?: Transaction;
3042
- signingNonceCommitment: SigningCommitmentWithOptionalNonce;
3043
- vout?: number;
3044
- };
3045
3193
  type LeafRefundSigningData = {
3046
3194
  keyDerivation: KeyDerivation;
3047
3195
  receivingPubkey: Uint8Array;
3196
+ signingNonceCommitment: SigningCommitmentWithOptionalNonce;
3197
+ directSigningNonceCommitment: SigningCommitmentWithOptionalNonce;
3048
3198
  tx: Transaction;
3199
+ directTx?: Transaction;
3049
3200
  refundTx?: Transaction;
3050
- signingNonceCommitment: SigningCommitmentWithOptionalNonce;
3201
+ directRefundTx?: Transaction;
3202
+ directFromCpfpRefundTx?: Transaction;
3203
+ directFromCpfpRefundSigningNonceCommitment: SigningCommitmentWithOptionalNonce;
3051
3204
  vout: number;
3052
3205
  };
3053
3206
  declare class BaseTransferService {
@@ -3055,12 +3208,12 @@ declare class BaseTransferService {
3055
3208
  protected readonly connectionManager: ConnectionManager;
3056
3209
  protected readonly signingService: SigningService;
3057
3210
  constructor(config: WalletConfigService, connectionManager: ConnectionManager, signingService: SigningService);
3058
- sendTransferTweakKey(transfer: Transfer$1, leaves: LeafKeyTweak[], refundSignatureMap: Map<string, Uint8Array>): Promise<Transfer$1>;
3059
- deliverTransferPackage(transfer: Transfer$1, leaves: LeafKeyTweak[], refundSignatureMap: Map<string, Uint8Array>): Promise<Transfer$1>;
3211
+ sendTransferTweakKey(transfer: Transfer$1, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer$1>;
3212
+ deliverTransferPackage(transfer: Transfer$1, leaves: LeafKeyTweak[], cpfpRefundSignatureMap: Map<string, Uint8Array>, directRefundSignatureMap: Map<string, Uint8Array>, directFromCpfpRefundSignatureMap: Map<string, Uint8Array>): Promise<Transfer$1>;
3060
3213
  sendTransferWithKeyTweaks(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array): Promise<Transfer$1>;
3061
3214
  private prepareTransferPackage;
3062
3215
  private finalizeTransfer;
3063
- signRefunds(leafDataMap: Map<string, ClaimLeafData>, operatorSigningResults: LeafRefundTxSigningResult[], adaptorPubKey?: Uint8Array): Promise<NodeSignatures[]>;
3216
+ signRefunds(leafDataMap: Map<string, LeafRefundSigningData>, operatorSigningResults: LeafRefundTxSigningResult[], cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<NodeSignatures[]>;
3064
3217
  private prepareSendTransferKeyTweaks;
3065
3218
  private prepareSingleSendTransferKeyTweak;
3066
3219
  protected findShare(shares: VerifiableSecretShare[], operatorID: number): VerifiableSecretShare | undefined;
@@ -3081,22 +3234,30 @@ declare class TransferService extends BaseTransferService {
3081
3234
  sendTransferSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date): Promise<{
3082
3235
  transfer: Transfer$1;
3083
3236
  signatureMap: Map<string, Uint8Array>;
3237
+ directSignatureMap: Map<string, Uint8Array>;
3238
+ directFromCpfpSignatureMap: Map<string, Uint8Array>;
3084
3239
  leafDataMap: Map<string, LeafRefundSigningData>;
3085
3240
  }>;
3086
3241
  startSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date): Promise<{
3087
3242
  transfer: Transfer$1;
3088
3243
  signatureMap: Map<string, Uint8Array>;
3244
+ directSignatureMap: Map<string, Uint8Array>;
3245
+ directFromCpfpSignatureMap: Map<string, Uint8Array>;
3089
3246
  leafDataMap: Map<string, LeafRefundSigningData>;
3090
3247
  }>;
3091
- counterSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, adaptorPubKey?: Uint8Array): Promise<{
3248
+ counterSwapSignRefund(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<{
3092
3249
  transfer: Transfer$1;
3093
3250
  signatureMap: Map<string, Uint8Array>;
3251
+ directSignatureMap: Map<string, Uint8Array>;
3252
+ directFromCpfpSignatureMap: Map<string, Uint8Array>;
3094
3253
  leafDataMap: Map<string, LeafRefundSigningData>;
3095
3254
  signingResults: LeafRefundTxSigningResult[];
3096
3255
  }>;
3097
- sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean, adaptorPubKey?: Uint8Array): Promise<{
3256
+ sendTransferSignRefundInternal(leaves: LeafKeyTweak[], receiverIdentityPubkey: Uint8Array, expiryTime: Date, forSwap: boolean, cpfpAdaptorPubKey?: Uint8Array, directAdaptorPubKey?: Uint8Array, directFromCpfpAdaptorPubKey?: Uint8Array): Promise<{
3098
3257
  transfer: Transfer$1;
3099
3258
  signatureMap: Map<string, Uint8Array>;
3259
+ directSignatureMap: Map<string, Uint8Array>;
3260
+ directFromCpfpSignatureMap: Map<string, Uint8Array>;
3100
3261
  leafDataMap: Map<string, LeafRefundSigningData>;
3101
3262
  signingResults: LeafRefundTxSigningResult[];
3102
3263
  }>;
@@ -3108,47 +3269,11 @@ declare class TransferService extends BaseTransferService {
3108
3269
  private finalizeNodeSignatures;
3109
3270
  cancelTransfer(transfer: Transfer$1, operatorAddress: string): Promise<Transfer$1 | undefined>;
3110
3271
  queryPendingTransfersBySender(operatorAddress: string): Promise<QueryTransfersResponse>;
3111
- refreshTimelockNodes(nodes: TreeNode[], parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
3272
+ private refreshTimelockNodesInternal;
3273
+ refreshTimelockNodes(node: TreeNode, parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
3112
3274
  extendTimelock(node: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
3113
- refreshTimelockRefundTx(node: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
3114
- }
3115
-
3116
- interface WalletLeaf {
3117
- id: string;
3118
- treeId: string;
3119
- value: number;
3120
- parentNodeId?: string | undefined;
3121
- nodeTx: string;
3122
- refundTx: string;
3123
- vout: number;
3124
- verifyingPublicKey: string;
3125
- ownerIdentityPublicKey: string;
3126
- signingKeyshare: SigningKeyshare | undefined;
3127
- status: string;
3128
- network: keyof typeof Network$1;
3129
- }
3130
- declare enum TransferDirection {
3131
- INCOMING = "INCOMING",
3132
- OUTGOING = "OUTGOING"
3133
- }
3134
- interface WalletTransfer {
3135
- id: string;
3136
- senderIdentityPublicKey: string;
3137
- receiverIdentityPublicKey: string;
3138
- status: keyof typeof TransferStatus;
3139
- totalValue: number;
3140
- expiryTime: Date | undefined;
3141
- leaves: WalletTransferLeaf[];
3142
- createdTime: Date | undefined;
3143
- updatedTime: Date | undefined;
3144
- type: keyof typeof TransferType;
3145
- transferDirection: keyof typeof TransferDirection;
3146
- }
3147
- interface WalletTransferLeaf {
3148
- leaf: WalletLeaf | undefined;
3149
- secretCipher: string;
3150
- signature: string;
3151
- intermediateRefundTx: string;
3275
+ testonly_expireTimeLockNodeTx(node: TreeNode, parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
3276
+ testonly_expireTimeLockRefundtx(node: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
3152
3277
  }
3153
3278
 
3154
3279
  /**
@@ -3336,20 +3461,37 @@ declare class SparkWallet extends EventEmitter {
3336
3461
  sspSignature: string;
3337
3462
  outputIndex?: number;
3338
3463
  }): Promise<ClaimStaticDepositOutput | null>;
3464
+ /**
3465
+ * Get a quote on how much credit you can claim for a deposit from the SSP. If the quote charges less fees than the max fee, claim the deposit.
3466
+ *
3467
+ * @param {Object} params - The parameters object
3468
+ * @param {string} params.transactionId - The ID of the transaction
3469
+ * @param {number} params.maxFee - The maximum fee to claim the deposit for
3470
+ * @param {number} [params.outputIndex] - The index of the output
3471
+ * @returns {Promise<StaticDepositQuoteOutput>} Quote for claiming a deposit to a static deposit address
3472
+ */
3473
+ claimStaticDepositWithMaxFee({ transactionId, maxFee, outputIndex, }: {
3474
+ transactionId: string;
3475
+ maxFee: number;
3476
+ outputIndex?: number;
3477
+ }): Promise<ClaimStaticDepositOutput | null>;
3339
3478
  /**
3340
3479
  * Refunds a static deposit to a destination address.
3341
3480
  *
3342
- * @param {string} depositTransactionId - The ID of the transaction
3343
- * @param {number} [outputIndex] - The index of the output
3344
- * @param {string} destinationAddress - The destination address
3345
- * @param {number} fee - The fee to refund
3481
+ * @param {Object} params - The refund parameters
3482
+ * @param {string} params.depositTransactionId - The ID of the transaction
3483
+ * @param {number} [params.outputIndex] - The index of the output
3484
+ * @param {string} params.destinationAddress - The destination address
3485
+ * @param {number} [params.fee] - **@deprecated** The fee to refund
3486
+ * @param {number} [params.satsPerVbyteFee] - The fee per vbyte to refund
3346
3487
  * @returns {Promise<string>} The hex of the refund transaction
3347
3488
  */
3348
- refundStaticDeposit({ depositTransactionId, outputIndex, destinationAddress, fee, }: {
3489
+ refundStaticDeposit({ depositTransactionId, outputIndex, destinationAddress, fee, satsPerVbyteFee, }: {
3349
3490
  depositTransactionId: string;
3350
3491
  outputIndex?: number;
3351
3492
  destinationAddress: string;
3352
- fee: number;
3493
+ /** @deprecated use `satsPerVbyteFee` */ fee?: number;
3494
+ satsPerVbyteFee?: number;
3353
3495
  }): Promise<string>;
3354
3496
  private getStaticDepositSigningPayload;
3355
3497
  private getDepositTransactionVout;
@@ -3537,9 +3679,9 @@ declare class SparkWallet extends EventEmitter {
3537
3679
  * Gets a transfer that has been sent by the SSP to the wallet.
3538
3680
  *
3539
3681
  * @param {string} id - The ID of the transfer
3540
- * @returns {Promise<GraphQLTransferObj | null>} The transfer
3682
+ * @returns {Promise<TransferWithUserRequest | undefined>} The transfer
3541
3683
  */
3542
- getTransferFromSsp(id: string): Promise<Transfer | null>;
3684
+ getTransferFromSsp(id: string): Promise<TransferWithUserRequest | undefined>;
3543
3685
  /**
3544
3686
  * Gets a transfer, that the wallet is a participant of, in the Spark network.
3545
3687
  * Only contains data about the spark->spark transfer, use getTransferFromSsp if you're
@@ -3675,13 +3817,6 @@ declare class SparkWallet extends EventEmitter {
3675
3817
  * @returns {Promise<void>} Promise that resolves when the timelock is refreshed
3676
3818
  */
3677
3819
  testOnly_expireTimelock(nodeId: string): Promise<void>;
3678
- /**
3679
- * Refresh the timelock of a specific node's refund transaction only.
3680
- *
3681
- * @param {string} nodeId - The ID of the node whose refund transaction to refresh
3682
- * @returns {Promise<void>} Promise that resolves when the refund timelock is refreshed
3683
- */
3684
- testOnly_expireTimelockRefundTx(nodeId: string): Promise<void>;
3685
3820
  private cleanup;
3686
3821
  cleanupConnections(): Promise<void>;
3687
3822
  private startPeriodicClaimTransfers;
@@ -3743,4 +3878,4 @@ declare class TokenTransactionService {
3743
3878
  private createSignaturesForOperators;
3744
3879
  }
3745
3880
 
3746
- export { AuthenticationError, type Bech32mTokenIdentifier, type Bech32mTokenIdentifierData, type BroadcastConfig, type BroadcastResult, type ConfigOptions, ConfigurationError, ConnectionManager, type CreateLightningInvoiceParams, DEFAULT_FEE_SATS, type DecodedSparkAddressData, ReactNativeSparkSigner as DefaultSparkSigner, type DepositParams, type FeeBumpTxChain, type FeeBumpTxPackage, type FeeRate, type InitWalletResponse, InternalValidationError, LRC_WALLET_NETWORK, LRC_WALLET_NETWORK_TYPE, type LeafInfo, Network, NetworkError, NetworkToProto, type NetworkType, NotImplementedError, type PayLightningInvoiceParams, RPCError, type RawTokenIdentifierHex, ReactNativeSparkSigner, type SparkAddressData, type SparkAddressFormat, SparkSDKError, SparkWallet, type SparkWalletEvents, type SparkWalletProps, type TokenBalanceMap, type TokenMetadataMap, type TokenOutputsMap, TokenTransactionService, type TransferParams, type TxChain, type UserTokenMetadata, type Utxo, ValidationError, type VerifiableSecretShare, WalletConfig, WalletConfigService, addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, bigIntToPrivateKey, checkIfSelectedOutputsAreAvailable, checkIfValidSequence, collectResponses, computeTaprootKeyNoScript, computerLagrangeCoefficients, constructFeeBumpTx, constructUnilateralExitFeeBumpPackages, constructUnilateralExitTxs, createRefundTx, createSigningCommitment, createSigningNonce, decodeBech32mTokenIdentifier, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, decodeSparkAddress, encodeBech32mTokenIdentifier, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, encodeSparkAddress, evaluatePolynomial, fieldDiv, filterTokenBalanceForTokenPublicKey, generateAdaptorFromSignature, generatePolynomialForSecretSharing, generateSignatureFromExistingAdaptor, getCurrentTimelock, getEphemeralAnchorOutput, getLatestDepositTxId, getNetwork, getNetworkFromAddress, getNetworkFromString, getNextTransactionSequence, getP2TRAddressFromPkScript, getP2TRAddressFromPublicKey, getP2TRScriptFromPublicKey, getP2WPKHAddressFromPublicKey, getRandomBigInt, getRandomSigningNonce, getSigHashFromTx, getSigningCommitmentFromNonce, getSparkAddressFromTaproot, getTransactionSequence, getTransferPackageSigningPayload, getTxFromRawTxBytes, getTxFromRawTxHex, getTxId, getTxIdNoReverse, isEphemeralAnchorOutput, isTxBroadcast, isValidPublicKey, isValidSparkAddress, lastKeyWithTarget, maybeApplyFee, modInverse, proofOfPossessionMessageHashForDepositAddress, protoToNetwork, recoverSecret, splitSecret, splitSecretWithProofs, subtractPrivateKeys, subtractPublicKeys, sumAvailableTokens, sumOfPrivateKeys, validateOutboundAdaptorSignature, validateShare };
3881
+ export { AuthenticationError, type Bech32mTokenIdentifier, type Bech32mTokenIdentifierData, type BroadcastConfig, type BroadcastResult, type ConfigOptions, ConfigurationError, ConnectionManager, type CreateLightningInvoiceParams, DEFAULT_FEE_SATS, DIRECT_TIMELOCK_OFFSET, type DecodedSparkAddressData, ReactNativeSparkSigner as DefaultSparkSigner, type DepositParams, type FeeBumpTxChain, type FeeBumpTxPackage, type FeeRate, INITIAL_DIRECT_SEQUENCE, INITIAL_SEQUENCE, type InitWalletResponse, InternalValidationError, LRC_WALLET_NETWORK, LRC_WALLET_NETWORK_TYPE, type LeafInfo, Network, NetworkError, NetworkToProto, type NetworkType, NotImplementedError, type PayLightningInvoiceParams, RPCError, type RawTokenIdentifierHex, ReactNativeSparkSigner, type SparkAddressData, type SparkAddressFormat, SparkSDKError, SparkWallet, type SparkWalletEvents, type SparkWalletProps, TEST_UNILATERAL_DIRECT_SEQUENCE, TEST_UNILATERAL_SEQUENCE, type TokenBalanceMap, type TokenMetadataMap, type TokenOutputsMap, TokenTransactionService, type TransferParams, type TxChain, type UserTokenMetadata, type Utxo, ValidationError, type VerifiableSecretShare, WalletConfig, WalletConfigService, addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, bigIntToPrivateKey, checkIfSelectedOutputsAreAvailable, checkIfValidSequence, collectResponses, computeTaprootKeyNoScript, computerLagrangeCoefficients, constructFeeBumpTx, constructUnilateralExitFeeBumpPackages, constructUnilateralExitTxs, createConnectorRefundTransactions, createLeafNodeTx, createNodeTx, createNodeTxs, createRefundTx, createRefundTxs, createRootTx, createSigningCommitment, createSigningNonce, createSplitTx, decodeBech32mTokenIdentifier, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, decodeSparkAddress, doesLeafNeedRefresh, encodeBech32mTokenIdentifier, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, encodeSparkAddress, evaluatePolynomial, fieldDiv, filterTokenBalanceForTokenPublicKey, generateAdaptorFromSignature, generatePolynomialForSecretSharing, generateSignatureFromExistingAdaptor, getCurrentTimelock, getEphemeralAnchorOutput, getLatestDepositTxId, getNetwork, getNetworkFromAddress, getNetworkFromString, getNextTransactionSequence, getP2TRAddressFromPkScript, getP2TRAddressFromPublicKey, getP2TRScriptFromPublicKey, getP2WPKHAddressFromPublicKey, getRandomBigInt, getRandomSigningNonce, getSigHashFromTx, getSigningCommitmentFromNonce, getSparkAddressFromTaproot, getTransactionSequence, getTransferPackageSigningPayload, getTxEstimatedVbytesSizeByNumberOfInputsOutputs, getTxFromRawTxBytes, getTxFromRawTxHex, getTxId, getTxIdNoReverse, isEphemeralAnchorOutput, isTxBroadcast, isValidPublicKey, isValidSparkAddress, lastKeyWithTarget, maybeApplyFee, modInverse, proofOfPossessionMessageHashForDepositAddress, protoToNetwork, recoverSecret, splitSecret, splitSecretWithProofs, subtractPrivateKeys, subtractPublicKeys, sumAvailableTokens, sumOfPrivateKeys, validateOutboundAdaptorSignature, validateShare };