@btc-vision/transaction 1.3.6 → 1.3.8

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 +1 @@
1
- export declare const version = "1.3.6";
1
+ export declare const version = "1.3.8";
package/build/_version.js CHANGED
@@ -1 +1 @@
1
- export const version = '1.3.6';
1
+ export const version = '1.3.8';
@@ -9,6 +9,8 @@ export declare class BinaryReader {
9
9
  static bigintCompare(a: bigint, b: bigint): number;
10
10
  static numberCompare(a: number, b: number): number;
11
11
  setBuffer(bytes: BufferLike): void;
12
+ length(): number;
13
+ bytesLeft(): number;
12
14
  readU8(): u8;
13
15
  readU16(be?: boolean): u16;
14
16
  readU32(be?: boolean): u32;
@@ -27,6 +27,12 @@ export class BinaryReader {
27
27
  this.buffer = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
28
28
  this.currentOffset = 0;
29
29
  }
30
+ length() {
31
+ return this.buffer.byteLength;
32
+ }
33
+ bytesLeft() {
34
+ return this.buffer.byteLength - this.currentOffset;
35
+ }
30
36
  readU8() {
31
37
  this.verifyEnd(this.currentOffset + U8_BYTE_LENGTH);
32
38
  const value = this.buffer.getUint8(this.currentOffset);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@btc-vision/transaction",
3
3
  "type": "module",
4
- "version": "1.3.6",
4
+ "version": "1.3.8",
5
5
  "author": "BlobMaster41",
6
6
  "description": "OPNet transaction library allows you to create and sign transactions for the OPNet network.",
7
7
  "engines": {
package/src/_version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.3.6';
1
+ export const version = '1.3.8';
@@ -42,6 +42,14 @@ export class BinaryReader {
42
42
  this.currentOffset = 0;
43
43
  }
44
44
 
45
+ public length(): number {
46
+ return this.buffer.byteLength;
47
+ }
48
+
49
+ public bytesLeft(): number {
50
+ return this.buffer.byteLength - this.currentOffset;
51
+ }
52
+
45
53
  /**
46
54
  * Reads a single unsigned byte (u8).
47
55
  */