@trustwallet/wallet-core 4.2.10 → 4.2.12

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.
@@ -28589,6 +28589,7 @@
28589
28589
  * @property {TW.BitcoinV2.Proto.IPsbt|null} [psbt] SigningOutput psbt
28590
28590
  * @property {TW.Utxo.Proto.ITransaction|null} [bitcoin] SigningOutput bitcoin
28591
28591
  * @property {TW.Zcash.Proto.ITransaction|null} [zcash] SigningOutput zcash
28592
+ * @property {TW.DecredV2.Proto.ITransaction|null} [decred] SigningOutput decred
28592
28593
  */
28593
28594
 
28594
28595
  /**
@@ -28686,17 +28687,25 @@
28686
28687
  */
28687
28688
  SigningOutput.prototype.zcash = null;
28688
28689
 
28690
+ /**
28691
+ * SigningOutput decred.
28692
+ * @member {TW.DecredV2.Proto.ITransaction|null|undefined} decred
28693
+ * @memberof TW.BitcoinV2.Proto.SigningOutput
28694
+ * @instance
28695
+ */
28696
+ SigningOutput.prototype.decred = null;
28697
+
28689
28698
  // OneOf field names bound to virtual getters and setters
28690
28699
  var $oneOfFields;
28691
28700
 
28692
28701
  /**
28693
28702
  * SigningOutput transaction.
28694
- * @member {"bitcoin"|"zcash"|undefined} transaction
28703
+ * @member {"bitcoin"|"zcash"|"decred"|undefined} transaction
28695
28704
  * @memberof TW.BitcoinV2.Proto.SigningOutput
28696
28705
  * @instance
28697
28706
  */
28698
28707
  Object.defineProperty(SigningOutput.prototype, "transaction", {
28699
- get: $util.oneOfGetter($oneOfFields = ["bitcoin", "zcash"]),
28708
+ get: $util.oneOfGetter($oneOfFields = ["bitcoin", "zcash", "decred"]),
28700
28709
  set: $util.oneOfSetter($oneOfFields)
28701
28710
  });
28702
28711
 
@@ -28744,6 +28753,8 @@
28744
28753
  $root.TW.Utxo.Proto.Transaction.encode(message.bitcoin, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim();
28745
28754
  if (message.zcash != null && Object.hasOwnProperty.call(message, "zcash"))
28746
28755
  $root.TW.Zcash.Proto.Transaction.encode(message.zcash, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim();
28756
+ if (message.decred != null && Object.hasOwnProperty.call(message, "decred"))
28757
+ $root.TW.DecredV2.Proto.Transaction.encode(message.decred, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim();
28747
28758
  return writer;
28748
28759
  };
28749
28760
 
@@ -28795,6 +28806,9 @@
28795
28806
  case 16:
28796
28807
  message.zcash = $root.TW.Zcash.Proto.Transaction.decode(reader, reader.uint32());
28797
28808
  break;
28809
+ case 17:
28810
+ message.decred = $root.TW.DecredV2.Proto.Transaction.decode(reader, reader.uint32());
28811
+ break;
28798
28812
  default:
28799
28813
  reader.skipType(tag & 7);
28800
28814
  break;
@@ -28888,6 +28902,16 @@
28888
28902
  return "zcash." + error;
28889
28903
  }
28890
28904
  }
28905
+ if (message.decred != null && message.hasOwnProperty("decred")) {
28906
+ if (properties.transaction === 1)
28907
+ return "transaction: multiple values";
28908
+ properties.transaction = 1;
28909
+ {
28910
+ var error = $root.TW.DecredV2.Proto.Transaction.verify(message.decred);
28911
+ if (error)
28912
+ return "decred." + error;
28913
+ }
28914
+ }
28891
28915
  return null;
28892
28916
  };
28893
28917
 
@@ -29063,6 +29087,11 @@
29063
29087
  throw TypeError(".TW.BitcoinV2.Proto.SigningOutput.zcash: object expected");
29064
29088
  message.zcash = $root.TW.Zcash.Proto.Transaction.fromObject(object.zcash);
29065
29089
  }
29090
+ if (object.decred != null) {
29091
+ if (typeof object.decred !== "object")
29092
+ throw TypeError(".TW.BitcoinV2.Proto.SigningOutput.decred: object expected");
29093
+ message.decred = $root.TW.DecredV2.Proto.Transaction.fromObject(object.decred);
29094
+ }
29066
29095
  return message;
29067
29096
  };
29068
29097
 
@@ -29110,65 +29139,1142 @@
29110
29139
  var long = new $util.Long(0, 0, false);
29111
29140
  object.fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
29112
29141
  } else
