@buildonspark/spark-sdk 0.1.47 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{chunk-BGGEVUJK.js → chunk-2ENZX6LT.js} +241 -7
  3. package/dist/{chunk-LHRD2WT6.js → chunk-4JD4HIAN.js} +23 -3
  4. package/dist/chunk-BYXBJQAS.js +0 -0
  5. package/dist/{chunk-EAP3U3CW.js → chunk-CDLETEDT.js} +25 -17
  6. package/dist/{chunk-OBFKIEMP.js → chunk-TM6CHQXC.js} +1 -1
  7. package/dist/{chunk-NNX4OK44.js → chunk-UDK3EBE5.js} +5544 -1678
  8. package/dist/chunk-XYTKKLCV.js +7 -0
  9. package/dist/{client-D7KgLN44.d.ts → client-DKbwpcnl.d.ts} +73 -61
  10. package/dist/{client-CvpTRpcw.d.cts → client-Drs5Lapg.d.cts} +73 -61
  11. package/dist/debug.cjs +32358 -0
  12. package/dist/debug.d.cts +126 -0
  13. package/dist/debug.d.ts +126 -0
  14. package/dist/debug.js +21 -0
  15. package/dist/graphql/objects/index.d.cts +2 -5
  16. package/dist/graphql/objects/index.d.ts +2 -5
  17. package/dist/graphql/objects/index.js +2 -4
  18. package/dist/index.cjs +791 -474
  19. package/dist/index.d.cts +8 -7
  20. package/dist/index.d.ts +8 -7
  21. package/dist/index.js +32 -36
  22. package/dist/index.node.cjs +791 -474
  23. package/dist/index.node.d.cts +12 -132
  24. package/dist/index.node.d.ts +12 -132
  25. package/dist/index.node.js +31 -31
  26. package/dist/native/index.cjs +885 -575
  27. package/dist/native/index.d.cts +419 -335
  28. package/dist/native/index.d.ts +419 -335
  29. package/dist/native/index.js +857 -550
  30. package/dist/proto/lrc20.d.cts +1 -1
  31. package/dist/proto/lrc20.d.ts +1 -1
  32. package/dist/proto/lrc20.js +1 -1
  33. package/dist/proto/spark.cjs +241 -7
  34. package/dist/proto/spark.d.cts +1 -1
  35. package/dist/proto/spark.d.ts +1 -1
  36. package/dist/proto/spark.js +5 -1
  37. package/dist/proto/spark_token.cjs +22 -2
  38. package/dist/proto/spark_token.d.cts +8 -1
  39. package/dist/proto/spark_token.d.ts +8 -1
  40. package/dist/proto/spark_token.js +2 -2
  41. package/dist/{sdk-types-BGCeea0G.d.ts → sdk-types-DCIVdKUT.d.ts} +1 -1
  42. package/dist/{sdk-types-XUeQMLFP.d.cts → sdk-types-DJ2ve9YY.d.cts} +1 -1
  43. package/dist/{spark-BbUrbvZz.d.ts → spark-BUOx3U7Q.d.cts} +103 -5
  44. package/dist/{spark-BbUrbvZz.d.cts → spark-BUOx3U7Q.d.ts} +103 -5
  45. package/dist/{spark-wallet-CJkQW8pK.d.ts → spark-wallet-CF8Oxjqs.d.ts} +143 -131
  46. package/dist/{spark-wallet-BAFPpPtY.d.cts → spark-wallet-DOLSa3oF.d.cts} +143 -131
  47. package/dist/tests/test-utils.cjs +7137 -5744
  48. package/dist/tests/test-utils.d.cts +5 -5
  49. package/dist/tests/test-utils.d.ts +5 -5
  50. package/dist/tests/test-utils.js +16 -8
  51. package/dist/types/index.cjs +239 -7
  52. package/dist/types/index.d.cts +3 -3
  53. package/dist/types/index.d.ts +3 -3
  54. package/dist/types/index.js +6 -8
  55. package/dist/xchain-address-C2xMs9nz.d.cts +126 -0
  56. package/dist/xchain-address-Ckto9oEz.d.ts +126 -0
  57. package/package.json +5 -1
  58. package/src/debug.ts +13 -0
  59. package/src/proto/mock.ts +76 -0
  60. package/src/proto/spark.ts +354 -6
  61. package/src/proto/spark_token.ts +34 -2
  62. package/src/services/coop-exit.ts +6 -3
  63. package/src/services/deposit.ts +9 -8
  64. package/src/services/lightning.ts +3 -1
  65. package/src/services/signing.ts +10 -6
  66. package/src/services/token-transactions.ts +95 -80
  67. package/src/services/transfer.ts +88 -60
  68. package/src/services/tree-creation.ts +17 -9
  69. package/src/signer/signer.react-native.ts +3 -5
  70. package/src/signer/signer.ts +153 -297
  71. package/src/signer/types.ts +18 -7
  72. package/src/spark-wallet/spark-wallet.ts +170 -136
  73. package/src/spark-wallet/types.ts +18 -4
  74. package/src/tests/integration/adaptor-signature.test.ts +8 -9
  75. package/src/tests/integration/coop-exit.test.ts +212 -201
  76. package/src/tests/integration/lightning.test.ts +126 -101
  77. package/src/tests/integration/swap.test.ts +115 -83
  78. package/src/tests/integration/transfer.test.ts +287 -210
  79. package/src/tests/integration/tree-creation.test.ts +0 -5
  80. package/src/tests/test-utils.ts +10 -4
  81. package/src/tests/token-identifier.test.ts +6 -6
  82. package/src/utils/token-identifier.ts +27 -21
  83. package/src/utils/token-transaction-validation.ts +34 -0
  84. package/src/utils/token-transactions.ts +9 -5
  85. package/dist/chunk-GWFQ7EBA.js +0 -3773
  86. package/dist/chunk-HMLOC6TE.js +0 -14
  87. package/ios/spark_frost.kt +0 -1900
@@ -606,6 +606,7 @@ interface TokenTransactionWithStatus$1 {
606
606
  tokenTransaction: TokenTransaction$1 | undefined;
607
607
  status: TokenTransactionStatus$1;
608
608
  confirmationMetadata: TokenTransactionConfirmationMetadata$1 | undefined;
609
+ tokenTransactionHash: Uint8Array;
609
610
  }
610
611
  declare const TokenTransactionWithStatus$1: MessageFns$2<TokenTransactionWithStatus$1>;
