@trustwallet/wallet-core 2.8.0 → 2.9.2
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 +121 -11
- package/dist/generated/core_proto.js +546 -81
- package/dist/lib/wallet-core.js +91 -90
- 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
|
|
@@ -21112,6 +21546,7 @@
|
|
21112
21546
|
case 20:
|
21113
21547
|
case 21:
|
21114
21548
|
case 22:
|
21549
|
+
case 23:
|
21115
21550
|
break;
|
21116
21551
|
}
|
21117
21552
|
return null;
|
@@ -21234,6 +21669,10 @@
|
|
21234
21669
|
case 22:
|
21235
21670
|
message.error = 22;
|
21236
21671
|
break;
|
21672
|
+
case "Error_invalid_requested_token_amount":
|
21673
|
+
case 23:
|
21674
|
+
message.error = 23;
|
21675
|
+
break;
|
21237
21676
|
}
|
21238
21677
|
return message;
|
21239
21678
|
};
|
@@ -23864,6 +24303,7 @@
|
|
23864
24303
|
case 20:
|
23865
24304
|
case 21:
|
23866
24305
|
case 22:
|
24306
|
+
case 23:
|
23867
24307
|
break;
|
23868
24308
|
}
|
23869
24309
|
return null;
|
@@ -23976,6 +24416,10 @@
|
|
23976
24416
|
case 22:
|
23977
24417
|
message.error = 22;
|
23978
24418
|
break;
|
24419
|
+
case "Error_invalid_requested_token_amount":
|
24420
|
+
case 23:
|
24421
|
+
message.error = 23;
|
24422
|
+
break;
|
23979
24423
|
}
|
23980
24424
|
return message;
|
23981
24425
|
};
|
@@ -26337,6 +26781,7 @@
|
|
26337
26781
|
case 20:
|
26338
26782
|
case 21:
|
26339
26783
|
case 22:
|
26784
|
+
case 23:
|
26340
26785
|
break;
|
26341
26786
|
}
|
26342
26787
|
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
@@ -26475,6 +26920,10 @@
|
|
26475
26920
|
case 22:
|
26476
26921
|
message.error = 22;
|
26477
26922
|
break;
|
26923
|
+
case "Error_invalid_requested_token_amount":
|
26924
|
+
case 23:
|
26925
|
+
message.error = 23;
|
26926
|
+
break;
|
26478
26927
|
}
|
26479
26928
|
if (object.errorMessage != null)
|
26480
26929
|
message.errorMessage = String(object.errorMessage);
|
@@ -29714,6 +30163,7 @@
|
|
29714
30163
|
case 20:
|
29715
30164
|
case 21:
|
29716
30165
|
case 22:
|
30166
|
+
case 23:
|
29717
30167
|
break;
|
29718
30168
|
}
|
29719
30169
|
return null;
|
@@ -29826,6 +30276,10 @@
|
|
29826
30276
|
case 22:
|
29827
30277
|
message.error = 22;
|
29828
30278
|
break;
|
30279
|
+
case "Error_invalid_requested_token_amount":
|
30280
|
+
case 23:
|
30281
|
+
message.error = 23;
|
30282
|
+
break;
|
29829
30283
|
}
|
29830
30284
|
return message;
|
29831
30285
|
};
|
@@ -40027,7 +40481,7 @@
|
|
40027
40481
|
* Properties of a FunctionCall.
|
40028
40482
|
* @memberof TW.NEAR.Proto
|
40029
40483
|
* @interface IFunctionCall
|
40030
|
-
* @property {
|
40484
|
+
* @property {string|null} [methodName] FunctionCall methodName
|
40031
40485
|
* @property {Uint8Array|null} [args] FunctionCall args
|
40032
40486
|
* @property {Long|null} [gas] FunctionCall gas
|
40033
40487
|
* @property {Uint8Array|null} [deposit] FunctionCall deposit
|
@@ -40050,11 +40504,11 @@
|
|
40050
40504
|
|
40051
40505
|
/**
|
40052
40506
|
* FunctionCall methodName.
|
40053
|
-
* @member {
|
40507
|
+
* @member {string} methodName
|
40054
40508
|
* @memberof TW.NEAR.Proto.FunctionCall
|
40055
40509
|
* @instance
|
40056
40510
|
*/
|
40057
|
-
FunctionCall.prototype.methodName =
|
40511
|
+
FunctionCall.prototype.methodName = "";
|
40058
40512
|
|
40059
40513
|
/**
|
40060
40514
|
* FunctionCall args.
|
@@ -40105,7 +40559,7 @@
|
|
40105
40559
|
if (!writer)
|
40106
40560
|
writer = $Writer.create();
|
40107
40561
|
if (message.methodName != null && Object.hasOwnProperty.call(message, "methodName"))
|
40108
|
-
writer.uint32(/* id 1, wireType 2 =*/10).
|
40562
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.methodName);
|
40109
40563
|
if (message.args != null && Object.hasOwnProperty.call(message, "args"))
|
40110
40564
|
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.args);
|
40111
40565
|
if (message.gas != null && Object.hasOwnProperty.call(message, "gas"))
|
@@ -40134,7 +40588,7 @@
|
|
40134
40588
|
var tag = reader.uint32();
|
40135
40589
|
switch (tag >>> 3) {
|
40136
40590
|
case 1:
|
40137
|
-
message.methodName = reader.
|
40591
|
+
message.methodName = reader.string();
|
40138
40592
|
break;
|
40139
40593
|
case 2:
|
40140
40594
|
message.args = reader.bytes();
|
@@ -40165,8 +40619,8 @@
|
|
40165
40619
|
if (typeof message !== "object" || message === null)
|
40166
40620
|
return "object expected";
|
40167
40621
|
if (message.methodName != null && message.hasOwnProperty("methodName"))
|
40168
|
-
if (
|
40169
|
-
return "methodName:
|
40622
|
+
if (!$util.isString(message.methodName))
|
40623
|
+
return "methodName: string expected";
|
40170
40624
|
if (message.args != null && message.hasOwnProperty("args"))
|
40171
40625
|
if (!(message.args && typeof message.args.length === "number" || $util.isString(message.args)))
|
40172
40626
|
return "args: buffer expected";
|
@@ -40192,10 +40646,7 @@
|
|
40192
40646
|
return object;
|
40193
40647
|
var message = new $root.TW.NEAR.Proto.FunctionCall();
|
40194
40648
|
if (object.methodName != null)
|
40195
|
-
|
40196
|
-
$util.base64.decode(object.methodName, message.methodName = $util.newBuffer($util.base64.length(object.methodName)), 0);
|
40197
|
-
else if (object.methodName.length)
|
40198
|
-
message.methodName = object.methodName;
|
40649
|
+
message.methodName = String(object.methodName);
|
40199
40650
|
if (object.args != null)
|
40200
40651
|
if (typeof object.args === "string")
|
40201
40652
|
$util.base64.decode(object.args, message.args = $util.newBuffer($util.base64.length(object.args)), 0);
|
@@ -40232,13 +40683,7 @@
|
|
40232
40683
|
options = {};
|
40233
40684
|
var object = {};
|
40234
40685
|
if (options.defaults) {
|
40235
|
-
|
40236
|
-
object.methodName = "";
|
40237
|
-
else {
|
40238
|
-
object.methodName = [];
|
40239
|
-
if (options.bytes !== Array)
|
40240
|
-
object.methodName = $util.newBuffer(object.methodName);
|
40241
|
-
}
|
40686
|
+
object.methodName = "";
|
40242
40687
|
if (options.bytes === String)
|
40243
40688
|
object.args = "";
|
40244
40689
|
else {
|
@@ -40260,7 +40705,7 @@
|
|
40260
40705
|
}
|
40261
40706
|
}
|
40262
40707
|
if (message.methodName != null && message.hasOwnProperty("methodName"))
|
40263
|
-
object.methodName =
|
40708
|
+
object.methodName = message.methodName;
|
40264
40709
|
if (message.args != null && message.hasOwnProperty("args"))
|
40265
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;
|
40266
40711
|
if (message.gas != null && message.hasOwnProperty("gas"))
|
@@ -44428,6 +44873,7 @@
|
|
44428
44873
|
case 20:
|
44429
44874
|
case 21:
|
44430
44875
|
case 22:
|
44876
|
+
case 23:
|
44431
44877
|
break;
|
44432
44878
|
}
|
44433
44879
|
return null;
|
@@ -44543,6 +44989,10 @@
|
|
44543
44989
|
case 22:
|
44544
44990
|
message.error = 22;
|
44545
44991
|
break;
|
44992
|
+
case "Error_invalid_requested_token_amount":
|
44993
|
+
case 23:
|
44994
|
+
message.error = 23;
|
44995
|
+
break;
|
44546
44996
|
}
|
44547
44997
|
return message;
|
44548
44998
|
};
|
@@ -45101,6 +45551,7 @@
|
|
45101
45551
|
case 20:
|
45102
45552
|
case 21:
|
45103
45553
|
case 22:
|
45554
|
+
case 23:
|
45104
45555
|
break;
|
45105
45556
|
}
|
45106
45557
|
return null;
|
@@ -45240,6 +45691,10 @@
|
|
45240
45691
|
case 22:
|
45241
45692
|
message.error = 22;
|
45242
45693
|
break;
|
45694
|
+
case "Error_invalid_requested_token_amount":
|
45695
|
+
case 23:
|
45696
|
+
message.error = 23;
|
45697
|
+
break;
|
45243
45698
|
}
|
45244
45699
|
return message;
|
45245
45700
|
};
|
@@ -52332,6 +52787,7 @@
|
|
52332
52787
|
case 20:
|
52333
52788
|
case 21:
|
52334
52789
|
case 22:
|
52790
|
+
case 23:
|
52335
52791
|
break;
|
52336
52792
|
}
|
52337
52793
|
return null;
|
@@ -52447,6 +52903,10 @@
|
|
52447
52903
|
case 22:
|
52448
52904
|
message.error = 22;
|
52449
52905
|
break;
|
52906
|
+
case "Error_invalid_requested_token_amount":
|
52907
|
+
case 23:
|
52908
|
+
message.error = 23;
|
52909
|
+
break;
|
52450
52910
|
}
|
52451
52911
|
return message;
|
52452
52912
|
};
|
@@ -61869,6 +62329,7 @@
|
|
61869
62329
|
case 20:
|
61870
62330
|
case 21:
|
61871
62331
|
case 22:
|
62332
|
+
case 23:
|
61872
62333
|
break;
|
61873
62334
|
}
|
61874
62335
|
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
@@ -61992,6 +62453,10 @@
|
|
61992
62453
|
case 22:
|
61993
62454
|
message.error = 22;
|
61994
62455
|
break;
|
62456
|
+
case "Error_invalid_requested_token_amount":
|
62457
|
+
case 23:
|
62458
|
+
message.error = 23;
|
62459
|
+
break;
|
61995
62460
|
}
|
61996
62461
|
if (object.errorMessage != null)
|
61997
62462
|
message.errorMessage = String(object.errorMessage);
|