@buildonspark/spark-sdk 0.1.45 → 0.1.47

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 (146) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/{chunk-I54FARY2.js → chunk-EAP3U3CW.js} +14 -14
  3. package/dist/chunk-GWFQ7EBA.js +3773 -0
  4. package/dist/{chunk-J2IE4Z7Y.js → chunk-NNX4OK44.js} +3487 -934
  5. package/dist/{RequestLightningSendInput-Du0z7Om7.d.cts → client-CvpTRpcw.d.cts} +422 -212
  6. package/dist/{RequestLightningSendInput-DEPd_fPO.d.ts → client-D7KgLN44.d.ts} +422 -212
  7. package/dist/graphql/objects/index.d.cts +5 -9
  8. package/dist/graphql/objects/index.d.ts +5 -9
  9. package/dist/graphql/objects/index.js +1 -1
  10. package/dist/index.cjs +20461 -23377
  11. package/dist/index.d.cts +15 -769
  12. package/dist/index.d.ts +15 -769
  13. package/dist/index.js +81 -71
  14. package/dist/index.node.cjs +21994 -25018
  15. package/dist/index.node.d.cts +312 -34
  16. package/dist/index.node.d.ts +312 -34
  17. package/dist/index.node.js +82 -176
  18. package/dist/native/index.cjs +22847 -25841
  19. package/dist/native/index.d.cts +974 -1138
  20. package/dist/native/index.d.ts +974 -1138
  21. package/dist/native/index.js +10604 -13592
  22. package/dist/proto/lrc20.d.cts +2 -2
  23. package/dist/proto/lrc20.d.ts +2 -2
  24. package/dist/proto/lrc20.js +3098 -46
  25. package/dist/proto/spark.d.cts +1 -1
  26. package/dist/proto/spark.d.ts +1 -1
  27. package/dist/proto/spark_token.d.cts +1 -1
  28. package/dist/proto/spark_token.d.ts +1 -1
  29. package/dist/{sdk-types-Cc4l4kb1.d.ts → sdk-types-BGCeea0G.d.ts} +1 -1
  30. package/dist/{sdk-types-B0SwjolI.d.cts → sdk-types-XUeQMLFP.d.cts} +1 -1
  31. package/dist/{spark-dM7EYXYQ.d.cts → spark-BbUrbvZz.d.cts} +1 -1
  32. package/dist/{spark-dM7EYXYQ.d.ts → spark-BbUrbvZz.d.ts} +1 -1
  33. package/dist/spark-wallet-BAFPpPtY.d.cts +923 -0
  34. package/dist/spark-wallet-CJkQW8pK.d.ts +923 -0
  35. package/dist/spark_bindings/native/index.d.cts +1 -1
  36. package/dist/spark_bindings/native/index.d.ts +1 -1
  37. package/dist/spark_bindings/wasm/index.d.cts +1 -1
  38. package/dist/spark_bindings/wasm/index.d.ts +1 -1
  39. package/dist/{services/index.cjs → tests/test-utils.cjs} +2512 -4380
  40. package/dist/tests/test-utils.d.cts +79 -0
  41. package/dist/tests/test-utils.d.ts +79 -0
  42. package/dist/tests/test-utils.js +85 -0
  43. package/dist/types/index.d.cts +5 -9
  44. package/dist/types/index.d.ts +5 -9
  45. package/dist/types/index.js +5 -5
  46. package/dist/{types-C-Rp0Oo7.d.cts → types-BADxR3bm.d.cts} +1 -1
  47. package/dist/{types-C-Rp0Oo7.d.ts → types-BADxR3bm.d.ts} +1 -1
  48. package/package.json +7 -35
  49. package/src/graphql/client.ts +59 -20
  50. package/src/index.node.ts +28 -2
  51. package/src/index.ts +31 -1
  52. package/src/native/index.ts +16 -2
  53. package/src/services/config.ts +4 -6
  54. package/src/services/connection.ts +131 -64
  55. package/src/services/lightning.ts +1 -2
  56. package/src/services/token-transactions.ts +7 -7
  57. package/src/services/transfer.ts +1 -1
  58. package/src/services/tree-creation.ts +1 -1
  59. package/src/services/wallet-config.ts +18 -10
  60. package/src/signer/signer.react-native.ts +2 -5
  61. package/src/signer/signer.ts +138 -64
  62. package/src/signer/types.ts +52 -0
  63. package/src/spark-wallet/spark-wallet.ts +79 -36
  64. package/src/spark-wallet/types.ts +4 -4
  65. package/src/tests/integration/coop-exit.test.ts +2 -1
  66. package/src/tests/integration/lightning.test.ts +2 -2
  67. package/src/tests/integration/swap.test.ts +1 -1
  68. package/src/tests/integration/transfer.test.ts +5 -5
  69. package/src/tests/integration/tree-creation.test.ts +1 -1
  70. package/src/tests/integration/wallet.test.ts +1 -0
  71. package/src/tests/isHermeticTest.ts +3 -24
  72. package/src/tests/{test-util.ts → test-utils.ts} +3 -7
  73. package/src/tests/wrapWithOtelSpan.test.ts +1 -1
  74. package/src/{address → utils}/address.ts +1 -1
  75. package/src/utils/crypto.ts +19 -9
  76. package/src/utils/index.ts +2 -0
  77. package/src/utils/network.ts +17 -0
  78. package/src/utils/secret-sharing.ts +1 -2
  79. package/src/utils/signing.ts +1 -1
  80. package/src/utils/token-transactions.ts +3 -3
  81. package/src/utils/unilateral-exit.ts +32 -0
  82. package/src/utils/xchain-address.ts +1 -1
  83. package/dist/BitcoinNetwork-TnABML0T.d.cts +0 -18
  84. package/dist/BitcoinNetwork-TnABML0T.d.ts +0 -18
  85. package/dist/LightningSendFeeEstimateInput-BgOhEAI-.d.cts +0 -10
  86. package/dist/LightningSendFeeEstimateInput-BgOhEAI-.d.ts +0 -10
  87. package/dist/address/index.cjs +0 -458
  88. package/dist/address/index.d.cts +0 -32
  89. package/dist/address/index.d.ts +0 -32
  90. package/dist/address/index.js +0 -17
  91. package/dist/chunk-5FUB65LX.js +0 -838
  92. package/dist/chunk-6264CGDM.js +0 -113
  93. package/dist/chunk-7V6N75CC.js +0 -24
  94. package/dist/chunk-C2S227QR.js +0 -2336
  95. package/dist/chunk-GSI4OLXZ.js +0 -117
  96. package/dist/chunk-GZ5IPPJ2.js +0 -170
  97. package/dist/chunk-HWJWKEIU.js +0 -75
  98. package/dist/chunk-KMUMFYFX.js +0 -137
  99. package/dist/chunk-L3EHBOUX.js +0 -0
  100. package/dist/chunk-NSJF5F5O.js +0 -325
  101. package/dist/chunk-NTFKFRQ2.js +0 -3146
  102. package/dist/chunk-PQN3C2MF.js +0 -1122
  103. package/dist/chunk-QNNSEJ4P.js +0 -232
  104. package/dist/chunk-R5PXJZQS.js +0 -277
  105. package/dist/chunk-VTUGIIWI.js +0 -0
  106. package/dist/chunk-YUPMXTCJ.js +0 -622
  107. package/dist/chunk-Z5HIAYFT.js +0 -84
  108. package/dist/index-B2AwKW5J.d.cts +0 -214
  109. package/dist/index-CJDi1HWc.d.ts +0 -214
  110. package/dist/network-BTJl-Sul.d.ts +0 -46
  111. package/dist/network-CqgsdUF2.d.cts +0 -46
  112. package/dist/services/config.cjs +0 -2354
  113. package/dist/services/config.d.cts +0 -42
  114. package/dist/services/config.d.ts +0 -42
  115. package/dist/services/config.js +0 -17
  116. package/dist/services/connection.cjs +0 -17691
  117. package/dist/services/connection.d.cts +0 -95
  118. package/dist/services/connection.d.ts +0 -95
  119. package/dist/services/connection.js +0 -11
  120. package/dist/services/index.d.cts +0 -21
  121. package/dist/services/index.d.ts +0 -21
  122. package/dist/services/index.js +0 -58
  123. package/dist/services/lrc-connection.cjs +0 -4713
  124. package/dist/services/lrc-connection.d.cts +0 -34
  125. package/dist/services/lrc-connection.d.ts +0 -34
  126. package/dist/services/lrc-connection.js +0 -11
  127. package/dist/services/token-transactions.cjs +0 -2877
  128. package/dist/services/token-transactions.d.cts +0 -75
  129. package/dist/services/token-transactions.d.ts +0 -75
  130. package/dist/services/token-transactions.js +0 -15
  131. package/dist/services/wallet-config.cjs +0 -340
  132. package/dist/services/wallet-config.d.cts +0 -56
  133. package/dist/services/wallet-config.d.ts +0 -56
  134. package/dist/services/wallet-config.js +0 -33
  135. package/dist/signer/signer.cjs +0 -2004
  136. package/dist/signer/signer.d.cts +0 -10
  137. package/dist/signer/signer.d.ts +0 -10
  138. package/dist/signer/signer.js +0 -24
  139. package/dist/signer-BocS_J6B.d.ts +0 -187
  140. package/dist/signer-DKS0AJkw.d.cts +0 -187
  141. package/dist/utils/index.cjs +0 -2947
  142. package/dist/utils/index.d.cts +0 -18
  143. package/dist/utils/index.d.ts +0 -18
  144. package/dist/utils/index.js +0 -157
  145. package/src/address/index.ts +0 -1
  146. package/src/services/lrc-connection.ts +0 -215
@@ -1,16 +1,16 @@
1
- import { HDKey } from '@scure/bip32';
2
1
  import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
3
2
  import { CallOptions } from 'nice-grpc-common';
4
- import { TokenSigner, Receipt, NetworkType as NetworkType$1, MayHaveLrc20WalletApiConfig, LRC20WalletApiConfig, HasLrc20WalletApiConfig, LRCWallet } from '@buildonspark/lrc20-sdk';
3
+ import { NetworkType as NetworkType$1, TokenSigner, Receipt, MayHaveLrc20WalletApiConfig, LRC20WalletApiConfig, HasLrc20WalletApiConfig, LRCWallet } from '@buildonspark/lrc20-sdk';
5
4
  import * as btc from '@scure/btc-signer';
6
- import { Transaction as Transaction$1 } from '@scure/btc-signer';
5
+ import { Transaction } from '@scure/btc-signer';
7
6
  import * as bitcoin from 'bitcoinjs-lib';
8
7
  import { Psbt } from 'bitcoinjs-lib';
8
+ import { TransactionOutput, TransactionInput } from '@scure/btc-signer/psbt';
9
+ import { HDKey } from '@scure/bip32';
9
10
  import { Query } from '@lightsparkdev/core';
10
11
  import { Channel } from 'nice-grpc';
11
12
  import { Channel as Channel$1 } from 'nice-grpc-web';
12
13
  import { EventEmitter } from 'eventemitter3';
13
- import { TransactionOutput, TransactionInput } from '@scure/btc-signer/psbt';
14
14
 