29113
- object.fee = options.longs === String ? "0" : 0;
29114
- object.psbt = null;
29142
+ object.fee = options.longs === String ? "0" : 0;
29143
+ object.psbt = null;
29144
+ }
29145
+ if (message.error != null && message.hasOwnProperty("error"))
29146
+ object.error = options.enums === String ? $root.TW.Common.Proto.SigningError[message.error] : message.error;
29147
+ if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
29148
+ object.errorMessage = message.errorMessage;
29149
+ if (message.encoded != null && message.hasOwnProperty("encoded"))
29150
+ object.encoded = options.bytes === String ? $util.base64.encode(message.encoded, 0, message.encoded.length) : options.bytes === Array ? Array.prototype.slice.call(message.encoded) : message.encoded;
29151
+ if (message.txid != null && message.hasOwnProperty("txid"))
29152
+ object.txid = options.bytes === String ? $util.base64.encode(message.txid, 0, message.txid.length) : options.bytes === Array ? Array.prototype.slice.call(message.txid) : message.txid;
29153
+ if (message.vsize != null && message.hasOwnProperty("vsize"))
29154
+ if (typeof message.vsize === "number")
29155
+ object.vsize = options.longs === String ? String(message.vsize) : message.vsize;
29156
+ else
29157
+ object.vsize = options.longs === String ? $util.Long.prototype.toString.call(message.vsize) : options.longs === Number ? new $util.LongBits(message.vsize.low >>> 0, message.vsize.high >>> 0).toNumber(true) : message.vsize;
29158
+ if (message.weight != null && message.hasOwnProperty("weight"))
29159
+ if (typeof message.weight === "number")
29160
+ object.weight = options.longs === String ? String(message.weight) : message.weight;
29161
+ else
29162
+ object.weight = options.longs === String ? $util.Long.prototype.toString.call(message.weight) : options.longs === Number ? new $util.LongBits(message.weight.low >>> 0, message.weight.high >>> 0).toNumber(true) : message.weight;
29163
+ if (message.fee != null && message.hasOwnProperty("fee"))
29164
+ if (typeof message.fee === "number")
29165
+ object.fee = options.longs === String ? String(message.fee) : message.fee;
29166
+ else
29167
+ object.fee = options.longs === String ? $util.Long.prototype.toString.call(message.fee) : options.longs === Number ? new $util.LongBits(message.fee.low >>> 0, message.fee.high >>> 0).toNumber() : message.fee;
29168
+ if (message.psbt != null && message.hasOwnProperty("psbt"))
29169
+ object.psbt = $root.TW.BitcoinV2.Proto.Psbt.toObject(message.psbt, options);
29170
+ if (message.bitcoin != null && message.hasOwnProperty("bitcoin")) {
29171
+ object.bitcoin = $root.TW.Utxo.Proto.Transaction.toObject(message.bitcoin, options);
29172
+ if (options.oneofs)
29173
+ object.transaction = "bitcoin";
29174
+ }
29175
+ if (message.zcash != null && message.hasOwnProperty("zcash")) {
29176
+ object.zcash = $root.TW.Zcash.Proto.Transaction.toObject(message.zcash, options);
29177
+ if (options.oneofs)
29178
+ object.transaction = "zcash";
29179
+ }
29180
+ if (message.decred != null && message.hasOwnProperty("decred")) {
29181
+ object.decred = $root.TW.DecredV2.Proto.Transaction.toObject(message.decred, options);
29182
+ if (options.oneofs)
29183
+ object.transaction = "decred";
29184
+ }
29185
+ return object;
29186
+ };
29187
+
29188
+ /**
29189
+ * Converts this SigningOutput to JSON.
29190
+ * @function toJSON
29191
+ * @memberof TW.BitcoinV2.Proto.SigningOutput
29192
+ * @instance
29193
+ * @returns {Object.<string,*>} JSON object
29194
+ */
29195
+ SigningOutput.prototype.toJSON = function toJSON() {
29196
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
29197
+ };
29198
+
29199
+ return SigningOutput;
29200
+ })();
29201
+
29202
+ return Proto;
29203
+ })();
29204
+
29205
+ return BitcoinV2;
29206
+ })();
29207
+
29208
+ TW.DecredV2 = (function() {
29209
+
29210
+ /**
29211
+ * Namespace DecredV2.
29212
+ * @memberof TW
29213
+ * @namespace
29214
+ */
29215
+ var DecredV2 = {};
29216
+
29217
+ DecredV2.Proto = (function() {
29218
+
29219
+ /**
29220
+ * Namespace Proto.
29221
+ * @memberof TW.DecredV2
29222
+ * @namespace
29223
+ */
29224
+ var Proto = {};
29225
+
29226
+ Proto.OutPoint = (function() {
29227
+
29228
+ /**
29229
+ * Properties of an OutPoint.
29230
+ * @memberof TW.DecredV2.Proto
29231
+ * @interface IOutPoint
29232
+ * @property {Uint8Array|null} [hash] OutPoint hash
29233
+ * @property {number|null} [vout] OutPoint vout
29234
+ * @property {number|null} [tree] OutPoint tree
29235
+ */
29236
+
29237
+ /**
29238
+ * Constructs a new OutPoint.
29239
+ * @memberof TW.DecredV2.Proto
29240
+ * @classdesc Represents an OutPoint.
29241
+ * @implements IOutPoint
29242
+ * @constructor
29243
+ * @param {TW.DecredV2.Proto.IOutPoint=} [properties] Properties to set
29244
+ */
29245
+ function OutPoint(properties) {
29246
+ if (properties)
29247
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
29248
+ if (properties[keys[i]] != null)
29249
+ this[keys[i]] = properties[keys[i]];
29250
+ }
29251
+
29252
+ /**
29253
+ * OutPoint hash.
29254
+ * @member {Uint8Array} hash
29255
+ * @memberof TW.DecredV2.Proto.OutPoint
29256
+ * @instance
29257
+ */
29258
+ OutPoint.prototype.hash = $util.newBuffer([]);
29259
+
29260
+ /**
29261
+ * OutPoint vout.
29262
+ * @member {number} vout
29263
+ * @memberof TW.DecredV2.Proto.OutPoint
29264
+ * @instance
29265
+ */
29266
+ OutPoint.prototype.vout = 0;
29267
+
29268
+ /**
29269
+ * OutPoint tree.
29270
+ * @member {number} tree
29271
+ * @memberof TW.DecredV2.Proto.OutPoint
29272
+ * @instance
29273
+ */
29274
+ OutPoint.prototype.tree = 0;
29275
+
29276
+ /**
29277
+ * Creates a new OutPoint instance using the specified properties.
29278
+ * @function create
29279
+ * @memberof TW.DecredV2.Proto.OutPoint
29280
+ * @static
29281
+ * @param {TW.DecredV2.Proto.IOutPoint=} [properties] Properties to set
29282
+ * @returns {TW.DecredV2.Proto.OutPoint} OutPoint instance
29283
+ */
29284
+ OutPoint.create = function create(properties) {
29285
+ return new OutPoint(properties);
29286
+ };
29287
+
29288
+ /**
29289
+ * Encodes the specified OutPoint message. Does not implicitly {@link TW.DecredV2.Proto.OutPoint.verify|verify} messages.
29290
+ * @function encode
29291
+ * @memberof TW.DecredV2.Proto.OutPoint
29292
+ * @static
29293
+ * @param {TW.DecredV2.Proto.IOutPoint} message OutPoint message or plain object to encode
29294
+ * @param {$protobuf.Writer} [writer] Writer to encode to
29295
+ * @returns {$protobuf.Writer} Writer
29296
+ */
29297
+ OutPoint.encode = function encode(message, writer) {
29298
+ if (!writer)
29299
+ writer = $Writer.create();
29300
+ if (message.hash != null && Object.hasOwnProperty.call(message, "hash"))
29301
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash);
29302
+ if (message.vout != null && Object.hasOwnProperty.call(message, "vout"))
29303
+ writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.vout);
29304
+ if (message.tree != null && Object.hasOwnProperty.call(message, "tree"))
29305
+ writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.tree);
29306
+ return writer;
29307
+ };
29308
+
29309
+ /**
29310
+ * Decodes an OutPoint message from the specified reader or buffer.
29311
+ * @function decode
29312
+ * @memberof TW.DecredV2.Proto.OutPoint
29313
+ * @static
29314
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
29315
+ * @param {number} [length] Message length if known beforehand
29316
+ * @returns {TW.DecredV2.Proto.OutPoint} OutPoint
29317
+ * @throws {Error} If the payload is not a reader or valid buffer
29318
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
29319
+ */
29320
+ OutPoint.decode = function decode(reader, length) {
29321
+ if (!(reader instanceof $Reader))
29322
+ reader = $Reader.create(reader);
29323
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.DecredV2.Proto.OutPoint();
29324
+ while (reader.pos < end) {
29325
+ var tag = reader.uint32();
29326
+ switch (tag >>> 3) {
29327
+ case 1:
29328
+ message.hash = reader.bytes();
29329
+ break;
29330
+ case 2:
29331
+ message.vout = reader.uint32();
29332
+ break;
29333
+ case 3:
29334
+ message.tree = reader.uint32();
29335
+ break;
29336
+ default:
29337
+ reader.skipType(tag & 7);
29338
+ break;
29339
+ }
29340
+ }
29341
+ return message;
29342
+ };
29343
+
29344
+ /**
29345
+ * Verifies an OutPoint message.
29346
+ * @function verify
29347
+ * @memberof TW.DecredV2.Proto.OutPoint
29348
+ * @static
29349
+ * @param {Object.<string,*>} message Plain object to verify
29350
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
29351
+ */
29352
+ OutPoint.verify = function verify(message) {
29353
+ if (typeof message !== "object" || message === null)
29354
+ return "object expected";
29355
+ if (message.hash != null && message.hasOwnProperty("hash"))
29356
+ if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash)))
29357
+ return "hash: buffer expected";
29358
+ if (message.vout != null && message.hasOwnProperty("vout"))
29359
+ if (!$util.isInteger(message.vout))
29360
+ return "vout: integer expected";
29361
+ if (message.tree != null && message.hasOwnProperty("tree"))
29362
+ if (!$util.isInteger(message.tree))
29363
+ return "tree: integer expected";
29364
+ return null;
29365
+ };
29366
+
29367
+ /**
29368
+ * Creates an OutPoint message from a plain object. Also converts values to their respective internal types.
29369
+ * @function fromObject
29370
+ * @memberof TW.DecredV2.Proto.OutPoint
29371
+ * @static
29372
+ * @param {Object.<string,*>} object Plain object
29373
+ * @returns {TW.DecredV2.Proto.OutPoint} OutPoint
29374
+ */
29375
+ OutPoint.fromObject = function fromObject(object) {
29376
+ if (object instanceof $root.TW.DecredV2.Proto.OutPoint)
29377
+ return object;
29378
+ var message = new $root.TW.DecredV2.Proto.OutPoint();
29379
+ if (object.hash != null)
29380
+ if (typeof object.hash === "string")
29381
+ $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0);
29382
+ else if (object.hash.length)
29383
+ message.hash = object.hash;
29384
+ if (object.vout != null)
29385
+ message.vout = object.vout >>> 0;
29386
+ if (object.tree != null)
29387
+ message.tree = object.tree >>> 0;
29388
+ return message;
29389
+ };
29390
+
29391
+ /**
29392
+ * Creates a plain object from an OutPoint message. Also converts values to other types if specified.
29393
+ * @function toObject
29394
+ * @memberof TW.DecredV2.Proto.OutPoint
29395
+ * @static
29396
+ * @param {TW.DecredV2.Proto.OutPoint} message OutPoint
29397
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
29398
+ * @returns {Object.<string,*>} Plain object
29399
+ */
29400
+ OutPoint.toObject = function toObject(message, options) {
29401
+ if (!options)
29402
+ options = {};
29403
+ var object = {};
29404
+ if (options.defaults) {
29405
+ if (options.bytes === String)
29406
+ object.hash = "";
29407
+ else {
29408
+ object.hash = [];
29409
+ if (options.bytes !== Array)
29410
+ object.hash = $util.newBuffer(object.hash);
29411
+ }
29412
+ object.vout = 0;
29413
+ object.tree = 0;
29414
+ }
29415
+ if (message.hash != null && message.hasOwnProperty("hash"))
29416
+ object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash;
29417
+ if (message.vout != null && message.hasOwnProperty("vout"))
29418
+ object.vout = message.vout;
29419
+ if (message.tree != null && message.hasOwnProperty("tree"))
29420
+ object.tree = message.tree;
29421
+ return object;
29422
+ };
29423
+
29424
+ /**
29425
+ * Converts this OutPoint to JSON.
29426
+ * @function toJSON
29427
+ * @memberof TW.DecredV2.Proto.OutPoint
29428
+ * @instance
29429
+ * @returns {Object.<string,*>} JSON object
29430
+ */
29431
+ OutPoint.prototype.toJSON = function toJSON() {
29432
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
29433
+ };
29434
+
29435
+ return OutPoint;
29436
+ })();
29437
+
29438
+ Proto.Transaction = (function() {
29439
+
29440
+ /**
29441
+ * Properties of a Transaction.
29442
+ * @memberof TW.DecredV2.Proto
29443
+ * @interface ITransaction
29444
+ * @property {number|null} [serializeType] Transaction serializeType
29445
+ * @property {number|null} [version] Transaction version
29446
+ * @property {Array.<TW.DecredV2.Proto.ITransactionInput>|null} [inputs] Transaction inputs
29447
+ * @property {Array.<TW.DecredV2.Proto.ITransactionOutput>|null} [outputs] Transaction outputs
29448
+ * @property {number|null} [lockTime] Transaction lockTime
29449
+ * @property {number|null} [expiry] Transaction expiry
29450
+ */
29451
+
29452
+ /**
29453
+ * Constructs a new Transaction.
29454
+ * @memberof TW.DecredV2.Proto
29455
+ * @classdesc Represents a Transaction.
29456
+ * @implements ITransaction
29457
+ * @constructor
29458
+ * @param {TW.DecredV2.Proto.ITransaction=} [properties] Properties to set
29459
+ */
29460
+ function Transaction(properties) {
29461
+ this.inputs = [];
29462
+ this.outputs = [];
29463
+ if (properties)
29464
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
29465
+ if (properties[keys[i]] != null)
29466
+ this[keys[i]] = properties[keys[i]];
29467
+ }
29468
+
29469
+ /**
29470
+ * Transaction serializeType.
29471
+ * @member {number} serializeType
29472
+ * @memberof TW.DecredV2.Proto.Transaction
29473
+ * @instance
29474
+ */
29475
+ Transaction.prototype.serializeType = 0;
29476
+
29477
+ /**
29478
+ * Transaction version.
29479
+ * @member {number} version
29480
+ * @memberof TW.DecredV2.Proto.Transaction
29481
+ * @instance
29482
+ */
29483
+ Transaction.prototype.version = 0;
29484
+
29485
+ /**
29486
+ * Transaction inputs.
29487
+ * @member {Array.<TW.DecredV2.Proto.ITransactionInput>} inputs
29488
+ * @memberof TW.DecredV2.Proto.Transaction
29489
+ * @instance
29490
+ */
29491
+ Transaction.prototype.inputs = $util.emptyArray;
29492
+
29493
+ /**
29494
+ * Transaction outputs.
29495
+ * @member {Array.<TW.DecredV2.Proto.ITransactionOutput>} outputs
29496
+ * @memberof TW.DecredV2.Proto.Transaction
29497
+ * @instance
29498
+ */
29499
+ Transaction.prototype.outputs = $util.emptyArray;
29500
+
29501
+ /**
29502
+ * Transaction lockTime.
29503
+ * @member {number} lockTime
29504
+ * @memberof TW.DecredV2.Proto.Transaction
29505
+ * @instance
29506
+ */
29507
+ Transaction.prototype.lockTime = 0;
29508
+
29509
+ /**
29510
+ * Transaction expiry.
29511
+ * @member {number} expiry
29512
+ * @memberof TW.DecredV2.Proto.Transaction
29513
+ * @instance
29514
+ */
29515
+ Transaction.prototype.expiry = 0;
29516
+
29517
+ /**
29518
+ * Creates a new Transaction instance using the specified properties.
29519
+ * @function create
29520
+ * @memberof TW.DecredV2.Proto.Transaction
29521
+ * @static
29522
+ * @param {TW.DecredV2.Proto.ITransaction=} [properties] Properties to set
29523
+ * @returns {TW.DecredV2.Proto.Transaction} Transaction instance
29524
+ */
29525
+ Transaction.create = function create(properties) {
29526
+ return new Transaction(properties);
29527
+ };
29528
+
29529
+ /**
29530
+ * Encodes the specified Transaction message. Does not implicitly {@link TW.DecredV2.Proto.Transaction.verify|verify} messages.
29531
+ * @function encode
29532
+ * @memberof TW.DecredV2.Proto.Transaction
29533
+ * @static
29534
+ * @param {TW.DecredV2.Proto.ITransaction} message Transaction message or plain object to encode
29535
+ * @param {$protobuf.Writer} [writer] Writer to encode to
29536
+ * @returns {$protobuf.Writer} Writer
29537
+ */
29538
+ Transaction.encode = function encode(message, writer) {
29539
+ if (!writer)
29540
+ writer = $Writer.create();
29541
+ if (message.serializeType != null && Object.hasOwnProperty.call(message, "serializeType"))
29542
+ writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.serializeType);
29543
+ if (message.version != null && Object.hasOwnProperty.call(message, "version"))
29544
+ writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.version);
29545
+ if (message.inputs != null && message.inputs.length)
29546
+ for (var i = 0; i < message.inputs.length; ++i)
29547
+ $root.TW.DecredV2.Proto.TransactionInput.encode(message.inputs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
29548
+ if (message.outputs != null && message.outputs.length)
29549
+ for (var i = 0; i < message.outputs.length; ++i)
29550
+ $root.TW.DecredV2.Proto.TransactionOutput.encode(message.outputs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
29551
+ if (message.lockTime != null && Object.hasOwnProperty.call(message, "lockTime"))
29552
+ writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.lockTime);
29553
+ if (message.expiry != null && Object.hasOwnProperty.call(message, "expiry"))
29554
+ writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.expiry);
29555
+ return writer;
29556
+ };
29557
+
29558
+ /**
29559
+ * Decodes a Transaction message from the specified reader or buffer.
29560
+ * @function decode
29561
+ * @memberof TW.DecredV2.Proto.Transaction
29562
+ * @static
29563
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
29564
+ * @param {number} [length] Message length if known beforehand
29565
+ * @returns {TW.DecredV2.Proto.Transaction} Transaction
29566
+ * @throws {Error} If the payload is not a reader or valid buffer
29567
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
29568
+ */
29569
+ Transaction.decode = function decode(reader, length) {
29570
+ if (!(reader instanceof $Reader))
29571
+ reader = $Reader.create(reader);
29572
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.DecredV2.Proto.Transaction();
29573
+ while (reader.pos < end) {
29574
+ var tag = reader.uint32();
29575
+ switch (tag >>> 3) {
29576
+ case 1:
29577
+ message.serializeType = reader.uint32();
29578
+ break;
29579
+ case 2:
29580
+ message.version = reader.uint32();
29581
+ break;
29582
+ case 3:
29583
+ if (!(message.inputs && message.inputs.length))
29584
+ message.inputs = [];
29585
+ message.inputs.push($root.TW.DecredV2.Proto.TransactionInput.decode(reader, reader.uint32()));
29586
+ break;
29587
+ case 4:
29588
+ if (!(message.outputs && message.outputs.length))
29589
+ message.outputs = [];
29590
+ message.outputs.push($root.TW.DecredV2.Proto.TransactionOutput.decode(reader, reader.uint32()));
29591
+ break;
29592
+ case 5:
29593
+ message.lockTime = reader.uint32();
29594
+ break;
29595
+ case 6:
29596
+ message.expiry = reader.uint32();
29597
+ break;
29598
+ default:
29599
+ reader.skipType(tag & 7);
29600
+ break;
29601
+ }
29602
+ }
29603
+ return message;
29604
+ };
29605
+
29606
+ /**
29607
+ * Verifies a Transaction message.
29608
+ * @function verify
29609
+ * @memberof TW.DecredV2.Proto.Transaction
29610
+ * @static
29611
+ * @param {Object.<string,*>} message Plain object to verify
29612
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
29613
+ */
29614
+ Transaction.verify = function verify(message) {
29615
+ if (typeof message !== "object" || message === null)
29616
+ return "object expected";
29617
+ if (message.serializeType != null && message.hasOwnProperty("serializeType"))
29618
+ if (!$util.isInteger(message.serializeType))
29619
+ return "serializeType: integer expected";
29620
+ if (message.version != null && message.hasOwnProperty("version"))
29621
+ if (!$util.isInteger(message.version))
29622
+ return "version: integer expected";
29623
+ if (message.inputs != null && message.hasOwnProperty("inputs")) {
29624
+ if (!Array.isArray(message.inputs))
29625
+ return "inputs: array expected";
29626
+ for (var i = 0; i < message.inputs.length; ++i) {
29627
+ var error = $root.TW.DecredV2.Proto.TransactionInput.verify(message.inputs[i]);
29628
+ if (error)
29629
+ return "inputs." + error;
29630
+ }
29631
+ }
29632
+ if (message.outputs != null && message.hasOwnProperty("outputs")) {
29633
+ if (!Array.isArray(message.outputs))
29634
+ return "outputs: array expected";
29635
+ for (var i = 0; i < message.outputs.length; ++i) {
29636
+ var error = $root.TW.DecredV2.Proto.TransactionOutput.verify(message.outputs[i]);
29637
+ if (error)
29638
+ return "outputs." + error;
29639
+ }
29640
+ }
29641
+ if (message.lockTime != null && message.hasOwnProperty("lockTime"))
29642
+ if (!$util.isInteger(message.lockTime))
29643
+ return "lockTime: integer expected";
29644
+ if (message.expiry != null && message.hasOwnProperty("expiry"))
29645
+ if (!$util.isInteger(message.expiry))
29646
+ return "expiry: integer expected";
29647
+ return null;
29648
+ };
29649
+
29650
+ /**
29651
+ * Creates a Transaction message from a plain object. Also converts values to their respective internal types.
29652
+ * @function fromObject
29653
+ * @memberof TW.DecredV2.Proto.Transaction
29654
+ * @static
29655
+ * @param {Object.<string,*>} object Plain object
29656
+ * @returns {TW.DecredV2.Proto.Transaction} Transaction
29657
+ */
29658
+ Transaction.fromObject = function fromObject(object) {
29659
+ if (object instanceof $root.TW.DecredV2.Proto.Transaction)
29660
+ return object;
29661
+ var message = new $root.TW.DecredV2.Proto.Transaction();
29662
+ if (object.serializeType != null)
29663
+ message.serializeType = object.serializeType >>> 0;
29664
+ if (object.version != null)
29665
+ message.version = object.version >>> 0;
29666
+ if (object.inputs) {
29667
+ if (!Array.isArray(object.inputs))
29668
+ throw TypeError(".TW.DecredV2.Proto.Transaction.inputs: array expected");
29669
+ message.inputs = [];
29670
+ for (var i = 0; i < object.inputs.length; ++i) {
29671
+ if (typeof object.inputs[i] !== "object")
29672
+ throw TypeError(".TW.DecredV2.Proto.Transaction.inputs: object expected");
29673
+ message.inputs[i] = $root.TW.DecredV2.Proto.TransactionInput.fromObject(object.inputs[i]);
29674
+ }
29675
+ }
29676
+ if (object.outputs) {
29677
+ if (!Array.isArray(object.outputs))
29678
+ throw TypeError(".TW.DecredV2.Proto.Transaction.outputs: array expected");
29679
+ message.outputs = [];
29680
+ for (var i = 0; i < object.outputs.length; ++i) {
29681
+ if (typeof object.outputs[i] !== "object")
29682
+ throw TypeError(".TW.DecredV2.Proto.Transaction.outputs: object expected");
29683
+ message.outputs[i] = $root.TW.DecredV2.Proto.TransactionOutput.fromObject(object.outputs[i]);
29684
+ }
29685
+ }
29686
+ if (object.lockTime != null)
29687
+ message.lockTime = object.lockTime >>> 0;
29688
+ if (object.expiry != null)
29689
+ message.expiry = object.expiry >>> 0;
29690
+ return message;
29691
+ };
29692
+
29693
+ /**
29694
+ * Creates a plain object from a Transaction message. Also converts values to other types if specified.
29695
+ * @function toObject
29696
+ * @memberof TW.DecredV2.Proto.Transaction
29697
+ * @static
29698
+ * @param {TW.DecredV2.Proto.Transaction} message Transaction
29699
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
29700
+ * @returns {Object.<string,*>} Plain object
29701
+ */
29702
+ Transaction.toObject = function toObject(message, options) {
29703
+ if (!options)
29704
+ options = {};
29705
+ var object = {};
29706
+ if (options.arrays || options.defaults) {
29707
+ object.inputs = [];
29708
+ object.outputs = [];
29709
+ }
29710
+ if (options.defaults) {
29711
+ object.serializeType = 0;
29712
+ object.version = 0;
29713
+ object.lockTime = 0;
29714
+ object.expiry = 0;
29715
+ }
29716
+ if (message.serializeType != null && message.hasOwnProperty("serializeType"))
29717
+ object.serializeType = message.serializeType;
29718
+ if (message.version != null && message.hasOwnProperty("version"))
29719
+ object.version = message.version;
29720
+ if (message.inputs && message.inputs.length) {
29721
+ object.inputs = [];
29722
+ for (var j = 0; j < message.inputs.length; ++j)
29723
+ object.inputs[j] = $root.TW.DecredV2.Proto.TransactionInput.toObject(message.inputs[j], options);
29724
+ }
29725
+ if (message.outputs && message.outputs.length) {
29726
+ object.outputs = [];
29727
+ for (var j = 0; j < message.outputs.length; ++j)
29728
+ object.outputs[j] = $root.TW.DecredV2.Proto.TransactionOutput.toObject(message.outputs[j], options);
29729
+ }
29730
+ if (message.lockTime != null && message.hasOwnProperty("lockTime"))
29731
+ object.lockTime = message.lockTime;
29732
+ if (message.expiry != null && message.hasOwnProperty("expiry"))
29733
+ object.expiry = message.expiry;
29734
+ return object;
29735
+ };
29736
+
29737
+ /**
29738
+ * Converts this Transaction to JSON.
29739
+ * @function toJSON
29740
+ * @memberof TW.DecredV2.Proto.Transaction
29741
+ * @instance
29742
+ * @returns {Object.<string,*>} JSON object
29743
+ */
29744
+ Transaction.prototype.toJSON = function toJSON() {
29745
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
29746
+ };
29747
+
29748
+ return Transaction;
29749
+ })();
29750
+
29751
+ Proto.TransactionInput = (function() {
29752
+
29753
+ /**
29754
+ * Properties of a TransactionInput.
29755
+ * @memberof TW.DecredV2.Proto
29756
+ * @interface ITransactionInput
29757
+ * @property {TW.DecredV2.Proto.IOutPoint|null} [outPoint] TransactionInput outPoint
29758
+ * @property {number|null} [sequence] TransactionInput sequence
29759
+ * @property {Long|null} [value] TransactionInput value
29760
+ * @property {number|null} [blockHeight] TransactionInput blockHeight
29761
+ * @property {number|null} [blockIndex] TransactionInput blockIndex
29762
+ * @property {Uint8Array|null} [scriptSig] TransactionInput scriptSig
29763
+ */
29764
+
29765
+ /**
29766
+ * Constructs a new TransactionInput.
29767
+ * @memberof TW.DecredV2.Proto
29768
+ * @classdesc Represents a TransactionInput.
29769
+ * @implements ITransactionInput
29770
+ * @constructor
29771
+ * @param {TW.DecredV2.Proto.ITransactionInput=} [properties] Properties to set
29772
+ */
29773
+ function TransactionInput(properties) {
29774
+ if (properties)
29775
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
29776
+ if (properties[keys[i]] != null)
29777
+ this[keys[i]] = properties[keys[i]];
29778
+ }
29779
+
29780
+ /**
29781
+ * TransactionInput outPoint.
29782
+ * @member {TW.DecredV2.Proto.IOutPoint|null|undefined} outPoint
29783
+ * @memberof TW.DecredV2.Proto.TransactionInput
29784
+ * @instance
29785
+ */
29786
+ TransactionInput.prototype.outPoint = null;
29787
+
29788
+ /**
29789
+ * TransactionInput sequence.
29790
+ * @member {number} sequence
29791
+ * @memberof TW.DecredV2.Proto.TransactionInput
29792
+ * @instance
29793
+ */
29794
+ TransactionInput.prototype.sequence = 0;
29795
+
29796
+ /**
29797
+ * TransactionInput value.
29798
+ * @member {Long} value
29799
+ * @memberof TW.DecredV2.Proto.TransactionInput
29800
+ * @instance
29801
+ */
29802
+ TransactionInput.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
29803
+
29804
+ /**
29805
+ * TransactionInput blockHeight.
29806
+ * @member {number} blockHeight
29807
+ * @memberof TW.DecredV2.Proto.TransactionInput
29808
+ * @instance
29809
+ */
29810
+ TransactionInput.prototype.blockHeight = 0;
29811
+
29812
+ /**
29813
+ * TransactionInput blockIndex.
29814
+ * @member {number} blockIndex
29815
+ * @memberof TW.DecredV2.Proto.TransactionInput
29816
+ * @instance
29817
+ */
29818
+ TransactionInput.prototype.blockIndex = 0;
29819
+
29820
+ /**
29821
+ * TransactionInput scriptSig.
29822
+ * @member {Uint8Array} scriptSig
29823
+ * @memberof TW.DecredV2.Proto.TransactionInput
29824
+ * @instance
29825
+ */
29826
+ TransactionInput.prototype.scriptSig = $util.newBuffer([]);
29827
+
29828
+ /**
29829
+ * Creates a new TransactionInput instance using the specified properties.
29830
+ * @function create
29831
+ * @memberof TW.DecredV2.Proto.TransactionInput
29832
+ * @static
29833
+ * @param {TW.DecredV2.Proto.ITransactionInput=} [properties] Properties to set
29834
+ * @returns {TW.DecredV2.Proto.TransactionInput} TransactionInput instance
29835
+ */
29836
+ TransactionInput.create = function create(properties) {
29837
+ return new TransactionInput(properties);
29838
+ };
29839
+
29840
+ /**
29841
+ * Encodes the specified TransactionInput message. Does not implicitly {@link TW.DecredV2.Proto.TransactionInput.verify|verify} messages.
29842
+ * @function encode
29843
+ * @memberof TW.DecredV2.Proto.TransactionInput
29844
+ * @static
29845
+ * @param {TW.DecredV2.Proto.ITransactionInput} message TransactionInput message or plain object to encode
29846
+ * @param {$protobuf.Writer} [writer] Writer to encode to
29847
+ * @returns {$protobuf.Writer} Writer
29848
+ */
29849
+ TransactionInput.encode = function encode(message, writer) {
29850
+ if (!writer)
29851
+ writer = $Writer.create();
29852
+ if (message.outPoint != null && Object.hasOwnProperty.call(message, "outPoint"))
29853
+ $root.TW.DecredV2.Proto.OutPoint.encode(message.outPoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
29854
+ if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence"))
29855
+ writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.sequence);
29856
+ if (message.value != null && Object.hasOwnProperty.call(message, "value"))
29857
+ writer.uint32(/* id 3, wireType 0 =*/24).int64(message.value);
29858
+ if (message.blockHeight != null && Object.hasOwnProperty.call(message, "blockHeight"))
29859
+ writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.blockHeight);
29860
+ if (message.blockIndex != null && Object.hasOwnProperty.call(message, "blockIndex"))
29861
+ writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.blockIndex);
29862
+ if (message.scriptSig != null && Object.hasOwnProperty.call(message, "scriptSig"))
29863
+ writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.scriptSig);
29864
+ return writer;
29865
+ };
29866
+
29867
+ /**
29868
+ * Decodes a TransactionInput message from the specified reader or buffer.
29869
+ * @function decode
29870
+ * @memberof TW.DecredV2.Proto.TransactionInput
29871
+ * @static
29872
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
29873
+ * @param {number} [length] Message length if known beforehand
29874
+ * @returns {TW.DecredV2.Proto.TransactionInput} TransactionInput
29875
+ * @throws {Error} If the payload is not a reader or valid buffer
29876
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
29877
+ */
29878
+ TransactionInput.decode = function decode(reader, length) {
29879
+ if (!(reader instanceof $Reader))
29880
+ reader = $Reader.create(reader);
29881
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.DecredV2.Proto.TransactionInput();
29882
+ while (reader.pos < end) {
29883
+ var tag = reader.uint32();
29884
+ switch (tag >>> 3) {
29885
+ case 1:
29886
+ message.outPoint = $root.TW.DecredV2.Proto.OutPoint.decode(reader, reader.uint32());
29887
+ break;
29888
+ case 2:
29889
+ message.sequence = reader.uint32();
29890
+ break;
29891
+ case 3:
29892
+ message.value = reader.int64();
29893
+ break;
29894
+ case 4:
29895
+ message.blockHeight = reader.uint32();
29896
+ break;
29897
+ case 5:
29898
+ message.blockIndex = reader.uint32();
29899
+ break;
29900
+ case 6:
29901
+ message.scriptSig = reader.bytes();
29902
+ break;
29903
+ default:
29904
+ reader.skipType(tag & 7);
29905
+ break;
29906
+ }
29907
+ }
29908
+ return message;
29909
+ };
29910
+
29911
+ /**
29912
+ * Verifies a TransactionInput message.
29913
+ * @function verify
29914
+ * @memberof TW.DecredV2.Proto.TransactionInput
29915
+ * @static
29916
+ * @param {Object.<string,*>} message Plain object to verify
29917
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
29918
+ */
29919
+ TransactionInput.verify = function verify(message) {
29920
+ if (typeof message !== "object" || message === null)
29921
+ return "object expected";
29922
+ if (message.outPoint != null && message.hasOwnProperty("outPoint")) {
29923
+ var error = $root.TW.DecredV2.Proto.OutPoint.verify(message.outPoint);
29924
+ if (error)
29925
+ return "outPoint." + error;
29926
+ }
29927
+ if (message.sequence != null && message.hasOwnProperty("sequence"))
29928
+ if (!$util.isInteger(message.sequence))
29929
+ return "sequence: integer expected";
29930
+ if (message.value != null && message.hasOwnProperty("value"))
29931
+ if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high)))
29932
+ return "value: integer|Long expected";
29933
+ if (message.blockHeight != null && message.hasOwnProperty("blockHeight"))
29934
+ if (!$util.isInteger(message.blockHeight))
29935
+ return "blockHeight: integer expected";
29936
+ if (message.blockIndex != null && message.hasOwnProperty("blockIndex"))
29937
+ if (!$util.isInteger(message.blockIndex))
29938
+ return "blockIndex: integer expected";
29939
+ if (message.scriptSig != null && message.hasOwnProperty("scriptSig"))
29940
+ if (!(message.scriptSig && typeof message.scriptSig.length === "number" || $util.isString(message.scriptSig)))
29941
+ return "scriptSig: buffer expected";
29942
+ return null;
29943
+ };
29944
+
29945
+ /**
29946
+ * Creates a TransactionInput message from a plain object. Also converts values to their respective internal types.
29947
+ * @function fromObject
29948
+ * @memberof TW.DecredV2.Proto.TransactionInput
29949
+ * @static
29950
+ * @param {Object.<string,*>} object Plain object
29951
+ * @returns {TW.DecredV2.Proto.TransactionInput} TransactionInput
29952
+ */
29953
+ TransactionInput.fromObject = function fromObject(object) {
29954
+ if (object instanceof $root.TW.DecredV2.Proto.TransactionInput)
29955
+ return object;
29956
+ var message = new $root.TW.DecredV2.Proto.TransactionInput();
29957
+ if (object.outPoint != null) {
29958
+ if (typeof object.outPoint !== "object")
29959
+ throw TypeError(".TW.DecredV2.Proto.TransactionInput.outPoint: object expected");
29960
+ message.outPoint = $root.TW.DecredV2.Proto.OutPoint.fromObject(object.outPoint);
29961
+ }
29962
+ if (object.sequence != null)
29963
+ message.sequence = object.sequence >>> 0;
29964
+ if (object.value != null)
29965
+ if ($util.Long)
29966
+ (message.value = $util.Long.fromValue(object.value)).unsigned = false;
29967
+ else if (typeof object.value === "string")
29968
+ message.value = parseInt(object.value, 10);
29969
+ else if (typeof object.value === "number")
29970
+ message.value = object.value;
29971
+ else if (typeof object.value === "object")
29972
+ message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber();
29973
+ if (object.blockHeight != null)
29974
+ message.blockHeight = object.blockHeight >>> 0;
29975
+ if (object.blockIndex != null)
29976
+ message.blockIndex = object.blockIndex >>> 0;
29977
+ if (object.scriptSig != null)
29978
+ if (typeof object.scriptSig === "string")
29979
+ $util.base64.decode(object.scriptSig, message.scriptSig = $util.newBuffer($util.base64.length(object.scriptSig)), 0);
29980
+ else if (object.scriptSig.length)
29981
+ message.scriptSig = object.scriptSig;
29982
+ return message;
29983
+ };
29984
+
29985
+ /**
29986
+ * Creates a plain object from a TransactionInput message. Also converts values to other types if specified.
29987
+ * @function toObject
29988
+ * @memberof TW.DecredV2.Proto.TransactionInput
29989
+ * @static
29990
+ * @param {TW.DecredV2.Proto.TransactionInput} message TransactionInput
29991
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
29992
+ * @returns {Object.<string,*>} Plain object
29993
+ */
29994
+ TransactionInput.toObject = function toObject(message, options) {
29995
+ if (!options)
29996
+ options = {};
29997
+ var object = {};
29998
+ if (options.defaults) {
29999
+ object.outPoint = null;
30000
+ object.sequence = 0;
30001
+ if ($util.Long) {
30002
+ var long = new $util.Long(0, 0, false);
30003
+ object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
30004
+ } else
30005
+ object.value = options.longs === String ? "0" : 0;
30006
+ object.blockHeight = 0;
30007
+ object.blockIndex = 0;
30008
+ if (options.bytes === String)
30009
+ object.scriptSig = "";
30010
+ else {
30011
+ object.scriptSig = [];
30012
+ if (options.bytes !== Array)
30013
+ object.scriptSig = $util.newBuffer(object.scriptSig);
30014
+ }
30015
+ }
30016
+ if (message.outPoint != null && message.hasOwnProperty("outPoint"))
30017
+ object.outPoint = $root.TW.DecredV2.Proto.OutPoint.toObject(message.outPoint, options);
30018
+ if (message.sequence != null && message.hasOwnProperty("sequence"))
30019
+ object.sequence = message.sequence;
30020
+ if (message.value != null && message.hasOwnProperty("value"))
30021
+ if (typeof message.value === "number")
30022
+ object.value = options.longs === String ? String(message.value) : message.value;
30023
+ else
30024
+ object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value;
30025
+ if (message.blockHeight != null && message.hasOwnProperty("blockHeight"))
30026
+ object.blockHeight = message.blockHeight;
30027
+ if (message.blockIndex != null && message.hasOwnProperty("blockIndex"))
30028
+ object.blockIndex = message.blockIndex;
30029
+ if (message.scriptSig != null && message.hasOwnProperty("scriptSig"))
30030
+ object.scriptSig = options.bytes === String ? $util.base64.encode(message.scriptSig, 0, message.scriptSig.length) : options.bytes === Array ? Array.prototype.slice.call(message.scriptSig) : message.scriptSig;
30031
+ return object;
30032
+ };
30033
+
30034
+ /**
30035
+ * Converts this TransactionInput to JSON.
30036
+ * @function toJSON
30037
+ * @memberof TW.DecredV2.Proto.TransactionInput
30038
+ * @instance
30039
+ * @returns {Object.<string,*>} JSON object
30040
+ */
30041
+ TransactionInput.prototype.toJSON = function toJSON() {
30042
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
30043
+ };
30044
+
30045
+ return TransactionInput;
30046
+ })();
30047
+
30048
+ Proto.TransactionOutput = (function() {
30049
+
30050
+ /**
30051
+ * Properties of a TransactionOutput.
30052
+ * @memberof TW.DecredV2.Proto
30053
+ * @interface ITransactionOutput
30054
+ * @property {Long|null} [value] TransactionOutput value
30055
+ * @property {number|null} [version] TransactionOutput version
30056
+ * @property {Uint8Array|null} [script] TransactionOutput script
30057
+ */
30058
+
30059
+ /**
30060
+ * Constructs a new TransactionOutput.
30061
+ * @memberof TW.DecredV2.Proto
30062
+ * @classdesc Represents a TransactionOutput.
30063
+ * @implements ITransactionOutput
30064
+ * @constructor
30065
+ * @param {TW.DecredV2.Proto.ITransactionOutput=} [properties] Properties to set
30066
+ */
30067
+ function TransactionOutput(properties) {
30068
+ if (properties)
30069
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
30070
+ if (properties[keys[i]] != null)
30071
+ this[keys[i]] = properties[keys[i]];
30072
+ }
30073
+
30074
+ /**
30075
+ * TransactionOutput value.
30076
+ * @member {Long} value
30077
+ * @memberof TW.DecredV2.Proto.TransactionOutput
30078
+ * @instance
30079
+ */
30080
+ TransactionOutput.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
30081
+
30082
+ /**
30083
+ * TransactionOutput version.
30084
+ * @member {number} version
30085
+ * @memberof TW.DecredV2.Proto.TransactionOutput
30086
+ * @instance
30087
+ */
30088
+ TransactionOutput.prototype.version = 0;
30089
+
30090
+ /**
30091
+ * TransactionOutput script.
30092
+ * @member {Uint8Array} script
30093
+ * @memberof TW.DecredV2.Proto.TransactionOutput
30094
+ * @instance
30095
+ */
30096
+ TransactionOutput.prototype.script = $util.newBuffer([]);
30097
+
30098
+ /**
30099
+ * Creates a new TransactionOutput instance using the specified properties.
30100
+ * @function create
30101
+ * @memberof TW.DecredV2.Proto.TransactionOutput
30102
+ * @static
30103
+ * @param {TW.DecredV2.Proto.ITransactionOutput=} [properties] Properties to set
30104
+ * @returns {TW.DecredV2.Proto.TransactionOutput} TransactionOutput instance
30105
+ */
30106
+ TransactionOutput.create = function create(properties) {
30107
+ return new TransactionOutput(properties);
30108
+ };
30109
+
30110
+ /**
30111
+ * Encodes the specified TransactionOutput message. Does not implicitly {@link TW.DecredV2.Proto.TransactionOutput.verify|verify} messages.
30112
+ * @function encode
30113
+ * @memberof TW.DecredV2.Proto.TransactionOutput
30114
+ * @static
30115
+ * @param {TW.DecredV2.Proto.ITransactionOutput} message TransactionOutput message or plain object to encode
30116
+ * @param {$protobuf.Writer} [writer] Writer to encode to
30117
+ * @returns {$protobuf.Writer} Writer
30118
+ */
30119
+ TransactionOutput.encode = function encode(message, writer) {
30120
+ if (!writer)
30121
+ writer = $Writer.create();
30122
+ if (message.value != null && Object.hasOwnProperty.call(message, "value"))
30123
+ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value);
30124
+ if (message.version != null && Object.hasOwnProperty.call(message, "version"))
30125
+ writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.version);
30126
+ if (message.script != null && Object.hasOwnProperty.call(message, "script"))
30127
+ writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.script);
30128
+ return writer;
30129
+ };
30130
+
30131
+ /**
30132
+ * Decodes a TransactionOutput message from the specified reader or buffer.
30133
+ * @function decode
30134
+ * @memberof TW.DecredV2.Proto.TransactionOutput
30135
+ * @static
30136
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
30137
+ * @param {number} [length] Message length if known beforehand
30138
+ * @returns {TW.DecredV2.Proto.TransactionOutput} TransactionOutput
30139
+ * @throws {Error} If the payload is not a reader or valid buffer
30140
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
30141
+ */
30142
+ TransactionOutput.decode = function decode(reader, length) {
30143
+ if (!(reader instanceof $Reader))
30144
+ reader = $Reader.create(reader);
30145
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.DecredV2.Proto.TransactionOutput();
30146
+ while (reader.pos < end) {
30147
+ var tag = reader.uint32();
30148
+ switch (tag >>> 3) {
30149
+ case 1:
30150
+ message.value = reader.int64();
30151
+ break;
30152
+ case 2:
30153
+ message.version = reader.uint32();
30154
+ break;
30155
+ case 3:
30156
+ message.script = reader.bytes();
30157
+ break;
30158
+ default:
30159
+ reader.skipType(tag & 7);
30160
+ break;
30161
+ }
30162
+ }
30163
+ return message;
30164
+ };
30165
+
30166
+ /**
30167
+ * Verifies a TransactionOutput message.
30168
+ * @function verify
30169
+ * @memberof TW.DecredV2.Proto.TransactionOutput
30170
+ * @static
30171
+ * @param {Object.<string,*>} message Plain object to verify
30172
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
30173
+ */
30174
+ TransactionOutput.verify = function verify(message) {
30175
+ if (typeof message !== "object" || message === null)
30176
+ return "object expected";
30177
+ if (message.value != null && message.hasOwnProperty("value"))
30178
+ if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high)))
30179
+ return "value: integer|Long expected";
30180
+ if (message.version != null && message.hasOwnProperty("version"))
30181
+ if (!$util.isInteger(message.version))
30182
+ return "version: integer expected";
30183
+ if (message.script != null && message.hasOwnProperty("script"))
30184
+ if (!(message.script && typeof message.script.length === "number" || $util.isString(message.script)))
30185
+ return "script: buffer expected";
30186
+ return null;
30187
+ };
30188
+
30189
+ /**
30190
+ * Creates a TransactionOutput message from a plain object. Also converts values to their respective internal types.
30191
+ * @function fromObject
30192
+ * @memberof TW.DecredV2.Proto.TransactionOutput
30193
+ * @static
30194
+ * @param {Object.<string,*>} object Plain object
30195
+ * @returns {TW.DecredV2.Proto.TransactionOutput} TransactionOutput
30196
+ */
30197
+ TransactionOutput.fromObject = function fromObject(object) {
30198
+ if (object instanceof $root.TW.DecredV2.Proto.TransactionOutput)
30199
+ return object;
30200
+ var message = new $root.TW.DecredV2.Proto.TransactionOutput();
30201
+ if (object.value != null)
30202
+ if ($util.Long)
30203
+ (message.value = $util.Long.fromValue(object.value)).unsigned = false;
30204
+ else if (typeof object.value === "string")
30205
+ message.value = parseInt(object.value, 10);
30206
+ else if (typeof object.value === "number")
30207
+ message.value = object.value;
30208
+ else if (typeof object.value === "object")
30209
+ message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber();
30210
+ if (object.version != null)
30211
+ message.version = object.version >>> 0;
30212
+ if (object.script != null)
30213
+ if (typeof object.script === "string")
30214
+ $util.base64.decode(object.script, message.script = $util.newBuffer($util.base64.length(object.script)), 0);
30215
+ else if (object.script.length)
30216
+ message.script = object.script;
30217
+ return message;
30218
+ };
30219
+
30220
+ /**
30221
+ * Creates a plain object from a TransactionOutput message. Also converts values to other types if specified.
30222
+ * @function toObject
30223
+ * @memberof TW.DecredV2.Proto.TransactionOutput
30224
+ * @static
30225
+ * @param {TW.DecredV2.Proto.TransactionOutput} message TransactionOutput
30226
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
30227
+ * @returns {Object.<string,*>} Plain object
30228
+ */
30229
+ TransactionOutput.toObject = function toObject(message, options) {
30230
+ if (!options)
30231
+ options = {};
30232
+ var object = {};
30233
+ if (options.defaults) {
30234
+ if ($util.Long) {
30235
+ var long = new $util.Long(0, 0, false);
30236
+ object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
30237
+ } else
30238
+ object.value = options.longs === String ? "0" : 0;
30239
+ object.version = 0;
30240
+ if (options.bytes === String)
30241
+ object.script = "";
30242
+ else {
30243
+ object.script = [];
30244
+ if (options.bytes !== Array)
30245
+ object.script = $util.newBuffer(object.script);
30246
+ }
29115
30247
  }
29116
- if (message.error != null && message.hasOwnProperty("error"))
29117
- object.error = options.enums === String ? $root.TW.Common.Proto.SigningError[message.error] : message.error;
29118
- if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
29119
- object.errorMessage = message.errorMessage;
29120
- if (message.encoded != null && message.hasOwnProperty("encoded"))
29121
- object.encoded = options.bytes === String ? $util.base64.encode(message.encoded, 0, message.encoded.length) : options.bytes === Array ? Array.prototype.slice.call(message.encoded) : message.encoded;
29122
- if (message.txid != null && message.hasOwnProperty("txid"))
29123
- object.txid = options.bytes === String ? $util.base64.encode(message.txid, 0, message.txid.length) : options.bytes === Array ? Array.prototype.slice.call(message.txid) : message.txid;
29124
- if (message.vsize != null && message.hasOwnProperty("vsize"))
29125
- if (typeof message.vsize === "number")
29126
- object.vsize = options.longs === String ? String(message.vsize) : message.vsize;
29127
- else
29128
- object.vsize = options.longs === String ? $util.Long.prototype.toString.call(message.vsize) : options.longs === Number ? new $util.LongBits(message.vsize.low >>> 0, message.vsize.high >>> 0).toNumber(true) : message.vsize;
29129
- if (message.weight != null && message.hasOwnProperty("weight"))
29130
- if (typeof message.weight === "number")
29131
- object.weight = options.longs === String ? String(message.weight) : message.weight;
29132
- else
29133
- object.weight = options.longs === String ? $util.Long.prototype.toString.call(message.weight) : options.longs === Number ? new $util.LongBits(message.weight.low >>> 0, message.weight.high >>> 0).toNumber(true) : message.weight;
29134
- if (message.fee != null && message.hasOwnProperty("fee"))
29135
- if (typeof message.fee === "number")
29136
- object.fee = options.longs === String ? String(message.fee) : message.fee;
30248
+ if (message.value != null && message.hasOwnProperty("value"))
30249
+ if (typeof message.value === "number")
30250
+ object.value = options.longs === String ? String(message.value) : message.value;
29137
30251
  else
29138
- object.fee = options.longs === String ? $util.Long.prototype.toString.call(message.fee) : options.longs === Number ? new $util.LongBits(message.fee.low >>> 0, message.fee.high >>> 0).toNumber() : message.fee;
29139
- if (message.psbt != null && message.hasOwnProperty("psbt"))
29140
- object.psbt = $root.TW.BitcoinV2.Proto.Psbt.toObject(message.psbt, options);
29141
- if (message.bitcoin != null && message.hasOwnProperty("bitcoin")) {
29142
- object.bitcoin = $root.TW.Utxo.Proto.Transaction.toObject(message.bitcoin, options);
29143
- if (options.oneofs)
29144
- object.transaction = "bitcoin";
29145
- }
29146
- if (message.zcash != null && message.hasOwnProperty("zcash")) {
29147
- object.zcash = $root.TW.Zcash.Proto.Transaction.toObject(message.zcash, options);
29148
- if (options.oneofs)
29149
- object.transaction = "zcash";
29150
- }
30252
+ object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value;
30253
+ if (message.version != null && message.hasOwnProperty("version"))
30254
+ object.version = message.version;
30255
+ if (message.script != null && message.hasOwnProperty("script"))
30256
+ object.script = options.bytes === String ? $util.base64.encode(message.script, 0, message.script.length) : options.bytes === Array ? Array.prototype.slice.call(message.script) : message.script;
29151
30257
  return object;
29152
30258
  };
