@trustwallet/wallet-core 2.9.0 → 2.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9875,6 +9875,7 @@
|
|
9875
9875
|
case 20:
|
9876
9876
|
case 21:
|
9877
9877
|
case 22:
|
9878
|
+
case 23:
|
9878
9879
|
break;
|
9879
9880
|
}
|
9880
9881
|
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
@@ -9993,6 +9994,10 @@
|
|
9993
9994
|
case 22:
|
9994
9995
|
message.error = 22;
|
9995
9996
|
break;
|
9997
|
+
case "Error_invalid_requested_token_amount":
|
9998
|
+
case 23:
|
9999
|
+
message.error = 23;
|
10000
|
+
break;
|
9996
10001
|
}
|
9997
10002
|
if (object.errorMessage != null)
|
9998
10003
|
message.errorMessage = String(object.errorMessage);
|
@@ -10097,6 +10102,7 @@
|
|
10097
10102
|
* @property {number} Error_no_support_n2n=20 Error_no_support_n2n value
|
10098
10103
|
* @property {number} Error_signatures_count=21 Error_signatures_count value
|
10099
10104
|
* @property {number} Error_invalid_params=22 Error_invalid_params value
|
10105
|
+
* @property {number} Error_invalid_requested_token_amount=23 Error_invalid_requested_token_amount value
|
10100
10106
|
*/
|
10101
10107
|
Proto.SigningError = (function() {
|
10102
10108
|
var valuesById = {}, values = Object.create(valuesById);
|
@@ -10123,6 +10129,7 @@
|
|
10123
10129
|
values[valuesById[20] = "Error_no_support_n2n"] = 20;
|
10124
10130
|
values[valuesById[21] = "Error_signatures_count"] = 21;
|
10125
10131
|
values[valuesById[22] = "Error_invalid_params"] = 22;
|
10132
|
+
values[valuesById[23] = "Error_invalid_requested_token_amount"] = 23;
|
10126
10133
|
return values;
|
10127
10134
|
})();
|
10128
10135
|
|
@@ -12083,6 +12090,7 @@
|
|
12083
12090
|
case 20:
|
12084
12091
|
case 21:
|
12085
12092
|
case 22:
|
12093
|
+
case 23:
|
12086
12094
|
break;
|
12087
12095
|
}
|
12088
12096
|
if (message.outputOpReturn != null && message.hasOwnProperty("outputOpReturn"))
|
@@ -12247,6 +12255,10 @@
|
|
12247
12255
|
case 22:
|
12248
12256
|
message.error = 22;
|
12249
12257
|
break;
|
12258
|
+
case "Error_invalid_requested_token_amount":
|
12259
|
+
case 23:
|
12260
|
+
message.error = 23;
|
12261
|
+
break;
|
12250
12262
|
}
|
12251
12263
|
if (object.outputOpReturn != null)
|
12252
12264
|
if (typeof object.outputOpReturn === "string")
|
@@ -12551,6 +12563,7 @@
|
|
12551
12563
|
case 20:
|
12552
12564
|
case 21:
|
12553
12565
|
case 22:
|
12566
|
+
case 23:
|
12554
12567
|
break;
|
12555
12568
|
}
|
12556
12569
|
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
@@ -12676,6 +12689,10 @@
|
|
12676
12689
|
case 22:
|
12677
12690
|
message.error = 22;
|
12678
12691
|
break;
|
12692
|
+
case "Error_invalid_requested_token_amount":
|
12693
|
+
case 23:
|
12694
|
+
message.error = 23;
|
12695
|
+
break;
|
12679
12696
|
}
|
12680
12697
|
if (object.errorMessage != null)
|
12681
12698
|
message.errorMessage = String(object.errorMessage);
|
@@ -13103,6 +13120,7 @@
|
|
13103
13120
|
case 20:
|
13104
13121
|
case 21:
|
13105
13122
|
case 22:
|
13123
|
+
case 23:
|
13106
13124
|
break;
|
13107
13125
|
}
|
13108
13126
|
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
@@ -13226,6 +13244,10 @@
|
|
13226
13244
|
case 22:
|
13227
13245
|
message.error = 22;
|
13228
13246
|
break;
|
13247
|
+
case "Error_invalid_requested_token_amount":
|
13248
|
+
case 23:
|
13249
|
+
message.error = 23;
|
13250
|
+
break;
|
13229
13251
|
}
|
13230
13252
|
if (object.errorMessage != null)
|
13231
13253
|
message.errorMessage = String(object.errorMessage);
|
@@ -13991,6 +14013,7 @@
|
|
13991
14013
|
* @interface ITxOutput
|
13992
14014
|
* @property {string|null} [address] TxOutput address
|
13993
14015
|
* @property {Long|null} [amount] TxOutput amount
|
14016
|
+
* @property {Array.<TW.Cardano.Proto.ITokenAmount>|null} [tokenAmount] TxOutput tokenAmount
|
13994
14017
|
*/
|
13995
14018
|
|
13996
14019
|
/**
|
@@ -14002,6 +14025,7 @@
|
|
14002
14025
|
* @param {TW.Cardano.Proto.ITxOutput=} [properties] Properties to set
|
14003
14026
|
*/
|
14004
14027
|
function TxOutput(properties) {
|
14028
|
+
this.tokenAmount = [];
|
14005
14029
|
if (properties)
|
14006
14030
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14007
14031
|
if (properties[keys[i]] != null)
|
@@ -14024,6 +14048,14 @@
|
|
14024
14048
|
*/
|
14025
14049
|
TxOutput.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
14026
14050
|
|
14051
|
+
/**
|
14052
|
+
* TxOutput tokenAmount.
|
14053
|
+
* @member {Array.<TW.Cardano.Proto.ITokenAmount>} tokenAmount
|
14054
|
+
* @memberof TW.Cardano.Proto.TxOutput
|
14055
|
+
* @instance
|
14056
|
+
*/
|
14057
|
+
TxOutput.prototype.tokenAmount = $util.emptyArray;
|
14058
|
+
|
14027
14059
|
/**
|
14028
14060
|
* Creates a new TxOutput instance using the specified properties.
|
14029
14061
|
* @function create
|
@@ -14052,6 +14084,9 @@
|
|
14052
14084
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.address);
|
14053
14085
|
if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
|
14054
14086
|
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount);
|
14087
|
+
if (message.tokenAmount != null && message.tokenAmount.length)
|
14088
|
+
for (var i = 0; i < message.tokenAmount.length; ++i)
|
14089
|
+
$root.TW.Cardano.Proto.TokenAmount.encode(message.tokenAmount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
14055
14090
|
return writer;
|
14056
14091
|
};
|
14057
14092
|
|
@@ -14079,6 +14114,11 @@
|
|
14079
14114
|
case 2:
|
14080
14115
|
message.amount = reader.uint64();
|
14081
14116
|
break;
|
14117
|
+
case 3:
|
14118
|
+
if (!(message.tokenAmount && message.tokenAmount.length))
|
14119
|
+
message.tokenAmount = [];
|
14120
|
+
message.tokenAmount.push($root.TW.Cardano.Proto.TokenAmount.decode(reader, reader.uint32()));
|
14121
|
+
break;
|
14082
14122
|
default:
|
14083
14123
|
reader.skipType(tag & 7);
|
14084
14124
|
break;
|
@@ -14104,6 +14144,15 @@
|
|
14104
14144
|
if (message.amount != null && message.hasOwnProperty("amount"))
|
14105
14145
|
if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
|
14106
14146
|
return "amount: integer|Long expected";
|
14147
|
+
if (message.tokenAmount != null && message.hasOwnProperty("tokenAmount")) {
|
14148
|
+
if (!Array.isArray(message.tokenAmount))
|
14149
|
+
return "tokenAmount: array expected";
|
14150
|
+
for (var i = 0; i < message.tokenAmount.length; ++i) {
|
14151
|
+
var error = $root.TW.Cardano.Proto.TokenAmount.verify(message.tokenAmount[i]);
|
14152
|
+
if (error)
|
14153
|
+
return "tokenAmount." + error;
|
14154
|
+
}
|
14155
|
+
}
|
14107
14156
|
return null;
|
14108
14157
|
};
|
14109
14158
|
|
@@ -14130,6 +14179,16 @@
|
|
14130
14179
|
message.amount = object.amount;
|
14131
14180
|
else if (typeof object.amount === "object")
|
14132
14181
|
message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true);
|
14182
|
+
if (object.tokenAmount) {
|
14183
|
+
if (!Array.isArray(object.tokenAmount))
|
14184
|
+
throw TypeError(".TW.Cardano.Proto.TxOutput.tokenAmount: array expected");
|
14185
|
+
message.tokenAmount = [];
|
14186
|
+
for (var i = 0; i < object.tokenAmount.length; ++i) {
|
14187
|
+
if (typeof object.tokenAmount[i] !== "object")
|
14188
|
+
throw TypeError(".TW.Cardano.Proto.TxOutput.tokenAmount: object expected");
|
14189
|
+
message.tokenAmount[i] = $root.TW.Cardano.Proto.TokenAmount.fromObject(object.tokenAmount[i]);
|
14190
|
+
}
|
14191
|
+
}
|
14133
14192
|
return message;
|
14134
14193
|
};
|
14135
14194
|
|
@@ -14146,6 +14205,8 @@
|
|
14146
14205
|
if (!options)
|
14147
14206
|
options = {};
|
14148
14207
|
var object = {};
|
14208
|
+
if (options.arrays || options.defaults)
|
14209
|
+
object.tokenAmount = [];
|
14149
14210
|
if (options.defaults) {
|
14150
14211
|
object.address = "";
|
14151
14212
|
if ($util.Long) {
|
@@ -14161,6 +14222,11 @@
|
|
14161
14222
|
object.amount = options.longs === String ? String(message.amount) : message.amount;
|
14162
14223
|
else
|
14163
14224
|
object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount;
|
14225
|
+
if (message.tokenAmount && message.tokenAmount.length) {
|
14226
|
+
object.tokenAmount = [];
|
14227
|
+
for (var j = 0; j < message.tokenAmount.length; ++j)
|
14228
|
+
object.tokenAmount[j] = $root.TW.Cardano.Proto.TokenAmount.toObject(message.tokenAmount[j], options);
|
14229
|
+
}
|
14164
14230
|
return object;
|
14165
14231
|
};
|
14166
14232
|
|
@@ -14178,6 +14244,185 @@
|
|
14178
14244
|
return TxOutput;
|
14179
14245
|
})();
|
14180
14246
|
|
14247
|
+
Proto.TokenBundle = (function() {
|
14248
|
+
|
14249
|
+
/**
|
14250
|
+
* Properties of a TokenBundle.
|
14251
|
+
* @memberof TW.Cardano.Proto
|
14252
|
+
* @interface ITokenBundle
|
14253
|
+
* @property {Array.<TW.Cardano.Proto.ITokenAmount>|null} [token] TokenBundle token
|
14254
|
+
*/
|
14255
|
+
|
14256
|
+
/**
|
14257
|
+
* Constructs a new TokenBundle.
|
14258
|
+
* @memberof TW.Cardano.Proto
|
14259
|
+
* @classdesc Represents a TokenBundle.
|
14260
|
+
* @implements ITokenBundle
|
14261
|
+
* @constructor
|
14262
|
+
* @param {TW.Cardano.Proto.ITokenBundle=} [properties] Properties to set
|
14263
|
+
*/
|
14264
|
+
function TokenBundle(properties) {
|
14265
|
+
this.token = [];
|
14266
|
+
if (properties)
|
14267
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14268
|
+
if (properties[keys[i]] != null)
|
14269
|
+
this[keys[i]] = properties[keys[i]];
|
14270
|
+
}
|
14271
|
+
|
14272
|
+
/**
|
14273
|
+
* TokenBundle token.
|
14274
|
+
* @member {Array.<TW.Cardano.Proto.ITokenAmount>} token
|
14275
|
+
* @memberof TW.Cardano.Proto.TokenBundle
|
14276
|
+
* @instance
|
14277
|
+
*/
|
14278
|
+
TokenBundle.prototype.token = $util.emptyArray;
|
14279
|
+
|
14280
|
+
/**
|
14281
|
+
* Creates a new TokenBundle instance using the specified properties.
|
14282
|
+
* @function create
|
14283
|
+
* @memberof TW.Cardano.Proto.TokenBundle
|
14284
|
+
* @static
|
14285
|
+
* @param {TW.Cardano.Proto.ITokenBundle=} [properties] Properties to set
|
14286
|
+
* @returns {TW.Cardano.Proto.TokenBundle} TokenBundle instance
|
14287
|
+
*/
|
14288
|
+
TokenBundle.create = function create(properties) {
|
14289
|
+
return new TokenBundle(properties);
|
14290
|
+
};
|
14291
|
+
|
14292
|
+
/**
|
14293
|
+
* Encodes the specified TokenBundle message. Does not implicitly {@link TW.Cardano.Proto.TokenBundle.verify|verify} messages.
|
14294
|
+
* @function encode
|
14295
|
+
* @memberof TW.Cardano.Proto.TokenBundle
|
14296
|
+
* @static
|
14297
|
+
* @param {TW.Cardano.Proto.ITokenBundle} message TokenBundle message or plain object to encode
|
14298
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
14299
|
+
* @returns {$protobuf.Writer} Writer
|
14300
|
+
*/
|
14301
|
+
TokenBundle.encode = function encode(message, writer) {
|
14302
|
+
if (!writer)
|
14303
|
+
writer = $Writer.create();
|
14304
|
+
if (message.token != null && message.token.length)
|
14305
|
+
for (var i = 0; i < message.token.length; ++i)
|
14306
|
+
$root.TW.Cardano.Proto.TokenAmount.encode(message.token[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
14307
|
+
return writer;
|
14308
|
+
};
|
14309
|
+
|
14310
|
+
/**
|
14311
|
+
* Decodes a TokenBundle message from the specified reader or buffer.
|
14312
|
+
* @function decode
|
14313
|
+
* @memberof TW.Cardano.Proto.TokenBundle
|
14314
|
+
* @static
|
14315
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14316
|
+
* @param {number} [length] Message length if known beforehand
|
14317
|
+
* @returns {TW.Cardano.Proto.TokenBundle} TokenBundle
|
14318
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
14319
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14320
|
+
*/
|
14321
|
+
TokenBundle.decode = function decode(reader, length) {
|
14322
|
+
if (!(reader instanceof $Reader))
|
14323
|
+
reader = $Reader.create(reader);
|
14324
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Cardano.Proto.TokenBundle();
|
14325
|
+
while (reader.pos < end) {
|
14326
|
+
var tag = reader.uint32();
|
14327
|
+
switch (tag >>> 3) {
|
14328
|
+
case 1:
|
14329
|
+
if (!(message.token && message.token.length))
|
14330
|
+
message.token = [];
|
14331
|
+
message.token.push($root.TW.Cardano.Proto.TokenAmount.decode(reader, reader.uint32()));
|
14332
|
+
break;
|
14333
|
+
default:
|
14334
|
+
reader.skipType(tag & 7);
|
14335
|
+
break;
|
14336
|
+
}
|
14337
|
+
}
|
14338
|
+
return message;
|
14339
|
+
};
|
14340
|
+
|
14341
|
+
/**
|
14342
|
+
* Verifies a TokenBundle message.
|
14343
|
+
* @function verify
|
14344
|
+
* @memberof TW.Cardano.Proto.TokenBundle
|
14345
|
+
* @static
|
14346
|
+
* @param {Object.<string,*>} message Plain object to verify
|
14347
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
14348
|
+
*/
|
14349
|
+
TokenBundle.verify = function verify(message) {
|
14350
|
+
if (typeof message !== "object" || message === null)
|
14351
|
+
return "object expected";
|
14352
|
+
if (message.token != null && message.hasOwnProperty("token")) {
|
14353
|
+
if (!Array.isArray(message.token))
|
14354
|
+
return "token: array expected";
|
14355
|
+
for (var i = 0; i < message.token.length; ++i) {
|
14356
|
+
var error = $root.TW.Cardano.Proto.TokenAmount.verify(message.token[i]);
|
14357
|
+
if (error)
|
14358
|
+
return "token." + error;
|
14359
|
+
}
|
14360
|
+
}
|
14361
|
+
return null;
|
14362
|
+
};
|
14363
|
+
|
14364
|
+
/**
|
14365
|
+
* Creates a TokenBundle message from a plain object. Also converts values to their respective internal types.
|
14366
|
+
* @function fromObject
|
14367
|
+
* @memberof TW.Cardano.Proto.TokenBundle
|
14368
|
+
* @static
|
14369
|
+
* @param {Object.<string,*>} object Plain object
|
14370
|
+
* @returns {TW.Cardano.Proto.TokenBundle} TokenBundle
|
14371
|
+
*/
|
14372
|
+
TokenBundle.fromObject = function fromObject(object) {
|
14373
|
+
if (object instanceof $root.TW.Cardano.Proto.TokenBundle)
|
14374
|
+
return object;
|
14375
|
+
var message = new $root.TW.Cardano.Proto.TokenBundle();
|
14376
|
+
if (object.token) {
|
14377
|
+
if (!Array.isArray(object.token))
|
14378
|
+
throw TypeError(".TW.Cardano.Proto.TokenBundle.token: array expected");
|
14379
|
+
message.token = [];
|
14380
|
+
for (var i = 0; i < object.token.length; ++i) {
|
14381
|
+
if (typeof object.token[i] !== "object")
|
14382
|
+
throw TypeError(".TW.Cardano.Proto.TokenBundle.token: object expected");
|
14383
|
+
message.token[i] = $root.TW.Cardano.Proto.TokenAmount.fromObject(object.token[i]);
|
14384
|
+
}
|
14385
|
+
}
|
14386
|
+
return message;
|
14387
|
+
};
|
14388
|
+
|
14389
|
+
/**
|
14390
|
+
* Creates a plain object from a TokenBundle message. Also converts values to other types if specified.
|
14391
|
+
* @function toObject
|
14392
|
+
* @memberof TW.Cardano.Proto.TokenBundle
|
14393
|
+
* @static
|
14394
|
+
* @param {TW.Cardano.Proto.TokenBundle} message TokenBundle
|
14395
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
14396
|
+
* @returns {Object.<string,*>} Plain object
|
14397
|
+
*/
|
14398
|
+
TokenBundle.toObject = function toObject(message, options) {
|
14399
|
+
if (!options)
|
14400
|
+
options = {};
|
14401
|
+
var object = {};
|
14402
|
+
if (options.arrays || options.defaults)
|
14403
|
+
object.token = [];
|
14404
|
+
if (message.token && message.token.length) {
|
14405
|
+
object.token = [];
|
14406
|
+
for (var j = 0; j < message.token.length; ++j)
|
14407
|
+
object.token[j] = $root.TW.Cardano.Proto.TokenAmount.toObject(message.token[j], options);
|
14408
|
+
}
|
14409
|
+
return object;
|
14410
|
+
};
|
14411
|
+
|
14412
|
+
/**
|
14413
|
+
* Converts this TokenBundle to JSON.
|
14414
|
+
* @function toJSON
|
14415
|
+
* @memberof TW.Cardano.Proto.TokenBundle
|
14416
|
+
* @instance
|
14417
|
+
* @returns {Object.<string,*>} JSON object
|
14418
|
+
*/
|
14419
|
+
TokenBundle.prototype.toJSON = function toJSON() {
|
14420
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14421
|
+
};
|
14422
|
+
|
14423
|
+
return TokenBundle;
|
14424
|
+
})();
|
14425
|
+
|
14181
14426
|
Proto.Transfer = (function() {
|
14182
14427
|
|
14183
14428
|
/**
|
@@ -14187,7 +14432,9 @@
|
|
14187
14432
|
* @property {string|null} [toAddress] Transfer toAddress
|
14188
14433
|
* @property {string|null} [changeAddress] Transfer changeAddress
|
14189
14434
|
* @property {Long|null} [amount] Transfer amount
|
14435
|
+
* @property {TW.Cardano.Proto.ITokenBundle|null} [tokenAmount] Transfer tokenAmount
|
14190
14436
|
* @property {boolean|null} [useMaxAmount] Transfer useMaxAmount
|
14437
|
+
* @property {Long|null} [forceFee] Transfer forceFee
|
14191
14438
|
*/
|
14192
14439
|
|
14193
14440
|
/**
|
@@ -14229,6 +14476,14 @@
|
|
14229
14476
|
*/
|
14230
14477
|
Transfer.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
14231
14478
|
|
14479
|
+
/**
|
14480
|
+
* Transfer tokenAmount.
|
14481
|
+
* @member {TW.Cardano.Proto.ITokenBundle|null|undefined} tokenAmount
|
14482
|
+
* @memberof TW.Cardano.Proto.Transfer
|
14483
|
+
* @instance
|
14484
|
+
*/
|
14485
|
+
Transfer.prototype.tokenAmount = null;
|
14486
|
+
|
14232
14487
|
/**
|
14233
14488
|
* Transfer useMaxAmount.
|
14234
14489
|
* @member {boolean} useMaxAmount
|
@@ -14237,6 +14492,14 @@
|
|
14237
14492
|
*/
|
14238
14493
|
Transfer.prototype.useMaxAmount = false;
|
14239
14494
|
|
14495
|
+
/**
|
14496
|
+
* Transfer forceFee.
|
14497
|
+
* @member {Long} forceFee
|
14498
|
+
* @memberof TW.Cardano.Proto.Transfer
|
14499
|
+
* @instance
|
14500
|
+
*/
|
14501
|
+
Transfer.prototype.forceFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
14502
|
+
|
14240
14503
|
/**
|
14241
14504
|
* Creates a new Transfer instance using the specified properties.
|
14242
14505
|
* @function create
|
@@ -14267,8 +14530,12 @@
|
|
14267
14530
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.changeAddress);
|
14268
14531
|
if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
|
14269
14532
|
writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amount);
|
14533
|
+
if (message.tokenAmount != null && Object.hasOwnProperty.call(message, "tokenAmount"))
|
14534
|
+
$root.TW.Cardano.Proto.TokenBundle.encode(message.tokenAmount, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
14270
14535
|
if (message.useMaxAmount != null && Object.hasOwnProperty.call(message, "useMaxAmount"))
|
14271
|
-
writer.uint32(/* id
|
14536
|
+
writer.uint32(/* id 5, wireType 0 =*/40).bool(message.useMaxAmount);
|
14537
|
+
if (message.forceFee != null && Object.hasOwnProperty.call(message, "forceFee"))
|
14538
|
+
writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.forceFee);
|
14272
14539
|
return writer;
|
14273
14540
|
};
|
14274
14541
|
|
@@ -14300,8 +14567,14 @@
|
|
14300
14567
|
message.amount = reader.uint64();
|
14301
14568
|
break;
|
14302
14569
|
case 4:
|
14570
|
+
message.tokenAmount = $root.TW.Cardano.Proto.TokenBundle.decode(reader, reader.uint32());
|
14571
|
+
break;
|
14572
|
+
case 5:
|
14303
14573
|
message.useMaxAmount = reader.bool();
|
14304
14574
|
break;
|
14575
|
+
case 6:
|
14576
|
+
message.forceFee = reader.uint64();
|
14577
|
+
break;
|
14305
14578
|
default:
|
14306
14579
|
reader.skipType(tag & 7);
|
14307
14580
|
break;
|
@@ -14330,9 +14603,17 @@
|
|
14330
14603
|
if (message.amount != null && message.hasOwnProperty("amount"))
|
14331
14604
|
if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
|
14332
14605
|
return "amount: integer|Long expected";
|
14606
|
+
if (message.tokenAmount != null && message.hasOwnProperty("tokenAmount")) {
|
14607
|
+
var error = $root.TW.Cardano.Proto.TokenBundle.verify(message.tokenAmount);
|
14608
|
+
if (error)
|
14609
|
+
return "tokenAmount." + error;
|
14610
|
+
}
|
14333
14611
|
if (message.useMaxAmount != null && message.hasOwnProperty("useMaxAmount"))
|
14334
14612
|
if (typeof message.useMaxAmount !== "boolean")
|
14335
14613
|
return "useMaxAmount: boolean expected";
|
14614
|
+
if (message.forceFee != null && message.hasOwnProperty("forceFee"))
|
14615
|
+
if (!$util.isInteger(message.forceFee) && !(message.forceFee && $util.isInteger(message.forceFee.low) && $util.isInteger(message.forceFee.high)))
|
14616
|
+
return "forceFee: integer|Long expected";
|
14336
14617
|
return null;
|
14337
14618
|
};
|
14338
14619
|
|
@@ -14361,8 +14642,22 @@
|
|
14361
14642
|
message.amount = object.amount;
|
14362
14643
|
else if (typeof object.amount === "object")
|
14363
14644
|
message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true);
|
14645
|
+
if (object.tokenAmount != null) {
|
14646
|
+
if (typeof object.tokenAmount !== "object")
|
14647
|
+
throw TypeError(".TW.Cardano.Proto.Transfer.tokenAmount: object expected");
|
14648
|
+
message.tokenAmount = $root.TW.Cardano.Proto.TokenBundle.fromObject(object.tokenAmount);
|
14649
|
+
}
|
14364
14650
|
if (object.useMaxAmount != null)
|
14365
14651
|
message.useMaxAmount = Boolean(object.useMaxAmount);
|
14652
|
+
if (object.forceFee != null)
|
14653
|
+
if ($util.Long)
|
14654
|
+
(message.forceFee = $util.Long.fromValue(object.forceFee)).unsigned = true;
|
14655
|
+
else if (typeof object.forceFee === "string")
|
14656
|
+
message.forceFee = parseInt(object.forceFee, 10);
|
14657
|
+
else if (typeof object.forceFee === "number")
|
14658
|
+
message.forceFee = object.forceFee;
|
14659
|
+
else if (typeof object.forceFee === "object")
|
14660
|
+
message.forceFee = new $util.LongBits(object.forceFee.low >>> 0, object.forceFee.high >>> 0).toNumber(true);
|
14366
14661
|
return message;
|
14367
14662
|
};
|
14368
14663
|
|
@@ -14387,7 +14682,13 @@
|
|
14387
14682
|
object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
14388
14683
|
} else
|
14389
14684
|
object.amount = options.longs === String ? "0" : 0;
|
14685
|
+
object.tokenAmount = null;
|
14390
14686
|
object.useMaxAmount = false;
|
14687
|
+
if ($util.Long) {
|
14688
|
+
var long = new $util.Long(0, 0, true);
|
14689
|
+
object.forceFee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
14690
|
+
} else
|
14691
|
+
object.forceFee = options.longs === String ? "0" : 0;
|
14391
14692
|
}
|
14392
14693
|
if (message.toAddress != null && message.hasOwnProperty("toAddress"))
|
14393
14694
|
object.toAddress = message.toAddress;
|
@@ -14398,8 +14699,15 @@
|
|
14398
14699
|
object.amount = options.longs === String ? String(message.amount) : message.amount;
|
14399
14700
|
else
|
14400
14701
|
object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount;
|
14702
|
+
if (message.tokenAmount != null && message.hasOwnProperty("tokenAmount"))
|
14703
|
+
object.tokenAmount = $root.TW.Cardano.Proto.TokenBundle.toObject(message.tokenAmount, options);
|
14401
14704
|
if (message.useMaxAmount != null && message.hasOwnProperty("useMaxAmount"))
|
14402
14705
|
object.useMaxAmount = message.useMaxAmount;
|
14706
|
+
if (message.forceFee != null && message.hasOwnProperty("forceFee"))
|
14707
|
+
if (typeof message.forceFee === "number")
|
14708
|
+
object.forceFee = options.longs === String ? String(message.forceFee) : message.forceFee;
|
14709
|
+
else
|
14710
|
+
object.forceFee = options.longs === String ? $util.Long.prototype.toString.call(message.forceFee) : options.longs === Number ? new $util.LongBits(message.forceFee.low >>> 0, message.forceFee.high >>> 0).toNumber(true) : message.forceFee;
|
14403
14711
|
return object;
|
14404
14712
|
};
|
14405
14713
|
|
@@ -14423,10 +14731,13 @@
|
|
14423
14731
|
* Properties of a TransactionPlan.
|
14424
14732
|
* @memberof TW.Cardano.Proto
|
14425
14733
|
* @interface ITransactionPlan
|
14426
|
-
* @property {Long|null} [amount] TransactionPlan amount
|
14427
14734
|
* @property {Long|null} [availableAmount] TransactionPlan availableAmount
|
14735
|
+
* @property {Long|null} [amount] TransactionPlan amount
|
14428
14736
|
* @property {Long|null} [fee] TransactionPlan fee
|
14429
14737
|
* @property {Long|null} [change] TransactionPlan change
|
14738
|
+
* @property {Array.<TW.Cardano.Proto.ITokenAmount>|null} [availableTokens] TransactionPlan availableTokens
|
14739
|
+
* @property {Array.<TW.Cardano.Proto.ITokenAmount>|null} [outputTokens] TransactionPlan outputTokens
|
14740
|
+
* @property {Array.<TW.Cardano.Proto.ITokenAmount>|null} [changeTokens] TransactionPlan changeTokens
|
14430
14741
|
* @property {Array.<TW.Cardano.Proto.ITxInput>|null} [utxos] TransactionPlan utxos
|
14431
14742
|
* @property {TW.Common.Proto.SigningError|null} [error] TransactionPlan error
|
14432
14743
|
*/
|
@@ -14440,6 +14751,9 @@
|
|
14440
14751
|
* @param {TW.Cardano.Proto.ITransactionPlan=} [properties] Properties to set
|
14441
14752
|
*/
|
14442
14753
|
function TransactionPlan(properties) {
|
14754
|
+
this.availableTokens = [];
|
14755
|
+
this.outputTokens = [];
|
14756
|
+
this.changeTokens = [];
|
14443
14757
|
this.utxos = [];
|
14444
14758
|
if (properties)
|
14445
14759
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
@@ -14448,20 +14762,20 @@
|
|
14448
14762
|
}
|
14449
14763
|
|
14450
14764
|
/**
|
14451
|
-
* TransactionPlan
|
14452
|
-
* @member {Long}
|
14765
|
+
* TransactionPlan availableAmount.
|
14766
|
+
* @member {Long} availableAmount
|
14453
14767
|
* @memberof TW.Cardano.Proto.TransactionPlan
|
14454
14768
|
* @instance
|
14455
14769
|
*/
|
14456
|
-
TransactionPlan.prototype.
|
14770
|
+
TransactionPlan.prototype.availableAmount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
14457
14771
|
|
14458
14772
|
/**
|
14459
|
-
* TransactionPlan
|
14460
|
-
* @member {Long}
|
14773
|
+
* TransactionPlan amount.
|
14774
|
+
* @member {Long} amount
|
14461
14775
|
* @memberof TW.Cardano.Proto.TransactionPlan
|
14462
14776
|
* @instance
|
14463
14777
|
*/
|
14464
|
-
TransactionPlan.prototype.
|
14778
|
+
TransactionPlan.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
14465
14779
|
|
14466
14780
|
/**
|
14467
14781
|
* TransactionPlan fee.
|
@@ -14479,6 +14793,30 @@
|
|
14479
14793
|
*/
|
14480
14794
|
TransactionPlan.prototype.change = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
14481
14795
|
|
14796
|
+
/**
|
14797
|
+
* TransactionPlan availableTokens.
|
14798
|
+
* @member {Array.<TW.Cardano.Proto.ITokenAmount>} availableTokens
|
14799
|
+
* @memberof TW.Cardano.Proto.TransactionPlan
|
14800
|
+
* @instance
|
14801
|
+
*/
|
14802
|
+
TransactionPlan.prototype.availableTokens = $util.emptyArray;
|
14803
|
+
|
14804
|
+
/**
|
14805
|
+
* TransactionPlan outputTokens.
|
14806
|
+
* @member {Array.<TW.Cardano.Proto.ITokenAmount>} outputTokens
|
14807
|
+
* @memberof TW.Cardano.Proto.TransactionPlan
|
14808
|
+
* @instance
|
14809
|
+
*/
|
14810
|
+
TransactionPlan.prototype.outputTokens = $util.emptyArray;
|
14811
|
+
|
14812
|
+
/**
|
14813
|
+
* TransactionPlan changeTokens.
|
14814
|
+
* @member {Array.<TW.Cardano.Proto.ITokenAmount>} changeTokens
|
14815
|
+
* @memberof TW.Cardano.Proto.TransactionPlan
|
14816
|
+
* @instance
|
14817
|
+
*/
|
14818
|
+
TransactionPlan.prototype.changeTokens = $util.emptyArray;
|
14819
|
+
|
14482
14820
|
/**
|
14483
14821
|
* TransactionPlan utxos.
|
14484
14822
|
* @member {Array.<TW.Cardano.Proto.ITxInput>} utxos
|
@@ -14519,19 +14857,28 @@
|
|
14519
14857
|
TransactionPlan.encode = function encode(message, writer) {
|
14520
14858
|
if (!writer)
|
14521
14859
|
writer = $Writer.create();
|
14522
|
-
if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
|
14523
|
-
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount);
|
14524
14860
|
if (message.availableAmount != null && Object.hasOwnProperty.call(message, "availableAmount"))
|
14525
|
-
writer.uint32(/* id
|
14861
|
+
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.availableAmount);
|
14862
|
+
if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
|
14863
|
+
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount);
|
14526
14864
|
if (message.fee != null && Object.hasOwnProperty.call(message, "fee"))
|
14527
14865
|
writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.fee);
|
14528
14866
|
if (message.change != null && Object.hasOwnProperty.call(message, "change"))
|
14529
14867
|
writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.change);
|
14868
|
+
if (message.availableTokens != null && message.availableTokens.length)
|
14869
|
+
for (var i = 0; i < message.availableTokens.length; ++i)
|
14870
|
+
$root.TW.Cardano.Proto.TokenAmount.encode(message.availableTokens[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
14871
|
+
if (message.outputTokens != null && message.outputTokens.length)
|
14872
|
+
for (var i = 0; i < message.outputTokens.length; ++i)
|
14873
|
+
$root.TW.Cardano.Proto.TokenAmount.encode(message.outputTokens[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
14874
|
+
if (message.changeTokens != null && message.changeTokens.length)
|
14875
|
+
for (var i = 0; i < message.changeTokens.length; ++i)
|
14876
|
+
$root.TW.Cardano.Proto.TokenAmount.encode(message.changeTokens[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
14530
14877
|
if (message.utxos != null && message.utxos.length)
|
14531
14878
|
for (var i = 0; i < message.utxos.length; ++i)
|
14532
|
-
$root.TW.Cardano.Proto.TxInput.encode(message.utxos[i], writer.uint32(/* id
|
14879
|
+
$root.TW.Cardano.Proto.TxInput.encode(message.utxos[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
14533
14880
|
if (message.error != null && Object.hasOwnProperty.call(message, "error"))
|
14534
|
-
writer.uint32(/* id
|
14881
|
+
writer.uint32(/* id 9, wireType 0 =*/72).int32(message.error);
|
14535
14882
|
return writer;
|
14536
14883
|
};
|
14537
14884
|
|
@@ -14554,10 +14901,10 @@
|
|
14554
14901
|
var tag = reader.uint32();
|
14555
14902
|
switch (tag >>> 3) {
|
14556
14903
|
case 1:
|
14557
|
-
message.
|
14904
|
+
message.availableAmount = reader.uint64();
|
14558
14905
|
break;
|
14559
14906
|
case 2:
|
14560
|
-
message.
|
14907
|
+
message.amount = reader.uint64();
|
14561
14908
|
break;
|
14562
14909
|
case 3:
|
14563
14910
|
message.fee = reader.uint64();
|
@@ -14566,11 +14913,26 @@
|
|
14566
14913
|
message.change = reader.uint64();
|
14567
14914
|
break;
|
14568
14915
|
case 5:
|
14916
|
+
if (!(message.availableTokens && message.availableTokens.length))
|
14917
|
+
message.availableTokens = [];
|
14918
|
+
message.availableTokens.push($root.TW.Cardano.Proto.TokenAmount.decode(reader, reader.uint32()));
|
14919
|
+
break;
|
14920
|
+
case 6:
|
14921
|
+
if (!(message.outputTokens && message.outputTokens.length))
|
14922
|
+
message.outputTokens = [];
|
14923
|
+
message.outputTokens.push($root.TW.Cardano.Proto.TokenAmount.decode(reader, reader.uint32()));
|
14924
|
+
break;
|
14925
|
+
case 7:
|
14926
|
+
if (!(message.changeTokens && message.changeTokens.length))
|
14927
|
+
message.changeTokens = [];
|
14928
|
+
message.changeTokens.push($root.TW.Cardano.Proto.TokenAmount.decode(reader, reader.uint32()));
|
14929
|
+
break;
|
14930
|
+
case 8:
|
14569
14931
|
if (!(message.utxos && message.utxos.length))
|
14570
14932
|
message.utxos = [];
|
14571
14933
|
message.utxos.push($root.TW.Cardano.Proto.TxInput.decode(reader, reader.uint32()));
|
14572
14934
|
break;
|
14573
|
-
case
|
14935
|
+
case 9:
|
14574
14936
|
message.error = reader.int32();
|
14575
14937
|
break;
|
14576
14938
|
default:
|
@@ -14592,18 +14954,45 @@
|
|
14592
14954
|
TransactionPlan.verify = function verify(message) {
|
14593
14955
|
if (typeof message !== "object" || message === null)
|
14594
14956
|
return "object expected";
|
14595
|
-
if (message.amount != null && message.hasOwnProperty("amount"))
|
14596
|
-
if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
|
14597
|
-
return "amount: integer|Long expected";
|
14598
14957
|
if (message.availableAmount != null && message.hasOwnProperty("availableAmount"))
|
14599
14958
|
if (!$util.isInteger(message.availableAmount) && !(message.availableAmount && $util.isInteger(message.availableAmount.low) && $util.isInteger(message.availableAmount.high)))
|
14600
14959
|
return "availableAmount: integer|Long expected";
|
14960
|
+
if (message.amount != null && message.hasOwnProperty("amount"))
|
14961
|
+
if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
|
14962
|
+
return "amount: integer|Long expected";
|
14601
14963
|
if (message.fee != null && message.hasOwnProperty("fee"))
|
14602
14964
|
if (!$util.isInteger(message.fee) && !(message.fee && $util.isInteger(message.fee.low) && $util.isInteger(message.fee.high)))
|
14603
14965
|
return "fee: integer|Long expected";
|
14604
14966
|
if (message.change != null && message.hasOwnProperty("change"))
|
14605
14967
|
if (!$util.isInteger(message.change) && !(message.change && $util.isInteger(message.change.low) && $util.isInteger(message.change.high)))
|
14606
14968
|
return "change: integer|Long expected";
|
14969
|
+
if (message.availableTokens != null && message.hasOwnProperty("availableTokens")) {
|
14970
|
+
if (!Array.isArray(message.availableTokens))
|
14971
|
+
return "availableTokens: array expected";
|
14972
|
+
for (var i = 0; i < message.availableTokens.length; ++i) {
|
14973
|
+
var error = $root.TW.Cardano.Proto.TokenAmount.verify(message.availableTokens[i]);
|
14974
|
+
if (error)
|
14975
|
+
return "availableTokens." + error;
|
14976
|
+
}
|
14977
|
+
}
|
14978
|
+
if (message.outputTokens != null && message.hasOwnProperty("outputTokens")) {
|
14979
|
+
if (!Array.isArray(message.outputTokens))
|
14980
|
+
return "outputTokens: array expected";
|
14981
|
+
for (var i = 0; i < message.outputTokens.length; ++i) {
|
14982
|
+
var error = $root.TW.Cardano.Proto.TokenAmount.verify(message.outputTokens[i]);
|
14983
|
+
if (error)
|
14984
|
+
return "outputTokens." + error;
|
14985
|
+
}
|
14986
|
+
}
|
14987
|
+
if (message.changeTokens != null && message.hasOwnProperty("changeTokens")) {
|
14988
|
+
if (!Array.isArray(message.changeTokens))
|
14989
|
+
return "changeTokens: array expected";
|
14990
|
+
for (var i = 0; i < message.changeTokens.length; ++i) {
|
14991
|
+
var error = $root.TW.Cardano.Proto.TokenAmount.verify(message.changeTokens[i]);
|
14992
|
+
if (error)
|
14993
|
+
return "changeTokens." + error;
|
14994
|
+
}
|
14995
|
+
}
|
14607
14996
|
if (message.utxos != null && message.hasOwnProperty("utxos")) {
|
14608
14997
|
if (!Array.isArray(message.utxos))
|
14609
14998
|
return "utxos: array expected";
|
@@ -14640,6 +15029,7 @@
|
|
14640
15029
|
case 20:
|
14641
15030
|
case 21:
|
14642
15031
|
case 22:
|
15032
|
+
case 23:
|
14643
15033
|
break;
|
14644
15034
|
}
|
14645
15035
|
return null;
|
@@ -14657,15 +15047,6 @@
|
|
14657
15047
|
if (object instanceof $root.TW.Cardano.Proto.TransactionPlan)
|
14658
15048
|
return object;
|
14659
15049
|
var message = new $root.TW.Cardano.Proto.TransactionPlan();
|
14660
|
-
if (object.amount != null)
|
14661
|
-
if ($util.Long)
|
14662
|
-
(message.amount = $util.Long.fromValue(object.amount)).unsigned = true;
|
14663
|
-
else if (typeof object.amount === "string")
|
14664
|
-
message.amount = parseInt(object.amount, 10);
|
14665
|
-
else if (typeof object.amount === "number")
|
14666
|
-
message.amount = object.amount;
|
14667
|
-
else if (typeof object.amount === "object")
|
14668
|
-
message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true);
|
14669
15050
|
if (object.availableAmount != null)
|
14670
15051
|
if ($util.Long)
|
14671
15052
|
(message.availableAmount = $util.Long.fromValue(object.availableAmount)).unsigned = true;
|
@@ -14675,6 +15056,15 @@
|
|
14675
15056
|
message.availableAmount = object.availableAmount;
|
14676
15057
|
else if (typeof object.availableAmount === "object")
|
14677
15058
|
message.availableAmount = new $util.LongBits(object.availableAmount.low >>> 0, object.availableAmount.high >>> 0).toNumber(true);
|
15059
|
+
if (object.amount != null)
|
15060
|
+
if ($util.Long)
|
15061
|
+
(message.amount = $util.Long.fromValue(object.amount)).unsigned = true;
|
15062
|
+
else if (typeof object.amount === "string")
|
15063
|
+
message.amount = parseInt(object.amount, 10);
|
15064
|
+
else if (typeof object.amount === "number")
|
15065
|
+
message.amount = object.amount;
|
15066
|
+
else if (typeof object.amount === "object")
|
15067
|
+
message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true);
|
14678
15068
|
if (object.fee != null)
|
14679
15069
|
if ($util.Long)
|
14680
15070
|
(message.fee = $util.Long.fromValue(object.fee)).unsigned = true;
|
@@ -14693,6 +15083,36 @@
|
|
14693
15083
|
message.change = object.change;
|
14694
15084
|
else if (typeof object.change === "object")
|
14695
15085
|
message.change = new $util.LongBits(object.change.low >>> 0, object.change.high >>> 0).toNumber(true);
|
15086
|
+
if (object.availableTokens) {
|
15087
|
+
if (!Array.isArray(object.availableTokens))
|
15088
|
+
throw TypeError(".TW.Cardano.Proto.TransactionPlan.availableTokens: array expected");
|
15089
|
+
message.availableTokens = [];
|
15090
|
+
for (var i = 0; i < object.availableTokens.length; ++i) {
|
15091
|
+
if (typeof object.availableTokens[i] !== "object")
|
15092
|
+
throw TypeError(".TW.Cardano.Proto.TransactionPlan.availableTokens: object expected");
|
15093
|
+
message.availableTokens[i] = $root.TW.Cardano.Proto.TokenAmount.fromObject(object.availableTokens[i]);
|
15094
|
+
}
|
15095
|
+
}
|
15096
|
+
if (object.outputTokens) {
|
15097
|
+
if (!Array.isArray(object.outputTokens))
|
15098
|
+
throw TypeError(".TW.Cardano.Proto.TransactionPlan.outputTokens: array expected");
|
15099
|
+
message.outputTokens = [];
|
15100
|
+
for (var i = 0; i < object.outputTokens.length; ++i) {
|
15101
|
+
if (typeof object.outputTokens[i] !== "object")
|
15102
|
+
throw TypeError(".TW.Cardano.Proto.TransactionPlan.outputTokens: object expected");
|
15103
|
+
message.outputTokens[i] = $root.TW.Cardano.Proto.TokenAmount.fromObject(object.outputTokens[i]);
|
15104
|
+
}
|
15105
|
+
}
|
15106
|
+
if (object.changeTokens) {
|
15107
|
+
if (!Array.isArray(object.changeTokens))
|
15108
|
+
throw TypeError(".TW.Cardano.Proto.TransactionPlan.changeTokens: array expected");
|
15109
|
+
message.changeTokens = [];
|
15110
|
+
for (var i = 0; i < object.changeTokens.length; ++i) {
|
15111
|
+
if (typeof object.changeTokens[i] !== "object")
|
15112
|
+
throw TypeError(".TW.Cardano.Proto.TransactionPlan.changeTokens: object expected");
|
15113
|
+
message.changeTokens[i] = $root.TW.Cardano.Proto.TokenAmount.fromObject(object.changeTokens[i]);
|
15114
|
+
}
|
15115
|
+
}
|
14696
15116
|
if (object.utxos) {
|
14697
15117
|
if (!Array.isArray(object.utxos))
|
14698
15118
|
throw TypeError(".TW.Cardano.Proto.TransactionPlan.utxos: array expected");
|
@@ -14796,6 +15216,10 @@
|
|
14796
15216
|
case 22:
|
14797
15217
|
message.error = 22;
|
14798
15218
|
break;
|
15219
|
+
case "Error_invalid_requested_token_amount":
|
15220
|
+
case 23:
|
15221
|
+
message.error = 23;
|
15222
|
+
break;
|
14799
15223
|
}
|
14800
15224
|
return message;
|
14801
15225
|
};
|
@@ -14813,19 +15237,23 @@
|
|
14813
15237
|
if (!options)
|
14814
15238
|
options = {};
|
14815
15239
|
var object = {};
|
14816
|
-
if (options.arrays || options.defaults)
|
15240
|
+
if (options.arrays || options.defaults) {
|
15241
|
+
object.availableTokens = [];
|
15242
|
+
object.outputTokens = [];
|
15243
|
+
object.changeTokens = [];
|
14817
15244
|
object.utxos = [];
|
15245
|
+
}
|
14818
15246
|
if (options.defaults) {
|
14819
15247
|
if ($util.Long) {
|
14820
15248
|
var long = new $util.Long(0, 0, true);
|
14821
|
-
object.
|
15249
|
+
object.availableAmount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
14822
15250
|
} else
|
14823
|
-
object.
|
15251
|
+
object.availableAmount = options.longs === String ? "0" : 0;
|
14824
15252
|
if ($util.Long) {
|
14825
15253
|
var long = new $util.Long(0, 0, true);
|
14826
|
-
object.
|
15254
|
+
object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
14827
15255
|
} else
|
14828
|
-
object.
|
15256
|
+
object.amount = options.longs === String ? "0" : 0;
|
14829
15257
|
if ($util.Long) {
|
14830
15258
|
var long = new $util.Long(0, 0, true);
|
14831
15259
|
object.fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
@@ -14838,16 +15266,16 @@
|
|
14838
15266
|
object.change = options.longs === String ? "0" : 0;
|
14839
15267
|
object.error = options.enums === String ? "OK" : 0;
|
14840
15268
|
}
|
14841
|
-
if (message.amount != null && message.hasOwnProperty("amount"))
|
14842
|
-
if (typeof message.amount === "number")
|
14843
|
-
object.amount = options.longs === String ? String(message.amount) : message.amount;
|
14844
|
-
else
|
14845
|
-
object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount;
|
14846
15269
|
if (message.availableAmount != null && message.hasOwnProperty("availableAmount"))
|
14847
15270
|
if (typeof message.availableAmount === "number")
|
14848
15271
|
object.availableAmount = options.longs === String ? String(message.availableAmount) : message.availableAmount;
|
14849
15272
|
else
|
14850
15273
|
object.availableAmount = options.longs === String ? $util.Long.prototype.toString.call(message.availableAmount) : options.longs === Number ? new $util.LongBits(message.availableAmount.low >>> 0, message.availableAmount.high >>> 0).toNumber(true) : message.availableAmount;
|
15274
|
+
if (message.amount != null && message.hasOwnProperty("amount"))
|
15275
|
+
if (typeof message.amount === "number")
|
15276
|
+
object.amount = options.longs === String ? String(message.amount) : message.amount;
|
15277
|
+
else
|
15278
|
+
object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount;
|
14851
15279
|
if (message.fee != null && message.hasOwnProperty("fee"))
|
14852
15280
|
if (typeof message.fee === "number")
|
14853
15281
|
object.fee = options.longs === String ? String(message.fee) : message.fee;
|
@@ -14858,6 +15286,21 @@
|
|
14858
15286
|
object.change = options.longs === String ? String(message.change) : message.change;
|
14859
15287
|
else
|
14860
15288
|
object.change = options.longs === String ? $util.Long.prototype.toString.call(message.change) : options.longs === Number ? new $util.LongBits(message.change.low >>> 0, message.change.high >>> 0).toNumber(true) : message.change;
|
15289
|
+
if (message.availableTokens && message.availableTokens.length) {
|
15290
|
+
object.availableTokens = [];
|
15291
|
+
for (var j = 0; j < message.availableTokens.length; ++j)
|
15292
|
+
object.availableTokens[j] = $root.TW.Cardano.Proto.TokenAmount.toObject(message.availableTokens[j], options);
|
15293
|
+
}
|
15294
|
+
if (message.outputTokens && message.outputTokens.length) {
|
15295
|
+
object.outputTokens = [];
|
15296
|
+
for (var j = 0; j < message.outputTokens.length; ++j)
|
15297
|
+
object.outputTokens[j] = $root.TW.Cardano.Proto.TokenAmount.toObject(message.outputTokens[j], options);
|
15298
|
+
}
|
15299
|
+
if (message.changeTokens && message.changeTokens.length) {
|
15300
|
+
object.changeTokens = [];
|
15301
|
+
for (var j = 0; j < message.changeTokens.length; ++j)
|
15302
|
+
object.changeTokens[j] = $root.TW.Cardano.Proto.TokenAmount.toObject(message.changeTokens[j], options);
|
15303
|
+
}
|
14861
15304
|
if (message.utxos && message.utxos.length) {
|
14862
15305
|
object.utxos = [];
|
14863
15306
|
for (var j = 0; j < message.utxos.length; ++j)
|
@@ -15357,6 +15800,7 @@
|
|
15357
15800
|
case 20:
|
15358
15801
|
case 21:
|
15359
15802
|
case 22:
|
15803
|
+
case 23:
|
15360
15804
|
break;
|
15361
15805
|
}
|
15362
15806
|
return null;
|
@@ -15477,6 +15921,10 @@
|
|
15477
15921
|
case 22:
|
15478
15922
|
message.error = 22;
|
15479
15923
|
break;
|
15924
|
+
case "Error_invalid_requested_token_amount":
|
15925
|
+
case 23:
|
15926
|
+
message.error = 23;
|
15927
|
+
break;
|
15480
15928
|
}
|
15481
15929
|
return message;
|
15482
15930
|
};
|
@@ -21098,6 +21546,7 @@
|
|
21098
21546
|
case 20:
|
21099
21547
|
case 21:
|
21100
21548
|
case 22:
|
21549
|
+
case 23:
|
21101
21550
|
break;
|
21102
21551
|
}
|
21103
21552
|
return null;
|
@@ -21220,6 +21669,10 @@
|
|
21220
21669
|
case 22:
|
21221
21670
|
message.error = 22;
|
21222
21671
|
break;
|
21672
|
+
case "Error_invalid_requested_token_amount":
|
21673
|
+
case 23:
|
21674
|
+
message.error = 23;
|
21675
|
+
break;
|
21223
21676
|
}
|
21224
21677
|
return message;
|
21225
21678
|
};
|
@@ -23850,6 +24303,7 @@
|
|
23850
24303
|
case 20:
|
23851
24304
|
case 21:
|
23852
24305
|
case 22:
|
24306
|
+
case 23:
|
23853
24307
|
break;
|
23854
24308
|
}
|
23855
24309
|
return null;
|
@@ -23962,6 +24416,10 @@
|
|
23962
24416
|
case 22:
|
23963
24417
|
message.error = 22;
|
23964
24418
|
break;
|
24419
|
+
case "Error_invalid_requested_token_amount":
|
24420
|
+
case 23:
|
24421
|
+
message.error = 23;
|
24422
|
+
break;
|
23965
24423
|
}
|
23966
24424
|
return message;
|
23967
24425
|
};
|
@@ -26323,6 +26781,7 @@
|
|
26323
26781
|
case 20:
|
26324
26782
|
case 21:
|
26325
26783
|
case 22:
|
26784
|
+
case 23:
|
26326
26785
|
break;
|
26327
26786
|
}
|
26328
26787
|
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
@@ -26461,6 +26920,10 @@
|
|
26461
26920
|
case 22:
|
26462
26921
|
message.error = 22;
|
26463
26922
|
break;
|
26923
|
+
case "Error_invalid_requested_token_amount":
|
26924
|
+
case 23:
|
26925
|
+
message.error = 23;
|
26926
|
+
break;
|
26464
26927
|
}
|
26465
26928
|
if (object.errorMessage != null)
|
26466
26929
|
message.errorMessage = String(object.errorMessage);
|
@@ -29700,6 +30163,7 @@
|
|
29700
30163
|
case 20:
|
29701
30164
|
case 21:
|
29702
30165
|
case 22:
|
30166
|
+
case 23:
|
29703
30167
|
break;
|
29704
30168
|
}
|
29705
30169
|
return null;
|
@@ -29812,6 +30276,10 @@
|
|
29812
30276
|
case 22:
|
29813
30277
|
message.error = 22;
|
29814
30278
|
break;
|
30279
|
+
case "Error_invalid_requested_token_amount":
|
30280
|
+
case 23:
|
30281
|
+
message.error = 23;
|
30282
|
+
break;
|
29815
30283
|
}
|
29816
30284
|
return message;
|
29817
30285
|
};
|
@@ -44405,6 +44873,7 @@
|
|
44405
44873
|
case 20:
|
44406
44874
|
case 21:
|
44407
44875
|
case 22:
|
44876
|
+
case 23:
|
44408
44877
|
break;
|
44409
44878
|
}
|
44410
44879
|
return null;
|
@@ -44520,6 +44989,10 @@
|
|
44520
44989
|
case 22:
|
44521
44990
|
message.error = 22;
|
44522
44991
|
break;
|
44992
|
+
case "Error_invalid_requested_token_amount":
|
44993
|
+
case 23:
|
44994
|
+
message.error = 23;
|
44995
|
+
break;
|
44523
44996
|
}
|
44524
44997
|
return message;
|
44525
44998
|
};
|
@@ -45078,6 +45551,7 @@
|
|
45078
45551
|
case 20:
|
45079
45552
|
case 21:
|
45080
45553
|
case 22:
|
45554
|
+
case 23:
|
45081
45555
|
break;
|
45082
45556
|
}
|
45083
45557
|
return null;
|
@@ -45217,6 +45691,10 @@
|
|
45217
45691
|
case 22:
|
45218
45692
|
message.error = 22;
|
45219
45693
|
break;
|
45694
|
+
case "Error_invalid_requested_token_amount":
|
45695
|
+
case 23:
|
45696
|
+
message.error = 23;
|
45697
|
+
break;
|
45220
45698
|
}
|
45221
45699
|
return message;
|
45222
45700
|
};
|
@@ -49420,6 +49898,7 @@
|
|
49420
49898
|
* @property {TW.Polkadot.Proto.Staking.IWithdrawUnbonded|null} [withdrawUnbonded] Staking withdrawUnbonded
|
49421
49899
|
* @property {TW.Polkadot.Proto.Staking.INominate|null} [nominate] Staking nominate
|
49422
49900
|
* @property {TW.Polkadot.Proto.Staking.IChill|null} [chill] Staking chill
|
49901
|
+
* @property {TW.Polkadot.Proto.Staking.IChillAndUnbond|null} [chillAndUnbond] Staking chillAndUnbond
|
49423
49902
|
*/
|
49424
49903
|
|
49425
49904
|
/**
|
@@ -49493,17 +49972,25 @@
|
|
49493
49972
|
*/
|
49494
49973
|
Staking.prototype.chill = null;
|
49495
49974
|
|
49975
|
+
/**
|
49976
|
+
* Staking chillAndUnbond.
|
49977
|
+
* @member {TW.Polkadot.Proto.Staking.IChillAndUnbond|null|undefined} chillAndUnbond
|
49978
|
+
* @memberof TW.Polkadot.Proto.Staking
|
49979
|
+
* @instance
|
49980
|
+
*/
|
49981
|
+
Staking.prototype.chillAndUnbond = null;
|
49982
|
+
|
49496
49983
|
// OneOf field names bound to virtual getters and setters
|
49497
49984
|
var $oneOfFields;
|
49498
49985
|
|
49499
49986
|
/**
|
49500
49987
|
* Staking messageOneof.
|
49501
|
-
* @member {"bond"|"bondAndNominate"|"bondExtra"|"unbond"|"withdrawUnbonded"|"nominate"|"chill"|undefined} messageOneof
|
49988
|
+
* @member {"bond"|"bondAndNominate"|"bondExtra"|"unbond"|"withdrawUnbonded"|"nominate"|"chill"|"chillAndUnbond"|undefined} messageOneof
|
49502
49989
|
* @memberof TW.Polkadot.Proto.Staking
|
49503
49990
|
* @instance
|
49504
49991
|
*/
|
49505
49992
|
Object.defineProperty(Staking.prototype, "messageOneof", {
|
49506
|
-
get: $util.oneOfGetter($oneOfFields = ["bond", "bondAndNominate", "bondExtra", "unbond", "withdrawUnbonded", "nominate", "chill"]),
|
49993
|
+
get: $util.oneOfGetter($oneOfFields = ["bond", "bondAndNominate", "bondExtra", "unbond", "withdrawUnbonded", "nominate", "chill", "chillAndUnbond"]),
|
49507
49994
|
set: $util.oneOfSetter($oneOfFields)
|
49508
49995
|
});
|
49509
49996
|
|
@@ -49545,6 +50032,8 @@
|
|
49545
50032
|
$root.TW.Polkadot.Proto.Staking.Nominate.encode(message.nominate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
49546
50033
|
if (message.chill != null && Object.hasOwnProperty.call(message, "chill"))
|
49547
50034
|
$root.TW.Polkadot.Proto.Staking.Chill.encode(message.chill, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
50035
|
+
if (message.chillAndUnbond != null && Object.hasOwnProperty.call(message, "chillAndUnbond"))
|
50036
|
+
$root.TW.Polkadot.Proto.Staking.ChillAndUnbond.encode(message.chillAndUnbond, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
49548
50037
|
return writer;
|
49549
50038
|
};
|
49550
50039
|
|
@@ -49587,6 +50076,9 @@
|
|
49587
50076
|
case 7:
|
49588
50077
|
message.chill = $root.TW.Polkadot.Proto.Staking.Chill.decode(reader, reader.uint32());
|
49589
50078
|
break;
|
50079
|
+
case 8:
|
50080
|
+
message.chillAndUnbond = $root.TW.Polkadot.Proto.Staking.ChillAndUnbond.decode(reader, reader.uint32());
|
50081
|
+
break;
|
49590
50082
|
default:
|
49591
50083
|
reader.skipType(tag & 7);
|
49592
50084
|
break;
|
@@ -49675,6 +50167,16 @@
|
|
49675
50167
|
return "chill." + error;
|
49676
50168
|
}
|
49677
50169
|
}
|
50170
|
+
if (message.chillAndUnbond != null && message.hasOwnProperty("chillAndUnbond")) {
|
50171
|
+
if (properties.messageOneof === 1)
|
50172
|
+
return "messageOneof: multiple values";
|
50173
|
+
properties.messageOneof = 1;
|
50174
|
+
{
|
50175
|
+
var error = $root.TW.Polkadot.Proto.Staking.ChillAndUnbond.verify(message.chillAndUnbond);
|
50176
|
+
if (error)
|
50177
|
+
return "chillAndUnbond." + error;
|
50178
|
+
}
|
50179
|
+
}
|
49678
50180
|
return null;
|
49679
50181
|
};
|
49680
50182
|
|
@@ -49725,6 +50227,11 @@
|
|
49725
50227
|
throw TypeError(".TW.Polkadot.Proto.Staking.chill: object expected");
|
49726
50228
|
message.chill = $root.TW.Polkadot.Proto.Staking.Chill.fromObject(object.chill);
|
49727
50229
|
}
|
50230
|
+
if (object.chillAndUnbond != null) {
|
50231
|
+
if (typeof object.chillAndUnbond !== "object")
|
50232
|
+
throw TypeError(".TW.Polkadot.Proto.Staking.chillAndUnbond: object expected");
|
50233
|
+
message.chillAndUnbond = $root.TW.Polkadot.Proto.Staking.ChillAndUnbond.fromObject(object.chillAndUnbond);
|
50234
|
+
}
|
49728
50235
|
return message;
|
49729
50236
|
};
|
49730
50237
|
|
@@ -49776,6 +50283,11 @@
|
|
49776
50283
|
if (options.oneofs)
|
49777
50284
|
object.messageOneof = "chill";
|
49778
50285
|
}
|
50286
|
+
if (message.chillAndUnbond != null && message.hasOwnProperty("chillAndUnbond")) {
|
50287
|
+
object.chillAndUnbond = $root.TW.Polkadot.Proto.Staking.ChillAndUnbond.toObject(message.chillAndUnbond, options);
|
50288
|
+
if (options.oneofs)
|
50289
|
+
object.messageOneof = "chillAndUnbond";
|
50290
|
+
}
|
49779
50291
|
return object;
|
49780
50292
|
};
|
49781
50293
|
|
@@ -50955,6 +51467,173 @@
|
|
50955
51467
|
return Nominate;
|
50956
51468
|
})();
|
50957
51469
|
|
51470
|
+
Staking.ChillAndUnbond = (function() {
|
51471
|
+
|
51472
|
+
/**
|
51473
|
+
* Properties of a ChillAndUnbond.
|
51474
|
+
* @memberof TW.Polkadot.Proto.Staking
|
51475
|
+
* @interface IChillAndUnbond
|
51476
|
+
* @property {Uint8Array|null} [value] ChillAndUnbond value
|
51477
|
+
*/
|
51478
|
+
|
51479
|
+
/**
|
51480
|
+
* Constructs a new ChillAndUnbond.
|
51481
|
+
* @memberof TW.Polkadot.Proto.Staking
|
51482
|
+
* @classdesc Represents a ChillAndUnbond.
|
51483
|
+
* @implements IChillAndUnbond
|
51484
|
+
* @constructor
|
51485
|
+
* @param {TW.Polkadot.Proto.Staking.IChillAndUnbond=} [properties] Properties to set
|
51486
|
+
*/
|
51487
|
+
function ChillAndUnbond(properties) {
|
51488
|
+
if (properties)
|
51489
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
51490
|
+
if (properties[keys[i]] != null)
|
51491
|
+
this[keys[i]] = properties[keys[i]];
|
51492
|
+
}
|
51493
|
+
|
51494
|
+
/**
|
51495
|
+
* ChillAndUnbond value.
|
51496
|
+
* @member {Uint8Array} value
|
51497
|
+
* @memberof TW.Polkadot.Proto.Staking.ChillAndUnbond
|
51498
|
+
* @instance
|
51499
|
+
*/
|
51500
|
+
ChillAndUnbond.prototype.value = $util.newBuffer([]);
|
51501
|
+
|
51502
|
+
/**
|
51503
|
+
* Creates a new ChillAndUnbond instance using the specified properties.
|
51504
|
+
* @function create
|
51505
|
+
* @memberof TW.Polkadot.Proto.Staking.ChillAndUnbond
|
51506
|
+
* @static
|
51507
|
+
* @param {TW.Polkadot.Proto.Staking.IChillAndUnbond=} [properties] Properties to set
|
51508
|
+
* @returns {TW.Polkadot.Proto.Staking.ChillAndUnbond} ChillAndUnbond instance
|
51509
|
+
*/
|
51510
|
+
ChillAndUnbond.create = function create(properties) {
|
51511
|
+
return new ChillAndUnbond(properties);
|
51512
|
+
};
|
51513
|
+
|
51514
|
+
/**
|
51515
|
+
* Encodes the specified ChillAndUnbond message. Does not implicitly {@link TW.Polkadot.Proto.Staking.ChillAndUnbond.verify|verify} messages.
|
51516
|
+
* @function encode
|
51517
|
+
* @memberof TW.Polkadot.Proto.Staking.ChillAndUnbond
|
51518
|
+
* @static
|
51519
|
+
* @param {TW.Polkadot.Proto.Staking.IChillAndUnbond} message ChillAndUnbond message or plain object to encode
|
51520
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
51521
|
+
* @returns {$protobuf.Writer} Writer
|
51522
|
+
*/
|
51523
|
+
ChillAndUnbond.encode = function encode(message, writer) {
|
51524
|
+
if (!writer)
|
51525
|
+
writer = $Writer.create();
|
51526
|
+
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
51527
|
+
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value);
|
51528
|
+
return writer;
|
51529
|
+
};
|
51530
|
+
|
51531
|
+
/**
|
51532
|
+
* Decodes a ChillAndUnbond message from the specified reader or buffer.
|
51533
|
+
* @function decode
|
51534
|
+
* @memberof TW.Polkadot.Proto.Staking.ChillAndUnbond
|
51535
|
+
* @static
|
51536
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
51537
|
+
* @param {number} [length] Message length if known beforehand
|
51538
|
+
* @returns {TW.Polkadot.Proto.Staking.ChillAndUnbond} ChillAndUnbond
|
51539
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
51540
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
51541
|
+
*/
|
51542
|
+
ChillAndUnbond.decode = function decode(reader, length) {
|
51543
|
+
if (!(reader instanceof $Reader))
|
51544
|
+
reader = $Reader.create(reader);
|
51545
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Polkadot.Proto.Staking.ChillAndUnbond();
|
51546
|
+
while (reader.pos < end) {
|
51547
|
+
var tag = reader.uint32();
|
51548
|
+
switch (tag >>> 3) {
|
51549
|
+
case 1:
|
51550
|
+
message.value = reader.bytes();
|
51551
|
+
break;
|
51552
|
+
default:
|
51553
|
+
reader.skipType(tag & 7);
|
51554
|
+
break;
|
51555
|
+
}
|
51556
|
+
}
|
51557
|
+
return message;
|
51558
|
+
};
|
51559
|
+
|
51560
|
+
/**
|
51561
|
+
* Verifies a ChillAndUnbond message.
|
51562
|
+
* @function verify
|
51563
|
+
* @memberof TW.Polkadot.Proto.Staking.ChillAndUnbond
|
51564
|
+
* @static
|
51565
|
+
* @param {Object.<string,*>} message Plain object to verify
|
51566
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
51567
|
+
*/
|
51568
|
+
ChillAndUnbond.verify = function verify(message) {
|
51569
|
+
if (typeof message !== "object" || message === null)
|
51570
|
+
return "object expected";
|
51571
|
+
if (message.value != null && message.hasOwnProperty("value"))
|
51572
|
+
if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value)))
|
51573
|
+
return "value: buffer expected";
|
51574
|
+
return null;
|
51575
|
+
};
|
51576
|
+
|
51577
|
+
/**
|
51578
|
+
* Creates a ChillAndUnbond message from a plain object. Also converts values to their respective internal types.
|
51579
|
+
* @function fromObject
|
51580
|
+
* @memberof TW.Polkadot.Proto.Staking.ChillAndUnbond
|
51581
|
+
* @static
|
51582
|
+
* @param {Object.<string,*>} object Plain object
|
51583
|
+
* @returns {TW.Polkadot.Proto.Staking.ChillAndUnbond} ChillAndUnbond
|
51584
|
+
*/
|
51585
|
+
ChillAndUnbond.fromObject = function fromObject(object) {
|
51586
|
+
if (object instanceof $root.TW.Polkadot.Proto.Staking.ChillAndUnbond)
|
51587
|
+
return object;
|
51588
|
+
var message = new $root.TW.Polkadot.Proto.Staking.ChillAndUnbond();
|
51589
|
+
if (object.value != null)
|
51590
|
+
if (typeof object.value === "string")
|
51591
|
+
$util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0);
|
51592
|
+
else if (object.value.length)
|
51593
|
+
message.value = object.value;
|
51594
|
+
return message;
|
51595
|
+
};
|
51596
|
+
|
51597
|
+
/**
|
51598
|
+
* Creates a plain object from a ChillAndUnbond message. Also converts values to other types if specified.
|
51599
|
+
* @function toObject
|
51600
|
+
* @memberof TW.Polkadot.Proto.Staking.ChillAndUnbond
|
51601
|
+
* @static
|
51602
|
+
* @param {TW.Polkadot.Proto.Staking.ChillAndUnbond} message ChillAndUnbond
|
51603
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
51604
|
+
* @returns {Object.<string,*>} Plain object
|
51605
|
+
*/
|
51606
|
+
ChillAndUnbond.toObject = function toObject(message, options) {
|
51607
|
+
if (!options)
|
51608
|
+
options = {};
|
51609
|
+
var object = {};
|
51610
|
+
if (options.defaults)
|
51611
|
+
if (options.bytes === String)
|
51612
|
+
object.value = "";
|
51613
|
+
else {
|
51614
|
+
object.value = [];
|
51615
|
+
if (options.bytes !== Array)
|
51616
|
+
object.value = $util.newBuffer(object.value);
|
51617
|
+
}
|
51618
|
+
if (message.value != null && message.hasOwnProperty("value"))
|
51619
|
+
object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value;
|
51620
|
+
return object;
|
51621
|
+
};
|
51622
|
+
|
51623
|
+
/**
|
51624
|
+
* Converts this ChillAndUnbond to JSON.
|
51625
|
+
* @function toJSON
|
51626
|
+
* @memberof TW.Polkadot.Proto.Staking.ChillAndUnbond
|
51627
|
+
* @instance
|
51628
|
+
* @returns {Object.<string,*>} JSON object
|
51629
|
+
*/
|
51630
|
+
ChillAndUnbond.prototype.toJSON = function toJSON() {
|
51631
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
51632
|
+
};
|
51633
|
+
|
51634
|
+
return ChillAndUnbond;
|
51635
|
+
})();
|
51636
|
+
|
50958
51637
|
Staking.Chill = (function() {
|
50959
51638
|
|
50960
51639
|
/**
|
@@ -52309,6 +52988,7 @@
|
|
52309
52988
|
case 20:
|
52310
52989
|
case 21:
|
52311
52990
|
case 22:
|
52991
|
+
case 23:
|
52312
52992
|
break;
|
52313
52993
|
}
|
52314
52994
|
return null;
|
@@ -52424,6 +53104,10 @@
|
|
52424
53104
|
case 22:
|
52425
53105
|
message.error = 22;
|
52426
53106
|
break;
|
53107
|
+
case "Error_invalid_requested_token_amount":
|
53108
|
+
case 23:
|
53109
|
+
message.error = 23;
|
53110
|
+
break;
|
52427
53111
|
}
|
52428
53112
|
return message;
|
52429
53113
|
};
|
@@ -61846,6 +62530,7 @@
|
|
61846
62530
|
case 20:
|
61847
62531
|
case 21:
|
61848
62532
|
case 22:
|
62533
|
+
case 23:
|
61849
62534
|
break;
|
61850
62535
|
}
|
61851
62536
|
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
@@ -61969,6 +62654,10 @@
|
|
61969
62654
|
case 22:
|
61970
62655
|
message.error = 22;
|
61971
62656
|
break;
|
62657
|
+
case "Error_invalid_requested_token_amount":
|
62658
|
+
case 23:
|
62659
|
+
message.error = 23;
|
62660
|
+
break;
|
61972
62661
|
}
|
61973
62662
|
if (object.errorMessage != null)
|
61974
62663
|
message.errorMessage = String(object.errorMessage);
|