15
15
  declare class SparkSDKError extends Error {
16
16
  readonly context: Record<string, unknown>;
@@ -148,24 +148,24 @@ declare class NotImplementedError extends SparkSDKError {
148
148
  */
149
149
  interface Empty {
150
150
  }
151
- declare const Empty: MessageFns$5<Empty>;
152
- type Builtin$5 = Date | Function | Uint8Array | string | number | boolean | undefined;
153
- type DeepPartial$5<T> = T extends Builtin$5 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$5<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$5<U>> : T extends {
151
+ declare const Empty: MessageFns$4<Empty>;
152
+ type Builtin$4 = Date | Function | Uint8Array | string | number | boolean | undefined;
153
+ type DeepPartial$4<T> = T extends Builtin$4 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$4<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$4<U>> : T extends {
154
154
  $case: string;
155
155
  } ? {
156
- [K in keyof Omit<T, "$case">]?: DeepPartial$5<T[K]>;
156
+ [K in keyof Omit<T, "$case">]?: DeepPartial$4<T[K]>;
157
157
  } & {
158
158
  $case: T["$case"];
159
159
  } : T extends {} ? {
160
- [K in keyof T]?: DeepPartial$5<T[K]>;
160
+ [K in keyof T]?: DeepPartial$4<T[K]>;
161
161
  } : Partial<T>;
162
- interface MessageFns$5<T> {
162
+ interface MessageFns$4<T> {
163
163
  encode(message: T, writer?: BinaryWriter): BinaryWriter;
164
164
  decode(input: BinaryReader | Uint8Array, length?: number): T;
165
165
  fromJSON(object: any): T;
166
166
  toJSON(message: T): unknown;
167
- create(base?: DeepPartial$5<T>): T;
168
- fromPartial(object: DeepPartial$5<T>): T;
167
+ create(base?: DeepPartial$4<T>): T;
168
+ fromPartial(object: DeepPartial$4<T>): T;
169
169
  }
170
170
 
171
171
  declare enum SignatureIntent {
@@ -186,24 +186,24 @@ interface SigningCommitment$1 {
186
186
  /** The public key for binding. 33 bytes. */
187
187
  binding: Uint8Array;
188
188
  }
189
- declare const SigningCommitment$1: MessageFns$4<SigningCommitment$1>;
190
- type Builtin$4 = Date | Function | Uint8Array | string | number | boolean | undefined;
191
- type DeepPartial$4<T> = T extends Builtin$4 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$4<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$4<U>> : T extends {
189
+ declare const SigningCommitment$1: MessageFns$3<SigningCommitment$1>;
190
+ type Builtin$3 = Date | Function | Uint8Array | string | number | boolean | undefined;
191
+ type DeepPartial$3<T> = T extends Builtin$3 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$3<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$3<U>> : T extends {
192
192
  $case: string;
193
193
  } ? {
194
- [K in keyof Omit<T, "$case">]?: DeepPartial$4<T[K]>;
194
+ [K in keyof Omit<T, "$case">]?: DeepPartial$3<T[K]>;
195
195
  } & {
196
196
  $case: T["$case"];
197
197
  } : T extends {} ? {
198
- [K in keyof T]?: DeepPartial$4<T[K]>;
198
+ [K in keyof T]?: DeepPartial$3<T[K]>;
199
199
  } : Partial<T>;
200
- interface MessageFns$4<T> {
200
+ interface MessageFns$3<T> {
201
201
  encode(message: T, writer?: BinaryWriter): BinaryWriter;
202
202
  decode(input: BinaryReader | Uint8Array, length?: number): T;
203
203
  fromJSON(object: any): T;
204
204
  toJSON(message: T): unknown;
205
- create(base?: DeepPartial$4<T>): T;
206
- fromPartial(object: DeepPartial$4<T>): T;
205
+ create(base?: DeepPartial$3<T>): T;
206
+ fromPartial(object: DeepPartial$3<T>): T;
207
207
  }
208
208
 
209
209
  /** Network is the network type of the bitcoin network. */
@@ -265,7 +265,7 @@ declare enum InitiatePreimageSwapRequest_Reason {
265
265
  interface SubscribeToEventsRequest {
266
266
  identityPublicKey: Uint8Array;
267
267
  }
268
- declare const SubscribeToEventsRequest: MessageFns$3<SubscribeToEventsRequest>;
268
+ declare const SubscribeToEventsRequest: MessageFns$2<SubscribeToEventsRequest>;
269
269
  interface SubscribeToEventsResponse {
270
270
  event?: {
271
271
  $case: "transfer";
@@ -278,18 +278,18 @@ interface SubscribeToEventsResponse {
278
278
  connected: ConnectedEvent;
279
279
  } | undefined;
280
280
  }
281
- declare const SubscribeToEventsResponse: MessageFns$3<SubscribeToEventsResponse>;
281
+ declare const SubscribeToEventsResponse: MessageFns$2<SubscribeToEventsResponse>;
282
282
  interface ConnectedEvent {
283
283
  }
284
- declare const ConnectedEvent: MessageFns$3<ConnectedEvent>;
284
+ declare const ConnectedEvent: MessageFns$2<ConnectedEvent>;
285
285
  interface TransferEvent {
286
286
  transfer: Transfer$1 | undefined;
287
287
  }
288
- declare const TransferEvent: MessageFns$3<TransferEvent>;
288
+ declare const TransferEvent: MessageFns$2<TransferEvent>;
289
289
  interface DepositEvent {
290
290
  deposit: TreeNode | undefined;
291
291
  }
292
- declare const DepositEvent: MessageFns$3<DepositEvent>;
292
+ declare const DepositEvent: MessageFns$2<DepositEvent>;
293
293
  /**
294
294
  * DepositAddressProof is the proof of possession of the deposit address.
295
295
  * When a user wants to generate a deposit address, they are sending their public key to the SE,
@@ -309,7 +309,7 @@ interface DepositAddressProof {
309
309
  /** The proof of possession of the signing key piece by the SE. */
310
310
  proofOfPossessionSignature: Uint8Array;
311
311
  }
312
- declare const DepositAddressProof: MessageFns$3<DepositAddressProof>;
312
+ declare const DepositAddressProof: MessageFns$2<DepositAddressProof>;
313
313
  /**
314
314
  * GenerateDepositAddressRequest is the request to generate a deposit address.
315
315
  * The user will send their public key to the SE, and the SE will respond with an address of user's
@@ -327,7 +327,7 @@ interface GenerateDepositAddressRequest {
327
327
  /** Generate static deposit address */
328
328
  isStatic?: boolean | undefined;
329
329
  }
330
- declare const GenerateDepositAddressRequest: MessageFns$3<GenerateDepositAddressRequest>;
330
+ declare const GenerateDepositAddressRequest: MessageFns$2<GenerateDepositAddressRequest>;
331
331
  /** Address is the address of the user's public key + SE's public key. */
332
332
  interface Address {
333
333
  /** The p2tr address of the user's public key + SE's public key. */
@@ -339,12 +339,12 @@ interface Address {
339
339
  /** Is it a static deposit address */
340
340
  isStatic: boolean;
341
341
  }
342
- declare const Address: MessageFns$3<Address>;
342
+ declare const Address: MessageFns$2<Address>;
343
343
  /** GenerateDepositAddressResponse is the response to the request to generate a deposit address. */
344
344
  interface GenerateDepositAddressResponse {
345
345
  depositAddress: Address | undefined;
346
346
  }
347
- declare const GenerateDepositAddressResponse: MessageFns$3<GenerateDepositAddressResponse>;
347
+ declare const GenerateDepositAddressResponse: MessageFns$2<GenerateDepositAddressResponse>;
348
348
  /**
349
349
  * UTXO represents a utxo on the bitcoin network.
350
350
  * The UTXO is used to create a tree on Spark, it can also be an off-chain utxo so that the user
@@ -360,7 +360,7 @@ interface UTXO {
360
360
  /** Transaction ID. Required, but older code may not provide it. */
361
361
  txid: Uint8Array;
362
362
  }
363
- declare const UTXO: MessageFns$3<UTXO>;
363
+ declare const UTXO: MessageFns$2<UTXO>;
364
364
  /**
365
365
  * NodeOutput represents a node on the tree.
366
366
  * This is similar to a UTXO, which is used to create a subtree on Spark. But instead of using
@@ -372,7 +372,7 @@ interface NodeOutput {
372
372
  /** The vout of the raw transaction for the node, which will be used to create the tree. */
373
373
  vout: number;
374
374
  }
375
- declare const NodeOutput: MessageFns$3<NodeOutput>;
375
+ declare const NodeOutput: MessageFns$2<NodeOutput>;
376
376
  /**
377
377
  * SigningJob is the job for signing a transaction.
378
378
  * The signing job is used to sign a bitcoin transaction using Spark FROST.
@@ -385,7 +385,7 @@ interface SigningJob {
385
385
  /** The signing nonce commitment of the user. */
386
386
  signingNonceCommitment: SigningCommitment$1 | undefined;
387
387
  }
388
- declare const SigningJob: MessageFns$3<SigningJob>;
388
+ declare const SigningJob: MessageFns$2<SigningJob>;
389
389
  /** SigningKeyshare is the keyshare information of the SE keyshare group. */
390
390
  interface SigningKeyshare {
391
391
  /** The identifiers of the owners of the keyshare. */
@@ -401,7 +401,7 @@ interface SigningKeyshare {
401
401
  /** The latest update time of the keyshare. */
402
402
  updatedTime: Date | undefined;
403
403
  }
404
- declare const SigningKeyshare: MessageFns$3<SigningKeyshare>;
404
+ declare const SigningKeyshare: MessageFns$2<SigningKeyshare>;
405
405
  /**
406
406
  * SigningResult is the result of the signing job from the SE keyshare group.
407
407
  * It contains all the information for user to sign their part. After user signs, the signature
@@ -423,7 +423,7 @@ interface SigningResult {
423
423
  /** The keyshare information of the SE keyshare group. */
424
424
  signingKeyshare: SigningKeyshare | undefined;
425
425
  }
426
- declare const SigningResult: MessageFns$3<SigningResult>;
426
+ declare const SigningResult: MessageFns$2<SigningResult>;
427
427
  /**
428
428
  * NodeSignatureShares is the signature shares for a node on the tree.
429
429
  * For each tree node, the verifying key stays the same for both transactions.
@@ -444,7 +444,7 @@ interface NodeSignatureShares {
444
444
  /** The signing result of the node's direct from cpfp refund transaction. This transaction is to broadcast for the SO. */
445
445
  directFromCpfpRefundTxSigningResult: SigningResult | undefined;
446
446
  }
447
- declare const NodeSignatureShares: MessageFns$3<NodeSignatureShares>;
447
+ declare const NodeSignatureShares: MessageFns$2<NodeSignatureShares>;
448
448
  /**
449
449
  * NodeSignatures is the final signatures for a node on the tree.
450
450
  * It contains the signature for the node's transaction and refund transaction.
@@ -463,7 +463,7 @@ interface NodeSignatures {
463
463
  /** The final signature of the node's direct from cpfp refund transaction. This transaction is to pay for the watchtower. */
464
464
  directFromCpfpRefundTxSignature: Uint8Array;
465
465
  }
466
- declare const NodeSignatures: MessageFns$3<NodeSignatures>;
466
+ declare const NodeSignatures: MessageFns$2<NodeSignatures>;
467
467
  /** StartTreeCreationRequest is the request to start the tree creation for a tree root node. */
468
468
  interface StartTreeCreationRequest {
469
469
  /** The identity public key of the user. */
@@ -481,7 +481,7 @@ interface StartTreeCreationRequest {
481
481
  /** The signing job for the root node's direct refund transaction */
482
482
  directFromCpfpRefundTxSigningJob: SigningJob | undefined;
483
483
  }
484
- declare const StartTreeCreationRequest: MessageFns$3<StartTreeCreationRequest>;
484
+ declare const StartTreeCreationRequest: MessageFns$2<StartTreeCreationRequest>;
485
485
  /** StartTreeCreationResponse is the response to the request to start the tree creation for a tree root node. */
486
486
  interface StartTreeCreationResponse {
487
487
  /** The id of the tree. */
@@ -489,7 +489,7 @@ interface StartTreeCreationResponse {
489
489
  /** The signature shares for the root node. */
490
490
  rootNodeSignatureShares: NodeSignatureShares | undefined;
491
491
  }
492
- declare const StartTreeCreationResponse: MessageFns$3<StartTreeCreationResponse>;
492
+ declare const StartTreeCreationResponse: MessageFns$2<StartTreeCreationResponse>;
493
493
  /** StartDepositTreeCreationRequest is the request to start the tree creation for a tree root node. */
494
494
  interface StartDepositTreeCreationRequest {
495
495
  /** The identity public key of the user. */
@@ -507,7 +507,7 @@ interface StartDepositTreeCreationRequest {
507
507
  /** The signing job for the root node's direct from cpfp refund transaction. */
508
508
  directFromCpfpRefundTxSigningJob: SigningJob | undefined;
509
509
  }
510
- declare const StartDepositTreeCreationRequest: MessageFns$3<StartDepositTreeCreationRequest>;
510
+ declare const StartDepositTreeCreationRequest: MessageFns$2<StartDepositTreeCreationRequest>;
511
511
  /** StartDepositTreeCreationResponse is the response to the request to start the tree creation for a tree root node. */
512
512
  interface StartDepositTreeCreationResponse {
513
513
  /** The id of the tree. */
@@ -515,7 +515,7 @@ interface StartDepositTreeCreationResponse {
515
515
  /** The signature shares for the root node. */
516
516
  rootNodeSignatureShares: NodeSignatureShares | undefined;
517
517
  }
518
- declare const StartDepositTreeCreationResponse: MessageFns$3<StartDepositTreeCreationResponse>;
518
+ declare const StartDepositTreeCreationResponse: MessageFns$2<StartDepositTreeCreationResponse>;
519
519
  /**
520
520
  * This proto is constructed by the wallet to specify leaves it wants to spend as
521
521
  * part of the token transaction.
@@ -524,11 +524,11 @@ interface TokenOutputToSpend$1 {
524
524
  prevTokenTransactionHash: Uint8Array;
525
525
  prevTokenTransactionVout: number;
526
526
  }
527
- declare const TokenOutputToSpend$1: MessageFns$3<TokenOutputToSpend$1>;
527
+ declare const TokenOutputToSpend$1: MessageFns$2<TokenOutputToSpend$1>;
528
528
  interface TokenTransferInput$1 {
529
529
  outputsToSpend: TokenOutputToSpend$1[];
530
530
  }
531
- declare const TokenTransferInput$1: MessageFns$3<TokenTransferInput$1>;
531
+ declare const TokenTransferInput$1: MessageFns$2<TokenTransferInput$1>;
532
532
  interface TokenMintInput$1 {
533
533
  issuerPublicKey: Uint8Array;
534
534
  /**
@@ -543,7 +543,7 @@ interface TokenMintInput$1 {
543
543
  issuerProvidedTimestamp: number;
544
544
  tokenIdentifier?: Uint8Array | undefined;
545
545
  }
546
- declare const TokenMintInput$1: MessageFns$3<TokenMintInput$1>;
546
+ declare const TokenMintInput$1: MessageFns$2<TokenMintInput$1>;
547
547
  interface TokenCreateInput$1 {
548
548
  issuerPublicKey: Uint8Array;
549
549
  tokenName: string;
@@ -554,13 +554,13 @@ interface TokenCreateInput$1 {
554
554
  isFreezable: boolean;
555
555
  creationEntityPublicKey?: Uint8Array | undefined;
556
556
  }
557
- declare const TokenCreateInput$1: MessageFns$3<TokenCreateInput$1>;
557
+ declare const TokenCreateInput$1: MessageFns$2<TokenCreateInput$1>;
558
558
  /**
559
559
  * This proto is constructed by the wallet to specify outputs it wants to create
560
560
  * as part of a token transaction. Output id and revocation public key should remain unfilled
561
561
  * so that the SE can fill them as part of the StartTokenTransaction() call.
562
562
  */
563
- interface TokenOutput$2 {
563
+ interface TokenOutput$1 {
564
564
  id?: string | undefined;
565
565
  ownerPublicKey: Uint8Array;
566
566
  revocationCommitment?: Uint8Array | undefined;
@@ -571,7 +571,7 @@ interface TokenOutput$2 {
571
571
  /** Decoded uint128 */
572
572
  tokenAmount: Uint8Array;
573
573
  }
574
- declare const TokenOutput$2: MessageFns$3<TokenOutput$2>;
574
+ declare const TokenOutput$1: MessageFns$2<TokenOutput$1>;
575
575
  /**
576
576
  * This proto is constructed by the wallet and is the core transaction data structure.
577
577
  * This proto is deterministically hashed to generate the token_transaction_hash that
@@ -588,33 +588,33 @@ interface TokenTransaction$1 {
588
588
  $case: "createInput";
589
589
  createInput: TokenCreateInput$1;
590
590
  } | undefined;
591
- tokenOutputs: TokenOutput$2[];
591
+ tokenOutputs: TokenOutput$1[];
592
592
  sparkOperatorIdentityPublicKeys: Uint8Array[];
593
593
  network: Network$1;
594
594
  }
595
- declare const TokenTransaction$1: MessageFns$3<TokenTransaction$1>;
595
+ declare const TokenTransaction$1: MessageFns$2<TokenTransaction$1>;
596
596
  interface SpentTokenOutputMetadata$1 {
597
597
  outputId: string;
598
598
  revocationSecret: Uint8Array;
599
599
  }
600
- declare const SpentTokenOutputMetadata$1: MessageFns$3<SpentTokenOutputMetadata$1>;
600
+ declare const SpentTokenOutputMetadata$1: MessageFns$2<SpentTokenOutputMetadata$1>;
601
601
  interface TokenTransactionConfirmationMetadata$1 {
602
602
  spentTokenOutputsMetadata: SpentTokenOutputMetadata$1[];
603
603
  }
604
- declare const TokenTransactionConfirmationMetadata$1: MessageFns$3<TokenTransactionConfirmationMetadata$1>;
604
+ declare const TokenTransactionConfirmationMetadata$1: MessageFns$2<TokenTransactionConfirmationMetadata$1>;
605
605
  interface TokenTransactionWithStatus$1 {
606
606
  tokenTransaction: TokenTransaction$1 | undefined;
607
607
  status: TokenTransactionStatus$1;
608
608
  confirmationMetadata: TokenTransactionConfirmationMetadata$1 | undefined;
609
609
  }
610
- declare const TokenTransactionWithStatus$1: MessageFns$3<TokenTransactionWithStatus$1>;
610
+ declare const TokenTransactionWithStatus$1: MessageFns$2<TokenTransactionWithStatus$1>;
611
611
  interface SignatureWithIndex$1 {
612
612
  /** This is a Schnorr or ECDSA DER signature which can be between 64 and 73 bytes. */
613
613
  signature: Uint8Array;
614
614
  /** The index of the TTXO associated with this signature. */
615
615
  inputIndex: number;
616
616
  }
617
- declare const SignatureWithIndex$1: MessageFns$3<SignatureWithIndex$1>;
617
+ declare const SignatureWithIndex$1: MessageFns$2<SignatureWithIndex$1>;
618
618
  interface TokenTransactionSignatures {
619
619
  /**
620
620
  * Filled by signing the partial token transaction hash with the owner/issuer private key.
@@ -623,7 +623,7 @@ interface TokenTransactionSignatures {
623
623
  */
624
624
  ownerSignatures: SignatureWithIndex$1[];
625
625
  }
626
- declare const TokenTransactionSignatures: MessageFns$3<TokenTransactionSignatures>;
626
+ declare const TokenTransactionSignatures: MessageFns$2<TokenTransactionSignatures>;
627
627
  interface StartTokenTransactionRequest {
628
628
  identityPublicKey: Uint8Array;
629
629
  partialTokenTransaction: TokenTransaction$1 | undefined;
@@ -631,7 +631,7 @@ interface StartTokenTransactionRequest {
631
631
  tokenTransactionSignatures: TokenTransactionSignatures | undefined;
632
632
  sparkPaymentIntent: string;
633
633
  }
634
- declare const StartTokenTransactionRequest: MessageFns$3<StartTokenTransactionRequest>;
634
+ declare const StartTokenTransactionRequest: MessageFns$2<StartTokenTransactionRequest>;
635
635
  interface StartTokenTransactionResponse {
636
636
  /**
637
637
  * This is the same token transaction sent by the wallet with output revocation public keys
@@ -644,12 +644,12 @@ interface StartTokenTransactionResponse {
644
644
  */
645
645
  keyshareInfo: SigningKeyshare | undefined;
646
646
  }
647
- declare const StartTokenTransactionResponse: MessageFns$3<StartTokenTransactionResponse>;
647
+ declare const StartTokenTransactionResponse: MessageFns$2<StartTokenTransactionResponse>;
648
648
  interface OperatorSpecificTokenTransactionSignablePayload {
649
649
  finalTokenTransactionHash: Uint8Array;
650
650
  operatorIdentityPublicKey: Uint8Array;
651
651
  }
652
- declare const OperatorSpecificTokenTransactionSignablePayload: MessageFns$3<OperatorSpecificTokenTransactionSignablePayload>;
652
+ declare const OperatorSpecificTokenTransactionSignablePayload: MessageFns$2<OperatorSpecificTokenTransactionSignablePayload>;
653
653
  /**
654
654
  * This message allows the sender of a output being spent to provide final evidence
655
655
  * that it owns a output to an SO when requesting signing and release of the revocation keyshare.
@@ -658,30 +658,30 @@ interface OperatorSpecificOwnerSignature {
658
658
  ownerSignature: SignatureWithIndex$1 | undefined;
659
659
  payload: OperatorSpecificTokenTransactionSignablePayload | undefined;
660
660
  }
661
- declare const OperatorSpecificOwnerSignature: MessageFns$3<OperatorSpecificOwnerSignature>;
661
+ declare const OperatorSpecificOwnerSignature: MessageFns$2<OperatorSpecificOwnerSignature>;
662
662
  interface SignTokenTransactionRequest {
663
663
  finalTokenTransaction: TokenTransaction$1 | undefined;
664
664
  operatorSpecificSignatures: OperatorSpecificOwnerSignature[];
665
665
  identityPublicKey: Uint8Array;
666
666
  }
667
- declare const SignTokenTransactionRequest: MessageFns$3<SignTokenTransactionRequest>;
667
+ declare const SignTokenTransactionRequest: MessageFns$2<SignTokenTransactionRequest>;
668
668
  interface KeyshareWithIndex {
669
669
  /** The index of the input TTXO associated with this keyshare. */
670
670
  inputIndex: number;
671
671
  keyshare: Uint8Array;
672
672
  }
673
- declare const KeyshareWithIndex: MessageFns$3<KeyshareWithIndex>;
673
+ declare const KeyshareWithIndex: MessageFns$2<KeyshareWithIndex>;
674
674
  interface SignTokenTransactionResponse {
675
675
  sparkOperatorSignature: Uint8Array;
676
676
  revocationKeyshares: KeyshareWithIndex[];
677
677
  }
678
- declare const SignTokenTransactionResponse: MessageFns$3<SignTokenTransactionResponse>;
678
+ declare const SignTokenTransactionResponse: MessageFns$2<SignTokenTransactionResponse>;
679
679
  interface RevocationSecretWithIndex {
680
680
  /** The index of the input TTXO associated with this secret. */
681
681
  inputIndex: number;
682
682
  revocationSecret: Uint8Array;
683
683
  }
684
- declare const RevocationSecretWithIndex: MessageFns$3<RevocationSecretWithIndex>;
684
+ declare const RevocationSecretWithIndex: MessageFns$2<RevocationSecretWithIndex>;
685
685
  interface FinalizeTokenTransactionRequest {
686
686
  finalTokenTransaction: TokenTransaction$1 | undefined;
687
687
  /**
@@ -692,8 +692,8 @@ interface FinalizeTokenTransactionRequest {
692
692
  identityPublicKey: Uint8Array;
693
693
  sparkPaymentIntent: string;
694
694
  }
695
- declare const FinalizeTokenTransactionRequest: MessageFns$3<FinalizeTokenTransactionRequest>;
696
- interface FreezeTokensPayload$1 {
695
+ declare const FinalizeTokenTransactionRequest: MessageFns$2<FinalizeTokenTransactionRequest>;
696
+ interface FreezeTokensPayload {
697
697
  ownerPublicKey: Uint8Array;
698
698
  tokenPublicKey: Uint8Array;
699
699
  issuerProvidedTimestamp: number;
@@ -702,19 +702,19 @@ interface FreezeTokensPayload$1 {
702
702
  shouldUnfreeze: boolean;
703
703
  tokenIdentifier?: Uint8Array | undefined;
704
704
  }
705
- declare const FreezeTokensPayload$1: MessageFns$3<FreezeTokensPayload$1>;
706
- interface FreezeTokensRequest$1 {
707
- freezeTokensPayload: FreezeTokensPayload$1 | undefined;
705
+ declare const FreezeTokensPayload: MessageFns$2<FreezeTokensPayload>;
706
+ interface FreezeTokensRequest {
707
+ freezeTokensPayload: FreezeTokensPayload | undefined;
708
708
  /** This is a Schnorr or ECDSA DER signature which can be between 64 and 73 bytes. */
709
709
  issuerSignature: Uint8Array;
710
710
  }
711
- declare const FreezeTokensRequest$1: MessageFns$3<FreezeTokensRequest$1>;
712
- interface FreezeTokensResponse$1 {
711
+ declare const FreezeTokensRequest: MessageFns$2<FreezeTokensRequest>;
712
+ interface FreezeTokensResponse {
713
713
  impactedOutputIds: string[];
714
714
  /** Decoded uint128 */
715
715
  impactedTokenAmount: Uint8Array;
716
716
  }
717
- declare const FreezeTokensResponse$1: MessageFns$3<FreezeTokensResponse$1>;
717
+ declare const FreezeTokensResponse: MessageFns$2<FreezeTokensResponse>;
718
718
  interface QueryTokenOutputsRequest$1 {
719
719
  ownerPublicKeys: Uint8Array[];
720
720
  /** Optionally provide token public keys. If not set return leaves for all tokens. */
@@ -723,7 +723,7 @@ interface QueryTokenOutputsRequest$1 {
723
723
  /** defaults to mainnet when no network is provided. */
724
724
  network: Network$1;
725
725
  }
726
- declare const QueryTokenOutputsRequest$1: MessageFns$3<QueryTokenOutputsRequest$1>;
726
+ declare const QueryTokenOutputsRequest$1: MessageFns$2<QueryTokenOutputsRequest$1>;
727
727
  /** Request constraints are combined using an AND relation. */
728
728
  interface QueryTokenTransactionsRequest$1 {
729
729
  /** Returns transactions that have one of these output ids in the input or output. */
@@ -739,22 +739,22 @@ interface QueryTokenTransactionsRequest$1 {
739
739
  limit: number;
740
740
  offset: number;
741
741
  }
742
- declare const QueryTokenTransactionsRequest$1: MessageFns$3<QueryTokenTransactionsRequest$1>;
742
+ declare const QueryTokenTransactionsRequest$1: MessageFns$2<QueryTokenTransactionsRequest$1>;
743
743
  interface QueryTokenTransactionsResponse$1 {
744
744
  tokenTransactionsWithStatus: TokenTransactionWithStatus$1[];
745
745
  offset: number;
746
746
  }
747
- declare const QueryTokenTransactionsResponse$1: MessageFns$3<QueryTokenTransactionsResponse$1>;
747
+ declare const QueryTokenTransactionsResponse$1: MessageFns$2<QueryTokenTransactionsResponse$1>;
748
748
  interface OutputWithPreviousTransactionData$1 {
749
- output: TokenOutput$2 | undefined;
749
+ output: TokenOutput$1 | undefined;
750
750
  previousTransactionHash: Uint8Array;
751
751
  previousTransactionVout: number;
752
752
  }
753
- declare const OutputWithPreviousTransactionData$1: MessageFns$3<OutputWithPreviousTransactionData$1>;
753
+ declare const OutputWithPreviousTransactionData$1: MessageFns$2<OutputWithPreviousTransactionData$1>;
754
754
  interface QueryTokenOutputsResponse$1 {
755
755
  outputsWithPreviousTransactionData: OutputWithPreviousTransactionData$1[];
756
756
  }
757
- declare const QueryTokenOutputsResponse$1: MessageFns$3<QueryTokenOutputsResponse$1>;
757
+ declare const QueryTokenOutputsResponse$1: MessageFns$2<QueryTokenOutputsResponse$1>;
758
758
  /** TreeNode represents a node on the tree. */
759
759
  interface TreeNode {
760
760
  /** The id of the node. */
@@ -794,7 +794,7 @@ interface TreeNode {
794
794
  /** The refund transaction of the node, this transaction is to pay to the user. */
795
795
  directFromCpfpRefundTx: Uint8Array;
796
796
  }
797
- declare const TreeNode: MessageFns$3<TreeNode>;
797
+ declare const TreeNode: MessageFns$2<TreeNode>;
798
798
  /** FinalizeNodeSignaturesRequest is the request to finalize the signatures for a node. */
799
799
  interface FinalizeNodeSignaturesRequest {
800
800
  /** The intent of the signature. */
@@ -802,13 +802,13 @@ interface FinalizeNodeSignaturesRequest {
802
802
  /** The signatures for the node. */
803
803
  nodeSignatures: NodeSignatures[];
804
804
  }
805
- declare const FinalizeNodeSignaturesRequest: MessageFns$3<FinalizeNodeSignaturesRequest>;
805
+ declare const FinalizeNodeSignaturesRequest: MessageFns$2<FinalizeNodeSignaturesRequest>;
806
806
  /** FinalizeNodeSignaturesResponse is the response to the request to finalize the signatures for a node. */
807
807
  interface FinalizeNodeSignaturesResponse {
808
808
  /** The nodes that are finalized. */
809
809
  nodes: TreeNode[];
810
810
  }
811
- declare const FinalizeNodeSignaturesResponse: MessageFns$3<FinalizeNodeSignaturesResponse>;
811
+ declare const FinalizeNodeSignaturesResponse: MessageFns$2<FinalizeNodeSignaturesResponse>;
812
812
  /**
813
813
  * SecretShare is a secret share of a secret, using Feldman VSS.
814
814
  * The secret share is in the field of secp256k1 scalar field.
@@ -822,14 +822,14 @@ interface SecretShare$1 {
822
822
  */
823
823
  proofs: Uint8Array[];
824
824
  }
825
- declare const SecretShare$1: MessageFns$3<SecretShare$1>;
825
+ declare const SecretShare$1: MessageFns$2<SecretShare$1>;
826
826
  interface LeafRefundTxSigningJob {
827
827
  leafId: string;
828
828
  refundTxSigningJob: SigningJob | undefined;
829
829
  directRefundTxSigningJob: SigningJob | undefined;
830
830
  directFromCpfpRefundTxSigningJob: SigningJob | undefined;
831
831
  }
832
- declare const LeafRefundTxSigningJob: MessageFns$3<LeafRefundTxSigningJob>;
832
+ declare const LeafRefundTxSigningJob: MessageFns$2<LeafRefundTxSigningJob>;
833
833
  interface UserSignedTxSigningJob {
834
834
  leafId: string;
835
835
  signingPublicKey: Uint8Array;
@@ -838,7 +838,7 @@ interface UserSignedTxSigningJob {
838
838
  userSignature: Uint8Array;
839
839
  signingCommitments: SigningCommitments | undefined;
840
840
  }
841
- declare const UserSignedTxSigningJob: MessageFns$3<UserSignedTxSigningJob>;
841
+ declare const UserSignedTxSigningJob: MessageFns$2<UserSignedTxSigningJob>;
842
842
  interface LeafRefundTxSigningResult {
843
843
  leafId: string;
844
844
  refundTxSigningResult: SigningResult | undefined;
@@ -846,7 +846,7 @@ interface LeafRefundTxSigningResult {
846
846
  directRefundTxSigningResult: SigningResult | undefined;
847
847
  directFromCpfpRefundTxSigningResult: SigningResult | undefined;
848
848
  }
849
- declare const LeafRefundTxSigningResult: MessageFns$3<LeafRefundTxSigningResult>;
849
+ declare const LeafRefundTxSigningResult: MessageFns$2<LeafRefundTxSigningResult>;
850
850
  interface StartUserSignedTransferRequest {
851
851
  transferId: string;
852
852
  ownerIdentityPublicKey: Uint8Array;
@@ -856,7 +856,7 @@ interface StartUserSignedTransferRequest {
856
856
  directLeavesToSend: UserSignedTxSigningJob[];
857
857
  directFromCpfpLeavesToSend: UserSignedTxSigningJob[];
858
858
  }
859
- declare const StartUserSignedTransferRequest: MessageFns$3<StartUserSignedTransferRequest>;
859
+ declare const StartUserSignedTransferRequest: MessageFns$2<StartUserSignedTransferRequest>;
860
860
  interface StartTransferRequest {
861
861
  transferId: string;
862
862
  ownerIdentityPublicKey: Uint8Array;
@@ -868,12 +868,12 @@ interface StartTransferRequest {
868
868
  transferPackage: TransferPackage | undefined;
869
869
  sparkPaymentIntent: string;
870
870
  }
871
- declare const StartTransferRequest: MessageFns$3<StartTransferRequest>;
871
+ declare const StartTransferRequest: MessageFns$2<StartTransferRequest>;
872
872
  interface StartTransferResponse {
873
873
  transfer: Transfer$1 | undefined;
874
874
  signingResults: LeafRefundTxSigningResult[];
875
875
  }
876
- declare const StartTransferResponse: MessageFns$3<StartTransferResponse>;
876
+ declare const StartTransferResponse: MessageFns$2<StartTransferResponse>;
877
877
  /**
878
878
  * TransferPackage is a package of leaves to send and key tweaks to send.
879
879
  * This is in the improved send transfer flow where the sender can send the transfer in one call to
@@ -893,7 +893,7 @@ interface TransferPackage {
893
893
  /** The leaves to send, with user signed direct from cpfp refunds and signing package. */
894
894
  directFromCpfpLeavesToSend: UserSignedTxSigningJob[];
895
895
  }
896
- declare const TransferPackage: MessageFns$3<TransferPackage>;
896
+ declare const TransferPackage: MessageFns$2<TransferPackage>;
897
897
  interface SendLeafKeyTweak {
898
898
  leafId: string;
899
899
  secretShareTweak: SecretShare$1 | undefined;
@@ -907,24 +907,24 @@ interface SendLeafKeyTweak {
907
907
  directRefundSignature: Uint8Array;
908
908
  directFromCpfpRefundSignature: Uint8Array;
909
909
  }
910
- declare const SendLeafKeyTweak: MessageFns$3<SendLeafKeyTweak>;
910
+ declare const SendLeafKeyTweak: MessageFns$2<SendLeafKeyTweak>;
911
911
  interface FinalizeTransferRequest {
912
912
  transferId: string;
913
913
  ownerIdentityPublicKey: Uint8Array;
914
914
  leavesToSend: SendLeafKeyTweak[];
915
915
  sparkPaymentIntent: string;
916
916
  }
917
- declare const FinalizeTransferRequest: MessageFns$3<FinalizeTransferRequest>;
917
+ declare const FinalizeTransferRequest: MessageFns$2<FinalizeTransferRequest>;
918
918
  interface FinalizeTransferWithTransferPackageRequest {
919
919
  transferId: string;
920
920
  ownerIdentityPublicKey: Uint8Array;
921
921
  transferPackage: TransferPackage | undefined;
922
922
  }
923
- declare const FinalizeTransferWithTransferPackageRequest: MessageFns$3<FinalizeTransferWithTransferPackageRequest>;
923
+ declare const FinalizeTransferWithTransferPackageRequest: MessageFns$2<FinalizeTransferWithTransferPackageRequest>;
924
924
  interface FinalizeTransferResponse {
925
925
  transfer: Transfer$1 | undefined;
926
926
  }
927
- declare const FinalizeTransferResponse: MessageFns$3<FinalizeTransferResponse>;
927
+ declare const FinalizeTransferResponse: MessageFns$2<FinalizeTransferResponse>;
928
928
  interface Transfer$1 {
929
929
  id: string;
930
930
  senderIdentityPublicKey: Uint8Array;
@@ -937,7 +937,7 @@ interface Transfer$1 {
937
937
  updatedTime: Date | undefined;
938
938
  type: TransferType;
939
939
  }
940
- declare const Transfer$1: MessageFns$3<Transfer$1>;
940
+ declare const Transfer$1: MessageFns$2<Transfer$1>;
941
941
  interface TransferLeaf {
942
942
  leaf: TreeNode | undefined;
943
943
  secretCipher: Uint8Array;
@@ -946,7 +946,7 @@ interface TransferLeaf {
946
946
  intermediateDirectRefundTx: Uint8Array;
947
947
  intermediateDirectFromCpfpRefundTx: Uint8Array;
948
948
  }
949
- declare const TransferLeaf: MessageFns$3<TransferLeaf>;
949
+ declare const TransferLeaf: MessageFns$2<TransferLeaf>;
950
950
  interface TransferFilter {
951
951
  participant?: {
952
952
  $case: "receiverIdentityPublicKey";
@@ -968,12 +968,12 @@ interface TransferFilter {
968
968
  network: Network$1;
969
969
  statuses: TransferStatus[];
970
970
  }
971
- declare const TransferFilter: MessageFns$3<TransferFilter>;
971
+ declare const TransferFilter: MessageFns$2<TransferFilter>;
972
972
  interface QueryTransfersResponse {
973
973
  transfers: Transfer$1[];
974
974
  offset: number;
975
975
  }
976
- declare const QueryTransfersResponse: MessageFns$3<QueryTransfersResponse>;
976
+ declare const QueryTransfersResponse: MessageFns$2<QueryTransfersResponse>;
977
977
  interface ClaimLeafKeyTweak {
978
978
  leafId: string;
979
979
  secretShareTweak: SecretShare$1 | undefined;
@@ -981,23 +981,23 @@ interface ClaimLeafKeyTweak {
981
981
  [key: string]: Uint8Array;
982
982
  };
983
983
  }
984
- declare const ClaimLeafKeyTweak: MessageFns$3<ClaimLeafKeyTweak>;
984
+ declare const ClaimLeafKeyTweak: MessageFns$2<ClaimLeafKeyTweak>;
985
985
  interface ClaimTransferTweakKeysRequest {
986
986
  transferId: string;
987
987
  ownerIdentityPublicKey: Uint8Array;
988
988
  leavesToReceive: ClaimLeafKeyTweak[];
989
989
  }
990
- declare const ClaimTransferTweakKeysRequest: MessageFns$3<ClaimTransferTweakKeysRequest>;
990
+ declare const ClaimTransferTweakKeysRequest: MessageFns$2<ClaimTransferTweakKeysRequest>;
991
991
  interface ClaimTransferSignRefundsRequest {
992
992
  transferId: string;
993
993
  ownerIdentityPublicKey: Uint8Array;
994
994
  signingJobs: LeafRefundTxSigningJob[];
995
995
  }
996
- declare const ClaimTransferSignRefundsRequest: MessageFns$3<ClaimTransferSignRefundsRequest>;
996
+ declare const ClaimTransferSignRefundsRequest: MessageFns$2<ClaimTransferSignRefundsRequest>;
997
997
  interface ClaimTransferSignRefundsResponse {
998
998
  signingResults: LeafRefundTxSigningResult[];
999
999
  }
1000
- declare const ClaimTransferSignRefundsResponse: MessageFns$3<ClaimTransferSignRefundsResponse>;
1000
+ declare const ClaimTransferSignRefundsResponse: MessageFns$2<ClaimTransferSignRefundsResponse>;
1001
1001
  interface StorePreimageShareRequest {
1002
1002
  paymentHash: Uint8Array;
1003
1003
  preimageShare: SecretShare$1 | undefined;
@@ -1005,27 +1005,27 @@ interface StorePreimageShareRequest {
1005
1005
  invoiceString: string;
1006
1006
  userIdentityPublicKey: Uint8Array;
1007
1007
  }
1008
- declare const StorePreimageShareRequest: MessageFns$3<StorePreimageShareRequest>;
1008
+ declare const StorePreimageShareRequest: MessageFns$2<StorePreimageShareRequest>;
1009
1009
  interface RequestedSigningCommitments {
1010
1010
  signingNonceCommitments: {
1011
1011
  [key: string]: SigningCommitment$1;
1012
1012
  };
1013
1013
  }
1014
- declare const RequestedSigningCommitments: MessageFns$3<RequestedSigningCommitments>;
1014
+ declare const RequestedSigningCommitments: MessageFns$2<RequestedSigningCommitments>;
1015
1015
  interface GetSigningCommitmentsRequest {
1016
1016
  nodeIds: string[];
1017
1017
  }
1018
- declare const GetSigningCommitmentsRequest: MessageFns$3<GetSigningCommitmentsRequest>;
1018
+ declare const GetSigningCommitmentsRequest: MessageFns$2<GetSigningCommitmentsRequest>;
1019
1019
  interface GetSigningCommitmentsResponse {
1020
1020
  signingCommitments: RequestedSigningCommitments[];
1021
1021
  }
1022
- declare const GetSigningCommitmentsResponse: MessageFns$3<GetSigningCommitmentsResponse>;
1022
+ declare const GetSigningCommitmentsResponse: MessageFns$2<GetSigningCommitmentsResponse>;
1023
1023
  interface SigningCommitments {
1024
1024
  signingCommitments: {
1025
1025
  [key: string]: SigningCommitment$1;
1026
1026
  };
1027
1027
  }
1028
- declare const SigningCommitments: MessageFns$3<SigningCommitments>;
1028
+ declare const SigningCommitments: MessageFns$2<SigningCommitments>;
1029
1029
  interface UserSignedRefund {
1030
1030
  nodeId: string;
1031
1031
  refundTx: Uint8Array;
@@ -1034,16 +1034,16 @@ interface UserSignedRefund {
1034
1034
  userSignatureCommitment: SigningCommitment$1 | undefined;
1035
1035
  network: Network$1;
1036
1036
  }
1037
- declare const UserSignedRefund: MessageFns$3<UserSignedRefund>;
1037
+ declare const UserSignedRefund: MessageFns$2<UserSignedRefund>;
1038
1038
  interface InvoiceAmountProof {
1039
1039
  bolt11Invoice: string;
1040
1040
  }
1041
- declare const InvoiceAmountProof: MessageFns$3<InvoiceAmountProof>;
1041
+ declare const InvoiceAmountProof: MessageFns$2<InvoiceAmountProof>;
1042
1042
  interface InvoiceAmount {
1043
1043
  valueSats: number;
1044
1044
  invoiceAmountProof: InvoiceAmountProof | undefined;
1045
1045
  }
1046
- declare const InvoiceAmount: MessageFns$3<InvoiceAmount>;
1046
+ declare const InvoiceAmount: MessageFns$2<InvoiceAmount>;
1047
1047
  interface InitiatePreimageSwapRequest {
1048
1048
  paymentHash: Uint8Array;
1049
1049
  invoiceAmount: InvoiceAmount | undefined;
@@ -1052,23 +1052,23 @@ interface InitiatePreimageSwapRequest {
1052
1052
  receiverIdentityPublicKey: Uint8Array;
1053
1053
  feeSats: number;
1054
1054
  }
1055
- declare const InitiatePreimageSwapRequest: MessageFns$3<InitiatePreimageSwapRequest>;
1055
+ declare const InitiatePreimageSwapRequest: MessageFns$2<InitiatePreimageSwapRequest>;
1056
1056
  interface InitiatePreimageSwapResponse {
1057
1057
  preimage: Uint8Array;
1058
1058
  transfer: Transfer$1 | undefined;
1059
1059
  }
1060
- declare const InitiatePreimageSwapResponse: MessageFns$3<InitiatePreimageSwapResponse>;
1060
+ declare const InitiatePreimageSwapResponse: MessageFns$2<InitiatePreimageSwapResponse>;
1061
1061
  interface CooperativeExitRequest {
1062
1062
  transfer: StartTransferRequest | undefined;
1063
1063
  exitId: string;
1064
1064
  exitTxid: Uint8Array;
1065
1065
  }
1066
- declare const CooperativeExitRequest: MessageFns$3<CooperativeExitRequest>;
1066
+ declare const CooperativeExitRequest: MessageFns$2<CooperativeExitRequest>;
1067
1067
  interface CooperativeExitResponse {
1068
1068
  transfer: Transfer$1 | undefined;
1069
1069
  signingResults: LeafRefundTxSigningResult[];
1070
1070
  }
1071
- declare const CooperativeExitResponse: MessageFns$3<CooperativeExitResponse>;
1071
+ declare const CooperativeExitResponse: MessageFns$2<CooperativeExitResponse>;
1072
1072
  interface CounterLeafSwapRequest {
1073
1073
  transfer: StartTransferRequest | undefined;
1074
1074
  swapId: string;
@@ -1076,28 +1076,28 @@ interface CounterLeafSwapRequest {
1076
1076
  directAdaptorPublicKey: Uint8Array;
1077
1077
  directFromCpfpAdaptorPublicKey: Uint8Array;
1078
1078
  }
1079
- declare const CounterLeafSwapRequest: MessageFns$3<CounterLeafSwapRequest>;
1079
+ declare const CounterLeafSwapRequest: MessageFns$2<CounterLeafSwapRequest>;
1080
1080
  interface CounterLeafSwapResponse {
1081
1081
  transfer: Transfer$1 | undefined;
1082
1082
  signingResults: LeafRefundTxSigningResult[];
1083
1083
  }
1084
- declare const CounterLeafSwapResponse: MessageFns$3<CounterLeafSwapResponse>;
1084
+ declare const CounterLeafSwapResponse: MessageFns$2<CounterLeafSwapResponse>;
1085
1085
  interface RefreshTimelockRequest {
1086
1086
  leafId: string;
1087
1087
  ownerIdentityPublicKey: Uint8Array;
1088
1088
  signingJobs: SigningJob[];
1089
1089
  }
1090
- declare const RefreshTimelockRequest: MessageFns$3<RefreshTimelockRequest>;
1090
+ declare const RefreshTimelockRequest: MessageFns$2<RefreshTimelockRequest>;
1091
1091
  interface RefreshTimelockSigningResult {
1092
1092
  signingResult: SigningResult | undefined;
1093
1093
  /** Should maybe just be a part of SigningResult? */
1094
1094
  verifyingKey: Uint8Array;
1095
1095
  }
1096
- declare const RefreshTimelockSigningResult: MessageFns$3<RefreshTimelockSigningResult>;
1096
+ declare const RefreshTimelockSigningResult: MessageFns$2<RefreshTimelockSigningResult>;
1097
1097
  interface RefreshTimelockResponse {
1098
1098
  signingResults: RefreshTimelockSigningResult[];
1099
1099
  }
1100
- declare const RefreshTimelockResponse: MessageFns$3<RefreshTimelockResponse>;
1100
+ declare const RefreshTimelockResponse: MessageFns$2<RefreshTimelockResponse>;
1101
1101
  interface ExtendLeafRequest {
1102
1102
  leafId: string;
1103
1103
  ownerIdentityPublicKey: Uint8Array;
@@ -1107,12 +1107,12 @@ interface ExtendLeafRequest {
1107
1107
  directRefundTxSigningJob: SigningJob | undefined;
1108
1108
  directFromCpfpRefundTxSigningJob: SigningJob | undefined;
1109
1109
  }
1110
- declare const ExtendLeafRequest: MessageFns$3<ExtendLeafRequest>;
1110
+ declare const ExtendLeafRequest: MessageFns$2<ExtendLeafRequest>;
1111
1111
  interface ExtendLeafSigningResult {
1112
1112
  signingResult: SigningResult | undefined;
1113
1113
  verifyingKey: Uint8Array;
1114
1114
  }
1115
- declare const ExtendLeafSigningResult: MessageFns$3<ExtendLeafSigningResult>;
1115
+ declare const ExtendLeafSigningResult: MessageFns$2<ExtendLeafSigningResult>;
1116
1116
  interface ExtendLeafResponse {
1117
1117
  leafId: string;
1118
1118
  nodeTxSigningResult: ExtendLeafSigningResult | undefined;
@@ -1121,12 +1121,12 @@ interface ExtendLeafResponse {
1121
1121
  directRefundTxSigningResult: ExtendLeafSigningResult | undefined;
1122
1122
  directFromCpfpRefundTxSigningResult: ExtendLeafSigningResult | undefined;
1123
1123
  }
1124
- declare const ExtendLeafResponse: MessageFns$3<ExtendLeafResponse>;
1124
+ declare const ExtendLeafResponse: MessageFns$2<ExtendLeafResponse>;
1125
1125
  interface AddressRequestNode {
1126
1126
  userPublicKey: Uint8Array;
1127
1127
  children: AddressRequestNode[];
1128
1128
  }
1129
- declare const AddressRequestNode: MessageFns$3<AddressRequestNode>;
1129
+ declare const AddressRequestNode: MessageFns$2<AddressRequestNode>;
1130
1130
  interface PrepareTreeAddressRequest {
1131
1131
  source?: {
1132
1132
  $case: "parentNodeOutput";
@@ -1142,16 +1142,16 @@ interface PrepareTreeAddressRequest {
1142
1142
  node: AddressRequestNode | undefined;
1143
1143
  userIdentityPublicKey: Uint8Array;
1144
1144
  }
1145
- declare const PrepareTreeAddressRequest: MessageFns$3<PrepareTreeAddressRequest>;
1145
+ declare const PrepareTreeAddressRequest: MessageFns$2<PrepareTreeAddressRequest>;
1146
1146
  interface AddressNode {
1147
1147
  address: Address | undefined;
1148
1148
  children: AddressNode[];
1149
1149
  }
1150
- declare const AddressNode: MessageFns$3<AddressNode>;
1150
+ declare const AddressNode: MessageFns$2<AddressNode>;
1151
1151
  interface PrepareTreeAddressResponse {
1152
1152
  node: AddressNode | undefined;
1153
1153
  }
1154
- declare const PrepareTreeAddressResponse: MessageFns$3<PrepareTreeAddressResponse>;
1154
+ declare const PrepareTreeAddressResponse: MessageFns$2<PrepareTreeAddressResponse>;
1155
1155
  interface CreationNode {
1156
1156
  /** This is the cpfp tx that spends the parent node's output. */
1157
1157
  nodeTxSigningJob: SigningJob | undefined;
@@ -1166,7 +1166,7 @@ interface CreationNode {
1166
1166
  /** The direct from cpfp refund tx can only exist if there's no children. */
1167
1167
  directFromCpfpRefundTxSigningJob: SigningJob | undefined;
1168
1168
  }
1169
- declare const CreationNode: MessageFns$3<CreationNode>;
1169
+ declare const CreationNode: MessageFns$2<CreationNode>;
1170
1170
  interface CreateTreeRequest {
1171
1171
  source?: {
1172
1172
  $case: "parentNodeOutput";
@@ -1180,7 +1180,7 @@ interface CreateTreeRequest {
1180
1180
  /** The owner of the tree. */
1181
1181
  userIdentityPublicKey: Uint8Array;
1182
1182
  }
1183
- declare const CreateTreeRequest: MessageFns$3<CreateTreeRequest>;
1183
+ declare const CreateTreeRequest: MessageFns$2<CreateTreeRequest>;
1184
1184
  interface CreationResponseNode {
1185
1185
  nodeId: string;
1186
1186
  nodeTxSigningResult: SigningResult | undefined;
@@ -1190,52 +1190,52 @@ interface CreationResponseNode {
1190
1190
  directRefundTxSigningResult: SigningResult | undefined;
1191
1191
  directFromCpfpRefundTxSigningResult: SigningResult | undefined;
1192
1192
  }
1193
- declare const CreationResponseNode: MessageFns$3<CreationResponseNode>;
1193
+ declare const CreationResponseNode: MessageFns$2<CreationResponseNode>;
1194
1194
  interface CreateTreeResponse {
1195
1195
  node: CreationResponseNode | undefined;
1196
1196
  }
1197
- declare const CreateTreeResponse: MessageFns$3<CreateTreeResponse>;
1197
+ declare const CreateTreeResponse: MessageFns$2<CreateTreeResponse>;
1198
1198
  interface SigningOperatorInfo {
1199
1199
  index: number;
1200
1200
  identifier: string;
1201
1201
  publicKey: Uint8Array;
1202
1202
  address: string;
1203
1203
  }
1204
- declare const SigningOperatorInfo: MessageFns$3<SigningOperatorInfo>;
1204
+ declare const SigningOperatorInfo: MessageFns$2<SigningOperatorInfo>;
1205
1205
  interface GetSigningOperatorListResponse {
1206
1206
  signingOperators: {
1207
1207
  [key: string]: SigningOperatorInfo;
1208
1208
  };
1209
1209
  }
1210
- declare const GetSigningOperatorListResponse: MessageFns$3<GetSigningOperatorListResponse>;
1210
+ declare const GetSigningOperatorListResponse: MessageFns$2<GetSigningOperatorListResponse>;
1211
1211
  interface QueryUserSignedRefundsRequest {
1212
1212
  paymentHash: Uint8Array;
1213
1213
  identityPublicKey: Uint8Array;
1214
1214
  }
1215
- declare const QueryUserSignedRefundsRequest: MessageFns$3<QueryUserSignedRefundsRequest>;
1215
+ declare const QueryUserSignedRefundsRequest: MessageFns$2<QueryUserSignedRefundsRequest>;
1216
1216
  interface QueryUserSignedRefundsResponse {
1217
1217
  userSignedRefunds: UserSignedRefund[];
1218
1218
  }
1219
- declare const QueryUserSignedRefundsResponse: MessageFns$3<QueryUserSignedRefundsResponse>;
1219
+ declare const QueryUserSignedRefundsResponse: MessageFns$2<QueryUserSignedRefundsResponse>;
1220
1220
  interface ProvidePreimageRequest {
1221
1221
  paymentHash: Uint8Array;
1222
1222
  preimage: Uint8Array;
1223
1223
  identityPublicKey: Uint8Array;
1224
1224
  }
1225
- declare const ProvidePreimageRequest: MessageFns$3<ProvidePreimageRequest>;
1225
+ declare const ProvidePreimageRequest: MessageFns$2<ProvidePreimageRequest>;
1226
1226
  interface ProvidePreimageResponse {
1227
1227
  transfer: Transfer$1 | undefined;
1228
1228
  }
1229
- declare const ProvidePreimageResponse: MessageFns$3<ProvidePreimageResponse>;
1229
+ declare const ProvidePreimageResponse: MessageFns$2<ProvidePreimageResponse>;
1230
1230
  interface ReturnLightningPaymentRequest {
1231
1231
  paymentHash: Uint8Array;
1232
1232
  userIdentityPublicKey: Uint8Array;
1233
1233
  }
1234
- declare const ReturnLightningPaymentRequest: MessageFns$3<ReturnLightningPaymentRequest>;
1234
+ declare const ReturnLightningPaymentRequest: MessageFns$2<ReturnLightningPaymentRequest>;
1235
1235
  interface TreeNodeIds {
1236
1236
  nodeIds: string[];
1237
1237
  }
1238
- declare const TreeNodeIds: MessageFns$3<TreeNodeIds>;
1238
+ declare const TreeNodeIds: MessageFns$2<TreeNodeIds>;
1239
1239
  interface QueryNodesRequest {
1240
1240
  source?: {
1241
1241
  $case: "ownerIdentityPubkey";
@@ -1250,23 +1250,23 @@ interface QueryNodesRequest {
1250
1250
  /** defaults to mainnet when no network is provided. Does not check network when querying by node_ids */
1251
1251
  network: Network$1;
1252
1252
  }
1253
- declare const QueryNodesRequest: MessageFns$3<QueryNodesRequest>;
1253
+ declare const QueryNodesRequest: MessageFns$2<QueryNodesRequest>;
1254
1254
  interface QueryNodesResponse {
1255
1255
  nodes: {
1256
1256
  [key: string]: TreeNode;
1257
1257
  };
1258
1258
  offset: number;
1259
1259
  }
1260
- declare const QueryNodesResponse: MessageFns$3<QueryNodesResponse>;
1260
+ declare const QueryNodesResponse: MessageFns$2<QueryNodesResponse>;
1261
1261
  interface CancelTransferRequest {
1262
1262
  transferId: string;
1263
1263
  senderIdentityPublicKey: Uint8Array;
1264
1264
  }
1265
- declare const CancelTransferRequest: MessageFns$3<CancelTransferRequest>;
1265
+ declare const CancelTransferRequest: MessageFns$2<CancelTransferRequest>;
1266
1266
  interface CancelTransferResponse {
1267
1267
  transfer: Transfer$1 | undefined;
1268
1268
  }
1269
- declare const CancelTransferResponse: MessageFns$3<CancelTransferResponse>;
1269
+ declare const CancelTransferResponse: MessageFns$2<CancelTransferResponse>;
1270
1270
  /**
1271
1271
  * Returns a list of addresses that can be used in express deposit flow.
1272
1272
  * Excludes static deposit addresses.
@@ -1280,7 +1280,7 @@ interface QueryUnusedDepositAddressesRequest {
1280
1280
  /** defaults to 0 if not set. */
1281
1281
  offset: number;
1282
1282
  }
1283
- declare const QueryUnusedDepositAddressesRequest: MessageFns$3<QueryUnusedDepositAddressesRequest>;
1283
+ declare const QueryUnusedDepositAddressesRequest: MessageFns$2<QueryUnusedDepositAddressesRequest>;
1284
1284
  interface QueryStaticDepositAddressesRequest {
1285
1285
  identityPublicKey: Uint8Array;
1286
1286
  /** defaults to mainnet when no network is provided. */
@@ -1288,37 +1288,45 @@ interface QueryStaticDepositAddressesRequest {
1288
1288
  limit: number;
1289
1289
  offset: number;
1290
1290
  }
1291
- declare const QueryStaticDepositAddressesRequest: MessageFns$3<QueryStaticDepositAddressesRequest>;
1291
+ declare const QueryStaticDepositAddressesRequest: MessageFns$2<QueryStaticDepositAddressesRequest>;
1292
1292
  interface DepositAddressQueryResult {
1293
1293
  depositAddress: string;
1294
1294
  userSigningPublicKey: Uint8Array;
1295
1295
  verifyingPublicKey: Uint8Array;
1296
1296
  leafId?: string | undefined;
1297
1297
  }
1298
- declare const DepositAddressQueryResult: MessageFns$3<DepositAddressQueryResult>;
1298
+ declare const DepositAddressQueryResult: MessageFns$2<DepositAddressQueryResult>;
1299
1299
  interface QueryUnusedDepositAddressesResponse {
1300
1300
  depositAddresses: DepositAddressQueryResult[];
1301
1301
  /** defaults to -1 if there are no more results */
1302
1302
  offset: number;
1303
1303
  }
1304
- declare const QueryUnusedDepositAddressesResponse: MessageFns$3<QueryUnusedDepositAddressesResponse>;
1304
+ declare const QueryUnusedDepositAddressesResponse: MessageFns$2<QueryUnusedDepositAddressesResponse>;
1305
1305
  interface QueryStaticDepositAddressesResponse {
1306
1306
  depositAddresses: DepositAddressQueryResult[];
1307
1307
  }
1308
- declare const QueryStaticDepositAddressesResponse: MessageFns$3<QueryStaticDepositAddressesResponse>;
1308
+ declare const QueryStaticDepositAddressesResponse: MessageFns$2<QueryStaticDepositAddressesResponse>;
1309
1309
  interface QueryBalanceRequest {
1310
1310
  identityPublicKey: Uint8Array;
1311
1311
  /** defaults to mainnet when no network is provided. */
1312
1312
  network: Network$1;
1313
1313
  }
1314
- declare const QueryBalanceRequest: MessageFns$3<QueryBalanceRequest>;
1314
+ declare const QueryBalanceRequest: MessageFns$2<QueryBalanceRequest>;
1315
1315
  interface QueryBalanceResponse {
1316
1316
  balance: number;
1317
1317
  nodeBalances: {
1318
1318
  [key: string]: number;
1319
1319
  };
1320
1320
  }
1321
- declare const QueryBalanceResponse: MessageFns$3<QueryBalanceResponse>;
1321
+ declare const QueryBalanceResponse: MessageFns$2<QueryBalanceResponse>;
1322
+ interface PaymentIntentFields {
1323
+ id: Uint8Array;
1324
+ assetIdentifier?: Uint8Array | undefined;
1325
+ /** variable length uint128 */
1326
+ assetAmount: Uint8Array;
1327
+ memo?: string | undefined;
1328
+ }
1329
+ declare const PaymentIntentFields: MessageFns$2<PaymentIntentFields>;
1322
1330
  interface InitiateUtxoSwapRequest {
1323
1331
  onChainUtxo: UTXO | undefined;
1324
1332
  requestType: UtxoSwapRequestType;
@@ -1334,157 +1342,265 @@ interface InitiateUtxoSwapRequest {
1334
1342
  transfer: StartTransferRequest | undefined;
1335
1343
  spendTxSigningJob: SigningJob | undefined;
1336
1344
  }
1337
- declare const InitiateUtxoSwapRequest: MessageFns$3<InitiateUtxoSwapRequest>;
1345
+ declare const InitiateUtxoSwapRequest: MessageFns$2<InitiateUtxoSwapRequest>;
1338
1346
  interface InitiateUtxoSwapResponse {
1339
1347
  spendTxSigningResult: SigningResult | undefined;
1340
1348
  transfer: Transfer$1 | undefined;
1341
1349
  depositAddress: DepositAddressQueryResult | undefined;
1342
1350
  }
1343
- declare const InitiateUtxoSwapResponse: MessageFns$3<InitiateUtxoSwapResponse>;
1351
+ declare const InitiateUtxoSwapResponse: MessageFns$2<InitiateUtxoSwapResponse>;
1344
1352
  interface ExitingTree {
1345
1353
  treeId: string;
1346
1354
  userSigningCommitment: SigningCommitment$1 | undefined;
1347
1355
  vin: number;
1348
1356
  }
1349
- declare const ExitingTree: MessageFns$3<ExitingTree>;
1357
+ declare const ExitingTree: MessageFns$2<ExitingTree>;
1350
1358
  interface ExitSingleNodeTreeSigningResult {
1351
1359
  treeId: string;
1352
1360
  signingResult: SigningResult | undefined;
1353
1361
  verifyingKey: Uint8Array;
1354
1362
  }
1355
- declare const ExitSingleNodeTreeSigningResult: MessageFns$3<ExitSingleNodeTreeSigningResult>;
1363
+ declare const ExitSingleNodeTreeSigningResult: MessageFns$2<ExitSingleNodeTreeSigningResult>;
1356
1364
  interface BitcoinTransactionOutput {
1357
1365
  value: number;
1358
1366
  pkScript: Uint8Array;
1359
1367
  }
1360
- declare const BitcoinTransactionOutput: MessageFns$3<BitcoinTransactionOutput>;
1368
+ declare const BitcoinTransactionOutput: MessageFns$2<BitcoinTransactionOutput>;
1361
1369
  interface ExitSingleNodeTreesRequest {
1362
1370
  ownerIdentityPublicKey: Uint8Array;
1363
1371
  exitingTrees: ExitingTree[];
1364
1372
  rawTx: Uint8Array;
1365
1373
  previousOutputs: BitcoinTransactionOutput[];
1366
1374
  }
1367
- declare const ExitSingleNodeTreesRequest: MessageFns$3<ExitSingleNodeTreesRequest>;
1375
+ declare const ExitSingleNodeTreesRequest: MessageFns$2<ExitSingleNodeTreesRequest>;
1368
1376
  interface ExitSingleNodeTreesResponse {
1369
1377
  signingResults: ExitSingleNodeTreeSigningResult[];
1370
1378
  }
1371
- declare const ExitSingleNodeTreesResponse: MessageFns$3<ExitSingleNodeTreesResponse>;
1379
+ declare const ExitSingleNodeTreesResponse: MessageFns$2<ExitSingleNodeTreesResponse>;
1372
1380
  interface QueryNodesDistributionRequest {
1373
1381
  ownerIdentityPublicKey: Uint8Array;
1374
1382
  }
1375
- declare const QueryNodesDistributionRequest: MessageFns$3<QueryNodesDistributionRequest>;
1383
+ declare const QueryNodesDistributionRequest: MessageFns$2<QueryNodesDistributionRequest>;
1376
1384
  interface QueryNodesDistributionResponse {
1377
1385
  nodeDistribution: {
1378
1386
  [key: number]: number;
1379
1387
  };
1380
1388
  }
1381
- declare const QueryNodesDistributionResponse: MessageFns$3<QueryNodesDistributionResponse>;
1389
+ declare const QueryNodesDistributionResponse: MessageFns$2<QueryNodesDistributionResponse>;
1382
1390
  interface QueryNodesByValueRequest {
1383
1391
  ownerIdentityPublicKey: Uint8Array;
1384
1392
  value: number;
1385
1393
  offset: number;
1386
1394
  limit: number;
1387
1395
  }
1388
- declare const QueryNodesByValueRequest: MessageFns$3<QueryNodesByValueRequest>;
1396
+ declare const QueryNodesByValueRequest: MessageFns$2<QueryNodesByValueRequest>;
1389
1397
  interface QueryNodesByValueResponse {
1390
1398
  nodes: {
1391
1399
  [key: string]: TreeNode;
1392
1400
  };
1393
1401
  offset: number;
1394
1402
  }
1395
- declare const QueryNodesByValueResponse: MessageFns$3<QueryNodesByValueResponse>;
1396
- interface SparkServiceClient$1<CallOptionsExt = {}> {
1397
- generate_deposit_address(request: DeepPartial$3<GenerateDepositAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GenerateDepositAddressResponse>;
1398
- start_deposit_tree_creation(request: DeepPartial$3<StartDepositTreeCreationRequest>, options?: CallOptions & CallOptionsExt): Promise<StartDepositTreeCreationResponse>;
1403
+ declare const QueryNodesByValueResponse: MessageFns$2<QueryNodesByValueResponse>;
1404
+ interface SparkServiceClient<CallOptionsExt = {}> {
1405
+ generate_deposit_address(request: DeepPartial$2<GenerateDepositAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GenerateDepositAddressResponse>;
1406
+ start_deposit_tree_creation(request: DeepPartial$2<StartDepositTreeCreationRequest>, options?: CallOptions & CallOptionsExt): Promise<StartDepositTreeCreationResponse>;
1399
1407
  /**
1400
1408
  * This is deprecated, please use start_deposit_tree_creation instead.
1401
1409
  *
1402
1410
  * @deprecated
1403
1411
  */
1404
- start_tree_creation(request: DeepPartial$3<StartTreeCreationRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTreeCreationResponse>;
1405
- finalize_node_signatures(request: DeepPartial$3<FinalizeNodeSignaturesRequest>, options?: CallOptions & CallOptionsExt): Promise<FinalizeNodeSignaturesResponse>;
1406
- start_transfer(request: DeepPartial$3<StartTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransferResponse>;
1412
+ start_tree_creation(request: DeepPartial$2<StartTreeCreationRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTreeCreationResponse>;
1413
+ finalize_node_signatures(request: DeepPartial$2<FinalizeNodeSignaturesRequest>, options?: CallOptions & CallOptionsExt): Promise<FinalizeNodeSignaturesResponse>;
1414
+ start_transfer(request: DeepPartial$2<StartTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransferResponse>;
1407
1415
  /**
1408
1416
  * This is deprecated, please use finalize_transfer_with_transfer_package instead.
1409
1417
  *
1410
1418
  * @deprecated
1411
1419
  */
1412
- finalize_transfer(request: DeepPartial$3<FinalizeTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<FinalizeTransferResponse>;
1413
- finalize_transfer_with_transfer_package(request: DeepPartial$3<FinalizeTransferWithTransferPackageRequest>, options?: CallOptions & CallOptionsExt): Promise<FinalizeTransferResponse>;
1414
- cancel_transfer(request: DeepPartial$3<CancelTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<CancelTransferResponse>;
1415
- query_pending_transfers(request: DeepPartial$3<TransferFilter>, options?: CallOptions & CallOptionsExt): Promise<QueryTransfersResponse>;
1416
- query_all_transfers(request: DeepPartial$3<TransferFilter>, options?: CallOptions & CallOptionsExt): Promise<QueryTransfersResponse>;
1417
- claim_transfer_tweak_keys(request: DeepPartial$3<ClaimTransferTweakKeysRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
1418
- claim_transfer_sign_refunds(request: DeepPartial$3<ClaimTransferSignRefundsRequest>, options?: CallOptions & CallOptionsExt): Promise<ClaimTransferSignRefundsResponse>;
1419
- store_preimage_share(request: DeepPartial$3<StorePreimageShareRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
1420
- get_signing_commitments(request: DeepPartial$3<GetSigningCommitmentsRequest>, options?: CallOptions & CallOptionsExt): Promise<GetSigningCommitmentsResponse>;
1421
- cooperative_exit(request: DeepPartial$3<CooperativeExitRequest>, options?: CallOptions & CallOptionsExt): Promise<CooperativeExitResponse>;
1422
- initiate_preimage_swap(request: DeepPartial$3<InitiatePreimageSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<InitiatePreimageSwapResponse>;
1423
- provide_preimage(request: DeepPartial$3<ProvidePreimageRequest>, options?: CallOptions & CallOptionsExt): Promise<ProvidePreimageResponse>;
1420
+ finalize_transfer(request: DeepPartial$2<FinalizeTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<FinalizeTransferResponse>;
1421
+ finalize_transfer_with_transfer_package(request: DeepPartial$2<FinalizeTransferWithTransferPackageRequest>, options?: CallOptions & CallOptionsExt): Promise<FinalizeTransferResponse>;
1422
+ cancel_transfer(request: DeepPartial$2<CancelTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<CancelTransferResponse>;
1423
+ query_pending_transfers(request: DeepPartial$2<TransferFilter>, options?: CallOptions & CallOptionsExt): Promise<QueryTransfersResponse>;
1424
+ query_all_transfers(request: DeepPartial$2<TransferFilter>, options?: CallOptions & CallOptionsExt): Promise<QueryTransfersResponse>;
1425
+ claim_transfer_tweak_keys(request: DeepPartial$2<ClaimTransferTweakKeysRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
1426
+ claim_transfer_sign_refunds(request: DeepPartial$2<ClaimTransferSignRefundsRequest>, options?: CallOptions & CallOptionsExt): Promise<ClaimTransferSignRefundsResponse>;
1427
+ store_preimage_share(request: DeepPartial$2<StorePreimageShareRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
1428
+ get_signing_commitments(request: DeepPartial$2<GetSigningCommitmentsRequest>, options?: CallOptions & CallOptionsExt): Promise<GetSigningCommitmentsResponse>;
1429
+ cooperative_exit(request: DeepPartial$2<CooperativeExitRequest>, options?: CallOptions & CallOptionsExt): Promise<CooperativeExitResponse>;
1430
+ initiate_preimage_swap(request: DeepPartial$2<InitiatePreimageSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<InitiatePreimageSwapResponse>;
1431
+ provide_preimage(request: DeepPartial$2<ProvidePreimageRequest>, options?: CallOptions & CallOptionsExt): Promise<ProvidePreimageResponse>;
1424
1432
  /**
1425
1433
  * This is the exact same as start_transfer, but expresses to the SO
1426
1434
  * this transfer is specifically for a leaf swap.
1427
1435
  */
1428
- start_leaf_swap(request: DeepPartial$3<StartTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransferResponse>;
1436
+ start_leaf_swap(request: DeepPartial$2<StartTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransferResponse>;
1429
1437
  /**
1430
1438
  * This is deprecated, please use counter_leaf_swap instead.
1431
1439
  *
1432
1440
  * @deprecated
1433
1441
  */
1434
- leaf_swap(request: DeepPartial$3<CounterLeafSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<CounterLeafSwapResponse>;
1442
+ leaf_swap(request: DeepPartial$2<CounterLeafSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<CounterLeafSwapResponse>;
1435
1443
  /**
1436
1444
  * This is the exact same as start_leaf_swap, but signs with
1437
1445
  * an adaptor public key after a counterparty has begun the swap via start_leaf_swap.
1438
1446
  */
1439
- counter_leaf_swap(request: DeepPartial$3<CounterLeafSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<CounterLeafSwapResponse>;
1440
- refresh_timelock(request: DeepPartial$3<RefreshTimelockRequest>, options?: CallOptions & CallOptionsExt): Promise<RefreshTimelockResponse>;
1441
- extend_leaf(request: DeepPartial$3<ExtendLeafRequest>, options?: CallOptions & CallOptionsExt): Promise<ExtendLeafResponse>;
1442
- prepare_tree_address(request: DeepPartial$3<PrepareTreeAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<PrepareTreeAddressResponse>;
1443
- create_tree(request: DeepPartial$3<CreateTreeRequest>, options?: CallOptions & CallOptionsExt): Promise<CreateTreeResponse>;
1444
- get_signing_operator_list(request: DeepPartial$3<Empty>, options?: CallOptions & CallOptionsExt): Promise<GetSigningOperatorListResponse>;
1445
- query_nodes(request: DeepPartial$3<QueryNodesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryNodesResponse>;
1446
- query_nodes_distribution(request: DeepPartial$3<QueryNodesDistributionRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryNodesDistributionResponse>;
1447
- query_nodes_by_value(request: DeepPartial$3<QueryNodesByValueRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryNodesByValueResponse>;
1448
- query_balance(request: DeepPartial$3<QueryBalanceRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryBalanceResponse>;
1449
- query_user_signed_refunds(request: DeepPartial$3<QueryUserSignedRefundsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryUserSignedRefundsResponse>;
1447
+ counter_leaf_swap(request: DeepPartial$2<CounterLeafSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<CounterLeafSwapResponse>;
1448
+ refresh_timelock(request: DeepPartial$2<RefreshTimelockRequest>, options?: CallOptions & CallOptionsExt): Promise<RefreshTimelockResponse>;
1449
+ extend_leaf(request: DeepPartial$2<ExtendLeafRequest>, options?: CallOptions & CallOptionsExt): Promise<ExtendLeafResponse>;
1450
+ prepare_tree_address(request: DeepPartial$2<PrepareTreeAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<PrepareTreeAddressResponse>;
1451
+ create_tree(request: DeepPartial$2<CreateTreeRequest>, options?: CallOptions & CallOptionsExt): Promise<CreateTreeResponse>;
1452
+ get_signing_operator_list(request: DeepPartial$2<Empty>, options?: CallOptions & CallOptionsExt): Promise<GetSigningOperatorListResponse>;
1453
+ query_nodes(request: DeepPartial$2<QueryNodesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryNodesResponse>;
1454
+ query_nodes_distribution(request: DeepPartial$2<QueryNodesDistributionRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryNodesDistributionResponse>;
1455
+ query_nodes_by_value(request: DeepPartial$2<QueryNodesByValueRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryNodesByValueResponse>;
1456
+ query_balance(request: DeepPartial$2<QueryBalanceRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryBalanceResponse>;
1457
+ query_user_signed_refunds(request: DeepPartial$2<QueryUserSignedRefundsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryUserSignedRefundsResponse>;
1450
1458
  /** Token RPCs */
1451
- start_token_transaction(request: DeepPartial$3<StartTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTokenTransactionResponse>;
1452
- sign_token_transaction(request: DeepPartial$3<SignTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<SignTokenTransactionResponse>;
1453
- finalize_token_transaction(request: DeepPartial$3<FinalizeTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
1454
- freeze_tokens(request: DeepPartial$3<FreezeTokensRequest$1>, options?: CallOptions & CallOptionsExt): Promise<FreezeTokensResponse$1>;
1455
- query_token_outputs(request: DeepPartial$3<QueryTokenOutputsRequest$1>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse$1>;
1456
- query_token_transactions(request: DeepPartial$3<QueryTokenTransactionsRequest$1>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse$1>;
1457
- return_lightning_payment(request: DeepPartial$3<ReturnLightningPaymentRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
1458
- query_unused_deposit_addresses(request: DeepPartial$3<QueryUnusedDepositAddressesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryUnusedDepositAddressesResponse>;
1459
- query_static_deposit_addresses(request: DeepPartial$3<QueryStaticDepositAddressesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryStaticDepositAddressesResponse>;
1460
- subscribe_to_events(request: DeepPartial$3<SubscribeToEventsRequest>, options?: CallOptions & CallOptionsExt): AsyncIterable<SubscribeToEventsResponse>;
1459
+ start_token_transaction(request: DeepPartial$2<StartTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTokenTransactionResponse>;
1460
+ sign_token_transaction(request: DeepPartial$2<SignTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<SignTokenTransactionResponse>;
1461
+ finalize_token_transaction(request: DeepPartial$2<FinalizeTokenTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
1462
+ freeze_tokens(request: DeepPartial$2<FreezeTokensRequest>, options?: CallOptions & CallOptionsExt): Promise<FreezeTokensResponse>;
1463
+ query_token_outputs(request: DeepPartial$2<QueryTokenOutputsRequest$1>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse$1>;
1464
+ query_token_transactions(request: DeepPartial$2<QueryTokenTransactionsRequest$1>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse$1>;
1465
+ return_lightning_payment(request: DeepPartial$2<ReturnLightningPaymentRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
1466
+ query_unused_deposit_addresses(request: DeepPartial$2<QueryUnusedDepositAddressesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryUnusedDepositAddressesResponse>;
1467
+ query_static_deposit_addresses(request: DeepPartial$2<QueryStaticDepositAddressesRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryStaticDepositAddressesResponse>;
1468
+ subscribe_to_events(request: DeepPartial$2<SubscribeToEventsRequest>, options?: CallOptions & CallOptionsExt): AsyncIterable<SubscribeToEventsResponse>;
1461
1469
  /** Claim a deposit to a static address from SSP side */
1462
- initiate_utxo_swap(request: DeepPartial$3<InitiateUtxoSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<InitiateUtxoSwapResponse>;
1463
- exit_single_node_trees(request: DeepPartial$3<ExitSingleNodeTreesRequest>, options?: CallOptions & CallOptionsExt): Promise<ExitSingleNodeTreesResponse>;
1470
+ initiate_utxo_swap(request: DeepPartial$2<InitiateUtxoSwapRequest>, options?: CallOptions & CallOptionsExt): Promise<InitiateUtxoSwapResponse>;
1471
+ exit_single_node_trees(request: DeepPartial$2<ExitSingleNodeTreesRequest>, options?: CallOptions & CallOptionsExt): Promise<ExitSingleNodeTreesResponse>;
1464
1472
  }
1465
- type Builtin$3 = Date | Function | Uint8Array | string | number | boolean | undefined;
1466
- type DeepPartial$3<T> = T extends Builtin$3 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$3<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$3<U>> : T extends {
1473
+ type Builtin$2 = Date | Function | Uint8Array | string | number | boolean | undefined;
1474
+ type DeepPartial$2<T> = T extends Builtin$2 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$2<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$2<U>> : T extends {
1467
1475
  $case: string;
1468
1476
  } ? {
1469
- [K in keyof Omit<T, "$case">]?: DeepPartial$3<T[K]>;
1477
+ [K in keyof Omit<T, "$case">]?: DeepPartial$2<T[K]>;
1470
1478
  } & {
1471
1479
  $case: T["$case"];
1472
1480
  } : T extends {} ? {
1473
- [K in keyof T]?: DeepPartial$3<T[K]>;
1481
+ [K in keyof T]?: DeepPartial$2<T[K]>;
1474
1482
  } : Partial<T>;
1475
- interface MessageFns$3<T> {
1483
+ interface MessageFns$2<T> {
1476
1484
  encode(message: T, writer?: BinaryWriter): BinaryWriter;
1477
1485
  decode(input: BinaryReader | Uint8Array, length?: number): T;
1478
1486
  fromJSON(object: any): T;
1479
1487
  toJSON(message: T): unknown;
1480
- create(base?: DeepPartial$3<T>): T;
1481
- fromPartial(object: DeepPartial$3<T>): T;
1488
+ create(base?: DeepPartial$2<T>): T;
1489
+ fromPartial(object: DeepPartial$2<T>): T;
1482
1490
  }
1483
1491
 
1484
- interface ISigningCommitment {
1485
- hiding: Uint8Array;
1486
- binding: Uint8Array;
1492
+ /** This is an enum identifying a particular Bitcoin Network. **/
1493
+ declare enum BitcoinNetwork {
1494
+ /**
1495
+ * This is an enum value that represents values that could be added in the future.
1496
+ * Clients should support unknown values as more of them could be added without notice.
1497
+ */
1498
+ FUTURE_VALUE = "FUTURE_VALUE",
1499
+ /** The production version of the Bitcoin Blockchain. **/
1500
+ MAINNET = "MAINNET",
1501
+ /** A test version of the Bitcoin Blockchain, maintained by Lightspark. **/
1502
+ REGTEST = "REGTEST",
1503
+ /** A test version of the Bitcoin Blockchain, maintained by a centralized organization. Not in use at Lightspark. **/
1504
+ SIGNET = "SIGNET",
1505
+ /** A test version of the Bitcoin Blockchain, publicly available. **/
1506
+ TESTNET = "TESTNET"
1507
+ }
1508
+
1509
+ declare enum Network {
1510
+ MAINNET = 0,
1511
+ TESTNET = 1,
1512
+ SIGNET = 2,
1513
+ REGTEST = 3,
1514
+ LOCAL = 4
1515
+ }
1516
+ type NetworkType = keyof typeof Network;
1517
+ declare const NetworkToProto: Record<Network, Network$1>;
1518
+ declare const protoToNetwork: (protoNetwork: Network$1) => Network | undefined;
1519
+ declare const getNetwork: (network: Network) => typeof btc.NETWORK;
1520
+ declare const LRC_WALLET_NETWORK: Readonly<{
1521
+ 0: bitcoin.networks.Network;
1522
+ 1: bitcoin.networks.Network;
1523
+ 2: bitcoin.networks.Network;
1524
+ 3: bitcoin.networks.Network;
1525
+ 4: bitcoin.networks.Network;
1526
+ }>;
1527
+ declare const LRC_WALLET_NETWORK_TYPE: Readonly<{
1528
+ 0: NetworkType$1.MAINNET;
1529
+ 1: NetworkType$1.TESTNET;
1530
+ 2: NetworkType$1.TESTNET;
1531
+ 3: NetworkType$1.REGTEST;
1532
+ 4: NetworkType$1.LOCAL;
1533
+ }>;
1534
+ /**
1535
+ * Utility function to determine the network from a Bitcoin address.
1536
+ *
1537
+ * @param {string} address - The Bitcoin address
1538
+ * @returns {BitcoinNetwork | null} The detected network or null if not detected
1539
+ */
1540
+ declare function getNetworkFromAddress(address: string): BitcoinNetwork.MAINNET | BitcoinNetwork.REGTEST | null;
1541
+ /**
1542
+ * Utility function to get the network enum value from a string.
1543
+ *
1544
+ * @param {string} network - The Bitcoin network to turn into an enum value
1545
+ * @returns {Network} The enum value matching the string
1546
+ */
1547
+ declare function getNetworkFromString(network?: string): Network;
1548
+
1549
+ declare const AddressNetwork: Record<NetworkType, string>;
1550
+ type SparkAddressFormat = `${(typeof AddressNetwork)[keyof typeof AddressNetwork]}1${string}`;
1551
+ interface SparkAddressData {
1552
+ identityPublicKey: string;
1553
+ network: NetworkType;
1554
+ paymentIntentFields?: PaymentIntentFields;
1555
+ }
1556
+ interface DecodedSparkAddressData {
1557
+ identityPublicKey: string;
1558
+ network: NetworkType;
1559
+ paymentIntentFields?: {
1560
+ id: string;
1561
+ assetIdentifier?: string;
1562
+ assetAmount: bigint;
1563
+ memo?: string;
1564
+ };
1487
1565
  }
1566
+ declare function encodeSparkAddress(payload: SparkAddressData): SparkAddressFormat;
1567
+ declare function decodeSparkAddress(address: string, network: NetworkType): DecodedSparkAddressData;
1568
+ declare function isValidSparkAddress(address: string): boolean;
1569
+ declare function isValidPublicKey(publicKey: string): void;
1570
+
1571
+ declare function generateSignatureFromExistingAdaptor(signature: Uint8Array, adaptorPrivateKeyBytes: Uint8Array): Uint8Array;
1572
+ declare function generateAdaptorFromSignature(signature: Uint8Array): {
1573
+ adaptorSignature: Uint8Array;
1574
+ adaptorPrivateKey: Uint8Array;
1575
+ };
1576
+ declare function validateOutboundAdaptorSignature(pubkey: Uint8Array, hash: Uint8Array, signature: Uint8Array, adaptorPubkey: Uint8Array): boolean;
1577
+ declare function applyAdaptorToSignature(pubkey: Uint8Array, hash: Uint8Array, signature: Uint8Array, adaptorPrivateKeyBytes: Uint8Array): Uint8Array;
1578
+
1579
+ declare function computeTaprootKeyNoScript(pubkey: Uint8Array): Uint8Array;
1580
+ declare function getP2TRScriptFromPublicKey(pubKey: Uint8Array, network: Network): Uint8Array;
1581
+ declare function getP2TRAddressFromPublicKey(pubKey: Uint8Array, network: Network): string;
1582
+ declare function getP2TRAddressFromPkScript(pkScript: Uint8Array, network: Network): string;
1583
+ declare function getP2WPKHAddressFromPublicKey(pubKey: Uint8Array, network: Network): string;
1584
+ declare function getTxFromRawTxHex(rawTxHex: string): btc.Transaction;
1585
+ declare function getTxFromRawTxBytes(rawTxBytes: Uint8Array): btc.Transaction;
1586
+ declare function getSigHashFromTx(tx: btc.Transaction, inputIndex: number, prevOutput: TransactionOutput): Uint8Array;
1587
+ declare function getTxId(tx: btc.Transaction): string;
1588
+ declare function getTxIdNoReverse(tx: btc.Transaction): string;
1589
+
1590
+ declare function addPublicKeys(a: Uint8Array, b: Uint8Array): Uint8Array;
1591
+ declare function applyAdditiveTweakToPublicKey(pubkey: Uint8Array, tweak: Uint8Array): Uint8Array<ArrayBufferLike>;
1592
+ declare function subtractPublicKeys(a: Uint8Array, b: Uint8Array): Uint8Array<ArrayBufferLike>;
1593
+ declare function addPrivateKeys(a: Uint8Array, b: Uint8Array): Uint8Array<ArrayBufferLike>;
1594
+ declare function subtractPrivateKeys(a: Uint8Array, b: Uint8Array): Uint8Array<ArrayBufferLike>;
1595
+ declare function sumOfPrivateKeys(keys: Uint8Array[]): Uint8Array<ArrayBufferLike>;
1596
+ declare function lastKeyWithTarget(target: Uint8Array, keys: Uint8Array[]): Uint8Array<ArrayBufferLike>;
1597
+
1598
+ declare function getLatestDepositTxId(address: string): Promise<string | null>;
1599
+ declare function isTxBroadcast(txid: string, baseUrl: string, network?: any): Promise<boolean>;
1600
+
1601
+ declare function proofOfPossessionMessageHashForDepositAddress(userPubkey: Uint8Array, operatorPubkey: Uint8Array, depositAddress: string): Uint8Array;
1602
+
1603
+ declare function collectResponses<T>(responses: PromiseSettledResult<T>[]): T[];
1488
1604
 
1489
1605
  type Polynomial = {
1490
1606
  fieldModulus: bigint;
@@ -1512,6 +1628,11 @@ declare function recoverSecret(shares: VerifiableSecretShare[]): bigint;
1512
1628
  declare function validateShare(share: VerifiableSecretShare): void;
1513
1629
  declare function bigIntToPrivateKey(value: bigint): Uint8Array;
1514
1630
 
1631
+ interface ISigningCommitment {
1632
+ hiding: Uint8Array;
1633
+ binding: Uint8Array;
1634
+ }
1635
+
1515
1636
  type SigningNonce = {
1516
1637
  binding: Uint8Array;
1517
1638
  hiding: Uint8Array;
@@ -1556,6 +1677,24 @@ type KeyPair = {
1556
1677
  privateKey: Uint8Array;
1557
1678
  publicKey: Uint8Array;
1558
1679
  };
1680
+
1681
+ declare function getRandomSigningNonce(): SigningNonce;
1682
+ declare function createSigningNonce(binding: Uint8Array, hiding: Uint8Array): SigningNonce;
1683
+ declare function getSigningCommitmentFromNonce(nonce: SigningNonce): SigningCommitment;
1684
+ declare function encodeSigningNonceToBytes(nonce: SigningNonce): Uint8Array;
1685
+ declare function decodeBytesToSigningNonce(bytes: Uint8Array): SigningNonce;
1686
+ declare function createSigningCommitment(binding: Uint8Array, hiding: Uint8Array): SigningCommitment;
1687
+ declare function encodeSigningCommitmentToBytes(commitment: SigningCommitment): Uint8Array;
1688
+ declare function decodeBytesToSigningCommitment(bytes: Uint8Array): SigningCommitment;
1689
+
1690
+ type HumanReadableTokenIdentifier = `btk1${string}` | `btkrt1${string}` | `btkt1${string}` | `btks1${string}` | `btkl1${string}`;
1691
+ interface HumanReadableTokenIdentifierData {
1692
+ tokenIdentifier: Uint8Array;
1693
+ network: NetworkType;
1694
+ }
1695
+ declare function encodeHumanReadableTokenIdentifier(payload: HumanReadableTokenIdentifierData): HumanReadableTokenIdentifier;
1696
+ declare function decodeHumanReadableTokenIdentifier(humanReadableTokenIdentifier: HumanReadableTokenIdentifier, network: NetworkType): HumanReadableTokenIdentifierData;
1697
+
1559
1698
  interface SparkKeysGenerator {
1560
1699
  deriveKeysFromSeed(seed: Uint8Array, accountNumber: number): Promise<{
1561
1700
  masterPublicKey: Uint8Array;
@@ -1588,7 +1727,7 @@ interface SparkSigner extends TokenSigner {
1588
1727
  signMessageWithPublicKey(message: Uint8Array, publicKey: Uint8Array, compact?: boolean): Promise<Uint8Array>;
1589
1728
  signMessageWithIdentityKey(message: Uint8Array, compact?: boolean): Promise<Uint8Array>;
1590
1729
  validateMessageWithIdentityKey(message: Uint8Array, signature: Uint8Array): Promise<boolean>;
1591
- signTransactionIndex(tx: Transaction$1, index: number, publicKey: Uint8Array): void;
1730
+ signTransactionIndex(tx: Transaction, index: number, publicKey: Uint8Array): void;
1592
1731
  encryptLeafPrivateKeyEcies(receiverPublicKey: Uint8Array, publicKey: Uint8Array): Promise<Uint8Array>;
1593
1732
  decryptEcies(ciphertext: Uint8Array): Promise<Uint8Array>;
1594
1733
  getRandomSigningCommitment(): Promise<SigningCommitment>;
@@ -1647,29 +1786,11 @@ declare class DefaultSparkSigner implements SparkSigner {
1647
1786
  validateMessageWithIdentityKey(message: Uint8Array, signature: Uint8Array): Promise<boolean>;
1648
1787
  signPsbt(psbt: Psbt, input: number, sighashTypes?: number[], receipt?: Receipt): Promise<Psbt>;
1649
1788
  private getReceiptPrivateKey;
1650
- signTransactionIndex(tx: Transaction$1, index: number, publicKey: Uint8Array): void;
1651
- }
1652
-
1653
- declare class ReactNativeSparkSigner extends DefaultSparkSigner {
1654
- signFrost({ message, privateAsPubKey, publicKey, verifyingKey, selfCommitment, statechainCommitments, adaptorPubKey, }: SignFrostParams): Promise<Uint8Array>;
1655
- aggregateFrost({ message, publicKey, verifyingKey, selfCommitment, statechainCommitments, adaptorPubKey, selfSignature, statechainSignatures, statechainPublicKeys, }: AggregateFrostParams): Promise<Uint8Array>;
1789
+ signTransactionIndex(tx: Transaction, index: number, publicKey: Uint8Array): void;
1656
1790
  }
1657
1791
 
1658
- /** This is an enum identifying a particular Bitcoin Network. **/
1659
- declare enum BitcoinNetwork {
1660
- /**
1661
- * This is an enum value that represents values that could be added in the future.
1662
- * Clients should support unknown values as more of them could be added without notice.
1663
- */
1664
- FUTURE_VALUE = "FUTURE_VALUE",
1665
- /** The production version of the Bitcoin Blockchain. **/
1666
- MAINNET = "MAINNET",
1667
- /** A test version of the Bitcoin Blockchain, maintained by Lightspark. **/
1668
- REGTEST = "REGTEST",
1669
- /** A test version of the Bitcoin Blockchain, maintained by a centralized organization. Not in use at Lightspark. **/
1670
- SIGNET = "SIGNET",
1671
- /** A test version of the Bitcoin Blockchain, publicly available. **/
1672
- TESTNET = "TESTNET"
1792
+ interface ClaimStaticDepositOutput {
1793
+ transferId: string;
1673
1794
  }
1674
1795
 
1675
1796
  /** This enum identifies the unit of currency associated with a CurrencyAmount. **/
@@ -1721,19 +1842,38 @@ interface CurrencyAmount {
1721
1842
  preferredCurrencyValueApprox: number;
1722
1843
  }
1723
1844
 
1724
- interface ClaimStaticDepositOutput {
1725
- transferId: string;
1845
+ declare enum ExitSpeed {
1846
+ /**
1847
+ * This is an enum value that represents values that could be added in the future.
1848
+ * Clients should support unknown values as more of them could be added without notice.
1849
+ */
1850
+ FUTURE_VALUE = "FUTURE_VALUE",
1851
+ FAST = "FAST",
1852
+ MEDIUM = "MEDIUM",
1853
+ SLOW = "SLOW"
1726
1854
  }
1727
1855
 
1728
- interface CompleteCoopExitInput {
1729
- userOutboundTransferExternalId: string;
1730
- coopExitRequestId: string;
1856
+ declare enum SparkCoopExitRequestStatus {
1857
+ /**
1858
+ * This is an enum value that represents values that could be added in the future.
1859
+ * Clients should support unknown values as more of them could be added without notice.
1860
+ */
1861
+ FUTURE_VALUE = "FUTURE_VALUE",
1862
+ INITIATED = "INITIATED",
1863
+ INBOUND_TRANSFER_CHECKED = "INBOUND_TRANSFER_CHECKED",
1864
+ TX_SIGNED = "TX_SIGNED",
1865
+ TX_BROADCASTED = "TX_BROADCASTED",
1866
+ WAITING_ON_TX_CONFIRMATIONS = "WAITING_ON_TX_CONFIRMATIONS",
1867
+ SUCCEEDED = "SUCCEEDED",
1868
+ EXPIRED = "EXPIRED",
1869
+ FAILED = "FAILED"
1731
1870
  }
1732
1871
 
1733
- interface CompleteLeavesSwapInput {
1734
- adaptorSecretKey: string;
1735
- userOutboundTransferExternalId: string;
1736
- leavesSwapRequestId: string;
1872
+ interface Leaf {
1873
+ /** The amount of the leaf. **/
1874
+ amount: CurrencyAmount;
1875
+ /** The id of the leaf known at signing operators. **/
1876
+ sparkNodeId: string;
1737
1877
  }
1738
1878
 
1739
1879
  /** This is an object representing information about a page returned by the Lightspark API. For more information, please see the “Pagination” section of our API docs for more information about its usage. **/
@@ -1744,35 +1884,122 @@ interface PageInfo {
1744
1884
  endCursor?: string | undefined;
1745
1885
  }
1746
1886
 
1747
- interface CoopExitFeeEstimate {
1748
- userFee: CurrencyAmount;
1749
- l1BroadcastFee: CurrencyAmount;
1750
- }
1751
-
1752
- interface CoopExitFeeEstimatesInput {
1753
- leafExternalIds: string[];
1754
- withdrawalAddress: string;
1755
- }
1756
-
1757
- interface CoopExitFeeEstimatesOutput {
1758
- speedFast?: CoopExitFeeEstimate | undefined;
1759
- speedMedium?: CoopExitFeeEstimate | undefined;
1760
- speedSlow?: CoopExitFeeEstimate | undefined;
1761
- }
1762
-
1763
- interface CoopExitFeeQuote {
1887
+ interface SparkTransferToLeavesConnection {
1764
1888
  /**
1765
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
1766
- * string.
1889
+ * The total count of objects in this connection, using the current filters. It is different from the
1890
+ * number of objects returned in the current page (in the `entities` field).
1767
1891
  **/
1768
- id: string;
1769
- /** The date and time when the entity was first created. **/
1770
- createdAt: string;
1771
- /** The date and time when the entity was last updated. **/
1772
- updatedAt: string;
1773
- /** The network the coop exit fee quote is on. **/
1774
- network: BitcoinNetwork;
1775
- /** The total currency amount of all the nodes user swapped for the coop exit quote. **/
1892
+ count: number;
1893
+ /** An object that holds pagination information about the objects in this connection. **/
1894
+ pageInfo: PageInfo;
1895
+ /** The leaves for the current page of this connection. **/
1896
+ entities: Leaf[];
1897
+ /** The typename of the object **/
1898
+ typename: string;
1899
+ }
1900
+
1901
+ declare class Transfer {
1902
+ /** The total amount of the transfer. **/
1903
+ readonly totalAmount: CurrencyAmount;
1904
+ /** The id of the transfer known at signing operators. If not set, the transfer hasn't been
1905
+ * initialized. **/
1906
+ readonly sparkId?: string | undefined;
1907
+ /** The user request this transfer belongs to, if there is any **/
1908
+ readonly userRequestId?: string | undefined;
1909
+ constructor(
1910
+ /** The total amount of the transfer. **/
1911
+ totalAmount: CurrencyAmount,
1912
+ /** The id of the transfer known at signing operators. If not set, the transfer hasn't been
1913
+ * initialized. **/
1914
+ sparkId?: string | undefined,
1915
+ /** The user request this transfer belongs to, if there is any **/
1916
+ userRequestId?: string | undefined);
1917
+ getLeaves(client: SspClient, first?: number | undefined, after?: string | undefined): Promise<SparkTransferToLeavesConnection>;
1918
+ toJson(): {
1919
+ transfer_total_amount: any;
1920
+ transfer_spark_id: string | undefined;
1921
+ transfer_user_request: {
1922
+ id: string | undefined;
1923
+ };
1924
+ };
1925
+ }
1926
+
1927
+ interface CoopExitRequest {
1928
+ /**
1929
+ * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
1930
+ * string.
1931
+ **/
1932
+ id: string;
1933
+ /** The date and time when the entity was first created. **/
1934
+ createdAt: string;
1935
+ /** The date and time when the entity was last updated. **/
1936
+ updatedAt: string;
1937
+ /** The network the lightning send request is on. **/
1938
+ network: BitcoinNetwork;
1939
+ /** The fee user pays for the coop exit not including the L1 broadcast fee. **/
1940
+ fee: CurrencyAmount;
1941
+ /** The L1 broadcast fee user pays for the coop exit. **/
1942
+ l1BroadcastFee: CurrencyAmount;
1943
+ /** The status of this coop exit request. **/
1944
+ status: SparkCoopExitRequestStatus;
1945
+ /** The time when the coop exit request expires and the UTXOs are released. **/
1946
+ expiresAt: string;
1947
+ /** The raw connector transaction. **/
1948
+ rawConnectorTransaction: string;
1949
+ /** The raw coop exit L1 transaction. **/
1950
+ rawCoopExitTransaction: string;
1951
+ /** The transaction id of the coop exit transaction. **/
1952
+ coopExitTxid: string;
1953
+ /** The typename of the object **/
1954
+ typename: string;
1955
+ /** The fee quote user requested for this coop exit. **/
1956
+ feeQuoteId?: string | undefined;
1957
+ /** The exit speed user requested for this coop exit. **/
1958
+ exitSpeed?: ExitSpeed | undefined;
1959
+ /** The swap transfer. **/
1960
+ transfer?: Transfer | undefined;
1961
+ }
1962
+
1963
+ interface CompleteCoopExitInput {
1964
+ userOutboundTransferExternalId: string;
1965
+ coopExitRequestId: string;
1966
+ }
1967
+
1968
+ interface CompleteLeavesSwapInput {
1969
+ adaptorSecretKey: string;
1970
+ userOutboundTransferExternalId: string;
1971
+ leavesSwapRequestId: string;
1972
+ }
1973
+
1974
+ interface CoopExitFeeEstimate {
1975
+ userFee: CurrencyAmount;
1976
+ l1BroadcastFee: CurrencyAmount;
1977
+ }
1978
+
1979
+ interface CoopExitFeeEstimatesInput {
1980
+ leafExternalIds: string[];
1981
+ withdrawalAddress: string;
1982
+ }
1983
+
1984
+ interface CoopExitFeeEstimatesOutput {
1985
+ speedFast?: CoopExitFeeEstimate | undefined;
1986
+ speedMedium?: CoopExitFeeEstimate | undefined;
1987
+ speedSlow?: CoopExitFeeEstimate | undefined;
1988
+ }
1989
+
1990
+ interface CoopExitFeeQuote {
1991
+ /**
1992
+ * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
1993
+ * string.
1994
+ **/
1995
+ id: string;
1996
+ /** The date and time when the entity was first created. **/
1997
+ createdAt: string;
1998
+ /** The date and time when the entity was last updated. **/
1999
+ updatedAt: string;
2000
+ /** The network the coop exit fee quote is on. **/
2001
+ network: BitcoinNetwork;
2002
+ /** The total currency amount of all the nodes user swapped for the coop exit quote. **/
1776
2003
  totalAmount: CurrencyAmount;
1777
2004
  /** The fee user pays for the coop exit not including the L1 broadcast fee when exit speed is fast. **/
1778
2005
  userFeeFast: CurrencyAmount;
@@ -1797,31 +2024,22 @@ interface CoopExitFeeQuoteInput {
1797
2024
  withdrawalAddress: string;
1798
2025
  }
1799
2026
 
1800
- declare enum ExitSpeed {
1801
- /**
1802
- * This is an enum value that represents values that could be added in the future.
1803
- * Clients should support unknown values as more of them could be added without notice.
1804
- */
1805
- FUTURE_VALUE = "FUTURE_VALUE",
1806
- FAST = "FAST",
1807
- MEDIUM = "MEDIUM",
1808
- SLOW = "SLOW"
2027
+ interface GetChallengeOutput {
2028
+ protectedChallenge: string;
1809
2029
  }
1810
2030
 
1811
- declare enum SparkCoopExitRequestStatus {
1812
- /**
1813
- * This is an enum value that represents values that could be added in the future.
1814
- * Clients should support unknown values as more of them could be added without notice.
1815
- */
1816
- FUTURE_VALUE = "FUTURE_VALUE",
1817
- INITIATED = "INITIATED",
1818
- INBOUND_TRANSFER_CHECKED = "INBOUND_TRANSFER_CHECKED",
1819
- TX_SIGNED = "TX_SIGNED",
1820
- TX_BROADCASTED = "TX_BROADCASTED",
1821
- WAITING_ON_TX_CONFIRMATIONS = "WAITING_ON_TX_CONFIRMATIONS",
1822
- SUCCEEDED = "SUCCEEDED",
1823
- EXPIRED = "EXPIRED",
1824
- FAILED = "FAILED"
2031
+ interface Invoice {
2032
+ encodedInvoice: string;
2033
+ bitcoinNetwork: BitcoinNetwork;
2034
+ paymentHash: string;
2035
+ amount: CurrencyAmount;
2036
+ createdAt: string;
2037
+ expiresAt: string;
2038
+ memo?: string | undefined;
2039
+ }
2040
+
2041
+ interface LeavesSwapFeeEstimateOutput {
2042
+ feeEstimate: CurrencyAmount;
1825
2043
  }
1826
2044
 
1827
2045
  declare enum SparkLeavesSwapRequestStatus {
@@ -1873,194 +2091,30 @@ interface LeavesSwapRequest {
1873
2091
  /** The typename of the object **/
1874
2092
  typename: string;
1875
2093
  /** The leaves transfer out from user. **/
1876
- outboundTransfer?: Transfer | undefined;
1877
- /** The time when the leaves swap request expires. **/
1878
- expiresAt?: string | undefined;
1879
- }
1880
-
1881
- interface Invoice {
1882
- encodedInvoice: string;
1883
- bitcoinNetwork: BitcoinNetwork;
1884
- paymentHash: string;
1885
- amount: CurrencyAmount;
1886
- createdAt: string;
1887
- expiresAt: string;
1888
- memo?: string | undefined;
1889
- }
1890
-
1891
- declare enum LightningReceiveRequestStatus {
1892
- /**
1893
- * This is an enum value that represents values that could be added in the future.
1894
- * Clients should support unknown values as more of them could be added without notice.
1895
- */
1896
- FUTURE_VALUE = "FUTURE_VALUE",
1897
- INVOICE_CREATED = "INVOICE_CREATED",
1898
- TRANSFER_CREATED = "TRANSFER_CREATED",
1899
- TRANSFER_CREATION_FAILED = "TRANSFER_CREATION_FAILED",
1900
- REFUND_SIGNING_COMMITMENTS_QUERYING_FAILED = "REFUND_SIGNING_COMMITMENTS_QUERYING_FAILED",
1901
- REFUND_SIGNING_FAILED = "REFUND_SIGNING_FAILED",
1902
- PAYMENT_PREIMAGE_RECOVERED = "PAYMENT_PREIMAGE_RECOVERED",
1903
- PAYMENT_PREIMAGE_RECOVERING_FAILED = "PAYMENT_PREIMAGE_RECOVERING_FAILED",
1904
- LIGHTNING_PAYMENT_RECEIVED = "LIGHTNING_PAYMENT_RECEIVED",
1905
- TRANSFER_FAILED = "TRANSFER_FAILED",
1906
- TRANSFER_COMPLETED = "TRANSFER_COMPLETED"
1907
- }
1908
-
1909
- interface LightningReceiveRequest {
1910
- /**
1911
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
1912
- * string.
1913
- **/
1914
- id: string;
1915
- /** The date and time when the entity was first created. **/
1916
- createdAt: string;
1917
- /** The date and time when the entity was last updated. **/
1918
- updatedAt: string;
1919
- /** The network the lightning send request is on. **/
1920
- network: BitcoinNetwork;
1921
- /** The lightning invoice generated to receive lightning payment. **/
1922
- invoice: Invoice;
1923
- /** The status of the request. **/
1924
- status: LightningReceiveRequestStatus;
1925
- /** The typename of the object **/
1926
- typename: string;
1927
- /** The leaves transfer after lightning payment was received. **/
1928
- transfer?: Transfer | undefined;
1929
- /** The payment preimage of the invoice if retrieved from SE. **/
1930
- paymentPreimage?: string | undefined;
1931
- /** The receiver's identity public key if different from owner of the request. **/
1932
- receiverIdentityPublicKey?: string | undefined;
1933
- }
1934
-
1935
- interface LightningSendFeeEstimateOutput {
1936
- feeEstimate: CurrencyAmount;
1937
- }
1938
-
1939
- interface StaticDepositQuoteInput {
1940
- /** The transaction id of the deposit. **/
1941
- transactionId: string;
1942
- /** The output index of the deposit. **/
1943
- outputIndex: number;
1944
- /** The bitcoin network of the deposit. **/
1945
- network: BitcoinNetwork;
1946
- }
1947
-
1948
- interface StaticDepositQuoteOutput {
1949
- /** The transaction id of the deposit. **/
1950
- transactionId: string;
1951
- /** The output index of the deposit. **/
1952
- outputIndex: number;
1953
- /** The bitcoin network of the deposit. **/
1954
- network: BitcoinNetwork;
1955
- /** The amount of sats that will be credited to the user's balance. **/
1956
- creditAmountSats: number;
1957
- /** The signature of the quote. **/
1958
- signature: string;
1959
- }
1960
-
1961
- interface VerifyChallengeOutput {
1962
- validUntil: string;
1963
- sessionToken: string;
1964
- }
1965
-
1966
- interface SspClientOptions {
1967
- baseUrl: string;
1968
- identityPublicKey: string;
1969
- schemaEndpoint?: string;
1970
- }
1971
- interface MayHaveSspClientOptions {
1972
- readonly sspClientOptions?: SspClientOptions;
1973
- }
1974
- interface HasSspClientOptions {
1975
- readonly sspClientOptions: SspClientOptions;
1976
- }
1977
- declare class SspClient {
1978
- private readonly requester;
1979
- private readonly signer;
1980
- private readonly authProvider;
1981
- constructor(config: HasSspClientOptions & {
1982
- signer: SparkSigner;
1983
- });
1984
- executeRawQuery<T>(query: Query<T>, needsAuth?: boolean): Promise<T | null>;
1985
- getSwapFeeEstimate(amountSats: number): Promise<LeavesSwapFeeEstimateOutput | null>;
1986
- getLightningSendFeeEstimate(encodedInvoice: string, amountSats?: number): Promise<LightningSendFeeEstimateOutput | null>;
1987
- getCoopExitFeeEstimate({ leafExternalIds, withdrawalAddress, }: CoopExitFeeEstimatesInput): Promise<CoopExitFeeEstimatesOutput | null>;
1988
- getCurrentUser(): Promise<void>;
1989
- completeCoopExit({ userOutboundTransferExternalId, coopExitRequestId, }: CompleteCoopExitInput): Promise<CoopExitRequest | null>;
1990
- requestCoopExit({ leafExternalIds, withdrawalAddress, idempotencyKey, exitSpeed, feeLeafExternalIds, feeQuoteId, withdrawAll, }: RequestCoopExitInput): Promise<CoopExitRequest | null>;
1991
- requestLightningReceive({ amountSats, network, paymentHash, expirySecs, memo, includeSparkAddress, receiverIdentityPubkey, descriptionHash, }: RequestLightningReceiveInput): Promise<LightningReceiveRequest | null>;
1992
- requestLightningSend({ encodedInvoice, idempotencyKey, amountSats, }: RequestLightningSendInput): Promise<LightningSendRequest | null>;
1993
- requestLeaveSwap({ adaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, targetAmountSatsList, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
1994
- completeLeaveSwap({ adaptorSecretKey, userOutboundTransferExternalId, leavesSwapRequestId, }: CompleteLeavesSwapInput): Promise<LeavesSwapRequest | null>;
1995
- getLightningReceiveRequest(id: string): Promise<LightningReceiveRequest | null>;
1996
- getLightningSendRequest(id: string): Promise<LightningSendRequest | null>;
1997
- getLeaveSwapRequest(id: string): Promise<LeavesSwapRequest | null>;
1998
- getCoopExitRequest(id: string): Promise<CoopExitRequest | null>;
1999
- getClaimDepositQuote({ transactionId, outputIndex, network, }: StaticDepositQuoteInput): Promise<StaticDepositQuoteOutput | null>;
2000
- claimStaticDeposit({ transactionId, outputIndex, network, creditAmountSats, depositSecretKey, signature, sspSignature, }: {
2001
- transactionId: string;
2002
- outputIndex: number;
2003
- network: BitcoinNetwork;
2004
- creditAmountSats: number;
2005
- depositSecretKey: string;
2006
- signature: string;
2007
- sspSignature: string;
2008
- }): Promise<ClaimStaticDepositOutput | null>;
2009
- getTransfer(id: string): Promise<Transfer | null>;
2010
- getChallenge(): Promise<GetChallengeOutput | null>;
2011
- verifyChallenge(signature: string, protectedChallenge: string): Promise<VerifyChallengeOutput | null>;
2012
- authenticate(): Promise<void>;
2013
- getCoopExitFeeQuote({ leafExternalIds, withdrawalAddress, }: CoopExitFeeQuoteInput): Promise<CoopExitFeeQuote | null>;
2014
- }
2015
-
2016
- interface Leaf {
2017
- /** The amount of the leaf. **/
2018
- amount: CurrencyAmount;
2019
- /** The id of the leaf known at signing operators. **/
2020
- sparkNodeId: string;
2021
- }
2022
-
2023
- interface SparkTransferToLeavesConnection {
2024
- /**
2025
- * The total count of objects in this connection, using the current filters. It is different from the
2026
- * number of objects returned in the current page (in the `entities` field).
2027
- **/
2028
- count: number;
2029
- /** An object that holds pagination information about the objects in this connection. **/
2030
- pageInfo: PageInfo;
2031
- /** The leaves for the current page of this connection. **/
2032
- entities: Leaf[];
2033
- /** The typename of the object **/
2034
- typename: string;
2035
- }
2036
-
2037
- declare class Transfer {
2038
- /** The total amount of the transfer. **/
2039
- readonly totalAmount: CurrencyAmount;
2040
- /** The id of the transfer known at signing operators. If not set, the transfer hasn't been
2041
- * initialized. **/
2042
- readonly sparkId?: string | undefined;
2043
- /** The user request this transfer belongs to, if there is any **/
2044
- readonly userRequestId?: string | undefined;
2045
- constructor(
2046
- /** The total amount of the transfer. **/
2047
- totalAmount: CurrencyAmount,
2048
- /** The id of the transfer known at signing operators. If not set, the transfer hasn't been
2049
- * initialized. **/
2050
- sparkId?: string | undefined,
2051
- /** The user request this transfer belongs to, if there is any **/
2052
- userRequestId?: string | undefined);
2053
- getLeaves(client: SspClient, first?: number | undefined, after?: string | undefined): Promise<SparkTransferToLeavesConnection>;
2054
- toJson(): {
2055
- transfer_total_amount: any;
2056
- transfer_spark_id: string | undefined;
2057
- transfer_user_request: {
2058
- id: string | undefined;
2059
- };
2060
- };
2094
+ outboundTransfer?: Transfer | undefined;
2095
+ /** The time when the leaves swap request expires. **/
2096
+ expiresAt?: string | undefined;
2061
2097
  }
2062
2098
 
2063
- interface CoopExitRequest {
2099
+ declare enum LightningReceiveRequestStatus {
2100
+ /**
2101
+ * This is an enum value that represents values that could be added in the future.
2102
+ * Clients should support unknown values as more of them could be added without notice.
2103
+ */
2104
+ FUTURE_VALUE = "FUTURE_VALUE",
2105
+ INVOICE_CREATED = "INVOICE_CREATED",
2106
+ TRANSFER_CREATED = "TRANSFER_CREATED",
2107
+ TRANSFER_CREATION_FAILED = "TRANSFER_CREATION_FAILED",
2108
+ REFUND_SIGNING_COMMITMENTS_QUERYING_FAILED = "REFUND_SIGNING_COMMITMENTS_QUERYING_FAILED",
2109
+ REFUND_SIGNING_FAILED = "REFUND_SIGNING_FAILED",
2110
+ PAYMENT_PREIMAGE_RECOVERED = "PAYMENT_PREIMAGE_RECOVERED",
2111
+ PAYMENT_PREIMAGE_RECOVERING_FAILED = "PAYMENT_PREIMAGE_RECOVERING_FAILED",
2112
+ LIGHTNING_PAYMENT_RECEIVED = "LIGHTNING_PAYMENT_RECEIVED",
2113
+ TRANSFER_FAILED = "TRANSFER_FAILED",
2114
+ TRANSFER_COMPLETED = "TRANSFER_COMPLETED"
2115
+ }
2116
+
2117
+ interface LightningReceiveRequest {
2064
2118
  /**
2065
2119
  * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
2066
2120
  * string.
@@ -2072,36 +2126,18 @@ interface CoopExitRequest {
2072
2126
  updatedAt: string;
2073
2127
  /** The network the lightning send request is on. **/
2074
2128
  network: BitcoinNetwork;
2075
- /** The fee user pays for the coop exit not including the L1 broadcast fee. **/
2076
- fee: CurrencyAmount;
2077
- /** The L1 broadcast fee user pays for the coop exit. **/
2078
- l1BroadcastFee: CurrencyAmount;
2079
- /** The status of this coop exit request. **/
2080
- status: SparkCoopExitRequestStatus;
2081
- /** The time when the coop exit request expires and the UTXOs are released. **/
2082
- expiresAt: string;
2083
- /** The raw connector transaction. **/
2084
- rawConnectorTransaction: string;
2085
- /** The raw coop exit L1 transaction. **/
2086
- rawCoopExitTransaction: string;
2087
- /** The transaction id of the coop exit transaction. **/
2088
- coopExitTxid: string;
2129
+ /** The lightning invoice generated to receive lightning payment. **/
2130
+ invoice: Invoice;
2131
+ /** The status of the request. **/
2132
+ status: LightningReceiveRequestStatus;
2089
2133
  /** The typename of the object **/
2090
2134
  typename: string;
2091
- /** The fee quote user requested for this coop exit. **/
2092
- feeQuoteId?: string | undefined;
2093
- /** The exit speed user requested for this coop exit. **/
2094
- exitSpeed?: ExitSpeed | undefined;
2095
- /** The swap transfer. **/
2135
+ /** The leaves transfer after lightning payment was received. **/
2096
2136
  transfer?: Transfer | undefined;
2097
- }
2098
-
2099
- interface GetChallengeOutput {
2100
- protectedChallenge: string;
2101
- }
2102
-
2103
- interface LeavesSwapFeeEstimateOutput {
2104
- feeEstimate: CurrencyAmount;
2137
+ /** The payment preimage of the invoice if retrieved from SE. **/
2138
+ paymentPreimage?: string | undefined;
2139
+ /** The receiver's identity public key if different from owner of the request. **/
2140
+ receiverIdentityPublicKey?: string | undefined;
2105
2141
  }
2106
2142
 
2107
2143
  interface LightningSendFeeEstimateInput {
@@ -2113,6 +2149,10 @@ interface LightningSendFeeEstimateInput {
2113
2149
  amountSats?: number | undefined;
2114
2150
  }
2115
2151
 
2152
+ interface LightningSendFeeEstimateOutput {
2153
+ feeEstimate: CurrencyAmount;
2154
+ }
2155
+
2116
2156
  declare enum LightningSendRequestStatus {
2117
2157
  /**
2118
2158
  * This is an enum value that represents values that could be added in the future.
@@ -2225,68 +2265,278 @@ interface RequestLightningSendInput {
2225
2265
  amountSats?: number | undefined;
2226
2266
  }
2227
2267
 
2228
- declare enum Network {
2229
- MAINNET = 0,
2230
- TESTNET = 1,
2231
- SIGNET = 2,
2232
- REGTEST = 3,
2233
- LOCAL = 4
2268
+ interface StaticDepositQuoteInput {
2269
+ /** The transaction id of the deposit. **/
2270
+ transactionId: string;
2271
+ /** The output index of the deposit. **/
2272
+ outputIndex: number;
2273
+ /** The bitcoin network of the deposit. **/
2274
+ network: BitcoinNetwork;
2234
2275
  }
2235
- type NetworkType = keyof typeof Network;
2236
- declare const NetworkToProto: Record<Network, Network$1>;
2237
- declare const getNetwork: (network: Network) => typeof btc.NETWORK;
2238
- declare const LRC_WALLET_NETWORK: Readonly<{
2239
- 0: bitcoin.networks.Network;
2240
- 1: bitcoin.networks.Network;
2241
- 2: bitcoin.networks.Network;
2242
- 3: bitcoin.networks.Network;
2243
- 4: bitcoin.networks.Network;
2244
- }>;
2245
- declare const LRC_WALLET_NETWORK_TYPE: Readonly<{
2246
- 0: NetworkType$1.MAINNET;
2247
- 1: NetworkType$1.TESTNET;
2248
- 2: NetworkType$1.TESTNET;
2249
- 3: NetworkType$1.REGTEST;
2250
- 4: NetworkType$1.LOCAL;
2251
- }>;
2276
+
2277
+ interface StaticDepositQuoteOutput {
2278
+ /** The transaction id of the deposit. **/
2279
+ transactionId: string;
2280
+ /** The output index of the deposit. **/
2281
+ outputIndex: number;
2282
+ /** The bitcoin network of the deposit. **/
2283
+ network: BitcoinNetwork;
2284
+ /** The amount of sats that will be credited to the user's balance. **/
2285
+ creditAmountSats: number;
2286
+ /** The signature of the quote. **/
2287
+ signature: string;
2288
+ }
2289
+
2290
+ interface VerifyChallengeOutput {
2291
+ validUntil: string;
2292
+ sessionToken: string;
2293
+ }
2294
+
2295
+ interface SspClientOptions {
2296
+ baseUrl: string;
2297
+ identityPublicKey: string;
2298
+ schemaEndpoint?: string;
2299
+ }
2300
+ interface MayHaveSspClientOptions {
2301
+ readonly sspClientOptions?: SspClientOptions;
2302
+ }
2303
+ interface HasSspClientOptions {
2304
+ readonly sspClientOptions: SspClientOptions;
2305
+ }
2306
+ declare class SspClient {
2307
+ private readonly requester;
2308
+ private readonly signer;
2309
+ private readonly authProvider;
2310
+ private authPromise?;
2311
+ constructor(config: HasSspClientOptions & {
2312
+ signer: SparkSigner;
2313
+ });
2314
+ executeRawQuery<T>(query: Query<T>, needsAuth?: boolean): Promise<T | null>;
2315
+ getSwapFeeEstimate(amountSats: number): Promise<LeavesSwapFeeEstimateOutput | null>;
2316
+ getLightningSendFeeEstimate(encodedInvoice: string, amountSats?: number): Promise<LightningSendFeeEstimateOutput | null>;
2317
+ getCoopExitFeeEstimate({ leafExternalIds, withdrawalAddress, }: CoopExitFeeEstimatesInput): Promise<CoopExitFeeEstimatesOutput | null>;
2318
+ getCurrentUser(): Promise<void>;
2319
+ completeCoopExit({ userOutboundTransferExternalId, coopExitRequestId, }: CompleteCoopExitInput): Promise<CoopExitRequest | null>;
2320
+ requestCoopExit({ leafExternalIds, withdrawalAddress, idempotencyKey, exitSpeed, feeLeafExternalIds, feeQuoteId, withdrawAll, }: RequestCoopExitInput): Promise<CoopExitRequest | null>;
2321
+ requestLightningReceive({ amountSats, network, paymentHash, expirySecs, memo, includeSparkAddress, receiverIdentityPubkey, descriptionHash, }: RequestLightningReceiveInput): Promise<LightningReceiveRequest | null>;
2322
+ requestLightningSend({ encodedInvoice, idempotencyKey, amountSats, }: RequestLightningSendInput): Promise<LightningSendRequest | null>;
2323
+ requestLeaveSwap({ adaptorPubkey, totalAmountSats, targetAmountSats, feeSats, userLeaves, idempotencyKey, targetAmountSatsList, }: RequestLeavesSwapInput): Promise<LeavesSwapRequest | null>;
2324
+ completeLeaveSwap({ adaptorSecretKey, userOutboundTransferExternalId, leavesSwapRequestId, }: CompleteLeavesSwapInput): Promise<LeavesSwapRequest | null>;
2325
+ getLightningReceiveRequest(id: string): Promise<LightningReceiveRequest | null>;
2326
+ getLightningSendRequest(id: string): Promise<LightningSendRequest | null>;
2327
+ getLeaveSwapRequest(id: string): Promise<LeavesSwapRequest | null>;
2328
+ getCoopExitRequest(id: string): Promise<CoopExitRequest | null>;
2329
+ getClaimDepositQuote({ transactionId, outputIndex, network, }: StaticDepositQuoteInput): Promise<StaticDepositQuoteOutput | null>;
2330
+ claimStaticDeposit({ transactionId, outputIndex, network, creditAmountSats, depositSecretKey, signature, sspSignature, }: {
2331
+ transactionId: string;
2332
+ outputIndex: number;
2333
+ network: BitcoinNetwork;
2334
+ creditAmountSats: number;
2335
+ depositSecretKey: string;
2336
+ signature: string;
2337
+ sspSignature: string;
2338
+ }): Promise<ClaimStaticDepositOutput | null>;
2339
+ getTransfer(id: string): Promise<Transfer | null>;
2340
+ getChallenge(): Promise<GetChallengeOutput | null>;
2341
+ verifyChallenge(signature: string, protectedChallenge: string): Promise<VerifyChallengeOutput | null>;
2342
+ authenticate(): Promise<void>;
2343
+ getCoopExitFeeQuote({ leafExternalIds, withdrawalAddress, }: CoopExitFeeQuoteInput): Promise<CoopExitFeeQuote | null>;
2344
+ }
2345
+
2346
+ type SigningOperator = {
2347
+ readonly id: number;
2348
+ readonly identifier: string;
2349
+ readonly address: string;
2350
+ readonly identityPublicKey: string;
2351
+ };
2352
+ type ConfigOptions = MayHaveLrc20WalletApiConfig & MayHaveSspClientOptions & {
2353
+ readonly network?: NetworkType;
2354
+ readonly signingOperators?: Readonly<Record<string, SigningOperator>>;
2355
+ readonly coodinatorIdentifier?: string;
2356
+ readonly frostSignerAddress?: string;
2357
+ readonly lrc20Address?: string;
2358
+ readonly threshold?: number;
2359
+ readonly tokenSignatures?: "ECDSA" | "SCHNORR";
2360
+ readonly tokenValidityDurationSeconds?: number;
2361
+ readonly tokenTransactionVersion?: "V0" | "V1";
2362
+ readonly electrsUrl?: string;
2363
+ readonly lrc20ApiConfig?: LRC20WalletApiConfig;
2364
+ readonly sspClientOptions?: SspClientOptions;
2365
+ readonly expectedWithdrawBondSats?: number;
2366
+ readonly expectedWithdrawRelativeBlockLocktime?: number;
2367
+ };
2368
+ declare const WalletConfig: {
2369
+ LOCAL: Required<ConfigOptions>;
2370
+ LOCAL_SCHNORR: Required<ConfigOptions>;
2371
+ LOCAL_ECDSA: Required<ConfigOptions>;
2372
+ REGTEST: Required<ConfigOptions>;
2373
+ MAINNET: Required<ConfigOptions>;
2374
+ };
2375
+
2376
+ type CreateLightningInvoiceParams = {
2377
+ amountSats: number;
2378
+ memo?: string;
2379
+ expirySeconds?: number;
2380
+ includeSparkAddress?: boolean;
2381
+ receiverIdentityPubkey?: string;
2382
+ descriptionHash?: string;
2383
+ };
2384
+ type PayLightningInvoiceParams = {
2385
+ invoice: string;
2386
+ maxFeeSats: number;
2387
+ preferSpark?: boolean;
2388
+ amountSatsToSend?: number;
2389
+ };
2390
+ type TransferParams = {
2391
+ amountSats: number;
2392
+ receiverSparkAddress: string;
2393
+ };
2394
+ type DepositParams = {
2395
+ signingPubKey: Uint8Array;
2396
+ verifyingKey: Uint8Array;
2397
+ depositTx: Transaction;
2398
+ vout: number;
2399
+ };
2252
2400
  /**
2253
- * Utility function to determine the network from a Bitcoin address.
2401
+ * Token metadata containing essential information about a token.
2402
+ * This is the wallet's internal representation with JavaScript-friendly types.
2254
2403
  *
2255
- * @param {string} address - The Bitcoin address
2256
- * @returns {BitcoinNetwork | null} The detected network or null if not detected
2404
+ * rawTokenIdentifier: This is the raw binary token identifier - This is used to encode the human readable token identifier.
2405
+ *
2406
+ * tokenPublicKey: This is the hex-encoded public key of the token issuer - Same as issuerPublicKey.
2407
+ *
2408
+ * @example
2409
+ * ```typescript
2410
+ * const tokenMetadata: UserTokenMetadata = {
2411
+ * rawTokenIdentifier: new Uint8Array([1, 2, 3]),
2412
+ * tokenPublicKey: "0348fbb...",
2413
+ * tokenName: "SparkToken",
2414
+ * tokenTicker: "SPK",
2415
+ * decimals: 8,
2416
+ * maxSupply: 1000000n
2417
+ * };
2418
+ * ```
2257
2419
  */
2258
- declare function getNetworkFromAddress(address: string): BitcoinNetwork.MAINNET | BitcoinNetwork.REGTEST | null;
2420
+ type UserTokenMetadata = {
2421
+ /** Raw binary token identifier - This is used to encode the human readable token identifier */
2422
+ rawTokenIdentifier: Uint8Array;
2423
+ /** Public key of the token issuer - Same as issuerPublicKey */
2424
+ tokenPublicKey: string;
2425
+ /** Human-readable name of the token (e.g., SparkToken)*/
2426
+ tokenName: string;
2427
+ /** Short ticker symbol for the token (e.g., "SPK") */
2428
+ tokenTicker: string;
2429
+ /** Number of decimal places for token amounts */
2430
+ decimals: number;
2431
+ /** Maximum supply of tokens that can ever be minted */
2432
+ maxSupply: bigint;
2433
+ };
2434
+ type TokenBalanceMap = Map<HumanReadableTokenIdentifier, {
2435
+ balance: bigint;
2436
+ tokenMetadata: UserTokenMetadata;
2437
+ }>;
2438
+ type InitWalletResponse = {
2439
+ mnemonic?: string | undefined;
2440
+ };
2441
+ interface SparkWalletProps {
2442
+ mnemonicOrSeed?: Uint8Array | string;
2443
+ accountNumber?: number;
2444
+ signer?: SparkSigner;
2445
+ options?: ConfigOptions;
2446
+ }
2447
+ interface SparkWalletEvents {
2448
+ /** Emitted when an incoming transfer is successfully claimed. Includes the transfer ID and new total balance. */
2449
+ "transfer:claimed": (transferId: string, updatedBalance: number) => void;
2450
+ /** Emitted when a deposit is marked as available. Includes the deposit ID and new total balance. */
2451
+ "deposit:confirmed": (depositId: string, updatedBalance: number) => void;
2452
+ /** Emitted when the stream is connected */
2453
+ "stream:connected": () => void;
2454
+ /** Emitted when the stream disconnects and fails to reconnect after max attempts */
2455
+ "stream:disconnected": (reason: string) => void;
2456
+ /** Emitted when attempting to reconnect the stream */
2457
+ "stream:reconnecting": (attempt: number, maxAttempts: number, delayMs: number, error: string) => void;
2458
+ }
2459
+
2460
+ declare function sumAvailableTokens(outputs: OutputWithPreviousTransactionData$1[]): bigint;
2461
+ declare function checkIfSelectedOutputsAreAvailable(selectedOutputs: OutputWithPreviousTransactionData$1[], tokenOutputs: Map<string, OutputWithPreviousTransactionData$1[]>, tokenPublicKey: Uint8Array): boolean;
2462
+ declare function filterTokenBalanceForTokenPublicKey(tokenBalances: TokenBalanceMap, publicKey: string): {
2463
+ balance: bigint;
2464
+ };
2465
+
2466
+ declare function getTransferPackageSigningPayload(transferID: string, transferPackage: TransferPackage): Uint8Array;
2467
+
2468
+ declare const DEFAULT_FEE_SATS: number;
2259
2469
  /**
2260
- * Utility function to get the network enum value from a string.
2261
- *
2262
- * @param {string} network - The Bitcoin network to turn into an enum value
2263
- * @returns {Network} The enum value matching the string
2470
+ * Subtracts the default fee from the amount if it's greater than the fee.
2471
+ * Returns the original amount if it's less than or equal to the fee.
2264
2472
  */
2265
- declare function getNetworkFromString(network?: string): Network;
2266
-
2267
- type SigningOperator = {
2268
- readonly id: number;
2269
- readonly identifier: string;
2270
- readonly address: string;
2271
- readonly identityPublicKey: string;
2473
+ declare function maybeApplyFee(amount: bigint): bigint;
2474
+ declare function createRefundTx(sequence: number, nodeOutPoint: TransactionInput, amountSats: bigint, receivingPubkey: Uint8Array, network: Network): Transaction;
2475
+ declare function getCurrentTimelock(currSequence?: number): number;
2476
+ declare function getTransactionSequence(currSequence?: number): number;
2477
+ declare function checkIfValidSequence(currSequence?: number): void;
2478
+ declare function getNextTransactionSequence(currSequence?: number, forRefresh?: boolean): {
2479
+ nextSequence: number;
2480
+ needRefresh: boolean;
2272
2481
  };
2273
- type ConfigOptions = MayHaveLrc20WalletApiConfig & MayHaveSspClientOptions & {
2274
- readonly network?: NetworkType;
2275
- readonly signingOperators?: Readonly<Record<string, SigningOperator>>;
2276
- readonly coodinatorIdentifier?: string;
2277
- readonly frostSignerAddress?: string;
2278
- readonly lrc20Address?: string;
2279
- readonly threshold?: number;
2280
- readonly tokenSignatures?: "ECDSA" | "SCHNORR";
2281
- readonly tokenValidityDurationSeconds?: number;
2282
- readonly tokenTransactionVersion?: "V0" | "V1";
2283
- readonly electrsUrl?: string;
2284
- readonly lrc20ApiConfig?: LRC20WalletApiConfig;
2285
- readonly sspClientOptions?: SspClientOptions;
2286
- readonly expectedWithdrawBondSats?: number;
2287
- readonly expectedWithdrawRelativeBlockLocktime?: number;
2482
+ declare function getEphemeralAnchorOutput(): TransactionOutput;
2483
+
2484
+ interface LeafInfo {
2485
+ leafId: string;
2486
+ nodeTx: string;
2487
+ refundTx: string;
2488
+ }
2489
+ interface Utxo {
2490
+ txid: string;
2491
+ vout: number;
2492
+ value: bigint;
2493
+ script: string;
2494
+ publicKey: string;
2495
+ }
2496
+ interface FeeRate {
2497
+ satPerVbyte: number;
2498
+ }
2499
+ interface FeeBumpTxPackage {
2500
+ tx: string;
2501
+ feeBumpPsbt?: string;
2502
+ }
2503
+ interface FeeBumpTxChain {
2504
+ leafId: string;
2505
+ txPackages: FeeBumpTxPackage[];
2506
+ }
2507
+ interface TxChain {
2508
+ leafId: string;
2509
+ transactions: string[];
2510
+ }
2511
+ interface BroadcastConfig {
2512
+ bitcoinCoreRpcUrl?: string;
2513
+ rpcUsername?: string;
2514
+ rpcPassword?: string;
2515
+ autoBroadcast?: boolean;
2516
+ network?: "MAINNET" | "REGTEST" | "TESTNET" | "SIGNET" | "LOCAL";
2517
+ }
2518
+ interface BroadcastResult {
2519
+ success: boolean;
2520
+ txids?: string[];
2521
+ error?: string;
2522
+ broadcastedPackages?: number;
2523
+ }
2524
+ declare function isEphemeralAnchorOutput(script?: Uint8Array, amount?: bigint): boolean;
2525
+ declare function constructUnilateralExitTxs(nodeHexStrings: string[], sparkClient?: SparkServiceClient, network?: any): Promise<TxChain[]>;
2526
+ declare function constructUnilateralExitFeeBumpPackages(nodeHexStrings: string[], utxos: Utxo[], feeRate: FeeRate, electrsUrl: string, sparkClient?: SparkServiceClient, network?: any): Promise<FeeBumpTxChain[]>;
2527
+ declare function constructFeeBumpTx(txHex: string, utxos: Utxo[], feeRate: FeeRate, previousFeeBumpTx?: string): {
2528
+ feeBumpPsbt: string;
2529
+ usedUtxos: Utxo[];
2530
+ correctedParentTx?: string;
2288
2531
  };
2289
2532
 
2533
+ declare function getSparkAddressFromTaproot(taprootAddress: string): SparkAddressFormat;
2534
+
2535
+ declare class ReactNativeSparkSigner extends DefaultSparkSigner {
2536
+ signFrost({ message, privateAsPubKey, publicKey, verifyingKey, selfCommitment, statechainCommitments, adaptorPubKey, }: SignFrostParams): Promise<Uint8Array>;
2537
+ aggregateFrost({ message, publicKey, verifyingKey, selfCommitment, statechainCommitments, adaptorPubKey, selfSignature, statechainSignatures, statechainPublicKeys, }: AggregateFrostParams): Promise<Uint8Array>;
2538
+ }
2539
+
2290
2540
  declare class WalletConfigService implements HasLrc20WalletApiConfig, HasSspClientOptions {
2291
2541
  private readonly config;
2292
2542
  readonly signer: SparkSigner;
@@ -2321,38 +2571,38 @@ declare enum InterruptTransferRequest_InterruptTransferAction {
2321
2571
  interface CleanUpPreimageShareRequest {
2322
2572
  paymentHash: Uint8Array;
2323
2573
  }
2324
- declare const CleanUpPreimageShareRequest: MessageFns$2<CleanUpPreimageShareRequest>;
2574
+ declare const CleanUpPreimageShareRequest: MessageFns$1<CleanUpPreimageShareRequest>;
2325
2575
  interface InterruptTransferRequest {
2326
2576
  action: InterruptTransferRequest_InterruptTransferAction;
2327
2577
  }
2328
- declare const InterruptTransferRequest: MessageFns$2<InterruptTransferRequest>;
2578
+ declare const InterruptTransferRequest: MessageFns$1<InterruptTransferRequest>;
2329
2579
  interface UpdateNodesStatusRequest {
2330
2580
  nodeIds: string[];
2331
2581
  status: string;
2332
2582
  }
2333
- declare const UpdateNodesStatusRequest: MessageFns$2<UpdateNodesStatusRequest>;
2583
+ declare const UpdateNodesStatusRequest: MessageFns$1<UpdateNodesStatusRequest>;
2334
2584
  interface MockServiceClient<CallOptionsExt = {}> {
2335
- clean_up_preimage_share(request: DeepPartial$2<CleanUpPreimageShareRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2336
- interrupt_transfer(request: DeepPartial$2<InterruptTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2337
- update_nodes_status(request: DeepPartial$2<UpdateNodesStatusRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
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>;
2338
2588
  }
2339
- type Builtin$2 = Date | Function | Uint8Array | string | number | boolean | undefined;
2340
- type DeepPartial$2<T> = T extends Builtin$2 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$2<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$2<U>> : T extends {
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 {
2341
2591
  $case: string;
2342
2592
  } ? {
2343
- [K in keyof Omit<T, "$case">]?: DeepPartial$2<T[K]>;
2593
+ [K in keyof Omit<T, "$case">]?: DeepPartial$1<T[K]>;
2344
2594
  } & {
2345
2595
  $case: T["$case"];
2346
2596
  } : T extends {} ? {
2347
- [K in keyof T]?: DeepPartial$2<T[K]>;
2597
+ [K in keyof T]?: DeepPartial$1<T[K]>;
2348
2598
  } : Partial<T>;
2349
- interface MessageFns$2<T> {
2599
+ interface MessageFns$1<T> {
2350
2600
  encode(message: T, writer?: BinaryWriter): BinaryWriter;
2351
2601
  decode(input: BinaryReader | Uint8Array, length?: number): T;
2352
2602
  fromJSON(object: any): T;
2353
2603
  toJSON(message: T): unknown;
2354
- create(base?: DeepPartial$2<T>): T;
2355
- fromPartial(object: DeepPartial$2<T>): T;
2604
+ create(base?: DeepPartial$1<T>): T;
2605
+ fromPartial(object: DeepPartial$1<T>): T;
2356
2606
  }
2357
2607
 
2358
2608
  declare enum TokenTransactionStatus {
@@ -2373,16 +2623,16 @@ interface TokenOutputToSpend {
2373
2623
  prevTokenTransactionHash: Uint8Array;
2374
2624
  prevTokenTransactionVout: number;
2375
2625
  }
2376
- declare const TokenOutputToSpend: MessageFns$1<TokenOutputToSpend>;
2626
+ declare const TokenOutputToSpend: MessageFns<TokenOutputToSpend>;
2377
2627
  interface TokenTransferInput {
2378
2628
  outputsToSpend: TokenOutputToSpend[];
2379
2629
  }
2380
- declare const TokenTransferInput: MessageFns$1<TokenTransferInput>;
2630
+ declare const TokenTransferInput: MessageFns<TokenTransferInput>;
2381
2631
  interface TokenMintInput {
2382
2632
  issuerPublicKey: Uint8Array;
2383
2633
  tokenIdentifier?: Uint8Array | undefined;
2384
2634
  }
2385
- declare const TokenMintInput: MessageFns$1<TokenMintInput>;
2635
+ declare const TokenMintInput: MessageFns<TokenMintInput>;
2386
2636
  interface TokenCreateInput {
2387
2637
  issuerPublicKey: Uint8Array;
2388
2638
  tokenName: string;
@@ -2393,14 +2643,14 @@ interface TokenCreateInput {
2393
2643
  isFreezable: boolean;
2394
2644
  creationEntityPublicKey?: Uint8Array | undefined;
2395
2645
  }
2396
- declare const TokenCreateInput: MessageFns$1<TokenCreateInput>;
2646
+ declare const TokenCreateInput: MessageFns<TokenCreateInput>;
2397
2647
  /**
2398
2648
  * This proto is constructed by the wallet to specify outputs it wants to create
2399
2649
  * as part of a token transaction. Output id and revocation public key should
2400
2650
  * remain unfilled so that the SE can fill them as part of the
2401
2651
  * StartTokenTransaction() call.
2402
2652
  */
2403
- interface TokenOutput$1 {
2653
+ interface TokenOutput {
2404
2654
  id?: string | undefined;
2405
2655
  ownerPublicKey: Uint8Array;
2406
2656
  revocationCommitment?: Uint8Array | undefined;
@@ -2411,7 +2661,7 @@ interface TokenOutput$1 {
2411
2661
  /** Decoded uint128 */
2412
2662
  tokenAmount: Uint8Array;
2413
2663
  }
2414
- declare const TokenOutput$1: MessageFns$1<TokenOutput$1>;
2664
+ declare const TokenOutput: MessageFns<TokenOutput>;
2415
2665
  /**
2416
2666
  * This proto is constructed by the wallet and is the core transaction data
2417
2667
  * structure. This proto is deterministically hashed to generate the
@@ -2435,7 +2685,7 @@ interface TokenTransaction {
2435
2685
  $case: "createInput";
2436
2686
  createInput: TokenCreateInput;
2437
2687
  } | undefined;
2438
- tokenOutputs: TokenOutput$1[];
2688
+ tokenOutputs: TokenOutput[];
2439
2689
  sparkOperatorIdentityPublicKeys: Uint8Array[];
2440
2690
  /**
2441
2691
  * Server-set expiry time. The server calculates this by adding the client's
@@ -2451,7 +2701,7 @@ interface TokenTransaction {
2451
2701
  */
2452
2702
  clientCreatedTimestamp: Date | undefined;
2453
2703
  }
2454
- declare const TokenTransaction: MessageFns$1<TokenTransaction>;
2704
+ declare const TokenTransaction: MessageFns<TokenTransaction>;
2455
2705
  interface SignatureWithIndex {
2456
2706
  /**
2457
2707
  * This is a Schnorr or ECDSA DER signature which can be between 64 and 73
@@ -2461,7 +2711,7 @@ interface SignatureWithIndex {
2461
2711
  /** The index of the TTXO associated with this signature. */
2462
2712
  inputIndex: number;
2463
2713
  }
2464
- declare const SignatureWithIndex: MessageFns$1<SignatureWithIndex>;
2714
+ declare const SignatureWithIndex: MessageFns<SignatureWithIndex>;
2465
2715
  /**
2466
2716
  * A group of signatures for the input TTXOs binding them to the final token
2467
2717
  * transaction hash. This bundle of signatures is specific to a given operator.
@@ -2470,7 +2720,7 @@ interface InputTtxoSignaturesPerOperator {
2470
2720
  ttxoSignatures: SignatureWithIndex[];
2471
2721
  operatorIdentityPublicKey: Uint8Array;
2472
2722
  }
2473
- declare const InputTtxoSignaturesPerOperator: MessageFns$1<InputTtxoSignaturesPerOperator>;
2723
+ declare const InputTtxoSignaturesPerOperator: MessageFns<InputTtxoSignaturesPerOperator>;
2474
2724
  /** === Start Transaction === */
2475
2725
  interface StartTransactionRequest {
2476
2726
  identityPublicKey: Uint8Array;
@@ -2489,28 +2739,28 @@ interface StartTransactionRequest {
2489
2739
  */
2490
2740
  validityDurationSeconds: number;
2491
2741
  }
2492
- declare const StartTransactionRequest: MessageFns$1<StartTransactionRequest>;
2742
+ declare const StartTransactionRequest: MessageFns<StartTransactionRequest>;
2493
2743
  interface StartTransactionResponse {
2494
2744
  finalTokenTransaction: TokenTransaction | undefined;
2495
2745
  keyshareInfo: SigningKeyshare | undefined;
2496
2746
  }
2497
- declare const StartTransactionResponse: MessageFns$1<StartTransactionResponse>;
2747
+ declare const StartTransactionResponse: MessageFns<StartTransactionResponse>;
2498
2748
  interface CommitTransactionRequest {
2499
2749
  finalTokenTransaction: TokenTransaction | undefined;
2500
2750
  finalTokenTransactionHash: Uint8Array;
2501
2751
  inputTtxoSignaturesPerOperator: InputTtxoSignaturesPerOperator[];
2502
2752
  ownerIdentityPublicKey: Uint8Array;
2503
2753
  }
2504
- declare const CommitTransactionRequest: MessageFns$1<CommitTransactionRequest>;
2754
+ declare const CommitTransactionRequest: MessageFns<CommitTransactionRequest>;
2505
2755
  interface CommitTransactionResponse {
2506
2756
  }
2507
- declare const CommitTransactionResponse: MessageFns$1<CommitTransactionResponse>;
2757
+ declare const CommitTransactionResponse: MessageFns<CommitTransactionResponse>;
2508
2758
  interface QueryTokenMetadataRequest {
2509
2759
  tokenIdentifiers: Uint8Array[];
2510
2760
  issuerPublicKeys: Uint8Array[];
2511
2761
  }
2512
- declare const QueryTokenMetadataRequest: MessageFns$1<QueryTokenMetadataRequest>;
2513
- interface TokenMetadata$1 {
2762
+ declare const QueryTokenMetadataRequest: MessageFns<QueryTokenMetadataRequest>;
2763
+ interface TokenMetadata {
2514
2764
  issuerPublicKey: Uint8Array;
2515
2765
  tokenName: string;
2516
2766
  tokenTicker: string;
@@ -2521,11 +2771,11 @@ interface TokenMetadata$1 {
2521
2771
  creationEntityPublicKey?: Uint8Array | undefined;
2522
2772
  tokenIdentifier: Uint8Array;
2523
2773
  }
2524
- declare const TokenMetadata$1: MessageFns$1<TokenMetadata$1>;
2774
+ declare const TokenMetadata: MessageFns<TokenMetadata>;
2525
2775
  interface QueryTokenMetadataResponse {
2526
- tokenMetadata: TokenMetadata$1[];
2776
+ tokenMetadata: TokenMetadata[];
2527
2777
  }
2528
- declare const QueryTokenMetadataResponse: MessageFns$1<QueryTokenMetadataResponse>;
2778
+ declare const QueryTokenMetadataResponse: MessageFns<QueryTokenMetadataResponse>;
2529
2779
  interface QueryTokenOutputsRequest {
2530
2780
  ownerPublicKeys: Uint8Array[];
2531
2781
  /** Optionally provide issuer public keys or token identifiers. If both are not set return outputs for all tokens. */
@@ -2534,370 +2784,67 @@ interface QueryTokenOutputsRequest {
2534
2784
  /** defaults to mainnet when no network is provided. */
2535
2785
  network: Network$1;
2536
2786
  }
2537
- declare const QueryTokenOutputsRequest: MessageFns$1<QueryTokenOutputsRequest>;
2787
+ declare const QueryTokenOutputsRequest: MessageFns<QueryTokenOutputsRequest>;
2538
2788
  /** Request constraints are combined using an AND relation. */
2539
2789
  interface QueryTokenTransactionsRequest {
2540
2790
  /** Returns transactions that have one of these output ids in the input or output. */
2541
2791
  outputIds: string[];
2542
2792
  /** Returns transactions that have this owner public key as the sender or receiver in one or more of the input/output leaves. */
2543
2793
  ownerPublicKeys: Uint8Array[];
2544
- /** Returns transactions that related to this token public key. */
2545
- issuerPublicKeys: Uint8Array[];
2546
- /** Returns transactions that related to this token identifier. */
2547
- tokenIdentifiers: Uint8Array[];
2548
- /** Returns transactions that match the provided transaction hashes. */
2549
- tokenTransactionHashes: Uint8Array[];
2550
- limit: number;
2551
- offset: number;
2552
- }
2553
- declare const QueryTokenTransactionsRequest: MessageFns$1<QueryTokenTransactionsRequest>;
2554
- interface QueryTokenTransactionsResponse {
2555
- tokenTransactionsWithStatus: TokenTransactionWithStatus[];
2556
- offset: number;
2557
- }
2558
- declare const QueryTokenTransactionsResponse: MessageFns$1<QueryTokenTransactionsResponse>;
2559
- interface OutputWithPreviousTransactionData {
2560
- output: TokenOutput$1 | undefined;
2561
- previousTransactionHash: Uint8Array;
2562
- previousTransactionVout: number;
2563
- }
2564
- declare const OutputWithPreviousTransactionData: MessageFns$1<OutputWithPreviousTransactionData>;
2565
- interface QueryTokenOutputsResponse {
2566
- outputsWithPreviousTransactionData: OutputWithPreviousTransactionData[];
2567
- }
2568
- declare const QueryTokenOutputsResponse: MessageFns$1<QueryTokenOutputsResponse>;
2569
- interface SpentTokenOutputMetadata {
2570
- outputId: string;
2571
- revocationSecret: Uint8Array;
2572
- }
2573
- declare const SpentTokenOutputMetadata: MessageFns$1<SpentTokenOutputMetadata>;
2574
- interface TokenTransactionConfirmationMetadata {
2575
- spentTokenOutputsMetadata: SpentTokenOutputMetadata[];
2576
- }
2577
- declare const TokenTransactionConfirmationMetadata: MessageFns$1<TokenTransactionConfirmationMetadata>;
2578
- interface TokenTransactionWithStatus {
2579
- tokenTransaction: TokenTransaction | undefined;
2580
- status: TokenTransactionStatus;
2581
- confirmationMetadata: TokenTransactionConfirmationMetadata | undefined;
2582
- }
2583
- declare const TokenTransactionWithStatus: MessageFns$1<TokenTransactionWithStatus>;
2584
- interface SparkTokenServiceClient<CallOptionsExt = {}> {
2585
- /**
2586
- * Start process to create final token transaction with all inputs required
2587
- * from user and SOs (including revocation secret commitment)
2588
- */
2589
- start_transaction(request: DeepPartial$1<StartTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransactionResponse>;
2590
- /**
2591
- * Complete the transaction and commit it with all SOs. This will be
2592
- * coordinated by one SO.
2593
- */
2594
- commit_transaction(request: DeepPartial$1<CommitTransactionRequest>, options?: CallOptions & CallOptionsExt): Promise<CommitTransactionResponse>;
2595
- query_token_metadata(request: DeepPartial$1<QueryTokenMetadataRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenMetadataResponse>;
2596
- query_token_transactions(request: DeepPartial$1<QueryTokenTransactionsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenTransactionsResponse>;
2597
- query_token_outputs(request: DeepPartial$1<QueryTokenOutputsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryTokenOutputsResponse>;
2598
- }
2599
- type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
2600
- 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 {
2601
- $case: string;
2602
- } ? {
2603
- [K in keyof Omit<T, "$case">]?: DeepPartial$1<T[K]>;
2604
- } & {
2605
- $case: T["$case"];
2606
- } : T extends {} ? {
2607
- [K in keyof T]?: DeepPartial$1<T[K]>;
2608
- } : Partial<T>;
2609
- interface MessageFns$1<T> {
2610
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
2611
- decode(input: BinaryReader | Uint8Array, length?: number): T;
2612
- fromJSON(object: any): T;
2613
- toJSON(message: T): unknown;
2614
- create(base?: DeepPartial$1<T>): T;
2615
- fromPartial(object: DeepPartial$1<T>): T;
2616
- }
2617
-
2618
- declare class ConnectionManager {
2619
- private config;
2620
- private clients;
2621
- private tokenClients;
2622
- private streamClients;
2623
- constructor(config: WalletConfigService);
2624
- createClients(): Promise<void>;
2625
- closeConnections(): Promise<void>;
2626
- createMockClient(address: string): Promise<MockServiceClient & {
2627
- close: () => void;
2628
- }>;
2629
- private createChannelWithTLS;
2630
- createSparkStreamClient(address: string, certPath?: string): Promise<SparkServiceClient$1 & {
2631
- close?: () => void;
2632
- }>;
2633
- createSparkClient(address: string, certPath?: string): Promise<SparkServiceClient$1 & {
2634
- close?: () => void;
2635
- }>;
2636
- createSparkTokenClient(address: string, certPath?: string): Promise<SparkTokenServiceClient & {
2637
- close?: () => void;
2638
- }>;
2639
- getStreamChannel(address: string): Promise<Channel | Channel$1 | undefined>;
2640
- private authenticate;
2641
- private createSparkAuthnGrpcConnection;
2642
- private createAuthnMiddleware;
2643
- private createMiddleware;
2644
- private createNodeMiddleware;
2645
- private createBrowserMiddleware;
2646
- private createGrpcClient;
2647
- }
2648
-
2649
- declare enum Layer {
2650
- L1 = 0,
2651
- SPARK = 1,
2652
- UNRECOGNIZED = -1
2653
- }
2654
- declare enum OperationType {
2655
- /** USER_TRANSFER - User operations */
2656
- USER_TRANSFER = 0,
2657
- USER_BURN = 1,
2658
- /** ISSUER_ANNOUNCE - Issuer operations */
2659
- ISSUER_ANNOUNCE = 2,
2660
- ISSUER_MINT = 3,
2661
- ISSUER_TRANSFER = 4,
2662
- ISSUER_FREEZE = 5,
2663
- ISSUER_UNFREEZE = 6,
2664
- ISSUER_BURN = 7,
2665
- UNRECOGNIZED = -1
2666
- }
2667
- declare enum OnChainTransactionStatus {
2668
- PENDING = 0,
2669
- CONFIRMED = 1,
2670
- WAITING_MINED = 2,
2671
- MINED = 3,
2672
- ATTACHING = 4,
2673
- ATTACHED = 5,
2674
- UNRECOGNIZED = -1
2675
- }
2676
- declare enum SparkTransactionStatus {
2677
- STARTED = 0,
2678
- SIGNED = 1,
2679
- FINALIZED = 2,
2680
- UNRECOGNIZED = -1
2681
- }
2682
- interface SendSparkSignatureRequest {
2683
- finalTokenTransaction: TokenTransaction$1 | undefined;
2684
- operatorSpecificSignatures: OperatorSpecificOwnerSignature[];
2685
- operatorSignatureData: SparkOperatorSignatureData | undefined;
2686
- revocationSecrets: RevocationSecretWithIndex[];
2687
- }
2688
- declare const SendSparkSignatureRequest: MessageFns<SendSparkSignatureRequest>;
2689
- interface SparkOperatorSignatureData {
2690
- sparkOperatorSignature: Uint8Array;
2691
- operatorIdentityPublicKey: Uint8Array;
2692
- }
2693
- declare const SparkOperatorSignatureData: MessageFns<SparkOperatorSignatureData>;
2694
- interface GetSparkTxRequest {
2695
- finalTokenTransactionHash: Uint8Array;
2696
- }
2697
- declare const GetSparkTxRequest: MessageFns<GetSparkTxRequest>;
2698
- interface VerifySparkTxRequest {
2699
- finalTokenTransaction: TokenTransaction$1 | undefined;
2700
- }
2701
- declare const VerifySparkTxRequest: MessageFns<VerifySparkTxRequest>;
2702
- interface ListSparkTxsRequest {
2703
- pageToken?: Uint8Array | undefined;
2704
- pageSize?: number | undefined;
2705
- }
2706
- declare const ListSparkTxsRequest: MessageFns<ListSparkTxsRequest>;
2707
- interface ListWithdrawnOutputsRequest {
2708
- blockhash?: Uint8Array | undefined;
2709
- pageToken?: string | undefined;
2710
- pageSize?: number | undefined;
2711
- }
2712
- declare const ListWithdrawnOutputsRequest: MessageFns<ListWithdrawnOutputsRequest>;
2713
- interface ListSparkTxsResponse {
2714
- tokenTransactions: TokenTransactionResponse[];
2715
- nextPageToken?: Uint8Array | undefined;
2716
- }
2717
- declare const ListSparkTxsResponse: MessageFns<ListSparkTxsResponse>;
2718
- interface ListWithdrawnOutputsResponse {
2719
- outputs: TokenOutput[];
2720
- nextPageToken?: string | undefined;
2721
- }
2722
- declare const ListWithdrawnOutputsResponse: MessageFns<ListWithdrawnOutputsResponse>;
2723
- interface GetSparkTxResponse {
2724
- finalTokenTransaction: TokenTransaction$1 | undefined;
2725
- }
2726
- declare const GetSparkTxResponse: MessageFns<GetSparkTxResponse>;
2727
- interface FreezeTokensRequest {
2728
- freezeTokensPayload: FreezeTokensPayload | undefined;
2729
- issuerSignature: Uint8Array;
2730
- }
2731
- declare const FreezeTokensRequest: MessageFns<FreezeTokensRequest>;
2732
- interface FreezeTokensResponse {
2733
- impactedOutputIds: string[];
2734
- /** Decoded uint128 */
2735
- impactedTokenAmount: Uint8Array[];
2736
- }
2737
- declare const FreezeTokensResponse: MessageFns<FreezeTokensResponse>;
2738
- interface ListAllTokenTransactionsRequest {
2739
- cursor?: ListAllTokenTransactionsCursor | undefined;
2740
- pageSize?: number | undefined;
2741
- /** optional filters */
2742
- ownerPublicKey?: Uint8Array | undefined;
2743
- tokenPublicKey?: Uint8Array | undefined;
2744
- beforeTimestamp?: Date | undefined;
2745
- afterTimestamp?: Date | undefined;
2746
- operationTypes: OperationType[];
2747
- }
2748
- declare const ListAllTokenTransactionsRequest: MessageFns<ListAllTokenTransactionsRequest>;
2749
- interface ListAllTokenTransactionsResponse {
2750
- transactions: Transaction[];
2751
- nextCursor?: ListAllTokenTransactionsCursor | undefined;
2752
- }
2753
- declare const ListAllTokenTransactionsResponse: MessageFns<ListAllTokenTransactionsResponse>;
2754
- interface BlockInfoResponse {
2755
- blockInfo: BlockInfo | undefined;
2756
- }
2757
- declare const BlockInfoResponse: MessageFns<BlockInfoResponse>;
2758
- interface SendRawTxRequest {
2759
- tx: string;
2760
- maxBurnAmount?: number | undefined;
2761
- }
2762
- declare const SendRawTxRequest: MessageFns<SendRawTxRequest>;
2763
- interface GetTokenPubkeyInfoRequest {
2764
- publicKeys: Uint8Array[];
2765
- }
2766
- declare const GetTokenPubkeyInfoRequest: MessageFns<GetTokenPubkeyInfoRequest>;
2767
- interface GetTokenPubkeyInfoResponse {
2768
- tokenPubkeyInfos: TokenPubkeyInfo[];
2769
- }
2770
- declare const GetTokenPubkeyInfoResponse: MessageFns<GetTokenPubkeyInfoResponse>;
2771
- interface TokenPubkeyInfo {
2772
- announcement?: TokenPubkeyAnnouncement | undefined;
2773
- totalSupply: Uint8Array;
2774
- /** scriptbuf */
2775
- owner?: Uint8Array | undefined;
2776
- logoUrl?: string | undefined;
2777
- }
2778
- declare const TokenPubkeyInfo: MessageFns<TokenPubkeyInfo>;
2779
- /**
2780
- * This proto is constructed by the wallet to specify leaves it wants to create
2781
- * as part of a token transaction.
2782
- */
2783
- interface TokenOutput {
2784
- id: string;
2785
- ownerPublicKey: Uint8Array;
2786
- revocationCommitment: Uint8Array;
2787
- withdrawalBondSats: number;
2788
- withdrawalLocktime: number;
2789
- tokenPublicKey: Uint8Array;
2790
- tokenAmount: Uint8Array;
2791
- isFrozen?: boolean | undefined;
2792
- }
2793
- declare const TokenOutput: MessageFns<TokenOutput>;
2794
- interface FreezeTokensPayload {
2795
- ownerPublicKey: Uint8Array;
2796
- tokenPublicKey: Uint8Array;
2797
- timestamp: number;
2798
- operatorIdentityPublicKey: Uint8Array;
2799
- /** Set to false when requesting a freeze. */
2800
- shouldUnfreeze: boolean;
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;
2801
2802
  }
2802
- declare const FreezeTokensPayload: MessageFns<FreezeTokensPayload>;
2803
- interface TokenTransactionResponse {
2804
- finalized: boolean;
2805
- finalTokenTransaction: TokenTransaction$1 | undefined;
2806
- finalTokenTransactionHash: Uint8Array;
2803
+ declare const QueryTokenTransactionsRequest: MessageFns<QueryTokenTransactionsRequest>;
2804
+ interface QueryTokenTransactionsResponse {
2805
+ tokenTransactionsWithStatus: TokenTransactionWithStatus[];
2806
+ offset: number;
2807
2807
  }
2808
- declare const TokenTransactionResponse: MessageFns<TokenTransactionResponse>;
2809
- interface Transaction {
2810
- transaction?: {
2811
- $case: "onChain";
2812
- onChain: OnChainTransaction;
2813
- } | {
2814
- $case: "spark";
2815
- spark: SparkTransaction;
2816
- } | undefined;
2808
+ declare const QueryTokenTransactionsResponse: MessageFns<QueryTokenTransactionsResponse>;
2809
+ interface OutputWithPreviousTransactionData {
2810
+ output: TokenOutput | undefined;
2811
+ previousTransactionHash: Uint8Array;
2812
+ previousTransactionVout: number;
2817
2813
  }
2818
- declare const Transaction: MessageFns<Transaction>;
2819
- interface ListAllTokenTransactionsCursor {
2820
- /** tx_hash of the last tx fetched */
2821
- lastTransactionHash: Uint8Array;
2822
- /** whether the last_tx_hash is on chain */
2823
- layer: Layer;
2814
+ declare const OutputWithPreviousTransactionData: MessageFns<OutputWithPreviousTransactionData>;
2815
+ interface QueryTokenOutputsResponse {
2816
+ outputsWithPreviousTransactionData: OutputWithPreviousTransactionData[];
2824
2817
  }
2825
- declare const ListAllTokenTransactionsCursor: MessageFns<ListAllTokenTransactionsCursor>;
2826
- interface OnChainTokenOutput {
2827
- rawTx: Uint8Array;
2828
- vout: number;
2829
- amountSats: number;
2830
- tokenPublicKey?: string | undefined;
2831
- tokenAmount?: Uint8Array | undefined;
2832
- }
2833
- declare const OnChainTokenOutput: MessageFns<OnChainTokenOutput>;
2834
- interface OnChainTransaction {
2835
- operationType: OperationType;
2836
- transactionHash: Uint8Array;
2837
- rawtx: Uint8Array;
2838
- status: OnChainTransactionStatus;
2839
- inputs: OnChainTokenOutput[];
2840
- outputs: OnChainTokenOutput[];
2841
- broadcastedAt: Date | undefined;
2842
- confirmedAt: Date | undefined;
2843
- }
2844
- declare const OnChainTransaction: MessageFns<OnChainTransaction>;
2845
- interface SparkTransaction {
2846
- operationType: OperationType;
2847
- transactionHash: Uint8Array;
2848
- status: SparkTransactionStatus;
2849
- confirmedAt: Date | undefined;
2850
- leavesToCreate: SparkLeaf[];
2851
- leavesToSpend: SparkLeaf[];
2852
- sparkOperatorIdentityPublicKeys: Uint8Array[];
2818
+ declare const QueryTokenOutputsResponse: MessageFns<QueryTokenOutputsResponse>;
2819
+ interface SpentTokenOutputMetadata {
2820
+ outputId: string;
2821
+ revocationSecret: Uint8Array;
2853
2822
  }
2854
- declare const SparkTransaction: MessageFns<SparkTransaction>;
2855
- interface SparkLeaf {
2856
- tokenPublicKey: Uint8Array;
2857
- id: string;
2858
- ownerPublicKey: Uint8Array;
2859
- revocationPublicKey: Uint8Array;
2860
- withdrawalBondSats: number;
2861
- withdrawalLocktime: number;
2862
- tokenAmount: Uint8Array;
2863
- createTxHash: Uint8Array;
2864
- createTxVoutIndex: number;
2865
- spendTxHash?: Uint8Array | undefined;
2866
- spendTxVoutIndex?: number | undefined;
2867
- isFrozen?: boolean | undefined;
2868
- }
2869
- declare const SparkLeaf: MessageFns<SparkLeaf>;
2870
- interface BlockInfo {
2871
- blockHash: Uint8Array;
2872
- blockHeight: number;
2873
- minedAt: Date | undefined;
2874
- }
2875
- declare const BlockInfo: MessageFns<BlockInfo>;
2876
- interface TokenPubkey {
2877
- publicKey: Uint8Array;
2823
+ declare const SpentTokenOutputMetadata: MessageFns<SpentTokenOutputMetadata>;
2824
+ interface TokenTransactionConfirmationMetadata {
2825
+ spentTokenOutputsMetadata: SpentTokenOutputMetadata[];
2878
2826
  }
2879
- declare const TokenPubkey: MessageFns<TokenPubkey>;
2880
- interface TokenPubkeyAnnouncement {
2881
- publicKey: TokenPubkey | undefined;
2882
- name: string;
2883
- symbol: string;
2884
- decimal: Uint8Array;
2885
- /** u128 */
2886
- maxSupply: Uint8Array;
2887
- isFreezable: boolean;
2827
+ declare const TokenTransactionConfirmationMetadata: MessageFns<TokenTransactionConfirmationMetadata>;
2828
+ interface TokenTransactionWithStatus {
2829
+ tokenTransaction: TokenTransaction | undefined;
2830
+ status: TokenTransactionStatus;
2831
+ confirmationMetadata: TokenTransactionConfirmationMetadata | undefined;
2888
2832
  }
2889
- declare const TokenPubkeyAnnouncement: MessageFns<TokenPubkeyAnnouncement>;
2890
- interface SparkServiceClient<CallOptionsExt = {}> {
2891
- sendSparkSignature(request: DeepPartial<SendSparkSignatureRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2892
- listSparkTxs(request: DeepPartial<ListSparkTxsRequest>, options?: CallOptions & CallOptionsExt): Promise<ListSparkTxsResponse>;
2893
- listTransactions(request: DeepPartial<ListAllTokenTransactionsRequest>, options?: CallOptions & CallOptionsExt): Promise<ListAllTokenTransactionsResponse>;
2894
- listWithdrawnOutputs(request: DeepPartial<ListWithdrawnOutputsRequest>, options?: CallOptions & CallOptionsExt): Promise<ListWithdrawnOutputsResponse>;
2895
- getSparkTx(request: DeepPartial<GetSparkTxRequest>, options?: CallOptions & CallOptionsExt): Promise<GetSparkTxResponse>;
2896
- verifySparkTx(request: DeepPartial<VerifySparkTxRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2897
- freezeTokens(request: DeepPartial<FreezeTokensRequest>, options?: CallOptions & CallOptionsExt): Promise<FreezeTokensResponse>;
2898
- getLastIndexedBlockInfo(request: DeepPartial<Empty>, options?: CallOptions & CallOptionsExt): Promise<BlockInfoResponse>;
2899
- sendRawLrcTransaction(request: DeepPartial<SendRawTxRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
2900
- getTokenPubkeyInfo(request: DeepPartial<GetTokenPubkeyInfoRequest>, options?: CallOptions & CallOptionsExt): Promise<GetTokenPubkeyInfoResponse>;
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>;
2901
2848
  }
2902
2849
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
2903
2850
  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 {
@@ -2918,16 +2865,34 @@ interface MessageFns<T> {
2918
2865
  fromPartial(object: DeepPartial<T>): T;
2919
2866
  }
2920
2867
 
2921
- declare class Lrc20ConnectionManager {
2868
+ declare class ConnectionManager {
2922
2869
  private config;
2923
- private lrc20Client;
2870
+ private clients;
2871
+ private tokenClients;
2872
+ private streamClients;
2873
+ private authPromises;
2924
2874
  constructor(config: WalletConfigService);
2925
- closeConnection(): Promise<void>;
2875
+ createClients(): Promise<void>;
2876
+ closeConnections(): Promise<void>;
2877
+ createMockClient(address: string): Promise<MockServiceClient & {
2878
+ close: () => void;
2879
+ }>;
2926
2880
  private createChannelWithTLS;
2927
- createLrc20Client(certPath?: string): Promise<SparkServiceClient & {
2881
+ createSparkStreamClient(address: string, certPath?: string): Promise<SparkServiceClient & {
2882
+ close?: () => void;
2883
+ }>;
2884
+ createSparkClient(address: string, certPath?: string): Promise<SparkServiceClient & {
2885
+ close?: () => void;
2886
+ }>;
2887
+ createSparkTokenClient(address: string, certPath?: string): Promise<SparkTokenServiceClient & {
2928
2888
  close?: () => void;
2929
2889
  }>;
2890
+ getStreamChannel(address: string): Promise<Channel | Channel$1 | undefined>;
2891
+ private authenticate;
2892
+ private createSparkAuthnGrpcConnection;
2893
+ private createAuthnMiddleware;
2930
2894
  private createMiddleware;
2895
+ private handleMiddlewareError;
2931
2896
  private createNodeMiddleware;
2932
2897
  private createBrowserMiddleware;
2933
2898
  private createGrpcClient;
@@ -2946,16 +2911,16 @@ type LeafKeyTweak = {
2946
2911
  };
2947
2912
  type ClaimLeafData = {
2948
2913
  signingPubKey: Uint8Array;
2949
- tx?: Transaction$1;
2950
- refundTx?: Transaction$1;
2914
+ tx?: Transaction;
2915
+ refundTx?: Transaction;
2951
2916
  signingNonceCommitment: SigningCommitment;
2952
2917
  vout?: number;
2953
2918
  };
2954
2919
  type LeafRefundSigningData = {
2955
2920
  signingPubKey: Uint8Array;
2956
2921
  receivingPubkey: Uint8Array;
2957
- tx: Transaction$1;
2958
- refundTx?: Transaction$1;
2922
+ tx: Transaction;
2923
+ refundTx?: Transaction;
2959
2924
  signingNonceCommitment: SigningCommitment;
2960
2925
  vout: number;
2961
2926
  };
@@ -3022,9 +2987,6 @@ declare class TransferService extends BaseTransferService {
3022
2987
  refreshTimelockRefundTx(node: TreeNode, signingPubKey: Uint8Array): Promise<FinalizeNodeSignaturesResponse>;
3023
2988
  }
3024
2989
 
3025
- declare const AddressNetwork: Record<NetworkType, string>;
3026
- type SparkAddressFormat = `${(typeof AddressNetwork)[keyof typeof AddressNetwork]}1${string}`;
3027
-
3028
2990
  interface WalletLeaf {
3029
2991
  id: string;
3030
2992
  treeId: string;
@@ -3063,74 +3025,6 @@ interface WalletTransferLeaf {
3063
3025
  intermediateRefundTx: string;
3064
3026
  }
3065
3027
 
3066
- type HumanReadableTokenIdentifier = `btk1${string}` | `btkrt1${string}` | `btkt1${string}` | `btks1${string}` | `btkl1${string}`;
3067
-
3068
- type CreateLightningInvoiceParams = {
3069
- amountSats: number;
3070
- memo?: string;
3071
- expirySeconds?: number;
3072
- includeSparkAddress?: boolean;
3073
- receiverIdentityPubkey?: string;
3074
- descriptionHash?: string;
3075
- };
3076
- type PayLightningInvoiceParams = {
3077
- invoice: string;
3078
- maxFeeSats: number;
3079
- preferSpark?: boolean;
3080
- amountSatsToSend?: number;
3081
- };
3082
- type TransferParams = {
3083
- amountSats: number;
3084
- receiverSparkAddress: string;
3085
- };
3086
- /**
3087
- * Token metadata containing essential information about a token.
3088
- * This is the wallet's internal representation with JavaScript-friendly types.
3089
- *
3090
- * rawTokenIdentifier: This is the raw binary token identifier - This is used to encode the human readable token identifier.
3091
- *
3092
- * tokenPublicKey: This is the hex-encoded public key of the token issuer - Same as issuerPublicKey.
3093
- *
3094
- * @example
3095
- * ```typescript
3096
- * const tokenMetadata: TokenMetadata = {
3097
- * rawTokenIdentifier: new Uint8Array([1, 2, 3]),
3098
- * tokenPublicKey: "0348fbb...",
3099
- * tokenName: "SparkToken",
3100
- * tokenTicker: "SPK",
3101
- * decimals: 8,
3102
- * maxSupply: 1000000n
3103
- * };
3104
- * ```
3105
- */
3106
- type TokenMetadata = {
3107
- /** Raw binary token identifier - This is used to encode the human readable token identifier */
3108
- rawTokenIdentifier: Uint8Array;
3109
- /** Hex-encoded public key of the token issuer - Same as issuerPublicKey */
3110
- tokenPublicKey: string;
3111
- /** Human-readable name of the token (e.g., SparkToken)*/
3112
- tokenName: string;
3113
- /** Short ticker symbol for the token (e.g., "SPK") */
3114
- tokenTicker: string;
3115
- /** Number of decimal places for token amounts */
3116
- decimals: number;
3117
- /** Maximum supply of tokens that can ever be minted */
3118
- maxSupply: bigint;
3119
- };
3120
- type TokenBalanceMap = Map<HumanReadableTokenIdentifier, {
3121
- balance: bigint;
3122
- tokenMetadata: TokenMetadata;
3123
- }>;
3124
- type InitWalletResponse = {
3125
- mnemonic?: string | undefined;
3126
- };
3127
- interface SparkWalletProps {
3128
- mnemonicOrSeed?: Uint8Array | string;
3129
- accountNumber?: number;
3130
- signer?: SparkSigner;
3131
- options?: ConfigOptions;
3132
- }
3133
-
3134
3028
  /**
3135
3029
  * The SparkWallet class is the primary interface for interacting with the Spark network.
3136
3030
  * It provides methods for creating and managing wallets, handling deposits, executing transfers,
@@ -3139,7 +3033,6 @@ interface SparkWalletProps {
3139
3033
  declare class SparkWallet extends EventEmitter {
3140
3034
  protected config: WalletConfigService;
3141
3035
  protected connectionManager: ConnectionManager;
3142
- protected lrc20ConnectionManager: Lrc20ConnectionManager;
3143
3036
  protected lrc20Wallet: LRCWallet | undefined;
3144
3037
  protected transferService: TransferService;
3145
3038
  protected tracerId: string;
@@ -3159,6 +3052,7 @@ declare class SparkWallet extends EventEmitter {
3159
3052
  private streamController;
3160
3053
  protected leaves: TreeNode[];
3161
3054
  protected tokenOutputs: Map<string, OutputWithPreviousTransactionData$1[]>;
3055
+ protected tokenMetadata: Map<string, TokenMetadata>;
3162
3056
  private claimTransfersInterval;
3163
3057
  protected wrapWithOtelSpan<T>(name: string, fn: (...args: any[]) => Promise<T>): (...args: any[]) => Promise<T>;
3164
3058
  protected constructor(options?: ConfigOptions, signer?: SparkSigner);
@@ -3262,6 +3156,7 @@ declare class SparkWallet extends EventEmitter {
3262
3156
  balance: bigint;
3263
3157
  tokenBalances: TokenBalanceMap;
3264
3158
  }>;
3159
+ private getTokenMetadata;
3265
3160
  private getTokenBalance;
3266
3161
  private getInternalBalance;
3267
3162
  /**
@@ -3566,7 +3461,7 @@ declare class SparkWallet extends EventEmitter {
3566
3461
  receiverSparkAddress: string;
3567
3462
  }[], outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST", selectedOutputs?: OutputWithPreviousTransactionData$1[]): Promise<string>;
3568
3463
  /**
3569
- * Retrieves token transaction history for specified tokens owned by the wallet.
3464
+ * Retrieves token transaction history for specified tokens
3570
3465
  * Can optionally filter by specific transaction hashes.
3571
3466
  *
3572
3467
  * @param ownerPublicKeys - Optional array of owner public keys to query transactions for
@@ -3576,7 +3471,13 @@ declare class SparkWallet extends EventEmitter {
3576
3471
  * @param outputIds - Optional array of output IDs to filter by
3577
3472
  * @returns Promise resolving to array of token transactions with their current status
3578
3473
  */
3579
- queryTokenTransactions(ownerPublicKeys?: string[], issuerPublicKeys?: string[], tokenTransactionHashes?: string[], tokenIdentifiers?: string[], outputIds?: string[]): Promise<TokenTransactionWithStatus[]>;
3474
+ queryTokenTransactions({ ownerPublicKeys, issuerPublicKeys, tokenTransactionHashes, tokenIdentifiers, outputIds, }: {
3475
+ ownerPublicKeys?: string[];
3476
+ issuerPublicKeys?: string[];
3477
+ tokenTransactionHashes?: string[];
3478
+ tokenIdentifiers?: string[];
3479
+ outputIds?: string[];
3480
+ }): Promise<TokenTransactionWithStatus[]>;
3580
3481
  getTokenL1Address(): Promise<string>;
3581
3482
  /**
3582
3483
  * Signs a message with the identity key.
@@ -3658,122 +3559,57 @@ declare class SparkWallet extends EventEmitter {
3658
3559
  private queryNodes;
3659
3560
  }
3660
3561
 
3661
- declare function generateSignatureFromExistingAdaptor(signature: Uint8Array, adaptorPrivateKeyBytes: Uint8Array): Uint8Array;
3662
- declare function generateAdaptorFromSignature(signature: Uint8Array): {
3663
- adaptorSignature: Uint8Array;
3664
- adaptorPrivateKey: Uint8Array;
3665
- };
3666
- declare function validateOutboundAdaptorSignature(pubkey: Uint8Array, hash: Uint8Array, signature: Uint8Array, adaptorPubkey: Uint8Array): boolean;
3667
- declare function applyAdaptorToSignature(pubkey: Uint8Array, hash: Uint8Array, signature: Uint8Array, adaptorPrivateKeyBytes: Uint8Array): Uint8Array;
3668
-
3669
- declare function computeTaprootKeyNoScript(pubkey: Uint8Array): Uint8Array;
3670
- declare function getP2TRScriptFromPublicKey(pubKey: Uint8Array, network: Network): Uint8Array;
3671
- declare function getP2TRAddressFromPublicKey(pubKey: Uint8Array, network: Network): string;
3672
- declare function getP2TRAddressFromPkScript(pkScript: Uint8Array, network: Network): string;
3673
- declare function getP2WPKHAddressFromPublicKey(pubKey: Uint8Array, network: Network): string;
3674
- declare function getTxFromRawTxHex(rawTxHex: string): btc.Transaction;
3675
- declare function getTxFromRawTxBytes(rawTxBytes: Uint8Array): btc.Transaction;
3676
- declare function getSigHashFromTx(tx: btc.Transaction, inputIndex: number, prevOutput: TransactionOutput): Uint8Array;
3677
- declare function getTxId(tx: btc.Transaction): string;
3678
- declare function getTxIdNoReverse(tx: btc.Transaction): string;
3679
-
3680
- declare function addPublicKeys(a: Uint8Array, b: Uint8Array): Uint8Array;
3681
- declare function applyAdditiveTweakToPublicKey(pubkey: Uint8Array, tweak: Uint8Array): Uint8Array<ArrayBufferLike>;
3682
- declare function subtractPublicKeys(a: Uint8Array, b: Uint8Array): Uint8Array<ArrayBufferLike>;
3683
- declare function addPrivateKeys(a: Uint8Array, b: Uint8Array): Uint8Array<ArrayBufferLike>;
3684
- declare function subtractPrivateKeys(a: Uint8Array, b: Uint8Array): Uint8Array<ArrayBufferLike>;
3685
- declare function sumOfPrivateKeys(keys: Uint8Array[]): Uint8Array<ArrayBufferLike>;
3686
- declare function lastKeyWithTarget(target: Uint8Array, keys: Uint8Array[]): Uint8Array<ArrayBufferLike>;
3687
-
3688
- declare function getLatestDepositTxId(address: string): Promise<string | null>;
3689
- declare function isTxBroadcast(txid: string, baseUrl: string, network?: any): Promise<boolean>;
3690
-
3691
- declare function proofOfPossessionMessageHashForDepositAddress(userPubkey: Uint8Array, operatorPubkey: Uint8Array, depositAddress: string): Uint8Array;
3692
-
3693
- declare function collectResponses<T>(responses: PromiseSettledResult<T>[]): T[];
3694
-
3695
- declare function getRandomSigningNonce(): SigningNonce;
3696
- declare function createSigningNonce(binding: Uint8Array, hiding: Uint8Array): SigningNonce;
3697
- declare function getSigningCommitmentFromNonce(nonce: SigningNonce): SigningCommitment;
3698
- declare function encodeSigningNonceToBytes(nonce: SigningNonce): Uint8Array;
3699
- declare function decodeBytesToSigningNonce(bytes: Uint8Array): SigningNonce;
3700
- declare function createSigningCommitment(binding: Uint8Array, hiding: Uint8Array): SigningCommitment;
3701
- declare function encodeSigningCommitmentToBytes(commitment: SigningCommitment): Uint8Array;
3702
- declare function decodeBytesToSigningCommitment(bytes: Uint8Array): SigningCommitment;
3703
-
3704
- declare function calculateAvailableTokenAmount(outputLeaves: OutputWithPreviousTransactionData$1[]): bigint;
3705
- declare function checkIfSelectedOutputsAreAvailable(selectedOutputs: OutputWithPreviousTransactionData$1[], tokenOutputs: Map<string, OutputWithPreviousTransactionData$1[]>, tokenPublicKey: Uint8Array): boolean;
3706
- declare function filterTokenBalanceForTokenPublicKey(tokenBalances: TokenBalanceMap, publicKey: string): {
3707
- balance: bigint;
3708
- };
3709
-
3710
- declare function getTransferPackageSigningPayload(transferID: string, transferPackage: TransferPackage): Uint8Array;
3711
-
3712
- declare const DEFAULT_FEE_SATS: number;
3713
- /**
3714
- * Subtracts the default fee from the amount if it's greater than the fee.
3715
- * Returns the original amount if it's less than or equal to the fee.
3716
- */
3717
- declare function maybeApplyFee(amount: bigint): bigint;
3718
- declare function createRefundTx(sequence: number, nodeOutPoint: TransactionInput, amountSats: bigint, receivingPubkey: Uint8Array, network: Network): Transaction$1;
3719
- declare function getCurrentTimelock(currSequence?: number): number;
3720
- declare function getTransactionSequence(currSequence?: number): number;
3721
- declare function checkIfValidSequence(currSequence?: number): void;
3722
- declare function getNextTransactionSequence(currSequence?: number, forRefresh?: boolean): {
3723
- nextSequence: number;
3724
- needRefresh: boolean;
3725
- };
3726
- declare function getEphemeralAnchorOutput(): TransactionOutput;
3727
-
3728
- interface LeafInfo {
3729
- leafId: string;
3730
- nodeTx: string;
3731
- refundTx: string;
3732
- }
3733
- interface Utxo {
3734
- txid: string;
3735
- vout: number;
3736
- value: bigint;
3737
- script: string;
3738
- publicKey: string;
3739
- }
3740
- interface FeeRate {
3741
- satPerVbyte: number;
3742
- }
3743
- interface FeeBumpTxPackage {
3744
- tx: string;
3745
- feeBumpPsbt?: string;
3746
- }
3747
- interface FeeBumpTxChain {
3748
- leafId: string;
3749
- txPackages: FeeBumpTxPackage[];
3750
- }
3751
- interface TxChain {
3752
- leafId: string;
3753
- transactions: string[];
3754
- }
3755
- interface BroadcastConfig {
3756
- bitcoinCoreRpcUrl?: string;
3757
- rpcUsername?: string;
3758
- rpcPassword?: string;
3759
- autoBroadcast?: boolean;
3760
- network?: "MAINNET" | "REGTEST" | "TESTNET" | "SIGNET" | "LOCAL";
3562
+ interface FetchOwnedTokenOutputsParams {
3563
+ ownerPublicKeys: Uint8Array[];
3564
+ issuerPublicKeys?: Uint8Array[];
3565
+ tokenIdentifiers?: Uint8Array[];
3761
3566
  }
3762
- interface BroadcastResult {
3763
- success: boolean;
3764
- txids?: string[];
3765
- error?: string;
3766
- broadcastedPackages?: number;
3567
+ interface QueryTokenTransactionsParams {
3568
+ ownerPublicKeys?: string[];
3569
+ issuerPublicKeys?: string[];
3570
+ tokenTransactionHashes?: string[];
3571
+ tokenIdentifiers?: string[];
3572
+ outputIds?: string[];
3767
3573
  }
3768
- declare function isEphemeralAnchorOutput(script?: Uint8Array, amount?: bigint): boolean;
3769
- declare function constructUnilateralExitTxs(nodeHexStrings: string[], sparkClient?: SparkServiceClient$1, network?: any): Promise<TxChain[]>;
3770
- declare function constructUnilateralExitFeeBumpPackages(nodeHexStrings: string[], utxos: Utxo[], feeRate: FeeRate, electrsUrl: string, sparkClient?: SparkServiceClient$1, network?: any): Promise<FeeBumpTxChain[]>;
3771
- declare function constructFeeBumpTx(txHex: string, utxos: Utxo[], feeRate: FeeRate, previousFeeBumpTx?: string): {
3772
- feeBumpPsbt: string;
3773
- usedUtxos: Utxo[];
3774
- correctedParentTx?: string;
3775
- };
3776
-
3777
- declare function getSparkAddressFromTaproot(taprootAddress: string): SparkAddressFormat;
3778
-
3779
- export { AuthenticationError, type BroadcastConfig, type BroadcastResult, ConfigurationError, DEFAULT_FEE_SATS, ReactNativeSparkSigner as DefaultSparkSigner, type FeeBumpTxChain, type FeeBumpTxPackage, type FeeRate, InternalValidationError, LRC_WALLET_NETWORK, LRC_WALLET_NETWORK_TYPE, type LeafInfo, Network, NetworkError, NetworkToProto, type NetworkType, NotImplementedError, RPCError, ReactNativeSparkSigner, SparkSDKError, SparkWallet, type TxChain, type Utxo, ValidationError, type VerifiableSecretShare, addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, bigIntToPrivateKey, calculateAvailableTokenAmount, checkIfSelectedOutputsAreAvailable, checkIfValidSequence, collectResponses, computeTaprootKeyNoScript, computerLagrangeCoefficients, constructFeeBumpTx, constructUnilateralExitFeeBumpPackages, constructUnilateralExitTxs, createRefundTx, createSigningCommitment, createSigningNonce, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, 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, lastKeyWithTarget, maybeApplyFee, modInverse, proofOfPossessionMessageHashForDepositAddress, recoverSecret, splitSecret, splitSecretWithProofs, subtractPrivateKeys, subtractPublicKeys, sumOfPrivateKeys, validateOutboundAdaptorSignature, validateShare };
3574
+ declare class TokenTransactionService {
3575
+ protected readonly config: WalletConfigService;
3576
+ protected readonly connectionManager: ConnectionManager;
3577
+ constructor(config: WalletConfigService, connectionManager: ConnectionManager);
3578
+ tokenTransfer(tokenOutputs: Map<string, OutputWithPreviousTransactionData$1[]>, receiverOutputs: {
3579
+ tokenPublicKey: string;
3580
+ tokenAmount: bigint;
3581
+ receiverSparkAddress: string;
3582
+ }[], outputSelectionStrategy?: "SMALL_FIRST" | "LARGE_FIRST", selectedOutputs?: OutputWithPreviousTransactionData$1[]): Promise<string>;
3583
+ constructTransferTokenTransactionV0(selectedOutputs: OutputWithPreviousTransactionData$1[], tokenOutputData: Array<{
3584
+ receiverSparkAddress: Uint8Array;
3585
+ tokenPublicKey: Uint8Array;
3586
+ tokenAmount: bigint;
3587
+ }>): Promise<TokenTransaction$1>;
3588
+ constructTransferTokenTransaction(selectedOutputs: OutputWithPreviousTransactionData$1[], tokenOutputData: Array<{
3589
+ receiverSparkAddress: Uint8Array;
3590
+ tokenPublicKey: Uint8Array;
3591
+ tokenAmount: bigint;
3592
+ }>): Promise<TokenTransaction>;
3593
+ collectOperatorIdentityPublicKeys(): Uint8Array[];
3594
+ broadcastTokenTransaction(tokenTransaction: TokenTransaction$1 | TokenTransaction, outputsToSpendSigningPublicKeys?: Uint8Array[], outputsToSpendCommitments?: Uint8Array[]): Promise<string>;
3595
+ private broadcastTokenTransactionV0;
3596
+ private broadcastTokenTransactionV1;
3597
+ private startTokenTransactionV0;
3598
+ private startTokenTransaction;
3599
+ private signTokenTransactionV0;
3600
+ private signTokenTransaction;
3601
+ fetchOwnedTokenOutputs(params: FetchOwnedTokenOutputsParams): Promise<OutputWithPreviousTransactionData$1[]>;
3602
+ queryTokenTransactions(params: QueryTokenTransactionsParams): Promise<TokenTransactionWithStatus$1[] | TokenTransactionWithStatus[]>;
3603
+ private fetchOwnedTokenOutputsV0;
3604
+ private fetchOwnedTokenOutputsV1;
3605
+ private queryTokenTransactionsV0;
3606
+ private queryTokenTransactionsV1;
3607
+ syncTokenOutputs(tokenOutputs: Map<string, OutputWithPreviousTransactionData$1[]>): Promise<void>;
3608
+ selectTokenOutputs(tokenOutputs: OutputWithPreviousTransactionData$1[], tokenAmount: bigint, strategy: "SMALL_FIRST" | "LARGE_FIRST"): OutputWithPreviousTransactionData$1[];
3609
+ private sortTokenOutputsByStrategy;
3610
+ private signMessageWithKey;
3611
+ private finalizeTokenTransaction;
3612
+ private createSignaturesForOperators;
3613
+ }
3614
+
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 };