@vbyte/btc-dev 1.0.13 → 1.0.15

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.13",
3
+ "version": "1.0.15",
4
4
  "description": "Batteries-included toolset for plebian bitcoin development",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -195,8 +195,8 @@ export declare const vin_template: z.ZodObject<{
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
  } & {
@@ -237,8 +237,8 @@ export declare const tx_template: z.ZodObject<{
237
237
  } | null | undefined;
238
238
  script_sig?: string | null | 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;
@@ -268,14 +267,14 @@ export declare const tx_template: z.ZodObject<{
268
267
  script_sig?: string | null | 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
280
  sequence?: string | number | undefined;
@@ -286,6 +285,7 @@ export declare const tx_template: z.ZodObject<{
286
285
  } | null | undefined;
287
286
  script_sig?: string | null | 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
  });