@trustwallet/wallet-core 3.0.6 → 3.0.7
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.
@@ -6829,6 +6829,9 @@ export namespace TW {
|
|
6829
6829
|
|
6830
6830
|
/** Message authRevoke */
|
6831
6831
|
authRevoke?: (TW.Cosmos.Proto.Message.IAuthRevoke|null);
|
6832
|
+
|
6833
|
+
/** Message msgVote */
|
6834
|
+
msgVote?: (TW.Cosmos.Proto.Message.IMsgVote|null);
|
6832
6835
|
}
|
6833
6836
|
|
6834
6837
|
/** Represents a Message. */
|
@@ -6891,8 +6894,11 @@ export namespace TW {
|
|
6891
6894
|
/** Message authRevoke. */
|
6892
6895
|
public authRevoke?: (TW.Cosmos.Proto.Message.IAuthRevoke|null);
|
6893
6896
|
|
6897
|
+
/** Message msgVote. */
|
6898
|
+
public msgVote?: (TW.Cosmos.Proto.Message.IMsgVote|null);
|
6899
|
+
|
6894
6900
|
/** Message messageOneof. */
|
6895
|
-
public messageOneof?: ("sendCoinsMessage"|"transferTokensMessage"|"stakeMessage"|"unstakeMessage"|"restakeMessage"|"withdrawStakeRewardMessage"|"rawJsonMessage"|"wasmTerraExecuteContractTransferMessage"|"wasmTerraExecuteContractSendMessage"|"thorchainSendMessage"|"wasmTerraExecuteContractGeneric"|"wasmExecuteContractTransferMessage"|"wasmExecuteContractSendMessage"|"wasmExecuteContractGeneric"|"signDirectMessage"|"authGrant"|"authRevoke");
|
6901
|
+
public messageOneof?: ("sendCoinsMessage"|"transferTokensMessage"|"stakeMessage"|"unstakeMessage"|"restakeMessage"|"withdrawStakeRewardMessage"|"rawJsonMessage"|"wasmTerraExecuteContractTransferMessage"|"wasmTerraExecuteContractSendMessage"|"thorchainSendMessage"|"wasmTerraExecuteContractGeneric"|"wasmExecuteContractTransferMessage"|"wasmExecuteContractSendMessage"|"wasmExecuteContractGeneric"|"signDirectMessage"|"authGrant"|"authRevoke"|"msgVote");
|
6896
6902
|
|
6897
6903
|
/**
|
6898
6904
|
* Creates a new Message instance using the specified properties.
|
@@ -8683,6 +8689,100 @@ export namespace TW {
|
|
8683
8689
|
*/
|
8684
8690
|
public toJSON(): { [k: string]: any };
|
8685
8691
|
}
|
8692
|
+
|
8693
|
+
/** VoteOption enum. */
|
8694
|
+
enum VoteOption {
|
8695
|
+
_UNSPECIFIED = 0,
|
8696
|
+
YES = 1,
|
8697
|
+
ABSTAIN = 2,
|
8698
|
+
NO = 3,
|
8699
|
+
NO_WITH_VETO = 4
|
8700
|
+
}
|
8701
|
+
|
8702
|
+
/** Properties of a MsgVote. */
|
8703
|
+
interface IMsgVote {
|
8704
|
+
|
8705
|
+
/** MsgVote proposalId */
|
8706
|
+
proposalId?: (Long|null);
|
8707
|
+
|
8708
|
+
/** MsgVote voter */
|
8709
|
+
voter?: (string|null);
|
8710
|
+
|
8711
|
+
/** MsgVote option */
|
8712
|
+
option?: (TW.Cosmos.Proto.Message.VoteOption|null);
|
8713
|
+
}
|
8714
|
+
|
8715
|
+
/** Represents a MsgVote. */
|
8716
|
+
class MsgVote implements IMsgVote {
|
8717
|
+
|
8718
|
+
/**
|
8719
|
+
* Constructs a new MsgVote.
|
8720
|
+
* @param [properties] Properties to set
|
8721
|
+
*/
|
8722
|
+
constructor(properties?: TW.Cosmos.Proto.Message.IMsgVote);
|
8723
|
+
|
8724
|
+
/** MsgVote proposalId. */
|
8725
|
+
public proposalId: Long;
|
8726
|
+
|
8727
|
+
/** MsgVote voter. */
|
8728
|
+
public voter: string;
|
8729
|
+
|
8730
|
+
/** MsgVote option. */
|
8731
|
+
public option: TW.Cosmos.Proto.Message.VoteOption;
|
8732
|
+
|
8733
|
+
/**
|
8734
|
+
* Creates a new MsgVote instance using the specified properties.
|
8735
|
+
* @param [properties] Properties to set
|
8736
|
+
* @returns MsgVote instance
|
8737
|
+
*/
|
8738
|
+
public static create(properties?: TW.Cosmos.Proto.Message.IMsgVote): TW.Cosmos.Proto.Message.MsgVote;
|
8739
|
+
|
8740
|
+
/**
|
8741
|
+
* Encodes the specified MsgVote message. Does not implicitly {@link TW.Cosmos.Proto.Message.MsgVote.verify|verify} messages.
|
8742
|
+
* @param message MsgVote message or plain object to encode
|
8743
|
+
* @param [writer] Writer to encode to
|
8744
|
+
* @returns Writer
|
8745
|
+
*/
|
8746
|
+
public static encode(message: TW.Cosmos.Proto.Message.IMsgVote, writer?: $protobuf.Writer): $protobuf.Writer;
|
8747
|
+
|
8748
|
+
/**
|
8749
|
+
* Decodes a MsgVote message from the specified reader or buffer.
|
8750
|
+
* @param reader Reader or buffer to decode from
|
8751
|
+
* @param [length] Message length if known beforehand
|
8752
|
+
* @returns MsgVote
|
8753
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
8754
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8755
|
+
*/
|
8756
|
+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): TW.Cosmos.Proto.Message.MsgVote;
|
8757
|
+
|
8758
|
+
/**
|
8759
|
+
* Verifies a MsgVote message.
|
8760
|
+
* @param message Plain object to verify
|
8761
|
+
* @returns `null` if valid, otherwise the reason why it is not
|
8762
|
+
*/
|
8763
|
+
public static verify(message: { [k: string]: any }): (string|null);
|
8764
|
+
|
8765
|
+
/**
|
8766
|
+
* Creates a MsgVote message from a plain object. Also converts values to their respective internal types.
|
8767
|
+
* @param object Plain object
|
8768
|
+
* @returns MsgVote
|
8769
|
+
*/
|
8770
|
+
public static fromObject(object: { [k: string]: any }): TW.Cosmos.Proto.Message.MsgVote;
|
8771
|
+
|
8772
|
+
/**
|
8773
|
+
* Creates a plain object from a MsgVote message. Also converts values to other types if specified.
|
8774
|
+
* @param message MsgVote
|
8775
|
+
* @param [options] Conversion options
|
8776
|
+
* @returns Plain object
|
8777
|
+
*/
|
8778
|
+
public static toObject(message: TW.Cosmos.Proto.Message.MsgVote, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
8779
|
+
|
8780
|
+
/**
|
8781
|
+
* Converts this MsgVote to JSON.
|
8782
|
+
* @returns JSON object
|
8783
|
+
*/
|
8784
|
+
public toJSON(): { [k: string]: any };
|
8785
|
+
}
|
8686
8786
|
}
|
8687
8787
|
|
8688
8788
|
/** SigningMode enum. */
|
@@ -20356,6 +20356,7 @@
|
|
20356
20356
|
* @property {TW.Cosmos.Proto.Message.ISignDirect|null} [signDirectMessage] Message signDirectMessage
|
20357
20357
|
* @property {TW.Cosmos.Proto.Message.IAuthGrant|null} [authGrant] Message authGrant
|
20358
20358
|
* @property {TW.Cosmos.Proto.Message.IAuthRevoke|null} [authRevoke] Message authRevoke
|
20359
|
+
* @property {TW.Cosmos.Proto.Message.IMsgVote|null} [msgVote] Message msgVote
|
20359
20360
|
*/
|
20360
20361
|
|
20361
20362
|
/**
|
@@ -20509,17 +20510,25 @@
|
|
20509
20510
|
*/
|
20510
20511
|
Message.prototype.authRevoke = null;
|
20511
20512
|
|
20513
|
+
/**
|
20514
|
+
* Message msgVote.
|
20515
|
+
* @member {TW.Cosmos.Proto.Message.IMsgVote|null|undefined} msgVote
|
20516
|
+
* @memberof TW.Cosmos.Proto.Message
|
20517
|
+
* @instance
|
20518
|
+
*/
|
20519
|
+
Message.prototype.msgVote = null;
|
20520
|
+
|
20512
20521
|
// OneOf field names bound to virtual getters and setters
|
20513
20522
|
var $oneOfFields;
|
20514
20523
|
|
20515
20524
|
/**
|
20516
20525
|
* Message messageOneof.
|
20517
|
-
* @member {"sendCoinsMessage"|"transferTokensMessage"|"stakeMessage"|"unstakeMessage"|"restakeMessage"|"withdrawStakeRewardMessage"|"rawJsonMessage"|"wasmTerraExecuteContractTransferMessage"|"wasmTerraExecuteContractSendMessage"|"thorchainSendMessage"|"wasmTerraExecuteContractGeneric"|"wasmExecuteContractTransferMessage"|"wasmExecuteContractSendMessage"|"wasmExecuteContractGeneric"|"signDirectMessage"|"authGrant"|"authRevoke"|undefined} messageOneof
|
20526
|
+
* @member {"sendCoinsMessage"|"transferTokensMessage"|"stakeMessage"|"unstakeMessage"|"restakeMessage"|"withdrawStakeRewardMessage"|"rawJsonMessage"|"wasmTerraExecuteContractTransferMessage"|"wasmTerraExecuteContractSendMessage"|"thorchainSendMessage"|"wasmTerraExecuteContractGeneric"|"wasmExecuteContractTransferMessage"|"wasmExecuteContractSendMessage"|"wasmExecuteContractGeneric"|"signDirectMessage"|"authGrant"|"authRevoke"|"msgVote"|undefined} messageOneof
|
20518
20527
|
* @memberof TW.Cosmos.Proto.Message
|
20519
20528
|
* @instance
|
20520
20529
|
*/
|
20521
20530
|
Object.defineProperty(Message.prototype, "messageOneof", {
|
20522
|
-
get: $util.oneOfGetter($oneOfFields = ["sendCoinsMessage", "transferTokensMessage", "stakeMessage", "unstakeMessage", "restakeMessage", "withdrawStakeRewardMessage", "rawJsonMessage", "wasmTerraExecuteContractTransferMessage", "wasmTerraExecuteContractSendMessage", "thorchainSendMessage", "wasmTerraExecuteContractGeneric", "wasmExecuteContractTransferMessage", "wasmExecuteContractSendMessage", "wasmExecuteContractGeneric", "signDirectMessage", "authGrant", "authRevoke"]),
|
20531
|
+
get: $util.oneOfGetter($oneOfFields = ["sendCoinsMessage", "transferTokensMessage", "stakeMessage", "unstakeMessage", "restakeMessage", "withdrawStakeRewardMessage", "rawJsonMessage", "wasmTerraExecuteContractTransferMessage", "wasmTerraExecuteContractSendMessage", "thorchainSendMessage", "wasmTerraExecuteContractGeneric", "wasmExecuteContractTransferMessage", "wasmExecuteContractSendMessage", "wasmExecuteContractGeneric", "signDirectMessage", "authGrant", "authRevoke", "msgVote"]),
|
20523
20532
|
set: $util.oneOfSetter($oneOfFields)
|
20524
20533
|
});
|
20525
20534
|
|
@@ -20581,6 +20590,8 @@
|
|
20581
20590
|
$root.TW.Cosmos.Proto.Message.AuthGrant.encode(message.authGrant, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim();
|
20582
20591
|
if (message.authRevoke != null && Object.hasOwnProperty.call(message, "authRevoke"))
|
20583
20592
|
$root.TW.Cosmos.Proto.Message.AuthRevoke.encode(message.authRevoke, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim();
|
20593
|
+
if (message.msgVote != null && Object.hasOwnProperty.call(message, "msgVote"))
|
20594
|
+
$root.TW.Cosmos.Proto.Message.MsgVote.encode(message.msgVote, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim();
|
20584
20595
|
return writer;
|
20585
20596
|
};
|
20586
20597
|
|
@@ -20653,6 +20664,9 @@
|
|
20653
20664
|
case 17:
|
20654
20665
|
message.authRevoke = $root.TW.Cosmos.Proto.Message.AuthRevoke.decode(reader, reader.uint32());
|
20655
20666
|
break;
|
20667
|
+
case 18:
|
20668
|
+
message.msgVote = $root.TW.Cosmos.Proto.Message.MsgVote.decode(reader, reader.uint32());
|
20669
|
+
break;
|
20656
20670
|
default:
|
20657
20671
|
reader.skipType(tag & 7);
|
20658
20672
|
break;
|
@@ -20841,6 +20855,16 @@
|
|
20841
20855
|
return "authRevoke." + error;
|
20842
20856
|
}
|
20843
20857
|
}
|
20858
|
+
if (message.msgVote != null && message.hasOwnProperty("msgVote")) {
|
20859
|
+
if (properties.messageOneof === 1)
|
20860
|
+
return "messageOneof: multiple values";
|
20861
|
+
properties.messageOneof = 1;
|
20862
|
+
{
|
20863
|
+
var error = $root.TW.Cosmos.Proto.Message.MsgVote.verify(message.msgVote);
|
20864
|
+
if (error)
|
20865
|
+
return "msgVote." + error;
|
20866
|
+
}
|
20867
|
+
}
|
20844
20868
|
return null;
|
20845
20869
|
};
|
20846
20870
|
|
@@ -20941,6 +20965,11 @@
|
|
20941
20965
|
throw TypeError(".TW.Cosmos.Proto.Message.authRevoke: object expected");
|
20942
20966
|
message.authRevoke = $root.TW.Cosmos.Proto.Message.AuthRevoke.fromObject(object.authRevoke);
|
20943
20967
|
}
|
20968
|
+
if (object.msgVote != null) {
|
20969
|
+
if (typeof object.msgVote !== "object")
|
20970
|
+
throw TypeError(".TW.Cosmos.Proto.Message.msgVote: object expected");
|
20971
|
+
message.msgVote = $root.TW.Cosmos.Proto.Message.MsgVote.fromObject(object.msgVote);
|
20972
|
+
}
|
20944
20973
|
return message;
|
20945
20974
|
};
|
20946
20975
|
|
@@ -21042,6 +21071,11 @@
|
|
21042
21071
|
if (options.oneofs)
|
21043
21072
|
object.messageOneof = "authRevoke";
|
21044
21073
|
}
|
21074
|
+
if (message.msgVote != null && message.hasOwnProperty("msgVote")) {
|
21075
|
+
object.msgVote = $root.TW.Cosmos.Proto.Message.MsgVote.toObject(message.msgVote, options);
|
21076
|
+
if (options.oneofs)
|
21077
|
+
object.messageOneof = "msgVote";
|
21078
|
+
}
|
21045
21079
|
return object;
|
21046
21080
|
};
|
21047
21081
|
|
@@ -25657,6 +25691,271 @@
|
|
25657
25691
|
return AuthRevoke;
|
25658
25692
|
})();
|
25659
25693
|
|
25694
|
+
/**
|
25695
|
+
* VoteOption enum.
|
25696
|
+
* @name TW.Cosmos.Proto.Message.VoteOption
|
25697
|
+
* @enum {number}
|
25698
|
+
* @property {number} _UNSPECIFIED=0 _UNSPECIFIED value
|
25699
|
+
* @property {number} YES=1 YES value
|
25700
|
+
* @property {number} ABSTAIN=2 ABSTAIN value
|
25701
|
+
* @property {number} NO=3 NO value
|
25702
|
+
* @property {number} NO_WITH_VETO=4 NO_WITH_VETO value
|
25703
|
+
*/
|
25704
|
+
Message.VoteOption = (function() {
|
25705
|
+
var valuesById = {}, values = Object.create(valuesById);
|
25706
|
+
values[valuesById[0] = "_UNSPECIFIED"] = 0;
|
25707
|
+
values[valuesById[1] = "YES"] = 1;
|
25708
|
+
values[valuesById[2] = "ABSTAIN"] = 2;
|
25709
|
+
values[valuesById[3] = "NO"] = 3;
|
25710
|
+
values[valuesById[4] = "NO_WITH_VETO"] = 4;
|
25711
|
+
return values;
|
25712
|
+
})();
|
25713
|
+
|
25714
|
+
Message.MsgVote = (function() {
|
25715
|
+
|
25716
|
+
/**
|
25717
|
+
* Properties of a MsgVote.
|
25718
|
+
* @memberof TW.Cosmos.Proto.Message
|
25719
|
+
* @interface IMsgVote
|
25720
|
+
* @property {Long|null} [proposalId] MsgVote proposalId
|
25721
|
+
* @property {string|null} [voter] MsgVote voter
|
25722
|
+
* @property {TW.Cosmos.Proto.Message.VoteOption|null} [option] MsgVote option
|
25723
|
+
*/
|
25724
|
+
|
25725
|
+
/**
|
25726
|
+
* Constructs a new MsgVote.
|
25727
|
+
* @memberof TW.Cosmos.Proto.Message
|
25728
|
+
* @classdesc Represents a MsgVote.
|
25729
|
+
* @implements IMsgVote
|
25730
|
+
* @constructor
|
25731
|
+
* @param {TW.Cosmos.Proto.Message.IMsgVote=} [properties] Properties to set
|
25732
|
+
*/
|
25733
|
+
function MsgVote(properties) {
|
25734
|
+
if (properties)
|
25735
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
25736
|
+
if (properties[keys[i]] != null)
|
25737
|
+
this[keys[i]] = properties[keys[i]];
|
25738
|
+
}
|
25739
|
+
|
25740
|
+
/**
|
25741
|
+
* MsgVote proposalId.
|
25742
|
+
* @member {Long} proposalId
|
25743
|
+
* @memberof TW.Cosmos.Proto.Message.MsgVote
|
25744
|
+
* @instance
|
25745
|
+
*/
|
25746
|
+
MsgVote.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
25747
|
+
|
25748
|
+
/**
|
25749
|
+
* MsgVote voter.
|
25750
|
+
* @member {string} voter
|
25751
|
+
* @memberof TW.Cosmos.Proto.Message.MsgVote
|
25752
|
+
* @instance
|
25753
|
+
*/
|
25754
|
+
MsgVote.prototype.voter = "";
|
25755
|
+
|
25756
|
+
/**
|
25757
|
+
* MsgVote option.
|
25758
|
+
* @member {TW.Cosmos.Proto.Message.VoteOption} option
|
25759
|
+
* @memberof TW.Cosmos.Proto.Message.MsgVote
|
25760
|
+
* @instance
|
25761
|
+
*/
|
25762
|
+
MsgVote.prototype.option = 0;
|
25763
|
+
|
25764
|
+
/**
|
25765
|
+
* Creates a new MsgVote instance using the specified properties.
|
25766
|
+
* @function create
|
25767
|
+
* @memberof TW.Cosmos.Proto.Message.MsgVote
|
25768
|
+
* @static
|
25769
|
+
* @param {TW.Cosmos.Proto.Message.IMsgVote=} [properties] Properties to set
|
25770
|
+
* @returns {TW.Cosmos.Proto.Message.MsgVote} MsgVote instance
|
25771
|
+
*/
|
25772
|
+
MsgVote.create = function create(properties) {
|
25773
|
+
return new MsgVote(properties);
|
25774
|
+
};
|
25775
|
+
|
25776
|
+
/**
|
25777
|
+
* Encodes the specified MsgVote message. Does not implicitly {@link TW.Cosmos.Proto.Message.MsgVote.verify|verify} messages.
|
25778
|
+
* @function encode
|
25779
|
+
* @memberof TW.Cosmos.Proto.Message.MsgVote
|
25780
|
+
* @static
|
25781
|
+
* @param {TW.Cosmos.Proto.Message.IMsgVote} message MsgVote message or plain object to encode
|
25782
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
25783
|
+
* @returns {$protobuf.Writer} Writer
|
25784
|
+
*/
|
25785
|
+
MsgVote.encode = function encode(message, writer) {
|
25786
|
+
if (!writer)
|
25787
|
+
writer = $Writer.create();
|
25788
|
+
if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId"))
|
25789
|
+
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId);
|
25790
|
+
if (message.voter != null && Object.hasOwnProperty.call(message, "voter"))
|
25791
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.voter);
|
25792
|
+
if (message.option != null && Object.hasOwnProperty.call(message, "option"))
|
25793
|
+
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.option);
|
25794
|
+
return writer;
|
25795
|
+
};
|
25796
|
+
|
25797
|
+
/**
|
25798
|
+
* Decodes a MsgVote message from the specified reader or buffer.
|
25799
|
+
* @function decode
|
25800
|
+
* @memberof TW.Cosmos.Proto.Message.MsgVote
|
25801
|
+
* @static
|
25802
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25803
|
+
* @param {number} [length] Message length if known beforehand
|
25804
|
+
* @returns {TW.Cosmos.Proto.Message.MsgVote} MsgVote
|
25805
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
25806
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25807
|
+
*/
|
25808
|
+
MsgVote.decode = function decode(reader, length) {
|
25809
|
+
if (!(reader instanceof $Reader))
|
25810
|
+
reader = $Reader.create(reader);
|
25811
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Cosmos.Proto.Message.MsgVote();
|
25812
|
+
while (reader.pos < end) {
|
25813
|
+
var tag = reader.uint32();
|
25814
|
+
switch (tag >>> 3) {
|
25815
|
+
case 1:
|
25816
|
+
message.proposalId = reader.uint64();
|
25817
|
+
break;
|
25818
|
+
case 2:
|
25819
|
+
message.voter = reader.string();
|
25820
|
+
break;
|
25821
|
+
case 3:
|
25822
|
+
message.option = reader.int32();
|
25823
|
+
break;
|
25824
|
+
default:
|
25825
|
+
reader.skipType(tag & 7);
|
25826
|
+
break;
|
25827
|
+
}
|
25828
|
+
}
|
25829
|
+
return message;
|
25830
|
+
};
|
25831
|
+
|
25832
|
+
/**
|
25833
|
+
* Verifies a MsgVote message.
|
25834
|
+
* @function verify
|
25835
|
+
* @memberof TW.Cosmos.Proto.Message.MsgVote
|
25836
|
+
* @static
|
25837
|
+
* @param {Object.<string,*>} message Plain object to verify
|
25838
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25839
|
+
*/
|
25840
|
+
MsgVote.verify = function verify(message) {
|
25841
|
+
if (typeof message !== "object" || message === null)
|
25842
|
+
return "object expected";
|
25843
|
+
if (message.proposalId != null && message.hasOwnProperty("proposalId"))
|
25844
|
+
if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high)))
|
25845
|
+
return "proposalId: integer|Long expected";
|
25846
|
+
if (message.voter != null && message.hasOwnProperty("voter"))
|
25847
|
+
if (!$util.isString(message.voter))
|
25848
|
+
return "voter: string expected";
|
25849
|
+
if (message.option != null && message.hasOwnProperty("option"))
|
25850
|
+
switch (message.option) {
|
25851
|
+
default:
|
25852
|
+
return "option: enum value expected";
|
25853
|
+
case 0:
|
25854
|
+
case 1:
|
25855
|
+
case 2:
|
25856
|
+
case 3:
|
25857
|
+
case 4:
|
25858
|
+
break;
|
25859
|
+
}
|
25860
|
+
return null;
|
25861
|
+
};
|
25862
|
+
|
25863
|
+
/**
|
25864
|
+
* Creates a MsgVote message from a plain object. Also converts values to their respective internal types.
|
25865
|
+
* @function fromObject
|
25866
|
+
* @memberof TW.Cosmos.Proto.Message.MsgVote
|
25867
|
+
* @static
|
25868
|
+
* @param {Object.<string,*>} object Plain object
|
25869
|
+
* @returns {TW.Cosmos.Proto.Message.MsgVote} MsgVote
|
25870
|
+
*/
|
25871
|
+
MsgVote.fromObject = function fromObject(object) {
|
25872
|
+
if (object instanceof $root.TW.Cosmos.Proto.Message.MsgVote)
|
25873
|
+
return object;
|
25874
|
+
var message = new $root.TW.Cosmos.Proto.Message.MsgVote();
|
25875
|
+
if (object.proposalId != null)
|
25876
|
+
if ($util.Long)
|
25877
|
+
(message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true;
|
25878
|
+
else if (typeof object.proposalId === "string")
|
25879
|
+
message.proposalId = parseInt(object.proposalId, 10);
|
25880
|
+
else if (typeof object.proposalId === "number")
|
25881
|
+
message.proposalId = object.proposalId;
|
25882
|
+
else if (typeof object.proposalId === "object")
|
25883
|
+
message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.high >>> 0).toNumber(true);
|
25884
|
+
if (object.voter != null)
|
25885
|
+
message.voter = String(object.voter);
|
25886
|
+
switch (object.option) {
|
25887
|
+
case "_UNSPECIFIED":
|
25888
|
+
case 0:
|
25889
|
+
message.option = 0;
|
25890
|
+
break;
|
25891
|
+
case "YES":
|
25892
|
+
case 1:
|
25893
|
+
message.option = 1;
|
25894
|
+
break;
|
25895
|
+
case "ABSTAIN":
|
25896
|
+
case 2:
|
25897
|
+
message.option = 2;
|
25898
|
+
break;
|
25899
|
+
case "NO":
|
25900
|
+
case 3:
|
25901
|
+
message.option = 3;
|
25902
|
+
break;
|
25903
|
+
case "NO_WITH_VETO":
|
25904
|
+
case 4:
|
25905
|
+
message.option = 4;
|
25906
|
+
break;
|
25907
|
+
}
|
25908
|
+
return message;
|
25909
|
+
};
|
25910
|
+
|
25911
|
+
/**
|
25912
|
+
* Creates a plain object from a MsgVote message. Also converts values to other types if specified.
|
25913
|
+
* @function toObject
|
25914
|
+
* @memberof TW.Cosmos.Proto.Message.MsgVote
|
25915
|
+
* @static
|
25916
|
+
* @param {TW.Cosmos.Proto.Message.MsgVote} message MsgVote
|
25917
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
25918
|
+
* @returns {Object.<string,*>} Plain object
|
25919
|
+
*/
|
25920
|
+
MsgVote.toObject = function toObject(message, options) {
|
25921
|
+
if (!options)
|
25922
|
+
options = {};
|
25923
|
+
var object = {};
|
25924
|
+
if (options.defaults) {
|
25925
|
+
if ($util.Long) {
|
25926
|
+
var long = new $util.Long(0, 0, true);
|
25927
|
+
object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
25928
|
+
} else
|
25929
|
+
object.proposalId = options.longs === String ? "0" : 0;
|
25930
|
+
object.voter = "";
|
25931
|
+
object.option = options.enums === String ? "_UNSPECIFIED" : 0;
|
25932
|
+
}
|
25933
|
+
if (message.proposalId != null && message.hasOwnProperty("proposalId"))
|
25934
|
+
if (typeof message.proposalId === "number")
|
25935
|
+
object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId;
|
25936
|
+
else
|
25937
|
+
object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId;
|
25938
|
+
if (message.voter != null && message.hasOwnProperty("voter"))
|
25939
|
+
object.voter = message.voter;
|
25940
|
+
if (message.option != null && message.hasOwnProperty("option"))
|
25941
|
+
object.option = options.enums === String ? $root.TW.Cosmos.Proto.Message.VoteOption[message.option] : message.option;
|
25942
|
+
return object;
|
25943
|
+
};
|
25944
|
+
|
25945
|
+
/**
|
25946
|
+
* Converts this MsgVote to JSON.
|
25947
|
+
* @function toJSON
|
25948
|
+
* @memberof TW.Cosmos.Proto.Message.MsgVote
|
25949
|
+
* @instance
|
25950
|
+
* @returns {Object.<string,*>} JSON object
|
25951
|
+
*/
|
25952
|
+
MsgVote.prototype.toJSON = function toJSON() {
|
25953
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
25954
|
+
};
|
25955
|
+
|
25956
|
+
return MsgVote;
|
25957
|
+
})();
|
25958
|
+
|
25660
25959
|
return Message;
|
25661
25960
|
})();
|
25662
25961
|
|
Binary file
|