@buildonspark/spark-sdk 0.2.8 → 0.2.9

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 (51) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/bare/index.cjs +28 -24
  3. package/dist/bare/index.d.cts +182 -182
  4. package/dist/bare/index.d.ts +182 -182
  5. package/dist/bare/index.js +28 -24
  6. package/dist/{chunk-G2RIVSSI.js → chunk-23BBEC25.js} +1 -1
  7. package/dist/{chunk-HMJO7LPI.js → chunk-5Y7YILMA.js} +28 -24
  8. package/dist/{client-TLqKGhj8.d.cts → client-B9CAWKWz.d.cts} +1 -1
  9. package/dist/{client-B5vlztPA.d.ts → client-Dd3QnxQu.d.ts} +1 -1
  10. package/dist/debug.cjs +28 -24
  11. package/dist/debug.d.cts +5 -5
  12. package/dist/debug.d.ts +5 -5
  13. package/dist/debug.js +1 -1
  14. package/dist/graphql/objects/index.d.cts +3 -3
  15. package/dist/graphql/objects/index.d.ts +3 -3
  16. package/dist/index.cjs +28 -24
  17. package/dist/index.d.cts +6 -6
  18. package/dist/index.d.ts +6 -6
  19. package/dist/index.js +2 -2
  20. package/dist/index.node.cjs +28 -24
  21. package/dist/index.node.d.cts +6 -6
  22. package/dist/index.node.d.ts +6 -6
  23. package/dist/index.node.js +1 -1
  24. package/dist/native/index.cjs +28 -24
  25. package/dist/native/index.d.cts +2 -2
  26. package/dist/native/index.d.ts +2 -2
  27. package/dist/native/index.js +28 -24
  28. package/dist/proto/spark.d.cts +1 -1
  29. package/dist/proto/spark.d.ts +1 -1
  30. package/dist/proto/spark_token.d.cts +1 -1
  31. package/dist/proto/spark_token.d.ts +1 -1
  32. package/dist/{spark-CBBjw5AY.d.cts → spark-CtGJPkx4.d.cts} +1 -1
  33. package/dist/{spark-CBBjw5AY.d.ts → spark-CtGJPkx4.d.ts} +1 -1
  34. package/dist/{spark-wallet-CIuHgbSR.d.cts → spark-wallet-Cp3yv6cK.d.ts} +4 -4
  35. package/dist/{spark-wallet-CrNWPa9p.d.ts → spark-wallet-yc2KhsVY.d.cts} +4 -4
  36. package/dist/{spark-wallet.node-BvfiSwh_.d.cts → spark-wallet.node-D0Qw5Wb4.d.cts} +1 -1
  37. package/dist/{spark-wallet.node-pnKSb-aa.d.ts → spark-wallet.node-D4IovOHu.d.ts} +1 -1
  38. package/dist/tests/test-utils.cjs +1 -1
  39. package/dist/tests/test-utils.d.cts +5 -5
  40. package/dist/tests/test-utils.d.ts +5 -5
  41. package/dist/tests/test-utils.js +2 -2
  42. package/dist/{token-transactions-e8UUOjFk.d.ts → token-transactions-0nmR9mQO.d.ts} +4 -4
  43. package/dist/{token-transactions-ChvD_wLe.d.cts → token-transactions-CwhlOgIP.d.cts} +4 -4
  44. package/dist/types/index.d.cts +2 -2
  45. package/dist/types/index.d.ts +2 -2
  46. package/dist/{xchain-address-CDnNobbB.d.ts → xchain-address-BPwpnmuY.d.ts} +3 -3
  47. package/dist/{xchain-address-CtqVOuWz.d.cts → xchain-address-CNQEwLjR.d.cts} +3 -3
  48. package/package.json +1 -1
  49. package/src/services/token-transactions.ts +36 -31
  50. package/src/spark-wallet/spark-wallet.ts +3 -2
  51. package/src/tests/integration/ssp/static-deposit-validation.test.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @buildonspark/spark-sdk
2
2
 
3
+ ## 0.2.9
4
+
5
+ ### Patch Changes
6
+
7
+ - -- return offset from queryTokenTransactions
8
+
3
9
  ## 0.2.8
4
10
 
5
11
  ### Patch Changes
@@ -17689,7 +17689,7 @@ var ecies = __toESM(require("eciesjs"), 1);
17689
17689
  var import_core10 = require("@lightsparkdev/core");
17690
17690
  var isReactNative = typeof navigator !== "undefined" && navigator.product === "ReactNative";
17691
17691
  var isBun = globalThis.Bun !== void 0;
17692
- var packageVersion = true ? "0.2.8" : "unknown";
17692
+ var packageVersion = true ? "0.2.9" : "unknown";
17693
17693
  var baseEnvStr = "unknown";
