@bitgo-beta/abstract-cosmos 1.0.1-beta.99 → 1.0.1-beta.991
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/.eslintignore +1 -1
- package/CHANGELOG.md +834 -0
- package/dist/resources/MsgCompiled.d.ts +1212 -0
- package/dist/resources/MsgCompiled.js +2761 -0
- package/dist/src/cosmosCoin.d.ts +20 -10
- package/dist/src/cosmosCoin.d.ts.map +1 -1
- package/dist/src/cosmosCoin.js +170 -143
- package/dist/src/index.js +6 -2
- package/dist/src/lib/ContractCallBuilder.d.ts +3 -3
- package/dist/src/lib/ContractCallBuilder.d.ts.map +1 -1
- package/dist/src/lib/ContractCallBuilder.js +35 -2
- package/dist/src/lib/StakingActivateBuilder.d.ts +3 -3
- package/dist/src/lib/StakingActivateBuilder.d.ts.map +1 -1
- package/dist/src/lib/StakingActivateBuilder.js +35 -2
- package/dist/src/lib/StakingDeactivateBuilder.d.ts +3 -3
- package/dist/src/lib/StakingDeactivateBuilder.d.ts.map +1 -1
- package/dist/src/lib/StakingDeactivateBuilder.js +35 -2
- package/dist/src/lib/StakingRedelegateBuilder.d.ts +13 -0
- package/dist/src/lib/StakingRedelegateBuilder.d.ts.map +1 -0
- package/dist/src/lib/StakingRedelegateBuilder.js +61 -0
- package/dist/src/lib/StakingWithdrawRewardsBuilder.d.ts +3 -3
- package/dist/src/lib/StakingWithdrawRewardsBuilder.d.ts.map +1 -1
- package/dist/src/lib/StakingWithdrawRewardsBuilder.js +35 -2
- package/dist/src/lib/constants.d.ts +2 -0
- package/dist/src/lib/constants.d.ts.map +1 -1
- package/dist/src/lib/constants.js +4 -2
- package/dist/src/lib/iface.d.ts +30 -8
- package/dist/src/lib/iface.d.ts.map +1 -1
- package/dist/src/lib/iface.js +18 -1
- package/dist/src/lib/index.d.ts +1 -0
- package/dist/src/lib/index.d.ts.map +1 -1
- package/dist/src/lib/index.js +32 -4
- package/dist/src/lib/keyPair.js +9 -10
- package/dist/src/lib/transaction.d.ts +8 -9
- package/dist/src/lib/transaction.d.ts.map +1 -1
- package/dist/src/lib/transaction.js +124 -92
- package/dist/src/lib/transactionBuilder.d.ts +17 -14
- package/dist/src/lib/transactionBuilder.d.ts.map +1 -1
- package/dist/src/lib/transactionBuilder.js +10 -5
- package/dist/src/lib/transferBuilder.d.ts +3 -3
- package/dist/src/lib/transferBuilder.d.ts.map +1 -1
- package/dist/src/lib/transferBuilder.js +35 -2
- package/dist/src/lib/utils.d.ts +97 -17
- package/dist/src/lib/utils.d.ts.map +1 -1
- package/dist/src/lib/utils.js +229 -23
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -10
- package/resources/MsgCompiled.d.ts +1212 -0
- package/resources/MsgCompiled.js +2761 -0
|
@@ -0,0 +1,2761 @@
|
|
|
1
|
+
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var $protobuf = require('protobufjs/minimal');
|
|
5
|
+
|
|
6
|
+
// Common aliases
|
|
7
|
+
var $Reader = $protobuf.Reader,
|
|
8
|
+
$Writer = $protobuf.Writer,
|
|
9
|
+
$util = $protobuf.util;
|
|
10
|
+
|
|
11
|
+
// Exported root namespace
|
|
12
|
+
var $root = $protobuf.roots['default'] || ($protobuf.roots['default'] = {});
|
|
13
|
+
|
|
14
|
+
$root.common = (function () {
|
|
15
|
+
/**
|
|
16
|
+
* Namespace common.
|
|
17
|
+
* @exports common
|
|
18
|
+
* @namespace
|
|
19
|
+
*/
|
|
20
|
+
var common = {};
|
|
21
|
+
|
|
22
|
+
common.Asset = (function () {
|
|
23
|
+
/**
|
|
24
|
+
* Properties of an Asset.
|
|
25
|
+
* @memberof common
|
|
26
|
+
* @interface IAsset
|
|
27
|
+
* @property {string|null} [chain] Asset chain
|
|
28
|
+
* @property {string|null} [symbol] Asset symbol
|
|
29
|
+
* @property {string|null} [ticker] Asset ticker
|
|
30
|
+
* @property {boolean|null} [synth] Asset synth
|
|
31
|
+
* @property {boolean|null} [trade] Asset trade
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new Asset.
|
|
36
|
+
* @memberof common
|
|
37
|
+
* @classdesc Represents an Asset.
|
|
38
|
+
* @implements IAsset
|
|
39
|
+
* @constructor
|
|
40
|
+
* @param {common.IAsset=} [properties] Properties to set
|
|
41
|
+
*/
|
|
42
|
+
function Asset(properties) {
|
|
43
|
+
if (properties)
|
|
44
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
45
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Asset chain.
|
|
50
|
+
* @member {string} chain
|
|
51
|
+
* @memberof common.Asset
|
|
52
|
+
* @instance
|
|
53
|
+
*/
|
|
54
|
+
Asset.prototype.chain = '';
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Asset symbol.
|
|
58
|
+
* @member {string} symbol
|
|
59
|
+
* @memberof common.Asset
|
|
60
|
+
* @instance
|
|
61
|
+
*/
|
|
62
|
+
Asset.prototype.symbol = '';
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Asset ticker.
|
|
66
|
+
* @member {string} ticker
|
|
67
|
+
* @memberof common.Asset
|
|
68
|
+
* @instance
|
|
69
|
+
*/
|
|
70
|
+
Asset.prototype.ticker = '';
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Asset synth.
|
|
74
|
+
* @member {boolean} synth
|
|
75
|
+
* @memberof common.Asset
|
|
76
|
+
* @instance
|
|
77
|
+
*/
|
|
78
|
+
Asset.prototype.synth = false;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Asset trade.
|
|
82
|
+
* @member {boolean} trade
|
|
83
|
+
* @memberof common.Asset
|
|
84
|
+
* @instance
|
|
85
|
+
*/
|
|
86
|
+
Asset.prototype.trade = false;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Creates a new Asset instance using the specified properties.
|
|
90
|
+
* @function create
|
|
91
|
+
* @memberof common.Asset
|
|
92
|
+
* @static
|
|
93
|
+
* @param {common.IAsset=} [properties] Properties to set
|
|
94
|
+
* @returns {common.Asset} Asset instance
|
|
95
|
+
*/
|
|
96
|
+
Asset.create = function create(properties) {
|
|
97
|
+
return new Asset(properties);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Encodes the specified Asset message. Does not implicitly {@link common.Asset.verify|verify} messages.
|
|
102
|
+
* @function encode
|
|
103
|
+
* @memberof common.Asset
|
|
104
|
+
* @static
|
|
105
|
+
* @param {common.IAsset} message Asset message or plain object to encode
|
|
106
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
107
|
+
* @returns {$protobuf.Writer} Writer
|
|
108
|
+
*/
|
|
109
|
+
Asset.encode = function encode(message, writer) {
|
|
110
|
+
if (!writer) writer = $Writer.create();
|
|
111
|
+
if (message.chain != null && Object.hasOwnProperty.call(message, 'chain'))
|
|
112
|
+
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.chain);
|
|
113
|
+
if (message.symbol != null && Object.hasOwnProperty.call(message, 'symbol'))
|
|
114
|
+
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.symbol);
|
|
115
|
+
if (message.ticker != null && Object.hasOwnProperty.call(message, 'ticker'))
|
|
116
|
+
writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.ticker);
|
|
117
|
+
if (message.synth != null && Object.hasOwnProperty.call(message, 'synth'))
|
|
118
|
+
writer.uint32(/* id 4, wireType 0 =*/ 32).bool(message.synth);
|
|
119
|
+
if (message.trade != null && Object.hasOwnProperty.call(message, 'trade'))
|
|
120
|
+
writer.uint32(/* id 5, wireType 0 =*/ 40).bool(message.trade);
|
|
121
|
+
return writer;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Encodes the specified Asset message, length delimited. Does not implicitly {@link common.Asset.verify|verify} messages.
|
|
126
|
+
* @function encodeDelimited
|
|
127
|
+
* @memberof common.Asset
|
|
128
|
+
* @static
|
|
129
|
+
* @param {common.IAsset} message Asset message or plain object to encode
|
|
130
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
131
|
+
* @returns {$protobuf.Writer} Writer
|
|
132
|
+
*/
|
|
133
|
+
Asset.encodeDelimited = function encodeDelimited(message, writer) {
|
|
134
|
+
return this.encode(message, writer).ldelim();
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Decodes an Asset message from the specified reader or buffer.
|
|
139
|
+
* @function decode
|
|
140
|
+
* @memberof common.Asset
|
|
141
|
+
* @static
|
|
142
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
143
|
+
* @param {number} [length] Message length if known beforehand
|
|
144
|
+
* @returns {common.Asset} Asset
|
|
145
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
146
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
147
|
+
*/
|
|
148
|
+
Asset.decode = function decode(reader, length) {
|
|
149
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
150
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
151
|
+
message = new $root.common.Asset();
|
|
152
|
+
while (reader.pos < end) {
|
|
153
|
+
var tag = reader.uint32();
|
|
154
|
+
switch (tag >>> 3) {
|
|
155
|
+
case 1:
|
|
156
|
+
message.chain = reader.string();
|
|
157
|
+
break;
|
|
158
|
+
case 2:
|
|
159
|
+
message.symbol = reader.string();
|
|
160
|
+
break;
|
|
161
|
+
case 3:
|
|
162
|
+
message.ticker = reader.string();
|
|
163
|
+
break;
|
|
164
|
+
case 4:
|
|
165
|
+
message.synth = reader.bool();
|
|
166
|
+
break;
|
|
167
|
+
case 5:
|
|
168
|
+
message.trade = reader.bool();
|
|
169
|
+
break;
|
|
170
|
+
default:
|
|
171
|
+
reader.skipType(tag & 7);
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return message;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Decodes an Asset message from the specified reader or buffer, length delimited.
|
|
180
|
+
* @function decodeDelimited
|
|
181
|
+
* @memberof common.Asset
|
|
182
|
+
* @static
|
|
183
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
184
|
+
* @returns {common.Asset} Asset
|
|
185
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
186
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
187
|
+
*/
|
|
188
|
+
Asset.decodeDelimited = function decodeDelimited(reader) {
|
|
189
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
190
|
+
return this.decode(reader, reader.uint32());
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Verifies an Asset message.
|
|
195
|
+
* @function verify
|
|
196
|
+
* @memberof common.Asset
|
|
197
|
+
* @static
|
|
198
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
199
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
200
|
+
*/
|
|
201
|
+
Asset.verify = function verify(message) {
|
|
202
|
+
if (typeof message !== 'object' || message === null) return 'object expected';
|
|
203
|
+
if (message.chain != null && message.hasOwnProperty('chain'))
|
|
204
|
+
if (!$util.isString(message.chain)) return 'chain: string expected';
|
|
205
|
+
if (message.symbol != null && message.hasOwnProperty('symbol'))
|
|
206
|
+
if (!$util.isString(message.symbol)) return 'symbol: string expected';
|
|
207
|
+
if (message.ticker != null && message.hasOwnProperty('ticker'))
|
|
208
|
+
if (!$util.isString(message.ticker)) return 'ticker: string expected';
|
|
209
|
+
if (message.synth != null && message.hasOwnProperty('synth'))
|
|
210
|
+
if (typeof message.synth !== 'boolean') return 'synth: boolean expected';
|
|
211
|
+
if (message.trade != null && message.hasOwnProperty('trade'))
|
|
212
|
+
if (typeof message.trade !== 'boolean') return 'trade: boolean expected';
|
|
213
|
+
return null;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Creates an Asset message from a plain object. Also converts values to their respective internal types.
|
|
218
|
+
* @function fromObject
|
|
219
|
+
* @memberof common.Asset
|
|
220
|
+
* @static
|
|
221
|
+
* @param {Object.<string,*>} object Plain object
|
|
222
|
+
* @returns {common.Asset} Asset
|
|
223
|
+
*/
|
|
224
|
+
Asset.fromObject = function fromObject(object) {
|
|
225
|
+
if (object instanceof $root.common.Asset) return object;
|
|
226
|
+
var message = new $root.common.Asset();
|
|
227
|
+
if (object.chain != null) message.chain = String(object.chain);
|
|
228
|
+
if (object.symbol != null) message.symbol = String(object.symbol);
|
|
229
|
+
if (object.ticker != null) message.ticker = String(object.ticker);
|
|
230
|
+
if (object.synth != null) message.synth = Boolean(object.synth);
|
|
231
|
+
if (object.trade != null) message.trade = Boolean(object.trade);
|
|
232
|
+
return message;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Creates a plain object from an Asset message. Also converts values to other types if specified.
|
|
237
|
+
* @function toObject
|
|
238
|
+
* @memberof common.Asset
|
|
239
|
+
* @static
|
|
240
|
+
* @param {common.Asset} message Asset
|
|
241
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
242
|
+
* @returns {Object.<string,*>} Plain object
|
|
243
|
+
*/
|
|
244
|
+
Asset.toObject = function toObject(message, options) {
|
|
245
|
+
if (!options) options = {};
|
|
246
|
+
var object = {};
|
|
247
|
+
if (options.defaults) {
|
|
248
|
+
object.chain = '';
|
|
249
|
+
object.symbol = '';
|
|
250
|
+
object.ticker = '';
|
|
251
|
+
object.synth = false;
|
|
252
|
+
object.trade = false;
|
|
253
|
+
}
|
|
254
|
+
if (message.chain != null && message.hasOwnProperty('chain')) object.chain = message.chain;
|
|
255
|
+
if (message.symbol != null && message.hasOwnProperty('symbol')) object.symbol = message.symbol;
|
|
256
|
+
if (message.ticker != null && message.hasOwnProperty('ticker')) object.ticker = message.ticker;
|
|
257
|
+
if (message.synth != null && message.hasOwnProperty('synth')) object.synth = message.synth;
|
|
258
|
+
if (message.trade != null && message.hasOwnProperty('trade')) object.trade = message.trade;
|
|
259
|
+
return object;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Converts this Asset to JSON.
|
|
264
|
+
* @function toJSON
|
|
265
|
+
* @memberof common.Asset
|
|
266
|
+
* @instance
|
|
267
|
+
* @returns {Object.<string,*>} JSON object
|
|
268
|
+
*/
|
|
269
|
+
Asset.prototype.toJSON = function toJSON() {
|
|
270
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
return Asset;
|
|
274
|
+
})();
|
|
275
|
+
|
|
276
|
+
common.Coin = (function () {
|
|
277
|
+
/**
|
|
278
|
+
* Properties of a Coin.
|
|
279
|
+
* @memberof common
|
|
280
|
+
* @interface ICoin
|
|
281
|
+
* @property {common.IAsset|null} [asset] Coin asset
|
|
282
|
+
* @property {string|null} [amount] Coin amount
|
|
283
|
+
* @property {number|Long|null} [decimals] Coin decimals
|
|
284
|
+
*/
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Constructs a new Coin.
|
|
288
|
+
* @memberof common
|
|
289
|
+
* @classdesc Represents a Coin.
|
|
290
|
+
* @implements ICoin
|
|
291
|
+
* @constructor
|
|
292
|
+
* @param {common.ICoin=} [properties] Properties to set
|
|
293
|
+
*/
|
|
294
|
+
function Coin(properties) {
|
|
295
|
+
if (properties)
|
|
296
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
297
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Coin asset.
|
|
302
|
+
* @member {common.IAsset|null|undefined} asset
|
|
303
|
+
* @memberof common.Coin
|
|
304
|
+
* @instance
|
|
305
|
+
*/
|
|
306
|
+
Coin.prototype.asset = null;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Coin amount.
|
|
310
|
+
* @member {string} amount
|
|
311
|
+
* @memberof common.Coin
|
|
312
|
+
* @instance
|
|
313
|
+
*/
|
|
314
|
+
Coin.prototype.amount = '';
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Coin decimals.
|
|
318
|
+
* @member {number|Long} decimals
|
|
319
|
+
* @memberof common.Coin
|
|
320
|
+
* @instance
|
|
321
|
+
*/
|
|
322
|
+
Coin.prototype.decimals = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Creates a new Coin instance using the specified properties.
|
|
326
|
+
* @function create
|
|
327
|
+
* @memberof common.Coin
|
|
328
|
+
* @static
|
|
329
|
+
* @param {common.ICoin=} [properties] Properties to set
|
|
330
|
+
* @returns {common.Coin} Coin instance
|
|
331
|
+
*/
|
|
332
|
+
Coin.create = function create(properties) {
|
|
333
|
+
return new Coin(properties);
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Encodes the specified Coin message. Does not implicitly {@link common.Coin.verify|verify} messages.
|
|
338
|
+
* @function encode
|
|
339
|
+
* @memberof common.Coin
|
|
340
|
+
* @static
|
|
341
|
+
* @param {common.ICoin} message Coin message or plain object to encode
|
|
342
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
343
|
+
* @returns {$protobuf.Writer} Writer
|
|
344
|
+
*/
|
|
345
|
+
Coin.encode = function encode(message, writer) {
|
|
346
|
+
if (!writer) writer = $Writer.create();
|
|
347
|
+
if (message.asset != null && Object.hasOwnProperty.call(message, 'asset'))
|
|
348
|
+
$root.common.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim();
|
|
349
|
+
if (message.amount != null && Object.hasOwnProperty.call(message, 'amount'))
|
|
350
|
+
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.amount);
|
|
351
|
+
if (message.decimals != null && Object.hasOwnProperty.call(message, 'decimals'))
|
|
352
|
+
writer.uint32(/* id 3, wireType 0 =*/ 24).int64(message.decimals);
|
|
353
|
+
return writer;
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Encodes the specified Coin message, length delimited. Does not implicitly {@link common.Coin.verify|verify} messages.
|
|
358
|
+
* @function encodeDelimited
|
|
359
|
+
* @memberof common.Coin
|
|
360
|
+
* @static
|
|
361
|
+
* @param {common.ICoin} message Coin message or plain object to encode
|
|
362
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
363
|
+
* @returns {$protobuf.Writer} Writer
|
|
364
|
+
*/
|
|
365
|
+
Coin.encodeDelimited = function encodeDelimited(message, writer) {
|
|
366
|
+
return this.encode(message, writer).ldelim();
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Decodes a Coin message from the specified reader or buffer.
|
|
371
|
+
* @function decode
|
|
372
|
+
* @memberof common.Coin
|
|
373
|
+
* @static
|
|
374
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
375
|
+
* @param {number} [length] Message length if known beforehand
|
|
376
|
+
* @returns {common.Coin} Coin
|
|
377
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
378
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
379
|
+
*/
|
|
380
|
+
Coin.decode = function decode(reader, length) {
|
|
381
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
382
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
383
|
+
message = new $root.common.Coin();
|
|
384
|
+
while (reader.pos < end) {
|
|
385
|
+
var tag = reader.uint32();
|
|
386
|
+
switch (tag >>> 3) {
|
|
387
|
+
case 1:
|
|
388
|
+
message.asset = $root.common.Asset.decode(reader, reader.uint32());
|
|
389
|
+
break;
|
|
390
|
+
case 2:
|
|
391
|
+
message.amount = reader.string();
|
|
392
|
+
break;
|
|
393
|
+
case 3:
|
|
394
|
+
message.decimals = reader.int64();
|
|
395
|
+
break;
|
|
396
|
+
default:
|
|
397
|
+
reader.skipType(tag & 7);
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return message;
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Decodes a Coin message from the specified reader or buffer, length delimited.
|
|
406
|
+
* @function decodeDelimited
|
|
407
|
+
* @memberof common.Coin
|
|
408
|
+
* @static
|
|
409
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
410
|
+
* @returns {common.Coin} Coin
|
|
411
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
412
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
413
|
+
*/
|
|
414
|
+
Coin.decodeDelimited = function decodeDelimited(reader) {
|
|
415
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
416
|
+
return this.decode(reader, reader.uint32());
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Verifies a Coin message.
|
|
421
|
+
* @function verify
|
|
422
|
+
* @memberof common.Coin
|
|
423
|
+
* @static
|
|
424
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
425
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
426
|
+
*/
|
|
427
|
+
Coin.verify = function verify(message) {
|
|
428
|
+
if (typeof message !== 'object' || message === null) return 'object expected';
|
|
429
|
+
if (message.asset != null && message.hasOwnProperty('asset')) {
|
|
430
|
+
var error = $root.common.Asset.verify(message.asset);
|
|
431
|
+
if (error) return 'asset.' + error;
|
|
432
|
+
}
|
|
433
|
+
if (message.amount != null && message.hasOwnProperty('amount'))
|
|
434
|
+
if (!$util.isString(message.amount)) return 'amount: string expected';
|
|
435
|
+
if (message.decimals != null && message.hasOwnProperty('decimals'))
|
|
436
|
+
if (
|
|
437
|
+
!$util.isInteger(message.decimals) &&
|
|
438
|
+
!(message.decimals && $util.isInteger(message.decimals.low) && $util.isInteger(message.decimals.high))
|
|
439
|
+
)
|
|
440
|
+
return 'decimals: integer|Long expected';
|
|
441
|
+
return null;
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Creates a Coin message from a plain object. Also converts values to their respective internal types.
|
|
446
|
+
* @function fromObject
|
|
447
|
+
* @memberof common.Coin
|
|
448
|
+
* @static
|
|
449
|
+
* @param {Object.<string,*>} object Plain object
|
|
450
|
+
* @returns {common.Coin} Coin
|
|
451
|
+
*/
|
|
452
|
+
Coin.fromObject = function fromObject(object) {
|
|
453
|
+
if (object instanceof $root.common.Coin) return object;
|
|
454
|
+
var message = new $root.common.Coin();
|
|
455
|
+
if (object.asset != null) {
|
|
456
|
+
if (typeof object.asset !== 'object') throw TypeError('.common.Coin.asset: object expected');
|
|
457
|
+
message.asset = $root.common.Asset.fromObject(object.asset);
|
|
458
|
+
}
|
|
459
|
+
if (object.amount != null) message.amount = String(object.amount);
|
|
460
|
+
if (object.decimals != null)
|
|
461
|
+
if ($util.Long) (message.decimals = $util.Long.fromValue(object.decimals)).unsigned = false;
|
|
462
|
+
else if (typeof object.decimals === 'string') message.decimals = parseInt(object.decimals, 10);
|
|
463
|
+
else if (typeof object.decimals === 'number') message.decimals = object.decimals;
|
|
464
|
+
else if (typeof object.decimals === 'object')
|
|
465
|
+
message.decimals = new $util.LongBits(object.decimals.low >>> 0, object.decimals.high >>> 0).toNumber();
|
|
466
|
+
return message;
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Creates a plain object from a Coin message. Also converts values to other types if specified.
|
|
471
|
+
* @function toObject
|
|
472
|
+
* @memberof common.Coin
|
|
473
|
+
* @static
|
|
474
|
+
* @param {common.Coin} message Coin
|
|
475
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
476
|
+
* @returns {Object.<string,*>} Plain object
|
|
477
|
+
*/
|
|
478
|
+
Coin.toObject = function toObject(message, options) {
|
|
479
|
+
if (!options) options = {};
|
|
480
|
+
var object = {};
|
|
481
|
+
if (options.defaults) {
|
|
482
|
+
object.asset = null;
|
|
483
|
+
object.amount = '';
|
|
484
|
+
if ($util.Long) {
|
|
485
|
+
var long = new $util.Long(0, 0, false);
|
|
486
|
+
object.decimals =
|
|
487
|
+
options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
488
|
+
} else object.decimals = options.longs === String ? '0' : 0;
|
|
489
|
+
}
|
|
490
|
+
if (message.asset != null && message.hasOwnProperty('asset'))
|
|
491
|
+
object.asset = $root.common.Asset.toObject(message.asset, options);
|
|
492
|
+
if (message.amount != null && message.hasOwnProperty('amount')) object.amount = message.amount;
|
|
493
|
+
if (message.decimals != null && message.hasOwnProperty('decimals'))
|
|
494
|
+
if (typeof message.decimals === 'number')
|
|
495
|
+
object.decimals = options.longs === String ? String(message.decimals) : message.decimals;
|
|
496
|
+
else
|
|
497
|
+
object.decimals =
|
|
498
|
+
options.longs === String
|
|
499
|
+
? $util.Long.prototype.toString.call(message.decimals)
|
|
500
|
+
: options.longs === Number
|
|
501
|
+
? new $util.LongBits(message.decimals.low >>> 0, message.decimals.high >>> 0).toNumber()
|
|
502
|
+
: message.decimals;
|
|
503
|
+
return object;
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Converts this Coin to JSON.
|
|
508
|
+
* @function toJSON
|
|
509
|
+
* @memberof common.Coin
|
|
510
|
+
* @instance
|
|
511
|
+
* @returns {Object.<string,*>} JSON object
|
|
512
|
+
*/
|
|
513
|
+
Coin.prototype.toJSON = function toJSON() {
|
|
514
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
return Coin;
|
|
518
|
+
})();
|
|
519
|
+
|
|
520
|
+
common.PubKeySet = (function () {
|
|
521
|
+
/**
|
|
522
|
+
* Properties of a PubKeySet.
|
|
523
|
+
* @memberof common
|
|
524
|
+
* @interface IPubKeySet
|
|
525
|
+
* @property {string|null} [secp256k1] PubKeySet secp256k1
|
|
526
|
+
* @property {string|null} [ed25519] PubKeySet ed25519
|
|
527
|
+
*/
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Constructs a new PubKeySet.
|
|
531
|
+
* @memberof common
|
|
532
|
+
* @classdesc Represents a PubKeySet.
|
|
533
|
+
* @implements IPubKeySet
|
|
534
|
+
* @constructor
|
|
535
|
+
* @param {common.IPubKeySet=} [properties] Properties to set
|
|
536
|
+
*/
|
|
537
|
+
function PubKeySet(properties) {
|
|
538
|
+
if (properties)
|
|
539
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
540
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* PubKeySet secp256k1.
|
|
545
|
+
* @member {string} secp256k1
|
|
546
|
+
* @memberof common.PubKeySet
|
|
547
|
+
* @instance
|
|
548
|
+
*/
|
|
549
|
+
PubKeySet.prototype.secp256k1 = '';
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* PubKeySet ed25519.
|
|
553
|
+
* @member {string} ed25519
|
|
554
|
+
* @memberof common.PubKeySet
|
|
555
|
+
* @instance
|
|
556
|
+
*/
|
|
557
|
+
PubKeySet.prototype.ed25519 = '';
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Creates a new PubKeySet instance using the specified properties.
|
|
561
|
+
* @function create
|
|
562
|
+
* @memberof common.PubKeySet
|
|
563
|
+
* @static
|
|
564
|
+
* @param {common.IPubKeySet=} [properties] Properties to set
|
|
565
|
+
* @returns {common.PubKeySet} PubKeySet instance
|
|
566
|
+
*/
|
|
567
|
+
PubKeySet.create = function create(properties) {
|
|
568
|
+
return new PubKeySet(properties);
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* Encodes the specified PubKeySet message. Does not implicitly {@link common.PubKeySet.verify|verify} messages.
|
|
573
|
+
* @function encode
|
|
574
|
+
* @memberof common.PubKeySet
|
|
575
|
+
* @static
|
|
576
|
+
* @param {common.IPubKeySet} message PubKeySet message or plain object to encode
|
|
577
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
578
|
+
* @returns {$protobuf.Writer} Writer
|
|
579
|
+
*/
|
|
580
|
+
PubKeySet.encode = function encode(message, writer) {
|
|
581
|
+
if (!writer) writer = $Writer.create();
|
|
582
|
+
if (message.secp256k1 != null && Object.hasOwnProperty.call(message, 'secp256k1'))
|
|
583
|
+
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.secp256k1);
|
|
584
|
+
if (message.ed25519 != null && Object.hasOwnProperty.call(message, 'ed25519'))
|
|
585
|
+
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.ed25519);
|
|
586
|
+
return writer;
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Encodes the specified PubKeySet message, length delimited. Does not implicitly {@link common.PubKeySet.verify|verify} messages.
|
|
591
|
+
* @function encodeDelimited
|
|
592
|
+
* @memberof common.PubKeySet
|
|
593
|
+
* @static
|
|
594
|
+
* @param {common.IPubKeySet} message PubKeySet message or plain object to encode
|
|
595
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
596
|
+
* @returns {$protobuf.Writer} Writer
|
|
597
|
+
*/
|
|
598
|
+
PubKeySet.encodeDelimited = function encodeDelimited(message, writer) {
|
|
599
|
+
return this.encode(message, writer).ldelim();
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Decodes a PubKeySet message from the specified reader or buffer.
|
|
604
|
+
* @function decode
|
|
605
|
+
* @memberof common.PubKeySet
|
|
606
|
+
* @static
|
|
607
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
608
|
+
* @param {number} [length] Message length if known beforehand
|
|
609
|
+
* @returns {common.PubKeySet} PubKeySet
|
|
610
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
611
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
612
|
+
*/
|
|
613
|
+
PubKeySet.decode = function decode(reader, length) {
|
|
614
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
615
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
616
|
+
message = new $root.common.PubKeySet();
|
|
617
|
+
while (reader.pos < end) {
|
|
618
|
+
var tag = reader.uint32();
|
|
619
|
+
switch (tag >>> 3) {
|
|
620
|
+
case 1:
|
|
621
|
+
message.secp256k1 = reader.string();
|
|
622
|
+
break;
|
|
623
|
+
case 2:
|
|
624
|
+
message.ed25519 = reader.string();
|
|
625
|
+
break;
|
|
626
|
+
default:
|
|
627
|
+
reader.skipType(tag & 7);
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
return message;
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Decodes a PubKeySet message from the specified reader or buffer, length delimited.
|
|
636
|
+
* @function decodeDelimited
|
|
637
|
+
* @memberof common.PubKeySet
|
|
638
|
+
* @static
|
|
639
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
640
|
+
* @returns {common.PubKeySet} PubKeySet
|
|
641
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
642
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
643
|
+
*/
|
|
644
|
+
PubKeySet.decodeDelimited = function decodeDelimited(reader) {
|
|
645
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
646
|
+
return this.decode(reader, reader.uint32());
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Verifies a PubKeySet message.
|
|
651
|
+
* @function verify
|
|
652
|
+
* @memberof common.PubKeySet
|
|
653
|
+
* @static
|
|
654
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
655
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
656
|
+
*/
|
|
657
|
+
PubKeySet.verify = function verify(message) {
|
|
658
|
+
if (typeof message !== 'object' || message === null) return 'object expected';
|
|
659
|
+
if (message.secp256k1 != null && message.hasOwnProperty('secp256k1'))
|
|
660
|
+
if (!$util.isString(message.secp256k1)) return 'secp256k1: string expected';
|
|
661
|
+
if (message.ed25519 != null && message.hasOwnProperty('ed25519'))
|
|
662
|
+
if (!$util.isString(message.ed25519)) return 'ed25519: string expected';
|
|
663
|
+
return null;
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Creates a PubKeySet message from a plain object. Also converts values to their respective internal types.
|
|
668
|
+
* @function fromObject
|
|
669
|
+
* @memberof common.PubKeySet
|
|
670
|
+
* @static
|
|
671
|
+
* @param {Object.<string,*>} object Plain object
|
|
672
|
+
* @returns {common.PubKeySet} PubKeySet
|
|
673
|
+
*/
|
|
674
|
+
PubKeySet.fromObject = function fromObject(object) {
|
|
675
|
+
if (object instanceof $root.common.PubKeySet) return object;
|
|
676
|
+
var message = new $root.common.PubKeySet();
|
|
677
|
+
if (object.secp256k1 != null) message.secp256k1 = String(object.secp256k1);
|
|
678
|
+
if (object.ed25519 != null) message.ed25519 = String(object.ed25519);
|
|
679
|
+
return message;
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Creates a plain object from a PubKeySet message. Also converts values to other types if specified.
|
|
684
|
+
* @function toObject
|
|
685
|
+
* @memberof common.PubKeySet
|
|
686
|
+
* @static
|
|
687
|
+
* @param {common.PubKeySet} message PubKeySet
|
|
688
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
689
|
+
* @returns {Object.<string,*>} Plain object
|
|
690
|
+
*/
|
|
691
|
+
PubKeySet.toObject = function toObject(message, options) {
|
|
692
|
+
if (!options) options = {};
|
|
693
|
+
var object = {};
|
|
694
|
+
if (options.defaults) {
|
|
695
|
+
object.secp256k1 = '';
|
|
696
|
+
object.ed25519 = '';
|
|
697
|
+
}
|
|
698
|
+
if (message.secp256k1 != null && message.hasOwnProperty('secp256k1')) object.secp256k1 = message.secp256k1;
|
|
699
|
+
if (message.ed25519 != null && message.hasOwnProperty('ed25519')) object.ed25519 = message.ed25519;
|
|
700
|
+
return object;
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Converts this PubKeySet to JSON.
|
|
705
|
+
* @function toJSON
|
|
706
|
+
* @memberof common.PubKeySet
|
|
707
|
+
* @instance
|
|
708
|
+
* @returns {Object.<string,*>} JSON object
|
|
709
|
+
*/
|
|
710
|
+
PubKeySet.prototype.toJSON = function toJSON() {
|
|
711
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
712
|
+
};
|
|
713
|
+
|
|
714
|
+
return PubKeySet;
|
|
715
|
+
})();
|
|
716
|
+
|
|
717
|
+
common.Tx = (function () {
|
|
718
|
+
/**
|
|
719
|
+
* Properties of a Tx.
|
|
720
|
+
* @memberof common
|
|
721
|
+
* @interface ITx
|
|
722
|
+
* @property {string|null} [id] Tx id
|
|
723
|
+
* @property {string|null} [chain] Tx chain
|
|
724
|
+
* @property {string|null} [fromAddress] Tx fromAddress
|
|
725
|
+
* @property {string|null} [toAddress] Tx toAddress
|
|
726
|
+
* @property {Array.<common.ICoin>|null} [coins] Tx coins
|
|
727
|
+
* @property {Array.<common.ICoin>|null} [gas] Tx gas
|
|
728
|
+
* @property {string|null} [memo] Tx memo
|
|
729
|
+
*/
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Constructs a new Tx.
|
|
733
|
+
* @memberof common
|
|
734
|
+
* @classdesc Represents a Tx.
|
|
735
|
+
* @implements ITx
|
|
736
|
+
* @constructor
|
|
737
|
+
* @param {common.ITx=} [properties] Properties to set
|
|
738
|
+
*/
|
|
739
|
+
function Tx(properties) {
|
|
740
|
+
this.coins = [];
|
|
741
|
+
this.gas = [];
|
|
742
|
+
if (properties)
|
|
743
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
744
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Tx id.
|
|
749
|
+
* @member {string} id
|
|
750
|
+
* @memberof common.Tx
|
|
751
|
+
* @instance
|
|
752
|
+
*/
|
|
753
|
+
Tx.prototype.id = '';
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Tx chain.
|
|
757
|
+
* @member {string} chain
|
|
758
|
+
* @memberof common.Tx
|
|
759
|
+
* @instance
|
|
760
|
+
*/
|
|
761
|
+
Tx.prototype.chain = '';
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Tx fromAddress.
|
|
765
|
+
* @member {string} fromAddress
|
|
766
|
+
* @memberof common.Tx
|
|
767
|
+
* @instance
|
|
768
|
+
*/
|
|
769
|
+
Tx.prototype.fromAddress = '';
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Tx toAddress.
|
|
773
|
+
* @member {string} toAddress
|
|
774
|
+
* @memberof common.Tx
|
|
775
|
+
* @instance
|
|
776
|
+
*/
|
|
777
|
+
Tx.prototype.toAddress = '';
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Tx coins.
|
|
781
|
+
* @member {Array.<common.ICoin>} coins
|
|
782
|
+
* @memberof common.Tx
|
|
783
|
+
* @instance
|
|
784
|
+
*/
|
|
785
|
+
Tx.prototype.coins = $util.emptyArray;
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* Tx gas.
|
|
789
|
+
* @member {Array.<common.ICoin>} gas
|
|
790
|
+
* @memberof common.Tx
|
|
791
|
+
* @instance
|
|
792
|
+
*/
|
|
793
|
+
Tx.prototype.gas = $util.emptyArray;
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* Tx memo.
|
|
797
|
+
* @member {string} memo
|
|
798
|
+
* @memberof common.Tx
|
|
799
|
+
* @instance
|
|
800
|
+
*/
|
|
801
|
+
Tx.prototype.memo = '';
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* Creates a new Tx instance using the specified properties.
|
|
805
|
+
* @function create
|
|
806
|
+
* @memberof common.Tx
|
|
807
|
+
* @static
|
|
808
|
+
* @param {common.ITx=} [properties] Properties to set
|
|
809
|
+
* @returns {common.Tx} Tx instance
|
|
810
|
+
*/
|
|
811
|
+
Tx.create = function create(properties) {
|
|
812
|
+
return new Tx(properties);
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* Encodes the specified Tx message. Does not implicitly {@link common.Tx.verify|verify} messages.
|
|
817
|
+
* @function encode
|
|
818
|
+
* @memberof common.Tx
|
|
819
|
+
* @static
|
|
820
|
+
* @param {common.ITx} message Tx message or plain object to encode
|
|
821
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
822
|
+
* @returns {$protobuf.Writer} Writer
|
|
823
|
+
*/
|
|
824
|
+
Tx.encode = function encode(message, writer) {
|
|
825
|
+
if (!writer) writer = $Writer.create();
|
|
826
|
+
if (message.id != null && Object.hasOwnProperty.call(message, 'id'))
|
|
827
|
+
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.id);
|
|
828
|
+
if (message.chain != null && Object.hasOwnProperty.call(message, 'chain'))
|
|
829
|
+
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.chain);
|
|
830
|
+
if (message.fromAddress != null && Object.hasOwnProperty.call(message, 'fromAddress'))
|
|
831
|
+
writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.fromAddress);
|
|
832
|
+
if (message.toAddress != null && Object.hasOwnProperty.call(message, 'toAddress'))
|
|
833
|
+
writer.uint32(/* id 4, wireType 2 =*/ 34).string(message.toAddress);
|
|
834
|
+
if (message.coins != null && message.coins.length)
|
|
835
|
+
for (var i = 0; i < message.coins.length; ++i)
|
|
836
|
+
$root.common.Coin.encode(message.coins[i], writer.uint32(/* id 5, wireType 2 =*/ 42).fork()).ldelim();
|
|
837
|
+
if (message.gas != null && message.gas.length)
|
|
838
|
+
for (var i = 0; i < message.gas.length; ++i)
|
|
839
|
+
$root.common.Coin.encode(message.gas[i], writer.uint32(/* id 6, wireType 2 =*/ 50).fork()).ldelim();
|
|
840
|
+
if (message.memo != null && Object.hasOwnProperty.call(message, 'memo'))
|
|
841
|
+
writer.uint32(/* id 7, wireType 2 =*/ 58).string(message.memo);
|
|
842
|
+
return writer;
|
|
843
|
+
};
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* Encodes the specified Tx message, length delimited. Does not implicitly {@link common.Tx.verify|verify} messages.
|
|
847
|
+
* @function encodeDelimited
|
|
848
|
+
* @memberof common.Tx
|
|
849
|
+
* @static
|
|
850
|
+
* @param {common.ITx} message Tx message or plain object to encode
|
|
851
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
852
|
+
* @returns {$protobuf.Writer} Writer
|
|
853
|
+
*/
|
|
854
|
+
Tx.encodeDelimited = function encodeDelimited(message, writer) {
|
|
855
|
+
return this.encode(message, writer).ldelim();
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* Decodes a Tx message from the specified reader or buffer.
|
|
860
|
+
* @function decode
|
|
861
|
+
* @memberof common.Tx
|
|
862
|
+
* @static
|
|
863
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
864
|
+
* @param {number} [length] Message length if known beforehand
|
|
865
|
+
* @returns {common.Tx} Tx
|
|
866
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
867
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
868
|
+
*/
|
|
869
|
+
Tx.decode = function decode(reader, length) {
|
|
870
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
871
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
872
|
+
message = new $root.common.Tx();
|
|
873
|
+
while (reader.pos < end) {
|
|
874
|
+
var tag = reader.uint32();
|
|
875
|
+
switch (tag >>> 3) {
|
|
876
|
+
case 1:
|
|
877
|
+
message.id = reader.string();
|
|
878
|
+
break;
|
|
879
|
+
case 2:
|
|
880
|
+
message.chain = reader.string();
|
|
881
|
+
break;
|
|
882
|
+
case 3:
|
|
883
|
+
message.fromAddress = reader.string();
|
|
884
|
+
break;
|
|
885
|
+
case 4:
|
|
886
|
+
message.toAddress = reader.string();
|
|
887
|
+
break;
|
|
888
|
+
case 5:
|
|
889
|
+
if (!(message.coins && message.coins.length)) message.coins = [];
|
|
890
|
+
message.coins.push($root.common.Coin.decode(reader, reader.uint32()));
|
|
891
|
+
break;
|
|
892
|
+
case 6:
|
|
893
|
+
if (!(message.gas && message.gas.length)) message.gas = [];
|
|
894
|
+
message.gas.push($root.common.Coin.decode(reader, reader.uint32()));
|
|
895
|
+
break;
|
|
896
|
+
case 7:
|
|
897
|
+
message.memo = reader.string();
|
|
898
|
+
break;
|
|
899
|
+
default:
|
|
900
|
+
reader.skipType(tag & 7);
|
|
901
|
+
break;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
return message;
|
|
905
|
+
};
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* Decodes a Tx message from the specified reader or buffer, length delimited.
|
|
909
|
+
* @function decodeDelimited
|
|
910
|
+
* @memberof common.Tx
|
|
911
|
+
* @static
|
|
912
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
913
|
+
* @returns {common.Tx} Tx
|
|
914
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
915
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
916
|
+
*/
|
|
917
|
+
Tx.decodeDelimited = function decodeDelimited(reader) {
|
|
918
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
919
|
+
return this.decode(reader, reader.uint32());
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Verifies a Tx message.
|
|
924
|
+
* @function verify
|
|
925
|
+
* @memberof common.Tx
|
|
926
|
+
* @static
|
|
927
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
928
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
929
|
+
*/
|
|
930
|
+
Tx.verify = function verify(message) {
|
|
931
|
+
if (typeof message !== 'object' || message === null) return 'object expected';
|
|
932
|
+
if (message.id != null && message.hasOwnProperty('id'))
|
|
933
|
+
if (!$util.isString(message.id)) return 'id: string expected';
|
|
934
|
+
if (message.chain != null && message.hasOwnProperty('chain'))
|
|
935
|
+
if (!$util.isString(message.chain)) return 'chain: string expected';
|
|
936
|
+
if (message.fromAddress != null && message.hasOwnProperty('fromAddress'))
|
|
937
|
+
if (!$util.isString(message.fromAddress)) return 'fromAddress: string expected';
|
|
938
|
+
if (message.toAddress != null && message.hasOwnProperty('toAddress'))
|
|
939
|
+
if (!$util.isString(message.toAddress)) return 'toAddress: string expected';
|
|
940
|
+
if (message.coins != null && message.hasOwnProperty('coins')) {
|
|
941
|
+
if (!Array.isArray(message.coins)) return 'coins: array expected';
|
|
942
|
+
for (var i = 0; i < message.coins.length; ++i) {
|
|
943
|
+
var error = $root.common.Coin.verify(message.coins[i]);
|
|
944
|
+
if (error) return 'coins.' + error;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
if (message.gas != null && message.hasOwnProperty('gas')) {
|
|
948
|
+
if (!Array.isArray(message.gas)) return 'gas: array expected';
|
|
949
|
+
for (var i = 0; i < message.gas.length; ++i) {
|
|
950
|
+
var error = $root.common.Coin.verify(message.gas[i]);
|
|
951
|
+
if (error) return 'gas.' + error;
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
if (message.memo != null && message.hasOwnProperty('memo'))
|
|
955
|
+
if (!$util.isString(message.memo)) return 'memo: string expected';
|
|
956
|
+
return null;
|
|
957
|
+
};
|
|
958
|
+
|
|
959
|
+
/**
|
|
960
|
+
* Creates a Tx message from a plain object. Also converts values to their respective internal types.
|
|
961
|
+
* @function fromObject
|
|
962
|
+
* @memberof common.Tx
|
|
963
|
+
* @static
|
|
964
|
+
* @param {Object.<string,*>} object Plain object
|
|
965
|
+
* @returns {common.Tx} Tx
|
|
966
|
+
*/
|
|
967
|
+
Tx.fromObject = function fromObject(object) {
|
|
968
|
+
if (object instanceof $root.common.Tx) return object;
|
|
969
|
+
var message = new $root.common.Tx();
|
|
970
|
+
if (object.id != null) message.id = String(object.id);
|
|
971
|
+
if (object.chain != null) message.chain = String(object.chain);
|
|
972
|
+
if (object.fromAddress != null) message.fromAddress = String(object.fromAddress);
|
|
973
|
+
if (object.toAddress != null) message.toAddress = String(object.toAddress);
|
|
974
|
+
if (object.coins) {
|
|
975
|
+
if (!Array.isArray(object.coins)) throw TypeError('.common.Tx.coins: array expected');
|
|
976
|
+
message.coins = [];
|
|
977
|
+
for (var i = 0; i < object.coins.length; ++i) {
|
|
978
|
+
if (typeof object.coins[i] !== 'object') throw TypeError('.common.Tx.coins: object expected');
|
|
979
|
+
message.coins[i] = $root.common.Coin.fromObject(object.coins[i]);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
if (object.gas) {
|
|
983
|
+
if (!Array.isArray(object.gas)) throw TypeError('.common.Tx.gas: array expected');
|
|
984
|
+
message.gas = [];
|
|
985
|
+
for (var i = 0; i < object.gas.length; ++i) {
|
|
986
|
+
if (typeof object.gas[i] !== 'object') throw TypeError('.common.Tx.gas: object expected');
|
|
987
|
+
message.gas[i] = $root.common.Coin.fromObject(object.gas[i]);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
if (object.memo != null) message.memo = String(object.memo);
|
|
991
|
+
return message;
|
|
992
|
+
};
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* Creates a plain object from a Tx message. Also converts values to other types if specified.
|
|
996
|
+
* @function toObject
|
|
997
|
+
* @memberof common.Tx
|
|
998
|
+
* @static
|
|
999
|
+
* @param {common.Tx} message Tx
|
|
1000
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1001
|
+
* @returns {Object.<string,*>} Plain object
|
|
1002
|
+
*/
|
|
1003
|
+
Tx.toObject = function toObject(message, options) {
|
|
1004
|
+
if (!options) options = {};
|
|
1005
|
+
var object = {};
|
|
1006
|
+
if (options.arrays || options.defaults) {
|
|
1007
|
+
object.coins = [];
|
|
1008
|
+
object.gas = [];
|
|
1009
|
+
}
|
|
1010
|
+
if (options.defaults) {
|
|
1011
|
+
object.id = '';
|
|
1012
|
+
object.chain = '';
|
|
1013
|
+
object.fromAddress = '';
|
|
1014
|
+
object.toAddress = '';
|
|
1015
|
+
object.memo = '';
|
|
1016
|
+
}
|
|
1017
|
+
if (message.id != null && message.hasOwnProperty('id')) object.id = message.id;
|
|
1018
|
+
if (message.chain != null && message.hasOwnProperty('chain')) object.chain = message.chain;
|
|
1019
|
+
if (message.fromAddress != null && message.hasOwnProperty('fromAddress'))
|
|
1020
|
+
object.fromAddress = message.fromAddress;
|
|
1021
|
+
if (message.toAddress != null && message.hasOwnProperty('toAddress')) object.toAddress = message.toAddress;
|
|
1022
|
+
if (message.coins && message.coins.length) {
|
|
1023
|
+
object.coins = [];
|
|
1024
|
+
for (var j = 0; j < message.coins.length; ++j)
|
|
1025
|
+
object.coins[j] = $root.common.Coin.toObject(message.coins[j], options);
|
|
1026
|
+
}
|
|
1027
|
+
if (message.gas && message.gas.length) {
|
|
1028
|
+
object.gas = [];
|
|
1029
|
+
for (var j = 0; j < message.gas.length; ++j)
|
|
1030
|
+
object.gas[j] = $root.common.Coin.toObject(message.gas[j], options);
|
|
1031
|
+
}
|
|
1032
|
+
if (message.memo != null && message.hasOwnProperty('memo')) object.memo = message.memo;
|
|
1033
|
+
return object;
|
|
1034
|
+
};
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* Converts this Tx to JSON.
|
|
1038
|
+
* @function toJSON
|
|
1039
|
+
* @memberof common.Tx
|
|
1040
|
+
* @instance
|
|
1041
|
+
* @returns {Object.<string,*>} JSON object
|
|
1042
|
+
*/
|
|
1043
|
+
Tx.prototype.toJSON = function toJSON() {
|
|
1044
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1045
|
+
};
|
|
1046
|
+
|
|
1047
|
+
return Tx;
|
|
1048
|
+
})();
|
|
1049
|
+
|
|
1050
|
+
common.Fee = (function () {
|
|
1051
|
+
/**
|
|
1052
|
+
* Properties of a Fee.
|
|
1053
|
+
* @memberof common
|
|
1054
|
+
* @interface IFee
|
|
1055
|
+
* @property {Array.<common.ICoin>|null} [coins] Fee coins
|
|
1056
|
+
* @property {string|null} [poolDeduct] Fee poolDeduct
|
|
1057
|
+
*/
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* Constructs a new Fee.
|
|
1061
|
+
* @memberof common
|
|
1062
|
+
* @classdesc Represents a Fee.
|
|
1063
|
+
* @implements IFee
|
|
1064
|
+
* @constructor
|
|
1065
|
+
* @param {common.IFee=} [properties] Properties to set
|
|
1066
|
+
*/
|
|
1067
|
+
function Fee(properties) {
|
|
1068
|
+
this.coins = [];
|
|
1069
|
+
if (properties)
|
|
1070
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1071
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* Fee coins.
|
|
1076
|
+
* @member {Array.<common.ICoin>} coins
|
|
1077
|
+
* @memberof common.Fee
|
|
1078
|
+
* @instance
|
|
1079
|
+
*/
|
|
1080
|
+
Fee.prototype.coins = $util.emptyArray;
|
|
1081
|
+
|
|
1082
|
+
/**
|
|
1083
|
+
* Fee poolDeduct.
|
|
1084
|
+
* @member {string} poolDeduct
|
|
1085
|
+
* @memberof common.Fee
|
|
1086
|
+
* @instance
|
|
1087
|
+
*/
|
|
1088
|
+
Fee.prototype.poolDeduct = '';
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* Creates a new Fee instance using the specified properties.
|
|
1092
|
+
* @function create
|
|
1093
|
+
* @memberof common.Fee
|
|
1094
|
+
* @static
|
|
1095
|
+
* @param {common.IFee=} [properties] Properties to set
|
|
1096
|
+
* @returns {common.Fee} Fee instance
|
|
1097
|
+
*/
|
|
1098
|
+
Fee.create = function create(properties) {
|
|
1099
|
+
return new Fee(properties);
|
|
1100
|
+
};
|
|
1101
|
+
|
|
1102
|
+
/**
|
|
1103
|
+
* Encodes the specified Fee message. Does not implicitly {@link common.Fee.verify|verify} messages.
|
|
1104
|
+
* @function encode
|
|
1105
|
+
* @memberof common.Fee
|
|
1106
|
+
* @static
|
|
1107
|
+
* @param {common.IFee} message Fee message or plain object to encode
|
|
1108
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1109
|
+
* @returns {$protobuf.Writer} Writer
|
|
1110
|
+
*/
|
|
1111
|
+
Fee.encode = function encode(message, writer) {
|
|
1112
|
+
if (!writer) writer = $Writer.create();
|
|
1113
|
+
if (message.coins != null && message.coins.length)
|
|
1114
|
+
for (var i = 0; i < message.coins.length; ++i)
|
|
1115
|
+
$root.common.Coin.encode(message.coins[i], writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim();
|
|
1116
|
+
if (message.poolDeduct != null && Object.hasOwnProperty.call(message, 'poolDeduct'))
|
|
1117
|
+
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.poolDeduct);
|
|
1118
|
+
return writer;
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
/**
|
|
1122
|
+
* Encodes the specified Fee message, length delimited. Does not implicitly {@link common.Fee.verify|verify} messages.
|
|
1123
|
+
* @function encodeDelimited
|
|
1124
|
+
* @memberof common.Fee
|
|
1125
|
+
* @static
|
|
1126
|
+
* @param {common.IFee} message Fee message or plain object to encode
|
|
1127
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1128
|
+
* @returns {$protobuf.Writer} Writer
|
|
1129
|
+
*/
|
|
1130
|
+
Fee.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1131
|
+
return this.encode(message, writer).ldelim();
|
|
1132
|
+
};
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* Decodes a Fee message from the specified reader or buffer.
|
|
1136
|
+
* @function decode
|
|
1137
|
+
* @memberof common.Fee
|
|
1138
|
+
* @static
|
|
1139
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1140
|
+
* @param {number} [length] Message length if known beforehand
|
|
1141
|
+
* @returns {common.Fee} Fee
|
|
1142
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1143
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1144
|
+
*/
|
|
1145
|
+
Fee.decode = function decode(reader, length) {
|
|
1146
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
1147
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
1148
|
+
message = new $root.common.Fee();
|
|
1149
|
+
while (reader.pos < end) {
|
|
1150
|
+
var tag = reader.uint32();
|
|
1151
|
+
switch (tag >>> 3) {
|
|
1152
|
+
case 1:
|
|
1153
|
+
if (!(message.coins && message.coins.length)) message.coins = [];
|
|
1154
|
+
message.coins.push($root.common.Coin.decode(reader, reader.uint32()));
|
|
1155
|
+
break;
|
|
1156
|
+
case 2:
|
|
1157
|
+
message.poolDeduct = reader.string();
|
|
1158
|
+
break;
|
|
1159
|
+
default:
|
|
1160
|
+
reader.skipType(tag & 7);
|
|
1161
|
+
break;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
return message;
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
/**
|
|
1168
|
+
* Decodes a Fee message from the specified reader or buffer, length delimited.
|
|
1169
|
+
* @function decodeDelimited
|
|
1170
|
+
* @memberof common.Fee
|
|
1171
|
+
* @static
|
|
1172
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1173
|
+
* @returns {common.Fee} Fee
|
|
1174
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1175
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1176
|
+
*/
|
|
1177
|
+
Fee.decodeDelimited = function decodeDelimited(reader) {
|
|
1178
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
1179
|
+
return this.decode(reader, reader.uint32());
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* Verifies a Fee message.
|
|
1184
|
+
* @function verify
|
|
1185
|
+
* @memberof common.Fee
|
|
1186
|
+
* @static
|
|
1187
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1188
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1189
|
+
*/
|
|
1190
|
+
Fee.verify = function verify(message) {
|
|
1191
|
+
if (typeof message !== 'object' || message === null) return 'object expected';
|
|
1192
|
+
if (message.coins != null && message.hasOwnProperty('coins')) {
|
|
1193
|
+
if (!Array.isArray(message.coins)) return 'coins: array expected';
|
|
1194
|
+
for (var i = 0; i < message.coins.length; ++i) {
|
|
1195
|
+
var error = $root.common.Coin.verify(message.coins[i]);
|
|
1196
|
+
if (error) return 'coins.' + error;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
if (message.poolDeduct != null && message.hasOwnProperty('poolDeduct'))
|
|
1200
|
+
if (!$util.isString(message.poolDeduct)) return 'poolDeduct: string expected';
|
|
1201
|
+
return null;
|
|
1202
|
+
};
|
|
1203
|
+
|
|
1204
|
+
/**
|
|
1205
|
+
* Creates a Fee message from a plain object. Also converts values to their respective internal types.
|
|
1206
|
+
* @function fromObject
|
|
1207
|
+
* @memberof common.Fee
|
|
1208
|
+
* @static
|
|
1209
|
+
* @param {Object.<string,*>} object Plain object
|
|
1210
|
+
* @returns {common.Fee} Fee
|
|
1211
|
+
*/
|
|
1212
|
+
Fee.fromObject = function fromObject(object) {
|
|
1213
|
+
if (object instanceof $root.common.Fee) return object;
|
|
1214
|
+
var message = new $root.common.Fee();
|
|
1215
|
+
if (object.coins) {
|
|
1216
|
+
if (!Array.isArray(object.coins)) throw TypeError('.common.Fee.coins: array expected');
|
|
1217
|
+
message.coins = [];
|
|
1218
|
+
for (var i = 0; i < object.coins.length; ++i) {
|
|
1219
|
+
if (typeof object.coins[i] !== 'object') throw TypeError('.common.Fee.coins: object expected');
|
|
1220
|
+
message.coins[i] = $root.common.Coin.fromObject(object.coins[i]);
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
if (object.poolDeduct != null) message.poolDeduct = String(object.poolDeduct);
|
|
1224
|
+
return message;
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* Creates a plain object from a Fee message. Also converts values to other types if specified.
|
|
1229
|
+
* @function toObject
|
|
1230
|
+
* @memberof common.Fee
|
|
1231
|
+
* @static
|
|
1232
|
+
* @param {common.Fee} message Fee
|
|
1233
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1234
|
+
* @returns {Object.<string,*>} Plain object
|
|
1235
|
+
*/
|
|
1236
|
+
Fee.toObject = function toObject(message, options) {
|
|
1237
|
+
if (!options) options = {};
|
|
1238
|
+
var object = {};
|
|
1239
|
+
if (options.arrays || options.defaults) object.coins = [];
|
|
1240
|
+
if (options.defaults) object.poolDeduct = '';
|
|
1241
|
+
if (message.coins && message.coins.length) {
|
|
1242
|
+
object.coins = [];
|
|
1243
|
+
for (var j = 0; j < message.coins.length; ++j)
|
|
1244
|
+
object.coins[j] = $root.common.Coin.toObject(message.coins[j], options);
|
|
1245
|
+
}
|
|
1246
|
+
if (message.poolDeduct != null && message.hasOwnProperty('poolDeduct')) object.poolDeduct = message.poolDeduct;
|
|
1247
|
+
return object;
|
|
1248
|
+
};
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Converts this Fee to JSON.
|
|
1252
|
+
* @function toJSON
|
|
1253
|
+
* @memberof common.Fee
|
|
1254
|
+
* @instance
|
|
1255
|
+
* @returns {Object.<string,*>} JSON object
|
|
1256
|
+
*/
|
|
1257
|
+
Fee.prototype.toJSON = function toJSON() {
|
|
1258
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1259
|
+
};
|
|
1260
|
+
|
|
1261
|
+
return Fee;
|
|
1262
|
+
})();
|
|
1263
|
+
|
|
1264
|
+
common.ProtoUint = (function () {
|
|
1265
|
+
/**
|
|
1266
|
+
* Properties of a ProtoUint.
|
|
1267
|
+
* @memberof common
|
|
1268
|
+
* @interface IProtoUint
|
|
1269
|
+
* @property {string|null} [value] ProtoUint value
|
|
1270
|
+
*/
|
|
1271
|
+
|
|
1272
|
+
/**
|
|
1273
|
+
* Constructs a new ProtoUint.
|
|
1274
|
+
* @memberof common
|
|
1275
|
+
* @classdesc Represents a ProtoUint.
|
|
1276
|
+
* @implements IProtoUint
|
|
1277
|
+
* @constructor
|
|
1278
|
+
* @param {common.IProtoUint=} [properties] Properties to set
|
|
1279
|
+
*/
|
|
1280
|
+
function ProtoUint(properties) {
|
|
1281
|
+
if (properties)
|
|
1282
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1283
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
/**
|
|
1287
|
+
* ProtoUint value.
|
|
1288
|
+
* @member {string} value
|
|
1289
|
+
* @memberof common.ProtoUint
|
|
1290
|
+
* @instance
|
|
1291
|
+
*/
|
|
1292
|
+
ProtoUint.prototype.value = '';
|
|
1293
|
+
|
|
1294
|
+
/**
|
|
1295
|
+
* Creates a new ProtoUint instance using the specified properties.
|
|
1296
|
+
* @function create
|
|
1297
|
+
* @memberof common.ProtoUint
|
|
1298
|
+
* @static
|
|
1299
|
+
* @param {common.IProtoUint=} [properties] Properties to set
|
|
1300
|
+
* @returns {common.ProtoUint} ProtoUint instance
|
|
1301
|
+
*/
|
|
1302
|
+
ProtoUint.create = function create(properties) {
|
|
1303
|
+
return new ProtoUint(properties);
|
|
1304
|
+
};
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* Encodes the specified ProtoUint message. Does not implicitly {@link common.ProtoUint.verify|verify} messages.
|
|
1308
|
+
* @function encode
|
|
1309
|
+
* @memberof common.ProtoUint
|
|
1310
|
+
* @static
|
|
1311
|
+
* @param {common.IProtoUint} message ProtoUint message or plain object to encode
|
|
1312
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1313
|
+
* @returns {$protobuf.Writer} Writer
|
|
1314
|
+
*/
|
|
1315
|
+
ProtoUint.encode = function encode(message, writer) {
|
|
1316
|
+
if (!writer) writer = $Writer.create();
|
|
1317
|
+
if (message.value != null && Object.hasOwnProperty.call(message, 'value'))
|
|
1318
|
+
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.value);
|
|
1319
|
+
return writer;
|
|
1320
|
+
};
|
|
1321
|
+
|
|
1322
|
+
/**
|
|
1323
|
+
* Encodes the specified ProtoUint message, length delimited. Does not implicitly {@link common.ProtoUint.verify|verify} messages.
|
|
1324
|
+
* @function encodeDelimited
|
|
1325
|
+
* @memberof common.ProtoUint
|
|
1326
|
+
* @static
|
|
1327
|
+
* @param {common.IProtoUint} message ProtoUint message or plain object to encode
|
|
1328
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1329
|
+
* @returns {$protobuf.Writer} Writer
|
|
1330
|
+
*/
|
|
1331
|
+
ProtoUint.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1332
|
+
return this.encode(message, writer).ldelim();
|
|
1333
|
+
};
|
|
1334
|
+
|
|
1335
|
+
/**
|
|
1336
|
+
* Decodes a ProtoUint message from the specified reader or buffer.
|
|
1337
|
+
* @function decode
|
|
1338
|
+
* @memberof common.ProtoUint
|
|
1339
|
+
* @static
|
|
1340
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1341
|
+
* @param {number} [length] Message length if known beforehand
|
|
1342
|
+
* @returns {common.ProtoUint} ProtoUint
|
|
1343
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1344
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1345
|
+
*/
|
|
1346
|
+
ProtoUint.decode = function decode(reader, length) {
|
|
1347
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
1348
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
1349
|
+
message = new $root.common.ProtoUint();
|
|
1350
|
+
while (reader.pos < end) {
|
|
1351
|
+
var tag = reader.uint32();
|
|
1352
|
+
switch (tag >>> 3) {
|
|
1353
|
+
case 1:
|
|
1354
|
+
message.value = reader.string();
|
|
1355
|
+
break;
|
|
1356
|
+
default:
|
|
1357
|
+
reader.skipType(tag & 7);
|
|
1358
|
+
break;
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
return message;
|
|
1362
|
+
};
|
|
1363
|
+
|
|
1364
|
+
/**
|
|
1365
|
+
* Decodes a ProtoUint message from the specified reader or buffer, length delimited.
|
|
1366
|
+
* @function decodeDelimited
|
|
1367
|
+
* @memberof common.ProtoUint
|
|
1368
|
+
* @static
|
|
1369
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1370
|
+
* @returns {common.ProtoUint} ProtoUint
|
|
1371
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1372
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1373
|
+
*/
|
|
1374
|
+
ProtoUint.decodeDelimited = function decodeDelimited(reader) {
|
|
1375
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
1376
|
+
return this.decode(reader, reader.uint32());
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Verifies a ProtoUint message.
|
|
1381
|
+
* @function verify
|
|
1382
|
+
* @memberof common.ProtoUint
|
|
1383
|
+
* @static
|
|
1384
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1385
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1386
|
+
*/
|
|
1387
|
+
ProtoUint.verify = function verify(message) {
|
|
1388
|
+
if (typeof message !== 'object' || message === null) return 'object expected';
|
|
1389
|
+
if (message.value != null && message.hasOwnProperty('value'))
|
|
1390
|
+
if (!$util.isString(message.value)) return 'value: string expected';
|
|
1391
|
+
return null;
|
|
1392
|
+
};
|
|
1393
|
+
|
|
1394
|
+
/**
|
|
1395
|
+
* Creates a ProtoUint message from a plain object. Also converts values to their respective internal types.
|
|
1396
|
+
* @function fromObject
|
|
1397
|
+
* @memberof common.ProtoUint
|
|
1398
|
+
* @static
|
|
1399
|
+
* @param {Object.<string,*>} object Plain object
|
|
1400
|
+
* @returns {common.ProtoUint} ProtoUint
|
|
1401
|
+
*/
|
|
1402
|
+
ProtoUint.fromObject = function fromObject(object) {
|
|
1403
|
+
if (object instanceof $root.common.ProtoUint) return object;
|
|
1404
|
+
var message = new $root.common.ProtoUint();
|
|
1405
|
+
if (object.value != null) message.value = String(object.value);
|
|
1406
|
+
return message;
|
|
1407
|
+
};
|
|
1408
|
+
|
|
1409
|
+
/**
|
|
1410
|
+
* Creates a plain object from a ProtoUint message. Also converts values to other types if specified.
|
|
1411
|
+
* @function toObject
|
|
1412
|
+
* @memberof common.ProtoUint
|
|
1413
|
+
* @static
|
|
1414
|
+
* @param {common.ProtoUint} message ProtoUint
|
|
1415
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1416
|
+
* @returns {Object.<string,*>} Plain object
|
|
1417
|
+
*/
|
|
1418
|
+
ProtoUint.toObject = function toObject(message, options) {
|
|
1419
|
+
if (!options) options = {};
|
|
1420
|
+
var object = {};
|
|
1421
|
+
if (options.defaults) object.value = '';
|
|
1422
|
+
if (message.value != null && message.hasOwnProperty('value')) object.value = message.value;
|
|
1423
|
+
return object;
|
|
1424
|
+
};
|
|
1425
|
+
|
|
1426
|
+
/**
|
|
1427
|
+
* Converts this ProtoUint to JSON.
|
|
1428
|
+
* @function toJSON
|
|
1429
|
+
* @memberof common.ProtoUint
|
|
1430
|
+
* @instance
|
|
1431
|
+
* @returns {Object.<string,*>} JSON object
|
|
1432
|
+
*/
|
|
1433
|
+
ProtoUint.prototype.toJSON = function toJSON() {
|
|
1434
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1435
|
+
};
|
|
1436
|
+
|
|
1437
|
+
return ProtoUint;
|
|
1438
|
+
})();
|
|
1439
|
+
|
|
1440
|
+
return common;
|
|
1441
|
+
})();
|
|
1442
|
+
|
|
1443
|
+
$root.types = (function () {
|
|
1444
|
+
/**
|
|
1445
|
+
* Namespace types.
|
|
1446
|
+
* @exports types
|
|
1447
|
+
* @namespace
|
|
1448
|
+
*/
|
|
1449
|
+
var types = {};
|
|
1450
|
+
|
|
1451
|
+
types.MsgDeposit = (function () {
|
|
1452
|
+
/**
|
|
1453
|
+
* Properties of a MsgDeposit.
|
|
1454
|
+
* @memberof types
|
|
1455
|
+
* @interface IMsgDeposit
|
|
1456
|
+
* @property {Array.<common.ICoin>|null} [coins] MsgDeposit coins
|
|
1457
|
+
* @property {string|null} [memo] MsgDeposit memo
|
|
1458
|
+
* @property {Uint8Array|null} [signer] MsgDeposit signer
|
|
1459
|
+
*/
|
|
1460
|
+
|
|
1461
|
+
/**
|
|
1462
|
+
* Constructs a new MsgDeposit.
|
|
1463
|
+
* @memberof types
|
|
1464
|
+
* @classdesc Represents a MsgDeposit.
|
|
1465
|
+
* @implements IMsgDeposit
|
|
1466
|
+
* @constructor
|
|
1467
|
+
* @param {types.IMsgDeposit=} [properties] Properties to set
|
|
1468
|
+
*/
|
|
1469
|
+
function MsgDeposit(properties) {
|
|
1470
|
+
this.coins = [];
|
|
1471
|
+
if (properties)
|
|
1472
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1473
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
/**
|
|
1477
|
+
* MsgDeposit coins.
|
|
1478
|
+
* @member {Array.<common.ICoin>} coins
|
|
1479
|
+
* @memberof types.MsgDeposit
|
|
1480
|
+
* @instance
|
|
1481
|
+
*/
|
|
1482
|
+
MsgDeposit.prototype.coins = $util.emptyArray;
|
|
1483
|
+
|
|
1484
|
+
/**
|
|
1485
|
+
* MsgDeposit memo.
|
|
1486
|
+
* @member {string} memo
|
|
1487
|
+
* @memberof types.MsgDeposit
|
|
1488
|
+
* @instance
|
|
1489
|
+
*/
|
|
1490
|
+
MsgDeposit.prototype.memo = '';
|
|
1491
|
+
|
|
1492
|
+
/**
|
|
1493
|
+
* MsgDeposit signer.
|
|
1494
|
+
* @member {Uint8Array} signer
|
|
1495
|
+
* @memberof types.MsgDeposit
|
|
1496
|
+
* @instance
|
|
1497
|
+
*/
|
|
1498
|
+
MsgDeposit.prototype.signer = $util.newBuffer([]);
|
|
1499
|
+
|
|
1500
|
+
/**
|
|
1501
|
+
* Creates a new MsgDeposit instance using the specified properties.
|
|
1502
|
+
* @function create
|
|
1503
|
+
* @memberof types.MsgDeposit
|
|
1504
|
+
* @static
|
|
1505
|
+
* @param {types.IMsgDeposit=} [properties] Properties to set
|
|
1506
|
+
* @returns {types.MsgDeposit} MsgDeposit instance
|
|
1507
|
+
*/
|
|
1508
|
+
MsgDeposit.create = function create(properties) {
|
|
1509
|
+
return new MsgDeposit(properties);
|
|
1510
|
+
};
|
|
1511
|
+
|
|
1512
|
+
/**
|
|
1513
|
+
* Encodes the specified MsgDeposit message. Does not implicitly {@link types.MsgDeposit.verify|verify} messages.
|
|
1514
|
+
* @function encode
|
|
1515
|
+
* @memberof types.MsgDeposit
|
|
1516
|
+
* @static
|
|
1517
|
+
* @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode
|
|
1518
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1519
|
+
* @returns {$protobuf.Writer} Writer
|
|
1520
|
+
*/
|
|
1521
|
+
MsgDeposit.encode = function encode(message, writer) {
|
|
1522
|
+
if (!writer) writer = $Writer.create();
|
|
1523
|
+
if (message.coins != null && message.coins.length)
|
|
1524
|
+
for (var i = 0; i < message.coins.length; ++i)
|
|
1525
|
+
$root.common.Coin.encode(message.coins[i], writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim();
|
|
1526
|
+
if (message.memo != null && Object.hasOwnProperty.call(message, 'memo'))
|
|
1527
|
+
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.memo);
|
|
1528
|
+
if (message.signer != null && Object.hasOwnProperty.call(message, 'signer'))
|
|
1529
|
+
writer.uint32(/* id 3, wireType 2 =*/ 26).bytes(message.signer);
|
|
1530
|
+
return writer;
|
|
1531
|
+
};
|
|
1532
|
+
|
|
1533
|
+
/**
|
|
1534
|
+
* Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link types.MsgDeposit.verify|verify} messages.
|
|
1535
|
+
* @function encodeDelimited
|
|
1536
|
+
* @memberof types.MsgDeposit
|
|
1537
|
+
* @static
|
|
1538
|
+
* @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode
|
|
1539
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1540
|
+
* @returns {$protobuf.Writer} Writer
|
|
1541
|
+
*/
|
|
1542
|
+
MsgDeposit.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1543
|
+
return this.encode(message, writer).ldelim();
|
|
1544
|
+
};
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* Decodes a MsgDeposit message from the specified reader or buffer.
|
|
1548
|
+
* @function decode
|
|
1549
|
+
* @memberof types.MsgDeposit
|
|
1550
|
+
* @static
|
|
1551
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1552
|
+
* @param {number} [length] Message length if known beforehand
|
|
1553
|
+
* @returns {types.MsgDeposit} MsgDeposit
|
|
1554
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1555
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1556
|
+
*/
|
|
1557
|
+
MsgDeposit.decode = function decode(reader, length) {
|
|
1558
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
1559
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
1560
|
+
message = new $root.types.MsgDeposit();
|
|
1561
|
+
while (reader.pos < end) {
|
|
1562
|
+
var tag = reader.uint32();
|
|
1563
|
+
switch (tag >>> 3) {
|
|
1564
|
+
case 1:
|
|
1565
|
+
if (!(message.coins && message.coins.length)) message.coins = [];
|
|
1566
|
+
message.coins.push($root.common.Coin.decode(reader, reader.uint32()));
|
|
1567
|
+
break;
|
|
1568
|
+
case 2:
|
|
1569
|
+
message.memo = reader.string();
|
|
1570
|
+
break;
|
|
1571
|
+
case 3:
|
|
1572
|
+
message.signer = reader.bytes();
|
|
1573
|
+
break;
|
|
1574
|
+
default:
|
|
1575
|
+
reader.skipType(tag & 7);
|
|
1576
|
+
break;
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
return message;
|
|
1580
|
+
};
|
|
1581
|
+
|
|
1582
|
+
/**
|
|
1583
|
+
* Decodes a MsgDeposit message from the specified reader or buffer, length delimited.
|
|
1584
|
+
* @function decodeDelimited
|
|
1585
|
+
* @memberof types.MsgDeposit
|
|
1586
|
+
* @static
|
|
1587
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1588
|
+
* @returns {types.MsgDeposit} MsgDeposit
|
|
1589
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1590
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1591
|
+
*/
|
|
1592
|
+
MsgDeposit.decodeDelimited = function decodeDelimited(reader) {
|
|
1593
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
1594
|
+
return this.decode(reader, reader.uint32());
|
|
1595
|
+
};
|
|
1596
|
+
|
|
1597
|
+
/**
|
|
1598
|
+
* Verifies a MsgDeposit message.
|
|
1599
|
+
* @function verify
|
|
1600
|
+
* @memberof types.MsgDeposit
|
|
1601
|
+
* @static
|
|
1602
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1603
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1604
|
+
*/
|
|
1605
|
+
MsgDeposit.verify = function verify(message) {
|
|
1606
|
+
if (typeof message !== 'object' || message === null) return 'object expected';
|
|
1607
|
+
if (message.coins != null && message.hasOwnProperty('coins')) {
|
|
1608
|
+
if (!Array.isArray(message.coins)) return 'coins: array expected';
|
|
1609
|
+
for (var i = 0; i < message.coins.length; ++i) {
|
|
1610
|
+
var error = $root.common.Coin.verify(message.coins[i]);
|
|
1611
|
+
if (error) return 'coins.' + error;
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
if (message.memo != null && message.hasOwnProperty('memo'))
|
|
1615
|
+
if (!$util.isString(message.memo)) return 'memo: string expected';
|
|
1616
|
+
if (message.signer != null && message.hasOwnProperty('signer'))
|
|
1617
|
+
if (!((message.signer && typeof message.signer.length === 'number') || $util.isString(message.signer)))
|
|
1618
|
+
return 'signer: buffer expected';
|
|
1619
|
+
return null;
|
|
1620
|
+
};
|
|
1621
|
+
|
|
1622
|
+
/**
|
|
1623
|
+
* Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types.
|
|
1624
|
+
* @function fromObject
|
|
1625
|
+
* @memberof types.MsgDeposit
|
|
1626
|
+
* @static
|
|
1627
|
+
* @param {Object.<string,*>} object Plain object
|
|
1628
|
+
* @returns {types.MsgDeposit} MsgDeposit
|
|
1629
|
+
*/
|
|
1630
|
+
MsgDeposit.fromObject = function fromObject(object) {
|
|
1631
|
+
if (object instanceof $root.types.MsgDeposit) return object;
|
|
1632
|
+
var message = new $root.types.MsgDeposit();
|
|
1633
|
+
if (object.coins) {
|
|
1634
|
+
if (!Array.isArray(object.coins)) throw TypeError('.types.MsgDeposit.coins: array expected');
|
|
1635
|
+
message.coins = [];
|
|
1636
|
+
for (var i = 0; i < object.coins.length; ++i) {
|
|
1637
|
+
if (typeof object.coins[i] !== 'object') throw TypeError('.types.MsgDeposit.coins: object expected');
|
|
1638
|
+
message.coins[i] = $root.common.Coin.fromObject(object.coins[i]);
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
if (object.memo != null) message.memo = String(object.memo);
|
|
1642
|
+
if (object.signer != null)
|
|
1643
|
+
if (typeof object.signer === 'string')
|
|
1644
|
+
$util.base64.decode(object.signer, (message.signer = $util.newBuffer($util.base64.length(object.signer))), 0);
|
|
1645
|
+
else if (object.signer.length) message.signer = object.signer;
|
|
1646
|
+
return message;
|
|
1647
|
+
};
|
|
1648
|
+
|
|
1649
|
+
/**
|
|
1650
|
+
* Creates a plain object from a MsgDeposit message. Also converts values to other types if specified.
|
|
1651
|
+
* @function toObject
|
|
1652
|
+
* @memberof types.MsgDeposit
|
|
1653
|
+
* @static
|
|
1654
|
+
* @param {types.MsgDeposit} message MsgDeposit
|
|
1655
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1656
|
+
* @returns {Object.<string,*>} Plain object
|
|
1657
|
+
*/
|
|
1658
|
+
MsgDeposit.toObject = function toObject(message, options) {
|
|
1659
|
+
if (!options) options = {};
|
|
1660
|
+
var object = {};
|
|
1661
|
+
if (options.arrays || options.defaults) object.coins = [];
|
|
1662
|
+
if (options.defaults) {
|
|
1663
|
+
object.memo = '';
|
|
1664
|
+
if (options.bytes === String) object.signer = '';
|
|
1665
|
+
else {
|
|
1666
|
+
object.signer = [];
|
|
1667
|
+
if (options.bytes !== Array) object.signer = $util.newBuffer(object.signer);
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
if (message.coins && message.coins.length) {
|
|
1671
|
+
object.coins = [];
|
|
1672
|
+
for (var j = 0; j < message.coins.length; ++j)
|
|
1673
|
+
object.coins[j] = $root.common.Coin.toObject(message.coins[j], options);
|
|
1674
|
+
}
|
|
1675
|
+
if (message.memo != null && message.hasOwnProperty('memo')) object.memo = message.memo;
|
|
1676
|
+
if (message.signer != null && message.hasOwnProperty('signer'))
|
|
1677
|
+
object.signer =
|
|
1678
|
+
options.bytes === String
|
|
1679
|
+
? $util.base64.encode(message.signer, 0, message.signer.length)
|
|
1680
|
+
: options.bytes === Array
|
|
1681
|
+
? Array.prototype.slice.call(message.signer)
|
|
1682
|
+
: message.signer;
|
|
1683
|
+
return object;
|
|
1684
|
+
};
|
|
1685
|
+
|
|
1686
|
+
/**
|
|
1687
|
+
* Converts this MsgDeposit to JSON.
|
|
1688
|
+
* @function toJSON
|
|
1689
|
+
* @memberof types.MsgDeposit
|
|
1690
|
+
* @instance
|
|
1691
|
+
* @returns {Object.<string,*>} JSON object
|
|
1692
|
+
*/
|
|
1693
|
+
MsgDeposit.prototype.toJSON = function toJSON() {
|
|
1694
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1695
|
+
};
|
|
1696
|
+
|
|
1697
|
+
return MsgDeposit;
|
|
1698
|
+
})();
|
|
1699
|
+
|
|
1700
|
+
types.MsgSend = (function () {
|
|
1701
|
+
/**
|
|
1702
|
+
* Properties of a MsgSend.
|
|
1703
|
+
* @memberof types
|
|
1704
|
+
* @interface IMsgSend
|
|
1705
|
+
* @property {Uint8Array|null} [fromAddress] MsgSend fromAddress
|
|
1706
|
+
* @property {Uint8Array|null} [toAddress] MsgSend toAddress
|
|
1707
|
+
* @property {Array.<cosmos.base.v1beta1.ICoin>|null} [amount] MsgSend amount
|
|
1708
|
+
*/
|
|
1709
|
+
|
|
1710
|
+
/**
|
|
1711
|
+
* Constructs a new MsgSend.
|
|
1712
|
+
* @memberof types
|
|
1713
|
+
* @classdesc Represents a MsgSend.
|
|
1714
|
+
* @implements IMsgSend
|
|
1715
|
+
* @constructor
|
|
1716
|
+
* @param {types.IMsgSend=} [properties] Properties to set
|
|
1717
|
+
*/
|
|
1718
|
+
function MsgSend(properties) {
|
|
1719
|
+
this.amount = [];
|
|
1720
|
+
if (properties)
|
|
1721
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
1722
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
/**
|
|
1726
|
+
* MsgSend fromAddress.
|
|
1727
|
+
* @member {Uint8Array} fromAddress
|
|
1728
|
+
* @memberof types.MsgSend
|
|
1729
|
+
* @instance
|
|
1730
|
+
*/
|
|
1731
|
+
MsgSend.prototype.fromAddress = $util.newBuffer([]);
|
|
1732
|
+
|
|
1733
|
+
/**
|
|
1734
|
+
* MsgSend toAddress.
|
|
1735
|
+
* @member {Uint8Array} toAddress
|
|
1736
|
+
* @memberof types.MsgSend
|
|
1737
|
+
* @instance
|
|
1738
|
+
*/
|
|
1739
|
+
MsgSend.prototype.toAddress = $util.newBuffer([]);
|
|
1740
|
+
|
|
1741
|
+
/**
|
|
1742
|
+
* MsgSend amount.
|
|
1743
|
+
* @member {Array.<cosmos.base.v1beta1.ICoin>} amount
|
|
1744
|
+
* @memberof types.MsgSend
|
|
1745
|
+
* @instance
|
|
1746
|
+
*/
|
|
1747
|
+
MsgSend.prototype.amount = $util.emptyArray;
|
|
1748
|
+
|
|
1749
|
+
/**
|
|
1750
|
+
* Creates a new MsgSend instance using the specified properties.
|
|
1751
|
+
* @function create
|
|
1752
|
+
* @memberof types.MsgSend
|
|
1753
|
+
* @static
|
|
1754
|
+
* @param {types.IMsgSend=} [properties] Properties to set
|
|
1755
|
+
* @returns {types.MsgSend} MsgSend instance
|
|
1756
|
+
*/
|
|
1757
|
+
MsgSend.create = function create(properties) {
|
|
1758
|
+
return new MsgSend(properties);
|
|
1759
|
+
};
|
|
1760
|
+
|
|
1761
|
+
/**
|
|
1762
|
+
* Encodes the specified MsgSend message. Does not implicitly {@link types.MsgSend.verify|verify} messages.
|
|
1763
|
+
* @function encode
|
|
1764
|
+
* @memberof types.MsgSend
|
|
1765
|
+
* @static
|
|
1766
|
+
* @param {types.IMsgSend} message MsgSend message or plain object to encode
|
|
1767
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1768
|
+
* @returns {$protobuf.Writer} Writer
|
|
1769
|
+
*/
|
|
1770
|
+
MsgSend.encode = function encode(message, writer) {
|
|
1771
|
+
if (!writer) writer = $Writer.create();
|
|
1772
|
+
if (message.fromAddress != null && Object.hasOwnProperty.call(message, 'fromAddress'))
|
|
1773
|
+
writer.uint32(/* id 1, wireType 2 =*/ 10).bytes(message.fromAddress);
|
|
1774
|
+
if (message.toAddress != null && Object.hasOwnProperty.call(message, 'toAddress'))
|
|
1775
|
+
writer.uint32(/* id 2, wireType 2 =*/ 18).bytes(message.toAddress);
|
|
1776
|
+
if (message.amount != null && message.amount.length)
|
|
1777
|
+
for (var i = 0; i < message.amount.length; ++i)
|
|
1778
|
+
$root.cosmos.base.v1beta1.Coin.encode(
|
|
1779
|
+
message.amount[i],
|
|
1780
|
+
writer.uint32(/* id 3, wireType 2 =*/ 26).fork()
|
|
1781
|
+
).ldelim();
|
|
1782
|
+
return writer;
|
|
1783
|
+
};
|
|
1784
|
+
|
|
1785
|
+
/**
|
|
1786
|
+
* Encodes the specified MsgSend message, length delimited. Does not implicitly {@link types.MsgSend.verify|verify} messages.
|
|
1787
|
+
* @function encodeDelimited
|
|
1788
|
+
* @memberof types.MsgSend
|
|
1789
|
+
* @static
|
|
1790
|
+
* @param {types.IMsgSend} message MsgSend message or plain object to encode
|
|
1791
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
1792
|
+
* @returns {$protobuf.Writer} Writer
|
|
1793
|
+
*/
|
|
1794
|
+
MsgSend.encodeDelimited = function encodeDelimited(message, writer) {
|
|
1795
|
+
return this.encode(message, writer).ldelim();
|
|
1796
|
+
};
|
|
1797
|
+
|
|
1798
|
+
/**
|
|
1799
|
+
* Decodes a MsgSend message from the specified reader or buffer.
|
|
1800
|
+
* @function decode
|
|
1801
|
+
* @memberof types.MsgSend
|
|
1802
|
+
* @static
|
|
1803
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1804
|
+
* @param {number} [length] Message length if known beforehand
|
|
1805
|
+
* @returns {types.MsgSend} MsgSend
|
|
1806
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1807
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1808
|
+
*/
|
|
1809
|
+
MsgSend.decode = function decode(reader, length) {
|
|
1810
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
1811
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
1812
|
+
message = new $root.types.MsgSend();
|
|
1813
|
+
while (reader.pos < end) {
|
|
1814
|
+
var tag = reader.uint32();
|
|
1815
|
+
switch (tag >>> 3) {
|
|
1816
|
+
case 1:
|
|
1817
|
+
message.fromAddress = reader.bytes();
|
|
1818
|
+
break;
|
|
1819
|
+
case 2:
|
|
1820
|
+
message.toAddress = reader.bytes();
|
|
1821
|
+
break;
|
|
1822
|
+
case 3:
|
|
1823
|
+
if (!(message.amount && message.amount.length)) message.amount = [];
|
|
1824
|
+
message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()));
|
|
1825
|
+
break;
|
|
1826
|
+
default:
|
|
1827
|
+
reader.skipType(tag & 7);
|
|
1828
|
+
break;
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
return message;
|
|
1832
|
+
};
|
|
1833
|
+
|
|
1834
|
+
/**
|
|
1835
|
+
* Decodes a MsgSend message from the specified reader or buffer, length delimited.
|
|
1836
|
+
* @function decodeDelimited
|
|
1837
|
+
* @memberof types.MsgSend
|
|
1838
|
+
* @static
|
|
1839
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1840
|
+
* @returns {types.MsgSend} MsgSend
|
|
1841
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1842
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1843
|
+
*/
|
|
1844
|
+
MsgSend.decodeDelimited = function decodeDelimited(reader) {
|
|
1845
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
1846
|
+
return this.decode(reader, reader.uint32());
|
|
1847
|
+
};
|
|
1848
|
+
|
|
1849
|
+
/**
|
|
1850
|
+
* Verifies a MsgSend message.
|
|
1851
|
+
* @function verify
|
|
1852
|
+
* @memberof types.MsgSend
|
|
1853
|
+
* @static
|
|
1854
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1855
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1856
|
+
*/
|
|
1857
|
+
MsgSend.verify = function verify(message) {
|
|
1858
|
+
if (typeof message !== 'object' || message === null) return 'object expected';
|
|
1859
|
+
if (message.fromAddress != null && message.hasOwnProperty('fromAddress'))
|
|
1860
|
+
if (
|
|
1861
|
+
!(
|
|
1862
|
+
(message.fromAddress && typeof message.fromAddress.length === 'number') ||
|
|
1863
|
+
$util.isString(message.fromAddress)
|
|
1864
|
+
)
|
|
1865
|
+
)
|
|
1866
|
+
return 'fromAddress: buffer expected';
|
|
1867
|
+
if (message.toAddress != null && message.hasOwnProperty('toAddress'))
|
|
1868
|
+
if (!((message.toAddress && typeof message.toAddress.length === 'number') || $util.isString(message.toAddress)))
|
|
1869
|
+
return 'toAddress: buffer expected';
|
|
1870
|
+
if (message.amount != null && message.hasOwnProperty('amount')) {
|
|
1871
|
+
if (!Array.isArray(message.amount)) return 'amount: array expected';
|
|
1872
|
+
for (var i = 0; i < message.amount.length; ++i) {
|
|
1873
|
+
var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]);
|
|
1874
|
+
if (error) return 'amount.' + error;
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
return null;
|
|
1878
|
+
};
|
|
1879
|
+
|
|
1880
|
+
/**
|
|
1881
|
+
* Creates a MsgSend message from a plain object. Also converts values to their respective internal types.
|
|
1882
|
+
* @function fromObject
|
|
1883
|
+
* @memberof types.MsgSend
|
|
1884
|
+
* @static
|
|
1885
|
+
* @param {Object.<string,*>} object Plain object
|
|
1886
|
+
* @returns {types.MsgSend} MsgSend
|
|
1887
|
+
*/
|
|
1888
|
+
MsgSend.fromObject = function fromObject(object) {
|
|
1889
|
+
if (object instanceof $root.types.MsgSend) return object;
|
|
1890
|
+
var message = new $root.types.MsgSend();
|
|
1891
|
+
if (object.fromAddress != null)
|
|
1892
|
+
if (typeof object.fromAddress === 'string')
|
|
1893
|
+
$util.base64.decode(
|
|
1894
|
+
object.fromAddress,
|
|
1895
|
+
(message.fromAddress = $util.newBuffer($util.base64.length(object.fromAddress))),
|
|
1896
|
+
0
|
|
1897
|
+
);
|
|
1898
|
+
else if (object.fromAddress.length) message.fromAddress = object.fromAddress;
|
|
1899
|
+
if (object.toAddress != null)
|
|
1900
|
+
if (typeof object.toAddress === 'string')
|
|
1901
|
+
$util.base64.decode(
|
|
1902
|
+
object.toAddress,
|
|
1903
|
+
(message.toAddress = $util.newBuffer($util.base64.length(object.toAddress))),
|
|
1904
|
+
0
|
|
1905
|
+
);
|
|
1906
|
+
else if (object.toAddress.length) message.toAddress = object.toAddress;
|
|
1907
|
+
if (object.amount) {
|
|
1908
|
+
if (!Array.isArray(object.amount)) throw TypeError('.types.MsgSend.amount: array expected');
|
|
1909
|
+
message.amount = [];
|
|
1910
|
+
for (var i = 0; i < object.amount.length; ++i) {
|
|
1911
|
+
if (typeof object.amount[i] !== 'object') throw TypeError('.types.MsgSend.amount: object expected');
|
|
1912
|
+
message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]);
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
return message;
|
|
1916
|
+
};
|
|
1917
|
+
|
|
1918
|
+
/**
|
|
1919
|
+
* Creates a plain object from a MsgSend message. Also converts values to other types if specified.
|
|
1920
|
+
* @function toObject
|
|
1921
|
+
* @memberof types.MsgSend
|
|
1922
|
+
* @static
|
|
1923
|
+
* @param {types.MsgSend} message MsgSend
|
|
1924
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1925
|
+
* @returns {Object.<string,*>} Plain object
|
|
1926
|
+
*/
|
|
1927
|
+
MsgSend.toObject = function toObject(message, options) {
|
|
1928
|
+
if (!options) options = {};
|
|
1929
|
+
var object = {};
|
|
1930
|
+
if (options.arrays || options.defaults) object.amount = [];
|
|
1931
|
+
if (options.defaults) {
|
|
1932
|
+
if (options.bytes === String) object.fromAddress = '';
|
|
1933
|
+
else {
|
|
1934
|
+
object.fromAddress = [];
|
|
1935
|
+
if (options.bytes !== Array) object.fromAddress = $util.newBuffer(object.fromAddress);
|
|
1936
|
+
}
|
|
1937
|
+
if (options.bytes === String) object.toAddress = '';
|
|
1938
|
+
else {
|
|
1939
|
+
object.toAddress = [];
|
|
1940
|
+
if (options.bytes !== Array) object.toAddress = $util.newBuffer(object.toAddress);
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
if (message.fromAddress != null && message.hasOwnProperty('fromAddress'))
|
|
1944
|
+
object.fromAddress =
|
|
1945
|
+
options.bytes === String
|
|
1946
|
+
? $util.base64.encode(message.fromAddress, 0, message.fromAddress.length)
|
|
1947
|
+
: options.bytes === Array
|
|
1948
|
+
? Array.prototype.slice.call(message.fromAddress)
|
|
1949
|
+
: message.fromAddress;
|
|
1950
|
+
if (message.toAddress != null && message.hasOwnProperty('toAddress'))
|
|
1951
|
+
object.toAddress =
|
|
1952
|
+
options.bytes === String
|
|
1953
|
+
? $util.base64.encode(message.toAddress, 0, message.toAddress.length)
|
|
1954
|
+
: options.bytes === Array
|
|
1955
|
+
? Array.prototype.slice.call(message.toAddress)
|
|
1956
|
+
: message.toAddress;
|
|
1957
|
+
if (message.amount && message.amount.length) {
|
|
1958
|
+
object.amount = [];
|
|
1959
|
+
for (var j = 0; j < message.amount.length; ++j)
|
|
1960
|
+
object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options);
|
|
1961
|
+
}
|
|
1962
|
+
return object;
|
|
1963
|
+
};
|
|
1964
|
+
|
|
1965
|
+
/**
|
|
1966
|
+
* Converts this MsgSend to JSON.
|
|
1967
|
+
* @function toJSON
|
|
1968
|
+
* @memberof types.MsgSend
|
|
1969
|
+
* @instance
|
|
1970
|
+
* @returns {Object.<string,*>} JSON object
|
|
1971
|
+
*/
|
|
1972
|
+
MsgSend.prototype.toJSON = function toJSON() {
|
|
1973
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
1974
|
+
};
|
|
1975
|
+
|
|
1976
|
+
return MsgSend;
|
|
1977
|
+
})();
|
|
1978
|
+
|
|
1979
|
+
return types;
|
|
1980
|
+
})();
|
|
1981
|
+
|
|
1982
|
+
$root.cosmos = (function () {
|
|
1983
|
+
/**
|
|
1984
|
+
* Namespace cosmos.
|
|
1985
|
+
* @exports cosmos
|
|
1986
|
+
* @namespace
|
|
1987
|
+
*/
|
|
1988
|
+
var cosmos = {};
|
|
1989
|
+
|
|
1990
|
+
cosmos.base = (function () {
|
|
1991
|
+
/**
|
|
1992
|
+
* Namespace base.
|
|
1993
|
+
* @memberof cosmos
|
|
1994
|
+
* @namespace
|
|
1995
|
+
*/
|
|
1996
|
+
var base = {};
|
|
1997
|
+
|
|
1998
|
+
base.v1beta1 = (function () {
|
|
1999
|
+
/**
|
|
2000
|
+
* Namespace v1beta1.
|
|
2001
|
+
* @memberof cosmos.base
|
|
2002
|
+
* @namespace
|
|
2003
|
+
*/
|
|
2004
|
+
var v1beta1 = {};
|
|
2005
|
+
|
|
2006
|
+
v1beta1.Coin = (function () {
|
|
2007
|
+
/**
|
|
2008
|
+
* Properties of a Coin.
|
|
2009
|
+
* @memberof cosmos.base.v1beta1
|
|
2010
|
+
* @interface ICoin
|
|
2011
|
+
* @property {string|null} [denom] Coin denom
|
|
2012
|
+
* @property {string|null} [amount] Coin amount
|
|
2013
|
+
*/
|
|
2014
|
+
|
|
2015
|
+
/**
|
|
2016
|
+
* Constructs a new Coin.
|
|
2017
|
+
* @memberof cosmos.base.v1beta1
|
|
2018
|
+
* @classdesc Represents a Coin.
|
|
2019
|
+
* @implements ICoin
|
|
2020
|
+
* @constructor
|
|
2021
|
+
* @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set
|
|
2022
|
+
*/
|
|
2023
|
+
function Coin(properties) {
|
|
2024
|
+
if (properties)
|
|
2025
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2026
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
/**
|
|
2030
|
+
* Coin denom.
|
|
2031
|
+
* @member {string} denom
|
|
2032
|
+
* @memberof cosmos.base.v1beta1.Coin
|
|
2033
|
+
* @instance
|
|
2034
|
+
*/
|
|
2035
|
+
Coin.prototype.denom = '';
|
|
2036
|
+
|
|
2037
|
+
/**
|
|
2038
|
+
* Coin amount.
|
|
2039
|
+
* @member {string} amount
|
|
2040
|
+
* @memberof cosmos.base.v1beta1.Coin
|
|
2041
|
+
* @instance
|
|
2042
|
+
*/
|
|
2043
|
+
Coin.prototype.amount = '';
|
|
2044
|
+
|
|
2045
|
+
/**
|
|
2046
|
+
* Creates a new Coin instance using the specified properties.
|
|
2047
|
+
* @function create
|
|
2048
|
+
* @memberof cosmos.base.v1beta1.Coin
|
|
2049
|
+
* @static
|
|
2050
|
+
* @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set
|
|
2051
|
+
* @returns {cosmos.base.v1beta1.Coin} Coin instance
|
|
2052
|
+
*/
|
|
2053
|
+
Coin.create = function create(properties) {
|
|
2054
|
+
return new Coin(properties);
|
|
2055
|
+
};
|
|
2056
|
+
|
|
2057
|
+
/**
|
|
2058
|
+
* Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages.
|
|
2059
|
+
* @function encode
|
|
2060
|
+
* @memberof cosmos.base.v1beta1.Coin
|
|
2061
|
+
* @static
|
|
2062
|
+
* @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode
|
|
2063
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2064
|
+
* @returns {$protobuf.Writer} Writer
|
|
2065
|
+
*/
|
|
2066
|
+
Coin.encode = function encode(message, writer) {
|
|
2067
|
+
if (!writer) writer = $Writer.create();
|
|
2068
|
+
if (message.denom != null && Object.hasOwnProperty.call(message, 'denom'))
|
|
2069
|
+
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.denom);
|
|
2070
|
+
if (message.amount != null && Object.hasOwnProperty.call(message, 'amount'))
|
|
2071
|
+
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.amount);
|
|
2072
|
+
return writer;
|
|
2073
|
+
};
|
|
2074
|
+
|
|
2075
|
+
/**
|
|
2076
|
+
* Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages.
|
|
2077
|
+
* @function encodeDelimited
|
|
2078
|
+
* @memberof cosmos.base.v1beta1.Coin
|
|
2079
|
+
* @static
|
|
2080
|
+
* @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode
|
|
2081
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2082
|
+
* @returns {$protobuf.Writer} Writer
|
|
2083
|
+
*/
|
|
2084
|
+
Coin.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2085
|
+
return this.encode(message, writer).ldelim();
|
|
2086
|
+
};
|
|
2087
|
+
|
|
2088
|
+
/**
|
|
2089
|
+
* Decodes a Coin message from the specified reader or buffer.
|
|
2090
|
+
* @function decode
|
|
2091
|
+
* @memberof cosmos.base.v1beta1.Coin
|
|
2092
|
+
* @static
|
|
2093
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2094
|
+
* @param {number} [length] Message length if known beforehand
|
|
2095
|
+
* @returns {cosmos.base.v1beta1.Coin} Coin
|
|
2096
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2097
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2098
|
+
*/
|
|
2099
|
+
Coin.decode = function decode(reader, length) {
|
|
2100
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
2101
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
2102
|
+
message = new $root.cosmos.base.v1beta1.Coin();
|
|
2103
|
+
while (reader.pos < end) {
|
|
2104
|
+
var tag = reader.uint32();
|
|
2105
|
+
switch (tag >>> 3) {
|
|
2106
|
+
case 1:
|
|
2107
|
+
message.denom = reader.string();
|
|
2108
|
+
break;
|
|
2109
|
+
case 2:
|
|
2110
|
+
message.amount = reader.string();
|
|
2111
|
+
break;
|
|
2112
|
+
default:
|
|
2113
|
+
reader.skipType(tag & 7);
|
|
2114
|
+
break;
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
return message;
|
|
2118
|
+
};
|
|
2119
|
+
|
|
2120
|
+
/**
|
|
2121
|
+
* Decodes a Coin message from the specified reader or buffer, length delimited.
|
|
2122
|
+
* @function decodeDelimited
|
|
2123
|
+
* @memberof cosmos.base.v1beta1.Coin
|
|
2124
|
+
* @static
|
|
2125
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2126
|
+
* @returns {cosmos.base.v1beta1.Coin} Coin
|
|
2127
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2128
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2129
|
+
*/
|
|
2130
|
+
Coin.decodeDelimited = function decodeDelimited(reader) {
|
|
2131
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
2132
|
+
return this.decode(reader, reader.uint32());
|
|
2133
|
+
};
|
|
2134
|
+
|
|
2135
|
+
/**
|
|
2136
|
+
* Verifies a Coin message.
|
|
2137
|
+
* @function verify
|
|
2138
|
+
* @memberof cosmos.base.v1beta1.Coin
|
|
2139
|
+
* @static
|
|
2140
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
2141
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
2142
|
+
*/
|
|
2143
|
+
Coin.verify = function verify(message) {
|
|
2144
|
+
if (typeof message !== 'object' || message === null) return 'object expected';
|
|
2145
|
+
if (message.denom != null && message.hasOwnProperty('denom'))
|
|
2146
|
+
if (!$util.isString(message.denom)) return 'denom: string expected';
|
|
2147
|
+
if (message.amount != null && message.hasOwnProperty('amount'))
|
|
2148
|
+
if (!$util.isString(message.amount)) return 'amount: string expected';
|
|
2149
|
+
return null;
|
|
2150
|
+
};
|
|
2151
|
+
|
|
2152
|
+
/**
|
|
2153
|
+
* Creates a Coin message from a plain object. Also converts values to their respective internal types.
|
|
2154
|
+
* @function fromObject
|
|
2155
|
+
* @memberof cosmos.base.v1beta1.Coin
|
|
2156
|
+
* @static
|
|
2157
|
+
* @param {Object.<string,*>} object Plain object
|
|
2158
|
+
* @returns {cosmos.base.v1beta1.Coin} Coin
|
|
2159
|
+
*/
|
|
2160
|
+
Coin.fromObject = function fromObject(object) {
|
|
2161
|
+
if (object instanceof $root.cosmos.base.v1beta1.Coin) return object;
|
|
2162
|
+
var message = new $root.cosmos.base.v1beta1.Coin();
|
|
2163
|
+
if (object.denom != null) message.denom = String(object.denom);
|
|
2164
|
+
if (object.amount != null) message.amount = String(object.amount);
|
|
2165
|
+
return message;
|
|
2166
|
+
};
|
|
2167
|
+
|
|
2168
|
+
/**
|
|
2169
|
+
* Creates a plain object from a Coin message. Also converts values to other types if specified.
|
|
2170
|
+
* @function toObject
|
|
2171
|
+
* @memberof cosmos.base.v1beta1.Coin
|
|
2172
|
+
* @static
|
|
2173
|
+
* @param {cosmos.base.v1beta1.Coin} message Coin
|
|
2174
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
2175
|
+
* @returns {Object.<string,*>} Plain object
|
|
2176
|
+
*/
|
|
2177
|
+
Coin.toObject = function toObject(message, options) {
|
|
2178
|
+
if (!options) options = {};
|
|
2179
|
+
var object = {};
|
|
2180
|
+
if (options.defaults) {
|
|
2181
|
+
object.denom = '';
|
|
2182
|
+
object.amount = '';
|
|
2183
|
+
}
|
|
2184
|
+
if (message.denom != null && message.hasOwnProperty('denom')) object.denom = message.denom;
|
|
2185
|
+
if (message.amount != null && message.hasOwnProperty('amount')) object.amount = message.amount;
|
|
2186
|
+
return object;
|
|
2187
|
+
};
|
|
2188
|
+
|
|
2189
|
+
/**
|
|
2190
|
+
* Converts this Coin to JSON.
|
|
2191
|
+
* @function toJSON
|
|
2192
|
+
* @memberof cosmos.base.v1beta1.Coin
|
|
2193
|
+
* @instance
|
|
2194
|
+
* @returns {Object.<string,*>} JSON object
|
|
2195
|
+
*/
|
|
2196
|
+
Coin.prototype.toJSON = function toJSON() {
|
|
2197
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2198
|
+
};
|
|
2199
|
+
|
|
2200
|
+
return Coin;
|
|
2201
|
+
})();
|
|
2202
|
+
|
|
2203
|
+
v1beta1.DecCoin = (function () {
|
|
2204
|
+
/**
|
|
2205
|
+
* Properties of a DecCoin.
|
|
2206
|
+
* @memberof cosmos.base.v1beta1
|
|
2207
|
+
* @interface IDecCoin
|
|
2208
|
+
* @property {string|null} [denom] DecCoin denom
|
|
2209
|
+
* @property {string|null} [amount] DecCoin amount
|
|
2210
|
+
*/
|
|
2211
|
+
|
|
2212
|
+
/**
|
|
2213
|
+
* Constructs a new DecCoin.
|
|
2214
|
+
* @memberof cosmos.base.v1beta1
|
|
2215
|
+
* @classdesc Represents a DecCoin.
|
|
2216
|
+
* @implements IDecCoin
|
|
2217
|
+
* @constructor
|
|
2218
|
+
* @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set
|
|
2219
|
+
*/
|
|
2220
|
+
function DecCoin(properties) {
|
|
2221
|
+
if (properties)
|
|
2222
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2223
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
/**
|
|
2227
|
+
* DecCoin denom.
|
|
2228
|
+
* @member {string} denom
|
|
2229
|
+
* @memberof cosmos.base.v1beta1.DecCoin
|
|
2230
|
+
* @instance
|
|
2231
|
+
*/
|
|
2232
|
+
DecCoin.prototype.denom = '';
|
|
2233
|
+
|
|
2234
|
+
/**
|
|
2235
|
+
* DecCoin amount.
|
|
2236
|
+
* @member {string} amount
|
|
2237
|
+
* @memberof cosmos.base.v1beta1.DecCoin
|
|
2238
|
+
* @instance
|
|
2239
|
+
*/
|
|
2240
|
+
DecCoin.prototype.amount = '';
|
|
2241
|
+
|
|
2242
|
+
/**
|
|
2243
|
+
* Creates a new DecCoin instance using the specified properties.
|
|
2244
|
+
* @function create
|
|
2245
|
+
* @memberof cosmos.base.v1beta1.DecCoin
|
|
2246
|
+
* @static
|
|
2247
|
+
* @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set
|
|
2248
|
+
* @returns {cosmos.base.v1beta1.DecCoin} DecCoin instance
|
|
2249
|
+
*/
|
|
2250
|
+
DecCoin.create = function create(properties) {
|
|
2251
|
+
return new DecCoin(properties);
|
|
2252
|
+
};
|
|
2253
|
+
|
|
2254
|
+
/**
|
|
2255
|
+
* Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages.
|
|
2256
|
+
* @function encode
|
|
2257
|
+
* @memberof cosmos.base.v1beta1.DecCoin
|
|
2258
|
+
* @static
|
|
2259
|
+
* @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode
|
|
2260
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2261
|
+
* @returns {$protobuf.Writer} Writer
|
|
2262
|
+
*/
|
|
2263
|
+
DecCoin.encode = function encode(message, writer) {
|
|
2264
|
+
if (!writer) writer = $Writer.create();
|
|
2265
|
+
if (message.denom != null && Object.hasOwnProperty.call(message, 'denom'))
|
|
2266
|
+
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.denom);
|
|
2267
|
+
if (message.amount != null && Object.hasOwnProperty.call(message, 'amount'))
|
|
2268
|
+
writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.amount);
|
|
2269
|
+
return writer;
|
|
2270
|
+
};
|
|
2271
|
+
|
|
2272
|
+
/**
|
|
2273
|
+
* Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages.
|
|
2274
|
+
* @function encodeDelimited
|
|
2275
|
+
* @memberof cosmos.base.v1beta1.DecCoin
|
|
2276
|
+
* @static
|
|
2277
|
+
* @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode
|
|
2278
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2279
|
+
* @returns {$protobuf.Writer} Writer
|
|
2280
|
+
*/
|
|
2281
|
+
DecCoin.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2282
|
+
return this.encode(message, writer).ldelim();
|
|
2283
|
+
};
|
|
2284
|
+
|
|
2285
|
+
/**
|
|
2286
|
+
* Decodes a DecCoin message from the specified reader or buffer.
|
|
2287
|
+
* @function decode
|
|
2288
|
+
* @memberof cosmos.base.v1beta1.DecCoin
|
|
2289
|
+
* @static
|
|
2290
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2291
|
+
* @param {number} [length] Message length if known beforehand
|
|
2292
|
+
* @returns {cosmos.base.v1beta1.DecCoin} DecCoin
|
|
2293
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2294
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2295
|
+
*/
|
|
2296
|
+
DecCoin.decode = function decode(reader, length) {
|
|
2297
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
2298
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
2299
|
+
message = new $root.cosmos.base.v1beta1.DecCoin();
|
|
2300
|
+
while (reader.pos < end) {
|
|
2301
|
+
var tag = reader.uint32();
|
|
2302
|
+
switch (tag >>> 3) {
|
|
2303
|
+
case 1:
|
|
2304
|
+
message.denom = reader.string();
|
|
2305
|
+
break;
|
|
2306
|
+
case 2:
|
|
2307
|
+
message.amount = reader.string();
|
|
2308
|
+
break;
|
|
2309
|
+
default:
|
|
2310
|
+
reader.skipType(tag & 7);
|
|
2311
|
+
break;
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
return message;
|
|
2315
|
+
};
|
|
2316
|
+
|
|
2317
|
+
/**
|
|
2318
|
+
* Decodes a DecCoin message from the specified reader or buffer, length delimited.
|
|
2319
|
+
* @function decodeDelimited
|
|
2320
|
+
* @memberof cosmos.base.v1beta1.DecCoin
|
|
2321
|
+
* @static
|
|
2322
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2323
|
+
* @returns {cosmos.base.v1beta1.DecCoin} DecCoin
|
|
2324
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2325
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2326
|
+
*/
|
|
2327
|
+
DecCoin.decodeDelimited = function decodeDelimited(reader) {
|
|
2328
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
2329
|
+
return this.decode(reader, reader.uint32());
|
|
2330
|
+
};
|
|
2331
|
+
|
|
2332
|
+
/**
|
|
2333
|
+
* Verifies a DecCoin message.
|
|
2334
|
+
* @function verify
|
|
2335
|
+
* @memberof cosmos.base.v1beta1.DecCoin
|
|
2336
|
+
* @static
|
|
2337
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
2338
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
2339
|
+
*/
|
|
2340
|
+
DecCoin.verify = function verify(message) {
|
|
2341
|
+
if (typeof message !== 'object' || message === null) return 'object expected';
|
|
2342
|
+
if (message.denom != null && message.hasOwnProperty('denom'))
|
|
2343
|
+
if (!$util.isString(message.denom)) return 'denom: string expected';
|
|
2344
|
+
if (message.amount != null && message.hasOwnProperty('amount'))
|
|
2345
|
+
if (!$util.isString(message.amount)) return 'amount: string expected';
|
|
2346
|
+
return null;
|
|
2347
|
+
};
|
|
2348
|
+
|
|
2349
|
+
/**
|
|
2350
|
+
* Creates a DecCoin message from a plain object. Also converts values to their respective internal types.
|
|
2351
|
+
* @function fromObject
|
|
2352
|
+
* @memberof cosmos.base.v1beta1.DecCoin
|
|
2353
|
+
* @static
|
|
2354
|
+
* @param {Object.<string,*>} object Plain object
|
|
2355
|
+
* @returns {cosmos.base.v1beta1.DecCoin} DecCoin
|
|
2356
|
+
*/
|
|
2357
|
+
DecCoin.fromObject = function fromObject(object) {
|
|
2358
|
+
if (object instanceof $root.cosmos.base.v1beta1.DecCoin) return object;
|
|
2359
|
+
var message = new $root.cosmos.base.v1beta1.DecCoin();
|
|
2360
|
+
if (object.denom != null) message.denom = String(object.denom);
|
|
2361
|
+
if (object.amount != null) message.amount = String(object.amount);
|
|
2362
|
+
return message;
|
|
2363
|
+
};
|
|
2364
|
+
|
|
2365
|
+
/**
|
|
2366
|
+
* Creates a plain object from a DecCoin message. Also converts values to other types if specified.
|
|
2367
|
+
* @function toObject
|
|
2368
|
+
* @memberof cosmos.base.v1beta1.DecCoin
|
|
2369
|
+
* @static
|
|
2370
|
+
* @param {cosmos.base.v1beta1.DecCoin} message DecCoin
|
|
2371
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
2372
|
+
* @returns {Object.<string,*>} Plain object
|
|
2373
|
+
*/
|
|
2374
|
+
DecCoin.toObject = function toObject(message, options) {
|
|
2375
|
+
if (!options) options = {};
|
|
2376
|
+
var object = {};
|
|
2377
|
+
if (options.defaults) {
|
|
2378
|
+
object.denom = '';
|
|
2379
|
+
object.amount = '';
|
|
2380
|
+
}
|
|
2381
|
+
if (message.denom != null && message.hasOwnProperty('denom')) object.denom = message.denom;
|
|
2382
|
+
if (message.amount != null && message.hasOwnProperty('amount')) object.amount = message.amount;
|
|
2383
|
+
return object;
|
|
2384
|
+
};
|
|
2385
|
+
|
|
2386
|
+
/**
|
|
2387
|
+
* Converts this DecCoin to JSON.
|
|
2388
|
+
* @function toJSON
|
|
2389
|
+
* @memberof cosmos.base.v1beta1.DecCoin
|
|
2390
|
+
* @instance
|
|
2391
|
+
* @returns {Object.<string,*>} JSON object
|
|
2392
|
+
*/
|
|
2393
|
+
DecCoin.prototype.toJSON = function toJSON() {
|
|
2394
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2395
|
+
};
|
|
2396
|
+
|
|
2397
|
+
return DecCoin;
|
|
2398
|
+
})();
|
|
2399
|
+
|
|
2400
|
+
v1beta1.IntProto = (function () {
|
|
2401
|
+
/**
|
|
2402
|
+
* Properties of an IntProto.
|
|
2403
|
+
* @memberof cosmos.base.v1beta1
|
|
2404
|
+
* @interface IIntProto
|
|
2405
|
+
* @property {string|null} [int] IntProto int
|
|
2406
|
+
*/
|
|
2407
|
+
|
|
2408
|
+
/**
|
|
2409
|
+
* Constructs a new IntProto.
|
|
2410
|
+
* @memberof cosmos.base.v1beta1
|
|
2411
|
+
* @classdesc Represents an IntProto.
|
|
2412
|
+
* @implements IIntProto
|
|
2413
|
+
* @constructor
|
|
2414
|
+
* @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set
|
|
2415
|
+
*/
|
|
2416
|
+
function IntProto(properties) {
|
|
2417
|
+
if (properties)
|
|
2418
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2419
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
/**
|
|
2423
|
+
* IntProto int.
|
|
2424
|
+
* @member {string} int
|
|
2425
|
+
* @memberof cosmos.base.v1beta1.IntProto
|
|
2426
|
+
* @instance
|
|
2427
|
+
*/
|
|
2428
|
+
IntProto.prototype.int = '';
|
|
2429
|
+
|
|
2430
|
+
/**
|
|
2431
|
+
* Creates a new IntProto instance using the specified properties.
|
|
2432
|
+
* @function create
|
|
2433
|
+
* @memberof cosmos.base.v1beta1.IntProto
|
|
2434
|
+
* @static
|
|
2435
|
+
* @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set
|
|
2436
|
+
* @returns {cosmos.base.v1beta1.IntProto} IntProto instance
|
|
2437
|
+
*/
|
|
2438
|
+
IntProto.create = function create(properties) {
|
|
2439
|
+
return new IntProto(properties);
|
|
2440
|
+
};
|
|
2441
|
+
|
|
2442
|
+
/**
|
|
2443
|
+
* Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages.
|
|
2444
|
+
* @function encode
|
|
2445
|
+
* @memberof cosmos.base.v1beta1.IntProto
|
|
2446
|
+
* @static
|
|
2447
|
+
* @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode
|
|
2448
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2449
|
+
* @returns {$protobuf.Writer} Writer
|
|
2450
|
+
*/
|
|
2451
|
+
IntProto.encode = function encode(message, writer) {
|
|
2452
|
+
if (!writer) writer = $Writer.create();
|
|
2453
|
+
if (message.int != null && Object.hasOwnProperty.call(message, 'int'))
|
|
2454
|
+
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.int);
|
|
2455
|
+
return writer;
|
|
2456
|
+
};
|
|
2457
|
+
|
|
2458
|
+
/**
|
|
2459
|
+
* Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages.
|
|
2460
|
+
* @function encodeDelimited
|
|
2461
|
+
* @memberof cosmos.base.v1beta1.IntProto
|
|
2462
|
+
* @static
|
|
2463
|
+
* @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode
|
|
2464
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2465
|
+
* @returns {$protobuf.Writer} Writer
|
|
2466
|
+
*/
|
|
2467
|
+
IntProto.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2468
|
+
return this.encode(message, writer).ldelim();
|
|
2469
|
+
};
|
|
2470
|
+
|
|
2471
|
+
/**
|
|
2472
|
+
* Decodes an IntProto message from the specified reader or buffer.
|
|
2473
|
+
* @function decode
|
|
2474
|
+
* @memberof cosmos.base.v1beta1.IntProto
|
|
2475
|
+
* @static
|
|
2476
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2477
|
+
* @param {number} [length] Message length if known beforehand
|
|
2478
|
+
* @returns {cosmos.base.v1beta1.IntProto} IntProto
|
|
2479
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2480
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2481
|
+
*/
|
|
2482
|
+
IntProto.decode = function decode(reader, length) {
|
|
2483
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
2484
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
2485
|
+
message = new $root.cosmos.base.v1beta1.IntProto();
|
|
2486
|
+
while (reader.pos < end) {
|
|
2487
|
+
var tag = reader.uint32();
|
|
2488
|
+
switch (tag >>> 3) {
|
|
2489
|
+
case 1:
|
|
2490
|
+
message.int = reader.string();
|
|
2491
|
+
break;
|
|
2492
|
+
default:
|
|
2493
|
+
reader.skipType(tag & 7);
|
|
2494
|
+
break;
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
return message;
|
|
2498
|
+
};
|
|
2499
|
+
|
|
2500
|
+
/**
|
|
2501
|
+
* Decodes an IntProto message from the specified reader or buffer, length delimited.
|
|
2502
|
+
* @function decodeDelimited
|
|
2503
|
+
* @memberof cosmos.base.v1beta1.IntProto
|
|
2504
|
+
* @static
|
|
2505
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2506
|
+
* @returns {cosmos.base.v1beta1.IntProto} IntProto
|
|
2507
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2508
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2509
|
+
*/
|
|
2510
|
+
IntProto.decodeDelimited = function decodeDelimited(reader) {
|
|
2511
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
2512
|
+
return this.decode(reader, reader.uint32());
|
|
2513
|
+
};
|
|
2514
|
+
|
|
2515
|
+
/**
|
|
2516
|
+
* Verifies an IntProto message.
|
|
2517
|
+
* @function verify
|
|
2518
|
+
* @memberof cosmos.base.v1beta1.IntProto
|
|
2519
|
+
* @static
|
|
2520
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
2521
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
2522
|
+
*/
|
|
2523
|
+
IntProto.verify = function verify(message) {
|
|
2524
|
+
if (typeof message !== 'object' || message === null) return 'object expected';
|
|
2525
|
+
if (message.int != null && message.hasOwnProperty('int'))
|
|
2526
|
+
if (!$util.isString(message.int)) return 'int: string expected';
|
|
2527
|
+
return null;
|
|
2528
|
+
};
|
|
2529
|
+
|
|
2530
|
+
/**
|
|
2531
|
+
* Creates an IntProto message from a plain object. Also converts values to their respective internal types.
|
|
2532
|
+
* @function fromObject
|
|
2533
|
+
* @memberof cosmos.base.v1beta1.IntProto
|
|
2534
|
+
* @static
|
|
2535
|
+
* @param {Object.<string,*>} object Plain object
|
|
2536
|
+
* @returns {cosmos.base.v1beta1.IntProto} IntProto
|
|
2537
|
+
*/
|
|
2538
|
+
IntProto.fromObject = function fromObject(object) {
|
|
2539
|
+
if (object instanceof $root.cosmos.base.v1beta1.IntProto) return object;
|
|
2540
|
+
var message = new $root.cosmos.base.v1beta1.IntProto();
|
|
2541
|
+
if (object.int != null) message.int = String(object.int);
|
|
2542
|
+
return message;
|
|
2543
|
+
};
|
|
2544
|
+
|
|
2545
|
+
/**
|
|
2546
|
+
* Creates a plain object from an IntProto message. Also converts values to other types if specified.
|
|
2547
|
+
* @function toObject
|
|
2548
|
+
* @memberof cosmos.base.v1beta1.IntProto
|
|
2549
|
+
* @static
|
|
2550
|
+
* @param {cosmos.base.v1beta1.IntProto} message IntProto
|
|
2551
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
2552
|
+
* @returns {Object.<string,*>} Plain object
|
|
2553
|
+
*/
|
|
2554
|
+
IntProto.toObject = function toObject(message, options) {
|
|
2555
|
+
if (!options) options = {};
|
|
2556
|
+
var object = {};
|
|
2557
|
+
if (options.defaults) object.int = '';
|
|
2558
|
+
if (message.int != null && message.hasOwnProperty('int')) object.int = message.int;
|
|
2559
|
+
return object;
|
|
2560
|
+
};
|
|
2561
|
+
|
|
2562
|
+
/**
|
|
2563
|
+
* Converts this IntProto to JSON.
|
|
2564
|
+
* @function toJSON
|
|
2565
|
+
* @memberof cosmos.base.v1beta1.IntProto
|
|
2566
|
+
* @instance
|
|
2567
|
+
* @returns {Object.<string,*>} JSON object
|
|
2568
|
+
*/
|
|
2569
|
+
IntProto.prototype.toJSON = function toJSON() {
|
|
2570
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2571
|
+
};
|
|
2572
|
+
|
|
2573
|
+
return IntProto;
|
|
2574
|
+
})();
|
|
2575
|
+
|
|
2576
|
+
v1beta1.DecProto = (function () {
|
|
2577
|
+
/**
|
|
2578
|
+
* Properties of a DecProto.
|
|
2579
|
+
* @memberof cosmos.base.v1beta1
|
|
2580
|
+
* @interface IDecProto
|
|
2581
|
+
* @property {string|null} [dec] DecProto dec
|
|
2582
|
+
*/
|
|
2583
|
+
|
|
2584
|
+
/**
|
|
2585
|
+
* Constructs a new DecProto.
|
|
2586
|
+
* @memberof cosmos.base.v1beta1
|
|
2587
|
+
* @classdesc Represents a DecProto.
|
|
2588
|
+
* @implements IDecProto
|
|
2589
|
+
* @constructor
|
|
2590
|
+
* @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set
|
|
2591
|
+
*/
|
|
2592
|
+
function DecProto(properties) {
|
|
2593
|
+
if (properties)
|
|
2594
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2595
|
+
if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
/**
|
|
2599
|
+
* DecProto dec.
|
|
2600
|
+
* @member {string} dec
|
|
2601
|
+
* @memberof cosmos.base.v1beta1.DecProto
|
|
2602
|
+
* @instance
|
|
2603
|
+
*/
|
|
2604
|
+
DecProto.prototype.dec = '';
|
|
2605
|
+
|
|
2606
|
+
/**
|
|
2607
|
+
* Creates a new DecProto instance using the specified properties.
|
|
2608
|
+
* @function create
|
|
2609
|
+
* @memberof cosmos.base.v1beta1.DecProto
|
|
2610
|
+
* @static
|
|
2611
|
+
* @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set
|
|
2612
|
+
* @returns {cosmos.base.v1beta1.DecProto} DecProto instance
|
|
2613
|
+
*/
|
|
2614
|
+
DecProto.create = function create(properties) {
|
|
2615
|
+
return new DecProto(properties);
|
|
2616
|
+
};
|
|
2617
|
+
|
|
2618
|
+
/**
|
|
2619
|
+
* Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages.
|
|
2620
|
+
* @function encode
|
|
2621
|
+
* @memberof cosmos.base.v1beta1.DecProto
|
|
2622
|
+
* @static
|
|
2623
|
+
* @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode
|
|
2624
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2625
|
+
* @returns {$protobuf.Writer} Writer
|
|
2626
|
+
*/
|
|
2627
|
+
DecProto.encode = function encode(message, writer) {
|
|
2628
|
+
if (!writer) writer = $Writer.create();
|
|
2629
|
+
if (message.dec != null && Object.hasOwnProperty.call(message, 'dec'))
|
|
2630
|
+
writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.dec);
|
|
2631
|
+
return writer;
|
|
2632
|
+
};
|
|
2633
|
+
|
|
2634
|
+
/**
|
|
2635
|
+
* Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages.
|
|
2636
|
+
* @function encodeDelimited
|
|
2637
|
+
* @memberof cosmos.base.v1beta1.DecProto
|
|
2638
|
+
* @static
|
|
2639
|
+
* @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode
|
|
2640
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
2641
|
+
* @returns {$protobuf.Writer} Writer
|
|
2642
|
+
*/
|
|
2643
|
+
DecProto.encodeDelimited = function encodeDelimited(message, writer) {
|
|
2644
|
+
return this.encode(message, writer).ldelim();
|
|
2645
|
+
};
|
|
2646
|
+
|
|
2647
|
+
/**
|
|
2648
|
+
* Decodes a DecProto message from the specified reader or buffer.
|
|
2649
|
+
* @function decode
|
|
2650
|
+
* @memberof cosmos.base.v1beta1.DecProto
|
|
2651
|
+
* @static
|
|
2652
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2653
|
+
* @param {number} [length] Message length if known beforehand
|
|
2654
|
+
* @returns {cosmos.base.v1beta1.DecProto} DecProto
|
|
2655
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2656
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2657
|
+
*/
|
|
2658
|
+
DecProto.decode = function decode(reader, length) {
|
|
2659
|
+
if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
|
|
2660
|
+
var end = length === undefined ? reader.len : reader.pos + length,
|
|
2661
|
+
message = new $root.cosmos.base.v1beta1.DecProto();
|
|
2662
|
+
while (reader.pos < end) {
|
|
2663
|
+
var tag = reader.uint32();
|
|
2664
|
+
switch (tag >>> 3) {
|
|
2665
|
+
case 1:
|
|
2666
|
+
message.dec = reader.string();
|
|
2667
|
+
break;
|
|
2668
|
+
default:
|
|
2669
|
+
reader.skipType(tag & 7);
|
|
2670
|
+
break;
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2673
|
+
return message;
|
|
2674
|
+
};
|
|
2675
|
+
|
|
2676
|
+
/**
|
|
2677
|
+
* Decodes a DecProto message from the specified reader or buffer, length delimited.
|
|
2678
|
+
* @function decodeDelimited
|
|
2679
|
+
* @memberof cosmos.base.v1beta1.DecProto
|
|
2680
|
+
* @static
|
|
2681
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
2682
|
+
* @returns {cosmos.base.v1beta1.DecProto} DecProto
|
|
2683
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
2684
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
2685
|
+
*/
|
|
2686
|
+
DecProto.decodeDelimited = function decodeDelimited(reader) {
|
|
2687
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
2688
|
+
return this.decode(reader, reader.uint32());
|
|
2689
|
+
};
|
|
2690
|
+
|
|
2691
|
+
/**
|
|
2692
|
+
* Verifies a DecProto message.
|
|
2693
|
+
* @function verify
|
|
2694
|
+
* @memberof cosmos.base.v1beta1.DecProto
|
|
2695
|
+
* @static
|
|
2696
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
2697
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
2698
|
+
*/
|
|
2699
|
+
DecProto.verify = function verify(message) {
|
|
2700
|
+
if (typeof message !== 'object' || message === null) return 'object expected';
|
|
2701
|
+
if (message.dec != null && message.hasOwnProperty('dec'))
|
|
2702
|
+
if (!$util.isString(message.dec)) return 'dec: string expected';
|
|
2703
|
+
return null;
|
|
2704
|
+
};
|
|
2705
|
+
|
|
2706
|
+
/**
|
|
2707
|
+
* Creates a DecProto message from a plain object. Also converts values to their respective internal types.
|
|
2708
|
+
* @function fromObject
|
|
2709
|
+
* @memberof cosmos.base.v1beta1.DecProto
|
|
2710
|
+
* @static
|
|
2711
|
+
* @param {Object.<string,*>} object Plain object
|
|
2712
|
+
* @returns {cosmos.base.v1beta1.DecProto} DecProto
|
|
2713
|
+
*/
|
|
2714
|
+
DecProto.fromObject = function fromObject(object) {
|
|
2715
|
+
if (object instanceof $root.cosmos.base.v1beta1.DecProto) return object;
|
|
2716
|
+
var message = new $root.cosmos.base.v1beta1.DecProto();
|
|
2717
|
+
if (object.dec != null) message.dec = String(object.dec);
|
|
2718
|
+
return message;
|
|
2719
|
+
};
|
|
2720
|
+
|
|
2721
|
+
/**
|
|
2722
|
+
* Creates a plain object from a DecProto message. Also converts values to other types if specified.
|
|
2723
|
+
* @function toObject
|
|
2724
|
+
* @memberof cosmos.base.v1beta1.DecProto
|
|
2725
|
+
* @static
|
|
2726
|
+
* @param {cosmos.base.v1beta1.DecProto} message DecProto
|
|
2727
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
2728
|
+
* @returns {Object.<string,*>} Plain object
|
|
2729
|
+
*/
|
|
2730
|
+
DecProto.toObject = function toObject(message, options) {
|
|
2731
|
+
if (!options) options = {};
|
|
2732
|
+
var object = {};
|
|
2733
|
+
if (options.defaults) object.dec = '';
|
|
2734
|
+
if (message.dec != null && message.hasOwnProperty('dec')) object.dec = message.dec;
|
|
2735
|
+
return object;
|
|
2736
|
+
};
|
|
2737
|
+
|
|
2738
|
+
/**
|
|
2739
|
+
* Converts this DecProto to JSON.
|
|
2740
|
+
* @function toJSON
|
|
2741
|
+
* @memberof cosmos.base.v1beta1.DecProto
|
|
2742
|
+
* @instance
|
|
2743
|
+
* @returns {Object.<string,*>} JSON object
|
|
2744
|
+
*/
|
|
2745
|
+
DecProto.prototype.toJSON = function toJSON() {
|
|
2746
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
2747
|
+
};
|
|
2748
|
+
|
|
2749
|
+
return DecProto;
|
|
2750
|
+
})();
|
|
2751
|
+
|
|
2752
|
+
return v1beta1;
|
|
2753
|
+
})();
|
|
2754
|
+
|
|
2755
|
+
return base;
|
|
2756
|
+
})();
|
|
2757
|
+
|
|
2758
|
+
return cosmos;
|
|
2759
|
+
})();
|
|
2760
|
+
|
|
2761
|
+
module.exports = $root;
|