From b64fe73622ccb4d25711bacbf967da06e11792ae Mon Sep 17 00:00:00 2001 From: Roy van Kaathoven Date: Thu, 20 Sep 2018 23:40:19 +0200 Subject: [PATCH 1/9] update protobufs add build protobuf script --- build-protobufs.sh | 6 + protobuf/api/api.proto | 890 ++ protobuf/core/Contract.proto | 229 + protobuf/core/Discover.proto | 44 + protobuf/core/Tron.proto | 485 + protobuf/core/TronInventoryItems.proto | 12 + src/protocol/core/Contract_pb.js | 3915 ++++++- src/protocol/core/Discover_pb.js | 192 +- src/protocol/core/TronInventoryItems_pb.js | 2 +- src/protocol/core/Tron_pb.js | 11127 +++++++++++++------ 10 files changed, 13116 insertions(+), 3786 deletions(-) create mode 100755 build-protobufs.sh create mode 100644 protobuf/api/api.proto create mode 100644 protobuf/core/Contract.proto create mode 100644 protobuf/core/Discover.proto create mode 100644 protobuf/core/Tron.proto create mode 100644 protobuf/core/TronInventoryItems.proto diff --git a/build-protobufs.sh b/build-protobufs.sh new file mode 100755 index 0000000..4e0b43b --- /dev/null +++ b/build-protobufs.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +docker run --rm -v $(pwd):$(pwd) -w $(pwd) znly/protoc \ + --proto_path=protobuf \ + --js_out=import_style=commonjs,binary:src/protocol \ + protobuf/core/*.proto protobuf/api/*.proto diff --git a/protobuf/api/api.proto b/protobuf/api/api.proto new file mode 100644 index 0000000..a84e460 --- /dev/null +++ b/protobuf/api/api.proto @@ -0,0 +1,890 @@ +syntax = "proto3"; +package protocol; + +import "core/Tron.proto"; +import "core/Contract.proto"; +import "google/api/annotations.proto"; + + +option java_package = "org.tron.api"; //Specify the name of the package that generated the Java file +option java_outer_classname = "GrpcAPI"; //Specify the class name of the generated Java file +option go_package = "github.com/tronprotocol/grpc-gateway/api"; + +service Wallet { + + rpc GetAccount (Account) returns (Account) { + option (google.api.http) = { + post: "/wallet/getaccount" + body: "*" + additional_bindings { + get: "/wallet/getaccount" + } + }; + }; + + rpc GetAccountById (Account) returns (Account) { + option (google.api.http) = { + post: "/wallet/getaccountbyid" + body: "*" + additional_bindings { + get: "/wallet/getaccountbyid" + } + }; + }; + + //Please use CreateTransaction2 instead of this function. + rpc CreateTransaction (TransferContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/createtransaction" + body: "*" + additional_bindings { + get: "/wallet/createtransaction" + } + }; + }; + //Use this function instead of CreateTransaction. + rpc CreateTransaction2 (TransferContract) returns (TransactionExtention) { + }; + + rpc BroadcastTransaction (Transaction) returns (Return) { + option (google.api.http) = { + post: "/wallet/broadcasttransaction" + body: "*" + additional_bindings { + get: "/wallet/broadcasttransaction" + } + }; + }; + //Please use UpdateAccount2 instead of this function. + rpc UpdateAccount (AccountUpdateContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/updateaccount" + body: "*" + additional_bindings { + get: "/wallet/updateaccount" + } + }; + }; + + + rpc SetAccountId (SetAccountIdContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/setaccountid" + body: "*" + additional_bindings { + get: "/wallet/setaccountid" + } + }; + }; + + //Use this function instead of UpdateAccount. + rpc UpdateAccount2 (AccountUpdateContract) returns (TransactionExtention) { + }; + + //Please use VoteWitnessAccount2 instead of this function. + rpc VoteWitnessAccount (VoteWitnessContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/votewitnessaccount" + body: "*" + additional_bindings { + get: "/wallet/votewitnessaccount" + } + }; + }; + + //modify the consume_user_resource_percent + rpc UpdateSetting (UpdateSettingContract) returns (TransactionExtention) { + }; + + //Use this function instead of VoteWitnessAccount. + rpc VoteWitnessAccount2 (VoteWitnessContract) returns (TransactionExtention) { + }; + //Please use CreateAssetIssue2 instead of this function. + rpc CreateAssetIssue (AssetIssueContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/createassetissue" + body: "*" + additional_bindings { + get: "/wallet/createassetissue" + } + }; + }; + //Use this function instead of CreateAssetIssue. + rpc CreateAssetIssue2 (AssetIssueContract) returns (TransactionExtention) { + }; + //Please use UpdateWitness2 instead of this function. + rpc UpdateWitness (WitnessUpdateContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/updatewitness" + body: "*" + additional_bindings { + get: "/wallet/updatewitness" + } + }; + }; + //Use this function instead of UpdateWitness. + rpc UpdateWitness2 (WitnessUpdateContract) returns (TransactionExtention) { + }; + //Please use CreateAccount2 instead of this function. + rpc CreateAccount (AccountCreateContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/createaccount" + body: "*" + additional_bindings { + get: "/wallet/createaccount" + } + }; + }; + //Use this function instead of CreateAccount. + rpc CreateAccount2 (AccountCreateContract) returns (TransactionExtention) { + } + //Please use CreateWitness2 instead of this function. + rpc CreateWitness (WitnessCreateContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/createwitness" + body: "*" + additional_bindings { + get: "/wallet/createwitness" + } + }; + }; + //Use this function instead of CreateWitness. + rpc CreateWitness2 (WitnessCreateContract) returns (TransactionExtention) { + } + //Please use TransferAsset2 instead of this function. + rpc TransferAsset (TransferAssetContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/transferasset" + body: "*" + additional_bindings { + get: "/wallet/transferasset" + } + }; + } + //Use this function instead of TransferAsset. + rpc TransferAsset2 (TransferAssetContract) returns (TransactionExtention) { + } + //Please use ParticipateAssetIssue2 instead of this function. + rpc ParticipateAssetIssue (ParticipateAssetIssueContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/participateassetissue" + body: "*" + additional_bindings { + get: "/wallet/participateassetissue" + } + }; + } + //Use this function instead of ParticipateAssetIssue. + rpc ParticipateAssetIssue2 (ParticipateAssetIssueContract) returns (TransactionExtention) { + } + //Please use FreezeBalance2 instead of this function. + rpc FreezeBalance (FreezeBalanceContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/freezebalance" + body: "*" + additional_bindings { + get: "/wallet/freezebalance" + } + }; + } + //Use this function instead of FreezeBalance. + rpc FreezeBalance2 (FreezeBalanceContract) returns (TransactionExtention) { + } + //Please use UnfreezeBalance2 instead of this function. + rpc UnfreezeBalance (UnfreezeBalanceContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/unfreezebalance" + body: "*" + additional_bindings { + get: "/wallet/unfreezebalance" + } + }; + } + //Use this function instead of UnfreezeBalance. + rpc UnfreezeBalance2 (UnfreezeBalanceContract) returns (TransactionExtention) { + } + //Please use UnfreezeAsset2 instead of this function. + rpc UnfreezeAsset (UnfreezeAssetContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/unfreezeasset" + body: "*" + additional_bindings { + get: "/wallet/unfreezeasset" + } + }; + } + //Use this function instead of UnfreezeAsset. + rpc UnfreezeAsset2 (UnfreezeAssetContract) returns (TransactionExtention) { + } + //Please use WithdrawBalance2 instead of this function. + rpc WithdrawBalance (WithdrawBalanceContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/withdrawbalance" + body: "*" + additional_bindings { + get: "/wallet/withdrawbalance" + } + }; + } + //Use this function instead of WithdrawBalance. + rpc WithdrawBalance2 (WithdrawBalanceContract) returns (TransactionExtention) { + } + //Please use UpdateAsset2 instead of this function. + rpc UpdateAsset (UpdateAssetContract) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/updateasset" + body: "*" + additional_bindings { + get: "/wallet/updateasset" + } + }; + } + //Use this function instead of UpdateAsset. + rpc UpdateAsset2 (UpdateAssetContract) returns (TransactionExtention) { + } + + rpc ProposalCreate (ProposalCreateContract) returns (TransactionExtention) { + } + + rpc ProposalApprove (ProposalApproveContract) returns (TransactionExtention) { + } + + rpc ProposalDelete (ProposalDeleteContract) returns (TransactionExtention) { + } + + rpc BuyStorage (BuyStorageContract) returns (TransactionExtention) { + } + + rpc BuyStorageBytes (BuyStorageBytesContract) returns (TransactionExtention) { + } + + rpc SellStorage (SellStorageContract) returns (TransactionExtention) { + } + + rpc ExchangeCreate (ExchangeCreateContract) returns (TransactionExtention) { + } + + rpc ExchangeInject (ExchangeInjectContract) returns (TransactionExtention) { + } + + rpc ExchangeWithdraw (ExchangeWithdrawContract) returns (TransactionExtention) { + } + + rpc ExchangeTransaction (ExchangeTransactionContract) returns (TransactionExtention) { + } + + rpc ListNodes (EmptyMessage) returns (NodeList) { + option (google.api.http) = { + post: "/wallet/listnodes" + body: "*" + additional_bindings { + get: "/wallet/listnodes" + } + }; + } + + rpc GetAssetIssueByAccount (Account) returns (AssetIssueList) { + option (google.api.http) = { + post: "/wallet/getassetissuebyaccount" + body: "*" + additional_bindings { + get: "/wallet/getassetissuebyaccount" + } + }; + } + rpc GetAccountNet (Account) returns (AccountNetMessage) { + option (google.api.http) = { + post: "/wallet/getaccountnet" + body: "*" + additional_bindings { + get: "/wallet/getaccountnet" + } + }; + }; + rpc GetAccountResource (Account) returns (AccountResourceMessage) { + }; + rpc GetAssetIssueByName (BytesMessage) returns (AssetIssueContract) { + option (google.api.http) = { + post: "/wallet/getassetissuebyname" + body: "*" + additional_bindings { + get: "/wallet/getassetissuebyname" + } + }; + } + //Please use GetNowBlock2 instead of this function. + rpc GetNowBlock (EmptyMessage) returns (Block) { + option (google.api.http) = { + post: "/wallet/getnowblock" + body: "*" + additional_bindings { + get: "/wallet/getnowblock" + } + }; + } + //Use this function instead of GetNowBlock. + rpc GetNowBlock2 (EmptyMessage) returns (BlockExtention) { + } + //Please use GetBlockByNum2 instead of this function. + rpc GetBlockByNum (NumberMessage) returns (Block) { + option (google.api.http) = { + post: "/wallet/getblockbynum" + body: "*" + additional_bindings { + get: "/wallet/getblockbynum" + } + }; + } + //Use this function instead of GetBlockByNum. + rpc GetBlockByNum2 (NumberMessage) returns (BlockExtention) { + } + + rpc GetTransactionCountByBlockNum (NumberMessage) returns (NumberMessage) { + } + + rpc GetBlockById (BytesMessage) returns (Block) { + option (google.api.http) = { + post: "/wallet/getblockbyid" + body: "*" + additional_bindings { + get: "/wallet/getblockbyid" + } + }; + } + //Please use GetBlockByLimitNext2 instead of this function. + rpc GetBlockByLimitNext (BlockLimit) returns (BlockList) { + option (google.api.http) = { + post: "/wallet/getblockbylimitnext" + body: "*" + additional_bindings { + get: "/wallet/getblockbylimitnext" + } + }; + } + //Use this function instead of GetBlockByLimitNext. + rpc GetBlockByLimitNext2 (BlockLimit) returns (BlockListExtention) { + } + //Please use GetBlockByLatestNum2 instead of this function. + rpc GetBlockByLatestNum (NumberMessage) returns (BlockList) { + option (google.api.http) = { + post: "/wallet/getblockbylatestnum" + body: "*" + additional_bindings { + get: "/wallet/getblockbylatestnum" + } + }; + } + //Use this function instead of GetBlockByLatestNum. + rpc GetBlockByLatestNum2 (NumberMessage) returns (BlockListExtention) { + } + rpc GetTransactionById (BytesMessage) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/gettransactionbyid" + body: "*" + additional_bindings { + get: "/wallet/gettransactionbyid" + } + }; + } + + rpc DeployContract (CreateSmartContract) returns (TransactionExtention) { + } + + rpc GetContract (BytesMessage) returns (SmartContract) { + } + + rpc TriggerContract (TriggerSmartContract) returns (TransactionExtention) { + } + + rpc ListWitnesses (EmptyMessage) returns (WitnessList) { + option (google.api.http) = { + post: "/wallet/listwitnesses" + body: "*" + additional_bindings { + get: "/wallet/listwitnesses" + } + }; + }; + + rpc ListProposals (EmptyMessage) returns (ProposalList) { + option (google.api.http) = { + post: "/wallet/listproposals" + body: "*" + additional_bindings { + get: "/wallet/listproposals" + } + }; + }; + + rpc GetProposalById (BytesMessage) returns (Proposal) { + option (google.api.http) = { + post: "/wallet/getproposalbyid" + body: "*" + additional_bindings { + get: "/wallet/getproposalbyid" + } + }; + }; + + rpc ListExchanges (EmptyMessage) returns (ExchangeList) { + option (google.api.http) = { + post: "/wallet/listexchanges" + body: "*" + additional_bindings { + get: "/wallet/listexchanges" + } + }; + }; + + rpc GetExchangeById (BytesMessage) returns (Exchange) { + option (google.api.http) = { + post: "/wallet/getexchangebyid" + body: "*" + additional_bindings { + get: "/wallet/getexchangebyid" + } + }; + }; + + rpc GetChainParameters (EmptyMessage) returns (ChainParameters) { + option (google.api.http) = { + post: "/wallet/getchainparameters" + body: "*" + additional_bindings { + get: "/wallet/getchainparameters" + } + }; + }; + + rpc GetAssetIssueList (EmptyMessage) returns (AssetIssueList) { + option (google.api.http) = { + post: "/wallet/getassetissuelist" + body: "*" + additional_bindings { + get: "/wallet/getassetissuelist" + } + }; + } + rpc GetPaginatedAssetIssueList (PaginatedMessage) returns (AssetIssueList) { + option (google.api.http) = { + post: "/wallet/getpaginatedassetissuelist" + body: "*" + additional_bindings { + get: "/wallet/getpaginatedassetissuelist" + } + }; + } + rpc TotalTransaction (EmptyMessage) returns (NumberMessage) { + option (google.api.http) = { + post: "/wallet/totaltransaction" + body: "*" + additional_bindings { + get: "/wallet/totaltransaction" + } + }; + } + rpc GetNextMaintenanceTime (EmptyMessage) returns (NumberMessage) { + option (google.api.http) = { + post: "/wallet/getnextmaintenancetime" + body: "*" + additional_bindings { + get: "/wallet/getnextmaintenancetime" + } + }; + } + //Warning: do not invoke this interface provided by others. + //Please use GetTransactionSign2 instead of this function. + rpc GetTransactionSign (TransactionSign) returns (Transaction) { + option (google.api.http) = { + post: "/wallet/gettransactionsign" + body: "*" + additional_bindings { + get: "/wallet/gettransactionsign" + } + }; + }; + //Warning: do not invoke this interface provided by others. + //Use this function instead of GetTransactionSign. + rpc GetTransactionSign2 (TransactionSign) returns (TransactionExtention) { + }; + //Warning: do not invoke this interface provided by others. + rpc CreateAddress (BytesMessage) returns (BytesMessage) { + option (google.api.http) = { + post: "/wallet/createaddress" + body: "*" + additional_bindings { + get: "/wallet/createaddress" + } + }; + }; + //Warning: do not invoke this interface provided by others. + rpc EasyTransfer (EasyTransferMessage) returns (EasyTransferResponse) { + option (google.api.http) = { + post: "/wallet/easytransfer" + body: "*" + additional_bindings { + get: "/wallet/easytransfer" + } + }; + }; + //Warning: do not invoke this interface provided by others. + rpc EasyTransferByPrivate (EasyTransferByPrivateMessage) returns (EasyTransferResponse) { + option (google.api.http) = { + post: "/wallet/easytransferbyprivate" + body: "*" + additional_bindings { + get: "/wallet/easytransferbyprivate" + } + }; + }; + //Warning: do not invoke this interface provided by others. + rpc GenerateAddress (EmptyMessage) returns (AddressPrKeyPairMessage) { + + option (google.api.http) = { + post: "/wallet/generateaddress" + body: "*" + additional_bindings { + get: "/wallet/generateaddress" + } + }; + } + + rpc GetTransactionInfoById (BytesMessage) returns (TransactionInfo) { + option (google.api.http) = { + post: "/wallet/gettransactioninfobyid" + body: "*" + additional_bindings { + get: "/wallet/gettransactioninfobyid" + } + }; + } +}; + + +service WalletSolidity { + + rpc GetAccount (Account) returns (Account) { + option (google.api.http) = { + post: "/walletsolidity/getaccount" + body: "*" + additional_bindings { + get: "/walletsolidity/getaccount" + } + }; + }; + rpc GetAccountById (Account) returns (Account) { + option (google.api.http) = { + post: "/walletsolidity/getaccountbyid" + body: "*" + additional_bindings { + get: "/walletsolidity/getaccountbyid" + } + }; + }; + + rpc ListWitnesses (EmptyMessage) returns (WitnessList) { + option (google.api.http) = { + post: "/walletsolidity/listwitnesses" + body: "*" + additional_bindings { + get: "/walletsolidity/listwitnesses" + } + }; + }; + rpc GetAssetIssueList (EmptyMessage) returns (AssetIssueList) { + option (google.api.http) = { + post: "/walletsolidity/getassetissuelist" + body: "*" + additional_bindings { + get: "/walletsolidity/getassetissuelist" + } + }; + } + rpc GetPaginatedAssetIssueList (PaginatedMessage) returns (AssetIssueList) { + option (google.api.http) = { + post: "/walletsolidity/getpaginatedassetissuelist" + body: "*" + additional_bindings { + get: "/walletsolidity/getpaginatedassetissuelist" + } + }; + } + //Please use GetNowBlock2 instead of this function. + rpc GetNowBlock (EmptyMessage) returns (Block) { + option (google.api.http) = { + post: "/walletsolidity/getnowblock" + body: "*" + additional_bindings { + get: "/walletsolidity/getnowblock" + } + }; + } + //Use this function instead of GetNowBlock. + rpc GetNowBlock2 (EmptyMessage) returns (BlockExtention) { + } + //Please use GetBlockByNum2 instead of this function. + rpc GetBlockByNum (NumberMessage) returns (Block) { + option (google.api.http) = { + post: "/walletsolidity/getblockbynum" + body: "*" + additional_bindings { + get: "/walletsolidity/getblockbynum" + } + }; + } + //Use this function instead of GetBlockByNum. + rpc GetBlockByNum2 (NumberMessage) returns (BlockExtention) { + } + + rpc GetTransactionCountByBlockNum (NumberMessage) returns (NumberMessage) { + } + + rpc GetTransactionById (BytesMessage) returns (Transaction) { + option (google.api.http) = { + post: "/walletsolidity/gettransactionbyid" + body: "*" + additional_bindings { + get: "/walletsolidity/gettransactionbyid" + } + }; + } + rpc GetTransactionInfoById (BytesMessage) returns (TransactionInfo) { + option (google.api.http) = { + post: "/walletsolidity/gettransactioninfobyid" + body: "*" + additional_bindings { + get: "/walletsolidity/gettransactioninfobyid" + } + }; + } + //Warning: do not invoke this interface provided by others. + rpc GenerateAddress (EmptyMessage) returns (AddressPrKeyPairMessage) { + option (google.api.http) = { + post: "/walletsolidity/generateaddress" + body: "*" + additional_bindings { + get: "/walletsolidity/generateaddress" + } + }; + } +}; + +service WalletExtension { + //Please use GetTransactionsFromThis2 instead of this function. + rpc GetTransactionsFromThis (AccountPaginated) returns (TransactionList) { + option (google.api.http) = { + post: "/walletextension/gettransactionsfromthis" + body: "*" + additional_bindings { + get: "/walletextension/gettransactionsfromthis" + } + }; + } + //Use this function instead of GetTransactionsFromThis. + rpc GetTransactionsFromThis2 (AccountPaginated) returns (TransactionListExtention) { + } + //Please use GetTransactionsToThis2 instead of this function. + rpc GetTransactionsToThis (AccountPaginated) returns (TransactionList) { + option (google.api.http) = { + post: "/walletextension/gettransactionstothis" + body: "*" + additional_bindings { + get: "/walletextension/gettransactionstothis" + } + }; + } + //Use this function instead of GetTransactionsToThis. + rpc GetTransactionsToThis2 (AccountPaginated) returns (TransactionListExtention) { + } +}; + +// the api of tron's db +service Database { + // for tapos + rpc getBlockReference (EmptyMessage) returns (BlockReference) { + + } + rpc GetDynamicProperties (EmptyMessage) returns (DynamicProperties) { + + } + rpc GetNowBlock (EmptyMessage) returns (Block) { + + } + rpc GetBlockByNum (NumberMessage) returns (Block) { + + } +}; + +message Return { + enum response_code { + SUCCESS = 0; + SIGERROR = 1; // error in signature + CONTRACT_VALIDATE_ERROR = 2; + CONTRACT_EXE_ERROR = 3; + BANDWITH_ERROR = 4; + DUP_TRANSACTION_ERROR = 5; + TAPOS_ERROR = 6; + TOO_BIG_TRANSACTION_ERROR = 7; + TRANSACTION_EXPIRATION_ERROR = 8; + SERVER_BUSY = 9; + OTHER_ERROR = 20; + } + + bool result = 1; + response_code code = 2; + bytes message = 3; +} + +message BlockReference { + int64 block_num = 1; + bytes block_hash = 2; +} + +// the api of tron's network such as node list. +service Network { + +}; + +message WitnessList { + repeated Witness witnesses = 1; +} +message ProposalList { + repeated Proposal proposals = 1; +} +message ExchangeList { + repeated Exchange exchanges = 1; +} +message AssetIssueList { + repeated AssetIssueContract assetIssue = 1; +} +message BlockList { + repeated Block block = 1; +} +message TransactionList { + repeated Transaction transaction = 1; +} + +// Gossip node list +message NodeList { + repeated Node nodes = 1; +} + +// Gossip node +message Node { + Address address = 1; +} + +// Gossip node address +message Address { + bytes host = 1; + int32 port = 2; +} + +message EmptyMessage { +} +message NumberMessage { + int64 num = 1; +} +message BytesMessage { + bytes value = 1; +} +message TimeMessage { + int64 beginInMilliseconds = 1; + int64 endInMilliseconds = 2; +} +message BlockLimit { + int64 startNum = 1; + int64 endNum = 2; +} +message TransactionLimit { + bytes transactionId = 1; + int64 limitNum = 2; +} +message AccountPaginated { + Account account = 1; + int64 offset = 2; + int64 limit = 3; +} +message TimePaginatedMessage { + TimeMessage timeMessage = 1; + int64 offset = 2; + int64 limit = 3; +} +//deprecated +message AccountNetMessage { + int64 freeNetUsed = 1; + int64 freeNetLimit = 2; + int64 NetUsed = 3; + int64 NetLimit = 4; + map assetNetUsed = 5; + map assetNetLimit = 6; + int64 TotalNetLimit = 7; + int64 TotalNetWeight = 8; +} +message AccountResourceMessage { + int64 freeNetUsed = 1; + int64 freeNetLimit = 2; + int64 NetUsed = 3; + int64 NetLimit = 4; + map assetNetUsed = 5; + map assetNetLimit = 6; + int64 TotalNetLimit = 7; + int64 TotalNetWeight = 8; + + int64 EnergyUsed = 13; + int64 EnergyLimit = 14; + int64 TotalEnergyLimit = 15; + int64 TotalEnergyWeight = 16; + + int64 storageUsed = 21; + int64 storageLimit = 22; +} + +message PaginatedMessage { + int64 offset = 1; + int64 limit = 2; +} + +message EasyTransferMessage { + bytes passPhrase = 1; + bytes toAddress = 2; + int64 amount = 3; +} + +message EasyTransferByPrivateMessage { + bytes privateKey = 1; + bytes toAddress = 2; + int64 amount = 3; +} + +message EasyTransferResponse { + Transaction transaction = 1; + Return result = 2; + bytes txid = 3; //transaction id = sha256(transaction.rowdata) +} + +message AddressPrKeyPairMessage { + string address = 1; + string privateKey = 2; +} + +message TransactionExtention { + Transaction transaction = 1; + bytes txid = 2; //transaction id = sha256(transaction.rowdata) + repeated bytes constant_result = 3; + Return result = 4; +} + +message BlockExtention { + repeated TransactionExtention transactions = 1; + BlockHeader block_header = 2; + bytes blockid = 3; +} + +message BlockListExtention { + repeated BlockExtention block = 1; +} + +message TransactionListExtention { + repeated TransactionExtention transaction = 1; +} \ No newline at end of file diff --git a/protobuf/core/Contract.proto b/protobuf/core/Contract.proto new file mode 100644 index 0000000..18eafde --- /dev/null +++ b/protobuf/core/Contract.proto @@ -0,0 +1,229 @@ +/* + * java-tron is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * java-tron is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +syntax = "proto3"; + +package protocol; + +option java_package = "org.tron.protos"; //Specify the name of the package that generated the Java file +option java_outer_classname = "Contract"; //Specify the class name of the generated Java file +option go_package = "github.com/tronprotocol/grpc-gateway/core"; + +import "core/Tron.proto"; + +message AccountCreateContract { + bytes owner_address = 1; + bytes account_address = 2; + AccountType type = 3; +} + +// Update account name. Account name is not unique now. +message AccountUpdateContract { + bytes account_name = 1; + bytes owner_address = 2; +} + +// Set account id if the account has no id. Account id is unique and case insensitive. +message SetAccountIdContract { + bytes account_id = 1; + bytes owner_address = 2; +} + +message TransferContract { + bytes owner_address = 1; + bytes to_address = 2; + int64 amount = 3; +} + +message TransferAssetContract { + bytes asset_name = 1; + bytes owner_address = 2; + bytes to_address = 3; + int64 amount = 4; +} + + +message VoteAssetContract { + bytes owner_address = 1; + repeated bytes vote_address = 2; + bool support = 3; + int32 count = 5; +} + +message VoteWitnessContract { + message Vote { + bytes vote_address = 1; + int64 vote_count = 2; + } + bytes owner_address = 1; + repeated Vote votes = 2; + bool support = 3; +} + +message UpdateSettingContract { + bytes owner_address = 1; + bytes contract_address = 2; + int64 consume_user_resource_percent = 3; +} + +message WitnessCreateContract { + bytes owner_address = 1; + bytes url = 2; +} + +message WitnessUpdateContract { + bytes owner_address = 1; + bytes update_url = 12; +} + +message AssetIssueContract { + message FrozenSupply { + int64 frozen_amount = 1; + int64 frozen_days = 2; + } + bytes owner_address = 1; + bytes name = 2; + bytes abbr = 3; + int64 total_supply = 4; + repeated FrozenSupply frozen_supply = 5; + int32 trx_num = 6; + int32 num = 8; + int64 start_time = 9; + int64 end_time = 10; + int64 order = 11; // the order of tokens of the same name + int32 vote_score = 16; + bytes description = 20; + bytes url = 21; + int64 free_asset_net_limit = 22; + int64 public_free_asset_net_limit = 23; + int64 public_free_asset_net_usage = 24; + int64 public_latest_free_net_time = 25; +} + +message ParticipateAssetIssueContract { + bytes owner_address = 1; + bytes to_address = 2; + bytes asset_name = 3; // the namekey of target asset, include name and order + int64 amount = 4; // the amount of drops +} + + +enum ResourceCode { + BANDWIDTH = 0x00; + ENERGY = 0x01; +} + +message FreezeBalanceContract { + bytes owner_address = 1; + int64 frozen_balance = 2; + int64 frozen_duration = 3; + + ResourceCode resource = 10; +} + +message UnfreezeBalanceContract { + bytes owner_address = 1; + + ResourceCode resource = 10; +} + +message UnfreezeAssetContract { + bytes owner_address = 1; +} + +message WithdrawBalanceContract { + bytes owner_address = 1; +} + +message UpdateAssetContract { + bytes owner_address = 1; + bytes description = 2; + bytes url = 3; + int64 new_limit = 4; + int64 new_public_limit = 5; +} + +message ProposalCreateContract { + bytes owner_address = 1; + map parameters = 2; +} + +message ProposalApproveContract { + bytes owner_address = 1; + int64 proposal_id = 2; + bool is_add_approval = 3; // add or remove approval +} + +message ProposalDeleteContract { + bytes owner_address = 1; + int64 proposal_id = 2; +} + +message CreateSmartContract { + bytes owner_address = 1; + SmartContract new_contract = 2; +} + +message TriggerSmartContract { + bytes owner_address = 1; + bytes contract_address = 2; + int64 call_value = 3; + bytes data = 4; +} + +message BuyStorageContract { + bytes owner_address = 1; + int64 quant = 2; // trx quantity for buy storage (sun) +} + +message BuyStorageBytesContract { + bytes owner_address = 1; + int64 bytes = 2; // storage bytes for buy +} + +message SellStorageContract { + bytes owner_address = 1; + int64 storage_bytes = 2; +} + +message ExchangeCreateContract { + bytes owner_address = 1; + bytes first_token_id = 2; + int64 first_token_balance = 3; + bytes second_token_id = 4; + int64 second_token_balance = 5; +} + +message ExchangeInjectContract { + bytes owner_address = 1; + int64 exchange_id = 2; + bytes token_id = 3; + int64 quant = 4; +} + +message ExchangeWithdrawContract { + bytes owner_address = 1; + int64 exchange_id = 2; + bytes token_id = 3; + int64 quant = 4; +} + +message ExchangeTransactionContract { + bytes owner_address = 1; + int64 exchange_id = 2; + bytes token_id = 3; + int64 quant = 4; + int64 expected = 5; +} \ No newline at end of file diff --git a/protobuf/core/Discover.proto b/protobuf/core/Discover.proto new file mode 100644 index 0000000..4cc0d83 --- /dev/null +++ b/protobuf/core/Discover.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package protocol; + + +option java_package = "org.tron.protos"; //Specify the name of the package that generated the Java file +option java_outer_classname = "Discover"; //Specify the class name of the generated Java file +option go_package = "github.com/tronprotocol/grpc-gateway/core"; + +message Endpoint { + bytes address = 1; + int32 port = 2; + bytes nodeId = 3; +} + +message PingMessage { + Endpoint from = 1; + Endpoint to = 2; + int32 version = 3; + int64 timestamp = 4; +} + +message PongMessage { + Endpoint from = 1; + int32 echo = 2; + int64 timestamp = 3; +} + +message FindNeighbours { + Endpoint from = 1; + bytes targetId = 2; + int64 timestamp = 3; +} + +message Neighbours { + Endpoint from = 1; + repeated Endpoint neighbours = 2; + int64 timestamp = 3; +} + +message BackupMessage { + bool flag = 1; + int32 priority = 2; +} \ No newline at end of file diff --git a/protobuf/core/Tron.proto b/protobuf/core/Tron.proto new file mode 100644 index 0000000..38c4f3a --- /dev/null +++ b/protobuf/core/Tron.proto @@ -0,0 +1,485 @@ +syntax = "proto3"; + +import "google/protobuf/any.proto"; +import "core/Discover.proto"; + +package protocol; + + +option java_package = "org.tron.protos"; //Specify the name of the package that generated the Java file +option java_outer_classname = "Protocol"; //Specify the class name of the generated Java file +option go_package = "github.com/tronprotocol/grpc-gateway/core"; + +enum AccountType { + Normal = 0; + AssetIssue = 1; + Contract = 2; +} + +// AccountId, (name, address) use name, (null, address) use address, (name, null) use name, +message AccountId { + bytes name = 1; + bytes address = 2; +} + +// vote message +message Vote { + // the super rep address + bytes vote_address = 1; + // the vote num to this super rep. + int64 vote_count = 2; +} + +// Proposal +message Proposal { + int64 proposal_id = 1; + bytes proposer_address = 2; + map parameters = 3; + int64 expiration_time = 4; + int64 create_time = 5; + repeated bytes approvals = 6; + enum State { + PENDING = 0; + DISAPPROVED = 1; + APPROVED = 2; + CANCELED = 3; + } + State state = 7; +} + +// Exchange +message Exchange { + int64 exchange_id = 1; + bytes creator_address = 2; + int64 create_time = 3; + bytes first_token_id = 6; + int64 first_token_balance = 7; + bytes second_token_id = 8; + int64 second_token_balance = 9; +} + +message ChainParameters { + repeated ChainParameter chainParameter = 1; + message ChainParameter { + string key = 1; + int64 value = 2; + } +} + +/* Account */ +message Account { + /* frozen balance */ + message Frozen { + int64 frozen_balance = 1; // the frozen trx balance + int64 expire_time = 2; // the expire time + } + // account nick name + bytes account_name = 1; + AccountType type = 2; + // the create address + bytes address = 3; + // the trx balance + int64 balance = 4; + // the votes + repeated Vote votes = 5; + // the other asset owned by this account + map asset = 6; + + // the frozen balance + repeated Frozen frozen = 7; + // bandwidth, get from frozen + int64 net_usage = 8; + + // this account create time + int64 create_time = 0x09; + // this last operation time, including transfer, voting and so on. //FIXME fix grammar + int64 latest_opration_time = 10; + // witness block producing allowance + int64 allowance = 0x0B; + // last withdraw time + int64 latest_withdraw_time = 0x0C; + // not used so far + bytes code = 13; + bool is_witness = 14; + bool is_committee = 15; + // frozen asset(for asset issuer) + repeated Frozen frozen_supply = 16; + // asset_issued_name + bytes asset_issued_name = 17; + map latest_asset_operation_time = 18; + + int64 free_net_usage = 19; + map free_asset_net_usage = 20; + int64 latest_consume_time = 21; + int64 latest_consume_free_time = 22; + + // the identity of this account, case insensitive + bytes account_id = 23; + + message AccountResource { + // energy resource, get from frozen + int64 energy_usage = 1; + // the frozen balance for energy + Frozen frozen_balance_for_energy = 2; + int64 latest_consume_time_for_energy = 3; + + // storage resource, get from market + int64 storage_limit = 6; + int64 storage_usage = 7; + int64 latest_exchange_storage_time = 8; + } + AccountResource account_resource = 26; + + bytes codeHash = 30; +} + +message authority { + AccountId account = 1; + bytes permission_name = 2; +} + +message permission { + AccountId account = 1; +} + +// Witness +message Witness { + bytes address = 1; + int64 voteCount = 2; + bytes pubKey = 3; + string url = 4; + int64 totalProduced = 5; + int64 totalMissed = 6; + int64 latestBlockNum = 7; + int64 latestSlotNum = 8; + bool isJobs = 9; +} + +// Vote Change +message Votes { + bytes address = 1; + repeated Vote old_votes = 2; + repeated Vote new_votes = 3; +} + +// Transcation + +message TXOutput { + int64 value = 1; + bytes pubKeyHash = 2; +} + +message TXInput { + message raw { + bytes txID = 1; + int64 vout = 2; + bytes pubKey = 3; + } + raw raw_data = 1; + bytes signature = 4; +} + +message TXOutputs { + repeated TXOutput outputs = 1; +} + +message ResourceReceipt { + int64 energy_usage = 1; + int64 energy_fee = 2; + int64 origin_energy_usage = 3; + int64 energy_usage_total = 4; + int64 net_usage = 5; + int64 net_fee = 6; + Transaction.Result.contractResult result = 7; +} + +message Transaction { + message Contract { + enum ContractType { + AccountCreateContract = 0; + TransferContract = 1; + TransferAssetContract = 2; + VoteAssetContract = 3; + VoteWitnessContract = 4; + WitnessCreateContract = 5; + AssetIssueContract = 6; + WitnessUpdateContract = 8; + ParticipateAssetIssueContract = 9; + AccountUpdateContract = 10; + FreezeBalanceContract = 11; + UnfreezeBalanceContract = 12; + WithdrawBalanceContract = 13; + UnfreezeAssetContract = 14; + UpdateAssetContract = 15; + ProposalCreateContract = 16; + ProposalApproveContract = 17; + ProposalDeleteContract = 18; + SetAccountIdContract = 19; + CustomContract = 20; + // BuyStorageContract = 21; + // BuyStorageBytesContract = 22; + // SellStorageContract = 23; + CreateSmartContract = 30; + TriggerSmartContract = 31; + GetContract = 32; + UpdateSettingContract = 33; + ExchangeCreateContract = 41; + ExchangeInjectContract = 42; + ExchangeWithdrawContract = 43; + ExchangeTransactionContract = 44; + } + ContractType type = 1; + google.protobuf.Any parameter = 2; + bytes provider = 3; + bytes ContractName = 4; + } + + message Result { + enum code { + SUCESS = 0; + FAILED = 1; + } + enum contractResult { + DEFAULT = 0; + SUCCESS = 1; + REVERT = 2; + BAD_JUMP_DESTINATION = 3; + OUT_OF_MEMORY = 4; + PRECOMPILED_CONTRACT = 5; + STACK_TOO_SMALL = 6; + STACK_TOO_LARGE = 7; + ILLEGAL_OPERATION = 8; + STACK_OVERFLOW = 9; + OUT_OF_ENERGY = 10; + OUT_OF_TIME = 11; + JVM_STACK_OVER_FLOW = 12; + UNKNOWN = 13; + } + int64 fee = 1; + code ret = 2; + contractResult contractRet = 3; + + int64 withdraw_amount = 15; + int64 unfreeze_amount = 16; + } + + message raw { + bytes ref_block_bytes = 1; + int64 ref_block_num = 3; + bytes ref_block_hash = 4; + int64 expiration = 8; + repeated authority auths = 9; + // data not used + bytes data = 10; + //only support size = 1, repeated list here for extension + repeated Contract contract = 11; + // scripts not used + bytes scripts = 12; + int64 timestamp = 14; + int64 fee_limit = 18; + } + + raw raw_data = 1; + // only support size = 1, repeated list here for muti-sig extension + repeated bytes signature = 2; + repeated Result ret = 5; +} + +message TransactionInfo { + enum code { + SUCESS = 0; + FAILED = 1; + } + message Log { + bytes address = 1; + repeated bytes topics = 2; + bytes data = 3; + } + bytes id = 1; + int64 fee = 2; + int64 blockNumber = 3; + int64 blockTimeStamp = 4; + repeated bytes contractResult = 5; + bytes contract_address = 6; + ResourceReceipt receipt = 7; + repeated Log log = 8; + code result = 9; + bytes resMessage = 10; + + int64 withdraw_amount = 15; + int64 unfreeze_amount = 16; +} + +message Transactions { + repeated Transaction transactions = 1; +} + +message TransactionSign { + Transaction transaction = 1; + bytes privateKey = 2; +} + +message BlockHeader { + message raw { + int64 timestamp = 1; + bytes txTrieRoot = 2; + bytes parentHash = 3; + //bytes nonce = 5; + //bytes difficulty = 6; + int64 number = 7; + int64 witness_id = 8; + bytes witness_address = 9; + int32 version = 10; + } + raw raw_data = 1; + bytes witness_signature = 2; +} + +// block +message Block { + repeated Transaction transactions = 1; + BlockHeader block_header = 2; +} + +message ChainInventory { + message BlockId { + bytes hash = 1; + int64 number = 2; + } + repeated BlockId ids = 1; + int64 remain_num = 2; +} + +// Inventory +message BlockInventory { + enum Type { + SYNC = 0; + ADVTISE = 1; + FETCH = 2; + } + + message BlockId { + bytes hash = 1; + int64 number = 2; + } + repeated BlockId ids = 1; + Type type = 2; +} + +message Inventory { + enum InventoryType { + TRX = 0; + BLOCK = 1; + } + InventoryType type = 1; + repeated bytes ids = 2; +} + +message Items { + enum ItemType { + ERR = 0; + TRX = 1; + BLOCK = 2; + BLOCKHEADER = 3; + } + + ItemType type = 1; + repeated Block blocks = 2; + repeated BlockHeader block_headers = 3; + repeated Transaction transactions = 4; +} + +// DynamicProperties +message DynamicProperties { + int64 last_solidity_block_num = 1; +} + +enum ReasonCode { + REQUESTED = 0x00; + BAD_PROTOCOL = 0x02; + TOO_MANY_PEERS = 0x04; + DUPLICATE_PEER = 0x05; + INCOMPATIBLE_PROTOCOL = 0x06; + NULL_IDENTITY = 0x07; + PEER_QUITING = 0x08; + UNEXPECTED_IDENTITY = 0x09; + LOCAL_IDENTITY = 0x0A; + PING_TIMEOUT = 0x0B; + USER_REASON = 0x10; + RESET = 0x11; + SYNC_FAIL = 0x12; + FETCH_FAIL = 0x13; + BAD_TX = 0x14; + BAD_BLOCK = 0x15; + FORKED = 0x16; + UNLINKABLE = 0x17; + INCOMPATIBLE_VERSION = 0x18; + INCOMPATIBLE_CHAIN = 0x19; + TIME_OUT = 0x20; + CONNECT_FAIL = 0x21; + TOO_MANY_PEERS_WITH_SAME_IP = 0x22; + UNKNOWN = 0xFF; +} + +message DisconnectMessage { + ReasonCode reason = 1; +} + +message HelloMessage { + message BlockId { + bytes hash = 1; + int64 number = 2; + } + + Endpoint from = 1; + int32 version = 2; + int64 timestamp = 3; + BlockId genesisBlockId = 4; + BlockId solidBlockId = 5; + BlockId headBlockId = 6; +} + +message SmartContract { + message ABI { + message Entry { + enum EntryType { + UnknownEntryType = 0; + Constructor = 1; + Function = 2; + Event = 3; + Fallback = 4; + } + message Param { + bool indexed = 1; + string name = 2; + string type = 3; + // SolidityType type = 3; + } + enum StateMutabilityType { + UnknownMutabilityType = 0; + Pure = 1; + View = 2; + Nonpayable = 3; + Payable = 4; + } + + bool anonymous = 1; + bool constant = 2; + string name = 3; + repeated Param inputs = 4; + repeated Param outputs = 5; + EntryType type = 6; + bool payable = 7; + StateMutabilityType stateMutability = 8; + } + repeated Entry entrys = 1; + } + bytes origin_address = 1; + bytes contract_address = 2; + ABI abi = 3; + bytes bytecode = 4; + int64 call_value = 5; + int64 consume_user_resource_percent = 6; + string name = 7; + +} \ No newline at end of file diff --git a/protobuf/core/TronInventoryItems.proto b/protobuf/core/TronInventoryItems.proto new file mode 100644 index 0000000..a82d2de --- /dev/null +++ b/protobuf/core/TronInventoryItems.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package protocol; + +option java_package = "org.tron.protos"; //Specify the name of the package that generated the Java file +option java_outer_classname = "TronInventoryItems"; //Specify the class name of the generated Java file +option go_package = "github.com/tronprotocol/grpc-gateway/core"; + +message InventoryItems { + int32 type = 1; + repeated bytes items = 2; +} \ No newline at end of file diff --git a/src/protocol/core/Contract_pb.js b/src/protocol/core/Contract_pb.js index bbcd3f1..79e1586 100644 --- a/src/protocol/core/Contract_pb.js +++ b/src/protocol/core/Contract_pb.js @@ -16,14 +16,28 @@ goog.exportSymbol('proto.protocol.AccountCreateContract', null, global); goog.exportSymbol('proto.protocol.AccountUpdateContract', null, global); goog.exportSymbol('proto.protocol.AssetIssueContract', null, global); goog.exportSymbol('proto.protocol.AssetIssueContract.FrozenSupply', null, global); -goog.exportSymbol('proto.protocol.DeployContract', null, global); +goog.exportSymbol('proto.protocol.BuyStorageBytesContract', null, global); +goog.exportSymbol('proto.protocol.BuyStorageContract', null, global); +goog.exportSymbol('proto.protocol.CreateSmartContract', null, global); +goog.exportSymbol('proto.protocol.ExchangeCreateContract', null, global); +goog.exportSymbol('proto.protocol.ExchangeInjectContract', null, global); +goog.exportSymbol('proto.protocol.ExchangeTransactionContract', null, global); +goog.exportSymbol('proto.protocol.ExchangeWithdrawContract', null, global); goog.exportSymbol('proto.protocol.FreezeBalanceContract', null, global); goog.exportSymbol('proto.protocol.ParticipateAssetIssueContract', null, global); +goog.exportSymbol('proto.protocol.ProposalApproveContract', null, global); +goog.exportSymbol('proto.protocol.ProposalCreateContract', null, global); +goog.exportSymbol('proto.protocol.ProposalDeleteContract', null, global); +goog.exportSymbol('proto.protocol.ResourceCode', null, global); +goog.exportSymbol('proto.protocol.SellStorageContract', null, global); +goog.exportSymbol('proto.protocol.SetAccountIdContract', null, global); goog.exportSymbol('proto.protocol.TransferAssetContract', null, global); goog.exportSymbol('proto.protocol.TransferContract', null, global); +goog.exportSymbol('proto.protocol.TriggerSmartContract', null, global); goog.exportSymbol('proto.protocol.UnfreezeAssetContract', null, global); goog.exportSymbol('proto.protocol.UnfreezeBalanceContract', null, global); goog.exportSymbol('proto.protocol.UpdateAssetContract', null, global); +goog.exportSymbol('proto.protocol.UpdateSettingContract', null, global); goog.exportSymbol('proto.protocol.VoteAssetContract', null, global); goog.exportSymbol('proto.protocol.VoteWitnessContract', null, global); goog.exportSymbol('proto.protocol.VoteWitnessContract.Vote', null, global); @@ -77,9 +91,9 @@ proto.protocol.AccountCreateContract.prototype.toObject = function(opt_includeIn */ proto.protocol.AccountCreateContract.toObject = function(includeInstance, msg) { var f, obj = { - type: jspb.Message.getFieldWithDefault(msg, 1, 0), - accountName: msg.getAccountName_asB64(), - ownerAddress: msg.getOwnerAddress_asB64() + ownerAddress: msg.getOwnerAddress_asB64(), + accountAddress: msg.getAccountAddress_asB64(), + type: jspb.Message.getFieldWithDefault(msg, 3, 0) }; if (includeInstance) { @@ -117,16 +131,16 @@ proto.protocol.AccountCreateContract.deserializeBinaryFromReader = function(msg, var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {!proto.protocol.AccountType} */ (reader.readEnum()); - msg.setType(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setAccountName(value); + msg.setAccountAddress(value); break; case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setOwnerAddress(value); + var value = /** @type {!proto.protocol.AccountType} */ (reader.readEnum()); + msg.setType(value); break; default: reader.skipField(); @@ -157,23 +171,23 @@ proto.protocol.AccountCreateContract.prototype.serializeBinary = function() { */ proto.protocol.AccountCreateContract.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( 1, f ); } - f = message.getAccountName_asU8(); + f = message.getAccountAddress_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } - f = message.getOwnerAddress_asU8(); - if (f.length > 0) { - writer.writeBytes( + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( 3, f ); @@ -182,95 +196,95 @@ proto.protocol.AccountCreateContract.serializeBinaryToWriter = function(message, /** - * optional AccountType type = 1; - * @return {!proto.protocol.AccountType} - */ -proto.protocol.AccountCreateContract.prototype.getType = function() { - return /** @type {!proto.protocol.AccountType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {!proto.protocol.AccountType} value */ -proto.protocol.AccountCreateContract.prototype.setType = function(value) { - jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * optional bytes account_name = 2; + * optional bytes owner_address = 1; * @return {!(string|Uint8Array)} */ -proto.protocol.AccountCreateContract.prototype.getAccountName = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.protocol.AccountCreateContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional bytes account_name = 2; - * This is a type-conversion wrapper around `getAccountName()` + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` * @return {string} */ -proto.protocol.AccountCreateContract.prototype.getAccountName_asB64 = function() { +proto.protocol.AccountCreateContract.prototype.getOwnerAddress_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getAccountName())); + this.getOwnerAddress())); }; /** - * optional bytes account_name = 2; + * optional bytes owner_address = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getAccountName()` + * This is a type-conversion wrapper around `getOwnerAddress()` * @return {!Uint8Array} */ -proto.protocol.AccountCreateContract.prototype.getAccountName_asU8 = function() { +proto.protocol.AccountCreateContract.prototype.getOwnerAddress_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getAccountName())); + this.getOwnerAddress())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.AccountCreateContract.prototype.setAccountName = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); +proto.protocol.AccountCreateContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); }; /** - * optional bytes owner_address = 3; + * optional bytes account_address = 2; * @return {!(string|Uint8Array)} */ -proto.protocol.AccountCreateContract.prototype.getOwnerAddress = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.protocol.AccountCreateContract.prototype.getAccountAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * optional bytes owner_address = 3; - * This is a type-conversion wrapper around `getOwnerAddress()` + * optional bytes account_address = 2; + * This is a type-conversion wrapper around `getAccountAddress()` * @return {string} */ -proto.protocol.AccountCreateContract.prototype.getOwnerAddress_asB64 = function() { +proto.protocol.AccountCreateContract.prototype.getAccountAddress_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getOwnerAddress())); + this.getAccountAddress())); }; /** - * optional bytes owner_address = 3; + * optional bytes account_address = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getOwnerAddress()` + * This is a type-conversion wrapper around `getAccountAddress()` * @return {!Uint8Array} */ -proto.protocol.AccountCreateContract.prototype.getOwnerAddress_asU8 = function() { +proto.protocol.AccountCreateContract.prototype.getAccountAddress_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getOwnerAddress())); + this.getAccountAddress())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.AccountCreateContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 3, value); +proto.protocol.AccountCreateContract.prototype.setAccountAddress = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional AccountType type = 3; + * @return {!proto.protocol.AccountType} + */ +proto.protocol.AccountCreateContract.prototype.getType = function() { + return /** @type {!proto.protocol.AccountType} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {!proto.protocol.AccountType} value */ +proto.protocol.AccountCreateContract.prototype.setType = function(value) { + jspb.Message.setField(this, 3, value); }; @@ -448,7 +462,7 @@ proto.protocol.AccountUpdateContract.prototype.getAccountName_asU8 = function() /** @param {!(string|Uint8Array)} value */ proto.protocol.AccountUpdateContract.prototype.setAccountName = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -487,7 +501,224 @@ proto.protocol.AccountUpdateContract.prototype.getOwnerAddress_asU8 = function() /** @param {!(string|Uint8Array)} value */ proto.protocol.AccountUpdateContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); + jspb.Message.setField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.SetAccountIdContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.SetAccountIdContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.SetAccountIdContract.displayName = 'proto.protocol.SetAccountIdContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.SetAccountIdContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.SetAccountIdContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.SetAccountIdContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.SetAccountIdContract.toObject = function(includeInstance, msg) { + var f, obj = { + accountId: msg.getAccountId_asB64(), + ownerAddress: msg.getOwnerAddress_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.SetAccountIdContract} + */ +proto.protocol.SetAccountIdContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.SetAccountIdContract; + return proto.protocol.SetAccountIdContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.SetAccountIdContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.SetAccountIdContract} + */ +proto.protocol.SetAccountIdContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAccountId(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.SetAccountIdContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.SetAccountIdContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.SetAccountIdContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.SetAccountIdContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAccountId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional bytes account_id = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.SetAccountIdContract.prototype.getAccountId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes account_id = 1; + * This is a type-conversion wrapper around `getAccountId()` + * @return {string} + */ +proto.protocol.SetAccountIdContract.prototype.getAccountId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAccountId())); +}; + + +/** + * optional bytes account_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAccountId()` + * @return {!Uint8Array} + */ +proto.protocol.SetAccountIdContract.prototype.getAccountId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAccountId())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.SetAccountIdContract.prototype.setAccountId = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional bytes owner_address = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.SetAccountIdContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes owner_address = 2; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.SetAccountIdContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.SetAccountIdContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.SetAccountIdContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 2, value); }; @@ -677,7 +908,7 @@ proto.protocol.TransferContract.prototype.getOwnerAddress_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.TransferContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -716,7 +947,7 @@ proto.protocol.TransferContract.prototype.getToAddress_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.TransferContract.prototype.setToAddress = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -731,7 +962,7 @@ proto.protocol.TransferContract.prototype.getAmount = function() { /** @param {number} value */ proto.protocol.TransferContract.prototype.setAmount = function(value) { - jspb.Message.setProto3IntField(this, 3, value); + jspb.Message.setField(this, 3, value); }; @@ -933,7 +1164,7 @@ proto.protocol.TransferAssetContract.prototype.getAssetName_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.TransferAssetContract.prototype.setAssetName = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -972,7 +1203,7 @@ proto.protocol.TransferAssetContract.prototype.getOwnerAddress_asU8 = function() /** @param {!(string|Uint8Array)} value */ proto.protocol.TransferAssetContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -1011,7 +1242,7 @@ proto.protocol.TransferAssetContract.prototype.getToAddress_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.TransferAssetContract.prototype.setToAddress = function(value) { - jspb.Message.setProto3BytesField(this, 3, value); + jspb.Message.setField(this, 3, value); }; @@ -1026,7 +1257,7 @@ proto.protocol.TransferAssetContract.prototype.getAmount = function() { /** @param {number} value */ proto.protocol.TransferAssetContract.prototype.setAmount = function(value) { - jspb.Message.setProto3IntField(this, 4, value); + jspb.Message.setField(this, 4, value); }; @@ -1235,7 +1466,7 @@ proto.protocol.VoteAssetContract.prototype.getOwnerAddress_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.VoteAssetContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -1305,7 +1536,7 @@ proto.protocol.VoteAssetContract.prototype.getSupport = function() { /** @param {boolean} value */ proto.protocol.VoteAssetContract.prototype.setSupport = function(value) { - jspb.Message.setProto3BooleanField(this, 3, value); + jspb.Message.setField(this, 3, value); }; @@ -1320,7 +1551,7 @@ proto.protocol.VoteAssetContract.prototype.getCount = function() { /** @param {number} value */ proto.protocol.VoteAssetContract.prototype.setCount = function(value) { - jspb.Message.setProto3IntField(this, 5, value); + jspb.Message.setField(this, 5, value); }; @@ -1659,7 +1890,7 @@ proto.protocol.VoteWitnessContract.Vote.prototype.getVoteAddress_asU8 = function /** @param {!(string|Uint8Array)} value */ proto.protocol.VoteWitnessContract.Vote.prototype.setVoteAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -1674,7 +1905,7 @@ proto.protocol.VoteWitnessContract.Vote.prototype.getVoteCount = function() { /** @param {number} value */ proto.protocol.VoteWitnessContract.Vote.prototype.setVoteCount = function(value) { - jspb.Message.setProto3IntField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -1713,7 +1944,7 @@ proto.protocol.VoteWitnessContract.prototype.getOwnerAddress_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.VoteWitnessContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -1761,7 +1992,7 @@ proto.protocol.VoteWitnessContract.prototype.getSupport = function() { /** @param {boolean} value */ proto.protocol.VoteWitnessContract.prototype.setSupport = function(value) { - jspb.Message.setProto3BooleanField(this, 3, value); + jspb.Message.setField(this, 3, value); }; @@ -1776,7 +2007,251 @@ proto.protocol.VoteWitnessContract.prototype.setSupport = function(value) { * @extends {jspb.Message} * @constructor */ -proto.protocol.WitnessCreateContract = function(opt_data) { +proto.protocol.UpdateSettingContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.UpdateSettingContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.UpdateSettingContract.displayName = 'proto.protocol.UpdateSettingContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.UpdateSettingContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.UpdateSettingContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.UpdateSettingContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.UpdateSettingContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + contractAddress: msg.getContractAddress_asB64(), + consumeUserResourcePercent: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.UpdateSettingContract} + */ +proto.protocol.UpdateSettingContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.UpdateSettingContract; + return proto.protocol.UpdateSettingContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.UpdateSettingContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.UpdateSettingContract} + */ +proto.protocol.UpdateSettingContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setContractAddress(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setConsumeUserResourcePercent(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.UpdateSettingContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.UpdateSettingContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.UpdateSettingContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.UpdateSettingContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getContractAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getConsumeUserResourcePercent(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.UpdateSettingContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.UpdateSettingContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.UpdateSettingContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.UpdateSettingContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional bytes contract_address = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.UpdateSettingContract.prototype.getContractAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes contract_address = 2; + * This is a type-conversion wrapper around `getContractAddress()` + * @return {string} + */ +proto.protocol.UpdateSettingContract.prototype.getContractAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getContractAddress())); +}; + + +/** + * optional bytes contract_address = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getContractAddress()` + * @return {!Uint8Array} + */ +proto.protocol.UpdateSettingContract.prototype.getContractAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getContractAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.UpdateSettingContract.prototype.setContractAddress = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional int64 consume_user_resource_percent = 3; + * @return {number} + */ +proto.protocol.UpdateSettingContract.prototype.getConsumeUserResourcePercent = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.UpdateSettingContract.prototype.setConsumeUserResourcePercent = function(value) { + jspb.Message.setField(this, 3, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.WitnessCreateContract = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.protocol.WitnessCreateContract, jspb.Message); @@ -1939,7 +2414,7 @@ proto.protocol.WitnessCreateContract.prototype.getOwnerAddress_asU8 = function() /** @param {!(string|Uint8Array)} value */ proto.protocol.WitnessCreateContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -1978,7 +2453,7 @@ proto.protocol.WitnessCreateContract.prototype.getUrl_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.WitnessCreateContract.prototype.setUrl = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -2156,7 +2631,7 @@ proto.protocol.WitnessUpdateContract.prototype.getOwnerAddress_asU8 = function() /** @param {!(string|Uint8Array)} value */ proto.protocol.WitnessUpdateContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -2195,7 +2670,7 @@ proto.protocol.WitnessUpdateContract.prototype.getUpdateUrl_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.WitnessUpdateContract.prototype.setUpdateUrl = function(value) { - jspb.Message.setProto3BytesField(this, 12, value); + jspb.Message.setField(this, 12, value); }; @@ -2263,6 +2738,7 @@ proto.protocol.AssetIssueContract.toObject = function(includeInstance, msg) { num: jspb.Message.getFieldWithDefault(msg, 8, 0), startTime: jspb.Message.getFieldWithDefault(msg, 9, 0), endTime: jspb.Message.getFieldWithDefault(msg, 10, 0), + order: jspb.Message.getFieldWithDefault(msg, 11, 0), voteScore: jspb.Message.getFieldWithDefault(msg, 16, 0), description: msg.getDescription_asB64(), url: msg.getUrl_asB64(), @@ -2343,6 +2819,10 @@ proto.protocol.AssetIssueContract.deserializeBinaryFromReader = function(msg, re var value = /** @type {number} */ (reader.readInt64()); msg.setEndTime(value); break; + case 11: + var value = /** @type {number} */ (reader.readInt64()); + msg.setOrder(value); + break; case 16: var value = /** @type {number} */ (reader.readInt32()); msg.setVoteScore(value); @@ -2464,6 +2944,13 @@ proto.protocol.AssetIssueContract.serializeBinaryToWriter = function(message, wr f ); } + f = message.getOrder(); + if (f !== 0) { + writer.writeInt64( + 11, + f + ); + } f = message.getVoteScore(); if (f !== 0) { writer.writeInt32( @@ -2666,7 +3153,7 @@ proto.protocol.AssetIssueContract.FrozenSupply.prototype.getFrozenAmount = funct /** @param {number} value */ proto.protocol.AssetIssueContract.FrozenSupply.prototype.setFrozenAmount = function(value) { - jspb.Message.setProto3IntField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -2681,7 +3168,7 @@ proto.protocol.AssetIssueContract.FrozenSupply.prototype.getFrozenDays = functio /** @param {number} value */ proto.protocol.AssetIssueContract.FrozenSupply.prototype.setFrozenDays = function(value) { - jspb.Message.setProto3IntField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -2720,7 +3207,7 @@ proto.protocol.AssetIssueContract.prototype.getOwnerAddress_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.AssetIssueContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -2759,7 +3246,7 @@ proto.protocol.AssetIssueContract.prototype.getName_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.AssetIssueContract.prototype.setName = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -2798,7 +3285,7 @@ proto.protocol.AssetIssueContract.prototype.getAbbr_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.AssetIssueContract.prototype.setAbbr = function(value) { - jspb.Message.setProto3BytesField(this, 3, value); + jspb.Message.setField(this, 3, value); }; @@ -2813,7 +3300,7 @@ proto.protocol.AssetIssueContract.prototype.getTotalSupply = function() { /** @param {number} value */ proto.protocol.AssetIssueContract.prototype.setTotalSupply = function(value) { - jspb.Message.setProto3IntField(this, 4, value); + jspb.Message.setField(this, 4, value); }; @@ -2859,7 +3346,7 @@ proto.protocol.AssetIssueContract.prototype.getTrxNum = function() { /** @param {number} value */ proto.protocol.AssetIssueContract.prototype.setTrxNum = function(value) { - jspb.Message.setProto3IntField(this, 6, value); + jspb.Message.setField(this, 6, value); }; @@ -2874,7 +3361,7 @@ proto.protocol.AssetIssueContract.prototype.getNum = function() { /** @param {number} value */ proto.protocol.AssetIssueContract.prototype.setNum = function(value) { - jspb.Message.setProto3IntField(this, 8, value); + jspb.Message.setField(this, 8, value); }; @@ -2889,7 +3376,7 @@ proto.protocol.AssetIssueContract.prototype.getStartTime = function() { /** @param {number} value */ proto.protocol.AssetIssueContract.prototype.setStartTime = function(value) { - jspb.Message.setProto3IntField(this, 9, value); + jspb.Message.setField(this, 9, value); }; @@ -2904,7 +3391,22 @@ proto.protocol.AssetIssueContract.prototype.getEndTime = function() { /** @param {number} value */ proto.protocol.AssetIssueContract.prototype.setEndTime = function(value) { - jspb.Message.setProto3IntField(this, 10, value); + jspb.Message.setField(this, 10, value); +}; + + +/** + * optional int64 order = 11; + * @return {number} + */ +proto.protocol.AssetIssueContract.prototype.getOrder = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); +}; + + +/** @param {number} value */ +proto.protocol.AssetIssueContract.prototype.setOrder = function(value) { + jspb.Message.setField(this, 11, value); }; @@ -2919,7 +3421,7 @@ proto.protocol.AssetIssueContract.prototype.getVoteScore = function() { /** @param {number} value */ proto.protocol.AssetIssueContract.prototype.setVoteScore = function(value) { - jspb.Message.setProto3IntField(this, 16, value); + jspb.Message.setField(this, 16, value); }; @@ -2958,7 +3460,7 @@ proto.protocol.AssetIssueContract.prototype.getDescription_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.AssetIssueContract.prototype.setDescription = function(value) { - jspb.Message.setProto3BytesField(this, 20, value); + jspb.Message.setField(this, 20, value); }; @@ -2997,7 +3499,7 @@ proto.protocol.AssetIssueContract.prototype.getUrl_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.AssetIssueContract.prototype.setUrl = function(value) { - jspb.Message.setProto3BytesField(this, 21, value); + jspb.Message.setField(this, 21, value); }; @@ -3012,7 +3514,7 @@ proto.protocol.AssetIssueContract.prototype.getFreeAssetNetLimit = function() { /** @param {number} value */ proto.protocol.AssetIssueContract.prototype.setFreeAssetNetLimit = function(value) { - jspb.Message.setProto3IntField(this, 22, value); + jspb.Message.setField(this, 22, value); }; @@ -3027,7 +3529,7 @@ proto.protocol.AssetIssueContract.prototype.getPublicFreeAssetNetLimit = functio /** @param {number} value */ proto.protocol.AssetIssueContract.prototype.setPublicFreeAssetNetLimit = function(value) { - jspb.Message.setProto3IntField(this, 23, value); + jspb.Message.setField(this, 23, value); }; @@ -3042,7 +3544,7 @@ proto.protocol.AssetIssueContract.prototype.getPublicFreeAssetNetUsage = functio /** @param {number} value */ proto.protocol.AssetIssueContract.prototype.setPublicFreeAssetNetUsage = function(value) { - jspb.Message.setProto3IntField(this, 24, value); + jspb.Message.setField(this, 24, value); }; @@ -3057,7 +3559,7 @@ proto.protocol.AssetIssueContract.prototype.getPublicLatestFreeNetTime = functio /** @param {number} value */ proto.protocol.AssetIssueContract.prototype.setPublicLatestFreeNetTime = function(value) { - jspb.Message.setProto3IntField(this, 25, value); + jspb.Message.setField(this, 25, value); }; @@ -3259,7 +3761,7 @@ proto.protocol.ParticipateAssetIssueContract.prototype.getOwnerAddress_asU8 = fu /** @param {!(string|Uint8Array)} value */ proto.protocol.ParticipateAssetIssueContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -3298,7 +3800,7 @@ proto.protocol.ParticipateAssetIssueContract.prototype.getToAddress_asU8 = funct /** @param {!(string|Uint8Array)} value */ proto.protocol.ParticipateAssetIssueContract.prototype.setToAddress = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -3337,7 +3839,7 @@ proto.protocol.ParticipateAssetIssueContract.prototype.getAssetName_asU8 = funct /** @param {!(string|Uint8Array)} value */ proto.protocol.ParticipateAssetIssueContract.prototype.setAssetName = function(value) { - jspb.Message.setProto3BytesField(this, 3, value); + jspb.Message.setField(this, 3, value); }; @@ -3352,7 +3854,7 @@ proto.protocol.ParticipateAssetIssueContract.prototype.getAmount = function() { /** @param {number} value */ proto.protocol.ParticipateAssetIssueContract.prototype.setAmount = function(value) { - jspb.Message.setProto3IntField(this, 4, value); + jspb.Message.setField(this, 4, value); }; @@ -3367,12 +3869,12 @@ proto.protocol.ParticipateAssetIssueContract.prototype.setAmount = function(valu * @extends {jspb.Message} * @constructor */ -proto.protocol.DeployContract = function(opt_data) { +proto.protocol.FreezeBalanceContract = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.DeployContract, jspb.Message); +goog.inherits(proto.protocol.FreezeBalanceContract, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.DeployContract.displayName = 'proto.protocol.DeployContract'; + proto.protocol.FreezeBalanceContract.displayName = 'proto.protocol.FreezeBalanceContract'; } @@ -3387,8 +3889,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.DeployContract.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.DeployContract.toObject(opt_includeInstance, this); +proto.protocol.FreezeBalanceContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.FreezeBalanceContract.toObject(opt_includeInstance, this); }; @@ -3397,14 +3899,16 @@ proto.protocol.DeployContract.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.DeployContract} msg The msg instance to transform. + * @param {!proto.protocol.FreezeBalanceContract} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.DeployContract.toObject = function(includeInstance, msg) { +proto.protocol.FreezeBalanceContract.toObject = function(includeInstance, msg) { var f, obj = { ownerAddress: msg.getOwnerAddress_asB64(), - script: msg.getScript_asB64() + frozenBalance: jspb.Message.getFieldWithDefault(msg, 2, 0), + frozenDuration: jspb.Message.getFieldWithDefault(msg, 3, 0), + resource: jspb.Message.getFieldWithDefault(msg, 10, 0) }; if (includeInstance) { @@ -3418,23 +3922,23 @@ proto.protocol.DeployContract.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.DeployContract} + * @return {!proto.protocol.FreezeBalanceContract} */ -proto.protocol.DeployContract.deserializeBinary = function(bytes) { +proto.protocol.FreezeBalanceContract.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.DeployContract; - return proto.protocol.DeployContract.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.FreezeBalanceContract; + return proto.protocol.FreezeBalanceContract.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.DeployContract} msg The message object to deserialize into. + * @param {!proto.protocol.FreezeBalanceContract} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.DeployContract} + * @return {!proto.protocol.FreezeBalanceContract} */ -proto.protocol.DeployContract.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.FreezeBalanceContract.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3446,8 +3950,16 @@ proto.protocol.DeployContract.deserializeBinaryFromReader = function(msg, reader msg.setOwnerAddress(value); break; case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setScript(value); + var value = /** @type {number} */ (reader.readInt64()); + msg.setFrozenBalance(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFrozenDuration(value); + break; + case 10: + var value = /** @type {!proto.protocol.ResourceCode} */ (reader.readEnum()); + msg.setResource(value); break; default: reader.skipField(); @@ -3462,9 +3974,9 @@ proto.protocol.DeployContract.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.DeployContract.prototype.serializeBinary = function() { +proto.protocol.FreezeBalanceContract.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.DeployContract.serializeBinaryToWriter(this, writer); + proto.protocol.FreezeBalanceContract.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3472,11 +3984,11 @@ proto.protocol.DeployContract.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.DeployContract} message + * @param {!proto.protocol.FreezeBalanceContract} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.DeployContract.serializeBinaryToWriter = function(message, writer) { +proto.protocol.FreezeBalanceContract.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getOwnerAddress_asU8(); if (f.length > 0) { @@ -3485,239 +3997,24 @@ proto.protocol.DeployContract.serializeBinaryToWriter = function(message, writer f ); } - f = message.getScript_asU8(); - if (f.length > 0) { - writer.writeBytes( + f = message.getFrozenBalance(); + if (f !== 0) { + writer.writeInt64( 2, f ); } -}; - - -/** - * optional bytes owner_address = 1; - * @return {!(string|Uint8Array)} - */ -proto.protocol.DeployContract.prototype.getOwnerAddress = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes owner_address = 1; - * This is a type-conversion wrapper around `getOwnerAddress()` - * @return {string} - */ -proto.protocol.DeployContract.prototype.getOwnerAddress_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getOwnerAddress())); -}; - - -/** - * optional bytes owner_address = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getOwnerAddress()` - * @return {!Uint8Array} - */ -proto.protocol.DeployContract.prototype.getOwnerAddress_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getOwnerAddress())); -}; - - -/** @param {!(string|Uint8Array)} value */ -proto.protocol.DeployContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional bytes script = 2; - * @return {!(string|Uint8Array)} - */ -proto.protocol.DeployContract.prototype.getScript = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * optional bytes script = 2; - * This is a type-conversion wrapper around `getScript()` - * @return {string} - */ -proto.protocol.DeployContract.prototype.getScript_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getScript())); -}; - - -/** - * optional bytes script = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getScript()` - * @return {!Uint8Array} - */ -proto.protocol.DeployContract.prototype.getScript_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getScript())); -}; - - -/** @param {!(string|Uint8Array)} value */ -proto.protocol.DeployContract.prototype.setScript = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); -}; - - - -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.protocol.FreezeBalanceContract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.protocol.FreezeBalanceContract, jspb.Message); -if (goog.DEBUG && !COMPILED) { - proto.protocol.FreezeBalanceContract.displayName = 'proto.protocol.FreezeBalanceContract'; -} - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.protocol.FreezeBalanceContract.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.FreezeBalanceContract.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.protocol.FreezeBalanceContract} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.protocol.FreezeBalanceContract.toObject = function(includeInstance, msg) { - var f, obj = { - ownerAddress: msg.getOwnerAddress_asB64(), - frozenBalance: jspb.Message.getFieldWithDefault(msg, 2, 0), - frozenDuration: jspb.Message.getFieldWithDefault(msg, 3, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.FreezeBalanceContract} - */ -proto.protocol.FreezeBalanceContract.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.FreezeBalanceContract; - return proto.protocol.FreezeBalanceContract.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.protocol.FreezeBalanceContract} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.FreezeBalanceContract} - */ -proto.protocol.FreezeBalanceContract.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setOwnerAddress(value); - break; - case 2: - var value = /** @type {number} */ (reader.readInt64()); - msg.setFrozenBalance(value); - break; - case 3: - var value = /** @type {number} */ (reader.readInt64()); - msg.setFrozenDuration(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.protocol.FreezeBalanceContract.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.protocol.FreezeBalanceContract.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.protocol.FreezeBalanceContract} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.protocol.FreezeBalanceContract.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getOwnerAddress_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getFrozenBalance(); + f = message.getFrozenDuration(); if (f !== 0) { writer.writeInt64( - 2, + 3, f ); } - f = message.getFrozenDuration(); - if (f !== 0) { - writer.writeInt64( - 3, + f = message.getResource(); + if (f !== 0.0) { + writer.writeEnum( + 10, f ); } @@ -3759,7 +4056,7 @@ proto.protocol.FreezeBalanceContract.prototype.getOwnerAddress_asU8 = function() /** @param {!(string|Uint8Array)} value */ proto.protocol.FreezeBalanceContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -3774,7 +4071,7 @@ proto.protocol.FreezeBalanceContract.prototype.getFrozenBalance = function() { /** @param {number} value */ proto.protocol.FreezeBalanceContract.prototype.setFrozenBalance = function(value) { - jspb.Message.setProto3IntField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -3789,7 +4086,22 @@ proto.protocol.FreezeBalanceContract.prototype.getFrozenDuration = function() { /** @param {number} value */ proto.protocol.FreezeBalanceContract.prototype.setFrozenDuration = function(value) { - jspb.Message.setProto3IntField(this, 3, value); + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional ResourceCode resource = 10; + * @return {!proto.protocol.ResourceCode} + */ +proto.protocol.FreezeBalanceContract.prototype.getResource = function() { + return /** @type {!proto.protocol.ResourceCode} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +}; + + +/** @param {!proto.protocol.ResourceCode} value */ +proto.protocol.FreezeBalanceContract.prototype.setResource = function(value) { + jspb.Message.setField(this, 10, value); }; @@ -3840,7 +4152,8 @@ proto.protocol.UnfreezeBalanceContract.prototype.toObject = function(opt_include */ proto.protocol.UnfreezeBalanceContract.toObject = function(includeInstance, msg) { var f, obj = { - ownerAddress: msg.getOwnerAddress_asB64() + ownerAddress: msg.getOwnerAddress_asB64(), + resource: jspb.Message.getFieldWithDefault(msg, 10, 0) }; if (includeInstance) { @@ -3881,6 +4194,10 @@ proto.protocol.UnfreezeBalanceContract.deserializeBinaryFromReader = function(ms var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOwnerAddress(value); break; + case 10: + var value = /** @type {!proto.protocol.ResourceCode} */ (reader.readEnum()); + msg.setResource(value); + break; default: reader.skipField(); break; @@ -3917,6 +4234,13 @@ proto.protocol.UnfreezeBalanceContract.serializeBinaryToWriter = function(messag f ); } + f = message.getResource(); + if (f !== 0.0) { + writer.writeEnum( + 10, + f + ); + } }; @@ -3955,7 +4279,22 @@ proto.protocol.UnfreezeBalanceContract.prototype.getOwnerAddress_asU8 = function /** @param {!(string|Uint8Array)} value */ proto.protocol.UnfreezeBalanceContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional ResourceCode resource = 10; + * @return {!proto.protocol.ResourceCode} + */ +proto.protocol.UnfreezeBalanceContract.prototype.getResource = function() { + return /** @type {!proto.protocol.ResourceCode} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +}; + + +/** @param {!proto.protocol.ResourceCode} value */ +proto.protocol.UnfreezeBalanceContract.prototype.setResource = function(value) { + jspb.Message.setField(this, 10, value); }; @@ -4121,7 +4460,7 @@ proto.protocol.UnfreezeAssetContract.prototype.getOwnerAddress_asU8 = function() /** @param {!(string|Uint8Array)} value */ proto.protocol.UnfreezeAssetContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -4287,7 +4626,7 @@ proto.protocol.WithdrawBalanceContract.prototype.getOwnerAddress_asU8 = function /** @param {!(string|Uint8Array)} value */ proto.protocol.WithdrawBalanceContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -4501,7 +4840,7 @@ proto.protocol.UpdateAssetContract.prototype.getOwnerAddress_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.UpdateAssetContract.prototype.setOwnerAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -4540,7 +4879,7 @@ proto.protocol.UpdateAssetContract.prototype.getDescription_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.UpdateAssetContract.prototype.setDescription = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -4579,7 +4918,7 @@ proto.protocol.UpdateAssetContract.prototype.getUrl_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.UpdateAssetContract.prototype.setUrl = function(value) { - jspb.Message.setProto3BytesField(this, 3, value); + jspb.Message.setField(this, 3, value); }; @@ -4594,7 +4933,7 @@ proto.protocol.UpdateAssetContract.prototype.getNewLimit = function() { /** @param {number} value */ proto.protocol.UpdateAssetContract.prototype.setNewLimit = function(value) { - jspb.Message.setProto3IntField(this, 4, value); + jspb.Message.setField(this, 4, value); }; @@ -4609,8 +4948,2872 @@ proto.protocol.UpdateAssetContract.prototype.getNewPublicLimit = function() { /** @param {number} value */ proto.protocol.UpdateAssetContract.prototype.setNewPublicLimit = function(value) { - jspb.Message.setProto3IntField(this, 5, value); + jspb.Message.setField(this, 5, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.ProposalCreateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; +goog.inherits(proto.protocol.ProposalCreateContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ProposalCreateContract.displayName = 'proto.protocol.ProposalCreateContract'; +} + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.ProposalCreateContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ProposalCreateContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ProposalCreateContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ProposalCreateContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + parametersMap: (f = msg.getParametersMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.ProposalCreateContract} + */ +proto.protocol.ProposalCreateContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ProposalCreateContract; + return proto.protocol.ProposalCreateContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ProposalCreateContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ProposalCreateContract} + */ +proto.protocol.ProposalCreateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = msg.getParametersMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt64, jspb.BinaryReader.prototype.readInt64); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.ProposalCreateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ProposalCreateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ProposalCreateContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ProposalCreateContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getParametersMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeInt64, jspb.BinaryWriter.prototype.writeInt64); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ProposalCreateContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.ProposalCreateContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.ProposalCreateContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ProposalCreateContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * map parameters = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.protocol.ProposalCreateContract.prototype.getParametersMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + null)); +}; + + +proto.protocol.ProposalCreateContract.prototype.clearParametersMap = function() { + this.getParametersMap().clear(); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.ProposalApproveContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.ProposalApproveContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ProposalApproveContract.displayName = 'proto.protocol.ProposalApproveContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.ProposalApproveContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ProposalApproveContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ProposalApproveContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ProposalApproveContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + proposalId: jspb.Message.getFieldWithDefault(msg, 2, 0), + isAddApproval: jspb.Message.getFieldWithDefault(msg, 3, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.ProposalApproveContract} + */ +proto.protocol.ProposalApproveContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ProposalApproveContract; + return proto.protocol.ProposalApproveContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ProposalApproveContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ProposalApproveContract} + */ +proto.protocol.ProposalApproveContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setProposalId(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsAddApproval(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.ProposalApproveContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ProposalApproveContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ProposalApproveContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ProposalApproveContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getProposalId(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getIsAddApproval(); + if (f) { + writer.writeBool( + 3, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ProposalApproveContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.ProposalApproveContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.ProposalApproveContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ProposalApproveContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 proposal_id = 2; + * @return {number} + */ +proto.protocol.ProposalApproveContract.prototype.getProposalId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ProposalApproveContract.prototype.setProposalId = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional bool is_add_approval = 3; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.protocol.ProposalApproveContract.prototype.getIsAddApproval = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 3, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.ProposalApproveContract.prototype.setIsAddApproval = function(value) { + jspb.Message.setField(this, 3, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.ProposalDeleteContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.ProposalDeleteContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ProposalDeleteContract.displayName = 'proto.protocol.ProposalDeleteContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.ProposalDeleteContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ProposalDeleteContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ProposalDeleteContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ProposalDeleteContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + proposalId: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.ProposalDeleteContract} + */ +proto.protocol.ProposalDeleteContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ProposalDeleteContract; + return proto.protocol.ProposalDeleteContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ProposalDeleteContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ProposalDeleteContract} + */ +proto.protocol.ProposalDeleteContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setProposalId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.ProposalDeleteContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ProposalDeleteContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ProposalDeleteContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ProposalDeleteContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getProposalId(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ProposalDeleteContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.ProposalDeleteContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.ProposalDeleteContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ProposalDeleteContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 proposal_id = 2; + * @return {number} + */ +proto.protocol.ProposalDeleteContract.prototype.getProposalId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ProposalDeleteContract.prototype.setProposalId = function(value) { + jspb.Message.setField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.CreateSmartContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.CreateSmartContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.CreateSmartContract.displayName = 'proto.protocol.CreateSmartContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.CreateSmartContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.CreateSmartContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.CreateSmartContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.CreateSmartContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + newContract: (f = msg.getNewContract()) && core_Tron_pb.SmartContract.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.CreateSmartContract} + */ +proto.protocol.CreateSmartContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.CreateSmartContract; + return proto.protocol.CreateSmartContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.CreateSmartContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.CreateSmartContract} + */ +proto.protocol.CreateSmartContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = new core_Tron_pb.SmartContract; + reader.readMessage(value,core_Tron_pb.SmartContract.deserializeBinaryFromReader); + msg.setNewContract(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.CreateSmartContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.CreateSmartContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.CreateSmartContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.CreateSmartContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getNewContract(); + if (f != null) { + writer.writeMessage( + 2, + f, + core_Tron_pb.SmartContract.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.CreateSmartContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.CreateSmartContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.CreateSmartContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.CreateSmartContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional SmartContract new_contract = 2; + * @return {?proto.protocol.SmartContract} + */ +proto.protocol.CreateSmartContract.prototype.getNewContract = function() { + return /** @type{?proto.protocol.SmartContract} */ ( + jspb.Message.getWrapperField(this, core_Tron_pb.SmartContract, 2)); +}; + + +/** @param {?proto.protocol.SmartContract|undefined} value */ +proto.protocol.CreateSmartContract.prototype.setNewContract = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +proto.protocol.CreateSmartContract.prototype.clearNewContract = function() { + this.setNewContract(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.CreateSmartContract.prototype.hasNewContract = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.TriggerSmartContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.TriggerSmartContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.TriggerSmartContract.displayName = 'proto.protocol.TriggerSmartContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.TriggerSmartContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TriggerSmartContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.TriggerSmartContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TriggerSmartContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + contractAddress: msg.getContractAddress_asB64(), + callValue: jspb.Message.getFieldWithDefault(msg, 3, 0), + data: msg.getData_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.TriggerSmartContract} + */ +proto.protocol.TriggerSmartContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.TriggerSmartContract; + return proto.protocol.TriggerSmartContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.TriggerSmartContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.TriggerSmartContract} + */ +proto.protocol.TriggerSmartContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setContractAddress(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setCallValue(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.TriggerSmartContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.TriggerSmartContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.TriggerSmartContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TriggerSmartContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getContractAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getCallValue(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TriggerSmartContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.TriggerSmartContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.TriggerSmartContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TriggerSmartContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional bytes contract_address = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TriggerSmartContract.prototype.getContractAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes contract_address = 2; + * This is a type-conversion wrapper around `getContractAddress()` + * @return {string} + */ +proto.protocol.TriggerSmartContract.prototype.getContractAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getContractAddress())); +}; + + +/** + * optional bytes contract_address = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getContractAddress()` + * @return {!Uint8Array} + */ +proto.protocol.TriggerSmartContract.prototype.getContractAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getContractAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TriggerSmartContract.prototype.setContractAddress = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional int64 call_value = 3; + * @return {number} + */ +proto.protocol.TriggerSmartContract.prototype.getCallValue = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.TriggerSmartContract.prototype.setCallValue = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional bytes data = 4; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TriggerSmartContract.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes data = 4; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.protocol.TriggerSmartContract.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.protocol.TriggerSmartContract.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TriggerSmartContract.prototype.setData = function(value) { + jspb.Message.setField(this, 4, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.BuyStorageContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.BuyStorageContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.BuyStorageContract.displayName = 'proto.protocol.BuyStorageContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.BuyStorageContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.BuyStorageContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.BuyStorageContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BuyStorageContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + quant: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.BuyStorageContract} + */ +proto.protocol.BuyStorageContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.BuyStorageContract; + return proto.protocol.BuyStorageContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.BuyStorageContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.BuyStorageContract} + */ +proto.protocol.BuyStorageContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setQuant(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.BuyStorageContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.BuyStorageContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.BuyStorageContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BuyStorageContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getQuant(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.BuyStorageContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.BuyStorageContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.BuyStorageContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.BuyStorageContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 quant = 2; + * @return {number} + */ +proto.protocol.BuyStorageContract.prototype.getQuant = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.BuyStorageContract.prototype.setQuant = function(value) { + jspb.Message.setField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.BuyStorageBytesContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.BuyStorageBytesContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.BuyStorageBytesContract.displayName = 'proto.protocol.BuyStorageBytesContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.BuyStorageBytesContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.BuyStorageBytesContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.BuyStorageBytesContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BuyStorageBytesContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + bytes: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.BuyStorageBytesContract} + */ +proto.protocol.BuyStorageBytesContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.BuyStorageBytesContract; + return proto.protocol.BuyStorageBytesContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.BuyStorageBytesContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.BuyStorageBytesContract} + */ +proto.protocol.BuyStorageBytesContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setBytes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.BuyStorageBytesContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.BuyStorageBytesContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.BuyStorageBytesContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BuyStorageBytesContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getBytes(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.BuyStorageBytesContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.BuyStorageBytesContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.BuyStorageBytesContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.BuyStorageBytesContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 bytes = 2; + * @return {number} + */ +proto.protocol.BuyStorageBytesContract.prototype.getBytes = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.BuyStorageBytesContract.prototype.setBytes = function(value) { + jspb.Message.setField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.SellStorageContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.SellStorageContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.SellStorageContract.displayName = 'proto.protocol.SellStorageContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.SellStorageContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.SellStorageContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.SellStorageContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.SellStorageContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + storageBytes: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.SellStorageContract} + */ +proto.protocol.SellStorageContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.SellStorageContract; + return proto.protocol.SellStorageContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.SellStorageContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.SellStorageContract} + */ +proto.protocol.SellStorageContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStorageBytes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.SellStorageContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.SellStorageContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.SellStorageContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.SellStorageContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getStorageBytes(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.SellStorageContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.SellStorageContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.SellStorageContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.SellStorageContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 storage_bytes = 2; + * @return {number} + */ +proto.protocol.SellStorageContract.prototype.getStorageBytes = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.SellStorageContract.prototype.setStorageBytes = function(value) { + jspb.Message.setField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.ExchangeCreateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.ExchangeCreateContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ExchangeCreateContract.displayName = 'proto.protocol.ExchangeCreateContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.ExchangeCreateContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ExchangeCreateContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ExchangeCreateContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ExchangeCreateContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + firstTokenId: msg.getFirstTokenId_asB64(), + firstTokenBalance: jspb.Message.getFieldWithDefault(msg, 3, 0), + secondTokenId: msg.getSecondTokenId_asB64(), + secondTokenBalance: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.ExchangeCreateContract} + */ +proto.protocol.ExchangeCreateContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ExchangeCreateContract; + return proto.protocol.ExchangeCreateContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ExchangeCreateContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ExchangeCreateContract} + */ +proto.protocol.ExchangeCreateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setFirstTokenId(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFirstTokenBalance(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSecondTokenId(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setSecondTokenBalance(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.ExchangeCreateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ExchangeCreateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ExchangeCreateContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ExchangeCreateContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getFirstTokenId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getFirstTokenBalance(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getSecondTokenId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = message.getSecondTokenBalance(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ExchangeCreateContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.ExchangeCreateContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.ExchangeCreateContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ExchangeCreateContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional bytes first_token_id = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ExchangeCreateContract.prototype.getFirstTokenId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes first_token_id = 2; + * This is a type-conversion wrapper around `getFirstTokenId()` + * @return {string} + */ +proto.protocol.ExchangeCreateContract.prototype.getFirstTokenId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getFirstTokenId())); +}; + + +/** + * optional bytes first_token_id = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getFirstTokenId()` + * @return {!Uint8Array} + */ +proto.protocol.ExchangeCreateContract.prototype.getFirstTokenId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getFirstTokenId())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ExchangeCreateContract.prototype.setFirstTokenId = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional int64 first_token_balance = 3; + * @return {number} + */ +proto.protocol.ExchangeCreateContract.prototype.getFirstTokenBalance = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ExchangeCreateContract.prototype.setFirstTokenBalance = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional bytes second_token_id = 4; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ExchangeCreateContract.prototype.getSecondTokenId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes second_token_id = 4; + * This is a type-conversion wrapper around `getSecondTokenId()` + * @return {string} + */ +proto.protocol.ExchangeCreateContract.prototype.getSecondTokenId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSecondTokenId())); +}; + + +/** + * optional bytes second_token_id = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSecondTokenId()` + * @return {!Uint8Array} + */ +proto.protocol.ExchangeCreateContract.prototype.getSecondTokenId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSecondTokenId())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ExchangeCreateContract.prototype.setSecondTokenId = function(value) { + jspb.Message.setField(this, 4, value); +}; + + +/** + * optional int64 second_token_balance = 5; + * @return {number} + */ +proto.protocol.ExchangeCreateContract.prototype.getSecondTokenBalance = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ExchangeCreateContract.prototype.setSecondTokenBalance = function(value) { + jspb.Message.setField(this, 5, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.ExchangeInjectContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.ExchangeInjectContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ExchangeInjectContract.displayName = 'proto.protocol.ExchangeInjectContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.ExchangeInjectContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ExchangeInjectContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ExchangeInjectContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ExchangeInjectContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + exchangeId: jspb.Message.getFieldWithDefault(msg, 2, 0), + tokenId: msg.getTokenId_asB64(), + quant: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.ExchangeInjectContract} + */ +proto.protocol.ExchangeInjectContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ExchangeInjectContract; + return proto.protocol.ExchangeInjectContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ExchangeInjectContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ExchangeInjectContract} + */ +proto.protocol.ExchangeInjectContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setExchangeId(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setTokenId(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setQuant(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.ExchangeInjectContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ExchangeInjectContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ExchangeInjectContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ExchangeInjectContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getExchangeId(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getTokenId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getQuant(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ExchangeInjectContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.ExchangeInjectContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.ExchangeInjectContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ExchangeInjectContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 exchange_id = 2; + * @return {number} + */ +proto.protocol.ExchangeInjectContract.prototype.getExchangeId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ExchangeInjectContract.prototype.setExchangeId = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional bytes token_id = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ExchangeInjectContract.prototype.getTokenId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes token_id = 3; + * This is a type-conversion wrapper around `getTokenId()` + * @return {string} + */ +proto.protocol.ExchangeInjectContract.prototype.getTokenId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getTokenId())); +}; + + +/** + * optional bytes token_id = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTokenId()` + * @return {!Uint8Array} + */ +proto.protocol.ExchangeInjectContract.prototype.getTokenId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getTokenId())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ExchangeInjectContract.prototype.setTokenId = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional int64 quant = 4; + * @return {number} + */ +proto.protocol.ExchangeInjectContract.prototype.getQuant = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ExchangeInjectContract.prototype.setQuant = function(value) { + jspb.Message.setField(this, 4, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.ExchangeWithdrawContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.ExchangeWithdrawContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ExchangeWithdrawContract.displayName = 'proto.protocol.ExchangeWithdrawContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.ExchangeWithdrawContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ExchangeWithdrawContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ExchangeWithdrawContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ExchangeWithdrawContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + exchangeId: jspb.Message.getFieldWithDefault(msg, 2, 0), + tokenId: msg.getTokenId_asB64(), + quant: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.ExchangeWithdrawContract} + */ +proto.protocol.ExchangeWithdrawContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ExchangeWithdrawContract; + return proto.protocol.ExchangeWithdrawContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ExchangeWithdrawContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ExchangeWithdrawContract} + */ +proto.protocol.ExchangeWithdrawContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setExchangeId(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setTokenId(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setQuant(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.ExchangeWithdrawContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ExchangeWithdrawContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ExchangeWithdrawContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ExchangeWithdrawContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getExchangeId(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getTokenId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getQuant(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ExchangeWithdrawContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.ExchangeWithdrawContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.ExchangeWithdrawContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ExchangeWithdrawContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 exchange_id = 2; + * @return {number} + */ +proto.protocol.ExchangeWithdrawContract.prototype.getExchangeId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ExchangeWithdrawContract.prototype.setExchangeId = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional bytes token_id = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ExchangeWithdrawContract.prototype.getTokenId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes token_id = 3; + * This is a type-conversion wrapper around `getTokenId()` + * @return {string} + */ +proto.protocol.ExchangeWithdrawContract.prototype.getTokenId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getTokenId())); +}; + + +/** + * optional bytes token_id = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTokenId()` + * @return {!Uint8Array} + */ +proto.protocol.ExchangeWithdrawContract.prototype.getTokenId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getTokenId())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ExchangeWithdrawContract.prototype.setTokenId = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional int64 quant = 4; + * @return {number} + */ +proto.protocol.ExchangeWithdrawContract.prototype.getQuant = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ExchangeWithdrawContract.prototype.setQuant = function(value) { + jspb.Message.setField(this, 4, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.ExchangeTransactionContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.ExchangeTransactionContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ExchangeTransactionContract.displayName = 'proto.protocol.ExchangeTransactionContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.ExchangeTransactionContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ExchangeTransactionContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ExchangeTransactionContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ExchangeTransactionContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + exchangeId: jspb.Message.getFieldWithDefault(msg, 2, 0), + tokenId: msg.getTokenId_asB64(), + quant: jspb.Message.getFieldWithDefault(msg, 4, 0), + expected: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.ExchangeTransactionContract} + */ +proto.protocol.ExchangeTransactionContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ExchangeTransactionContract; + return proto.protocol.ExchangeTransactionContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ExchangeTransactionContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ExchangeTransactionContract} + */ +proto.protocol.ExchangeTransactionContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setExchangeId(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setTokenId(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setQuant(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setExpected(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.ExchangeTransactionContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ExchangeTransactionContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ExchangeTransactionContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ExchangeTransactionContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getExchangeId(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getTokenId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getQuant(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = message.getExpected(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ExchangeTransactionContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.ExchangeTransactionContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.ExchangeTransactionContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ExchangeTransactionContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 exchange_id = 2; + * @return {number} + */ +proto.protocol.ExchangeTransactionContract.prototype.getExchangeId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ExchangeTransactionContract.prototype.setExchangeId = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional bytes token_id = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ExchangeTransactionContract.prototype.getTokenId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes token_id = 3; + * This is a type-conversion wrapper around `getTokenId()` + * @return {string} + */ +proto.protocol.ExchangeTransactionContract.prototype.getTokenId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getTokenId())); +}; + + +/** + * optional bytes token_id = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTokenId()` + * @return {!Uint8Array} + */ +proto.protocol.ExchangeTransactionContract.prototype.getTokenId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getTokenId())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ExchangeTransactionContract.prototype.setTokenId = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional int64 quant = 4; + * @return {number} + */ +proto.protocol.ExchangeTransactionContract.prototype.getQuant = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ExchangeTransactionContract.prototype.setQuant = function(value) { + jspb.Message.setField(this, 4, value); +}; + + +/** + * optional int64 expected = 5; + * @return {number} + */ +proto.protocol.ExchangeTransactionContract.prototype.getExpected = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ExchangeTransactionContract.prototype.setExpected = function(value) { + jspb.Message.setField(this, 5, value); +}; + + +/** + * @enum {number} + */ +proto.protocol.ResourceCode = { + BANDWIDTH: 0, + ENERGY: 1 +}; goog.object.extend(exports, proto.protocol); diff --git a/src/protocol/core/Discover_pb.js b/src/protocol/core/Discover_pb.js index 05d7584..2bec12c 100644 --- a/src/protocol/core/Discover_pb.js +++ b/src/protocol/core/Discover_pb.js @@ -11,6 +11,7 @@ var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); +goog.exportSymbol('proto.protocol.BackupMessage', null, global); goog.exportSymbol('proto.protocol.Endpoint', null, global); goog.exportSymbol('proto.protocol.FindNeighbours', null, global); goog.exportSymbol('proto.protocol.Neighbours', null, global); @@ -202,7 +203,7 @@ proto.protocol.Endpoint.prototype.getAddress_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.Endpoint.prototype.setAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -217,7 +218,7 @@ proto.protocol.Endpoint.prototype.getPort = function() { /** @param {number} value */ proto.protocol.Endpoint.prototype.setPort = function(value) { - jspb.Message.setProto3IntField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -256,7 +257,7 @@ proto.protocol.Endpoint.prototype.getNodeid_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.Endpoint.prototype.setNodeid = function(value) { - jspb.Message.setProto3BytesField(this, 3, value); + jspb.Message.setField(this, 3, value); }; @@ -498,7 +499,7 @@ proto.protocol.PingMessage.prototype.getVersion = function() { /** @param {number} value */ proto.protocol.PingMessage.prototype.setVersion = function(value) { - jspb.Message.setProto3IntField(this, 3, value); + jspb.Message.setField(this, 3, value); }; @@ -513,7 +514,7 @@ proto.protocol.PingMessage.prototype.getTimestamp = function() { /** @param {number} value */ proto.protocol.PingMessage.prototype.setTimestamp = function(value) { - jspb.Message.setProto3IntField(this, 4, value); + jspb.Message.setField(this, 4, value); }; @@ -711,7 +712,7 @@ proto.protocol.PongMessage.prototype.getEcho = function() { /** @param {number} value */ proto.protocol.PongMessage.prototype.setEcho = function(value) { - jspb.Message.setProto3IntField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -726,7 +727,7 @@ proto.protocol.PongMessage.prototype.getTimestamp = function() { /** @param {number} value */ proto.protocol.PongMessage.prototype.setTimestamp = function(value) { - jspb.Message.setProto3IntField(this, 3, value); + jspb.Message.setField(this, 3, value); }; @@ -948,7 +949,7 @@ proto.protocol.FindNeighbours.prototype.getTargetid_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.FindNeighbours.prototype.setTargetid = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -963,7 +964,7 @@ proto.protocol.FindNeighbours.prototype.getTimestamp = function() { /** @param {number} value */ proto.protocol.FindNeighbours.prototype.setTimestamp = function(value) { - jspb.Message.setProto3IntField(this, 3, value); + jspb.Message.setField(this, 3, value); }; @@ -1202,7 +1203,178 @@ proto.protocol.Neighbours.prototype.getTimestamp = function() { /** @param {number} value */ proto.protocol.Neighbours.prototype.setTimestamp = function(value) { - jspb.Message.setProto3IntField(this, 3, value); + jspb.Message.setField(this, 3, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.BackupMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.BackupMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.BackupMessage.displayName = 'proto.protocol.BackupMessage'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.BackupMessage.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.BackupMessage.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.BackupMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BackupMessage.toObject = function(includeInstance, msg) { + var f, obj = { + flag: jspb.Message.getFieldWithDefault(msg, 1, false), + priority: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.BackupMessage} + */ +proto.protocol.BackupMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.BackupMessage; + return proto.protocol.BackupMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.BackupMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.BackupMessage} + */ +proto.protocol.BackupMessage.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setFlag(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setPriority(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.BackupMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.BackupMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.BackupMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.BackupMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFlag(); + if (f) { + writer.writeBool( + 1, + f + ); + } + f = message.getPriority(); + if (f !== 0) { + writer.writeInt32( + 2, + f + ); + } +}; + + +/** + * optional bool flag = 1; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.protocol.BackupMessage.prototype.getFlag = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 1, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.BackupMessage.prototype.setFlag = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int32 priority = 2; + * @return {number} + */ +proto.protocol.BackupMessage.prototype.getPriority = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.BackupMessage.prototype.setPriority = function(value) { + jspb.Message.setField(this, 2, value); }; diff --git a/src/protocol/core/TronInventoryItems_pb.js b/src/protocol/core/TronInventoryItems_pb.js index d2744d7..81dfb00 100644 --- a/src/protocol/core/TronInventoryItems_pb.js +++ b/src/protocol/core/TronInventoryItems_pb.js @@ -169,7 +169,7 @@ proto.protocol.InventoryItems.prototype.getType = function() { /** @param {number} value */ proto.protocol.InventoryItems.prototype.setType = function(value) { - jspb.Message.setProto3IntField(this, 1, value); + jspb.Message.setField(this, 1, value); }; diff --git a/src/protocol/core/Tron_pb.js b/src/protocol/core/Tron_pb.js index 84b433f..d9f54f7 100644 --- a/src/protocol/core/Tron_pb.js +++ b/src/protocol/core/Tron_pb.js @@ -14,6 +14,7 @@ var global = Function('return this')(); var google_protobuf_any_pb = require('google-protobuf/google/protobuf/any_pb.js'); var core_Discover_pb = require('../core/Discover_pb.js'); goog.exportSymbol('proto.protocol.Account', null, global); +goog.exportSymbol('proto.protocol.Account.AccountResource', null, global); goog.exportSymbol('proto.protocol.Account.Frozen', null, global); goog.exportSymbol('proto.protocol.AccountId', null, global); goog.exportSymbol('proto.protocol.AccountType', null, global); @@ -25,15 +26,27 @@ goog.exportSymbol('proto.protocol.BlockInventory.BlockId', null, global); goog.exportSymbol('proto.protocol.BlockInventory.Type', null, global); goog.exportSymbol('proto.protocol.ChainInventory', null, global); goog.exportSymbol('proto.protocol.ChainInventory.BlockId', null, global); +goog.exportSymbol('proto.protocol.ChainParameters', null, global); +goog.exportSymbol('proto.protocol.ChainParameters.ChainParameter', null, global); goog.exportSymbol('proto.protocol.DisconnectMessage', null, global); goog.exportSymbol('proto.protocol.DynamicProperties', null, global); +goog.exportSymbol('proto.protocol.Exchange', null, global); goog.exportSymbol('proto.protocol.HelloMessage', null, global); goog.exportSymbol('proto.protocol.HelloMessage.BlockId', null, global); goog.exportSymbol('proto.protocol.Inventory', null, global); goog.exportSymbol('proto.protocol.Inventory.InventoryType', null, global); goog.exportSymbol('proto.protocol.Items', null, global); goog.exportSymbol('proto.protocol.Items.ItemType', null, global); +goog.exportSymbol('proto.protocol.Proposal', null, global); +goog.exportSymbol('proto.protocol.Proposal.State', null, global); goog.exportSymbol('proto.protocol.ReasonCode', null, global); +goog.exportSymbol('proto.protocol.ResourceReceipt', null, global); +goog.exportSymbol('proto.protocol.SmartContract', null, global); +goog.exportSymbol('proto.protocol.SmartContract.ABI', null, global); +goog.exportSymbol('proto.protocol.SmartContract.ABI.Entry', null, global); +goog.exportSymbol('proto.protocol.SmartContract.ABI.Entry.EntryType', null, global); +goog.exportSymbol('proto.protocol.SmartContract.ABI.Entry.Param', null, global); +goog.exportSymbol('proto.protocol.SmartContract.ABI.Entry.StateMutabilityType', null, global); goog.exportSymbol('proto.protocol.TXInput', null, global); goog.exportSymbol('proto.protocol.TXInput.raw', null, global); goog.exportSymbol('proto.protocol.TXOutput', null, global); @@ -43,13 +56,18 @@ goog.exportSymbol('proto.protocol.Transaction.Contract', null, global); goog.exportSymbol('proto.protocol.Transaction.Contract.ContractType', null, global); goog.exportSymbol('proto.protocol.Transaction.Result', null, global); goog.exportSymbol('proto.protocol.Transaction.Result.code', null, global); +goog.exportSymbol('proto.protocol.Transaction.Result.contractResult', null, global); goog.exportSymbol('proto.protocol.Transaction.raw', null, global); +goog.exportSymbol('proto.protocol.TransactionInfo', null, global); +goog.exportSymbol('proto.protocol.TransactionInfo.Log', null, global); +goog.exportSymbol('proto.protocol.TransactionInfo.code', null, global); +goog.exportSymbol('proto.protocol.TransactionSign', null, global); goog.exportSymbol('proto.protocol.Transactions', null, global); goog.exportSymbol('proto.protocol.Vote', null, global); goog.exportSymbol('proto.protocol.Votes', null, global); goog.exportSymbol('proto.protocol.Witness', null, global); -goog.exportSymbol('proto.protocol.acuthrity', null, global); -goog.exportSymbol('proto.protocol.permision', null, global); +goog.exportSymbol('proto.protocol.authority', null, global); +goog.exportSymbol('proto.protocol.permission', null, global); /** * Generated by JsPbCodeGenerator. @@ -224,7 +242,7 @@ proto.protocol.AccountId.prototype.getName_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.AccountId.prototype.setName = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -263,7 +281,7 @@ proto.protocol.AccountId.prototype.getAddress_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.AccountId.prototype.setAddress = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -441,7 +459,7 @@ proto.protocol.Vote.prototype.getVoteAddress_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.protocol.Vote.prototype.setVoteAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -456,7 +474,7 @@ proto.protocol.Vote.prototype.getVoteCount = function() { /** @param {number} value */ proto.protocol.Vote.prototype.setVoteCount = function(value) { - jspb.Message.setProto3IntField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -471,19 +489,19 @@ proto.protocol.Vote.prototype.setVoteCount = function(value) { * @extends {jspb.Message} * @constructor */ -proto.protocol.Account = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Account.repeatedFields_, null); +proto.protocol.Proposal = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Proposal.repeatedFields_, null); }; -goog.inherits(proto.protocol.Account, jspb.Message); +goog.inherits(proto.protocol.Proposal, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.Account.displayName = 'proto.protocol.Account'; + proto.protocol.Proposal.displayName = 'proto.protocol.Proposal'; } /** * List of repeated fields within this message type. * @private {!Array} * @const */ -proto.protocol.Account.repeatedFields_ = [5,7,16]; +proto.protocol.Proposal.repeatedFields_ = [6]; @@ -498,8 +516,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.Account.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.Account.toObject(opt_includeInstance, this); +proto.protocol.Proposal.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Proposal.toObject(opt_includeInstance, this); }; @@ -508,37 +526,19 @@ proto.protocol.Account.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.Account} msg The msg instance to transform. + * @param {!proto.protocol.Proposal} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Account.toObject = function(includeInstance, msg) { +proto.protocol.Proposal.toObject = function(includeInstance, msg) { var f, obj = { - accountName: msg.getAccountName_asB64(), - type: jspb.Message.getFieldWithDefault(msg, 2, 0), - address: msg.getAddress_asB64(), - balance: jspb.Message.getFieldWithDefault(msg, 4, 0), - votesList: jspb.Message.toObjectList(msg.getVotesList(), - proto.protocol.Vote.toObject, includeInstance), - assetMap: (f = msg.getAssetMap()) ? f.toObject(includeInstance, undefined) : [], - frozenList: jspb.Message.toObjectList(msg.getFrozenList(), - proto.protocol.Account.Frozen.toObject, includeInstance), - netUsage: jspb.Message.getFieldWithDefault(msg, 8, 0), - createTime: jspb.Message.getFieldWithDefault(msg, 9, 0), - latestOprationTime: jspb.Message.getFieldWithDefault(msg, 10, 0), - allowance: jspb.Message.getFieldWithDefault(msg, 11, 0), - latestWithdrawTime: jspb.Message.getFieldWithDefault(msg, 12, 0), - code: msg.getCode_asB64(), - isWitness: jspb.Message.getFieldWithDefault(msg, 14, false), - isCommittee: jspb.Message.getFieldWithDefault(msg, 15, false), - frozenSupplyList: jspb.Message.toObjectList(msg.getFrozenSupplyList(), - proto.protocol.Account.Frozen.toObject, includeInstance), - assetIssuedName: msg.getAssetIssuedName_asB64(), - latestAssetOperationTimeMap: (f = msg.getLatestAssetOperationTimeMap()) ? f.toObject(includeInstance, undefined) : [], - freeNetUsage: jspb.Message.getFieldWithDefault(msg, 19, 0), - freeAssetNetUsageMap: (f = msg.getFreeAssetNetUsageMap()) ? f.toObject(includeInstance, undefined) : [], - latestConsumeTime: jspb.Message.getFieldWithDefault(msg, 21, 0), - latestConsumeFreeTime: jspb.Message.getFieldWithDefault(msg, 22, 0) + proposalId: jspb.Message.getFieldWithDefault(msg, 1, 0), + proposerAddress: msg.getProposerAddress_asB64(), + parametersMap: (f = msg.getParametersMap()) ? f.toObject(includeInstance, undefined) : [], + expirationTime: jspb.Message.getFieldWithDefault(msg, 4, 0), + createTime: jspb.Message.getFieldWithDefault(msg, 5, 0), + approvalsList: msg.getApprovalsList_asB64(), + state: jspb.Message.getFieldWithDefault(msg, 7, 0) }; if (includeInstance) { @@ -552,23 +552,23 @@ proto.protocol.Account.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.Account} + * @return {!proto.protocol.Proposal} */ -proto.protocol.Account.deserializeBinary = function(bytes) { +proto.protocol.Proposal.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.Account; - return proto.protocol.Account.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.Proposal; + return proto.protocol.Proposal.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.Account} msg The message object to deserialize into. + * @param {!proto.protocol.Proposal} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.Account} + * @return {!proto.protocol.Proposal} */ -proto.protocol.Account.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.Proposal.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -576,101 +576,34 @@ proto.protocol.Account.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setAccountName(value); + var value = /** @type {number} */ (reader.readInt64()); + msg.setProposalId(value); break; case 2: - var value = /** @type {!proto.protocol.AccountType} */ (reader.readEnum()); - msg.setType(value); - break; - case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setAddress(value); + msg.setProposerAddress(value); break; - case 4: - var value = /** @type {number} */ (reader.readInt64()); - msg.setBalance(value); - break; - case 5: - var value = new proto.protocol.Vote; - reader.readMessage(value,proto.protocol.Vote.deserializeBinaryFromReader); - msg.addVotes(value); - break; - case 6: - var value = msg.getAssetMap(); + case 3: + var value = msg.getParametersMap(); reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64); + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt64, jspb.BinaryReader.prototype.readInt64); }); break; - case 7: - var value = new proto.protocol.Account.Frozen; - reader.readMessage(value,proto.protocol.Account.Frozen.deserializeBinaryFromReader); - msg.addFrozen(value); - break; - case 8: + case 4: var value = /** @type {number} */ (reader.readInt64()); - msg.setNetUsage(value); + msg.setExpirationTime(value); break; - case 9: + case 5: var value = /** @type {number} */ (reader.readInt64()); msg.setCreateTime(value); break; - case 10: - var value = /** @type {number} */ (reader.readInt64()); - msg.setLatestOprationTime(value); - break; - case 11: - var value = /** @type {number} */ (reader.readInt64()); - msg.setAllowance(value); - break; - case 12: - var value = /** @type {number} */ (reader.readInt64()); - msg.setLatestWithdrawTime(value); - break; - case 13: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setCode(value); - break; - case 14: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIsWitness(value); - break; - case 15: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIsCommittee(value); - break; - case 16: - var value = new proto.protocol.Account.Frozen; - reader.readMessage(value,proto.protocol.Account.Frozen.deserializeBinaryFromReader); - msg.addFrozenSupply(value); - break; - case 17: + case 6: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setAssetIssuedName(value); - break; - case 18: - var value = msg.getLatestAssetOperationTimeMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64); - }); - break; - case 19: - var value = /** @type {number} */ (reader.readInt64()); - msg.setFreeNetUsage(value); - break; - case 20: - var value = msg.getFreeAssetNetUsageMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64); - }); - break; - case 21: - var value = /** @type {number} */ (reader.readInt64()); - msg.setLatestConsumeTime(value); + msg.addApprovals(value); break; - case 22: - var value = /** @type {number} */ (reader.readInt64()); - msg.setLatestConsumeFreeTime(value); + case 7: + var value = /** @type {!proto.protocol.Proposal.State} */ (reader.readEnum()); + msg.setState(value); break; default: reader.skipField(); @@ -685,9 +618,9 @@ proto.protocol.Account.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.Account.prototype.serializeBinary = function() { +proto.protocol.Proposal.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.Account.serializeBinaryToWriter(this, writer); + proto.protocol.Proposal.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -695,163 +628,241 @@ proto.protocol.Account.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.Account} message + * @param {!proto.protocol.Proposal} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Account.serializeBinaryToWriter = function(message, writer) { +proto.protocol.Proposal.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getAccountName_asU8(); - if (f.length > 0) { - writer.writeBytes( + f = message.getProposalId(); + if (f !== 0) { + writer.writeInt64( 1, f ); } - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } - f = message.getAddress_asU8(); + f = message.getProposerAddress_asU8(); if (f.length > 0) { writer.writeBytes( - 3, - f - ); - } - f = message.getBalance(); - if (f !== 0) { - writer.writeInt64( - 4, + 2, f ); } - f = message.getVotesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 5, - f, - proto.protocol.Vote.serializeBinaryToWriter - ); - } - f = message.getAssetMap(true); + f = message.getParametersMap(true); if (f && f.getLength() > 0) { - f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); - } - f = message.getFrozenList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 7, - f, - proto.protocol.Account.Frozen.serializeBinaryToWriter - ); + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeInt64, jspb.BinaryWriter.prototype.writeInt64); } - f = message.getNetUsage(); + f = message.getExpirationTime(); if (f !== 0) { writer.writeInt64( - 8, + 4, f ); } f = message.getCreateTime(); if (f !== 0) { writer.writeInt64( - 9, - f - ); - } - f = message.getLatestOprationTime(); - if (f !== 0) { - writer.writeInt64( - 10, - f - ); - } - f = message.getAllowance(); - if (f !== 0) { - writer.writeInt64( - 11, - f - ); - } - f = message.getLatestWithdrawTime(); - if (f !== 0) { - writer.writeInt64( - 12, - f - ); - } - f = message.getCode_asU8(); - if (f.length > 0) { - writer.writeBytes( - 13, - f - ); - } - f = message.getIsWitness(); - if (f) { - writer.writeBool( - 14, - f - ); - } - f = message.getIsCommittee(); - if (f) { - writer.writeBool( - 15, + 5, f ); } - f = message.getFrozenSupplyList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 16, - f, - proto.protocol.Account.Frozen.serializeBinaryToWriter - ); - } - f = message.getAssetIssuedName_asU8(); + f = message.getApprovalsList_asU8(); if (f.length > 0) { - writer.writeBytes( - 17, - f - ); - } - f = message.getLatestAssetOperationTimeMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(18, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); - } - f = message.getFreeNetUsage(); - if (f !== 0) { - writer.writeInt64( - 19, + writer.writeRepeatedBytes( + 6, f ); } - f = message.getFreeAssetNetUsageMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(20, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); - } - f = message.getLatestConsumeTime(); - if (f !== 0) { - writer.writeInt64( - 21, - f - ); - } - f = message.getLatestConsumeFreeTime(); - if (f !== 0) { - writer.writeInt64( - 22, + f = message.getState(); + if (f !== 0.0) { + writer.writeEnum( + 7, f ); } }; +/** + * @enum {number} + */ +proto.protocol.Proposal.State = { + PENDING: 0, + DISAPPROVED: 1, + APPROVED: 2, + CANCELED: 3 +}; + +/** + * optional int64 proposal_id = 1; + * @return {number} + */ +proto.protocol.Proposal.prototype.getProposalId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Proposal.prototype.setProposalId = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional bytes proposer_address = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Proposal.prototype.getProposerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes proposer_address = 2; + * This is a type-conversion wrapper around `getProposerAddress()` + * @return {string} + */ +proto.protocol.Proposal.prototype.getProposerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getProposerAddress())); +}; + + +/** + * optional bytes proposer_address = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getProposerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.Proposal.prototype.getProposerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getProposerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Proposal.prototype.setProposerAddress = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * map parameters = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.protocol.Proposal.prototype.getParametersMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +proto.protocol.Proposal.prototype.clearParametersMap = function() { + this.getParametersMap().clear(); +}; + + +/** + * optional int64 expiration_time = 4; + * @return {number} + */ +proto.protocol.Proposal.prototype.getExpirationTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Proposal.prototype.setExpirationTime = function(value) { + jspb.Message.setField(this, 4, value); +}; + + +/** + * optional int64 create_time = 5; + * @return {number} + */ +proto.protocol.Proposal.prototype.getCreateTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Proposal.prototype.setCreateTime = function(value) { + jspb.Message.setField(this, 5, value); +}; + + +/** + * repeated bytes approvals = 6; + * @return {!(Array|Array)} + */ +proto.protocol.Proposal.prototype.getApprovalsList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 6)); +}; + + +/** + * repeated bytes approvals = 6; + * This is a type-conversion wrapper around `getApprovalsList()` + * @return {!Array.} + */ +proto.protocol.Proposal.prototype.getApprovalsList_asB64 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsB64( + this.getApprovalsList())); +}; + + +/** + * repeated bytes approvals = 6; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getApprovalsList()` + * @return {!Array.} + */ +proto.protocol.Proposal.prototype.getApprovalsList_asU8 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsU8( + this.getApprovalsList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.protocol.Proposal.prototype.setApprovalsList = function(value) { + jspb.Message.setField(this, 6, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + */ +proto.protocol.Proposal.prototype.addApprovals = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 6, value, opt_index); +}; + + +proto.protocol.Proposal.prototype.clearApprovalsList = function() { + this.setApprovalsList([]); +}; + + +/** + * optional State state = 7; + * @return {!proto.protocol.Proposal.State} + */ +proto.protocol.Proposal.prototype.getState = function() { + return /** @type {!proto.protocol.Proposal.State} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** @param {!proto.protocol.Proposal.State} value */ +proto.protocol.Proposal.prototype.setState = function(value) { + jspb.Message.setField(this, 7, value); +}; + + /** * Generated by JsPbCodeGenerator. @@ -863,12 +874,12 @@ proto.protocol.Account.serializeBinaryToWriter = function(message, writer) { * @extends {jspb.Message} * @constructor */ -proto.protocol.Account.Frozen = function(opt_data) { +proto.protocol.Exchange = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.Account.Frozen, jspb.Message); +goog.inherits(proto.protocol.Exchange, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.Account.Frozen.displayName = 'proto.protocol.Account.Frozen'; + proto.protocol.Exchange.displayName = 'proto.protocol.Exchange'; } @@ -883,8 +894,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.Account.Frozen.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.Account.Frozen.toObject(opt_includeInstance, this); +proto.protocol.Exchange.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Exchange.toObject(opt_includeInstance, this); }; @@ -893,14 +904,19 @@ proto.protocol.Account.Frozen.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.Account.Frozen} msg The msg instance to transform. + * @param {!proto.protocol.Exchange} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Account.Frozen.toObject = function(includeInstance, msg) { +proto.protocol.Exchange.toObject = function(includeInstance, msg) { var f, obj = { - frozenBalance: jspb.Message.getFieldWithDefault(msg, 1, 0), - expireTime: jspb.Message.getFieldWithDefault(msg, 2, 0) + exchangeId: jspb.Message.getFieldWithDefault(msg, 1, 0), + creatorAddress: msg.getCreatorAddress_asB64(), + createTime: jspb.Message.getFieldWithDefault(msg, 3, 0), + firstTokenId: msg.getFirstTokenId_asB64(), + firstTokenBalance: jspb.Message.getFieldWithDefault(msg, 7, 0), + secondTokenId: msg.getSecondTokenId_asB64(), + secondTokenBalance: jspb.Message.getFieldWithDefault(msg, 9, 0) }; if (includeInstance) { @@ -914,23 +930,23 @@ proto.protocol.Account.Frozen.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.Account.Frozen} + * @return {!proto.protocol.Exchange} */ -proto.protocol.Account.Frozen.deserializeBinary = function(bytes) { +proto.protocol.Exchange.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.Account.Frozen; - return proto.protocol.Account.Frozen.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.Exchange; + return proto.protocol.Exchange.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.Account.Frozen} msg The message object to deserialize into. + * @param {!proto.protocol.Exchange} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.Account.Frozen} + * @return {!proto.protocol.Exchange} */ -proto.protocol.Account.Frozen.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.Exchange.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -939,11 +955,31 @@ proto.protocol.Account.Frozen.deserializeBinaryFromReader = function(msg, reader switch (field) { case 1: var value = /** @type {number} */ (reader.readInt64()); - msg.setFrozenBalance(value); + msg.setExchangeId(value); break; case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setCreatorAddress(value); + break; + case 3: var value = /** @type {number} */ (reader.readInt64()); - msg.setExpireTime(value); + msg.setCreateTime(value); + break; + case 6: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setFirstTokenId(value); + break; + case 7: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFirstTokenBalance(value); + break; + case 8: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSecondTokenId(value); + break; + case 9: + var value = /** @type {number} */ (reader.readInt64()); + msg.setSecondTokenBalance(value); break; default: reader.skipField(); @@ -958,9 +994,9 @@ proto.protocol.Account.Frozen.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.Account.Frozen.prototype.serializeBinary = function() { +proto.protocol.Exchange.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.Account.Frozen.serializeBinaryToWriter(this, writer); + proto.protocol.Exchange.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -968,23 +1004,58 @@ proto.protocol.Account.Frozen.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.Account.Frozen} message + * @param {!proto.protocol.Exchange} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Account.Frozen.serializeBinaryToWriter = function(message, writer) { +proto.protocol.Exchange.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getFrozenBalance(); + f = message.getExchangeId(); if (f !== 0) { writer.writeInt64( 1, f ); } - f = message.getExpireTime(); + f = message.getCreatorAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getCreateTime(); if (f !== 0) { writer.writeInt64( - 2, + 3, + f + ); + } + f = message.getFirstTokenId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 6, + f + ); + } + f = message.getFirstTokenBalance(); + if (f !== 0) { + writer.writeInt64( + 7, + f + ); + } + f = message.getSecondTokenId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 8, + f + ); + } + f = message.getSecondTokenBalance(); + if (f !== 0) { + writer.writeInt64( + 9, f ); } @@ -992,519 +1063,516 @@ proto.protocol.Account.Frozen.serializeBinaryToWriter = function(message, writer /** - * optional int64 frozen_balance = 1; + * optional int64 exchange_id = 1; * @return {number} */ -proto.protocol.Account.Frozen.prototype.getFrozenBalance = function() { +proto.protocol.Exchange.prototype.getExchangeId = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** @param {number} value */ -proto.protocol.Account.Frozen.prototype.setFrozenBalance = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional int64 expire_time = 2; - * @return {number} - */ -proto.protocol.Account.Frozen.prototype.getExpireTime = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** @param {number} value */ -proto.protocol.Account.Frozen.prototype.setExpireTime = function(value) { - jspb.Message.setProto3IntField(this, 2, value); +proto.protocol.Exchange.prototype.setExchangeId = function(value) { + jspb.Message.setField(this, 1, value); }; /** - * optional bytes account_name = 1; + * optional bytes creator_address = 2; * @return {!(string|Uint8Array)} */ -proto.protocol.Account.prototype.getAccountName = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.protocol.Exchange.prototype.getCreatorAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * optional bytes account_name = 1; - * This is a type-conversion wrapper around `getAccountName()` + * optional bytes creator_address = 2; + * This is a type-conversion wrapper around `getCreatorAddress()` * @return {string} */ -proto.protocol.Account.prototype.getAccountName_asB64 = function() { +proto.protocol.Exchange.prototype.getCreatorAddress_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getAccountName())); + this.getCreatorAddress())); }; /** - * optional bytes account_name = 1; + * optional bytes creator_address = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getAccountName()` + * This is a type-conversion wrapper around `getCreatorAddress()` * @return {!Uint8Array} */ -proto.protocol.Account.prototype.getAccountName_asU8 = function() { +proto.protocol.Exchange.prototype.getCreatorAddress_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getAccountName())); + this.getCreatorAddress())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.Account.prototype.setAccountName = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); +proto.protocol.Exchange.prototype.setCreatorAddress = function(value) { + jspb.Message.setField(this, 2, value); }; /** - * optional AccountType type = 2; - * @return {!proto.protocol.AccountType} + * optional int64 create_time = 3; + * @return {number} */ -proto.protocol.Account.prototype.getType = function() { - return /** @type {!proto.protocol.AccountType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.protocol.Exchange.prototype.getCreateTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; -/** @param {!proto.protocol.AccountType} value */ -proto.protocol.Account.prototype.setType = function(value) { - jspb.Message.setProto3EnumField(this, 2, value); +/** @param {number} value */ +proto.protocol.Exchange.prototype.setCreateTime = function(value) { + jspb.Message.setField(this, 3, value); }; /** - * optional bytes address = 3; + * optional bytes first_token_id = 6; * @return {!(string|Uint8Array)} */ -proto.protocol.Account.prototype.getAddress = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.protocol.Exchange.prototype.getFirstTokenId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** - * optional bytes address = 3; - * This is a type-conversion wrapper around `getAddress()` + * optional bytes first_token_id = 6; + * This is a type-conversion wrapper around `getFirstTokenId()` * @return {string} */ -proto.protocol.Account.prototype.getAddress_asB64 = function() { +proto.protocol.Exchange.prototype.getFirstTokenId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getAddress())); + this.getFirstTokenId())); }; /** - * optional bytes address = 3; + * optional bytes first_token_id = 6; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getAddress()` + * This is a type-conversion wrapper around `getFirstTokenId()` * @return {!Uint8Array} */ -proto.protocol.Account.prototype.getAddress_asU8 = function() { +proto.protocol.Exchange.prototype.getFirstTokenId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getAddress())); + this.getFirstTokenId())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.Account.prototype.setAddress = function(value) { - jspb.Message.setProto3BytesField(this, 3, value); +proto.protocol.Exchange.prototype.setFirstTokenId = function(value) { + jspb.Message.setField(this, 6, value); }; /** - * optional int64 balance = 4; + * optional int64 first_token_balance = 7; * @return {number} */ -proto.protocol.Account.prototype.getBalance = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +proto.protocol.Exchange.prototype.getFirstTokenBalance = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); }; /** @param {number} value */ -proto.protocol.Account.prototype.setBalance = function(value) { - jspb.Message.setProto3IntField(this, 4, value); +proto.protocol.Exchange.prototype.setFirstTokenBalance = function(value) { + jspb.Message.setField(this, 7, value); }; /** - * repeated Vote votes = 5; - * @return {!Array.} + * optional bytes second_token_id = 8; + * @return {!(string|Uint8Array)} */ -proto.protocol.Account.prototype.getVotesList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.Vote, 5)); +proto.protocol.Exchange.prototype.getSecondTokenId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 8, "")); }; -/** @param {!Array.} value */ -proto.protocol.Account.prototype.setVotesList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 5, value); +/** + * optional bytes second_token_id = 8; + * This is a type-conversion wrapper around `getSecondTokenId()` + * @return {string} + */ +proto.protocol.Exchange.prototype.getSecondTokenId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSecondTokenId())); }; /** - * @param {!proto.protocol.Vote=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.Vote} + * optional bytes second_token_id = 8; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSecondTokenId()` + * @return {!Uint8Array} */ -proto.protocol.Account.prototype.addVotes = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.protocol.Vote, opt_index); +proto.protocol.Exchange.prototype.getSecondTokenId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSecondTokenId())); }; -proto.protocol.Account.prototype.clearVotesList = function() { - this.setVotesList([]); +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Exchange.prototype.setSecondTokenId = function(value) { + jspb.Message.setField(this, 8, value); }; /** - * map asset = 6; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * optional int64 second_token_balance = 9; + * @return {number} */ -proto.protocol.Account.prototype.getAssetMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 6, opt_noLazyCreate, - null)); +proto.protocol.Exchange.prototype.getSecondTokenBalance = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0)); }; -proto.protocol.Account.prototype.clearAssetMap = function() { - this.getAssetMap().clear(); +/** @param {number} value */ +proto.protocol.Exchange.prototype.setSecondTokenBalance = function(value) { + jspb.Message.setField(this, 9, value); }; + /** - * repeated Frozen frozen = 7; - * @return {!Array.} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.protocol.Account.prototype.getFrozenList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.Account.Frozen, 7)); +proto.protocol.ChainParameters = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.ChainParameters.repeatedFields_, null); }; +goog.inherits(proto.protocol.ChainParameters, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ChainParameters.displayName = 'proto.protocol.ChainParameters'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.ChainParameters.repeatedFields_ = [1]; -/** @param {!Array.} value */ -proto.protocol.Account.prototype.setFrozenList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 7, value); -}; - +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * @param {!proto.protocol.Account.Frozen=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.Account.Frozen} + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} */ -proto.protocol.Account.prototype.addFrozen = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.protocol.Account.Frozen, opt_index); -}; - - -proto.protocol.Account.prototype.clearFrozenList = function() { - this.setFrozenList([]); +proto.protocol.ChainParameters.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ChainParameters.toObject(opt_includeInstance, this); }; /** - * optional int64 net_usage = 8; - * @return {number} + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ChainParameters} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Account.prototype.getNetUsage = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); -}; - +proto.protocol.ChainParameters.toObject = function(includeInstance, msg) { + var f, obj = { + chainparameterList: jspb.Message.toObjectList(msg.getChainparameterList(), + proto.protocol.ChainParameters.ChainParameter.toObject, includeInstance) + }; -/** @param {number} value */ -proto.protocol.Account.prototype.setNetUsage = function(value) { - jspb.Message.setProto3IntField(this, 8, value); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * optional int64 create_time = 9; - * @return {number} + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.ChainParameters} */ -proto.protocol.Account.prototype.getCreateTime = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0)); +proto.protocol.ChainParameters.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ChainParameters; + return proto.protocol.ChainParameters.deserializeBinaryFromReader(msg, reader); }; -/** @param {number} value */ -proto.protocol.Account.prototype.setCreateTime = function(value) { - jspb.Message.setProto3IntField(this, 9, value); +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ChainParameters} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ChainParameters} + */ +proto.protocol.ChainParameters.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.ChainParameters.ChainParameter; + reader.readMessage(value,proto.protocol.ChainParameters.ChainParameter.deserializeBinaryFromReader); + msg.addChainparameter(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * optional int64 latest_opration_time = 10; - * @return {number} + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.protocol.Account.prototype.getLatestOprationTime = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +proto.protocol.ChainParameters.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ChainParameters.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; -/** @param {number} value */ -proto.protocol.Account.prototype.setLatestOprationTime = function(value) { - jspb.Message.setProto3IntField(this, 10, value); +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ChainParameters} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ChainParameters.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getChainparameterList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.protocol.ChainParameters.ChainParameter.serializeBinaryToWriter + ); + } }; + /** - * optional int64 allowance = 11; - * @return {number} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.protocol.Account.prototype.getAllowance = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); +proto.protocol.ChainParameters.ChainParameter = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; +goog.inherits(proto.protocol.ChainParameters.ChainParameter, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ChainParameters.ChainParameter.displayName = 'proto.protocol.ChainParameters.ChainParameter'; +} -/** @param {number} value */ -proto.protocol.Account.prototype.setAllowance = function(value) { - jspb.Message.setProto3IntField(this, 11, value); +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.ChainParameters.ChainParameter.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ChainParameters.ChainParameter.toObject(opt_includeInstance, this); }; /** - * optional int64 latest_withdraw_time = 12; - * @return {number} + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ChainParameters.ChainParameter} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Account.prototype.getLatestWithdrawTime = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); -}; - +proto.protocol.ChainParameters.ChainParameter.toObject = function(includeInstance, msg) { + var f, obj = { + key: jspb.Message.getFieldWithDefault(msg, 1, ""), + value: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; -/** @param {number} value */ -proto.protocol.Account.prototype.setLatestWithdrawTime = function(value) { - jspb.Message.setProto3IntField(this, 12, value); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * optional bytes code = 13; - * @return {!(string|Uint8Array)} + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.ChainParameters.ChainParameter} */ -proto.protocol.Account.prototype.getCode = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 13, "")); +proto.protocol.ChainParameters.ChainParameter.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ChainParameters.ChainParameter; + return proto.protocol.ChainParameters.ChainParameter.deserializeBinaryFromReader(msg, reader); }; /** - * optional bytes code = 13; - * This is a type-conversion wrapper around `getCode()` - * @return {string} + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ChainParameters.ChainParameter} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ChainParameters.ChainParameter} */ -proto.protocol.Account.prototype.getCode_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getCode())); +proto.protocol.ChainParameters.ChainParameter.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setKey(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * optional bytes code = 13; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getCode()` + * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.Account.prototype.getCode_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getCode())); -}; - - -/** @param {!(string|Uint8Array)} value */ -proto.protocol.Account.prototype.setCode = function(value) { - jspb.Message.setProto3BytesField(this, 13, value); +proto.protocol.ChainParameters.ChainParameter.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ChainParameters.ChainParameter.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * optional bool is_witness = 14; - * Note that Boolean fields may be set to 0/1 when serialized from a Java server. - * You should avoid comparisons like {@code val === true/false} in those cases. - * @return {boolean} - */ -proto.protocol.Account.prototype.getIsWitness = function() { - return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 14, false)); -}; - - -/** @param {boolean} value */ -proto.protocol.Account.prototype.setIsWitness = function(value) { - jspb.Message.setProto3BooleanField(this, 14, value); -}; - - -/** - * optional bool is_committee = 15; - * Note that Boolean fields may be set to 0/1 when serialized from a Java server. - * You should avoid comparisons like {@code val === true/false} in those cases. - * @return {boolean} - */ -proto.protocol.Account.prototype.getIsCommittee = function() { - return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 15, false)); -}; - - -/** @param {boolean} value */ -proto.protocol.Account.prototype.setIsCommittee = function(value) { - jspb.Message.setProto3BooleanField(this, 15, value); -}; - - -/** - * repeated Frozen frozen_supply = 16; - * @return {!Array.} - */ -proto.protocol.Account.prototype.getFrozenSupplyList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.Account.Frozen, 16)); -}; - - -/** @param {!Array.} value */ -proto.protocol.Account.prototype.setFrozenSupplyList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 16, value); -}; - - -/** - * @param {!proto.protocol.Account.Frozen=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.Account.Frozen} - */ -proto.protocol.Account.prototype.addFrozenSupply = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 16, opt_value, proto.protocol.Account.Frozen, opt_index); -}; - - -proto.protocol.Account.prototype.clearFrozenSupplyList = function() { - this.setFrozenSupplyList([]); -}; - - -/** - * optional bytes asset_issued_name = 17; - * @return {!(string|Uint8Array)} + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ChainParameters.ChainParameter} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Account.prototype.getAssetIssuedName = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 17, "")); +proto.protocol.ChainParameters.ChainParameter.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getValue(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } }; /** - * optional bytes asset_issued_name = 17; - * This is a type-conversion wrapper around `getAssetIssuedName()` + * optional string key = 1; * @return {string} */ -proto.protocol.Account.prototype.getAssetIssuedName_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getAssetIssuedName())); -}; - - -/** - * optional bytes asset_issued_name = 17; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getAssetIssuedName()` - * @return {!Uint8Array} - */ -proto.protocol.Account.prototype.getAssetIssuedName_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getAssetIssuedName())); -}; - - -/** @param {!(string|Uint8Array)} value */ -proto.protocol.Account.prototype.setAssetIssuedName = function(value) { - jspb.Message.setProto3BytesField(this, 17, value); -}; - - -/** - * map latest_asset_operation_time = 18; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.protocol.Account.prototype.getLatestAssetOperationTimeMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 18, opt_noLazyCreate, - null)); +proto.protocol.ChainParameters.ChainParameter.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; -proto.protocol.Account.prototype.clearLatestAssetOperationTimeMap = function() { - this.getLatestAssetOperationTimeMap().clear(); +/** @param {string} value */ +proto.protocol.ChainParameters.ChainParameter.prototype.setKey = function(value) { + jspb.Message.setField(this, 1, value); }; /** - * optional int64 free_net_usage = 19; + * optional int64 value = 2; * @return {number} */ -proto.protocol.Account.prototype.getFreeNetUsage = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 19, 0)); +proto.protocol.ChainParameters.ChainParameter.prototype.getValue = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** @param {number} value */ -proto.protocol.Account.prototype.setFreeNetUsage = function(value) { - jspb.Message.setProto3IntField(this, 19, value); -}; - - -/** - * map free_asset_net_usage = 20; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.protocol.Account.prototype.getFreeAssetNetUsageMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 20, opt_noLazyCreate, - null)); -}; - - -proto.protocol.Account.prototype.clearFreeAssetNetUsageMap = function() { - this.getFreeAssetNetUsageMap().clear(); +proto.protocol.ChainParameters.ChainParameter.prototype.setValue = function(value) { + jspb.Message.setField(this, 2, value); }; /** - * optional int64 latest_consume_time = 21; - * @return {number} + * repeated ChainParameter chainParameter = 1; + * @return {!Array.} */ -proto.protocol.Account.prototype.getLatestConsumeTime = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 21, 0)); +proto.protocol.ChainParameters.prototype.getChainparameterList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.ChainParameters.ChainParameter, 1)); }; -/** @param {number} value */ -proto.protocol.Account.prototype.setLatestConsumeTime = function(value) { - jspb.Message.setProto3IntField(this, 21, value); +/** @param {!Array.} value */ +proto.protocol.ChainParameters.prototype.setChainparameterList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** - * optional int64 latest_consume_free_time = 22; - * @return {number} + * @param {!proto.protocol.ChainParameters.ChainParameter=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.ChainParameters.ChainParameter} */ -proto.protocol.Account.prototype.getLatestConsumeFreeTime = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 22, 0)); +proto.protocol.ChainParameters.prototype.addChainparameter = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.ChainParameters.ChainParameter, opt_index); }; -/** @param {number} value */ -proto.protocol.Account.prototype.setLatestConsumeFreeTime = function(value) { - jspb.Message.setProto3IntField(this, 22, value); +proto.protocol.ChainParameters.prototype.clearChainparameterList = function() { + this.setChainparameterList([]); }; @@ -1519,13 +1587,20 @@ proto.protocol.Account.prototype.setLatestConsumeFreeTime = function(value) { * @extends {jspb.Message} * @constructor */ -proto.protocol.acuthrity = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.protocol.Account = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Account.repeatedFields_, null); }; -goog.inherits(proto.protocol.acuthrity, jspb.Message); +goog.inherits(proto.protocol.Account, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.acuthrity.displayName = 'proto.protocol.acuthrity'; + proto.protocol.Account.displayName = 'proto.protocol.Account'; } +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Account.repeatedFields_ = [5,7,16]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1539,8 +1614,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.acuthrity.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.acuthrity.toObject(opt_includeInstance, this); +proto.protocol.Account.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Account.toObject(opt_includeInstance, this); }; @@ -1549,14 +1624,40 @@ proto.protocol.acuthrity.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.acuthrity} msg The msg instance to transform. + * @param {!proto.protocol.Account} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.acuthrity.toObject = function(includeInstance, msg) { +proto.protocol.Account.toObject = function(includeInstance, msg) { var f, obj = { - account: (f = msg.getAccount()) && proto.protocol.AccountId.toObject(includeInstance, f), - permissionName: msg.getPermissionName_asB64() + accountName: msg.getAccountName_asB64(), + type: jspb.Message.getFieldWithDefault(msg, 2, 0), + address: msg.getAddress_asB64(), + balance: jspb.Message.getFieldWithDefault(msg, 4, 0), + votesList: jspb.Message.toObjectList(msg.getVotesList(), + proto.protocol.Vote.toObject, includeInstance), + assetMap: (f = msg.getAssetMap()) ? f.toObject(includeInstance, undefined) : [], + frozenList: jspb.Message.toObjectList(msg.getFrozenList(), + proto.protocol.Account.Frozen.toObject, includeInstance), + netUsage: jspb.Message.getFieldWithDefault(msg, 8, 0), + createTime: jspb.Message.getFieldWithDefault(msg, 9, 0), + latestOprationTime: jspb.Message.getFieldWithDefault(msg, 10, 0), + allowance: jspb.Message.getFieldWithDefault(msg, 11, 0), + latestWithdrawTime: jspb.Message.getFieldWithDefault(msg, 12, 0), + code: msg.getCode_asB64(), + isWitness: jspb.Message.getFieldWithDefault(msg, 14, false), + isCommittee: jspb.Message.getFieldWithDefault(msg, 15, false), + frozenSupplyList: jspb.Message.toObjectList(msg.getFrozenSupplyList(), + proto.protocol.Account.Frozen.toObject, includeInstance), + assetIssuedName: msg.getAssetIssuedName_asB64(), + latestAssetOperationTimeMap: (f = msg.getLatestAssetOperationTimeMap()) ? f.toObject(includeInstance, undefined) : [], + freeNetUsage: jspb.Message.getFieldWithDefault(msg, 19, 0), + freeAssetNetUsageMap: (f = msg.getFreeAssetNetUsageMap()) ? f.toObject(includeInstance, undefined) : [], + latestConsumeTime: jspb.Message.getFieldWithDefault(msg, 21, 0), + latestConsumeFreeTime: jspb.Message.getFieldWithDefault(msg, 22, 0), + accountId: msg.getAccountId_asB64(), + accountResource: (f = msg.getAccountResource()) && proto.protocol.Account.AccountResource.toObject(includeInstance, f), + codehash: msg.getCodehash_asB64() }; if (includeInstance) { @@ -1570,23 +1671,23 @@ proto.protocol.acuthrity.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.acuthrity} + * @return {!proto.protocol.Account} */ -proto.protocol.acuthrity.deserializeBinary = function(bytes) { +proto.protocol.Account.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.acuthrity; - return proto.protocol.acuthrity.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.Account; + return proto.protocol.Account.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.acuthrity} msg The message object to deserialize into. + * @param {!proto.protocol.Account} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.acuthrity} + * @return {!proto.protocol.Account} */ -proto.protocol.acuthrity.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.Account.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1594,55 +1695,3858 @@ proto.protocol.acuthrity.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.protocol.AccountId; - reader.readMessage(value,proto.protocol.AccountId.deserializeBinaryFromReader); - msg.setAccount(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAccountName(value); break; case 2: + var value = /** @type {!proto.protocol.AccountType} */ (reader.readEnum()); + msg.setType(value); + break; + case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setPermissionName(value); + msg.setAddress(value); break; - default: - reader.skipField(); + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setBalance(value); break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.protocol.acuthrity.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.protocol.acuthrity.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.protocol.acuthrity} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.protocol.acuthrity.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getAccount(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.protocol.AccountId.serializeBinaryToWriter - ); - } - f = message.getPermissionName_asU8(); - if (f.length > 0) { - writer.writeBytes( - 2, + case 5: + var value = new proto.protocol.Vote; + reader.readMessage(value,proto.protocol.Vote.deserializeBinaryFromReader); + msg.addVotes(value); + break; + case 6: + var value = msg.getAssetMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64); + }); + break; + case 7: + var value = new proto.protocol.Account.Frozen; + reader.readMessage(value,proto.protocol.Account.Frozen.deserializeBinaryFromReader); + msg.addFrozen(value); + break; + case 8: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNetUsage(value); + break; + case 9: + var value = /** @type {number} */ (reader.readInt64()); + msg.setCreateTime(value); + break; + case 10: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestOprationTime(value); + break; + case 11: + var value = /** @type {number} */ (reader.readInt64()); + msg.setAllowance(value); + break; + case 12: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestWithdrawTime(value); + break; + case 13: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setCode(value); + break; + case 14: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsWitness(value); + break; + case 15: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsCommittee(value); + break; + case 16: + var value = new proto.protocol.Account.Frozen; + reader.readMessage(value,proto.protocol.Account.Frozen.deserializeBinaryFromReader); + msg.addFrozenSupply(value); + break; + case 17: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAssetIssuedName(value); + break; + case 18: + var value = msg.getLatestAssetOperationTimeMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64); + }); + break; + case 19: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFreeNetUsage(value); + break; + case 20: + var value = msg.getFreeAssetNetUsageMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt64); + }); + break; + case 21: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestConsumeTime(value); + break; + case 22: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestConsumeFreeTime(value); + break; + case 23: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAccountId(value); + break; + case 26: + var value = new proto.protocol.Account.AccountResource; + reader.readMessage(value,proto.protocol.Account.AccountResource.deserializeBinaryFromReader); + msg.setAccountResource(value); + break; + case 30: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setCodehash(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Account.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Account.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Account} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Account.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAccountName_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } + f = message.getAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getBalance(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = message.getVotesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.protocol.Vote.serializeBinaryToWriter + ); + } + f = message.getAssetMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f = message.getFrozenList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 7, + f, + proto.protocol.Account.Frozen.serializeBinaryToWriter + ); + } + f = message.getNetUsage(); + if (f !== 0) { + writer.writeInt64( + 8, + f + ); + } + f = message.getCreateTime(); + if (f !== 0) { + writer.writeInt64( + 9, + f + ); + } + f = message.getLatestOprationTime(); + if (f !== 0) { + writer.writeInt64( + 10, + f + ); + } + f = message.getAllowance(); + if (f !== 0) { + writer.writeInt64( + 11, + f + ); + } + f = message.getLatestWithdrawTime(); + if (f !== 0) { + writer.writeInt64( + 12, + f + ); + } + f = message.getCode_asU8(); + if (f.length > 0) { + writer.writeBytes( + 13, + f + ); + } + f = message.getIsWitness(); + if (f) { + writer.writeBool( + 14, + f + ); + } + f = message.getIsCommittee(); + if (f) { + writer.writeBool( + 15, + f + ); + } + f = message.getFrozenSupplyList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 16, + f, + proto.protocol.Account.Frozen.serializeBinaryToWriter + ); + } + f = message.getAssetIssuedName_asU8(); + if (f.length > 0) { + writer.writeBytes( + 17, + f + ); + } + f = message.getLatestAssetOperationTimeMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(18, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f = message.getFreeNetUsage(); + if (f !== 0) { + writer.writeInt64( + 19, + f + ); + } + f = message.getFreeAssetNetUsageMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(20, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt64); + } + f = message.getLatestConsumeTime(); + if (f !== 0) { + writer.writeInt64( + 21, + f + ); + } + f = message.getLatestConsumeFreeTime(); + if (f !== 0) { + writer.writeInt64( + 22, + f + ); + } + f = message.getAccountId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 23, + f + ); + } + f = message.getAccountResource(); + if (f != null) { + writer.writeMessage( + 26, + f, + proto.protocol.Account.AccountResource.serializeBinaryToWriter + ); + } + f = message.getCodehash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 30, + f + ); + } +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Account.Frozen = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.Account.Frozen, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Account.Frozen.displayName = 'proto.protocol.Account.Frozen'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Account.Frozen.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Account.Frozen.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Account.Frozen} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Account.Frozen.toObject = function(includeInstance, msg) { + var f, obj = { + frozenBalance: jspb.Message.getFieldWithDefault(msg, 1, 0), + expireTime: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Account.Frozen} + */ +proto.protocol.Account.Frozen.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Account.Frozen; + return proto.protocol.Account.Frozen.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Account.Frozen} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Account.Frozen} + */ +proto.protocol.Account.Frozen.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFrozenBalance(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setExpireTime(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Account.Frozen.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Account.Frozen.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Account.Frozen} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Account.Frozen.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFrozenBalance(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getExpireTime(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional int64 frozen_balance = 1; + * @return {number} + */ +proto.protocol.Account.Frozen.prototype.getFrozenBalance = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.Frozen.prototype.setFrozenBalance = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 expire_time = 2; + * @return {number} + */ +proto.protocol.Account.Frozen.prototype.getExpireTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.Frozen.prototype.setExpireTime = function(value) { + jspb.Message.setField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Account.AccountResource = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.Account.AccountResource, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Account.AccountResource.displayName = 'proto.protocol.Account.AccountResource'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Account.AccountResource.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Account.AccountResource.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Account.AccountResource} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Account.AccountResource.toObject = function(includeInstance, msg) { + var f, obj = { + energyUsage: jspb.Message.getFieldWithDefault(msg, 1, 0), + frozenBalanceForEnergy: (f = msg.getFrozenBalanceForEnergy()) && proto.protocol.Account.Frozen.toObject(includeInstance, f), + latestConsumeTimeForEnergy: jspb.Message.getFieldWithDefault(msg, 3, 0), + storageLimit: jspb.Message.getFieldWithDefault(msg, 6, 0), + storageUsage: jspb.Message.getFieldWithDefault(msg, 7, 0), + latestExchangeStorageTime: jspb.Message.getFieldWithDefault(msg, 8, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Account.AccountResource} + */ +proto.protocol.Account.AccountResource.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Account.AccountResource; + return proto.protocol.Account.AccountResource.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Account.AccountResource} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Account.AccountResource} + */ +proto.protocol.Account.AccountResource.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEnergyUsage(value); + break; + case 2: + var value = new proto.protocol.Account.Frozen; + reader.readMessage(value,proto.protocol.Account.Frozen.deserializeBinaryFromReader); + msg.setFrozenBalanceForEnergy(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestConsumeTimeForEnergy(value); + break; + case 6: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStorageLimit(value); + break; + case 7: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStorageUsage(value); + break; + case 8: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestExchangeStorageTime(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Account.AccountResource.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Account.AccountResource.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Account.AccountResource} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Account.AccountResource.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getEnergyUsage(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getFrozenBalanceForEnergy(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.protocol.Account.Frozen.serializeBinaryToWriter + ); + } + f = message.getLatestConsumeTimeForEnergy(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getStorageLimit(); + if (f !== 0) { + writer.writeInt64( + 6, + f + ); + } + f = message.getStorageUsage(); + if (f !== 0) { + writer.writeInt64( + 7, + f + ); + } + f = message.getLatestExchangeStorageTime(); + if (f !== 0) { + writer.writeInt64( + 8, + f + ); + } +}; + + +/** + * optional int64 energy_usage = 1; + * @return {number} + */ +proto.protocol.Account.AccountResource.prototype.getEnergyUsage = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.AccountResource.prototype.setEnergyUsage = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional Frozen frozen_balance_for_energy = 2; + * @return {?proto.protocol.Account.Frozen} + */ +proto.protocol.Account.AccountResource.prototype.getFrozenBalanceForEnergy = function() { + return /** @type{?proto.protocol.Account.Frozen} */ ( + jspb.Message.getWrapperField(this, proto.protocol.Account.Frozen, 2)); +}; + + +/** @param {?proto.protocol.Account.Frozen|undefined} value */ +proto.protocol.Account.AccountResource.prototype.setFrozenBalanceForEnergy = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +proto.protocol.Account.AccountResource.prototype.clearFrozenBalanceForEnergy = function() { + this.setFrozenBalanceForEnergy(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.Account.AccountResource.prototype.hasFrozenBalanceForEnergy = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional int64 latest_consume_time_for_energy = 3; + * @return {number} + */ +proto.protocol.Account.AccountResource.prototype.getLatestConsumeTimeForEnergy = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.AccountResource.prototype.setLatestConsumeTimeForEnergy = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional int64 storage_limit = 6; + * @return {number} + */ +proto.protocol.Account.AccountResource.prototype.getStorageLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.AccountResource.prototype.setStorageLimit = function(value) { + jspb.Message.setField(this, 6, value); +}; + + +/** + * optional int64 storage_usage = 7; + * @return {number} + */ +proto.protocol.Account.AccountResource.prototype.getStorageUsage = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.AccountResource.prototype.setStorageUsage = function(value) { + jspb.Message.setField(this, 7, value); +}; + + +/** + * optional int64 latest_exchange_storage_time = 8; + * @return {number} + */ +proto.protocol.Account.AccountResource.prototype.getLatestExchangeStorageTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.AccountResource.prototype.setLatestExchangeStorageTime = function(value) { + jspb.Message.setField(this, 8, value); +}; + + +/** + * optional bytes account_name = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Account.prototype.getAccountName = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes account_name = 1; + * This is a type-conversion wrapper around `getAccountName()` + * @return {string} + */ +proto.protocol.Account.prototype.getAccountName_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAccountName())); +}; + + +/** + * optional bytes account_name = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAccountName()` + * @return {!Uint8Array} + */ +proto.protocol.Account.prototype.getAccountName_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAccountName())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Account.prototype.setAccountName = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional AccountType type = 2; + * @return {!proto.protocol.AccountType} + */ +proto.protocol.Account.prototype.getType = function() { + return /** @type {!proto.protocol.AccountType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {!proto.protocol.AccountType} value */ +proto.protocol.Account.prototype.setType = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional bytes address = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Account.prototype.getAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes address = 3; + * This is a type-conversion wrapper around `getAddress()` + * @return {string} + */ +proto.protocol.Account.prototype.getAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAddress())); +}; + + +/** + * optional bytes address = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAddress()` + * @return {!Uint8Array} + */ +proto.protocol.Account.prototype.getAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Account.prototype.setAddress = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional int64 balance = 4; + * @return {number} + */ +proto.protocol.Account.prototype.getBalance = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setBalance = function(value) { + jspb.Message.setField(this, 4, value); +}; + + +/** + * repeated Vote votes = 5; + * @return {!Array.} + */ +proto.protocol.Account.prototype.getVotesList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Vote, 5)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Account.prototype.setVotesList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.protocol.Vote=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Vote} + */ +proto.protocol.Account.prototype.addVotes = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.protocol.Vote, opt_index); +}; + + +proto.protocol.Account.prototype.clearVotesList = function() { + this.setVotesList([]); +}; + + +/** + * map asset = 6; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.protocol.Account.prototype.getAssetMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 6, opt_noLazyCreate, + null)); +}; + + +proto.protocol.Account.prototype.clearAssetMap = function() { + this.getAssetMap().clear(); +}; + + +/** + * repeated Frozen frozen = 7; + * @return {!Array.} + */ +proto.protocol.Account.prototype.getFrozenList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Account.Frozen, 7)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Account.prototype.setFrozenList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 7, value); +}; + + +/** + * @param {!proto.protocol.Account.Frozen=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Account.Frozen} + */ +proto.protocol.Account.prototype.addFrozen = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.protocol.Account.Frozen, opt_index); +}; + + +proto.protocol.Account.prototype.clearFrozenList = function() { + this.setFrozenList([]); +}; + + +/** + * optional int64 net_usage = 8; + * @return {number} + */ +proto.protocol.Account.prototype.getNetUsage = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setNetUsage = function(value) { + jspb.Message.setField(this, 8, value); +}; + + +/** + * optional int64 create_time = 9; + * @return {number} + */ +proto.protocol.Account.prototype.getCreateTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setCreateTime = function(value) { + jspb.Message.setField(this, 9, value); +}; + + +/** + * optional int64 latest_opration_time = 10; + * @return {number} + */ +proto.protocol.Account.prototype.getLatestOprationTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setLatestOprationTime = function(value) { + jspb.Message.setField(this, 10, value); +}; + + +/** + * optional int64 allowance = 11; + * @return {number} + */ +proto.protocol.Account.prototype.getAllowance = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setAllowance = function(value) { + jspb.Message.setField(this, 11, value); +}; + + +/** + * optional int64 latest_withdraw_time = 12; + * @return {number} + */ +proto.protocol.Account.prototype.getLatestWithdrawTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setLatestWithdrawTime = function(value) { + jspb.Message.setField(this, 12, value); +}; + + +/** + * optional bytes code = 13; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Account.prototype.getCode = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 13, "")); +}; + + +/** + * optional bytes code = 13; + * This is a type-conversion wrapper around `getCode()` + * @return {string} + */ +proto.protocol.Account.prototype.getCode_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getCode())); +}; + + +/** + * optional bytes code = 13; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getCode()` + * @return {!Uint8Array} + */ +proto.protocol.Account.prototype.getCode_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getCode())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Account.prototype.setCode = function(value) { + jspb.Message.setField(this, 13, value); +}; + + +/** + * optional bool is_witness = 14; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.protocol.Account.prototype.getIsWitness = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 14, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.Account.prototype.setIsWitness = function(value) { + jspb.Message.setField(this, 14, value); +}; + + +/** + * optional bool is_committee = 15; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.protocol.Account.prototype.getIsCommittee = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 15, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.Account.prototype.setIsCommittee = function(value) { + jspb.Message.setField(this, 15, value); +}; + + +/** + * repeated Frozen frozen_supply = 16; + * @return {!Array.} + */ +proto.protocol.Account.prototype.getFrozenSupplyList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Account.Frozen, 16)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Account.prototype.setFrozenSupplyList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 16, value); +}; + + +/** + * @param {!proto.protocol.Account.Frozen=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Account.Frozen} + */ +proto.protocol.Account.prototype.addFrozenSupply = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 16, opt_value, proto.protocol.Account.Frozen, opt_index); +}; + + +proto.protocol.Account.prototype.clearFrozenSupplyList = function() { + this.setFrozenSupplyList([]); +}; + + +/** + * optional bytes asset_issued_name = 17; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Account.prototype.getAssetIssuedName = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 17, "")); +}; + + +/** + * optional bytes asset_issued_name = 17; + * This is a type-conversion wrapper around `getAssetIssuedName()` + * @return {string} + */ +proto.protocol.Account.prototype.getAssetIssuedName_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAssetIssuedName())); +}; + + +/** + * optional bytes asset_issued_name = 17; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAssetIssuedName()` + * @return {!Uint8Array} + */ +proto.protocol.Account.prototype.getAssetIssuedName_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAssetIssuedName())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Account.prototype.setAssetIssuedName = function(value) { + jspb.Message.setField(this, 17, value); +}; + + +/** + * map latest_asset_operation_time = 18; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.protocol.Account.prototype.getLatestAssetOperationTimeMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 18, opt_noLazyCreate, + null)); +}; + + +proto.protocol.Account.prototype.clearLatestAssetOperationTimeMap = function() { + this.getLatestAssetOperationTimeMap().clear(); +}; + + +/** + * optional int64 free_net_usage = 19; + * @return {number} + */ +proto.protocol.Account.prototype.getFreeNetUsage = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 19, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setFreeNetUsage = function(value) { + jspb.Message.setField(this, 19, value); +}; + + +/** + * map free_asset_net_usage = 20; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.protocol.Account.prototype.getFreeAssetNetUsageMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 20, opt_noLazyCreate, + null)); +}; + + +proto.protocol.Account.prototype.clearFreeAssetNetUsageMap = function() { + this.getFreeAssetNetUsageMap().clear(); +}; + + +/** + * optional int64 latest_consume_time = 21; + * @return {number} + */ +proto.protocol.Account.prototype.getLatestConsumeTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 21, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setLatestConsumeTime = function(value) { + jspb.Message.setField(this, 21, value); +}; + + +/** + * optional int64 latest_consume_free_time = 22; + * @return {number} + */ +proto.protocol.Account.prototype.getLatestConsumeFreeTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 22, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Account.prototype.setLatestConsumeFreeTime = function(value) { + jspb.Message.setField(this, 22, value); +}; + + +/** + * optional bytes account_id = 23; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Account.prototype.getAccountId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 23, "")); +}; + + +/** + * optional bytes account_id = 23; + * This is a type-conversion wrapper around `getAccountId()` + * @return {string} + */ +proto.protocol.Account.prototype.getAccountId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAccountId())); +}; + + +/** + * optional bytes account_id = 23; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAccountId()` + * @return {!Uint8Array} + */ +proto.protocol.Account.prototype.getAccountId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAccountId())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Account.prototype.setAccountId = function(value) { + jspb.Message.setField(this, 23, value); +}; + + +/** + * optional AccountResource account_resource = 26; + * @return {?proto.protocol.Account.AccountResource} + */ +proto.protocol.Account.prototype.getAccountResource = function() { + return /** @type{?proto.protocol.Account.AccountResource} */ ( + jspb.Message.getWrapperField(this, proto.protocol.Account.AccountResource, 26)); +}; + + +/** @param {?proto.protocol.Account.AccountResource|undefined} value */ +proto.protocol.Account.prototype.setAccountResource = function(value) { + jspb.Message.setWrapperField(this, 26, value); +}; + + +proto.protocol.Account.prototype.clearAccountResource = function() { + this.setAccountResource(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.Account.prototype.hasAccountResource = function() { + return jspb.Message.getField(this, 26) != null; +}; + + +/** + * optional bytes codeHash = 30; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Account.prototype.getCodehash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 30, "")); +}; + + +/** + * optional bytes codeHash = 30; + * This is a type-conversion wrapper around `getCodehash()` + * @return {string} + */ +proto.protocol.Account.prototype.getCodehash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getCodehash())); +}; + + +/** + * optional bytes codeHash = 30; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getCodehash()` + * @return {!Uint8Array} + */ +proto.protocol.Account.prototype.getCodehash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getCodehash())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Account.prototype.setCodehash = function(value) { + jspb.Message.setField(this, 30, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.authority = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.authority, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.authority.displayName = 'proto.protocol.authority'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.authority.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.authority.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.authority} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.authority.toObject = function(includeInstance, msg) { + var f, obj = { + account: (f = msg.getAccount()) && proto.protocol.AccountId.toObject(includeInstance, f), + permissionName: msg.getPermissionName_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.authority} + */ +proto.protocol.authority.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.authority; + return proto.protocol.authority.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.authority} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.authority} + */ +proto.protocol.authority.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.AccountId; + reader.readMessage(value,proto.protocol.AccountId.deserializeBinaryFromReader); + msg.setAccount(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPermissionName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.authority.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.authority.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.authority} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.authority.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAccount(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.AccountId.serializeBinaryToWriter + ); + } + f = message.getPermissionName_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional AccountId account = 1; + * @return {?proto.protocol.AccountId} + */ +proto.protocol.authority.prototype.getAccount = function() { + return /** @type{?proto.protocol.AccountId} */ ( + jspb.Message.getWrapperField(this, proto.protocol.AccountId, 1)); +}; + + +/** @param {?proto.protocol.AccountId|undefined} value */ +proto.protocol.authority.prototype.setAccount = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.authority.prototype.clearAccount = function() { + this.setAccount(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.authority.prototype.hasAccount = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes permission_name = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.authority.prototype.getPermissionName = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes permission_name = 2; + * This is a type-conversion wrapper around `getPermissionName()` + * @return {string} + */ +proto.protocol.authority.prototype.getPermissionName_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPermissionName())); +}; + + +/** + * optional bytes permission_name = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPermissionName()` + * @return {!Uint8Array} + */ +proto.protocol.authority.prototype.getPermissionName_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPermissionName())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.authority.prototype.setPermissionName = function(value) { + jspb.Message.setField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.permission = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.permission, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.permission.displayName = 'proto.protocol.permission'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.permission.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.permission.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.permission} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.permission.toObject = function(includeInstance, msg) { + var f, obj = { + account: (f = msg.getAccount()) && proto.protocol.AccountId.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.permission} + */ +proto.protocol.permission.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.permission; + return proto.protocol.permission.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.permission} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.permission} + */ +proto.protocol.permission.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.AccountId; + reader.readMessage(value,proto.protocol.AccountId.deserializeBinaryFromReader); + msg.setAccount(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.permission.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.permission.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.permission} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.permission.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAccount(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.AccountId.serializeBinaryToWriter + ); + } +}; + + +/** + * optional AccountId account = 1; + * @return {?proto.protocol.AccountId} + */ +proto.protocol.permission.prototype.getAccount = function() { + return /** @type{?proto.protocol.AccountId} */ ( + jspb.Message.getWrapperField(this, proto.protocol.AccountId, 1)); +}; + + +/** @param {?proto.protocol.AccountId|undefined} value */ +proto.protocol.permission.prototype.setAccount = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.permission.prototype.clearAccount = function() { + this.setAccount(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.permission.prototype.hasAccount = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Witness = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.Witness, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Witness.displayName = 'proto.protocol.Witness'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Witness.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Witness.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Witness} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Witness.toObject = function(includeInstance, msg) { + var f, obj = { + address: msg.getAddress_asB64(), + votecount: jspb.Message.getFieldWithDefault(msg, 2, 0), + pubkey: msg.getPubkey_asB64(), + url: jspb.Message.getFieldWithDefault(msg, 4, ""), + totalproduced: jspb.Message.getFieldWithDefault(msg, 5, 0), + totalmissed: jspb.Message.getFieldWithDefault(msg, 6, 0), + latestblocknum: jspb.Message.getFieldWithDefault(msg, 7, 0), + latestslotnum: jspb.Message.getFieldWithDefault(msg, 8, 0), + isjobs: jspb.Message.getFieldWithDefault(msg, 9, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Witness} + */ +proto.protocol.Witness.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Witness; + return proto.protocol.Witness.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Witness} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Witness} + */ +proto.protocol.Witness.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAddress(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setVotecount(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPubkey(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setUrl(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTotalproduced(value); + break; + case 6: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTotalmissed(value); + break; + case 7: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestblocknum(value); + break; + case 8: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLatestslotnum(value); + break; + case 9: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsjobs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Witness.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Witness.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Witness} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Witness.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getVotecount(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getPubkey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getUrl(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getTotalproduced(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } + f = message.getTotalmissed(); + if (f !== 0) { + writer.writeInt64( + 6, + f + ); + } + f = message.getLatestblocknum(); + if (f !== 0) { + writer.writeInt64( + 7, + f + ); + } + f = message.getLatestslotnum(); + if (f !== 0) { + writer.writeInt64( + 8, + f + ); + } + f = message.getIsjobs(); + if (f) { + writer.writeBool( + 9, + f + ); + } +}; + + +/** + * optional bytes address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Witness.prototype.getAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes address = 1; + * This is a type-conversion wrapper around `getAddress()` + * @return {string} + */ +proto.protocol.Witness.prototype.getAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAddress())); +}; + + +/** + * optional bytes address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAddress()` + * @return {!Uint8Array} + */ +proto.protocol.Witness.prototype.getAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Witness.prototype.setAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 voteCount = 2; + * @return {number} + */ +proto.protocol.Witness.prototype.getVotecount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Witness.prototype.setVotecount = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional bytes pubKey = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Witness.prototype.getPubkey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes pubKey = 3; + * This is a type-conversion wrapper around `getPubkey()` + * @return {string} + */ +proto.protocol.Witness.prototype.getPubkey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPubkey())); +}; + + +/** + * optional bytes pubKey = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPubkey()` + * @return {!Uint8Array} + */ +proto.protocol.Witness.prototype.getPubkey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPubkey())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Witness.prototype.setPubkey = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional string url = 4; + * @return {string} + */ +proto.protocol.Witness.prototype.getUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +proto.protocol.Witness.prototype.setUrl = function(value) { + jspb.Message.setField(this, 4, value); +}; + + +/** + * optional int64 totalProduced = 5; + * @return {number} + */ +proto.protocol.Witness.prototype.getTotalproduced = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Witness.prototype.setTotalproduced = function(value) { + jspb.Message.setField(this, 5, value); +}; + + +/** + * optional int64 totalMissed = 6; + * @return {number} + */ +proto.protocol.Witness.prototype.getTotalmissed = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Witness.prototype.setTotalmissed = function(value) { + jspb.Message.setField(this, 6, value); +}; + + +/** + * optional int64 latestBlockNum = 7; + * @return {number} + */ +proto.protocol.Witness.prototype.getLatestblocknum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Witness.prototype.setLatestblocknum = function(value) { + jspb.Message.setField(this, 7, value); +}; + + +/** + * optional int64 latestSlotNum = 8; + * @return {number} + */ +proto.protocol.Witness.prototype.getLatestslotnum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Witness.prototype.setLatestslotnum = function(value) { + jspb.Message.setField(this, 8, value); +}; + + +/** + * optional bool isJobs = 9; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.protocol.Witness.prototype.getIsjobs = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 9, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.Witness.prototype.setIsjobs = function(value) { + jspb.Message.setField(this, 9, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Votes = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Votes.repeatedFields_, null); +}; +goog.inherits(proto.protocol.Votes, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Votes.displayName = 'proto.protocol.Votes'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Votes.repeatedFields_ = [2,3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Votes.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Votes.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Votes} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Votes.toObject = function(includeInstance, msg) { + var f, obj = { + address: msg.getAddress_asB64(), + oldVotesList: jspb.Message.toObjectList(msg.getOldVotesList(), + proto.protocol.Vote.toObject, includeInstance), + newVotesList: jspb.Message.toObjectList(msg.getNewVotesList(), + proto.protocol.Vote.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Votes} + */ +proto.protocol.Votes.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Votes; + return proto.protocol.Votes.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Votes} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Votes} + */ +proto.protocol.Votes.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAddress(value); + break; + case 2: + var value = new proto.protocol.Vote; + reader.readMessage(value,proto.protocol.Vote.deserializeBinaryFromReader); + msg.addOldVotes(value); + break; + case 3: + var value = new proto.protocol.Vote; + reader.readMessage(value,proto.protocol.Vote.deserializeBinaryFromReader); + msg.addNewVotes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Votes.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Votes.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Votes} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Votes.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getOldVotesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.protocol.Vote.serializeBinaryToWriter + ); + } + f = message.getNewVotesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.protocol.Vote.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Votes.prototype.getAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes address = 1; + * This is a type-conversion wrapper around `getAddress()` + * @return {string} + */ +proto.protocol.Votes.prototype.getAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAddress())); +}; + + +/** + * optional bytes address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAddress()` + * @return {!Uint8Array} + */ +proto.protocol.Votes.prototype.getAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Votes.prototype.setAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * repeated Vote old_votes = 2; + * @return {!Array.} + */ +proto.protocol.Votes.prototype.getOldVotesList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Vote, 2)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Votes.prototype.setOldVotesList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.protocol.Vote=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Vote} + */ +proto.protocol.Votes.prototype.addOldVotes = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.protocol.Vote, opt_index); +}; + + +proto.protocol.Votes.prototype.clearOldVotesList = function() { + this.setOldVotesList([]); +}; + + +/** + * repeated Vote new_votes = 3; + * @return {!Array.} + */ +proto.protocol.Votes.prototype.getNewVotesList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Vote, 3)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Votes.prototype.setNewVotesList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.protocol.Vote=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Vote} + */ +proto.protocol.Votes.prototype.addNewVotes = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.protocol.Vote, opt_index); +}; + + +proto.protocol.Votes.prototype.clearNewVotesList = function() { + this.setNewVotesList([]); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.TXOutput = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.TXOutput, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.TXOutput.displayName = 'proto.protocol.TXOutput'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.TXOutput.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TXOutput.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.TXOutput} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXOutput.toObject = function(includeInstance, msg) { + var f, obj = { + value: jspb.Message.getFieldWithDefault(msg, 1, 0), + pubkeyhash: msg.getPubkeyhash_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.TXOutput} + */ +proto.protocol.TXOutput.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.TXOutput; + return proto.protocol.TXOutput.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.TXOutput} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.TXOutput} + */ +proto.protocol.TXOutput.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setValue(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPubkeyhash(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.TXOutput.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.TXOutput.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.TXOutput} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXOutput.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValue(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getPubkeyhash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional int64 value = 1; + * @return {number} + */ +proto.protocol.TXOutput.prototype.getValue = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.TXOutput.prototype.setValue = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional bytes pubKeyHash = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TXOutput.prototype.getPubkeyhash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes pubKeyHash = 2; + * This is a type-conversion wrapper around `getPubkeyhash()` + * @return {string} + */ +proto.protocol.TXOutput.prototype.getPubkeyhash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPubkeyhash())); +}; + + +/** + * optional bytes pubKeyHash = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPubkeyhash()` + * @return {!Uint8Array} + */ +proto.protocol.TXOutput.prototype.getPubkeyhash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPubkeyhash())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TXOutput.prototype.setPubkeyhash = function(value) { + jspb.Message.setField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.TXInput = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.TXInput, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.TXInput.displayName = 'proto.protocol.TXInput'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.TXInput.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TXInput.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.TXInput} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXInput.toObject = function(includeInstance, msg) { + var f, obj = { + rawData: (f = msg.getRawData()) && proto.protocol.TXInput.raw.toObject(includeInstance, f), + signature: msg.getSignature_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.TXInput} + */ +proto.protocol.TXInput.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.TXInput; + return proto.protocol.TXInput.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.TXInput} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.TXInput} + */ +proto.protocol.TXInput.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.TXInput.raw; + reader.readMessage(value,proto.protocol.TXInput.raw.deserializeBinaryFromReader); + msg.setRawData(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSignature(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.TXInput.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.TXInput.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.TXInput} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXInput.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRawData(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.TXInput.raw.serializeBinaryToWriter + ); + } + f = message.getSignature_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.TXInput.raw = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.TXInput.raw, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.TXInput.raw.displayName = 'proto.protocol.TXInput.raw'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.TXInput.raw.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TXInput.raw.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.TXInput.raw} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXInput.raw.toObject = function(includeInstance, msg) { + var f, obj = { + txid: msg.getTxid_asB64(), + vout: jspb.Message.getFieldWithDefault(msg, 2, 0), + pubkey: msg.getPubkey_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.TXInput.raw} + */ +proto.protocol.TXInput.raw.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.TXInput.raw; + return proto.protocol.TXInput.raw.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.TXInput.raw} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.TXInput.raw} + */ +proto.protocol.TXInput.raw.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setTxid(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setVout(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPubkey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.TXInput.raw.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.TXInput.raw.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.TXInput.raw} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXInput.raw.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTxid_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getVout(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getPubkey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional bytes txID = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TXInput.raw.prototype.getTxid = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes txID = 1; + * This is a type-conversion wrapper around `getTxid()` + * @return {string} + */ +proto.protocol.TXInput.raw.prototype.getTxid_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getTxid())); +}; + + +/** + * optional bytes txID = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTxid()` + * @return {!Uint8Array} + */ +proto.protocol.TXInput.raw.prototype.getTxid_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getTxid())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TXInput.raw.prototype.setTxid = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 vout = 2; + * @return {number} + */ +proto.protocol.TXInput.raw.prototype.getVout = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.TXInput.raw.prototype.setVout = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional bytes pubKey = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TXInput.raw.prototype.getPubkey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes pubKey = 3; + * This is a type-conversion wrapper around `getPubkey()` + * @return {string} + */ +proto.protocol.TXInput.raw.prototype.getPubkey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPubkey())); +}; + + +/** + * optional bytes pubKey = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPubkey()` + * @return {!Uint8Array} + */ +proto.protocol.TXInput.raw.prototype.getPubkey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPubkey())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TXInput.raw.prototype.setPubkey = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional raw raw_data = 1; + * @return {?proto.protocol.TXInput.raw} + */ +proto.protocol.TXInput.prototype.getRawData = function() { + return /** @type{?proto.protocol.TXInput.raw} */ ( + jspb.Message.getWrapperField(this, proto.protocol.TXInput.raw, 1)); +}; + + +/** @param {?proto.protocol.TXInput.raw|undefined} value */ +proto.protocol.TXInput.prototype.setRawData = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.TXInput.prototype.clearRawData = function() { + this.setRawData(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.TXInput.prototype.hasRawData = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes signature = 4; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TXInput.prototype.getSignature = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes signature = 4; + * This is a type-conversion wrapper around `getSignature()` + * @return {string} + */ +proto.protocol.TXInput.prototype.getSignature_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSignature())); +}; + + +/** + * optional bytes signature = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSignature()` + * @return {!Uint8Array} + */ +proto.protocol.TXInput.prototype.getSignature_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSignature())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TXInput.prototype.setSignature = function(value) { + jspb.Message.setField(this, 4, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.TXOutputs = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.TXOutputs.repeatedFields_, null); +}; +goog.inherits(proto.protocol.TXOutputs, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.TXOutputs.displayName = 'proto.protocol.TXOutputs'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.TXOutputs.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.TXOutputs.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TXOutputs.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.TXOutputs} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXOutputs.toObject = function(includeInstance, msg) { + var f, obj = { + outputsList: jspb.Message.toObjectList(msg.getOutputsList(), + proto.protocol.TXOutput.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.TXOutputs} + */ +proto.protocol.TXOutputs.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.TXOutputs; + return proto.protocol.TXOutputs.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.TXOutputs} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.TXOutputs} + */ +proto.protocol.TXOutputs.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.TXOutput; + reader.readMessage(value,proto.protocol.TXOutput.deserializeBinaryFromReader); + msg.addOutputs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.TXOutputs.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.TXOutputs.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.TXOutputs} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TXOutputs.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOutputsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.protocol.TXOutput.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated TXOutput outputs = 1; + * @return {!Array.} + */ +proto.protocol.TXOutputs.prototype.getOutputsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.TXOutput, 1)); +}; + + +/** @param {!Array.} value */ +proto.protocol.TXOutputs.prototype.setOutputsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.protocol.TXOutput=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.TXOutput} + */ +proto.protocol.TXOutputs.prototype.addOutputs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.TXOutput, opt_index); +}; + + +proto.protocol.TXOutputs.prototype.clearOutputsList = function() { + this.setOutputsList([]); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.ResourceReceipt = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.ResourceReceipt, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ResourceReceipt.displayName = 'proto.protocol.ResourceReceipt'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.ResourceReceipt.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ResourceReceipt.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ResourceReceipt} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ResourceReceipt.toObject = function(includeInstance, msg) { + var f, obj = { + energyUsage: jspb.Message.getFieldWithDefault(msg, 1, 0), + energyFee: jspb.Message.getFieldWithDefault(msg, 2, 0), + originEnergyUsage: jspb.Message.getFieldWithDefault(msg, 3, 0), + energyUsageTotal: jspb.Message.getFieldWithDefault(msg, 4, 0), + netUsage: jspb.Message.getFieldWithDefault(msg, 5, 0), + netFee: jspb.Message.getFieldWithDefault(msg, 6, 0), + result: jspb.Message.getFieldWithDefault(msg, 7, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.ResourceReceipt} + */ +proto.protocol.ResourceReceipt.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ResourceReceipt; + return proto.protocol.ResourceReceipt.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ResourceReceipt} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ResourceReceipt} + */ +proto.protocol.ResourceReceipt.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEnergyUsage(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEnergyFee(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setOriginEnergyUsage(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEnergyUsageTotal(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNetUsage(value); + break; + case 6: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNetFee(value); + break; + case 7: + var value = /** @type {!proto.protocol.Transaction.Result.contractResult} */ (reader.readEnum()); + msg.setResult(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.ResourceReceipt.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ResourceReceipt.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ResourceReceipt} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ResourceReceipt.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getEnergyUsage(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getEnergyFee(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getOriginEnergyUsage(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getEnergyUsageTotal(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = message.getNetUsage(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } + f = message.getNetFee(); + if (f !== 0) { + writer.writeInt64( + 6, + f + ); + } + f = message.getResult(); + if (f !== 0.0) { + writer.writeEnum( + 7, + f + ); + } +}; + + +/** + * optional int64 energy_usage = 1; + * @return {number} + */ +proto.protocol.ResourceReceipt.prototype.getEnergyUsage = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ResourceReceipt.prototype.setEnergyUsage = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 energy_fee = 2; + * @return {number} + */ +proto.protocol.ResourceReceipt.prototype.getEnergyFee = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ResourceReceipt.prototype.setEnergyFee = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional int64 origin_energy_usage = 3; + * @return {number} + */ +proto.protocol.ResourceReceipt.prototype.getOriginEnergyUsage = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ResourceReceipt.prototype.setOriginEnergyUsage = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional int64 energy_usage_total = 4; + * @return {number} + */ +proto.protocol.ResourceReceipt.prototype.getEnergyUsageTotal = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ResourceReceipt.prototype.setEnergyUsageTotal = function(value) { + jspb.Message.setField(this, 4, value); +}; + + +/** + * optional int64 net_usage = 5; + * @return {number} + */ +proto.protocol.ResourceReceipt.prototype.getNetUsage = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ResourceReceipt.prototype.setNetUsage = function(value) { + jspb.Message.setField(this, 5, value); +}; + + +/** + * optional int64 net_fee = 6; + * @return {number} + */ +proto.protocol.ResourceReceipt.prototype.getNetFee = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ResourceReceipt.prototype.setNetFee = function(value) { + jspb.Message.setField(this, 6, value); +}; + + +/** + * optional Transaction.Result.contractResult result = 7; + * @return {!proto.protocol.Transaction.Result.contractResult} + */ +proto.protocol.ResourceReceipt.prototype.getResult = function() { + return /** @type {!proto.protocol.Transaction.Result.contractResult} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** @param {!proto.protocol.Transaction.Result.contractResult} value */ +proto.protocol.ResourceReceipt.prototype.setResult = function(value) { + jspb.Message.setField(this, 7, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Transaction = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Transaction.repeatedFields_, null); +}; +goog.inherits(proto.protocol.Transaction, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Transaction.displayName = 'proto.protocol.Transaction'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Transaction.repeatedFields_ = [2,5]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Transaction.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Transaction.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Transaction} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transaction.toObject = function(includeInstance, msg) { + var f, obj = { + rawData: (f = msg.getRawData()) && proto.protocol.Transaction.raw.toObject(includeInstance, f), + signatureList: msg.getSignatureList_asB64(), + retList: jspb.Message.toObjectList(msg.getRetList(), + proto.protocol.Transaction.Result.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Transaction} + */ +proto.protocol.Transaction.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Transaction; + return proto.protocol.Transaction.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Transaction} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Transaction} + */ +proto.protocol.Transaction.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.Transaction.raw; + reader.readMessage(value,proto.protocol.Transaction.raw.deserializeBinaryFromReader); + msg.setRawData(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addSignature(value); + break; + case 5: + var value = new proto.protocol.Transaction.Result; + reader.readMessage(value,proto.protocol.Transaction.Result.deserializeBinaryFromReader); + msg.addRet(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Transaction.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Transaction.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Transaction} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transaction.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRawData(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.Transaction.raw.serializeBinaryToWriter + ); + } + f = message.getSignatureList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 2, + f + ); + } + f = message.getRetList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.protocol.Transaction.Result.serializeBinaryToWriter + ); + } +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Transaction.Contract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.Transaction.Contract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Transaction.Contract.displayName = 'proto.protocol.Transaction.Contract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Transaction.Contract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Transaction.Contract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Transaction.Contract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transaction.Contract.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + parameter: (f = msg.getParameter()) && google_protobuf_any_pb.Any.toObject(includeInstance, f), + provider: msg.getProvider_asB64(), + contractname: msg.getContractname_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Transaction.Contract} + */ +proto.protocol.Transaction.Contract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Transaction.Contract; + return proto.protocol.Transaction.Contract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Transaction.Contract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Transaction.Contract} + */ +proto.protocol.Transaction.Contract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.protocol.Transaction.Contract.ContractType} */ (reader.readEnum()); + msg.setType(value); + break; + case 2: + var value = new google_protobuf_any_pb.Any; + reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader); + msg.setParameter(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setProvider(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setContractname(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.Transaction.Contract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Transaction.Contract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Transaction.Contract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transaction.Contract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getParameter(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_any_pb.Any.serializeBinaryToWriter + ); + } + f = message.getProvider_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getContractname_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, f ); } @@ -1650,23 +5554,72 @@ proto.protocol.acuthrity.serializeBinaryToWriter = function(message, writer) { /** - * optional AccountId account = 1; - * @return {?proto.protocol.AccountId} + * @enum {number} + */ +proto.protocol.Transaction.Contract.ContractType = { + ACCOUNTCREATECONTRACT: 0, + TRANSFERCONTRACT: 1, + TRANSFERASSETCONTRACT: 2, + VOTEASSETCONTRACT: 3, + VOTEWITNESSCONTRACT: 4, + WITNESSCREATECONTRACT: 5, + ASSETISSUECONTRACT: 6, + WITNESSUPDATECONTRACT: 8, + PARTICIPATEASSETISSUECONTRACT: 9, + ACCOUNTUPDATECONTRACT: 10, + FREEZEBALANCECONTRACT: 11, + UNFREEZEBALANCECONTRACT: 12, + WITHDRAWBALANCECONTRACT: 13, + UNFREEZEASSETCONTRACT: 14, + UPDATEASSETCONTRACT: 15, + PROPOSALCREATECONTRACT: 16, + PROPOSALAPPROVECONTRACT: 17, + PROPOSALDELETECONTRACT: 18, + SETACCOUNTIDCONTRACT: 19, + CUSTOMCONTRACT: 20, + CREATESMARTCONTRACT: 30, + TRIGGERSMARTCONTRACT: 31, + GETCONTRACT: 32, + UPDATESETTINGCONTRACT: 33, + EXCHANGECREATECONTRACT: 41, + EXCHANGEINJECTCONTRACT: 42, + EXCHANGEWITHDRAWCONTRACT: 43, + EXCHANGETRANSACTIONCONTRACT: 44 +}; + +/** + * optional ContractType type = 1; + * @return {!proto.protocol.Transaction.Contract.ContractType} + */ +proto.protocol.Transaction.Contract.prototype.getType = function() { + return /** @type {!proto.protocol.Transaction.Contract.ContractType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.protocol.Transaction.Contract.ContractType} value */ +proto.protocol.Transaction.Contract.prototype.setType = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional google.protobuf.Any parameter = 2; + * @return {?proto.google.protobuf.Any} */ -proto.protocol.acuthrity.prototype.getAccount = function() { - return /** @type{?proto.protocol.AccountId} */ ( - jspb.Message.getWrapperField(this, proto.protocol.AccountId, 1)); +proto.protocol.Transaction.Contract.prototype.getParameter = function() { + return /** @type{?proto.google.protobuf.Any} */ ( + jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 2)); }; -/** @param {?proto.protocol.AccountId|undefined} value */ -proto.protocol.acuthrity.prototype.setAccount = function(value) { - jspb.Message.setWrapperField(this, 1, value); +/** @param {?proto.google.protobuf.Any|undefined} value */ +proto.protocol.Transaction.Contract.prototype.setParameter = function(value) { + jspb.Message.setWrapperField(this, 2, value); }; -proto.protocol.acuthrity.prototype.clearAccount = function() { - this.setAccount(undefined); +proto.protocol.Transaction.Contract.prototype.clearParameter = function() { + this.setParameter(undefined); }; @@ -1674,47 +5627,86 @@ proto.protocol.acuthrity.prototype.clearAccount = function() { * Returns whether this field is set. * @return {!boolean} */ -proto.protocol.acuthrity.prototype.hasAccount = function() { - return jspb.Message.getField(this, 1) != null; +proto.protocol.Transaction.Contract.prototype.hasParameter = function() { + return jspb.Message.getField(this, 2) != null; }; /** - * optional bytes permission_name = 2; + * optional bytes provider = 3; * @return {!(string|Uint8Array)} */ -proto.protocol.acuthrity.prototype.getPermissionName = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.protocol.Transaction.Contract.prototype.getProvider = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** - * optional bytes permission_name = 2; - * This is a type-conversion wrapper around `getPermissionName()` + * optional bytes provider = 3; + * This is a type-conversion wrapper around `getProvider()` * @return {string} */ -proto.protocol.acuthrity.prototype.getPermissionName_asB64 = function() { +proto.protocol.Transaction.Contract.prototype.getProvider_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getPermissionName())); + this.getProvider())); }; /** - * optional bytes permission_name = 2; + * optional bytes provider = 3; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getPermissionName()` + * This is a type-conversion wrapper around `getProvider()` * @return {!Uint8Array} */ -proto.protocol.acuthrity.prototype.getPermissionName_asU8 = function() { +proto.protocol.Transaction.Contract.prototype.getProvider_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getPermissionName())); + this.getProvider())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Transaction.Contract.prototype.setProvider = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional bytes ContractName = 4; + * @return {!(string|Uint8Array)} + */ +proto.protocol.Transaction.Contract.prototype.getContractname = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes ContractName = 4; + * This is a type-conversion wrapper around `getContractname()` + * @return {string} + */ +proto.protocol.Transaction.Contract.prototype.getContractname_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getContractname())); +}; + + +/** + * optional bytes ContractName = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getContractname()` + * @return {!Uint8Array} + */ +proto.protocol.Transaction.Contract.prototype.getContractname_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getContractname())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.acuthrity.prototype.setPermissionName = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); +proto.protocol.Transaction.Contract.prototype.setContractname = function(value) { + jspb.Message.setField(this, 4, value); }; @@ -1729,12 +5721,12 @@ proto.protocol.acuthrity.prototype.setPermissionName = function(value) { * @extends {jspb.Message} * @constructor */ -proto.protocol.permision = function(opt_data) { +proto.protocol.Transaction.Result = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.permision, jspb.Message); +goog.inherits(proto.protocol.Transaction.Result, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.permision.displayName = 'proto.protocol.permision'; + proto.protocol.Transaction.Result.displayName = 'proto.protocol.Transaction.Result'; } @@ -1749,8 +5741,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.permision.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.permision.toObject(opt_includeInstance, this); +proto.protocol.Transaction.Result.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Transaction.Result.toObject(opt_includeInstance, this); }; @@ -1759,13 +5751,17 @@ proto.protocol.permision.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.permision} msg The msg instance to transform. + * @param {!proto.protocol.Transaction.Result} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.permision.toObject = function(includeInstance, msg) { +proto.protocol.Transaction.Result.toObject = function(includeInstance, msg) { var f, obj = { - account: (f = msg.getAccount()) && proto.protocol.AccountId.toObject(includeInstance, f) + fee: jspb.Message.getFieldWithDefault(msg, 1, 0), + ret: jspb.Message.getFieldWithDefault(msg, 2, 0), + contractret: jspb.Message.getFieldWithDefault(msg, 3, 0), + withdrawAmount: jspb.Message.getFieldWithDefault(msg, 15, 0), + unfreezeAmount: jspb.Message.getFieldWithDefault(msg, 16, 0) }; if (includeInstance) { @@ -1779,23 +5775,23 @@ proto.protocol.permision.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.permision} + * @return {!proto.protocol.Transaction.Result} */ -proto.protocol.permision.deserializeBinary = function(bytes) { +proto.protocol.Transaction.Result.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.permision; - return proto.protocol.permision.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.Transaction.Result; + return proto.protocol.Transaction.Result.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.permision} msg The message object to deserialize into. + * @param {!proto.protocol.Transaction.Result} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.permision} + * @return {!proto.protocol.Transaction.Result} */ -proto.protocol.permision.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.Transaction.Result.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1803,9 +5799,24 @@ proto.protocol.permision.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.protocol.AccountId; - reader.readMessage(value,proto.protocol.AccountId.deserializeBinaryFromReader); - msg.setAccount(value); + var value = /** @type {number} */ (reader.readInt64()); + msg.setFee(value); + break; + case 2: + var value = /** @type {!proto.protocol.Transaction.Result.code} */ (reader.readEnum()); + msg.setRet(value); + break; + case 3: + var value = /** @type {!proto.protocol.Transaction.Result.contractResult} */ (reader.readEnum()); + msg.setContractret(value); + break; + case 15: + var value = /** @type {number} */ (reader.readInt64()); + msg.setWithdrawAmount(value); + break; + case 16: + var value = /** @type {number} */ (reader.readInt64()); + msg.setUnfreezeAmount(value); break; default: reader.skipField(); @@ -1820,9 +5831,9 @@ proto.protocol.permision.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.permision.prototype.serializeBinary = function() { +proto.protocol.Transaction.Result.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.permision.serializeBinaryToWriter(this, writer); + proto.protocol.Transaction.Result.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1830,50 +5841,150 @@ proto.protocol.permision.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.permision} message + * @param {!proto.protocol.Transaction.Result} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.permision.serializeBinaryToWriter = function(message, writer) { +proto.protocol.Transaction.Result.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getAccount(); - if (f != null) { - writer.writeMessage( + f = message.getFee(); + if (f !== 0) { + writer.writeInt64( 1, - f, - proto.protocol.AccountId.serializeBinaryToWriter + f + ); + } + f = message.getRet(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } + f = message.getContractret(); + if (f !== 0.0) { + writer.writeEnum( + 3, + f + ); + } + f = message.getWithdrawAmount(); + if (f !== 0) { + writer.writeInt64( + 15, + f + ); + } + f = message.getUnfreezeAmount(); + if (f !== 0) { + writer.writeInt64( + 16, + f ); } }; /** - * optional AccountId account = 1; - * @return {?proto.protocol.AccountId} + * @enum {number} */ -proto.protocol.permision.prototype.getAccount = function() { - return /** @type{?proto.protocol.AccountId} */ ( - jspb.Message.getWrapperField(this, proto.protocol.AccountId, 1)); +proto.protocol.Transaction.Result.code = { + SUCESS: 0, + FAILED: 1 }; +/** + * @enum {number} + */ +proto.protocol.Transaction.Result.contractResult = { + DEFAULT: 0, + SUCCESS: 1, + REVERT: 2, + BAD_JUMP_DESTINATION: 3, + OUT_OF_MEMORY: 4, + PRECOMPILED_CONTRACT: 5, + STACK_TOO_SMALL: 6, + STACK_TOO_LARGE: 7, + ILLEGAL_OPERATION: 8, + STACK_OVERFLOW: 9, + OUT_OF_ENERGY: 10, + OUT_OF_TIME: 11, + JVM_STACK_OVER_FLOW: 12, + UNKNOWN: 13 +}; -/** @param {?proto.protocol.AccountId|undefined} value */ -proto.protocol.permision.prototype.setAccount = function(value) { - jspb.Message.setWrapperField(this, 1, value); +/** + * optional int64 fee = 1; + * @return {number} + */ +proto.protocol.Transaction.Result.prototype.getFee = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; -proto.protocol.permision.prototype.clearAccount = function() { - this.setAccount(undefined); +/** @param {number} value */ +proto.protocol.Transaction.Result.prototype.setFee = function(value) { + jspb.Message.setField(this, 1, value); }; /** - * Returns whether this field is set. - * @return {!boolean} + * optional code ret = 2; + * @return {!proto.protocol.Transaction.Result.code} */ -proto.protocol.permision.prototype.hasAccount = function() { - return jspb.Message.getField(this, 1) != null; +proto.protocol.Transaction.Result.prototype.getRet = function() { + return /** @type {!proto.protocol.Transaction.Result.code} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {!proto.protocol.Transaction.Result.code} value */ +proto.protocol.Transaction.Result.prototype.setRet = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional contractResult contractRet = 3; + * @return {!proto.protocol.Transaction.Result.contractResult} + */ +proto.protocol.Transaction.Result.prototype.getContractret = function() { + return /** @type {!proto.protocol.Transaction.Result.contractResult} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {!proto.protocol.Transaction.Result.contractResult} value */ +proto.protocol.Transaction.Result.prototype.setContractret = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional int64 withdraw_amount = 15; + * @return {number} + */ +proto.protocol.Transaction.Result.prototype.getWithdrawAmount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 15, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Transaction.Result.prototype.setWithdrawAmount = function(value) { + jspb.Message.setField(this, 15, value); +}; + + +/** + * optional int64 unfreeze_amount = 16; + * @return {number} + */ +proto.protocol.Transaction.Result.prototype.getUnfreezeAmount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 16, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Transaction.Result.prototype.setUnfreezeAmount = function(value) { + jspb.Message.setField(this, 16, value); }; @@ -1888,13 +5999,20 @@ proto.protocol.permision.prototype.hasAccount = function() { * @extends {jspb.Message} * @constructor */ -proto.protocol.Witness = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.protocol.Transaction.raw = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Transaction.raw.repeatedFields_, null); }; -goog.inherits(proto.protocol.Witness, jspb.Message); +goog.inherits(proto.protocol.Transaction.raw, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.Witness.displayName = 'proto.protocol.Witness'; + proto.protocol.Transaction.raw.displayName = 'proto.protocol.Transaction.raw'; } +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Transaction.raw.repeatedFields_ = [9,11]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1908,31 +6026,34 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.Witness.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.Witness.toObject(opt_includeInstance, this); +proto.protocol.Transaction.raw.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Transaction.raw.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.protocol.Witness} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.protocol.Witness.toObject = function(includeInstance, msg) { - var f, obj = { - address: msg.getAddress_asB64(), - votecount: jspb.Message.getFieldWithDefault(msg, 2, 0), - pubkey: msg.getPubkey_asB64(), - url: jspb.Message.getFieldWithDefault(msg, 4, ""), - totalproduced: jspb.Message.getFieldWithDefault(msg, 5, 0), - totalmissed: jspb.Message.getFieldWithDefault(msg, 6, 0), - latestblocknum: jspb.Message.getFieldWithDefault(msg, 7, 0), - latestslotnum: jspb.Message.getFieldWithDefault(msg, 8, 0), - isjobs: jspb.Message.getFieldWithDefault(msg, 9, false) + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Transaction.raw} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Transaction.raw.toObject = function(includeInstance, msg) { + var f, obj = { + refBlockBytes: msg.getRefBlockBytes_asB64(), + refBlockNum: jspb.Message.getFieldWithDefault(msg, 3, 0), + refBlockHash: msg.getRefBlockHash_asB64(), + expiration: jspb.Message.getFieldWithDefault(msg, 8, 0), + authsList: jspb.Message.toObjectList(msg.getAuthsList(), + proto.protocol.authority.toObject, includeInstance), + data: msg.getData_asB64(), + contractList: jspb.Message.toObjectList(msg.getContractList(), + proto.protocol.Transaction.Contract.toObject, includeInstance), + scripts: msg.getScripts_asB64(), + timestamp: jspb.Message.getFieldWithDefault(msg, 14, 0), + feeLimit: jspb.Message.getFieldWithDefault(msg, 18, 0) }; if (includeInstance) { @@ -1946,23 +6067,23 @@ proto.protocol.Witness.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.Witness} + * @return {!proto.protocol.Transaction.raw} */ -proto.protocol.Witness.deserializeBinary = function(bytes) { +proto.protocol.Transaction.raw.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.Witness; - return proto.protocol.Witness.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.Transaction.raw; + return proto.protocol.Transaction.raw.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.Witness} msg The message object to deserialize into. + * @param {!proto.protocol.Transaction.raw} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.Witness} + * @return {!proto.protocol.Transaction.raw} */ -proto.protocol.Witness.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.Transaction.raw.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1971,39 +6092,45 @@ proto.protocol.Witness.deserializeBinaryFromReader = function(msg, reader) { switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setAddress(value); - break; - case 2: - var value = /** @type {number} */ (reader.readInt64()); - msg.setVotecount(value); + msg.setRefBlockBytes(value); break; case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setPubkey(value); + var value = /** @type {number} */ (reader.readInt64()); + msg.setRefBlockNum(value); break; case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setUrl(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setRefBlockHash(value); break; - case 5: + case 8: var value = /** @type {number} */ (reader.readInt64()); - msg.setTotalproduced(value); + msg.setExpiration(value); break; - case 6: - var value = /** @type {number} */ (reader.readInt64()); - msg.setTotalmissed(value); + case 9: + var value = new proto.protocol.authority; + reader.readMessage(value,proto.protocol.authority.deserializeBinaryFromReader); + msg.addAuths(value); break; - case 7: - var value = /** @type {number} */ (reader.readInt64()); - msg.setLatestblocknum(value); + case 10: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); break; - case 8: + case 11: + var value = new proto.protocol.Transaction.Contract; + reader.readMessage(value,proto.protocol.Transaction.Contract.deserializeBinaryFromReader); + msg.addContract(value); + break; + case 12: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setScripts(value); + break; + case 14: var value = /** @type {number} */ (reader.readInt64()); - msg.setLatestslotnum(value); + msg.setTimestamp(value); break; - case 9: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIsjobs(value); + case 18: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFeeLimit(value); break; default: reader.skipField(); @@ -2018,9 +6145,9 @@ proto.protocol.Witness.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.Witness.prototype.serializeBinary = function() { +proto.protocol.Transaction.raw.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.Witness.serializeBinaryToWriter(this, writer); + proto.protocol.Transaction.raw.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2028,72 +6155,81 @@ proto.protocol.Witness.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.Witness} message + * @param {!proto.protocol.Transaction.raw} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Witness.serializeBinaryToWriter = function(message, writer) { +proto.protocol.Transaction.raw.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getAddress_asU8(); + f = message.getRefBlockBytes_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } - f = message.getVotecount(); + f = message.getRefBlockNum(); if (f !== 0) { writer.writeInt64( - 2, - f - ); - } - f = message.getPubkey_asU8(); - if (f.length > 0) { - writer.writeBytes( 3, f ); } - f = message.getUrl(); + f = message.getRefBlockHash_asU8(); if (f.length > 0) { - writer.writeString( + writer.writeBytes( 4, f ); } - f = message.getTotalproduced(); + f = message.getExpiration(); if (f !== 0) { writer.writeInt64( - 5, + 8, f ); } - f = message.getTotalmissed(); - if (f !== 0) { - writer.writeInt64( - 6, + f = message.getAuthsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 9, + f, + proto.protocol.authority.serializeBinaryToWriter + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 10, f ); } - f = message.getLatestblocknum(); - if (f !== 0) { - writer.writeInt64( - 7, + f = message.getContractList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 11, + f, + proto.protocol.Transaction.Contract.serializeBinaryToWriter + ); + } + f = message.getScripts_asU8(); + if (f.length > 0) { + writer.writeBytes( + 12, f ); } - f = message.getLatestslotnum(); + f = message.getTimestamp(); if (f !== 0) { writer.writeInt64( - 8, + 14, f ); } - f = message.getIsjobs(); - if (f) { - writer.writeBool( - 9, + f = message.getFeeLimit(); + if (f !== 0) { + writer.writeInt64( + 18, f ); } @@ -2101,645 +6237,394 @@ proto.protocol.Witness.serializeBinaryToWriter = function(message, writer) { /** - * optional bytes address = 1; + * optional bytes ref_block_bytes = 1; * @return {!(string|Uint8Array)} */ -proto.protocol.Witness.prototype.getAddress = function() { +proto.protocol.Transaction.raw.prototype.getRefBlockBytes = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional bytes address = 1; - * This is a type-conversion wrapper around `getAddress()` + * optional bytes ref_block_bytes = 1; + * This is a type-conversion wrapper around `getRefBlockBytes()` * @return {string} */ -proto.protocol.Witness.prototype.getAddress_asB64 = function() { +proto.protocol.Transaction.raw.prototype.getRefBlockBytes_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getAddress())); + this.getRefBlockBytes())); }; /** - * optional bytes address = 1; + * optional bytes ref_block_bytes = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getAddress()` + * This is a type-conversion wrapper around `getRefBlockBytes()` * @return {!Uint8Array} */ -proto.protocol.Witness.prototype.getAddress_asU8 = function() { +proto.protocol.Transaction.raw.prototype.getRefBlockBytes_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getAddress())); + this.getRefBlockBytes())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.Witness.prototype.setAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); +proto.protocol.Transaction.raw.prototype.setRefBlockBytes = function(value) { + jspb.Message.setField(this, 1, value); }; /** - * optional int64 voteCount = 2; + * optional int64 ref_block_num = 3; * @return {number} */ -proto.protocol.Witness.prototype.getVotecount = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.protocol.Transaction.raw.prototype.getRefBlockNum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** @param {number} value */ -proto.protocol.Witness.prototype.setVotecount = function(value) { - jspb.Message.setProto3IntField(this, 2, value); +proto.protocol.Transaction.raw.prototype.setRefBlockNum = function(value) { + jspb.Message.setField(this, 3, value); }; /** - * optional bytes pubKey = 3; + * optional bytes ref_block_hash = 4; * @return {!(string|Uint8Array)} */ -proto.protocol.Witness.prototype.getPubkey = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.protocol.Transaction.raw.prototype.getRefBlockHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** - * optional bytes pubKey = 3; - * This is a type-conversion wrapper around `getPubkey()` + * optional bytes ref_block_hash = 4; + * This is a type-conversion wrapper around `getRefBlockHash()` * @return {string} */ -proto.protocol.Witness.prototype.getPubkey_asB64 = function() { +proto.protocol.Transaction.raw.prototype.getRefBlockHash_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getPubkey())); + this.getRefBlockHash())); }; /** - * optional bytes pubKey = 3; + * optional bytes ref_block_hash = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getPubkey()` + * This is a type-conversion wrapper around `getRefBlockHash()` * @return {!Uint8Array} */ -proto.protocol.Witness.prototype.getPubkey_asU8 = function() { +proto.protocol.Transaction.raw.prototype.getRefBlockHash_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getPubkey())); + this.getRefBlockHash())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.Witness.prototype.setPubkey = function(value) { - jspb.Message.setProto3BytesField(this, 3, value); -}; - - -/** - * optional string url = 4; - * @return {string} - */ -proto.protocol.Witness.prototype.getUrl = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** @param {string} value */ -proto.protocol.Witness.prototype.setUrl = function(value) { - jspb.Message.setProto3StringField(this, 4, value); -}; - - -/** - * optional int64 totalProduced = 5; - * @return {number} - */ -proto.protocol.Witness.prototype.getTotalproduced = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** @param {number} value */ -proto.protocol.Witness.prototype.setTotalproduced = function(value) { - jspb.Message.setProto3IntField(this, 5, value); -}; - - -/** - * optional int64 totalMissed = 6; - * @return {number} - */ -proto.protocol.Witness.prototype.getTotalmissed = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); -}; - - -/** @param {number} value */ -proto.protocol.Witness.prototype.setTotalmissed = function(value) { - jspb.Message.setProto3IntField(this, 6, value); -}; - - -/** - * optional int64 latestBlockNum = 7; - * @return {number} - */ -proto.protocol.Witness.prototype.getLatestblocknum = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); -}; - - -/** @param {number} value */ -proto.protocol.Witness.prototype.setLatestblocknum = function(value) { - jspb.Message.setProto3IntField(this, 7, value); +proto.protocol.Transaction.raw.prototype.setRefBlockHash = function(value) { + jspb.Message.setField(this, 4, value); }; /** - * optional int64 latestSlotNum = 8; + * optional int64 expiration = 8; * @return {number} */ -proto.protocol.Witness.prototype.getLatestslotnum = function() { +proto.protocol.Transaction.raw.prototype.getExpiration = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); }; /** @param {number} value */ -proto.protocol.Witness.prototype.setLatestslotnum = function(value) { - jspb.Message.setProto3IntField(this, 8, value); +proto.protocol.Transaction.raw.prototype.setExpiration = function(value) { + jspb.Message.setField(this, 8, value); }; /** - * optional bool isJobs = 9; - * Note that Boolean fields may be set to 0/1 when serialized from a Java server. - * You should avoid comparisons like {@code val === true/false} in those cases. - * @return {boolean} + * repeated authority auths = 9; + * @return {!Array.} */ -proto.protocol.Witness.prototype.getIsjobs = function() { - return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 9, false)); +proto.protocol.Transaction.raw.prototype.getAuthsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.authority, 9)); }; -/** @param {boolean} value */ -proto.protocol.Witness.prototype.setIsjobs = function(value) { - jspb.Message.setProto3BooleanField(this, 9, value); +/** @param {!Array.} value */ +proto.protocol.Transaction.raw.prototype.setAuthsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 9, value); }; - /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * @param {!proto.protocol.authority=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.authority} */ -proto.protocol.Votes = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Votes.repeatedFields_, null); +proto.protocol.Transaction.raw.prototype.addAuths = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, proto.protocol.authority, opt_index); }; -goog.inherits(proto.protocol.Votes, jspb.Message); -if (goog.DEBUG && !COMPILED) { - proto.protocol.Votes.displayName = 'proto.protocol.Votes'; -} -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.protocol.Votes.repeatedFields_ = [2,3]; +proto.protocol.Transaction.raw.prototype.clearAuthsList = function() { + this.setAuthsList([]); +}; + -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} + * optional bytes data = 10; + * @return {!(string|Uint8Array)} */ -proto.protocol.Votes.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.Votes.toObject(opt_includeInstance, this); +proto.protocol.Transaction.raw.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 10, "")); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.protocol.Votes} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * optional bytes data = 10; + * This is a type-conversion wrapper around `getData()` + * @return {string} */ -proto.protocol.Votes.toObject = function(includeInstance, msg) { - var f, obj = { - address: msg.getAddress_asB64(), - oldVotesList: jspb.Message.toObjectList(msg.getOldVotesList(), - proto.protocol.Vote.toObject, includeInstance), - newVotesList: jspb.Message.toObjectList(msg.getNewVotesList(), - proto.protocol.Vote.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; +proto.protocol.Transaction.raw.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.Votes} + * optional bytes data = 10; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} */ -proto.protocol.Votes.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.Votes; - return proto.protocol.Votes.deserializeBinaryFromReader(msg, reader); +proto.protocol.Transaction.raw.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); }; -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.protocol.Votes} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.Votes} - */ -proto.protocol.Votes.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setAddress(value); - break; - case 2: - var value = new proto.protocol.Vote; - reader.readMessage(value,proto.protocol.Vote.deserializeBinaryFromReader); - msg.addOldVotes(value); - break; - case 3: - var value = new proto.protocol.Vote; - reader.readMessage(value,proto.protocol.Vote.deserializeBinaryFromReader); - msg.addNewVotes(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +/** @param {!(string|Uint8Array)} value */ +proto.protocol.Transaction.raw.prototype.setData = function(value) { + jspb.Message.setField(this, 10, value); }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * repeated Contract contract = 11; + * @return {!Array.} */ -proto.protocol.Votes.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.protocol.Votes.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.protocol.Transaction.raw.prototype.getContractList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction.Contract, 11)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Transaction.raw.prototype.setContractList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 11, value); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.protocol.Votes} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {!proto.protocol.Transaction.Contract=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Transaction.Contract} */ -proto.protocol.Votes.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getAddress_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getOldVotesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 2, - f, - proto.protocol.Vote.serializeBinaryToWriter - ); - } - f = message.getNewVotesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - proto.protocol.Vote.serializeBinaryToWriter - ); - } +proto.protocol.Transaction.raw.prototype.addContract = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 11, opt_value, proto.protocol.Transaction.Contract, opt_index); +}; + + +proto.protocol.Transaction.raw.prototype.clearContractList = function() { + this.setContractList([]); }; /** - * optional bytes address = 1; + * optional bytes scripts = 12; * @return {!(string|Uint8Array)} */ -proto.protocol.Votes.prototype.getAddress = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.protocol.Transaction.raw.prototype.getScripts = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 12, "")); }; /** - * optional bytes address = 1; - * This is a type-conversion wrapper around `getAddress()` + * optional bytes scripts = 12; + * This is a type-conversion wrapper around `getScripts()` * @return {string} */ -proto.protocol.Votes.prototype.getAddress_asB64 = function() { +proto.protocol.Transaction.raw.prototype.getScripts_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getAddress())); + this.getScripts())); }; /** - * optional bytes address = 1; + * optional bytes scripts = 12; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getAddress()` + * This is a type-conversion wrapper around `getScripts()` * @return {!Uint8Array} */ -proto.protocol.Votes.prototype.getAddress_asU8 = function() { +proto.protocol.Transaction.raw.prototype.getScripts_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getAddress())); + this.getScripts())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.Votes.prototype.setAddress = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * repeated Vote old_votes = 2; - * @return {!Array.} - */ -proto.protocol.Votes.prototype.getOldVotesList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.Vote, 2)); -}; - - -/** @param {!Array.} value */ -proto.protocol.Votes.prototype.setOldVotesList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 2, value); -}; - - -/** - * @param {!proto.protocol.Vote=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.Vote} - */ -proto.protocol.Votes.prototype.addOldVotes = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.protocol.Vote, opt_index); -}; - - -proto.protocol.Votes.prototype.clearOldVotesList = function() { - this.setOldVotesList([]); +proto.protocol.Transaction.raw.prototype.setScripts = function(value) { + jspb.Message.setField(this, 12, value); }; /** - * repeated Vote new_votes = 3; - * @return {!Array.} + * optional int64 timestamp = 14; + * @return {number} */ -proto.protocol.Votes.prototype.getNewVotesList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.Vote, 3)); +proto.protocol.Transaction.raw.prototype.getTimestamp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 14, 0)); }; -/** @param {!Array.} value */ -proto.protocol.Votes.prototype.setNewVotesList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 3, value); +/** @param {number} value */ +proto.protocol.Transaction.raw.prototype.setTimestamp = function(value) { + jspb.Message.setField(this, 14, value); }; /** - * @param {!proto.protocol.Vote=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.Vote} + * optional int64 fee_limit = 18; + * @return {number} */ -proto.protocol.Votes.prototype.addNewVotes = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.protocol.Vote, opt_index); +proto.protocol.Transaction.raw.prototype.getFeeLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 18, 0)); }; -proto.protocol.Votes.prototype.clearNewVotesList = function() { - this.setNewVotesList([]); +/** @param {number} value */ +proto.protocol.Transaction.raw.prototype.setFeeLimit = function(value) { + jspb.Message.setField(this, 18, value); }; - /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * optional raw raw_data = 1; + * @return {?proto.protocol.Transaction.raw} */ -proto.protocol.TXOutput = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.protocol.Transaction.prototype.getRawData = function() { + return /** @type{?proto.protocol.Transaction.raw} */ ( + jspb.Message.getWrapperField(this, proto.protocol.Transaction.raw, 1)); }; -goog.inherits(proto.protocol.TXOutput, jspb.Message); -if (goog.DEBUG && !COMPILED) { - proto.protocol.TXOutput.displayName = 'proto.protocol.TXOutput'; -} -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.protocol.TXOutput.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.TXOutput.toObject(opt_includeInstance, this); +/** @param {?proto.protocol.Transaction.raw|undefined} value */ +proto.protocol.Transaction.prototype.setRawData = function(value) { + jspb.Message.setWrapperField(this, 1, value); }; -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.protocol.TXOutput} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.protocol.TXOutput.toObject = function(includeInstance, msg) { - var f, obj = { - value: jspb.Message.getFieldWithDefault(msg, 1, 0), - pubkeyhash: msg.getPubkeyhash_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; +proto.protocol.Transaction.prototype.clearRawData = function() { + this.setRawData(undefined); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.TXOutput} + * Returns whether this field is set. + * @return {!boolean} */ -proto.protocol.TXOutput.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.TXOutput; - return proto.protocol.TXOutput.deserializeBinaryFromReader(msg, reader); +proto.protocol.Transaction.prototype.hasRawData = function() { + return jspb.Message.getField(this, 1) != null; }; /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.protocol.TXOutput} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.TXOutput} + * repeated bytes signature = 2; + * @return {!(Array|Array)} */ -proto.protocol.TXOutput.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt64()); - msg.setValue(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setPubkeyhash(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +proto.protocol.Transaction.prototype.getSignatureList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * repeated bytes signature = 2; + * This is a type-conversion wrapper around `getSignatureList()` + * @return {!Array.} */ -proto.protocol.TXOutput.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.protocol.TXOutput.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.protocol.Transaction.prototype.getSignatureList_asB64 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsB64( + this.getSignatureList())); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.protocol.TXOutput} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * repeated bytes signature = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSignatureList()` + * @return {!Array.} */ -proto.protocol.TXOutput.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getValue(); - if (f !== 0) { - writer.writeInt64( - 1, - f - ); - } - f = message.getPubkeyhash_asU8(); - if (f.length > 0) { - writer.writeBytes( - 2, - f - ); - } +proto.protocol.Transaction.prototype.getSignatureList_asU8 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsU8( + this.getSignatureList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.protocol.Transaction.prototype.setSignatureList = function(value) { + jspb.Message.setField(this, 2, value || []); }; /** - * optional int64 value = 1; - * @return {number} + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index */ -proto.protocol.TXOutput.prototype.getValue = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.protocol.Transaction.prototype.addSignature = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 2, value, opt_index); }; -/** @param {number} value */ -proto.protocol.TXOutput.prototype.setValue = function(value) { - jspb.Message.setProto3IntField(this, 1, value); +proto.protocol.Transaction.prototype.clearSignatureList = function() { + this.setSignatureList([]); }; /** - * optional bytes pubKeyHash = 2; - * @return {!(string|Uint8Array)} + * repeated Result ret = 5; + * @return {!Array.} */ -proto.protocol.TXOutput.prototype.getPubkeyhash = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.protocol.Transaction.prototype.getRetList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction.Result, 5)); }; -/** - * optional bytes pubKeyHash = 2; - * This is a type-conversion wrapper around `getPubkeyhash()` - * @return {string} - */ -proto.protocol.TXOutput.prototype.getPubkeyhash_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getPubkeyhash())); +/** @param {!Array.} value */ +proto.protocol.Transaction.prototype.setRetList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 5, value); }; /** - * optional bytes pubKeyHash = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getPubkeyhash()` - * @return {!Uint8Array} + * @param {!proto.protocol.Transaction.Result=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Transaction.Result} */ -proto.protocol.TXOutput.prototype.getPubkeyhash_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getPubkeyhash())); +proto.protocol.Transaction.prototype.addRet = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.protocol.Transaction.Result, opt_index); }; -/** @param {!(string|Uint8Array)} value */ -proto.protocol.TXOutput.prototype.setPubkeyhash = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); +proto.protocol.Transaction.prototype.clearRetList = function() { + this.setRetList([]); }; @@ -2754,13 +6639,20 @@ proto.protocol.TXOutput.prototype.setPubkeyhash = function(value) { * @extends {jspb.Message} * @constructor */ -proto.protocol.TXInput = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.protocol.TransactionInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.TransactionInfo.repeatedFields_, null); }; -goog.inherits(proto.protocol.TXInput, jspb.Message); +goog.inherits(proto.protocol.TransactionInfo, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.TXInput.displayName = 'proto.protocol.TXInput'; + proto.protocol.TransactionInfo.displayName = 'proto.protocol.TransactionInfo'; } +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.TransactionInfo.repeatedFields_ = [5,8]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -2774,8 +6666,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.TXInput.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.TXInput.toObject(opt_includeInstance, this); +proto.protocol.TransactionInfo.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TransactionInfo.toObject(opt_includeInstance, this); }; @@ -2784,14 +6676,25 @@ proto.protocol.TXInput.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.TXInput} msg The msg instance to transform. + * @param {!proto.protocol.TransactionInfo} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.TXInput.toObject = function(includeInstance, msg) { +proto.protocol.TransactionInfo.toObject = function(includeInstance, msg) { var f, obj = { - rawData: (f = msg.getRawData()) && proto.protocol.TXInput.raw.toObject(includeInstance, f), - signature: msg.getSignature_asB64() + id: msg.getId_asB64(), + fee: jspb.Message.getFieldWithDefault(msg, 2, 0), + blocknumber: jspb.Message.getFieldWithDefault(msg, 3, 0), + blocktimestamp: jspb.Message.getFieldWithDefault(msg, 4, 0), + contractresultList: msg.getContractresultList_asB64(), + contractAddress: msg.getContractAddress_asB64(), + receipt: (f = msg.getReceipt()) && proto.protocol.ResourceReceipt.toObject(includeInstance, f), + logList: jspb.Message.toObjectList(msg.getLogList(), + proto.protocol.TransactionInfo.Log.toObject, includeInstance), + result: jspb.Message.getFieldWithDefault(msg, 9, 0), + resmessage: msg.getResmessage_asB64(), + withdrawAmount: jspb.Message.getFieldWithDefault(msg, 15, 0), + unfreezeAmount: jspb.Message.getFieldWithDefault(msg, 16, 0) }; if (includeInstance) { @@ -2805,23 +6708,23 @@ proto.protocol.TXInput.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.TXInput} + * @return {!proto.protocol.TransactionInfo} */ -proto.protocol.TXInput.deserializeBinary = function(bytes) { +proto.protocol.TransactionInfo.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.TXInput; - return proto.protocol.TXInput.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.TransactionInfo; + return proto.protocol.TransactionInfo.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.TXInput} msg The message object to deserialize into. + * @param {!proto.protocol.TransactionInfo} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.TXInput} + * @return {!proto.protocol.TransactionInfo} */ -proto.protocol.TXInput.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.TransactionInfo.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2829,13 +6732,54 @@ proto.protocol.TXInput.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.protocol.TXInput.raw; - reader.readMessage(value,proto.protocol.TXInput.raw.deserializeBinaryFromReader); - msg.setRawData(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setId(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFee(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setBlocknumber(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setBlocktimestamp(value); + break; + case 5: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addContractresult(value); + break; + case 6: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setContractAddress(value); + break; + case 7: + var value = new proto.protocol.ResourceReceipt; + reader.readMessage(value,proto.protocol.ResourceReceipt.deserializeBinaryFromReader); + msg.setReceipt(value); break; - case 4: + case 8: + var value = new proto.protocol.TransactionInfo.Log; + reader.readMessage(value,proto.protocol.TransactionInfo.Log.deserializeBinaryFromReader); + msg.addLog(value); + break; + case 9: + var value = /** @type {!proto.protocol.TransactionInfo.code} */ (reader.readEnum()); + msg.setResult(value); + break; + case 10: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setSignature(value); + msg.setResmessage(value); + break; + case 15: + var value = /** @type {number} */ (reader.readInt64()); + msg.setWithdrawAmount(value); + break; + case 16: + var value = /** @type {number} */ (reader.readInt64()); + msg.setUnfreezeAmount(value); break; default: reader.skipField(); @@ -2850,9 +6794,9 @@ proto.protocol.TXInput.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.TXInput.prototype.serializeBinary = function() { +proto.protocol.TransactionInfo.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.TXInput.serializeBinaryToWriter(this, writer); + proto.protocol.TransactionInfo.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2860,30 +6804,109 @@ proto.protocol.TXInput.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.TXInput} message + * @param {!proto.protocol.TransactionInfo} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.TXInput.serializeBinaryToWriter = function(message, writer) { +proto.protocol.TransactionInfo.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getRawData(); + f = message.getId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getFee(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getBlocknumber(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getBlocktimestamp(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = message.getContractresultList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 5, + f + ); + } + f = message.getContractAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 6, + f + ); + } + f = message.getReceipt(); if (f != null) { writer.writeMessage( - 1, + 7, f, - proto.protocol.TXInput.raw.serializeBinaryToWriter + proto.protocol.ResourceReceipt.serializeBinaryToWriter ); } - f = message.getSignature_asU8(); + f = message.getLogList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 8, + f, + proto.protocol.TransactionInfo.Log.serializeBinaryToWriter + ); + } + f = message.getResult(); + if (f !== 0.0) { + writer.writeEnum( + 9, + f + ); + } + f = message.getResmessage_asU8(); if (f.length > 0) { writer.writeBytes( - 4, + 10, + f + ); + } + f = message.getWithdrawAmount(); + if (f !== 0) { + writer.writeInt64( + 15, + f + ); + } + f = message.getUnfreezeAmount(); + if (f !== 0) { + writer.writeInt64( + 16, f ); } }; +/** + * @enum {number} + */ +proto.protocol.TransactionInfo.code = { + SUCESS: 0, + FAILED: 1 +}; + /** * Generated by JsPbCodeGenerator. @@ -2895,13 +6918,20 @@ proto.protocol.TXInput.serializeBinaryToWriter = function(message, writer) { * @extends {jspb.Message} * @constructor */ -proto.protocol.TXInput.raw = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.protocol.TransactionInfo.Log = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.TransactionInfo.Log.repeatedFields_, null); }; -goog.inherits(proto.protocol.TXInput.raw, jspb.Message); +goog.inherits(proto.protocol.TransactionInfo.Log, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.TXInput.raw.displayName = 'proto.protocol.TXInput.raw'; + proto.protocol.TransactionInfo.Log.displayName = 'proto.protocol.TransactionInfo.Log'; } +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.TransactionInfo.Log.repeatedFields_ = [2]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -2915,8 +6945,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.TXInput.raw.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.TXInput.raw.toObject(opt_includeInstance, this); +proto.protocol.TransactionInfo.Log.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TransactionInfo.Log.toObject(opt_includeInstance, this); }; @@ -2925,15 +6955,15 @@ proto.protocol.TXInput.raw.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.TXInput.raw} msg The msg instance to transform. + * @param {!proto.protocol.TransactionInfo.Log} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.TXInput.raw.toObject = function(includeInstance, msg) { +proto.protocol.TransactionInfo.Log.toObject = function(includeInstance, msg) { var f, obj = { - txid: msg.getTxid_asB64(), - vout: jspb.Message.getFieldWithDefault(msg, 2, 0), - pubkey: msg.getPubkey_asB64() + address: msg.getAddress_asB64(), + topicsList: msg.getTopicsList_asB64(), + data: msg.getData_asB64() }; if (includeInstance) { @@ -2947,23 +6977,23 @@ proto.protocol.TXInput.raw.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.TXInput.raw} + * @return {!proto.protocol.TransactionInfo.Log} */ -proto.protocol.TXInput.raw.deserializeBinary = function(bytes) { +proto.protocol.TransactionInfo.Log.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.TXInput.raw; - return proto.protocol.TXInput.raw.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.TransactionInfo.Log; + return proto.protocol.TransactionInfo.Log.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.TXInput.raw} msg The message object to deserialize into. + * @param {!proto.protocol.TransactionInfo.Log} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.TXInput.raw} + * @return {!proto.protocol.TransactionInfo.Log} */ -proto.protocol.TXInput.raw.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.TransactionInfo.Log.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2972,15 +7002,15 @@ proto.protocol.TXInput.raw.deserializeBinaryFromReader = function(msg, reader) { switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setTxid(value); + msg.setAddress(value); break; case 2: - var value = /** @type {number} */ (reader.readInt64()); - msg.setVout(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addTopics(value); break; case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setPubkey(value); + msg.setData(value); break; default: reader.skipField(); @@ -2995,9 +7025,9 @@ proto.protocol.TXInput.raw.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.TXInput.raw.prototype.serializeBinary = function() { +proto.protocol.TransactionInfo.Log.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.TXInput.raw.serializeBinaryToWriter(this, writer); + proto.protocol.TransactionInfo.Log.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3005,27 +7035,27 @@ proto.protocol.TXInput.raw.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.TXInput.raw} message + * @param {!proto.protocol.TransactionInfo.Log} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.TXInput.raw.serializeBinaryToWriter = function(message, writer) { +proto.protocol.TransactionInfo.Log.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getTxid_asU8(); + f = message.getAddress_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } - f = message.getVout(); - if (f !== 0) { - writer.writeInt64( + f = message.getTopicsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( 2, f ); } - f = message.getPubkey_asU8(); + f = message.getData_asU8(); if (f.length > 0) { writer.writeBytes( 3, @@ -3036,495 +7066,454 @@ proto.protocol.TXInput.raw.serializeBinaryToWriter = function(message, writer) { /** - * optional bytes txID = 1; + * optional bytes address = 1; * @return {!(string|Uint8Array)} */ -proto.protocol.TXInput.raw.prototype.getTxid = function() { +proto.protocol.TransactionInfo.Log.prototype.getAddress = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional bytes txID = 1; - * This is a type-conversion wrapper around `getTxid()` + * optional bytes address = 1; + * This is a type-conversion wrapper around `getAddress()` * @return {string} */ -proto.protocol.TXInput.raw.prototype.getTxid_asB64 = function() { +proto.protocol.TransactionInfo.Log.prototype.getAddress_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getTxid())); + this.getAddress())); }; /** - * optional bytes txID = 1; + * optional bytes address = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getTxid()` + * This is a type-conversion wrapper around `getAddress()` * @return {!Uint8Array} */ -proto.protocol.TXInput.raw.prototype.getTxid_asU8 = function() { +proto.protocol.TransactionInfo.Log.prototype.getAddress_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getTxid())); + this.getAddress())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.TXInput.raw.prototype.setTxid = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); +proto.protocol.TransactionInfo.Log.prototype.setAddress = function(value) { + jspb.Message.setField(this, 1, value); }; /** - * optional int64 vout = 2; - * @return {number} + * repeated bytes topics = 2; + * @return {!(Array|Array)} */ -proto.protocol.TXInput.raw.prototype.getVout = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.protocol.TransactionInfo.Log.prototype.getTopicsList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); }; -/** @param {number} value */ -proto.protocol.TXInput.raw.prototype.setVout = function(value) { - jspb.Message.setProto3IntField(this, 2, value); +/** + * repeated bytes topics = 2; + * This is a type-conversion wrapper around `getTopicsList()` + * @return {!Array.} + */ +proto.protocol.TransactionInfo.Log.prototype.getTopicsList_asB64 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsB64( + this.getTopicsList())); }; /** - * optional bytes pubKey = 3; + * repeated bytes topics = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTopicsList()` + * @return {!Array.} + */ +proto.protocol.TransactionInfo.Log.prototype.getTopicsList_asU8 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsU8( + this.getTopicsList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.protocol.TransactionInfo.Log.prototype.setTopicsList = function(value) { + jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + */ +proto.protocol.TransactionInfo.Log.prototype.addTopics = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +proto.protocol.TransactionInfo.Log.prototype.clearTopicsList = function() { + this.setTopicsList([]); +}; + + +/** + * optional bytes data = 3; * @return {!(string|Uint8Array)} */ -proto.protocol.TXInput.raw.prototype.getPubkey = function() { +proto.protocol.TransactionInfo.Log.prototype.getData = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** - * optional bytes pubKey = 3; - * This is a type-conversion wrapper around `getPubkey()` + * optional bytes data = 3; + * This is a type-conversion wrapper around `getData()` * @return {string} */ -proto.protocol.TXInput.raw.prototype.getPubkey_asB64 = function() { +proto.protocol.TransactionInfo.Log.prototype.getData_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getPubkey())); + this.getData())); }; /** - * optional bytes pubKey = 3; + * optional bytes data = 3; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getPubkey()` + * This is a type-conversion wrapper around `getData()` * @return {!Uint8Array} */ -proto.protocol.TXInput.raw.prototype.getPubkey_asU8 = function() { +proto.protocol.TransactionInfo.Log.prototype.getData_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getPubkey())); + this.getData())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.TXInput.raw.prototype.setPubkey = function(value) { - jspb.Message.setProto3BytesField(this, 3, value); +proto.protocol.TransactionInfo.Log.prototype.setData = function(value) { + jspb.Message.setField(this, 3, value); }; /** - * optional raw raw_data = 1; - * @return {?proto.protocol.TXInput.raw} + * optional bytes id = 1; + * @return {!(string|Uint8Array)} */ -proto.protocol.TXInput.prototype.getRawData = function() { - return /** @type{?proto.protocol.TXInput.raw} */ ( - jspb.Message.getWrapperField(this, proto.protocol.TXInput.raw, 1)); +proto.protocol.TransactionInfo.prototype.getId = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; -/** @param {?proto.protocol.TXInput.raw|undefined} value */ -proto.protocol.TXInput.prototype.setRawData = function(value) { - jspb.Message.setWrapperField(this, 1, value); +/** + * optional bytes id = 1; + * This is a type-conversion wrapper around `getId()` + * @return {string} + */ +proto.protocol.TransactionInfo.prototype.getId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getId())); }; -proto.protocol.TXInput.prototype.clearRawData = function() { - this.setRawData(undefined); +/** + * optional bytes id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getId()` + * @return {!Uint8Array} + */ +proto.protocol.TransactionInfo.prototype.getId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getId())); }; -/** - * Returns whether this field is set. - * @return {!boolean} - */ -proto.protocol.TXInput.prototype.hasRawData = function() { - return jspb.Message.getField(this, 1) != null; +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TransactionInfo.prototype.setId = function(value) { + jspb.Message.setField(this, 1, value); }; /** - * optional bytes signature = 4; - * @return {!(string|Uint8Array)} + * optional int64 fee = 2; + * @return {number} */ -proto.protocol.TXInput.prototype.getSignature = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +proto.protocol.TransactionInfo.prototype.getFee = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.TransactionInfo.prototype.setFee = function(value) { + jspb.Message.setField(this, 2, value); }; /** - * optional bytes signature = 4; - * This is a type-conversion wrapper around `getSignature()` - * @return {string} + * optional int64 blockNumber = 3; + * @return {number} */ -proto.protocol.TXInput.prototype.getSignature_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getSignature())); +proto.protocol.TransactionInfo.prototype.getBlocknumber = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.protocol.TransactionInfo.prototype.setBlocknumber = function(value) { + jspb.Message.setField(this, 3, value); }; /** - * optional bytes signature = 4; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getSignature()` - * @return {!Uint8Array} + * optional int64 blockTimeStamp = 4; + * @return {number} */ -proto.protocol.TXInput.prototype.getSignature_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getSignature())); +proto.protocol.TransactionInfo.prototype.getBlocktimestamp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; -/** @param {!(string|Uint8Array)} value */ -proto.protocol.TXInput.prototype.setSignature = function(value) { - jspb.Message.setProto3BytesField(this, 4, value); +/** @param {number} value */ +proto.protocol.TransactionInfo.prototype.setBlocktimestamp = function(value) { + jspb.Message.setField(this, 4, value); }; - /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * repeated bytes contractResult = 5; + * @return {!(Array|Array)} */ -proto.protocol.TXOutputs = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.TXOutputs.repeatedFields_, null); +proto.protocol.TransactionInfo.prototype.getContractresultList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 5)); }; -goog.inherits(proto.protocol.TXOutputs, jspb.Message); -if (goog.DEBUG && !COMPILED) { - proto.protocol.TXOutputs.displayName = 'proto.protocol.TXOutputs'; -} -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.protocol.TXOutputs.repeatedFields_ = [1]; - -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} + * repeated bytes contractResult = 5; + * This is a type-conversion wrapper around `getContractresultList()` + * @return {!Array.} */ -proto.protocol.TXOutputs.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.TXOutputs.toObject(opt_includeInstance, this); +proto.protocol.TransactionInfo.prototype.getContractresultList_asB64 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsB64( + this.getContractresultList())); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.protocol.TXOutputs} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * repeated bytes contractResult = 5; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getContractresultList()` + * @return {!Array.} */ -proto.protocol.TXOutputs.toObject = function(includeInstance, msg) { - var f, obj = { - outputsList: jspb.Message.toObjectList(msg.getOutputsList(), - proto.protocol.TXOutput.toObject, includeInstance) - }; +proto.protocol.TransactionInfo.prototype.getContractresultList_asU8 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsU8( + this.getContractresultList())); +}; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; + +/** @param {!(Array|Array)} value */ +proto.protocol.TransactionInfo.prototype.setContractresultList = function(value) { + jspb.Message.setField(this, 5, value || []); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.TXOutputs} + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index */ -proto.protocol.TXOutputs.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.TXOutputs; - return proto.protocol.TXOutputs.deserializeBinaryFromReader(msg, reader); +proto.protocol.TransactionInfo.prototype.addContractresult = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 5, value, opt_index); }; -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.protocol.TXOutputs} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.TXOutputs} - */ -proto.protocol.TXOutputs.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.protocol.TXOutput; - reader.readMessage(value,proto.protocol.TXOutput.deserializeBinaryFromReader); - msg.addOutputs(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +proto.protocol.TransactionInfo.prototype.clearContractresultList = function() { + this.setContractresultList([]); }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * optional bytes contract_address = 6; + * @return {!(string|Uint8Array)} */ -proto.protocol.TXOutputs.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.protocol.TXOutputs.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.protocol.TransactionInfo.prototype.getContractAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.protocol.TXOutputs} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * optional bytes contract_address = 6; + * This is a type-conversion wrapper around `getContractAddress()` + * @return {string} */ -proto.protocol.TXOutputs.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getOutputsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.protocol.TXOutput.serializeBinaryToWriter - ); - } +proto.protocol.TransactionInfo.prototype.getContractAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getContractAddress())); }; /** - * repeated TXOutput outputs = 1; - * @return {!Array.} + * optional bytes contract_address = 6; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getContractAddress()` + * @return {!Uint8Array} */ -proto.protocol.TXOutputs.prototype.getOutputsList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.TXOutput, 1)); +proto.protocol.TransactionInfo.prototype.getContractAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getContractAddress())); }; -/** @param {!Array.} value */ -proto.protocol.TXOutputs.prototype.setOutputsList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 1, value); +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TransactionInfo.prototype.setContractAddress = function(value) { + jspb.Message.setField(this, 6, value); }; /** - * @param {!proto.protocol.TXOutput=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.TXOutput} + * optional ResourceReceipt receipt = 7; + * @return {?proto.protocol.ResourceReceipt} */ -proto.protocol.TXOutputs.prototype.addOutputs = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.TXOutput, opt_index); +proto.protocol.TransactionInfo.prototype.getReceipt = function() { + return /** @type{?proto.protocol.ResourceReceipt} */ ( + jspb.Message.getWrapperField(this, proto.protocol.ResourceReceipt, 7)); }; -proto.protocol.TXOutputs.prototype.clearOutputsList = function() { - this.setOutputsList([]); +/** @param {?proto.protocol.ResourceReceipt|undefined} value */ +proto.protocol.TransactionInfo.prototype.setReceipt = function(value) { + jspb.Message.setWrapperField(this, 7, value); }; +proto.protocol.TransactionInfo.prototype.clearReceipt = function() { + this.setReceipt(undefined); +}; + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Returns whether this field is set. + * @return {!boolean} */ -proto.protocol.Transaction = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Transaction.repeatedFields_, null); +proto.protocol.TransactionInfo.prototype.hasReceipt = function() { + return jspb.Message.getField(this, 7) != null; }; -goog.inherits(proto.protocol.Transaction, jspb.Message); -if (goog.DEBUG && !COMPILED) { - proto.protocol.Transaction.displayName = 'proto.protocol.Transaction'; -} -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.protocol.Transaction.repeatedFields_ = [2,5]; - -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} + * repeated Log log = 8; + * @return {!Array.} */ -proto.protocol.Transaction.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.Transaction.toObject(opt_includeInstance, this); +proto.protocol.TransactionInfo.prototype.getLogList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.TransactionInfo.Log, 8)); +}; + + +/** @param {!Array.} value */ +proto.protocol.TransactionInfo.prototype.setLogList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 8, value); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.protocol.Transaction} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {!proto.protocol.TransactionInfo.Log=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.TransactionInfo.Log} */ -proto.protocol.Transaction.toObject = function(includeInstance, msg) { - var f, obj = { - rawData: (f = msg.getRawData()) && proto.protocol.Transaction.raw.toObject(includeInstance, f), - signatureList: msg.getSignatureList_asB64(), - retList: jspb.Message.toObjectList(msg.getRetList(), - proto.protocol.Transaction.Result.toObject, includeInstance) - }; +proto.protocol.TransactionInfo.prototype.addLog = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 8, opt_value, proto.protocol.TransactionInfo.Log, opt_index); +}; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; + +proto.protocol.TransactionInfo.prototype.clearLogList = function() { + this.setLogList([]); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.Transaction} + * optional code result = 9; + * @return {!proto.protocol.TransactionInfo.code} */ -proto.protocol.Transaction.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.Transaction; - return proto.protocol.Transaction.deserializeBinaryFromReader(msg, reader); +proto.protocol.TransactionInfo.prototype.getResult = function() { + return /** @type {!proto.protocol.TransactionInfo.code} */ (jspb.Message.getFieldWithDefault(this, 9, 0)); }; -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.protocol.Transaction} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.Transaction} - */ -proto.protocol.Transaction.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.protocol.Transaction.raw; - reader.readMessage(value,proto.protocol.Transaction.raw.deserializeBinaryFromReader); - msg.setRawData(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addSignature(value); - break; - case 5: - var value = new proto.protocol.Transaction.Result; - reader.readMessage(value,proto.protocol.Transaction.Result.deserializeBinaryFromReader); - msg.addRet(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +/** @param {!proto.protocol.TransactionInfo.code} value */ +proto.protocol.TransactionInfo.prototype.setResult = function(value) { + jspb.Message.setField(this, 9, value); +}; + + +/** + * optional bytes resMessage = 10; + * @return {!(string|Uint8Array)} + */ +proto.protocol.TransactionInfo.prototype.getResmessage = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 10, "")); }; /** - * Serializes the message to binary data (in protobuf wire format). + * optional bytes resMessage = 10; + * This is a type-conversion wrapper around `getResmessage()` + * @return {string} + */ +proto.protocol.TransactionInfo.prototype.getResmessage_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getResmessage())); +}; + + +/** + * optional bytes resMessage = 10; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getResmessage()` * @return {!Uint8Array} */ -proto.protocol.Transaction.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.protocol.Transaction.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.protocol.TransactionInfo.prototype.getResmessage_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getResmessage())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.TransactionInfo.prototype.setResmessage = function(value) { + jspb.Message.setField(this, 10, value); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.protocol.Transaction} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * optional int64 withdraw_amount = 15; + * @return {number} */ -proto.protocol.Transaction.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getRawData(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.protocol.Transaction.raw.serializeBinaryToWriter - ); - } - f = message.getSignatureList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 2, - f - ); - } - f = message.getRetList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 5, - f, - proto.protocol.Transaction.Result.serializeBinaryToWriter - ); - } +proto.protocol.TransactionInfo.prototype.getWithdrawAmount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 15, 0)); +}; + + +/** @param {number} value */ +proto.protocol.TransactionInfo.prototype.setWithdrawAmount = function(value) { + jspb.Message.setField(this, 15, value); +}; + + +/** + * optional int64 unfreeze_amount = 16; + * @return {number} + */ +proto.protocol.TransactionInfo.prototype.getUnfreezeAmount = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 16, 0)); +}; + + +/** @param {number} value */ +proto.protocol.TransactionInfo.prototype.setUnfreezeAmount = function(value) { + jspb.Message.setField(this, 16, value); }; @@ -3539,13 +7528,20 @@ proto.protocol.Transaction.serializeBinaryToWriter = function(message, writer) { * @extends {jspb.Message} * @constructor */ -proto.protocol.Transaction.Contract = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.protocol.Transactions = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Transactions.repeatedFields_, null); }; -goog.inherits(proto.protocol.Transaction.Contract, jspb.Message); +goog.inherits(proto.protocol.Transactions, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.Transaction.Contract.displayName = 'proto.protocol.Transaction.Contract'; + proto.protocol.Transactions.displayName = 'proto.protocol.Transactions'; } +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Transactions.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -3559,8 +7555,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.Transaction.Contract.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.Transaction.Contract.toObject(opt_includeInstance, this); +proto.protocol.Transactions.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Transactions.toObject(opt_includeInstance, this); }; @@ -3569,16 +7565,14 @@ proto.protocol.Transaction.Contract.prototype.toObject = function(opt_includeIns * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.Transaction.Contract} msg The msg instance to transform. + * @param {!proto.protocol.Transactions} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Transaction.Contract.toObject = function(includeInstance, msg) { +proto.protocol.Transactions.toObject = function(includeInstance, msg) { var f, obj = { - type: jspb.Message.getFieldWithDefault(msg, 1, 0), - parameter: (f = msg.getParameter()) && google_protobuf_any_pb.Any.toObject(includeInstance, f), - provider: msg.getProvider_asB64(), - contractname: msg.getContractname_asB64() + transactionsList: jspb.Message.toObjectList(msg.getTransactionsList(), + proto.protocol.Transaction.toObject, includeInstance) }; if (includeInstance) { @@ -3592,23 +7586,23 @@ proto.protocol.Transaction.Contract.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.Transaction.Contract} + * @return {!proto.protocol.Transactions} */ -proto.protocol.Transaction.Contract.deserializeBinary = function(bytes) { +proto.protocol.Transactions.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.Transaction.Contract; - return proto.protocol.Transaction.Contract.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.Transactions; + return proto.protocol.Transactions.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.Transaction.Contract} msg The message object to deserialize into. + * @param {!proto.protocol.Transactions} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.Transaction.Contract} + * @return {!proto.protocol.Transactions} */ -proto.protocol.Transaction.Contract.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.Transactions.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3616,21 +7610,9 @@ proto.protocol.Transaction.Contract.deserializeBinaryFromReader = function(msg, var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {!proto.protocol.Transaction.Contract.ContractType} */ (reader.readEnum()); - msg.setType(value); - break; - case 2: - var value = new google_protobuf_any_pb.Any; - reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader); - msg.setParameter(value); - break; - case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setProvider(value); - break; - case 4: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setContractname(value); + var value = new proto.protocol.Transaction; + reader.readMessage(value,proto.protocol.Transaction.deserializeBinaryFromReader); + msg.addTransactions(value); break; default: reader.skipField(); @@ -3645,9 +7627,9 @@ proto.protocol.Transaction.Contract.deserializeBinaryFromReader = function(msg, * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.Transaction.Contract.prototype.serializeBinary = function() { +proto.protocol.Transactions.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.Transaction.Contract.serializeBinaryToWriter(this, writer); + proto.protocol.Transactions.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3655,187 +7637,261 @@ proto.protocol.Transaction.Contract.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.Transaction.Contract} message + * @param {!proto.protocol.Transactions} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Transaction.Contract.serializeBinaryToWriter = function(message, writer) { +proto.protocol.Transactions.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( + f = message.getTransactionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( 1, - f - ); - } - f = message.getParameter(); - if (f != null) { - writer.writeMessage( - 2, f, - google_protobuf_any_pb.Any.serializeBinaryToWriter - ); - } - f = message.getProvider_asU8(); - if (f.length > 0) { - writer.writeBytes( - 3, - f - ); - } - f = message.getContractname_asU8(); - if (f.length > 0) { - writer.writeBytes( - 4, - f + proto.protocol.Transaction.serializeBinaryToWriter ); } }; /** - * @enum {number} + * repeated Transaction transactions = 1; + * @return {!Array.} */ -proto.protocol.Transaction.Contract.ContractType = { - ACCOUNTCREATECONTRACT: 0, - TRANSFERCONTRACT: 1, - TRANSFERASSETCONTRACT: 2, - VOTEASSETCONTRACT: 3, - VOTEWITNESSCONTRACT: 4, - WITNESSCREATECONTRACT: 5, - ASSETISSUECONTRACT: 6, - DEPLOYCONTRACT: 7, - WITNESSUPDATECONTRACT: 8, - PARTICIPATEASSETISSUECONTRACT: 9, - ACCOUNTUPDATECONTRACT: 10, - FREEZEBALANCECONTRACT: 11, - UNFREEZEBALANCECONTRACT: 12, - WITHDRAWBALANCECONTRACT: 13, - UNFREEZEASSETCONTRACT: 14, - UPDATEASSETCONTRACT: 15, - CUSTOMCONTRACT: 20 +proto.protocol.Transactions.prototype.getTransactionsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction, 1)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Transactions.prototype.setTransactionsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); }; + /** - * optional ContractType type = 1; - * @return {!proto.protocol.Transaction.Contract.ContractType} + * @param {!proto.protocol.Transaction=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Transaction} */ -proto.protocol.Transaction.Contract.prototype.getType = function() { - return /** @type {!proto.protocol.Transaction.Contract.ContractType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.protocol.Transactions.prototype.addTransactions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.Transaction, opt_index); }; -/** @param {!proto.protocol.Transaction.Contract.ContractType} value */ -proto.protocol.Transaction.Contract.prototype.setType = function(value) { - jspb.Message.setProto3EnumField(this, 1, value); +proto.protocol.Transactions.prototype.clearTransactionsList = function() { + this.setTransactionsList([]); }; + /** - * optional google.protobuf.Any parameter = 2; - * @return {?proto.google.protobuf.Any} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.protocol.Transaction.Contract.prototype.getParameter = function() { - return /** @type{?proto.google.protobuf.Any} */ ( - jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 2)); +proto.protocol.TransactionSign = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; +goog.inherits(proto.protocol.TransactionSign, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.TransactionSign.displayName = 'proto.protocol.TransactionSign'; +} -/** @param {?proto.google.protobuf.Any|undefined} value */ -proto.protocol.Transaction.Contract.prototype.setParameter = function(value) { - jspb.Message.setWrapperField(this, 2, value); +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.TransactionSign.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.TransactionSign.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.TransactionSign} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.TransactionSign.toObject = function(includeInstance, msg) { + var f, obj = { + transaction: (f = msg.getTransaction()) && proto.protocol.Transaction.toObject(includeInstance, f), + privatekey: msg.getPrivatekey_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} -proto.protocol.Transaction.Contract.prototype.clearParameter = function() { - this.setParameter(undefined); +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.TransactionSign} + */ +proto.protocol.TransactionSign.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.TransactionSign; + return proto.protocol.TransactionSign.deserializeBinaryFromReader(msg, reader); }; /** - * Returns whether this field is set. - * @return {!boolean} + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.TransactionSign} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.TransactionSign} */ -proto.protocol.Transaction.Contract.prototype.hasParameter = function() { - return jspb.Message.getField(this, 2) != null; +proto.protocol.TransactionSign.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.Transaction; + reader.readMessage(value,proto.protocol.Transaction.deserializeBinaryFromReader); + msg.setTransaction(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPrivatekey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * optional bytes provider = 3; - * @return {!(string|Uint8Array)} + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.protocol.Transaction.Contract.prototype.getProvider = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.protocol.TransactionSign.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.TransactionSign.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * optional bytes provider = 3; - * This is a type-conversion wrapper around `getProvider()` - * @return {string} + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.TransactionSign} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Transaction.Contract.prototype.getProvider_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getProvider())); +proto.protocol.TransactionSign.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTransaction(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.Transaction.serializeBinaryToWriter + ); + } + f = message.getPrivatekey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } }; /** - * optional bytes provider = 3; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getProvider()` - * @return {!Uint8Array} + * optional Transaction transaction = 1; + * @return {?proto.protocol.Transaction} */ -proto.protocol.Transaction.Contract.prototype.getProvider_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getProvider())); +proto.protocol.TransactionSign.prototype.getTransaction = function() { + return /** @type{?proto.protocol.Transaction} */ ( + jspb.Message.getWrapperField(this, proto.protocol.Transaction, 1)); }; -/** @param {!(string|Uint8Array)} value */ -proto.protocol.Transaction.Contract.prototype.setProvider = function(value) { - jspb.Message.setProto3BytesField(this, 3, value); +/** @param {?proto.protocol.Transaction|undefined} value */ +proto.protocol.TransactionSign.prototype.setTransaction = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.TransactionSign.prototype.clearTransaction = function() { + this.setTransaction(undefined); }; /** - * optional bytes ContractName = 4; + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.TransactionSign.prototype.hasTransaction = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes privateKey = 2; * @return {!(string|Uint8Array)} */ -proto.protocol.Transaction.Contract.prototype.getContractname = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +proto.protocol.TransactionSign.prototype.getPrivatekey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * optional bytes ContractName = 4; - * This is a type-conversion wrapper around `getContractname()` + * optional bytes privateKey = 2; + * This is a type-conversion wrapper around `getPrivatekey()` * @return {string} */ -proto.protocol.Transaction.Contract.prototype.getContractname_asB64 = function() { +proto.protocol.TransactionSign.prototype.getPrivatekey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getContractname())); + this.getPrivatekey())); }; /** - * optional bytes ContractName = 4; + * optional bytes privateKey = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getContractname()` + * This is a type-conversion wrapper around `getPrivatekey()` * @return {!Uint8Array} */ -proto.protocol.Transaction.Contract.prototype.getContractname_asU8 = function() { +proto.protocol.TransactionSign.prototype.getPrivatekey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getContractname())); + this.getPrivatekey())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.Transaction.Contract.prototype.setContractname = function(value) { - jspb.Message.setProto3BytesField(this, 4, value); +proto.protocol.TransactionSign.prototype.setPrivatekey = function(value) { + jspb.Message.setField(this, 2, value); }; @@ -3850,12 +7906,12 @@ proto.protocol.Transaction.Contract.prototype.setContractname = function(value) * @extends {jspb.Message} * @constructor */ -proto.protocol.Transaction.Result = function(opt_data) { +proto.protocol.BlockHeader = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.Transaction.Result, jspb.Message); +goog.inherits(proto.protocol.BlockHeader, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.Transaction.Result.displayName = 'proto.protocol.Transaction.Result'; + proto.protocol.BlockHeader.displayName = 'proto.protocol.BlockHeader'; } @@ -3870,8 +7926,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.Transaction.Result.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.Transaction.Result.toObject(opt_includeInstance, this); +proto.protocol.BlockHeader.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.BlockHeader.toObject(opt_includeInstance, this); }; @@ -3880,14 +7936,14 @@ proto.protocol.Transaction.Result.prototype.toObject = function(opt_includeInsta * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.Transaction.Result} msg The msg instance to transform. + * @param {!proto.protocol.BlockHeader} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Transaction.Result.toObject = function(includeInstance, msg) { +proto.protocol.BlockHeader.toObject = function(includeInstance, msg) { var f, obj = { - fee: jspb.Message.getFieldWithDefault(msg, 1, 0), - ret: jspb.Message.getFieldWithDefault(msg, 2, 0) + rawData: (f = msg.getRawData()) && proto.protocol.BlockHeader.raw.toObject(includeInstance, f), + witnessSignature: msg.getWitnessSignature_asB64() }; if (includeInstance) { @@ -3901,23 +7957,23 @@ proto.protocol.Transaction.Result.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.Transaction.Result} + * @return {!proto.protocol.BlockHeader} */ -proto.protocol.Transaction.Result.deserializeBinary = function(bytes) { +proto.protocol.BlockHeader.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.Transaction.Result; - return proto.protocol.Transaction.Result.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.BlockHeader; + return proto.protocol.BlockHeader.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.Transaction.Result} msg The message object to deserialize into. + * @param {!proto.protocol.BlockHeader} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.Transaction.Result} + * @return {!proto.protocol.BlockHeader} */ -proto.protocol.Transaction.Result.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.BlockHeader.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3925,12 +7981,13 @@ proto.protocol.Transaction.Result.deserializeBinaryFromReader = function(msg, re var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {number} */ (reader.readInt64()); - msg.setFee(value); + var value = new proto.protocol.BlockHeader.raw; + reader.readMessage(value,proto.protocol.BlockHeader.raw.deserializeBinaryFromReader); + msg.setRawData(value); break; case 2: - var value = /** @type {!proto.protocol.Transaction.Result.code} */ (reader.readEnum()); - msg.setRet(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setWitnessSignature(value); break; default: reader.skipField(); @@ -3945,9 +8002,9 @@ proto.protocol.Transaction.Result.deserializeBinaryFromReader = function(msg, re * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.Transaction.Result.prototype.serializeBinary = function() { +proto.protocol.BlockHeader.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.Transaction.Result.serializeBinaryToWriter(this, writer); + proto.protocol.BlockHeader.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3955,22 +8012,23 @@ proto.protocol.Transaction.Result.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.Transaction.Result} message + * @param {!proto.protocol.BlockHeader} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Transaction.Result.serializeBinaryToWriter = function(message, writer) { +proto.protocol.BlockHeader.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getFee(); - if (f !== 0) { - writer.writeInt64( + f = message.getRawData(); + if (f != null) { + writer.writeMessage( 1, - f + f, + proto.protocol.BlockHeader.raw.serializeBinaryToWriter ); } - f = message.getRet(); - if (f !== 0.0) { - writer.writeEnum( + f = message.getWitnessSignature_asU8(); + if (f.length > 0) { + writer.writeBytes( 2, f ); @@ -3978,44 +8036,6 @@ proto.protocol.Transaction.Result.serializeBinaryToWriter = function(message, wr }; -/** - * @enum {number} - */ -proto.protocol.Transaction.Result.code = { - SUCESS: 0, - FAILED: 1 -}; - -/** - * optional int64 fee = 1; - * @return {number} - */ -proto.protocol.Transaction.Result.prototype.getFee = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.protocol.Transaction.Result.prototype.setFee = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional code ret = 2; - * @return {!proto.protocol.Transaction.Result.code} - */ -proto.protocol.Transaction.Result.prototype.getRet = function() { - return /** @type {!proto.protocol.Transaction.Result.code} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** @param {!proto.protocol.Transaction.Result.code} value */ -proto.protocol.Transaction.Result.prototype.setRet = function(value) { - jspb.Message.setProto3EnumField(this, 2, value); -}; - - /** * Generated by JsPbCodeGenerator. @@ -4027,20 +8047,13 @@ proto.protocol.Transaction.Result.prototype.setRet = function(value) { * @extends {jspb.Message} * @constructor */ -proto.protocol.Transaction.raw = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Transaction.raw.repeatedFields_, null); +proto.protocol.BlockHeader.raw = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.Transaction.raw, jspb.Message); +goog.inherits(proto.protocol.BlockHeader.raw, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.Transaction.raw.displayName = 'proto.protocol.Transaction.raw'; + proto.protocol.BlockHeader.raw.displayName = 'proto.protocol.BlockHeader.raw'; } -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.protocol.Transaction.raw.repeatedFields_ = [9,11]; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -4054,8 +8067,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.Transaction.raw.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.Transaction.raw.toObject(opt_includeInstance, this); +proto.protocol.BlockHeader.raw.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.BlockHeader.raw.toObject(opt_includeInstance, this); }; @@ -4064,23 +8077,19 @@ proto.protocol.Transaction.raw.prototype.toObject = function(opt_includeInstance * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.Transaction.raw} msg The msg instance to transform. + * @param {!proto.protocol.BlockHeader.raw} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Transaction.raw.toObject = function(includeInstance, msg) { +proto.protocol.BlockHeader.raw.toObject = function(includeInstance, msg) { var f, obj = { - refBlockBytes: msg.getRefBlockBytes_asB64(), - refBlockNum: jspb.Message.getFieldWithDefault(msg, 3, 0), - refBlockHash: msg.getRefBlockHash_asB64(), - expiration: jspb.Message.getFieldWithDefault(msg, 8, 0), - authsList: jspb.Message.toObjectList(msg.getAuthsList(), - proto.protocol.acuthrity.toObject, includeInstance), - data: msg.getData_asB64(), - contractList: jspb.Message.toObjectList(msg.getContractList(), - proto.protocol.Transaction.Contract.toObject, includeInstance), - scripts: msg.getScripts_asB64(), - timestamp: jspb.Message.getFieldWithDefault(msg, 14, 0) + timestamp: jspb.Message.getFieldWithDefault(msg, 1, 0), + txtrieroot: msg.getTxtrieroot_asB64(), + parenthash: msg.getParenthash_asB64(), + number: jspb.Message.getFieldWithDefault(msg, 7, 0), + witnessId: jspb.Message.getFieldWithDefault(msg, 8, 0), + witnessAddress: msg.getWitnessAddress_asB64(), + version: jspb.Message.getFieldWithDefault(msg, 10, 0) }; if (includeInstance) { @@ -4094,23 +8103,23 @@ proto.protocol.Transaction.raw.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.Transaction.raw} + * @return {!proto.protocol.BlockHeader.raw} */ -proto.protocol.Transaction.raw.deserializeBinary = function(bytes) { +proto.protocol.BlockHeader.raw.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.Transaction.raw; - return proto.protocol.Transaction.raw.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.BlockHeader.raw; + return proto.protocol.BlockHeader.raw.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.Transaction.raw} msg The message object to deserialize into. + * @param {!proto.protocol.BlockHeader.raw} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.Transaction.raw} + * @return {!proto.protocol.BlockHeader.raw} */ -proto.protocol.Transaction.raw.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.BlockHeader.raw.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -4118,42 +8127,32 @@ proto.protocol.Transaction.raw.deserializeBinaryFromReader = function(msg, reade var field = reader.getFieldNumber(); switch (field) { case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTimestamp(value); + break; + case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setRefBlockBytes(value); + msg.setTxtrieroot(value); break; case 3: - var value = /** @type {number} */ (reader.readInt64()); - msg.setRefBlockNum(value); - break; - case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setRefBlockHash(value); + msg.setParenthash(value); + break; + case 7: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNumber(value); break; case 8: var value = /** @type {number} */ (reader.readInt64()); - msg.setExpiration(value); + msg.setWitnessId(value); break; case 9: - var value = new proto.protocol.acuthrity; - reader.readMessage(value,proto.protocol.acuthrity.deserializeBinaryFromReader); - msg.addAuths(value); - break; - case 10: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setData(value); - break; - case 11: - var value = new proto.protocol.Transaction.Contract; - reader.readMessage(value,proto.protocol.Transaction.Contract.deserializeBinaryFromReader); - msg.addContract(value); - break; - case 12: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setScripts(value); + msg.setWitnessAddress(value); break; - case 14: - var value = /** @type {number} */ (reader.readInt64()); - msg.setTimestamp(value); + case 10: + var value = /** @type {number} */ (reader.readInt32()); + msg.setVersion(value); break; default: reader.skipField(); @@ -4168,9 +8167,9 @@ proto.protocol.Transaction.raw.deserializeBinaryFromReader = function(msg, reade * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.Transaction.raw.prototype.serializeBinary = function() { +proto.protocol.BlockHeader.raw.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.Transaction.raw.serializeBinaryToWriter(this, writer); + proto.protocol.BlockHeader.raw.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -4178,74 +8177,58 @@ proto.protocol.Transaction.raw.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.Transaction.raw} message + * @param {!proto.protocol.BlockHeader.raw} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Transaction.raw.serializeBinaryToWriter = function(message, writer) { +proto.protocol.BlockHeader.raw.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getRefBlockBytes_asU8(); - if (f.length > 0) { - writer.writeBytes( + f = message.getTimestamp(); + if (f !== 0) { + writer.writeInt64( 1, f ); } - f = message.getRefBlockNum(); - if (f !== 0) { - writer.writeInt64( - 3, + f = message.getTxtrieroot_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, f ); } - f = message.getRefBlockHash_asU8(); + f = message.getParenthash_asU8(); if (f.length > 0) { writer.writeBytes( - 4, + 3, f ); } - f = message.getExpiration(); + f = message.getNumber(); if (f !== 0) { writer.writeInt64( - 8, + 7, f ); } - f = message.getAuthsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 9, - f, - proto.protocol.acuthrity.serializeBinaryToWriter - ); - } - f = message.getData_asU8(); - if (f.length > 0) { - writer.writeBytes( - 10, + f = message.getWitnessId(); + if (f !== 0) { + writer.writeInt64( + 8, f ); } - f = message.getContractList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 11, - f, - proto.protocol.Transaction.Contract.serializeBinaryToWriter - ); - } - f = message.getScripts_asU8(); + f = message.getWitnessAddress_asU8(); if (f.length > 0) { writer.writeBytes( - 12, + 9, f ); } - f = message.getTimestamp(); + f = message.getVersion(); if (f !== 0) { - writer.writeInt64( - 14, + writer.writeInt32( + 10, f ); } @@ -4253,286 +8236,451 @@ proto.protocol.Transaction.raw.serializeBinaryToWriter = function(message, write /** - * optional bytes ref_block_bytes = 1; + * optional int64 timestamp = 1; + * @return {number} + */ +proto.protocol.BlockHeader.raw.prototype.getTimestamp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.BlockHeader.raw.prototype.setTimestamp = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional bytes txTrieRoot = 2; * @return {!(string|Uint8Array)} */ -proto.protocol.Transaction.raw.prototype.getRefBlockBytes = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.protocol.BlockHeader.raw.prototype.getTxtrieroot = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * optional bytes ref_block_bytes = 1; - * This is a type-conversion wrapper around `getRefBlockBytes()` + * optional bytes txTrieRoot = 2; + * This is a type-conversion wrapper around `getTxtrieroot()` * @return {string} */ -proto.protocol.Transaction.raw.prototype.getRefBlockBytes_asB64 = function() { +proto.protocol.BlockHeader.raw.prototype.getTxtrieroot_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getRefBlockBytes())); + this.getTxtrieroot())); }; /** - * optional bytes ref_block_bytes = 1; + * optional bytes txTrieRoot = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getRefBlockBytes()` + * This is a type-conversion wrapper around `getTxtrieroot()` * @return {!Uint8Array} */ -proto.protocol.Transaction.raw.prototype.getRefBlockBytes_asU8 = function() { +proto.protocol.BlockHeader.raw.prototype.getTxtrieroot_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getRefBlockBytes())); + this.getTxtrieroot())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.Transaction.raw.prototype.setRefBlockBytes = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); +proto.protocol.BlockHeader.raw.prototype.setTxtrieroot = function(value) { + jspb.Message.setField(this, 2, value); }; /** - * optional int64 ref_block_num = 3; + * optional bytes parentHash = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.BlockHeader.raw.prototype.getParenthash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes parentHash = 3; + * This is a type-conversion wrapper around `getParenthash()` + * @return {string} + */ +proto.protocol.BlockHeader.raw.prototype.getParenthash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getParenthash())); +}; + + +/** + * optional bytes parentHash = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getParenthash()` + * @return {!Uint8Array} + */ +proto.protocol.BlockHeader.raw.prototype.getParenthash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getParenthash())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.BlockHeader.raw.prototype.setParenthash = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * optional int64 number = 7; * @return {number} */ -proto.protocol.Transaction.raw.prototype.getRefBlockNum = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +proto.protocol.BlockHeader.raw.prototype.getNumber = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); }; /** @param {number} value */ -proto.protocol.Transaction.raw.prototype.setRefBlockNum = function(value) { - jspb.Message.setProto3IntField(this, 3, value); +proto.protocol.BlockHeader.raw.prototype.setNumber = function(value) { + jspb.Message.setField(this, 7, value); }; /** - * optional bytes ref_block_hash = 4; + * optional int64 witness_id = 8; + * @return {number} + */ +proto.protocol.BlockHeader.raw.prototype.getWitnessId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +}; + + +/** @param {number} value */ +proto.protocol.BlockHeader.raw.prototype.setWitnessId = function(value) { + jspb.Message.setField(this, 8, value); +}; + + +/** + * optional bytes witness_address = 9; * @return {!(string|Uint8Array)} */ -proto.protocol.Transaction.raw.prototype.getRefBlockHash = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +proto.protocol.BlockHeader.raw.prototype.getWitnessAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 9, "")); }; /** - * optional bytes ref_block_hash = 4; - * This is a type-conversion wrapper around `getRefBlockHash()` + * optional bytes witness_address = 9; + * This is a type-conversion wrapper around `getWitnessAddress()` * @return {string} */ -proto.protocol.Transaction.raw.prototype.getRefBlockHash_asB64 = function() { +proto.protocol.BlockHeader.raw.prototype.getWitnessAddress_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getRefBlockHash())); + this.getWitnessAddress())); }; /** - * optional bytes ref_block_hash = 4; + * optional bytes witness_address = 9; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getRefBlockHash()` + * This is a type-conversion wrapper around `getWitnessAddress()` * @return {!Uint8Array} */ -proto.protocol.Transaction.raw.prototype.getRefBlockHash_asU8 = function() { +proto.protocol.BlockHeader.raw.prototype.getWitnessAddress_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getRefBlockHash())); + this.getWitnessAddress())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.Transaction.raw.prototype.setRefBlockHash = function(value) { - jspb.Message.setProto3BytesField(this, 4, value); +proto.protocol.BlockHeader.raw.prototype.setWitnessAddress = function(value) { + jspb.Message.setField(this, 9, value); }; /** - * optional int64 expiration = 8; + * optional int32 version = 10; * @return {number} */ -proto.protocol.Transaction.raw.prototype.getExpiration = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +proto.protocol.BlockHeader.raw.prototype.getVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); }; /** @param {number} value */ -proto.protocol.Transaction.raw.prototype.setExpiration = function(value) { - jspb.Message.setProto3IntField(this, 8, value); +proto.protocol.BlockHeader.raw.prototype.setVersion = function(value) { + jspb.Message.setField(this, 10, value); }; /** - * repeated acuthrity auths = 9; - * @return {!Array.} + * optional raw raw_data = 1; + * @return {?proto.protocol.BlockHeader.raw} */ -proto.protocol.Transaction.raw.prototype.getAuthsList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.acuthrity, 9)); +proto.protocol.BlockHeader.prototype.getRawData = function() { + return /** @type{?proto.protocol.BlockHeader.raw} */ ( + jspb.Message.getWrapperField(this, proto.protocol.BlockHeader.raw, 1)); }; -/** @param {!Array.} value */ -proto.protocol.Transaction.raw.prototype.setAuthsList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 9, value); +/** @param {?proto.protocol.BlockHeader.raw|undefined} value */ +proto.protocol.BlockHeader.prototype.setRawData = function(value) { + jspb.Message.setWrapperField(this, 1, value); }; -/** - * @param {!proto.protocol.acuthrity=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.acuthrity} - */ -proto.protocol.Transaction.raw.prototype.addAuths = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, proto.protocol.acuthrity, opt_index); +proto.protocol.BlockHeader.prototype.clearRawData = function() { + this.setRawData(undefined); }; -proto.protocol.Transaction.raw.prototype.clearAuthsList = function() { - this.setAuthsList([]); +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.BlockHeader.prototype.hasRawData = function() { + return jspb.Message.getField(this, 1) != null; }; /** - * optional bytes data = 10; + * optional bytes witness_signature = 2; * @return {!(string|Uint8Array)} */ -proto.protocol.Transaction.raw.prototype.getData = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 10, "")); +proto.protocol.BlockHeader.prototype.getWitnessSignature = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * optional bytes data = 10; - * This is a type-conversion wrapper around `getData()` + * optional bytes witness_signature = 2; + * This is a type-conversion wrapper around `getWitnessSignature()` * @return {string} */ -proto.protocol.Transaction.raw.prototype.getData_asB64 = function() { +proto.protocol.BlockHeader.prototype.getWitnessSignature_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getData())); + this.getWitnessSignature())); }; /** - * optional bytes data = 10; + * optional bytes witness_signature = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getData()` + * This is a type-conversion wrapper around `getWitnessSignature()` * @return {!Uint8Array} */ -proto.protocol.Transaction.raw.prototype.getData_asU8 = function() { +proto.protocol.BlockHeader.prototype.getWitnessSignature_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); + this.getWitnessSignature())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.Transaction.raw.prototype.setData = function(value) { - jspb.Message.setProto3BytesField(this, 10, value); +proto.protocol.BlockHeader.prototype.setWitnessSignature = function(value) { + jspb.Message.setField(this, 2, value); }; + /** - * repeated Contract contract = 11; - * @return {!Array.} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.protocol.Transaction.raw.prototype.getContractList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction.Contract, 11)); +proto.protocol.Block = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Block.repeatedFields_, null); }; +goog.inherits(proto.protocol.Block, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Block.displayName = 'proto.protocol.Block'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Block.repeatedFields_ = [1]; -/** @param {!Array.} value */ -proto.protocol.Transaction.raw.prototype.setContractList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 11, value); + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Block.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Block.toObject(opt_includeInstance, this); }; /** - * @param {!proto.protocol.Transaction.Contract=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.Transaction.Contract} + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Block} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Transaction.raw.prototype.addContract = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 11, opt_value, proto.protocol.Transaction.Contract, opt_index); +proto.protocol.Block.toObject = function(includeInstance, msg) { + var f, obj = { + transactionsList: jspb.Message.toObjectList(msg.getTransactionsList(), + proto.protocol.Transaction.toObject, includeInstance), + blockHeader: (f = msg.getBlockHeader()) && proto.protocol.BlockHeader.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} -proto.protocol.Transaction.raw.prototype.clearContractList = function() { - this.setContractList([]); +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Block} + */ +proto.protocol.Block.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Block; + return proto.protocol.Block.deserializeBinaryFromReader(msg, reader); }; /** - * optional bytes scripts = 12; - * @return {!(string|Uint8Array)} + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Block} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Block} */ -proto.protocol.Transaction.raw.prototype.getScripts = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 12, "")); +proto.protocol.Block.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.Transaction; + reader.readMessage(value,proto.protocol.Transaction.deserializeBinaryFromReader); + msg.addTransactions(value); + break; + case 2: + var value = new proto.protocol.BlockHeader; + reader.readMessage(value,proto.protocol.BlockHeader.deserializeBinaryFromReader); + msg.setBlockHeader(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * optional bytes scripts = 12; - * This is a type-conversion wrapper around `getScripts()` - * @return {string} + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.protocol.Transaction.raw.prototype.getScripts_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getScripts())); +proto.protocol.Block.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Block.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * optional bytes scripts = 12; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getScripts()` - * @return {!Uint8Array} + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Block} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Transaction.raw.prototype.getScripts_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getScripts())); +proto.protocol.Block.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTransactionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.protocol.Transaction.serializeBinaryToWriter + ); + } + f = message.getBlockHeader(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.protocol.BlockHeader.serializeBinaryToWriter + ); + } }; -/** @param {!(string|Uint8Array)} value */ -proto.protocol.Transaction.raw.prototype.setScripts = function(value) { - jspb.Message.setProto3BytesField(this, 12, value); +/** + * repeated Transaction transactions = 1; + * @return {!Array.} + */ +proto.protocol.Block.prototype.getTransactionsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction, 1)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Block.prototype.setTransactionsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** - * optional int64 timestamp = 14; - * @return {number} + * @param {!proto.protocol.Transaction=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Transaction} */ -proto.protocol.Transaction.raw.prototype.getTimestamp = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 14, 0)); +proto.protocol.Block.prototype.addTransactions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.Transaction, opt_index); }; -/** @param {number} value */ -proto.protocol.Transaction.raw.prototype.setTimestamp = function(value) { - jspb.Message.setProto3IntField(this, 14, value); +proto.protocol.Block.prototype.clearTransactionsList = function() { + this.setTransactionsList([]); }; /** - * optional raw raw_data = 1; - * @return {?proto.protocol.Transaction.raw} + * optional BlockHeader block_header = 2; + * @return {?proto.protocol.BlockHeader} */ -proto.protocol.Transaction.prototype.getRawData = function() { - return /** @type{?proto.protocol.Transaction.raw} */ ( - jspb.Message.getWrapperField(this, proto.protocol.Transaction.raw, 1)); +proto.protocol.Block.prototype.getBlockHeader = function() { + return /** @type{?proto.protocol.BlockHeader} */ ( + jspb.Message.getWrapperField(this, proto.protocol.BlockHeader, 2)); }; -/** @param {?proto.protocol.Transaction.raw|undefined} value */ -proto.protocol.Transaction.prototype.setRawData = function(value) { - jspb.Message.setWrapperField(this, 1, value); +/** @param {?proto.protocol.BlockHeader|undefined} value */ +proto.protocol.Block.prototype.setBlockHeader = function(value) { + jspb.Message.setWrapperField(this, 2, value); }; -proto.protocol.Transaction.prototype.clearRawData = function() { - this.setRawData(undefined); +proto.protocol.Block.prototype.clearBlockHeader = function() { + this.setBlockHeader(undefined); }; @@ -4540,92 +8688,157 @@ proto.protocol.Transaction.prototype.clearRawData = function() { * Returns whether this field is set. * @return {!boolean} */ -proto.protocol.Transaction.prototype.hasRawData = function() { - return jspb.Message.getField(this, 1) != null; +proto.protocol.Block.prototype.hasBlockHeader = function() { + return jspb.Message.getField(this, 2) != null; }; + /** - * repeated bytes signature = 2; - * @return {!(Array|Array)} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.protocol.Transaction.prototype.getSignatureList = function() { - return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); +proto.protocol.ChainInventory = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.ChainInventory.repeatedFields_, null); }; - - +goog.inherits(proto.protocol.ChainInventory, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.ChainInventory.displayName = 'proto.protocol.ChainInventory'; +} /** - * repeated bytes signature = 2; - * This is a type-conversion wrapper around `getSignatureList()` - * @return {!Array.} + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.protocol.Transaction.prototype.getSignatureList_asB64 = function() { - return /** @type {!Array.} */ (jspb.Message.bytesListAsB64( - this.getSignatureList())); -}; +proto.protocol.ChainInventory.repeatedFields_ = [1]; + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * repeated bytes signature = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getSignatureList()` - * @return {!Array.} + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} */ -proto.protocol.Transaction.prototype.getSignatureList_asU8 = function() { - return /** @type {!Array.} */ (jspb.Message.bytesListAsU8( - this.getSignatureList())); -}; - - -/** @param {!(Array|Array)} value */ -proto.protocol.Transaction.prototype.setSignatureList = function(value) { - jspb.Message.setField(this, 2, value || []); +proto.protocol.ChainInventory.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ChainInventory.toObject(opt_includeInstance, this); }; /** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.ChainInventory} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Transaction.prototype.addSignature = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 2, value, opt_index); -}; - +proto.protocol.ChainInventory.toObject = function(includeInstance, msg) { + var f, obj = { + idsList: jspb.Message.toObjectList(msg.getIdsList(), + proto.protocol.ChainInventory.BlockId.toObject, includeInstance), + remainNum: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; -proto.protocol.Transaction.prototype.clearSignatureList = function() { - this.setSignatureList([]); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * repeated Result ret = 5; - * @return {!Array.} + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.ChainInventory} */ -proto.protocol.Transaction.prototype.getRetList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction.Result, 5)); +proto.protocol.ChainInventory.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.ChainInventory; + return proto.protocol.ChainInventory.deserializeBinaryFromReader(msg, reader); }; -/** @param {!Array.} value */ -proto.protocol.Transaction.prototype.setRetList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 5, value); +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.ChainInventory} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.ChainInventory} + */ +proto.protocol.ChainInventory.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.ChainInventory.BlockId; + reader.readMessage(value,proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader); + msg.addIds(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setRemainNum(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * @param {!proto.protocol.Transaction.Result=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.Transaction.Result} + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.protocol.Transaction.prototype.addRet = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.protocol.Transaction.Result, opt_index); +proto.protocol.ChainInventory.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ChainInventory.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; -proto.protocol.Transaction.prototype.clearRetList = function() { - this.setRetList([]); +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ChainInventory} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ChainInventory.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getIdsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.protocol.ChainInventory.BlockId.serializeBinaryToWriter + ); + } + f = message.getRemainNum(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } }; @@ -4640,20 +8853,13 @@ proto.protocol.Transaction.prototype.clearRetList = function() { * @extends {jspb.Message} * @constructor */ -proto.protocol.Transactions = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Transactions.repeatedFields_, null); +proto.protocol.ChainInventory.BlockId = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.Transactions, jspb.Message); +goog.inherits(proto.protocol.ChainInventory.BlockId, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.Transactions.displayName = 'proto.protocol.Transactions'; + proto.protocol.ChainInventory.BlockId.displayName = 'proto.protocol.ChainInventory.BlockId'; } -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.protocol.Transactions.repeatedFields_ = [1]; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -4667,8 +8873,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.Transactions.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.Transactions.toObject(opt_includeInstance, this); +proto.protocol.ChainInventory.BlockId.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.ChainInventory.BlockId.toObject(opt_includeInstance, this); }; @@ -4677,14 +8883,14 @@ proto.protocol.Transactions.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.Transactions} msg The msg instance to transform. + * @param {!proto.protocol.ChainInventory.BlockId} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Transactions.toObject = function(includeInstance, msg) { +proto.protocol.ChainInventory.BlockId.toObject = function(includeInstance, msg) { var f, obj = { - transactionsList: jspb.Message.toObjectList(msg.getTransactionsList(), - proto.protocol.Transaction.toObject, includeInstance) + hash: msg.getHash_asB64(), + number: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { @@ -4698,23 +8904,23 @@ proto.protocol.Transactions.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.Transactions} + * @return {!proto.protocol.ChainInventory.BlockId} */ -proto.protocol.Transactions.deserializeBinary = function(bytes) { +proto.protocol.ChainInventory.BlockId.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.Transactions; - return proto.protocol.Transactions.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.ChainInventory.BlockId; + return proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.Transactions} msg The message object to deserialize into. + * @param {!proto.protocol.ChainInventory.BlockId} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.Transactions} + * @return {!proto.protocol.ChainInventory.BlockId} */ -proto.protocol.Transactions.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -4722,9 +8928,12 @@ proto.protocol.Transactions.deserializeBinaryFromReader = function(msg, reader) var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.protocol.Transaction; - reader.readMessage(value,proto.protocol.Transaction.deserializeBinaryFromReader); - msg.addTransactions(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setHash(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNumber(value); break; default: reader.skipField(); @@ -4736,64 +8945,139 @@ proto.protocol.Transactions.deserializeBinaryFromReader = function(msg, reader) /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.ChainInventory.BlockId.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.ChainInventory.BlockId.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.ChainInventory.BlockId} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.ChainInventory.BlockId.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getNumber(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional bytes hash = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.ChainInventory.BlockId.prototype.getHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes hash = 1; + * This is a type-conversion wrapper around `getHash()` + * @return {string} + */ +proto.protocol.ChainInventory.BlockId.prototype.getHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getHash())); +}; + + +/** + * optional bytes hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getHash()` + * @return {!Uint8Array} + */ +proto.protocol.ChainInventory.BlockId.prototype.getHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getHash())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.ChainInventory.BlockId.prototype.setHash = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 number = 2; + * @return {number} */ -proto.protocol.Transactions.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.protocol.Transactions.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.protocol.ChainInventory.BlockId.prototype.getNumber = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.protocol.Transactions} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.protocol.Transactions.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTransactionsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.protocol.Transaction.serializeBinaryToWriter - ); - } +/** @param {number} value */ +proto.protocol.ChainInventory.BlockId.prototype.setNumber = function(value) { + jspb.Message.setField(this, 2, value); }; /** - * repeated Transaction transactions = 1; - * @return {!Array.} + * repeated BlockId ids = 1; + * @return {!Array.} */ -proto.protocol.Transactions.prototype.getTransactionsList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction, 1)); +proto.protocol.ChainInventory.prototype.getIdsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.ChainInventory.BlockId, 1)); }; -/** @param {!Array.} value */ -proto.protocol.Transactions.prototype.setTransactionsList = function(value) { +/** @param {!Array.} value */ +proto.protocol.ChainInventory.prototype.setIdsList = function(value) { jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** - * @param {!proto.protocol.Transaction=} opt_value + * @param {!proto.protocol.ChainInventory.BlockId=} opt_value * @param {number=} opt_index - * @return {!proto.protocol.Transaction} + * @return {!proto.protocol.ChainInventory.BlockId} */ -proto.protocol.Transactions.prototype.addTransactions = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.Transaction, opt_index); +proto.protocol.ChainInventory.prototype.addIds = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.ChainInventory.BlockId, opt_index); }; -proto.protocol.Transactions.prototype.clearTransactionsList = function() { - this.setTransactionsList([]); +proto.protocol.ChainInventory.prototype.clearIdsList = function() { + this.setIdsList([]); +}; + + +/** + * optional int64 remain_num = 2; + * @return {number} + */ +proto.protocol.ChainInventory.prototype.getRemainNum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.ChainInventory.prototype.setRemainNum = function(value) { + jspb.Message.setField(this, 2, value); }; @@ -4808,13 +9092,20 @@ proto.protocol.Transactions.prototype.clearTransactionsList = function() { * @extends {jspb.Message} * @constructor */ -proto.protocol.BlockHeader = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.protocol.BlockInventory = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.BlockInventory.repeatedFields_, null); }; -goog.inherits(proto.protocol.BlockHeader, jspb.Message); +goog.inherits(proto.protocol.BlockInventory, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.BlockHeader.displayName = 'proto.protocol.BlockHeader'; + proto.protocol.BlockInventory.displayName = 'proto.protocol.BlockInventory'; } +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.BlockInventory.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -4828,8 +9119,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.BlockHeader.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.BlockHeader.toObject(opt_includeInstance, this); +proto.protocol.BlockInventory.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.BlockInventory.toObject(opt_includeInstance, this); }; @@ -4838,14 +9129,15 @@ proto.protocol.BlockHeader.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.BlockHeader} msg The msg instance to transform. + * @param {!proto.protocol.BlockInventory} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.BlockHeader.toObject = function(includeInstance, msg) { +proto.protocol.BlockInventory.toObject = function(includeInstance, msg) { var f, obj = { - rawData: (f = msg.getRawData()) && proto.protocol.BlockHeader.raw.toObject(includeInstance, f), - witnessSignature: msg.getWitnessSignature_asB64() + idsList: jspb.Message.toObjectList(msg.getIdsList(), + proto.protocol.BlockInventory.BlockId.toObject, includeInstance), + type: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { @@ -4859,23 +9151,23 @@ proto.protocol.BlockHeader.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.BlockHeader} + * @return {!proto.protocol.BlockInventory} */ -proto.protocol.BlockHeader.deserializeBinary = function(bytes) { +proto.protocol.BlockInventory.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.BlockHeader; - return proto.protocol.BlockHeader.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.BlockInventory; + return proto.protocol.BlockInventory.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.BlockHeader} msg The message object to deserialize into. + * @param {!proto.protocol.BlockInventory} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.BlockHeader} + * @return {!proto.protocol.BlockInventory} */ -proto.protocol.BlockHeader.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.BlockInventory.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -4883,13 +9175,13 @@ proto.protocol.BlockHeader.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.protocol.BlockHeader.raw; - reader.readMessage(value,proto.protocol.BlockHeader.raw.deserializeBinaryFromReader); - msg.setRawData(value); + var value = new proto.protocol.BlockInventory.BlockId; + reader.readMessage(value,proto.protocol.BlockInventory.BlockId.deserializeBinaryFromReader); + msg.addIds(value); break; case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setWitnessSignature(value); + var value = /** @type {!proto.protocol.BlockInventory.Type} */ (reader.readEnum()); + msg.setType(value); break; default: reader.skipField(); @@ -4904,9 +9196,9 @@ proto.protocol.BlockHeader.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.BlockHeader.prototype.serializeBinary = function() { +proto.protocol.BlockInventory.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.BlockHeader.serializeBinaryToWriter(this, writer); + proto.protocol.BlockInventory.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -4914,23 +9206,23 @@ proto.protocol.BlockHeader.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.BlockHeader} message + * @param {!proto.protocol.BlockInventory} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.BlockHeader.serializeBinaryToWriter = function(message, writer) { +proto.protocol.BlockInventory.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getRawData(); - if (f != null) { - writer.writeMessage( + f = message.getIdsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( 1, f, - proto.protocol.BlockHeader.raw.serializeBinaryToWriter + proto.protocol.BlockInventory.BlockId.serializeBinaryToWriter ); } - f = message.getWitnessSignature_asU8(); - if (f.length > 0) { - writer.writeBytes( + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( 2, f ); @@ -4938,6 +9230,15 @@ proto.protocol.BlockHeader.serializeBinaryToWriter = function(message, writer) { }; +/** + * @enum {number} + */ +proto.protocol.BlockInventory.Type = { + SYNC: 0, + ADVTISE: 1, + FETCH: 2 +}; + /** * Generated by JsPbCodeGenerator. @@ -4949,12 +9250,12 @@ proto.protocol.BlockHeader.serializeBinaryToWriter = function(message, writer) { * @extends {jspb.Message} * @constructor */ -proto.protocol.BlockHeader.raw = function(opt_data) { +proto.protocol.BlockInventory.BlockId = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.BlockHeader.raw, jspb.Message); +goog.inherits(proto.protocol.BlockInventory.BlockId, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.BlockHeader.raw.displayName = 'proto.protocol.BlockHeader.raw'; + proto.protocol.BlockInventory.BlockId.displayName = 'proto.protocol.BlockInventory.BlockId'; } @@ -4969,8 +9270,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.BlockHeader.raw.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.BlockHeader.raw.toObject(opt_includeInstance, this); +proto.protocol.BlockInventory.BlockId.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.BlockInventory.BlockId.toObject(opt_includeInstance, this); }; @@ -4979,18 +9280,14 @@ proto.protocol.BlockHeader.raw.prototype.toObject = function(opt_includeInstance * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.BlockHeader.raw} msg The msg instance to transform. + * @param {!proto.protocol.BlockInventory.BlockId} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.BlockHeader.raw.toObject = function(includeInstance, msg) { +proto.protocol.BlockInventory.BlockId.toObject = function(includeInstance, msg) { var f, obj = { - timestamp: jspb.Message.getFieldWithDefault(msg, 1, 0), - txtrieroot: msg.getTxtrieroot_asB64(), - parenthash: msg.getParenthash_asB64(), - number: jspb.Message.getFieldWithDefault(msg, 7, 0), - witnessId: jspb.Message.getFieldWithDefault(msg, 8, 0), - witnessAddress: msg.getWitnessAddress_asB64() + hash: msg.getHash_asB64(), + number: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { @@ -5004,23 +9301,23 @@ proto.protocol.BlockHeader.raw.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.BlockHeader.raw} + * @return {!proto.protocol.BlockInventory.BlockId} */ -proto.protocol.BlockHeader.raw.deserializeBinary = function(bytes) { +proto.protocol.BlockInventory.BlockId.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.BlockHeader.raw; - return proto.protocol.BlockHeader.raw.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.BlockInventory.BlockId; + return proto.protocol.BlockInventory.BlockId.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.BlockHeader.raw} msg The message object to deserialize into. + * @param {!proto.protocol.BlockInventory.BlockId} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.BlockHeader.raw} + * @return {!proto.protocol.BlockInventory.BlockId} */ -proto.protocol.BlockHeader.raw.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.BlockInventory.BlockId.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -5028,29 +9325,13 @@ proto.protocol.BlockHeader.raw.deserializeBinaryFromReader = function(msg, reade var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {number} */ (reader.readInt64()); - msg.setTimestamp(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setTxtrieroot(value); - break; - case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setParenthash(value); + msg.setHash(value); break; - case 7: + case 2: var value = /** @type {number} */ (reader.readInt64()); msg.setNumber(value); break; - case 8: - var value = /** @type {number} */ (reader.readInt64()); - msg.setWitnessId(value); - break; - case 9: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setWitnessAddress(value); - break; default: reader.skipField(); break; @@ -5064,9 +9345,9 @@ proto.protocol.BlockHeader.raw.deserializeBinaryFromReader = function(msg, reade * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.BlockHeader.raw.prototype.serializeBinary = function() { +proto.protocol.BlockInventory.BlockId.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.BlockHeader.raw.serializeBinaryToWriter(this, writer); + proto.protocol.BlockInventory.BlockId.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -5074,51 +9355,23 @@ proto.protocol.BlockHeader.raw.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.BlockHeader.raw} message + * @param {!proto.protocol.BlockInventory.BlockId} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.BlockHeader.raw.serializeBinaryToWriter = function(message, writer) { +proto.protocol.BlockInventory.BlockId.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getTimestamp(); - if (f !== 0) { - writer.writeInt64( - 1, - f - ); - } - f = message.getTxtrieroot_asU8(); - if (f.length > 0) { - writer.writeBytes( - 2, - f - ); - } - f = message.getParenthash_asU8(); - if (f.length > 0) { - writer.writeBytes( - 3, - f - ); - } - f = message.getNumber(); - if (f !== 0) { - writer.writeInt64( - 7, - f - ); - } - f = message.getWitnessId(); - if (f !== 0) { - writer.writeInt64( - 8, - f - ); - } - f = message.getWitnessAddress_asU8(); + f = message.getHash_asU8(); if (f.length > 0) { writer.writeBytes( - 9, + 1, + f + ); + } + f = message.getNumber(); + if (f !== 0) { + writer.writeInt64( + 2, f ); } @@ -5126,233 +9379,324 @@ proto.protocol.BlockHeader.raw.serializeBinaryToWriter = function(message, write /** - * optional int64 timestamp = 1; - * @return {number} - */ -proto.protocol.BlockHeader.raw.prototype.getTimestamp = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.protocol.BlockHeader.raw.prototype.setTimestamp = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional bytes txTrieRoot = 2; + * optional bytes hash = 1; * @return {!(string|Uint8Array)} */ -proto.protocol.BlockHeader.raw.prototype.getTxtrieroot = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.protocol.BlockInventory.BlockId.prototype.getHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional bytes txTrieRoot = 2; - * This is a type-conversion wrapper around `getTxtrieroot()` + * optional bytes hash = 1; + * This is a type-conversion wrapper around `getHash()` * @return {string} */ -proto.protocol.BlockHeader.raw.prototype.getTxtrieroot_asB64 = function() { +proto.protocol.BlockInventory.BlockId.prototype.getHash_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getTxtrieroot())); + this.getHash())); }; /** - * optional bytes txTrieRoot = 2; + * optional bytes hash = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getTxtrieroot()` + * This is a type-conversion wrapper around `getHash()` * @return {!Uint8Array} */ -proto.protocol.BlockHeader.raw.prototype.getTxtrieroot_asU8 = function() { +proto.protocol.BlockInventory.BlockId.prototype.getHash_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getTxtrieroot())); + this.getHash())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.BlockHeader.raw.prototype.setTxtrieroot = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); +proto.protocol.BlockInventory.BlockId.prototype.setHash = function(value) { + jspb.Message.setField(this, 1, value); }; /** - * optional bytes parentHash = 3; - * @return {!(string|Uint8Array)} + * optional int64 number = 2; + * @return {number} */ -proto.protocol.BlockHeader.raw.prototype.getParenthash = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.protocol.BlockInventory.BlockId.prototype.getNumber = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.BlockInventory.BlockId.prototype.setNumber = function(value) { + jspb.Message.setField(this, 2, value); }; /** - * optional bytes parentHash = 3; - * This is a type-conversion wrapper around `getParenthash()` - * @return {string} + * repeated BlockId ids = 1; + * @return {!Array.} */ -proto.protocol.BlockHeader.raw.prototype.getParenthash_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getParenthash())); +proto.protocol.BlockInventory.prototype.getIdsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.BlockInventory.BlockId, 1)); +}; + + +/** @param {!Array.} value */ +proto.protocol.BlockInventory.prototype.setIdsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** - * optional bytes parentHash = 3; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getParenthash()` - * @return {!Uint8Array} + * @param {!proto.protocol.BlockInventory.BlockId=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.BlockInventory.BlockId} */ -proto.protocol.BlockHeader.raw.prototype.getParenthash_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getParenthash())); +proto.protocol.BlockInventory.prototype.addIds = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.BlockInventory.BlockId, opt_index); }; -/** @param {!(string|Uint8Array)} value */ -proto.protocol.BlockHeader.raw.prototype.setParenthash = function(value) { - jspb.Message.setProto3BytesField(this, 3, value); +proto.protocol.BlockInventory.prototype.clearIdsList = function() { + this.setIdsList([]); }; /** - * optional int64 number = 7; - * @return {number} + * optional Type type = 2; + * @return {!proto.protocol.BlockInventory.Type} */ -proto.protocol.BlockHeader.raw.prototype.getNumber = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +proto.protocol.BlockInventory.prototype.getType = function() { + return /** @type {!proto.protocol.BlockInventory.Type} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; -/** @param {number} value */ -proto.protocol.BlockHeader.raw.prototype.setNumber = function(value) { - jspb.Message.setProto3IntField(this, 7, value); +/** @param {!proto.protocol.BlockInventory.Type} value */ +proto.protocol.BlockInventory.prototype.setType = function(value) { + jspb.Message.setField(this, 2, value); }; + /** - * optional int64 witness_id = 8; - * @return {number} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.protocol.BlockHeader.raw.prototype.getWitnessId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +proto.protocol.Inventory = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Inventory.repeatedFields_, null); +}; +goog.inherits(proto.protocol.Inventory, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Inventory.displayName = 'proto.protocol.Inventory'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Inventory.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Inventory.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Inventory.toObject(opt_includeInstance, this); }; -/** @param {number} value */ -proto.protocol.BlockHeader.raw.prototype.setWitnessId = function(value) { - jspb.Message.setProto3IntField(this, 8, value); +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Inventory} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Inventory.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + idsList: msg.getIdsList_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * optional bytes witness_address = 9; - * @return {!(string|Uint8Array)} + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Inventory} */ -proto.protocol.BlockHeader.raw.prototype.getWitnessAddress = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +proto.protocol.Inventory.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Inventory; + return proto.protocol.Inventory.deserializeBinaryFromReader(msg, reader); }; /** - * optional bytes witness_address = 9; - * This is a type-conversion wrapper around `getWitnessAddress()` - * @return {string} + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Inventory} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.Inventory} */ -proto.protocol.BlockHeader.raw.prototype.getWitnessAddress_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getWitnessAddress())); +proto.protocol.Inventory.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.protocol.Inventory.InventoryType} */ (reader.readEnum()); + msg.setType(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addIds(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * optional bytes witness_address = 9; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getWitnessAddress()` + * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.BlockHeader.raw.prototype.getWitnessAddress_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getWitnessAddress())); +proto.protocol.Inventory.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.Inventory.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; -/** @param {!(string|Uint8Array)} value */ -proto.protocol.BlockHeader.raw.prototype.setWitnessAddress = function(value) { - jspb.Message.setProto3BytesField(this, 9, value); +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.Inventory} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Inventory.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 2, + f + ); + } }; /** - * optional raw raw_data = 1; - * @return {?proto.protocol.BlockHeader.raw} + * @enum {number} */ -proto.protocol.BlockHeader.prototype.getRawData = function() { - return /** @type{?proto.protocol.BlockHeader.raw} */ ( - jspb.Message.getWrapperField(this, proto.protocol.BlockHeader.raw, 1)); +proto.protocol.Inventory.InventoryType = { + TRX: 0, + BLOCK: 1 }; - -/** @param {?proto.protocol.BlockHeader.raw|undefined} value */ -proto.protocol.BlockHeader.prototype.setRawData = function(value) { - jspb.Message.setWrapperField(this, 1, value); +/** + * optional InventoryType type = 1; + * @return {!proto.protocol.Inventory.InventoryType} + */ +proto.protocol.Inventory.prototype.getType = function() { + return /** @type {!proto.protocol.Inventory.InventoryType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; -proto.protocol.BlockHeader.prototype.clearRawData = function() { - this.setRawData(undefined); +/** @param {!proto.protocol.Inventory.InventoryType} value */ +proto.protocol.Inventory.prototype.setType = function(value) { + jspb.Message.setField(this, 1, value); }; /** - * Returns whether this field is set. - * @return {!boolean} + * repeated bytes ids = 2; + * @return {!(Array|Array)} */ -proto.protocol.BlockHeader.prototype.hasRawData = function() { - return jspb.Message.getField(this, 1) != null; +proto.protocol.Inventory.prototype.getIdsList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); }; /** - * optional bytes witness_signature = 2; - * @return {!(string|Uint8Array)} + * repeated bytes ids = 2; + * This is a type-conversion wrapper around `getIdsList()` + * @return {!Array.} */ -proto.protocol.BlockHeader.prototype.getWitnessSignature = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.protocol.Inventory.prototype.getIdsList_asB64 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsB64( + this.getIdsList())); }; /** - * optional bytes witness_signature = 2; - * This is a type-conversion wrapper around `getWitnessSignature()` - * @return {string} + * repeated bytes ids = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getIdsList()` + * @return {!Array.} */ -proto.protocol.BlockHeader.prototype.getWitnessSignature_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getWitnessSignature())); +proto.protocol.Inventory.prototype.getIdsList_asU8 = function() { + return /** @type {!Array.} */ (jspb.Message.bytesListAsU8( + this.getIdsList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.protocol.Inventory.prototype.setIdsList = function(value) { + jspb.Message.setField(this, 2, value || []); }; /** - * optional bytes witness_signature = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getWitnessSignature()` - * @return {!Uint8Array} + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index */ -proto.protocol.BlockHeader.prototype.getWitnessSignature_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getWitnessSignature())); +proto.protocol.Inventory.prototype.addIds = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 2, value, opt_index); }; -/** @param {!(string|Uint8Array)} value */ -proto.protocol.BlockHeader.prototype.setWitnessSignature = function(value) { - jspb.Message.setProto3BytesField(this, 2, value); +proto.protocol.Inventory.prototype.clearIdsList = function() { + this.setIdsList([]); }; @@ -5367,19 +9711,19 @@ proto.protocol.BlockHeader.prototype.setWitnessSignature = function(value) { * @extends {jspb.Message} * @constructor */ -proto.protocol.Block = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Block.repeatedFields_, null); +proto.protocol.Items = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Items.repeatedFields_, null); }; -goog.inherits(proto.protocol.Block, jspb.Message); +goog.inherits(proto.protocol.Items, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.Block.displayName = 'proto.protocol.Block'; + proto.protocol.Items.displayName = 'proto.protocol.Items'; } /** * List of repeated fields within this message type. * @private {!Array} * @const */ -proto.protocol.Block.repeatedFields_ = [1]; +proto.protocol.Items.repeatedFields_ = [2,3,4]; @@ -5394,8 +9738,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.Block.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.Block.toObject(opt_includeInstance, this); +proto.protocol.Items.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Items.toObject(opt_includeInstance, this); }; @@ -5404,15 +9748,19 @@ proto.protocol.Block.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.Block} msg The msg instance to transform. + * @param {!proto.protocol.Items} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Block.toObject = function(includeInstance, msg) { +proto.protocol.Items.toObject = function(includeInstance, msg) { var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + blocksList: jspb.Message.toObjectList(msg.getBlocksList(), + proto.protocol.Block.toObject, includeInstance), + blockHeadersList: jspb.Message.toObjectList(msg.getBlockHeadersList(), + proto.protocol.BlockHeader.toObject, includeInstance), transactionsList: jspb.Message.toObjectList(msg.getTransactionsList(), - proto.protocol.Transaction.toObject, includeInstance), - blockHeader: (f = msg.getBlockHeader()) && proto.protocol.BlockHeader.toObject(includeInstance, f) + proto.protocol.Transaction.toObject, includeInstance) }; if (includeInstance) { @@ -5426,23 +9774,23 @@ proto.protocol.Block.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.Block} + * @return {!proto.protocol.Items} */ -proto.protocol.Block.deserializeBinary = function(bytes) { +proto.protocol.Items.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.Block; - return proto.protocol.Block.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.Items; + return proto.protocol.Items.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.Block} msg The message object to deserialize into. + * @param {!proto.protocol.Items} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.Block} + * @return {!proto.protocol.Items} */ -proto.protocol.Block.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.Items.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -5450,14 +9798,23 @@ proto.protocol.Block.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.protocol.Transaction; - reader.readMessage(value,proto.protocol.Transaction.deserializeBinaryFromReader); - msg.addTransactions(value); + var value = /** @type {!proto.protocol.Items.ItemType} */ (reader.readEnum()); + msg.setType(value); break; case 2: + var value = new proto.protocol.Block; + reader.readMessage(value,proto.protocol.Block.deserializeBinaryFromReader); + msg.addBlocks(value); + break; + case 3: var value = new proto.protocol.BlockHeader; reader.readMessage(value,proto.protocol.BlockHeader.deserializeBinaryFromReader); - msg.setBlockHeader(value); + msg.addBlockHeaders(value); + break; + case 4: + var value = new proto.protocol.Transaction; + reader.readMessage(value,proto.protocol.Transaction.deserializeBinaryFromReader); + msg.addTransactions(value); break; default: reader.skipField(); @@ -5472,9 +9829,9 @@ proto.protocol.Block.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.Block.prototype.serializeBinary = function() { +proto.protocol.Items.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.Block.serializeBinaryToWriter(this, writer); + proto.protocol.Items.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -5482,89 +9839,161 @@ proto.protocol.Block.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.Block} message + * @param {!proto.protocol.Items} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Block.serializeBinaryToWriter = function(message, writer) { +proto.protocol.Items.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getTransactionsList(); + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getBlocksList(); if (f.length > 0) { writer.writeRepeatedMessage( - 1, + 2, f, - proto.protocol.Transaction.serializeBinaryToWriter + proto.protocol.Block.serializeBinaryToWriter ); } - f = message.getBlockHeader(); - if (f != null) { - writer.writeMessage( - 2, + f = message.getBlockHeadersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, f, proto.protocol.BlockHeader.serializeBinaryToWriter ); } + f = message.getTransactionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.protocol.Transaction.serializeBinaryToWriter + ); + } }; /** - * repeated Transaction transactions = 1; - * @return {!Array.} + * @enum {number} */ -proto.protocol.Block.prototype.getTransactionsList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction, 1)); +proto.protocol.Items.ItemType = { + ERR: 0, + TRX: 1, + BLOCK: 2, + BLOCKHEADER: 3 +}; + +/** + * optional ItemType type = 1; + * @return {!proto.protocol.Items.ItemType} + */ +proto.protocol.Items.prototype.getType = function() { + return /** @type {!proto.protocol.Items.ItemType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; -/** @param {!Array.} value */ -proto.protocol.Block.prototype.setTransactionsList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 1, value); +/** @param {!proto.protocol.Items.ItemType} value */ +proto.protocol.Items.prototype.setType = function(value) { + jspb.Message.setField(this, 1, value); }; /** - * @param {!proto.protocol.Transaction=} opt_value + * repeated Block blocks = 2; + * @return {!Array.} + */ +proto.protocol.Items.prototype.getBlocksList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Block, 2)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Items.prototype.setBlocksList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.protocol.Block=} opt_value * @param {number=} opt_index - * @return {!proto.protocol.Transaction} + * @return {!proto.protocol.Block} */ -proto.protocol.Block.prototype.addTransactions = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.Transaction, opt_index); +proto.protocol.Items.prototype.addBlocks = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.protocol.Block, opt_index); }; -proto.protocol.Block.prototype.clearTransactionsList = function() { - this.setTransactionsList([]); +proto.protocol.Items.prototype.clearBlocksList = function() { + this.setBlocksList([]); }; /** - * optional BlockHeader block_header = 2; - * @return {?proto.protocol.BlockHeader} + * repeated BlockHeader block_headers = 3; + * @return {!Array.} */ -proto.protocol.Block.prototype.getBlockHeader = function() { - return /** @type{?proto.protocol.BlockHeader} */ ( - jspb.Message.getWrapperField(this, proto.protocol.BlockHeader, 2)); +proto.protocol.Items.prototype.getBlockHeadersList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.BlockHeader, 3)); }; -/** @param {?proto.protocol.BlockHeader|undefined} value */ -proto.protocol.Block.prototype.setBlockHeader = function(value) { - jspb.Message.setWrapperField(this, 2, value); +/** @param {!Array.} value */ +proto.protocol.Items.prototype.setBlockHeadersList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.protocol.BlockHeader=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.BlockHeader} + */ +proto.protocol.Items.prototype.addBlockHeaders = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.protocol.BlockHeader, opt_index); +}; + + +proto.protocol.Items.prototype.clearBlockHeadersList = function() { + this.setBlockHeadersList([]); +}; + + +/** + * repeated Transaction transactions = 4; + * @return {!Array.} + */ +proto.protocol.Items.prototype.getTransactionsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction, 4)); }; -proto.protocol.Block.prototype.clearBlockHeader = function() { - this.setBlockHeader(undefined); +/** @param {!Array.} value */ +proto.protocol.Items.prototype.setTransactionsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 4, value); }; /** - * Returns whether this field is set. - * @return {!boolean} + * @param {!proto.protocol.Transaction=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Transaction} */ -proto.protocol.Block.prototype.hasBlockHeader = function() { - return jspb.Message.getField(this, 2) != null; +proto.protocol.Items.prototype.addTransactions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.protocol.Transaction, opt_index); +}; + + +proto.protocol.Items.prototype.clearTransactionsList = function() { + this.setTransactionsList([]); }; @@ -5579,20 +10008,13 @@ proto.protocol.Block.prototype.hasBlockHeader = function() { * @extends {jspb.Message} * @constructor */ -proto.protocol.ChainInventory = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.ChainInventory.repeatedFields_, null); +proto.protocol.DynamicProperties = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.ChainInventory, jspb.Message); +goog.inherits(proto.protocol.DynamicProperties, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.ChainInventory.displayName = 'proto.protocol.ChainInventory'; + proto.protocol.DynamicProperties.displayName = 'proto.protocol.DynamicProperties'; } -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.protocol.ChainInventory.repeatedFields_ = [1]; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -5606,8 +10028,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.ChainInventory.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.ChainInventory.toObject(opt_includeInstance, this); +proto.protocol.DynamicProperties.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.DynamicProperties.toObject(opt_includeInstance, this); }; @@ -5616,15 +10038,13 @@ proto.protocol.ChainInventory.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.ChainInventory} msg The msg instance to transform. + * @param {!proto.protocol.DynamicProperties} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.ChainInventory.toObject = function(includeInstance, msg) { +proto.protocol.DynamicProperties.toObject = function(includeInstance, msg) { var f, obj = { - idsList: jspb.Message.toObjectList(msg.getIdsList(), - proto.protocol.ChainInventory.BlockId.toObject, includeInstance), - remainNum: jspb.Message.getFieldWithDefault(msg, 2, 0) + lastSolidityBlockNum: jspb.Message.getFieldWithDefault(msg, 1, 0) }; if (includeInstance) { @@ -5638,23 +10058,23 @@ proto.protocol.ChainInventory.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.ChainInventory} + * @return {!proto.protocol.DynamicProperties} */ -proto.protocol.ChainInventory.deserializeBinary = function(bytes) { +proto.protocol.DynamicProperties.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.ChainInventory; - return proto.protocol.ChainInventory.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.DynamicProperties; + return proto.protocol.DynamicProperties.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.ChainInventory} msg The message object to deserialize into. + * @param {!proto.protocol.DynamicProperties} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.ChainInventory} + * @return {!proto.protocol.DynamicProperties} */ -proto.protocol.ChainInventory.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.DynamicProperties.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -5662,13 +10082,8 @@ proto.protocol.ChainInventory.deserializeBinaryFromReader = function(msg, reader var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.protocol.ChainInventory.BlockId; - reader.readMessage(value,proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader); - msg.addIds(value); - break; - case 2: var value = /** @type {number} */ (reader.readInt64()); - msg.setRemainNum(value); + msg.setLastSolidityBlockNum(value); break; default: reader.skipField(); @@ -5683,9 +10098,9 @@ proto.protocol.ChainInventory.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.ChainInventory.prototype.serializeBinary = function() { +proto.protocol.DynamicProperties.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.ChainInventory.serializeBinaryToWriter(this, writer); + proto.protocol.DynamicProperties.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -5693,30 +10108,37 @@ proto.protocol.ChainInventory.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.ChainInventory} message + * @param {!proto.protocol.DynamicProperties} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.ChainInventory.serializeBinaryToWriter = function(message, writer) { +proto.protocol.DynamicProperties.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getIdsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.protocol.ChainInventory.BlockId.serializeBinaryToWriter - ); - } - f = message.getRemainNum(); + f = message.getLastSolidityBlockNum(); if (f !== 0) { writer.writeInt64( - 2, + 1, f ); } }; +/** + * optional int64 last_solidity_block_num = 1; + * @return {number} + */ +proto.protocol.DynamicProperties.prototype.getLastSolidityBlockNum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.DynamicProperties.prototype.setLastSolidityBlockNum = function(value) { + jspb.Message.setField(this, 1, value); +}; + + /** * Generated by JsPbCodeGenerator. @@ -5728,12 +10150,12 @@ proto.protocol.ChainInventory.serializeBinaryToWriter = function(message, writer * @extends {jspb.Message} * @constructor */ -proto.protocol.ChainInventory.BlockId = function(opt_data) { +proto.protocol.DisconnectMessage = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.ChainInventory.BlockId, jspb.Message); +goog.inherits(proto.protocol.DisconnectMessage, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.ChainInventory.BlockId.displayName = 'proto.protocol.ChainInventory.BlockId'; + proto.protocol.DisconnectMessage.displayName = 'proto.protocol.DisconnectMessage'; } @@ -5748,8 +10170,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.ChainInventory.BlockId.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.ChainInventory.BlockId.toObject(opt_includeInstance, this); +proto.protocol.DisconnectMessage.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.DisconnectMessage.toObject(opt_includeInstance, this); }; @@ -5758,14 +10180,13 @@ proto.protocol.ChainInventory.BlockId.prototype.toObject = function(opt_includeI * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.ChainInventory.BlockId} msg The msg instance to transform. + * @param {!proto.protocol.DisconnectMessage} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.ChainInventory.BlockId.toObject = function(includeInstance, msg) { +proto.protocol.DisconnectMessage.toObject = function(includeInstance, msg) { var f, obj = { - hash: msg.getHash_asB64(), - number: jspb.Message.getFieldWithDefault(msg, 2, 0) + reason: jspb.Message.getFieldWithDefault(msg, 1, 0) }; if (includeInstance) { @@ -5779,23 +10200,23 @@ proto.protocol.ChainInventory.BlockId.toObject = function(includeInstance, msg) /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.ChainInventory.BlockId} + * @return {!proto.protocol.DisconnectMessage} */ -proto.protocol.ChainInventory.BlockId.deserializeBinary = function(bytes) { +proto.protocol.DisconnectMessage.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.ChainInventory.BlockId; - return proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.DisconnectMessage; + return proto.protocol.DisconnectMessage.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.ChainInventory.BlockId} msg The message object to deserialize into. + * @param {!proto.protocol.DisconnectMessage} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.ChainInventory.BlockId} + * @return {!proto.protocol.DisconnectMessage} */ -proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.DisconnectMessage.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -5803,12 +10224,8 @@ proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader = function(msg var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setHash(value); - break; - case 2: - var value = /** @type {number} */ (reader.readInt64()); - msg.setNumber(value); + var value = /** @type {!proto.protocol.ReasonCode} */ (reader.readEnum()); + msg.setReason(value); break; default: reader.skipField(); @@ -5823,9 +10240,9 @@ proto.protocol.ChainInventory.BlockId.deserializeBinaryFromReader = function(msg * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.ChainInventory.BlockId.prototype.serializeBinary = function() { +proto.protocol.DisconnectMessage.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.ChainInventory.BlockId.serializeBinaryToWriter(this, writer); + proto.protocol.DisconnectMessage.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -5833,126 +10250,34 @@ proto.protocol.ChainInventory.BlockId.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.ChainInventory.BlockId} message + * @param {!proto.protocol.DisconnectMessage} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.ChainInventory.BlockId.serializeBinaryToWriter = function(message, writer) { +proto.protocol.DisconnectMessage.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getHash_asU8(); - if (f.length > 0) { - writer.writeBytes( + f = message.getReason(); + if (f !== 0.0) { + writer.writeEnum( 1, f ); } - f = message.getNumber(); - if (f !== 0) { - writer.writeInt64( - 2, - f - ); - } -}; - - -/** - * optional bytes hash = 1; - * @return {!(string|Uint8Array)} - */ -proto.protocol.ChainInventory.BlockId.prototype.getHash = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes hash = 1; - * This is a type-conversion wrapper around `getHash()` - * @return {string} - */ -proto.protocol.ChainInventory.BlockId.prototype.getHash_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getHash())); -}; - - -/** - * optional bytes hash = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getHash()` - * @return {!Uint8Array} - */ -proto.protocol.ChainInventory.BlockId.prototype.getHash_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getHash())); -}; - - -/** @param {!(string|Uint8Array)} value */ -proto.protocol.ChainInventory.BlockId.prototype.setHash = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional int64 number = 2; - * @return {number} - */ -proto.protocol.ChainInventory.BlockId.prototype.getNumber = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** @param {number} value */ -proto.protocol.ChainInventory.BlockId.prototype.setNumber = function(value) { - jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * repeated BlockId ids = 1; - * @return {!Array.} - */ -proto.protocol.ChainInventory.prototype.getIdsList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.ChainInventory.BlockId, 1)); -}; - - -/** @param {!Array.} value */ -proto.protocol.ChainInventory.prototype.setIdsList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.protocol.ChainInventory.BlockId=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.ChainInventory.BlockId} - */ -proto.protocol.ChainInventory.prototype.addIds = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.ChainInventory.BlockId, opt_index); -}; - - -proto.protocol.ChainInventory.prototype.clearIdsList = function() { - this.setIdsList([]); }; /** - * optional int64 remain_num = 2; - * @return {number} + * optional ReasonCode reason = 1; + * @return {!proto.protocol.ReasonCode} */ -proto.protocol.ChainInventory.prototype.getRemainNum = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.protocol.DisconnectMessage.prototype.getReason = function() { + return /** @type {!proto.protocol.ReasonCode} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; -/** @param {number} value */ -proto.protocol.ChainInventory.prototype.setRemainNum = function(value) { - jspb.Message.setProto3IntField(this, 2, value); +/** @param {!proto.protocol.ReasonCode} value */ +proto.protocol.DisconnectMessage.prototype.setReason = function(value) { + jspb.Message.setField(this, 1, value); }; @@ -5967,20 +10292,13 @@ proto.protocol.ChainInventory.prototype.setRemainNum = function(value) { * @extends {jspb.Message} * @constructor */ -proto.protocol.BlockInventory = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.BlockInventory.repeatedFields_, null); +proto.protocol.HelloMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.BlockInventory, jspb.Message); +goog.inherits(proto.protocol.HelloMessage, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.BlockInventory.displayName = 'proto.protocol.BlockInventory'; + proto.protocol.HelloMessage.displayName = 'proto.protocol.HelloMessage'; } -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.protocol.BlockInventory.repeatedFields_ = [1]; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -5994,8 +10312,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.BlockInventory.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.BlockInventory.toObject(opt_includeInstance, this); +proto.protocol.HelloMessage.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.HelloMessage.toObject(opt_includeInstance, this); }; @@ -6004,15 +10322,18 @@ proto.protocol.BlockInventory.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.BlockInventory} msg The msg instance to transform. + * @param {!proto.protocol.HelloMessage} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.BlockInventory.toObject = function(includeInstance, msg) { +proto.protocol.HelloMessage.toObject = function(includeInstance, msg) { var f, obj = { - idsList: jspb.Message.toObjectList(msg.getIdsList(), - proto.protocol.BlockInventory.BlockId.toObject, includeInstance), - type: jspb.Message.getFieldWithDefault(msg, 2, 0) + from: (f = msg.getFrom()) && core_Discover_pb.Endpoint.toObject(includeInstance, f), + version: jspb.Message.getFieldWithDefault(msg, 2, 0), + timestamp: jspb.Message.getFieldWithDefault(msg, 3, 0), + genesisblockid: (f = msg.getGenesisblockid()) && proto.protocol.HelloMessage.BlockId.toObject(includeInstance, f), + solidblockid: (f = msg.getSolidblockid()) && proto.protocol.HelloMessage.BlockId.toObject(includeInstance, f), + headblockid: (f = msg.getHeadblockid()) && proto.protocol.HelloMessage.BlockId.toObject(includeInstance, f) }; if (includeInstance) { @@ -6026,23 +10347,23 @@ proto.protocol.BlockInventory.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.BlockInventory} + * @return {!proto.protocol.HelloMessage} */ -proto.protocol.BlockInventory.deserializeBinary = function(bytes) { +proto.protocol.HelloMessage.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.BlockInventory; - return proto.protocol.BlockInventory.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.HelloMessage; + return proto.protocol.HelloMessage.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.BlockInventory} msg The message object to deserialize into. + * @param {!proto.protocol.HelloMessage} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.BlockInventory} + * @return {!proto.protocol.HelloMessage} */ -proto.protocol.BlockInventory.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.HelloMessage.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -6050,13 +10371,32 @@ proto.protocol.BlockInventory.deserializeBinaryFromReader = function(msg, reader var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.protocol.BlockInventory.BlockId; - reader.readMessage(value,proto.protocol.BlockInventory.BlockId.deserializeBinaryFromReader); - msg.addIds(value); + var value = new core_Discover_pb.Endpoint; + reader.readMessage(value,core_Discover_pb.Endpoint.deserializeBinaryFromReader); + msg.setFrom(value); break; case 2: - var value = /** @type {!proto.protocol.BlockInventory.Type} */ (reader.readEnum()); - msg.setType(value); + var value = /** @type {number} */ (reader.readInt32()); + msg.setVersion(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTimestamp(value); + break; + case 4: + var value = new proto.protocol.HelloMessage.BlockId; + reader.readMessage(value,proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader); + msg.setGenesisblockid(value); + break; + case 5: + var value = new proto.protocol.HelloMessage.BlockId; + reader.readMessage(value,proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader); + msg.setSolidblockid(value); + break; + case 6: + var value = new proto.protocol.HelloMessage.BlockId; + reader.readMessage(value,proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader); + msg.setHeadblockid(value); break; default: reader.skipField(); @@ -6071,9 +10411,9 @@ proto.protocol.BlockInventory.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.BlockInventory.prototype.serializeBinary = function() { +proto.protocol.HelloMessage.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.BlockInventory.serializeBinaryToWriter(this, writer); + proto.protocol.HelloMessage.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -6081,39 +10421,61 @@ proto.protocol.BlockInventory.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.BlockInventory} message + * @param {!proto.protocol.HelloMessage} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.BlockInventory.serializeBinaryToWriter = function(message, writer) { +proto.protocol.HelloMessage.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getIdsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( + f = message.getFrom(); + if (f != null) { + writer.writeMessage( 1, f, - proto.protocol.BlockInventory.BlockId.serializeBinaryToWriter + core_Discover_pb.Endpoint.serializeBinaryToWriter ); } - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( + f = message.getVersion(); + if (f !== 0) { + writer.writeInt32( 2, f ); } + f = message.getTimestamp(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getGenesisblockid(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter + ); + } + f = message.getSolidblockid(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter + ); + } + f = message.getHeadblockid(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter + ); + } }; -/** - * @enum {number} - */ -proto.protocol.BlockInventory.Type = { - SYNC: 0, - ADVTISE: 1, - FETCH: 2 -}; - /** * Generated by JsPbCodeGenerator. @@ -6125,12 +10487,12 @@ proto.protocol.BlockInventory.Type = { * @extends {jspb.Message} * @constructor */ -proto.protocol.BlockInventory.BlockId = function(opt_data) { +proto.protocol.HelloMessage.BlockId = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.BlockInventory.BlockId, jspb.Message); +goog.inherits(proto.protocol.HelloMessage.BlockId, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.BlockInventory.BlockId.displayName = 'proto.protocol.BlockInventory.BlockId'; + proto.protocol.HelloMessage.BlockId.displayName = 'proto.protocol.HelloMessage.BlockId'; } @@ -6145,8 +10507,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.BlockInventory.BlockId.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.BlockInventory.BlockId.toObject(opt_includeInstance, this); +proto.protocol.HelloMessage.BlockId.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.HelloMessage.BlockId.toObject(opt_includeInstance, this); }; @@ -6155,11 +10517,11 @@ proto.protocol.BlockInventory.BlockId.prototype.toObject = function(opt_includeI * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.BlockInventory.BlockId} msg The msg instance to transform. + * @param {!proto.protocol.HelloMessage.BlockId} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.BlockInventory.BlockId.toObject = function(includeInstance, msg) { +proto.protocol.HelloMessage.BlockId.toObject = function(includeInstance, msg) { var f, obj = { hash: msg.getHash_asB64(), number: jspb.Message.getFieldWithDefault(msg, 2, 0) @@ -6176,23 +10538,23 @@ proto.protocol.BlockInventory.BlockId.toObject = function(includeInstance, msg) /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.BlockInventory.BlockId} + * @return {!proto.protocol.HelloMessage.BlockId} */ -proto.protocol.BlockInventory.BlockId.deserializeBinary = function(bytes) { +proto.protocol.HelloMessage.BlockId.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.BlockInventory.BlockId; - return proto.protocol.BlockInventory.BlockId.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.HelloMessage.BlockId; + return proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.BlockInventory.BlockId} msg The message object to deserialize into. + * @param {!proto.protocol.HelloMessage.BlockId} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.BlockInventory.BlockId} + * @return {!proto.protocol.HelloMessage.BlockId} */ -proto.protocol.BlockInventory.BlockId.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -6220,9 +10582,9 @@ proto.protocol.BlockInventory.BlockId.deserializeBinaryFromReader = function(msg * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.BlockInventory.BlockId.prototype.serializeBinary = function() { +proto.protocol.HelloMessage.BlockId.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.BlockInventory.BlockId.serializeBinaryToWriter(this, writer); + proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -6230,11 +10592,11 @@ proto.protocol.BlockInventory.BlockId.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.BlockInventory.BlockId} message + * @param {!proto.protocol.HelloMessage.BlockId} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.BlockInventory.BlockId.serializeBinaryToWriter = function(message, writer) { +proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getHash_asU8(); if (f.length > 0) { @@ -6257,7 +10619,7 @@ proto.protocol.BlockInventory.BlockId.serializeBinaryToWriter = function(message * optional bytes hash = 1; * @return {!(string|Uint8Array)} */ -proto.protocol.BlockInventory.BlockId.prototype.getHash = function() { +proto.protocol.HelloMessage.BlockId.prototype.getHash = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -6267,7 +10629,7 @@ proto.protocol.BlockInventory.BlockId.prototype.getHash = function() { * This is a type-conversion wrapper around `getHash()` * @return {string} */ -proto.protocol.BlockInventory.BlockId.prototype.getHash_asB64 = function() { +proto.protocol.HelloMessage.BlockId.prototype.getHash_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getHash())); }; @@ -6280,15 +10642,15 @@ proto.protocol.BlockInventory.BlockId.prototype.getHash_asB64 = function() { * This is a type-conversion wrapper around `getHash()` * @return {!Uint8Array} */ -proto.protocol.BlockInventory.BlockId.prototype.getHash_asU8 = function() { +proto.protocol.HelloMessage.BlockId.prototype.getHash_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getHash())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.BlockInventory.BlockId.prototype.setHash = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); +proto.protocol.HelloMessage.BlockId.prototype.setHash = function(value) { + jspb.Message.setField(this, 1, value); }; @@ -6296,282 +10658,164 @@ proto.protocol.BlockInventory.BlockId.prototype.setHash = function(value) { * optional int64 number = 2; * @return {number} */ -proto.protocol.BlockInventory.BlockId.prototype.getNumber = function() { +proto.protocol.HelloMessage.BlockId.prototype.getNumber = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** @param {number} value */ -proto.protocol.BlockInventory.BlockId.prototype.setNumber = function(value) { - jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * repeated BlockId ids = 1; - * @return {!Array.} - */ -proto.protocol.BlockInventory.prototype.getIdsList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.BlockInventory.BlockId, 1)); -}; - - -/** @param {!Array.} value */ -proto.protocol.BlockInventory.prototype.setIdsList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.protocol.BlockInventory.BlockId=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.BlockInventory.BlockId} - */ -proto.protocol.BlockInventory.prototype.addIds = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.BlockInventory.BlockId, opt_index); -}; - - -proto.protocol.BlockInventory.prototype.clearIdsList = function() { - this.setIdsList([]); -}; - - -/** - * optional Type type = 2; - * @return {!proto.protocol.BlockInventory.Type} - */ -proto.protocol.BlockInventory.prototype.getType = function() { - return /** @type {!proto.protocol.BlockInventory.Type} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** @param {!proto.protocol.BlockInventory.Type} value */ -proto.protocol.BlockInventory.prototype.setType = function(value) { - jspb.Message.setProto3EnumField(this, 2, value); +proto.protocol.HelloMessage.BlockId.prototype.setNumber = function(value) { + jspb.Message.setField(this, 2, value); }; - -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.protocol.Inventory = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Inventory.repeatedFields_, null); -}; -goog.inherits(proto.protocol.Inventory, jspb.Message); -if (goog.DEBUG && !COMPILED) { - proto.protocol.Inventory.displayName = 'proto.protocol.Inventory'; -} /** - * List of repeated fields within this message type. - * @private {!Array} - * @const + * optional Endpoint from = 1; + * @return {?proto.protocol.Endpoint} */ -proto.protocol.Inventory.repeatedFields_ = [2]; +proto.protocol.HelloMessage.prototype.getFrom = function() { + return /** @type{?proto.protocol.Endpoint} */ ( + jspb.Message.getWrapperField(this, core_Discover_pb.Endpoint, 1)); +}; +/** @param {?proto.protocol.Endpoint|undefined} value */ +proto.protocol.HelloMessage.prototype.setFrom = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.HelloMessage.prototype.clearFrom = function() { + this.setFrom(undefined); +}; + -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} + * Returns whether this field is set. + * @return {!boolean} */ -proto.protocol.Inventory.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.Inventory.toObject(opt_includeInstance, this); +proto.protocol.HelloMessage.prototype.hasFrom = function() { + return jspb.Message.getField(this, 1) != null; }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.protocol.Inventory} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * optional int32 version = 2; + * @return {number} */ -proto.protocol.Inventory.toObject = function(includeInstance, msg) { - var f, obj = { - type: jspb.Message.getFieldWithDefault(msg, 1, 0), - idsList: msg.getIdsList_asB64() - }; +proto.protocol.HelloMessage.prototype.getVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; + +/** @param {number} value */ +proto.protocol.HelloMessage.prototype.setVersion = function(value) { + jspb.Message.setField(this, 2, value); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.Inventory} + * optional int64 timestamp = 3; + * @return {number} */ -proto.protocol.Inventory.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.Inventory; - return proto.protocol.Inventory.deserializeBinaryFromReader(msg, reader); +proto.protocol.HelloMessage.prototype.getTimestamp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.protocol.Inventory} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.Inventory} - */ -proto.protocol.Inventory.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.protocol.Inventory.InventoryType} */ (reader.readEnum()); - msg.setType(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addIds(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +/** @param {number} value */ +proto.protocol.HelloMessage.prototype.setTimestamp = function(value) { + jspb.Message.setField(this, 3, value); }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * optional BlockId genesisBlockId = 4; + * @return {?proto.protocol.HelloMessage.BlockId} */ -proto.protocol.Inventory.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.protocol.Inventory.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.protocol.HelloMessage.prototype.getGenesisblockid = function() { + return /** @type{?proto.protocol.HelloMessage.BlockId} */ ( + jspb.Message.getWrapperField(this, proto.protocol.HelloMessage.BlockId, 4)); }; -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.protocol.Inventory} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.protocol.Inventory.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } - f = message.getIdsList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 2, - f - ); - } +/** @param {?proto.protocol.HelloMessage.BlockId|undefined} value */ +proto.protocol.HelloMessage.prototype.setGenesisblockid = function(value) { + jspb.Message.setWrapperField(this, 4, value); +}; + + +proto.protocol.HelloMessage.prototype.clearGenesisblockid = function() { + this.setGenesisblockid(undefined); }; /** - * @enum {number} + * Returns whether this field is set. + * @return {!boolean} */ -proto.protocol.Inventory.InventoryType = { - TRX: 0, - BLOCK: 1 +proto.protocol.HelloMessage.prototype.hasGenesisblockid = function() { + return jspb.Message.getField(this, 4) != null; }; + /** - * optional InventoryType type = 1; - * @return {!proto.protocol.Inventory.InventoryType} + * optional BlockId solidBlockId = 5; + * @return {?proto.protocol.HelloMessage.BlockId} */ -proto.protocol.Inventory.prototype.getType = function() { - return /** @type {!proto.protocol.Inventory.InventoryType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.protocol.HelloMessage.prototype.getSolidblockid = function() { + return /** @type{?proto.protocol.HelloMessage.BlockId} */ ( + jspb.Message.getWrapperField(this, proto.protocol.HelloMessage.BlockId, 5)); }; -/** @param {!proto.protocol.Inventory.InventoryType} value */ -proto.protocol.Inventory.prototype.setType = function(value) { - jspb.Message.setProto3EnumField(this, 1, value); +/** @param {?proto.protocol.HelloMessage.BlockId|undefined} value */ +proto.protocol.HelloMessage.prototype.setSolidblockid = function(value) { + jspb.Message.setWrapperField(this, 5, value); }; -/** - * repeated bytes ids = 2; - * @return {!(Array|Array)} - */ -proto.protocol.Inventory.prototype.getIdsList = function() { - return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); +proto.protocol.HelloMessage.prototype.clearSolidblockid = function() { + this.setSolidblockid(undefined); }; /** - * repeated bytes ids = 2; - * This is a type-conversion wrapper around `getIdsList()` - * @return {!Array.} + * Returns whether this field is set. + * @return {!boolean} */ -proto.protocol.Inventory.prototype.getIdsList_asB64 = function() { - return /** @type {!Array.} */ (jspb.Message.bytesListAsB64( - this.getIdsList())); +proto.protocol.HelloMessage.prototype.hasSolidblockid = function() { + return jspb.Message.getField(this, 5) != null; }; /** - * repeated bytes ids = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIdsList()` - * @return {!Array.} + * optional BlockId headBlockId = 6; + * @return {?proto.protocol.HelloMessage.BlockId} */ -proto.protocol.Inventory.prototype.getIdsList_asU8 = function() { - return /** @type {!Array.} */ (jspb.Message.bytesListAsU8( - this.getIdsList())); +proto.protocol.HelloMessage.prototype.getHeadblockid = function() { + return /** @type{?proto.protocol.HelloMessage.BlockId} */ ( + jspb.Message.getWrapperField(this, proto.protocol.HelloMessage.BlockId, 6)); }; -/** @param {!(Array|Array)} value */ -proto.protocol.Inventory.prototype.setIdsList = function(value) { - jspb.Message.setField(this, 2, value || []); +/** @param {?proto.protocol.HelloMessage.BlockId|undefined} value */ +proto.protocol.HelloMessage.prototype.setHeadblockid = function(value) { + jspb.Message.setWrapperField(this, 6, value); }; -/** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - */ -proto.protocol.Inventory.prototype.addIds = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 2, value, opt_index); +proto.protocol.HelloMessage.prototype.clearHeadblockid = function() { + this.setHeadblockid(undefined); }; -proto.protocol.Inventory.prototype.clearIdsList = function() { - this.setIdsList([]); +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.HelloMessage.prototype.hasHeadblockid = function() { + return jspb.Message.getField(this, 6) != null; }; @@ -6586,20 +10830,13 @@ proto.protocol.Inventory.prototype.clearIdsList = function() { * @extends {jspb.Message} * @constructor */ -proto.protocol.Items = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Items.repeatedFields_, null); +proto.protocol.SmartContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.Items, jspb.Message); +goog.inherits(proto.protocol.SmartContract, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.Items.displayName = 'proto.protocol.Items'; + proto.protocol.SmartContract.displayName = 'proto.protocol.SmartContract'; } -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.protocol.Items.repeatedFields_ = [2,3,4]; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -6613,8 +10850,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.Items.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.Items.toObject(opt_includeInstance, this); +proto.protocol.SmartContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.SmartContract.toObject(opt_includeInstance, this); }; @@ -6623,19 +10860,19 @@ proto.protocol.Items.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.Items} msg The msg instance to transform. + * @param {!proto.protocol.SmartContract} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Items.toObject = function(includeInstance, msg) { +proto.protocol.SmartContract.toObject = function(includeInstance, msg) { var f, obj = { - type: jspb.Message.getFieldWithDefault(msg, 1, 0), - blocksList: jspb.Message.toObjectList(msg.getBlocksList(), - proto.protocol.Block.toObject, includeInstance), - blockHeadersList: jspb.Message.toObjectList(msg.getBlockHeadersList(), - proto.protocol.BlockHeader.toObject, includeInstance), - transactionsList: jspb.Message.toObjectList(msg.getTransactionsList(), - proto.protocol.Transaction.toObject, includeInstance) + originAddress: msg.getOriginAddress_asB64(), + contractAddress: msg.getContractAddress_asB64(), + abi: (f = msg.getAbi()) && proto.protocol.SmartContract.ABI.toObject(includeInstance, f), + bytecode: msg.getBytecode_asB64(), + callValue: jspb.Message.getFieldWithDefault(msg, 5, 0), + consumeUserResourcePercent: jspb.Message.getFieldWithDefault(msg, 6, 0), + name: jspb.Message.getFieldWithDefault(msg, 7, "") }; if (includeInstance) { @@ -6649,23 +10886,23 @@ proto.protocol.Items.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.Items} + * @return {!proto.protocol.SmartContract} */ -proto.protocol.Items.deserializeBinary = function(bytes) { +proto.protocol.SmartContract.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.Items; - return proto.protocol.Items.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.SmartContract; + return proto.protocol.SmartContract.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.Items} msg The message object to deserialize into. + * @param {!proto.protocol.SmartContract} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.Items} + * @return {!proto.protocol.SmartContract} */ -proto.protocol.Items.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.SmartContract.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -6673,23 +10910,33 @@ proto.protocol.Items.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {!proto.protocol.Items.ItemType} */ (reader.readEnum()); - msg.setType(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOriginAddress(value); break; case 2: - var value = new proto.protocol.Block; - reader.readMessage(value,proto.protocol.Block.deserializeBinaryFromReader); - msg.addBlocks(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setContractAddress(value); + break; + case 3: + var value = new proto.protocol.SmartContract.ABI; + reader.readMessage(value,proto.protocol.SmartContract.ABI.deserializeBinaryFromReader); + msg.setAbi(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBytecode(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setCallValue(value); break; - case 3: - var value = new proto.protocol.BlockHeader; - reader.readMessage(value,proto.protocol.BlockHeader.deserializeBinaryFromReader); - msg.addBlockHeaders(value); + case 6: + var value = /** @type {number} */ (reader.readInt64()); + msg.setConsumeUserResourcePercent(value); break; - case 4: - var value = new proto.protocol.Transaction; - reader.readMessage(value,proto.protocol.Transaction.deserializeBinaryFromReader); - msg.addTransactions(value); + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); break; default: reader.skipField(); @@ -6704,9 +10951,9 @@ proto.protocol.Items.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.Items.prototype.serializeBinary = function() { +proto.protocol.SmartContract.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.Items.serializeBinaryToWriter(this, writer); + proto.protocol.SmartContract.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -6714,161 +10961,62 @@ proto.protocol.Items.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.Items} message + * @param {!proto.protocol.SmartContract} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Items.serializeBinaryToWriter = function(message, writer) { +proto.protocol.SmartContract.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( + f = message.getOriginAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( 1, f ); } - f = message.getBlocksList(); + f = message.getContractAddress_asU8(); if (f.length > 0) { - writer.writeRepeatedMessage( + writer.writeBytes( 2, - f, - proto.protocol.Block.serializeBinaryToWriter + f ); } - f = message.getBlockHeadersList(); - if (f.length > 0) { - writer.writeRepeatedMessage( + f = message.getAbi(); + if (f != null) { + writer.writeMessage( 3, f, - proto.protocol.BlockHeader.serializeBinaryToWriter + proto.protocol.SmartContract.ABI.serializeBinaryToWriter ); } - f = message.getTransactionsList(); + f = message.getBytecode_asU8(); if (f.length > 0) { - writer.writeRepeatedMessage( + writer.writeBytes( 4, - f, - proto.protocol.Transaction.serializeBinaryToWriter + f + ); + } + f = message.getCallValue(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } + f = message.getConsumeUserResourcePercent(); + if (f !== 0) { + writer.writeInt64( + 6, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 7, + f ); } -}; - - -/** - * @enum {number} - */ -proto.protocol.Items.ItemType = { - ERR: 0, - TRX: 1, - BLOCK: 2, - BLOCKHEADER: 3 -}; - -/** - * optional ItemType type = 1; - * @return {!proto.protocol.Items.ItemType} - */ -proto.protocol.Items.prototype.getType = function() { - return /** @type {!proto.protocol.Items.ItemType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {!proto.protocol.Items.ItemType} value */ -proto.protocol.Items.prototype.setType = function(value) { - jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * repeated Block blocks = 2; - * @return {!Array.} - */ -proto.protocol.Items.prototype.getBlocksList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.Block, 2)); -}; - - -/** @param {!Array.} value */ -proto.protocol.Items.prototype.setBlocksList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 2, value); -}; - - -/** - * @param {!proto.protocol.Block=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.Block} - */ -proto.protocol.Items.prototype.addBlocks = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.protocol.Block, opt_index); -}; - - -proto.protocol.Items.prototype.clearBlocksList = function() { - this.setBlocksList([]); -}; - - -/** - * repeated BlockHeader block_headers = 3; - * @return {!Array.} - */ -proto.protocol.Items.prototype.getBlockHeadersList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.BlockHeader, 3)); -}; - - -/** @param {!Array.} value */ -proto.protocol.Items.prototype.setBlockHeadersList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.protocol.BlockHeader=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.BlockHeader} - */ -proto.protocol.Items.prototype.addBlockHeaders = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.protocol.BlockHeader, opt_index); -}; - - -proto.protocol.Items.prototype.clearBlockHeadersList = function() { - this.setBlockHeadersList([]); -}; - - -/** - * repeated Transaction transactions = 4; - * @return {!Array.} - */ -proto.protocol.Items.prototype.getTransactionsList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.protocol.Transaction, 4)); -}; - - -/** @param {!Array.} value */ -proto.protocol.Items.prototype.setTransactionsList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 4, value); -}; - - -/** - * @param {!proto.protocol.Transaction=} opt_value - * @param {number=} opt_index - * @return {!proto.protocol.Transaction} - */ -proto.protocol.Items.prototype.addTransactions = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.protocol.Transaction, opt_index); -}; - - -proto.protocol.Items.prototype.clearTransactionsList = function() { - this.setTransactionsList([]); }; @@ -6883,13 +11031,20 @@ proto.protocol.Items.prototype.clearTransactionsList = function() { * @extends {jspb.Message} * @constructor */ -proto.protocol.DynamicProperties = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.protocol.SmartContract.ABI = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.SmartContract.ABI.repeatedFields_, null); }; -goog.inherits(proto.protocol.DynamicProperties, jspb.Message); +goog.inherits(proto.protocol.SmartContract.ABI, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.DynamicProperties.displayName = 'proto.protocol.DynamicProperties'; + proto.protocol.SmartContract.ABI.displayName = 'proto.protocol.SmartContract.ABI'; } +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.SmartContract.ABI.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -6903,8 +11058,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.DynamicProperties.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.DynamicProperties.toObject(opt_includeInstance, this); +proto.protocol.SmartContract.ABI.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.SmartContract.ABI.toObject(opt_includeInstance, this); }; @@ -6913,13 +11068,14 @@ proto.protocol.DynamicProperties.prototype.toObject = function(opt_includeInstan * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.DynamicProperties} msg The msg instance to transform. + * @param {!proto.protocol.SmartContract.ABI} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.DynamicProperties.toObject = function(includeInstance, msg) { +proto.protocol.SmartContract.ABI.toObject = function(includeInstance, msg) { var f, obj = { - lastSolidityBlockNum: jspb.Message.getFieldWithDefault(msg, 1, 0) + entrysList: jspb.Message.toObjectList(msg.getEntrysList(), + proto.protocol.SmartContract.ABI.Entry.toObject, includeInstance) }; if (includeInstance) { @@ -6933,23 +11089,23 @@ proto.protocol.DynamicProperties.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.DynamicProperties} + * @return {!proto.protocol.SmartContract.ABI} */ -proto.protocol.DynamicProperties.deserializeBinary = function(bytes) { +proto.protocol.SmartContract.ABI.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.DynamicProperties; - return proto.protocol.DynamicProperties.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.SmartContract.ABI; + return proto.protocol.SmartContract.ABI.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.DynamicProperties} msg The message object to deserialize into. + * @param {!proto.protocol.SmartContract.ABI} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.DynamicProperties} + * @return {!proto.protocol.SmartContract.ABI} */ -proto.protocol.DynamicProperties.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.SmartContract.ABI.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -6957,8 +11113,9 @@ proto.protocol.DynamicProperties.deserializeBinaryFromReader = function(msg, rea var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {number} */ (reader.readInt64()); - msg.setLastSolidityBlockNum(value); + var value = new proto.protocol.SmartContract.ABI.Entry; + reader.readMessage(value,proto.protocol.SmartContract.ABI.Entry.deserializeBinaryFromReader); + msg.addEntrys(value); break; default: reader.skipField(); @@ -6973,9 +11130,9 @@ proto.protocol.DynamicProperties.deserializeBinaryFromReader = function(msg, rea * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.DynamicProperties.prototype.serializeBinary = function() { +proto.protocol.SmartContract.ABI.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.DynamicProperties.serializeBinaryToWriter(this, writer); + proto.protocol.SmartContract.ABI.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -6983,37 +11140,23 @@ proto.protocol.DynamicProperties.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.DynamicProperties} message + * @param {!proto.protocol.SmartContract.ABI} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.DynamicProperties.serializeBinaryToWriter = function(message, writer) { +proto.protocol.SmartContract.ABI.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getLastSolidityBlockNum(); - if (f !== 0) { - writer.writeInt64( + f = message.getEntrysList(); + if (f.length > 0) { + writer.writeRepeatedMessage( 1, - f + f, + proto.protocol.SmartContract.ABI.Entry.serializeBinaryToWriter ); } }; -/** - * optional int64 last_solidity_block_num = 1; - * @return {number} - */ -proto.protocol.DynamicProperties.prototype.getLastSolidityBlockNum = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** @param {number} value */ -proto.protocol.DynamicProperties.prototype.setLastSolidityBlockNum = function(value) { - jspb.Message.setProto3IntField(this, 1, value); -}; - - /** * Generated by JsPbCodeGenerator. @@ -7025,13 +11168,20 @@ proto.protocol.DynamicProperties.prototype.setLastSolidityBlockNum = function(va * @extends {jspb.Message} * @constructor */ -proto.protocol.DisconnectMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.protocol.SmartContract.ABI.Entry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.SmartContract.ABI.Entry.repeatedFields_, null); }; -goog.inherits(proto.protocol.DisconnectMessage, jspb.Message); +goog.inherits(proto.protocol.SmartContract.ABI.Entry, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.DisconnectMessage.displayName = 'proto.protocol.DisconnectMessage'; + proto.protocol.SmartContract.ABI.Entry.displayName = 'proto.protocol.SmartContract.ABI.Entry'; } +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.SmartContract.ABI.Entry.repeatedFields_ = [4,5]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -7045,8 +11195,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.DisconnectMessage.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.DisconnectMessage.toObject(opt_includeInstance, this); +proto.protocol.SmartContract.ABI.Entry.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.SmartContract.ABI.Entry.toObject(opt_includeInstance, this); }; @@ -7055,13 +11205,22 @@ proto.protocol.DisconnectMessage.prototype.toObject = function(opt_includeInstan * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.DisconnectMessage} msg The msg instance to transform. + * @param {!proto.protocol.SmartContract.ABI.Entry} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.DisconnectMessage.toObject = function(includeInstance, msg) { +proto.protocol.SmartContract.ABI.Entry.toObject = function(includeInstance, msg) { var f, obj = { - reason: jspb.Message.getFieldWithDefault(msg, 1, 0) + anonymous: jspb.Message.getFieldWithDefault(msg, 1, false), + constant: jspb.Message.getFieldWithDefault(msg, 2, false), + name: jspb.Message.getFieldWithDefault(msg, 3, ""), + inputsList: jspb.Message.toObjectList(msg.getInputsList(), + proto.protocol.SmartContract.ABI.Entry.Param.toObject, includeInstance), + outputsList: jspb.Message.toObjectList(msg.getOutputsList(), + proto.protocol.SmartContract.ABI.Entry.Param.toObject, includeInstance), + type: jspb.Message.getFieldWithDefault(msg, 6, 0), + payable: jspb.Message.getFieldWithDefault(msg, 7, false), + statemutability: jspb.Message.getFieldWithDefault(msg, 8, 0) }; if (includeInstance) { @@ -7075,32 +11234,62 @@ proto.protocol.DisconnectMessage.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.DisconnectMessage} + * @return {!proto.protocol.SmartContract.ABI.Entry} */ -proto.protocol.DisconnectMessage.deserializeBinary = function(bytes) { +proto.protocol.SmartContract.ABI.Entry.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.DisconnectMessage; - return proto.protocol.DisconnectMessage.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.SmartContract.ABI.Entry; + return proto.protocol.SmartContract.ABI.Entry.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.DisconnectMessage} msg The message object to deserialize into. + * @param {!proto.protocol.SmartContract.ABI.Entry} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.DisconnectMessage} + * @return {!proto.protocol.SmartContract.ABI.Entry} */ -proto.protocol.DisconnectMessage.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.SmartContract.ABI.Entry.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.protocol.ReasonCode} */ (reader.readEnum()); - msg.setReason(value); + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAnonymous(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setConstant(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 4: + var value = new proto.protocol.SmartContract.ABI.Entry.Param; + reader.readMessage(value,proto.protocol.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader); + msg.addInputs(value); + break; + case 5: + var value = new proto.protocol.SmartContract.ABI.Entry.Param; + reader.readMessage(value,proto.protocol.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader); + msg.addOutputs(value); + break; + case 6: + var value = /** @type {!proto.protocol.SmartContract.ABI.Entry.EntryType} */ (reader.readEnum()); + msg.setType(value); + break; + case 7: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setPayable(value); + break; + case 8: + var value = /** @type {!proto.protocol.SmartContract.ABI.Entry.StateMutabilityType} */ (reader.readEnum()); + msg.setStatemutability(value); break; default: reader.skipField(); @@ -7115,9 +11304,9 @@ proto.protocol.DisconnectMessage.deserializeBinaryFromReader = function(msg, rea * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.DisconnectMessage.prototype.serializeBinary = function() { +proto.protocol.SmartContract.ABI.Entry.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.DisconnectMessage.serializeBinaryToWriter(this, writer); + proto.protocol.SmartContract.ABI.Entry.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -7125,16 +11314,67 @@ proto.protocol.DisconnectMessage.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.DisconnectMessage} message + * @param {!proto.protocol.SmartContract.ABI.Entry} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.DisconnectMessage.serializeBinaryToWriter = function(message, writer) { +proto.protocol.SmartContract.ABI.Entry.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getReason(); + f = message.getAnonymous(); + if (f) { + writer.writeBool( + 1, + f + ); + } + f = message.getConstant(); + if (f) { + writer.writeBool( + 2, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getInputsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.protocol.SmartContract.ABI.Entry.Param.serializeBinaryToWriter + ); + } + f = message.getOutputsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.protocol.SmartContract.ABI.Entry.Param.serializeBinaryToWriter + ); + } + f = message.getType(); if (f !== 0.0) { writer.writeEnum( - 1, + 6, + f + ); + } + f = message.getPayable(); + if (f) { + writer.writeBool( + 7, + f + ); + } + f = message.getStatemutability(); + if (f !== 0.0) { + writer.writeEnum( + 8, f ); } @@ -7142,21 +11382,28 @@ proto.protocol.DisconnectMessage.serializeBinaryToWriter = function(message, wri /** - * optional ReasonCode reason = 1; - * @return {!proto.protocol.ReasonCode} + * @enum {number} */ -proto.protocol.DisconnectMessage.prototype.getReason = function() { - return /** @type {!proto.protocol.ReasonCode} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.protocol.SmartContract.ABI.Entry.EntryType = { + UNKNOWNENTRYTYPE: 0, + CONSTRUCTOR: 1, + FUNCTION: 2, + EVENT: 3, + FALLBACK: 4 }; - -/** @param {!proto.protocol.ReasonCode} value */ -proto.protocol.DisconnectMessage.prototype.setReason = function(value) { - jspb.Message.setProto3EnumField(this, 1, value); +/** + * @enum {number} + */ +proto.protocol.SmartContract.ABI.Entry.StateMutabilityType = { + UNKNOWNMUTABILITYTYPE: 0, + PURE: 1, + VIEW: 2, + NONPAYABLE: 3, + PAYABLE: 4 }; - /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -7167,12 +11414,12 @@ proto.protocol.DisconnectMessage.prototype.setReason = function(value) { * @extends {jspb.Message} * @constructor */ -proto.protocol.HelloMessage = function(opt_data) { +proto.protocol.SmartContract.ABI.Entry.Param = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.HelloMessage, jspb.Message); +goog.inherits(proto.protocol.SmartContract.ABI.Entry.Param, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.HelloMessage.displayName = 'proto.protocol.HelloMessage'; + proto.protocol.SmartContract.ABI.Entry.Param.displayName = 'proto.protocol.SmartContract.ABI.Entry.Param'; } @@ -7187,8 +11434,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.HelloMessage.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.HelloMessage.toObject(opt_includeInstance, this); +proto.protocol.SmartContract.ABI.Entry.Param.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.SmartContract.ABI.Entry.Param.toObject(opt_includeInstance, this); }; @@ -7197,18 +11444,15 @@ proto.protocol.HelloMessage.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.HelloMessage} msg The msg instance to transform. + * @param {!proto.protocol.SmartContract.ABI.Entry.Param} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.HelloMessage.toObject = function(includeInstance, msg) { +proto.protocol.SmartContract.ABI.Entry.Param.toObject = function(includeInstance, msg) { var f, obj = { - from: (f = msg.getFrom()) && core_Discover_pb.Endpoint.toObject(includeInstance, f), - version: jspb.Message.getFieldWithDefault(msg, 2, 0), - timestamp: jspb.Message.getFieldWithDefault(msg, 3, 0), - genesisblockid: (f = msg.getGenesisblockid()) && proto.protocol.HelloMessage.BlockId.toObject(includeInstance, f), - solidblockid: (f = msg.getSolidblockid()) && proto.protocol.HelloMessage.BlockId.toObject(includeInstance, f), - headblockid: (f = msg.getHeadblockid()) && proto.protocol.HelloMessage.BlockId.toObject(includeInstance, f) + indexed: jspb.Message.getFieldWithDefault(msg, 1, false), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + type: jspb.Message.getFieldWithDefault(msg, 3, "") }; if (includeInstance) { @@ -7222,23 +11466,23 @@ proto.protocol.HelloMessage.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.HelloMessage} + * @return {!proto.protocol.SmartContract.ABI.Entry.Param} */ -proto.protocol.HelloMessage.deserializeBinary = function(bytes) { +proto.protocol.SmartContract.ABI.Entry.Param.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.HelloMessage; - return proto.protocol.HelloMessage.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.SmartContract.ABI.Entry.Param; + return proto.protocol.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.HelloMessage} msg The message object to deserialize into. + * @param {!proto.protocol.SmartContract.ABI.Entry.Param} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.HelloMessage} + * @return {!proto.protocol.SmartContract.ABI.Entry.Param} */ -proto.protocol.HelloMessage.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.SmartContract.ABI.Entry.Param.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -7246,32 +11490,16 @@ proto.protocol.HelloMessage.deserializeBinaryFromReader = function(msg, reader) var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new core_Discover_pb.Endpoint; - reader.readMessage(value,core_Discover_pb.Endpoint.deserializeBinaryFromReader); - msg.setFrom(value); + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIndexed(value); break; case 2: - var value = /** @type {number} */ (reader.readInt32()); - msg.setVersion(value); + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); break; case 3: - var value = /** @type {number} */ (reader.readInt64()); - msg.setTimestamp(value); - break; - case 4: - var value = new proto.protocol.HelloMessage.BlockId; - reader.readMessage(value,proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader); - msg.setGenesisblockid(value); - break; - case 5: - var value = new proto.protocol.HelloMessage.BlockId; - reader.readMessage(value,proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader); - msg.setSolidblockid(value); - break; - case 6: - var value = new proto.protocol.HelloMessage.BlockId; - reader.readMessage(value,proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader); - msg.setHeadblockid(value); + var value = /** @type {string} */ (reader.readString()); + msg.setType(value); break; default: reader.skipField(); @@ -7286,9 +11514,9 @@ proto.protocol.HelloMessage.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.HelloMessage.prototype.serializeBinary = function() { +proto.protocol.SmartContract.ABI.Entry.Param.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.HelloMessage.serializeBinaryToWriter(this, writer); + proto.protocol.SmartContract.ABI.Entry.Param.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -7296,332 +11524,368 @@ proto.protocol.HelloMessage.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.HelloMessage} message + * @param {!proto.protocol.SmartContract.ABI.Entry.Param} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.HelloMessage.serializeBinaryToWriter = function(message, writer) { +proto.protocol.SmartContract.ABI.Entry.Param.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getFrom(); - if (f != null) { - writer.writeMessage( + f = message.getIndexed(); + if (f) { + writer.writeBool( 1, - f, - core_Discover_pb.Endpoint.serializeBinaryToWriter + f ); } - f = message.getVersion(); - if (f !== 0) { - writer.writeInt32( + f = message.getName(); + if (f.length > 0) { + writer.writeString( 2, f ); } - f = message.getTimestamp(); - if (f !== 0) { - writer.writeInt64( + f = message.getType(); + if (f.length > 0) { + writer.writeString( 3, f ); } - f = message.getGenesisblockid(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter - ); - } - f = message.getSolidblockid(); - if (f != null) { - writer.writeMessage( - 5, - f, - proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter - ); - } - f = message.getHeadblockid(); - if (f != null) { - writer.writeMessage( - 6, - f, - proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter - ); - } }; +/** + * optional bool indexed = 1; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.protocol.SmartContract.ABI.Entry.Param.prototype.getIndexed = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 1, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.SmartContract.ABI.Entry.Param.prototype.setIndexed = function(value) { + jspb.Message.setField(this, 1, value); +}; + /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * optional string name = 2; + * @return {string} */ -proto.protocol.HelloMessage.BlockId = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.protocol.SmartContract.ABI.Entry.Param.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.protocol.SmartContract.ABI.Entry.Param.prototype.setName = function(value) { + jspb.Message.setField(this, 2, value); }; -goog.inherits(proto.protocol.HelloMessage.BlockId, jspb.Message); -if (goog.DEBUG && !COMPILED) { - proto.protocol.HelloMessage.BlockId.displayName = 'proto.protocol.HelloMessage.BlockId'; -} -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} + * optional string type = 3; + * @return {string} */ -proto.protocol.HelloMessage.BlockId.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.HelloMessage.BlockId.toObject(opt_includeInstance, this); +proto.protocol.SmartContract.ABI.Entry.Param.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.protocol.SmartContract.ABI.Entry.Param.prototype.setType = function(value) { + jspb.Message.setField(this, 3, value); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.protocol.HelloMessage.BlockId} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * optional bool anonymous = 1; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.protocol.SmartContract.ABI.Entry.prototype.getAnonymous = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 1, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.SmartContract.ABI.Entry.prototype.setAnonymous = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional bool constant = 2; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.protocol.SmartContract.ABI.Entry.prototype.getConstant = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 2, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.SmartContract.ABI.Entry.prototype.setConstant = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional string name = 3; + * @return {string} */ -proto.protocol.HelloMessage.BlockId.toObject = function(includeInstance, msg) { - var f, obj = { - hash: msg.getHash_asB64(), - number: jspb.Message.getFieldWithDefault(msg, 2, 0) - }; +proto.protocol.SmartContract.ABI.Entry.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; + +/** @param {string} value */ +proto.protocol.SmartContract.ABI.Entry.prototype.setName = function(value) { + jspb.Message.setField(this, 3, value); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.HelloMessage.BlockId} + * repeated Param inputs = 4; + * @return {!Array.} */ -proto.protocol.HelloMessage.BlockId.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.HelloMessage.BlockId; - return proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader(msg, reader); +proto.protocol.SmartContract.ABI.Entry.prototype.getInputsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.SmartContract.ABI.Entry.Param, 4)); +}; + + +/** @param {!Array.} value */ +proto.protocol.SmartContract.ABI.Entry.prototype.setInputsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 4, value); }; /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.protocol.HelloMessage.BlockId} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.HelloMessage.BlockId} + * @param {!proto.protocol.SmartContract.ABI.Entry.Param=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.SmartContract.ABI.Entry.Param} */ -proto.protocol.HelloMessage.BlockId.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setHash(value); - break; - case 2: - var value = /** @type {number} */ (reader.readInt64()); - msg.setNumber(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +proto.protocol.SmartContract.ABI.Entry.prototype.addInputs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.protocol.SmartContract.ABI.Entry.Param, opt_index); +}; + + +proto.protocol.SmartContract.ABI.Entry.prototype.clearInputsList = function() { + this.setInputsList([]); }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * repeated Param outputs = 5; + * @return {!Array.} */ -proto.protocol.HelloMessage.BlockId.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.protocol.SmartContract.ABI.Entry.prototype.getOutputsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.SmartContract.ABI.Entry.Param, 5)); +}; + + +/** @param {!Array.} value */ +proto.protocol.SmartContract.ABI.Entry.prototype.setOutputsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 5, value); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.protocol.HelloMessage.BlockId} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {!proto.protocol.SmartContract.ABI.Entry.Param=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.SmartContract.ABI.Entry.Param} */ -proto.protocol.HelloMessage.BlockId.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getHash_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getNumber(); - if (f !== 0) { - writer.writeInt64( - 2, - f - ); - } +proto.protocol.SmartContract.ABI.Entry.prototype.addOutputs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.protocol.SmartContract.ABI.Entry.Param, opt_index); +}; + + +proto.protocol.SmartContract.ABI.Entry.prototype.clearOutputsList = function() { + this.setOutputsList([]); }; /** - * optional bytes hash = 1; - * @return {!(string|Uint8Array)} + * optional EntryType type = 6; + * @return {!proto.protocol.SmartContract.ABI.Entry.EntryType} */ -proto.protocol.HelloMessage.BlockId.prototype.getHash = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.protocol.SmartContract.ABI.Entry.prototype.getType = function() { + return /** @type {!proto.protocol.SmartContract.ABI.Entry.EntryType} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** @param {!proto.protocol.SmartContract.ABI.Entry.EntryType} value */ +proto.protocol.SmartContract.ABI.Entry.prototype.setType = function(value) { + jspb.Message.setField(this, 6, value); }; /** - * optional bytes hash = 1; - * This is a type-conversion wrapper around `getHash()` - * @return {string} + * optional bool payable = 7; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} */ -proto.protocol.HelloMessage.BlockId.prototype.getHash_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getHash())); +proto.protocol.SmartContract.ABI.Entry.prototype.getPayable = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 7, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.SmartContract.ABI.Entry.prototype.setPayable = function(value) { + jspb.Message.setField(this, 7, value); }; /** - * optional bytes hash = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getHash()` - * @return {!Uint8Array} + * optional StateMutabilityType stateMutability = 8; + * @return {!proto.protocol.SmartContract.ABI.Entry.StateMutabilityType} */ -proto.protocol.HelloMessage.BlockId.prototype.getHash_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getHash())); +proto.protocol.SmartContract.ABI.Entry.prototype.getStatemutability = function() { + return /** @type {!proto.protocol.SmartContract.ABI.Entry.StateMutabilityType} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); }; -/** @param {!(string|Uint8Array)} value */ -proto.protocol.HelloMessage.BlockId.prototype.setHash = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); +/** @param {!proto.protocol.SmartContract.ABI.Entry.StateMutabilityType} value */ +proto.protocol.SmartContract.ABI.Entry.prototype.setStatemutability = function(value) { + jspb.Message.setField(this, 8, value); }; /** - * optional int64 number = 2; - * @return {number} + * repeated Entry entrys = 1; + * @return {!Array.} */ -proto.protocol.HelloMessage.BlockId.prototype.getNumber = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.protocol.SmartContract.ABI.prototype.getEntrysList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.SmartContract.ABI.Entry, 1)); }; -/** @param {number} value */ -proto.protocol.HelloMessage.BlockId.prototype.setNumber = function(value) { - jspb.Message.setProto3IntField(this, 2, value); +/** @param {!Array.} value */ +proto.protocol.SmartContract.ABI.prototype.setEntrysList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** - * optional Endpoint from = 1; - * @return {?proto.protocol.Endpoint} + * @param {!proto.protocol.SmartContract.ABI.Entry=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.SmartContract.ABI.Entry} */ -proto.protocol.HelloMessage.prototype.getFrom = function() { - return /** @type{?proto.protocol.Endpoint} */ ( - jspb.Message.getWrapperField(this, core_Discover_pb.Endpoint, 1)); +proto.protocol.SmartContract.ABI.prototype.addEntrys = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.protocol.SmartContract.ABI.Entry, opt_index); }; -/** @param {?proto.protocol.Endpoint|undefined} value */ -proto.protocol.HelloMessage.prototype.setFrom = function(value) { - jspb.Message.setWrapperField(this, 1, value); +proto.protocol.SmartContract.ABI.prototype.clearEntrysList = function() { + this.setEntrysList([]); }; -proto.protocol.HelloMessage.prototype.clearFrom = function() { - this.setFrom(undefined); +/** + * optional bytes origin_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.SmartContract.prototype.getOriginAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * Returns whether this field is set. - * @return {!boolean} + * optional bytes origin_address = 1; + * This is a type-conversion wrapper around `getOriginAddress()` + * @return {string} */ -proto.protocol.HelloMessage.prototype.hasFrom = function() { - return jspb.Message.getField(this, 1) != null; +proto.protocol.SmartContract.prototype.getOriginAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOriginAddress())); }; /** - * optional int32 version = 2; - * @return {number} + * optional bytes origin_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOriginAddress()` + * @return {!Uint8Array} */ -proto.protocol.HelloMessage.prototype.getVersion = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.protocol.SmartContract.prototype.getOriginAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOriginAddress())); }; -/** @param {number} value */ -proto.protocol.HelloMessage.prototype.setVersion = function(value) { - jspb.Message.setProto3IntField(this, 2, value); +/** @param {!(string|Uint8Array)} value */ +proto.protocol.SmartContract.prototype.setOriginAddress = function(value) { + jspb.Message.setField(this, 1, value); }; /** - * optional int64 timestamp = 3; - * @return {number} + * optional bytes contract_address = 2; + * @return {!(string|Uint8Array)} */ -proto.protocol.HelloMessage.prototype.getTimestamp = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +proto.protocol.SmartContract.prototype.getContractAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; -/** @param {number} value */ -proto.protocol.HelloMessage.prototype.setTimestamp = function(value) { - jspb.Message.setProto3IntField(this, 3, value); +/** + * optional bytes contract_address = 2; + * This is a type-conversion wrapper around `getContractAddress()` + * @return {string} + */ +proto.protocol.SmartContract.prototype.getContractAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getContractAddress())); }; /** - * optional BlockId genesisBlockId = 4; - * @return {?proto.protocol.HelloMessage.BlockId} + * optional bytes contract_address = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getContractAddress()` + * @return {!Uint8Array} */ -proto.protocol.HelloMessage.prototype.getGenesisblockid = function() { - return /** @type{?proto.protocol.HelloMessage.BlockId} */ ( - jspb.Message.getWrapperField(this, proto.protocol.HelloMessage.BlockId, 4)); +proto.protocol.SmartContract.prototype.getContractAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getContractAddress())); }; -/** @param {?proto.protocol.HelloMessage.BlockId|undefined} value */ -proto.protocol.HelloMessage.prototype.setGenesisblockid = function(value) { - jspb.Message.setWrapperField(this, 4, value); +/** @param {!(string|Uint8Array)} value */ +proto.protocol.SmartContract.prototype.setContractAddress = function(value) { + jspb.Message.setField(this, 2, value); }; -proto.protocol.HelloMessage.prototype.clearGenesisblockid = function() { - this.setGenesisblockid(undefined); +/** + * optional ABI abi = 3; + * @return {?proto.protocol.SmartContract.ABI} + */ +proto.protocol.SmartContract.prototype.getAbi = function() { + return /** @type{?proto.protocol.SmartContract.ABI} */ ( + jspb.Message.getWrapperField(this, proto.protocol.SmartContract.ABI, 3)); +}; + + +/** @param {?proto.protocol.SmartContract.ABI|undefined} value */ +proto.protocol.SmartContract.prototype.setAbi = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +proto.protocol.SmartContract.prototype.clearAbi = function() { + this.setAbi(undefined); }; @@ -7629,68 +11893,92 @@ proto.protocol.HelloMessage.prototype.clearGenesisblockid = function() { * Returns whether this field is set. * @return {!boolean} */ -proto.protocol.HelloMessage.prototype.hasGenesisblockid = function() { - return jspb.Message.getField(this, 4) != null; +proto.protocol.SmartContract.prototype.hasAbi = function() { + return jspb.Message.getField(this, 3) != null; }; /** - * optional BlockId solidBlockId = 5; - * @return {?proto.protocol.HelloMessage.BlockId} + * optional bytes bytecode = 4; + * @return {!(string|Uint8Array)} */ -proto.protocol.HelloMessage.prototype.getSolidblockid = function() { - return /** @type{?proto.protocol.HelloMessage.BlockId} */ ( - jspb.Message.getWrapperField(this, proto.protocol.HelloMessage.BlockId, 5)); +proto.protocol.SmartContract.prototype.getBytecode = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; -/** @param {?proto.protocol.HelloMessage.BlockId|undefined} value */ -proto.protocol.HelloMessage.prototype.setSolidblockid = function(value) { - jspb.Message.setWrapperField(this, 5, value); +/** + * optional bytes bytecode = 4; + * This is a type-conversion wrapper around `getBytecode()` + * @return {string} + */ +proto.protocol.SmartContract.prototype.getBytecode_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBytecode())); }; -proto.protocol.HelloMessage.prototype.clearSolidblockid = function() { - this.setSolidblockid(undefined); +/** + * optional bytes bytecode = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBytecode()` + * @return {!Uint8Array} + */ +proto.protocol.SmartContract.prototype.getBytecode_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBytecode())); }; -/** - * Returns whether this field is set. - * @return {!boolean} - */ -proto.protocol.HelloMessage.prototype.hasSolidblockid = function() { - return jspb.Message.getField(this, 5) != null; +/** @param {!(string|Uint8Array)} value */ +proto.protocol.SmartContract.prototype.setBytecode = function(value) { + jspb.Message.setField(this, 4, value); }; /** - * optional BlockId headBlockId = 6; - * @return {?proto.protocol.HelloMessage.BlockId} + * optional int64 call_value = 5; + * @return {number} */ -proto.protocol.HelloMessage.prototype.getHeadblockid = function() { - return /** @type{?proto.protocol.HelloMessage.BlockId} */ ( - jspb.Message.getWrapperField(this, proto.protocol.HelloMessage.BlockId, 6)); +proto.protocol.SmartContract.prototype.getCallValue = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; -/** @param {?proto.protocol.HelloMessage.BlockId|undefined} value */ -proto.protocol.HelloMessage.prototype.setHeadblockid = function(value) { - jspb.Message.setWrapperField(this, 6, value); +/** @param {number} value */ +proto.protocol.SmartContract.prototype.setCallValue = function(value) { + jspb.Message.setField(this, 5, value); }; -proto.protocol.HelloMessage.prototype.clearHeadblockid = function() { - this.setHeadblockid(undefined); +/** + * optional int64 consume_user_resource_percent = 6; + * @return {number} + */ +proto.protocol.SmartContract.prototype.getConsumeUserResourcePercent = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** @param {number} value */ +proto.protocol.SmartContract.prototype.setConsumeUserResourcePercent = function(value) { + jspb.Message.setField(this, 6, value); }; /** - * Returns whether this field is set. - * @return {!boolean} + * optional string name = 7; + * @return {string} */ -proto.protocol.HelloMessage.prototype.hasHeadblockid = function() { - return jspb.Message.getField(this, 6) != null; +proto.protocol.SmartContract.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** @param {string} value */ +proto.protocol.SmartContract.prototype.setName = function(value) { + jspb.Message.setField(this, 7, value); }; @@ -7729,6 +12017,7 @@ proto.protocol.ReasonCode = { INCOMPATIBLE_CHAIN: 25, TIME_OUT: 32, CONNECT_FAIL: 33, + TOO_MANY_PEERS_WITH_SAME_IP: 34, UNKNOWN: 255 }; From f0eccb4e5c1345122bb62b5e167402d49117098a Mon Sep 17 00:00:00 2001 From: Roy van Kaathoven Date: Thu, 20 Sep 2018 23:48:38 +0200 Subject: [PATCH 2/9] v0.3.0-tvm --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 17a1b3f..bcec8e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tronscan/client", - "version": "0.2.12", + "version": "0.3.0-tvm", "description": "Tronscan API Client", "main": "src/index.js", "homepage": "https://api.tronscan.org/", From f57022b759b40a978f9d2c411330e426ccb60999 Mon Sep 17 00:00:00 2001 From: Roy van Kaathoven Date: Thu, 20 Sep 2018 23:50:39 +0200 Subject: [PATCH 3/9] v0.3.1-tvm --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bcec8e3..8ce4cf7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tronscan/client", - "version": "0.3.0-tvm", + "version": "0.3.1-tvm", "description": "Tronscan API Client", "main": "src/index.js", "homepage": "https://api.tronscan.org/", From 3e7f07ab562351ebf2eecaf533289a859cf1a8c7 Mon Sep 17 00:00:00 2001 From: Roy van Kaathoven Date: Sat, 1 Dec 2018 17:00:34 +0800 Subject: [PATCH 4/9] update protobufs --- protobuf/api/api.proto | 91 ++- protobuf/core/Contract.proto | 23 + protobuf/core/Tron.proto | 46 +- src/protocol/core/Contract_pb.js | 941 ++++++++++++++++++++++ src/protocol/core/Tron_pb.js | 1262 ++++++++++++++++++++++++++---- 5 files changed, 2213 insertions(+), 150 deletions(-) diff --git a/protobuf/api/api.proto b/protobuf/api/api.proto index a84e460..2373631 100644 --- a/protobuf/api/api.proto +++ b/protobuf/api/api.proto @@ -415,7 +415,15 @@ service Wallet { } }; }; - + rpc GetPaginatedProposalList (PaginatedMessage) returns (ProposalList) { + option (google.api.http) = { + post: "/wallet/getpaginatedproposallist" + body: "*" + additional_bindings { + get: "/wallet/getpaginatedproposallist" + } + }; + } rpc GetProposalById (BytesMessage) returns (Proposal) { option (google.api.http) = { post: "/wallet/getproposalbyid" @@ -435,7 +443,15 @@ service Wallet { } }; }; - + rpc GetPaginatedExchangeList (PaginatedMessage) returns (ExchangeList) { + option (google.api.http) = { + post: "/wallet/getpaginatedexchangelist" + body: "*" + additional_bindings { + get: "/wallet/getpaginatedexchangelist" + } + }; + } rpc GetExchangeById (BytesMessage) returns (Exchange) { option (google.api.http) = { post: "/wallet/getexchangebyid" @@ -474,6 +490,8 @@ service Wallet { } }; } + + rpc TotalTransaction (EmptyMessage) returns (NumberMessage) { option (google.api.http) = { post: "/wallet/totaltransaction" @@ -558,6 +576,54 @@ service Wallet { } }; } + + rpc AccountPermissionUpdate (AccountPermissionUpdateContract) returns (TransactionExtention) { + option (google.api.http) = { + post: "/wallet/accountpermissionupdate" + body: "*" + additional_bindings { + get: "/wallet/accountpermissionupdate" + } + }; + } + + rpc PermissionAddKey (PermissionAddKeyContract) returns (TransactionExtention) { + option (google.api.http) = { + post: "/wallet/permissionaddkey" + body: "*" + additional_bindings { + get: "/wallet/permissionaddkey" + } + }; + } + + rpc PermissionUpdateKey (PermissionUpdateKeyContract) returns (TransactionExtention) { + option (google.api.http) = { + post: "/wallet/permissionupdatekey" + body: "*" + additional_bindings { + get: "/wallet/permissionupdatekey" + } + }; + } + + rpc PermissionDeleteKey (PermissionDeleteKeyContract) returns (TransactionExtention) { + option (google.api.http) = { + post: "/wallet/permissiondeletekey" + body: "*" + additional_bindings { + get: "/wallet/permissiondeletekey" + } + }; + } + + rpc AddSign (TransactionSign) returns (TransactionExtention) { + + } + + rpc GetTransactionSignWeight (Transaction) returns (TransactionSignWeight) { + + } }; @@ -887,4 +953,25 @@ message BlockListExtention { message TransactionListExtention { repeated TransactionExtention transaction = 1; +} + +message TransactionSignWeight { + message Result { + enum response_code { + ENOUGH_PERMISSION = 0; + NOT_ENOUGH_PERMISSION = 1; // error in + SIGNATURE_FORMAT_ERROR = 2; + COMPUTE_ADDRESS_ERROR = 3; + PERMISSION_ERROR = 4; //The key is not in permission + OTHER_ERROR = 20; + } + response_code code = 1; + string message = 2; + } + + Permission permission = 1; + repeated bytes approved_list = 2; + int64 current_weight = 3; + Result result = 4; + TransactionExtention transaction = 5; } \ No newline at end of file diff --git a/protobuf/core/Contract.proto b/protobuf/core/Contract.proto index 18eafde..6704bbf 100644 --- a/protobuf/core/Contract.proto +++ b/protobuf/core/Contract.proto @@ -226,4 +226,27 @@ message ExchangeTransactionContract { bytes token_id = 3; int64 quant = 4; int64 expected = 5; +} + +message AccountPermissionUpdateContract { + bytes owner_address = 1; + repeated Permission permissions = 2; +} + +message PermissionAddKeyContract { + bytes owner_address = 1; + Key key = 2; + string permission_name = 3; +} + +message PermissionUpdateKeyContract { + bytes owner_address = 1; + Key key = 2; + string permission_name = 3; +} + +message PermissionDeleteKeyContract { + bytes owner_address = 1; + bytes key_address = 2; + string permission_name = 3; } \ No newline at end of file diff --git a/protobuf/core/Tron.proto b/protobuf/core/Tron.proto index 38c4f3a..a9543cf 100644 --- a/protobuf/core/Tron.proto +++ b/protobuf/core/Tron.proto @@ -129,18 +129,30 @@ message Account { int64 latest_exchange_storage_time = 8; } AccountResource account_resource = 26; - bytes codeHash = 30; + repeated Permission permissions = 31; } -message authority { - AccountId account = 1; - bytes permission_name = 2; +message Key { + bytes address = 1; + int64 weight = 2; +} + +message Permission { + string name = 1; + int64 threshold = 2; + string parent = 3; + repeated Key keys = 4; } -message permission { +message authority { AccountId account = 1; + bytes permission_name = 2; } +// +//message permission { +// AccountId account = 1; +//} // Witness message Witness { @@ -227,6 +239,10 @@ message Transaction { ExchangeInjectContract = 42; ExchangeWithdrawContract = 43; ExchangeTransactionContract = 44; + AccountPermissionUpdateContract = 45; + PermissionAddKeyContract = 46; + PermissionUpdateKeyContract = 47; + PermissionDeleteKeyContract = 48; } ContractType type = 1; google.protobuf.Any parameter = 2; @@ -308,6 +324,7 @@ message TransactionInfo { int64 withdraw_amount = 15; int64 unfreeze_amount = 16; + repeated InternalTransaction internal_transactions = 17; } message Transactions { @@ -482,4 +499,23 @@ message SmartContract { int64 consume_user_resource_percent = 6; string name = 7; +} + +message InternalTransaction { + // internalTransaction identity, the root InternalTransaction hash + // should equals to root transaction id. + bytes hash = 1; + // the one send trx (TBD: or token) via function + bytes caller_address = 2; + // the one recieve trx (TBD: or token) via function + bytes transferTo_address = 3; + message CallValueInfo{ + // trx (TBD: or token) value + int64 callValue = 1; + // TBD: tokenName, trx should be empty + bytes tokenName = 2; + } + repeated CallValueInfo callValueInfo = 4; + bytes note = 5; + bool rejected = 6; } \ No newline at end of file diff --git a/src/protocol/core/Contract_pb.js b/src/protocol/core/Contract_pb.js index 79e1586..11d6be9 100644 --- a/src/protocol/core/Contract_pb.js +++ b/src/protocol/core/Contract_pb.js @@ -13,6 +13,7 @@ var global = Function('return this')(); var core_Tron_pb = require('../core/Tron_pb.js'); goog.exportSymbol('proto.protocol.AccountCreateContract', null, global); +goog.exportSymbol('proto.protocol.AccountPermissionUpdateContract', null, global); goog.exportSymbol('proto.protocol.AccountUpdateContract', null, global); goog.exportSymbol('proto.protocol.AssetIssueContract', null, global); goog.exportSymbol('proto.protocol.AssetIssueContract.FrozenSupply', null, global); @@ -25,6 +26,9 @@ goog.exportSymbol('proto.protocol.ExchangeTransactionContract', null, global); goog.exportSymbol('proto.protocol.ExchangeWithdrawContract', null, global); goog.exportSymbol('proto.protocol.FreezeBalanceContract', null, global); goog.exportSymbol('proto.protocol.ParticipateAssetIssueContract', null, global); +goog.exportSymbol('proto.protocol.PermissionAddKeyContract', null, global); +goog.exportSymbol('proto.protocol.PermissionDeleteKeyContract', null, global); +goog.exportSymbol('proto.protocol.PermissionUpdateKeyContract', null, global); goog.exportSymbol('proto.protocol.ProposalApproveContract', null, global); goog.exportSymbol('proto.protocol.ProposalCreateContract', null, global); goog.exportSymbol('proto.protocol.ProposalDeleteContract', null, global); @@ -7808,6 +7812,943 @@ proto.protocol.ExchangeTransactionContract.prototype.setExpected = function(valu }; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.AccountPermissionUpdateContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.AccountPermissionUpdateContract.repeatedFields_, null); +}; +goog.inherits(proto.protocol.AccountPermissionUpdateContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.AccountPermissionUpdateContract.displayName = 'proto.protocol.AccountPermissionUpdateContract'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.AccountPermissionUpdateContract.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.AccountPermissionUpdateContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.AccountPermissionUpdateContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.AccountPermissionUpdateContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.AccountPermissionUpdateContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + permissionsList: jspb.Message.toObjectList(msg.getPermissionsList(), + core_Tron_pb.Permission.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.AccountPermissionUpdateContract} + */ +proto.protocol.AccountPermissionUpdateContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.AccountPermissionUpdateContract; + return proto.protocol.AccountPermissionUpdateContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.AccountPermissionUpdateContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.AccountPermissionUpdateContract} + */ +proto.protocol.AccountPermissionUpdateContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = new core_Tron_pb.Permission; + reader.readMessage(value,core_Tron_pb.Permission.deserializeBinaryFromReader); + msg.addPermissions(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.AccountPermissionUpdateContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.AccountPermissionUpdateContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.AccountPermissionUpdateContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.AccountPermissionUpdateContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getPermissionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + core_Tron_pb.Permission.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.AccountPermissionUpdateContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.AccountPermissionUpdateContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.AccountPermissionUpdateContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.AccountPermissionUpdateContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * repeated Permission permissions = 2; + * @return {!Array.} + */ +proto.protocol.AccountPermissionUpdateContract.prototype.getPermissionsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, core_Tron_pb.Permission, 2)); +}; + + +/** @param {!Array.} value */ +proto.protocol.AccountPermissionUpdateContract.prototype.setPermissionsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.protocol.Permission=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Permission} + */ +proto.protocol.AccountPermissionUpdateContract.prototype.addPermissions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.protocol.Permission, opt_index); +}; + + +proto.protocol.AccountPermissionUpdateContract.prototype.clearPermissionsList = function() { + this.setPermissionsList([]); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.PermissionAddKeyContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.PermissionAddKeyContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.PermissionAddKeyContract.displayName = 'proto.protocol.PermissionAddKeyContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.PermissionAddKeyContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.PermissionAddKeyContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.PermissionAddKeyContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.PermissionAddKeyContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + key: (f = msg.getKey()) && core_Tron_pb.Key.toObject(includeInstance, f), + permissionName: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.PermissionAddKeyContract} + */ +proto.protocol.PermissionAddKeyContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.PermissionAddKeyContract; + return proto.protocol.PermissionAddKeyContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.PermissionAddKeyContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.PermissionAddKeyContract} + */ +proto.protocol.PermissionAddKeyContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = new core_Tron_pb.Key; + reader.readMessage(value,core_Tron_pb.Key.deserializeBinaryFromReader); + msg.setKey(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setPermissionName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.PermissionAddKeyContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.PermissionAddKeyContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.PermissionAddKeyContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.PermissionAddKeyContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getKey(); + if (f != null) { + writer.writeMessage( + 2, + f, + core_Tron_pb.Key.serializeBinaryToWriter + ); + } + f = message.getPermissionName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.PermissionAddKeyContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.PermissionAddKeyContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.PermissionAddKeyContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.PermissionAddKeyContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional Key key = 2; + * @return {?proto.protocol.Key} + */ +proto.protocol.PermissionAddKeyContract.prototype.getKey = function() { + return /** @type{?proto.protocol.Key} */ ( + jspb.Message.getWrapperField(this, core_Tron_pb.Key, 2)); +}; + + +/** @param {?proto.protocol.Key|undefined} value */ +proto.protocol.PermissionAddKeyContract.prototype.setKey = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +proto.protocol.PermissionAddKeyContract.prototype.clearKey = function() { + this.setKey(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.PermissionAddKeyContract.prototype.hasKey = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional string permission_name = 3; + * @return {string} + */ +proto.protocol.PermissionAddKeyContract.prototype.getPermissionName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.protocol.PermissionAddKeyContract.prototype.setPermissionName = function(value) { + jspb.Message.setField(this, 3, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.PermissionUpdateKeyContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.PermissionUpdateKeyContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.PermissionUpdateKeyContract.displayName = 'proto.protocol.PermissionUpdateKeyContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.PermissionUpdateKeyContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.PermissionUpdateKeyContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.PermissionUpdateKeyContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.PermissionUpdateKeyContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + key: (f = msg.getKey()) && core_Tron_pb.Key.toObject(includeInstance, f), + permissionName: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.PermissionUpdateKeyContract} + */ +proto.protocol.PermissionUpdateKeyContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.PermissionUpdateKeyContract; + return proto.protocol.PermissionUpdateKeyContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.PermissionUpdateKeyContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.PermissionUpdateKeyContract} + */ +proto.protocol.PermissionUpdateKeyContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = new core_Tron_pb.Key; + reader.readMessage(value,core_Tron_pb.Key.deserializeBinaryFromReader); + msg.setKey(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setPermissionName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.PermissionUpdateKeyContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.PermissionUpdateKeyContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.PermissionUpdateKeyContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.PermissionUpdateKeyContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getKey(); + if (f != null) { + writer.writeMessage( + 2, + f, + core_Tron_pb.Key.serializeBinaryToWriter + ); + } + f = message.getPermissionName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.PermissionUpdateKeyContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.PermissionUpdateKeyContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.PermissionUpdateKeyContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.PermissionUpdateKeyContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional Key key = 2; + * @return {?proto.protocol.Key} + */ +proto.protocol.PermissionUpdateKeyContract.prototype.getKey = function() { + return /** @type{?proto.protocol.Key} */ ( + jspb.Message.getWrapperField(this, core_Tron_pb.Key, 2)); +}; + + +/** @param {?proto.protocol.Key|undefined} value */ +proto.protocol.PermissionUpdateKeyContract.prototype.setKey = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +proto.protocol.PermissionUpdateKeyContract.prototype.clearKey = function() { + this.setKey(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.PermissionUpdateKeyContract.prototype.hasKey = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional string permission_name = 3; + * @return {string} + */ +proto.protocol.PermissionUpdateKeyContract.prototype.getPermissionName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.protocol.PermissionUpdateKeyContract.prototype.setPermissionName = function(value) { + jspb.Message.setField(this, 3, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.PermissionDeleteKeyContract = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.PermissionDeleteKeyContract, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.PermissionDeleteKeyContract.displayName = 'proto.protocol.PermissionDeleteKeyContract'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.PermissionDeleteKeyContract.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.PermissionDeleteKeyContract.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.PermissionDeleteKeyContract} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.PermissionDeleteKeyContract.toObject = function(includeInstance, msg) { + var f, obj = { + ownerAddress: msg.getOwnerAddress_asB64(), + keyAddress: msg.getKeyAddress_asB64(), + permissionName: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.PermissionDeleteKeyContract} + */ +proto.protocol.PermissionDeleteKeyContract.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.PermissionDeleteKeyContract; + return proto.protocol.PermissionDeleteKeyContract.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.PermissionDeleteKeyContract} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.PermissionDeleteKeyContract} + */ +proto.protocol.PermissionDeleteKeyContract.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOwnerAddress(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setKeyAddress(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setPermissionName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.PermissionDeleteKeyContract.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.PermissionDeleteKeyContract.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.PermissionDeleteKeyContract} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.PermissionDeleteKeyContract.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOwnerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getKeyAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getPermissionName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional bytes owner_address = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.PermissionDeleteKeyContract.prototype.getOwnerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes owner_address = 1; + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {string} + */ +proto.protocol.PermissionDeleteKeyContract.prototype.getOwnerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOwnerAddress())); +}; + + +/** + * optional bytes owner_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOwnerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.PermissionDeleteKeyContract.prototype.getOwnerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOwnerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.PermissionDeleteKeyContract.prototype.setOwnerAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional bytes key_address = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.PermissionDeleteKeyContract.prototype.getKeyAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes key_address = 2; + * This is a type-conversion wrapper around `getKeyAddress()` + * @return {string} + */ +proto.protocol.PermissionDeleteKeyContract.prototype.getKeyAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getKeyAddress())); +}; + + +/** + * optional bytes key_address = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getKeyAddress()` + * @return {!Uint8Array} + */ +proto.protocol.PermissionDeleteKeyContract.prototype.getKeyAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getKeyAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.PermissionDeleteKeyContract.prototype.setKeyAddress = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional string permission_name = 3; + * @return {string} + */ +proto.protocol.PermissionDeleteKeyContract.prototype.getPermissionName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.protocol.PermissionDeleteKeyContract.prototype.setPermissionName = function(value) { + jspb.Message.setField(this, 3, value); +}; + + /** * @enum {number} */ diff --git a/src/protocol/core/Tron_pb.js b/src/protocol/core/Tron_pb.js index d9f54f7..6425585 100644 --- a/src/protocol/core/Tron_pb.js +++ b/src/protocol/core/Tron_pb.js @@ -33,10 +33,14 @@ goog.exportSymbol('proto.protocol.DynamicProperties', null, global); goog.exportSymbol('proto.protocol.Exchange', null, global); goog.exportSymbol('proto.protocol.HelloMessage', null, global); goog.exportSymbol('proto.protocol.HelloMessage.BlockId', null, global); +goog.exportSymbol('proto.protocol.InternalTransaction', null, global); +goog.exportSymbol('proto.protocol.InternalTransaction.CallValueInfo', null, global); goog.exportSymbol('proto.protocol.Inventory', null, global); goog.exportSymbol('proto.protocol.Inventory.InventoryType', null, global); goog.exportSymbol('proto.protocol.Items', null, global); goog.exportSymbol('proto.protocol.Items.ItemType', null, global); +goog.exportSymbol('proto.protocol.Key', null, global); +goog.exportSymbol('proto.protocol.Permission', null, global); goog.exportSymbol('proto.protocol.Proposal', null, global); goog.exportSymbol('proto.protocol.Proposal.State', null, global); goog.exportSymbol('proto.protocol.ReasonCode', null, global); @@ -67,7 +71,6 @@ goog.exportSymbol('proto.protocol.Vote', null, global); goog.exportSymbol('proto.protocol.Votes', null, global); goog.exportSymbol('proto.protocol.Witness', null, global); goog.exportSymbol('proto.protocol.authority', null, global); -goog.exportSymbol('proto.protocol.permission', null, global); /** * Generated by JsPbCodeGenerator. @@ -1599,7 +1602,7 @@ if (goog.DEBUG && !COMPILED) { * @private {!Array} * @const */ -proto.protocol.Account.repeatedFields_ = [5,7,16]; +proto.protocol.Account.repeatedFields_ = [5,7,16,31]; @@ -1657,7 +1660,9 @@ proto.protocol.Account.toObject = function(includeInstance, msg) { latestConsumeFreeTime: jspb.Message.getFieldWithDefault(msg, 22, 0), accountId: msg.getAccountId_asB64(), accountResource: (f = msg.getAccountResource()) && proto.protocol.Account.AccountResource.toObject(includeInstance, f), - codehash: msg.getCodehash_asB64() + codehash: msg.getCodehash_asB64(), + permissionsList: jspb.Message.toObjectList(msg.getPermissionsList(), + proto.protocol.Permission.toObject, includeInstance) }; if (includeInstance) { @@ -1804,6 +1809,11 @@ proto.protocol.Account.deserializeBinaryFromReader = function(msg, reader) { var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setCodehash(value); break; + case 31: + var value = new proto.protocol.Permission; + reader.readMessage(value,proto.protocol.Permission.deserializeBinaryFromReader); + msg.addPermissions(value); + break; default: reader.skipField(); break; @@ -2003,6 +2013,14 @@ proto.protocol.Account.serializeBinaryToWriter = function(message, writer) { f ); } + f = message.getPermissionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 31, + f, + proto.protocol.Permission.serializeBinaryToWriter + ); + } }; @@ -3064,6 +3082,37 @@ proto.protocol.Account.prototype.setCodehash = function(value) { }; +/** + * repeated Permission permissions = 31; + * @return {!Array.} + */ +proto.protocol.Account.prototype.getPermissionsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Permission, 31)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Account.prototype.setPermissionsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 31, value); +}; + + +/** + * @param {!proto.protocol.Permission=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Permission} + */ +proto.protocol.Account.prototype.addPermissions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 31, opt_value, proto.protocol.Permission, opt_index); +}; + + +proto.protocol.Account.prototype.clearPermissionsList = function() { + this.setPermissionsList([]); +}; + + /** * Generated by JsPbCodeGenerator. @@ -3075,12 +3124,12 @@ proto.protocol.Account.prototype.setCodehash = function(value) { * @extends {jspb.Message} * @constructor */ -proto.protocol.authority = function(opt_data) { +proto.protocol.Key = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.authority, jspb.Message); +goog.inherits(proto.protocol.Key, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.authority.displayName = 'proto.protocol.authority'; + proto.protocol.Key.displayName = 'proto.protocol.Key'; } @@ -3095,8 +3144,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.authority.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.authority.toObject(opt_includeInstance, this); +proto.protocol.Key.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Key.toObject(opt_includeInstance, this); }; @@ -3105,14 +3154,14 @@ proto.protocol.authority.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.authority} msg The msg instance to transform. + * @param {!proto.protocol.Key} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.authority.toObject = function(includeInstance, msg) { +proto.protocol.Key.toObject = function(includeInstance, msg) { var f, obj = { - account: (f = msg.getAccount()) && proto.protocol.AccountId.toObject(includeInstance, f), - permissionName: msg.getPermissionName_asB64() + address: msg.getAddress_asB64(), + weight: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { @@ -3126,23 +3175,23 @@ proto.protocol.authority.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.authority} + * @return {!proto.protocol.Key} */ -proto.protocol.authority.deserializeBinary = function(bytes) { +proto.protocol.Key.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.authority; - return proto.protocol.authority.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.Key; + return proto.protocol.Key.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.authority} msg The message object to deserialize into. + * @param {!proto.protocol.Key} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.authority} + * @return {!proto.protocol.Key} */ -proto.protocol.authority.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.Key.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3150,13 +3199,12 @@ proto.protocol.authority.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.protocol.AccountId; - reader.readMessage(value,proto.protocol.AccountId.deserializeBinaryFromReader); - msg.setAccount(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAddress(value); break; case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setPermissionName(value); + var value = /** @type {number} */ (reader.readInt64()); + msg.setWeight(value); break; default: reader.skipField(); @@ -3171,9 +3219,9 @@ proto.protocol.authority.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.authority.prototype.serializeBinary = function() { +proto.protocol.Key.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.authority.serializeBinaryToWriter(this, writer); + proto.protocol.Key.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3181,23 +3229,22 @@ proto.protocol.authority.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.authority} message + * @param {!proto.protocol.Key} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.authority.serializeBinaryToWriter = function(message, writer) { +proto.protocol.Key.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getAccount(); - if (f != null) { - writer.writeMessage( + f = message.getAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( 1, - f, - proto.protocol.AccountId.serializeBinaryToWriter + f ); } - f = message.getPermissionName_asU8(); - if (f.length > 0) { - writer.writeBytes( + f = message.getWeight(); + if (f !== 0) { + writer.writeInt64( 2, f ); @@ -3206,70 +3253,55 @@ proto.protocol.authority.serializeBinaryToWriter = function(message, writer) { /** - * optional AccountId account = 1; - * @return {?proto.protocol.AccountId} - */ -proto.protocol.authority.prototype.getAccount = function() { - return /** @type{?proto.protocol.AccountId} */ ( - jspb.Message.getWrapperField(this, proto.protocol.AccountId, 1)); -}; - - -/** @param {?proto.protocol.AccountId|undefined} value */ -proto.protocol.authority.prototype.setAccount = function(value) { - jspb.Message.setWrapperField(this, 1, value); -}; - - -proto.protocol.authority.prototype.clearAccount = function() { - this.setAccount(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {!boolean} - */ -proto.protocol.authority.prototype.hasAccount = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional bytes permission_name = 2; + * optional bytes address = 1; * @return {!(string|Uint8Array)} */ -proto.protocol.authority.prototype.getPermissionName = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.protocol.Key.prototype.getAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional bytes permission_name = 2; - * This is a type-conversion wrapper around `getPermissionName()` + * optional bytes address = 1; + * This is a type-conversion wrapper around `getAddress()` * @return {string} */ -proto.protocol.authority.prototype.getPermissionName_asB64 = function() { +proto.protocol.Key.prototype.getAddress_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getPermissionName())); + this.getAddress())); }; /** - * optional bytes permission_name = 2; + * optional bytes address = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getPermissionName()` + * This is a type-conversion wrapper around `getAddress()` * @return {!Uint8Array} */ -proto.protocol.authority.prototype.getPermissionName_asU8 = function() { +proto.protocol.Key.prototype.getAddress_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getPermissionName())); + this.getAddress())); }; /** @param {!(string|Uint8Array)} value */ -proto.protocol.authority.prototype.setPermissionName = function(value) { +proto.protocol.Key.prototype.setAddress = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional int64 weight = 2; + * @return {number} + */ +proto.protocol.Key.prototype.getWeight = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Key.prototype.setWeight = function(value) { jspb.Message.setField(this, 2, value); }; @@ -3285,13 +3317,20 @@ proto.protocol.authority.prototype.setPermissionName = function(value) { * @extends {jspb.Message} * @constructor */ -proto.protocol.permission = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.protocol.Permission = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Permission.repeatedFields_, null); }; -goog.inherits(proto.protocol.permission, jspb.Message); +goog.inherits(proto.protocol.Permission, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.permission.displayName = 'proto.protocol.permission'; + proto.protocol.Permission.displayName = 'proto.protocol.Permission'; } +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.Permission.repeatedFields_ = [4]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -3305,8 +3344,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.permission.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.permission.toObject(opt_includeInstance, this); +proto.protocol.Permission.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Permission.toObject(opt_includeInstance, this); }; @@ -3315,13 +3354,17 @@ proto.protocol.permission.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.permission} msg The msg instance to transform. + * @param {!proto.protocol.Permission} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.permission.toObject = function(includeInstance, msg) { +proto.protocol.Permission.toObject = function(includeInstance, msg) { var f, obj = { - account: (f = msg.getAccount()) && proto.protocol.AccountId.toObject(includeInstance, f) + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + threshold: jspb.Message.getFieldWithDefault(msg, 2, 0), + parent: jspb.Message.getFieldWithDefault(msg, 3, ""), + keysList: jspb.Message.toObjectList(msg.getKeysList(), + proto.protocol.Key.toObject, includeInstance) }; if (includeInstance) { @@ -3335,23 +3378,23 @@ proto.protocol.permission.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.permission} + * @return {!proto.protocol.Permission} */ -proto.protocol.permission.deserializeBinary = function(bytes) { +proto.protocol.Permission.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.permission; - return proto.protocol.permission.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.Permission; + return proto.protocol.Permission.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.permission} msg The message object to deserialize into. + * @param {!proto.protocol.Permission} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.protocol.permission} + * @return {!proto.protocol.Permission} */ -proto.protocol.permission.deserializeBinaryFromReader = function(msg, reader) { +proto.protocol.Permission.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3359,9 +3402,21 @@ proto.protocol.permission.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.protocol.AccountId; - reader.readMessage(value,proto.protocol.AccountId.deserializeBinaryFromReader); - msg.setAccount(value); + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setThreshold(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setParent(value); + break; + case 4: + var value = new proto.protocol.Key; + reader.readMessage(value,proto.protocol.Key.deserializeBinaryFromReader); + msg.addKeys(value); break; default: reader.skipField(); @@ -3376,9 +3431,9 @@ proto.protocol.permission.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.protocol.permission.prototype.serializeBinary = function() { +proto.protocol.Permission.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.protocol.permission.serializeBinaryToWriter(this, writer); + proto.protocol.Permission.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3386,50 +3441,117 @@ proto.protocol.permission.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.protocol.permission} message + * @param {!proto.protocol.Permission} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.permission.serializeBinaryToWriter = function(message, writer) { +proto.protocol.Permission.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getAccount(); - if (f != null) { - writer.writeMessage( + f = message.getName(); + if (f.length > 0) { + writer.writeString( 1, + f + ); + } + f = message.getThreshold(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getParent(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getKeysList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, f, - proto.protocol.AccountId.serializeBinaryToWriter + proto.protocol.Key.serializeBinaryToWriter ); } }; /** - * optional AccountId account = 1; - * @return {?proto.protocol.AccountId} + * optional string name = 1; + * @return {string} */ -proto.protocol.permission.prototype.getAccount = function() { - return /** @type{?proto.protocol.AccountId} */ ( - jspb.Message.getWrapperField(this, proto.protocol.AccountId, 1)); +proto.protocol.Permission.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; -/** @param {?proto.protocol.AccountId|undefined} value */ -proto.protocol.permission.prototype.setAccount = function(value) { - jspb.Message.setWrapperField(this, 1, value); +/** @param {string} value */ +proto.protocol.Permission.prototype.setName = function(value) { + jspb.Message.setField(this, 1, value); }; -proto.protocol.permission.prototype.clearAccount = function() { - this.setAccount(undefined); +/** + * optional int64 threshold = 2; + * @return {number} + */ +proto.protocol.Permission.prototype.getThreshold = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.protocol.Permission.prototype.setThreshold = function(value) { + jspb.Message.setField(this, 2, value); }; /** - * Returns whether this field is set. - * @return {!boolean} + * optional string parent = 3; + * @return {string} */ -proto.protocol.permission.prototype.hasAccount = function() { - return jspb.Message.getField(this, 1) != null; +proto.protocol.Permission.prototype.getParent = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.protocol.Permission.prototype.setParent = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * repeated Key keys = 4; + * @return {!Array.} + */ +proto.protocol.Permission.prototype.getKeysList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.Key, 4)); +}; + + +/** @param {!Array.} value */ +proto.protocol.Permission.prototype.setKeysList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.protocol.Key=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.Key} + */ +proto.protocol.Permission.prototype.addKeys = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.protocol.Key, opt_index); +}; + + +proto.protocol.Permission.prototype.clearKeysList = function() { + this.setKeysList([]); }; @@ -3444,12 +3566,12 @@ proto.protocol.permission.prototype.hasAccount = function() { * @extends {jspb.Message} * @constructor */ -proto.protocol.Witness = function(opt_data) { +proto.protocol.authority = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.protocol.Witness, jspb.Message); +goog.inherits(proto.protocol.authority, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.protocol.Witness.displayName = 'proto.protocol.Witness'; + proto.protocol.authority.displayName = 'proto.protocol.authority'; } @@ -3464,8 +3586,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.protocol.Witness.prototype.toObject = function(opt_includeInstance) { - return proto.protocol.Witness.toObject(opt_includeInstance, this); +proto.protocol.authority.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.authority.toObject(opt_includeInstance, this); }; @@ -3474,21 +3596,14 @@ proto.protocol.Witness.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.protocol.Witness} msg The msg instance to transform. + * @param {!proto.protocol.authority} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.protocol.Witness.toObject = function(includeInstance, msg) { +proto.protocol.authority.toObject = function(includeInstance, msg) { var f, obj = { - address: msg.getAddress_asB64(), - votecount: jspb.Message.getFieldWithDefault(msg, 2, 0), - pubkey: msg.getPubkey_asB64(), - url: jspb.Message.getFieldWithDefault(msg, 4, ""), - totalproduced: jspb.Message.getFieldWithDefault(msg, 5, 0), - totalmissed: jspb.Message.getFieldWithDefault(msg, 6, 0), - latestblocknum: jspb.Message.getFieldWithDefault(msg, 7, 0), - latestslotnum: jspb.Message.getFieldWithDefault(msg, 8, 0), - isjobs: jspb.Message.getFieldWithDefault(msg, 9, false) + account: (f = msg.getAccount()) && proto.protocol.AccountId.toObject(includeInstance, f), + permissionName: msg.getPermissionName_asB64() }; if (includeInstance) { @@ -3502,19 +3617,236 @@ proto.protocol.Witness.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.protocol.Witness} + * @return {!proto.protocol.authority} */ -proto.protocol.Witness.deserializeBinary = function(bytes) { +proto.protocol.authority.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.protocol.Witness; - return proto.protocol.Witness.deserializeBinaryFromReader(msg, reader); + var msg = new proto.protocol.authority; + return proto.protocol.authority.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.protocol.Witness} msg The message object to deserialize into. + * @param {!proto.protocol.authority} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.authority} + */ +proto.protocol.authority.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.protocol.AccountId; + reader.readMessage(value,proto.protocol.AccountId.deserializeBinaryFromReader); + msg.setAccount(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPermissionName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.authority.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.authority.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.authority} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.authority.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAccount(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.protocol.AccountId.serializeBinaryToWriter + ); + } + f = message.getPermissionName_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional AccountId account = 1; + * @return {?proto.protocol.AccountId} + */ +proto.protocol.authority.prototype.getAccount = function() { + return /** @type{?proto.protocol.AccountId} */ ( + jspb.Message.getWrapperField(this, proto.protocol.AccountId, 1)); +}; + + +/** @param {?proto.protocol.AccountId|undefined} value */ +proto.protocol.authority.prototype.setAccount = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.protocol.authority.prototype.clearAccount = function() { + this.setAccount(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.protocol.authority.prototype.hasAccount = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes permission_name = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.authority.prototype.getPermissionName = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes permission_name = 2; + * This is a type-conversion wrapper around `getPermissionName()` + * @return {string} + */ +proto.protocol.authority.prototype.getPermissionName_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPermissionName())); +}; + + +/** + * optional bytes permission_name = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPermissionName()` + * @return {!Uint8Array} + */ +proto.protocol.authority.prototype.getPermissionName_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPermissionName())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.authority.prototype.setPermissionName = function(value) { + jspb.Message.setField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.Witness = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.Witness, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.Witness.displayName = 'proto.protocol.Witness'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.Witness.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.Witness.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.Witness} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.Witness.toObject = function(includeInstance, msg) { + var f, obj = { + address: msg.getAddress_asB64(), + votecount: jspb.Message.getFieldWithDefault(msg, 2, 0), + pubkey: msg.getPubkey_asB64(), + url: jspb.Message.getFieldWithDefault(msg, 4, ""), + totalproduced: jspb.Message.getFieldWithDefault(msg, 5, 0), + totalmissed: jspb.Message.getFieldWithDefault(msg, 6, 0), + latestblocknum: jspb.Message.getFieldWithDefault(msg, 7, 0), + latestslotnum: jspb.Message.getFieldWithDefault(msg, 8, 0), + isjobs: jspb.Message.getFieldWithDefault(msg, 9, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.Witness} + */ +proto.protocol.Witness.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.Witness; + return proto.protocol.Witness.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.Witness} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.protocol.Witness} */ @@ -5584,7 +5916,11 @@ proto.protocol.Transaction.Contract.ContractType = { EXCHANGECREATECONTRACT: 41, EXCHANGEINJECTCONTRACT: 42, EXCHANGEWITHDRAWCONTRACT: 43, - EXCHANGETRANSACTIONCONTRACT: 44 + EXCHANGETRANSACTIONCONTRACT: 44, + ACCOUNTPERMISSIONUPDATECONTRACT: 45, + PERMISSIONADDKEYCONTRACT: 46, + PERMISSIONUPDATEKEYCONTRACT: 47, + PERMISSIONDELETEKEYCONTRACT: 48 }; /** @@ -6651,7 +6987,7 @@ if (goog.DEBUG && !COMPILED) { * @private {!Array} * @const */ -proto.protocol.TransactionInfo.repeatedFields_ = [5,8]; +proto.protocol.TransactionInfo.repeatedFields_ = [5,8,17]; @@ -6694,7 +7030,9 @@ proto.protocol.TransactionInfo.toObject = function(includeInstance, msg) { result: jspb.Message.getFieldWithDefault(msg, 9, 0), resmessage: msg.getResmessage_asB64(), withdrawAmount: jspb.Message.getFieldWithDefault(msg, 15, 0), - unfreezeAmount: jspb.Message.getFieldWithDefault(msg, 16, 0) + unfreezeAmount: jspb.Message.getFieldWithDefault(msg, 16, 0), + internalTransactionsList: jspb.Message.toObjectList(msg.getInternalTransactionsList(), + proto.protocol.InternalTransaction.toObject, includeInstance) }; if (includeInstance) { @@ -6781,6 +7119,11 @@ proto.protocol.TransactionInfo.deserializeBinaryFromReader = function(msg, reade var value = /** @type {number} */ (reader.readInt64()); msg.setUnfreezeAmount(value); break; + case 17: + var value = new proto.protocol.InternalTransaction; + reader.readMessage(value,proto.protocol.InternalTransaction.deserializeBinaryFromReader); + msg.addInternalTransactions(value); + break; default: reader.skipField(); break; @@ -6896,6 +7239,14 @@ proto.protocol.TransactionInfo.serializeBinaryToWriter = function(message, write f ); } + f = message.getInternalTransactionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 17, + f, + proto.protocol.InternalTransaction.serializeBinaryToWriter + ); + } }; @@ -7517,6 +7868,37 @@ proto.protocol.TransactionInfo.prototype.setUnfreezeAmount = function(value) { }; +/** + * repeated InternalTransaction internal_transactions = 17; + * @return {!Array.} + */ +proto.protocol.TransactionInfo.prototype.getInternalTransactionsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.InternalTransaction, 17)); +}; + + +/** @param {!Array.} value */ +proto.protocol.TransactionInfo.prototype.setInternalTransactionsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 17, value); +}; + + +/** + * @param {!proto.protocol.InternalTransaction=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.InternalTransaction} + */ +proto.protocol.TransactionInfo.prototype.addInternalTransactions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 17, opt_value, proto.protocol.InternalTransaction, opt_index); +}; + + +proto.protocol.TransactionInfo.prototype.clearInternalTransactionsList = function() { + this.setInternalTransactionsList([]); +}; + + /** * Generated by JsPbCodeGenerator. @@ -11982,6 +12364,600 @@ proto.protocol.SmartContract.prototype.setName = function(value) { }; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.InternalTransaction = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.InternalTransaction.repeatedFields_, null); +}; +goog.inherits(proto.protocol.InternalTransaction, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.InternalTransaction.displayName = 'proto.protocol.InternalTransaction'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.protocol.InternalTransaction.repeatedFields_ = [4]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.InternalTransaction.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.InternalTransaction.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.InternalTransaction} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.InternalTransaction.toObject = function(includeInstance, msg) { + var f, obj = { + hash: msg.getHash_asB64(), + callerAddress: msg.getCallerAddress_asB64(), + transfertoAddress: msg.getTransfertoAddress_asB64(), + callvalueinfoList: jspb.Message.toObjectList(msg.getCallvalueinfoList(), + proto.protocol.InternalTransaction.CallValueInfo.toObject, includeInstance), + note: msg.getNote_asB64(), + rejected: jspb.Message.getFieldWithDefault(msg, 6, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.InternalTransaction} + */ +proto.protocol.InternalTransaction.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.InternalTransaction; + return proto.protocol.InternalTransaction.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.InternalTransaction} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.InternalTransaction} + */ +proto.protocol.InternalTransaction.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setHash(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setCallerAddress(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setTransfertoAddress(value); + break; + case 4: + var value = new proto.protocol.InternalTransaction.CallValueInfo; + reader.readMessage(value,proto.protocol.InternalTransaction.CallValueInfo.deserializeBinaryFromReader); + msg.addCallvalueinfo(value); + break; + case 5: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setNote(value); + break; + case 6: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setRejected(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.InternalTransaction.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.InternalTransaction.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.InternalTransaction} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.InternalTransaction.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getCallerAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getTransfertoAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getCallvalueinfoList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.protocol.InternalTransaction.CallValueInfo.serializeBinaryToWriter + ); + } + f = message.getNote_asU8(); + if (f.length > 0) { + writer.writeBytes( + 5, + f + ); + } + f = message.getRejected(); + if (f) { + writer.writeBool( + 6, + f + ); + } +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.protocol.InternalTransaction.CallValueInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.protocol.InternalTransaction.CallValueInfo, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.protocol.InternalTransaction.CallValueInfo.displayName = 'proto.protocol.InternalTransaction.CallValueInfo'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.protocol.InternalTransaction.CallValueInfo.prototype.toObject = function(opt_includeInstance) { + return proto.protocol.InternalTransaction.CallValueInfo.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.protocol.InternalTransaction.CallValueInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.InternalTransaction.CallValueInfo.toObject = function(includeInstance, msg) { + var f, obj = { + callvalue: jspb.Message.getFieldWithDefault(msg, 1, 0), + tokenname: msg.getTokenname_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.protocol.InternalTransaction.CallValueInfo} + */ +proto.protocol.InternalTransaction.CallValueInfo.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.protocol.InternalTransaction.CallValueInfo; + return proto.protocol.InternalTransaction.CallValueInfo.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.protocol.InternalTransaction.CallValueInfo} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.protocol.InternalTransaction.CallValueInfo} + */ +proto.protocol.InternalTransaction.CallValueInfo.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setCallvalue(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setTokenname(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.protocol.InternalTransaction.CallValueInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.protocol.InternalTransaction.CallValueInfo.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.protocol.InternalTransaction.CallValueInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.protocol.InternalTransaction.CallValueInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCallvalue(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getTokenname_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional int64 callValue = 1; + * @return {number} + */ +proto.protocol.InternalTransaction.CallValueInfo.prototype.getCallvalue = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.protocol.InternalTransaction.CallValueInfo.prototype.setCallvalue = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional bytes tokenName = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.InternalTransaction.CallValueInfo.prototype.getTokenname = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes tokenName = 2; + * This is a type-conversion wrapper around `getTokenname()` + * @return {string} + */ +proto.protocol.InternalTransaction.CallValueInfo.prototype.getTokenname_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getTokenname())); +}; + + +/** + * optional bytes tokenName = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTokenname()` + * @return {!Uint8Array} + */ +proto.protocol.InternalTransaction.CallValueInfo.prototype.getTokenname_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getTokenname())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.InternalTransaction.CallValueInfo.prototype.setTokenname = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional bytes hash = 1; + * @return {!(string|Uint8Array)} + */ +proto.protocol.InternalTransaction.prototype.getHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes hash = 1; + * This is a type-conversion wrapper around `getHash()` + * @return {string} + */ +proto.protocol.InternalTransaction.prototype.getHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getHash())); +}; + + +/** + * optional bytes hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getHash()` + * @return {!Uint8Array} + */ +proto.protocol.InternalTransaction.prototype.getHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getHash())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.InternalTransaction.prototype.setHash = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional bytes caller_address = 2; + * @return {!(string|Uint8Array)} + */ +proto.protocol.InternalTransaction.prototype.getCallerAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes caller_address = 2; + * This is a type-conversion wrapper around `getCallerAddress()` + * @return {string} + */ +proto.protocol.InternalTransaction.prototype.getCallerAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getCallerAddress())); +}; + + +/** + * optional bytes caller_address = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getCallerAddress()` + * @return {!Uint8Array} + */ +proto.protocol.InternalTransaction.prototype.getCallerAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getCallerAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.InternalTransaction.prototype.setCallerAddress = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional bytes transferTo_address = 3; + * @return {!(string|Uint8Array)} + */ +proto.protocol.InternalTransaction.prototype.getTransfertoAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes transferTo_address = 3; + * This is a type-conversion wrapper around `getTransfertoAddress()` + * @return {string} + */ +proto.protocol.InternalTransaction.prototype.getTransfertoAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getTransfertoAddress())); +}; + + +/** + * optional bytes transferTo_address = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTransfertoAddress()` + * @return {!Uint8Array} + */ +proto.protocol.InternalTransaction.prototype.getTransfertoAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getTransfertoAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.InternalTransaction.prototype.setTransfertoAddress = function(value) { + jspb.Message.setField(this, 3, value); +}; + + +/** + * repeated CallValueInfo callValueInfo = 4; + * @return {!Array.} + */ +proto.protocol.InternalTransaction.prototype.getCallvalueinfoList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.protocol.InternalTransaction.CallValueInfo, 4)); +}; + + +/** @param {!Array.} value */ +proto.protocol.InternalTransaction.prototype.setCallvalueinfoList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.protocol.InternalTransaction.CallValueInfo=} opt_value + * @param {number=} opt_index + * @return {!proto.protocol.InternalTransaction.CallValueInfo} + */ +proto.protocol.InternalTransaction.prototype.addCallvalueinfo = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.protocol.InternalTransaction.CallValueInfo, opt_index); +}; + + +proto.protocol.InternalTransaction.prototype.clearCallvalueinfoList = function() { + this.setCallvalueinfoList([]); +}; + + +/** + * optional bytes note = 5; + * @return {!(string|Uint8Array)} + */ +proto.protocol.InternalTransaction.prototype.getNote = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * optional bytes note = 5; + * This is a type-conversion wrapper around `getNote()` + * @return {string} + */ +proto.protocol.InternalTransaction.prototype.getNote_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getNote())); +}; + + +/** + * optional bytes note = 5; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getNote()` + * @return {!Uint8Array} + */ +proto.protocol.InternalTransaction.prototype.getNote_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getNote())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.protocol.InternalTransaction.prototype.setNote = function(value) { + jspb.Message.setField(this, 5, value); +}; + + +/** + * optional bool rejected = 6; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.protocol.InternalTransaction.prototype.getRejected = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 6, false)); +}; + + +/** @param {boolean} value */ +proto.protocol.InternalTransaction.prototype.setRejected = function(value) { + jspb.Message.setField(this, 6, value); +}; + + /** * @enum {number} */ From fefbce7c8726efec611dc1a014fc9ae4cb8ff5a1 Mon Sep 17 00:00:00 2001 From: Roy van Kaathoven Date: Tue, 4 Dec 2018 10:34:47 +0800 Subject: [PATCH 5/9] add tronweb -> protobuf conversion --- src/utils/transactionBuilder.js | 1 + src/utils/tronWeb.js | 202 ++++++++++++++++++++++++++++++++ 2 files changed, 203 insertions(+) create mode 100644 src/utils/tronWeb.js diff --git a/src/utils/transactionBuilder.js b/src/utils/transactionBuilder.js index 30ad7e2..882b162 100644 --- a/src/utils/transactionBuilder.js +++ b/src/utils/transactionBuilder.js @@ -228,6 +228,7 @@ function buildUnfreezeAsset(address) { } module.exports = { + buildTransferContract, buildTransferTransaction, buildAccountUpdate, buildAssetParticipate, diff --git a/src/utils/tronWeb.js b/src/utils/tronWeb.js new file mode 100644 index 0000000..dea4576 --- /dev/null +++ b/src/utils/tronWeb.js @@ -0,0 +1,202 @@ +const { buildTransferContract } = require("./transactionBuilder"); +const {Block, Transaction, Account} = require("../protocol/core/Tron_pb"); + +const { + TransferContract, + TransferAssetContract, + AccountUpdateContract, + VoteWitnessContract, + ParticipateAssetIssueContract, + AssetIssueContract, + FreezeBalanceContract, + UnfreezeBalanceContract, + WitnessUpdateContract, + WithdrawBalanceContract, + WitnessCreateContract, + UnfreezeAssetContract, +} = require("../protocol/core/Contract_pb"); + +const fromHexString = hexString => + new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16))); + +export function transactionJsonToProtoBuf(transaction) { + + const rawData = transaction.raw_data; + const contractJson = rawData.contract[0]; + const transactionObj = contractJsonToProtobuf(contractJson); + + const rawDataObj = transactionObj.getRawData(); + + rawDataObj.setRefBlockBytes(fromHexString(rawData.ref_block_bytes)); + rawDataObj.setRefBlockHash(fromHexString(rawData.ref_block_hash)); + if (rawData.expiration) { + rawDataObj.setExpiration(rawData.expiration); + } + + if (rawData.timestamp) { + rawDataObj.setTimestamp(rawData.timestamp); + } + + transactionObj.setRawData(rawDataObj); + + return transactionObj; +} + +export function contractJsonToProtobuf(contract) { + + const value = contract.parameter.value; + + switch (contract.type) { + + case "TransferContract": { + const {to_address, owner_address, amount} = value; + let transferContract = new TransferContract(); + transferContract.setToAddress(fromHexString(to_address)); + transferContract.setOwnerAddress(fromHexString(owner_address)); + transferContract.setAmount(amount); + + return buildTransferContract( + transferContract, + Transaction.Contract.ContractType.TRANSFERCONTRACT, + contract.type); + } + + case "TransferAssetContract": { + const {to_address, owner_address, amount, asset_name} = value; + let transferContract = new TransferAssetContract(); + transferContract.setToAddress(fromHexString(to_address)); + transferContract.setOwnerAddress(fromHexString(owner_address)); + transferContract.setAssetName(asset_name); + transferContract.setAmount(amount); + + return buildTransferContract( + transferContract, + Transaction.Contract.ContractType.TRANSFERASSETCONTRACT, + contract.type); + } + + case "AccountUpdateContract": { + + let contract = new AccountUpdateContract(); + contract.setOwnerAddress(Uint8Array.from(fromHexString(value.owner_address))); + contract.setAccountName(value.account_name); + + return buildTransferContract( + contract, + Transaction.Contract.ContractType.ACCOUNTUPDATECONTRACT, + "AccountUpdateContract"); + } + + case "WitnessCreateContract": { + + let contract = new WitnessCreateContract(); + contract.setOwnerAddress(fromHexString(value.owner_address)); + contract.setUrl(value.url); + + return buildTransferContract( + contract, + Transaction.Contract.ContractType.WITNESSCREATECONTRACT, + "WitnessCreateContract"); + } + + + case "WitnessUpdateContract": { + + let contract = new WitnessUpdateContract(); + contract.setOwnerAddress(fromHexString(value.owner_address)); + contract.setUpdateUrl(value.url); + + return buildTransferContract( + contract, + Transaction.Contract.ContractType.WITNESSUPDATECONTRACT, + "WitnessUpdateContract"); + } + + case "WithdrawBalanceContract": { + + let contract = new WithdrawBalanceContract(); + contract.setOwnerAddress(fromHexString(value.owner_address)); + + return buildTransferContract( + contract, + Transaction.Contract.ContractType.WITHDRAWBALANCECONTRACT, + "WithdrawBalanceContract"); + } + + case "FreezeBalanceContract": { + + // TODO ADD ENERGY SWITCH + + let contract = new FreezeBalanceContract(); + + contract.setOwnerAddress(fromHexString(value.owner_address)); + contract.setFrozenBalance(value.frozen_balance); + contract.setFrozenDuration(value.frozen_duration); + + return buildTransferContract( + contract, + Transaction.Contract.ContractType.FREEZEBALANCECONTRACT, + "FreezeBalanceContract"); + } + + + case "VoteWitnessContract": { + + let contract = new VoteWitnessContract(); + contract.setOwnerAddress(fromHexString(value.owner_address)); + + for (let address of Object.keys(value.votes)) { + let vote = new VoteWitnessContract.Vote(); + vote.setVoteAddress(fromHexString(address.vote_address)); + vote.setVoteCount(address.vote_count); + contract.addVotes(vote); + } + + return buildTransferContract( + contract, + Transaction.Contract.ContractType.VOTEWITNESSCONTRACT, + "VoteWitnessContract"); + } + + case "ParticipateAssetIssueContract": { + + let contract = new ParticipateAssetIssueContract(); + contract.setToAddress(fromHexString(value.to_address)); + contract.setOwnerAddress(fromHexString(value.owner_address)); + contract.setAssetName(value.asset_name); + contract.setAmount(value.amount); + + return buildTransferContract( + contract, + Transaction.Contract.ContractType.PARTICIPATEASSETISSUECONTRACT, + "ParticipateAssetIssueContract"); + } + + case "UnfreezeBalanceContract": { + + // TODO ADD ENERGY SWITCH + + let contract = new UnfreezeBalanceContract(); + + contract.setOwnerAddress(fromHexString(value.owner_address)); + + return buildTransferContract( + contract, + Transaction.Contract.ContractType.UNFREEZEBALANCECONTRACT, + "UnfreezeBalanceContract"); + } + + case "UnfreezeAssetContract": { + + let contract = new UnfreezeAssetContract(); + + contract.setOwnerAddress(fromHexString(value.owner_address)); + + return buildTransferContract( + contract, + Transaction.Contract.ContractType.UNFREEZEASSETCONTRACT, + "UnfreezeAssetContract"); + } + + } +} From 68ed2c56cbc9e4b8832567da33347fc21fe877e5 Mon Sep 17 00:00:00 2001 From: Roy van Kaathoven Date: Tue, 4 Dec 2018 14:57:13 +0800 Subject: [PATCH 6/9] v0.2.27 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b8e9407..01411d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tronscan/client", - "version": "0.2.26", + "version": "0.2.27", "description": "Tronscan API Client", "main": "src/index.js", "homepage": "https://api.tronscan.org/", From a5f73a2db56f952430455668c867f8bd689dd883 Mon Sep 17 00:00:00 2001 From: Roy van Kaathoven Date: Tue, 4 Dec 2018 16:25:26 +0800 Subject: [PATCH 7/9] v0.2.28 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 01411d3..63cd5b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tronscan/client", - "version": "0.2.27", + "version": "0.2.28", "description": "Tronscan API Client", "main": "src/index.js", "homepage": "https://api.tronscan.org/", From 1952a4c00b486ad9c48a183dbbc1b3117ca13854 Mon Sep 17 00:00:00 2001 From: Roy van Kaathoven Date: Tue, 4 Dec 2018 16:25:32 +0800 Subject: [PATCH 8/9] fix vote value --- src/utils/tronWeb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/tronWeb.js b/src/utils/tronWeb.js index dea4576..bd7d12b 100644 --- a/src/utils/tronWeb.js +++ b/src/utils/tronWeb.js @@ -145,7 +145,7 @@ export function contractJsonToProtobuf(contract) { let contract = new VoteWitnessContract(); contract.setOwnerAddress(fromHexString(value.owner_address)); - for (let address of Object.keys(value.votes)) { + for (let address of value.votes) { let vote = new VoteWitnessContract.Vote(); vote.setVoteAddress(fromHexString(address.vote_address)); vote.setVoteCount(address.vote_count); From f2aea08dc704542d7b221a29a7be7db3a680794f Mon Sep 17 00:00:00 2001 From: Roy van Kaathoven Date: Tue, 4 Dec 2018 22:15:05 +0800 Subject: [PATCH 9/9] v0.2.29 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 63cd5b7..92dcb81 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tronscan/client", - "version": "0.2.28", + "version": "0.2.29", "description": "Tronscan API Client", "main": "src/index.js", "homepage": "https://api.tronscan.org/",