@freesignal/protocol 0.4.1 → 0.4.3

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/types.d.ts CHANGED
@@ -91,7 +91,7 @@ interface DatagramJSON {
91
91
  export interface SignedDatagram extends Datagram {
92
92
  signature: string;
93
93
  }
94
- interface DatagramHeader {
94
+ export interface DatagramHeader {
95
95
  readonly id: string;
96
96
  readonly version: number;
97
97
  readonly sender: string;
@@ -118,7 +118,7 @@ export declare class Datagram implements Encodable {
118
118
  get payload(): Uint8Array | undefined;
119
119
  get signature(): string | undefined;
120
120
  private get unsigned();
121
- get header(): DatagramHeader;
121
+ get header(): Uint8Array;
122
122
  toBytes(): Uint8Array;
123
123
  sign(secretKey: Uint8Array): SignedDatagram;
124
124
  toString(): string;
package/dist/types.js CHANGED
@@ -260,14 +260,7 @@ class Datagram {
260
260
  return data.subarray(0, data.length - (this._signature ? crypto_1.default.EdDSA.signatureLength : 0));
261
261
  }
262
262
  get header() {
263
- return {
264
- id: this.id,
265
- version: this.version,
266
- sender: this.sender,
267
- receiver: this.receiver,
268
- protocol: this.protocol,
269
- createdAt: this.createdAt
270
- };
263
+ return this.toBytes().slice(0, Datagram.headerOffset);
271
264
  }
272
265
  toBytes() {
273
266
  var _a, _b, _c;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freesignal/protocol",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Signal Protocol implementation in javascript",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "author": "Christian Braghette",