@bitgo-beta/babylonlabs-io-btc-staking-ts 0.4.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,948 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import { btcstaking, btcstakingtx } from '@babylonlabs-io/babylon-proto-ts';
4
+ import { ProofOfPossessionBTC } from '@babylonlabs-io/babylon-proto-ts/dist/generated/babylon/btcstaking/v1/pop';
5
+ import { PsbtInputExtended } from 'bip174/src/lib/interfaces';
6
+ import { Psbt, Transaction, networks } from 'bitcoinjs-lib';
7
+ import { Input } from 'bitcoinjs-lib/src/transaction';
8
+
9
+ /**
10
+ * Base interface for staking parameters that define the rules and constraints
11
+ * for staking operations.
12
+ */
13
+ export interface StakingParams {
14
+ covenantNoCoordPks: string[];
15
+ covenantQuorum: number;
16
+ unbondingTime: number;
17
+ unbondingFeeSat: number;
18
+ maxStakingAmountSat: number;
19
+ minStakingAmountSat: number;
20
+ maxStakingTimeBlocks: number;
21
+ minStakingTimeBlocks: number;
22
+ slashing?: {
23
+ slashingPkScriptHex: string;
24
+ slashingRate: number;
25
+ minSlashingTxFeeSat: number;
26
+ };
27
+ }
28
+ /**
29
+ * Extension of StakingParams that includes activation height and version information.
30
+ * These parameters are used to identify and select the appropriate staking rules at
31
+ * different blockchain heights, but do not affect the actual staking transaction content.
32
+ */
33
+ export interface VersionedStakingParams extends StakingParams {
34
+ btcActivationHeight: number;
35
+ version: number;
36
+ }
37
+ /**
38
+ * Extension of VersionedStakingParams that includes a tag field for observability.
39
+ */
40
+ export interface ObservableVersionedStakingParams extends VersionedStakingParams {
41
+ tag: string;
42
+ }
43
+ export interface UTXO {
44
+ txid: string;
45
+ vout: number;
46
+ value: number;
47
+ scriptPubKey: string;
48
+ rawTxHex?: string;
49
+ redeemScript?: string;
50
+ witnessScript?: string;
51
+ }
52
+ export interface StakingScripts {
53
+ timelockScript: Buffer;
54
+ unbondingScript: Buffer;
55
+ slashingScript: Buffer;
56
+ unbondingTimelockScript: Buffer;
57
+ }
58
+ export declare class StakingScriptData {
59
+ stakerKey: Buffer;
60
+ finalityProviderKeys: Buffer[];
61
+ covenantKeys: Buffer[];
62
+ covenantThreshold: number;
63
+ stakingTimeLock: number;
64
+ unbondingTimeLock: number;
65
+ constructor(stakerKey: Buffer, finalityProviderKeys: Buffer[], covenantKeys: Buffer[], covenantThreshold: number, stakingTimelock: number, unbondingTimelock: number);
66
+ /**
67
+ * Validates the staking script.
68
+ * @returns {boolean} Returns true if the staking script is valid, otherwise false.
69
+ */
70
+ validate(): boolean;
71
+ /**
72
+ * Builds a timelock script.
73
+ * @param timelock - The timelock value to encode in the script.
74
+ * @returns {Buffer} containing the compiled timelock script.
75
+ */
76
+ buildTimelockScript(timelock: number): Buffer;
77
+ /**
78
+ * Builds the staking timelock script.
79
+ * Only holder of private key for given pubKey can spend after relative lock time
80
+ * Creates the timelock script in the form:
81
+ * <stakerPubKey>
82
+ * OP_CHECKSIGVERIFY
83
+ * <stakingTimeBlocks>
84
+ * OP_CHECKSEQUENCEVERIFY
85
+ * @returns {Buffer} The staking timelock script.
86
+ */
87
+ buildStakingTimelockScript(): Buffer;
88
+ /**
89
+ * Builds the unbonding timelock script.
90
+ * Creates the unbonding timelock script in the form:
91
+ * <stakerPubKey>
92
+ * OP_CHECKSIGVERIFY
93
+ * <unbondingTimeBlocks>
94
+ * OP_CHECKSEQUENCEVERIFY
95
+ * @returns {Buffer} The unbonding timelock script.
96
+ */
97
+ buildUnbondingTimelockScript(): Buffer;
98
+ /**
99
+ * Builds the unbonding script in the form:
100
+ * buildSingleKeyScript(stakerPk, true) ||
101
+ * buildMultiKeyScript(covenantPks, covenantThreshold, false)
102
+ * || means combining the scripts
103
+ * @returns {Buffer} The unbonding script.
104
+ */
105
+ buildUnbondingScript(): Buffer;
106
+ /**
107
+ * Builds the slashing script for staking in the form:
108
+ * buildSingleKeyScript(stakerPk, true) ||
109
+ * buildMultiKeyScript(finalityProviderPKs, 1, true) ||
110
+ * buildMultiKeyScript(covenantPks, covenantThreshold, false)
111
+ * || means combining the scripts
112
+ * The slashing script is a combination of single-key and multi-key scripts.
113
+ * The single-key script is used for staker key verification.
114
+ * The multi-key script is used for finality provider key verification and covenant key verification.
115
+ * @returns {Buffer} The slashing script as a Buffer.
116
+ */
117
+ buildSlashingScript(): Buffer;
118
+ /**
119
+ * Builds the staking scripts.
120
+ * @returns {StakingScripts} The staking scripts.
121
+ */
122
+ buildScripts(): StakingScripts;
123
+ /**
124
+ * Builds a single key script in the form:
125
+ * buildSingleKeyScript creates a single key script
126
+ * <pk> OP_CHECKSIGVERIFY (if withVerify is true)
127
+ * <pk> OP_CHECKSIG (if withVerify is false)
128
+ * @param pk - The public key buffer.
129
+ * @param withVerify - A boolean indicating whether to include the OP_CHECKSIGVERIFY opcode.
130
+ * @returns The compiled script buffer.
131
+ */
132
+ buildSingleKeyScript(pk: Buffer, withVerify: boolean): Buffer;
133
+ /**
134
+ * Builds a multi-key script in the form:
135
+ * <pk1> OP_CHEKCSIG <pk2> OP_CHECKSIGADD <pk3> OP_CHECKSIGADD ... <pkN> OP_CHECKSIGADD <threshold> OP_NUMEQUAL
136
+ * <withVerify -> OP_NUMEQUALVERIFY>
137
+ * It validates whether provided keys are unique and the threshold is not greater than number of keys
138
+ * If there is only one key provided it will return single key sig script
139
+ * @param pks - An array of public keys.
140
+ * @param threshold - The required number of valid signers.
141
+ * @param withVerify - A boolean indicating whether to include the OP_VERIFY opcode.
142
+ * @returns The compiled multi-key script as a Buffer.
143
+ * @throws {Error} If no keys are provided, if the required number of valid signers is greater than the number of provided keys, or if duplicate keys are provided.
144
+ */
145
+ buildMultiKeyScript(pks: Buffer[], threshold: number, withVerify: boolean): Buffer;
146
+ }
147
+ /**
148
+ * PsbtResult is an object containing a partially signed transaction and its fee
149
+ */
150
+ export interface PsbtResult {
151
+ psbt: Psbt;
152
+ fee: number;
153
+ }
154
+ /**
155
+ * TransactionResult is an object containing an unsigned transaction and its fee
156
+ */
157
+ export interface TransactionResult {
158
+ transaction: Transaction;
159
+ fee: number;
160
+ }
161
+ export interface StakerInfo {
162
+ address: string;
163
+ publicKeyNoCoordHex: string;
164
+ }
165
+ export declare class Staking {
166
+ network: networks.Network;
167
+ stakerInfo: StakerInfo;
168
+ params: StakingParams;
169
+ finalityProviderPkNoCoordHex: string;
170
+ stakingTimelock: number;
171
+ constructor(network: networks.Network, stakerInfo: StakerInfo, params: StakingParams, finalityProviderPkNoCoordHex: string, stakingTimelock: number);
172
+ /**
173
+ * buildScripts builds the staking scripts for the staking transaction.
174
+ * Note: different staking types may have different scripts.
175
+ * e.g the observable staking script has a data embed script.
176
+ *
177
+ * @returns {StakingScripts} - The staking scripts.
178
+ */
179
+ buildScripts(): StakingScripts;
180
+ /**
181
+ * Create a staking transaction for staking.
182
+ *
183
+ * @param {number} stakingAmountSat - The amount to stake in satoshis.
184
+ * @param {UTXO[]} inputUTXOs - The UTXOs to use as inputs for the staking
185
+ * transaction.
186
+ * @param {number} feeRate - The fee rate for the transaction in satoshis per byte.
187
+ * @returns {TransactionResult} - An object containing the unsigned
188
+ * transaction, and fee
189
+ * @throws {StakingError} - If the transaction cannot be built
190
+ */
191
+ createStakingTransaction(stakingAmountSat: number, inputUTXOs: UTXO[], feeRate: number): TransactionResult;
192
+ /**
193
+ * Create a staking psbt based on the existing staking transaction.
194
+ *
195
+ * @param {Transaction} stakingTx - The staking transaction.
196
+ * @param {UTXO[]} inputUTXOs - The UTXOs to use as inputs for the staking
197
+ * transaction. The UTXOs that were used to create the staking transaction should
198
+ * be included in this array.
199
+ * @returns {Psbt} - The psbt.
200
+ */
201
+ toStakingPsbt(stakingTx: Transaction, inputUTXOs: UTXO[]): Psbt;
202
+ /**
203
+ * Create an unbonding transaction for staking.
204
+ *
205
+ * @param {Transaction} stakingTx - The staking transaction to unbond.
206
+ * @returns {TransactionResult} - An object containing the unsigned
207
+ * transaction, and fee
208
+ * @throws {StakingError} - If the transaction cannot be built
209
+ */
210
+ createUnbondingTransaction(stakingTx: Transaction): TransactionResult;
211
+ /**
212
+ * Create an unbonding psbt based on the existing unbonding transaction and
213
+ * staking transaction.
214
+ *
215
+ * @param {Transaction} unbondingTx - The unbonding transaction.
216
+ * @param {Transaction} stakingTx - The staking transaction.
217
+ *
218
+ * @returns {Psbt} - The psbt.
219
+ */
220
+ toUnbondingPsbt(unbondingTx: Transaction, stakingTx: Transaction): Psbt;
221
+ /**
222
+ * Creates a withdrawal transaction that spends from an unbonding or slashing
223
+ * transaction. The timelock on the input transaction must have expired before
224
+ * this withdrawal can be valid.
225
+ *
226
+ * @param {Transaction} earlyUnbondedTx - The unbonding or slashing
227
+ * transaction to withdraw from
228
+ * @param {number} feeRate - Fee rate in satoshis per byte for the withdrawal
229
+ * transaction
230
+ * @returns {PsbtResult} - Contains the unsigned PSBT and fee amount
231
+ * @throws {StakingError} - If the input transaction is invalid or withdrawal
232
+ * transaction cannot be built
233
+ */
234
+ createWithdrawEarlyUnbondedTransaction(earlyUnbondedTx: Transaction, feeRate: number): PsbtResult;
235
+ /**
236
+ * Create a withdrawal psbt that spends a naturally expired staking
237
+ * transaction.
238
+ *
239
+ * @param {Transaction} stakingTx - The staking transaction to withdraw from.
240
+ * @param {number} feeRate - The fee rate for the transaction in satoshis per byte.
241
+ * @returns {PsbtResult} - An object containing the unsigned psbt and fee
242
+ * @throws {StakingError} - If the delegation is invalid or the transaction cannot be built
243
+ */
244
+ createWithdrawStakingExpiredPsbt(stakingTx: Transaction, feeRate: number): PsbtResult;
245
+ /**
246
+ * Create a slashing psbt spending from the staking output.
247
+ *
248
+ * @param {Transaction} stakingTx - The staking transaction to slash.
249
+ * @returns {PsbtResult} - An object containing the unsigned psbt and fee
250
+ * @throws {StakingError} - If the delegation is invalid or the transaction cannot be built
251
+ */
252
+ createStakingOutputSlashingPsbt(stakingTx: Transaction): PsbtResult;
253
+ /**
254
+ * Create a slashing psbt for an unbonding output.
255
+ *
256
+ * @param {Transaction} unbondingTx - The unbonding transaction to slash.
257
+ * @returns {PsbtResult} - An object containing the unsigned psbt and fee
258
+ * @throws {StakingError} - If the delegation is invalid or the transaction cannot be built
259
+ */
260
+ createUnbondingOutputSlashingPsbt(unbondingTx: Transaction): PsbtResult;
261
+ /**
262
+ * Create a withdraw slashing psbt that spends a slashing transaction from the
263
+ * staking output.
264
+ *
265
+ * @param {Transaction} slashingTx - The slashing transaction.
266
+ * @param {number} feeRate - The fee rate for the transaction in satoshis per byte.
267
+ * @returns {PsbtResult} - An object containing the unsigned psbt and fee
268
+ * @throws {StakingError} - If the delegation is invalid or the transaction cannot be built
269
+ */
270
+ createWithdrawSlashingPsbt(slashingTx: Transaction, feeRate: number): PsbtResult;
271
+ }
272
+ export interface ObservableStakingScripts extends StakingScripts {
273
+ dataEmbedScript: Buffer;
274
+ }
275
+ export declare class ObservableStakingScriptData extends StakingScriptData {
276
+ magicBytes: Buffer;
277
+ constructor(stakerKey: Buffer, finalityProviderKeys: Buffer[], covenantKeys: Buffer[], covenantThreshold: number, stakingTimelock: number, unbondingTimelock: number, magicBytes: Buffer);
278
+ /**
279
+ * Builds a data embed script for staking in the form:
280
+ * OP_RETURN || <serializedStakingData>
281
+ * where serializedStakingData is the concatenation of:
282
+ * MagicBytes || Version || StakerPublicKey || FinalityProviderPublicKey || StakingTimeLock
283
+ * Note: Only a single finality provider key is supported for now in phase 1
284
+ * @throws {Error} If the number of finality provider keys is not equal to 1.
285
+ * @returns {Buffer} The compiled data embed script.
286
+ */
287
+ buildDataEmbedScript(): Buffer;
288
+ /**
289
+ * Builds the staking scripts.
290
+ * @returns {ObservableStakingScripts} The staking scripts that can be used to stake.
291
+ * contains the timelockScript, unbondingScript, slashingScript,
292
+ * unbondingTimelockScript, and dataEmbedScript.
293
+ * @throws {Error} If script data is invalid.
294
+ */
295
+ buildScripts(): ObservableStakingScripts;
296
+ }
297
+ /**
298
+ * ObservableStaking is a class that provides an interface to create observable
299
+ * staking transactions for the Babylon Staking protocol.
300
+ *
301
+ * The class requires a network and staker information to create staking
302
+ * transactions.
303
+ * The staker information includes the staker's address and
304
+ * public key(without coordinates).
305
+ */
306
+ export declare class ObservableStaking extends Staking {
307
+ params: ObservableVersionedStakingParams;
308
+ constructor(network: networks.Network, stakerInfo: StakerInfo, params: ObservableVersionedStakingParams, finalityProviderPkNoCoordHex: string, stakingTimelock: number);
309
+ /**
310
+ * Build the staking scripts for observable staking.
311
+ * This method overwrites the base method to include the OP_RETURN tag based
312
+ * on the tag provided in the parameters.
313
+ *
314
+ * @returns {ObservableStakingScripts} - The staking scripts for observable staking.
315
+ * @throws {StakingError} - If the scripts cannot be built.
316
+ */
317
+ buildScripts(): ObservableStakingScripts;
318
+ /**
319
+ * Create a staking transaction for observable staking.
320
+ * This overwrites the method from the Staking class with the addtion
321
+ * of the
322
+ * 1. OP_RETURN tag in the staking scripts
323
+ * 2. lockHeight parameter
324
+ *
325
+ * @param {number} stakingAmountSat - The amount to stake in satoshis.
326
+ * @param {UTXO[]} inputUTXOs - The UTXOs to use as inputs for the staking
327
+ * transaction.
328
+ * @param {number} feeRate - The fee rate for the transaction in satoshis per byte.
329
+ * @returns {TransactionResult} - An object containing the unsigned transaction,
330
+ * and fee
331
+ */
332
+ createStakingTransaction(stakingAmountSat: number, inputUTXOs: UTXO[], feeRate: number): TransactionResult;
333
+ /**
334
+ * Create a staking psbt for observable staking.
335
+ *
336
+ * @param {Transaction} stakingTx - The staking transaction.
337
+ * @param {UTXO[]} inputUTXOs - The UTXOs to use as inputs for the staking
338
+ * transaction.
339
+ * @returns {Psbt} - The psbt.
340
+ */
341
+ toStakingPsbt(stakingTx: Transaction, inputUTXOs: UTXO[]): Psbt;
342
+ }
343
+ export interface CovenantSignature {
344
+ btcPkHex: string;
345
+ sigHex: string;
346
+ }
347
+ /**
348
+ * Constructs an unsigned BTC Staking transaction in psbt format.
349
+ *
350
+ * Outputs:
351
+ * - psbt:
352
+ * - The first output corresponds to the staking script with the specified amount.
353
+ * - The second output corresponds to the change from spending the amount and the transaction fee.
354
+ * - If a data embed script is provided, it will be added as the second output, and the fee will be the third output.
355
+ * - fee: The total fee amount for the transaction.
356
+ *
357
+ * Inputs:
358
+ * - scripts:
359
+ * - timelockScript, unbondingScript, slashingScript: Scripts for different transaction types.
360
+ * - dataEmbedScript: Optional data embed script.
361
+ * - amount: Amount to stake.
362
+ * - changeAddress: Address to send the change to.
363
+ * - inputUTXOs: All available UTXOs from the wallet.
364
+ * - network: Bitcoin network.
365
+ * - feeRate: Fee rate in satoshis per byte.
366
+ * - publicKeyNoCoord: Public key if the wallet is in taproot mode.
367
+ * - lockHeight: Optional block height locktime to set for the transaction (i.e., not mined until the block height).
368
+ *
369
+ * @param {Object} scripts - Scripts used to construct the taproot output.
370
+ * such as timelockScript, unbondingScript, slashingScript, and dataEmbedScript.
371
+ * @param {number} amount - The amount to stake.
372
+ * @param {string} changeAddress - The address to send the change to.
373
+ * @param {UTXO[]} inputUTXOs - All available UTXOs from the wallet.
374
+ * @param {networks.Network} network - The Bitcoin network.
375
+ * @param {number} feeRate - The fee rate in satoshis per byte.
376
+ * @param {number} [lockHeight] - The optional block height locktime.
377
+ * @returns {TransactionResult} - An object containing the unsigned transaction and fee
378
+ * @throws Will throw an error if the amount or fee rate is less than or equal
379
+ * to 0, if the change address is invalid, or if the public key is invalid.
380
+ */
381
+ export declare function stakingTransaction(scripts: {
382
+ timelockScript: Buffer;
383
+ unbondingScript: Buffer;
384
+ slashingScript: Buffer;
385
+ dataEmbedScript?: Buffer;
386
+ }, amount: number, changeAddress: string, inputUTXOs: UTXO[], network: networks.Network, feeRate: number, lockHeight?: number): TransactionResult;
387
+ /**
388
+ * Constructs a withdrawal transaction for manually unbonded delegation.
389
+ *
390
+ * This transaction spends the unbonded output from the staking transaction.
391
+ *
392
+ * Inputs:
393
+ * - scripts: Scripts used to construct the taproot output.
394
+ * - unbondingTimelockScript: Script for the unbonding timelock condition.
395
+ * - slashingScript: Script for the slashing condition.
396
+ * - unbondingTx: The unbonding transaction.
397
+ * - withdrawalAddress: The address to send the withdrawn funds to.
398
+ * - network: The Bitcoin network.
399
+ * - feeRate: The fee rate for the transaction in satoshis per byte.
400
+ *
401
+ * Returns:
402
+ * - psbt: The partially signed transaction (PSBT).
403
+ *
404
+ * @param {Object} scripts - The scripts used in the transaction.
405
+ * @param {Transaction} unbondingTx - The unbonding transaction.
406
+ * @param {string} withdrawalAddress - The address to send the withdrawn funds to.
407
+ * @param {networks.Network} network - The Bitcoin network.
408
+ * @param {number} feeRate - The fee rate for the transaction in satoshis per byte.
409
+ * @returns {PsbtResult} An object containing the partially signed transaction (PSBT).
410
+ */
411
+ export declare function withdrawEarlyUnbondedTransaction(scripts: {
412
+ unbondingTimelockScript: Buffer;
413
+ slashingScript: Buffer;
414
+ }, unbondingTx: Transaction, withdrawalAddress: string, network: networks.Network, feeRate: number): PsbtResult;
415
+ /**
416
+ * Constructs a withdrawal transaction for naturally unbonded delegation.
417
+ *
418
+ * This transaction spends the unbonded output from the staking transaction when the timelock has expired.
419
+ *
420
+ * Inputs:
421
+ * - scripts: Scripts used to construct the taproot output.
422
+ * - timelockScript: Script for the timelock condition.
423
+ * - slashingScript: Script for the slashing condition.
424
+ * - unbondingScript: Script for the unbonding condition.
425
+ * - tx: The original staking transaction.
426
+ * - withdrawalAddress: The address to send the withdrawn funds to.
427
+ * - network: The Bitcoin network.
428
+ * - feeRate: The fee rate for the transaction in satoshis per byte.
429
+ * - outputIndex: The index of the output to be spent in the original transaction (default is 0).
430
+ *
431
+ * Returns:
432
+ * - psbt: The partially signed transaction (PSBT).
433
+ *
434
+ * @param {Object} scripts - The scripts used in the transaction.
435
+ * @param {Transaction} tx - The original staking transaction.
436
+ * @param {string} withdrawalAddress - The address to send the withdrawn funds to.
437
+ * @param {networks.Network} network - The Bitcoin network.
438
+ * @param {number} feeRate - The fee rate for the transaction in satoshis per byte.
439
+ * @param {number} [outputIndex=0] - The index of the output to be spent in the original transaction.
440
+ * @returns {PsbtResult} An object containing the partially signed transaction (PSBT).
441
+ */
442
+ export declare function withdrawTimelockUnbondedTransaction(scripts: {
443
+ timelockScript: Buffer;
444
+ slashingScript: Buffer;
445
+ unbondingScript: Buffer;
446
+ }, tx: Transaction, withdrawalAddress: string, network: networks.Network, feeRate: number, outputIndex?: number): PsbtResult;
447
+ /**
448
+ * Constructs a withdrawal transaction for a slashing transaction.
449
+ *
450
+ * This transaction spends the output from the slashing transaction.
451
+ *
452
+ * @param {Object} scripts - The unbondingTimelockScript
453
+ * We use the unbonding timelock script as the timelock of the slashing transaction.
454
+ * This is due to slashing tx timelock is the same as the unbonding timelock.
455
+ * @param {Transaction} slashingTx - The slashing transaction.
456
+ * @param {string} withdrawalAddress - The address to send the withdrawn funds to.
457
+ * @param {networks.Network} network - The Bitcoin network.
458
+ * @param {number} feeRate - The fee rate for the transaction in satoshis per byte.
459
+ * @param {number} outputIndex - The index of the output to be spent in the original transaction.
460
+ * @returns {PsbtResult} An object containing the partially signed transaction (PSBT).
461
+ */
462
+ export declare function withdrawSlashingTransaction(scripts: {
463
+ unbondingTimelockScript: Buffer;
464
+ }, slashingTx: Transaction, withdrawalAddress: string, network: networks.Network, feeRate: number, outputIndex: number): PsbtResult;
465
+ /**
466
+ * Constructs a slashing transaction for a staking output without prior unbonding.
467
+ *
468
+ * This transaction spends the staking output of the staking transaction and distributes the funds
469
+ * according to the specified slashing rate.
470
+ *
471
+ * Outputs:
472
+ * - The first output sends `input * slashing_rate` funds to the slashing address.
473
+ * - The second output sends `input * (1 - slashing_rate) - fee` funds back to the user's address.
474
+ *
475
+ * Inputs:
476
+ * - scripts: Scripts used to construct the taproot output.
477
+ * - slashingScript: Script for the slashing condition.
478
+ * - timelockScript: Script for the timelock condition.
479
+ * - unbondingScript: Script for the unbonding condition.
480
+ * - unbondingTimelockScript: Script for the unbonding timelock condition.
481
+ * - transaction: The original staking transaction.
482
+ * - slashingAddress: The address to send the slashed funds to.
483
+ * - slashingRate: The rate at which the funds are slashed (0 < slashingRate < 1).
484
+ * - minimumFee: The minimum fee for the transaction in satoshis.
485
+ * - network: The Bitcoin network.
486
+ * - outputIndex: The index of the output to be spent in the original transaction (default is 0).
487
+ *
488
+ * @param {Object} scripts - The scripts used in the transaction.
489
+ * @param {Transaction} stakingTransaction - The original staking transaction.
490
+ * @param {string} slashingPkScriptHex - The public key script to send the slashed funds to.
491
+ * @param {number} slashingRate - The rate at which the funds are slashed.
492
+ * @param {number} minimumFee - The minimum fee for the transaction in satoshis.
493
+ * @param {networks.Network} network - The Bitcoin network.
494
+ * @param {number} [outputIndex=0] - The index of the output to be spent in the original transaction.
495
+ * @returns {{ psbt: Psbt }} An object containing the partially signed transaction (PSBT).
496
+ */
497
+ export declare function slashTimelockUnbondedTransaction(scripts: {
498
+ slashingScript: Buffer;
499
+ timelockScript: Buffer;
500
+ unbondingScript: Buffer;
501
+ unbondingTimelockScript: Buffer;
502
+ }, stakingTransaction: Transaction, slashingPkScriptHex: string, slashingRate: number, minimumFee: number, network: networks.Network, outputIndex?: number): {
503
+ psbt: Psbt;
504
+ };
505
+ /**
506
+ * Constructs a slashing transaction for an early unbonded transaction.
507
+ *
508
+ * This transaction spends the staking output of the staking transaction and distributes the funds
509
+ * according to the specified slashing rate.
510
+ *
511
+ * Transaction outputs:
512
+ * - The first output sends `input * slashing_rate` funds to the slashing address.
513
+ * - The second output sends `input * (1 - slashing_rate) - fee` funds back to the user's address.
514
+ *
515
+ * @param {Object} scripts - The scripts used in the transaction. e.g slashingScript, unbondingTimelockScript
516
+ * @param {Transaction} unbondingTx - The unbonding transaction.
517
+ * @param {string} slashingPkScriptHex - The public key script to send the slashed funds to.
518
+ * @param {number} slashingRate - The rate at which the funds are slashed.
519
+ * @param {number} minimumSlashingFee - The minimum fee for the transaction in satoshis.
520
+ * @param {networks.Network} network - The Bitcoin network.
521
+ * @returns {{ psbt: Psbt }} An object containing the partially signed transaction (PSBT).
522
+ */
523
+ export declare function slashEarlyUnbondedTransaction(scripts: {
524
+ slashingScript: Buffer;
525
+ unbondingTimelockScript: Buffer;
526
+ }, unbondingTx: Transaction, slashingPkScriptHex: string, slashingRate: number, minimumSlashingFee: number, network: networks.Network): {
527
+ psbt: Psbt;
528
+ };
529
+ export declare function unbondingTransaction(scripts: {
530
+ unbondingTimelockScript: Buffer;
531
+ slashingScript: Buffer;
532
+ }, stakingTx: Transaction, unbondingFee: number, network: networks.Network, outputIndex?: number): TransactionResult;
533
+ export declare const createCovenantWitness: (originalWitness: Buffer[], paramsCovenants: Buffer[], covenantSigs: CovenantSignature[], covenantQuorum: number) => Buffer<ArrayBufferLike>[];
534
+ export declare const initBTCCurve: () => void;
535
+ /**
536
+ * Check whether the given address is a valid Bitcoin address.
537
+ *
538
+ * @param {string} btcAddress - The Bitcoin address to check.
539
+ * @param {object} network - The Bitcoin network (e.g., bitcoin.networks.bitcoin).
540
+ * @returns {boolean} - True if the address is valid, otherwise false.
541
+ */
542
+ export declare const isValidBitcoinAddress: (btcAddress: string, network: networks.Network) => boolean;
543
+ /**
544
+ * Check whether the given address is a Taproot address.
545
+ *
546
+ * @param {string} taprootAddress - The Bitcoin bech32 encoded address to check.
547
+ * @param {object} network - The Bitcoin network (e.g., bitcoin.networks.bitcoin).
548
+ * @returns {boolean} - True if the address is a Taproot address, otherwise false.
549
+ */
550
+ export declare const isTaproot: (taprootAddress: string, network: networks.Network) => boolean;
551
+ /**
552
+ * Check whether the given public key is a valid public key without a coordinate.
553
+ *
554
+ * @param {string} pkWithNoCoord - public key without the coordinate.
555
+ * @returns {boolean} - True if the public key without the coordinate is valid, otherwise false.
556
+ */
557
+ export declare const isValidNoCoordPublicKey: (pkWithNoCoord: string) => boolean;
558
+ /**
559
+ * Get the public key without the coordinate.
560
+ *
561
+ * @param {string} pkHex - The public key in hex, with or without the coordinate.
562
+ * @returns {string} - The public key without the coordinate in hex.
563
+ * @throws {Error} - If the public key is invalid.
564
+ */
565
+ export declare const getPublicKeyNoCoord: (pkHex: string) => String;
566
+ /**
567
+ * Convert a transaction id to a hash. in buffer format.
568
+ *
569
+ * @param {string} txId - The transaction id.
570
+ * @returns {Buffer} - The transaction hash.
571
+ */
572
+ export declare const transactionIdToHash: (txId: string) => Buffer;
573
+ /**
574
+ * Validates a Babylon address. Babylon addresses are encoded in Bech32 format
575
+ * and have a prefix of "bbn".
576
+ * @param address - The address to validate.
577
+ * @returns True if the address is valid, false otherwise.
578
+ */
579
+ export declare const isValidBabylonAddress: (address: string) => boolean;
580
+ export type TransactionOutput = {
581
+ scriptPubKey: Buffer;
582
+ value: number;
583
+ };
584
+ export interface OutputInfo {
585
+ scriptPubKey: Buffer;
586
+ outputAddress: string;
587
+ }
588
+ /**
589
+ * Build the staking output for the transaction which contains p2tr output
590
+ * with staking scripts.
591
+ *
592
+ * @param {StakingScripts} scripts - The staking scripts.
593
+ * @param {networks.Network} network - The Bitcoin network.
594
+ * @param {number} amount - The amount to stake.
595
+ * @returns {TransactionOutput[]} - The staking transaction outputs.
596
+ * @throws {Error} - If the staking output cannot be built.
597
+ */
598
+ export declare const buildStakingTransactionOutputs: (scripts: {
599
+ timelockScript: Buffer;
600
+ unbondingScript: Buffer;
601
+ slashingScript: Buffer;
602
+ dataEmbedScript?: Buffer;
603
+ }, network: networks.Network, amount: number) => TransactionOutput[];
604
+ /**
605
+ * Derive the staking output address from the staking scripts.
606
+ *
607
+ * @param {StakingScripts} scripts - The staking scripts.
608
+ * @param {networks.Network} network - The Bitcoin network.
609
+ * @returns {StakingOutput} - The staking output address and scriptPubKey.
610
+ * @throws {StakingError} - If the staking output address cannot be derived.
611
+ */
612
+ export declare const deriveStakingOutputInfo: (scripts: {
613
+ timelockScript: Buffer;
614
+ unbondingScript: Buffer;
615
+ slashingScript: Buffer;
616
+ }, network: networks.Network) => {
617
+ outputAddress: string;
618
+ scriptPubKey: Buffer<ArrayBufferLike>;
619
+ };
620
+ /**
621
+ * Derive the unbonding output address and scriptPubKey from the staking scripts.
622
+ *
623
+ * @param {StakingScripts} scripts - The staking scripts.
624
+ * @param {networks.Network} network - The Bitcoin network.
625
+ * @returns {OutputInfo} - The unbonding output address and scriptPubKey.
626
+ * @throws {StakingError} - If the unbonding output address cannot be derived.
627
+ */
628
+ export declare const deriveUnbondingOutputInfo: (scripts: {
629
+ unbondingTimelockScript: Buffer;
630
+ slashingScript: Buffer;
631
+ }, network: networks.Network) => {
632
+ outputAddress: string;
633
+ scriptPubKey: Buffer<ArrayBufferLike>;
634
+ };
635
+ /**
636
+ * Derive the slashing output address and scriptPubKey from the staking scripts.
637
+ *
638
+ * @param {StakingScripts} scripts - The unbonding timelock scripts, we use the
639
+ * unbonding timelock script as the timelock of the slashing transaction.
640
+ * This is due to slashing tx timelock is the same as the unbonding timelock.
641
+ * @param {networks.Network} network - The Bitcoin network.
642
+ * @returns {OutputInfo} - The slashing output address and scriptPubKey.
643
+ * @throws {StakingError} - If the slashing output address cannot be derived.
644
+ */
645
+ export declare const deriveSlashingOutput: (scripts: {
646
+ unbondingTimelockScript: Buffer;
647
+ }, network: networks.Network) => {
648
+ outputAddress: string;
649
+ scriptPubKey: Buffer<ArrayBufferLike>;
650
+ };
651
+ /**
652
+ * Find the matching output index for the given transaction.
653
+ *
654
+ * @param {Transaction} tx - The transaction.
655
+ * @param {string} outputAddress - The output address.
656
+ * @param {networks.Network} network - The Bitcoin network.
657
+ * @returns {number} - The output index.
658
+ * @throws {Error} - If the matching output is not found.
659
+ */
660
+ export declare const findMatchingTxOutputIndex: (tx: Transaction, outputAddress: string, network: networks.Network) => number;
661
+ /**
662
+ * Validate the staking transaction input data.
663
+ *
664
+ * @param {number} stakingAmountSat - The staking amount in satoshis.
665
+ * @param {number} timelock - The staking time in blocks.
666
+ * @param {StakingParams} params - The staking parameters.
667
+ * @param {UTXO[]} inputUTXOs - The input UTXOs.
668
+ * @param {number} feeRate - The Bitcoin fee rate in sat/vbyte
669
+ * @throws {StakingError} - If the input data is invalid.
670
+ */
671
+ export declare const validateStakingTxInputData: (stakingAmountSat: number, timelock: number, params: StakingParams, inputUTXOs: UTXO[], feeRate: number) => void;
672
+ /**
673
+ * Validate the staking parameters.
674
+ * Extend this method to add additional validation for staking parameters based
675
+ * on the staking type.
676
+ * @param {StakingParams} params - The staking parameters.
677
+ * @throws {StakingError} - If the parameters are invalid.
678
+ */
679
+ export declare const validateParams: (params: StakingParams) => void;
680
+ /**
681
+ * Validate the staking timelock.
682
+ *
683
+ * @param {number} stakingTimelock - The staking timelock.
684
+ * @param {StakingParams} params - The staking parameters.
685
+ * @throws {StakingError} - If the staking timelock is invalid.
686
+ */
687
+ export declare const validateStakingTimelock: (stakingTimelock: number, params: StakingParams) => void;
688
+ /**
689
+ * toBuffers converts an array of strings to an array of buffers.
690
+ *
691
+ * @param {string[]} inputs - The input strings.
692
+ * @returns {Buffer[]} - The buffers.
693
+ * @throws {StakingError} - If the values cannot be converted to buffers.
694
+ */
695
+ export declare const toBuffers: (inputs: string[]) => Buffer[];
696
+ export declare const findInputUTXO: (inputUTXOs: UTXO[], input: Input) => UTXO;
697
+ /**
698
+ * Determines and constructs the correct PSBT input fields for a given UTXO based on its script type.
699
+ * This function handles different Bitcoin script types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR) and returns
700
+ * the appropriate PSBT input fields required for that UTXO.
701
+ *
702
+ * @param {UTXO} utxo - The unspent transaction output to process
703
+ * @param {Buffer} [publicKeyNoCoord] - The public of the staker (optional).
704
+ * @returns {object} PSBT input fields object containing the necessary data
705
+ * @throws {Error} If required input data is missing or if an unsupported script type is provided
706
+ */
707
+ export declare const getPsbtInputFields: (utxo: UTXO, publicKeyNoCoord?: Buffer) => PsbtInputExtended;
708
+ /**
709
+ * Supported Bitcoin script types
710
+ */
711
+ export declare enum BitcoinScriptType {
712
+ P2PKH = "pubkeyhash",
713
+ P2SH = "scripthash",
714
+ P2WPKH = "witnesspubkeyhash",
715
+ P2WSH = "witnessscripthash",
716
+ P2TR = "taproot"
717
+ }
718
+ /**
719
+ * Determines the type of Bitcoin script.
720
+ *
721
+ * This function tries to parse the script using different Bitcoin payment types and returns
722
+ * a string identifier for the script type.
723
+ *
724
+ * @param script - The raw script as a Buffer
725
+ * @returns {BitcoinScriptType} The identified script type
726
+ * @throws {Error} If the script cannot be identified as any known type
727
+ */
728
+ export declare const getScriptType: (script: Buffer) => BitcoinScriptType;
729
+ export declare const getBabylonParamByBtcHeight: (height: number, babylonParamsVersions: VersionedStakingParams[]) => StakingParams;
730
+ export declare const getBabylonParamByVersion: (version: number, babylonParams: VersionedStakingParams[]) => StakingParams;
731
+ export interface BtcProvider {
732
+ signPsbt(signingStep: SigningStep, psbtHex: string): Promise<string>;
733
+ signMessage?: (signingStep: SigningStep, message: string, type: "ecdsa") => Promise<string>;
734
+ }
735
+ export interface BabylonProvider {
736
+ signTransaction: <T extends object>(signingStep: SigningStep, msg: {
737
+ typeUrl: string;
738
+ value: T;
739
+ }) => Promise<Uint8Array>;
740
+ }
741
+ export declare enum SigningStep {
742
+ STAKING_SLASHING = "staking-slashing",
743
+ UNBONDING_SLASHING = "unbonding-slashing",
744
+ PROOF_OF_POSSESSION = "proof-of-possession",
745
+ CREATE_BTC_DELEGATION_MSG = "create-btc-delegation-msg",
746
+ STAKING = "staking",
747
+ UNBONDING = "unbonding",
748
+ WITHDRAW_STAKING_EXPIRED = "withdraw-staking-expired",
749
+ WITHDRAW_EARLY_UNBONDED = "withdraw-early-unbonded",
750
+ WITHDRAW_SLASHING = "withdraw-slashing"
751
+ }
752
+ export interface StakingInputs {
753
+ finalityProviderPkNoCoordHex: string;
754
+ stakingAmountSat: number;
755
+ stakingTimelock: number;
756
+ }
757
+ export interface InclusionProof {
758
+ pos: number;
759
+ merkle: string[];
760
+ blockHashHex: string;
761
+ }
762
+ export declare class BabylonBtcStakingManager {
763
+ private stakingParams;
764
+ private btcProvider;
765
+ private network;
766
+ private babylonProvider;
767
+ constructor(network: networks.Network, stakingParams: VersionedStakingParams[], btcProvider: BtcProvider, babylonProvider: BabylonProvider);
768
+ /**
769
+ * Creates a signed Pre-Staking Registration transaction that is ready to be
770
+ * sent to the Babylon chain.
771
+ * @param stakerBtcInfo - The staker BTC info which includes the BTC address
772
+ * and the no-coord public key in hex format.
773
+ * @param stakingInput - The staking inputs.
774
+ * @param babylonBtcTipHeight - The Babylon BTC tip height.
775
+ * @param inputUTXOs - The UTXOs that will be used to pay for the staking
776
+ * transaction.
777
+ * @param feeRate - The fee rate in satoshis per byte.
778
+ * @param babylonAddress - The Babylon bech32 encoded address of the staker.
779
+ * @returns The signed babylon pre-staking registration transaction in base64
780
+ * format.
781
+ */
782
+ preStakeRegistrationBabylonTransaction(stakerBtcInfo: StakerInfo, stakingInput: StakingInputs, babylonBtcTipHeight: number, inputUTXOs: UTXO[], feeRate: number, babylonAddress: string): Promise<{
783
+ signedBabylonTx: Uint8Array;
784
+ stakingTx: Transaction;
785
+ }>;
786
+ /**
787
+ * Creates a signed post-staking registration transaction that is ready to be
788
+ * sent to the Babylon chain. This is used when a staking transaction is
789
+ * already created and included in a BTC block and we want to register it on
790
+ * the Babylon chain.
791
+ * @param stakerBtcInfo - The staker BTC info which includes the BTC address
792
+ * and the no-coord public key in hex format.
793
+ * @param stakingTx - The staking transaction.
794
+ * @param stakingTxHeight - The BTC height in which the staking transaction
795
+ * is included.
796
+ * @param stakingInput - The staking inputs.
797
+ * @param inclusionProof - The inclusion proof of the staking transaction.
798
+ * @param babylonAddress - The Babylon bech32 encoded address of the staker.
799
+ * @returns The signed babylon transaction in base64 format.
800
+ */
801
+ postStakeRegistrationBabylonTransaction(stakerBtcInfo: StakerInfo, stakingTx: Transaction, stakingTxHeight: number, stakingInput: StakingInputs, inclusionProof: InclusionProof, babylonAddress: string): Promise<{
802
+ signedBabylonTx: Uint8Array;
803
+ }>;
804
+ /**
805
+ * Estimates the BTC fee required for staking.
806
+ * @param stakerBtcInfo - The staker BTC info which includes the BTC address
807
+ * and the no-coord public key in hex format.
808
+ * @param babylonBtcTipHeight - The BTC tip height recorded on the Babylon
809
+ * chain.
810
+ * @param stakingInput - The staking inputs.
811
+ * @param inputUTXOs - The UTXOs that will be used to pay for the staking
812
+ * transaction.
813
+ * @param feeRate - The fee rate in satoshis per byte.
814
+ * @returns The estimated BTC fee in satoshis.
815
+ */
816
+ estimateBtcStakingFee(stakerBtcInfo: StakerInfo, babylonBtcTipHeight: number, stakingInput: StakingInputs, inputUTXOs: UTXO[], feeRate: number): number;
817
+ /**
818
+ * Creates a signed staking transaction that is ready to be sent to the BTC
819
+ * network.
820
+ * @param stakerBtcInfo - The staker BTC info which includes the BTC address
821
+ * and the no-coord public key in hex format.
822
+ * @param stakingInput - The staking inputs.
823
+ * @param unsignedStakingTx - The unsigned staking transaction.
824
+ * @param inputUTXOs - The UTXOs that will be used to pay for the staking
825
+ * transaction.
826
+ * @param stakingParamsVersion - The params version that was used to create the
827
+ * delegation in Babylon chain
828
+ * @returns The signed staking transaction.
829
+ */
830
+ createSignedBtcStakingTransaction(stakerBtcInfo: StakerInfo, stakingInput: StakingInputs, unsignedStakingTx: Transaction, inputUTXOs: UTXO[], stakingParamsVersion: number): Promise<Transaction>;
831
+ /**
832
+ * Creates a partial signed unbonding transaction that is only signed by the
833
+ * staker. In order to complete the unbonding transaction, the covenant
834
+ * unbonding signatures need to be added to the transaction before sending it
835
+ * to the BTC network.
836
+ * NOTE: This method should only be used for Babylon phase-1 unbonding.
837
+ * @param stakerBtcInfo - The staker BTC info which includes the BTC address
838
+ * and the no-coord public key in hex format.
839
+ * @param stakingInput - The staking inputs.
840
+ * @param stakingParamsVersion - The params version that was used to create the
841
+ * delegation in Babylon chain
842
+ * @param stakingTx - The staking transaction.
843
+ * @returns The partial signed unbonding transaction and its fee.
844
+ */
845
+ createPartialSignedBtcUnbondingTransaction(stakerBtcInfo: StakerInfo, stakingInput: StakingInputs, stakingParamsVersion: number, stakingTx: Transaction): Promise<TransactionResult>;
846
+ /**
847
+ * Creates a signed unbonding transaction that is ready to be sent to the BTC
848
+ * network.
849
+ * @param stakerBtcInfo - The staker BTC info which includes the BTC address
850
+ * and the no-coord public key in hex format.
851
+ * @param stakingInput - The staking inputs.
852
+ * @param stakingParamsVersion - The params version that was used to create the
853
+ * delegation in Babylon chain
854
+ * @param stakingTx - The staking transaction.
855
+ * @param unsignedUnbondingTx - The unsigned unbonding transaction.
856
+ * @param covenantUnbondingSignatures - The covenant unbonding signatures.
857
+ * It can be retrieved from the Babylon chain or API.
858
+ * @returns The signed unbonding transaction and its fee.
859
+ */
860
+ createSignedBtcUnbondingTransaction(stakerBtcInfo: StakerInfo, stakingInput: StakingInputs, stakingParamsVersion: number, stakingTx: Transaction, unsignedUnbondingTx: Transaction, covenantUnbondingSignatures: {
861
+ btcPkHex: string;
862
+ sigHex: string;
863
+ }[]): Promise<TransactionResult>;
864
+ /**
865
+ * Creates a signed withdrawal transaction on the unbodning output expiry path
866
+ * that is ready to be sent to the BTC network.
867
+ * @param stakingInput - The staking inputs.
868
+ * @param stakingParamsVersion - The params version that was used to create the
869
+ * delegation in Babylon chain
870
+ * @param earlyUnbondingTx - The early unbonding transaction.
871
+ * @param feeRate - The fee rate in satoshis per byte.
872
+ * @returns The signed withdrawal transaction and its fee.
873
+ */
874
+ createSignedBtcWithdrawEarlyUnbondedTransaction(stakerBtcInfo: StakerInfo, stakingInput: StakingInputs, stakingParamsVersion: number, earlyUnbondingTx: Transaction, feeRate: number): Promise<TransactionResult>;
875
+ /**
876
+ * Creates a signed withdrawal transaction on the staking output expiry path
877
+ * that is ready to be sent to the BTC network.
878
+ * @param stakerBtcInfo - The staker BTC info which includes the BTC address
879
+ * and the no-coord public key in hex format.
880
+ * @param stakingInput - The staking inputs.
881
+ * @param stakingParamsVersion - The params version that was used to create the
882
+ * delegation in Babylon chain
883
+ * @param stakingTx - The staking transaction.
884
+ * @param feeRate - The fee rate in satoshis per byte.
885
+ * @returns The signed withdrawal transaction and its fee.
886
+ */
887
+ createSignedBtcWithdrawStakingExpiredTransaction(stakerBtcInfo: StakerInfo, stakingInput: StakingInputs, stakingParamsVersion: number, stakingTx: Transaction, feeRate: number): Promise<TransactionResult>;
888
+ /**
889
+ * Creates a signed withdrawal transaction for the expired slashing output that
890
+ * is ready to be sent to the BTC network.
891
+ * @param stakerBtcInfo - The staker BTC info which includes the BTC address
892
+ * and the no-coord public key in hex format.
893
+ * @param stakingInput - The staking inputs.
894
+ * @param stakingParamsVersion - The params version that was used to create the
895
+ * delegation in Babylon chain
896
+ * @param slashingTx - The slashing transaction.
897
+ * @param feeRate - The fee rate in satoshis per byte.
898
+ * @returns The signed withdrawal transaction and its fee.
899
+ */
900
+ createSignedBtcWithdrawSlashingTransaction(stakerBtcInfo: StakerInfo, stakingInput: StakingInputs, stakingParamsVersion: number, slashingTx: Transaction, feeRate: number): Promise<TransactionResult>;
901
+ /**
902
+ * Creates a proof of possession for the staker based on ECDSA signature.
903
+ * @param bech32Address - The staker's bech32 address.
904
+ * @returns The proof of possession.
905
+ */
906
+ createProofOfPossession(bech32Address: string): Promise<ProofOfPossessionBTC>;
907
+ /**
908
+ * Creates the unbonding, slashing, and unbonding slashing transactions and
909
+ * PSBTs.
910
+ * @param stakingInstance - The staking instance.
911
+ * @param stakingTx - The staking transaction.
912
+ * @returns The unbonding, slashing, and unbonding slashing transactions and
913
+ * PSBTs.
914
+ */
915
+ private createDelegationTransactionsAndPsbts;
916
+ /**
917
+ * Creates a protobuf message for the BTC delegation.
918
+ * @param stakingInstance - The staking instance.
919
+ * @param stakingInput - The staking inputs.
920
+ * @param stakingTx - The staking transaction.
921
+ * @param bech32Address - The staker's babylon chain bech32 address
922
+ * @param stakerBtcInfo - The staker's BTC information such as address and
923
+ * public key
924
+ * @param params - The staking parameters.
925
+ * @param inclusionProof - The inclusion proof of the staking transaction.
926
+ * @returns The protobuf message.
927
+ */
928
+ createBtcDelegationMsg(stakingInstance: Staking, stakingInput: StakingInputs, stakingTx: Transaction, bech32Address: string, stakerBtcInfo: StakerInfo, params: StakingParams, inclusionProof?: btcstaking.InclusionProof): Promise<{
929
+ typeUrl: string;
930
+ value: btcstakingtx.MsgCreateBTCDelegation;
931
+ }>;
932
+ /**
933
+ * Gets the inclusion proof for the staking transaction.
934
+ * See the type `InclusionProof` for more information
935
+ * @param inclusionProof - The inclusion proof.
936
+ * @returns The inclusion proof.
937
+ */
938
+ private getInclusionProof;
939
+ }
940
+ /**
941
+ * Get the staker signature from the unbonding transaction
942
+ * This is used mostly for unbonding transactions from phase-1(Observable)
943
+ * @param unbondingTx - The unbonding transaction
944
+ * @returns The staker signature
945
+ */
946
+ export declare const getUnbondingTxStakerSignature: (unbondingTx: Transaction) => string;
947
+
948
+ export {};