29153
30259
 
29154
30260
  /**
29155
- * Converts this SigningOutput to JSON.
30261
+ * Converts this TransactionOutput to JSON.
29156
30262
  * @function toJSON
29157
- * @memberof TW.BitcoinV2.Proto.SigningOutput
30263
+ * @memberof TW.DecredV2.Proto.TransactionOutput
29158
30264
  * @instance
29159
30265
  * @returns {Object.<string,*>} JSON object
29160
30266
  */
29161
- SigningOutput.prototype.toJSON = function toJSON() {
30267
+ TransactionOutput.prototype.toJSON = function toJSON() {
29162
30268
  return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
29163
30269
  };
29164
30270
 
29165
- return SigningOutput;
30271
+ return TransactionOutput;
29166
30272
  })();
29167
30273
 
29168
30274
  return Proto;
29169
30275
  })();
29170
30276
 
29171
- return BitcoinV2;
30277
+ return DecredV2;
29172
30278
  })();
29173
30279
 
29174
30280
  TW.Utxo = (function() {
@@ -29928,7 +31034,7 @@
29928
31034
  if (!writer)
29929
31035
  writer = $Writer.create();
29930
31036
  if (message.version != null && Object.hasOwnProperty.call(message, "version"))
29931
- writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version);
31037
+ writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.version);
29932
31038
  if (message.lockTime != null && Object.hasOwnProperty.call(message, "lockTime"))
