@scure/btc-signer 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/transaction.d.ts CHANGED
@@ -3,7 +3,17 @@ import { type CustomScript } from './payment.ts';
3
3
  import * as psbt from './psbt.ts';
4
4
  import { RawOutput } from './script.ts';
5
5
  import * as u from './utils.ts';
6
- import { type Bytes } from './utils.ts';
6
+ import { type Bytes, type TArg, type TRet } from './utils.ts';
7
+ /**
8
+ * Converts transaction weight units into virtual bytes.
9
+ * @param weight - transaction weight
10
+ * @returns Rounded-up virtual size.
11
+ * @example
12
+ * Convert transaction weight units into virtual bytes.
13
+ * ```ts
14
+ * toVsize(4);
15
+ * ```
16
+ */
7
17
  export declare const toVsize: (weight: number) => number;
8
18
  interface HDKey {
9
19
  publicKey: Bytes;
@@ -13,69 +23,225 @@ interface HDKey {
13
23
  deriveChild(index: number): HDKey;
14
24
  sign(hash: Bytes): Bytes;
15
25
  }
26
+ /** Signing source accepted by transaction signing helpers. */
16
27
  export type Signer = Bytes | HDKey;
28
+ /** Decimal precision used for BTC string formatting. */
17
29
  export declare const PRECISION = 8;
30
+ /** Default transaction version used for newly created transactions. */
18
31
  export declare const DEFAULT_VERSION = 2;
32
+ /** Default transaction locktime. */
19
33
  export declare const DEFAULT_LOCKTIME = 0;
34
+ /** Default input sequence number.
35
+ * Final (`0xffffffff`): matches the PSBT omission default and disables nLockTime/CLTV semantics
36
+ * unless callers choose a lower sequence explicitly (for example `0xfffffffe` with lockTime).
37
+ */
20
38
  export declare const DEFAULT_SEQUENCE = 4294967295;
39
+ /**
40
+ * Decimal coder for BTC-denominated strings.
41
+ * This is a fixed-precision BTC-string to satoshi-bigint helper, not a validator
42
+ * for transaction/PSBT output amounts. Signed values are intentional here, so
43
+ * callers can reuse the helper for display/history-style deltas as well as
44
+ * unsigned transfer amounts. It keeps the BTC scale at 8 fractional digits and
45
+ * rejects over-precise inputs instead of rounding.
46
+ * @example
47
+ * Convert between satoshi bigint values and BTC-denominated decimal strings.
48
+ * ```ts
49
+ * Decimal.encode(1n);
50
+ * ```
51
+ */
21
52
  export declare const Decimal: P.Coder<bigint, string>;
53
+ /**
54
+ * Returns a fallback only when the value is `undefined`.
55
+ * @param value - optional value
56
+ * @param def - fallback value
57
+ * @returns `value` when defined, otherwise `def`.
58
+ * @example
59
+ * Keep zero-like values but replace `undefined` with a fallback.
60
+ * ```ts
61
+ * def(undefined, 1);
62
+ * ```
63
+ */
22
64
  export declare const def: <T>(value: T | undefined, def: T) => T;
65
+ /**
66
+ * Deep-clones plain transaction data structures.
67
+ * @param obj - value to clone
68
+ * @returns Deep copy of the input value.
69
+ * @throws If the value contains an unsupported runtime type. {@link Error}
70
+ * @example
71
+ * Clone plain transaction data structures before mutating them.
72
+ * ```ts
73
+ * cloneDeep({ a: [new Uint8Array([1])] });
74
+ * ```
75
+ */
23
76
  export declare function cloneDeep<T>(obj: T): T;
77
+ /** Transaction construction and parsing options. */
24
78
  export interface TxOpts {
79
+ /** Transaction version to place into new transactions and imported PSBTs. */
25
80
  version?: number;
81
+ /** Global locktime for the transaction. */
26
82
  lockTime?: number;
83
+ /** PSBT version to emit when serializing. */
27
84
  PSBTVersion?: number;
85
+ /** Allow transaction versions outside the standard small set. */
28
86
  allowUnknownVersion?: boolean;
29
- /** @deprecated Use `allowUnknownOutputs` */
87
+ /**
88
+ * Deprecated alias for {@link allowUnknownOutputs}.
89
+ * @deprecated Use `allowUnknownOutputs`.
90
+ */
30
91
  allowUnknowOutput?: boolean;
92
+ /** Allow outputs with scripts this library does not recognize. */
31
93
  allowUnknownOutputs?: boolean;
32
- /** @deprecated Use `allowUnknownInputs` */
94
+ /**
95
+ * Deprecated alias for {@link allowUnknownInputs}.
96
+ * @deprecated Use `allowUnknownInputs`.
97
+ */
33
98
  allowUnknowInput?: boolean;
99
+ /** Allow signing and finalizing inputs with unknown script shapes. */
34
100
  allowUnknownInputs?: boolean;
101
+ /** Skip redeem-script and witness-script consistency checks. */
35
102
  disableScriptCheck?: boolean;
103
+ /** Match the odd empty-output encoding used by `bip174js`. */
36
104
  bip174jsCompat?: boolean;
105
+ /** Permit legacy inputs that only provide witness UTXO data. */
37
106
  allowLegacyWitnessUtxo?: boolean;
107
+ /** Grind ECDSA signatures until they use a low-R encoding. */
38
108
  lowR?: boolean;
109
+ /** UNSAFE: additional custom payment-script codecs and finalizers. */
39
110
  customScripts?: CustomScript[];
111
+ /** Preserve unknown PSBT key/value pairs instead of stripping them. */
40
112
  allowUnknown?: boolean;
41
113
  }
42
114
  /**
43
115
  * Internal, exported only for backwards-compat. Use `SigHash` instead.
44
- * @deprecated
116
+ * @deprecated Use {@link SigHash} instead.
117
+ * @example
118
+ * Combine the legacy bit flags when interoperating with older code.
119
+ * ```ts
120
+ * SignatureHash.ALL | SignatureHash.ANYONECANPAY;
121
+ * ```
45
122
  */
46
- export declare const SignatureHash: {
47
- DEFAULT: number;
48
- ALL: number;
49
- NONE: number;
50
- SINGLE: number;
51
- ANYONECANPAY: number;
52
- };
53
- export declare const SigHash: {
54
- readonly DEFAULT: number;
55
- readonly ALL: number;
56
- readonly NONE: number;
57
- readonly SINGLE: number;
58
- readonly DEFAULT_ANYONECANPAY: number;
123
+ export declare const SignatureHash: Readonly<{
124
+ readonly DEFAULT: 0;
125
+ readonly ALL: 1;
126
+ readonly NONE: 2;
127
+ readonly SINGLE: 3;
128
+ readonly ANYONECANPAY: 128;
129
+ }>;
130
+ /**
131
+ * Common signature hash flag combinations.
132
+ * @example
133
+ * Use the predefined signature-hash combinations exported by the library.
134
+ * ```ts
135
+ * SigHash.SINGLE_ANYONECANPAY;
136
+ * ```
137
+ */
138
+ export declare const SigHash: Readonly<{
139
+ readonly DEFAULT: 0;
140
+ readonly ALL: 1;
141
+ readonly NONE: 2;
142
+ readonly SINGLE: 3;
59
143
  readonly ALL_ANYONECANPAY: number;
60
144
  readonly NONE_ANYONECANPAY: number;
61
145
  readonly SINGLE_ANYONECANPAY: number;
62
- };
63
- export declare const SigHashNames: {
64
- [x: number]: "DEFAULT" | "ALL" | "NONE" | "SINGLE" | "DEFAULT_ANYONECANPAY" | "ALL_ANYONECANPAY" | "NONE_ANYONECANPAY" | "SINGLE_ANYONECANPAY";
65
- };
146
+ }>;
147
+ /** Reverse lookup table for signature hash flag names. */
148
+ export declare const SigHashNames: Readonly<{
149
+ [x: number]: "DEFAULT" | "ALL" | "NONE" | "SINGLE" | "ALL_ANYONECANPAY" | "NONE_ANYONECANPAY" | "SINGLE_ANYONECANPAY";
150
+ }>;
151
+ /** Signature-hash flag number accepted by signing helpers. */
66
152
  export type SigHash = u.ValueOf<typeof SigHash>;
153
+ /** Minimal transaction input fields required to serialize and sign. */
67
154
  export type TransactionInputRequired = {
155
+ /** Previous transaction id being spent. */
68
156
  txid: Bytes;
157
+ /** Previous output index inside that transaction. */
69
158
  index: number;
159
+ /** Final sequence number that will be serialized for the input. */
70
160
  sequence: number;
161
+ /** Final scriptSig bytes that will be serialized for the input. */
71
162
  finalScriptSig: Bytes;
72
163
  };
73
- export declare function inputBeforeSign(i: psbt.TransactionInput): TransactionInputRequired;
74
- declare function validateOpts(opts: TxOpts): Readonly<TxOpts>;
164
+ /**
165
+ * Normalizes a PSBT input into the fields needed for signing.
166
+ * @param i - PSBT input to validate
167
+ * @returns Input fields required for signing.
168
+ * @throws If the input is missing `txid` or `index`. {@link Error}
169
+ * @example
170
+ * Fill in defaults for the fields the signer expects to see.
171
+ * ```ts
172
+ * import { hex } from '@scure/base';
173
+ * import { inputBeforeSign } from '@scure/btc-signer/transaction.js';
174
+ * inputBeforeSign({
175
+ * txid: hex.decode('0000000000000000000000000000000000000000000000000000000000000001'),
176
+ * index: 0,
177
+ * });
178
+ * ```
179
+ */
180
+ export declare function inputBeforeSign(i: TArg<psbt.TransactionInput>): TRet<TransactionInputRequired>;
181
+ declare function validateOpts(opts: TArg<TxOpts>): TRet<Readonly<TxOpts>>;
182
+ /** Canonical PSBT input shape used by the coder layer. */
75
183
  export type PSBTInputs = psbt.PSBTKeyMapKeys<typeof psbt.PSBTInput>;
76
- export declare function getPrevOut(input: psbt.TransactionInput): P.UnwrapCoder<typeof RawOutput>;
77
- export declare function normalizeInput(i: psbt.TransactionInputUpdate, cur?: psbt.TransactionInput, allowedFields?: (keyof psbt.TransactionInput)[], disableScriptCheck?: boolean, allowUnknown?: boolean): psbt.TransactionInput;
78
- export declare function getInputType(input: psbt.TransactionInput, allowLegacyWitnessUtxo?: boolean): {
184
+ /** Canonical PSBT output shape used by the coder layer. */
185
+ export type PSBTOutputs = psbt.PSBTKeyMapKeys<typeof psbt.PSBTOutput>;
186
+ /**
187
+ * Extracts the previous output referenced by an input.
188
+ * @param input - PSBT input with previous output data
189
+ * @returns Previous output information.
190
+ * @throws If the input does not contain usable previous-output information. {@link Error}
191
+ * @example
192
+ * Read the previous output from either `witnessUtxo` or `nonWitnessUtxo`.
193
+ * ```ts
194
+ * getPrevOut({ witnessUtxo: { amount: 1n, script: new Uint8Array([0x51]) } });
195
+ * ```
196
+ */
197
+ export declare function getPrevOut(input: TArg<psbt.TransactionInput>): P.UnwrapCoder<typeof RawOutput>;
198
+ /**
199
+ * Normalizes a transaction input update into canonical PSBT form.
200
+ * @param i - input update to normalize
201
+ * @param cur - existing input value to merge with
202
+ * @param allowedFields - fields that may still change on signed inputs
203
+ * @param disableScriptCheck - whether to skip redeem/witness script sanity checks
204
+ * @param allowUnknown - whether to keep unknown PSBT fields
205
+ * @returns Normalized PSBT input.
206
+ * @example
207
+ * Accept hex txids from callers in the same display-order form used by `Transaction.id`, then
208
+ * normalize them into the repo's internal `TransactionInput` shape.
209
+ * ```ts
210
+ * import { hex } from '@scure/base';
211
+ * import { normalizeInput } from '@scure/btc-signer/transaction.js';
212
+ * normalizeInput({
213
+ * txid: '0000000000000000000000000000000000000000000000000000000000000001',
214
+ * index: 0,
215
+ * witnessUtxo: { amount: 1n, script: new Uint8Array([0x51]) },
216
+ * });
217
+ * ```
218
+ */
219
+ export declare function normalizeInput(i: TArg<psbt.TransactionInputUpdate>, cur?: TArg<PSBTInputs>, allowedFields?: TArg<readonly (keyof PSBTInputs)[]>, disableScriptCheck?: boolean, allowUnknown?: boolean): TRet<PSBTInputs>;
220
+ /**
221
+ * Determines how an input should be signed and finalized.
222
+ * Wrapper consistency is expected to be validated earlier by {@link normalizeInput}
223
+ * and {@link checkScript}; this helper classifies already-normalized inputs and is
224
+ * not a standalone redeemScript/witnessScript correctness gate for raw caller input.
225
+ * @param input - PSBT input to inspect
226
+ * @param allowLegacyWitnessUtxo - whether legacy inputs may rely on witness UTXO data only
227
+ * @returns Input classification including transaction type and sighash defaults.
228
+ * @throws If a documented runtime validation or state check fails. {@link Error}
229
+ * @example
230
+ * Detect how the signer should treat a SegWit input from its previous output script.
231
+ * ```ts
232
+ * import { hex } from '@scure/base';
233
+ * import { p2wpkh } from '@scure/btc-signer/payment.js';
234
+ * import { getInputType } from '@scure/btc-signer/transaction.js';
235
+ * import { pubECDSA, randomPrivateKeyBytes } from '@scure/btc-signer/utils.js';
236
+ * getInputType({
237
+ * witnessUtxo: {
238
+ * amount: 1n,
239
+ * script: p2wpkh(pubECDSA(randomPrivateKeyBytes())).script,
240
+ * },
241
+ * });
242
+ * ```
243
+ */
244
+ export declare function getInputType(input: TArg<psbt.TransactionInput>, allowLegacyWitnessUtxo?: boolean): {
79
245
  type: string;
80
246
  txType: string;
81
247
  last: {
@@ -112,6 +278,27 @@ export declare function getInputType(input: psbt.TransactionInput, allowLegacyWi
112
278
  defaultSighash: number;
113
279
  sighash: number;
114
280
  };
281
+ /**
282
+ * Mutable Bitcoin transaction and PSBT helper.
283
+ * @param opts - Transaction construction and PSBT serialization options. See {@link TxOpts}.
284
+ * @example
285
+ * Create a transaction, add one spend, and export it as PSBT.
286
+ * ```ts
287
+ * import { hex } from '@scure/base';
288
+ * import { p2wpkh } from '@scure/btc-signer/payment.js';
289
+ * import { Transaction } from '@scure/btc-signer/transaction.js';
290
+ * import { pubECDSA, randomPrivateKeyBytes } from '@scure/btc-signer/utils.js';
291
+ * const spend = p2wpkh(pubECDSA(randomPrivateKeyBytes()));
292
+ * const tx = new Transaction();
293
+ * tx.addInput({
294
+ * txid: hex.decode('0000000000000000000000000000000000000000000000000000000000000001'),
295
+ * index: 0,
296
+ * witnessUtxo: { amount: 2n, script: spend.script },
297
+ * });
298
+ * tx.addOutput({ script: spend.script, amount: 1n });
299
+ * tx.toPSBT();
300
+ * ```
301
+ */
115
302
  export declare class Transaction {
116
303
  private global;
117
304
  private inputs;
@@ -138,15 +325,15 @@ export declare class Transaction {
138
325
  private checkInputIdx;
139
326
  getInput(idx: number): psbt.TransactionInput;
140
327
  get inputsLength(): number;
141
- addInput(input: psbt.TransactionInputUpdate, _ignoreSignStatus?: boolean): number;
142
- updateInput(idx: number, input: psbt.TransactionInputUpdate, _ignoreSignStatus?: boolean): void;
328
+ addInput(input: TArg<psbt.TransactionInputUpdate>, _ignoreSignStatus?: boolean): number;
329
+ updateInput(idx: number, input: TArg<psbt.TransactionInputUpdate>, _ignoreSignStatus?: boolean): void;
143
330
  private checkOutputIdx;
144
331
  getOutput(idx: number): psbt.TransactionOutput;
145
332
  getOutputAddress(idx: number, network?: u.BTC_NETWORK): string | undefined;
146
333
  get outputsLength(): number;
147
334
  private normalizeOutput;
148
- addOutput(o: psbt.TransactionOutputUpdate, _ignoreSignStatus?: boolean): number;
149
- updateOutput(idx: number, output: psbt.TransactionOutputUpdate, _ignoreSignStatus?: boolean): void;
335
+ addOutput(o: TArg<psbt.TransactionOutputUpdate>, _ignoreSignStatus?: boolean): number;
336
+ updateOutput(idx: number, output: TArg<psbt.TransactionOutputUpdate>, _ignoreSignStatus?: boolean): void;
150
337
  addOutputAddress(address: string, amount: bigint, network?: u.BTC_NETWORK): number;
151
338
  get fee(): bigint;
152
339
  private preimageLegacy;
@@ -160,7 +347,31 @@ export declare class Transaction {
160
347
  combine(other: Transaction): this;
161
348
  clone(): Transaction;
162
349
  }
163
- export declare function PSBTCombine(psbts: Bytes[]): Bytes;
350
+ /**
351
+ * Merges multiple PSBT blobs into one.
352
+ * @param psbts - PSBT byte arrays to combine
353
+ * @returns Combined PSBT bytes.
354
+ * @throws If the PSBT list is empty or the partial transactions cannot be combined. {@link Error}
355
+ * @example
356
+ * Merge separate partially signed PSBTs that share the same unsigned transaction.
357
+ * ```ts
358
+ * import { PSBTCombine, Transaction } from '@scure/btc-signer/transaction.js';
359
+ * const psbt = new Transaction().toPSBT();
360
+ * PSBTCombine([psbt, psbt]);
361
+ * ```
362
+ */
363
+ export declare function PSBTCombine(psbts: TArg<Bytes[]>): TRet<Bytes>;
364
+ /**
365
+ * Parses a BIP32 path string into child indices.
366
+ * @param path - derivation path such as `m/0'/1`
367
+ * @returns Array of encoded child indices.
368
+ * @throws If the derivation path syntax or child indices are invalid. {@link Error}
369
+ * @example
370
+ * Parse a BIP32 derivation path into hardened and unhardened indices.
371
+ * ```ts
372
+ * bip32Path("m/0'/1");
373
+ * ```
374
+ */
164
375
  export declare function bip32Path(path: string): number[];
165
376
  export {};
166
377
  //# sourceMappingURL=transaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["src/transaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAW,KAAK,YAAY,EAAuC,MAAM,cAAc,CAAC;AAC/F,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAGL,SAAS,EAKV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,CAAC,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,KAAK,KAAK,EAA6C,MAAM,YAAY,CAAC;AAOnF,eAAO,MAAM,OAAO,GAAI,QAAQ,MAAM,KAAG,MAA+B,CAAC;AAGzE,UAAU,KAAK;IACb,SAAS,EAAE,KAAK,CAAC;IACjB,UAAU,EAAE,KAAK,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM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