@leofcoin/messages 1.0.1 → 1.1.0
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/messages.esm +8028 -0
- package/dist/messages.js +74 -70
- package/dist/protons.esm +3786 -0
- package/package.json +8 -4
- package/src/messages/block.js +7 -4
- package/src/messages/bw-request.js +8 -5
- package/src/messages/bw.js +8 -5
- package/src/messages/contract.js +8 -5
- package/src/messages/last-block-request.js +8 -5
- package/src/messages/last-block.js +8 -5
- package/src/messages/transaction.js +8 -5
- package/src/messages.js +5 -13
- package/webpack.config.js +22 -0
package/dist/messages.js
CHANGED
|
@@ -1,54 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var codecFormatInterface = require('@leofcoin/codec-format-interface');
|
|
5
|
-
|
|
6
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
|
-
|
|
8
|
-
var protons__default = /*#__PURE__*/_interopDefaultLegacy(protons);
|
|
9
|
-
|
|
10
|
-
var proto$4 = `
|
|
11
|
-
message ContractMessage {
|
|
12
|
-
required string creator = 1;
|
|
13
|
-
required bytes contract = 2;
|
|
14
|
-
repeated string constructorParameters = 3;
|
|
15
|
-
}
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
class ContractMessage extends codecFormatInterface.FormatInterface {
|
|
19
|
-
get keys() {
|
|
20
|
-
return ['creator', 'contract', 'constructorParameters']
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
constructor(buffer) {
|
|
24
|
-
super(buffer, protons__default['default'](proto$4).ContractMessage, {name: 'contract-message'});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
var proto$3 = `
|
|
29
|
-
|
|
30
|
-
message TransactionMessage {
|
|
31
|
-
required uint64 timestamp = 1;
|
|
32
|
-
required string from = 2;
|
|
33
|
-
required string to = 3;
|
|
34
|
-
required uint64 nonce = 4;
|
|
35
|
-
required string method = 5;
|
|
36
|
-
repeated string params = 6;
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
39
4
|
|
|
40
|
-
|
|
41
|
-
get keys() {
|
|
42
|
-
return ['timestamp', 'from', 'to', 'nonce', 'method', 'params']
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
constructor(buffer) {
|
|
46
|
-
const name = 'transaction-message';
|
|
47
|
-
super(buffer, protons__default['default'](proto$3).TransactionMessage, {name});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
5
|
+
var codecFormatInterface = require('@leofcoin/codec-format-interface');
|
|
50
6
|
|
|
51
|
-
var proto
|
|
7
|
+
var proto = `
|
|
52
8
|
message ValidatorMessage {
|
|
53
9
|
required string address = 1;
|
|
54
10
|
required string reward = 2;
|
|
@@ -75,59 +31,107 @@ message BlockMessage {
|
|
|
75
31
|
}
|
|
76
32
|
`;
|
|
77
33
|
|
|
34
|
+
class ContractMessage extends codecFormatInterface.FormatInterface {
|
|
35
|
+
get keys() {
|
|
36
|
+
return ['creator', 'contract', 'constructorParameters']
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get messageName() {
|
|
40
|
+
return 'ContractMessage'
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
constructor(buffer) {
|
|
44
|
+
super(buffer, proto, {name: 'contract-message'});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var contract = /*#__PURE__*/Object.freeze({
|
|
49
|
+
__proto__: null,
|
|
50
|
+
'default': ContractMessage
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
class TransactionMessage extends codecFormatInterface.FormatInterface {
|
|
54
|
+
get keys() {
|
|
55
|
+
return ['timestamp', 'from', 'to', 'nonce', 'method', 'params']
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get messageName() {
|
|
59
|
+
return 'TransactionMessage'
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
constructor(buffer) {
|
|
63
|
+
const name = 'transaction-message';
|
|
64
|
+
super(buffer, proto, {name});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
var transaction = /*#__PURE__*/Object.freeze({
|
|
69
|
+
__proto__: null,
|
|
70
|
+
'default': TransactionMessage
|
|
71
|
+
});
|
|
72
|
+
|
|
78
73
|
class BlockMessage extends codecFormatInterface.FormatInterface {
|
|
79
74
|
get keys() {
|
|
80
75
|
return ['index', 'previousHash', 'timestamp', 'reward', 'fees', 'transactions', 'validators']
|
|
81
76
|
}
|
|
82
77
|
|
|
78
|
+
get messageName() {
|
|
79
|
+
return 'BlockMessage'
|
|
80
|
+
}
|
|
81
|
+
|
|
83
82
|
constructor(buffer) {
|
|
84
83
|
const name = 'block-message';
|
|
85
|
-
super(buffer,
|
|
84
|
+
super(buffer, proto, {name});
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
87
|
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
required uint64 down = 2;
|
|
94
|
-
}
|
|
95
|
-
`;
|
|
88
|
+
var block = /*#__PURE__*/Object.freeze({
|
|
89
|
+
__proto__: null,
|
|
90
|
+
'default': BlockMessage
|
|
91
|
+
});
|
|
96
92
|
|
|
97
93
|
class BWMessage extends codecFormatInterface.FormatInterface {
|
|
98
94
|
get keys() {
|
|
99
95
|
return ['up', 'down']
|
|
100
96
|
}
|
|
101
97
|
|
|
98
|
+
get messageName() {
|
|
99
|
+
return 'BWMessage'
|
|
100
|
+
}
|
|
101
|
+
|
|
102
102
|
constructor(buffer) {
|
|
103
103
|
const name = 'bw-message';
|
|
104
|
-
super(buffer,
|
|
104
|
+
super(buffer, proto, {name});
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
var
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
`;
|
|
108
|
+
var bw = /*#__PURE__*/Object.freeze({
|
|
109
|
+
__proto__: null,
|
|
110
|
+
'default': BWMessage
|
|
111
|
+
});
|
|
113
112
|
|
|
114
113
|
class BWRequestMessage extends codecFormatInterface.FormatInterface {
|
|
115
114
|
get keys() {
|
|
116
115
|
return []
|
|
117
116
|
}
|
|
118
117
|
|
|
118
|
+
get messageName() {
|
|
119
|
+
return 'BWRequestMessage'
|
|
120
|
+
}
|
|
121
|
+
|
|
119
122
|
constructor(buffer) {
|
|
120
123
|
const name = 'bw-request-message';
|
|
121
|
-
super(buffer,
|
|
124
|
+
super(buffer, proto, {name});
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
127
|
|
|
125
|
-
var
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
BWMessage,
|
|
130
|
-
BWRequestMessage
|
|
131
|
-
};
|
|
128
|
+
var bwRequest = /*#__PURE__*/Object.freeze({
|
|
129
|
+
__proto__: null,
|
|
130
|
+
'default': BWRequestMessage
|
|
131
|
+
});
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
exports.BWMessage = bw;
|
|
134
|
+
exports.BWRequestMessage = bwRequest;
|
|
135
|
+
exports.BlockMessage = block;
|
|
136
|
+
exports.ContractMessage = contract;
|
|
137
|
+
exports.TransactionMessage = transaction;
|