29933
31039
  writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.lockTime);
29934
31040
  if (message.inputs != null && message.inputs.length)
@@ -29959,7 +31065,7 @@
29959
31065
  var tag = reader.uint32();
29960
31066
  switch (tag >>> 3) {
29961
31067
  case 1:
29962
- message.version = reader.int32();
31068
+ message.version = reader.uint32();
29963
31069
  break;
29964
31070
  case 2:
29965
31071
  message.lockTime = reader.uint32();
@@ -30033,7 +31139,7 @@
30033
31139
  return object;
30034
31140
  var message = new $root.TW.Utxo.Proto.Transaction();
30035
31141
  if (object.version != null)
30036
- message.version = object.version | 0;
31142
+ message.version = object.version >>> 0;
30037
31143
  if (object.lockTime != null)
30038
31144
  message.lockTime = object.lockTime >>> 0;
30039
31145
  if (object.inputs) {
@@ -30469,7 +31575,7 @@
30469
31575
  if (!writer)
30470
31576
  writer = $Writer.create();
30471
31577
  if (message.version != null && Object.hasOwnProperty.call(message, "version"))
30472
- writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version);
31578
+ writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.version);
30473
31579
  if (message.versionGroupId != null && Object.hasOwnProperty.call(message, "versionGroupId"))
