decentralcardgame-cardchain-client-ts 0.0.5 → 0.0.6
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/DecentralCardGame.cardchain.cardchain/module.js +311 -309
- package/DecentralCardGame.cardchain.cardchain/module.ts +469 -467
- package/DecentralCardGame.cardchain.cardchain/registry.js +58 -58
- package/DecentralCardGame.cardchain.cardchain/registry.ts +58 -58
- package/DecentralCardGame.cardchain.cardchain/rest.ts +3 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.js +41 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.ts +51 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/genesis.js +14 -1
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/genesis.ts +16 -2
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.js +10 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.ts +11 -0
- package/DecentralCardGame.cardchain.cardchain/types.js +2 -1
- package/DecentralCardGame.cardchain.cardchain/types.ts +2 -0
- package/client.js +1 -2
- package/package.json +1 -1
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/card.js +0 -491
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/card.ts +0 -556
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/collection.js +0 -365
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/collection.ts +0 -416
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/collection_proposal.js +0 -93
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/collection_proposal.ts +0 -124
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/copyright_proposal.js +0 -102
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/copyright_proposal.ts +0 -134
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/council.js +0 -350
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/council.ts +0 -409
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/genesis.js +0 -241
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/genesis.ts +0 -267
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/image.js +0 -88
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/image.ts +0 -115
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/match.js +0 -210
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/match.ts +0 -255
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/match_reporter_proposal.js +0 -67
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/match_reporter_proposal.ts +0 -92
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/num.js +0 -73
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/num.ts +0 -102
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/params.js +0 -275
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/params.ts +0 -324
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/query.js +0 -1970
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/query.ts +0 -2366
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/running_average.js +0 -85
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/running_average.ts +0 -111
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/sell_offer.js +0 -148
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/sell_offer.ts +0 -183
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/server.js +0 -93
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/server.ts +0 -124
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/tx.js +0 -4137
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/tx.ts +0 -5125
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/user.js +0 -496
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/user.ts +0 -556
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/vote_right.js +0 -84
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/vote_right.ts +0 -114
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/voting_result.js +0 -127
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/voting_result.ts +0 -161
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/voting_results.js +0 -148
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/voting_results.ts +0 -182
- package/cosmos.authz.v1beta1/types/cosmos/base/abci/v1beta1/abci.js +0 -773
- package/cosmos.authz.v1beta1/types/cosmos/base/abci/v1beta1/abci.ts +0 -989
- package/cosmos.authz.v1beta1/types/google/protobuf/duration.js +0 -84
- package/cosmos.authz.v1beta1/types/google/protobuf/duration.ts +0 -187
- package/cosmos.authz.v1beta1/types/tendermint/abci/types.js +0 -3447
- package/cosmos.authz.v1beta1/types/tendermint/abci/types.ts +0 -4107
- package/cosmos.authz.v1beta1/types/tendermint/crypto/keys.js +0 -100
- package/cosmos.authz.v1beta1/types/tendermint/crypto/keys.ts +0 -129
- package/cosmos.authz.v1beta1/types/tendermint/crypto/proof.js +0 -356
- package/cosmos.authz.v1beta1/types/tendermint/crypto/proof.ts +0 -439
- package/cosmos.authz.v1beta1/types/tendermint/types/params.js +0 -378
- package/cosmos.authz.v1beta1/types/tendermint/types/params.ts +0 -514
- package/cosmos.authz.v1beta1/types/tendermint/types/types.js +0 -1207
- package/cosmos.authz.v1beta1/types/tendermint/types/types.ts +0 -1452
- package/cosmos.authz.v1beta1/types/tendermint/types/validator.js +0 -254
- package/cosmos.authz.v1beta1/types/tendermint/types/validator.ts +0 -308
- package/cosmos.authz.v1beta1/types/tendermint/version/types.js +0 -133
- package/cosmos.authz.v1beta1/types/tendermint/version/types.ts +0 -184
- package/ibc.core.connection.v1/types/confio/proofs.js +0 -1120
- package/ibc.core.connection.v1/types/confio/proofs.ts +0 -1402
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import Long from "long";
|
|
3
|
-
import _m0 from "protobufjs/minimal";
|
|
4
|
-
import { PublicKey } from "../crypto/keys";
|
|
5
|
-
export const protobufPackage = "tendermint.types";
|
|
6
|
-
function createBaseValidatorSet() {
|
|
7
|
-
return { validators: [], proposer: undefined, totalVotingPower: 0 };
|
|
8
|
-
}
|
|
9
|
-
export const ValidatorSet = {
|
|
10
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
11
|
-
for (const v of message.validators) {
|
|
12
|
-
Validator.encode(v, writer.uint32(10).fork()).ldelim();
|
|
13
|
-
}
|
|
14
|
-
if (message.proposer !== undefined) {
|
|
15
|
-
Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim();
|
|
16
|
-
}
|
|
17
|
-
if (message.totalVotingPower !== 0) {
|
|
18
|
-
writer.uint32(24).int64(message.totalVotingPower);
|
|
19
|
-
}
|
|
20
|
-
return writer;
|
|
21
|
-
},
|
|
22
|
-
decode(input, length) {
|
|
23
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
24
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
25
|
-
const message = createBaseValidatorSet();
|
|
26
|
-
while (reader.pos < end) {
|
|
27
|
-
const tag = reader.uint32();
|
|
28
|
-
switch (tag >>> 3) {
|
|
29
|
-
case 1:
|
|
30
|
-
message.validators.push(Validator.decode(reader, reader.uint32()));
|
|
31
|
-
break;
|
|
32
|
-
case 2:
|
|
33
|
-
message.proposer = Validator.decode(reader, reader.uint32());
|
|
34
|
-
break;
|
|
35
|
-
case 3:
|
|
36
|
-
message.totalVotingPower = longToNumber(reader.int64());
|
|
37
|
-
break;
|
|
38
|
-
default:
|
|
39
|
-
reader.skipType(tag & 7);
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return message;
|
|
44
|
-
},
|
|
45
|
-
fromJSON(object) {
|
|
46
|
-
return {
|
|
47
|
-
validators: Array.isArray(object?.validators) ? object.validators.map((e) => Validator.fromJSON(e)) : [],
|
|
48
|
-
proposer: isSet(object.proposer) ? Validator.fromJSON(object.proposer) : undefined,
|
|
49
|
-
totalVotingPower: isSet(object.totalVotingPower) ? Number(object.totalVotingPower) : 0,
|
|
50
|
-
};
|
|
51
|
-
},
|
|
52
|
-
toJSON(message) {
|
|
53
|
-
const obj = {};
|
|
54
|
-
if (message.validators) {
|
|
55
|
-
obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
obj.validators = [];
|
|
59
|
-
}
|
|
60
|
-
message.proposer !== undefined
|
|
61
|
-
&& (obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined);
|
|
62
|
-
message.totalVotingPower !== undefined && (obj.totalVotingPower = Math.round(message.totalVotingPower));
|
|
63
|
-
return obj;
|
|
64
|
-
},
|
|
65
|
-
fromPartial(object) {
|
|
66
|
-
const message = createBaseValidatorSet();
|
|
67
|
-
message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || [];
|
|
68
|
-
message.proposer = (object.proposer !== undefined && object.proposer !== null)
|
|
69
|
-
? Validator.fromPartial(object.proposer)
|
|
70
|
-
: undefined;
|
|
71
|
-
message.totalVotingPower = object.totalVotingPower ?? 0;
|
|
72
|
-
return message;
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
function createBaseValidator() {
|
|
76
|
-
return { address: new Uint8Array(), pubKey: undefined, votingPower: 0, proposerPriority: 0 };
|
|
77
|
-
}
|
|
78
|
-
export const Validator = {
|
|
79
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
80
|
-
if (message.address.length !== 0) {
|
|
81
|
-
writer.uint32(10).bytes(message.address);
|
|
82
|
-
}
|
|
83
|
-
if (message.pubKey !== undefined) {
|
|
84
|
-
PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim();
|
|
85
|
-
}
|
|
86
|
-
if (message.votingPower !== 0) {
|
|
87
|
-
writer.uint32(24).int64(message.votingPower);
|
|
88
|
-
}
|
|
89
|
-
if (message.proposerPriority !== 0) {
|
|
90
|
-
writer.uint32(32).int64(message.proposerPriority);
|
|
91
|
-
}
|
|
92
|
-
return writer;
|
|
93
|
-
},
|
|
94
|
-
decode(input, length) {
|
|
95
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
96
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
97
|
-
const message = createBaseValidator();
|
|
98
|
-
while (reader.pos < end) {
|
|
99
|
-
const tag = reader.uint32();
|
|
100
|
-
switch (tag >>> 3) {
|
|
101
|
-
case 1:
|
|
102
|
-
message.address = reader.bytes();
|
|
103
|
-
break;
|
|
104
|
-
case 2:
|
|
105
|
-
message.pubKey = PublicKey.decode(reader, reader.uint32());
|
|
106
|
-
break;
|
|
107
|
-
case 3:
|
|
108
|
-
message.votingPower = longToNumber(reader.int64());
|
|
109
|
-
break;
|
|
110
|
-
case 4:
|
|
111
|
-
message.proposerPriority = longToNumber(reader.int64());
|
|
112
|
-
break;
|
|
113
|
-
default:
|
|
114
|
-
reader.skipType(tag & 7);
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return message;
|
|
119
|
-
},
|
|
120
|
-
fromJSON(object) {
|
|
121
|
-
return {
|
|
122
|
-
address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(),
|
|
123
|
-
pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined,
|
|
124
|
-
votingPower: isSet(object.votingPower) ? Number(object.votingPower) : 0,
|
|
125
|
-
proposerPriority: isSet(object.proposerPriority) ? Number(object.proposerPriority) : 0,
|
|
126
|
-
};
|
|
127
|
-
},
|
|
128
|
-
toJSON(message) {
|
|
129
|
-
const obj = {};
|
|
130
|
-
message.address !== undefined
|
|
131
|
-
&& (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array()));
|
|
132
|
-
message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined);
|
|
133
|
-
message.votingPower !== undefined && (obj.votingPower = Math.round(message.votingPower));
|
|
134
|
-
message.proposerPriority !== undefined && (obj.proposerPriority = Math.round(message.proposerPriority));
|
|
135
|
-
return obj;
|
|
136
|
-
},
|
|
137
|
-
fromPartial(object) {
|
|
138
|
-
const message = createBaseValidator();
|
|
139
|
-
message.address = object.address ?? new Uint8Array();
|
|
140
|
-
message.pubKey = (object.pubKey !== undefined && object.pubKey !== null)
|
|
141
|
-
? PublicKey.fromPartial(object.pubKey)
|
|
142
|
-
: undefined;
|
|
143
|
-
message.votingPower = object.votingPower ?? 0;
|
|
144
|
-
message.proposerPriority = object.proposerPriority ?? 0;
|
|
145
|
-
return message;
|
|
146
|
-
},
|
|
147
|
-
};
|
|
148
|
-
function createBaseSimpleValidator() {
|
|
149
|
-
return { pubKey: undefined, votingPower: 0 };
|
|
150
|
-
}
|
|
151
|
-
export const SimpleValidator = {
|
|
152
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
153
|
-
if (message.pubKey !== undefined) {
|
|
154
|
-
PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim();
|
|
155
|
-
}
|
|
156
|
-
if (message.votingPower !== 0) {
|
|
157
|
-
writer.uint32(16).int64(message.votingPower);
|
|
158
|
-
}
|
|
159
|
-
return writer;
|
|
160
|
-
},
|
|
161
|
-
decode(input, length) {
|
|
162
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
163
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
164
|
-
const message = createBaseSimpleValidator();
|
|
165
|
-
while (reader.pos < end) {
|
|
166
|
-
const tag = reader.uint32();
|
|
167
|
-
switch (tag >>> 3) {
|
|
168
|
-
case 1:
|
|
169
|
-
message.pubKey = PublicKey.decode(reader, reader.uint32());
|
|
170
|
-
break;
|
|
171
|
-
case 2:
|
|
172
|
-
message.votingPower = longToNumber(reader.int64());
|
|
173
|
-
break;
|
|
174
|
-
default:
|
|
175
|
-
reader.skipType(tag & 7);
|
|
176
|
-
break;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
return message;
|
|
180
|
-
},
|
|
181
|
-
fromJSON(object) {
|
|
182
|
-
return {
|
|
183
|
-
pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined,
|
|
184
|
-
votingPower: isSet(object.votingPower) ? Number(object.votingPower) : 0,
|
|
185
|
-
};
|
|
186
|
-
},
|
|
187
|
-
toJSON(message) {
|
|
188
|
-
const obj = {};
|
|
189
|
-
message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined);
|
|
190
|
-
message.votingPower !== undefined && (obj.votingPower = Math.round(message.votingPower));
|
|
191
|
-
return obj;
|
|
192
|
-
},
|
|
193
|
-
fromPartial(object) {
|
|
194
|
-
const message = createBaseSimpleValidator();
|
|
195
|
-
message.pubKey = (object.pubKey !== undefined && object.pubKey !== null)
|
|
196
|
-
? PublicKey.fromPartial(object.pubKey)
|
|
197
|
-
: undefined;
|
|
198
|
-
message.votingPower = object.votingPower ?? 0;
|
|
199
|
-
return message;
|
|
200
|
-
},
|
|
201
|
-
};
|
|
202
|
-
var globalThis = (() => {
|
|
203
|
-
if (typeof globalThis !== "undefined") {
|
|
204
|
-
return globalThis;
|
|
205
|
-
}
|
|
206
|
-
if (typeof self !== "undefined") {
|
|
207
|
-
return self;
|
|
208
|
-
}
|
|
209
|
-
if (typeof window !== "undefined") {
|
|
210
|
-
return window;
|
|
211
|
-
}
|
|
212
|
-
if (typeof global !== "undefined") {
|
|
213
|
-
return global;
|
|
214
|
-
}
|
|
215
|
-
throw "Unable to locate global object";
|
|
216
|
-
})();
|
|
217
|
-
function bytesFromBase64(b64) {
|
|
218
|
-
if (globalThis.Buffer) {
|
|
219
|
-
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
const bin = globalThis.atob(b64);
|
|
223
|
-
const arr = new Uint8Array(bin.length);
|
|
224
|
-
for (let i = 0; i < bin.length; ++i) {
|
|
225
|
-
arr[i] = bin.charCodeAt(i);
|
|
226
|
-
}
|
|
227
|
-
return arr;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
function base64FromBytes(arr) {
|
|
231
|
-
if (globalThis.Buffer) {
|
|
232
|
-
return globalThis.Buffer.from(arr).toString("base64");
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
const bin = [];
|
|
236
|
-
arr.forEach((byte) => {
|
|
237
|
-
bin.push(String.fromCharCode(byte));
|
|
238
|
-
});
|
|
239
|
-
return globalThis.btoa(bin.join(""));
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
function longToNumber(long) {
|
|
243
|
-
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
|
244
|
-
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
245
|
-
}
|
|
246
|
-
return long.toNumber();
|
|
247
|
-
}
|
|
248
|
-
if (_m0.util.Long !== Long) {
|
|
249
|
-
_m0.util.Long = Long;
|
|
250
|
-
_m0.configure();
|
|
251
|
-
}
|
|
252
|
-
function isSet(value) {
|
|
253
|
-
return value !== null && value !== undefined;
|
|
254
|
-
}
|
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import Long from "long";
|
|
3
|
-
import _m0 from "protobufjs/minimal";
|
|
4
|
-
import { PublicKey } from "../crypto/keys";
|
|
5
|
-
|
|
6
|
-
export const protobufPackage = "tendermint.types";
|
|
7
|
-
|
|
8
|
-
export interface ValidatorSet {
|
|
9
|
-
validators: Validator[];
|
|
10
|
-
proposer: Validator | undefined;
|
|
11
|
-
totalVotingPower: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface Validator {
|
|
15
|
-
address: Uint8Array;
|
|
16
|
-
pubKey: PublicKey | undefined;
|
|
17
|
-
votingPower: number;
|
|
18
|
-
proposerPriority: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface SimpleValidator {
|
|
22
|
-
pubKey: PublicKey | undefined;
|
|
23
|
-
votingPower: number;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function createBaseValidatorSet(): ValidatorSet {
|
|
27
|
-
return { validators: [], proposer: undefined, totalVotingPower: 0 };
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const ValidatorSet = {
|
|
31
|
-
encode(message: ValidatorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
32
|
-
for (const v of message.validators) {
|
|
33
|
-
Validator.encode(v!, writer.uint32(10).fork()).ldelim();
|
|
34
|
-
}
|
|
35
|
-
if (message.proposer !== undefined) {
|
|
36
|
-
Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim();
|
|
37
|
-
}
|
|
38
|
-
if (message.totalVotingPower !== 0) {
|
|
39
|
-
writer.uint32(24).int64(message.totalVotingPower);
|
|
40
|
-
}
|
|
41
|
-
return writer;
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSet {
|
|
45
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
46
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
47
|
-
const message = createBaseValidatorSet();
|
|
48
|
-
while (reader.pos < end) {
|
|
49
|
-
const tag = reader.uint32();
|
|
50
|
-
switch (tag >>> 3) {
|
|
51
|
-
case 1:
|
|
52
|
-
message.validators.push(Validator.decode(reader, reader.uint32()));
|
|
53
|
-
break;
|
|
54
|
-
case 2:
|
|
55
|
-
message.proposer = Validator.decode(reader, reader.uint32());
|
|
56
|
-
break;
|
|
57
|
-
case 3:
|
|
58
|
-
message.totalVotingPower = longToNumber(reader.int64() as Long);
|
|
59
|
-
break;
|
|
60
|
-
default:
|
|
61
|
-
reader.skipType(tag & 7);
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return message;
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
fromJSON(object: any): ValidatorSet {
|
|
69
|
-
return {
|
|
70
|
-
validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromJSON(e)) : [],
|
|
71
|
-
proposer: isSet(object.proposer) ? Validator.fromJSON(object.proposer) : undefined,
|
|
72
|
-
totalVotingPower: isSet(object.totalVotingPower) ? Number(object.totalVotingPower) : 0,
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
toJSON(message: ValidatorSet): unknown {
|
|
77
|
-
const obj: any = {};
|
|
78
|
-
if (message.validators) {
|
|
79
|
-
obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : undefined);
|
|
80
|
-
} else {
|
|
81
|
-
obj.validators = [];
|
|
82
|
-
}
|
|
83
|
-
message.proposer !== undefined
|
|
84
|
-
&& (obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined);
|
|
85
|
-
message.totalVotingPower !== undefined && (obj.totalVotingPower = Math.round(message.totalVotingPower));
|
|
86
|
-
return obj;
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
fromPartial<I extends Exact<DeepPartial<ValidatorSet>, I>>(object: I): ValidatorSet {
|
|
90
|
-
const message = createBaseValidatorSet();
|
|
91
|
-
message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || [];
|
|
92
|
-
message.proposer = (object.proposer !== undefined && object.proposer !== null)
|
|
93
|
-
? Validator.fromPartial(object.proposer)
|
|
94
|
-
: undefined;
|
|
95
|
-
message.totalVotingPower = object.totalVotingPower ?? 0;
|
|
96
|
-
return message;
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
function createBaseValidator(): Validator {
|
|
101
|
-
return { address: new Uint8Array(), pubKey: undefined, votingPower: 0, proposerPriority: 0 };
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export const Validator = {
|
|
105
|
-
encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
106
|
-
if (message.address.length !== 0) {
|
|
107
|
-
writer.uint32(10).bytes(message.address);
|
|
108
|
-
}
|
|
109
|
-
if (message.pubKey !== undefined) {
|
|
110
|
-
PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim();
|
|
111
|
-
}
|
|
112
|
-
if (message.votingPower !== 0) {
|
|
113
|
-
writer.uint32(24).int64(message.votingPower);
|
|
114
|
-
}
|
|
115
|
-
if (message.proposerPriority !== 0) {
|
|
116
|
-
writer.uint32(32).int64(message.proposerPriority);
|
|
117
|
-
}
|
|
118
|
-
return writer;
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): Validator {
|
|
122
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
123
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
124
|
-
const message = createBaseValidator();
|
|
125
|
-
while (reader.pos < end) {
|
|
126
|
-
const tag = reader.uint32();
|
|
127
|
-
switch (tag >>> 3) {
|
|
128
|
-
case 1:
|
|
129
|
-
message.address = reader.bytes();
|
|
130
|
-
break;
|
|
131
|
-
case 2:
|
|
132
|
-
message.pubKey = PublicKey.decode(reader, reader.uint32());
|
|
133
|
-
break;
|
|
134
|
-
case 3:
|
|
135
|
-
message.votingPower = longToNumber(reader.int64() as Long);
|
|
136
|
-
break;
|
|
137
|
-
case 4:
|
|
138
|
-
message.proposerPriority = longToNumber(reader.int64() as Long);
|
|
139
|
-
break;
|
|
140
|
-
default:
|
|
141
|
-
reader.skipType(tag & 7);
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return message;
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
fromJSON(object: any): Validator {
|
|
149
|
-
return {
|
|
150
|
-
address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(),
|
|
151
|
-
pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined,
|
|
152
|
-
votingPower: isSet(object.votingPower) ? Number(object.votingPower) : 0,
|
|
153
|
-
proposerPriority: isSet(object.proposerPriority) ? Number(object.proposerPriority) : 0,
|
|
154
|
-
};
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
toJSON(message: Validator): unknown {
|
|
158
|
-
const obj: any = {};
|
|
159
|
-
message.address !== undefined
|
|
160
|
-
&& (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array()));
|
|
161
|
-
message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined);
|
|
162
|
-
message.votingPower !== undefined && (obj.votingPower = Math.round(message.votingPower));
|
|
163
|
-
message.proposerPriority !== undefined && (obj.proposerPriority = Math.round(message.proposerPriority));
|
|
164
|
-
return obj;
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
fromPartial<I extends Exact<DeepPartial<Validator>, I>>(object: I): Validator {
|
|
168
|
-
const message = createBaseValidator();
|
|
169
|
-
message.address = object.address ?? new Uint8Array();
|
|
170
|
-
message.pubKey = (object.pubKey !== undefined && object.pubKey !== null)
|
|
171
|
-
? PublicKey.fromPartial(object.pubKey)
|
|
172
|
-
: undefined;
|
|
173
|
-
message.votingPower = object.votingPower ?? 0;
|
|
174
|
-
message.proposerPriority = object.proposerPriority ?? 0;
|
|
175
|
-
return message;
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
function createBaseSimpleValidator(): SimpleValidator {
|
|
180
|
-
return { pubKey: undefined, votingPower: 0 };
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export const SimpleValidator = {
|
|
184
|
-
encode(message: SimpleValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
185
|
-
if (message.pubKey !== undefined) {
|
|
186
|
-
PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim();
|
|
187
|
-
}
|
|
188
|
-
if (message.votingPower !== 0) {
|
|
189
|
-
writer.uint32(16).int64(message.votingPower);
|
|
190
|
-
}
|
|
191
|
-
return writer;
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): SimpleValidator {
|
|
195
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
196
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
197
|
-
const message = createBaseSimpleValidator();
|
|
198
|
-
while (reader.pos < end) {
|
|
199
|
-
const tag = reader.uint32();
|
|
200
|
-
switch (tag >>> 3) {
|
|
201
|
-
case 1:
|
|
202
|
-
message.pubKey = PublicKey.decode(reader, reader.uint32());
|
|
203
|
-
break;
|
|
204
|
-
case 2:
|
|
205
|
-
message.votingPower = longToNumber(reader.int64() as Long);
|
|
206
|
-
break;
|
|
207
|
-
default:
|
|
208
|
-
reader.skipType(tag & 7);
|
|
209
|
-
break;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
return message;
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
fromJSON(object: any): SimpleValidator {
|
|
216
|
-
return {
|
|
217
|
-
pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined,
|
|
218
|
-
votingPower: isSet(object.votingPower) ? Number(object.votingPower) : 0,
|
|
219
|
-
};
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
toJSON(message: SimpleValidator): unknown {
|
|
223
|
-
const obj: any = {};
|
|
224
|
-
message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined);
|
|
225
|
-
message.votingPower !== undefined && (obj.votingPower = Math.round(message.votingPower));
|
|
226
|
-
return obj;
|
|
227
|
-
},
|
|
228
|
-
|
|
229
|
-
fromPartial<I extends Exact<DeepPartial<SimpleValidator>, I>>(object: I): SimpleValidator {
|
|
230
|
-
const message = createBaseSimpleValidator();
|
|
231
|
-
message.pubKey = (object.pubKey !== undefined && object.pubKey !== null)
|
|
232
|
-
? PublicKey.fromPartial(object.pubKey)
|
|
233
|
-
: undefined;
|
|
234
|
-
message.votingPower = object.votingPower ?? 0;
|
|
235
|
-
return message;
|
|
236
|
-
},
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
declare var self: any | undefined;
|
|
240
|
-
declare var window: any | undefined;
|
|
241
|
-
declare var global: any | undefined;
|
|
242
|
-
var globalThis: any = (() => {
|
|
243
|
-
if (typeof globalThis !== "undefined") {
|
|
244
|
-
return globalThis;
|
|
245
|
-
}
|
|
246
|
-
if (typeof self !== "undefined") {
|
|
247
|
-
return self;
|
|
248
|
-
}
|
|
249
|
-
if (typeof window !== "undefined") {
|
|
250
|
-
return window;
|
|
251
|
-
}
|
|
252
|
-
if (typeof global !== "undefined") {
|
|
253
|
-
return global;
|
|
254
|
-
}
|
|
255
|
-
throw "Unable to locate global object";
|
|
256
|
-
})();
|
|
257
|
-
|
|
258
|
-
function bytesFromBase64(b64: string): Uint8Array {
|
|
259
|
-
if (globalThis.Buffer) {
|
|
260
|
-
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
261
|
-
} else {
|
|
262
|
-
const bin = globalThis.atob(b64);
|
|
263
|
-
const arr = new Uint8Array(bin.length);
|
|
264
|
-
for (let i = 0; i < bin.length; ++i) {
|
|
265
|
-
arr[i] = bin.charCodeAt(i);
|
|
266
|
-
}
|
|
267
|
-
return arr;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
function base64FromBytes(arr: Uint8Array): string {
|
|
272
|
-
if (globalThis.Buffer) {
|
|
273
|
-
return globalThis.Buffer.from(arr).toString("base64");
|
|
274
|
-
} else {
|
|
275
|
-
const bin: string[] = [];
|
|
276
|
-
arr.forEach((byte) => {
|
|
277
|
-
bin.push(String.fromCharCode(byte));
|
|
278
|
-
});
|
|
279
|
-
return globalThis.btoa(bin.join(""));
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
284
|
-
|
|
285
|
-
export type DeepPartial<T> = T extends Builtin ? T
|
|
286
|
-
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
287
|
-
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
288
|
-
: Partial<T>;
|
|
289
|
-
|
|
290
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
291
|
-
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
292
|
-
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
293
|
-
|
|
294
|
-
function longToNumber(long: Long): number {
|
|
295
|
-
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
|
296
|
-
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
297
|
-
}
|
|
298
|
-
return long.toNumber();
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if (_m0.util.Long !== Long) {
|
|
302
|
-
_m0.util.Long = Long as any;
|
|
303
|
-
_m0.configure();
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
function isSet(value: any): boolean {
|
|
307
|
-
return value !== null && value !== undefined;
|
|
308
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import Long from "long";
|
|
3
|
-
import _m0 from "protobufjs/minimal";
|
|
4
|
-
export const protobufPackage = "tendermint.version";
|
|
5
|
-
function createBaseApp() {
|
|
6
|
-
return { protocol: 0, software: "" };
|
|
7
|
-
}
|
|
8
|
-
export const App = {
|
|
9
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
10
|
-
if (message.protocol !== 0) {
|
|
11
|
-
writer.uint32(8).uint64(message.protocol);
|
|
12
|
-
}
|
|
13
|
-
if (message.software !== "") {
|
|
14
|
-
writer.uint32(18).string(message.software);
|
|
15
|
-
}
|
|
16
|
-
return writer;
|
|
17
|
-
},
|
|
18
|
-
decode(input, length) {
|
|
19
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
20
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
21
|
-
const message = createBaseApp();
|
|
22
|
-
while (reader.pos < end) {
|
|
23
|
-
const tag = reader.uint32();
|
|
24
|
-
switch (tag >>> 3) {
|
|
25
|
-
case 1:
|
|
26
|
-
message.protocol = longToNumber(reader.uint64());
|
|
27
|
-
break;
|
|
28
|
-
case 2:
|
|
29
|
-
message.software = reader.string();
|
|
30
|
-
break;
|
|
31
|
-
default:
|
|
32
|
-
reader.skipType(tag & 7);
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return message;
|
|
37
|
-
},
|
|
38
|
-
fromJSON(object) {
|
|
39
|
-
return {
|
|
40
|
-
protocol: isSet(object.protocol) ? Number(object.protocol) : 0,
|
|
41
|
-
software: isSet(object.software) ? String(object.software) : "",
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
toJSON(message) {
|
|
45
|
-
const obj = {};
|
|
46
|
-
message.protocol !== undefined && (obj.protocol = Math.round(message.protocol));
|
|
47
|
-
message.software !== undefined && (obj.software = message.software);
|
|
48
|
-
return obj;
|
|
49
|
-
},
|
|
50
|
-
fromPartial(object) {
|
|
51
|
-
const message = createBaseApp();
|
|
52
|
-
message.protocol = object.protocol ?? 0;
|
|
53
|
-
message.software = object.software ?? "";
|
|
54
|
-
return message;
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
function createBaseConsensus() {
|
|
58
|
-
return { block: 0, app: 0 };
|
|
59
|
-
}
|
|
60
|
-
export const Consensus = {
|
|
61
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
62
|
-
if (message.block !== 0) {
|
|
63
|
-
writer.uint32(8).uint64(message.block);
|
|
64
|
-
}
|
|
65
|
-
if (message.app !== 0) {
|
|
66
|
-
writer.uint32(16).uint64(message.app);
|
|
67
|
-
}
|
|
68
|
-
return writer;
|
|
69
|
-
},
|
|
70
|
-
decode(input, length) {
|
|
71
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
72
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
73
|
-
const message = createBaseConsensus();
|
|
74
|
-
while (reader.pos < end) {
|
|
75
|
-
const tag = reader.uint32();
|
|
76
|
-
switch (tag >>> 3) {
|
|
77
|
-
case 1:
|
|
78
|
-
message.block = longToNumber(reader.uint64());
|
|
79
|
-
break;
|
|
80
|
-
case 2:
|
|
81
|
-
message.app = longToNumber(reader.uint64());
|
|
82
|
-
break;
|
|
83
|
-
default:
|
|
84
|
-
reader.skipType(tag & 7);
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return message;
|
|
89
|
-
},
|
|
90
|
-
fromJSON(object) {
|
|
91
|
-
return { block: isSet(object.block) ? Number(object.block) : 0, app: isSet(object.app) ? Number(object.app) : 0 };
|
|
92
|
-
},
|
|
93
|
-
toJSON(message) {
|
|
94
|
-
const obj = {};
|
|
95
|
-
message.block !== undefined && (obj.block = Math.round(message.block));
|
|
96
|
-
message.app !== undefined && (obj.app = Math.round(message.app));
|
|
97
|
-
return obj;
|
|
98
|
-
},
|
|
99
|
-
fromPartial(object) {
|
|
100
|
-
const message = createBaseConsensus();
|
|
101
|
-
message.block = object.block ?? 0;
|
|
102
|
-
message.app = object.app ?? 0;
|
|
103
|
-
return message;
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
var globalThis = (() => {
|
|
107
|
-
if (typeof globalThis !== "undefined") {
|
|
108
|
-
return globalThis;
|
|
109
|
-
}
|
|
110
|
-
if (typeof self !== "undefined") {
|
|
111
|
-
return self;
|
|
112
|
-
}
|
|
113
|
-
if (typeof window !== "undefined") {
|
|
114
|
-
return window;
|
|
115
|
-
}
|
|
116
|
-
if (typeof global !== "undefined") {
|
|
117
|
-
return global;
|
|
118
|
-
}
|
|
119
|
-
throw "Unable to locate global object";
|
|
120
|
-
})();
|
|
121
|
-
function longToNumber(long) {
|
|
122
|
-
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
|
123
|
-
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
124
|
-
}
|
|
125
|
-
return long.toNumber();
|
|
126
|
-
}
|
|
127
|
-
if (_m0.util.Long !== Long) {
|
|
128
|
-
_m0.util.Long = Long;
|
|
129
|
-
_m0.configure();
|
|
130
|
-
}
|
|
131
|
-
function isSet(value) {
|
|
132
|
-
return value !== null && value !== undefined;
|
|
133
|
-
}
|