611
612
  interface SignatureWithIndex$1 {
@@ -1014,6 +1015,7 @@ interface RequestedSigningCommitments {
1014
1015
  declare const RequestedSigningCommitments: MessageFns$2<RequestedSigningCommitments>;
1015
1016
  interface GetSigningCommitmentsRequest {
1016
1017
  nodeIds: string[];
1018
+ count: number;
1017
1019
  }
1018
1020
  declare const GetSigningCommitmentsRequest: MessageFns$2<GetSigningCommitmentsRequest>;
1019
1021
  interface GetSigningCommitmentsResponse {
@@ -1287,6 +1289,8 @@ interface QueryStaticDepositAddressesRequest {
1287
1289
  network: Network$1;
1288
1290
  limit: number;
1289
1291
  offset: number;
1292
+ /** Optional filter. When specified, only the DepositAddress with this address is returned. */
1293
+ depositAddress?: string | undefined;
1290
1294
  }
1291
1295
  declare const QueryStaticDepositAddressesRequest: MessageFns$2<QueryStaticDepositAddressesRequest>;
1292
1296
  interface DepositAddressQueryResult {
@@ -1327,6 +1331,39 @@ interface PaymentIntentFields {
1327
1331
  memo?: string | undefined;
1328
1332
  }
1329
1333
  declare const PaymentIntentFields: MessageFns$2<PaymentIntentFields>;
1334
+ interface InitiateStaticDepositUtxoRefundRequest {
1335
+ onChainUtxo: UTXO | undefined;
1336
+ /**
1337
+ * A package that is used for signing L1 Bitcoin transactions using FROST.
1338
+ * SE consumes it to return SigningResult structure, that is used by the user to
1339
+ * construct the final signature for the refund Bitcoin transaction.
1340
+ */
1341
+ refundTxSigningJob: SigningJob | undefined;
1342
+ /**
1343
+ * Signature of a user statement that authorises the SE to initiate a static
1344
+ * deposit utxo refund to the user.
1345
+ *
1346
+ * The user statement is constructed by concatenating the following fields in order:
1347
+ * 1. Action name: "claim_static_deposit" (UTF-8 string)
1348
+ * 2. Network: lowercase network name (e.g., "bitcoin", "testnet") (UTF-8 string)
1349
+ * 3. Transaction ID: hex-encoded UTXO transaction ID (UTF-8 string)
1350
+ * 4. Output index: UTXO output index (vout) as 4-byte unsigned integer (little-endian)
1351
+ * 5. Request type: 2 for refund (1-byte unsigned integer, little-endian)
1352
+ * 6. Credit amount: amount of satoshis to credit as 8-byte unsigned integer (little-endian)
1353
+ * 7. Signing payload: sighash of spend transaction (UTF-8 string)
1354
+ *
1355
+ * The concatenated payload is then hashed with SHA-256, and the resulting hash
1356
+ * is signed using ECDSA with the user's identity private key to produce this signature.
1357
+ */
1358
+ userSignature: Uint8Array;
1359
+ }
1360
+ declare const InitiateStaticDepositUtxoRefundRequest: MessageFns$2<InitiateStaticDepositUtxoRefundRequest>;
1361
+ interface InitiateStaticDepositUtxoRefundResponse {
1362
+ /** The FROST signing results which must be aggregated by the user to complete signing */
1363
+ refundTxSigningResult: SigningResult | undefined;
1364
+ depositAddress: DepositAddressQueryResult | undefined;
1365
+ }
1366
+ declare const InitiateStaticDepositUtxoRefundResponse: MessageFns$2<InitiateStaticDepositUtxoRefundResponse>;
1330
1367
  interface InitiateUtxoSwapRequest {
1331
1368
  onChainUtxo: UTXO | undefined;
1332
1369
  requestType: UtxoSwapRequestType;
@@ -1449,6 +1486,7 @@ interface SparkServiceClient<CallOptionsExt = {}> {
1449
1486
  extend_leaf(request: DeepPartial$2<ExtendLeafRequest>, options?: CallOptions & CallOptionsExt): Promise<ExtendLeafResponse>;
1450
1487
  prepare_tree_address(request: DeepPartial$2<PrepareTreeAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<PrepareTreeAddressResponse>;
1451
1488
  create_tree(request: DeepPartial$2<CreateTreeRequest>, options?: CallOptions & CallOptionsExt): Promise<CreateTreeResponse>;
1489
+ create_tree_v2(request: DeepPartial$2<CreateTreeRequest>, options?: CallOptions & CallOptionsExt): Promise<CreateTreeResponse>;
1452
1490
  get_signing_operator_list(request: DeepPartial$2<Empty>, options?: CallOptions & CallOptionsExt): Promise<GetSigningOperatorListResponse>;
1453
1491
  query_nodes(request: DeepPartial$2<QueryNodesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryNodesResponse>;
1454
1492
  query_nodes_distribution(request: DeepPartial$2<QueryNodesDistributionRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryNodesDistributionResponse>;
@@ -1466,7 +1504,21 @@ interface SparkServiceClient<CallOptionsExt = {}> {
1466
1504
  query_unused_deposit_addresses(request: DeepPartial$2<QueryUnusedDepositAddressesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryUnusedDepositAddressesResponse>;
1467
1505
  query_static_deposit_addresses(request: DeepPartial$2<QueryStaticDepositAddressesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryStaticDepositAddressesResponse>;
1468
1506
  subscribe_to_events(request: DeepPartial$2<SubscribeToEventsRequest>, options?: CallOptions & CallOptionsExt): AsyncIterable<SubscribeToEventsResponse>;
1469
- /** Claim a deposit to a static address from SSP side */
1507
+ /**
1508
+ * Signs the provided refund transaction which spends the UTXO from a static
1509
+ * deposit address. If successful, the UTXO will no longer be available to claim on
1510
+ * the Spark network, and the refund transaction must be broadcasted on L1 to claim
1511
+ * the funds. Returns an error if the UTXO has already been claimed.
1512
+ */
1513
+ initiate_static_deposit_utxo_refund(request: DeepPartial$2<InitiateStaticDepositUtxoRefundRequest>, options?: CallOptions & CallOptionsExt): Promise<InitiateStaticDepositUtxoRefundResponse>;
1514
+ /**
1515
+ * DEPRECATED: This unified method is being split for better clarity and type safety
1516
+ *
1517
+ * For swap operations: Use spark_ssp_internal.initiate_static_deposit_utxo_swap()
1518
+ * For refund operations: Use initiate_static_deposit_utxo_refund()
1519
+ *
1520
+ * @deprecated
1521
+ */
1470
1522
  initiate_utxo_swap(request: DeepPartial$2<InitiateUtxoSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<InitiateUtxoSwapResponse>;
1471
1523
  exit_single_node_trees(request: DeepPartial$2<ExitSingleNodeTreesRequest>, options?: CallOptions & CallOptionsExt): Promise<ExitSingleNodeTreesResponse>;
1472
1524
  }
@@ -1641,9 +1693,30 @@ type SigningCommitment = {
1641
1693
  binding: Uint8Array;
1642
1694
  hiding: Uint8Array;
1643
1695
  };
1696
+ declare enum KeyDerivationType {
1697
+ LEAF = "leaf",
1698
+ DEPOSIT = "deposit",
1699
+ STATIC_DEPOSIT = "static_deposit",
1700
+ ECIES = "ecies",
1701
+ RANDOM = "random"
1702
+ }
1703
+ type KeyDerivation = {
1704
+ type: KeyDerivationType.LEAF;
1705
+ path: string;
1706
+ } | {
1707
+ type: KeyDerivationType.DEPOSIT;
1708
+ } | {
1709
+ type: KeyDerivationType.RANDOM;
1710
+ } | {
1711
+ type: KeyDerivationType.STATIC_DEPOSIT;
1712
+ path: number;
1713
+ } | {
1714
+ type: KeyDerivationType.ECIES;
1715
+ path: Uint8Array;
1716
+ };
1644
1717
  type SignFrostParams = {
1645
1718
  message: Uint8Array;
1646
- privateAsPubKey: Uint8Array;
1719
+ keyDerivation: KeyDerivation;
1647
1720
  publicKey: Uint8Array;
1648
1721
  verifyingKey: Uint8Array;
1649
1722
  selfCommitment: ISigningCommitment;
@@ -1652,7 +1725,7 @@ type SignFrostParams = {
1652
1725
  } | undefined;
1653
1726
  adaptorPubKey?: Uint8Array | undefined;
1654
1727
  };
1655
- type AggregateFrostParams = Omit<SignFrostParams, "privateAsPubKey"> & {
1728
+ type AggregateFrostParams = Omit<SignFrostParams, "keyDerivation"> & {
1656
1729
  selfSignature: Uint8Array;
1657
1730
  statechainSignatures?: {
1658
1731
  [key: string]: Uint8Array;
@@ -1666,7 +1739,6 @@ type SplitSecretWithProofsParams = {
1666
1739
  curveOrder: bigint;
1667
1740
  threshold: number;
1668
1741
  numShares: number;
1669
- isSecretPubkey?: boolean;
1670
1742
  };
1671
1743
  type DerivedHDKey = {
1672
1744
  hdKey: HDKey;
@@ -1687,17 +1759,283 @@ declare function createSigningCommitment(binding: Uint8Array, hiding: Uint8Array
1687
1759
  declare function encodeSigningCommitmentToBytes(commitment: SigningCommitment): Uint8Array;
1688
1760
  declare function decodeBytesToSigningCommitment(bytes: Uint8Array): SigningCommitment;
1689
1761
 
1690
- type HumanReadableTokenIdentifier = `btk1${string}` | `btkrt1${string}` | `btkt1${string}` | `btks1${string}` | `btkl1${string}`;
1691
- interface HumanReadableTokenIdentifierData {
1762
+ type Bech32mTokenIdentifier = `btk1${string}` | `btkrt1${string}` | `btkt1${string}` | `btks1${string}` | `btkl1${string}`;
1763
+ interface Bech32mTokenIdentifierData {
1692
1764
  tokenIdentifier: Uint8Array;
1693
1765
  network: NetworkType;
1694
1766
  }
1695
- declare function encodeHumanReadableTokenIdentifier(payload: HumanReadableTokenIdentifierData): HumanReadableTokenIdentifier;
1696
- declare function decodeHumanReadableTokenIdentifier(humanReadableTokenIdentifier: HumanReadableTokenIdentifier, network: NetworkType): HumanReadableTokenIdentifierData;
1767
+ declare function encodeBech32mTokenIdentifier(payload: Bech32mTokenIdentifierData): Bech32mTokenIdentifier;
1768
+ declare function decodeBech32mTokenIdentifier(bech32mTokenIdentifier: Bech32mTokenIdentifier, network: NetworkType): Bech32mTokenIdentifierData;
1769
+
1770
+ declare enum TokenTransactionStatus {
1771
+ TOKEN_TRANSACTION_STARTED = 0,
1772
+ TOKEN_TRANSACTION_SIGNED = 1,
1773
+ TOKEN_TRANSACTION_REVEALED = 5,
1774
+ TOKEN_TRANSACTION_FINALIZED = 2,
1775
+ TOKEN_TRANSACTION_STARTED_CANCELLED = 3,
1776
+ TOKEN_TRANSACTION_SIGNED_CANCELLED = 4,
1777
+ TOKEN_TRANSACTION_UNKNOWN = 10,
1778
+ UNRECOGNIZED = -1
1779
+ }
1780
+ /**
1781
+ * This proto is constructed by the wallet to specify leaves it wants to spend
1782
+ * as part of the token transaction.
1783
+ */
1784
+ interface TokenOutputToSpend {
1785
+ prevTokenTransactionHash: Uint8Array;
1786
+ prevTokenTransactionVout: number;
1787
+ }
1788
+ declare const TokenOutputToSpend: MessageFns$1<TokenOutputToSpend>;
1789
+ interface TokenTransferInput {
1790
+ outputsToSpend: TokenOutputToSpend[];
1791
+ }
1792
+ declare const TokenTransferInput: MessageFns$1<TokenTransferInput>;
1793
+ interface TokenMintInput {
1794
+ issuerPublicKey: Uint8Array;
1795
+ tokenIdentifier?: Uint8Array | undefined;
1796
+ }
1797
+ declare const TokenMintInput: MessageFns$1<TokenMintInput>;
1798
+ interface TokenCreateInput {
1799
+ issuerPublicKey: Uint8Array;
1800
+ tokenName: string;
1801
+ tokenTicker: string;
1802
+ decimals: number;
1803
+ /** Decoded uint128 */
1804
+ maxSupply: Uint8Array;
1805
+ isFreezable: boolean;
1806
+ creationEntityPublicKey?: Uint8Array | undefined;
1807
+ }
1808
+ declare const TokenCreateInput: MessageFns$1<TokenCreateInput>;
1809
+ /**
1810
+ * This proto is constructed by the wallet to specify outputs it wants to create
1811
+ * as part of a token transaction. Output id and revocation public key should
1812
+ * remain unfilled so that the SE can fill them as part of the
1813
+ * StartTokenTransaction() call.
1814
+ */
1815
+ interface TokenOutput {
1816
+ id?: string | undefined;
1817
+ ownerPublicKey: Uint8Array;
1818
+ revocationCommitment?: Uint8Array | undefined;
1819
+ withdrawBondSats?: number | undefined;
1820
+ withdrawRelativeBlockLocktime?: number | undefined;
1821
+ tokenPublicKey?: Uint8Array | undefined;
1822
+ tokenIdentifier?: Uint8Array | undefined;
1823
+ /** Decoded uint128 */
1824
+ tokenAmount: Uint8Array;
1825
+ }
1826
+ declare const TokenOutput: MessageFns$1<TokenOutput>;
1827
+ /**
1828
+ * This proto is constructed by the wallet and is the core transaction data
1829
+ * structure. This proto is deterministically hashed to generate the
1830
+ * token_transaction_hash that is cooperatively signed by the SO group to
1831
+ * confirm a token transaction.
1832
+ */
1833
+ interface TokenTransaction {
1834
+ /**
1835
+ * For mint transactions issuer_public_key will be specified without any
1836
+ * outputs_to_spend. For transfer transactions the token amount in the input
1837
+ * leaves must match the token amount in the output leaves.
1838
+ */
1839
+ version: number;
1840
+ tokenInputs?: {
1841
+ $case: "mintInput";
1842
+ mintInput: TokenMintInput;
1843
+ } | {
1844
+ $case: "transferInput";
1845
+ transferInput: TokenTransferInput;
1846
+ } | {
1847
+ $case: "createInput";
1848
+ createInput: TokenCreateInput;
1849
+ } | undefined;
1850
+ tokenOutputs: TokenOutput[];
1851
+ sparkOperatorIdentityPublicKeys: Uint8Array[];
1852
+ /**
1853
+ * Server-set expiry time. The server calculates this by adding the client's
1854
+ * requested validity_duration_seconds to the server's current time when
1855
+ * creating the final transaction.
1856
+ */
1857
+ expiryTime: Date | undefined;
1858
+ network: Network$1;
1859
+ /**
1860
+ * The timestamp of when the client created the transaction. This is used to
1861
+ * determine which transaction should win in a race condition. Earlier
1862
+ * timestamps win over later ones.
1863
+ */
1864
+ clientCreatedTimestamp: Date | undefined;
1865
+ }
1866
+ declare const TokenTransaction: MessageFns$1<TokenTransaction>;
1867
+ interface SignatureWithIndex {
1868
+ /**
1869
+ * This is a Schnorr or ECDSA DER signature which can be between 64 and 73
1870
+ * bytes.
1871
+ */
1872
+ signature: Uint8Array;
1873
+ /** The index of the TTXO associated with this signature. */
1874
+ inputIndex: number;
1875
+ }
1876
+ declare const SignatureWithIndex: MessageFns$1<SignatureWithIndex>;
1877
+ /**
1878
+ * A group of signatures for the input TTXOs binding them to the final token
1879
+ * transaction hash. This bundle of signatures is specific to a given operator.
1880
+ */
1881
+ interface InputTtxoSignaturesPerOperator {
1882
+ ttxoSignatures: SignatureWithIndex[];
1883
+ operatorIdentityPublicKey: Uint8Array;
1884
+ }
1885
+ declare const InputTtxoSignaturesPerOperator: MessageFns$1<InputTtxoSignaturesPerOperator>;
1886
+ /** === Start Transaction === */
1887
+ interface StartTransactionRequest {
1888
+ identityPublicKey: Uint8Array;
1889
+ partialTokenTransaction: TokenTransaction | undefined;
1890
+ /**
1891
+ * Filled by signing the partial token transaction hash with the
1892
+ * owner/issuer private key. For mint transactions this will be one
1893
+ * signature for the input issuer_public_key For transfer transactions this
1894
+ * will be one for each output for the output owner_public_key
1895
+ */
1896
+ partialTokenTransactionOwnerSignatures: SignatureWithIndex[];
1897
+ /**
1898
+ * How long the transaction should be valid for, in seconds.
1899
+ * The server will set the actual expiry_time in the final transaction based
1900
+ * on this duration. Must be within [1, 300] seconds.
1901
+ */
1902
+ validityDurationSeconds: number;
1903
+ }
1904
+ declare const StartTransactionRequest: MessageFns$1<StartTransactionRequest>;
1905
+ interface StartTransactionResponse {
1906
+ finalTokenTransaction: TokenTransaction | undefined;
1907
+ keyshareInfo: SigningKeyshare | undefined;
1908
+ }
1909
+ declare const StartTransactionResponse: MessageFns$1<StartTransactionResponse>;
1910
+ interface CommitTransactionRequest {
1911
+ finalTokenTransaction: TokenTransaction | undefined;
1912
+ finalTokenTransactionHash: Uint8Array;
1913
+ inputTtxoSignaturesPerOperator: InputTtxoSignaturesPerOperator[];
1914
+ ownerIdentityPublicKey: Uint8Array;
1915
+ }
1916
+ declare const CommitTransactionRequest: MessageFns$1<CommitTransactionRequest>;
1917
+ interface CommitTransactionResponse {
1918
+ }
1919
+ declare const CommitTransactionResponse: MessageFns$1<CommitTransactionResponse>;
1920
+ interface QueryTokenMetadataRequest {
1921
+ tokenIdentifiers: Uint8Array[];
1922
+ issuerPublicKeys: Uint8Array[];
1923
+ }
1924
+ declare const QueryTokenMetadataRequest: MessageFns$1<QueryTokenMetadataRequest>;
1925
+ interface TokenMetadata {
1926
+ issuerPublicKey: Uint8Array;
1927
+ tokenName: string;
1928
+ tokenTicker: string;
1929
+ decimals: number;
1930
+ /** Decoded uint128 */
1931
+ maxSupply: Uint8Array;
1932
+ isFreezable: boolean;
1933
+ creationEntityPublicKey?: Uint8Array | undefined;
1934
+ tokenIdentifier: Uint8Array;
1935
+ }
1936
+ declare const TokenMetadata: MessageFns$1<TokenMetadata>;
1937
+ interface QueryTokenMetadataResponse {
1938
+ tokenMetadata: TokenMetadata[];
1939
+ }
1940
+ declare const QueryTokenMetadataResponse: MessageFns$1<QueryTokenMetadataResponse>;
1941
+ interface QueryTokenOutputsRequest {
1942
+ ownerPublicKeys: Uint8Array[];
1943
+ /** Optionally provide issuer public keys or token identifiers. If both are not set return outputs for all tokens. */
1944
+ issuerPublicKeys: Uint8Array[];
1945
+ tokenIdentifiers: Uint8Array[];
1946
+ /** defaults to mainnet when no network is provided. */
1947
+ network: Network$1;
1948
+ }
1949
+ declare const QueryTokenOutputsRequest: MessageFns$1<QueryTokenOutputsRequest>;
1950
+ /** Request constraints are combined using an AND relation. */
1951
+ interface QueryTokenTransactionsRequest {
1952
+ /** Returns transactions that have one of these output ids in the input or output. */
1953
+ outputIds: string[];
1954
+ /** Returns transactions that have this owner public key as the sender or receiver in one or more of the input/output leaves. */
1955
+ ownerPublicKeys: Uint8Array[];
1956
+ /** Returns transactions that related to this token public key. */
1957
+ issuerPublicKeys: Uint8Array[];
1958
+ /** Returns transactions that related to this token identifier. */
1959
+ tokenIdentifiers: Uint8Array[];
1960
+ /** Returns transactions that match the provided transaction hashes. */
1961
+ tokenTransactionHashes: Uint8Array[];
1962
+ limit: number;
1963
+ offset: number;
1964
+ }
1965
+ declare const QueryTokenTransactionsRequest: MessageFns$1<QueryTokenTransactionsRequest>;
1966
+ interface QueryTokenTransactionsResponse {
1967
+ tokenTransactionsWithStatus: TokenTransactionWithStatus[];
1968
+ offset: number;
1969
+ }
1970
+ declare const QueryTokenTransactionsResponse: MessageFns$1<QueryTokenTransactionsResponse>;
1971
+ interface OutputWithPreviousTransactionData {
1972
+ output: TokenOutput | undefined;
1973
+ previousTransactionHash: Uint8Array;
1974
+ previousTransactionVout: number;
1975
+ }
1976
+ declare const OutputWithPreviousTransactionData: MessageFns$1<OutputWithPreviousTransactionData>;
1977
+ interface QueryTokenOutputsResponse {
1978
+ outputsWithPreviousTransactionData: OutputWithPreviousTransactionData[];
1979
+ }
1980
+ declare const QueryTokenOutputsResponse: MessageFns$1<QueryTokenOutputsResponse>;
1981
+ interface SpentTokenOutputMetadata {
1982
+ outputId: string;
1983
+ revocationSecret: Uint8Array;
1984
+ }
1985
+ declare const SpentTokenOutputMetadata: MessageFns$1<SpentTokenOutputMetadata>;
1986
+ interface TokenTransactionConfirmationMetadata {
1987
+ spentTokenOutputsMetadata: SpentTokenOutputMetadata[];
1988
+ }
1989
+ declare const TokenTransactionConfirmationMetadata: MessageFns$1<TokenTransactionConfirmationMetadata>;
1990
+ interface TokenTransactionWithStatus {
1991
+ tokenTransaction: TokenTransaction | undefined;
1992
+ status: TokenTransactionStatus;
1993
+ confirmationMetadata: TokenTransactionConfirmationMetadata | undefined;
1994
+ /**
1995
+ * In rare cases the above reconstructed token transaction may not match the original token transaction due to:
1996
+ * a) a pre-empted transfer transaction having its input TTXOs remapped to the newer transaction
1997
+ * b) proto migrations or field deprecations resulting in missing/swapped fields (eg. token public key -> token identifier)
1998
+ * Include the original hash to ensure clients can reconcile this transaction with the original if needed.
1999
+ */
2000
+ tokenTransactionHash: Uint8Array;
2001
+ }
2002
+ declare const TokenTransactionWithStatus: MessageFns$1<TokenTransactionWithStatus>;
2003
+ interface SparkTokenServiceClient<CallOptionsExt = {}> {
2004
+ /**
2005
+ * Start process to create final token transaction with all inputs required
2006
+ * from user and SOs (including revocation secret commitment)
2007
+ */
2008
+ start_transaction(request: DeepPartial$1<StartTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransactionResponse>;
2009
+ /**
2010
+ * Complete the transaction and commit it with all SOs. This will be
2011
+ * coordinated by one SO.
2012
+ */
2013
+ commit_transaction(request: DeepPartial$1<CommitTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<CommitTransactionResponse>;
2014
+ query_token_metadata(request: DeepPartial$1<QueryTokenMetadataRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenMetadataResponse>;
2015
+ query_token_transactions(request: DeepPartial$1<QueryTokenTransactionsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse>;
2016
+ query_token_outputs(request: DeepPartial$1<QueryTokenOutputsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse>;
2017
+ }
2018
+ type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
2019
+ 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 {
2020
+ $case: string;
2021
+ } ? {
2022
+ [K in keyof Omit<T, "$case">]?: DeepPartial$1<T[K]>;
2023
+ } & {
2024
+ $case: T["$case"];
2025
+ } : T extends {} ? {
2026
+ [K in keyof T]?: DeepPartial$1<T[K]>;
2027
+ } : Partial<T>;
2028
+ interface MessageFns$1<T> {
2029
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
2030
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
2031
+ fromJSON(object: any): T;
2032
+ toJSON(message: T): unknown;
2033
+ create(base?: DeepPartial$1<T>): T;
2034
+ fromPartial(object: DeepPartial$1<T>): T;
2035
+ }
1697
2036
 
1698
2037
  interface SparkKeysGenerator {
1699
2038
  deriveKeysFromSeed(seed: Uint8Array, accountNumber: number): Promise<{
1700
- masterPublicKey: Uint8Array;
1701
2039
  identityKey: KeyPair;
1702
2040
  signingHDKey: DerivedHDKey;
1703
2041
  depositKey: KeyPair;
@@ -1707,82 +2045,77 @@ interface SparkKeysGenerator {
1707
2045
  interface SparkSigner extends TokenSigner {
1708
2046
  getIdentityPublicKey(): Promise<Uint8Array>;
1709
2047
  getDepositSigningKey(): Promise<Uint8Array>;
1710
- generateStaticDepositKey(idx: number): Promise<Uint8Array>;
1711
2048
  getStaticDepositSigningKey(idx: number): Promise<Uint8Array>;
1712
2049
  getStaticDepositSecretKey(idx: number): Promise<Uint8Array>;
1713
2050
  generateMnemonic(): Promise<string>;
1714
2051
  mnemonicToSeed(mnemonic: string): Promise<Uint8Array>;
1715
2052
  createSparkWalletFromSeed(seed: Uint8Array | string, accountNumber?: number): Promise<string>;
1716
- restoreSigningKeysFromLeafs(leafs: TreeNode[]): Promise<void>;
1717
- getTrackedPublicKeys(): Promise<Uint8Array[]>;
1718
- generatePublicKey(hash?: Uint8Array): Promise<Uint8Array>;
1719
- removePublicKey(publicKey: Uint8Array): Promise<void>;
1720
- getSchnorrPublicKey(publicKey: Uint8Array): Promise<Uint8Array>;
1721
- signSchnorr(message: Uint8Array, publicKey: Uint8Array): Promise<Uint8Array>;
2053
+ getPublicKeyFromDerivation(keyDerivation?: KeyDerivation): Promise<Uint8Array>;
1722
2054
  signSchnorrWithIdentityKey(message: Uint8Array): Promise<Uint8Array>;
1723
- subtractPrivateKeysGivenPublicKeys(first: Uint8Array, second: Uint8Array): Promise<Uint8Array>;
2055
+ subtractPrivateKeysGivenDerivationPaths(first: string, second: string): Promise<Uint8Array>;
2056
+ subtractAndSplitSecretWithProofsGivenDerivations(params: Omit<SplitSecretWithProofsParams, "secret"> & {
2057
+ first: KeyDerivation;
2058
+ second?: KeyDerivation | undefined;
2059
+ }): Promise<VerifiableSecretShare[]>;
2060
+ subtractSplitAndEncrypt(params: Omit<SplitSecretWithProofsParams, "secret"> & {
2061
+ first: KeyDerivation;
2062
+ second: KeyDerivation;
2063
+ receiverPublicKey: Uint8Array;
2064
+ }): Promise<{
2065
+ shares: VerifiableSecretShare[];
2066
+ secretCipher: Uint8Array;
2067
+ }>;
1724
2068
  splitSecretWithProofs(params: SplitSecretWithProofsParams): Promise<VerifiableSecretShare[]>;
1725
2069
  signFrost(params: SignFrostParams): Promise<Uint8Array>;
1726
2070
  aggregateFrost(params: AggregateFrostParams): Promise<Uint8Array>;
1727
- signMessageWithPublicKey(message: Uint8Array, publicKey: Uint8Array, compact?: boolean): Promise<Uint8Array>;
1728
2071
  signMessageWithIdentityKey(message: Uint8Array, compact?: boolean): Promise<Uint8Array>;
1729
2072
  validateMessageWithIdentityKey(message: Uint8Array, signature: Uint8Array): Promise<boolean>;
1730
2073
  signTransactionIndex(tx: Transaction, index: number, publicKey: Uint8Array): void;
1731
- encryptLeafPrivateKeyEcies(receiverPublicKey: Uint8Array, publicKey: Uint8Array): Promise<Uint8Array>;
1732
2074
  decryptEcies(ciphertext: Uint8Array): Promise<Uint8Array>;
1733
2075
  getRandomSigningCommitment(): Promise<SigningCommitment>;
1734
- hashRandomPrivateKey(): Promise<Uint8Array>;
1735
- generateAdaptorFromSignature(signature: Uint8Array): Promise<{
1736
- adaptorSignature: Uint8Array;
1737
- adaptorPublicKey: Uint8Array;
1738
- }>;
1739
2076
  getDepositSigningKey(): Promise<Uint8Array>;
1740
- getMasterPublicKey(): Promise<Uint8Array>;
1741
2077
  }
1742
2078
  declare class DefaultSparkSigner implements SparkSigner {
1743
- private masterPublicKey;
1744
2079
  private identityKey;
1745
2080
  private signingKey;
1746
2081
  private depositKey;
1747
2082
  private staticDepositKey;
1748
- private staticDepositKeyMap;
1749
- protected publicKeyToPrivateKeyMap: Map<string, string>;
1750
2083
  protected commitmentToNonceMap: Map<SigningCommitment, SigningNonce>;
1751
2084
  private readonly keysGenerator;
1752
2085
  constructor({ sparkKeysGenerator, }?: {
1753
2086
  sparkKeysGenerator?: SparkKeysGenerator;
1754
2087
  });
1755
2088
  private deriveSigningKey;
1756
- restoreSigningKeysFromLeafs(leafs: TreeNode[]): Promise<void>;
1757
- getSchnorrPublicKey(publicKey: Uint8Array): Promise<Uint8Array>;
1758
- signSchnorr(message: Uint8Array, publicKey: Uint8Array): Promise<Uint8Array>;
2089
+ private decryptEciesToPrivateKey;
2090
+ protected getSigningPrivateKeyFromDerivation(keyDerivation: KeyDerivation): Promise<Uint8Array>;
1759
2091
  signSchnorrWithIdentityKey(message: Uint8Array): Promise<Uint8Array>;
1760
2092
  getIdentityPublicKey(): Promise<Uint8Array>;
1761
2093
  getDepositSigningKey(): Promise<Uint8Array>;
1762
- generateStaticDepositKey(idx: number): Promise<Uint8Array>;
1763
2094
  getStaticDepositSigningKey(idx: number): Promise<Uint8Array>;
1764
2095
  getStaticDepositSecretKey(idx: number): Promise<Uint8Array>;
1765
2096
  generateMnemonic(): Promise<string>;
1766
2097
  mnemonicToSeed(mnemonic: string): Promise<Uint8Array>;
1767
- getTrackedPublicKeys(): Promise<Uint8Array[]>;
1768
- generatePublicKey(hash?: Uint8Array): Promise<Uint8Array>;
1769
- removePublicKey(publicKey: Uint8Array): Promise<void>;
1770
- subtractPrivateKeysGivenPublicKeys(first: Uint8Array, second: Uint8Array): Promise<Uint8Array>;
1771
- splitSecretWithProofs({ secret, curveOrder, threshold, numShares, isSecretPubkey, }: SplitSecretWithProofsParams): Promise<VerifiableSecretShare[]>;
1772
- signFrost({ message, privateAsPubKey, publicKey, verifyingKey, selfCommitment, statechainCommitments, adaptorPubKey, }: SignFrostParams): Promise<Uint8Array>;
2098
+ getPublicKeyFromDerivation(keyDerivation: KeyDerivation): Promise<Uint8Array>;
2099
+ subtractPrivateKeysGivenDerivationPaths(first: string, second: string): Promise<Uint8Array>;
2100
+ subtractAndSplitSecretWithProofsGivenDerivations({ first, second, curveOrder, threshold, numShares, }: Omit<SplitSecretWithProofsParams, "secret"> & {
2101
+ first: KeyDerivation;
2102
+ second: KeyDerivation;
2103
+ }): Promise<VerifiableSecretShare[]>;
2104
+ subtractSplitAndEncrypt({ first, second, curveOrder, threshold, numShares, receiverPublicKey, }: Omit<SplitSecretWithProofsParams, "secret"> & {
2105
+ first: KeyDerivation;
2106
+ second: KeyDerivation;
2107
+ receiverPublicKey: Uint8Array;
2108
+ }): Promise<{
2109
+ shares: VerifiableSecretShare[];
2110
+ secretCipher: Uint8Array;
2111
+ }>;
2112
+ splitSecretWithProofs({ secret, curveOrder, threshold, numShares, }: SplitSecretWithProofsParams): Promise<VerifiableSecretShare[]>;
2113
+ signFrost({ message, keyDerivation, publicKey, verifyingKey, selfCommitment, statechainCommitments, adaptorPubKey, }: SignFrostParams): Promise<Uint8Array>;
1773
2114
  aggregateFrost({ message, publicKey, verifyingKey, selfCommitment, statechainCommitments, adaptorPubKey, selfSignature, statechainSignatures, statechainPublicKeys, }: AggregateFrostParams): Promise<Uint8Array>;
1774
2115
  createSparkWalletFromSeed(seed: Uint8Array | string, accountNumber?: number): Promise<string>;
1775
- signMessageWithPublicKey(message: Uint8Array, publicKey: Uint8Array, compact?: boolean): Promise<Uint8Array>;
1776
2116
  signMessageWithIdentityKey(message: Uint8Array, compact?: boolean): Promise<Uint8Array>;
1777
- encryptLeafPrivateKeyEcies(receiverPublicKey: Uint8Array, publicKey: Uint8Array): Promise<Uint8Array>;
1778
2117
  decryptEcies(ciphertext: Uint8Array): Promise<Uint8Array>;
1779
2118
  getRandomSigningCommitment(): Promise<SigningCommitment>;
1780
- hashRandomPrivateKey(): Promise<Uint8Array>;
1781
- generateAdaptorFromSignature(signature: Uint8Array): Promise<{
1782
- adaptorSignature: Uint8Array;
1783
- adaptorPublicKey: Uint8Array;
1784
- }>;
1785
- getMasterPublicKey(): Promise<Uint8Array>;
1786
2119
  validateMessageWithIdentityKey(message: Uint8Array, signature: Uint8Array): Promise<boolean>;
1787
2120
  signPsbt(psbt: Psbt, input: number, sighashTypes?: number[], receipt?: Receipt): Promise<Psbt>;
1788
2121
  private getReceiptPrivateKey;
@@ -2392,7 +2725,7 @@ type TransferParams = {
2392
2725
  receiverSparkAddress: string;
2393
2726
  };
2394
2727
  type DepositParams = {
2395
- signingPubKey: Uint8Array;
2728
+ keyDerivation: KeyDerivation;
2396
2729
  verifyingKey: Uint8Array;
2397
2730
  depositTx: Transaction;
2398
2731
  vout: number;
@@ -2401,7 +2734,7 @@ type DepositParams = {
2401
2734
  * Token metadata containing essential information about a token.
2402
2735
  * This is the wallet's internal representation with JavaScript-friendly types.
2403
2736
  *
2404
- * rawTokenIdentifier: This is the raw binary token identifier - This is used to encode the human readable token identifier.
2737
+ * rawTokenIdentifier: This is the raw binary token identifier - This is used to encode the bech32m encoded token identifier.
2405
2738
  *
2406
2739
  * tokenPublicKey: This is the hex-encoded public key of the token issuer - Same as issuerPublicKey.
2407
2740
  *
@@ -2431,10 +2764,15 @@ type UserTokenMetadata = {
2431
2764
  /** Maximum supply of tokens that can ever be minted */
2432
2765
  maxSupply: bigint;
2433
2766
  };
2434
- type TokenBalanceMap = Map<HumanReadableTokenIdentifier, {
2767
+ type TokenBalanceMap = Map<Bech32mTokenIdentifier, {
2435
2768
  balance: bigint;
2436
2769
  tokenMetadata: UserTokenMetadata;
2437
2770
  }>;
2771
+ type RawTokenIdentifierHex = string & {
2772
+ readonly __brand: "RawTokenIdentifierHex";
2773
+ };
2774
+ type TokenOutputsMap = Map<Bech32mTokenIdentifier, OutputWithPreviousTransactionData$1[]>;
2775
+ type TokenMetadataMap = Map<Bech32mTokenIdentifier, TokenMetadata>;
2438
2776
  type InitWalletResponse = {
2439
2777
  mnemonic?: string | undefined;
2440
2778
  };
@@ -2458,7 +2796,7 @@ interface SparkWalletEvents {
2458
2796
  }
2459
2797
 
2460
2798
  declare function sumAvailableTokens(outputs: OutputWithPreviousTransactionData$1[]): bigint;
2461
- declare function checkIfSelectedOutputsAreAvailable(selectedOutputs: OutputWithPreviousTransactionData$1[], tokenOutputs: Map<string, OutputWithPreviousTransactionData$1[]>, tokenPublicKey: Uint8Array): boolean;
2799
+ declare function checkIfSelectedOutputsAreAvailable(selectedOutputs: OutputWithPreviousTransactionData$1[], tokenOutputs: TokenOutputsMap, tokenIdentifier: Bech32mTokenIdentifier): boolean;
2462
2800
  declare function filterTokenBalanceForTokenPublicKey(tokenBalances: TokenBalanceMap, publicKey: string): {
2463
2801
  balance: bigint;
2464
2802
  };
@@ -2533,7 +2871,7 @@ declare function constructFeeBumpTx(txHex: string, utxos: Utxo[], feeRate: FeeRa
2533
2871
  declare function getSparkAddressFromTaproot(taprootAddress: string): SparkAddressFormat;
2534
2872
 
2535
2873
  declare class ReactNativeSparkSigner extends DefaultSparkSigner {
2536
- signFrost({ message, privateAsPubKey, publicKey, verifyingKey, selfCommitment, statechainCommitments, adaptorPubKey, }: SignFrostParams): Promise<Uint8Array>;
2874
+ signFrost({ message, keyDerivation, publicKey, verifyingKey, selfCommitment, statechainCommitments, adaptorPubKey, }: SignFrostParams): Promise<Uint8Array>;
2537
2875
  aggregateFrost({ message, publicKey, verifyingKey, selfCommitment, statechainCommitments, adaptorPubKey, selfSignature, statechainSignatures, statechainPublicKeys, }: AggregateFrostParams): Promise<Uint8Array>;
2538
2876
  }
2539
2877
 
@@ -2571,280 +2909,27 @@ declare enum InterruptTransferRequest_InterruptTransferAction {
2571
2909
  interface CleanUpPreimageShareRequest {
2572
2910
  paymentHash: Uint8Array;
2573
2911
  }
2574
- declare const CleanUpPreimageShareRequest: MessageFns$1<CleanUpPreimageShareRequest>;
2912
+ declare const CleanUpPreimageShareRequest: MessageFns<CleanUpPreimageShareRequest>;
2575
2913
  interface InterruptTransferRequest {
2576
2914
  action: InterruptTransferRequest_InterruptTransferAction;
2577
2915
  }
2578
- declare const InterruptTransferRequest: MessageFns$1<InterruptTransferRequest>;
2916
+ declare const InterruptTransferRequest: MessageFns<InterruptTransferRequest>;
2579
2917
  interface UpdateNodesStatusRequest {
2580
2918
  nodeIds: string[];
2581
2919
  status: string;
2582
2920
  }
2583
- declare const UpdateNodesStatusRequest: MessageFns$1<UpdateNodesStatusRequest>;
2584
- interface MockServiceClient<CallOptionsExt = {}> {
2585
- clean_up_preimage_share(request: DeepPartial$1<CleanUpPreimageShareRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2586
- interrupt_transfer(request: DeepPartial$1<InterruptTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2587
- update_nodes_status(request: DeepPartial$1<UpdateNodesStatusRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2588
- }
2589
- type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
2590
- 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 {
2591
- $case: string;
2592
- } ? {
2593
- [K in keyof Omit<T, "$case">]?: DeepPartial$1<T[K]>;
2594
- } & {
2595
- $case: T["$case"];
2596
- } : T extends {} ? {
2597
- [K in keyof T]?: DeepPartial$1<T[K]>;
2598
- } : Partial<T>;
2599
- interface MessageFns$1<T> {
2600
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
2601
- decode(input: BinaryReader | Uint8Array, length?: number): T;
2602
- fromJSON(object: any): T;
2603
- toJSON(message: T): unknown;
2604
- create(base?: DeepPartial$1<T>): T;
2605
- fromPartial(object: DeepPartial$1<T>): T;
2606
- }
2607
-
2608
- declare enum TokenTransactionStatus {
2609
- TOKEN_TRANSACTION_STARTED = 0,
2610
- TOKEN_TRANSACTION_SIGNED = 1,
2611
- TOKEN_TRANSACTION_REVEALED = 5,
2612
- TOKEN_TRANSACTION_FINALIZED = 2,
2613
- TOKEN_TRANSACTION_STARTED_CANCELLED = 3,
2614
- TOKEN_TRANSACTION_SIGNED_CANCELLED = 4,
2615
- TOKEN_TRANSACTION_UNKNOWN = 10,
2616
- UNRECOGNIZED = -1
2617
- }
2618
- /**
2619
- * This proto is constructed by the wallet to specify leaves it wants to spend
2620
- * as part of the token transaction.
2621
- */
2622
- interface TokenOutputToSpend {
2623
- prevTokenTransactionHash: Uint8Array;
2624
- prevTokenTransactionVout: number;
2625
- }
2626
- declare const TokenOutputToSpend: MessageFns<TokenOutputToSpend>;
2627
- interface TokenTransferInput {
2628
- outputsToSpend: TokenOutputToSpend[];
2629
- }
2630
- declare const TokenTransferInput: MessageFns<TokenTransferInput>;
2631
- interface TokenMintInput {
2632
- issuerPublicKey: Uint8Array;
2633
- tokenIdentifier?: Uint8Array | undefined;
2634
- }
2635
- declare const TokenMintInput: MessageFns<TokenMintInput>;
2636
- interface TokenCreateInput {
2637
- issuerPublicKey: Uint8Array;
2638
- tokenName: string;
2639
- tokenTicker: string;
2640
- decimals: number;
2641
- /** Decoded uint128 */
2642
- maxSupply: Uint8Array;
2643
- isFreezable: boolean;
2644
- creationEntityPublicKey?: Uint8Array | undefined;
2645
- }
2646
- declare const TokenCreateInput: MessageFns<TokenCreateInput>;
2647
- /**
2648
- * This proto is constructed by the wallet to specify outputs it wants to create
2649
- * as part of a token transaction. Output id and revocation public key should
2650
- * remain unfilled so that the SE can fill them as part of the
2651
- * StartTokenTransaction() call.
2652
- */
2653
- interface TokenOutput {
2654
- id?: string | undefined;
2655
- ownerPublicKey: Uint8Array;
2656
- revocationCommitment?: Uint8Array | undefined;
2657
- withdrawBondSats?: number | undefined;
2658
- withdrawRelativeBlockLocktime?: number | undefined;
2659
- tokenPublicKey?: Uint8Array | undefined;
2660
- tokenIdentifier?: Uint8Array | undefined;
2661
- /** Decoded uint128 */
2662
- tokenAmount: Uint8Array;
2663
- }
2664
- declare const TokenOutput: MessageFns<TokenOutput>;
2665
- /**
2666
- * This proto is constructed by the wallet and is the core transaction data
2667
- * structure. This proto is deterministically hashed to generate the
2668
- * token_transaction_hash that is cooperatively signed by the SO group to
2669
- * confirm a token transaction.
2670
- */
2671
- interface TokenTransaction {
2672
- /**
2673
- * For mint transactions issuer_public_key will be specified without any
2674
- * outputs_to_spend. For transfer transactions the token amount in the input
2675
- * leaves must match the token amount in the output leaves.
2676
- */
2677
- version: number;
2678
- tokenInputs?: {
2679
- $case: "mintInput";
2680
- mintInput: TokenMintInput;
2681
- } | {
2682
- $case: "transferInput";
2683
- transferInput: TokenTransferInput;
2684
- } | {
2685
- $case: "createInput";
2686
- createInput: TokenCreateInput;
2687
- } | undefined;
2688
- tokenOutputs: TokenOutput[];
2689
- sparkOperatorIdentityPublicKeys: Uint8Array[];
2690
- /**
2691
- * Server-set expiry time. The server calculates this by adding the client's
2692
- * requested validity_duration_seconds to the server's current time when
2693
- * creating the final transaction.
2694
- */
2695
- expiryTime: Date | undefined;
2696
- network: Network$1;
2697
- /**
2698
- * The timestamp of when the client created the transaction. This is used to
2699
- * determine which transaction should win in a race condition. Earlier
2700
- * timestamps win over later ones.
2701
- */
2702
- clientCreatedTimestamp: Date | undefined;
2921
+ declare const UpdateNodesStatusRequest: MessageFns<UpdateNodesStatusRequest>;
2922
+ /** TriggerTaskRequest is used to trigger a scheduled task immediately in hermetic tests. */
2923
+ interface TriggerTaskRequest {
2924
+ taskName: string;
2703
2925
  }
2704
- declare const TokenTransaction: MessageFns<TokenTransaction>;
2705
- interface SignatureWithIndex {
2706
- /**
2707
- * This is a Schnorr or ECDSA DER signature which can be between 64 and 73
2708
- * bytes.
2709
- */
2710
- signature: Uint8Array;
2711
- /** The index of the TTXO associated with this signature. */
2712
- inputIndex: number;
2713
- }
2714
- declare const SignatureWithIndex: MessageFns<SignatureWithIndex>;
2715
- /**
2716
- * A group of signatures for the input TTXOs binding them to the final token
2717
- * transaction hash. This bundle of signatures is specific to a given operator.
2718
- */
2719
- interface InputTtxoSignaturesPerOperator {
2720
- ttxoSignatures: SignatureWithIndex[];
2721
- operatorIdentityPublicKey: Uint8Array;
2722
- }
2723
- declare const InputTtxoSignaturesPerOperator: MessageFns<InputTtxoSignaturesPerOperator>;
2724
- /** === Start Transaction === */
2725
- interface StartTransactionRequest {
2726
- identityPublicKey: Uint8Array;
2727
- partialTokenTransaction: TokenTransaction | undefined;
2728
- /**
2729
- * Filled by signing the partial token transaction hash with the
2730
- * owner/issuer private key. For mint transactions this will be one
2731
- * signature for the input issuer_public_key For transfer transactions this
2732
- * will be one for each output for the output owner_public_key
2733
- */
2734
- partialTokenTransactionOwnerSignatures: SignatureWithIndex[];
2735
- /**
2736
- * How long the transaction should be valid for, in seconds.
2737
- * The server will set the actual expiry_time in the final transaction based
2738
- * on this duration. Must be within [1, 300] seconds.
2739
- */
2740
- validityDurationSeconds: number;
2741
- }
2742
- declare const StartTransactionRequest: MessageFns<StartTransactionRequest>;
2743
- interface StartTransactionResponse {
2744
- finalTokenTransaction: TokenTransaction | undefined;
2745
- keyshareInfo: SigningKeyshare | undefined;
2746
- }
2747
- declare const StartTransactionResponse: MessageFns<StartTransactionResponse>;
2748
- interface CommitTransactionRequest {
2749
- finalTokenTransaction: TokenTransaction | undefined;
2750
- finalTokenTransactionHash: Uint8Array;
2751
- inputTtxoSignaturesPerOperator: InputTtxoSignaturesPerOperator[];
2752
- ownerIdentityPublicKey: Uint8Array;
2753
- }
2754
- declare const CommitTransactionRequest: MessageFns<CommitTransactionRequest>;
2755
- interface CommitTransactionResponse {
2756
- }
2757
- declare const CommitTransactionResponse: MessageFns<CommitTransactionResponse>;
2758
- interface QueryTokenMetadataRequest {
2759
- tokenIdentifiers: Uint8Array[];
2760
- issuerPublicKeys: Uint8Array[];
2761
- }
2762
- declare const QueryTokenMetadataRequest: MessageFns<QueryTokenMetadataRequest>;
2763
- interface TokenMetadata {
2764
- issuerPublicKey: Uint8Array;
2765
- tokenName: string;
2766
- tokenTicker: string;
2767
- decimals: number;
2768
- /** Decoded uint128 */
2769
- maxSupply: Uint8Array;
2770
- isFreezable: boolean;
2771
- creationEntityPublicKey?: Uint8Array | undefined;
2772
- tokenIdentifier: Uint8Array;
2773
- }
2774
- declare const TokenMetadata: MessageFns<TokenMetadata>;
2775
- interface QueryTokenMetadataResponse {
2776
- tokenMetadata: TokenMetadata[];
2777
- }
2778
- declare const QueryTokenMetadataResponse: MessageFns<QueryTokenMetadataResponse>;
2779
- interface QueryTokenOutputsRequest {
2780
- ownerPublicKeys: Uint8Array[];
2781
- /** Optionally provide issuer public keys or token identifiers. If both are not set return outputs for all tokens. */
2782
- issuerPublicKeys: Uint8Array[];
2783
- tokenIdentifiers: Uint8Array[];
2784
- /** defaults to mainnet when no network is provided. */
2785
- network: Network$1;
2786
- }
2787
- declare const QueryTokenOutputsRequest: MessageFns<QueryTokenOutputsRequest>;
2788
- /** Request constraints are combined using an AND relation. */
2789
- interface QueryTokenTransactionsRequest {
2790
- /** Returns transactions that have one of these output ids in the input or output. */
2791
- outputIds: string[];
2792
- /** Returns transactions that have this owner public key as the sender or receiver in one or more of the input/output leaves. */
2793
- ownerPublicKeys: Uint8Array[];
2794
- /** Returns transactions that related to this token public key. */
2795
- issuerPublicKeys: Uint8Array[];
2796
- /** Returns transactions that related to this token identifier. */
2797
- tokenIdentifiers: Uint8Array[];
2798
- /** Returns transactions that match the provided transaction hashes. */
2799
- tokenTransactionHashes: Uint8Array[];
2800
- limit: number;
2801
- offset: number;
2802
- }
2803
- declare const QueryTokenTransactionsRequest: MessageFns<QueryTokenTransactionsRequest>;
2804
- interface QueryTokenTransactionsResponse {
2805
- tokenTransactionsWithStatus: TokenTransactionWithStatus[];
2806
- offset: number;
2807
- }
2808
- declare const QueryTokenTransactionsResponse: MessageFns<QueryTokenTransactionsResponse>;
2809
- interface OutputWithPreviousTransactionData {
2810
- output: TokenOutput | undefined;
2811
- previousTransactionHash: Uint8Array;
2812
- previousTransactionVout: number;
2813
- }
2814
- declare const OutputWithPreviousTransactionData: MessageFns<OutputWithPreviousTransactionData>;
2815
- interface QueryTokenOutputsResponse {
2816
- outputsWithPreviousTransactionData: OutputWithPreviousTransactionData[];
2817
- }
2818
- declare const QueryTokenOutputsResponse: MessageFns<QueryTokenOutputsResponse>;
2819
- interface SpentTokenOutputMetadata {
2820
- outputId: string;
2821
- revocationSecret: Uint8Array;
2822
- }
2823
- declare const SpentTokenOutputMetadata: MessageFns<SpentTokenOutputMetadata>;
2824
- interface TokenTransactionConfirmationMetadata {
2825
- spentTokenOutputsMetadata: SpentTokenOutputMetadata[];
2826
- }
2827
- declare const TokenTransactionConfirmationMetadata: MessageFns<TokenTransactionConfirmationMetadata>;
2828
- interface TokenTransactionWithStatus {
2829
- tokenTransaction: TokenTransaction | undefined;
2830
- status: TokenTransactionStatus;
2831
- confirmationMetadata: TokenTransactionConfirmationMetadata | undefined;
2832
- }
2833
- declare const TokenTransactionWithStatus: MessageFns<TokenTransactionWithStatus>;
2834
- interface SparkTokenServiceClient<CallOptionsExt = {}> {
2835
- /**
2836
- * Start process to create final token transaction with all inputs required
2837
- * from user and SOs (including revocation secret commitment)
2838
- */
2839
- start_transaction(request: DeepPartial<StartTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransactionResponse>;
2840
- /**
2841
- * Complete the transaction and commit it with all SOs. This will be
2842
- * coordinated by one SO.
2843
- */
2844
- commit_transaction(request: DeepPartial<CommitTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<CommitTransactionResponse>;
2845
- query_token_metadata(request: DeepPartial<QueryTokenMetadataRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenMetadataResponse>;
2846
- query_token_transactions(request: DeepPartial<QueryTokenTransactionsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse>;
2847
- query_token_outputs(request: DeepPartial<QueryTokenOutputsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse>;
2926
+ declare const TriggerTaskRequest: MessageFns<TriggerTaskRequest>;
2927
+ interface MockServiceClient<CallOptionsExt = {}> {
2928
+ clean_up_preimage_share(request: DeepPartial<CleanUpPreimageShareRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2929
+ interrupt_transfer(request: DeepPartial<InterruptTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2930
+ update_nodes_status(request: DeepPartial<UpdateNodesStatusRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2931
+ /** Triggers the execution of a scheduled task immediately by name. Used by hermetic tests */
2932
+ trigger_task(request: DeepPartial<TriggerTaskRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2848
2933
  }
2849
2934
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
2850
2935
  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 {
@@ -2906,18 +2991,18 @@ declare class SigningService {
2906
2991
 
2907
2992
  type LeafKeyTweak = {
2908
2993
  leaf: TreeNode;
2909
- signingPubKey: Uint8Array;
2910
- newSigningPubKey: Uint8Array;
2994
+ keyDerivation: KeyDerivation;
2995
+ newKeyDerivation: KeyDerivation;
2911
2996
  };
2912
2997
  type ClaimLeafData = {
2913
- signingPubKey: Uint8Array;
2998
+ keyDerivation: KeyDerivation;
2914
2999
  tx?: Transaction;
2915
3000
  refundTx?: Transaction;
2916
3001
  signingNonceCommitment: SigningCommitment;
2917
3002
  vout?: number;
2918
3003
  };
2919
3004
  type LeafRefundSigningData = {
2920
- signingPubKey: Uint8Array;
3005
+ keyDerivation: KeyDerivation;
2921
3006
  receivingPubkey: Uint8Array;
2922
3007
  tx: Transaction;
2923
3008
  refundTx?: Transaction;
@@ -2982,9 +3067,9 @@ declare class TransferService extends BaseTransferService {
2982
3067
  private finalizeNodeSignatures;
2983
3068
  cancelTransfer(transfer: Transfer$1, operatorAddress: string): Promise<Transfer$1 | undefined>;
2984
3069
  queryPendingTransfersBySender(operatorAddress: string): Promise<QueryTransfersResponse>;
2985
- refreshTimelockNodes(nodes: TreeNode[], parentNode: TreeNode, signingPubKey: Uint8Array): Promise<FinalizeNodeSignaturesResponse>;
2986
- extendTimelock(node: TreeNode, signingPubKey: Uint8Array): Promise<FinalizeNodeSignaturesResponse>;
2987
- refreshTimelockRefundTx(node: TreeNode, signingPubKey: Uint8Array): Promise<FinalizeNodeSignaturesResponse>;
3070
+ refreshTimelockNodes(nodes: TreeNode[], parentNode: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
3071
+ extendTimelock(node: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
3072
+ refreshTimelockRefundTx(node: TreeNode): Promise<FinalizeNodeSignaturesResponse>;
2988
3073
  }
2989
3074
 
2990
3075
  interface WalletLeaf {
@@ -3051,8 +3136,8 @@ declare class SparkWallet extends EventEmitter {
3051
3136
  private sparkAddress;
3052
3137
  private streamController;
3053
3138
  protected leaves: TreeNode[];
3054
- protected tokenOutputs: Map<string, OutputWithPreviousTransactionData$1[]>;
3055
- protected tokenMetadata: Map<string, TokenMetadata>;
3139
+ protected tokenMetadata: TokenMetadataMap;
3140
+ protected tokenOutputs: TokenOutputsMap;
3056
3141
  private claimTransfersInterval;
3057
3142
  protected wrapWithOtelSpan<T>(name: string, fn: (...args: any[]) => Promise<T>): (...args: any[]) => Promise<T>;
3058
3143
  protected constructor(options?: ConfigOptions, signer?: SparkSigner);
@@ -3150,7 +3235,7 @@ declare class SparkWallet extends EventEmitter {
3150
3235
  *
3151
3236
  * @returns {Promise<Object>} Object containing:
3152
3237
  * - balance: The wallet's current balance in satoshis
3153
- * - tokenBalances: Map of the human readable token identifier to token balances and token info
3238
+ * - tokenBalances: Map of the bech32m encodedtoken identifier to token balances and token info
3154
3239
  */
3155
3240
  getBalance(): Promise<{
3156
3241
  balance: bigint;
@@ -3438,8 +3523,8 @@ declare class SparkWallet extends EventEmitter {
3438
3523
  * @param {OutputWithPreviousTransactionData[]} [params.selectedOutputs] - Optional specific leaves to use for the transfer
3439
3524
  * @returns {Promise<string>} The transaction ID of the token transfer
3440
3525
  */
3441
- transferTokens({ tokenPublicKey, tokenAmount, receiverSparkAddress, outputSelectionStrategy, selectedOutputs, }: {
3442
- tokenPublicKey: string;
3526
+ transferTokens({ tokenIdentifier, tokenAmount, receiverSparkAddress, outputSelectionStrategy, selectedOutputs, }: {
3527
+ tokenIdentifier: Bech32mTokenIdentifier;
3443
3528
  tokenAmount: bigint;
3444
3529
  receiverSparkAddress: string;
3445
3530
  outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST";
@@ -3456,7 +3541,7 @@ declare class SparkWallet extends EventEmitter {
3456
3541
  * @returns {Promise<string[]>} Array of transaction IDs for the token transfers
3457
3542
  */
3458
3543
  batchTransferTokens(receiverOutputs: {
3459
- tokenPublicKey: string;
3544
+ tokenIdentifier: Bech32mTokenIdentifier;
3460
3545
  tokenAmount: bigint;
3461
3546
  receiverSparkAddress: string;
3462
3547
  }[], outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST", selectedOutputs?: OutputWithPreviousTransactionData$1[]): Promise<string>;
@@ -3575,8 +3660,8 @@ declare class TokenTransactionService {
3575
3660
  protected readonly config: WalletConfigService;
3576
3661
  protected readonly connectionManager: ConnectionManager;
3577
3662
  constructor(config: WalletConfigService, connectionManager: ConnectionManager);
3578
- tokenTransfer(tokenOutputs: Map<string, OutputWithPreviousTransactionData$1[]>, receiverOutputs: {
3579
- tokenPublicKey: string;
3663
+ tokenTransfer(tokenOutputs: TokenOutputsMap, receiverOutputs: {
3664
+ tokenIdentifier: Bech32mTokenIdentifier;
3580
3665
  tokenAmount: bigint;
3581
3666
  receiverSparkAddress: string;
3582
3667
  }[], outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST", selectedOutputs?: OutputWithPreviousTransactionData$1[]): Promise<string>;
@@ -3587,7 +3672,7 @@ declare class TokenTransactionService {
3587
3672
  }>): Promise<TokenTransaction$1>;
3588
3673
  constructTransferTokenTransaction(selectedOutputs: OutputWithPreviousTransactionData$1[], tokenOutputData: Array<{
3589
3674
  receiverSparkAddress: Uint8Array;
3590
- tokenPublicKey: Uint8Array;
3675
+ rawTokenIdentifier: Uint8Array;
3591
3676
  tokenAmount: bigint;
3592
3677
  }>): Promise<TokenTransaction>;
3593
3678
  collectOperatorIdentityPublicKeys(): Uint8Array[];
@@ -3604,7 +3689,6 @@ declare class TokenTransactionService {
3604
3689
  private fetchOwnedTokenOutputsV1;
3605
3690
  private queryTokenTransactionsV0;
3606
3691
  private queryTokenTransactionsV1;
3607
- syncTokenOutputs(tokenOutputs: Map<string, OutputWithPreviousTransactionData$1[]>): Promise<void>;
3608
3692
  selectTokenOutputs(tokenOutputs: OutputWithPreviousTransactionData$1[], tokenAmount: bigint, strategy: "SMALL_FIRST" | "LARGE_FIRST"): OutputWithPreviousTransactionData$1[];
3609
3693
  private sortTokenOutputsByStrategy;
3610
3694
  private signMessageWithKey;
@@ -3612,4 +3696,4 @@ declare class TokenTransactionService {
3612
3696
  private createSignaturesForOperators;
3613
3697
  }
3614
3698
 
3615
- export { AuthenticationError, 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 HumanReadableTokenIdentifier, type HumanReadableTokenIdentifierData, type InitWalletResponse, InternalValidationError, LRC_WALLET_NETWORK, LRC_WALLET_NETWORK_TYPE, type LeafInfo, Network, NetworkError, NetworkToProto, type NetworkType, NotImplementedError, type PayLightningInvoiceParams, RPCError, ReactNativeSparkSigner, type SparkAddressData, type SparkAddressFormat, SparkSDKError, SparkWallet, type SparkWalletEvents, type SparkWalletProps, type TokenBalanceMap, 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, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, decodeHumanReadableTokenIdentifier, decodeSparkAddress, encodeHumanReadableTokenIdentifier, 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 };
3699
+ 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 };