@vbyte/btc-dev 1.0.14 → 1.1.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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vbyte/btc-dev",
3
- "version": "1.0.14",
3
+ "version": "1.1.0",
4
4
  "description": "Batteries-included toolset for plebian bitcoin development",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -45,10 +45,6 @@
45
45
  "types": "./lib/meta/index.d.ts",
46
46
  "import": "./lib/meta/index.js"
47
47
  },
48
- "./psbt": {
49
- "types": "./lib/psbt/index.d.ts",
50
- "import": "./lib/psbt/index.js"
51
- },
52
48
  "./script": {
53
49
  "types": "./lib/script/index.d.ts",
54
50
  "import": "./lib/script/index.js"
@@ -87,8 +83,8 @@
87
83
  "@noble/hashes": "^1.8.0",
88
84
  "@scure/btc-signer": "^1.8.1",
89
85
  "@vbyte/buff": "^1.0.2",
90
- "@vbyte/micro-lib": "^1.0.14",
91
- "zod": "^3.25.69"
86
+ "@vbyte/micro-lib": "^1.1.1",
87
+ "zod": "^4.0.5"
92
88
  },
93
89
  "devDependencies": {
94
90
  "@cmdcode/core-cmd": "^1.6.5",
@@ -97,10 +93,10 @@
97
93
  "@rollup/plugin-node-resolve": "^16.0.1",
98
94
  "@rollup/plugin-terser": "^0.4.4",
99
95
  "@rollup/plugin-typescript": "^12.1.4",
100
- "@types/node": "^24.0.10",
96
+ "@types/node": "^24.0.14",
101
97
  "@types/tape": "^5.8.1",
102
98
  "faucet": "^0.0.4",
103
- "rollup": "^4.44.1",
99
+ "rollup": "^4.45.1",
104
100
  "tape": "^5.9.0",
105
101
  "tslib": "^2.8.1",
106
102
  "tsx": "^4.20.3",
@@ -29,24 +29,24 @@ export declare const tx_input: z.ZodObject<{
29
29
  }, "strip", z.ZodTypeAny, {
30
30
  txid: string;
31
31
  vout: number;
32
- sequence: number;
33
32
  coinbase: string | null;
34
33
  prevout: {
35
34
  value: bigint;
36
35
  script_pk: string;
37
36
  } | null;
38
37
  script_sig: string | null;
38
+ sequence: number;
39
39
  witness: string[];
40
40
  }, {
41
41
  txid: string;
42
42
  vout: number;
43
- sequence: number;
44
43
  coinbase: string | null;
45
44
  prevout: {
46
45
  value: bigint;
47
46
  script_pk: string;
48
47
  } | null;
49
48
  script_sig: string | null;
49
+ sequence: number;
50
50
  witness: string[];
51
51
  }>;
52
52
  export declare const tx_data: z.ZodObject<{
@@ -71,24 +71,24 @@ export declare const tx_data: z.ZodObject<{
71
71
  }, "strip", z.ZodTypeAny, {
72
72
  txid: string;
73
73
  vout: number;
74
- sequence: number;
75
74
  coinbase: string | null;
76
75
  prevout: {
77
76
  value: bigint;
78
77
  script_pk: string;
79
78
  } | null;
80
79
  script_sig: string | null;
80
+ sequence: number;
81
81
  witness: string[];
82
82
  }, {
83
83
  txid: string;
84
84
  vout: number;
85
- sequence: number;
86
85
  coinbase: string | null;
87
86
  prevout: {
88
87
  value: bigint;
89
88
  script_pk: string;
90
89
  } | null;
91
90
  script_sig: string | null;
91
+ sequence: number;
92
92
  witness: string[];
93
93
  }>, "many">;
94
94
  vout: z.ZodArray<z.ZodObject<{
@@ -111,13 +111,13 @@ export declare const tx_data: z.ZodObject<{
111
111
  vin: {
112
112
  txid: string;
113
113
  vout: number;
114
- sequence: number;
115
114
  coinbase: string | null;
116
115
  prevout: {
117
116
  value: bigint;
118
117
  script_pk: string;
119
118
  } | null;
120
119
  script_sig: string | null;
120
+ sequence: number;
121
121
  witness: string[];
122
122
  }[];
123
123
  locktime: number;
@@ -130,13 +130,13 @@ export declare const tx_data: z.ZodObject<{
130
130
  vin: {
131
131
  txid: string;
132
132
  vout: number;
133
- sequence: number;
134
133
  coinbase: string | null;
135
134
  prevout: {
136
135
  value: bigint;
137
136
  script_pk: string;
138
137
  } | null;
139
138
  script_sig: string | null;
139
+ sequence: number;
140
140
  witness: string[];
141
141
  }[];
142
142
  locktime: number;
@@ -174,29 +174,29 @@ export declare const vin_template: z.ZodObject<{
174
174
  }, "strip", z.ZodTypeAny, {
175
175
  txid: string;
176
176
  vout: number;
177
- sequence?: string | number | undefined;
178
177
  coinbase?: string | null | undefined;
179
178
  prevout?: {
180
179
  value: number | bigint;
181
180
  script_pk: string;
182
181
  } | null | undefined;
183
182
  script_sig?: string | null | undefined;
183
+ sequence?: string | number | undefined;
184
184
  witness?: string[] | undefined;
185
185
  }, {
186
186
  txid: string;
187
187
  vout: number;
188
- sequence?: string | number | undefined;
189
188
  coinbase?: string | null | undefined;
190
189
  prevout?: {
191
190
  value: number | bigint;
192
191
  script_pk: string;
193
192
  } | null | undefined;
194
193
  script_sig?: string | null | undefined;
194
+ sequence?: string | number | undefined;
195
195
  witness?: string[] | undefined;
196
196
  }>;
197
197
  export declare const tx_template: z.ZodObject<{
198
- version: z.ZodDefault<z.ZodNumber>;
199
- vin: z.ZodDefault<z.ZodArray<z.ZodObject<{
198
+ version: z.ZodOptional<z.ZodNumber>;
199
+ vin: z.ZodArray<z.ZodObject<{
200
200
  txid: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
201
201
  vout: z.ZodNumber;
202
202
  } & {
@@ -218,27 +218,27 @@ export declare const tx_template: z.ZodObject<{
218
218
  }, "strip", z.ZodTypeAny, {
219
219
  txid: string;
220
220
  vout: number;
221
- sequence?: string | number | undefined;
222
221
  coinbase?: string | null | undefined;
223
222
  prevout?: {
224
223
  value: number | bigint;
225
224
  script_pk: string;
226
225
  } | null | undefined;
227
226
  script_sig?: string | null | undefined;
227
+ sequence?: string | number | undefined;
228
228
  witness?: string[] | undefined;
229
229
  }, {
230
230
  txid: string;
231
231
  vout: number;
232
- sequence?: string | number | undefined;
233
232
  coinbase?: string | null | undefined;
234
233
  prevout?: {
235
234
  value: number | bigint;
236
235
  script_pk: string;
237
236
  } | null | undefined;
238
237
  script_sig?: string | null | undefined;
238
+ sequence?: string | number | undefined;
239
239
  witness?: string[] | undefined;
240
- }>, "many">>;
241
- vout: z.ZodDefault<z.ZodArray<z.ZodObject<{
240
+ }>, "many">;
241
+ vout: z.ZodArray<z.ZodObject<{
242
242
  script_pk: z.ZodEffects<z.ZodString, string, string>;
243
243
  } & {
244
244
  value: z.ZodUnion<[z.ZodNumber, z.ZodBigInt]>;
@@ -248,10 +248,9 @@ export declare const tx_template: z.ZodObject<{
248
248
  }, {
249
249
  value: number | bigint;
250
250
  script_pk: string;
251
- }>, "many">>;
251
+ }>, "many">;
252
252
  locktime: z.ZodOptional<z.ZodNumber>;
253
253
  }, "strip", z.ZodTypeAny, {
254
- version: number;
255
254
  vout: {
256
255
  value: number | bigint;
257
256
  script_pk: string;
@@ -259,33 +258,34 @@ export declare const tx_template: z.ZodObject<{
259
258
  vin: {
260
259
  txid: string;
261
260
  vout: number;
262
- sequence?: string | number | undefined;
263
261
  coinbase?: string | null | undefined;
264
262
  prevout?: {
265
263
  value: number | bigint;
266
264
  script_pk: string;
267
265
  } | null | undefined;
268
266
  script_sig?: string | null | undefined;
267
+ sequence?: string | number | undefined;
269
268
  witness?: string[] | undefined;
270
269
  }[];
270
+ version?: number | undefined;
271
271
  locktime?: number | undefined;
272
272
  }, {
273
- version?: number | undefined;
274
- vout?: {
273
+ vout: {
275
274
  value: number | bigint;
276
275
  script_pk: string;
277
- }[] | undefined;
278
- vin?: {
276
+ }[];
277
+ vin: {
279
278
  txid: string;
280
279
  vout: number;
281
- sequence?: string | number | undefined;
282
280
  coinbase?: string | null | undefined;
283
281
  prevout?: {
284
282
  value: number | bigint;
285
283
  script_pk: string;
286
284
  } | null | undefined;
287
285
  script_sig?: string | null | undefined;
286
+ sequence?: string | number | undefined;
288
287
  witness?: string[] | undefined;
289
- }[] | undefined;
288
+ }[];
289
+ version?: number | undefined;
290
290
  locktime?: number | undefined;
291
291
  }>;
package/dist/schema/tx.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { hex, hex32, uint } from '@vbyte/micro-lib/schema';
3
- const sats = z.bigint().positive().max(2100000000000000n);
3
+ const sats = z.bigint().min(0n).max(2100000000000000n);
4
4
  export const tx_output = z.object({
5
5
  value: sats,
6
6
  script_pk: hex,
@@ -31,8 +31,8 @@ export const vin_template = tx_input.extend({
31
31
  witness: z.array(hex).optional(),
32
32
  });
33
33
  export const tx_template = z.object({
34
- version: uint.default(1),
35
- vin: z.array(vin_template).default([]),
36
- vout: z.array(vout_template).default([]),
34
+ version: uint.optional(),
35
+ vin: z.array(vin_template),
36
+ vout: z.array(vout_template),
37
37
  locktime: uint.optional(),
38
38
  });