@r3e/neo-js-sdk 0.3.0 → 0.3.2

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.
@@ -146,11 +146,14 @@ export class BinaryReader {
146
146
  }
147
147
  readUInt64LE() {
148
148
  const bytes = this.read(8);
149
- let result = 0n;
150
- for (let index = 7; index >= 0; index -= 1) {
151
- result = (result << 8n) | BigInt(bytes[index]);
152
- }
153
- return result;
149
+ return (BigInt(bytes[0]) |
150
+ (BigInt(bytes[1]) << 8n) |
151
+ (BigInt(bytes[2]) << 16n) |
152
+ (BigInt(bytes[3]) << 24n) |
153
+ (BigInt(bytes[4]) << 32n) |
154
+ (BigInt(bytes[5]) << 40n) |
155
+ (BigInt(bytes[6]) << 48n) |
156
+ (BigInt(bytes[7]) << 56n));
154
157
  }
155
158
  readMultiple(type) {
156
159
  const count = Number(this.readVarInt());
package/dist/core/tx.d.ts CHANGED
@@ -132,6 +132,7 @@ export declare class Tx {
132
132
  marshalUnsignedTo(writer: BinaryWriter): void;
133
133
  marshalTo(writer: BinaryWriter): void;
134
134
  static unmarshalFrom(reader: BinaryReader): Tx;
135
+ static unmarshalUnsignedFrom(reader: BinaryReader): Tx;
135
136
  toBytes(): Uint8Array;
136
137
  toJSON(): {
137
138
  version: number;
package/dist/core/tx.js CHANGED
@@ -233,6 +233,21 @@ export class Tx {
233
233
  witnesses: reader.readMultiple(Witness),
234
234
  });
235
235
  }
236
+ static unmarshalUnsignedFrom(reader) {
237
+ const version = reader.readUInt8();
238
+ if (version !== 0) {
239
+ throw new Error(`unexpected tx version: ${version}`);
240
+ }
241
+ return new Tx({
242
+ nonce: reader.readUInt32LE(),
243
+ systemFee: reader.readUInt64LE(),
244
+ networkFee: reader.readUInt64LE(),
245
+ validUntilBlock: reader.readUInt32LE(),
246
+ signers: reader.readMultiple(Signer),
247
+ attributes: reader.readMultiple(TxAttribute),
248
+ script: reader.readVarBytes(),
249
+ });
250
+ }
236
251
  toBytes() {
237
252
  return serialize(this);
238
253
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r3e/neo-js-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Neo N3 JavaScript/TypeScript SDK — successor to neo-js (no longer maintained). Typed models, object-based RPC inputs, full N3 RPC coverage.",
5
5
  "repository": {
6
6
  "type": "git",