30474
31580
  writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.versionGroupId);
30475
31581
  if (message.inputs != null && message.inputs.length)
@@ -30508,7 +31614,7 @@
30508
31614
  var tag = reader.uint32();
30509
31615
  switch (tag >>> 3) {
30510
31616
  case 1:
30511
- message.version = reader.int32();
31617
+ message.version = reader.uint32();
30512
31618
  break;
30513
31619
  case 2:
30514
31620
  message.versionGroupId = reader.uint32();
@@ -30606,7 +31712,7 @@
30606
31712
  return object;
30607
31713
  var message = new $root.TW.Zcash.Proto.Transaction();
30608
31714
  if (object.version != null)
30609
- message.version = object.version | 0;
31715
+ message.version = object.version >>> 0;
30610
31716
  if (object.versionGroupId != null)
30611
31717
  message.versionGroupId = object.versionGroupId >>> 0;
30612
31718
  if (object.inputs) {
@@ -32565,6 +33671,243 @@
32565
33671
  return DeregisterStakingKey;
32566
33672
  })();
32567
33673
 
33674
+ Proto.VoteDelegation = (function() {
33675
+
33676
+ /**
33677
+ * Properties of a VoteDelegation.
33678
+ * @memberof TW.Cardano.Proto
33679
+ * @interface IVoteDelegation
33680
+ * @property {string|null} [stakingAddress] VoteDelegation stakingAddress
33681
+ * @property {TW.Cardano.Proto.VoteDelegation.DRepType|null} [drepType] VoteDelegation drepType
33682
+ * @property {string|null} [drepId] VoteDelegation drepId
33683
+ */
33684
+
33685
+ /**
33686
+ * Constructs a new VoteDelegation.
33687
+ * @memberof TW.Cardano.Proto
33688
+ * @classdesc Represents a VoteDelegation.
33689
+ * @implements IVoteDelegation
33690
+ * @constructor
33691
+ * @param {TW.Cardano.Proto.IVoteDelegation=} [properties] Properties to set
33692
+ */
33693
+ function VoteDelegation(properties) {
33694
+ if (properties)
33695
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
33696
+ if (properties[keys[i]] != null)
33697
+ this[keys[i]] = properties[keys[i]];
33698
+ }
33699
+
33700
+ /**
33701
+ * VoteDelegation stakingAddress.
33702
+ * @member {string} stakingAddress
33703
+ * @memberof TW.Cardano.Proto.VoteDelegation
33704
+ * @instance
33705
+ */
33706
+ VoteDelegation.prototype.stakingAddress = "";
33707
+
33708
+ /**
33709
+ * VoteDelegation drepType.
33710
+ * @member {TW.Cardano.Proto.VoteDelegation.DRepType} drepType
33711
+ * @memberof TW.Cardano.Proto.VoteDelegation
33712
+ * @instance
33713
+ */
33714
+ VoteDelegation.prototype.drepType = 0;
33715
+
33716
+ /**
33717
+ * VoteDelegation drepId.
33718
+ * @member {string} drepId
33719
+ * @memberof TW.Cardano.Proto.VoteDelegation
33720
+ * @instance
33721
+ */
33722
+ VoteDelegation.prototype.drepId = "";
33723
+
33724
+ /**
33725
+ * Creates a new VoteDelegation instance using the specified properties.
33726
+ * @function create
33727
+ * @memberof TW.Cardano.Proto.VoteDelegation
33728
+ * @static
33729
+ * @param {TW.Cardano.Proto.IVoteDelegation=} [properties] Properties to set
33730
+ * @returns {TW.Cardano.Proto.VoteDelegation} VoteDelegation instance
33731
+ */
33732
+ VoteDelegation.create = function create(properties) {
33733
+ return new VoteDelegation(properties);
33734
+ };
33735
+
33736
+ /**
33737
+ * Encodes the specified VoteDelegation message. Does not implicitly {@link TW.Cardano.Proto.VoteDelegation.verify|verify} messages.
33738
+ * @function encode
33739
+ * @memberof TW.Cardano.Proto.VoteDelegation
33740
+ * @static
33741
+ * @param {TW.Cardano.Proto.IVoteDelegation} message VoteDelegation message or plain object to encode
33742
+ * @param {$protobuf.Writer} [writer] Writer to encode to
33743
+ * @returns {$protobuf.Writer} Writer
33744
+ */
33745
+ VoteDelegation.encode = function encode(message, writer) {
33746
+ if (!writer)
33747
+ writer = $Writer.create();
33748
+ if (message.stakingAddress != null && Object.hasOwnProperty.call(message, "stakingAddress"))
33749
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.stakingAddress);
33750
+ if (message.drepType != null && Object.hasOwnProperty.call(message, "drepType"))
33751
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.drepType);
33752
+ if (message.drepId != null && Object.hasOwnProperty.call(message, "drepId"))
33753
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.drepId);
33754
+ return writer;
33755
+ };
33756
+
33757
+ /**
33758
+ * Decodes a VoteDelegation message from the specified reader or buffer.
33759
+ * @function decode
33760
+ * @memberof TW.Cardano.Proto.VoteDelegation
33761
+ * @static
33762
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
33763
+ * @param {number} [length] Message length if known beforehand
33764
+ * @returns {TW.Cardano.Proto.VoteDelegation} VoteDelegation
33765
+ * @throws {Error} If the payload is not a reader or valid buffer
33766
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
33767
+ */
33768
+ VoteDelegation.decode = function decode(reader, length) {
33769
+ if (!(reader instanceof $Reader))
33770
+ reader = $Reader.create(reader);
33771
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Cardano.Proto.VoteDelegation();
33772
+ while (reader.pos < end) {
33773
+ var tag = reader.uint32();
33774
+ switch (tag >>> 3) {
33775
+ case 1:
33776
+ message.stakingAddress = reader.string();
33777
+ break;
33778
+ case 2:
33779
+ message.drepType = reader.int32();
33780
+ break;
33781
+ case 3:
33782
+ message.drepId = reader.string();
33783
+ break;
33784
+ default:
33785
+ reader.skipType(tag & 7);
33786
+ break;
33787
+ }
33788
+ }
33789
+ return message;
33790
+ };
33791
+
33792
+ /**
33793
+ * Verifies a VoteDelegation message.
33794
+ * @function verify
33795
+ * @memberof TW.Cardano.Proto.VoteDelegation
33796
+ * @static
33797
+ * @param {Object.<string,*>} message Plain object to verify
33798
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
33799
+ */
33800
+ VoteDelegation.verify = function verify(message) {
33801
+ if (typeof message !== "object" || message === null)
33802
+ return "object expected";
33803
+ if (message.stakingAddress != null && message.hasOwnProperty("stakingAddress"))
33804
+ if (!$util.isString(message.stakingAddress))
33805
+ return "stakingAddress: string expected";
33806
+ if (message.drepType != null && message.hasOwnProperty("drepType"))
33807
+ switch (message.drepType) {
33808
+ default:
33809
+ return "drepType: enum value expected";
33810
+ case 0:
33811
+ case 2:
33812
+ case 3:
33813
+ break;
33814
+ }
33815
+ if (message.drepId != null && message.hasOwnProperty("drepId"))
33816
+ if (!$util.isString(message.drepId))
33817
+ return "drepId: string expected";
33818
+ return null;
33819
+ };
33820
+
33821
+ /**
33822
+ * Creates a VoteDelegation message from a plain object. Also converts values to their respective internal types.
33823
+ * @function fromObject
33824
+ * @memberof TW.Cardano.Proto.VoteDelegation
33825
+ * @static
33826
+ * @param {Object.<string,*>} object Plain object
33827
+ * @returns {TW.Cardano.Proto.VoteDelegation} VoteDelegation
33828
+ */
33829
+ VoteDelegation.fromObject = function fromObject(object) {
33830
+ if (object instanceof $root.TW.Cardano.Proto.VoteDelegation)
33831
+ return object;
33832
+ var message = new $root.TW.Cardano.Proto.VoteDelegation();
33833
+ if (object.stakingAddress != null)
33834
+ message.stakingAddress = String(object.stakingAddress);
33835
+ switch (object.drepType) {
33836
+ case "DREP_ID":
33837
+ case 0:
33838
+ message.drepType = 0;
33839
+ break;
33840
+ case "DREP_ALWAYS_ABSTAIN":
33841
+ case 2:
33842
+ message.drepType = 2;
33843
+ break;
33844
+ case "DREP_NO_CONFIDENCE":
33845
+ case 3:
33846
+ message.drepType = 3;
33847
+ break;
33848
+ }
33849
+ if (object.drepId != null)
33850
+ message.drepId = String(object.drepId);
33851
+ return message;
33852
+ };
33853
+
33854
+ /**
33855
+ * Creates a plain object from a VoteDelegation message. Also converts values to other types if specified.
33856
+ * @function toObject
33857
+ * @memberof TW.Cardano.Proto.VoteDelegation
33858
+ * @static
33859
+ * @param {TW.Cardano.Proto.VoteDelegation} message VoteDelegation
33860
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
33861
+ * @returns {Object.<string,*>} Plain object
33862
+ */
33863
+ VoteDelegation.toObject = function toObject(message, options) {
33864
+ if (!options)
33865
+ options = {};
33866
+ var object = {};
33867
+ if (options.defaults) {
33868
+ object.stakingAddress = "";
33869
+ object.drepType = options.enums === String ? "DREP_ID" : 0;
33870
+ object.drepId = "";
33871
+ }
33872
+ if (message.stakingAddress != null && message.hasOwnProperty("stakingAddress"))
33873
+ object.stakingAddress = message.stakingAddress;
33874
+ if (message.drepType != null && message.hasOwnProperty("drepType"))
33875
+ object.drepType = options.enums === String ? $root.TW.Cardano.Proto.VoteDelegation.DRepType[message.drepType] : message.drepType;
33876
+ if (message.drepId != null && message.hasOwnProperty("drepId"))
33877
+ object.drepId = message.drepId;
33878
+ return object;
33879
+ };
33880
+
33881
+ /**
33882
+ * Converts this VoteDelegation to JSON.
33883
+ * @function toJSON
33884
+ * @memberof TW.Cardano.Proto.VoteDelegation
33885
+ * @instance
33886
+ * @returns {Object.<string,*>} JSON object
33887
+ */
33888
+ VoteDelegation.prototype.toJSON = function toJSON() {
33889
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
33890
+ };
33891
+
33892
+ /**
33893
+ * DRepType enum.
33894
+ * @name TW.Cardano.Proto.VoteDelegation.DRepType
33895
+ * @enum {number}
33896
+ * @property {number} DREP_ID=0 DREP_ID value
33897
+ * @property {number} DREP_ALWAYS_ABSTAIN=2 DREP_ALWAYS_ABSTAIN value
33898
+ * @property {number} DREP_NO_CONFIDENCE=3 DREP_NO_CONFIDENCE value
33899
+ */
33900
+ VoteDelegation.DRepType = (function() {
33901
+ var valuesById = {}, values = Object.create(valuesById);
33902
+ values[valuesById[0] = "DREP_ID"] = 0;
33903
+ values[valuesById[2] = "DREP_ALWAYS_ABSTAIN"] = 2;
33904
+ values[valuesById[3] = "DREP_NO_CONFIDENCE"] = 3;
33905
+ return values;
33906
+ })();
33907
+
33908
+ return VoteDelegation;
33909
+ })();
33910
+
32568
33911
  Proto.Delegate = (function() {
32569
33912
 
32570
33913
  /**
@@ -33724,6 +35067,7 @@
33724
35067
  * @property {TW.Cardano.Proto.IDelegate|null} [delegate] SigningInput delegate
33725
35068
  * @property {TW.Cardano.Proto.IWithdraw|null} [withdraw] SigningInput withdraw
33726
35069
  * @property {TW.Cardano.Proto.IDeregisterStakingKey|null} [deregisterStakingKey] SigningInput deregisterStakingKey
35070
+ * @property {TW.Cardano.Proto.IVoteDelegation|null} [voteDelegation] SigningInput voteDelegation
33727
35071
  * @property {Long|null} [ttl] SigningInput ttl
33728
35072
  * @property {TW.Cardano.Proto.ITransactionPlan|null} [plan] SigningInput plan
33729
35073
  * @property {Array.<TW.Cardano.Proto.ITxOutput>|null} [extraOutputs] SigningInput extraOutputs
@@ -33803,6 +35147,14 @@
33803
35147
  */
33804
35148
  SigningInput.prototype.deregisterStakingKey = null;
33805
35149
 
35150
+ /**
35151
+ * SigningInput voteDelegation.
35152
+ * @member {TW.Cardano.Proto.IVoteDelegation|null|undefined} voteDelegation
35153
+ * @memberof TW.Cardano.Proto.SigningInput
35154
+ * @instance
35155
+ */
35156
+ SigningInput.prototype.voteDelegation = null;
35157
+
33806
35158
  /**
33807
35159
  * SigningInput ttl.
33808
35160
  * @member {Long} ttl
@@ -33874,6 +35226,8 @@
33874
35226
  if (message.extraOutputs != null && message.extraOutputs.length)
33875
35227
  for (var i = 0; i < message.extraOutputs.length; ++i)
33876
35228
  $root.TW.Cardano.Proto.TxOutput.encode(message.extraOutputs[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
35229
+ if (message.voteDelegation != null && Object.hasOwnProperty.call(message, "voteDelegation"))
35230
+ $root.TW.Cardano.Proto.VoteDelegation.encode(message.voteDelegation, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
33877
35231
  return writer;
33878
35232
  };
33879
35233
 
@@ -33920,6 +35274,9 @@
33920
35274
  case 9:
33921
35275
  message.deregisterStakingKey = $root.TW.Cardano.Proto.DeregisterStakingKey.decode(reader, reader.uint32());
33922
35276
  break;
35277
+ case 11:
35278
+ message.voteDelegation = $root.TW.Cardano.Proto.VoteDelegation.decode(reader, reader.uint32());
35279
+ break;
33923
35280
  case 4:
33924
35281
  message.ttl = reader.uint64();
33925
35282
  break;
@@ -33991,6 +35348,11 @@
33991
35348
  if (error)
33992
35349
  return "deregisterStakingKey." + error;
33993
35350
  }
35351
+ if (message.voteDelegation != null && message.hasOwnProperty("voteDelegation")) {
35352
+ var error = $root.TW.Cardano.Proto.VoteDelegation.verify(message.voteDelegation);
35353
+ if (error)
35354
+ return "voteDelegation." + error;
35355
+ }
33994
35356
  if (message.ttl != null && message.hasOwnProperty("ttl"))
33995
35357
  if (!$util.isInteger(message.ttl) && !(message.ttl && $util.isInteger(message.ttl.low) && $util.isInteger(message.ttl.high)))
33996
35358
  return "ttl: integer|Long expected";
@@ -34068,6 +35430,11 @@
34068
35430
  throw TypeError(".TW.Cardano.Proto.SigningInput.deregisterStakingKey: object expected");
34069
35431
  message.deregisterStakingKey = $root.TW.Cardano.Proto.DeregisterStakingKey.fromObject(object.deregisterStakingKey);
34070
35432
  }
35433
+ if (object.voteDelegation != null) {
35434
+ if (typeof object.voteDelegation !== "object")
35435
+ throw TypeError(".TW.Cardano.Proto.SigningInput.voteDelegation: object expected");
35436
+ message.voteDelegation = $root.TW.Cardano.Proto.VoteDelegation.fromObject(object.voteDelegation);
35437
+ }
34071
35438
  if (object.ttl != null)
34072
35439
  if ($util.Long)
34073
35440
  (message.ttl = $util.Long.fromValue(object.ttl)).unsigned = true;
@@ -34125,6 +35492,7 @@
34125
35492
  object.delegate = null;
34126
35493
  object.withdraw = null;
34127
35494
  object.deregisterStakingKey = null;
35495
+ object.voteDelegation = null;
34128
35496
  }
34129
35497
  if (message.utxos && message.utxos.length) {
34130
35498
  object.utxos = [];
@@ -34158,6 +35526,8 @@
34158
35526
  for (var j = 0; j < message.extraOutputs.length; ++j)
34159
35527
  object.extraOutputs[j] = $root.TW.Cardano.Proto.TxOutput.toObject(message.extraOutputs[j], options);
34160
35528
  }
35529
+ if (message.voteDelegation != null && message.hasOwnProperty("voteDelegation"))
35530
+ object.voteDelegation = $root.TW.Cardano.Proto.VoteDelegation.toObject(message.voteDelegation, options);
34161
35531
  return object;
34162
35532
  };
34163
35533
 
@@ -44377,6 +45747,7 @@
44377
45747
  * @property {string|null} [transactionId] SigningOutput transactionId
44378
45748
  * @property {TW.Common.Proto.SigningError|null} [error] SigningOutput error
44379
45749
  * @property {string|null} [errorMessage] SigningOutput errorMessage
45750
+ * @property {TW.BitcoinV2.Proto.ISigningOutput|null} [signingResultV2] SigningOutput signingResultV2
44380
45751
  */
44381
45752
 
44382
45753
  /**
@@ -44434,6 +45805,14 @@
44434
45805
  */
44435
45806
  SigningOutput.prototype.errorMessage = "";
44436
45807
 
45808
+ /**
45809
+ * SigningOutput signingResultV2.
45810
+ * @member {TW.BitcoinV2.Proto.ISigningOutput|null|undefined} signingResultV2
45811
+ * @memberof TW.Decred.Proto.SigningOutput
45812
+ * @instance
45813
+ */
45814
+ SigningOutput.prototype.signingResultV2 = null;
45815
+
44437
45816
  /**
44438
45817
  * Creates a new SigningOutput instance using the specified properties.
44439
45818
  * @function create
@@ -44468,6 +45847,8 @@
44468
45847
  writer.uint32(/* id 4, wireType 0 =*/32).int32(message.error);
44469
45848
  if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage"))
44470
45849
  writer.uint32(/* id 5, wireType 2 =*/42).string(message.errorMessage);
45850
+ if (message.signingResultV2 != null && Object.hasOwnProperty.call(message, "signingResultV2"))
45851
+ $root.TW.BitcoinV2.Proto.SigningOutput.encode(message.signingResultV2, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
44471
45852
  return writer;
44472
45853
  };
44473
45854
 
@@ -44504,6 +45885,9 @@
44504
45885
  case 5:
44505
45886
  message.errorMessage = reader.string();
44506
45887
  break;
45888
+ case 6:
45889
+ message.signingResultV2 = $root.TW.BitcoinV2.Proto.SigningOutput.decode(reader, reader.uint32());
45890
+ break;
44507
45891
  default:
44508
45892
  reader.skipType(tag & 7);
44509
45893
  break;
@@ -44569,6 +45953,11 @@
44569
45953
  if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
44570
45954
  if (!$util.isString(message.errorMessage))
44571
45955
  return "errorMessage: string expected";
45956
+ if (message.signingResultV2 != null && message.hasOwnProperty("signingResultV2")) {
45957
+ var error = $root.TW.BitcoinV2.Proto.SigningOutput.verify(message.signingResultV2);
45958
+ if (error)
45959
+ return "signingResultV2." + error;
45960
+ }
44572
45961
  return null;
44573
45962
  };
