@leofcoin/messages 1.3.14 → 1.3.16
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/exports/block.js +9 -7
- package/exports/bw-request.js +1 -2
- package/exports/bw.js +2 -2
- package/exports/contract.js +3 -3
- package/exports/index.js +6 -6
- package/exports/last-block-request.js +1 -2
- package/exports/last-block.js +2 -2
- package/exports/messages/block.d.ts +10 -17
- package/exports/messages/bw-request.d.ts +3 -0
- package/exports/messages/bw.d.ts +3 -0
- package/exports/messages/contract.d.ts +3 -0
- package/exports/messages/last-block-request.d.ts +3 -0
- package/exports/messages/last-block.d.ts +3 -0
- package/exports/messages/publish.d.ts +3 -0
- package/exports/messages/raw-transaction.d.ts +3 -0
- package/exports/messages/transaction.d.ts +3 -0
- package/exports/messages/validator.d.ts +3 -0
- package/exports/protos/block.proto.d.ts +11 -0
- package/exports/protos/bw-request.proto.d.ts +2 -0
- package/exports/protos/bw.proto.d.ts +5 -0
- package/exports/protos/contract.proto.d.ts +6 -0
- package/exports/protos/last-block-request.proto.d.ts +2 -0
- package/exports/protos/last-block.proto.d.ts +5 -0
- package/exports/protos/publish.proto.d.ts +8 -0
- package/exports/protos/raw-transaction.proto.d.ts +3 -0
- package/exports/protos/validator.proto.d.ts +6 -0
- package/exports/types.d.ts +1 -0
- package/exports/validator.js +2 -2
- package/package.json +1 -1
package/exports/block.js
CHANGED
|
@@ -6,13 +6,13 @@ import smartConcat from '@vandeurenglenn/typed-array-smart-concat';
|
|
|
6
6
|
import smartDeconcat from '@vandeurenglenn/typed-array-smart-deconcat';
|
|
7
7
|
|
|
8
8
|
var proto = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
index: Number(),
|
|
10
|
+
previousHash: String(),
|
|
11
|
+
timestamp: Number(),
|
|
12
|
+
reward: BigNumber.from(0),
|
|
13
|
+
fees: BigNumber.from(0),
|
|
14
|
+
transactions: new Uint8Array(),
|
|
15
|
+
validators: new Uint8Array()
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
class BlockMessage extends FormatInterface {
|
|
@@ -47,7 +47,9 @@ class BlockMessage extends FormatInterface {
|
|
|
47
47
|
}
|
|
48
48
|
decode() {
|
|
49
49
|
super.decode();
|
|
50
|
+
// @ts-ignore
|
|
50
51
|
this.decoded.transactions = smartDeconcat(this.decoded.transactions).map(transaction => new TransactionMessage(transaction).decoded);
|
|
52
|
+
// @ts-ignore
|
|
51
53
|
this.decoded.validators = smartDeconcat(this.decoded.validators).map(validator => new ValidatorMessage(validator).decoded);
|
|
52
54
|
return this.decoded;
|
|
53
55
|
}
|
package/exports/bw-request.js
CHANGED
package/exports/bw.js
CHANGED
package/exports/contract.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
2
2
|
|
|
3
3
|
var proto = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
creator: String(),
|
|
5
|
+
contract: new Uint8Array(),
|
|
6
|
+
constructorParameters: Array()
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
class ContractMessage extends FormatInterface {
|
package/exports/index.js
CHANGED
|
@@ -12,12 +12,12 @@ import '@vandeurenglenn/typed-array-smart-concat';
|
|
|
12
12
|
import '@vandeurenglenn/typed-array-smart-deconcat';
|
|
13
13
|
|
|
14
14
|
var proto = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
timestamp: Number(),
|
|
16
|
+
from: String(),
|
|
17
|
+
to: String(),
|
|
18
|
+
nonce: Number(),
|
|
19
|
+
method: String(),
|
|
20
|
+
params: Array()
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
class RawTransactionMessage extends FormatInterface {
|
package/exports/last-block.js
CHANGED
|
@@ -1,25 +1,18 @@
|
|
|
1
|
+
import proto from '../protos/block.proto.js';
|
|
1
2
|
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
2
|
-
import {
|
|
3
|
+
import type { messageInput } from '../types.js';
|
|
3
4
|
export default class BlockMessage extends FormatInterface {
|
|
4
|
-
decoded:
|
|
5
|
-
index: Number;
|
|
6
|
-
previousHash: String;
|
|
7
|
-
timestamp: String;
|
|
8
|
-
reward: BigNumber;
|
|
9
|
-
fees: BigNumber;
|
|
10
|
-
transactions: Uint8Array[] | Object[] | Uint8Array;
|
|
11
|
-
validators: Uint8Array[] | Object[] | Uint8Array;
|
|
12
|
-
};
|
|
5
|
+
decoded: typeof proto;
|
|
13
6
|
get messageName(): string;
|
|
14
7
|
constructor(buffer: messageInput);
|
|
15
8
|
encode(): Uint8Array;
|
|
16
9
|
decode(): {
|
|
17
|
-
index:
|
|
18
|
-
previousHash:
|
|
19
|
-
timestamp:
|
|
20
|
-
reward: BigNumber;
|
|
21
|
-
fees: BigNumber;
|
|
22
|
-
transactions: Uint8Array
|
|
23
|
-
validators: Uint8Array
|
|
10
|
+
index: number;
|
|
11
|
+
previousHash: string;
|
|
12
|
+
timestamp: number;
|
|
13
|
+
reward: import("@ethersproject/bignumber").BigNumber;
|
|
14
|
+
fees: import("@ethersproject/bignumber").BigNumber;
|
|
15
|
+
transactions: Uint8Array;
|
|
16
|
+
validators: Uint8Array;
|
|
24
17
|
};
|
|
25
18
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import proto from './../protos/bw-request.proto.js';
|
|
1
2
|
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
3
|
+
import type { messageInput } from '../types.js';
|
|
2
4
|
export default class BWRequestMessage extends FormatInterface {
|
|
5
|
+
decoded: typeof proto;
|
|
3
6
|
get messageName(): string;
|
|
4
7
|
constructor(buffer?: messageInput);
|
|
5
8
|
}
|
package/exports/messages/bw.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import proto from '../protos/bw.proto.js';
|
|
1
2
|
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
3
|
+
import type { messageInput } from '../types.js';
|
|
2
4
|
export default class BWMessage extends FormatInterface {
|
|
5
|
+
decoded: typeof proto;
|
|
3
6
|
get messageName(): string;
|
|
4
7
|
constructor(buffer: messageInput);
|
|
5
8
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import proto from '../protos/contract.proto.js';
|
|
1
2
|
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
3
|
+
import type { messageInput } from '../types.js';
|
|
2
4
|
export default class ContractMessage extends FormatInterface {
|
|
5
|
+
decoded: typeof proto;
|
|
3
6
|
get messageName(): string;
|
|
4
7
|
constructor(buffer: messageInput);
|
|
5
8
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import proto from '../protos/last-block-request.proto.js';
|
|
1
2
|
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
3
|
+
import type { messageInput } from '../types.js';
|
|
2
4
|
export default class LastBlockRequestMessage extends FormatInterface {
|
|
5
|
+
decoded: typeof proto;
|
|
3
6
|
get messageName(): string;
|
|
4
7
|
constructor(buffer: messageInput);
|
|
5
8
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import proto from '../protos/last-block.proto.js';
|
|
1
2
|
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
3
|
+
import type { messageInput } from '../types.js';
|
|
2
4
|
export default class LastBlockMessage extends FormatInterface {
|
|
5
|
+
decoded: typeof proto;
|
|
3
6
|
get messageName(): string;
|
|
4
7
|
constructor(buffer: messageInput);
|
|
5
8
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import proto from '../protos/publish.proto.js';
|
|
1
2
|
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
3
|
+
import type { messageInput } from '../types.js';
|
|
2
4
|
export default class BWRequestMessage extends FormatInterface {
|
|
5
|
+
decoded: typeof proto;
|
|
3
6
|
get messageName(): string;
|
|
4
7
|
constructor(buffer: messageInput);
|
|
5
8
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import proto from '../protos/raw-transaction.proto.js';
|
|
1
2
|
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
3
|
+
import type { messageInput } from '../types.js';
|
|
2
4
|
export default class RawTransactionMessage extends FormatInterface {
|
|
5
|
+
decoded: typeof proto;
|
|
3
6
|
get messageName(): string;
|
|
4
7
|
constructor(buffer: messageInput);
|
|
5
8
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import proto from './../protos/transaction.proto.js';
|
|
1
2
|
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
3
|
+
import type { messageInput } from '../types.js';
|
|
2
4
|
export default class TransactionMessage extends FormatInterface {
|
|
5
|
+
decoded: typeof proto;
|
|
3
6
|
get messageName(): string;
|
|
4
7
|
constructor(buffer: messageInput);
|
|
5
8
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import proto from '../protos/validator.proto.js';
|
|
1
2
|
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
3
|
+
import type { messageInput } from '../types.js';
|
|
2
4
|
export default class ValidatorMessage extends FormatInterface {
|
|
5
|
+
decoded: typeof proto;
|
|
3
6
|
get messageName(): string;
|
|
4
7
|
constructor(buffer: messageInput);
|
|
5
8
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BigNumber } from "@leofcoin/utils";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
index: number;
|
|
4
|
+
previousHash: string;
|
|
5
|
+
timestamp: number;
|
|
6
|
+
reward: BigNumber;
|
|
7
|
+
fees: BigNumber;
|
|
8
|
+
transactions: Uint8Array;
|
|
9
|
+
validators: Uint8Array;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type messageInput = Uint8Array | String | Object | ArrayBuffer;
|
package/exports/validator.js
CHANGED
|
@@ -2,8 +2,8 @@ import { BigNumber } from '@leofcoin/utils';
|
|
|
2
2
|
import { FormatInterface } from '@leofcoin/codec-format-interface';
|
|
3
3
|
|
|
4
4
|
var proto = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
address: String(),
|
|
6
|
+
reward: BigNumber.from(0)
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
class ValidatorMessage extends FormatInterface {
|