@vbyte/btc-dev 1.0.4 → 1.0.5

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.
@@ -1,11 +1,11 @@
1
- export type WitnessContext = WitnessData | TaprootScript | SegwitScript | TaprootSpend | SegwitSpend;
1
+ export type WitnessContext = WitnessInfo | TaprootScript | SegwitScript | TaprootSpend | SegwitSpend;
2
2
  export type WitnessVersion = number | null;
3
3
  export type WitnessType = 'p2w-pkh' | 'p2w-sh' | 'p2tr-pk' | 'p2tr-ts' | 'unknown';
4
4
  export interface WitnessSize {
5
5
  size: number;
6
6
  vsize: number;
7
7
  }
8
- export interface WitnessData {
8
+ export interface WitnessInfo {
9
9
  annex: string | null;
10
10
  cblock: string | null;
11
11
  params: string[];
@@ -13,22 +13,22 @@ export interface WitnessData {
13
13
  type: WitnessType;
14
14
  version: WitnessVersion;
15
15
  }
16
- export interface TaprootScript extends WitnessData {
16
+ export interface TaprootScript extends WitnessInfo {
17
17
  cblock: string;
18
18
  script: string;
19
19
  type: 'p2tr-ts';
20
20
  version: 1;
21
21
  }
22
- export interface SegwitScript extends WitnessData {
22
+ export interface SegwitScript extends WitnessInfo {
23
23
  script: string;
24
24
  type: 'p2w-sh';
25
25
  version: 0;
26
26
  }
27
- export interface TaprootSpend extends WitnessData {
27
+ export interface TaprootSpend extends WitnessInfo {
28
28
  type: 'p2tr-pk';
29
29
  version: 1;
30
30
  }
31
- export interface SegwitSpend extends WitnessData {
31
+ export interface SegwitSpend extends WitnessInfo {
32
32
  type: 'p2w-pkh';
33
33
  version: 0;
34
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vbyte/btc-dev",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Batteries-included toolset for plebian bitcoin development",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -9,7 +9,7 @@ import {
9
9
  import type {
10
10
  ScriptField,
11
11
  WitnessField,
12
- WitnessData,
12
+ WitnessInfo,
13
13
  WitnessSize,
14
14
  WitnessType
15
15
  } from '@/types/index.js'
@@ -17,7 +17,7 @@ import type {
17
17
  export class TransactionWitness {
18
18
 
19
19
  private readonly _data : Buff[]
20
- private readonly _meta : WitnessData
20
+ private readonly _meta : WitnessInfo
21
21
  private readonly _size : WitnessSize
22
22
 
23
23
  constructor (witness : Bytes[]) {
@@ -3,13 +3,13 @@ import { is_valid_script } from '@/lib/script/decode.js'
3
3
  import { TAPLEAF_VERSIONS } from '@/const.js'
4
4
 
5
5
  import type {
6
- WitnessData,
6
+ WitnessInfo,
7
7
  WitnessType
8
8
  } from '@/types/index.js'
9
9
 
10
10
  export function parse_witness_data (
11
11
  witness : Bytes[]
12
- ) : WitnessData {
12
+ ) : WitnessInfo {
13
13
  // Parse the witness data.
14
14
  const elems = witness.map(e => Buff.bytes(e))
15
15
  const annex = parse_annex_data(elems)
@@ -1,4 +1,4 @@
1
- export type WitnessContext = WitnessData | TaprootScript | SegwitScript | TaprootSpend | SegwitSpend
1
+ export type WitnessContext = WitnessInfo | TaprootScript | SegwitScript | TaprootSpend | SegwitSpend
2
2
  export type WitnessVersion = number | null
3
3
  export type WitnessType = 'p2w-pkh' | 'p2w-sh' | 'p2tr-pk' | 'p2tr-ts' | 'unknown'
4
4
 
@@ -7,7 +7,7 @@ export interface WitnessSize {
7
7
  vsize : number
8
8
  }
9
9
 
10
- export interface WitnessData {
10
+ export interface WitnessInfo {
11
11
  annex : string | null
12
12
  cblock : string | null
13
13
  params : string[]
@@ -16,25 +16,25 @@ export interface WitnessData {
16
16
  version : WitnessVersion
17
17
  }
18
18
 
19
- export interface TaprootScript extends WitnessData {
19
+ export interface TaprootScript extends WitnessInfo {
20
20
  cblock : string
21
21
  script : string
22
22
  type : 'p2tr-ts'
23
23
  version : 1
24
24
  }
25
25
 
26
- export interface SegwitScript extends WitnessData {
26
+ export interface SegwitScript extends WitnessInfo {
27
27
  script : string
28
28
  type : 'p2w-sh'
29
29
  version : 0
30
30
  }
31
31
 
32
- export interface TaprootSpend extends WitnessData {
32
+ export interface TaprootSpend extends WitnessInfo {
33
33
  type : 'p2tr-pk'
34
34
  version : 1
35
35
  }
36
36
 
37
- export interface SegwitSpend extends WitnessData {
37
+ export interface SegwitSpend extends WitnessInfo {
38
38
  type : 'p2w-pkh'
39
39
  version : 0
40
40
  }