17694
17694
  if (isBun) {
17695
17695
  const bunVersion = "version" in globalThis.Bun ? globalThis.Bun.version : "unknown-version";
@@ -29802,27 +29802,32 @@ var TokenTransactionService = class {
29802
29802
  };
29803
29803
  try {
29804
29804
  const response = await sparkClient.query_token_transactions(queryParams);
29805
- return response.tokenTransactionsWithStatus.map((tx) => {
29806
- const v1TokenTransaction = {
29807
- version: 1,
29808
- network: tx.tokenTransaction.network,
29809
- tokenInputs: tx.tokenTransaction.tokenInputs,
29810
- tokenOutputs: tx.tokenTransaction.tokenOutputs,
29811
- sparkOperatorIdentityPublicKeys: tx.tokenTransaction.sparkOperatorIdentityPublicKeys,
29812
- expiryTime: void 0,
29813
- // V0 doesn't have expiry time
29814
- invoiceAttachments: [],
29815
- clientCreatedTimestamp: tx.tokenTransaction?.tokenInputs?.$case === "mintInput" ? new Date(
29816
- tx.tokenTransaction.tokenInputs.mintInput.issuerProvidedTimestamp * 1e3
29817
- ) : /* @__PURE__ */ new Date()
29818
- };
29819
- return {
29820
- tokenTransaction: v1TokenTransaction,
29821
- status: tx.status,
29822
- confirmationMetadata: tx.confirmationMetadata,
29823
- tokenTransactionHash: tx.tokenTransactionHash
29824
- };
29825
- });
29805
+ return {
29806
+ tokenTransactionsWithStatus: response.tokenTransactionsWithStatus.map(
29807
+ (tx) => {
29808
+ const v1TokenTransaction = {
29809
+ version: 1,
29810
+ network: tx.tokenTransaction.network,
29811
+ tokenInputs: tx.tokenTransaction.tokenInputs,
29812
+ tokenOutputs: tx.tokenTransaction.tokenOutputs,
29813
+ sparkOperatorIdentityPublicKeys: tx.tokenTransaction.sparkOperatorIdentityPublicKeys,
29814
+ expiryTime: void 0,
29815
+ // V0 doesn't have expiry time
29816
+ clientCreatedTimestamp: tx.tokenTransaction?.tokenInputs?.$case === "mintInput" ? new Date(
29817
+ tx.tokenTransaction.tokenInputs.mintInput.issuerProvidedTimestamp * 1e3
29818
+ ) : /* @__PURE__ */ new Date(),
29819
+ invoiceAttachments: []
29820
+ };
29821
+ return {
29822
+ tokenTransaction: v1TokenTransaction,
29823
+ status: tx.status,
29824
+ confirmationMetadata: tx.confirmationMetadata,
29825
+ tokenTransactionHash: tx.tokenTransactionHash
29826
+ };
29827
+ }
29828
+ ),
29829
+ offset: response.offset
29830
+ };
29826
29831
  } catch (error) {
29827
29832
  throw new NetworkError(
29828
29833
  "Failed to query token transactions",
@@ -29864,8 +29869,7 @@ var TokenTransactionService = class {
29864
29869
  offset
29865
29870
  };
29866
29871
  try {
29867
- const response = await tokenClient.query_token_transactions(queryParams);
29868
- return response.tokenTransactionsWithStatus;
29872
+ return await tokenClient.query_token_transactions(queryParams);
29869
29873
  } catch (error) {
29870
29874
  throw new NetworkError(
29871
29875
  "Failed to query token transactions",
@@ -2394,153 +2394,6 @@ declare class SspClient {
2394
2394
  getCoopExitFeeQuote({ leafExternalIds, withdrawalAddress, }: CoopExitFeeQuoteInput): Promise<CoopExitFeeQuote | null>;
2395
2395
  }
2396
2396
 
2397
- declare enum Network {
2398
- MAINNET = 0,
2399
- TESTNET = 1,
2400
- SIGNET = 2,
2401
- REGTEST = 3,
2402
- LOCAL = 4
2403
- }
2404
- type NetworkType = keyof typeof Network;
2405
- declare const NetworkToProto: Record<Network, Network$1>;
2406
- declare const protoToNetwork: (protoNetwork: Network$1) => Network | undefined;
2407
- declare const getNetwork: (network: Network) => typeof btc.NETWORK;
2408
- declare const LRC_WALLET_NETWORK: Readonly<{
2409
- 0: bitcoin.networks.Network;
2410
- 1: bitcoin.networks.Network;
2411
- 2: bitcoin.networks.Network;
2412
- 3: bitcoin.networks.Network;
2413
- 4: bitcoin.networks.Network;
2414
- }>;
2415
- /**
2416
- * Utility function to determine the network from a Bitcoin address.
2417
- *
2418
- * @param {string} address - The Bitcoin address
2419
- * @returns {BitcoinNetwork | null} The detected network or null if not detected
2420
- */
2421
- declare function getNetworkFromAddress(address: string): BitcoinNetwork.MAINNET | BitcoinNetwork.REGTEST | null;
2422
- /**
2423
- * Utility function to get the network enum value from a string.
2424
- *
2425
- * @param {string} network - The Bitcoin network to turn into an enum value
2426
- * @returns {Network} The enum value matching the string
2427
- */
2428
- declare function getNetworkFromString(network?: string): Network;
2429
-
2430
- type SigningOperator = {
2431
- readonly id: number;
2432
- readonly identifier: string;
2433
- readonly address: string;
2434
- readonly identityPublicKey: string;
2435
- };
2436
- type ConsoleOptions = {
2437
- otel?: boolean;
2438
- };
2439
- type ConfigOptions = MayHaveSspClientOptions & {
2440
- readonly network?: NetworkType;
2441
- readonly signingOperators?: Readonly<Record<string, SigningOperator>>;
2442
- readonly coordinatorIdentifier?: string;
2443
- readonly frostSignerAddress?: string;
2444
- readonly threshold?: number;
2445
- readonly tokenSignatures?: "ECDSA" | "SCHNORR";
2446
- readonly tokenValidityDurationSeconds?: number;
2447
- readonly tokenTransactionVersion?: "V0" | "V1";
2448
- readonly electrsUrl?: string;
2449
- readonly sspClientOptions?: SspClientOptions;
2450
- readonly expectedWithdrawBondSats?: number;
2451
- readonly expectedWithdrawRelativeBlockLocktime?: number;
2452
- readonly signerWithPreExistingKeys?: boolean;
2453
- readonly console?: ConsoleOptions;
2454
- };
2455
-
2456
- declare class WalletConfigService implements HasSspClientOptions {
2457
- private readonly config;
2458
- readonly signer: SparkSigner;
2459
- readonly sspClientOptions: SspClientOptions;
2460
- constructor(options?: ConfigOptions, signer?: SparkSigner);
2461
- private getDefaultConfig;
2462
- getCoordinatorAddress(): string;
2463
- getSigningOperators(): Readonly<Record<string, SigningOperator>>;
2464
- getThreshold(): number;
2465
- getCoordinatorIdentifier(): string;
2466
- getExpectedWithdrawBondSats(): number;
2467
- getExpectedWithdrawRelativeBlockLocktime(): number;
2468
- getSspNetwork(): BitcoinNetwork;
2469
- getNetwork(): Network;
2470
- getNetworkType(): NetworkType;
2471
- getNetworkProto(): number;
2472
- getTokenSignatures(): "ECDSA" | "SCHNORR";
2473
- getTokenTransactionVersion(): "V0" | "V1";
2474
- getTokenValidityDurationSeconds(): number;
2475
- getElectrsUrl(): string;
2476
- getSspBaseUrl(): string;
2477
- getSspIdentityPublicKey(): string;
2478
- getConsoleOptions(): ConsoleOptions;
2479
- }
2480
-
2481
- declare enum InterruptTransferRequest_InterruptTransferAction {
2482
- NONE = 0,
2483
- INTERRUPT = 1,
2484
- RESUME = 2,
2485
- UNRECOGNIZED = -1
2486
- }
2487
- declare enum InterruptCoopExitRequest_InterruptCoopExitAction {
2488
- NONE = 0,
2489
- INTERRUPT = 1,
2490
- RESUME = 2,
2491
- UNRECOGNIZED = -1
2492
- }
2493
- interface CleanUpPreimageShareRequest {
2494
- paymentHash: Uint8Array;
2495
- }
2496
- declare const CleanUpPreimageShareRequest: MessageFns$1<CleanUpPreimageShareRequest>;
2497
- interface InterruptTransferRequest {
2498
- action: InterruptTransferRequest_InterruptTransferAction;
2499
- }
2500
- declare const InterruptTransferRequest: MessageFns$1<InterruptTransferRequest>;
2501
- interface UpdateNodesStatusRequest {
2502
- nodeIds: string[];
2503
- status: string;
2504
- }
2505
- declare const UpdateNodesStatusRequest: MessageFns$1<UpdateNodesStatusRequest>;
2506
- /** TriggerTaskRequest is used to trigger a scheduled task immediately in hermetic tests. */
2507
- interface TriggerTaskRequest {
2508
- taskName: string;
2509
- }
2510
- declare const TriggerTaskRequest: MessageFns$1<TriggerTaskRequest>;
2511
- interface InterruptCoopExitRequest {
2512
- action: InterruptCoopExitRequest_InterruptCoopExitAction;
2513
- /** optional, defaults to MockAction.TargetOperatorID */
2514
- targetOperator: string;
2515
- }
2516
- declare const InterruptCoopExitRequest: MessageFns$1<InterruptCoopExitRequest>;
2517
- interface MockServiceClient<CallOptionsExt = {}> {
2518
- clean_up_preimage_share(request: DeepPartial$1<CleanUpPreimageShareRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2519
- interrupt_transfer(request: DeepPartial$1<InterruptTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2520
- interrupt_coop_exit(request: DeepPartial$1<InterruptCoopExitRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2521
- update_nodes_status(request: DeepPartial$1<UpdateNodesStatusRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2522
- /** Triggers the execution of a scheduled task immediately by name. Used by hermetic tests */
2523
- trigger_task(request: DeepPartial$1<TriggerTaskRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2524
- }
2525
- type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
2526
- type DeepPartial$1<T> = T extends Builtin$1 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$1<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$1<U>> : T extends {
2527
- $case: string;
2528
- } ? {
2529
- [K in keyof Omit<T, "$case">]?: DeepPartial$1<T[K]>;
2530
- } & {
2531
- $case: T["$case"];
2532
- } : T extends {} ? {
2533
- [K in keyof T]?: DeepPartial$1<T[K]>;
2534
- } : Partial<T>;
2535
- interface MessageFns$1<T> {
2536
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
2537
- decode(input: BinaryReader | Uint8Array, length?: number): T;
2538
- fromJSON(object: any): T;
2539
- toJSON(message: T): unknown;
2540
- create(base?: DeepPartial$1<T>): T;
2541
- fromPartial(object: DeepPartial$1<T>): T;
2542
- }
2543
-
2544
2397
  declare enum CommitStatus {
2545
2398
  COMMIT_UNSPECIFIED = 0,
2546
2399
  COMMIT_PROCESSING = 1,
@@ -2565,16 +2418,16 @@ interface TokenOutputToSpend {
2565
2418
  prevTokenTransactionHash: Uint8Array;
2566
2419
  prevTokenTransactionVout: number;
2567
2420
  }
2568
- declare const TokenOutputToSpend: MessageFns<TokenOutputToSpend>;
2421
+ declare const TokenOutputToSpend: MessageFns$1<TokenOutputToSpend>;
2569
2422
  interface TokenTransferInput {
2570
2423
  outputsToSpend: TokenOutputToSpend[];
2571
2424
  }
2572
- declare const TokenTransferInput: MessageFns<TokenTransferInput>;
2425
+ declare const TokenTransferInput: MessageFns$1<TokenTransferInput>;
2573
2426
  interface TokenMintInput {
2574
2427
  issuerPublicKey: Uint8Array;
2575
2428
  tokenIdentifier?: Uint8Array | undefined;
2576
2429
  }
2577
- declare const TokenMintInput: MessageFns<TokenMintInput>;
2430
+ declare const TokenMintInput: MessageFns$1<TokenMintInput>;
2578
2431
  interface TokenCreateInput {
2579
2432
  issuerPublicKey: Uint8Array;
2580
2433
  /** No minimum length because a single utf-8 character can be 3 bytes. */
@@ -2587,7 +2440,7 @@ interface TokenCreateInput {
2587
2440
  isFreezable: boolean;
2588
2441
  creationEntityPublicKey?: Uint8Array | undefined;
2589
2442
  }
2590
- declare const TokenCreateInput: MessageFns<TokenCreateInput>;
2443
+ declare const TokenCreateInput: MessageFns$1<TokenCreateInput>;
2591
2444
  /**
2592
2445
  * This proto is constructed by the wallet to specify outputs it wants to create
2593
2446
  * as part of a token transaction. Output id and revocation public key should
@@ -2605,7 +2458,7 @@ interface TokenOutput {
2605
2458
  /** Decoded uint128 */
2606
2459
  tokenAmount: Uint8Array;
2607
2460
  }
2608
- declare const TokenOutput: MessageFns<TokenOutput>;
2461
+ declare const TokenOutput: MessageFns$1<TokenOutput>;
2609
2462
  /**
2610
2463
  * This proto is constructed by the wallet and is the core transaction data
2611
2464
  * structure. This proto is deterministically hashed to generate the
@@ -2647,11 +2500,11 @@ interface TokenTransaction {
2647
2500
  /** The spark invoices this transaction fulfills. */
2648
2501
  invoiceAttachments: InvoiceAttachment[];
2649
2502
  }
2650
- declare const TokenTransaction: MessageFns<TokenTransaction>;
2503
+ declare const TokenTransaction: MessageFns$1<TokenTransaction>;
2651
2504
  interface InvoiceAttachment {
2652
2505
  sparkInvoice: string;
2653
2506
  }
2654
- declare const InvoiceAttachment: MessageFns<InvoiceAttachment>;
2507
+ declare const InvoiceAttachment: MessageFns$1<InvoiceAttachment>;
2655
2508
  interface SignatureWithIndex {
2656
2509
  /**
2657
2510
  * This is a Schnorr or ECDSA DER signature which can be between 64 and 73
@@ -2661,7 +2514,7 @@ interface SignatureWithIndex {
2661
2514
  /** The index of the TTXO associated with this signature. */
2662
2515
  inputIndex: number;
2663
2516
  }
2664
- declare const SignatureWithIndex: MessageFns<SignatureWithIndex>;
2517
+ declare const SignatureWithIndex: MessageFns$1<SignatureWithIndex>;
2665
2518
  /**
2666
2519
  * A group of signatures for the input TTXOs binding them to the final token
2667
2520
  * transaction hash. This bundle of signatures is specific to a given operator.
@@ -2670,7 +2523,7 @@ interface InputTtxoSignaturesPerOperator {
2670
2523
  ttxoSignatures: SignatureWithIndex[];
2671
2524
  operatorIdentityPublicKey: Uint8Array;
2672
2525
  }
2673
- declare const InputTtxoSignaturesPerOperator: MessageFns<InputTtxoSignaturesPerOperator>;
2526
+ declare const InputTtxoSignaturesPerOperator: MessageFns$1<InputTtxoSignaturesPerOperator>;
2674
2527
  /** === Start Transaction === */
2675
2528
  interface StartTransactionRequest {
2676
2529
  identityPublicKey: Uint8Array;
@@ -2689,34 +2542,34 @@ interface StartTransactionRequest {
2689
2542
  */
2690
2543
  validityDurationSeconds: number;
2691
2544
  }
2692
- declare const StartTransactionRequest: MessageFns<StartTransactionRequest>;
2545
+ declare const StartTransactionRequest: MessageFns$1<StartTransactionRequest>;
2693
2546
  interface StartTransactionResponse {
2694
2547
  finalTokenTransaction: TokenTransaction | undefined;
2695
2548
  keyshareInfo: SigningKeyshare | undefined;
2696
2549
  }
2697
- declare const StartTransactionResponse: MessageFns<StartTransactionResponse>;
2550
+ declare const StartTransactionResponse: MessageFns$1<StartTransactionResponse>;
2698
2551
  interface CommitTransactionRequest {
2699
2552
  finalTokenTransaction: TokenTransaction | undefined;
2700
2553
  finalTokenTransactionHash: Uint8Array;
2701
2554
  inputTtxoSignaturesPerOperator: InputTtxoSignaturesPerOperator[];
2702
2555
  ownerIdentityPublicKey: Uint8Array;
2703
2556
  }
2704
- declare const CommitTransactionRequest: MessageFns<CommitTransactionRequest>;
2557
+ declare const CommitTransactionRequest: MessageFns$1<CommitTransactionRequest>;
2705
2558
  interface CommitProgress {
2706
2559
  committedOperatorPublicKeys: Uint8Array[];
2707
2560
  uncommittedOperatorPublicKeys: Uint8Array[];
2708
2561
  }
2709
- declare const CommitProgress: MessageFns<CommitProgress>;
2562
+ declare const CommitProgress: MessageFns$1<CommitProgress>;
2710
2563
  interface CommitTransactionResponse {
2711
2564
  commitStatus: CommitStatus;
2712
2565
  commitProgress: CommitProgress | undefined;
2713
2566
  }
2714
- declare const CommitTransactionResponse: MessageFns<CommitTransactionResponse>;
2567
+ declare const CommitTransactionResponse: MessageFns$1<CommitTransactionResponse>;
2715
2568
  interface QueryTokenMetadataRequest {
2716
2569
  tokenIdentifiers: Uint8Array[];
2717
2570
  issuerPublicKeys: Uint8Array[];
2718
2571
  }
2719
- declare const QueryTokenMetadataRequest: MessageFns<QueryTokenMetadataRequest>;
2572
+ declare const QueryTokenMetadataRequest: MessageFns$1<QueryTokenMetadataRequest>;
2720
2573
  interface TokenMetadata {
2721
2574
  issuerPublicKey: Uint8Array;
2722
2575
  tokenName: string;
@@ -2728,11 +2581,11 @@ interface TokenMetadata {
2728
2581
  creationEntityPublicKey?: Uint8Array | undefined;
2729
2582
  tokenIdentifier: Uint8Array;
2730
2583
  }
2731
- declare const TokenMetadata: MessageFns<TokenMetadata>;
2584
+ declare const TokenMetadata: MessageFns$1<TokenMetadata>;
2732
2585
  interface QueryTokenMetadataResponse {
2733
2586
  tokenMetadata: TokenMetadata[];
2734
2587
  }
2735
- declare const QueryTokenMetadataResponse: MessageFns<QueryTokenMetadataResponse>;
2588
+ declare const QueryTokenMetadataResponse: MessageFns$1<QueryTokenMetadataResponse>;
2736
2589
  interface QueryTokenOutputsRequest {
2737
2590
  ownerPublicKeys: Uint8Array[];
2738
2591
  /** Optionally provide issuer public keys or token identifiers. If both are not set return outputs for all tokens. */
@@ -2741,7 +2594,7 @@ interface QueryTokenOutputsRequest {
2741
2594
  /** defaults to mainnet when no network is provided. */
2742
2595
  network: Network$1;
2743
2596
  }
2744
- declare const QueryTokenOutputsRequest: MessageFns<QueryTokenOutputsRequest>;
2597
+ declare const QueryTokenOutputsRequest: MessageFns$1<QueryTokenOutputsRequest>;
2745
2598
  /** Request constraints are combined using an AND relation. */
2746
2599
  interface QueryTokenTransactionsRequest {
2747
2600
  /** Returns transactions that have one of these output ids in the input or output. */
@@ -2757,31 +2610,31 @@ interface QueryTokenTransactionsRequest {
2757
2610
  limit: number;
2758
2611
  offset: number;
2759
2612
  }
2760
- declare const QueryTokenTransactionsRequest: MessageFns<QueryTokenTransactionsRequest>;
2613
+ declare const QueryTokenTransactionsRequest: MessageFns$1<QueryTokenTransactionsRequest>;
2761
2614
  interface QueryTokenTransactionsResponse {
2762
2615
  tokenTransactionsWithStatus: TokenTransactionWithStatus[];
2763
2616
  offset: number;
2764
2617
  }
2765
- declare const QueryTokenTransactionsResponse: MessageFns<QueryTokenTransactionsResponse>;
2618
+ declare const QueryTokenTransactionsResponse: MessageFns$1<QueryTokenTransactionsResponse>;
2766
2619
  interface OutputWithPreviousTransactionData {
2767
2620
  output: TokenOutput | undefined;
2768
2621
  previousTransactionHash: Uint8Array;
2769
2622
  previousTransactionVout: number;
2770
2623
  }
2771
- declare const OutputWithPreviousTransactionData: MessageFns<OutputWithPreviousTransactionData>;
2624
+ declare const OutputWithPreviousTransactionData: MessageFns$1<OutputWithPreviousTransactionData>;
2772
2625
  interface QueryTokenOutputsResponse {
2773
2626
  outputsWithPreviousTransactionData: OutputWithPreviousTransactionData[];
2774
2627
  }
2775
- declare const QueryTokenOutputsResponse: MessageFns<QueryTokenOutputsResponse>;
2628
+ declare const QueryTokenOutputsResponse: MessageFns$1<QueryTokenOutputsResponse>;
2776
2629
  interface SpentTokenOutputMetadata {
2777
2630
  outputId: string;
2778
2631
  revocationSecret: Uint8Array;
2779
2632
  }
2780
- declare const SpentTokenOutputMetadata: MessageFns<SpentTokenOutputMetadata>;
2633
+ declare const SpentTokenOutputMetadata: MessageFns$1<SpentTokenOutputMetadata>;
2781
2634
  interface TokenTransactionConfirmationMetadata {
2782
2635
  spentTokenOutputsMetadata: SpentTokenOutputMetadata[];
2783
2636
  }
2784
- declare const TokenTransactionConfirmationMetadata: MessageFns<TokenTransactionConfirmationMetadata>;
2637
+ declare const TokenTransactionConfirmationMetadata: MessageFns$1<TokenTransactionConfirmationMetadata>;
2785
2638
  interface TokenTransactionWithStatus {
2786
2639
  tokenTransaction: TokenTransaction | undefined;
2787
2640
  status: TokenTransactionStatus;
@@ -2794,7 +2647,7 @@ interface TokenTransactionWithStatus {
2794
2647
  */
2795
2648
  tokenTransactionHash: Uint8Array;
2796
2649
  }
2797
- declare const TokenTransactionWithStatus: MessageFns<TokenTransactionWithStatus>;
2650
+ declare const TokenTransactionWithStatus: MessageFns$1<TokenTransactionWithStatus>;
2798
2651
  interface FreezeTokensPayload {
2799
2652
  version: number;
2800
2653
  ownerPublicKey: Uint8Array;
@@ -2805,34 +2658,181 @@ interface FreezeTokensPayload {
2805
2658
  /** Set to false when requesting a freeze. */
2806
2659
  shouldUnfreeze: boolean;
2807
2660
  }
2808
- declare const FreezeTokensPayload: MessageFns<FreezeTokensPayload>;
2661
+ declare const FreezeTokensPayload: MessageFns$1<FreezeTokensPayload>;
2809
2662
  interface FreezeTokensRequest {
2810
2663
  freezeTokensPayload: FreezeTokensPayload | undefined;
2811
2664
  /** This is a Schnorr or ECDSA DER signature which can be between 64 and 73 bytes. */
2812
2665
  issuerSignature: Uint8Array;
2813
2666
  }
2814
- declare const FreezeTokensRequest: MessageFns<FreezeTokensRequest>;
2667
+ declare const FreezeTokensRequest: MessageFns$1<FreezeTokensRequest>;
2815
2668
  interface FreezeTokensResponse {
2816
2669
  impactedOutputIds: string[];
2817
2670
  /** Decoded uint128 */
2818
2671
  impactedTokenAmount: Uint8Array;
2819
2672
  }
2820
- declare const FreezeTokensResponse: MessageFns<FreezeTokensResponse>;
2673
+ declare const FreezeTokensResponse: MessageFns$1<FreezeTokensResponse>;
2821
2674
  interface SparkTokenServiceClient<CallOptionsExt = {}> {
2822
2675
  /**
2823
2676
  * Start process to create final token transaction with all inputs required
2824
2677
  * from user and SOs (including revocation secret commitment)
2825
2678
  */
2826
- start_transaction(request: DeepPartial<StartTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransactionResponse>;
2679
+ start_transaction(request: DeepPartial$1<StartTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransactionResponse>;
2827
2680
  /**
2828
2681
  * Complete the transaction and commit it with all SOs. This will be
2829
2682
  * coordinated by one SO.
2830
2683
  */
2831
- commit_transaction(request: DeepPartial<CommitTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<CommitTransactionResponse>;
2832
- query_token_metadata(request: DeepPartial<QueryTokenMetadataRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenMetadataResponse>;
2833
- query_token_transactions(request: DeepPartial<QueryTokenTransactionsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse>;
2834
- query_token_outputs(request: DeepPartial<QueryTokenOutputsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse>;
2835
- freeze_tokens(request: DeepPartial<FreezeTokensRequest>, options?: CallOptions & CallOptionsExt): Promise<FreezeTokensResponse>;
2684
+ commit_transaction(request: DeepPartial$1<CommitTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<CommitTransactionResponse>;
2685
+ query_token_metadata(request: DeepPartial$1<QueryTokenMetadataRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenMetadataResponse>;
2686
+ query_token_transactions(request: DeepPartial$1<QueryTokenTransactionsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse>;
2687
+ query_token_outputs(request: DeepPartial$1<QueryTokenOutputsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse>;
2688
+ freeze_tokens(request: DeepPartial$1<FreezeTokensRequest>, options?: CallOptions & CallOptionsExt): Promise<FreezeTokensResponse>;
2689
+ }
2690
+ type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
2691
+ type DeepPartial$1<T> = T extends Builtin$1 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$1<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$1<U>> : T extends {
2692
+ $case: string;
2693
+ } ? {
2694
+ [K in keyof Omit<T, "$case">]?: DeepPartial$1<T[K]>;
2695
+ } & {
2696
+ $case: T["$case"];
2697
+ } : T extends {} ? {
2698
+ [K in keyof T]?: DeepPartial$1<T[K]>;
2699
+ } : Partial<T>;
2700
+ interface MessageFns$1<T> {
2701
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
2702
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
2703
+ fromJSON(object: any): T;
2704
+ toJSON(message: T): unknown;
2705
+ create(base?: DeepPartial$1<T>): T;
2706
+ fromPartial(object: DeepPartial$1<T>): T;
2707
+ }
2708
+
2709
+ declare enum Network {
2710
+ MAINNET = 0,
2711
+ TESTNET = 1,
2712
+ SIGNET = 2,
2713
+ REGTEST = 3,
2714
+ LOCAL = 4
2715
+ }
2716
+ type NetworkType = keyof typeof Network;
2717
+ declare const NetworkToProto: Record<Network, Network$1>;
2718
+ declare const protoToNetwork: (protoNetwork: Network$1) => Network | undefined;
2719
+ declare const getNetwork: (network: Network) => typeof btc.NETWORK;
2720
+ declare const LRC_WALLET_NETWORK: Readonly<{
2721
+ 0: bitcoin.networks.Network;
2722
+ 1: bitcoin.networks.Network;
2723
+ 2: bitcoin.networks.Network;
2724
+ 3: bitcoin.networks.Network;
2725
+ 4: bitcoin.networks.Network;
2726
+ }>;
2727
+ /**
2728
+ * Utility function to determine the network from a Bitcoin address.
2729
+ *
2730
+ * @param {string} address - The Bitcoin address
2731
+ * @returns {BitcoinNetwork | null} The detected network or null if not detected
2732
+ */
2733
+ declare function getNetworkFromAddress(address: string): BitcoinNetwork.MAINNET | BitcoinNetwork.REGTEST | null;
2734
+ /**
2735
+ * Utility function to get the network enum value from a string.
2736
+ *
2737
+ * @param {string} network - The Bitcoin network to turn into an enum value
2738
+ * @returns {Network} The enum value matching the string
2739
+ */
2740
+ declare function getNetworkFromString(network?: string): Network;
2741
+
2742
+ type SigningOperator = {
2743
+ readonly id: number;
2744
+ readonly identifier: string;
2745
+ readonly address: string;
2746
+ readonly identityPublicKey: string;
2747
+ };
2748
+ type ConsoleOptions = {
2749
+ otel?: boolean;
2750
+ };
2751
+ type ConfigOptions = MayHaveSspClientOptions & {
2752
+ readonly network?: NetworkType;
2753
+ readonly signingOperators?: Readonly<Record<string, SigningOperator>>;
2754
+ readonly coordinatorIdentifier?: string;
2755
+ readonly frostSignerAddress?: string;
2756
+ readonly threshold?: number;
2757
+ readonly tokenSignatures?: "ECDSA" | "SCHNORR";
2758
+ readonly tokenValidityDurationSeconds?: number;
2759
+ readonly tokenTransactionVersion?: "V0" | "V1";
2760
+ readonly electrsUrl?: string;
2761
+ readonly sspClientOptions?: SspClientOptions;
2762
+ readonly expectedWithdrawBondSats?: number;
2763
+ readonly expectedWithdrawRelativeBlockLocktime?: number;
2764
+ readonly signerWithPreExistingKeys?: boolean;
2765
+ readonly console?: ConsoleOptions;
2766
+ };
2767
+
2768
+ declare class WalletConfigService implements HasSspClientOptions {
2769
+ private readonly config;
2770
+ readonly signer: SparkSigner;
2771
+ readonly sspClientOptions: SspClientOptions;
2772
+ constructor(options?: ConfigOptions, signer?: SparkSigner);
2773
+ private getDefaultConfig;
2774
+ getCoordinatorAddress(): string;
2775
+ getSigningOperators(): Readonly<Record<string, SigningOperator>>;
2776
+ getThreshold(): number;
2777
+ getCoordinatorIdentifier(): string;
2778
+ getExpectedWithdrawBondSats(): number;
2779
+ getExpectedWithdrawRelativeBlockLocktime(): number;
2780
+ getSspNetwork(): BitcoinNetwork;
2781
+ getNetwork(): Network;
2782
+ getNetworkType(): NetworkType;
2783
+ getNetworkProto(): number;
2784
+ getTokenSignatures(): "ECDSA" | "SCHNORR";
2785
+ getTokenTransactionVersion(): "V0" | "V1";
2786
+ getTokenValidityDurationSeconds(): number;
2787
+ getElectrsUrl(): string;
2788
+ getSspBaseUrl(): string;
2789
+ getSspIdentityPublicKey(): string;
2790
+ getConsoleOptions(): ConsoleOptions;
2791
+ }
2792
+
2793
+ declare enum InterruptTransferRequest_InterruptTransferAction {
2794
+ NONE = 0,
2795
+ INTERRUPT = 1,
2796
+ RESUME = 2,
2797
+ UNRECOGNIZED = -1
2798
+ }
2799
+ declare enum InterruptCoopExitRequest_InterruptCoopExitAction {
2800
+ NONE = 0,
2801
+ INTERRUPT = 1,
2802
+ RESUME = 2,
2803
+ UNRECOGNIZED = -1
2804
+ }
2805
+ interface CleanUpPreimageShareRequest {
2806
+ paymentHash: Uint8Array;
2807
+ }
2808
+ declare const CleanUpPreimageShareRequest: MessageFns<CleanUpPreimageShareRequest>;
2809
+ interface InterruptTransferRequest {
2810
+ action: InterruptTransferRequest_InterruptTransferAction;
2811
+ }
2812
+ declare const InterruptTransferRequest: MessageFns<InterruptTransferRequest>;
2813
+ interface UpdateNodesStatusRequest {
2814
+ nodeIds: string[];
2815
+ status: string;
2816
+ }
2817
+ declare const UpdateNodesStatusRequest: MessageFns<UpdateNodesStatusRequest>;
2818
+ /** TriggerTaskRequest is used to trigger a scheduled task immediately in hermetic tests. */
2819
+ interface TriggerTaskRequest {
2820
+ taskName: string;
2821
+ }
2822
+ declare const TriggerTaskRequest: MessageFns<TriggerTaskRequest>;
2823
+ interface InterruptCoopExitRequest {
2824
+ action: InterruptCoopExitRequest_InterruptCoopExitAction;
2825
+ /** optional, defaults to MockAction.TargetOperatorID */
2826
+ targetOperator: string;
2827
+ }
2828
+ declare const InterruptCoopExitRequest: MessageFns<InterruptCoopExitRequest>;
2829
+ interface MockServiceClient<CallOptionsExt = {}> {
2830
+ clean_up_preimage_share(request: DeepPartial<CleanUpPreimageShareRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2831
+ interrupt_transfer(request: DeepPartial<InterruptTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2832
+ interrupt_coop_exit(request: DeepPartial<InterruptCoopExitRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2833
+ update_nodes_status(request: DeepPartial<UpdateNodesStatusRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2834
+ /** Triggers the execution of a scheduled task immediately by name. Used by hermetic tests */
2835
+ trigger_task(request: DeepPartial<TriggerTaskRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2836
2836
  }
2837
2837
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
2838
2838
  type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
@@ -3611,7 +3611,7 @@ declare class SparkWallet extends EventEmitter {
3611
3611
  outputIds?: string[];
3612
3612
  pageSize?: number;
3613
3613
  offset?: number;
3614
- }): Promise<TokenTransactionWithStatus[]>;
3614
+ }): Promise<QueryTokenTransactionsResponse>;
3615
3615
  getTokenL1Address(): Promise<string>;
3616
3616
  /**
3617
3617
  * Signs a message with the identity key.