44574
45963
 
@@ -44704,6 +46093,11 @@
44704
46093
  }
44705
46094
  if (object.errorMessage != null)
44706
46095
  message.errorMessage = String(object.errorMessage);
46096
+ if (object.signingResultV2 != null) {
46097
+ if (typeof object.signingResultV2 !== "object")
46098
+ throw TypeError(".TW.Decred.Proto.SigningOutput.signingResultV2: object expected");
46099
+ message.signingResultV2 = $root.TW.BitcoinV2.Proto.SigningOutput.fromObject(object.signingResultV2);
46100
+ }
44707
46101
  return message;
44708
46102
  };
44709
46103
 
@@ -44732,6 +46126,7 @@
44732
46126
  object.transactionId = "";
44733
46127
  object.error = options.enums === String ? "OK" : 0;
44734
46128
  object.errorMessage = "";
46129
+ object.signingResultV2 = null;
44735
46130
  }
44736
46131
  if (message.transaction != null && message.hasOwnProperty("transaction"))
44737
46132
  object.transaction = $root.TW.Decred.Proto.Transaction.toObject(message.transaction, options);
@@ -44743,6 +46138,8 @@
44743
46138
  object.error = options.enums === String ? $root.TW.Common.Proto.SigningError[message.error] : message.error;
44744
46139
  if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
44745
46140
  object.errorMessage = message.errorMessage;
46141
+ if (message.signingResultV2 != null && message.hasOwnProperty("signingResultV2"))
46142
+ object.signingResultV2 = $root.TW.BitcoinV2.Proto.SigningOutput.toObject(message.signingResultV2, options);
44746
46143
  return object;
44747
46144
  };
44748
46145