@trustwallet/wallet-core 2.7.0 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/core_proto.d.ts +219 -12
- package/dist/generated/core_proto.js +829 -83
- package/dist/lib/wallet-core.js +96 -95
- package/dist/lib/wallet-core.wasm +0 -0
- package/package.json +1 -1
@@ -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
|
};
|
@@ -15565,7 +16013,7 @@
|
|
15565
16013
|
* @memberof TW.Cosmos.Proto
|
15566
16014
|
* @interface IAmount
|
15567
16015
|
* @property {string|null} [denom] Amount denom
|
15568
|
-
* @property {
|
16016
|
+
* @property {string|null} [amount] Amount amount
|
15569
16017
|
*/
|
15570
16018
|
|
15571
16019
|
/**
|
@@ -15593,11 +16041,11 @@
|
|
15593
16041
|
|
15594
16042
|
/**
|
15595
16043
|
* Amount amount.
|
15596
|
-
* @member {
|
16044
|
+
* @member {string} amount
|
15597
16045
|
* @memberof TW.Cosmos.Proto.Amount
|
15598
16046
|
* @instance
|
15599
16047
|
*/
|
15600
|
-
Amount.prototype.amount =
|
16048
|
+
Amount.prototype.amount = "";
|
15601
16049
|
|
15602
16050
|
/**
|
15603
16051
|
* Creates a new Amount instance using the specified properties.
|
@@ -15626,7 +16074,7 @@
|
|
15626
16074
|
if (message.denom != null && Object.hasOwnProperty.call(message, "denom"))
|
15627
16075
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom);
|
15628
16076
|
if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
|
15629
|
-
writer.uint32(/* id 2, wireType
|
16077
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount);
|
15630
16078
|
return writer;
|
15631
16079
|
};
|
15632
16080
|
|
@@ -15652,7 +16100,7 @@
|
|
15652
16100
|
message.denom = reader.string();
|
15653
16101
|
break;
|
15654
16102
|
case 2:
|
15655
|
-
message.amount = reader.
|
16103
|
+
message.amount = reader.string();
|
15656
16104
|
break;
|
15657
16105
|
default:
|
15658
16106
|
reader.skipType(tag & 7);
|
@@ -15677,8 +16125,8 @@
|
|
15677
16125
|
if (!$util.isString(message.denom))
|
15678
16126
|
return "denom: string expected";
|
15679
16127
|
if (message.amount != null && message.hasOwnProperty("amount"))
|
15680
|
-
if (!$util.
|
15681
|
-
return "amount:
|
16128
|
+
if (!$util.isString(message.amount))
|
16129
|
+
return "amount: string expected";
|
15682
16130
|
return null;
|
15683
16131
|
};
|
15684
16132
|
|
@@ -15697,14 +16145,7 @@
|
|
15697
16145
|
if (object.denom != null)
|
15698
16146
|
message.denom = String(object.denom);
|
15699
16147
|
if (object.amount != null)
|
15700
|
-
|
15701
|
-
(message.amount = $util.Long.fromValue(object.amount)).unsigned = false;
|
15702
|
-
else if (typeof object.amount === "string")
|
15703
|
-
message.amount = parseInt(object.amount, 10);
|
15704
|
-
else if (typeof object.amount === "number")
|
15705
|
-
message.amount = object.amount;
|
15706
|
-
else if (typeof object.amount === "object")
|
15707
|
-
message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber();
|
16148
|
+
message.amount = String(object.amount);
|
15708
16149
|
return message;
|
15709
16150
|
};
|
15710
16151
|
|
@@ -15723,19 +16164,12 @@
|
|
15723
16164
|
var object = {};
|
15724
16165
|
if (options.defaults) {
|
15725
16166
|
object.denom = "";
|
15726
|
-
|
15727
|
-
var long = new $util.Long(0, 0, false);
|
15728
|
-
object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
15729
|
-
} else
|
15730
|
-
object.amount = options.longs === String ? "0" : 0;
|
16167
|
+
object.amount = "";
|
15731
16168
|
}
|
15732
16169
|
if (message.denom != null && message.hasOwnProperty("denom"))
|
15733
16170
|
object.denom = message.denom;
|
15734
16171
|
if (message.amount != null && message.hasOwnProperty("amount"))
|
15735
|
-
|
15736
|
-
object.amount = options.longs === String ? String(message.amount) : message.amount;
|
15737
|
-
else
|
15738
|
-
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() : message.amount;
|
16172
|
+
object.amount = message.amount;
|
15739
16173
|
return object;
|
15740
16174
|
};
|
15741
16175
|
|
@@ -16210,6 +16644,7 @@
|
|
16210
16644
|
* @property {TW.Cosmos.Proto.Message.IWasmTerraExecuteContractTransfer|null} [wasmTerraExecuteContractTransferMessage] Message wasmTerraExecuteContractTransferMessage
|
16211
16645
|
* @property {TW.Cosmos.Proto.Message.IWasmTerraExecuteContractSend|null} [wasmTerraExecuteContractSendMessage] Message wasmTerraExecuteContractSendMessage
|
16212
16646
|
* @property {TW.Cosmos.Proto.Message.ITHORChainSend|null} [thorchainSendMessage] Message thorchainSendMessage
|
16647
|
+
* @property {TW.Cosmos.Proto.Message.IWasmTerraExecuteContractGeneric|null} [wasmTerraExecuteContractGeneric] Message wasmTerraExecuteContractGeneric
|
16213
16648
|
*/
|
16214
16649
|
|
16215
16650
|
/**
|
@@ -16307,17 +16742,25 @@
|
|
16307
16742
|
*/
|
16308
16743
|
Message.prototype.thorchainSendMessage = null;
|
16309
16744
|
|
16745
|
+
/**
|
16746
|
+
* Message wasmTerraExecuteContractGeneric.
|
16747
|
+
* @member {TW.Cosmos.Proto.Message.IWasmTerraExecuteContractGeneric|null|undefined} wasmTerraExecuteContractGeneric
|
16748
|
+
* @memberof TW.Cosmos.Proto.Message
|
16749
|
+
* @instance
|
16750
|
+
*/
|
16751
|
+
Message.prototype.wasmTerraExecuteContractGeneric = null;
|
16752
|
+
|
16310
16753
|
// OneOf field names bound to virtual getters and setters
|
16311
16754
|
var $oneOfFields;
|
16312
16755
|
|
16313
16756
|
/**
|
16314
16757
|
* Message messageOneof.
|
16315
|
-
* @member {"sendCoinsMessage"|"transferTokensMessage"|"stakeMessage"|"unstakeMessage"|"restakeMessage"|"withdrawStakeRewardMessage"|"rawJsonMessage"|"wasmTerraExecuteContractTransferMessage"|"wasmTerraExecuteContractSendMessage"|"thorchainSendMessage"|undefined} messageOneof
|
16758
|
+
* @member {"sendCoinsMessage"|"transferTokensMessage"|"stakeMessage"|"unstakeMessage"|"restakeMessage"|"withdrawStakeRewardMessage"|"rawJsonMessage"|"wasmTerraExecuteContractTransferMessage"|"wasmTerraExecuteContractSendMessage"|"thorchainSendMessage"|"wasmTerraExecuteContractGeneric"|undefined} messageOneof
|
16316
16759
|
* @memberof TW.Cosmos.Proto.Message
|
16317
16760
|
* @instance
|
16318
16761
|
*/
|
16319
16762
|
Object.defineProperty(Message.prototype, "messageOneof", {
|
16320
|
-
get: $util.oneOfGetter($oneOfFields = ["sendCoinsMessage", "transferTokensMessage", "stakeMessage", "unstakeMessage", "restakeMessage", "withdrawStakeRewardMessage", "rawJsonMessage", "wasmTerraExecuteContractTransferMessage", "wasmTerraExecuteContractSendMessage", "thorchainSendMessage"]),
|
16763
|
+
get: $util.oneOfGetter($oneOfFields = ["sendCoinsMessage", "transferTokensMessage", "stakeMessage", "unstakeMessage", "restakeMessage", "withdrawStakeRewardMessage", "rawJsonMessage", "wasmTerraExecuteContractTransferMessage", "wasmTerraExecuteContractSendMessage", "thorchainSendMessage", "wasmTerraExecuteContractGeneric"]),
|
16321
16764
|
set: $util.oneOfSetter($oneOfFields)
|
16322
16765
|
});
|
16323
16766
|
|
@@ -16365,6 +16808,8 @@
|
|
16365
16808
|
$root.TW.Cosmos.Proto.Message.WasmTerraExecuteContractSend.encode(message.wasmTerraExecuteContractSendMessage, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
16366
16809
|
if (message.thorchainSendMessage != null && Object.hasOwnProperty.call(message, "thorchainSendMessage"))
|
16367
16810
|
$root.TW.Cosmos.Proto.Message.THORChainSend.encode(message.thorchainSendMessage, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
|
16811
|
+
if (message.wasmTerraExecuteContractGeneric != null && Object.hasOwnProperty.call(message, "wasmTerraExecuteContractGeneric"))
|
16812
|
+
$root.TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric.encode(message.wasmTerraExecuteContractGeneric, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
|
16368
16813
|
return writer;
|
16369
16814
|
};
|
16370
16815
|
|
@@ -16416,6 +16861,9 @@
|
|
16416
16861
|
case 10:
|
16417
16862
|
message.thorchainSendMessage = $root.TW.Cosmos.Proto.Message.THORChainSend.decode(reader, reader.uint32());
|
16418
16863
|
break;
|
16864
|
+
case 11:
|
16865
|
+
message.wasmTerraExecuteContractGeneric = $root.TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric.decode(reader, reader.uint32());
|
16866
|
+
break;
|
16419
16867
|
default:
|
16420
16868
|
reader.skipType(tag & 7);
|
16421
16869
|
break;
|
@@ -16534,6 +16982,16 @@
|
|
16534
16982
|
return "thorchainSendMessage." + error;
|
16535
16983
|
}
|
16536
16984
|
}
|
16985
|
+
if (message.wasmTerraExecuteContractGeneric != null && message.hasOwnProperty("wasmTerraExecuteContractGeneric")) {
|
16986
|
+
if (properties.messageOneof === 1)
|
16987
|
+
return "messageOneof: multiple values";
|
16988
|
+
properties.messageOneof = 1;
|
16989
|
+
{
|
16990
|
+
var error = $root.TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric.verify(message.wasmTerraExecuteContractGeneric);
|
16991
|
+
if (error)
|
16992
|
+
return "wasmTerraExecuteContractGeneric." + error;
|
16993
|
+
}
|
16994
|
+
}
|
16537
16995
|
return null;
|
16538
16996
|
};
|
16539
16997
|
|
@@ -16599,6 +17057,11 @@
|
|
16599
17057
|
throw TypeError(".TW.Cosmos.Proto.Message.thorchainSendMessage: object expected");
|
16600
17058
|
message.thorchainSendMessage = $root.TW.Cosmos.Proto.Message.THORChainSend.fromObject(object.thorchainSendMessage);
|
16601
17059
|
}
|
17060
|
+
if (object.wasmTerraExecuteContractGeneric != null) {
|
17061
|
+
if (typeof object.wasmTerraExecuteContractGeneric !== "object")
|
17062
|
+
throw TypeError(".TW.Cosmos.Proto.Message.wasmTerraExecuteContractGeneric: object expected");
|
17063
|
+
message.wasmTerraExecuteContractGeneric = $root.TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric.fromObject(object.wasmTerraExecuteContractGeneric);
|
17064
|
+
}
|
16602
17065
|
return message;
|
16603
17066
|
};
|
16604
17067
|
|
@@ -16665,6 +17128,11 @@
|
|
16665
17128
|
if (options.oneofs)
|
16666
17129
|
object.messageOneof = "thorchainSendMessage";
|
16667
17130
|
}
|
17131
|
+
if (message.wasmTerraExecuteContractGeneric != null && message.hasOwnProperty("wasmTerraExecuteContractGeneric")) {
|
17132
|
+
object.wasmTerraExecuteContractGeneric = $root.TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric.toObject(message.wasmTerraExecuteContractGeneric, options);
|
17133
|
+
if (options.oneofs)
|
17134
|
+
object.messageOneof = "wasmTerraExecuteContractGeneric";
|
17135
|
+
}
|
16668
17136
|
return object;
|
16669
17137
|
};
|
16670
17138
|
|
@@ -18928,6 +19396,253 @@
|
|
18928
19396
|
return THORChainSend;
|
18929
19397
|
})();
|
18930
19398
|
|
19399
|
+
Message.WasmTerraExecuteContractGeneric = (function() {
|
19400
|
+
|
19401
|
+
/**
|
19402
|
+
* Properties of a WasmTerraExecuteContractGeneric.
|
19403
|
+
* @memberof TW.Cosmos.Proto.Message
|
19404
|
+
* @interface IWasmTerraExecuteContractGeneric
|
19405
|
+
* @property {string|null} [senderAddress] WasmTerraExecuteContractGeneric senderAddress
|
19406
|
+
* @property {string|null} [contractAddress] WasmTerraExecuteContractGeneric contractAddress
|
19407
|
+
* @property {string|null} [executeMsg] WasmTerraExecuteContractGeneric executeMsg
|
19408
|
+
* @property {Array.<TW.Cosmos.Proto.IAmount>|null} [coins] WasmTerraExecuteContractGeneric coins
|
19409
|
+
*/
|
19410
|
+
|
19411
|
+
/**
|
19412
|
+
* Constructs a new WasmTerraExecuteContractGeneric.
|
19413
|
+
* @memberof TW.Cosmos.Proto.Message
|
19414
|
+
* @classdesc Represents a WasmTerraExecuteContractGeneric.
|
19415
|
+
* @implements IWasmTerraExecuteContractGeneric
|
19416
|
+
* @constructor
|
19417
|
+
* @param {TW.Cosmos.Proto.Message.IWasmTerraExecuteContractGeneric=} [properties] Properties to set
|
19418
|
+
*/
|
19419
|
+
function WasmTerraExecuteContractGeneric(properties) {
|
19420
|
+
this.coins = [];
|
19421
|
+
if (properties)
|
19422
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
19423
|
+
if (properties[keys[i]] != null)
|
19424
|
+
this[keys[i]] = properties[keys[i]];
|
19425
|
+
}
|
19426
|
+
|
19427
|
+
/**
|
19428
|
+
* WasmTerraExecuteContractGeneric senderAddress.
|
19429
|
+
* @member {string} senderAddress
|
19430
|
+
* @memberof TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric
|
19431
|
+
* @instance
|
19432
|
+
*/
|
19433
|
+
WasmTerraExecuteContractGeneric.prototype.senderAddress = "";
|
19434
|
+
|
19435
|
+
/**
|
19436
|
+
* WasmTerraExecuteContractGeneric contractAddress.
|
19437
|
+
* @member {string} contractAddress
|
19438
|
+
* @memberof TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric
|
19439
|
+
* @instance
|
19440
|
+
*/
|
19441
|
+
WasmTerraExecuteContractGeneric.prototype.contractAddress = "";
|
19442
|
+
|
19443
|
+
/**
|
19444
|
+
* WasmTerraExecuteContractGeneric executeMsg.
|
19445
|
+
* @member {string} executeMsg
|
19446
|
+
* @memberof TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric
|
19447
|
+
* @instance
|
19448
|
+
*/
|
19449
|
+
WasmTerraExecuteContractGeneric.prototype.executeMsg = "";
|
19450
|
+
|
19451
|
+
/**
|
19452
|
+
* WasmTerraExecuteContractGeneric coins.
|
19453
|
+
* @member {Array.<TW.Cosmos.Proto.IAmount>} coins
|
19454
|
+
* @memberof TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric
|
19455
|
+
* @instance
|
19456
|
+
*/
|
19457
|
+
WasmTerraExecuteContractGeneric.prototype.coins = $util.emptyArray;
|
19458
|
+
|
19459
|
+
/**
|
19460
|
+
* Creates a new WasmTerraExecuteContractGeneric instance using the specified properties.
|
19461
|
+
* @function create
|
19462
|
+
* @memberof TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric
|
19463
|
+
* @static
|
19464
|
+
* @param {TW.Cosmos.Proto.Message.IWasmTerraExecuteContractGeneric=} [properties] Properties to set
|
19465
|
+
* @returns {TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric} WasmTerraExecuteContractGeneric instance
|
19466
|
+
*/
|
19467
|
+
WasmTerraExecuteContractGeneric.create = function create(properties) {
|
19468
|
+
return new WasmTerraExecuteContractGeneric(properties);
|
19469
|
+
};
|
19470
|
+
|
19471
|
+
/**
|
19472
|
+
* Encodes the specified WasmTerraExecuteContractGeneric message. Does not implicitly {@link TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric.verify|verify} messages.
|
19473
|
+
* @function encode
|
19474
|
+
* @memberof TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric
|
19475
|
+
* @static
|
19476
|
+
* @param {TW.Cosmos.Proto.Message.IWasmTerraExecuteContractGeneric} message WasmTerraExecuteContractGeneric message or plain object to encode
|
19477
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
19478
|
+
* @returns {$protobuf.Writer} Writer
|
19479
|
+
*/
|
19480
|
+
WasmTerraExecuteContractGeneric.encode = function encode(message, writer) {
|
19481
|
+
if (!writer)
|
19482
|
+
writer = $Writer.create();
|
19483
|
+
if (message.senderAddress != null && Object.hasOwnProperty.call(message, "senderAddress"))
|
19484
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.senderAddress);
|
19485
|
+
if (message.contractAddress != null && Object.hasOwnProperty.call(message, "contractAddress"))
|
19486
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.contractAddress);
|
19487
|
+
if (message.executeMsg != null && Object.hasOwnProperty.call(message, "executeMsg"))
|
19488
|
+
writer.uint32(/* id 3, wireType 2 =*/26).string(message.executeMsg);
|
19489
|
+
if (message.coins != null && message.coins.length)
|
19490
|
+
for (var i = 0; i < message.coins.length; ++i)
|
19491
|
+
$root.TW.Cosmos.Proto.Amount.encode(message.coins[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
19492
|
+
return writer;
|
19493
|
+
};
|
19494
|
+
|
19495
|
+
/**
|
19496
|
+
* Decodes a WasmTerraExecuteContractGeneric message from the specified reader or buffer.
|
19497
|
+
* @function decode
|
19498
|
+
* @memberof TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric
|
19499
|
+
* @static
|
19500
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19501
|
+
* @param {number} [length] Message length if known beforehand
|
19502
|
+
* @returns {TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric} WasmTerraExecuteContractGeneric
|
19503
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
19504
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19505
|
+
*/
|
19506
|
+
WasmTerraExecuteContractGeneric.decode = function decode(reader, length) {
|
19507
|
+
if (!(reader instanceof $Reader))
|
19508
|
+
reader = $Reader.create(reader);
|
19509
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric();
|
19510
|
+
while (reader.pos < end) {
|
19511
|
+
var tag = reader.uint32();
|
19512
|
+
switch (tag >>> 3) {
|
19513
|
+
case 1:
|
19514
|
+
message.senderAddress = reader.string();
|
19515
|
+
break;
|
19516
|
+
case 2:
|
19517
|
+
message.contractAddress = reader.string();
|
19518
|
+
break;
|
19519
|
+
case 3:
|
19520
|
+
message.executeMsg = reader.string();
|
19521
|
+
break;
|
19522
|
+
case 5:
|
19523
|
+
if (!(message.coins && message.coins.length))
|
19524
|
+
message.coins = [];
|
19525
|
+
message.coins.push($root.TW.Cosmos.Proto.Amount.decode(reader, reader.uint32()));
|
19526
|
+
break;
|
19527
|
+
default:
|
19528
|
+
reader.skipType(tag & 7);
|
19529
|
+
break;
|
19530
|
+
}
|
19531
|
+
}
|
19532
|
+
return message;
|
19533
|
+
};
|
19534
|
+
|
19535
|
+
/**
|
19536
|
+
* Verifies a WasmTerraExecuteContractGeneric message.
|
19537
|
+
* @function verify
|
19538
|
+
* @memberof TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric
|
19539
|
+
* @static
|
19540
|
+
* @param {Object.<string,*>} message Plain object to verify
|
19541
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
19542
|
+
*/
|
19543
|
+
WasmTerraExecuteContractGeneric.verify = function verify(message) {
|
19544
|
+
if (typeof message !== "object" || message === null)
|
19545
|
+
return "object expected";
|
19546
|
+
if (message.senderAddress != null && message.hasOwnProperty("senderAddress"))
|
19547
|
+
if (!$util.isString(message.senderAddress))
|
19548
|
+
return "senderAddress: string expected";
|
19549
|
+
if (message.contractAddress != null && message.hasOwnProperty("contractAddress"))
|
19550
|
+
if (!$util.isString(message.contractAddress))
|
19551
|
+
return "contractAddress: string expected";
|
19552
|
+
if (message.executeMsg != null && message.hasOwnProperty("executeMsg"))
|
19553
|
+
if (!$util.isString(message.executeMsg))
|
19554
|
+
return "executeMsg: string expected";
|
19555
|
+
if (message.coins != null && message.hasOwnProperty("coins")) {
|
19556
|
+
if (!Array.isArray(message.coins))
|
19557
|
+
return "coins: array expected";
|
19558
|
+
for (var i = 0; i < message.coins.length; ++i) {
|
19559
|
+
var error = $root.TW.Cosmos.Proto.Amount.verify(message.coins[i]);
|
19560
|
+
if (error)
|
19561
|
+
return "coins." + error;
|
19562
|
+
}
|
19563
|
+
}
|
19564
|
+
return null;
|
19565
|
+
};
|
19566
|
+
|
19567
|
+
/**
|
19568
|
+
* Creates a WasmTerraExecuteContractGeneric message from a plain object. Also converts values to their respective internal types.
|
19569
|
+
* @function fromObject
|
19570
|
+
* @memberof TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric
|
19571
|
+
* @static
|
19572
|
+
* @param {Object.<string,*>} object Plain object
|
19573
|
+
* @returns {TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric} WasmTerraExecuteContractGeneric
|
19574
|
+
*/
|
19575
|
+
WasmTerraExecuteContractGeneric.fromObject = function fromObject(object) {
|
19576
|
+
if (object instanceof $root.TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric)
|
19577
|
+
return object;
|
19578
|
+
var message = new $root.TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric();
|
19579
|
+
if (object.senderAddress != null)
|
19580
|
+
message.senderAddress = String(object.senderAddress);
|
19581
|
+
if (object.contractAddress != null)
|
19582
|
+
message.contractAddress = String(object.contractAddress);
|
19583
|
+
if (object.executeMsg != null)
|
19584
|
+
message.executeMsg = String(object.executeMsg);
|
19585
|
+
if (object.coins) {
|
19586
|
+
if (!Array.isArray(object.coins))
|
19587
|
+
throw TypeError(".TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric.coins: array expected");
|
19588
|
+
message.coins = [];
|
19589
|
+
for (var i = 0; i < object.coins.length; ++i) {
|
19590
|
+
if (typeof object.coins[i] !== "object")
|
19591
|
+
throw TypeError(".TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric.coins: object expected");
|
19592
|
+
message.coins[i] = $root.TW.Cosmos.Proto.Amount.fromObject(object.coins[i]);
|
19593
|
+
}
|
19594
|
+
}
|
19595
|
+
return message;
|
19596
|
+
};
|
19597
|
+
|
19598
|
+
/**
|
19599
|
+
* Creates a plain object from a WasmTerraExecuteContractGeneric message. Also converts values to other types if specified.
|
19600
|
+
* @function toObject
|
19601
|
+
* @memberof TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric
|
19602
|
+
* @static
|
19603
|
+
* @param {TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric} message WasmTerraExecuteContractGeneric
|
19604
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
19605
|
+
* @returns {Object.<string,*>} Plain object
|
19606
|
+
*/
|
19607
|
+
WasmTerraExecuteContractGeneric.toObject = function toObject(message, options) {
|
19608
|
+
if (!options)
|
19609
|
+
options = {};
|
19610
|
+
var object = {};
|
19611
|
+
if (options.arrays || options.defaults)
|
19612
|
+
object.coins = [];
|
19613
|
+
if (options.defaults) {
|
19614
|
+
object.senderAddress = "";
|
19615
|
+
object.contractAddress = "";
|
19616
|
+
object.executeMsg = "";
|
19617
|
+
}
|
19618
|
+
if (message.senderAddress != null && message.hasOwnProperty("senderAddress"))
|
19619
|
+
object.senderAddress = message.senderAddress;
|
19620
|
+
if (message.contractAddress != null && message.hasOwnProperty("contractAddress"))
|
19621
|
+
object.contractAddress = message.contractAddress;
|
19622
|
+
if (message.executeMsg != null && message.hasOwnProperty("executeMsg"))
|
19623
|
+
object.executeMsg = message.executeMsg;
|
19624
|
+
if (message.coins && message.coins.length) {
|
19625
|
+
object.coins = [];
|
19626
|
+
for (var j = 0; j < message.coins.length; ++j)
|
19627
|
+
object.coins[j] = $root.TW.Cosmos.Proto.Amount.toObject(message.coins[j], options);
|
19628
|
+
}
|
19629
|
+
return object;
|
19630
|
+
};
|
19631
|
+
|
19632
|
+
/**
|
19633
|
+
* Converts this WasmTerraExecuteContractGeneric to JSON.
|
19634
|
+
* @function toJSON
|
19635
|
+
* @memberof TW.Cosmos.Proto.Message.WasmTerraExecuteContractGeneric
|
19636
|
+
* @instance
|
19637
|
+
* @returns {Object.<string,*>} JSON object
|
19638
|
+
*/
|
19639
|
+
WasmTerraExecuteContractGeneric.prototype.toJSON = function toJSON() {
|
19640
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
19641
|
+
};
|
19642
|
+
|
19643
|
+
return WasmTerraExecuteContractGeneric;
|
19644
|
+
})();
|
19645
|
+
|
18931
19646
|
Message.RawJSON = (function() {
|
18932
19647
|
|
18933
19648
|
/**
|
@@ -20831,6 +21546,7 @@
|
|
20831
21546
|
case 20:
|
20832
21547
|
case 21:
|
20833
21548
|
case 22:
|
21549
|
+
case 23:
|
20834
21550
|
break;
|
20835
21551
|
}
|
20836
21552
|
return null;
|
@@ -20953,6 +21669,10 @@
|
|
20953
21669
|
case 22:
|
20954
21670
|
message.error = 22;
|
20955
21671
|
break;
|
21672
|
+
case "Error_invalid_requested_token_amount":
|
21673
|
+
case 23:
|
21674
|
+
message.error = 23;
|
21675
|
+
break;
|
20956
21676
|
}
|
20957
21677
|
return message;
|
20958
21678
|
};
|
@@ -23583,6 +24303,7 @@
|
|
23583
24303
|
case 20:
|
23584
24304
|
case 21:
|
23585
24305
|
case 22:
|
24306
|
+
case 23:
|
23586
24307
|
break;
|
23587
24308
|
}
|
23588
24309
|
return null;
|
@@ -23695,6 +24416,10 @@
|
|
23695
24416
|
case 22:
|
23696
24417
|
message.error = 22;
|
23697
24418
|
break;
|
24419
|
+
case "Error_invalid_requested_token_amount":
|
24420
|
+
case 23:
|
24421
|
+
message.error = 23;
|
24422
|
+
break;
|
23698
24423
|
}
|
23699
24424
|
return message;
|
23700
24425
|
};
|
@@ -26056,6 +26781,7 @@
|
|
26056
26781
|
case 20:
|
26057
26782
|
case 21:
|
26058
26783
|
case 22:
|
26784
|
+
case 23:
|
26059
26785
|
break;
|
26060
26786
|
}
|
26061
26787
|
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
@@ -26194,6 +26920,10 @@
|
|
26194
26920
|
case 22:
|
26195
26921
|
message.error = 22;
|
26196
26922
|
break;
|
26923
|
+
case "Error_invalid_requested_token_amount":
|
26924
|
+
case 23:
|
26925
|
+
message.error = 23;
|
26926
|
+
break;
|
26197
26927
|
}
|
26198
26928
|
if (object.errorMessage != null)
|
26199
26929
|
message.errorMessage = String(object.errorMessage);
|
@@ -29433,6 +30163,7 @@
|
|
29433
30163
|
case 20:
|
29434
30164
|
case 21:
|
29435
30165
|
case 22:
|
30166
|
+
case 23:
|
29436
30167
|
break;
|
29437
30168
|
}
|
29438
30169
|
return null;
|
@@ -29545,6 +30276,10 @@
|
|
29545
30276
|
case 22:
|
29546
30277
|
message.error = 22;
|
29547
30278
|
break;
|
30279
|
+
case "Error_invalid_requested_token_amount":
|
30280
|
+
case 23:
|
30281
|
+
message.error = 23;
|
30282
|
+
break;
|
29548
30283
|
}
|
29549
30284
|
return message;
|
29550
30285
|
};
|
@@ -39746,7 +40481,7 @@
|
|
39746
40481
|
* Properties of a FunctionCall.
|
39747
40482
|
* @memberof TW.NEAR.Proto
|
39748
40483
|
* @interface IFunctionCall
|
39749
|
-
* @property {
|
40484
|
+
* @property {string|null} [methodName] FunctionCall methodName
|
39750
40485
|
* @property {Uint8Array|null} [args] FunctionCall args
|
39751
40486
|
* @property {Long|null} [gas] FunctionCall gas
|
39752
40487
|
* @property {Uint8Array|null} [deposit] FunctionCall deposit
|
@@ -39769,11 +40504,11 @@
|
|
39769
40504
|
|
39770
40505
|
/**
|
39771
40506
|
* FunctionCall methodName.
|
39772
|
-
* @member {
|
40507
|
+
* @member {string} methodName
|
39773
40508
|
* @memberof TW.NEAR.Proto.FunctionCall
|
39774
40509
|
* @instance
|
39775
40510
|
*/
|
39776
|
-
FunctionCall.prototype.methodName =
|
40511
|
+
FunctionCall.prototype.methodName = "";
|
39777
40512
|
|
39778
40513
|
/**
|
39779
40514
|
* FunctionCall args.
|
@@ -39824,7 +40559,7 @@
|
|
39824
40559
|
if (!writer)
|
39825
40560
|
writer = $Writer.create();
|
39826
40561
|
if (message.methodName != null && Object.hasOwnProperty.call(message, "methodName"))
|
39827
|
-
writer.uint32(/* id 1, wireType 2 =*/10).
|
40562
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.methodName);
|
39828
40563
|
if (message.args != null && Object.hasOwnProperty.call(message, "args"))
|
39829
40564
|
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.args);
|
39830
40565
|
if (message.gas != null && Object.hasOwnProperty.call(message, "gas"))
|
@@ -39853,7 +40588,7 @@
|
|
39853
40588
|
var tag = reader.uint32();
|
39854
40589
|
switch (tag >>> 3) {
|
39855
40590
|
case 1:
|
39856
|
-
message.methodName = reader.
|
40591
|
+
message.methodName = reader.string();
|
39857
40592
|
break;
|
39858
40593
|
case 2:
|
39859
40594
|
message.args = reader.bytes();
|
@@ -39884,8 +40619,8 @@
|
|
39884
40619
|
if (typeof message !== "object" || message === null)
|
39885
40620
|
return "object expected";
|
39886
40621
|
if (message.methodName != null && message.hasOwnProperty("methodName"))
|
39887
|
-
if (
|
39888
|
-
return "methodName:
|
40622
|
+
if (!$util.isString(message.methodName))
|
40623
|
+
return "methodName: string expected";
|
39889
40624
|
if (message.args != null && message.hasOwnProperty("args"))
|
39890
40625
|
if (!(message.args && typeof message.args.length === "number" || $util.isString(message.args)))
|
39891
40626
|
return "args: buffer expected";
|
@@ -39911,10 +40646,7 @@
|
|
39911
40646
|
return object;
|
39912
40647
|
var message = new $root.TW.NEAR.Proto.FunctionCall();
|
39913
40648
|
if (object.methodName != null)
|
39914
|
-
|
39915
|
-
$util.base64.decode(object.methodName, message.methodName = $util.newBuffer($util.base64.length(object.methodName)), 0);
|
39916
|
-
else if (object.methodName.length)
|
39917
|
-
message.methodName = object.methodName;
|
40649
|
+
message.methodName = String(object.methodName);
|
39918
40650
|
if (object.args != null)
|
39919
40651
|
if (typeof object.args === "string")
|
39920
40652
|
$util.base64.decode(object.args, message.args = $util.newBuffer($util.base64.length(object.args)), 0);
|
@@ -39951,13 +40683,7 @@
|
|
39951
40683
|
options = {};
|
39952
40684
|
var object = {};
|
39953
40685
|
if (options.defaults) {
|
39954
|
-
|
39955
|
-
object.methodName = "";
|
39956
|
-
else {
|
39957
|
-
object.methodName = [];
|
39958
|
-
if (options.bytes !== Array)
|
39959
|
-
object.methodName = $util.newBuffer(object.methodName);
|
39960
|
-
}
|
40686
|
+
object.methodName = "";
|
39961
40687
|
if (options.bytes === String)
|
39962
40688
|
object.args = "";
|
39963
40689
|
else {
|
@@ -39979,7 +40705,7 @@
|
|
39979
40705
|
}
|
39980
40706
|
}
|
39981
40707
|
if (message.methodName != null && message.hasOwnProperty("methodName"))
|
39982
|
-
object.methodName =
|
40708
|
+
object.methodName = message.methodName;
|
39983
40709
|
if (message.args != null && message.hasOwnProperty("args"))
|
39984
40710
|
object.args = options.bytes === String ? $util.base64.encode(message.args, 0, message.args.length) : options.bytes === Array ? Array.prototype.slice.call(message.args) : message.args;
|
39985
40711
|
if (message.gas != null && message.hasOwnProperty("gas"))
|
@@ -44147,6 +44873,7 @@
|
|
44147
44873
|
case 20:
|
44148
44874
|
case 21:
|
44149
44875
|
case 22:
|
44876
|
+
case 23:
|
44150
44877
|
break;
|
44151
44878
|
}
|
44152
44879
|
return null;
|
@@ -44262,6 +44989,10 @@
|
|
44262
44989
|
case 22:
|
44263
44990
|
message.error = 22;
|
44264
44991
|
break;
|
44992
|
+
case "Error_invalid_requested_token_amount":
|
44993
|
+
case 23:
|
44994
|
+
message.error = 23;
|
44995
|
+
break;
|
44265
44996
|
}
|
44266
44997
|
return message;
|
44267
44998
|
};
|
@@ -44820,6 +45551,7 @@
|
|
44820
45551
|
case 20:
|
44821
45552
|
case 21:
|
44822
45553
|
case 22:
|
45554
|
+
case 23:
|
44823
45555
|
break;
|
44824
45556
|
}
|
44825
45557
|
return null;
|
@@ -44959,6 +45691,10 @@
|
|
44959
45691
|
case 22:
|
44960
45692
|
message.error = 22;
|
44961
45693
|
break;
|
45694
|
+
case "Error_invalid_requested_token_amount":
|
45695
|
+
case 23:
|
45696
|
+
message.error = 23;
|
45697
|
+
break;
|
44962
45698
|
}
|
44963
45699
|
return message;
|
44964
45700
|
};
|
@@ -52051,6 +52787,7 @@
|
|
52051
52787
|
case 20:
|
52052
52788
|
case 21:
|
52053
52789
|
case 22:
|
52790
|
+
case 23:
|
52054
52791
|
break;
|
52055
52792
|
}
|
52056
52793
|
return null;
|
@@ -52166,6 +52903,10 @@
|
|
52166
52903
|
case 22:
|
52167
52904
|
message.error = 22;
|
52168
52905
|
break;
|
52906
|
+
case "Error_invalid_requested_token_amount":
|
52907
|
+
case 23:
|
52908
|
+
message.error = 23;
|
52909
|
+
break;
|
52169
52910
|
}
|
52170
52911
|
return message;
|
52171
52912
|
};
|
@@ -61588,6 +62329,7 @@
|
|
61588
62329
|
case 20:
|
61589
62330
|
case 21:
|
61590
62331
|
case 22:
|
62332
|
+
case 23:
|
61591
62333
|
break;
|
61592
62334
|
}
|
61593
62335
|
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
@@ -61711,6 +62453,10 @@
|
|
61711
62453
|
case 22:
|
61712
62454
|
message.error = 22;
|
61713
62455
|
break;
|
62456
|
+
case "Error_invalid_requested_token_amount":
|
62457
|
+
case 23:
|
62458
|
+
message.error = 23;
|
62459
|
+
break;
|
61714
62460
|
}
|
61715
62461
|
if (object.errorMessage != null)
|
61716
62462
|
message.errorMessage = String(object.errorMessage);
|